@epam/ai-dial-conversation-input 1.1.0-dev.293 → 1.1.0-dev.296

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,43 +1,43 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RequestStatus as r, ResponseFormat as i, buildCssVars as a, mergeClasses as o, useIsMobile as s } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, Dropdown as p, ElementSize as m, ErrorText as h, GhostIconButton as g, Highlight as _, NeutralButton as v, Popup as y, PopupSize as b, PrimaryButton as x, PrimaryIconButton as S, RadioGroup as C, RadioGroupOrientation as w, Search as T, Skeleton as E, SkeletonVariant as D, Slider as O, StaticIconButton as k, Textarea as A, Tooltip as j } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as ee, IconArrowNarrowRight as te, IconCheck as M, IconChevronDown as ne, IconChevronRight as N, IconFile as re, IconMicrophone as ie, IconPaperclip as ae, IconPlayerStopFilled as P, IconPlaystationSquare as F, IconPlus as oe, IconPrompt as se, IconSettings as ce, IconTool as le, IconX as I } from "@tabler/icons-react";
4
- import { createPortal as ue } from "react-dom";
5
- import { createElement as L, memo as R, useCallback as z, useEffect as B, useImperativeHandle as de, useLayoutEffect as fe, useMemo as V, useRef as H, useState as U } from "react";
6
- import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
7
- import { AttachmentCard as pe, AttachmentGroup as me, AttachmentTray as he, AttachmentTray as ge, FileDndOverlay as _e, MAX_UPLOADS_PER_MINUTE as ve, generateAttachmentId as ye, getAttachmentIcon as be, useClipboardPaste as xe } from "@epam/ai-dial-attachment-input";
2
+ import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, Dropdown as p, ElementSize as m, ErrorText as h, GhostIconButton as g, Highlight as _, NeutralButton as v, Popup as y, PopupSize as b, PrimaryButton as x, PrimaryIconButton as S, RadioGroup as C, RadioGroupOrientation as w, Search as T, Skeleton as E, SkeletonVariant as D, Slider as O, StaticIconButton as k, Textarea as ee, Tooltip as A } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowLeft as te, IconArrowNarrowRight as ne, IconCheck as j, IconChevronDown as re, IconChevronRight as M, IconFile as ie, IconMicrophone as ae, IconPaperclip as oe, IconPlayerStopFilled as N, IconPlaystationSquare as P, IconPlus as se, IconPrompt as ce, IconSettings as le, IconTool as ue, IconX as de } from "@tabler/icons-react";
4
+ import { createPortal as fe } from "react-dom";
5
+ import { createElement as F, memo as I, useCallback as L, useEffect as R, useImperativeHandle as pe, useLayoutEffect as me, useMemo as z, useRef as B, useState as V } from "react";
6
+ import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
7
+ import { AttachmentTray as he, MAX_UPLOADS_PER_MINUTE as ge, generateAttachmentId as _e, useClipboardPaste as ve } from "@epam/ai-dial-attachment-input";
8
8
  //#region src/hooks/useBottomSheet.ts
