@epam/ai-dial-conversation-input 1.2.0-dev.98 → 1.2.0-dev.99

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
- import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, RequestStatus as i, ResponseFormat as a, SELECT_LIST_MAX_HEIGHT_PX as o, buildCssVars as s, mergeClasses as c, useIsMobile as l } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as ne, TextareaResize as re, Tooltip as M } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as ie, IconArrowNarrowRight as ae, IconCheck as N, IconChevronDown as P, IconChevronRight as oe, IconFile as se, IconMicrophone as ce, IconPaperclip as le, IconPlayerStopFilled as ue, IconPlaystationSquare as de, IconPlus as F, IconSettings as fe, IconTool as pe, IconX as me } from "@tabler/icons-react";
4
- import { createElement as he, memo as ge, useCallback as I, useEffect as L, useImperativeHandle as _e, useLayoutEffect as ve, useMemo as R, useRef as z, useState as B } from "react";
5
- import { createPortal as ye } from "react-dom";
6
- import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
7
- import { AttachmentTray as be, MAX_UPLOADS_PER_MINUTE as xe, generateAttachmentId as Se, useClipboardPaste as Ce } from "@epam/ai-dial-attachment-input";
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 ee, PrimaryIconButton as E, RadioGroup as D, RadioGroupOrientation as O, Search as te, Skeleton as k, SkeletonVariant as ne, Slider as A, Spinner as re, StaticIconButton as ie, Textarea as j, TextareaResize as M, Tooltip as N } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowLeft as P, IconArrowNarrowRight as F, IconCheck as ae, IconChevronDown as oe, IconChevronRight as se, IconFile as ce, IconMicrophone as le, IconPaperclip as ue, IconPlayerStopFilled as I, IconPlaystationSquare as de, IconPlus as fe, IconSettings as pe, IconTool as me, IconX as he } from "@tabler/icons-react";
4
+ import { createElement as ge, memo as _e, useCallback as L, useEffect as R, useImperativeHandle as ve, useLayoutEffect as ye, useMemo as z, useRef as B, useState as V } from "react";
5
+ import { createPortal as be } from "react-dom";
6
+ import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
7
+ import { AttachmentTray as xe, MAX_UPLOADS_PER_MINUTE as Se, generateAttachmentId as G, useClipboardPaste as Ce } from "@epam/ai-dial-attachment-input";
8
8
  //#region src/constants/public-class-names.ts