9
- var Se = (e, t) => {
10
- B(() => {
9
+ var ye = (e, t) => {
10
+ R(() => {
11
11
  if (!e) return;
12
12
  let n = (e) => {
13
13
  e.key === "Escape" && t();
14
14
  };
15
15
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
16
- }, [e, t]), B(() => {
16
+ }, [e, t]), R(() => {
17
17
  if (e) return document.body.style.overflow = "hidden", () => {
18
18
  document.body.style.overflow = "";
19
19
  };
20
20
  }, [e]);
21
- }, Ce = {
21
+ }, be = {
22
22
  backdrop: "_backdrop_1d50f_9",
23
23
  sheet: "_sheet_1d50f_13",
24
24
  "slide-up": "_slide-up_1d50f_1",
25
25
  title: "_title_1d50f_18",
26
26
  divider: "_divider_1d50f_22"
27
- }, q = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: s, "aria-label": c, style: l, titleClassName: f = "dial-body-semi-text", className: p, colors: h, children: _ }) => {
28
- if (Se(e, r), !e || typeof document > "u") return null;
27
+ }, G = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: s, "aria-label": c, style: l, titleClassName: f = "dial-body-semi-text", className: p, colors: h, children: _ }) => {
28
+ if (ye(e, r), !e || typeof document > "u") return null;
29
29
  let v = a({
30
30
  "--ci-backdrop": h?.backdrop,
31
31
  "--ci-sheet-bg": h?.sheetBg,
32
32
  "--ci-sheet-text": h?.sheetText,
33
33
  "--ci-sheet-divider": h?.divider
34
34
  });
35
- return ue(/* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
36
- className: o(Ce.backdrop, "fixed inset-0 z-[55]"),
35
+ return fe(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
36
+ className: o(be.backdrop, "fixed inset-0 z-[55]"),
37
37
  style: v,
38
38
  onPointerDown: r,
39
39
  "aria-hidden": !0
40
- }), /* @__PURE__ */ K("div", {
40
+ }), /* @__PURE__ */ W("div", {
41
41
  role: "dialog",
42
42
  "aria-modal": !0,
43
43
  "aria-label": t ?? c,
@@ -45,14 +45,14 @@ var Se = (e, t) => {
45
45
  ...v,
46
46
  ...l
47
47
  },
48
- className: o(Ce.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", p),
49
- children: [t != null && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("div", {
48
+ className: o(be.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", p),
49
+ children: [t != null && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("div", {
50
50
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
51
51
  children: [
52
- i && /* @__PURE__ */ G("div", {
52
+ i && /* @__PURE__ */ U("div", {
53
53
  className: "absolute start-4",
54
- children: /* @__PURE__ */ G(g, {
55
- icon: /* @__PURE__ */ G(ee, {
54
+ children: /* @__PURE__ */ U(g, {
55
+ icon: /* @__PURE__ */ U(te, {
56
56
  size: d.LG,
57
57
  stroke: 1.5,
58
58
  className: "rtl:scale-x-[-1]"
@@ -61,41 +61,41 @@ var Se = (e, t) => {
61
61
  onClick: i
62
62
  })
63
63
  }),
64
- /* @__PURE__ */ G("span", {
65
- className: o(Ce.title, f),
64
+ /* @__PURE__ */ U("span", {
65
+ className: o(be.title, f),
66
66
  children: t
67
67
  }),
68
- /* @__PURE__ */ G("div", {
68
+ /* @__PURE__ */ U("div", {
69
69
  className: "absolute end-4 m-2",
70
- children: /* @__PURE__ */ G(u, {
70
+ children: /* @__PURE__ */ U(u, {
71
71
  ariaLabel: n,
72
72
  onClose: r,
73
73
  size: m.Standard
74
74
  })
75
75
  })
76
76
  ]
77
- }), /* @__PURE__ */ G("div", { className: o(Ce.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ G("div", {
77
+ }), /* @__PURE__ */ U("div", { className: o(be.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ U("div", {
78
78
  className: "overflow-y-auto",
79
79
  children: _
80
80
  })]
81
81
  })] }), document.body);
82
- }, we = async (e, t, n) => {
82
+ }, xe = async (e, t, n) => {
83
83
  let r = 6e4 / t, i = [];
84
84
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
85
85
  await Promise.allSettled(i);
86
- }, Te = ({ initialAttachments: n, onUploadAttachment: i, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
87
- let [h, g] = U(n), _ = H(h);
88
- B(() => {
86
+ }, Se = ({ initialAttachments: n, onUploadAttachment: i, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
87
+ let [h, g] = V(n), _ = B(h);
88
+ R(() => {
89
89
  _.current = h;
90
- }, [h]), B(() => () => {
90
+ }, [h]), R(() => () => {
91
91
  _.current.forEach((e) => {
92
92
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
93
93
  });
94
94
  }, []);
95
- let v = z((e) => e.map((e) => {
95
+ let v = L((e) => e.map((e) => {
96
96
  let n = e.type.startsWith("image/"), i = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = i ? URL.createObjectURL(e) : void 0;
97
97
  return {
98
- id: ye(),
98
+ id: _e(),
99
99
  name: e.name,
100
100
  contentType: e.type,
101
101
  file: e,
@@ -104,26 +104,26 @@ var Se = (e, t) => {
104
104
  previewUrl: a,
105
105
  playUrl: o
106
106
  };
107
- }), []), y = H(a);
108
- B(() => {
107
+ }), []), y = B(a);
108
+ R(() => {
109
109
  y.current = a;
110
110
  }, [a]);
111
- let b = H(!0), x = z((e) => {
111
+ let b = B(!0), x = L((e) => {
112
112
  g((t) => {
113
113
  let n = e(t);
114
114
  return n === t ? t : n;
115
115
  });
116
116
  }, []);
117
- B(() => {
117
+ R(() => {
118
118
  if (b.current) {
119
119
  b.current = !1;
120
120
  return;
121
121
  }
122
122
  y.current?.(h);
123
123
  }, [h]);
124
- let S = z((e) => {
124
+ let S = L((e) => {
125
125
  g(e);
126
- }, []), C = z(async (t) => {
126
+ }, []), C = L(async (t) => {
127
127
  if (i) {
128
128
  x((e) => e.map((e) => e.id === t.id ? {
129
129
  ...e,
@@ -145,7 +145,7 @@ var Se = (e, t) => {
145
145
  } : e));
146
146
  }
147
147
  }
148
- }, [i, x]), w = z((e, t = !0) => {
148
+ }, [i, x]), w = L((e, t = !0) => {
149
149
  let n = new Set(_.current.map((e) => e.id)), i = e.filter((e) => !n.has(e.id));
150
150
  if (i.length !== 0) {
151
151
  if (f != null && f > 0 && Number.isFinite(f)) {
@@ -166,7 +166,7 @@ var Se = (e, t) => {
166
166
  status: r.Error,
167
167
  errorReason: n
168
168
  } : e));
169
- }), we(e, ve, C);
169
+ }), xe(e, ge, C);
170
170
  }
171
171
  }
172
172
  }, [
@@ -177,20 +177,20 @@ var Se = (e, t) => {
177
177
  C,
178
178
  o
179
179
  ]);
180
- B(() => {
180
+ R(() => {
181
181
  s.length !== 0 && (w(v(s)), c?.());
182
182
  }, [
183
183
  w,
184
184
  v,
185
185
  c,
186
186
  s
187
- ]), B(() => {
187
+ ]), R(() => {
188
188
  l.length !== 0 && (w(l, !1), u?.());
189
189
  }, [
190
190
  w,
191
191
  u,
192
192
  l
193
- ]), B(() => {
193
+ ]), R(() => {
194
194
  if (!o) return;
195
195
  let t = !1, n = [], i = _.current.map((i) => {
196
196
  if (i.status === r.Loading) return i;
@@ -217,7 +217,7 @@ var Se = (e, t) => {
217
217
  x,
218
218
  C
219
219
  ]);
220
- let T = z((e) => {
220
+ let T = L((e) => {
221
221
  x((t) => {
222
222
  let n = t.find((t) => t.id === e);
223
223
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
@@ -229,11 +229,11 @@ var Se = (e, t) => {
229
229
  addAttachments: w,
230
230
  resetAttachments: S,
231
231
  handleRemove: T,
232
- handleRetry: z((e) => {
232
+ handleRetry: L((e) => {
233
233
  let t = h.find((t) => t.id === e);
234
234
  t && C(t);
235
235
  }, [h, C]),
236
- handleExpand: z(async (e) => {
236
+ handleExpand: L(async (e) => {
237
237
  let n = h.find((t) => t.id === e);
238
238
  if (!n || n.type !== t.Pasted) return;
239
239
  let r = await n.file.text();
@@ -245,9 +245,9 @@ var Se = (e, t) => {
245
245
  ]),
246
246
  hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
247
247
  };
248
- }, Ee = (e, t) => {
249
- let [n, r] = U(e), [i, a] = U(!1), [o, s] = U(0);
250
- return B(() => {
248
+ }, Ce = (e, t) => {
249
+ let [n, r] = V(e), [i, a] = V(!1), [o, s] = V(0);
250
+ return R(() => {
251
251
  if (e) {
252
252
  r(!0), a(!1), s((e) => e + 1);
253
253
  return;
@@ -263,18 +263,18 @@ var Se = (e, t) => {
263
263
  isExiting: i,
264
264
  instanceKey: o
265
265
  };
266
- }, De = (e, t) => !e.slice(0, t).includes("\n"), Oe = (e, t) => !e.slice(t).includes("\n"), ke = (e) => {
267
- let t = H(e);
266
+ }, we = (e, t) => !e.slice(0, t).includes("\n"), Te = (e, t) => !e.slice(t).includes("\n"), Ee = (e) => {
267
+ let t = B(e);
268
268
  t.current = e;
269
- let n = H(-1), r = H(""), i = z((e, i, a) => {
269
+ let n = B(-1), r = B(""), i = L((e, i, a) => {
270
270
  let o = t.current;
271
- return !o || o.length === 0 ? null : e === "up" ? !De(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 || !Oe(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
272
- }, []), a = z(() => {
271
+ return !o || o.length === 0 ? null : e === "up" ? !we(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !Te(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
272
+ }, []), a = L(() => {
273
273
  n.current = -1, r.current = "";
274
- }, []), o = z(() => {
274
+ }, []), o = L(() => {
275
275
  n.current = -1, r.current = "";
276
276
  }, []);
277
- return V(() => ({
277
+ return z(() => ({
278
278
  navigate: i,
279
279
  notifyChange: a,
280
280
  reset: o
@@ -283,13 +283,13 @@ var Se = (e, t) => {
283
283
  a,
284
284
  o
285
285
  ]);
286
- }, Ae = ({ messageProp: e, messageRevision: t }) => {
287
- let [n, r] = U(e), i = H(null), a = H(0), [o, s] = U(!1);
288
- return B(() => {
286
+ }, De = ({ messageProp: e, messageRevision: t }) => {
287
+ let [n, r] = V(e), i = B(null), a = B(0), [o, s] = V(!1);
288
+ return R(() => {
289
289
  r(e);
290
- }, [e, t]), B(() => {
290
+ }, [e, t]), R(() => {
291
291
  i.current && (a.current = i.current.offsetHeight);
292
- }, []), fe(() => {
292
+ }, []), me(() => {
293
293
  if (!i.current || a.current === 0) return;
294
294
  let e = i.current.offsetHeight > a.current;
295
295
  s((t) => e ? !0 : n === "" ? !1 : t);
@@ -299,18 +299,18 @@ var Se = (e, t) => {
299
299
  textareaRef: i,
300
300
  isMultiLine: o
301
301
  };
302
- }, je = /* @__PURE__ */ function(e) {
302
+ }, Oe = /* @__PURE__ */ function(e) {
303
303
  return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
304
- }({}), Me = [
304
+ }({}), ke = [
305
305
  "audio/webm;codecs=opus",
306
306
  "audio/ogg;codecs=opus",
307
307
  "audio/webm"
308
- ], Ne = () => Me.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Pe = ({ onAttachAudio: e }) => {
309
- let [t, n] = U("idle"), [r, i] = U(null), a = H(null), o = H(null), s = H(null), c = H(null), l = H([]), u = H(""), d = H(e);
308
+ ], Ae = () => ke.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", je = ({ onAttachAudio: e }) => {
309
+ let [t, n] = V("idle"), [r, i] = V(null), a = B(null), o = B(null), s = B(null), c = B(null), l = B([]), u = B(""), d = B(e);
310
310
  d.current = e;
311
- let f = z(() => {
311
+ let f = L(() => {
312
312
  a.current &&= (a.current.getTracks().forEach((e) => e.stop()), null), o.current &&= (o.current.close(), null), s.current = null, c.current = null;
313
- }, []), p = z(() => {
313
+ }, []), p = L(() => {
314
314
  (async () => {
315
315
  try {
316
316
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
@@ -319,7 +319,7 @@ var Se = (e, t) => {
319
319
  o.current = t;
320
320
  let r = t.createAnalyser();
321
321
  r.fftSize = 256, s.current = r, t.createMediaStreamSource(e).connect(r);
322
- let i = Ne();
322
+ let i = Ae();
323
323
  u.current = i, l.current = [];
324
324
  let d = new MediaRecorder(e, i ? { mimeType: i } : void 0);
325
325
  c.current = d, d.ondataavailable = (e) => {
@@ -329,17 +329,17 @@ var Se = (e, t) => {
329
329
  i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
330
330
  }
331
331
  })();
332
- }, []), m = z(() => {
332
+ }, []), m = L(() => {
333
333
  let e = c.current;
334
334
  !e || e.state !== "recording" || (e.onstop = () => {
335
335
  let e = u.current || "audio/webm", t = new Blob(l.current, { type: e }), r = e.split(";")[0].split("/")[1] ?? "webm", a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -1), o = new File([t], `voice-${a}.${r}`, { type: e });
336
336
  d.current(o), f(), i(null), n("idle");
337
337
  }, e.stop());
338
- }, [f]), h = z(() => {
338
+ }, [f]), h = L(() => {
339
339
  let e = c.current;
340
340
  e && e.state === "recording" && (e.ondataavailable = null, e.onstop = null, e.stop()), f(), i(null), n("idle");
341
341
  }, [f]);
342
- return B(() => () => {
342
+ return R(() => () => {
343
343
  f();
344
344
  }, [f]), {
345
345
  state: t,
@@ -349,12 +349,12 @@ var Se = (e, t) => {
349
349
  stopRecording: m,
350
350
  discardRecording: h
351
351
  };
352
- }, Fe = /* @__PURE__ */ function(e) {
352
+ }, Me = /* @__PURE__ */ function(e) {
353
353
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
354
- }({}), Ie = {
354
+ }({}), Ne = {
355
355
  item: "_item_1sr2n_1",
356
356
  itemIcon: "_itemIcon_1sr2n_11"
357
- }, Le = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: s, className: c, titleClassName: u = "dial-body-semi-text", itemLabelClassName: d = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
357
+ }, Pe = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: s, className: c, titleClassName: u = "dial-body-semi-text", itemLabelClassName: d = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
358
358
  let m = (e) => {
359
359
  e(), r();
360
360
  }, h = a({
@@ -363,7 +363,7 @@ var Se = (e, t) => {
363
363
  "--ci-sheet-item-active": p?.itemActiveBg,
364
364
  "--ci-sheet-icon": p?.itemIcon
365
365
  });
366
- return /* @__PURE__ */ G(q, {
366
+ return /* @__PURE__ */ U(G, {
367
367
  isOpen: e,
368
368
  title: t,
369
369
  closeLabel: n,
@@ -372,23 +372,23 @@ var Se = (e, t) => {
372
372
  className: c,
373
373
  titleClassName: u,
374
374
  colors: p?.shell,
375
- children: /* @__PURE__ */ G("ul", {
375
+ children: /* @__PURE__ */ U("ul", {
376
376
  role: "list",
377
377
  className: "flex flex-col",
378
378
  style: h,
379
- children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(l, {
379
+ children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U(l, {
380
380
  type: "button",
381
- className: o(Ie.item, "w-full gap-3 px-4 py-[10px] text-start"),
382
- iconBefore: /* @__PURE__ */ G("span", {
383
- className: Ie.itemIcon,
381
+ className: o(Ne.item, "w-full gap-3 px-4 py-[10px] text-start"),
382
+ iconBefore: /* @__PURE__ */ U("span", {
383
+ className: Ne.itemIcon,
384
384
  children: n
385
385
  }),
386
- iconAfter: r ? /* @__PURE__ */ G("span", {
386
+ iconAfter: r ? /* @__PURE__ */ U("span", {
387
387
  className: "ms-auto",
388
388
  children: r
389
389
  }) : null,
390
390
  textClassName: f,
391
- label: /* @__PURE__ */ G("span", {
391
+ label: /* @__PURE__ */ U("span", {
392
392
  className: d,
393
393
  children: t
394
394
  }),
@@ -396,9 +396,9 @@ var Se = (e, t) => {
396
396
  }) }, e))
397
397
  })
398
398
  });
399
- }, Re = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
400
- let [s, c] = U(t), [l, u] = U(n), [d, f] = U(r), p = H(o);
401
- B(() => {
399
+ }, Fe = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
400
+ let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
401
+ R(() => {
402
402
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
403
403
  }, [
404
404
  o,
@@ -415,7 +415,7 @@ var Se = (e, t) => {
415
415
  setResponseFormat: c,
416
416
  setSystemPrompt: u,
417
417
  setTemperature: f,
418
- handleSubmit: z(() => {
418
+ handleSubmit: L(() => {
419
419
  if (!m) return;
420
420
  let t = {};
421
421
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -429,17 +429,17 @@ var Se = (e, t) => {
429
429
  a
430
430
  ])
431
431
  };
432
- }, ze = { label: "_label_14i7c_1" }, Be = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: m = "System prompt", systemPromptTooltip: h = "Enter a prompt", temperatureLabel: g = "Temperature", temperatureLabels: _ = [
432
+ }, Ie = { label: "_label_14i7c_1" }, Le = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: m = "System prompt", systemPromptTooltip: h = "Enter a prompt", temperatureLabel: g = "Temperature", temperatureLabels: _ = [
433
433
  "Precise",
434
434
  "Neutral",
435
435
  "Creative"
436
436
  ], temperatureHint: v, labelClassName: y = "!dial-small-semi-text", colors: b }) => {
437
- let x = a({ "--csf-label-text": b?.labelText }), S = o(y, ze.label, "gap-1");
438
- return /* @__PURE__ */ K("div", {
437
+ let x = a({ "--csf-label-text": b?.labelText }), S = o(y, Ie.label, "gap-1");
438
+ return /* @__PURE__ */ W("div", {
439
439
  className: "flex flex-col gap-4 px-6 pb-3",
440
440
  style: x,
441
441
  children: [
442
- e.responseFormat && /* @__PURE__ */ G(C, {
442
+ e.responseFormat && /* @__PURE__ */ U(C, {
443
443
  id: "response-format",
444
444
  labelProps: {
445
445
  label: u,
@@ -458,7 +458,7 @@ var Se = (e, t) => {
458
458
  }],
459
459
  onChange: (e) => s(e)
460
460
  }),
461
- e.systemPrompt && /* @__PURE__ */ G(A, {
461
+ e.systemPrompt && /* @__PURE__ */ U(ee, {
462
462
  value: n,
463
463
  placeholder: h,
464
464
  resize: !0,
@@ -468,7 +468,7 @@ var Se = (e, t) => {
468
468
  },
469
469
  onChange: (e) => c(e ?? "")
470
470
  }),
471
- e.temperature && /* @__PURE__ */ G(O, {
471
+ e.temperature && /* @__PURE__ */ U(O, {
472
472
  labelProps: {
473
473
  label: g,
474
474
  className: S,
@@ -484,8 +484,8 @@ var Se = (e, t) => {
484
484
  })
485
485
  ]
486
486
  });
487
- }, Ve = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, 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: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
488
- let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: A, setTemperature: ee, handleSubmit: te } = Re({
487
+ }, Re = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, 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: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
488
+ let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: te, handleSubmit: ne } = Fe({
489
489
  isOpen: e,
490
490
  features: s,
491
491
  initialResponseFormat: c,
@@ -494,7 +494,7 @@ var Se = (e, t) => {
494
494
  onSave: d,
495
495
  onClose: r
496
496
  });
497
- return /* @__PURE__ */ K(q, {
497
+ return /* @__PURE__ */ W(G, {
498
498
  isOpen: e,
499
499
  title: f,
500
500
  closeLabel: i,
@@ -502,14 +502,14 @@ var Se = (e, t) => {
502
502
  onBack: t,
503
503
  backLabel: n,
504
504
  style: a,
505
- children: [/* @__PURE__ */ G(Be, {
505
+ children: [/* @__PURE__ */ U(Le, {
506
506
  features: s,
507
507
  responseFormat: T,
508
508
  systemPrompt: E,
509
509
  temperature: D,
510
510
  onResponseFormatChange: k,
511
- onSystemPromptChange: A,
512
- onTemperatureChange: ee,
511
+ onSystemPromptChange: ee,
512
+ onTemperatureChange: te,
513
513
  responseFormatLabel: p,
514
514
  responseFormatHint: m,
515
515
  responseFormatMarkdownLabel: h,
@@ -519,23 +519,23 @@ var Se = (e, t) => {
519
519
  temperatureLabel: y,
520
520
  temperatureLabels: b,
521
521
  temperatureHint: S
522
- }), /* @__PURE__ */ G("div", {
522
+ }), /* @__PURE__ */ U("div", {
523
523
  className: o("px-6 py-4 mobile:pb-8"),
524
- children: /* @__PURE__ */ G(j, {
524
+ children: /* @__PURE__ */ U(A, {
525
525
  tooltip: w,
526
526
  hideTooltip: O || !w,
527
527
  triggerClassName: "w-full",
528
- children: /* @__PURE__ */ G(x, {
528
+ children: /* @__PURE__ */ U(x, {
529
529
  label: C,
530
- onClick: te,
530
+ onClick: ne,
531
531
  disabled: !O,
532
532
  className: "w-full"
533
533
  })
534
534
  })
535
535
  })]
536
536
  });
537
- }, He = { modal: "_modal_kl0h0_1" }, Ue = ({ 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: S = He.modal }) => {
538
- let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Re({
537
+ }, ze = { modal: "_modal_kl0h0_1" }, Be = ({ 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: S = ze.modal }) => {
538
+ let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = Fe({
539
539
  features: e,
540
540
  initialResponseFormat: t,
541
541
  initialSystemPrompt: n,
@@ -543,26 +543,26 @@ var Se = (e, t) => {
543
543
  onSave: i,
544
544
  onClose: a
545
545
  });
546
- return /* @__PURE__ */ G(y, {
546
+ return /* @__PURE__ */ U(y, {
547
547
  open: !0,
548
548
  header: o,
549
549
  titleClassName: s,
550
550
  size: b.Sm,
551
551
  onClose: a,
552
552
  className: S,
553
- footer: /* @__PURE__ */ G("div", {
553
+ footer: /* @__PURE__ */ U("div", {
554
554
  className: "flex justify-end px-6 py-4",
555
- children: /* @__PURE__ */ G(j, {
555
+ children: /* @__PURE__ */ U(A, {
556
556
  tooltip: v,
557
557
  hideTooltip: E || !v,
558
- children: /* @__PURE__ */ G(x, {
558
+ children: /* @__PURE__ */ U(x, {
559
559
  label: _,
560
- onClick: A,
560
+ onClick: ee,
561
561
  disabled: !E
562
562
  })
563
563
  })
564
564
  }),
565
- children: /* @__PURE__ */ G(Be, {
565
+ children: /* @__PURE__ */ U(Le, {
566
566
  features: e,
567
567
  responseFormat: C,
568
568
  systemPrompt: w,
@@ -582,11 +582,11 @@ var Se = (e, t) => {
582
582
  })
583
583
  });
584
584
  };
585
- R(Ue);
586
- var We = {
585
+ I(Be);
586
+ var Ve = {
587
587
  icon: "_icon_1fv6z_1",
588
588
  selectedIcon: "_selectedIcon_1fv6z_5"
589
- }, Ge = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: m }) => /* @__PURE__ */ G(q, {
589
+ }, He = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: m }) => /* @__PURE__ */ U(G, {
590
590
  isOpen: e,
591
591
  title: u,
592
592
  closeLabel: i,
@@ -594,32 +594,32 @@ var We = {
594
594
  onBack: t,
595
595
  backLabel: n,
596
596
  style: s,
597
- children: /* @__PURE__ */ G("ul", {
597
+ children: /* @__PURE__ */ U("ul", {
598
598
  role: "menu",
599
599
  className: "flex flex-col pb-4",
600
600
  style: a({
601
601
  "--tbs-icon-text": m?.iconText,
602
602
  "--tbs-selected-icon-text": m?.selectedIconText
603
603
  }),
604
- children: d.map((e) => /* @__PURE__ */ G("li", {
604
+ children: d.map((e) => /* @__PURE__ */ U("li", {
605
605
  role: "none",
606
- children: /* @__PURE__ */ G(l, {
606
+ children: /* @__PURE__ */ U(l, {
607
607
  type: "button",
608
608
  role: "menuitemcheckbox",
609
609
  "aria-checked": e.isSelected,
610
610
  className: "w-full gap-3 px-4 py-[10px] text-start",
611
- iconBefore: /* @__PURE__ */ G("span", {
612
- className: o("flex items-center", We.icon),
611
+ iconBefore: /* @__PURE__ */ U("span", {
612
+ className: o("flex items-center", Ve.icon),
613
613
  children: e.icon
614
614
  }),
615
- iconAfter: e.isSelected ? /* @__PURE__ */ G("span", {
616
- className: o("ms-auto", We.selectedIcon),
617
- children: /* @__PURE__ */ G(M, {
615
+ iconAfter: e.isSelected ? /* @__PURE__ */ U("span", {
616
+ className: o("ms-auto", Ve.selectedIcon),
617
+ children: /* @__PURE__ */ U(j, {
618
618
  size: c,
619
619
  "aria-hidden": !0
620
620
  })
621
621
  }) : null,
622
- label: /* @__PURE__ */ G("span", {
622
+ label: /* @__PURE__ */ U("span", {
623
623
  className: p,
624
624
  children: e.label
625
625
  }),
@@ -627,12 +627,12 @@ var We = {
627
627
  })
628
628
  }, e.id))
629
629
  })
630
- }), Ke = {
630
+ }), Ue = {
631
631
  selectedToolIcon: "_selectedToolIcon_r268y_1",
632
632
  toolIcon: "_toolIcon_r268y_5",
633
633
  chevronIcon: "_chevronIcon_r268y_9"
634
- }, qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: h = !1, chatSettings: _, extraMenuItems: v, toolsMenuItems: y = [], onToolToggle: b, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
635
- let D = s(), [O, k] = U(!1), [A, j] = U(!1), [ee, te] = U(!1), [ne, re] = U(!1), [ie, P] = U(!1), F = V(() => a({
634
+ }, We = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: h = !1, chatSettings: _, extraMenuItems: v, toolsMenuItems: y = [], onToolToggle: b, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
635
+ let D = s(), [O, k] = V(!1), [ee, A] = V(!1), [te, ne] = V(!1), [re, ie] = V(!1), [ae, N] = V(!1), P = z(() => a({
636
636
  "--aab-selected-tool-icon": E?.selectedToolIcon,
637
637
  "--aab-tool-icon": E?.toolIcon,
638
638
  "--aab-chevron-icon": E?.chevronIcon
@@ -640,98 +640,98 @@ var We = {
640
640
  E?.selectedToolIcon,
641
641
  E?.toolIcon,
642
642
  E?.chevronIcon
643
- ]), I = y.length > 0 && b != null, ue = V(() => y.map((e) => ({
643
+ ]), de = y.length > 0 && b != null, fe = z(() => y.map((e) => ({
644
644
  key: e.id,
645
- label: /* @__PURE__ */ K("span", {
645
+ label: /* @__PURE__ */ W("span", {
646
646
  className: "flex flex-1 items-center gap-2",
647
- children: [/* @__PURE__ */ G("span", {
647
+ children: [/* @__PURE__ */ U("span", {
648
648
  className: "flex-1",
649
649
  children: e.label
650
- }), e.isSelected && /* @__PURE__ */ G(M, {
650
+ }), e.isSelected && /* @__PURE__ */ U(j, {
651
651
  size: c,
652
- style: F,
653
- className: Ke.selectedToolIcon,
652
+ style: P,
653
+ className: Ue.selectedToolIcon,
654
654
  "aria-hidden": !0
655
655
  })]
656
656
  }),
657
- icon: /* @__PURE__ */ G("span", {
658
- style: F,
659
- className: o("flex items-center", Ke.toolIcon),
657
+ icon: /* @__PURE__ */ U("span", {
658
+ style: P,
659
+ className: o("flex items-center", Ue.toolIcon),
660
660
  children: e.icon
661
661
  }),
662
662
  onClick: () => b?.(e.id)
663
663
  })), [
664
664
  y,
665
665
  b,
666
- F
667
- ]), L = V(() => [
666
+ P
667
+ ]), F = z(() => [
668
668
  ...e == null ? [] : [{
669
669
  key: "attach",
670
670
  label: t,
671
- icon: /* @__PURE__ */ G(ae, {
671
+ icon: /* @__PURE__ */ U(oe, {
672
672
  size: c,
673
673
  "aria-hidden": !0
674
674
  }),
675
675
  onClick: e
676
676
  }],
677
677
  ...v ?? [],
678
- ...I ? [{
678
+ ...de ? [{
679
679
  key: "tools",
680
680
  label: x,
681
- icon: /* @__PURE__ */ G(le, {
681
+ icon: /* @__PURE__ */ U(ue, {
682
682
  size: c,
683
683
  "aria-hidden": !0
684
684
  }),
685
685
  onClick: D ? () => {
686
- te(!0), k(!1);
686
+ ne(!0), k(!1);
687
687
  } : () => void 0,
688
- ...D ? { iconAfter: /* @__PURE__ */ G(N, {
688
+ ...D ? { iconAfter: /* @__PURE__ */ U(M, {
689
689
  size: c,
690
690
  stroke: 1.5,
691
- style: F,
692
- className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
691
+ style: P,
692
+ className: o("rtl:scale-x-[-1]", Ue.chevronIcon),
693
693
  "aria-hidden": !0
694
- }) } : { children: ue }
694
+ }) } : { children: fe }
695
695
  }] : [],
696
696
  ...C == null ? [] : [{
697
697
  key: "prompts",
698
698
  label: w,
699
- icon: /* @__PURE__ */ G(se, {
699
+ icon: /* @__PURE__ */ U(ce, {
700
700
  size: c,
701
701
  "aria-hidden": !0
702
702
  }),
703
703
  onClick: D ? () => {
704
- re(!0), k(!1);
704
+ ie(!0), k(!1);
705
705
  } : () => void 0,
706
- ...D ? { iconAfter: /* @__PURE__ */ G(N, {
706
+ ...D ? { iconAfter: /* @__PURE__ */ U(M, {
707
707
  size: c,
708
708
  stroke: 1.5,
709
- style: F,
710
- className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
709
+ style: P,
710
+ className: o("rtl:scale-x-[-1]", Ue.chevronIcon),
711
711
  "aria-hidden": !0
712
712
  }) } : {
713
713
  children: [{
714
714
  key: "prompts-panel",
715
715
  label: ""
716
716
  }],
717
- renderSubMenu: () => C(() => P(!1))
717
+ renderSubMenu: () => C(() => N(!1))
718
718
  }
719
719
  }],
720
720
  ..._ == null ? [] : [{
721
721
  key: "chat-settings",
722
722
  label: _.menuItemLabel ?? "Chat settings",
723
- icon: /* @__PURE__ */ G(ce, {
723
+ icon: /* @__PURE__ */ U(le, {
724
724
  size: c,
725
725
  "aria-hidden": !0
726
726
  }),
727
- iconAfter: D ? /* @__PURE__ */ G(N, {
727
+ iconAfter: D ? /* @__PURE__ */ U(M, {
728
728
  size: c,
729
729
  stroke: 1.5,
730
- style: F,
731
- className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
730
+ style: P,
731
+ className: o("rtl:scale-x-[-1]", Ue.chevronIcon),
732
732
  "aria-hidden": !0
733
733
  }) : null,
734
- onClick: () => j(!0)
734
+ onClick: () => A(!0)
735
735
  }]
736
736
  ], [
737
737
  t,
@@ -739,23 +739,23 @@ var We = {
739
739
  _,
740
740
  v,
741
741
  D,
742
- I,
742
+ de,
743
743
  x,
744
- ue,
744
+ fe,
745
745
  C,
746
746
  w,
747
- F
747
+ P
748
748
  ]);
749
- if (L.length === 0) return null;
750
- let R = /* @__PURE__ */ G(p, {
749
+ if (F.length === 0) return null;
750
+ let I = /* @__PURE__ */ U(p, {
751
751
  matchReferenceWidth: !1,
752
752
  placement: "bottom-start",
753
753
  listClassName: f,
754
- items: L,
755
- open: C == null ? void 0 : ie,
756
- onOpenChange: C == null ? void 0 : P,
757
- children: /* @__PURE__ */ G(g, {
758
- icon: /* @__PURE__ */ G(oe, {
754
+ items: F,
755
+ open: C == null ? void 0 : ae,
756
+ onOpenChange: C == null ? void 0 : N,
757
+ children: /* @__PURE__ */ U(g, {
758
+ icon: /* @__PURE__ */ U(se, {
759
759
  size: d.LG,
760
760
  "aria-hidden": !0
761
761
  }),
@@ -764,9 +764,9 @@ var We = {
764
764
  disabled: h
765
765
  })
766
766
  });
767
- return /* @__PURE__ */ G(W, { children: D ? /* @__PURE__ */ K(W, { children: [
768
- /* @__PURE__ */ G(g, {
769
- icon: /* @__PURE__ */ G(oe, {
767
+ return /* @__PURE__ */ U(H, { children: D ? /* @__PURE__ */ W(H, { children: [
768
+ /* @__PURE__ */ U(g, {
769
+ icon: /* @__PURE__ */ U(se, {
770
770
  size: d.LG,
771
771
  "aria-hidden": !0
772
772
  }),
@@ -776,48 +776,48 @@ var We = {
776
776
  disabled: h,
777
777
  onClick: () => k(!0)
778
778
  }),
779
- /* @__PURE__ */ G(Le, {
779
+ /* @__PURE__ */ U(Pe, {
780
780
  isOpen: O,
781
781
  title: r,
782
782
  closeLabel: l,
783
783
  onClose: () => k(!1),
784
784
  style: u,
785
- items: L,
785
+ items: F,
786
786
  className: "pb-4",
787
787
  btnTextClassName: "flex-1"
788
788
  }),
789
- I && /* @__PURE__ */ G(Ge, {
790
- isOpen: ee,
789
+ de && /* @__PURE__ */ U(He, {
790
+ isOpen: te,
791
791
  onBack: () => {
792
- te(!1), k(!0);
792
+ ne(!1), k(!0);
793
793
  },
794
794
  backLabel: S,
795
- onClose: () => te(!1),
795
+ onClose: () => ne(!1),
796
796
  closeLabel: l,
797
797
  style: u,
798
798
  title: x,
799
799
  items: y,
800
800
  onToolToggle: b
801
801
  }),
802
- C != null && /* @__PURE__ */ G(q, {
803
- isOpen: ne,
802
+ C != null && /* @__PURE__ */ U(G, {
803
+ isOpen: re,
804
804
  title: w,
805
805
  closeLabel: l,
806
806
  onBack: () => {
807
- re(!1), k(!0);
807
+ ie(!1), k(!0);
808
808
  },
809
809
  backLabel: T,
810
- onClose: () => re(!1),
810
+ onClose: () => ie(!1),
811
811
  style: u,
812
- children: C(() => re(!1))
812
+ children: C(() => ie(!1))
813
813
  }),
814
- _ != null && /* @__PURE__ */ G(Ve, {
815
- isOpen: A,
814
+ _ != null && /* @__PURE__ */ U(Re, {
815
+ isOpen: ee,
816
816
  onBack: () => {
817
- j(!1), k(!0);
817
+ A(!1), k(!0);
818
818
  },
819
819
  backLabel: _.backLabel ?? "Back",
820
- onClose: () => j(!1),
820
+ onClose: () => A(!1),
821
821
  closeLabel: l,
822
822
  style: u,
823
823
  features: _.features,
@@ -838,13 +838,13 @@ var We = {
838
838
  saveLabel: _.saveLabel,
839
839
  saveDisabledTooltip: _.saveDisabledTooltip
840
840
  })
841
- ] }) : /* @__PURE__ */ K(W, { children: [R, _ != null && A && /* @__PURE__ */ G(Ue, {
841
+ ] }) : /* @__PURE__ */ W(H, { children: [I, _ != null && ee && /* @__PURE__ */ U(Be, {
842
842
  features: _.features,
843
843
  initialResponseFormat: _.responseFormat ?? i.Markdown,
844
844
  initialSystemPrompt: _.systemPrompt,
845
845
  initialTemperature: _.temperature,
846
846
  onSave: _.onSave,
847
- onClose: () => j(!1),
847
+ onClose: () => A(!1),
848
848
  title: _.title,
849
849
  responseFormatLabel: _.responseFormatLabel,
850
850
  responseFormatHint: _.responseFormatHint,
@@ -858,106 +858,88 @@ var We = {
858
858
  saveLabel: _.saveLabel,
859
859
  saveDisabledTooltip: _.saveDisabledTooltip
860
860
  })] }) });
861
- }, J = {
862
- chip: "_chip_1gu87_1",
863
- chipIcon: "_chipIcon_1gu87_6",
864
- chipText: "_chipText_1gu87_10",
865
- chipClose: "_chipClose_1gu87_14"
866
- }, Je = (e) => `${e} tool${e === 1 ? "" : "s"}`, Ye = (e) => `Remove ${e}`, Xe = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = Je, removeLabel: i = Ye, typography: s, colors: l }) => {
867
- let u = e.filter((e) => e.isSelected);
868
- if (u.length === 0) return null;
869
- let d = a({
870
- "--ci-chip-bg": l?.chipBg,
871
- "--ci-chip-border": l?.chipBorder,
872
- "--ci-chip-icon": l?.chipIcon,
873
- "--ci-chip-text": l?.chipText,
874
- "--ci-chip-close": l?.chipClose,
875
- "--ci-chip-close-hover": l?.chipCloseHover
876
- });
877
- if (n) {
878
- let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ G(le, {
879
- size: c,
880
- "aria-hidden": !0
881
- }), n = e ? u[0].label : r(u.length);
882
- return /* @__PURE__ */ G("div", {
883
- className: "flex flex-wrap items-center gap-2",
884
- style: d,
885
- children: /* @__PURE__ */ K("div", {
886
- className: o(J.chip, "flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1"),
887
- children: [/* @__PURE__ */ G("span", {
888
- className: o(J.chipIcon, "shrink-0"),
889
- "aria-hidden": !0,
890
- children: t
891
- }), /* @__PURE__ */ G("span", {
892
- className: o(J.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
893
- children: n
894
- })]
861
+ }, K = {
862
+ chip: "_chip_ydmd8_1",
863
+ chipSelected: "_chipSelected_ydmd8_9",
864
+ chipIcon: "_chipIcon_ydmd8_16",
865
+ chipText: "_chipText_ydmd8_19",
866
+ chipClose: "_chipClose_ydmd8_22"
867
+ }, Ge = (e) => `Remove ${e}`, Ke = ({ items: e, onToolToggle: t, onToolDismiss: n, removeLabel: r = Ge, typography: i, colors: s }) => e.length === 0 ? null : /* @__PURE__ */ U("div", {
868
+ className: "flex flex-wrap items-center gap-2",
869
+ style: a({
870
+ "--ci-chip-bg": s?.chipBg,
871
+ "--ci-chip-border": s?.chipBorder,
872
+ "--ci-chip-icon": s?.chipIcon,
873
+ "--ci-chip-text": s?.chipText,
874
+ "--ci-chip-hover-bg": s?.chipHoverBg,
875
+ "--ci-chip-selected-bg": s?.chipSelectedBg,
876
+ "--ci-chip-selected-border": s?.chipSelectedBorder,
877
+ "--ci-chip-selected-icon": s?.chipSelectedIcon,
878
+ "--ci-chip-selected-text": s?.chipSelectedText,
879
+ "--ci-chip-close": s?.chipClose,
880
+ "--ci-chip-close-hover": s?.chipCloseHover
881
+ }),
882
+ children: e.map((e) => /* @__PURE__ */ W("div", {
883
+ className: o(K.chip, e.isSelected && K.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 pe-1 ps-2 transition-colors"),
884
+ children: [/* @__PURE__ */ W("button", {
885
+ type: "button",
886
+ onClick: () => t(e.id),
887
+ "aria-pressed": e.isSelected,
888
+ className: "flex min-w-0 items-center gap-1.5",
889
+ children: [/* @__PURE__ */ U("span", {
890
+ className: o(K.chipIcon, "shrink-0"),
891
+ "aria-hidden": !0,
892
+ children: e.icon
893
+ }), /* @__PURE__ */ U("span", {
894
+ className: o(K.chipText, i?.fontClassName || "dial-small-paragraph-text", "truncate"),
895
+ children: e.label
896
+ })]
897
+ }), /* @__PURE__ */ U("button", {
898
+ type: "button",
899
+ onClick: () => n(e.id),
900
+ "aria-label": r(e.label),
901
+ className: o(K.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
902
+ children: /* @__PURE__ */ U(de, {
903
+ size: 12,
904
+ "aria-hidden": !0
895
905
  })
896
- });
897
- }
898
- return /* @__PURE__ */ G("div", {
899
- className: "flex flex-wrap items-center gap-2",
900
- style: d,
901
- children: u.map((e) => /* @__PURE__ */ K("div", {
902
- className: o(J.chip, "flex items-center gap-1.5 rounded-full border py-1 pe-1 ps-2"),
903
- children: [
904
- /* @__PURE__ */ G("span", {
905
- className: J.chipIcon,
906
- "aria-hidden": !0,
907
- children: e.icon
908
- }),
909
- /* @__PURE__ */ G("span", {
910
- className: o(J.chipText, s?.fontClassName || "dial-small-paragraph-text"),
911
- children: e.label
912
- }),
913
- /* @__PURE__ */ G("button", {
914
- type: "button",
915
- onClick: () => t(e.id),
916
- className: o(J.chipClose, "flex items-center rounded p-0.5 transition-colors"),
917
- "aria-label": i(e.label),
918
- children: /* @__PURE__ */ G(I, {
919
- size: 12,
920
- "aria-hidden": !0
921
- })
922
- })
923
- ]
924
- }, e.id))
925
- });
926
- }, Y = {
906
+ })]
907
+ }, e.id))
908
+ }), q = {
927
909
  wrapper: "_wrapper_10e5r_1",
928
910
  wrapperDisabled: "_wrapperDisabled_10e5r_8",
929
911
  textarea: "_textarea_10e5r_13",
930
912
  modelSelectorButton: "_modelSelectorButton_10e5r_24",
931
913
  modelSelectorCaret: "_modelSelectorCaret_10e5r_24",
932
914
  modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_10e5r_33"
933
- }, X = {
915
+ }, qe = {
934
916
  wrapperError: "_wrapperError_129ri_1",
935
917
  waveformCanvas: "_waveformCanvas_129ri_5",
936
918
  recordingDot: "_recordingDot_129ri_19",
937
919
  "recording-pulse": "_recording-pulse_129ri_1"
938
- }, Ze = 3, Qe = 4, $e = 200, et = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, stopLabel: a = "Stop recording", discardLabel: s = "Discard recording", style: c, className: l }) => {
939
- let u = H(null), f = H(new Float32Array($e)), p = H(0), m = H(0), _ = e === je.Recording, v = e === je.Error, y = z((e) => {
920
+ }, Je = 3, Ye = 4, J = 200, Xe = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, stopLabel: a = "Stop recording", discardLabel: s = "Discard recording", style: c, className: l }) => {
921
+ let u = B(null), f = B(new Float32Array(J)), p = B(0), m = B(0), _ = e === Oe.Recording, v = e === Oe.Error, y = L((e) => {
940
922
  let t = e.getContext("2d");
941
923
  if (!t) return;
942
924
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
943
925
  let { width: n, height: r } = e;
944
926
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
945
- let i = Math.min(Math.max(1, Math.floor(n / Qe)), $e - 1), a = p.current, o = m.current;
927
+ let i = Math.min(Math.max(1, Math.floor(n / Ye)), J - 1), a = p.current, o = m.current;
946
928
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
947
929
  for (let e = 0; e <= i; e++) {
948
- let n = ((a - i + e) % $e + $e) % $e, o = f.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
949
- t.fillRect(e * Qe, (r - c) / 2, Ze, c);
930
+ let n = ((a - i + e) % J + J) % J, o = f.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
931
+ t.fillRect(e * Ye, (r - c) / 2, Je, c);
950
932
  }
951
933
  t.restore();
952
934
  }, []);
953
- B(() => {
935
+ R(() => {
954
936
  if (!_) return;
955
937
  let e = u.current;
956
938
  if (!e) return;
957
939
  f.current.fill(0), p.current = 0, m.current = 0;
958
940
  let n, r = () => {
959
- if (m.current += 1, m.current >= Qe) {
960
- m.current -= Qe;
941
+ if (m.current += 1, m.current >= Ye) {
942
+ m.current -= Ye;
961
943
  let e = t.current;
962
944
  if (e) {
963
945
  let t = new Uint8Array(e.frequencyBinCount);
@@ -967,7 +949,7 @@ var We = {
967
949
  let r = (t[e] - 128) / 128;
968
950
  n += r * r;
969
951
  }
970
- f.current[p.current % $e] = Math.sqrt(n / t.length), p.current++;
952
+ f.current[p.current % J] = Math.sqrt(n / t.length), p.current++;
971
953
  }
972
954
  }
973
955
  y(e), n = requestAnimationFrame(r);
@@ -979,7 +961,7 @@ var We = {
979
961
  _,
980
962
  t,
981
963
  y
982
- ]), B(() => {
964
+ ]), R(() => {
983
965
  let e = u.current;
984
966
  if (!e) return;
985
967
  let t = new ResizeObserver(() => {
@@ -987,17 +969,17 @@ var We = {
987
969
  });
988
970
  return t.observe(e), () => t.disconnect();
989
971
  }, [y]);
990
- let b = /* @__PURE__ */ K("div", {
972
+ let b = /* @__PURE__ */ W("div", {
991
973
  className: "flex flex-shrink-0 items-center justify-end gap-1",
992
- children: [/* @__PURE__ */ G(g, {
993
- icon: /* @__PURE__ */ G(I, {
974
+ children: [/* @__PURE__ */ U(g, {
975
+ icon: /* @__PURE__ */ U(de, {
994
976
  size: d.LG,
995
977
  "aria-hidden": !0
996
978
  }),
997
979
  "aria-label": s,
998
980
  onClick: i
999
- }), _ && /* @__PURE__ */ G(S, {
1000
- icon: /* @__PURE__ */ G(P, {
981
+ }), _ && /* @__PURE__ */ U(S, {
982
+ icon: /* @__PURE__ */ U(N, {
1001
983
  size: d.LG,
1002
984
  "aria-hidden": !0
1003
985
  }),
@@ -1005,78 +987,78 @@ var We = {
1005
987
  "aria-label": a
1006
988
  })]
1007
989
  });
1008
- return /* @__PURE__ */ K("div", {
990
+ return /* @__PURE__ */ W("div", {
1009
991
  className: l,
1010
- children: [/* @__PURE__ */ K("div", {
992
+ children: [/* @__PURE__ */ W("div", {
1011
993
  style: c,
1012
- className: o(Y.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", v && X.wrapperError),
1013
- children: [/* @__PURE__ */ K("div", {
994
+ className: o(q.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", v && qe.wrapperError),
995
+ children: [/* @__PURE__ */ W("div", {
1014
996
  className: "flex min-w-0 flex-1 items-center gap-3",
1015
- children: [_ && /* @__PURE__ */ G("span", {
1016
- className: o(X.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
997
+ children: [_ && /* @__PURE__ */ U("span", {
998
+ className: o(qe.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1017
999
  "aria-hidden": !0
1018
- }), /* @__PURE__ */ G("canvas", {
1000
+ }), /* @__PURE__ */ U("canvas", {
1019
1001
  ref: u,
1020
1002
  height: 32,
1021
- className: o(X.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
1003
+ className: o(qe.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
1022
1004
  })]
1023
1005
  }), b]
1024
- }), v && n && /* @__PURE__ */ G(h, {
1006
+ }), v && n && /* @__PURE__ */ U(h, {
1025
1007
  text: n,
1026
1008
  className: "mt-1 px-1"
1027
1009
  })]
1028
1010
  });
1029
- }, tt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ G(S, {
1011
+ }, Ze = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(S, {
1030
1012
  "aria-label": n,
1031
1013
  onClick: () => e?.(),
1032
1014
  disabled: t,
1033
1015
  "aria-hidden": r,
1034
- icon: /* @__PURE__ */ G(te, {
1016
+ icon: /* @__PURE__ */ U(ne, {
1035
1017
  size: d.LG,
1036
1018
  className: "rtl:scale-x-[-1]"
1037
1019
  })
1038
- }), nt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ G(k, {
1039
- icon: /* @__PURE__ */ G(F, { size: d.LG }),
1020
+ }), Qe = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(k, {
1021
+ icon: /* @__PURE__ */ U(P, { size: d.LG }),
1040
1022
  onClick: () => e?.(),
1041
1023
  "aria-label": t
1042
- }), Z = ({ size: e = 20 }) => /* @__PURE__ */ G(E, {
1024
+ }), $e = ({ size: e = 20 }) => /* @__PURE__ */ U(E, {
1043
1025
  variant: D.Circular,
1044
1026
  width: e,
1045
1027
  height: e,
1046
1028
  active: !0
1047
- }), rt = ({ loadingLabel: e }) => /* @__PURE__ */ K("span", {
1029
+ }), et = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
1048
1030
  className: "flex min-w-0 flex-1 items-center",
1049
- children: [/* @__PURE__ */ G(E, {
1031
+ children: [/* @__PURE__ */ U(E, {
1050
1032
  variant: D.Text,
1051
1033
  width: "100%",
1052
1034
  height: 16,
1053
1035
  active: !0
1054
- }), e && /* @__PURE__ */ G("span", {
1036
+ }), e && /* @__PURE__ */ U("span", {
1055
1037
  className: "sr-only",
1056
1038
  children: e
1057
1039
  })]
1058
- }), it = ({ loadingLabel: e }) => /* @__PURE__ */ G("div", {
1040
+ }), tt = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
1059
1041
  role: "status",
1060
1042
  "aria-label": e,
1061
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ K("div", {
1043
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ W("div", {
1062
1044
  className: "flex h-11 items-center gap-3 px-4",
1063
1045
  "aria-hidden": "true",
1064
- children: [/* @__PURE__ */ G(Z, {}), /* @__PURE__ */ G(rt, {})]
1046
+ children: [/* @__PURE__ */ U($e, {}), /* @__PURE__ */ U(et, {})]
1065
1047
  }, t))
1066
- }), at = (e) => e.displayName ?? e.id, ot = (e, t) => {
1048
+ }), Y = (e) => e.displayName ?? e.id, X = (e, t) => {
1067
1049
  let n = t.trim().toLowerCase();
1068
- return n ? e.filter((e) => at(e).toLowerCase().includes(n)) : e;
1069
- }, st = (e, t, r, i = 18, a) => /* @__PURE__ */ G(n, {
1050
+ return n ? e.filter((e) => Y(e).toLowerCase().includes(n)) : e;
1051
+ }, nt = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
1070
1052
  src: e,
1071
1053
  size: i,
1072
1054
  labels: { tooltip: a },
1073
1055
  initialsName: r
1074
- }), ct = {
1056
+ }), rt = {
1075
1057
  searchHeader: "_searchHeader_1tt5t_1",
1076
1058
  selectedItem: "_selectedItem_1tt5t_5",
1077
1059
  selectedItemCheck: "_selectedItemCheck_1tt5t_9"
1078
- }, lt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = ct.searchHeader, selectedItemClassName: s = ct.selectedItem, selectedItemCheckClassName: c = ct.selectedItemCheck, colors: l }) => {
1079
- let [u, f] = U(""), p = V(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = !h && !p && !!t, v = V(() => h ? /* @__PURE__ */ G(Z, { size: d.LG }) : st(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG, g ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1060
+ }, it = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = rt.searchHeader, selectedItemClassName: s = rt.selectedItem, selectedItemCheckClassName: c = rt.selectedItemCheck, colors: l }) => {
1061
+ let [u, f] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = !h && !p && !!t, v = z(() => h ? /* @__PURE__ */ U($e, { size: d.LG }) : nt(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG, g ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1080
1062
  h,
1081
1063
  p,
1082
1064
  g,
@@ -1086,11 +1068,11 @@ var We = {
1086
1068
  selectorIcon: v,
1087
1069
  selectorAriaLabel: y ? `${r?.ariaLabel ?? "Select model"}: ${y}` : r?.ariaLabel ?? "Select model",
1088
1070
  selectedLabel: y,
1089
- menuItems: V(() => {
1071
+ menuItems: z(() => {
1090
1072
  if (h) return Array.from({ length: 7 }, (e, t) => ({
1091
1073
  key: `__loading-${t}`,
1092
- icon: /* @__PURE__ */ G(Z, {}),
1093
- label: /* @__PURE__ */ G(rt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1074
+ icon: /* @__PURE__ */ U($e, {}),
1075
+ label: /* @__PURE__ */ U(et, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1094
1076
  disabled: !0
1095
1077
  }));
1096
1078
  if (!e || e.length === 0) {
@@ -1101,25 +1083,25 @@ var We = {
1101
1083
  disabled: !0
1102
1084
  }] : [];
1103
1085
  }
1104
- return ot(e, u).map((e) => {
1086
+ return X(e, u).map((e) => {
1105
1087
  let r = e.id === t;
1106
1088
  return {
1107
1089
  key: e.id,
1108
- label: /* @__PURE__ */ K("span", {
1090
+ label: /* @__PURE__ */ W("span", {
1109
1091
  className: "flex w-full items-center justify-between gap-2",
1110
1092
  style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
1111
- children: [/* @__PURE__ */ G(_, {
1112
- text: at(e),
1093
+ children: [/* @__PURE__ */ U(_, {
1094
+ text: Y(e),
1113
1095
  query: u,
1114
1096
  maxLines: 1
1115
- }), r && /* @__PURE__ */ G(M, {
1097
+ }), r && /* @__PURE__ */ U(j, {
1116
1098
  size: d.SM,
1117
1099
  stroke: 2,
1118
1100
  className: c,
1119
1101
  "aria-hidden": !0
1120
1102
  })]
1121
1103
  }),
1122
- icon: st(e.iconUrl, e.type, e.displayName ?? e.id),
1104
+ icon: nt(e.iconUrl, e.type, e.displayName ?? e.id),
1123
1105
  onClick: () => n?.(e.id),
1124
1106
  className: r ? s : void 0
1125
1107
  };
@@ -1135,10 +1117,10 @@ var We = {
1135
1117
  c,
1136
1118
  l?.selectedItemCheck
1137
1119
  ]),
1138
- menuHeader: V(() => !h && e && e.length > 0 ? /* @__PURE__ */ G("div", {
1120
+ menuHeader: z(() => !h && e && e.length > 0 ? /* @__PURE__ */ U("div", {
1139
1121
  style: a({ "--ms-search-header-bg": l?.searchHeaderBackground }),
1140
1122
  className: o("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
1141
- children: /* @__PURE__ */ G(T, {
1123
+ children: /* @__PURE__ */ U(T, {
1142
1124
  value: u,
1143
1125
  placeholder: r?.searchPlaceholder ?? "Search",
1144
1126
  size: m.Small,
@@ -1157,8 +1139,8 @@ var We = {
1157
1139
  e || f("");
1158
1140
  }
1159
1141
  };
1160
- }, ut = typeof window < "u" ? fe : B;
1161
- function dt(e) {
1142
+ }, Z = typeof window < "u" ? me : R;
1143
+ function at(e) {
1162
1144
  if (e !== void 0) switch (typeof e) {
1163
1145
  case "number": return e;
1164
1146
  case "string":
@@ -1166,15 +1148,15 @@ function dt(e) {
1166
1148
  break;
1167
1149
  }
1168
1150
  }
1169
- function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1170
- let { styleHeight: s, styleWidth: c } = V(() => ({
1171
- styleHeight: dt(o?.height),
1172
- styleWidth: dt(o?.width)
1173
- }), [o?.height, o?.width]), [l, u] = U({
1151
+ function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1152
+ let { styleHeight: s, styleWidth: c } = z(() => ({
1153
+ styleHeight: at(o?.height),
1154
+ styleWidth: at(o?.width)
1155
+ }), [o?.height, o?.width]), [l, u] = V({
1174
1156
  height: t,
1175
1157
  width: n
1176
1158
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
1177
- return ut(() => {
1159
+ return Z(() => {
1178
1160
  if (i === null || d) return;
1179
1161
  let t = new ResizeObserver((e) => {
1180
1162
  for (let t of e) {
@@ -1194,7 +1176,7 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1194
1176
  i,
1195
1177
  s,
1196
1178
  c
1197
- ]), V(() => ({
1179
+ ]), z(() => ({
1198
1180
  height: s ?? l.height,
1199
1181
  width: c ?? l.width
1200
1182
  }), [
@@ -1203,26 +1185,26 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1203
1185
  c
1204
1186
  ]);
1205
1187
  }
1206
- function pt(e) {
1207
- let t = H(() => {
1188
+ function st(e) {
1189
+ let t = B(() => {
1208
1190
  throw Error("Cannot call during render.");
1209
1191
  });
1210
- return ut(() => {
1192
+ return Z(() => {
1211
1193
  t.current = e;
1212
- }, [e]), z((e) => t.current?.(e), [t]);
1194
+ }, [e]), L((e) => t.current?.(e), [t]);
1213
1195
  }
1214
- var mt = null;
1215
- function ht(e = !1) {
1216
- if (mt === null || e) {
1196
+ var ct = null;
1197
+ function lt(e = !1) {
1198
+ if (ct === null || e) {
1217
1199
  let e = document.createElement("div"), t = e.style;
1218
1200
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1219
1201
  let n = document.createElement("div"), r = n.style;
1220
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? mt = "positive-descending" : (e.scrollLeft = 1, mt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), mt;
1202
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? ct = "positive-descending" : (e.scrollLeft = 1, ct = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), ct;
1221
1203
  }
1222
- return mt;
1204
+ return ct;
1223
1205
  }
1224
- function gt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1225
- if (t === "horizontal" && n) switch (ht()) {
1206
+ function ut({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1207
+ if (t === "horizontal" && n) switch (lt()) {
1226
1208
  case "negative": return -r;
1227
1209
  case "positive-descending":
1228
1210
  if (e) {
@@ -1236,13 +1218,13 @@ function gt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1236
1218
  function Q(e, t = "Assertion error") {
1237
1219
  if (!e) throw console.error(t), Error(t);
1238
1220
  }
1239
- function _t(e, t) {
1221
+ function dt(e, t) {
1240
1222
  if (e === t) return !0;
1241
1223
  if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1242
1224
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1243
1225
  return !0;
1244
1226
  }
1245
- function vt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1227
+ function ft({ cachedBounds: e, itemCount: t, itemSize: n }) {
1246
1228
  if (t === 0) return 0;
1247
1229
  if (typeof n == "number") return t * n;
1248
1230
  {
@@ -1250,9 +1232,9 @@ function vt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1250
1232
  return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1251
1233
  }
1252
1234
  }
1253
- function yt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1235
+ function pt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1254
1236
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1255
- let s = vt({
1237
+ let s = ft({
1256
1238
  cachedBounds: t,
1257
1239
  itemCount: r,
1258
1240
  itemSize: i
@@ -1264,7 +1246,7 @@ function yt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
1264
1246
  default: return a >= u && a <= l ? a : a < u ? u : l;
1265
1247
  }
1266
1248
  }
1267
- function bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1249
+ function mt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1268
1250
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
1269
1251
  for (; u < a;) {
1270
1252
  let n = e.get(u);
@@ -1283,7 +1265,7 @@ function bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
1283
1265
  stopIndexOverscan: l
1284
1266
  };
1285
1267
  }
1286
- function xt({ itemCount: e, itemProps: t, itemSize: n }) {
1268
+ function ht({ itemCount: e, itemProps: t, itemSize: n }) {
1287
1269
  let r = /* @__PURE__ */ new Map();
1288
1270
  return {
1289
1271
  get(i) {
@@ -1320,8 +1302,8 @@ function xt({ itemCount: e, itemProps: t, itemSize: n }) {
1320
1302
  }
1321
1303
  };
1322
1304
  }
1323
- function St({ itemCount: e, itemProps: t, itemSize: n }) {
1324
- return V(() => xt({
1305
+ function gt({ itemCount: e, itemProps: t, itemSize: n }) {
1306
+ return z(() => ht({
1325
1307
  itemCount: e,
1326
1308
  itemProps: t,
1327
1309
  itemSize: n
@@ -1331,7 +1313,7 @@ function St({ itemCount: e, itemProps: t, itemSize: n }) {
1331
1313
  n
1332
1314
  ]);
1333
1315
  }
1334
- function Ct({ containerSize: e, itemSize: t }) {
1316
+ function _t({ containerSize: e, itemSize: t }) {
1335
1317
  let n;
1336
1318
  switch (typeof t) {
1337
1319
  case "string":
@@ -1343,21 +1325,21 @@ function Ct({ containerSize: e, itemSize: t }) {
1343
1325
  }
1344
1326
  return n;
1345
1327
  }
1346
- function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1347
- let { height: u = n, width: d = n } = ft({
1328
+ function vt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1329
+ let { height: u = n, width: d = n } = ot({
1348
1330
  defaultHeight: r === "vertical" ? n : void 0,
1349
1331
  defaultWidth: r === "horizontal" ? n : void 0,
1350
1332
  element: e,
1351
1333
  mode: r === "vertical" ? "only-height" : "only-width",
1352
1334
  style: t
1353
- }), f = H({
1335
+ }), f = B({
1354
1336
  height: 0,
1355
1337
  width: 0
1356
- }), p = r === "vertical" ? u : d, m = Ct({
1338
+ }), p = r === "vertical" ? u : d, m = _t({
1357
1339
  containerSize: p,
1358
1340
  itemSize: s
1359
1341
  });
1360
- fe(() => {
1342
+ me(() => {
1361
1343
  if (typeof c == "function") {
1362
1344
  let e = f.current;
1363
1345
  (e.height !== u || e.width !== d) && (c({
@@ -1370,11 +1352,11 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1370
1352
  c,
1371
1353
  d
1372
1354
  ]);
1373
- let h = St({
1355
+ let h = gt({
1374
1356
  itemCount: a,
1375
1357
  itemProps: o,
1376
1358
  itemSize: m
1377
- }), g = z((e) => h.get(e), [h]), [_, v] = U(() => bt({
1359
+ }), g = L((e) => h.get(e), [h]), [_, v] = V(() => mt({
1378
1360
  cachedBounds: h,
1379
1361
  containerScrollOffset: 0,
1380
1362
  containerSize: p,
@@ -1385,7 +1367,7 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1385
1367
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1386
1368
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1387
1369
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1388
- }, C = z(() => vt({
1370
+ }, C = L(() => ft({
1389
1371
  cachedBounds: h,
1390
1372
  itemCount: a,
1391
1373
  itemSize: m
@@ -1393,9 +1375,9 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1393
1375
  h,
1394
1376
  a,
1395
1377
  m
1396
- ]), w = z((t) => bt({
1378
+ ]), w = L((t) => mt({
1397
1379
  cachedBounds: h,
1398
- containerScrollOffset: gt({
1380
+ containerScrollOffset: ut({
1399
1381
  containerElement: e,
1400
1382
  direction: r,
1401
1383
  isRtl: i,
@@ -1413,19 +1395,19 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1413
1395
  a,
1414
1396
  l
1415
1397
  ]);
1416
- return ut(() => {
1398
+ return Z(() => {
1417
1399
  v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
1418
1400
  }, [
1419
1401
  e,
1420
1402
  r,
1421
1403
  w
1422
- ]), ut(() => {
1404
+ ]), Z(() => {
1423
1405
  if (!e) return;
1424
1406
  let t = () => {
1425
1407
  v((t) => {
1426
- let { scrollLeft: n, scrollTop: o } = e, s = bt({
1408
+ let { scrollLeft: n, scrollTop: o } = e, s = mt({
1427
1409
  cachedBounds: h,
1428
- containerScrollOffset: gt({
1410
+ containerScrollOffset: ut({
1429
1411
  containerElement: e,
1430
1412
  direction: r,
1431
1413
  isRtl: i,
@@ -1435,7 +1417,7 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1435
1417
  itemCount: a,
1436
1418
  overscanCount: l
1437
1419
  });
1438
- return _t(s, t) ? t : s;
1420
+ return dt(s, t) ? t : s;
1439
1421
  });
1440
1422
  };
1441
1423
  return e.addEventListener("scroll", t), () => {
@@ -1451,8 +1433,8 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1451
1433
  ]), {
1452
1434
  getCellBounds: g,
1453
1435
  getEstimatedSize: C,
1454
- scrollToIndex: pt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1455
- let s = yt({
1436
+ scrollToIndex: st(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1437
+ let s = pt({
1456
1438
  align: t,
1457
1439
  cachedBounds: h,
1458
1440
  containerScrollOffset: n,
@@ -1462,14 +1444,14 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1462
1444
  itemSize: m
1463
1445
  });
1464
1446
  if (e) {
1465
- if (s = gt({
1447
+ if (s = ut({
1466
1448
  containerElement: e,
1467
1449
  direction: r,
1468
1450
  isRtl: i,
1469
1451
  scrollOffset: s
1470
1452
  }), typeof e.scrollTo != "function") {
1471
1453
  let e = w(s);
1472
- _t(_, e) || v(e);
1454
+ dt(_, e) || v(e);
1473
1455
  }
1474
1456
  return s;
1475
1457
  }
@@ -1480,30 +1462,30 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1480
1462
  stopIndexVisible: x
1481
1463
  };
1482
1464
  }
1483
- function $(e) {
1484
- return V(() => e, Object.values(e));
1465
+ function yt(e) {
1466
+ return z(() => e, Object.values(e));
1485
1467
  }
1486
- function Tt(e, t) {
1468
+ function bt(e, t) {
1487
1469
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1488
- return _t(n, a) && _t(r, o) && _t(i, s);
1470
+ return dt(n, a) && dt(r, o) && dt(i, s);
1489
1471
  }
1490
- function Et(e) {
1472
+ function xt(e) {
1491
1473
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1492
1474
  }
1493
- var Dt = "data-react-window-index";
1494
- function Ot({ 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 }) {
1495
- let m = $(u), h = V(() => R(s, Tt), [s]), [g, _] = U(null), v = Et(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = wt({
1475
+ var St = "data-react-window-index";
1476
+ function Ct({ 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 }) {
1477
+ let m = yt(u), h = z(() => I(s, bt), [s]), [g, _] = V(null), v = xt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = vt({
1496
1478
  containerElement: g,
1497
1479
  containerStyle: f,
1498
1480
  defaultContainerSize: n,
1499
1481
  direction: "vertical",
1500
1482
  itemCount: c,
1501
1483
  itemProps: m,
1502
- itemSize: V(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1484
+ itemSize: z(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1503
1485
  onResize: i,
1504
1486
  overscanCount: o
1505
1487
  });
1506
- de(r, () => ({
1488
+ pe(r, () => ({
1507
1489
  get element() {
1508
1490
  return g;
1509
1491
  },
@@ -1518,12 +1500,12 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1518
1500
  top: r
1519
1501
  });
1520
1502
  }
1521
- }), [g, x]), ut(() => {
1503
+ }), [g, x]), Z(() => {
1522
1504
  if (!g) return;
1523
1505
  let e = Array.from(g.children).filter((e, t) => {
1524
1506
  if (e.hasAttribute("aria-hidden")) return !1;
1525
1507
  let n = `${S + t}`;
1526
- return e.setAttribute(Dt, n), !0;
1508
+ return e.setAttribute(St, n), !0;
1527
1509
  });
1528
1510
  if (v) return l.observeRowElements(e);
1529
1511
  }, [
@@ -1532,7 +1514,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1532
1514
  l,
1533
1515
  S,
1534
1516
  w
1535
- ]), B(() => {
1517
+ ]), R(() => {
1536
1518
  S >= 0 && w >= 0 && a && a({
1537
1519
  startIndex: C,
1538
1520
  stopIndex: T
@@ -1547,11 +1529,11 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1547
1529
  w,
1548
1530
  T
1549
1531
  ]);
1550
- let E = V(() => {
1532
+ let E = z(() => {
1551
1533
  let e = [];
1552
1534
  if (c > 0) for (let t = S; t <= w; t++) {
1553
1535
  let n = y(t);
1554
- e.push(/* @__PURE__ */ L(h, {
1536
+ e.push(/* @__PURE__ */ F(h, {
1555
1537
  ...m,
1556
1538
  ariaAttributes: {
1557
1539
  "aria-posinset": t + 1,
@@ -1578,7 +1560,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1578
1560
  m,
1579
1561
  S,
1580
1562
  w
1581
- ]), D = /* @__PURE__ */ G("div", {
1563
+ ]), D = /* @__PURE__ */ U("div", {
1582
1564
  "aria-hidden": !0,
1583
1565
  style: {
1584
1566
  height: b(),
@@ -1586,7 +1568,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1586
1568
  zIndex: -1
1587
1569
  }
1588
1570
  });
1589
- return L(d, {
1571
+ return F(d, {
1590
1572
  role: "list",
1591
1573
  ...p,
1592
1574
  className: t,
@@ -1600,46 +1582,46 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1600
1582
  }
1601
1583
  }, E, e, D);
1602
1584
  }
1603
- var kt = {
1585
+ var wt = {
1604
1586
  divider: "_divider_1tiyp_1",
1605
1587
  item: "_item_1tiyp_5",
1606
1588
  itemIcon: "_itemIcon_1tiyp_15",
1607
1589
  checkIcon: "_checkIcon_1tiyp_19",
1608
1590
  stateLabel: "_stateLabel_1tiyp_23"
1609
- }, At = 44, jt = 8, Mt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
1610
- let u = r[e], f = st(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
1611
- return /* @__PURE__ */ G("div", {
1591
+ }, Tt = 44, Et = 8, Dt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
1592
+ let u = r[e], f = nt(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
1593
+ return /* @__PURE__ */ U("div", {
1612
1594
  style: t,
1613
1595
  ...n,
1614
- children: /* @__PURE__ */ G(l, {
1596
+ children: /* @__PURE__ */ U(l, {
1615
1597
  type: "button",
1616
- className: o(kt.item, "h-full w-full gap-3 px-4"),
1617
- iconBefore: /* @__PURE__ */ G("span", {
1618
- className: kt.itemIcon,
1598
+ className: o(wt.item, "h-full w-full gap-3 px-4"),
1599
+ iconBefore: /* @__PURE__ */ U("span", {
1600
+ className: wt.itemIcon,
1619
1601
  children: f
1620
1602
  }),
1621
- label: /* @__PURE__ */ K("span", {
1603
+ label: /* @__PURE__ */ W("span", {
1622
1604
  className: "flex flex-1 items-center justify-between gap-2",
1623
- children: [/* @__PURE__ */ G(_, {
1605
+ children: [/* @__PURE__ */ U(_, {
1624
1606
  text: u.displayName ?? u.id,
1625
1607
  query: s,
1626
1608
  maxLines: 1,
1627
1609
  className: o(a, "min-w-0 flex-1 text-start")
1628
- }), p && /* @__PURE__ */ G(M, {
1610
+ }), p && /* @__PURE__ */ U(j, {
1629
1611
  size: d.SM,
1630
- className: kt.checkIcon,
1612
+ className: wt.checkIcon,
1631
1613
  "aria-hidden": !0
1632
1614
  })]
1633
1615
  }),
1634
1616
  onClick: () => c(u.id)
1635
1617
  })
1636
1618
  });
1637
- }, Nt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: h = "dial-body-semi-text", labelClassName: g = "dial-small-text", colors: _ }) => {
1638
- let [v, y] = U("");
1639
- B(() => {
1619
+ }, Ot = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: h = "dial-body-semi-text", labelClassName: g = "dial-small-text", colors: _ }) => {
1620
+ let [v, y] = V("");
1621
+ R(() => {
1640
1622
  e || y("");
1641
1623
  }, [e]);
1642
- let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? ot(s, v) : [], w = (e) => {
1624
+ let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? X(s, v) : [], w = (e) => {
1643
1625
  l(e), i();
1644
1626
  }, E = a({
1645
1627
  "--ci-sheet-divider": _?.divider,
@@ -1649,7 +1631,7 @@ var kt = {
1649
1631
  "--ci-sheet-icon": _?.itemIcon,
1650
1632
  "--ci-check-icon": _?.checkIcon
1651
1633
  });
1652
- return /* @__PURE__ */ G(q, {
1634
+ return /* @__PURE__ */ U(G, {
1653
1635
  isOpen: e,
1654
1636
  title: t,
1655
1637
  closeLabel: n,
@@ -1658,28 +1640,28 @@ var kt = {
1658
1640
  titleClassName: h,
1659
1641
  className: "max-h-[80dvh]",
1660
1642
  colors: _?.shell,
1661
- children: /* @__PURE__ */ K("div", {
1643
+ children: /* @__PURE__ */ W("div", {
1662
1644
  className: "contents",
1663
1645
  style: E,
1664
- children: [b && !x && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
1646
+ children: [b && !x && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
1665
1647
  className: "flex-shrink-0 px-4 py-[10px]",
1666
- children: /* @__PURE__ */ G(T, {
1648
+ children: /* @__PURE__ */ U(T, {
1667
1649
  value: v,
1668
1650
  placeholder: r,
1669
1651
  size: m.Standard,
1670
1652
  onChange: (e) => y(e ?? "")
1671
1653
  })
1672
- }), /* @__PURE__ */ G("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ G(it, { loadingLabel: u }) : S ? /* @__PURE__ */ G("div", {
1654
+ }), /* @__PURE__ */ U("div", { className: o(wt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ U(tt, { loadingLabel: u }) : S ? /* @__PURE__ */ U("div", {
1673
1655
  role: "list",
1674
- className: o(kt.stateLabel, g, "px-4 py-4"),
1656
+ className: o(wt.stateLabel, g, "px-4 py-4"),
1675
1657
  children: S
1676
- }) : /* @__PURE__ */ G(Ot, {
1658
+ }) : /* @__PURE__ */ U(Ct, {
1677
1659
  role: "list",
1678
1660
  className: "overflow-y-auto",
1679
- style: { height: Math.min(C.length, jt) * At },
1680
- rowComponent: Mt,
1661
+ style: { height: Math.min(C.length, Et) * Tt },
1662
+ rowComponent: Dt,
1681
1663
  rowCount: C.length,
1682
- rowHeight: At,
1664
+ rowHeight: Tt,
1683
1665
  rowProps: {
1684
1666
  items: C,
1685
1667
  selectedDeploymentId: c,
@@ -1690,23 +1672,23 @@ var kt = {
1690
1672
  })]
1691
1673
  })
1692
1674
  });
1693
- }, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: h, onPickerOpenChange: _ }) => {
1694
- let [v, y] = U(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = lt({
1675
+ }, kt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: h, onPickerOpenChange: _ }) => {
1676
+ let [v, y] = V(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = it({
1695
1677
  deployments: e,
1696
1678
  selectedDeploymentId: t,
1697
1679
  onDeploymentChange: n,
1698
1680
  modelSelectorLabels: r
1699
1681
  });
1700
1682
  if (!e) return null;
1701
- let E = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ G(ne, {
1683
+ let E = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ U(re, {
1702
1684
  size: d.SM,
1703
- className: Y.modelSelectorCaret,
1685
+ className: q.modelSelectorCaret,
1704
1686
  "aria-hidden": !0
1705
1687
  });
1706
- return a ? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(j, {
1688
+ return a ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(A, {
1707
1689
  tooltip: S,
1708
- children: /* @__PURE__ */ G(g, {
1709
- icon: /* @__PURE__ */ K("div", {
1690
+ children: /* @__PURE__ */ U(g, {
1691
+ icon: /* @__PURE__ */ W("div", {
1710
1692
  className: "flex items-center gap-1",
1711
1693
  children: [b, D]
1712
1694
  }),
@@ -1714,16 +1696,16 @@ var kt = {
1714
1696
  onClick: () => {
1715
1697
  s || y(!0);
1716
1698
  },
1717
- className: o("w-[50px]", Y.modelSelectorButton, E)
1699
+ className: o("w-[50px]", q.modelSelectorButton, E)
1718
1700
  })
1719
- }), l ? /* @__PURE__ */ G(q, {
1701
+ }), l ? /* @__PURE__ */ U(G, {
1720
1702
  isOpen: v,
1721
1703
  title: r?.ariaLabel ?? "Select model",
1722
1704
  closeLabel: r?.closeLabel ?? "Close",
1723
1705
  onClose: () => y(!1),
1724
1706
  style: c,
1725
1707
  children: l(() => y(!1))
1726
- }) : /* @__PURE__ */ G(Nt, {
1708
+ }) : /* @__PURE__ */ U(Ot, {
1727
1709
  isOpen: v,
1728
1710
  title: r?.ariaLabel ?? "Select model",
1729
1711
  closeLabel: r?.closeLabel ?? "Close",
@@ -1736,7 +1718,7 @@ var kt = {
1736
1718
  errorLabel: r?.error,
1737
1719
  emptyLabel: r?.empty,
1738
1720
  style: c
1739
- })] }) : l ? /* @__PURE__ */ G(p, {
1721
+ })] }) : l ? /* @__PURE__ */ U(p, {
1740
1722
  placement: "top-end",
1741
1723
  matchReferenceWidth: !1,
1742
1724
  open: u,
@@ -1745,25 +1727,25 @@ var kt = {
1745
1727
  outsideClosable: !0,
1746
1728
  renderOverlay: () => l(() => _?.(!1)),
1747
1729
  listClassName: "!w-[368px] !bg-layer-raised",
1748
- children: /* @__PURE__ */ G(j, {
1730
+ children: /* @__PURE__ */ U(A, {
1749
1731
  tooltip: S,
1750
- children: /* @__PURE__ */ K("button", {
1732
+ children: /* @__PURE__ */ W("button", {
1751
1733
  type: "button",
1752
1734
  "aria-label": x,
1753
1735
  "aria-disabled": s || void 0,
1754
- className: o("flex items-center justify-center gap-1 rounded-full p-2", Y.modelSelectorButton, E, s && Y.modelSelectorButtonDisabled),
1736
+ className: o("flex items-center justify-center gap-1 rounded-full p-2", q.modelSelectorButton, E, s && q.modelSelectorButtonDisabled),
1755
1737
  onClick: () => {
1756
1738
  !i && !s && h?.();
1757
1739
  },
1758
1740
  children: [b, D]
1759
1741
  })
1760
1742
  })
1761
- }) : /* @__PURE__ */ G("div", {
1743
+ }) : /* @__PURE__ */ U("div", {
1762
1744
  className: o(s && E),
1763
1745
  "aria-disabled": s || void 0,
1764
- children: /* @__PURE__ */ G(j, {
1746
+ children: /* @__PURE__ */ U(A, {
1765
1747
  tooltip: S,
1766
- children: /* @__PURE__ */ G(f, {
1748
+ children: /* @__PURE__ */ U(f, {
1767
1749
  icon: b,
1768
1750
  ariaLabel: x,
1769
1751
  items: C,
@@ -1775,12 +1757,12 @@ var kt = {
1775
1757
  size: m.Standard,
1776
1758
  caretIcon: D,
1777
1759
  iconClassName: s ? E : void 0,
1778
- buttonClassName: o("bg-transparent", Y.modelSelectorButton, s && Y.modelSelectorButtonDisabled)
1760
+ buttonClassName: o("bg-transparent", q.modelSelectorButton, s && q.modelSelectorButtonDisabled)
1779
1761
  })
1780
1762
  })
1781
1763
  });
1782
- }, Ft = 160, It = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, colors: D, typography: O, className: A, pendingDropFiles: j = [], onDropFilesConsumed: ee, pendingAttachments: te = [], onPendingAttachmentsConsumed: M, pasteTextThreshold: ne = 4e3, maxMessageLength: N = 5e4, deployments: ae, selectedDeploymentId: P, onDeploymentChange: F, modelSelectorLabels: oe, initialAttachments: se = [], isStacked: ce = !1, hideAddButton: le = !1, hideAttachFile: I = !1, hideActionBar: ue = !1, renderFooterActions: L, isInputDisabled: R = !1, isModelSelectorDisabled: B = !1, isSendDisabled: de = !1, isAudioMessageSupported: fe = !1, sendOnEnter: pe = Fe.Enter, prefixAttachments: me = [], onRemovePrefixAttachment: he, chatSettings: _e, toolsMenuItems: ve, onToolToggle: ye, toolsMenuTitle: be, toolsBackLabel: Se, toolsChipLabels: Ce, promptsMenuOverlay: q, promptsMenuTitle: we, promptsBackLabel: De, autoFocus: Oe = !1, messageHistory: je, onDialFileSystemClick: Me, dialFileSystemLabel: Ne, validateAttachment: Ie, onAttachmentClick: Le, modelPickerOverlay: Re, maximumAttachmentsAmount: ze, onAttachmentsLimitExceeded: Be, isAttachmentsEnabled: Ve = !0, usageLimitsSlot: He, onMessageTooLong: Ue }) => {
1783
- let We = s(), [Ge, Ke] = U(!1), J = ke(je), Je = V(() => a({
1764
+ }, At = 160, jt = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, colors: D, typography: O, className: ee, pendingDropFiles: A = [], onDropFilesConsumed: te, pendingAttachments: ne = [], onPendingAttachmentsConsumed: j, pasteTextThreshold: re = 4e3, maxMessageLength: M = 5e4, deployments: oe, selectedDeploymentId: N, onDeploymentChange: P, modelSelectorLabels: se, initialAttachments: ce = [], isStacked: le = !1, hideAddButton: ue = !1, hideAttachFile: de = !1, hideActionBar: fe = !1, renderFooterActions: F, isInputDisabled: I = !1, isModelSelectorDisabled: pe = !1, isSendDisabled: me = !1, isAudioMessageSupported: ge = !1, sendOnEnter: _e = Me.Enter, prefixAttachments: ye = [], onRemovePrefixAttachment: be, chatSettings: G, toolsMenuItems: xe, onToolToggle: we, toolsMenuTitle: Te, toolsBackLabel: Oe, toolsChipLabels: ke, promptsMenuOverlay: Ae, promptsMenuTitle: Ne, promptsBackLabel: Pe, autoFocus: Fe = !1, messageHistory: Ie, onDialFileSystemClick: Le, dialFileSystemLabel: Re, validateAttachment: ze, onAttachmentClick: Be, modelPickerOverlay: Ve, maximumAttachmentsAmount: He, onAttachmentsLimitExceeded: Ue, isAttachmentsEnabled: K = !0, usageLimitsSlot: Ge, onMessageTooLong: qe }) => {
1765
+ let Je = s(), [Ye, J] = V(!1), $e = Ee(Ie), et = z(() => a({
1784
1766
  "--ci-bg": D?.background,
1785
1767
  "--ci-text": D?.text,
1786
1768
  "--ci-border": D?.border,
@@ -1793,130 +1775,136 @@ var kt = {
1793
1775
  "--ci-voice-error": D?.voiceError,
1794
1776
  "--ci-voice-waveform": D?.voiceWaveform,
1795
1777
  "--ci-voice-accent": D?.voiceAccent
1796
- }), [D]), Ye = V(() => Me ? [{
1778
+ }), [D]), tt = z(() => Le ? [{
1797
1779
  key: "dial-fs",
1798
- label: Ne ?? "DIAL file system",
1799
- icon: /* @__PURE__ */ G(re, {
1780
+ label: Re ?? "DIAL file system",
1781
+ icon: /* @__PURE__ */ U(ie, {
1800
1782
  size: c,
1801
1783
  "aria-hidden": !0
1802
1784
  }),
1803
- onClick: Me
1804
- }] : [], [Me, Ne]), { message: X, setMessage: Ze, textareaRef: Qe, isMultiLine: $e } = Ae({
1785
+ onClick: Le
1786
+ }] : [], [Le, Re]), { message: Y, setMessage: X, textareaRef: nt, isMultiLine: rt } = De({
1805
1787
  messageProp: e,
1806
1788
  messageRevision: t
1807
- }), { attachments: Z, buildAttachments: rt, addAttachments: it, resetAttachments: at, handleRemove: ot, handleRetry: st, handleExpand: ct, hasBlockedAttachments: lt } = Te({
1808
- initialAttachments: se,
1789
+ }), { attachments: it, buildAttachments: Z, addAttachments: at, resetAttachments: ot, handleRemove: st, handleRetry: ct, handleExpand: lt, hasBlockedAttachments: ut } = Se({
1790
+ initialAttachments: ce,
1809
1791
  onUploadAttachment: r,
1810
1792
  onAttachmentsChange: f,
1811
- validateAttachment: Ie,
1812
- pendingDropFiles: j,
1813
- onDropFilesConsumed: ee,
1814
- pendingAttachments: te,
1815
- onPendingAttachmentsConsumed: M,
1816
- onExpandPastedText: z((e) => {
1817
- Ze((t) => t ? `${t}\n${e}` : e);
1818
- }, [Ze]),
1819
- maximumAttachmentsAmount: ze,
1820
- baseAttachmentsAmount: me.length,
1821
- onAttachmentsLimitExceeded: Be
1822
- }), { state: ut, analyserNodeRef: dt, errorMessage: ft, startRecording: pt, stopRecording: mt, discardRecording: ht } = Pe({ onAttachAudio: z((e) => {
1823
- it(rt([e]));
1824
- }, [it, rt]) }), gt = H(null), Q = H(null), { handlePaste: _t } = xe(it, Ve ? ne : Infinity), vt = z((e) => {
1825
- if (!Ve) {
1793
+ validateAttachment: ze,
1794
+ pendingDropFiles: A,
1795
+ onDropFilesConsumed: te,
1796
+ pendingAttachments: ne,
1797
+ onPendingAttachmentsConsumed: j,
1798
+ onExpandPastedText: L((e) => {
1799
+ X((t) => t ? `${t}\n${e}` : e);
1800
+ }, [X]),
1801
+ maximumAttachmentsAmount: He,
1802
+ baseAttachmentsAmount: ye.length,
1803
+ onAttachmentsLimitExceeded: Ue
1804
+ }), { state: Q, analyserNodeRef: dt, errorMessage: ft, startRecording: pt, stopRecording: mt, discardRecording: ht } = je({ onAttachAudio: L((e) => {
1805
+ at(Z([e]));
1806
+ }, [at, Z]) }), gt = B(null), _t = B(null), { handlePaste: vt } = ve(at, K ? re : Infinity), yt = L((e) => {
1807
+ if (!K) {
1826
1808
  let t = e.clipboardData.getData("text/plain");
1827
- t.length >= N && Ue?.(t.length, N);
1809
+ t.length >= M && qe?.(t.length, M);
1828
1810
  }
1829
- _t(e);
1811
+ vt(e);
1830
1812
  }, [
1831
- Ve,
1832
- N,
1833
- Ue,
1834
- _t
1835
- ]), yt = X.trim().length > 0 || Z.length > 0, bt = yt && !lt && !de, { shouldRender: xt, isExiting: St, instanceKey: Ct } = Ee(!l && yt, Ft), wt = (ve?.some((e) => e.isSelected) ?? !1) && ye != null, $ = ce || X.includes("\n") || $e || wt, Tt = ae === void 0 || P != null, Et = V(() => fe && !St && !l, [
1836
- fe,
1837
- St,
1813
+ K,
1814
+ M,
1815
+ qe,
1816
+ vt
1817
+ ]), bt = Y.trim().length > 0 || it.length > 0, xt = bt && !ut && !me, { shouldRender: St, isExiting: Ct, instanceKey: wt } = Ce(!l && bt, At), [Tt, Et] = V([]);
1818
+ R(() => {
1819
+ Et([]);
1820
+ }, [(xe ?? []).map((e) => e.id).join("|")]);
1821
+ let Dt = z(() => (xe ?? []).filter((e) => e.isSelected || !Tt.includes(e.id)), [xe, Tt]), Ot = L((e) => {
1822
+ Et((t) => t.includes(e) ? t : [...t, e]), xe?.find((t) => t.id === e)?.isSelected && we?.(e);
1823
+ }, [xe, we]), jt = Dt.length > 0 && we != null, $ = le || Y.includes("\n") || rt || jt, Mt = oe === void 0 || N != null, Nt = z(() => ge && !Ct && !l, [
1824
+ ge,
1825
+ Ct,
1838
1826
  l
1839
- ]), Dt = async () => {
1840
- if (de) return;
1841
- if (!Ve && X.length >= N) {
1842
- Ue?.(X.length, N);
1827
+ ]), Pt = async () => {
1828
+ if (me) return;
1829
+ if (!K && Y.length >= M) {
1830
+ qe?.(Y.length, M);
1843
1831
  return;
1844
1832
  }
1845
- let e = X, t = Z;
1846
- Ze(""), J.reset();
1833
+ let e = Y, t = it;
1834
+ X(""), $e.reset();
1847
1835
  try {
1848
1836
  await n?.(e, t), t.forEach((e) => {
1849
1837
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
1850
- }), at([]);
1838
+ }), ot([]);
1851
1839
  } catch {
1852
- Ze(e), at(t);
1840
+ X(e), ot(t);
1853
1841
  }
1854
- }, Ot = (e) => {
1855
- if (!e.nativeEvent.isComposing && !R && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1856
- let t = e.currentTarget.selectionStart ?? 0, n = J.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
1842
+ }, Ft = (e) => {
1843
+ if (!e.nativeEvent.isComposing && !I && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1844
+ let t = e.currentTarget.selectionStart ?? 0, n = $e.navigate(e.key === "ArrowUp" ? "up" : "down", Y, t);
1857
1845
  if (n !== null) {
1858
- e.preventDefault(), Ze(n);
1846
+ e.preventDefault(), X(n);
1859
1847
  return;
1860
1848
  }
1861
1849
  }
1862
- e.key === "Enter" && (pe === Fe.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && bt && Tt && !R && Dt());
1863
- }, kt = (e) => {
1850
+ e.key === "Enter" && (_e === Me.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && xt && Mt && !I && Pt());
1851
+ }, It = (e) => {
1864
1852
  let t = Array.from(e.target.files ?? []);
1865
1853
  if (t.length === 0) return;
1866
- let n = rt(t);
1867
- e.target.value = "", it(n);
1854
+ let n = Z(t);
1855
+ e.target.value = "", at(n);
1868
1856
  };
1869
- if (ut !== "idle") return /* @__PURE__ */ G(et, {
1870
- state: ut,
1857
+ if (Q !== "idle") return /* @__PURE__ */ U(Xe, {
1858
+ state: Q,
1871
1859
  analyserNodeRef: dt,
1872
1860
  errorMessage: ft,
1873
1861
  onStop: mt,
1874
1862
  onDiscard: ht,
1875
1863
  stopLabel: T,
1876
1864
  discardLabel: E,
1877
- style: Je,
1878
- className: A
1865
+ style: et,
1866
+ className: ee
1879
1867
  });
1880
- let At = /* @__PURE__ */ G("textarea", {
1881
- className: o(Y.textarea, O?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
1882
- ref: Qe,
1883
- autoFocus: Oe,
1884
- value: X,
1868
+ let Lt = /* @__PURE__ */ U("textarea", {
1869
+ className: o(q.textarea, O?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
1870
+ ref: nt,
1871
+ autoFocus: Fe,
1872
+ value: Y,
1885
1873
  onChange: (e) => {
1886
- Ze(e.target.value), J.notifyChange(), u?.(e.target.value);
1874
+ X(e.target.value), $e.notifyChange(), u?.(e.target.value);
1887
1875
  },
1888
- onKeyDown: Ot,
1889
- onPaste: vt,
1876
+ onKeyDown: Ft,
1877
+ onPaste: yt,
1890
1878
  placeholder: p,
1891
1879
  "aria-label": m,
1892
- disabled: R,
1880
+ disabled: I,
1893
1881
  rows: 1
1894
1882
  });
1895
- return /* @__PURE__ */ K("div", {
1896
- ref: Q,
1897
- style: Je,
1898
- className: o(Y.wrapper, R && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", Z.length > 6 ? "py-3 ps-3" : "p-3", A),
1899
- children: [(me.length > 0 || Z.length > 0) && /* @__PURE__ */ G(ge, {
1900
- attachments: [...me, ...Z],
1883
+ return /* @__PURE__ */ W("div", {
1884
+ ref: _t,
1885
+ style: et,
1886
+ className: o(q.wrapper, I && q.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", it.length > 6 ? "py-3 ps-3" : "p-3", ee),
1887
+ children: [(ye.length > 0 || it.length > 0) && /* @__PURE__ */ U(he, {
1888
+ attachments: [...ye, ...it],
1901
1889
  onRemove: (e) => {
1902
- me.some((t) => t.id === e) ? he?.(e) : ot(e);
1890
+ ye.some((t) => t.id === e) ? be?.(e) : st(e);
1903
1891
  },
1904
- onRetry: st,
1905
- onExpand: ct,
1892
+ onRetry: ct,
1893
+ onExpand: lt,
1906
1894
  labels: {
1907
1895
  removeLabel: b,
1908
1896
  retryLabel: x
1909
1897
  },
1910
- onAttachmentClick: Le == null ? void 0 : (e) => {
1911
- let t = [...me, ...Z].find((t) => t.id === e);
1912
- t != null && Le(t);
1898
+ onAttachmentClick: Be == null ? void 0 : (e) => {
1899
+ let t = [...ye, ...it].find((t) => t.id === e);
1900
+ t != null && Be(t);
1913
1901
  }
1914
- }), ue ? $ && At : /* @__PURE__ */ K("div", {
1902
+ }), fe ? $ && Lt : /* @__PURE__ */ W("div", {
1915
1903
  className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
1916
1904
  children: [
1917
- !le && /* @__PURE__ */ K("div", {
1905
+ !ue && /* @__PURE__ */ W("div", {
1918
1906
  className: o("flex", "order-2", !$ && "desktop:order-1"),
1919
- children: [/* @__PURE__ */ G("input", {
1907
+ children: [/* @__PURE__ */ U("input", {
1920
1908
  ref: gt,
1921
1909
  type: "file",
1922
1910
  multiple: !0,
@@ -1924,95 +1912,94 @@ var kt = {
1924
1912
  className: "sr-only",
1925
1913
  "aria-hidden": !0,
1926
1914
  tabIndex: -1,
1927
- onChange: kt
1928
- }), /* @__PURE__ */ G(qe, {
1929
- onAttachClick: I ? void 0 : () => gt.current?.click(),
1915
+ onChange: It
1916
+ }), /* @__PURE__ */ U(We, {
1917
+ onAttachClick: de ? void 0 : () => gt.current?.click(),
1930
1918
  attachLabel: h,
1931
1919
  addMenuTitle: _,
1932
1920
  menuTitle: v,
1933
1921
  menuCloseLabel: y,
1934
- style: Je,
1935
- isDisabled: R,
1936
- chatSettings: _e,
1937
- extraMenuItems: Ye,
1938
- toolsMenuItems: ve,
1939
- onToolToggle: ye,
1940
- toolsMenuTitle: be,
1941
- toolsBackLabel: Se,
1942
- promptsMenuOverlay: q,
1943
- promptsMenuTitle: we,
1944
- promptsBackLabel: De
1922
+ style: et,
1923
+ isDisabled: I,
1924
+ chatSettings: G,
1925
+ extraMenuItems: tt,
1926
+ toolsMenuItems: xe,
1927
+ onToolToggle: we,
1928
+ toolsMenuTitle: Te,
1929
+ toolsBackLabel: Oe,
1930
+ promptsMenuOverlay: Ae,
1931
+ promptsMenuTitle: Ne,
1932
+ promptsBackLabel: Pe
1945
1933
  })]
1946
1934
  }),
1947
- $ && wt && /* @__PURE__ */ G("div", {
1935
+ $ && Dt.length > 0 && we != null && /* @__PURE__ */ U("div", {
1948
1936
  className: "order-3 min-w-0 flex-1",
1949
- children: /* @__PURE__ */ G(Xe, {
1950
- items: ve ?? [],
1951
- onToolToggle: ye,
1952
- isMobile: We,
1953
- countLabel: Ce?.countLabel,
1954
- removeLabel: Ce?.removeLabel
1937
+ children: /* @__PURE__ */ U(Ke, {
1938
+ items: Dt,
1939
+ onToolToggle: we,
1940
+ onToolDismiss: Ot,
1941
+ removeLabel: ke?.removeLabel
1955
1942
  })
1956
1943
  }),
1957
- /* @__PURE__ */ G("div", {
1944
+ /* @__PURE__ */ U("div", {
1958
1945
  className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
1959
- children: At
1946
+ children: Lt
1960
1947
  }),
1961
- /* @__PURE__ */ K("div", {
1962
- className: o("flex flex-shrink-0 items-center gap-2", $ && wt ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
1963
- children: [L ? L({
1964
- canSend: bt,
1965
- onSend: Dt
1966
- }) : /* @__PURE__ */ K(W, { children: [
1967
- He,
1968
- /* @__PURE__ */ G(Pt, {
1969
- deployments: ae,
1970
- selectedDeploymentId: P,
1971
- onDeploymentChange: F,
1972
- modelSelectorLabels: oe,
1948
+ /* @__PURE__ */ W("div", {
1949
+ className: o("flex flex-shrink-0 items-center gap-2", $ && jt ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
1950
+ children: [F ? F({
1951
+ canSend: xt,
1952
+ onSend: Pt
1953
+ }) : /* @__PURE__ */ W(H, { children: [
1954
+ Ge,
1955
+ /* @__PURE__ */ U(kt, {
1956
+ deployments: oe,
1957
+ selectedDeploymentId: N,
1958
+ onDeploymentChange: P,
1959
+ modelSelectorLabels: se,
1973
1960
  isStreaming: l,
1974
- isMobile: We,
1975
- isDisabled: B,
1976
- style: Je,
1977
- modelPickerOverlay: Re,
1978
- isPickerOpen: Ge,
1979
- onPickerToggle: () => Ke((e) => !e),
1980
- onPickerOpenChange: Ke
1961
+ isMobile: Je,
1962
+ isDisabled: pe,
1963
+ style: et,
1964
+ modelPickerOverlay: Ve,
1965
+ isPickerOpen: Ye,
1966
+ onPickerToggle: () => J((e) => !e),
1967
+ onPickerOpenChange: J
1981
1968
  }),
1982
- l && i ? /* @__PURE__ */ G(nt, {
1969
+ l && i ? /* @__PURE__ */ U(Qe, {
1983
1970
  onStop: i,
1984
1971
  ariaLabel: C
1985
- }) : !l && xt && /* @__PURE__ */ G(tt, {
1986
- onSend: Dt,
1987
- isDisabled: !Tt || lt || de,
1972
+ }) : !l && St && /* @__PURE__ */ U(Ze, {
1973
+ onSend: Pt,
1974
+ isDisabled: !Mt || ut || me,
1988
1975
  ariaLabel: S,
1989
- isExiting: St
1990
- }, Ct)
1991
- ] }), Et && /* @__PURE__ */ G(k, {
1992
- icon: /* @__PURE__ */ G(ie, {
1976
+ isExiting: Ct
1977
+ }, wt)
1978
+ ] }), Nt && /* @__PURE__ */ U(k, {
1979
+ icon: /* @__PURE__ */ U(ae, {
1993
1980
  size: d.LG,
1994
1981
  "aria-hidden": !0
1995
1982
  }),
1996
1983
  "aria-label": w,
1997
1984
  className: "size-8 flex-shrink-0",
1998
1985
  onClick: pt,
1999
- disabled: R || l
1986
+ disabled: I || l
2000
1987
  })]
2001
1988
  })
2002
1989
  ]
2003
1990
  })]
2004
1991
  });
2005
- }, Lt = { welcome: "_welcome_n2ph8_1" }, Rt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, inputClassName: s, isInputDisabled: c = !1, ...l }) => {
1992
+ }, $ = { welcome: "_welcome_n2ph8_1" }, Mt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, inputClassName: s, isInputDisabled: c = !1, ...l }) => {
2006
1993
  let { colors: u, typography: d } = r ?? {};
2007
- return /* @__PURE__ */ K("div", {
1994
+ return /* @__PURE__ */ W("div", {
2008
1995
  style: a({ "--ci-welcome-color": u?.welcomeText }),
2009
1996
  className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
2010
- children: [n && /* @__PURE__ */ G("h1", {
2011
- className: o(Lt.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
1997
+ children: [n && /* @__PURE__ */ U("h1", {
1998
+ className: o($.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
2012
1999
  children: n
2013
- }), /* @__PURE__ */ G("div", {
2000
+ }), /* @__PURE__ */ U("div", {
2014
2001
  className: "relative w-full max-w-[748px]",
2015
- children: /* @__PURE__ */ G(It, {
2002
+ children: /* @__PURE__ */ U(jt, {
2016
2003
  placeholder: t,
2017
2004
  isStreaming: e,
2018
2005
  isInputDisabled: c,
@@ -2023,97 +2010,97 @@ var kt = {
2023
2010
  })
2024
2011
  })]
2025
2012
  });
2026
- }, zt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: y, onDropFilesConsumed: b, validateAttachment: S, isAttachmentsEnabled: C, hideAttachFile: w = !1, fileAccept: T, maximumAttachmentsAmount: E, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: ee, pasteTextThreshold: te, maxMessageLength: M = 5e4, onMessageTooLong: ne }) => {
2027
- let N = H(null), [ie, ae] = U([]);
2028
- B(() => {
2029
- y?.length && (ae(y), b?.());
2013
+ }, Nt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: y, onDropFilesConsumed: b, validateAttachment: S, isAttachmentsEnabled: C, hideAttachFile: w = !1, fileAccept: T, maximumAttachmentsAmount: E, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: ee, onPendingAttachmentsConsumed: A, onAttachmentClick: te, pasteTextThreshold: ne, maxMessageLength: j = 5e4, onMessageTooLong: re }) => {
2014
+ let M = B(null), [ae, oe] = V([]);
2015
+ R(() => {
2016
+ y?.length && (oe(y), b?.());
2030
2017
  }, [y, b]);
2031
- let [P, F] = U(e ?? ""), [oe, se] = U([]), [ce, le] = U(t), I = oe.some((e) => e.status === r.Loading || e.status === r.Error), ue = (P.trim().length > 0 || oe.length > 0 || ce.length > 0) && !I, L = (e) => {
2032
- le((t) => t.filter((t) => t.id !== e));
2033
- }, R = z((e, t) => {
2034
- i(e, ce, t);
2035
- }, [ce, i]), de = () => {
2036
- if (ue) {
2037
- if (!C && P.length >= M) {
2038
- ne?.(P.length, M);
2018
+ let [N, P] = V(e ?? ""), [se, ce] = V([]), [le, ue] = V(t), de = se.some((e) => e.status === r.Loading || e.status === r.Error), fe = (N.trim().length > 0 || se.length > 0 || le.length > 0) && !de, F = (e) => {
2019
+ ue((t) => t.filter((t) => t.id !== e));
2020
+ }, I = L((e, t) => {
2021
+ i(e, le, t);
2022
+ }, [le, i]), pe = () => {
2023
+ if (fe) {
2024
+ if (!C && N.length >= j) {
2025
+ re?.(N.length, j);
2039
2026
  return;
2040
2027
  }
2041
- R(P, oe);
2028
+ I(N, se);
2042
2029
  }
2043
- }, fe = z(() => ae([]), []), pe = z((e) => {
2030
+ }, me = L(() => oe([]), []), he = L((e) => {
2044
2031
  let t = Array.from(e.target.files ?? []);
2045
- t.length !== 0 && (e.target.value = "", ae(t));
2046
- }, []), me = V(() => O ? [{
2032
+ t.length !== 0 && (e.target.value = "", oe(t));
2033
+ }, []), ge = z(() => O ? [{
2047
2034
  key: "dial-fs",
2048
2035
  label: k ?? "DIAL file system",
2049
- icon: /* @__PURE__ */ G(re, {
2036
+ icon: /* @__PURE__ */ U(ie, {
2050
2037
  size: c,
2051
2038
  "aria-hidden": !0
2052
2039
  }),
2053
2040
  onClick: O
2054
2041
  }] : [], [O, k]);
2055
- return /* @__PURE__ */ K("div", {
2042
+ return /* @__PURE__ */ W("div", {
2056
2043
  className: o("flex w-full flex-col gap-2", _),
2057
- children: [/* @__PURE__ */ G(It, {
2044
+ children: [/* @__PURE__ */ U(jt, {
2058
2045
  message: e,
2059
2046
  ariaLabel: u,
2060
2047
  isStacked: !0,
2061
2048
  hideActionBar: !0,
2062
- pendingDropFiles: ie,
2063
- onDropFilesConsumed: fe,
2064
- onSend: R,
2049
+ pendingDropFiles: ae,
2050
+ onDropFilesConsumed: me,
2051
+ onSend: I,
2065
2052
  onUploadAttachment: a,
2066
- onChange: F,
2067
- onAttachmentsChange: se,
2053
+ onChange: P,
2054
+ onAttachmentsChange: ce,
2068
2055
  removeLabel: d,
2069
2056
  retryLabel: f,
2070
2057
  className: "max-w-full",
2071
- prefixAttachments: ce,
2072
- onRemovePrefixAttachment: L,
2058
+ prefixAttachments: le,
2059
+ onRemovePrefixAttachment: F,
2073
2060
  validateAttachment: S,
2074
2061
  isAttachmentsEnabled: C,
2075
2062
  maximumAttachmentsAmount: E,
2076
2063
  onAttachmentsLimitExceeded: D,
2077
- pendingAttachments: A,
2078
- onPendingAttachmentsConsumed: j,
2079
- onAttachmentClick: ee,
2080
- pasteTextThreshold: te,
2081
- maxMessageLength: M,
2082
- onMessageTooLong: ne
2083
- }), /* @__PURE__ */ K("div", {
2064
+ pendingAttachments: ee,
2065
+ onPendingAttachmentsConsumed: A,
2066
+ onAttachmentClick: te,
2067
+ pasteTextThreshold: ne,
2068
+ maxMessageLength: j,
2069
+ onMessageTooLong: re
2070
+ }), /* @__PURE__ */ W("div", {
2084
2071
  className: "flex items-center justify-between",
2085
- children: [/* @__PURE__ */ G("div", {
2072
+ children: [/* @__PURE__ */ U("div", {
2086
2073
  className: "flex",
2087
- children: !w && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("input", {
2088
- ref: N,
2074
+ children: !w && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
2075
+ ref: M,
2089
2076
  type: "file",
2090
2077
  multiple: !0,
2091
2078
  accept: T,
2092
2079
  className: "sr-only",
2093
2080
  "aria-hidden": !0,
2094
2081
  tabIndex: -1,
2095
- onChange: pe
2096
- }), /* @__PURE__ */ G(qe, {
2097
- onAttachClick: () => N.current?.click(),
2082
+ onChange: he
2083
+ }), /* @__PURE__ */ U(We, {
2084
+ onAttachClick: () => M.current?.click(),
2098
2085
  attachLabel: m,
2099
2086
  addMenuTitle: p,
2100
2087
  menuTitle: h,
2101
2088
  menuCloseLabel: g,
2102
- extraMenuItems: me
2089
+ extraMenuItems: ge
2103
2090
  })] })
2104
- }), /* @__PURE__ */ K("div", {
2091
+ }), /* @__PURE__ */ W("div", {
2105
2092
  className: "flex gap-2",
2106
- children: [/* @__PURE__ */ G(v, {
2093
+ children: [/* @__PURE__ */ U(v, {
2107
2094
  label: s,
2108
2095
  onClick: n
2109
- }), /* @__PURE__ */ G(x, {
2096
+ }), /* @__PURE__ */ U(x, {
2110
2097
  label: l,
2111
- onClick: de,
2112
- disabled: !ue
2098
+ onClick: pe,
2099
+ disabled: !fe
2113
2100
  })]
2114
2101
  })]
2115
2102
  })]
2116
2103
  });
2117
2104
  };
2118
2105
  //#endregion
2119
- export { pe as AttachmentCard, me as AttachmentGroup, he as AttachmentTray, q as BottomSheetShell, Ue as ChatSettingsModal, Rt as ConversationInput, zt as EditMessageInput, _e as FileDndOverlay, It as Input, Fe as SendOnEnter, be as getAttachmentIcon };
2106
+ export { G as BottomSheetShell, Be as ChatSettingsModal, Mt as ConversationInput, Nt as EditMessageInput, jt as Input, Me as SendOnEnter };