9
- var W = {
9
+ var K = {
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 W = {
21
21
  modelMenuItem: "dial-ci-model-menu-item",
22
22
  modelMenuItemSelected: "dial-ci-model-menu-item-selected"
23
23
  }, we = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Te = (e, t, n) => {
24
- L(() => {
24
+ R(() => {
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]), L(() => {
30
+ }, [e, t]), R(() => {
31
31
  if (e) return document.body.style.overflow = "hidden", () => {
32
32
  document.body.style.overflow = "";
33
33
  };
34
- }, [e]), L(() => {
34
+ }, [e]), R(() => {
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(we) ?? t).focus();
@@ -55,119 +55,119 @@ var W = {
55
55
  "slide-up": "_slide-up_1d50f_1",
56
56
  title: "_title_1d50f_18",
57
57
  divider: "_divider_1d50f_22"
58
- }, G = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: l, titleClassName: u = "dial-body-semi-text", className: d, colors: h, children: _ }) => {
59
- let y = z(null);
60
- if (Te(e, r, y), !e || typeof document > "u") return null;
61
- let b = s({
62
- "--ci-backdrop": h?.backdrop,
63
- "--ci-sheet-bg": h?.sheetBg,
64
- "--ci-sheet-text": h?.sheetText,
65
- "--ci-sheet-divider": h?.divider
58
+ }, De = ({ 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 _ = B(null);
60
+ if (Te(e, r, _), !e || typeof document > "u") return null;
61
+ let y = c({
62
+ "--ci-backdrop": f?.backdrop,
63
+ "--ci-sheet-bg": f?.sheetBg,
64
+ "--ci-sheet-text": f?.sheetText,
65
+ "--ci-sheet-divider": f?.divider
66
66
  });
67
- return ye(/* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
68
- className: c(Ee.backdrop, "fixed inset-0 z-[55]"),
69
- style: b,
67
+ return be(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
68
+ className: l(Ee.backdrop, "fixed inset-0 z-[55]"),
69
+ style: y,
70
70
  onPointerDown: r,
71
71
  "aria-hidden": !0
72
- }), /* @__PURE__ */ U("div", {
73
- ref: y,
72
+ }), /* @__PURE__ */ W("div", {
73
+ ref: _,
74
74
  role: "dialog",
75
75
  "aria-modal": !0,
76
76
  "aria-label": t ?? o,
77
77
  tabIndex: -1,
78
78
  style: {
79
- ...b,
80
- ...l
79
+ ...y,
80
+ ...s
81
81
  },
82
- className: c(Ee.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
83
- children: [t != null && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
82
+ className: l(Ee.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
83
+ children: [t != null && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("div", {
84
84
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
85
85
  children: [
86
- i && /* @__PURE__ */ H("div", {
86
+ i && /* @__PURE__ */ U("div", {
87
87
  className: "absolute start-4",
88
- children: /* @__PURE__ */ H(v, {
89
- icon: /* @__PURE__ */ H(ie, {
90
- size: p.LG,
91
- stroke: m,
88
+ children: /* @__PURE__ */ U(b, {
89
+ icon: /* @__PURE__ */ U(P, {
90
+ size: h.LG,
91
+ stroke: g,
92
92
  className: "rtl:scale-x-[-1]"
93
93
  }),
94
94
  "aria-label": a,
95
95
  onClick: i
96
96
  })
97
97
  }),
98
- /* @__PURE__ */ H("span", {
99
- className: c(Ee.title, u),
98
+ /* @__PURE__ */ U("span", {
99
+ className: l(Ee.title, u),
100
100
  children: t
101
101
  }),
102
- /* @__PURE__ */ H("div", {
102
+ /* @__PURE__ */ U("div", {
103
103
  className: "absolute end-4 m-2",
104
- children: /* @__PURE__ */ H(f, {
104
+ children: /* @__PURE__ */ U(m, {
105
105
  ariaLabel: n,
106
106
  onClose: r,
107
- size: g.Standard
107
+ size: v.Standard
108
108
  })
109
109
  })
110
110
  ]
111
- }), /* @__PURE__ */ H("div", { className: c(Ee.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ H("div", {
111
+ }), /* @__PURE__ */ U("div", { className: l(Ee.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ U("div", {
112
112
  className: "overflow-y-auto",
113
- children: _
113
+ children: p
114
114
  })]
115
115
  })] }), document.body);
116
- }, De = async (e, t, n) => {
116
+ }, Oe = async (e, t, n) => {
117
117
  let r = 6e4 / t, i = [];
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
- }, Oe = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
121
- let [h, g] = B(n), _ = z(h);
122
- L(() => {
120
+ }, ke = ({ 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] = V(n), _ = B(h);
122
+ R(() => {
123
123
  _.current = h;
124
- }, [h]), L(() => () => {
124
+ }, [h]), R(() => () => {
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 = I((e) => e.map((e) => {
130
- let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
129
+ let v = L((e) => e.map((e) => {
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
- id: Se(),
132
+ id: G(),
133
133
  name: e.name,
134
134
  contentType: e.type,
135
135
  file: e,
136
136
  type: n ? t.Image : r ? t.Audio : t.File,
137
- status: i.Idle,
138
- previewUrl: a,
137
+ status: a.Idle,
138
+ previewUrl: i,
139
139
  playUrl: o
140
140
  };
141
- }), []), y = z(a);
142
- L(() => {
143
- y.current = a;
144
- }, [a]);
145
- let b = z(!0), x = I((e) => {
141
+ }), []), y = B(i);
142
+ R(() => {
143
+ y.current = i;
144
+ }, [i]);
145
+ let b = B(!0), x = L((e) => {
146
146
  g((t) => {
147
147
  let n = e(t);
148
148
  return n === t ? t : n;
149
149
  });
150
150
  }, []);
151
- L(() => {
151
+ R(() => {
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 = I((e) => {
158
+ let S = L((e) => {
159
159
  g(e);
160
- }, []), C = I(async (t) => {
160
+ }, []), C = L(async (t) => {
161
161
  if (r) {
162
162
  x((e) => e.map((e) => e.id === t.id ? {
163
163
  ...e,
164
- status: i.Loading
164
+ status: a.Loading
165
165
  } : e));
166
166
  try {
167
167
  let { url: e, name: n } = await r(t);
168
168
  x((r) => r.map((r) => r.id === t.id ? {
169
169
  ...r,
170
- status: i.Idle,
170
+ status: a.Idle,
171
171
  url: e,
172
172
  name: n
173
173
  } : r));
@@ -175,12 +175,12 @@ var W = {
175
175
  let r = typeof n == "object" && n && "errorReason" in n && Object.values(e).includes(n.errorReason) ? n.errorReason : void 0;
176
176
  x((e) => e.map((e) => e.id === t.id ? {
177
177
  ...e,
178
- status: i.Error,
178
+ status: a.Error,
179
179
  ...r != null && { errorReason: r }
180
180
  } : e));
181
181
  }
182
182
  }
183
- }, [r, x]), w = I((e, t = !0) => {
183
+ }, [r, x]), w = L((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)) {
@@ -198,10 +198,10 @@ var W = {
198
198
  let n = o?.(t);
199
199
  n == null ? e.push(t) : x((e) => e.map((e) => e.id === t.id ? {
200
200
  ...e,
201
- status: i.Error,
201
+ status: a.Error,
202
202
  errorReason: n
203
203
  } : e));
204
- }), De(e, xe, C);
204
+ }), Oe(e, Se, C);
205
205
  }
206
206
  }
207
207
  }, [
@@ -212,34 +212,34 @@ var W = {
212
212
  C,
213
213
  o
214
214
  ]);
215
- L(() => {
215
+ R(() => {
216
216
  s.length !== 0 && (w(v(s)), c?.());
217
217
  }, [
218
218
  w,
219
219
  v,
220
220
  c,
221
221
  s
222
- ]), L(() => {
222
+ ]), R(() => {
223
223
  l.length !== 0 && (w(l, !1), u?.());
224
224
  }, [
225
225
  w,
226
226
  u,
227
227
  l
228
- ]), L(() => {
228
+ ]), R(() => {
229
229
  if (!o) return;
230
230
  let t = !1, n = [], r = _.current.map((r) => {
231
- if (r.status === i.Loading) return r;
232
- let a = o(r);
233
- if (a != null) return r.status === i.Error && r.errorReason === a ? r : (t = !0, {
231
+ if (r.status === a.Loading) return r;
232
+ let i = o(r);
233
+ if (i != null) return r.status === a.Error && r.errorReason === i ? r : (t = !0, {
234
234
  ...r,
235
- status: i.Error,
236
- errorReason: a
235
+ status: a.Error,
236
+ errorReason: i
237
237
  });
238
238
  if (r.errorReason === e.UnsupportedType || r.errorReason === e.FileTooLarge) {
239
239
  t = !0;
240
240
  let e = {
241
241
  ...r,
242
- status: i.Idle,
242
+ status: a.Idle,
243
243
  errorReason: void 0
244
244
  };
245
245
  return e.url ?? n.push(e), e;
@@ -252,7 +252,7 @@ var W = {
252
252
  x,
253
253
  C
254
254
  ]);
255
- let T = I((e) => {
255
+ let T = L((e) => {
256
256
  x((t) => {
257
257
  let n = t.find((t) => t.id === e);
258
258
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
@@ -264,11 +264,11 @@ var W = {
264
264
  addAttachments: w,
265
265
  resetAttachments: S,
266
266
  handleRemove: T,
267
- handleRetry: I((e) => {
267
+ handleRetry: L((e) => {
268
268
  let t = h.find((t) => t.id === e);
269
269
  t && C(t);
270
270
  }, [h, C]),
271
- handleExpand: I(async (e) => {
271
+ handleExpand: L(async (e) => {
272
272
  let n = h.find((t) => t.id === e);
273
273
  if (!n || n.type !== t.Pasted) return;
274
274
  let r = await n.file.text();
@@ -278,48 +278,48 @@ var W = {
278
278
  T,
279
279
  d
280
280
  ]),
281
- hasBlockedAttachments: h.some((e) => e.status === i.Loading || e.status === i.Error)
281
+ hasBlockedAttachments: h.some((e) => e.status === a.Loading || e.status === a.Error)
282
282
  };
283
- }, ke = (e, t) => {
283
+ }, Ae = (e, t) => {
284
284
  if (!e.startsWith(t)) return !1;
285
285
  let n = e.slice(t.length);
286
286
  return !/\s/.test(n) && !n.includes(t);
287
- }, Ae = ({ config: e, message: t }) => {
288
- let [n, r] = B(!1), [i, a] = B(!1), o = e != null && ke(t, e.triggerPrefix) ? t.slice(e.triggerPrefix.length) : "", s = I((n, a, o) => {
287
+ }, je = ({ config: e, message: t }) => {
288
+ let [n, r] = V(!1), [i, a] = V(!1), o = e != null && Ae(t, e.triggerPrefix) ? t.slice(e.triggerPrefix.length) : "", s = L((n, a, o) => {
289
289
  if (e == null || a || t !== "" || i) return;
290
- let s = n === e.triggerPrefix, c = o === "insertFromPaste" && ke(n, e.triggerPrefix);
290
+ let s = n === e.triggerPrefix, c = o === "insertFromPaste" && Ae(n, e.triggerPrefix);
291
291
  (s || c) && r(!0);
292
292
  }, [
293
293
  e,
294
294
  t,
295
295
  i
296
296
  ]);
297
- return L(() => {
297
+ return R(() => {
298
298
  if (e == null) {
299
299
  r(!1), a(!1);
300
300
  return;
301
301
  }
302
- ke(t, e.triggerPrefix) || (r(!1), a(!1));
302
+ Ae(t, e.triggerPrefix) || (r(!1), a(!1));
303
303
  }, [e, t]), {
304
304
  isMenuOpen: n,
305
305
  query: o,
306
- dismiss: I(() => {
306
+ dismiss: L(() => {
307
307
  r(!1), a(!0);
308
308
  }, []),
309
309
  handleValueChange: s
310
310
  };
311
- }, je = (e, t) => !e.slice(0, t).includes("\n"), Me = (e, t) => !e.slice(t).includes("\n"), Ne = (e) => {
312
- let t = z(e);
311
+ }, Me = (e, t) => !e.slice(0, t).includes("\n"), Ne = (e, t) => !e.slice(t).includes("\n"), Pe = (e) => {
312
+ let t = B(e);
313
313
  t.current = e;
314
- let n = z(-1), r = z(""), i = I((e, i, a) => {
314
+ let n = B(-1), r = B(""), i = L((e, i, a) => {
315
315
  let o = t.current;
316
- return !o || o.length === 0 ? null : e === "up" ? !je(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 || !Me(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
317
- }, []), a = I(() => {
316
+ return !o || o.length === 0 ? null : e === "up" ? !Me(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 || !Ne(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
317
+ }, []), a = L(() => {
318
318
  n.current = -1, r.current = "";
319
- }, []), o = I(() => {
319
+ }, []), o = L(() => {
320
320
  n.current = -1, r.current = "";
321
321
  }, []);
322
- return R(() => ({
322
+ return z(() => ({
323
323
  navigate: i,
324
324
  notifyChange: a,
325
325
  reset: o
@@ -328,23 +328,23 @@ var W = {
328
328
  a,
329
329
  o
330
330
  ]);
331
- }, Pe = ({ messageProp: e, messageRevision: t }) => {
332
- let [n, r] = B(e), i = z(null);
333
- return L(() => {
331
+ }, Fe = ({ messageProp: e, messageRevision: t }) => {
332
+ let [n, r] = V(e), i = B(null);
333
+ return R(() => {
334
334
  r(e);
335
335
  }, [e, t]), {
336
336
  message: n,
337
337
  setMessage: r,
338
338
  textareaRef: i
339
339
  };
340
- }, Fe = (e, t, n, r = n) => {
340
+ }, Ie = (e, t, n, r = n) => {
341
341
  let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
342
342
  i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
343
- }, Ie = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Le = ({ insertion: e, textareaRef: t }) => {
344
- let n = e?.revision, r = z(e?.text);
343
+ }, Le = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Re = ({ insertion: e, textareaRef: t }) => {
344
+ let n = e?.revision, r = B(e?.text);
345
345
  r.current = e?.text;
346
- let i = z(n), a = z(null);
347
- return L(() => {
346
+ let i = B(n), a = B(null);
347
+ return R(() => {
348
348
  if (n === i.current) return;
349
349
  i.current = n;
350
350
  let e = r.current;
@@ -354,7 +354,7 @@ var W = {
354
354
  let { value: r, selectionStart: i, selectionEnd: o } = n, s = i ?? r.length, c = o ?? s;
355
355
  if (n.focus(), a.current = null, typeof document.execCommand == "function" && document.execCommand("insertText", !1, e)) return;
356
356
  let l = `${r.slice(0, s)}${e}${r.slice(c)}`;
357
- Fe(n, l, s + e.length), a.current = {
357
+ Ie(n, l, s + e.length), a.current = {
358
358
  insertedValue: l,
359
359
  previousValue: r,
360
360
  previousSelectionStart: s,
@@ -363,155 +363,155 @@ var W = {
363
363
  });
364
364
  }, [n, t]), { handleUndoKeyDown: (e) => {
365
365
  let n = a.current, r = t.current;
366
- return n == null || r == null || !Ie(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), Fe(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
366
+ return n == null || r == null || !Le(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), Ie(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
367
367
  } };
368
- }, Re = /* @__PURE__ */ function(e) {
368
+ }, ze = /* @__PURE__ */ function(e) {
369
369
  return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
370
- }({}), ze = /* @__PURE__ */ function(e) {
370
+ }({}), Be = /* @__PURE__ */ function(e) {
371
371
  return e.Dictation = "dictation", e.Attachment = "attachment", e;
372
- }({}), Be = [
372
+ }({}), Ve = [
373
373
  "audio/webm;codecs=opus",
374
374
  "audio/ogg;codecs=opus",
375
375
  "audio/webm"
376
- ], Ve = 100, He = 100, Ue = .01, We = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: r = "Voice input failed" }) => {
377
- let [i, a] = B("idle"), [o, s] = B(null), c = z(null), l = z(null), u = z({
376
+ ], He = 100, Ue = 100, We = .01, Ge = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
377
+ let [a, o] = V("idle"), [s, c] = V(null), l = B(null), d = B(null), f = B({
378
378
  onAttachAudio: e,
379
379
  onTranscribeAudio: t,
380
380
  onTranscript: n,
381
- errorLabel: r
381
+ errorLabel: i
382
382
  });
383
- u.current = {
383
+ f.current = {
384
384
  onAttachAudio: e,
385
385
  onTranscribeAudio: t,
386
386
  onTranscript: n,
387
- errorLabel: r
387
+ errorLabel: i
388
388
  };
389
- let d = I((e = "dictation") => {
390
- if (l.current) return;
389
+ let p = L((e = "dictation") => {
390
+ if (d.current) return;
391
391
  let t = { controller: new AbortController() };
392
- l.current = t, s(null), a("recording");
393
- let { signal: n } = t.controller, r = e === "dictation" ? u.current.onTranscribeAudio : void 0, i, o, d, f, p = !1, m = !1, h = [], g = () => {
394
- clearInterval(f), f = void 0;
395
- }, _ = () => {
396
- g(), d &&= (d.ondataavailable = null, d.onstop = null, d.onerror = null, d.state !== "inactive" && d.stop(), void 0), i?.getTracks().forEach((e) => e.stop()), i = void 0, o &&= (o.close(), void 0), l.current === t && (c.current = null);
392
+ d.current = t, c(null), o("recording");
393
+ let { signal: n } = t.controller, i = e === "dictation" ? f.current.onTranscribeAudio : void 0, a, s, p, m, h = !1, g = !1, _ = [], v = () => {
394
+ clearInterval(m), m = void 0;
395
+ }, y = () => {
396
+ v(), p &&= (p.ondataavailable = null, p.onstop = null, p.onerror = null, p.state !== "inactive" && p.stop(), void 0), a?.getTracks().forEach((e) => e.stop()), a = void 0, s &&= (s.close(), void 0), d.current === t && (l.current = null);
397
397
  };
398
398
  n.addEventListener("abort", () => {
399
- h.length = 0, _();
399
+ _.length = 0, y();
400
400
  }, { once: !0 });
401
- let v = () => {
402
- n.aborted || (_(), l.current = null, s(null), a("idle"));
403
- }, y = (e) => {
404
- n.aborted || (t.controller.abort(), l.current = null, s(e instanceof Error ? e.message : u.current.errorLabel), a("error"));
405
- }, b = () => {
406
- if (!i || n.aborted) return;
407
- let e = Be.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(i, e ? { mimeType: e } : void 0);
408
- d = t;
409
- let o = Date.now(), s = !1, l = !1, b = new Uint8Array(c.current?.fftSize ?? 256), x = async () => {
410
- if (!(m || n.aborted)) {
411
- m = !0, p = !0;
401
+ let b = () => {
402
+ n.aborted || (y(), d.current = null, c(null), o("idle"));
403
+ }, x = (e) => {
404
+ n.aborted || (t.controller.abort(), d.current = null, c(e instanceof Error ? e.message : f.current.errorLabel), o("error"));
405
+ }, S = () => {
406
+ if (!a || n.aborted) return;
407
+ let e = Ve.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
408
+ p = t;
409
+ let s = Date.now(), c = !1, d = !1, S = new Uint8Array(l.current?.fftSize ?? 256), C = async () => {
410
+ if (!(g || n.aborted)) {
411
+ g = !0, h = !0;
412
412
  try {
413
- let i = t.mimeType || e || "audio/webm", c = new Blob(h, { type: i });
414
- h.length = 0, _();
415
- let d = Date.now() - o >= He;
416
- if (c.size && (!r || d && (!s || l))) {
417
- let e = i.split(";")[0].split("/")[1] ?? "webm", t = new File([c], "voice-" + crypto.randomUUID() + "." + e, { type: i });
418
- if (r) {
419
- a("processing");
420
- let e = await r(t, n);
413
+ let a = t.mimeType || e || "audio/webm", l = new Blob(_, { type: a });
414
+ _.length = 0, y();
415
+ let p = Date.now() - s >= Ue;
416
+ if (l.size && (!i || p && (!c || d))) {
417
+ let e = u(a), t = r[e] ?? e.split("/")[1] ?? "webm", s = new File([l], "voice-" + crypto.randomUUID() + "." + t, { type: a });
418
+ if (i) {
419
+ o("processing");
420
+ let e = await i(s, n);
421
421
  if (n.aborted) return;
422
- u.current.onTranscript?.(e);
423
- } else u.current.onAttachAudio(t);
424
- } else r && u.current.onTranscript?.("");
425
- v();
422
+ f.current.onTranscript?.(e);
423
+ } else f.current.onAttachAudio(s);
424
+ } else i && f.current.onTranscript?.("");
425
+ b();
426
426
  } catch (e) {
427
- y(e);
427
+ x(e);
428
428
  }
429
429
  }
430
430
  };
431
431
  t.ondataavailable = (e) => {
432
- e.data.size && h.push(e.data);
433
- }, t.onerror = () => y(Error(u.current.errorLabel)), t.onstop = () => {
434
- x();
435
- }, t.start(), r && (f = setInterval(() => {
436
- let e = c.current;
432
+ e.data.size && _.push(e.data);
433
+ }, t.onerror = () => x(Error(f.current.errorLabel)), t.onstop = () => {
434
+ C();
435
+ }, t.start(), i && (m = setInterval(() => {
436
+ let e = l.current;
437
437
  if (!e) return;
438
- e.getByteTimeDomainData(b), s = !0;
438
+ e.getByteTimeDomainData(S), c = !0;
439
439
  let t = 0;
440
- for (let e of b) t += ((e - 128) / 128) ** 2;
441
- Math.sqrt(t / b.length) >= Ue && (l = !0, g());
442
- }, Ve));
440
+ for (let e of S) t += ((e - 128) / 128) ** 2;
441
+ Math.sqrt(t / S.length) >= We && (d = !0, v());
442
+ }, He));
443
443
  };
444
444
  t.stop = () => {
445
- p || n.aborted || (p = !0, g(), a("processing"), d?.state === "recording" && d.stop());
445
+ h || n.aborted || (h = !0, v(), o("processing"), p?.state === "recording" && p.stop());
446
446
  }, (async () => {
447
447
  try {
448
448
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
449
- if (n.aborted || p) {
450
- e.getTracks().forEach((e) => e.stop()), v();
449
+ if (n.aborted || h) {
450
+ e.getTracks().forEach((e) => e.stop()), b();
451
451
  return;
452
452
  }
453
- i = e, o = new AudioContext();
454
- let t = o.createAnalyser();
455
- t.fftSize = 256, c.current = t, o.createMediaStreamSource(i).connect(t), b(), a("recording");
453
+ a = e, s = new AudioContext();
454
+ let t = s.createAnalyser();
455
+ t.fftSize = 256, l.current = t, s.createMediaStreamSource(a).connect(t), S(), o("recording");
456
456
  } catch (e) {
457
- y(e);
457
+ x(e);
458
458
  }
459
459
  })();
460
- }, []), f = I(() => l.current?.stop?.(), []), p = I(() => {
461
- l.current?.controller.abort(), l.current = null, s(null), a("idle");
460
+ }, []), m = L(() => d.current?.stop?.(), []), h = L(() => {
461
+ d.current?.controller.abort(), d.current = null, c(null), o("idle");
462
462
  }, []);
463
- return L(() => () => {
464
- l.current?.controller.abort(), l.current = null;
463
+ return R(() => () => {
464
+ d.current?.controller.abort(), d.current = null;
465
465
  }, []), {
466
- state: i,
467
- analyserNodeRef: c,
468
- errorMessage: o,
469
- startRecording: d,
470
- stopRecording: f,
471
- discardRecording: p
466
+ state: a,
467
+ analyserNodeRef: l,
468
+ errorMessage: s,
469
+ startRecording: p,
470
+ stopRecording: m,
471
+ discardRecording: h
472
472
  };
473
- }, Ge = /* @__PURE__ */ function(e) {
473
+ }, Ke = /* @__PURE__ */ function(e) {
474
474
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
475
- }({}), Ke = /* @__PURE__ */ function(e) {
475
+ }({}), qe = /* @__PURE__ */ function(e) {
476
476
  return e.Stacked = "stacked", e.Inline = "inline", e;
477
- }({}), qe = {
477
+ }({}), Je = {
478
478
  item: "_item_1sr2n_1",
479
479
  itemIcon: "_itemIcon_1sr2n_11"
480
- }, Je = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: l = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
480
+ }, Ye = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "", colors: f }) => {
481
481
  let m = (e) => {
482
482
  e(), r();
483
- }, h = s({
484
- "--ci-sheet-text": p?.itemText,
485
- "--ci-sheet-item-hover": p?.itemHoverBg,
486
- "--ci-sheet-item-active": p?.itemActiveBg,
487
- "--ci-sheet-icon": p?.itemIcon
483
+ }, h = c({
484
+ "--ci-sheet-text": f?.itemText,
485
+ "--ci-sheet-item-hover": f?.itemHoverBg,
486
+ "--ci-sheet-item-active": f?.itemActiveBg,
487
+ "--ci-sheet-icon": f?.itemIcon
488
488
  });
489
- return /* @__PURE__ */ H(G, {
489
+ return /* @__PURE__ */ U(De, {
490
490
  isOpen: e,
491
491
  title: t,
492
492
  closeLabel: n,
493
493
  onClose: r,
494
494
  style: i,
495
495
  className: o,
496
- titleClassName: l,
497
- colors: p?.shell,
498
- children: /* @__PURE__ */ H("ul", {
496
+ titleClassName: s,
497
+ colors: f?.shell,
498
+ children: /* @__PURE__ */ U("ul", {
499
499
  role: "list",
500
500
  className: "flex flex-col",
501
501
  style: h,
502
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(d, {
502
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U(p, {
503
503
  type: "button",
504
- className: c(qe.item, "w-full gap-3 px-4 py-[10px] text-start"),
505
- iconBefore: /* @__PURE__ */ H("span", {
506
- className: qe.itemIcon,
504
+ className: l(Je.item, "w-full gap-3 px-4 py-[10px] text-start"),
505
+ iconBefore: /* @__PURE__ */ U("span", {
506
+ className: Je.itemIcon,
507
507
  children: n
508
508
  }),
509
- iconAfter: r ? /* @__PURE__ */ H("span", {
509
+ iconAfter: r ? /* @__PURE__ */ U("span", {
510
510
  className: "ms-auto",
511
511
  children: r
512
512
  }) : null,
513
- textClassName: f,
514
- label: /* @__PURE__ */ H("span", {
513
+ textClassName: d,
514
+ label: /* @__PURE__ */ U("span", {
515
515
  className: u,
516
516
  children: t
517
517
  }),
@@ -519,9 +519,9 @@ var W = {
519
519
  }) }, e))
520
520
  })
521
521
  });
522
- }, Ye = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
523
- let [s, c] = B(t), [l, u] = B(n), [d, f] = B(r), p = z(o);
524
- L(() => {
522
+ }, Xe = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
523
+ let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
524
+ R(() => {
525
525
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
526
526
  }, [
527
527
  o,
@@ -538,7 +538,7 @@ var W = {
538
538
  setResponseFormat: c,
539
539
  setSystemPrompt: u,
540
540
  setTemperature: f,
541
- handleSubmit: I(() => {
541
+ handleSubmit: L(() => {
542
542
  if (!m) return;
543
543
  let t = {};
544
544
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -552,17 +552,17 @@ var W = {
552
552
  a
553
553
  ])
554
554
  };
555
- }, Xe = { label: "_label_14i7c_1" }, Ze = ({ features: e, responseFormat: t, systemPrompt: n, temperature: i, onResponseFormatChange: o, onSystemPromptChange: l, 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 = [
555
+ }, Ze = { label: "_label_14i7c_1" }, Qe = ({ 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 = [
556
556
  "Precise",
557
557
  "Neutral",
558
558
  "Creative"
559
559
  ], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
560
- let S = s({ "--csf-label-text": x?.labelText }), C = c(b, Xe.label, "gap-1");
561
- return /* @__PURE__ */ U("div", {
560
+ let S = c({ "--csf-label-text": x?.labelText }), C = l(b, Ze.label, "gap-1");
561
+ return /* @__PURE__ */ W("div", {
562
562
  className: "flex flex-col gap-4 px-6 pb-3",
563
563
  style: S,
564
564
  children: [
565
- e.responseFormat && /* @__PURE__ */ H(E, {
565
+ e.responseFormat && /* @__PURE__ */ U(D, {
566
566
  id: "response-format",
567
567
  labelProps: {
568
568
  label: d,
@@ -570,35 +570,35 @@ var W = {
570
570
  caption: f
571
571
  },
572
572
  optionsClassName: "mb-2",
573
- orientation: D.Column,
574
- value: t ?? a.Markdown,
573
+ orientation: O.Column,
574
+ value: t ?? o.Markdown,
575
575
  items: [{
576
- value: a.Markdown,
576
+ value: o.Markdown,
577
577
  label: p
578
578
  }, {
579
- value: a.PlainText,
579
+ value: o.PlainText,
580
580
  label: m
581
581
  }],
582
- onChange: (e) => o(e)
582
+ onChange: (e) => a(e)
583
583
  }),
584
- e.systemPrompt && /* @__PURE__ */ H(ne, {
584
+ e.systemPrompt && /* @__PURE__ */ U(j, {
585
585
  value: n,
586
586
  placeholder: g,
587
- className: r,
588
- resize: re.Vertical,
587
+ className: i,
588
+ resize: M.Vertical,
589
589
  labelProps: {
590
590
  className: C,
591
591
  label: h
592
592
  },
593
- onChange: (e) => l(e ?? "")
593
+ onChange: (e) => s(e ?? "")
594
594
  }),
595
- e.temperature && /* @__PURE__ */ H(A, {
595
+ e.temperature && /* @__PURE__ */ U(A, {
596
596
  labelProps: {
597
597
  label: _,
598
598
  className: C,
599
599
  caption: y
600
600
  },
601
- value: i,
601
+ value: r,
602
602
  min: 0,
603
603
  max: 1,
604
604
  step: .1,
@@ -608,17 +608,17 @@ var W = {
608
608
  })
609
609
  ]
610
610
  });
611
- }, Qe = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: l, 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 }) => {
612
- let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: A, handleSubmit: te } = Ye({
611
+ }, $e = ({ 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 }) => {
612
+ let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: te, setTemperature: k, handleSubmit: ne } = Xe({
613
613
  isOpen: e,
614
614
  features: o,
615
615
  initialResponseFormat: s,
616
- initialSystemPrompt: l,
616
+ initialSystemPrompt: c,
617
617
  initialTemperature: u,
618
618
  onSave: d,
619
619
  onClose: r
620
620
  });
621
- return /* @__PURE__ */ U(G, {
621
+ return /* @__PURE__ */ W(De, {
622
622
  isOpen: e,
623
623
  title: f,
624
624
  closeLabel: i,
@@ -626,14 +626,14 @@ var W = {
626
626
  onBack: t,
627
627
  backLabel: n,
628
628
  style: a,
629
- children: [/* @__PURE__ */ H(Ze, {
629
+ children: [/* @__PURE__ */ U(Qe, {
630
630
  features: o,
631
- responseFormat: T,
632
- systemPrompt: E,
633
- temperature: D,
634
- onResponseFormatChange: k,
635
- onSystemPromptChange: ee,
636
- onTemperatureChange: A,
631
+ responseFormat: w,
632
+ systemPrompt: T,
633
+ temperature: E,
634
+ onResponseFormatChange: O,
635
+ onSystemPromptChange: te,
636
+ onTemperatureChange: k,
637
637
  responseFormatLabel: p,
638
638
  responseFormatHint: m,
639
639
  responseFormatMarkdownLabel: h,
@@ -643,23 +643,23 @@ var W = {
643
643
  temperatureLabel: y,
644
644
  temperatureLabels: b,
645
645
  temperatureHint: x
646
- }), /* @__PURE__ */ H("div", {
647
- className: c("px-6 py-4 mobile:pb-8"),
648
- children: /* @__PURE__ */ H(M, {
646
+ }), /* @__PURE__ */ U("div", {
647
+ className: l("px-6 py-4 mobile:pb-8"),
648
+ children: /* @__PURE__ */ U(N, {
649
649
  tooltip: C,
650
- hideTooltip: O || !C,
650
+ hideTooltip: D || !C,
651
651
  triggerClassName: "w-full",
652
- children: /* @__PURE__ */ H(w, {
652
+ children: /* @__PURE__ */ U(ee, {
653
653
  label: S,
654
- onClick: te,
655
- disabled: !O,
654
+ onClick: ne,
655
+ disabled: !D,
656
656
  className: "w-full"
657
657
  })
658
658
  })
659
659
  })]
660
660
  });
661
- }, $e = { modal: "_modal_kl0h0_1" }, et = ({ 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 = $e.modal }) => {
662
- let { responseFormat: b, systemPrompt: x, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = Ye({
661
+ }, q = { modal: "_modal_kl0h0_1" }, et = ({ 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 = q.modal }) => {
662
+ let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: E, setSystemPrompt: D, setTemperature: O, handleSubmit: te } = Xe({
663
663
  features: e,
664
664
  initialResponseFormat: t,
665
665
  initialSystemPrompt: n,
@@ -667,33 +667,33 @@ var W = {
667
667
  onSave: i,
668
668
  onClose: a
669
669
  });
670
- return /* @__PURE__ */ H(S, {
670
+ return /* @__PURE__ */ U(w, {
671
671
  open: !0,
672
672
  header: o,
673
673
  titleClassName: s,
674
- size: C.Sm,
674
+ size: T.Sm,
675
675
  onClose: a,
676
676
  className: y,
677
- footer: /* @__PURE__ */ H("div", {
677
+ footer: /* @__PURE__ */ U("div", {
678
678
  className: "flex justify-end px-6 py-4",
679
- children: /* @__PURE__ */ H(M, {
679
+ children: /* @__PURE__ */ U(N, {
680
680
  tooltip: v,
681
- hideTooltip: E || !v,
682
- children: /* @__PURE__ */ H(w, {
681
+ hideTooltip: C || !v,
682
+ children: /* @__PURE__ */ U(ee, {
683
683
  label: _,
684
- onClick: ee,
685
- disabled: !E
684
+ onClick: te,
685
+ disabled: !C
686
686
  })
687
687
  })
688
688
  }),
689
- children: /* @__PURE__ */ H(Ze, {
689
+ children: /* @__PURE__ */ U(Qe, {
690
690
  features: e,
691
691
  responseFormat: b,
692
692
  systemPrompt: x,
693
- temperature: T,
694
- onResponseFormatChange: D,
695
- onSystemPromptChange: O,
696
- onTemperatureChange: k,
693
+ temperature: S,
694
+ onResponseFormatChange: E,
695
+ onSystemPromptChange: D,
696
+ onTemperatureChange: O,
697
697
  responseFormatLabel: c,
698
698
  responseFormatHint: l,
699
699
  responseFormatMarkdownLabel: u,
@@ -705,10 +705,10 @@ var W = {
705
705
  temperatureHint: g
706
706
  })
707
707
  });
708
- }, K = {
708
+ }, tt = {
709
709
  icon: "_icon_1fv6z_1",
710
710
  selectedIcon: "_selectedIcon_1fv6z_5"
711
- }, tt = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: l, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: h }) => /* @__PURE__ */ H(G, {
711
+ }, nt = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: m }) => /* @__PURE__ */ U(De, {
712
712
  isOpen: e,
713
713
  title: o,
714
714
  closeLabel: i,
@@ -716,281 +716,281 @@ var W = {
716
716
  onBack: t,
717
717
  backLabel: n,
718
718
  style: a,
719
- children: /* @__PURE__ */ H("ul", {
719
+ children: /* @__PURE__ */ U("ul", {
720
720
  role: "menu",
721
721
  className: "flex flex-col pb-4",
722
- style: s({
723
- "--tbs-icon-text": h?.iconText,
724
- "--tbs-selected-icon-text": h?.selectedIconText
722
+ style: c({
723
+ "--tbs-icon-text": m?.iconText,
724
+ "--tbs-selected-icon-text": m?.selectedIconText
725
725
  }),
726
- children: l.map((e) => /* @__PURE__ */ H("li", {
726
+ children: s.map((e) => /* @__PURE__ */ U("li", {
727
727
  role: "none",
728
- children: /* @__PURE__ */ H(d, {
728
+ children: /* @__PURE__ */ U(p, {
729
729
  type: "button",
730
730
  role: "menuitemcheckbox",
731
731
  "aria-checked": e.isSelected,
732
732
  className: "w-full gap-3 px-4 py-[10px] text-start",
733
- iconBefore: /* @__PURE__ */ H("span", {
734
- className: c("flex items-center", K.icon),
733
+ iconBefore: /* @__PURE__ */ U("span", {
734
+ className: l("flex items-center", tt.icon),
735
735
  children: e.icon
736
736
  }),
737
- iconAfter: e.isSelected ? /* @__PURE__ */ H("span", {
738
- className: c("ms-auto", K.selectedIcon),
739
- children: /* @__PURE__ */ H(N, {
740
- size: u,
737
+ iconAfter: e.isSelected ? /* @__PURE__ */ U("span", {
738
+ className: l("ms-auto", tt.selectedIcon),
739
+ children: /* @__PURE__ */ U(ae, {
740
+ size: f,
741
741
  "aria-hidden": !0,
742
- stroke: m
742
+ stroke: g
743
743
  })
744
744
  }) : null,
745
- label: /* @__PURE__ */ H("span", {
746
- className: p,
745
+ label: /* @__PURE__ */ U("span", {
746
+ className: d,
747
747
  children: e.label
748
748
  }),
749
- onClick: () => f(e.id)
749
+ onClick: () => u(e.id)
750
750
  })
751
751
  }, e.id))
752
752
  })
753
- }), nt = {
753
+ }), rt = {
754
754
  toolIcon: "_toolIcon_ma5s5_1",
755
755
  chevronIcon: "_chevronIcon_ma5s5_5"
756
- }, rt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: o, menuCloseLabel: d, style: f, listClassName: _ = "w-[240px]", isDisabled: y = !1, chatSettings: x, extraMenuItems: S, toolsMenuItems: C = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, colors: O }) => {
757
- let k = l(), [ee, A] = B(!1), [te, j] = B(!1), [ne, re] = B(!1), [M, ie] = B(null), [ae, N] = B(!1), P = R(() => s({
758
- "--aab-tool-icon": O?.toolIcon,
759
- "--aab-chevron-icon": O?.chevronIcon
760
- }), [O?.toolIcon, O?.chevronIcon]), se = C.length > 0 && w != null, ue = D != null && D.length > 0, de = R(() => C.map((e) => ({
756
+ }, it = ({ 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: ee = "Back", menuOverlays: E, colors: D }) => {
757
+ let O = d(), [te, k] = V(!1), [ne, A] = V(!1), [re, ie] = V(!1), [j, M] = V(null), [N, P] = V(!1), F = z(() => c({
758
+ "--aab-tool-icon": D?.toolIcon,
759
+ "--aab-chevron-icon": D?.chevronIcon
760
+ }), [D?.toolIcon, D?.chevronIcon]), ae = C.length > 0 && w != null, oe = E != null && E.length > 0, ce = z(() => C.map((e) => ({
761
761
  key: e.id,
762
762
  label: e.label,
763
- icon: /* @__PURE__ */ H("span", {
764
- style: P,
765
- className: c("flex items-center", nt.toolIcon),
763
+ icon: /* @__PURE__ */ U("span", {
764
+ style: F,
765
+ className: l("flex items-center", rt.toolIcon),
766
766
  children: e.icon
767
767
  }),
768
768
  selectable: !0,
769
- mark: b.Check,
769
+ mark: S.Check,
770
770
  checked: e.isSelected,
771
771
  onClick: () => w?.(e.id)
772
772
  })), [
773
773
  C,
774
774
  w,
775
- P
776
- ]), me = R(() => [
775
+ F
776
+ ]), I = z(() => [
777
777
  ...e == null ? [] : [{
778
778
  key: "attach",
779
779
  label: r,
780
- icon: /* @__PURE__ */ H(le, {
781
- size: u,
780
+ icon: /* @__PURE__ */ U(ue, {
781
+ size: f,
782
782
  "aria-hidden": !0,
783
- stroke: m
783
+ stroke: g
784
784
  }),
785
785
  onClick: e
786
786
  }],
787
- ...S ?? [],
788
- ...se ? [{
787
+ ...x ?? [],
788
+ ...ae ? [{
789
789
  key: "tools",
790
790
  label: T,
791
- icon: /* @__PURE__ */ H(pe, {
792
- size: u,
791
+ icon: /* @__PURE__ */ U(me, {
792
+ size: f,
793
793
  "aria-hidden": !0,
794
- stroke: m
794
+ stroke: g
795
795
  }),
796
- onClick: k ? () => {
797
- re(!0), A(!1);
796
+ onClick: O ? () => {
797
+ ie(!0), k(!1);
798
798
  } : () => void 0,
799
- ...k ? { iconAfter: /* @__PURE__ */ H(oe, {
800
- size: u,
801
- stroke: m,
802
- style: P,
803
- className: c("rtl:scale-x-[-1]", nt.chevronIcon),
799
+ ...O ? { iconAfter: /* @__PURE__ */ U(se, {
800
+ size: f,
801
+ stroke: g,
802
+ style: F,
803
+ className: l("rtl:scale-x-[-1]", rt.chevronIcon),
804
804
  "aria-hidden": !0
805
- }) } : { children: de }
805
+ }) } : { children: ce }
806
806
  }] : [],
807
- ...(D ?? []).map((e) => ({
807
+ ...(E ?? []).map((e) => ({
808
808
  key: e.key,
809
809
  label: e.title,
810
810
  icon: e.icon,
811
- onClick: k ? () => {
812
- ie(e.key), A(!1);
811
+ onClick: O ? () => {
812
+ M(e.key), k(!1);
813
813
  } : () => void 0,
814
- ...k ? { iconAfter: /* @__PURE__ */ H(oe, {
815
- size: u,
816
- stroke: m,
817
- style: P,
818
- className: c("rtl:scale-x-[-1]", nt.chevronIcon),
814
+ ...O ? { iconAfter: /* @__PURE__ */ U(se, {
815
+ size: f,
816
+ stroke: g,
817
+ style: F,
818
+ className: l("rtl:scale-x-[-1]", rt.chevronIcon),
819
819
  "aria-hidden": !0
820
820
  }) } : {
821
821
  children: [{
822
822
  key: `${e.key}-panel`,
823
823
  label: ""
824
824
  }],
825
- renderSubMenu: () => e.renderOverlay(() => N(!1))
825
+ renderSubMenu: () => e.renderOverlay(() => P(!1))
826
826
  }
827
827
  })),
828
828
  ...t == null ? [] : [{
829
829
  key: "record-voice",
830
830
  label: n,
831
- icon: /* @__PURE__ */ H(ce, {
832
- size: u,
831
+ icon: /* @__PURE__ */ U(le, {
832
+ size: f,
833
833
  "aria-hidden": !0,
834
- stroke: m
834
+ stroke: g
835
835
  }),
836
836
  onClick: () => {
837
- A(!1), N(!1), t();
837
+ k(!1), P(!1), t();
838
838
  }
839
839
  }],
840
- ...x == null ? [] : [{
840
+ ...y == null ? [] : [{
841
841
  key: "chat-settings",
842
- label: x.menuItemLabel ?? "Chat settings",
843
- icon: /* @__PURE__ */ H(fe, {
844
- size: u,
842
+ label: y.menuItemLabel ?? "Chat settings",
843
+ icon: /* @__PURE__ */ U(pe, {
844
+ size: f,
845
845
  "aria-hidden": !0,
846
- stroke: m
846
+ stroke: g
847
847
  }),
848
- iconAfter: k ? /* @__PURE__ */ H(oe, {
849
- size: u,
850
- stroke: m,
851
- style: P,
852
- className: c("rtl:scale-x-[-1]", nt.chevronIcon),
848
+ iconAfter: O ? /* @__PURE__ */ U(se, {
849
+ size: f,
850
+ stroke: g,
851
+ style: F,
852
+ className: l("rtl:scale-x-[-1]", rt.chevronIcon),
853
853
  "aria-hidden": !0
854
854
  }) : null,
855
- onClick: () => j(!0)
855
+ onClick: () => A(!0)
856
856
  }]
857
857
  ], [
858
858
  r,
859
859
  e,
860
860
  t,
861
861
  n,
862
+ y,
862
863
  x,
863
- S,
864
- k,
865
- se,
864
+ O,
865
+ ae,
866
866
  T,
867
- de,
868
- D,
869
- P
867
+ ce,
868
+ E,
869
+ F
870
870
  ]);
871
- if (me.length === 0) return null;
872
- let he = /* @__PURE__ */ H(h, {
871
+ if (I.length === 0) return null;
872
+ let de = /* @__PURE__ */ U(_, {
873
873
  matchReferenceWidth: !1,
874
874
  placement: "bottom-start",
875
- listClassName: _,
876
- items: me,
877
- open: ue ? ae : void 0,
878
- onOpenChange: ue ? N : void 0,
879
- children: /* @__PURE__ */ H(v, {
880
- icon: /* @__PURE__ */ H(F, {
881
- size: p.LG,
875
+ listClassName: p,
876
+ items: I,
877
+ open: oe ? N : void 0,
878
+ onOpenChange: oe ? P : void 0,
879
+ children: /* @__PURE__ */ U(b, {
880
+ icon: /* @__PURE__ */ U(fe, {
881
+ size: h.LG,
882
882
  "aria-hidden": !0,
883
- stroke: m
883
+ stroke: g
884
884
  }),
885
885
  "aria-label": i,
886
886
  tooltipProps: { tooltip: i },
887
- disabled: y
887
+ disabled: m
888
888
  })
889
889
  });
890
- return /* @__PURE__ */ H(V, { children: k ? /* @__PURE__ */ U(V, { children: [
891
- /* @__PURE__ */ H(v, {
892
- icon: /* @__PURE__ */ H(F, {
893
- size: p.LG,
890
+ return /* @__PURE__ */ U(H, { children: O ? /* @__PURE__ */ W(H, { children: [
891
+ /* @__PURE__ */ U(b, {
892
+ icon: /* @__PURE__ */ U(fe, {
893
+ size: h.LG,
894
894
  "aria-hidden": !0,
895
- stroke: m
895
+ stroke: g
896
896
  }),
897
897
  "aria-label": i,
898
- size: g.Large,
898
+ size: v.Large,
899
899
  tooltipProps: { tooltip: i },
900
- disabled: y,
901
- onClick: () => A(!0)
900
+ disabled: m,
901
+ onClick: () => k(!0)
902
902
  }),
903
- /* @__PURE__ */ H(Je, {
904
- isOpen: ee,
905
- title: o,
906
- closeLabel: d,
907
- onClose: () => A(!1),
908
- style: f,
909
- items: me,
903
+ /* @__PURE__ */ U(Ye, {
904
+ isOpen: te,
905
+ title: a,
906
+ closeLabel: s,
907
+ onClose: () => k(!1),
908
+ style: u,
909
+ items: I,
910
910
  className: "pb-4",
911
911
  btnTextClassName: "flex-1"
912
912
  }),
913
- se && /* @__PURE__ */ H(tt, {
914
- isOpen: ne,
913
+ ae && /* @__PURE__ */ U(nt, {
914
+ isOpen: re,
915
915
  onBack: () => {
916
- re(!1), A(!0);
916
+ ie(!1), k(!0);
917
917
  },
918
- backLabel: E,
919
- onClose: () => re(!1),
920
- closeLabel: d,
921
- style: f,
918
+ backLabel: ee,
919
+ onClose: () => ie(!1),
920
+ closeLabel: s,
921
+ style: u,
922
922
  title: T,
923
923
  items: C,
924
924
  onToolToggle: w
925
925
  }),
926
- D?.map((e) => /* @__PURE__ */ H(G, {
927
- isOpen: M === e.key,
926
+ E?.map((e) => /* @__PURE__ */ U(De, {
927
+ isOpen: j === e.key,
928
928
  title: e.title,
929
- closeLabel: d,
929
+ closeLabel: s,
930
930
  onBack: () => {
931
- ie(null), A(!0);
931
+ M(null), k(!0);
932
932
  },
933
933
  backLabel: e.backLabel ?? "Back",
934
- onClose: () => ie(null),
935
- style: f,
936
- children: e.renderOverlay(() => ie(null))
934
+ onClose: () => M(null),
935
+ style: u,
936
+ children: e.renderOverlay(() => M(null))
937
937
  }, e.key)),
938
- x != null && /* @__PURE__ */ H(Qe, {
939
- isOpen: te,
938
+ y != null && /* @__PURE__ */ U($e, {
939
+ isOpen: ne,
940
940
  onBack: () => {
941
- j(!1), A(!0);
941
+ A(!1), k(!0);
942
942
  },
943
- backLabel: x.backLabel ?? "Back",
944
- onClose: () => j(!1),
945
- closeLabel: d,
946
- style: f,
947
- features: x.features,
948
- initialResponseFormat: x.responseFormat ?? a.Markdown,
949
- initialSystemPrompt: x.systemPrompt,
950
- initialTemperature: x.temperature,
951
- onSave: x.onSave,
952
- title: x.title,
953
- responseFormatLabel: x.responseFormatLabel,
954
- responseFormatHint: x.responseFormatHint,
955
- responseFormatMarkdownLabel: x.responseFormatMarkdownLabel,
956
- responseFormatPlainTextLabel: x.responseFormatPlainTextLabel,
957
- systemPromptLabel: x.systemPromptLabel,
958
- systemPromptTooltip: x.systemPromptTooltip,
959
- temperatureLabel: x.temperatureLabel,
960
- temperatureLabels: x.temperatureLabels,
961
- temperatureHint: x.temperatureHint,
962
- saveLabel: x.saveLabel,
963
- saveDisabledTooltip: x.saveDisabledTooltip
943
+ backLabel: y.backLabel ?? "Back",
944
+ onClose: () => A(!1),
945
+ closeLabel: s,
946
+ style: u,
947
+ features: y.features,
948
+ initialResponseFormat: y.responseFormat ?? o.Markdown,
949
+ initialSystemPrompt: y.systemPrompt,
950
+ initialTemperature: y.temperature,
951
+ onSave: y.onSave,
952
+ title: y.title,
953
+ responseFormatLabel: y.responseFormatLabel,
954
+ responseFormatHint: y.responseFormatHint,
955
+ responseFormatMarkdownLabel: y.responseFormatMarkdownLabel,
956
+ responseFormatPlainTextLabel: y.responseFormatPlainTextLabel,
957
+ systemPromptLabel: y.systemPromptLabel,
958
+ systemPromptTooltip: y.systemPromptTooltip,
959
+ temperatureLabel: y.temperatureLabel,
960
+ temperatureLabels: y.temperatureLabels,
961
+ temperatureHint: y.temperatureHint,
962
+ saveLabel: y.saveLabel,
963
+ saveDisabledTooltip: y.saveDisabledTooltip
964
964
  })
965
- ] }) : /* @__PURE__ */ U(V, { children: [he, x != null && te && /* @__PURE__ */ H(et, {
966
- features: x.features,
967
- initialResponseFormat: x.responseFormat ?? a.Markdown,
968
- initialSystemPrompt: x.systemPrompt,
969
- initialTemperature: x.temperature,
970
- onSave: x.onSave,
971
- onClose: () => j(!1),
972
- title: x.title,
973
- responseFormatLabel: x.responseFormatLabel,
974
- responseFormatHint: x.responseFormatHint,
975
- responseFormatMarkdownLabel: x.responseFormatMarkdownLabel,
976
- responseFormatPlainTextLabel: x.responseFormatPlainTextLabel,
977
- systemPromptLabel: x.systemPromptLabel,
978
- systemPromptTooltip: x.systemPromptTooltip,
979
- temperatureLabel: x.temperatureLabel,
980
- temperatureLabels: x.temperatureLabels,
981
- temperatureHint: x.temperatureHint,
982
- saveLabel: x.saveLabel,
983
- saveDisabledTooltip: x.saveDisabledTooltip
965
+ ] }) : /* @__PURE__ */ W(H, { children: [de, y != null && ne && /* @__PURE__ */ U(et, {
966
+ features: y.features,
967
+ initialResponseFormat: y.responseFormat ?? o.Markdown,
968
+ initialSystemPrompt: y.systemPrompt,
969
+ initialTemperature: y.temperature,
970
+ onSave: y.onSave,
971
+ onClose: () => A(!1),
972
+ title: y.title,
973
+ responseFormatLabel: y.responseFormatLabel,
974
+ responseFormatHint: y.responseFormatHint,
975
+ responseFormatMarkdownLabel: y.responseFormatMarkdownLabel,
976
+ responseFormatPlainTextLabel: y.responseFormatPlainTextLabel,
977
+ systemPromptLabel: y.systemPromptLabel,
978
+ systemPromptTooltip: y.systemPromptTooltip,
979
+ temperatureLabel: y.temperatureLabel,
980
+ temperatureLabels: y.temperatureLabels,
981
+ temperatureHint: y.temperatureHint,
982
+ saveLabel: y.saveLabel,
983
+ saveDisabledTooltip: y.saveDisabledTooltip
984
984
  })] }) });
985
- }, it = {
985
+ }, at = {
986
986
  chip: "_chip_ydmd8_1",
987
987
  chipSelected: "_chipSelected_ydmd8_9",
988
988
  chipIcon: "_chipIcon_ydmd8_16",
989
989
  chipText: "_chipText_ydmd8_19",
990
990
  chipClose: "_chipClose_ydmd8_22"
991
- }, at = (e) => `Remove ${e}`, ot = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = at, typography: a, colors: o }) => e.length === 0 ? null : /* @__PURE__ */ H("div", {
991
+ }, ot = (e) => `Remove ${e}`, st = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = ot, typography: a, colors: o }) => e.length === 0 ? null : /* @__PURE__ */ U("div", {
992
992
  className: "flex flex-wrap items-center gap-2",
993
- style: s({
993
+ style: c({
994
994
  "--ci-chip-bg": o?.chipBg,
995
995
  "--ci-chip-border": o?.chipBorder,
996
996
  "--ci-chip-icon": o?.chipIcon,
@@ -1003,34 +1003,34 @@ var W = {
1003
1003
  "--ci-chip-close": o?.chipClose,
1004
1004
  "--ci-chip-close-hover": o?.chipCloseHover
1005
1005
  }),
1006
- children: e.map((e) => /* @__PURE__ */ U("div", {
1007
- className: c(it.chip, e.isSelected && it.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
1008
- children: [/* @__PURE__ */ U("button", {
1006
+ children: e.map((e) => /* @__PURE__ */ W("div", {
1007
+ className: l(at.chip, e.isSelected && at.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
1008
+ children: [/* @__PURE__ */ W("button", {
1009
1009
  type: "button",
1010
1010
  onClick: () => t(e.id),
1011
1011
  "aria-pressed": e.isSelected,
1012
1012
  className: "flex min-w-0 items-center gap-1.5",
1013
- children: [/* @__PURE__ */ H("span", {
1014
- className: c(it.chipIcon, "shrink-0"),
1013
+ children: [/* @__PURE__ */ U("span", {
1014
+ className: l(at.chipIcon, "shrink-0"),
1015
1015
  "aria-hidden": !0,
1016
1016
  children: e.icon
1017
- }), /* @__PURE__ */ H("span", {
1018
- className: c(it.chipText, a?.fontClassName || "dial-small-paragraph-text", "truncate"),
1017
+ }), /* @__PURE__ */ U("span", {
1018
+ className: l(at.chipText, a?.fontClassName || "dial-small-paragraph-text", "truncate"),
1019
1019
  children: e.label
1020
1020
  })]
1021
- }), r && /* @__PURE__ */ H("button", {
1021
+ }), r && /* @__PURE__ */ U("button", {
1022
1022
  type: "button",
1023
1023
  onClick: () => n(e.id),
1024
1024
  "aria-label": i(e.label),
1025
- className: c(it.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1026
- children: /* @__PURE__ */ H(me, {
1025
+ className: l(at.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1026
+ children: /* @__PURE__ */ U(he, {
1027
1027
  size: 12,
1028
1028
  "aria-hidden": !0,
1029
- stroke: m
1029
+ stroke: g
1030
1030
  })
1031
1031
  })]
1032
1032
  }, e.id))
1033
- }), q = {
1033
+ }), J = {
1034
1034
  wrapper: "_wrapper_q1jcl_2",
1035
1035
  wrapperDisabled: "_wrapperDisabled_q1jcl_9",
1036
1036
  textarea: "_textarea_q1jcl_13",
@@ -1041,34 +1041,34 @@ var W = {
1041
1041
  modelSelectorName: "_modelSelectorName_q1jcl_50",
1042
1042
  modelSelectorVersion: "_modelSelectorVersion_q1jcl_53",
1043
1043
  modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_q1jcl_62"
1044
- }, st = {
1044
+ }, ct = {
1045
1045
  wrapperError: "_wrapperError_129ri_1",
1046
1046
  waveformCanvas: "_waveformCanvas_129ri_5",
1047
1047
  recordingDot: "_recordingDot_129ri_19",
1048
1048
  "recording-pulse": "_recording-pulse_129ri_1"
1049
- }, ct = 3, lt = 4, ut = 200, dt = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: l = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
1050
- let h = z(null), g = z(new Float32Array(ut)), y = z(0), b = z(0), x = e === Re.Recording, S = e === Re.Error, C = e === Re.Processing, w = I((e) => {
1049
+ }, lt = 3, ut = 4, dt = 200, ft = ({ 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 }) => {
1050
+ let p = B(null), m = B(new Float32Array(dt)), _ = B(0), v = B(0), x = e === ze.Recording, S = e === ze.Error, C = e === ze.Processing, w = L((e) => {
1051
1051
  let t = e.getContext("2d");
1052
1052
  if (!t) return;
1053
1053
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
1054
1054
  let { width: n, height: r } = e;
1055
1055
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
1056
- let i = Math.min(Math.max(1, Math.floor(n / lt)), ut - 1), a = y.current, o = b.current;
1056
+ let i = Math.min(Math.max(1, Math.floor(n / ut)), dt - 1), a = _.current, o = v.current;
1057
1057
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
1058
1058
  for (let e = 0; e <= i; e++) {
1059
- let n = ((a - i + e) % ut + ut) % ut, o = g.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
1060
- t.fillRect(e * lt, (r - c) / 2, ct, c);
1059
+ let n = ((a - i + e) % dt + dt) % dt, o = m.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
1060
+ t.fillRect(e * ut, (r - c) / 2, lt, c);
1061
1061
  }
1062
1062
  t.restore();
1063
1063
  }, []);
1064
- L(() => {
1064
+ R(() => {
1065
1065
  if (!x) return;
1066
- let e = h.current;
1066
+ let e = p.current;
1067
1067
  if (!e) return;
1068
- g.current.fill(0), y.current = 0, b.current = 0;
1068
+ m.current.fill(0), _.current = 0, v.current = 0;
1069
1069
  let n, r = () => {
1070
- if (b.current += 1, b.current >= lt) {
1071
- b.current -= lt;
1070
+ if (v.current += 1, v.current >= ut) {
1071
+ v.current -= ut;
1072
1072
  let e = t.current;
1073
1073
  if (e) {
1074
1074
  let t = new Uint8Array(e.frequencyBinCount);
@@ -1078,7 +1078,7 @@ var W = {
1078
1078
  let r = (t[e] - 128) / 128;
1079
1079
  n += r * r;
1080
1080
  }
1081
- g.current[y.current % ut] = Math.sqrt(n / t.length), y.current++;
1081
+ m.current[_.current % dt] = Math.sqrt(n / t.length), _.current++;
1082
1082
  }
1083
1083
  }
1084
1084
  w(e), n = requestAnimationFrame(r);
@@ -1090,30 +1090,30 @@ var W = {
1090
1090
  x,
1091
1091
  t,
1092
1092
  w
1093
- ]), L(() => {
1094
- let e = h.current;
1093
+ ]), R(() => {
1094
+ let e = p.current;
1095
1095
  if (!e) return;
1096
1096
  let t = new ResizeObserver(() => {
1097
1097
  w(e);
1098
1098
  });
1099
1099
  return t.observe(e), () => t.disconnect();
1100
1100
  }, [w]);
1101
- let E = /* @__PURE__ */ U("div", {
1101
+ let T = /* @__PURE__ */ W("div", {
1102
1102
  className: "flex flex-shrink-0 items-center justify-end gap-1",
1103
1103
  children: [
1104
- /* @__PURE__ */ H(v, {
1105
- icon: /* @__PURE__ */ H(me, {
1106
- size: p.LG,
1104
+ /* @__PURE__ */ U(b, {
1105
+ icon: /* @__PURE__ */ U(he, {
1106
+ size: h.LG,
1107
1107
  "aria-hidden": !0,
1108
- stroke: m
1108
+ stroke: g
1109
1109
  }),
1110
1110
  "aria-label": s,
1111
1111
  className: "mobile:min-h-11 mobile:min-w-11",
1112
1112
  onClick: i
1113
1113
  }),
1114
- x && /* @__PURE__ */ H(T, {
1115
- icon: /* @__PURE__ */ H(ue, {
1116
- size: p.LG,
1114
+ x && /* @__PURE__ */ U(E, {
1115
+ icon: /* @__PURE__ */ U(I, {
1116
+ size: h.LG,
1117
1117
  "aria-hidden": !0
1118
1118
  }),
1119
1119
  onClick: () => r?.(),
@@ -1121,109 +1121,109 @@ var W = {
1121
1121
  "aria-label": o,
1122
1122
  className: "mobile:min-h-11 mobile:min-w-11"
1123
1123
  }),
1124
- C && /* @__PURE__ */ H("span", {
1124
+ C && /* @__PURE__ */ U("span", {
1125
1125
  className: "flex size-[40px] flex-shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
1126
- children: /* @__PURE__ */ H(te, {
1126
+ children: /* @__PURE__ */ U(re, {
1127
1127
  size: 20,
1128
- ariaLabel: l
1128
+ ariaLabel: c
1129
1129
  })
1130
1130
  })
1131
1131
  ]
1132
1132
  });
1133
- return /* @__PURE__ */ U("div", {
1133
+ return /* @__PURE__ */ W("div", {
1134
1134
  className: d,
1135
- children: [/* @__PURE__ */ U("div", {
1135
+ children: [/* @__PURE__ */ W("div", {
1136
1136
  style: u,
1137
- className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f && q.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && st.wrapperError),
1138
- children: [/* @__PURE__ */ U("div", {
1137
+ className: l("flex w-full min-w-0 flex-col justify-center gap-2", !f && J.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && ct.wrapperError),
1138
+ children: [/* @__PURE__ */ W("div", {
1139
1139
  className: "flex min-w-0 flex-1 items-center gap-3",
1140
- children: [x && /* @__PURE__ */ H("span", {
1141
- className: c(st.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1140
+ children: [x && /* @__PURE__ */ U("span", {
1141
+ className: l(ct.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1142
1142
  "aria-hidden": !0
1143
- }), /* @__PURE__ */ H("canvas", {
1144
- ref: h,
1143
+ }), /* @__PURE__ */ U("canvas", {
1144
+ ref: p,
1145
1145
  height: 26,
1146
1146
  "aria-hidden": !0,
1147
- className: c(st.waveformCanvas, "h-[26px] min-w-0 flex-1")
1147
+ className: l(ct.waveformCanvas, "h-[26px] min-w-0 flex-1")
1148
1148
  })]
1149
- }), /* @__PURE__ */ U("div", {
1149
+ }), /* @__PURE__ */ W("div", {
1150
1150
  className: "flex items-center justify-between gap-2",
1151
- children: [a ?? /* @__PURE__ */ H("span", { "aria-hidden": !0 }), E]
1151
+ children: [a ?? /* @__PURE__ */ U("span", { "aria-hidden": !0 }), T]
1152
1152
  })]
1153
- }), S && n && /* @__PURE__ */ H("div", {
1153
+ }), S && n && /* @__PURE__ */ U("div", {
1154
1154
  role: "alert",
1155
- children: /* @__PURE__ */ H(_, {
1155
+ children: /* @__PURE__ */ U(y, {
1156
1156
  text: n,
1157
1157
  className: "mt-1 px-1"
1158
1158
  })
1159
1159
  })]
1160
1160
  });
1161
- }, ft = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ H(T, {
1161
+ }, pt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ U(E, {
1162
1162
  "aria-label": n,
1163
1163
  onClick: () => e?.(),
1164
1164
  disabled: t,
1165
1165
  tooltipProps: r ? { tooltip: r } : void 0,
1166
- icon: /* @__PURE__ */ H(ae, {
1167
- size: p.LG,
1166
+ icon: /* @__PURE__ */ U(F, {
1167
+ size: h.LG,
1168
1168
  className: "rtl:scale-x-[-1]",
1169
- stroke: m
1169
+ stroke: g
1170
1170
  })
1171
- }), pt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H(j, {
1172
- icon: /* @__PURE__ */ H(de, {
1173
- size: p.LG,
1174
- stroke: m
1171
+ }), mt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(ie, {
1172
+ icon: /* @__PURE__ */ U(de, {
1173
+ size: h.LG,
1174
+ stroke: g
1175
1175
  }),
1176
1176
  onClick: () => e?.(),
1177
1177
  "aria-label": t
1178
- }), mt = ({ size: e = 20 }) => /* @__PURE__ */ H(k, {
1179
- variant: ee.Circular,
1178
+ }), ht = ({ size: e = 20 }) => /* @__PURE__ */ U(k, {
1179
+ variant: ne.Circular,
1180
1180
  width: e,
1181
1181
  height: e,
1182
1182
  active: !0
1183
- }), ht = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
1183
+ }), gt = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
1184
1184
  className: "flex min-w-0 flex-1 items-center",
1185
- children: [/* @__PURE__ */ H(k, {
1186
- variant: ee.Text,
1185
+ children: [/* @__PURE__ */ U(k, {
1186
+ variant: ne.Text,
1187
1187
  width: "100%",
1188
1188
  height: 16,
1189
1189
  active: !0
1190
- }), e && /* @__PURE__ */ H("span", {
1190
+ }), e && /* @__PURE__ */ U("span", {
1191
1191
  className: "sr-only",
1192
1192
  children: e
1193
1193
  })]
1194
- }), gt = ({ loadingLabel: e }) => /* @__PURE__ */ H("div", {
1194
+ }), _t = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
1195
1195
  role: "status",
1196
1196
  "aria-label": e,
1197
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
1197
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ W("div", {
1198
1198
  className: "flex h-11 items-center gap-3 px-4",
1199
1199
  "aria-hidden": "true",
1200
- children: [/* @__PURE__ */ H(mt, {}), /* @__PURE__ */ H(ht, {})]
1200
+ children: [/* @__PURE__ */ U(ht, {}), /* @__PURE__ */ U(gt, {})]
1201
1201
  }, t))
1202
- }), _t = (e) => e.displayName ?? e.id, vt = (e, t) => {
1202
+ }), vt = (e) => e.displayName ?? e.id, yt = (e, t) => {
1203
1203
  let n = t.trim().toLowerCase();
1204
- return n ? e.filter((e) => _t(e).toLowerCase().includes(n)) : e;
1205
- }, yt = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
1204
+ return n ? e.filter((e) => vt(e).toLowerCase().includes(n)) : e;
1205
+ }, bt = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
1206
1206
  src: e,
1207
1207
  size: i,
1208
1208
  labels: { tooltip: a },
1209
1209
  initialsName: r
1210
- }), bt = { searchHeader: "_searchHeader_1728o_1" }, xt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = bt.searchHeader, colors: a }) => {
1211
- let [o, l] = B(""), u = R(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = R(() => d ? /* @__PURE__ */ H(mt, { size: p.LG }) : yt(u?.iconUrl, u?.type, u?.displayName ?? u?.id ?? "", p.LG, f ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1210
+ }), xt = { searchHeader: "_searchHeader_1728o_1" }, Y = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = xt.searchHeader, colors: a }) => {
1211
+ let [o, s] = V(""), u = z(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, p = z(() => d ? /* @__PURE__ */ U(ht, { size: h.LG }) : bt(u?.iconUrl, u?.type, u?.displayName ?? u?.id ?? "", h.LG, f ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1212
1212
  d,
1213
1213
  u,
1214
1214
  f,
1215
1215
  r?.unavailableTooltip
1216
- ]), h = u?.displayName ?? u?.id, _ = u?.displayVersion;
1216
+ ]), m = u?.displayName ?? u?.id, g = u?.displayVersion;
1217
1217
  return {
1218
- selectorIcon: m,
1219
- selectorAriaLabel: h ? `${r?.ariaLabel ?? "Select model"}: ${h}` : r?.ariaLabel ?? "Select model",
1220
- selectedLabel: h,
1221
- selectedVersion: _,
1222
- menuItems: R(() => {
1218
+ selectorIcon: p,
1219
+ selectorAriaLabel: m ? `${r?.ariaLabel ?? "Select model"}: ${m}` : r?.ariaLabel ?? "Select model",
1220
+ selectedLabel: m,
1221
+ selectedVersion: g,
1222
+ menuItems: z(() => {
1223
1223
  if (d) return Array.from({ length: 7 }, (e, t) => ({
1224
1224
  key: `__loading-${t}`,
1225
- icon: /* @__PURE__ */ H(mt, {}),
1226
- label: /* @__PURE__ */ H(ht, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1225
+ icon: /* @__PURE__ */ U(ht, {}),
1226
+ label: /* @__PURE__ */ U(gt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1227
1227
  disabled: !0
1228
1228
  }));
1229
1229
  if (!e || e.length === 0) {
@@ -1234,17 +1234,17 @@ var W = {
1234
1234
  disabled: !0
1235
1235
  }] : [];
1236
1236
  }
1237
- return vt(e, o).map((e) => ({
1237
+ return yt(e, o).map((e) => ({
1238
1238
  key: e.id,
1239
- label: /* @__PURE__ */ H(y, {
1240
- text: _t(e),
1239
+ label: /* @__PURE__ */ U(x, {
1240
+ text: vt(e),
1241
1241
  query: o,
1242
1242
  maxLines: 1
1243
1243
  }),
1244
- icon: yt(e.iconUrl, e.type, e.displayName ?? e.id),
1245
- mark: b.Check,
1244
+ icon: bt(e.iconUrl, e.type, e.displayName ?? e.id),
1245
+ mark: S.Check,
1246
1246
  checked: e.id === t,
1247
- className: c(W.modelMenuItem, e.id === t && W.modelMenuItemSelected),
1247
+ className: l(K.modelMenuItem, e.id === t && K.modelMenuItemSelected),
1248
1248
  onClick: () => n?.(e.id)
1249
1249
  }));
1250
1250
  }, [
@@ -1255,15 +1255,15 @@ var W = {
1255
1255
  r,
1256
1256
  n
1257
1257
  ]),
1258
- menuHeader: R(() => !d && e && e.length > 0 ? /* @__PURE__ */ H("div", {
1259
- style: s({ "--ms-search-header-bg": a?.searchHeaderBackground }),
1260
- className: c("sticky top-0 z-10 pb-1 pe-2 pt-2", i, W.modelMenuSearch),
1261
- children: /* @__PURE__ */ H(O, {
1258
+ menuHeader: z(() => !d && e && e.length > 0 ? /* @__PURE__ */ U("div", {
1259
+ style: c({ "--ms-search-header-bg": a?.searchHeaderBackground }),
1260
+ className: l("sticky top-0 z-10 pb-1 pe-2 pt-2", i, K.modelMenuSearch),
1261
+ children: /* @__PURE__ */ U(te, {
1262
1262
  value: o,
1263
1263
  placeholder: r?.searchPlaceholder ?? "Search",
1264
- size: g.Small,
1264
+ size: v.Small,
1265
1265
  wrapperClassName: "border-0",
1266
- onChange: (e) => l(e ?? "")
1266
+ onChange: (e) => s(e ?? "")
1267
1267
  })
1268
1268
  }) : void 0, [
1269
1269
  e,
@@ -1274,11 +1274,11 @@ var W = {
1274
1274
  a?.searchHeaderBackground
1275
1275
  ]),
1276
1276
  onOpenChange: (e) => {
1277
- e || l("");
1277
+ e || s("");
1278
1278
  }
1279
1279
  };
1280
- }, J = typeof window < "u" ? ve : L;
1281
- function Y(e) {
1280
+ }, St = typeof window < "u" ? ye : R;
1281
+ function Ct(e) {
1282
1282
  if (e !== void 0) switch (typeof e) {
1283
1283
  case "number": return e;
1284
1284
  case "string":
@@ -1286,15 +1286,15 @@ function Y(e) {
1286
1286
  break;
1287
1287
  }
1288
1288
  }
1289
- function St({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1290
- let { styleHeight: s, styleWidth: c } = R(() => ({
1291
- styleHeight: Y(o?.height),
1292
- styleWidth: Y(o?.width)
1293
- }), [o?.height, o?.width]), [l, u] = B({
1289
+ function wt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1290
+ let { styleHeight: s, styleWidth: c } = z(() => ({
1291
+ styleHeight: Ct(o?.height),
1292
+ styleWidth: Ct(o?.width)
1293
+ }), [o?.height, o?.width]), [l, u] = V({
1294
1294
  height: t,
1295
1295
  width: n
1296
1296
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
1297
- return J(() => {
1297
+ return St(() => {
1298
1298
  if (i === null || d) return;
1299
1299
  let t = new ResizeObserver((e) => {
1300
1300
  for (let t of e) {
@@ -1314,7 +1314,7 @@ function St({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1314
1314
  i,
1315
1315
  s,
1316
1316
  c
1317
- ]), R(() => ({
1317
+ ]), z(() => ({
1318
1318
  height: s ?? l.height,
1319
1319
  width: c ?? l.width
1320
1320
  }), [
@@ -1323,26 +1323,26 @@ function St({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1323
1323
  c
1324
1324
  ]);
1325
1325
  }
1326
- function Ct(e) {
1327
- let t = z(() => {
1326
+ function Tt(e) {
1327
+ let t = B(() => {
1328
1328
  throw Error("Cannot call during render.");
1329
1329
  });
1330
- return J(() => {
1330
+ return St(() => {
1331
1331
  t.current = e;
1332
- }, [e]), I((e) => t.current?.(e), [t]);
1332
+ }, [e]), L((e) => t.current?.(e), [t]);
1333
1333
  }
1334
- var wt = null;
1335
- function Tt(e = !1) {
1336
- if (wt === null || e) {
1334
+ var Et = null;
1335
+ function Dt(e = !1) {
1336
+ if (Et === null || e) {
1337
1337
  let e = document.createElement("div"), t = e.style;
1338
1338
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1339
1339
  let n = document.createElement("div"), r = n.style;
1340
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? wt = "positive-descending" : (e.scrollLeft = 1, wt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), wt;
1340
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Et = "positive-descending" : (e.scrollLeft = 1, Et = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Et;
1341
1341
  }
1342
- return wt;
1342
+ return Et;
1343
1343
  }
1344
- function Et({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1345
- if (t === "horizontal" && n) switch (Tt()) {
1344
+ function X({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1345
+ if (t === "horizontal" && n) switch (Dt()) {
1346
1346
  case "negative": return -r;
1347
1347
  case "positive-descending":
1348
1348
  if (e) {
@@ -1353,26 +1353,26 @@ function Et({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1353
1353
  }
1354
1354
  return r;
1355
1355
  }
1356
- function X(e, t = "Assertion error") {
1356
+ function Z(e, t = "Assertion error") {
1357
1357
  if (!e) throw console.error(t), Error(t);
1358
1358
  }
1359
- function Z(e, t) {
1359
+ function Q(e, t) {
1360
1360
  if (e === t) return !0;
1361
- if (!!e != !!t || (X(e !== void 0), X(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1361
+ if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1362
1362
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1363
1363
  return !0;
1364
1364
  }
1365
- function Q({ cachedBounds: e, itemCount: t, itemSize: n }) {
1365
+ function Ot({ cachedBounds: e, itemCount: t, itemSize: n }) {
1366
1366
  if (t === 0) return 0;
1367
1367
  if (typeof n == "number") return t * n;
1368
1368
  {
1369
1369
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
1370
- return X(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1370
+ return Z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1371
1371
  }
1372
1372
  }
1373
- function Dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1373
+ function kt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1374
1374
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1375
- let s = Q({
1375
+ let s = Ot({
1376
1376
  cachedBounds: t,
1377
1377
  itemCount: r,
1378
1378
  itemSize: i
@@ -1384,7 +1384,7 @@ function Dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
1384
1384
  default: return a >= u && a <= l ? a : a < u ? u : l;
1385
1385
  }
1386
1386
  }
1387
- function Ot({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1387
+ function At({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1388
1388
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
1389
1389
  for (; u < a;) {
1390
1390
  let n = e.get(u);
@@ -1403,11 +1403,11 @@ function Ot({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
1403
1403
  stopIndexOverscan: l
1404
1404
  };
1405
1405
  }
1406
- function kt({ itemCount: e, itemProps: t, itemSize: n }) {
1406
+ function jt({ itemCount: e, itemProps: t, itemSize: n }) {
1407
1407
  let r = /* @__PURE__ */ new Map();
1408
1408
  return {
1409
1409
  get(i) {
1410
- for (X(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1410
+ for (Z(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1411
1411
  let e = r.size, a;
1412
1412
  switch (typeof n) {
1413
1413
  case "function":
@@ -1423,14 +1423,14 @@ function kt({ itemCount: e, itemProps: t, itemSize: n }) {
1423
1423
  });
1424
1424
  else {
1425
1425
  let t = r.get(e - 1);
1426
- X(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1426
+ Z(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1427
1427
  scrollOffset: t.scrollOffset + t.size,
1428
1428
  size: a
1429
1429
  });
1430
1430
  }
1431
1431
  }
1432
1432
  let a = r.get(i);
1433
- return X(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1433
+ return Z(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1434
1434
  },
1435
1435
  set(e, t) {
1436
1436
  r.set(e, t);
@@ -1440,8 +1440,8 @@ function kt({ itemCount: e, itemProps: t, itemSize: n }) {
1440
1440
  }
1441
1441
  };
1442
1442
  }
1443
- function At({ itemCount: e, itemProps: t, itemSize: n }) {
1444
- return R(() => kt({
1443
+ function Mt({ itemCount: e, itemProps: t, itemSize: n }) {
1444
+ return z(() => jt({
1445
1445
  itemCount: e,
1446
1446
  itemProps: t,
1447
1447
  itemSize: n
@@ -1451,11 +1451,11 @@ function At({ itemCount: e, itemProps: t, itemSize: n }) {
1451
1451
  n
1452
1452
  ]);
1453
1453
  }
1454
- function jt({ containerSize: e, itemSize: t }) {
1454
+ function Nt({ containerSize: e, itemSize: t }) {
1455
1455
  let n;
1456
1456
  switch (typeof t) {
1457
1457
  case "string":
1458
- 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;
1458
+ 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;
1459
1459
  break;
1460
1460
  default:
1461
1461
  n = t;
@@ -1463,21 +1463,21 @@ function jt({ containerSize: e, itemSize: t }) {
1463
1463
  }
1464
1464
  return n;
1465
1465
  }
1466
- function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1467
- let { height: u = n, width: d = n } = St({
1466
+ function Pt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1467
+ let { height: u = n, width: d = n } = wt({
1468
1468
  defaultHeight: r === "vertical" ? n : void 0,
1469
1469
  defaultWidth: r === "horizontal" ? n : void 0,
1470
1470
  element: e,
1471
1471
  mode: r === "vertical" ? "only-height" : "only-width",
1472
1472
  style: t
1473
- }), f = z({
1473
+ }), f = B({
1474
1474
  height: 0,
1475
1475
  width: 0
1476
- }), p = r === "vertical" ? u : d, m = jt({
1476
+ }), p = r === "vertical" ? u : d, m = Nt({
1477
1477
  containerSize: p,
1478
1478
  itemSize: s
1479
1479
  });
1480
- ve(() => {
1480
+ ye(() => {
1481
1481
  if (typeof c == "function") {
1482
1482
  let e = f.current;
1483
1483
  (e.height !== u || e.width !== d) && (c({
@@ -1490,11 +1490,11 @@ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1490
1490
  c,
1491
1491
  d
1492
1492
  ]);
1493
- let h = At({
1493
+ let h = Mt({
1494
1494
  itemCount: a,
1495
1495
  itemProps: o,
1496
1496
  itemSize: m
1497
- }), g = I((e) => h.get(e), [h]), [_, v] = B(() => Ot({
1497
+ }), g = L((e) => h.get(e), [h]), [_, v] = V(() => At({
1498
1498
  cachedBounds: h,
1499
1499
  containerScrollOffset: 0,
1500
1500
  containerSize: p,
@@ -1505,7 +1505,7 @@ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1505
1505
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1506
1506
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1507
1507
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1508
- }, C = I(() => Q({
1508
+ }, C = L(() => Ot({
1509
1509
  cachedBounds: h,
1510
1510
  itemCount: a,
1511
1511
  itemSize: m
@@ -1513,9 +1513,9 @@ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1513
1513
  h,
1514
1514
  a,
1515
1515
  m
1516
- ]), w = I((t) => Ot({
1516
+ ]), w = L((t) => At({
1517
1517
  cachedBounds: h,
1518
- containerScrollOffset: Et({
1518
+ containerScrollOffset: X({
1519
1519
  containerElement: e,
1520
1520
  direction: r,
1521
1521
  isRtl: i,
@@ -1533,19 +1533,19 @@ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1533
1533
  a,
1534
1534
  l
1535
1535
  ]);
1536
- return J(() => {
1536
+ return St(() => {
1537
1537
  v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
1538
1538
  }, [
1539
1539
  e,
1540
1540
  r,
1541
1541
  w
1542
- ]), J(() => {
1542
+ ]), St(() => {
1543
1543
  if (!e) return;
1544
1544
  let t = () => {
1545
1545
  v((t) => {
1546
- let { scrollLeft: n, scrollTop: o } = e, s = Ot({
1546
+ let { scrollLeft: n, scrollTop: o } = e, s = At({
1547
1547
  cachedBounds: h,
1548
- containerScrollOffset: Et({
1548
+ containerScrollOffset: X({
1549
1549
  containerElement: e,
1550
1550
  direction: r,
1551
1551
  isRtl: i,
@@ -1555,7 +1555,7 @@ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1555
1555
  itemCount: a,
1556
1556
  overscanCount: l
1557
1557
  });
1558
- return Z(s, t) ? t : s;
1558
+ return Q(s, t) ? t : s;
1559
1559
  });
1560
1560
  };
1561
1561
  return e.addEventListener("scroll", t), () => {
@@ -1571,8 +1571,8 @@ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1571
1571
  ]), {
1572
1572
  getCellBounds: g,
1573
1573
  getEstimatedSize: C,
1574
- scrollToIndex: Ct(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1575
- let s = Dt({
1574
+ scrollToIndex: Tt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1575
+ let s = kt({
1576
1576
  align: t,
1577
1577
  cachedBounds: h,
1578
1578
  containerScrollOffset: n,
@@ -1582,14 +1582,14 @@ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1582
1582
  itemSize: m
1583
1583
  });
1584
1584
  if (e) {
1585
- if (s = Et({
1585
+ if (s = X({
1586
1586
  containerElement: e,
1587
1587
  direction: r,
1588
1588
  isRtl: i,
1589
1589
  scrollOffset: s
1590
1590
  }), typeof e.scrollTo != "function") {
1591
1591
  let e = w(s);
1592
- Z(_, e) || v(e);
1592
+ Q(_, e) || v(e);
1593
1593
  }
1594
1594
  return s;
1595
1595
  }
@@ -1600,30 +1600,30 @@ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1600
1600
  stopIndexVisible: x
1601
1601
  };
1602
1602
  }
1603
- function Nt(e) {
1604
- return R(() => e, Object.values(e));
1603
+ function Ft(e) {
1604
+ return z(() => e, Object.values(e));
1605
1605
  }
1606
- function Pt(e, t) {
1606
+ function It(e, t) {
1607
1607
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1608
- return Z(n, a) && Z(r, o) && Z(i, s);
1608
+ return Q(n, a) && Q(r, o) && Q(i, s);
1609
1609
  }
1610
- function Ft(e) {
1610
+ function Lt(e) {
1611
1611
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1612
1612
  }
1613
- var It = "data-react-window-index";
1614
- function Lt({ 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 }) {
1615
- let m = Nt(u), h = R(() => ge(s, Pt), [s]), [g, _] = B(null), v = Ft(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Mt({
1613
+ var Rt = "data-react-window-index";
1614
+ function zt({ 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 }) {
1615
+ let m = Ft(u), h = z(() => _e(s, It), [s]), [g, _] = V(null), v = Lt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Pt({
1616
1616
  containerElement: g,
1617
1617
  containerStyle: f,
1618
1618
  defaultContainerSize: n,
1619
1619
  direction: "vertical",
1620
1620
  itemCount: c,
1621
1621
  itemProps: m,
1622
- itemSize: R(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1622
+ itemSize: z(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1623
1623
  onResize: i,
1624
1624
  overscanCount: o
1625
1625
  });
1626
- _e(r, () => ({
1626
+ ve(r, () => ({
1627
1627
  get element() {
1628
1628
  return g;
1629
1629
  },
@@ -1638,12 +1638,12 @@ function Lt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1638
1638
  top: r
1639
1639
  });
1640
1640
  }
1641
- }), [g, x]), J(() => {
1641
+ }), [g, x]), St(() => {
1642
1642
  if (!g) return;
1643
1643
  let e = Array.from(g.children).filter((e, t) => {
1644
1644
  if (e.hasAttribute("aria-hidden")) return !1;
1645
1645
  let n = `${S + t}`;
1646
- return e.setAttribute(It, n), !0;
1646
+ return e.setAttribute(Rt, n), !0;
1647
1647
  });
1648
1648
  if (v) return l.observeRowElements(e);
1649
1649
  }, [
@@ -1652,7 +1652,7 @@ function Lt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1652
1652
  l,
1653
1653
  S,
1654
1654
  w
1655
- ]), L(() => {
1655
+ ]), R(() => {
1656
1656
  S >= 0 && w >= 0 && a && a({
1657
1657
  startIndex: C,
1658
1658
  stopIndex: T
@@ -1667,11 +1667,11 @@ function Lt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1667
1667
  w,
1668
1668
  T
1669
1669
  ]);
1670
- let E = R(() => {
1670
+ let ee = z(() => {
1671
1671
  let e = [];
1672
1672
  if (c > 0) for (let t = S; t <= w; t++) {
1673
1673
  let n = y(t);
1674
- e.push(/* @__PURE__ */ he(h, {
1674
+ e.push(/* @__PURE__ */ ge(h, {
1675
1675
  ...m,
1676
1676
  ariaAttributes: {
1677
1677
  "aria-posinset": t + 1,
@@ -1698,7 +1698,7 @@ function Lt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1698
1698
  m,
1699
1699
  S,
1700
1700
  w
1701
- ]), D = /* @__PURE__ */ H("div", {
1701
+ ]), E = /* @__PURE__ */ U("div", {
1702
1702
  "aria-hidden": !0,
1703
1703
  style: {
1704
1704
  height: b(),
@@ -1706,7 +1706,7 @@ function Lt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1706
1706
  zIndex: -1
1707
1707
  }
1708
1708
  });
1709
- return he(d, {
1709
+ return ge(d, {
1710
1710
  role: "list",
1711
1711
  ...p,
1712
1712
  className: t,
@@ -1718,272 +1718,272 @@ function Lt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1718
1718
  overflowY: "auto",
1719
1719
  ...f
1720
1720
  }
1721
- }, E, e, D);
1721
+ }, ee, e, E);
1722
1722
  }
1723
- var Rt = {
1723
+ var Bt = {
1724
1724
  divider: "_divider_1tiyp_1",
1725
1725
  item: "_item_1tiyp_5",
1726
1726
  itemIcon: "_itemIcon_1tiyp_15",
1727
1727
  checkIcon: "_checkIcon_1tiyp_19",
1728
1728
  stateLabel: "_stateLabel_1tiyp_23"
1729
- }, zt = 44, Bt = 8, Vt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, onSelect: s }) => {
1730
- let l = r[e], u = yt(l.iconUrl, l.type, l.displayName ?? l.id, p.SM), f = l.id === i;
1731
- return /* @__PURE__ */ H("div", {
1729
+ }, Vt = 44, Ht = 8, Ut = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, onSelect: s }) => {
1730
+ let c = r[e], u = bt(c.iconUrl, c.type, c.displayName ?? c.id, h.SM), d = c.id === i;
1731
+ return /* @__PURE__ */ U("div", {
1732
1732
  style: t,
1733
1733
  ...n,
1734
- children: /* @__PURE__ */ H(d, {
1734
+ children: /* @__PURE__ */ U(p, {
1735
1735
  type: "button",
1736
- "aria-current": f ? "true" : void 0,
1737
- className: c(Rt.item, "h-full w-full gap-3 px-4"),
1738
- iconBefore: /* @__PURE__ */ H("span", {
1739
- className: Rt.itemIcon,
1736
+ "aria-current": d ? "true" : void 0,
1737
+ className: l(Bt.item, "h-full w-full gap-3 px-4"),
1738
+ iconBefore: /* @__PURE__ */ U("span", {
1739
+ className: Bt.itemIcon,
1740
1740
  children: u
1741
1741
  }),
1742
- label: /* @__PURE__ */ U("span", {
1742
+ label: /* @__PURE__ */ W("span", {
1743
1743
  className: "flex flex-1 items-center justify-between gap-2",
1744
- children: [/* @__PURE__ */ H(y, {
1745
- text: l.displayName ?? l.id,
1744
+ children: [/* @__PURE__ */ U(x, {
1745
+ text: c.displayName ?? c.id,
1746
1746
  query: o,
1747
1747
  maxLines: 1,
1748
- className: c(a, "min-w-0 flex-1 text-start")
1749
- }), f && /* @__PURE__ */ H(N, {
1750
- size: p.SM,
1751
- className: Rt.checkIcon,
1748
+ className: l(a, "min-w-0 flex-1 text-start")
1749
+ }), d && /* @__PURE__ */ U(ae, {
1750
+ size: h.SM,
1751
+ className: Bt.checkIcon,
1752
1752
  "aria-hidden": !0,
1753
- stroke: m
1753
+ stroke: g
1754
1754
  })]
1755
1755
  }),
1756
- onClick: () => s(l.id)
1756
+ onClick: () => s(c.id)
1757
1757
  })
1758
1758
  });
1759
- }, Ht = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: _ }) => {
1760
- let [v, y] = B("");
1761
- L(() => {
1759
+ }, Wt = ({ 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 }) => {
1760
+ let [_, y] = V("");
1761
+ R(() => {
1762
1762
  e || y("");
1763
1763
  }, [e]);
1764
- let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? vt(a, v) : [], w = (e) => {
1765
- l(e), i();
1766
- }, T = s({
1767
- "--ci-sheet-divider": _?.divider,
1768
- "--ci-sheet-text": _?.itemText,
1769
- "--ci-sheet-item-hover": _?.itemHoverBg,
1770
- "--ci-sheet-item-active": _?.itemActiveBg,
1771
- "--ci-sheet-icon": _?.itemIcon,
1772
- "--ci-check-icon": _?.checkIcon
1764
+ let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? yt(a, _) : [], w = (e) => {
1765
+ s(e), i();
1766
+ }, T = c({
1767
+ "--ci-sheet-divider": g?.divider,
1768
+ "--ci-sheet-text": g?.itemText,
1769
+ "--ci-sheet-item-hover": g?.itemHoverBg,
1770
+ "--ci-sheet-item-active": g?.itemActiveBg,
1771
+ "--ci-sheet-icon": g?.itemIcon,
1772
+ "--ci-check-icon": g?.checkIcon
1773
1773
  });
1774
- return /* @__PURE__ */ H(G, {
1774
+ return /* @__PURE__ */ U(De, {
1775
1775
  isOpen: e,
1776
1776
  title: t,
1777
1777
  closeLabel: n,
1778
1778
  onClose: i,
1779
1779
  style: p,
1780
1780
  titleClassName: m,
1781
- className: c("max-h-[80dvh]", W.modelMenu),
1782
- colors: _?.shell,
1783
- children: /* @__PURE__ */ U("div", {
1781
+ className: l("max-h-[80dvh]", K.modelMenu),
1782
+ colors: g?.shell,
1783
+ children: /* @__PURE__ */ W("div", {
1784
1784
  className: "contents",
1785
1785
  style: T,
1786
- children: [b && !x && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
1786
+ children: [b && !x && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
1787
1787
  className: "flex-shrink-0 px-4 py-[10px]",
1788
- children: /* @__PURE__ */ H(O, {
1789
- value: v,
1788
+ children: /* @__PURE__ */ U(te, {
1789
+ value: _,
1790
1790
  placeholder: r,
1791
- size: g.Standard,
1791
+ size: v.Standard,
1792
1792
  onChange: (e) => y(e ?? "")
1793
1793
  })
1794
- }), /* @__PURE__ */ H("div", { className: c(Rt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ H(gt, { loadingLabel: u }) : S ? /* @__PURE__ */ H("div", {
1794
+ }), /* @__PURE__ */ U("div", { className: l(Bt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ U(_t, { loadingLabel: u }) : S ? /* @__PURE__ */ U("div", {
1795
1795
  role: "list",
1796
- className: c(Rt.stateLabel, h, "px-4 py-4"),
1796
+ className: l(Bt.stateLabel, h, "px-4 py-4"),
1797
1797
  children: S
1798
- }) : /* @__PURE__ */ H(Lt, {
1798
+ }) : /* @__PURE__ */ U(zt, {
1799
1799
  role: "list",
1800
1800
  className: "overflow-y-auto",
1801
- style: { height: Math.min(C.length, Bt) * zt },
1802
- rowComponent: Vt,
1801
+ style: { height: Math.min(C.length, Ht) * Vt },
1802
+ rowComponent: Ut,
1803
1803
  rowCount: C.length,
1804
- rowHeight: zt,
1804
+ rowHeight: Vt,
1805
1805
  rowProps: {
1806
1806
  items: C,
1807
1807
  selectedDeploymentId: o,
1808
1808
  labelClassName: h,
1809
- query: v,
1809
+ query: _,
1810
1810
  onSelect: w
1811
1811
  }
1812
1812
  })]
1813
1813
  })
1814
1814
  });
1815
- }, Ut = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: f, onPickerOpenChange: g }) => {
1816
- let [_, y] = B(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, selectedVersion: C, menuItems: w, menuHeader: T, onOpenChange: E } = xt({
1815
+ }, Gt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: o = !1, style: c, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: f, onPickerOpenChange: p }) => {
1816
+ let [m, v] = V(!1), { selectorIcon: y, selectorAriaLabel: x, selectedLabel: S, selectedVersion: C, menuItems: w, menuHeader: T, onOpenChange: ee } = Y({
1817
1817
  deployments: e,
1818
1818
  selectedDeploymentId: t,
1819
1819
  onDeploymentChange: n,
1820
1820
  modelSelectorLabels: r
1821
1821
  });
1822
1822
  if (!e) return null;
1823
- let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ H(P, {
1824
- size: p.SM,
1825
- className: c(q.modelSelectorCaret, W.modelSelectorCaret),
1823
+ let E = i || o ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ U(oe, {
1824
+ size: h.SM,
1825
+ className: l(J.modelSelectorCaret, K.modelSelectorCaret),
1826
1826
  "aria-hidden": !0,
1827
- stroke: m
1828
- }), k = /* @__PURE__ */ H("span", {
1829
- className: c("flex shrink-0 items-center", W.modelSelectorIcon),
1830
- children: b
1827
+ stroke: g
1828
+ }), O = /* @__PURE__ */ U("span", {
1829
+ className: l("flex shrink-0 items-center", K.modelSelectorIcon),
1830
+ children: y
1831
1831
  });
1832
- if (a) return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(M, {
1832
+ if (a) return /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(N, {
1833
1833
  tooltip: S,
1834
- children: /* @__PURE__ */ H(v, {
1835
- icon: /* @__PURE__ */ U("div", {
1834
+ children: /* @__PURE__ */ U(b, {
1835
+ icon: /* @__PURE__ */ W("div", {
1836
1836
  className: "flex items-center gap-1",
1837
- children: [k, O]
1837
+ children: [O, D]
1838
1838
  }),
1839
1839
  "aria-label": x,
1840
1840
  onClick: () => {
1841
- s || y(!0);
1841
+ o || v(!0);
1842
1842
  },
1843
- className: c("w-[50px]", q.modelSelectorButton, D, W.modelSelectorButton)
1843
+ className: l("w-[50px]", J.modelSelectorButton, E, K.modelSelectorButton)
1844
1844
  })
1845
- }), u ? /* @__PURE__ */ H(G, {
1846
- isOpen: _,
1845
+ }), u ? /* @__PURE__ */ U(De, {
1846
+ isOpen: m,
1847
1847
  title: r?.ariaLabel ?? "Select model",
1848
1848
  closeLabel: r?.closeLabel ?? "Close",
1849
- onClose: () => y(!1),
1850
- style: l,
1851
- className: W.modelMenu,
1852
- children: u(() => y(!1))
1853
- }) : /* @__PURE__ */ H(Ht, {
1854
- isOpen: _,
1849
+ onClose: () => v(!1),
1850
+ style: c,
1851
+ className: K.modelMenu,
1852
+ children: u(() => v(!1))
1853
+ }) : /* @__PURE__ */ U(Wt, {
1854
+ isOpen: m,
1855
1855
  title: r?.ariaLabel ?? "Select model",
1856
1856
  closeLabel: r?.closeLabel ?? "Close",
1857
1857
  searchPlaceholder: r?.searchPlaceholder ?? "Search",
1858
- onClose: () => y(!1),
1858
+ onClose: () => v(!1),
1859
1859
  deployments: e,
1860
1860
  selectedDeploymentId: t,
1861
1861
  onSelect: (e) => n?.(e),
1862
1862
  loadingLabel: r?.loading,
1863
1863
  errorLabel: r?.error,
1864
1864
  emptyLabel: r?.empty,
1865
- style: l
1865
+ style: c
1866
1866
  })] });
1867
1867
  if (u) {
1868
1868
  let e = C ? `${S} · ${C}` : S;
1869
- return /* @__PURE__ */ H(h, {
1869
+ return /* @__PURE__ */ U(_, {
1870
1870
  placement: "top-end",
1871
1871
  matchReferenceWidth: !1,
1872
1872
  open: d,
1873
- onOpenChange: g,
1873
+ onOpenChange: p,
1874
1874
  trigger: [],
1875
1875
  outsideClosable: !0,
1876
- renderOverlay: () => u(() => g?.(!1)),
1877
- listClassName: c("!w-[368px] !bg-layer-raised", W.modelMenu),
1878
- children: /* @__PURE__ */ H(M, {
1876
+ renderOverlay: () => u(() => p?.(!1)),
1877
+ listClassName: l("!w-[368px] !bg-layer-raised", K.modelMenu),
1878
+ children: /* @__PURE__ */ U(N, {
1879
1879
  tooltip: e,
1880
- children: /* @__PURE__ */ U("button", {
1880
+ children: /* @__PURE__ */ W("button", {
1881
1881
  type: "button",
1882
1882
  "aria-label": x,
1883
- "aria-disabled": s || void 0,
1884
- className: c("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5", q.modelSelectorButton, D, s && q.modelSelectorButtonDisabled, W.modelSelectorButton),
1883
+ "aria-disabled": o || void 0,
1884
+ className: l("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5", J.modelSelectorButton, E, o && J.modelSelectorButtonDisabled, K.modelSelectorButton),
1885
1885
  onClick: () => {
1886
- !i && !s && f?.();
1886
+ !i && !o && f?.();
1887
1887
  },
1888
1888
  children: [
1889
- k,
1890
- /* @__PURE__ */ U("span", {
1889
+ O,
1890
+ /* @__PURE__ */ W("span", {
1891
1891
  className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
1892
- children: [/* @__PURE__ */ H("span", {
1893
- className: c("dial-small-text max-w-[180px] shrink-0 truncate", q.modelSelectorName),
1892
+ children: [/* @__PURE__ */ U("span", {
1893
+ className: l("dial-small-text max-w-[180px] shrink-0 truncate", J.modelSelectorName),
1894
1894
  children: S
1895
- }), C && /* @__PURE__ */ H("span", {
1896
- className: c("dial-tiny-text min-w-0 truncate", q.modelSelectorVersion),
1895
+ }), C && /* @__PURE__ */ U("span", {
1896
+ className: l("dial-tiny-text min-w-0 truncate", J.modelSelectorVersion),
1897
1897
  children: C
1898
1898
  })]
1899
1899
  }),
1900
- O
1900
+ D
1901
1901
  ]
1902
1902
  })
1903
1903
  })
1904
1904
  });
1905
1905
  }
1906
- return /* @__PURE__ */ H("div", {
1907
- className: c(s && D),
1908
- "aria-disabled": s || void 0,
1909
- children: /* @__PURE__ */ H(h, {
1906
+ return /* @__PURE__ */ U("div", {
1907
+ className: l(o && E),
1908
+ "aria-disabled": o || void 0,
1909
+ children: /* @__PURE__ */ U(_, {
1910
1910
  items: w,
1911
1911
  menuHeader: T,
1912
1912
  placement: "bottom-end",
1913
1913
  matchReferenceWidth: !1,
1914
- maxDropdownHeight: o,
1915
- listClassName: c("!w-[240px]", W.modelMenu),
1916
- disabled: s,
1917
- onOpenChange: s ? void 0 : E,
1918
- children: /* @__PURE__ */ H(M, {
1914
+ maxDropdownHeight: s,
1915
+ listClassName: l("!w-[240px]", K.modelMenu),
1916
+ disabled: o,
1917
+ onOpenChange: o ? void 0 : ee,
1918
+ children: /* @__PURE__ */ U(N, {
1919
1919
  tooltip: S,
1920
- children: /* @__PURE__ */ U("button", {
1920
+ children: /* @__PURE__ */ W("button", {
1921
1921
  type: "button",
1922
1922
  "aria-label": x,
1923
- "aria-disabled": s || void 0,
1924
- className: c("flex items-center gap-1 rounded-full p-1.5", q.modelSelectorButton, s && q.modelSelectorButtonDisabled, W.modelSelectorButton),
1925
- children: [k, O]
1923
+ "aria-disabled": o || void 0,
1924
+ className: l("flex items-center gap-1 rounded-full p-1.5", J.modelSelectorButton, o && J.modelSelectorButtonDisabled, K.modelSelectorButton),
1925
+ children: [O, D]
1926
1926
  })
1927
1927
  })
1928
1928
  })
1929
1929
  });
1930
- }, Wt = ({ message: e = "", messageRevision: t, textInsertion: n, onSend: r, onUploadAttachment: i, onStop: a, isStreaming: o = !1, onChange: d, onAttachmentsChange: f, placeholder: g = "Type a message...", ariaLabel: y, attachLabel: b = "Attach file", fileAccept: x, addMenuTitle: S = "Add", menuTitle: C = "Menu", menuCloseLabel: w = "Close", removeLabel: T, retryLabel: E, uploadingLabel: D, sendLabel: O, sendTooltip: k, emptyMessageTooltip: ee, stopLabel: A, micLabel: te = "Dictate", recordVoiceLabel: j = "Record voice", stopRecordingLabel: ne, discardRecordingLabel: re, colors: M, typography: ie, attachmentTray: ae, className: N, pendingDropFiles: P = [], onDropFilesConsumed: oe, pendingAttachments: le = [], onPendingAttachmentsConsumed: ue, pasteTextThreshold: de = 4e3, maxMessageLength: F = 5e4, deployments: fe, selectedDeploymentId: pe, onDeploymentChange: me, modelSelectorLabels: he, initialAttachments: ge = [], hideAddButton: _e = !1, hideAttachFile: ve = !1, hideActionBar: ye = !1, actionRowLayout: xe = Ke.Stacked, isInlineActionRowAllowedBelowDesktop: Se = !1, renderFooterActions: we, isInputDisabled: Te = !1, isModelSelectorDisabled: Ee = !1, isSendDisabled: G = !1, isAudioMessageSupported: De = !1, isVoiceRecordingSupported: ke = De, onTranscribeAudio: je, transcribingLabel: Me, voiceErrorLabel: Fe, sendOnEnter: Ie = Ge.Enter, prefixAttachments: Be = [], onRemovePrefixAttachment: Ve, chatSettings: He, toolsMenuItems: Ue, onToolToggle: qe, canRemoveTools: Je = !0, toolsMenuTitle: Ye, toolsBackLabel: Xe, toolsChipLabels: Ze, menuOverlays: Qe, inlineStartSlot: $e, onInlineStartRemove: et, commandMenu: K, autoFocus: tt = !1, messageHistory: nt, onDialFileSystemClick: it, dialFileSystemLabel: at, validateAttachment: st, onAttachmentClick: ct, modelPickerOverlay: lt, maximumAttachmentsAmount: ut, onAttachmentsLimitExceeded: mt, isAttachmentsEnabled: ht = !0, isTextAttachmentsAllowed: gt = !0, usageLimitsSlot: _t, onMessageTooLong: vt }) => {
1931
- let yt = l(), [bt, xt] = B(!1), J = Ne(nt), Y = $e != null, [St, Ct] = B(null), [wt, Tt] = B(0), Et = R(() => s({
1932
- "--ci-bg": M?.background,
1933
- "--ci-text": M?.text,
1934
- "--ci-border": M?.border,
1935
- "--ci-border-focus": M?.borderFocus,
1936
- "--ci-placeholder": M?.placeholder,
1937
- "--ci-text-disabled": M?.textDisabled,
1938
- "--ci-model-selector-caret-color": M?.modelSelectorCaret,
1939
- "--ci-model-selector-hover-bg": M?.modelSelectorHoverBg,
1940
- "--ci-model-selector-disabled-color": M?.modelSelectorDisabled,
1941
- "--ci-model-selector-name-color": M?.modelSelectorName,
1942
- "--ci-model-selector-version-color": M?.modelSelectorVersion,
1943
- "--ci-voice-error": M?.voiceError,
1944
- "--ci-voice-waveform": M?.voiceWaveform,
1945
- "--ci-voice-accent": M?.voiceAccent,
1930
+ }, Kt = ({ message: e = "", messageRevision: t, textInsertion: n, onSend: r, onUploadAttachment: i, onStop: a, isStreaming: o = !1, onChange: s, onAttachmentsChange: u, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: v = "Attach file", fileAccept: x, addMenuTitle: S = "Add", menuTitle: C = "Menu", menuCloseLabel: w = "Close", removeLabel: T, retryLabel: ee, uploadingLabel: E, sendLabel: D, sendTooltip: O, emptyMessageTooltip: te, stopLabel: k, micLabel: ne = "Dictate", recordVoiceLabel: A = "Record voice", stopRecordingLabel: re, discardRecordingLabel: ie, colors: j, typography: M, attachmentTray: N, className: P, pendingDropFiles: F = [], onDropFilesConsumed: ae, pendingAttachments: oe = [], onPendingAttachmentsConsumed: se, pasteTextThreshold: ue = 4e3, maxMessageLength: I = 5e4, deployments: de, selectedDeploymentId: fe, onDeploymentChange: pe, modelSelectorLabels: me, initialAttachments: he = [], hideAddButton: ge = !1, hideAttachFile: _e = !1, hideActionBar: ve = !1, actionRowLayout: ye = qe.Stacked, isInlineActionRowAllowedBelowDesktop: be = !1, renderFooterActions: Se, isInputDisabled: G = !1, isModelSelectorDisabled: we = !1, isSendDisabled: Te = !1, isAudioMessageSupported: Ee = !1, isVoiceRecordingSupported: De = Ee, onTranscribeAudio: Oe, transcribingLabel: Ae, voiceErrorLabel: Me, sendOnEnter: Ne = Ke.Enter, prefixAttachments: Ie = [], onRemovePrefixAttachment: Le, chatSettings: Ve, toolsMenuItems: He, onToolToggle: Ue, canRemoveTools: We = !0, toolsMenuTitle: Je, toolsBackLabel: Ye, toolsChipLabels: Xe, menuOverlays: Ze, inlineStartSlot: Qe, onInlineStartRemove: $e, commandMenu: q, autoFocus: et = !1, messageHistory: tt, onDialFileSystemClick: nt, dialFileSystemLabel: rt, validateAttachment: at, onAttachmentClick: ot, modelPickerOverlay: ct, maximumAttachmentsAmount: lt, onAttachmentsLimitExceeded: ut, isAttachmentsEnabled: dt = !0, isTextAttachmentsAllowed: ht = !0, usageLimitsSlot: gt, onMessageTooLong: _t }) => {
1931
+ let vt = d(), [yt, bt] = V(!1), xt = Pe(tt), Y = Qe != null, [St, Ct] = V(null), [wt, Tt] = V(0), Et = z(() => c({
1932
+ "--ci-bg": j?.background,
1933
+ "--ci-text": j?.text,
1934
+ "--ci-border": j?.border,
1935
+ "--ci-border-focus": j?.borderFocus,
1936
+ "--ci-placeholder": j?.placeholder,
1937
+ "--ci-text-disabled": j?.textDisabled,
1938
+ "--ci-model-selector-caret-color": j?.modelSelectorCaret,
1939
+ "--ci-model-selector-hover-bg": j?.modelSelectorHoverBg,
1940
+ "--ci-model-selector-disabled-color": j?.modelSelectorDisabled,
1941
+ "--ci-model-selector-name-color": j?.modelSelectorName,
1942
+ "--ci-model-selector-version-color": j?.modelSelectorVersion,
1943
+ "--ci-voice-error": j?.voiceError,
1944
+ "--ci-voice-waveform": j?.voiceWaveform,
1945
+ "--ci-voice-accent": j?.voiceAccent,
1946
1946
  "--ci-first-line-indent": Y ? `calc(${wt}px + 4px)` : void 0
1947
1947
  }), [
1948
- M,
1948
+ j,
1949
1949
  Y,
1950
1950
  wt
1951
- ]), X = R(() => it ? [{
1951
+ ]), Dt = z(() => nt ? [{
1952
1952
  key: "dial-fs",
1953
- label: at ?? "DIAL file system",
1954
- icon: /* @__PURE__ */ H(se, {
1955
- size: u,
1953
+ label: rt ?? "DIAL file system",
1954
+ icon: /* @__PURE__ */ U(ce, {
1955
+ size: f,
1956
1956
  "aria-hidden": !0,
1957
- stroke: m
1957
+ stroke: g
1958
1958
  }),
1959
- onClick: it
1960
- }] : [], [it, at]), { message: Z, setMessage: Q, textareaRef: Dt } = Pe({
1959
+ onClick: nt
1960
+ }] : [], [nt, rt]), { message: X, setMessage: Z, textareaRef: Q } = Fe({
1961
1961
  messageProp: e,
1962
1962
  messageRevision: t
1963
- }), { handleUndoKeyDown: Ot } = Le({
1963
+ }), { handleUndoKeyDown: Ot } = Re({
1964
1964
  insertion: n,
1965
- textareaRef: Dt
1966
- }), { isMenuOpen: kt, query: At, dismiss: jt, handleValueChange: Mt } = Ae({
1967
- config: K,
1968
- message: Z
1969
- }), Nt = K?.emptyQueryHint != null, Pt = Nt && kt && At === "", Ft = I((e) => {
1970
- if (K == null || (jt(), !e?.consumeQuery)) return;
1971
- Dt.current?.focus();
1972
- let t = `${K.triggerPrefix}${At}`;
1973
- if (!Z.startsWith(t)) return;
1974
- let n = Z.slice(t.length);
1975
- Q(n), J.notifyChange(), d?.(n);
1965
+ textareaRef: Q
1966
+ }), { isMenuOpen: kt, query: At, dismiss: jt, handleValueChange: Mt } = je({
1967
+ config: q,
1968
+ message: X
1969
+ }), Nt = q?.emptyQueryHint != null, Pt = Nt && kt && At === "", Ft = L((e) => {
1970
+ if (q == null || (jt(), !e?.consumeQuery)) return;
1971
+ Q.current?.focus();
1972
+ let t = `${q.triggerPrefix}${At}`;
1973
+ if (!X.startsWith(t)) return;
1974
+ let n = X.slice(t.length);
1975
+ Z(n), xt.notifyChange(), s?.(n);
1976
1976
  }, [
1977
- K,
1977
+ q,
1978
1978
  jt,
1979
1979
  At,
1980
+ X,
1980
1981
  Z,
1981
- Q,
1982
- J,
1983
- d,
1984
- Dt
1982
+ xt,
1983
+ s,
1984
+ Q
1985
1985
  ]);
1986
- L(() => {
1986
+ R(() => {
1987
1987
  if (St == null) return;
1988
1988
  let e = new ResizeObserver((e) => {
1989
1989
  let t = e[0];
@@ -1991,130 +1991,130 @@ var Rt = {
1991
1991
  });
1992
1992
  return e.observe(St), () => e.disconnect();
1993
1993
  }, [St]);
1994
- let { attachments: It, buildAttachments: Lt, addAttachments: Rt, resetAttachments: zt, handleRemove: Bt, handleRetry: Vt, handleExpand: Ht, hasBlockedAttachments: Wt } = Oe({
1995
- initialAttachments: ge,
1994
+ let { attachments: It, buildAttachments: Lt, addAttachments: Rt, resetAttachments: zt, handleRemove: Bt, handleRetry: Vt, handleExpand: Ht, hasBlockedAttachments: Ut } = ke({
1995
+ initialAttachments: he,
1996
1996
  onUploadAttachment: i,
1997
- onAttachmentsChange: f,
1998
- validateAttachment: st,
1999
- pendingDropFiles: P,
2000
- onDropFilesConsumed: oe,
2001
- pendingAttachments: le,
2002
- onPendingAttachmentsConsumed: ue,
2003
- onExpandPastedText: I((e) => {
2004
- Q((t) => t ? `${t}\n${e}` : e);
2005
- }, [Q]),
2006
- maximumAttachmentsAmount: ut,
2007
- baseAttachmentsAmount: Be.length,
2008
- onAttachmentsLimitExceeded: mt
2009
- }), Gt = I((e) => {
1997
+ onAttachmentsChange: u,
1998
+ validateAttachment: at,
1999
+ pendingDropFiles: F,
2000
+ onDropFilesConsumed: ae,
2001
+ pendingAttachments: oe,
2002
+ onPendingAttachmentsConsumed: se,
2003
+ onExpandPastedText: L((e) => {
2004
+ Z((t) => t ? `${t}\n${e}` : e);
2005
+ }, [Z]),
2006
+ maximumAttachmentsAmount: lt,
2007
+ baseAttachmentsAmount: Ie.length,
2008
+ onAttachmentsLimitExceeded: ut
2009
+ }), Wt = L((e) => {
2010
2010
  Rt(Lt([e]));
2011
- }, [Rt, Lt]), Kt = z(!1), qt = z(Z);
2012
- qt.current = Z;
2013
- let [Jt, Yt] = B({
2011
+ }, [Rt, Lt]), Kt = B(!1), qt = B(X);
2012
+ qt.current = X;
2013
+ let [Jt, Yt] = V({
2014
2014
  text: "",
2015
2015
  revision: 0
2016
- }), { state: Xt, analyserNodeRef: Zt, errorMessage: Qt, startRecording: $t, stopRecording: en, discardRecording: tn } = We({
2017
- onAttachAudio: Gt,
2018
- onTranscribeAudio: je,
2019
- onTranscript: I((e) => {
2016
+ }), { state: Xt, analyserNodeRef: Zt, errorMessage: Qt, startRecording: $t, stopRecording: en, discardRecording: tn } = Ge({
2017
+ onAttachAudio: Wt,
2018
+ onTranscribeAudio: Oe,
2019
+ onTranscript: L((e) => {
2020
2020
  let t = e.trim();
2021
2021
  if (t) {
2022
2022
  let e = qt.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2023
- qt.current = n, Q(n), Yt((e) => ({
2023
+ qt.current = n, Z(n), Yt((e) => ({
2024
2024
  text: t,
2025
2025
  revision: e.revision + 1
2026
- })), J.notifyChange(), d?.(n);
2026
+ })), xt.notifyChange(), s?.(n);
2027
2027
  }
2028
2028
  Kt.current = !0;
2029
2029
  }, [
2030
- Q,
2031
- J,
2032
- d
2030
+ Z,
2031
+ xt,
2032
+ s
2033
2033
  ]),
2034
- errorLabel: Fe
2035
- }), $ = Xt === Re.Recording || Xt === Re.Processing;
2036
- L(() => {
2037
- (Xt === Re.Error || Xt === Re.Idle && Kt.current) && (Kt.current = !1, Dt.current?.focus());
2038
- }, [Xt, Dt]);
2039
- let nn = z(null), rn = z(null), an = ht && gt, { handlePaste: on } = Ce(Rt, an ? de : Infinity), sn = I((e) => {
2034
+ errorLabel: Me
2035
+ }), $ = Xt === ze.Recording || Xt === ze.Processing;
2036
+ R(() => {
2037
+ (Xt === ze.Error || Xt === ze.Idle && Kt.current) && (Kt.current = !1, Q.current?.focus());
2038
+ }, [Xt, Q]);
2039
+ let nn = B(null), rn = B(null), an = dt && ht, { handlePaste: on } = Ce(Rt, an ? ue : Infinity), sn = L((e) => {
2040
2040
  if (!an) {
2041
2041
  let t = e.clipboardData.getData("text/plain");
2042
- t.length >= F && vt?.(t.length, F);
2042
+ t.length >= I && _t?.(t.length, I);
2043
2043
  }
2044
2044
  on(e);
2045
2045
  }, [
2046
2046
  an,
2047
- F,
2048
- vt,
2047
+ I,
2048
+ _t,
2049
2049
  on
2050
- ]), cn = Z.trim().length > 0 || It.length > 0 || Y, ln = cn && !Wt && !G && !$, [un, dn] = B([]);
2051
- L(() => {
2050
+ ]), cn = X.trim().length > 0 || It.length > 0 || Y, ln = cn && !Ut && !Te && !$, [un, dn] = V([]);
2051
+ R(() => {
2052
2052
  dn([]);
2053
- }, [(Ue ?? []).map((e) => e.id).join("|")]);
2054
- let fn = R(() => {
2055
- let e = Ue ?? [];
2056
- return Je ? e.filter((e) => e.isSelected || !un.includes(e.id)) : e;
2053
+ }, [(He ?? []).map((e) => e.id).join("|")]);
2054
+ let fn = z(() => {
2055
+ let e = He ?? [];
2056
+ return We ? e.filter((e) => e.isSelected || !un.includes(e.id)) : e;
2057
2057
  }, [
2058
- Ue,
2058
+ He,
2059
2059
  un,
2060
- Je
2061
- ]), pn = I((e) => {
2062
- dn((t) => t.includes(e) ? t : [...t, e]), Ue?.find((t) => t.id === e)?.isSelected && qe?.(e);
2063
- }, [Ue, qe]), mn = fe === void 0 || pe != null, hn = De && !o, gn = async () => {
2064
- if (G || $) return;
2065
- if (Z.length >= F) {
2066
- vt?.(Z.length, F);
2060
+ We
2061
+ ]), pn = L((e) => {
2062
+ dn((t) => t.includes(e) ? t : [...t, e]), He?.find((t) => t.id === e)?.isSelected && Ue?.(e);
2063
+ }, [He, Ue]), mn = de === void 0 || fe != null, hn = Ee && !o, gn = async () => {
2064
+ if (Te || $) return;
2065
+ if (X.length >= I) {
2066
+ _t?.(X.length, I);
2067
2067
  return;
2068
2068
  }
2069
- let e = Z, t = It;
2070
- Q(""), J.reset();
2069
+ let e = X, t = It;
2070
+ Z(""), xt.reset();
2071
2071
  try {
2072
2072
  await r?.(e, t), t.forEach((e) => {
2073
2073
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
2074
2074
  }), zt([]);
2075
2075
  } catch {
2076
- Q(e), zt(t);
2076
+ Z(e), zt(t);
2077
2077
  }
2078
2078
  }, _n = (e) => {
2079
2079
  if (!$ && !Ot(e)) {
2080
- if (!e.nativeEvent.isComposing && !Te && !o) {
2080
+ if (!e.nativeEvent.isComposing && !G && !o) {
2081
2081
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2082
- let t = e.currentTarget.selectionStart ?? 0, n = J.navigate(e.key === "ArrowUp" ? "up" : "down", Z, t);
2082
+ let t = e.currentTarget.selectionStart ?? 0, n = xt.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
2083
2083
  if (n !== null) {
2084
- e.preventDefault(), Q(n);
2084
+ e.preventDefault(), Z(n);
2085
2085
  return;
2086
2086
  }
2087
2087
  }
2088
- if (e.key === "Backspace" && Y && et != null && e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === 0) {
2089
- e.preventDefault(), et();
2088
+ if (e.key === "Backspace" && Y && $e != null && e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === 0) {
2089
+ e.preventDefault(), $e();
2090
2090
  return;
2091
2091
  }
2092
2092
  }
2093
- e.key === "Enter" && (Ie === Ge.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o && ln && mn && !Te && gn());
2093
+ e.key === "Enter" && (Ne === Ke.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o && ln && mn && !G && gn());
2094
2094
  }
2095
2095
  }, vn = (e) => {
2096
2096
  let t = Array.from(e.target.files ?? []);
2097
2097
  if (t.length === 0) return;
2098
2098
  let n = Lt(t);
2099
2099
  e.target.value = "", Rt(n);
2100
- }, yn = /* @__PURE__ */ H("textarea", {
2101
- className: c(q.textarea, Y && q.textareaIndented, ie?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2102
- ref: Dt,
2103
- autoFocus: tt,
2104
- value: Z,
2100
+ }, yn = /* @__PURE__ */ U("textarea", {
2101
+ className: l(J.textarea, Y && J.textareaIndented, M?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2102
+ ref: Q,
2103
+ autoFocus: et,
2104
+ value: X,
2105
2105
  onChange: (e) => {
2106
- Q(e.target.value), J.notifyChange();
2106
+ Z(e.target.value), xt.notifyChange();
2107
2107
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
2108
- Mt(e.target.value, t?.isComposing ?? !1, t?.inputType), d?.(e.target.value);
2108
+ Mt(e.target.value, t?.isComposing ?? !1, t?.inputType), s?.(e.target.value);
2109
2109
  },
2110
2110
  onKeyDown: _n,
2111
2111
  onPaste: sn,
2112
- placeholder: Y ? void 0 : g,
2113
- "aria-label": y,
2114
- disabled: Te,
2112
+ placeholder: Y ? void 0 : p,
2113
+ "aria-label": m,
2114
+ disabled: G,
2115
2115
  readOnly: $,
2116
2116
  rows: 1
2117
- }), bn = K == null ? yn : /* @__PURE__ */ H(h, {
2117
+ }), bn = q == null ? yn : /* @__PURE__ */ U(_, {
2118
2118
  className: "w-full",
2119
2119
  open: kt,
2120
2120
  onOpenChange: (e) => {
@@ -2124,91 +2124,91 @@ var Rt = {
2124
2124
  trigger: [],
2125
2125
  initialFocus: -1,
2126
2126
  matchReferenceWidth: !1,
2127
- outsidePressIgnoreRef: Dt,
2127
+ outsidePressIgnoreRef: Q,
2128
2128
  renderOverlay: () => {
2129
- let e = K.renderMenu({
2129
+ let e = q.renderMenu({
2130
2130
  query: At,
2131
2131
  close: Ft
2132
2132
  });
2133
- return K.menuLabel == null ? e : /* @__PURE__ */ H("div", {
2133
+ return q.menuLabel == null ? e : /* @__PURE__ */ U("div", {
2134
2134
  role: "group",
2135
- "aria-label": K.menuLabel,
2135
+ "aria-label": q.menuLabel,
2136
2136
  children: e
2137
2137
  });
2138
2138
  },
2139
2139
  children: yn
2140
- }), xn = Y || Nt ? /* @__PURE__ */ U("div", {
2140
+ }), xn = Y || Nt ? /* @__PURE__ */ W("div", {
2141
2141
  className: "relative w-full",
2142
2142
  children: [
2143
- Y && /* @__PURE__ */ H("div", {
2143
+ Y && /* @__PURE__ */ U("div", {
2144
2144
  ref: Ct,
2145
2145
  className: "absolute start-0 top-0",
2146
- children: $e
2146
+ children: Qe
2147
2147
  }),
2148
- Pt && K != null && /* @__PURE__ */ U("span", {
2149
- className: c(q.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0", ie?.fontClassName || "dial-body-paragraph-text"),
2148
+ Pt && q != null && /* @__PURE__ */ W("span", {
2149
+ className: l(J.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0", M?.fontClassName || "dial-body-paragraph-text"),
2150
2150
  "aria-hidden": !0,
2151
- children: [/* @__PURE__ */ H("span", {
2151
+ children: [/* @__PURE__ */ U("span", {
2152
2152
  className: "invisible",
2153
- children: K.triggerPrefix
2154
- }), K.emptyQueryHint]
2153
+ children: q.triggerPrefix
2154
+ }), q.emptyQueryHint]
2155
2155
  }),
2156
2156
  bn
2157
2157
  ]
2158
- }) : bn, Sn = _e ? void 0 : /* @__PURE__ */ H(rt, {
2159
- onAttachClick: ve ? void 0 : () => nn.current?.click(),
2160
- attachLabel: b,
2158
+ }) : bn, Sn = ge ? void 0 : /* @__PURE__ */ U(it, {
2159
+ onAttachClick: _e ? void 0 : () => nn.current?.click(),
2160
+ attachLabel: v,
2161
2161
  addMenuTitle: S,
2162
2162
  menuTitle: C,
2163
2163
  menuCloseLabel: w,
2164
2164
  style: Et,
2165
- isDisabled: Te || $,
2166
- chatSettings: He,
2167
- extraMenuItems: X,
2168
- onRecordVoice: ke && ht && !o && !$ ? () => $t(ze.Attachment) : void 0,
2169
- recordVoiceLabel: j,
2170
- toolsMenuItems: Je ? Ue : void 0,
2171
- onToolToggle: qe,
2172
- toolsMenuTitle: Ye,
2173
- toolsBackLabel: Xe,
2174
- menuOverlays: Qe
2175
- }), Cn = xe === Ke.Inline && (!yt || Se), wn = Sn && /* @__PURE__ */ H("div", {
2176
- className: c("flex", W.addCluster),
2165
+ isDisabled: G || $,
2166
+ chatSettings: Ve,
2167
+ extraMenuItems: Dt,
2168
+ onRecordVoice: De && dt && !o && !$ ? () => $t(Be.Attachment) : void 0,
2169
+ recordVoiceLabel: A,
2170
+ toolsMenuItems: We ? He : void 0,
2171
+ onToolToggle: Ue,
2172
+ toolsMenuTitle: Je,
2173
+ toolsBackLabel: Ye,
2174
+ menuOverlays: Ze
2175
+ }), Cn = ye === qe.Inline && (!vt || be), wn = Sn && /* @__PURE__ */ U("div", {
2176
+ className: l("flex", K.addCluster),
2177
2177
  children: Sn
2178
- }), Tn = fn.length > 0 && qe != null && /* @__PURE__ */ H("div", {
2179
- className: c("min-w-0 flex-1", W.toolsChips),
2180
- children: /* @__PURE__ */ H(ot, {
2178
+ }), Tn = fn.length > 0 && Ue != null && /* @__PURE__ */ U("div", {
2179
+ className: l("min-w-0 flex-1", K.toolsChips),
2180
+ children: /* @__PURE__ */ U(st, {
2181
2181
  items: fn,
2182
- onToolToggle: qe,
2182
+ onToolToggle: Ue,
2183
2183
  onToolDismiss: pn,
2184
- canRemove: Je,
2185
- removeLabel: Ze?.removeLabel
2184
+ canRemove: We,
2185
+ removeLabel: Xe?.removeLabel
2186
2186
  })
2187
2187
  });
2188
- return /* @__PURE__ */ U("div", {
2188
+ return /* @__PURE__ */ W("div", {
2189
2189
  ref: rn,
2190
2190
  style: Et,
2191
- className: c(q.wrapper, Te && q.wrapperDisabled, Te && "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", It.length > 6 ? "py-4 ps-4" : "p-4", N, W.wrapper),
2191
+ className: l(J.wrapper, G && J.wrapperDisabled, G && "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", It.length > 6 ? "py-4 ps-4" : "p-4", P, K.wrapper),
2192
2192
  children: [
2193
- (Be.length > 0 || It.length > 0) && /* @__PURE__ */ H(be, {
2194
- attachments: [...Be, ...It],
2193
+ (Ie.length > 0 || It.length > 0) && /* @__PURE__ */ U(xe, {
2194
+ attachments: [...Ie, ...It],
2195
2195
  onRemove: (e) => {
2196
- Be.some((t) => t.id === e) ? Ve?.(e) : Bt(e);
2196
+ Ie.some((t) => t.id === e) ? Le?.(e) : Bt(e);
2197
2197
  },
2198
2198
  onRetry: Vt,
2199
2199
  onExpand: Ht,
2200
2200
  labels: {
2201
2201
  removeLabel: T,
2202
- retryLabel: E,
2203
- uploadingLabel: D
2202
+ retryLabel: ee,
2203
+ uploadingLabel: E
2204
2204
  },
2205
- styles: ae,
2206
- onAttachmentClick: ct == null ? void 0 : (e) => {
2207
- let t = [...Be, ...It].find((t) => t.id === e);
2208
- t != null && ct(t);
2205
+ styles: N,
2206
+ onAttachmentClick: ot == null ? void 0 : (e) => {
2207
+ let t = [...Ie, ...It].find((t) => t.id === e);
2208
+ t != null && ot(t);
2209
2209
  }
2210
2210
  }),
2211
- !_e && /* @__PURE__ */ H("input", {
2211
+ !ge && /* @__PURE__ */ U("input", {
2212
2212
  ref: nn,
2213
2213
  type: "file",
2214
2214
  multiple: !0,
@@ -2218,11 +2218,11 @@ var Rt = {
2218
2218
  tabIndex: -1,
2219
2219
  onChange: vn
2220
2220
  }),
2221
- Qt && /* @__PURE__ */ H(_, {
2221
+ Qt && /* @__PURE__ */ U(y, {
2222
2222
  text: Qt,
2223
2223
  className: "min-w-0 break-words px-1"
2224
2224
  }),
2225
- $ && /* @__PURE__ */ H(dt, {
2225
+ $ && /* @__PURE__ */ U(ft, {
2226
2226
  embedded: !0,
2227
2227
  state: Xt,
2228
2228
  analyserNodeRef: Zt,
@@ -2230,106 +2230,106 @@ var Rt = {
2230
2230
  onStop: en,
2231
2231
  onDiscard: tn,
2232
2232
  attachButton: Sn,
2233
- stopLabel: ne,
2234
- discardLabel: re,
2235
- processingLabel: Me
2233
+ stopLabel: re,
2234
+ discardLabel: ie,
2235
+ processingLabel: Ae
2236
2236
  }),
2237
- !$ && ye && xn,
2238
- !$ && !ye && Cn && Tn && /* @__PURE__ */ H("div", {
2237
+ !$ && ve && xn,
2238
+ !$ && !ve && Cn && Tn && /* @__PURE__ */ U("div", {
2239
2239
  className: "flex",
2240
2240
  children: Tn
2241
2241
  }),
2242
- !$ && !ye && /* @__PURE__ */ U("div", {
2243
- className: c("flex items-center gap-2", Cn ? "flex-nowrap" : "flex-wrap", W.actionRow),
2242
+ !$ && !ve && /* @__PURE__ */ W("div", {
2243
+ className: l("flex items-center gap-2", Cn ? "flex-nowrap" : "flex-wrap", K.actionRow),
2244
2244
  children: [
2245
2245
  Cn && wn,
2246
- /* @__PURE__ */ H("div", {
2247
- className: c("flex min-w-0 items-center self-stretch", Cn ? "flex-1" : "w-full", W.textareaWrap),
2246
+ /* @__PURE__ */ U("div", {
2247
+ className: l("flex min-w-0 items-center self-stretch", Cn ? "flex-1" : "w-full", K.textareaWrap),
2248
2248
  children: xn
2249
2249
  }),
2250
2250
  !Cn && wn,
2251
2251
  !Cn && Tn,
2252
- /* @__PURE__ */ H("div", {
2253
- className: c("ms-auto flex flex-shrink-0 items-center gap-2", W.footerActions),
2254
- children: we ? we({
2252
+ /* @__PURE__ */ U("div", {
2253
+ className: l("ms-auto flex flex-shrink-0 items-center gap-2", K.footerActions),
2254
+ children: Se ? Se({
2255
2255
  canSend: ln,
2256
2256
  onSend: gn
2257
- }) : /* @__PURE__ */ U(V, { children: [
2258
- _t,
2259
- /* @__PURE__ */ H(Ut, {
2260
- deployments: fe,
2261
- selectedDeploymentId: pe,
2262
- onDeploymentChange: me,
2263
- modelSelectorLabels: he,
2257
+ }) : /* @__PURE__ */ W(H, { children: [
2258
+ gt,
2259
+ /* @__PURE__ */ U(Gt, {
2260
+ deployments: de,
2261
+ selectedDeploymentId: fe,
2262
+ onDeploymentChange: pe,
2263
+ modelSelectorLabels: me,
2264
2264
  isStreaming: o,
2265
- isMobile: yt,
2266
- isDisabled: Ee,
2265
+ isMobile: vt,
2266
+ isDisabled: we,
2267
2267
  style: Et,
2268
- modelPickerOverlay: lt,
2269
- isPickerOpen: bt,
2270
- onPickerToggle: () => xt((e) => !e),
2271
- onPickerOpenChange: xt
2268
+ modelPickerOverlay: ct,
2269
+ isPickerOpen: yt,
2270
+ onPickerToggle: () => bt((e) => !e),
2271
+ onPickerOpenChange: bt
2272
2272
  }),
2273
- hn && /* @__PURE__ */ H(v, {
2274
- icon: /* @__PURE__ */ H(ce, {
2275
- size: p.LG,
2276
- stroke: m,
2273
+ hn && /* @__PURE__ */ U(b, {
2274
+ icon: /* @__PURE__ */ U(le, {
2275
+ size: h.LG,
2276
+ stroke: g,
2277
2277
  "aria-hidden": !0
2278
2278
  }),
2279
- "aria-label": te,
2280
- tooltipProps: { tooltip: te },
2279
+ "aria-label": ne,
2280
+ tooltipProps: { tooltip: ne },
2281
2281
  className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
2282
- onClick: () => $t(ze.Dictation),
2283
- disabled: Te || o
2282
+ onClick: () => $t(Be.Dictation),
2283
+ disabled: G || o
2284
2284
  }),
2285
- o && a ? /* @__PURE__ */ H(pt, {
2285
+ o && a ? /* @__PURE__ */ U(mt, {
2286
2286
  onStop: a,
2287
- ariaLabel: A
2288
- }) : !o && /* @__PURE__ */ H(ft, {
2287
+ ariaLabel: k
2288
+ }) : !o && /* @__PURE__ */ U(pt, {
2289
2289
  onSend: gn,
2290
2290
  isDisabled: !mn || !ln,
2291
- ariaLabel: O,
2292
- sendTooltip: cn ? k : ee ?? k
2291
+ ariaLabel: D,
2292
+ sendTooltip: cn ? O : te ?? O
2293
2293
  })
2294
2294
  ] })
2295
2295
  })
2296
2296
  ]
2297
2297
  }),
2298
- /* @__PURE__ */ H("span", {
2298
+ /* @__PURE__ */ U("span", {
2299
2299
  className: "sr-only",
2300
2300
  role: "status",
2301
2301
  "aria-live": "polite",
2302
2302
  "aria-atomic": "true",
2303
- children: /* @__PURE__ */ H("span", { children: Jt.text }, Jt.revision)
2303
+ children: /* @__PURE__ */ U("span", { children: Jt.text }, Jt.revision)
2304
2304
  })
2305
2305
  ]
2306
2306
  });
2307
- }, Gt = {
2307
+ }, qt = {
2308
2308
  welcome: "_welcome_1icyo_1",
2309
2309
  description: "_description_1icyo_5"
2310
- }, Kt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, styles: i, className: a, inputClassName: o, isInputDisabled: l = !1, ...u }) => {
2310
+ }, Jt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, styles: i, className: a, inputClassName: o, isInputDisabled: s = !1, ...u }) => {
2311
2311
  let { colors: d, typography: f, attachmentTray: p } = i ?? {};
2312
- return /* @__PURE__ */ U("div", {
2313
- style: s({
2312
+ return /* @__PURE__ */ W("div", {
2313
+ style: c({
2314
2314
  "--ci-welcome-color": d?.welcomeText,
2315
2315
  "--ci-description-color": d?.descriptionText
2316
2316
  }),
2317
- className: c("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", a),
2318
- children: [n && /* @__PURE__ */ U("div", {
2317
+ className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", a),
2318
+ children: [n && /* @__PURE__ */ W("div", {
2319
2319
  className: "flex flex-col items-center gap-4 text-center",
2320
- children: [/* @__PURE__ */ H("h1", {
2321
- className: c(Gt.welcome, "m-0", f?.welcomeClassName || "dial-display2-text"),
2320
+ children: [/* @__PURE__ */ U("h1", {
2321
+ className: l(qt.welcome, "m-0", f?.welcomeClassName || "dial-display2-text"),
2322
2322
  children: n
2323
- }), r && /* @__PURE__ */ H("p", {
2324
- className: c(Gt.description, "m-0 max-w-[540px]", f?.descriptionClassName || "dial-body-paragraph-text"),
2323
+ }), r && /* @__PURE__ */ U("p", {
2324
+ className: l(qt.description, "m-0 max-w-[540px]", f?.descriptionClassName || "dial-body-paragraph-text"),
2325
2325
  children: r
2326
2326
  })]
2327
- }), /* @__PURE__ */ H("div", {
2328
- className: c("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
2329
- children: /* @__PURE__ */ H(Wt, {
2327
+ }), /* @__PURE__ */ U("div", {
2328
+ className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
2329
+ children: /* @__PURE__ */ U(Kt, {
2330
2330
  placeholder: t,
2331
2331
  isStreaming: e,
2332
- isInputDisabled: l,
2332
+ isInputDisabled: s,
2333
2333
  ...u,
2334
2334
  className: o,
2335
2335
  colors: d?.input,
@@ -2338,101 +2338,101 @@ var Rt = {
2338
2338
  })
2339
2339
  })]
2340
2340
  });
2341
- }, qt = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: a, onSave: o, onUploadAttachment: s, cancelLabel: l = "Cancel", saveLabel: d = "Save & Submit", ariaLabel: f, removeLabel: p, retryLabel: h, uploadingLabel: g, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: S, pendingDropFiles: C, onDropFilesConsumed: T, validateAttachment: E, isAttachmentsEnabled: D, isTextAttachmentsAllowed: O, hideAttachFile: k = !1, fileAccept: ee, maximumAttachmentsAmount: A, onAttachmentsLimitExceeded: te, onDialFileSystemClick: j, dialFileSystemLabel: ne, pendingAttachments: re, onPendingAttachmentsConsumed: M, onAttachmentClick: ie, pasteTextThreshold: ae, maxMessageLength: N = 5e4, onMessageTooLong: P }) => {
2342
- let oe = z(null), [ce, le] = B([]);
2343
- L(() => {
2344
- C?.length && (le(C), T?.());
2345
- }, [C, T]);
2346
- let [ue, de] = B(e ?? ""), [F, fe] = B([]), [pe, me] = B(r), he = F.some((e) => e.status === i.Loading || e.status === i.Error), ge = (ue.trim().length > 0 || F.length > 0 || pe.length > 0) && !he, _e = (e) => {
2347
- me((t) => t.filter((t) => t.id !== e));
2348
- }, ve = I((e, t) => {
2349
- o(e, pe, t);
2350
- }, [pe, o]), ye = () => {
2351
- if (ge) {
2352
- if (ue.length >= N) {
2353
- P?.(ue.length, N);
2341
+ }, Yt = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: i, onSave: o, onUploadAttachment: s, cancelLabel: c = "Cancel", saveLabel: u = "Save & Submit", ariaLabel: d, removeLabel: p, retryLabel: m, uploadingLabel: h, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: x, pendingDropFiles: S, onDropFilesConsumed: w, validateAttachment: T, isAttachmentsEnabled: E, isTextAttachmentsAllowed: D, hideAttachFile: O = !1, fileAccept: te, maximumAttachmentsAmount: k, onAttachmentsLimitExceeded: ne, onDialFileSystemClick: A, dialFileSystemLabel: re, pendingAttachments: ie, onPendingAttachmentsConsumed: j, onAttachmentClick: M, pasteTextThreshold: N, maxMessageLength: P = 5e4, onMessageTooLong: F }) => {
2342
+ let ae = B(null), [oe, se] = V([]);
2343
+ R(() => {
2344
+ S?.length && (se(S), w?.());
2345
+ }, [S, w]);
2346
+ let [le, ue] = V(e ?? ""), [I, de] = V([]), [fe, pe] = V(r), me = I.some((e) => e.status === a.Loading || e.status === a.Error), he = (le.trim().length > 0 || I.length > 0 || fe.length > 0) && !me, ge = (e) => {
2347
+ pe((t) => t.filter((t) => t.id !== e));
2348
+ }, _e = L((e, t) => {
2349
+ o(e, fe, t);
2350
+ }, [fe, o]), ve = () => {
2351
+ if (he) {
2352
+ if (le.length >= P) {
2353
+ F?.(le.length, P);
2354
2354
  return;
2355
2355
  }
2356
- ve(ue, F);
2356
+ _e(le, I);
2357
2357
  }
2358
- }, be = I(() => le([]), []), xe = I((e) => {
2358
+ }, ye = L(() => se([]), []), be = L((e) => {
2359
2359
  let t = Array.from(e.target.files ?? []);
2360
- t.length !== 0 && (e.target.value = "", le(t));
2361
- }, []), Se = R(() => j ? [{
2360
+ t.length !== 0 && (e.target.value = "", se(t));
2361
+ }, []), xe = z(() => A ? [{
2362
2362
  key: "dial-fs",
2363
- label: ne ?? "DIAL file system",
2364
- icon: /* @__PURE__ */ H(se, {
2365
- size: u,
2363
+ label: re ?? "DIAL file system",
2364
+ icon: /* @__PURE__ */ U(ce, {
2365
+ size: f,
2366
2366
  "aria-hidden": !0,
2367
- stroke: m
2367
+ stroke: g
2368
2368
  }),
2369
- onClick: j
2370
- }] : [], [j, ne]);
2371
- return /* @__PURE__ */ U("div", {
2372
- className: c("flex w-full flex-col gap-2", S),
2373
- children: [/* @__PURE__ */ H(Wt, {
2369
+ onClick: A
2370
+ }] : [], [A, re]);
2371
+ return /* @__PURE__ */ W("div", {
2372
+ className: l("flex w-full flex-col gap-2", x),
2373
+ children: [/* @__PURE__ */ U(Kt, {
2374
2374
  message: e,
2375
2375
  inlineStartSlot: t,
2376
2376
  onInlineStartRemove: n,
2377
- ariaLabel: f,
2377
+ ariaLabel: d,
2378
2378
  hideActionBar: !0,
2379
- pendingDropFiles: ce,
2380
- onDropFilesConsumed: be,
2381
- onSend: ve,
2379
+ pendingDropFiles: oe,
2380
+ onDropFilesConsumed: ye,
2381
+ onSend: _e,
2382
2382
  onUploadAttachment: s,
2383
- onChange: de,
2384
- onAttachmentsChange: fe,
2383
+ onChange: ue,
2384
+ onAttachmentsChange: de,
2385
2385
  removeLabel: p,
2386
- retryLabel: h,
2387
- uploadingLabel: g,
2386
+ retryLabel: m,
2387
+ uploadingLabel: h,
2388
2388
  className: "max-w-full",
2389
- prefixAttachments: pe,
2390
- onRemovePrefixAttachment: _e,
2391
- validateAttachment: E,
2392
- isAttachmentsEnabled: D,
2393
- isTextAttachmentsAllowed: O,
2394
- maximumAttachmentsAmount: A,
2395
- onAttachmentsLimitExceeded: te,
2396
- pendingAttachments: re,
2397
- onPendingAttachmentsConsumed: M,
2398
- onAttachmentClick: ie,
2399
- pasteTextThreshold: ae,
2400
- maxMessageLength: N,
2401
- onMessageTooLong: P
2402
- }), /* @__PURE__ */ U("div", {
2389
+ prefixAttachments: fe,
2390
+ onRemovePrefixAttachment: ge,
2391
+ validateAttachment: T,
2392
+ isAttachmentsEnabled: E,
2393
+ isTextAttachmentsAllowed: D,
2394
+ maximumAttachmentsAmount: k,
2395
+ onAttachmentsLimitExceeded: ne,
2396
+ pendingAttachments: ie,
2397
+ onPendingAttachmentsConsumed: j,
2398
+ onAttachmentClick: M,
2399
+ pasteTextThreshold: N,
2400
+ maxMessageLength: P,
2401
+ onMessageTooLong: F
2402
+ }), /* @__PURE__ */ W("div", {
2403
2403
  className: "flex items-center justify-between",
2404
- children: [/* @__PURE__ */ H("div", {
2404
+ children: [/* @__PURE__ */ U("div", {
2405
2405
  className: "flex",
2406
- children: !k && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("input", {
2407
- ref: oe,
2406
+ children: !O && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
2407
+ ref: ae,
2408
2408
  type: "file",
2409
2409
  multiple: !0,
2410
- accept: ee,
2410
+ accept: te,
2411
2411
  className: "sr-only",
2412
2412
  "aria-hidden": !0,
2413
2413
  tabIndex: -1,
2414
- onChange: xe
2415
- }), /* @__PURE__ */ H(rt, {
2416
- onAttachClick: () => oe.current?.click(),
2414
+ onChange: be
2415
+ }), /* @__PURE__ */ U(it, {
2416
+ onAttachClick: () => ae.current?.click(),
2417
2417
  attachLabel: v,
2418
2418
  addMenuTitle: _,
2419
2419
  menuTitle: y,
2420
2420
  menuCloseLabel: b,
2421
- extraMenuItems: Se
2421
+ extraMenuItems: xe
2422
2422
  })] })
2423
- }), /* @__PURE__ */ U("div", {
2423
+ }), /* @__PURE__ */ W("div", {
2424
2424
  className: "flex gap-2",
2425
- children: [/* @__PURE__ */ H(x, {
2426
- label: l,
2427
- onClick: a
2428
- }), /* @__PURE__ */ H(w, {
2429
- label: d,
2430
- onClick: ye,
2431
- disabled: !ge
2425
+ children: [/* @__PURE__ */ U(C, {
2426
+ label: c,
2427
+ onClick: i
2428
+ }), /* @__PURE__ */ U(ee, {
2429
+ label: u,
2430
+ onClick: ve,
2431
+ disabled: !he
2432
2432
  })]
2433
2433
  })]
2434
2434
  })]
2435
2435
  });
2436
2436
  };
2437
2437
  //#endregion
2438
- export { Ke as ActionRowLayout, G as BottomSheetShell, W as CONVERSATION_INPUT_CLASS, et as ChatSettingsModal, Kt as ConversationInput, qt as EditMessageInput, Wt as Input, Ge as SendOnEnter };
2438
+ export { qe as ActionRowLayout, De as BottomSheetShell, K as CONVERSATION_INPUT_CLASS, et as ChatSettingsModal, Jt as ConversationInput, Yt as EditMessageInput, Kt as Input, Ke as SendOnEnter };