@epam/ai-dial-conversation-input 1.1.0-dev.179 → 1.1.0-dev.182

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
2
  import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, DialRadioGroup as p, DialSearch as m, DialSlider as h, DialTooltip as g, Dropdown as _, ElementSize as v, ErrorText as y, GhostIconButton as b, Highlight as x, Input as S, NeutralButton as C, Popup as w, PopupSize as T, PrimaryButton as E, PrimaryIconButton as D, RadioGroupOrientation as O, Skeleton as k, SkeletonVariant as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as ee, IconArrowNarrowRight as M, IconCheck as te, IconChevronDown as N, IconChevronRight as ne, IconFile as re, IconMicrophone as ie, IconPaperclip as ae, IconPlayerStopFilled as oe, IconPlaystationSquare as se, IconPlus as ce, IconPrompt as le, IconSettings as ue, IconTool as de, IconX as P } from "@tabler/icons-react";
4
- import { createPortal as F } from "react-dom";
5
- import { createElement as I, memo as fe, 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 { AttachmentCard as he, AttachmentGroup as ge, AttachmentTray as _e, AttachmentTray as ve, FileDndOverlay as ye, MAX_UPLOADS_PER_MINUTE as be, generateAttachmentId as xe, getAttachmentIcon as Se, useClipboardPaste as Ce } from "@epam/ai-dial-attachment-input";
3
+ import { IconArrowLeft as ee, IconArrowNarrowRight as M, IconCheck as N, IconChevronDown as te, IconChevronRight as P, IconFile as ne, IconMicrophone as re, IconPaperclip as ie, IconPlayerStopFilled as F, IconPlaystationSquare as I, IconPlus as ae, IconPrompt as oe, IconSettings as se, IconTool as ce, IconX as le } 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";
8
8
  //#region src/hooks/useBottomSheet.ts
9
- var we = (e, t) => {
10
- R(() => {
9
+ var Se = (e, t) => {
10
+ B(() => {
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]), R(() => {
16
+ }, [e, t]), B(() => {
17
17
  if (e) return document.body.style.overflow = "hidden", () => {
18
18
  document.body.style.overflow = "";
19
19
  };
20
20
  }, [e]);
21
- }, Te = {
21
+ }, Ce = {
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
- }, 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: m, children: h }) => {
28
- if (we(e, r), !e || typeof document > "u") return null;
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: m, children: h }) => {
28
+ if (Se(e, r), !e || typeof document > "u") return null;
29
29
  let g = a({
30
30
  "--ci-backdrop": m?.backdrop,
31
31
  "--ci-sheet-bg": m?.sheetBg,
32
32
  "--ci-sheet-text": m?.sheetText,
33
33
  "--ci-sheet-divider": m?.divider
34
34
  });
35
- return F(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
36
- className: o(Te.backdrop, "fixed inset-0 z-[55]"),
35
+ return ue(/* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
36
+ className: o(Ce.backdrop, "fixed inset-0 z-[55]"),
37
37
  style: g,
38
38
  onPointerDown: r,
39
39
  "aria-hidden": !0
40
- }), /* @__PURE__ */ W("div", {
40
+ }), /* @__PURE__ */ K("div", {
41
41
  role: "dialog",
42
42
  "aria-modal": !0,
43
43
  "aria-label": t ?? c,
@@ -45,14 +45,14 @@ var we = (e, t) => {
45
45
  ...g,
46
46
  ...l
47
47
  },
48
- className: o(Te.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", {
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", {
50
50
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
51
51
  children: [
52
- i && /* @__PURE__ */ U("div", {
52
+ i && /* @__PURE__ */ G("div", {
53
53
  className: "absolute start-4",
54
- children: /* @__PURE__ */ U(b, {
55
- icon: /* @__PURE__ */ U(ee, {
54
+ children: /* @__PURE__ */ G(b, {
55
+ icon: /* @__PURE__ */ G(ee, {
56
56
  size: d.LG,
57
57
  stroke: 1.5,
58
58
  className: "rtl:scale-x-[-1]"
@@ -61,41 +61,41 @@ var we = (e, t) => {
61
61
  onClick: i
62
62
  })
63
63
  }),
64
- /* @__PURE__ */ U("span", {
65
- className: o(Te.title, f),
64
+ /* @__PURE__ */ G("span", {
65
+ className: o(Ce.title, f),
66
66
  children: t
67
67
  }),
68
- /* @__PURE__ */ U("div", {
68
+ /* @__PURE__ */ G("div", {
69
69
  className: "absolute end-4 m-2",
70
- children: /* @__PURE__ */ U(u, {
70
+ children: /* @__PURE__ */ G(u, {
71
71
  ariaLabel: n,
72
72
  onClose: r,
73
73
  size: v.Standard
74
74
  })
75
75
  })
76
76
  ]
77
- }), /* @__PURE__ */ U("div", { className: o(Te.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ U("div", {
77
+ }), /* @__PURE__ */ G("div", { className: o(Ce.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ G("div", {
78
78
  className: "overflow-y-auto",
79
79
  children: h
80
80
  })]
81
81
  })] }), document.body);
82
- }, Ee = async (e, t, n) => {
82
+ }, we = 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
- }, De = ({ 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(() => {
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(() => {
89
89
  _.current = h;
90
- }, [h]), R(() => () => {
90
+ }, [h]), B(() => () => {
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 = L((e) => e.map((e) => {
95
+ let v = z((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: xe(),
98
+ id: ye(),
99
99
  name: e.name,
100
100
  contentType: e.type,
101
101
  file: e,
@@ -104,26 +104,26 @@ var we = (e, t) => {
104
104
  previewUrl: a,
105
105
  playUrl: o
106
106
  };
107
- }), []), y = B(a);
108
- R(() => {
107
+ }), []), y = H(a);
108
+ B(() => {
109
109
  y.current = a;
110
110
  }, [a]);
111
- let b = B(!0), x = L((e) => {
111
+ let b = H(!0), x = z((e) => {
112
112
  g((t) => {
113
113
  let n = e(t);
114
114
  return n === t ? t : n;
115
115
  });
116
116
  }, []);
117
- R(() => {
117
+ B(() => {
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 = L((e) => {
124
+ let S = z((e) => {
125
125
  g(e);
126
- }, []), C = L(async (t) => {
126
+ }, []), C = z(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 we = (e, t) => {
145
145
  } : e));
146
146
  }
147
147
  }
148
- }, [i, x]), w = L((e, t = !0) => {
148
+ }, [i, x]), w = z((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 we = (e, t) => {
166
166
  status: r.Error,
167
167
  errorReason: n
168
168
  } : e));
169
- }), Ee(e, be, C);
169
+ }), we(e, ve, C);
170
170
  }
171
171
  }
172
172
  }, [
@@ -177,20 +177,20 @@ var we = (e, t) => {
177
177
  C,
178
178
  o
179
179
  ]);
180
- R(() => {
180
+ B(() => {
181
181
  s.length !== 0 && (w(v(s)), c?.());
182
182
  }, [
183
183
  w,
184
184
  v,
185
185
  c,
186
186
  s
187
- ]), R(() => {
187
+ ]), B(() => {
188
188
  l.length !== 0 && (w(l, !1), u?.());
189
189
  }, [
190
190
  w,
191
191
  u,
192
192
  l
193
- ]), R(() => {
193
+ ]), B(() => {
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 we = (e, t) => {
217
217
  x,
218
218
  C
219
219
  ]);
220
- let T = L((e) => {
220
+ let T = z((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 we = (e, t) => {
229
229
  addAttachments: w,
230
230
  resetAttachments: S,
231
231
  handleRemove: T,
232
- handleRetry: L((e) => {
232
+ handleRetry: z((e) => {
233
233
  let t = h.find((t) => t.id === e);
234
234
  t && C(t);
235
235
  }, [h, C]),
236
- handleExpand: L(async (e) => {
236
+ handleExpand: z(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 we = (e, t) => {
245
245
  ]),
246
246
  hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
247
247
  };
248
- }, Oe = (e, t) => {
249
- let [n, r] = V(e), [i, a] = V(!1), [o, s] = V(0);
250
- return R(() => {
248
+ }, Ee = (e, t) => {
249
+ let [n, r] = U(e), [i, a] = U(!1), [o, s] = U(0);
250
+ return B(() => {
251
251
  if (e) {
252
252
  r(!0), a(!1), s((e) => e + 1);
253
253
  return;
@@ -263,18 +263,18 @@ var we = (e, t) => {
263
263
  isExiting: i,
264
264
  instanceKey: o
265
265
  };
266
- }, ke = (e, t) => !e.slice(0, t).includes("\n"), Ae = (e, t) => !e.slice(t).includes("\n"), je = (e) => {
267
- let t = B(e);
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);
268
268
  t.current = e;
269
- let n = B(-1), r = B(""), i = L((e, i, a) => {
269
+ let n = H(-1), r = H(""), i = z((e, i, a) => {
270
270
  let o = t.current;
271
- return !o || o.length === 0 ? null : e === "up" ? !ke(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 || !Ae(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
272
- }, []), a = L(() => {
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(() => {
273
273
  n.current = -1, r.current = "";
274
- }, []), o = L(() => {
274
+ }, []), o = z(() => {
275
275
  n.current = -1, r.current = "";
276
276
  }, []);
277
- return z(() => ({
277
+ return V(() => ({
278
278
  navigate: i,
279
279
  notifyChange: a,
280
280
  reset: o
@@ -283,13 +283,13 @@ var we = (e, t) => {
283
283
  a,
284
284
  o
285
285
  ]);
286
- }, Me = ({ messageProp: e, messageRevision: t }) => {
287
- let [n, r] = V(e), i = B(null), a = B(0), [o, s] = V(!1);
288
- return R(() => {
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(() => {
289
289
  r(e);
290
- }, [e, t]), R(() => {
290
+ }, [e, t]), B(() => {
291
291
  i.current && (a.current = i.current.offsetHeight);
292
- }, []), me(() => {
292
+ }, []), fe(() => {
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 we = (e, t) => {
299
299
  textareaRef: i,
300
300
  isMultiLine: o
301
301
  };
302
- }, Ne = /* @__PURE__ */ function(e) {
302
+ }, je = /* @__PURE__ */ function(e) {
303
303
  return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
304
- }({}), Pe = [
304
+ }({}), Me = [
305
305
  "audio/webm;codecs=opus",
306
306
  "audio/ogg;codecs=opus",
307
307
  "audio/webm"
308
- ], Fe = () => Pe.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Ie = ({ 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);
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);
310
310
  d.current = e;
311
- let f = L(() => {
311
+ let f = z(() => {
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 = L(() => {
313
+ }, []), p = z(() => {
314
314
  (async () => {
315
315
  try {
316
316
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
@@ -319,7 +319,7 @@ var we = (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 = Fe();
322
+ let i = Ne();
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 we = (e, t) => {
329
329
  i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
330
330
  }
331
331
  })();
332
- }, []), m = L(() => {
332
+ }, []), m = z(() => {
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], a = r.split("/")[1] ?? "webm", o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -1), s = new File([t], `voice-${o}.${a}`, { type: r });
336
336
  d.current(s), f(), i(null), n("idle");
337
337
  }, e.stop());
338
- }, [f]), h = L(() => {
338
+ }, [f]), h = z(() => {
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 R(() => () => {
342
+ return B(() => () => {
343
343
  f();
344
344
  }, [f]), {
345
345
  state: t,
@@ -349,12 +349,12 @@ var we = (e, t) => {
349
349
  stopRecording: m,
350
350
  discardRecording: h
351
351
  };
352
- }, Le = /* @__PURE__ */ function(e) {
352
+ }, Fe = /* @__PURE__ */ function(e) {
353
353
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
354
- }({}), Re = {
354
+ }({}), Ie = {
355
355
  item: "_item_5iycw_1",
356
356
  itemIcon: "_itemIcon_5iycw_11"
357
- }, ze = ({ 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
+ }, 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 }) => {
358
358
  let m = (e) => {
359
359
  e(), r();
360
360
  }, h = a({
@@ -363,7 +363,7 @@ var we = (e, t) => {
363
363
  "--ci-sheet-item-active": p?.itemActiveBg,
364
364
  "--ci-sheet-icon": p?.itemIcon
365
365
  });
366
- return /* @__PURE__ */ U(G, {
366
+ return /* @__PURE__ */ G(q, {
367
367
  isOpen: e,
368
368
  title: t,
369
369
  closeLabel: n,
@@ -372,23 +372,23 @@ var we = (e, t) => {
372
372
  className: c,
373
373
  titleClassName: u,
374
374
  colors: p?.shell,
375
- children: /* @__PURE__ */ U("ul", {
375
+ children: /* @__PURE__ */ G("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__ */ U("li", { children: /* @__PURE__ */ U(l, {
379
+ children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(l, {
380
380
  type: "button",
381
- className: o(Re.item, "w-full gap-3 px-4 py-[10px] text-start"),
382
- iconBefore: /* @__PURE__ */ U("span", {
383
- className: Re.itemIcon,
381
+ className: o(Ie.item, "w-full gap-3 px-4 py-[10px] text-start"),
382
+ iconBefore: /* @__PURE__ */ G("span", {
383
+ className: Ie.itemIcon,
384
384
  children: n
385
385
  }),
386
- iconAfter: r ? /* @__PURE__ */ U("span", {
386
+ iconAfter: r ? /* @__PURE__ */ G("span", {
387
387
  className: "ms-auto",
388
388
  children: r
389
389
  }) : null,
390
390
  textClassName: f,
391
- label: /* @__PURE__ */ U("span", {
391
+ label: /* @__PURE__ */ G("span", {
392
392
  className: d,
393
393
  children: t
394
394
  }),
@@ -396,9 +396,9 @@ var we = (e, t) => {
396
396
  }) }, e))
397
397
  })
398
398
  });
399
- }, Be = ({ 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(() => {
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(() => {
402
402
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
403
403
  }, [
404
404
  o,
@@ -415,7 +415,7 @@ var we = (e, t) => {
415
415
  setResponseFormat: c,
416
416
  setSystemPrompt: u,
417
417
  setTemperature: f,
418
- handleSubmit: L(() => {
418
+ handleSubmit: z(() => {
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 we = (e, t) => {
429
429
  a
430
430
  ])
431
431
  };
432
- }, Ve = { label: "_label_14i7c_1" }, He = ({ 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: m = "Plain text", systemPromptLabel: g = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
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: m = "Plain text", systemPromptLabel: g = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
433
433
  "Precise",
434
434
  "Neutral",
435
435
  "Creative"
436
436
  ], temperatureHint: b, labelClassName: x = "!dial-small-semi-text", colors: C }) => {
437
- let w = a({ "--csf-label-text": C?.labelText }), T = o(x, Ve.label, "gap-1");
438
- return /* @__PURE__ */ W("div", {
437
+ let w = a({ "--csf-label-text": C?.labelText }), T = o(x, ze.label, "gap-1");
438
+ return /* @__PURE__ */ K("div", {
439
439
  className: "flex flex-col gap-4 px-6 py-3",
440
440
  style: w,
441
441
  children: [
442
- e.responseFormat && /* @__PURE__ */ U(p, {
442
+ e.responseFormat && /* @__PURE__ */ G(p, {
443
443
  fieldTitle: u,
444
444
  labelClassName: T,
445
445
  elementId: "response-format",
@@ -455,7 +455,7 @@ var we = (e, t) => {
455
455
  }],
456
456
  onChange: (e) => s(e)
457
457
  }),
458
- e.systemPrompt && /* @__PURE__ */ U(S, {
458
+ e.systemPrompt && /* @__PURE__ */ G(S, {
459
459
  value: n,
460
460
  placeholder: _,
461
461
  labelProps: {
@@ -464,7 +464,7 @@ var we = (e, t) => {
464
464
  },
465
465
  onChange: (e) => c(e ?? "")
466
466
  }),
467
- e.temperature && /* @__PURE__ */ U(h, {
467
+ e.temperature && /* @__PURE__ */ G(h, {
468
468
  labelProps: {
469
469
  label: v,
470
470
  className: T,
@@ -479,8 +479,8 @@ var we = (e, t) => {
479
479
  })
480
480
  ]
481
481
  });
482
- }, Ue = ({ 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: _, systemPromptLabel: v, systemPromptTooltip: y, temperatureLabel: b, temperatureLabels: x, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
483
- let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: ee, handleSubmit: M } = Be({
482
+ }, 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: _, systemPromptLabel: v, systemPromptTooltip: y, temperatureLabel: b, temperatureLabels: x, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
483
+ let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: ee, handleSubmit: M } = Re({
484
484
  isOpen: e,
485
485
  features: s,
486
486
  initialResponseFormat: c,
@@ -489,7 +489,7 @@ var we = (e, t) => {
489
489
  onSave: d,
490
490
  onClose: r
491
491
  });
492
- return /* @__PURE__ */ W(G, {
492
+ return /* @__PURE__ */ K(q, {
493
493
  isOpen: e,
494
494
  title: f,
495
495
  closeLabel: i,
@@ -497,7 +497,7 @@ var we = (e, t) => {
497
497
  onBack: t,
498
498
  backLabel: n,
499
499
  style: a,
500
- children: [/* @__PURE__ */ U(He, {
500
+ children: [/* @__PURE__ */ G(Be, {
501
501
  features: s,
502
502
  responseFormat: T,
503
503
  systemPrompt: D,
@@ -514,13 +514,13 @@ var we = (e, t) => {
514
514
  temperatureLabel: b,
515
515
  temperatureLabels: x,
516
516
  temperatureHint: S
517
- }), /* @__PURE__ */ U("div", {
517
+ }), /* @__PURE__ */ G("div", {
518
518
  className: o("px-6 py-4 mobile:pb-8"),
519
- children: /* @__PURE__ */ U(g, {
519
+ children: /* @__PURE__ */ G(g, {
520
520
  tooltip: w,
521
521
  hideTooltip: k || !w,
522
522
  triggerClassName: "w-full",
523
- children: /* @__PURE__ */ U(E, {
523
+ children: /* @__PURE__ */ G(E, {
524
524
  label: C,
525
525
  onClick: M,
526
526
  disabled: !k,
@@ -529,8 +529,8 @@ var we = (e, t) => {
529
529
  })
530
530
  })]
531
531
  });
532
- }, We = { modal: "_modal_od073_1" }, Ge = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = We.modal }) => {
533
- let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Be({
532
+ }, He = { modal: "_modal_od073_1" }, Ue = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = He.modal }) => {
533
+ let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Re({
534
534
  features: e,
535
535
  initialResponseFormat: t,
536
536
  initialSystemPrompt: n,
@@ -538,25 +538,25 @@ var we = (e, t) => {
538
538
  onSave: i,
539
539
  onClose: a
540
540
  });
541
- return /* @__PURE__ */ U(w, {
541
+ return /* @__PURE__ */ G(w, {
542
542
  open: !0,
543
543
  header: o,
544
544
  size: T.Sm,
545
545
  onClose: a,
546
546
  className: y,
547
- footer: /* @__PURE__ */ U("div", {
547
+ footer: /* @__PURE__ */ G("div", {
548
548
  className: "flex justify-end px-6 py-4",
549
- children: /* @__PURE__ */ U(g, {
549
+ children: /* @__PURE__ */ G(g, {
550
550
  tooltip: v,
551
551
  hideTooltip: C || !v,
552
- children: /* @__PURE__ */ U(E, {
552
+ children: /* @__PURE__ */ G(E, {
553
553
  label: _,
554
554
  onClick: A,
555
555
  disabled: !C
556
556
  })
557
557
  })
558
558
  }),
559
- children: /* @__PURE__ */ U(He, {
559
+ children: /* @__PURE__ */ G(Be, {
560
560
  features: e,
561
561
  responseFormat: b,
562
562
  systemPrompt: x,
@@ -576,11 +576,11 @@ var we = (e, t) => {
576
576
  })
577
577
  });
578
578
  };
579
- fe(Ge);
580
- var Ke = {
579
+ R(Ue);
580
+ var We = {
581
581
  icon: "_icon_1fv6z_1",
582
582
  selectedIcon: "_selectedIcon_1fv6z_5"
583
- }, qe = ({ 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, {
583
+ }, 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, {
584
584
  isOpen: e,
585
585
  title: u,
586
586
  closeLabel: i,
@@ -588,32 +588,32 @@ var Ke = {
588
588
  onBack: t,
589
589
  backLabel: n,
590
590
  style: s,
591
- children: /* @__PURE__ */ U("ul", {
591
+ children: /* @__PURE__ */ G("ul", {
592
592
  role: "menu",
593
593
  className: "flex flex-col pb-4",
594
594
  style: a({
595
595
  "--tbs-icon-text": m?.iconText,
596
596
  "--tbs-selected-icon-text": m?.selectedIconText
597
597
  }),
598
- children: d.map((e) => /* @__PURE__ */ U("li", {
598
+ children: d.map((e) => /* @__PURE__ */ G("li", {
599
599
  role: "none",
600
- children: /* @__PURE__ */ U(l, {
600
+ children: /* @__PURE__ */ G(l, {
601
601
  type: "button",
602
602
  role: "menuitemcheckbox",
603
603
  "aria-checked": e.isSelected,
604
604
  className: "w-full gap-3 px-4 py-[10px] text-start",
605
- iconBefore: /* @__PURE__ */ U("span", {
606
- className: o("flex items-center", Ke.icon),
605
+ iconBefore: /* @__PURE__ */ G("span", {
606
+ className: o("flex items-center", We.icon),
607
607
  children: e.icon
608
608
  }),
609
- iconAfter: e.isSelected ? /* @__PURE__ */ U("span", {
610
- className: o("ms-auto", Ke.selectedIcon),
611
- children: /* @__PURE__ */ U(te, {
609
+ iconAfter: e.isSelected ? /* @__PURE__ */ G("span", {
610
+ className: o("ms-auto", We.selectedIcon),
611
+ children: /* @__PURE__ */ G(N, {
612
612
  size: c,
613
613
  "aria-hidden": !0
614
614
  })
615
615
  }) : null,
616
- label: /* @__PURE__ */ U("span", {
616
+ label: /* @__PURE__ */ G("span", {
617
617
  className: p,
618
618
  children: e.label
619
619
  }),
@@ -621,12 +621,12 @@ var Ke = {
621
621
  })
622
622
  }, e.id))
623
623
  })
624
- }), K = {
624
+ }), Ke = {
625
625
  selectedToolIcon: "_selectedToolIcon_r268y_1",
626
626
  toolIcon: "_toolIcon_r268y_5",
627
627
  chevronIcon: "_chevronIcon_r268y_9"
628
- }, Je = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: p = !1, chatSettings: m, extraMenuItems: h, toolsMenuItems: g = [], onToolToggle: y, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
629
- let D = s(), [O, k] = V(!1), [A, j] = V(!1), [ee, M] = V(!1), [N, re] = V(!1), [ie, oe] = V(!1), [se, P] = V(!1), F = z(() => a({
628
+ }, qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: p = !1, chatSettings: m, extraMenuItems: h, toolsMenuItems: g = [], onToolToggle: y, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
629
+ let D = s(), [O, k] = U(!1), [A, j] = U(!1), [ee, M] = U(!1), [te, ne] = U(!1), [re, F] = U(!1), I = V(() => a({
630
630
  "--aab-selected-tool-icon": E?.selectedToolIcon,
631
631
  "--aab-tool-icon": E?.toolIcon,
632
632
  "--aab-chevron-icon": E?.chevronIcon
@@ -634,91 +634,95 @@ var Ke = {
634
634
  E?.selectedToolIcon,
635
635
  E?.toolIcon,
636
636
  E?.chevronIcon
637
- ]), I = g.length > 0 && y != null, fe = z(() => g.map((e) => ({
637
+ ]), le = g.length > 0 && y != null, ue = V(() => g.map((e) => ({
638
638
  key: e.id,
639
- label: /* @__PURE__ */ W("span", {
639
+ label: /* @__PURE__ */ K("span", {
640
640
  className: "flex flex-1 items-center gap-2",
641
- children: [/* @__PURE__ */ U("span", {
641
+ children: [/* @__PURE__ */ G("span", {
642
642
  className: "flex-1",
643
643
  children: e.label
644
- }), e.isSelected && /* @__PURE__ */ U(te, {
644
+ }), e.isSelected && /* @__PURE__ */ G(N, {
645
645
  size: c,
646
- style: F,
647
- className: K.selectedToolIcon,
646
+ style: I,
647
+ className: Ke.selectedToolIcon,
648
648
  "aria-hidden": !0
649
649
  })]
650
650
  }),
651
- icon: /* @__PURE__ */ U("span", {
652
- style: F,
653
- className: o("flex items-center", K.toolIcon),
651
+ icon: /* @__PURE__ */ G("span", {
652
+ style: I,
653
+ className: o("flex items-center", Ke.toolIcon),
654
654
  children: e.icon
655
655
  }),
656
656
  onClick: () => y?.(e.id)
657
657
  })), [
658
658
  g,
659
659
  y,
660
- F
661
- ]), L = z(() => [
660
+ I
661
+ ]), L = V(() => [
662
662
  ...e == null ? [] : [{
663
663
  key: "attach",
664
664
  label: t,
665
- icon: /* @__PURE__ */ U(ae, {
665
+ icon: /* @__PURE__ */ G(ie, {
666
666
  size: c,
667
667
  "aria-hidden": !0
668
668
  }),
669
669
  onClick: e
670
670
  }],
671
671
  ...h ?? [],
672
- ...I ? [{
672
+ ...le ? [{
673
673
  key: "tools",
674
674
  label: x,
675
- icon: /* @__PURE__ */ U(de, {
675
+ icon: /* @__PURE__ */ G(ce, {
676
676
  size: c,
677
677
  "aria-hidden": !0
678
678
  }),
679
679
  onClick: D ? () => {
680
680
  M(!0), k(!1);
681
681
  } : () => void 0,
682
- ...D ? { iconAfter: /* @__PURE__ */ U(ne, {
682
+ ...D ? { iconAfter: /* @__PURE__ */ G(P, {
683
683
  size: c,
684
684
  stroke: 1.5,
685
- style: F,
686
- className: o("rtl:scale-x-[-1]", K.chevronIcon),
685
+ style: I,
686
+ className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
687
687
  "aria-hidden": !0
688
- }) } : { children: fe }
688
+ }) } : { children: ue }
689
689
  }] : [],
690
690
  ...C == null ? [] : [{
691
691
  key: "prompts",
692
692
  label: w,
693
- icon: /* @__PURE__ */ U(le, {
693
+ icon: /* @__PURE__ */ G(oe, {
694
694
  size: c,
695
695
  "aria-hidden": !0
696
696
  }),
697
697
  onClick: D ? () => {
698
- re(!0), k(!1);
699
- } : () => {
700
- oe(!1), P(!0);
701
- },
702
- iconAfter: D ? /* @__PURE__ */ U(ne, {
698
+ ne(!0), k(!1);
699
+ } : () => void 0,
700
+ ...D ? { iconAfter: /* @__PURE__ */ G(P, {
703
701
  size: c,
704
702
  stroke: 1.5,
705
- style: F,
706
- className: o("rtl:scale-x-[-1]", K.chevronIcon),
703
+ style: I,
704
+ className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
707
705
  "aria-hidden": !0
708
- }) : null
706
+ }) } : {
707
+ children: [{
708
+ key: "prompts-panel",
709
+ label: ""
710
+ }],
711
+ renderSubMenu: () => C(() => F(!1))
712
+ }
709
713
  }],
710
714
  ...m == null ? [] : [{
711
715
  key: "chat-settings",
712
716
  label: m.menuItemLabel ?? "Chat settings",
713
- icon: /* @__PURE__ */ U(ue, {
717
+ icon: /* @__PURE__ */ G(se, {
714
718
  size: c,
715
719
  "aria-hidden": !0
716
720
  }),
717
- iconAfter: D ? /* @__PURE__ */ U(ne, {
721
+ iconAfter: D ? /* @__PURE__ */ G(P, {
718
722
  size: c,
719
723
  stroke: 1.5,
720
- style: F,
721
- className: o("rtl:scale-x-[-1]", K.chevronIcon),
724
+ style: I,
725
+ className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
722
726
  "aria-hidden": !0
723
727
  }) : null,
724
728
  onClick: () => j(!0)
@@ -729,23 +733,23 @@ var Ke = {
729
733
  m,
730
734
  h,
731
735
  D,
732
- I,
736
+ le,
733
737
  x,
734
- fe,
738
+ ue,
735
739
  C,
736
740
  w,
737
- F
741
+ I
738
742
  ]);
739
743
  if (L.length === 0) return null;
740
- let R = /* @__PURE__ */ U(_, {
744
+ let R = /* @__PURE__ */ G(_, {
741
745
  matchReferenceWidth: !1,
742
746
  placement: "bottom-start",
743
747
  listClassName: f,
744
748
  items: L,
745
- open: C == null ? void 0 : ie,
746
- onOpenChange: C == null ? void 0 : oe,
747
- children: /* @__PURE__ */ U(b, {
748
- icon: /* @__PURE__ */ U(ce, {
749
+ open: C == null ? void 0 : re,
750
+ onOpenChange: C == null ? void 0 : F,
751
+ children: /* @__PURE__ */ G(b, {
752
+ icon: /* @__PURE__ */ G(ae, {
749
753
  size: d.LG,
750
754
  "aria-hidden": !0
751
755
  }),
@@ -754,9 +758,9 @@ var Ke = {
754
758
  disabled: p
755
759
  })
756
760
  });
757
- return /* @__PURE__ */ U(H, { children: D ? /* @__PURE__ */ W(H, { children: [
758
- /* @__PURE__ */ U(b, {
759
- icon: /* @__PURE__ */ U(ce, {
761
+ return /* @__PURE__ */ G(W, { children: D ? /* @__PURE__ */ K(W, { children: [
762
+ /* @__PURE__ */ G(b, {
763
+ icon: /* @__PURE__ */ G(ae, {
760
764
  size: d.LG,
761
765
  "aria-hidden": !0
762
766
  }),
@@ -766,7 +770,7 @@ var Ke = {
766
770
  disabled: p,
767
771
  onClick: () => k(!0)
768
772
  }),
769
- /* @__PURE__ */ U(ze, {
773
+ /* @__PURE__ */ G(Le, {
770
774
  isOpen: O,
771
775
  title: r,
772
776
  closeLabel: l,
@@ -776,7 +780,7 @@ var Ke = {
776
780
  className: "pb-4",
777
781
  btnTextClassName: "flex-1"
778
782
  }),
779
- I && /* @__PURE__ */ U(qe, {
783
+ le && /* @__PURE__ */ G(Ge, {
780
784
  isOpen: ee,
781
785
  onBack: () => {
782
786
  M(!1), k(!0);
@@ -789,19 +793,19 @@ var Ke = {
789
793
  items: g,
790
794
  onToolToggle: y
791
795
  }),
792
- C != null && /* @__PURE__ */ U(G, {
793
- isOpen: N,
796
+ C != null && /* @__PURE__ */ G(q, {
797
+ isOpen: te,
794
798
  title: w,
795
799
  closeLabel: l,
796
800
  onBack: () => {
797
- re(!1), k(!0);
801
+ ne(!1), k(!0);
798
802
  },
799
803
  backLabel: T,
800
- onClose: () => re(!1),
804
+ onClose: () => ne(!1),
801
805
  style: u,
802
- children: C(() => re(!1))
806
+ children: C(() => ne(!1))
803
807
  }),
804
- m != null && /* @__PURE__ */ U(Ue, {
808
+ m != null && /* @__PURE__ */ G(Ve, {
805
809
  isOpen: A,
806
810
  onBack: () => {
807
811
  j(!1), k(!0);
@@ -828,17 +832,7 @@ var Ke = {
828
832
  saveLabel: m.saveLabel,
829
833
  saveDisabledTooltip: m.saveDisabledTooltip
830
834
  })
831
- ] }) : /* @__PURE__ */ W(H, { children: [C == null ? R : /* @__PURE__ */ U(_, {
832
- matchReferenceWidth: !1,
833
- placement: "bottom-start",
834
- trigger: [],
835
- open: se,
836
- onOpenChange: P,
837
- renderOverlay: () => C(() => P(!1), () => {
838
- P(!1), oe(!0);
839
- }),
840
- children: R
841
- }), m != null && A && /* @__PURE__ */ U(Ge, {
835
+ ] }) : /* @__PURE__ */ K(W, { children: [R, m != null && A && /* @__PURE__ */ G(Ue, {
842
836
  features: m.features,
843
837
  initialResponseFormat: m.responseFormat ?? i.Markdown,
844
838
  initialSystemPrompt: m.systemPrompt,
@@ -858,12 +852,12 @@ var Ke = {
858
852
  saveLabel: m.saveLabel,
859
853
  saveDisabledTooltip: m.saveDisabledTooltip
860
854
  })] }) });
861
- }, q = {
855
+ }, J = {
862
856
  chip: "_chip_1gu87_1",
863
857
  chipIcon: "_chipIcon_1gu87_6",
864
858
  chipText: "_chipText_1gu87_10",
865
859
  chipClose: "_chipClose_1gu87_14"
866
- }, Ye = (e) => `${e} tool${e === 1 ? "" : "s"}`, J = (e) => `Remove ${e}`, Xe = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = Ye, removeLabel: i = J, typography: s, colors: l }) => {
860
+ }, 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
861
  let u = e.filter((e) => e.isSelected);
868
862
  if (u.length === 0) return null;
869
863
  let d = a({
@@ -875,47 +869,47 @@ var Ke = {
875
869
  "--ci-chip-close-hover": l?.chipCloseHover
876
870
  });
877
871
  if (n) {
878
- let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ U(de, {
872
+ let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ G(ce, {
879
873
  size: c,
880
874
  "aria-hidden": !0
881
875
  }), n = e ? u[0].label : r(u.length);
882
- return /* @__PURE__ */ U("div", {
876
+ return /* @__PURE__ */ G("div", {
883
877
  className: "flex flex-wrap items-center gap-2",
884
878
  style: d,
885
- children: /* @__PURE__ */ W("div", {
886
- className: o(q.chip, "flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1"),
887
- children: [/* @__PURE__ */ U("span", {
888
- className: o(q.chipIcon, "shrink-0"),
879
+ children: /* @__PURE__ */ K("div", {
880
+ className: o(J.chip, "flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1"),
881
+ children: [/* @__PURE__ */ G("span", {
882
+ className: o(J.chipIcon, "shrink-0"),
889
883
  "aria-hidden": !0,
890
884
  children: t
891
- }), /* @__PURE__ */ U("span", {
892
- className: o(q.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
885
+ }), /* @__PURE__ */ G("span", {
886
+ className: o(J.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
893
887
  children: n
894
888
  })]
895
889
  })
896
890
  });
897
891
  }
898
- return /* @__PURE__ */ U("div", {
892
+ return /* @__PURE__ */ G("div", {
899
893
  className: "flex flex-wrap items-center gap-2",
900
894
  style: d,
901
- children: u.map((e) => /* @__PURE__ */ W("div", {
902
- className: o(q.chip, "flex items-center gap-1.5 rounded-full border py-1 pe-1 ps-2"),
895
+ children: u.map((e) => /* @__PURE__ */ K("div", {
896
+ className: o(J.chip, "flex items-center gap-1.5 rounded-full border py-1 pe-1 ps-2"),
903
897
  children: [
904
- /* @__PURE__ */ U("span", {
905
- className: q.chipIcon,
898
+ /* @__PURE__ */ G("span", {
899
+ className: J.chipIcon,
906
900
  "aria-hidden": !0,
907
901
  children: e.icon
908
902
  }),
909
- /* @__PURE__ */ U("span", {
910
- className: o(q.chipText, s?.fontClassName || "dial-small-paragraph-text"),
903
+ /* @__PURE__ */ G("span", {
904
+ className: o(J.chipText, s?.fontClassName || "dial-small-paragraph-text"),
911
905
  children: e.label
912
906
  }),
913
- /* @__PURE__ */ U("button", {
907
+ /* @__PURE__ */ G("button", {
914
908
  type: "button",
915
909
  onClick: () => t(e.id),
916
- className: o(q.chipClose, "flex items-center rounded p-0.5 transition-colors"),
910
+ className: o(J.chipClose, "flex items-center rounded p-0.5 transition-colors"),
917
911
  "aria-label": i(e.label),
918
- children: /* @__PURE__ */ U(P, {
912
+ children: /* @__PURE__ */ G(le, {
919
913
  size: 12,
920
914
  "aria-hidden": !0
921
915
  })
@@ -935,22 +929,22 @@ var Ke = {
935
929
  waveformCanvas: "_waveformCanvas_129ri_5",
936
930
  recordingDot: "_recordingDot_129ri_19",
937
931
  "recording-pulse": "_recording-pulse_129ri_1"
938
- }, Ze = 3, Qe = 4, Z = 200, $e = ({ 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 = B(null), f = B(new Float32Array(Z)), p = B(0), m = B(0), h = e === Ne.Recording, g = e === Ne.Error, _ = L((e) => {
932
+ }, 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 }) => {
933
+ let u = H(null), f = H(new Float32Array($e)), p = H(0), m = H(0), h = e === je.Recording, g = e === je.Error, _ = z((e) => {
940
934
  let t = e.getContext("2d");
941
935
  if (!t) return;
942
936
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
943
937
  let { width: n, height: r } = e;
944
938
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
945
- let i = Math.min(Math.max(1, Math.floor(n / Qe)), Z - 1), a = p.current, o = m.current;
939
+ let i = Math.min(Math.max(1, Math.floor(n / Qe)), $e - 1), a = p.current, o = m.current;
946
940
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
947
941
  for (let e = 0; e <= i; e++) {
948
- let n = ((a - i + e) % Z + Z) % Z, o = f.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
942
+ 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
943
  t.fillRect(e * Qe, (r - c) / 2, Ze, c);
950
944
  }
951
945
  t.restore();
952
946
  }, []);
953
- R(() => {
947
+ B(() => {
954
948
  if (!h) return;
955
949
  let e = u.current;
956
950
  if (!e) return;
@@ -967,7 +961,7 @@ var Ke = {
967
961
  let r = (t[e] - 128) / 128;
968
962
  n += r * r;
969
963
  }
970
- f.current[p.current % Z] = Math.sqrt(n / t.length), p.current++;
964
+ f.current[p.current % $e] = Math.sqrt(n / t.length), p.current++;
971
965
  }
972
966
  }
973
967
  _(e), n = requestAnimationFrame(r);
@@ -979,7 +973,7 @@ var Ke = {
979
973
  h,
980
974
  t,
981
975
  _
982
- ]), R(() => {
976
+ ]), B(() => {
983
977
  let e = u.current;
984
978
  if (!e) return;
985
979
  let t = new ResizeObserver(() => {
@@ -987,17 +981,17 @@ var Ke = {
987
981
  });
988
982
  return t.observe(e), () => t.disconnect();
989
983
  }, [_]);
990
- let v = /* @__PURE__ */ W("div", {
984
+ let v = /* @__PURE__ */ K("div", {
991
985
  className: "flex flex-shrink-0 items-center justify-end gap-1",
992
- children: [/* @__PURE__ */ U(b, {
993
- icon: /* @__PURE__ */ U(P, {
986
+ children: [/* @__PURE__ */ G(b, {
987
+ icon: /* @__PURE__ */ G(le, {
994
988
  size: d.LG,
995
989
  "aria-hidden": !0
996
990
  }),
997
991
  "aria-label": s,
998
992
  onClick: i
999
- }), h && /* @__PURE__ */ U(D, {
1000
- icon: /* @__PURE__ */ U(oe, {
993
+ }), h && /* @__PURE__ */ G(D, {
994
+ icon: /* @__PURE__ */ G(F, {
1001
995
  size: d.LG,
1002
996
  "aria-hidden": !0
1003
997
  }),
@@ -1005,68 +999,68 @@ var Ke = {
1005
999
  "aria-label": a
1006
1000
  })]
1007
1001
  });
1008
- return /* @__PURE__ */ W("div", {
1002
+ return /* @__PURE__ */ K("div", {
1009
1003
  className: l,
1010
- children: [/* @__PURE__ */ W("div", {
1004
+ children: [/* @__PURE__ */ K("div", {
1011
1005
  style: c,
1012
1006
  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", g && X.wrapperError),
1013
- children: [/* @__PURE__ */ W("div", {
1007
+ children: [/* @__PURE__ */ K("div", {
1014
1008
  className: "flex min-w-0 flex-1 items-center gap-3",
1015
- children: [h && /* @__PURE__ */ U("span", {
1009
+ children: [h && /* @__PURE__ */ G("span", {
1016
1010
  className: o(X.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1017
1011
  "aria-hidden": !0
1018
- }), /* @__PURE__ */ U("canvas", {
1012
+ }), /* @__PURE__ */ G("canvas", {
1019
1013
  ref: u,
1020
1014
  height: 32,
1021
1015
  className: o(X.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
1022
1016
  })]
1023
1017
  }), v]
1024
- }), g && n && /* @__PURE__ */ U(y, {
1018
+ }), g && n && /* @__PURE__ */ G(y, {
1025
1019
  text: n,
1026
1020
  className: "mt-1 px-1"
1027
1021
  })]
1028
1022
  });
1029
- }, et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(D, {
1023
+ }, tt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ G(D, {
1030
1024
  "aria-label": n,
1031
1025
  onClick: () => e?.(),
1032
1026
  disabled: t,
1033
1027
  "aria-hidden": r,
1034
- icon: /* @__PURE__ */ U(M, {
1028
+ icon: /* @__PURE__ */ G(M, {
1035
1029
  size: d.LG,
1036
1030
  className: "rtl:scale-x-[-1]"
1037
1031
  })
1038
- }), tt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(j, {
1039
- icon: /* @__PURE__ */ U(se, { size: d.LG }),
1032
+ }), nt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ G(j, {
1033
+ icon: /* @__PURE__ */ G(I, { size: d.LG }),
1040
1034
  onClick: () => e?.(),
1041
1035
  "aria-label": t
1042
- }), nt = ({ size: e = 20 }) => /* @__PURE__ */ U(k, {
1036
+ }), Z = ({ size: e = 20 }) => /* @__PURE__ */ G(k, {
1043
1037
  variant: A.Circular,
1044
1038
  width: e,
1045
1039
  height: e,
1046
1040
  active: !0
1047
- }), rt = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
1041
+ }), rt = ({ loadingLabel: e }) => /* @__PURE__ */ K("span", {
1048
1042
  className: "flex min-w-0 flex-1 items-center",
1049
- children: [/* @__PURE__ */ U(k, {
1043
+ children: [/* @__PURE__ */ G(k, {
1050
1044
  variant: A.Text,
1051
1045
  width: "100%",
1052
1046
  height: 16,
1053
1047
  active: !0
1054
- }), e && /* @__PURE__ */ U("span", {
1048
+ }), e && /* @__PURE__ */ G("span", {
1055
1049
  className: "sr-only",
1056
1050
  children: e
1057
1051
  })]
1058
- }), it = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
1052
+ }), it = ({ loadingLabel: e }) => /* @__PURE__ */ G("div", {
1059
1053
  role: "status",
1060
1054
  "aria-label": e,
1061
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ W("div", {
1055
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ K("div", {
1062
1056
  className: "flex h-11 items-center gap-3 px-4",
1063
1057
  "aria-hidden": "true",
1064
- children: [/* @__PURE__ */ U(nt, {}), /* @__PURE__ */ U(rt, {})]
1058
+ children: [/* @__PURE__ */ G(Z, {}), /* @__PURE__ */ G(rt, {})]
1065
1059
  }, t))
1066
1060
  }), at = (e) => e.displayName ?? e.id, ot = (e, t) => {
1067
1061
  let n = t.trim().toLowerCase();
1068
1062
  return n ? e.filter((e) => at(e).toLowerCase().includes(n)) : e;
1069
- }, st = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
1063
+ }, st = (e, t, r, i = 18, a) => /* @__PURE__ */ G(n, {
1070
1064
  src: e,
1071
1065
  size: i,
1072
1066
  labels: { tooltip: a },
@@ -1076,16 +1070,16 @@ var Ke = {
1076
1070
  selectedItem: "_selectedItem_ibyso_5",
1077
1071
  selectedItemCheck: "_selectedItemCheck_ibyso_9"
1078
1072
  }, 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] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = z(() => h ? /* @__PURE__ */ U(nt, { size: d.LG }) : st(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG), [h, p]), _ = p?.displayName ?? p?.id;
1073
+ let [u, f] = U(""), p = V(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = V(() => h ? /* @__PURE__ */ G(Z, { size: d.LG }) : st(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG), [h, p]), _ = p?.displayName ?? p?.id;
1080
1074
  return {
1081
1075
  selectorIcon: g,
1082
1076
  selectorAriaLabel: _ ? `${r?.ariaLabel ?? "Select model"}: ${_}` : r?.ariaLabel ?? "Select model",
1083
1077
  selectedLabel: _,
1084
- menuItems: z(() => {
1078
+ menuItems: V(() => {
1085
1079
  if (h) return Array.from({ length: 7 }, (e, t) => ({
1086
1080
  key: `__loading-${t}`,
1087
- icon: /* @__PURE__ */ U(nt, {}),
1088
- label: /* @__PURE__ */ U(rt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1081
+ icon: /* @__PURE__ */ G(Z, {}),
1082
+ label: /* @__PURE__ */ G(rt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1089
1083
  disabled: !0
1090
1084
  }));
1091
1085
  if (!e || e.length === 0) {
@@ -1100,14 +1094,14 @@ var Ke = {
1100
1094
  let r = e.id === t;
1101
1095
  return {
1102
1096
  key: e.id,
1103
- label: /* @__PURE__ */ W("span", {
1097
+ label: /* @__PURE__ */ K("span", {
1104
1098
  className: "flex w-full items-center justify-between gap-2",
1105
1099
  style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
1106
- children: [/* @__PURE__ */ U(x, {
1100
+ children: [/* @__PURE__ */ G(x, {
1107
1101
  text: at(e),
1108
1102
  query: u,
1109
1103
  maxLines: 1
1110
- }), r && /* @__PURE__ */ U(te, {
1104
+ }), r && /* @__PURE__ */ G(N, {
1111
1105
  size: d.SM,
1112
1106
  stroke: 2,
1113
1107
  className: c,
@@ -1130,10 +1124,10 @@ var Ke = {
1130
1124
  c,
1131
1125
  l?.selectedItemCheck
1132
1126
  ]),
1133
- menuHeader: z(() => !h && e && e.length > 0 ? /* @__PURE__ */ U("div", {
1127
+ menuHeader: V(() => !h && e && e.length > 0 ? /* @__PURE__ */ G("div", {
1134
1128
  style: a({ "--ms-search-header-bg": l?.searchHeaderBackground }),
1135
1129
  className: o("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
1136
- children: /* @__PURE__ */ U(m, {
1130
+ children: /* @__PURE__ */ G(m, {
1137
1131
  value: u,
1138
1132
  placeholder: r?.searchPlaceholder ?? "Search",
1139
1133
  size: v.Small,
@@ -1152,7 +1146,7 @@ var Ke = {
1152
1146
  e || f("");
1153
1147
  }
1154
1148
  };
1155
- }, ut = typeof window < "u" ? me : R;
1149
+ }, ut = typeof window < "u" ? fe : B;
1156
1150
  function dt(e) {
1157
1151
  if (e !== void 0) switch (typeof e) {
1158
1152
  case "number": return e;
@@ -1162,10 +1156,10 @@ function dt(e) {
1162
1156
  }
1163
1157
  }
1164
1158
  function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1165
- let { styleHeight: s, styleWidth: c } = z(() => ({
1159
+ let { styleHeight: s, styleWidth: c } = V(() => ({
1166
1160
  styleHeight: dt(o?.height),
1167
1161
  styleWidth: dt(o?.width)
1168
- }), [o?.height, o?.width]), [l, u] = V({
1162
+ }), [o?.height, o?.width]), [l, u] = U({
1169
1163
  height: t,
1170
1164
  width: n
1171
1165
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
@@ -1189,7 +1183,7 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1189
1183
  i,
1190
1184
  s,
1191
1185
  c
1192
- ]), z(() => ({
1186
+ ]), V(() => ({
1193
1187
  height: s ?? l.height,
1194
1188
  width: c ?? l.width
1195
1189
  }), [
@@ -1199,12 +1193,12 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1199
1193
  ]);
1200
1194
  }
1201
1195
  function pt(e) {
1202
- let t = B(() => {
1196
+ let t = H(() => {
1203
1197
  throw Error("Cannot call during render.");
1204
1198
  });
1205
1199
  return ut(() => {
1206
1200
  t.current = e;
1207
- }, [e]), L((e) => t.current?.(e), [t]);
1201
+ }, [e]), z((e) => t.current?.(e), [t]);
1208
1202
  }
1209
1203
  var mt = null;
1210
1204
  function ht(e = !1) {
@@ -1316,7 +1310,7 @@ function xt({ itemCount: e, itemProps: t, itemSize: n }) {
1316
1310
  };
1317
1311
  }
1318
1312
  function St({ itemCount: e, itemProps: t, itemSize: n }) {
1319
- return z(() => xt({
1313
+ return V(() => xt({
1320
1314
  itemCount: e,
1321
1315
  itemProps: t,
1322
1316
  itemSize: n
@@ -1338,21 +1332,21 @@ function Ct({ containerSize: e, itemSize: t }) {
1338
1332
  }
1339
1333
  return n;
1340
1334
  }
1341
- function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1335
+ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1342
1336
  let { height: u = n, width: d = n } = ft({
1343
1337
  defaultHeight: r === "vertical" ? n : void 0,
1344
1338
  defaultWidth: r === "horizontal" ? n : void 0,
1345
1339
  element: e,
1346
1340
  mode: r === "vertical" ? "only-height" : "only-width",
1347
1341
  style: t
1348
- }), f = B({
1342
+ }), f = H({
1349
1343
  height: 0,
1350
1344
  width: 0
1351
1345
  }), p = r === "vertical" ? u : d, m = Ct({
1352
1346
  containerSize: p,
1353
1347
  itemSize: s
1354
1348
  });
1355
- me(() => {
1349
+ fe(() => {
1356
1350
  if (typeof c == "function") {
1357
1351
  let e = f.current;
1358
1352
  (e.height !== u || e.width !== d) && (c({
@@ -1369,7 +1363,7 @@ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
1369
1363
  itemCount: a,
1370
1364
  itemProps: o,
1371
1365
  itemSize: m
1372
- }), g = L((e) => h.get(e), [h]), [_, v] = V(() => bt({
1366
+ }), g = z((e) => h.get(e), [h]), [_, v] = U(() => bt({
1373
1367
  cachedBounds: h,
1374
1368
  containerScrollOffset: 0,
1375
1369
  containerSize: p,
@@ -1380,7 +1374,7 @@ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
1380
1374
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1381
1375
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1382
1376
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1383
- }, C = L(() => vt({
1377
+ }, C = z(() => vt({
1384
1378
  cachedBounds: h,
1385
1379
  itemCount: a,
1386
1380
  itemSize: m
@@ -1388,7 +1382,7 @@ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
1388
1382
  h,
1389
1383
  a,
1390
1384
  m
1391
- ]), w = L((t) => bt({
1385
+ ]), w = z((t) => bt({
1392
1386
  cachedBounds: h,
1393
1387
  containerScrollOffset: gt({
1394
1388
  containerElement: e,
@@ -1475,8 +1469,8 @@ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
1475
1469
  stopIndexVisible: x
1476
1470
  };
1477
1471
  }
1478
- function wt(e) {
1479
- return z(() => e, Object.values(e));
1472
+ function $(e) {
1473
+ return V(() => e, Object.values(e));
1480
1474
  }
1481
1475
  function Tt(e, t) {
1482
1476
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
@@ -1487,18 +1481,18 @@ function Et(e) {
1487
1481
  }
1488
1482
  var Dt = "data-react-window-index";
1489
1483
  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 }) {
1490
- let m = wt(u), h = z(() => fe(s, Tt), [s]), [g, _] = V(null), v = Et(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = $({
1484
+ 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({
1491
1485
  containerElement: g,
1492
1486
  containerStyle: f,
1493
1487
  defaultContainerSize: n,
1494
1488
  direction: "vertical",
1495
1489
  itemCount: c,
1496
1490
  itemProps: m,
1497
- itemSize: z(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1491
+ itemSize: V(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1498
1492
  onResize: i,
1499
1493
  overscanCount: o
1500
1494
  });
1501
- pe(r, () => ({
1495
+ de(r, () => ({
1502
1496
  get element() {
1503
1497
  return g;
1504
1498
  },
@@ -1527,7 +1521,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1527
1521
  l,
1528
1522
  S,
1529
1523
  w
1530
- ]), R(() => {
1524
+ ]), B(() => {
1531
1525
  S >= 0 && w >= 0 && a && a({
1532
1526
  startIndex: C,
1533
1527
  stopIndex: T
@@ -1542,11 +1536,11 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1542
1536
  w,
1543
1537
  T
1544
1538
  ]);
1545
- let E = z(() => {
1539
+ let E = V(() => {
1546
1540
  let e = [];
1547
1541
  if (c > 0) for (let t = S; t <= w; t++) {
1548
1542
  let n = y(t);
1549
- e.push(/* @__PURE__ */ I(h, {
1543
+ e.push(/* @__PURE__ */ L(h, {
1550
1544
  ...m,
1551
1545
  ariaAttributes: {
1552
1546
  "aria-posinset": t + 1,
@@ -1573,7 +1567,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1573
1567
  m,
1574
1568
  S,
1575
1569
  w
1576
- ]), D = /* @__PURE__ */ U("div", {
1570
+ ]), D = /* @__PURE__ */ G("div", {
1577
1571
  "aria-hidden": !0,
1578
1572
  style: {
1579
1573
  height: b(),
@@ -1581,7 +1575,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1581
1575
  zIndex: -1
1582
1576
  }
1583
1577
  });
1584
- return I(d, {
1578
+ return L(d, {
1585
1579
  role: "list",
1586
1580
  ...p,
1587
1581
  className: t,
@@ -1603,24 +1597,24 @@ var kt = {
1603
1597
  stateLabel: "_stateLabel_s5khb_23"
1604
1598
  }, At = 44, jt = 8, Mt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
1605
1599
  let u = r[e], f = st(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
1606
- return /* @__PURE__ */ U("div", {
1600
+ return /* @__PURE__ */ G("div", {
1607
1601
  style: t,
1608
1602
  ...n,
1609
- children: /* @__PURE__ */ U(l, {
1603
+ children: /* @__PURE__ */ G(l, {
1610
1604
  type: "button",
1611
1605
  className: o(kt.item, "h-full w-full gap-3 px-4"),
1612
- iconBefore: /* @__PURE__ */ U("span", {
1606
+ iconBefore: /* @__PURE__ */ G("span", {
1613
1607
  className: kt.itemIcon,
1614
1608
  children: f
1615
1609
  }),
1616
- label: /* @__PURE__ */ W("span", {
1610
+ label: /* @__PURE__ */ K("span", {
1617
1611
  className: "flex flex-1 items-center justify-between gap-2",
1618
- children: [/* @__PURE__ */ U(x, {
1612
+ children: [/* @__PURE__ */ G(x, {
1619
1613
  text: u.displayName ?? u.id,
1620
1614
  query: s,
1621
1615
  maxLines: 1,
1622
1616
  className: o(a, "min-w-0 flex-1 text-start")
1623
- }), p && /* @__PURE__ */ U(te, {
1617
+ }), p && /* @__PURE__ */ G(N, {
1624
1618
  size: d.SM,
1625
1619
  className: kt.checkIcon,
1626
1620
  "aria-hidden": !0
@@ -1630,8 +1624,8 @@ var kt = {
1630
1624
  })
1631
1625
  });
1632
1626
  }, 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: _ }) => {
1633
- let [y, b] = V("");
1634
- R(() => {
1627
+ let [y, b] = U("");
1628
+ B(() => {
1635
1629
  e || b("");
1636
1630
  }, [e]);
1637
1631
  let x = s && s.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? ot(s, y) : [], T = (e) => {
@@ -1644,7 +1638,7 @@ var kt = {
1644
1638
  "--ci-sheet-icon": _?.itemIcon,
1645
1639
  "--ci-check-icon": _?.checkIcon
1646
1640
  });
1647
- return /* @__PURE__ */ U(G, {
1641
+ return /* @__PURE__ */ G(q, {
1648
1642
  isOpen: e,
1649
1643
  title: t,
1650
1644
  closeLabel: n,
@@ -1653,22 +1647,22 @@ var kt = {
1653
1647
  titleClassName: h,
1654
1648
  className: "max-h-[80dvh]",
1655
1649
  colors: _?.shell,
1656
- children: /* @__PURE__ */ W("div", {
1650
+ children: /* @__PURE__ */ K("div", {
1657
1651
  className: "contents",
1658
1652
  style: E,
1659
- children: [x && !S && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
1653
+ children: [x && !S && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
1660
1654
  className: "flex-shrink-0 px-4 py-[10px]",
1661
- children: /* @__PURE__ */ U(m, {
1655
+ children: /* @__PURE__ */ G(m, {
1662
1656
  value: y,
1663
1657
  placeholder: r,
1664
1658
  size: v.Standard,
1665
1659
  onChange: b
1666
1660
  })
1667
- }), /* @__PURE__ */ U("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ U(it, { loadingLabel: u }) : C ? /* @__PURE__ */ U("div", {
1661
+ }), /* @__PURE__ */ G("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ G(it, { loadingLabel: u }) : C ? /* @__PURE__ */ G("div", {
1668
1662
  role: "list",
1669
1663
  className: o(kt.stateLabel, g, "px-4 py-4"),
1670
1664
  children: C
1671
- }) : /* @__PURE__ */ U(Ot, {
1665
+ }) : /* @__PURE__ */ G(Ot, {
1672
1666
  role: "list",
1673
1667
  className: "overflow-y-auto",
1674
1668
  style: { height: Math.min(w.length, jt) * At },
@@ -1686,22 +1680,22 @@ var kt = {
1686
1680
  })
1687
1681
  });
1688
1682
  }, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: p, onPickerOpenChange: m }) => {
1689
- let [h, y] = V(!1), { selectorIcon: x, selectorAriaLabel: S, selectedLabel: C, menuItems: w, menuHeader: T, onOpenChange: E } = lt({
1683
+ let [h, y] = U(!1), { selectorIcon: x, selectorAriaLabel: S, selectedLabel: C, menuItems: w, menuHeader: T, onOpenChange: E } = lt({
1690
1684
  deployments: e,
1691
1685
  selectedDeploymentId: t,
1692
1686
  onDeploymentChange: n,
1693
1687
  modelSelectorLabels: r
1694
1688
  });
1695
1689
  if (!e) return null;
1696
- let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ U(N, {
1690
+ let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ G(te, {
1697
1691
  size: d.SM,
1698
1692
  className: Y.modelSelectorCaret,
1699
1693
  "aria-hidden": !0
1700
1694
  });
1701
- return a ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(g, {
1695
+ return a ? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(g, {
1702
1696
  tooltip: C,
1703
- children: /* @__PURE__ */ U(b, {
1704
- icon: /* @__PURE__ */ W("div", {
1697
+ children: /* @__PURE__ */ G(b, {
1698
+ icon: /* @__PURE__ */ K("div", {
1705
1699
  className: "flex items-center gap-1",
1706
1700
  children: [x, O]
1707
1701
  }),
@@ -1711,14 +1705,14 @@ var kt = {
1711
1705
  },
1712
1706
  className: o("w-[50px]", Y.modelSelectorButton, D)
1713
1707
  })
1714
- }), l ? /* @__PURE__ */ U(G, {
1708
+ }), l ? /* @__PURE__ */ G(q, {
1715
1709
  isOpen: h,
1716
1710
  title: r?.ariaLabel ?? "Select model",
1717
1711
  closeLabel: r?.closeLabel ?? "Close",
1718
1712
  onClose: () => y(!1),
1719
1713
  style: c,
1720
1714
  children: l(() => y(!1))
1721
- }) : /* @__PURE__ */ U(Nt, {
1715
+ }) : /* @__PURE__ */ G(Nt, {
1722
1716
  isOpen: h,
1723
1717
  title: r?.ariaLabel ?? "Select model",
1724
1718
  closeLabel: r?.closeLabel ?? "Close",
@@ -1731,7 +1725,7 @@ var kt = {
1731
1725
  errorLabel: r?.error,
1732
1726
  emptyLabel: r?.empty,
1733
1727
  style: c
1734
- })] }) : l ? /* @__PURE__ */ U(_, {
1728
+ })] }) : l ? /* @__PURE__ */ G(_, {
1735
1729
  placement: "top-end",
1736
1730
  matchReferenceWidth: !1,
1737
1731
  open: u,
@@ -1740,9 +1734,9 @@ var kt = {
1740
1734
  outsideClosable: !0,
1741
1735
  renderOverlay: () => l(() => m?.(!1)),
1742
1736
  listClassName: "cp-dropdown-overlay !w-[320px]",
1743
- children: /* @__PURE__ */ U(g, {
1737
+ children: /* @__PURE__ */ G(g, {
1744
1738
  tooltip: C,
1745
- children: /* @__PURE__ */ W("button", {
1739
+ children: /* @__PURE__ */ K("button", {
1746
1740
  type: "button",
1747
1741
  "aria-label": S,
1748
1742
  "aria-disabled": s || void 0,
@@ -1753,12 +1747,12 @@ var kt = {
1753
1747
  children: [x, O]
1754
1748
  })
1755
1749
  })
1756
- }) : /* @__PURE__ */ U("div", {
1750
+ }) : /* @__PURE__ */ G("div", {
1757
1751
  className: o(s && D),
1758
1752
  "aria-disabled": s || void 0,
1759
- children: /* @__PURE__ */ U(g, {
1753
+ children: /* @__PURE__ */ G(g, {
1760
1754
  tooltip: C,
1761
- children: /* @__PURE__ */ U(f, {
1755
+ children: /* @__PURE__ */ G(f, {
1762
1756
  icon: x,
1763
1757
  ariaLabel: S,
1764
1758
  items: w,
@@ -1774,8 +1768,8 @@ var kt = {
1774
1768
  })
1775
1769
  })
1776
1770
  });
1777
- }, 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: k, pendingDropFiles: A = [], onDropFilesConsumed: ee, pendingAttachments: M = [], onPendingAttachmentsConsumed: te, pasteTextThreshold: N = 4e3, deployments: ne, selectedDeploymentId: ae, onDeploymentChange: oe, modelSelectorLabels: se, initialAttachments: ce = [], isStacked: le = !1, hideAddButton: ue = !1, hideAttachFile: de = !1, hideActionBar: P = !1, renderFooterActions: F, isInputDisabled: I = !1, isModelSelectorDisabled: fe = !1, isSendDisabled: R = !1, isAudioMessageSupported: pe = !1, sendOnEnter: me = Le.Enter, prefixAttachments: he = [], onRemovePrefixAttachment: ge, chatSettings: _e, toolsMenuItems: ye, onToolToggle: be, toolsMenuTitle: xe, toolsBackLabel: Se, toolsChipLabels: we, promptsMenuOverlay: Te, promptsMenuTitle: G, promptsBackLabel: Ee, autoFocus: ke = !1, messageHistory: Ae, onDialFileSystemClick: Ne, dialFileSystemLabel: Pe, validateAttachment: Fe, onAttachmentClick: Re, modelPickerOverlay: ze, maximumAttachmentsAmount: Be, onAttachmentsLimitExceeded: Ve, isAttachmentsEnabled: He = !0, usageLimitsSlot: Ue, onMessageTooLong: We }) => {
1778
- let Ge = s(), [Ke, qe] = V(!1), K = je(Ae), q = z(() => a({
1771
+ }, 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: k, pendingDropFiles: A = [], onDropFilesConsumed: ee, pendingAttachments: M = [], onPendingAttachmentsConsumed: N, pasteTextThreshold: te = 4e3, maxMessageLength: P = 5e4, deployments: ie, selectedDeploymentId: F, onDeploymentChange: I, modelSelectorLabels: ae, initialAttachments: oe = [], isStacked: se = !1, hideAddButton: ce = !1, hideAttachFile: le = !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 }) => {
1772
+ let We = s(), [Ge, Ke] = U(!1), J = ke(je), Je = V(() => a({
1779
1773
  "--ci-bg": D?.background,
1780
1774
  "--ci-text": D?.text,
1781
1775
  "--ci-border": D?.border,
@@ -1788,210 +1782,210 @@ var kt = {
1788
1782
  "--ci-voice-error": D?.voiceError,
1789
1783
  "--ci-voice-waveform": D?.voiceWaveform,
1790
1784
  "--ci-voice-accent": D?.voiceAccent
1791
- }), [D]), Ye = z(() => Ne ? [{
1785
+ }), [D]), Ye = V(() => Me ? [{
1792
1786
  key: "dial-fs",
1793
- label: Pe ?? "DIAL file system",
1794
- icon: /* @__PURE__ */ U(re, {
1787
+ label: Ne ?? "DIAL file system",
1788
+ icon: /* @__PURE__ */ G(ne, {
1795
1789
  size: c,
1796
1790
  "aria-hidden": !0
1797
1791
  }),
1798
- onClick: Ne
1799
- }] : [], [Ne, Pe]), { message: J, setMessage: X, textareaRef: Ze, isMultiLine: Qe } = Me({
1792
+ onClick: Me
1793
+ }] : [], [Me, Ne]), { message: X, setMessage: Ze, textareaRef: Qe, isMultiLine: $e } = Ae({
1800
1794
  messageProp: e,
1801
1795
  messageRevision: t
1802
- }), { attachments: Z, buildAttachments: nt, addAttachments: rt, resetAttachments: it, handleRemove: at, handleRetry: ot, handleExpand: st, hasBlockedAttachments: ct } = De({
1803
- initialAttachments: ce,
1796
+ }), { attachments: Z, buildAttachments: rt, addAttachments: it, resetAttachments: at, handleRemove: ot, handleRetry: st, handleExpand: ct, hasBlockedAttachments: lt } = Te({
1797
+ initialAttachments: oe,
1804
1798
  onUploadAttachment: r,
1805
1799
  onAttachmentsChange: f,
1806
- validateAttachment: Fe,
1800
+ validateAttachment: Ie,
1807
1801
  pendingDropFiles: A,
1808
1802
  onDropFilesConsumed: ee,
1809
1803
  pendingAttachments: M,
1810
- onPendingAttachmentsConsumed: te,
1811
- onExpandPastedText: L((e) => {
1812
- X((t) => t ? `${t}\n${e}` : e);
1813
- }, [X]),
1814
- maximumAttachmentsAmount: Be,
1815
- baseAttachmentsAmount: he.length,
1816
- onAttachmentsLimitExceeded: Ve
1817
- }), { state: lt, analyserNodeRef: ut, errorMessage: dt, startRecording: ft, stopRecording: pt, discardRecording: mt } = Ie({ onAttachAudio: L((e) => {
1818
- rt(nt([e]));
1819
- }, [rt, nt]) }), ht = B(null), gt = B(null), { handlePaste: Q } = Ce(rt, He ? N : Infinity), _t = L((e) => {
1820
- if (!He) {
1804
+ onPendingAttachmentsConsumed: N,
1805
+ onExpandPastedText: z((e) => {
1806
+ Ze((t) => t ? `${t}\n${e}` : e);
1807
+ }, [Ze]),
1808
+ maximumAttachmentsAmount: ze,
1809
+ baseAttachmentsAmount: me.length,
1810
+ onAttachmentsLimitExceeded: Be
1811
+ }), { state: ut, analyserNodeRef: dt, errorMessage: ft, startRecording: pt, stopRecording: mt, discardRecording: ht } = Pe({ onAttachAudio: z((e) => {
1812
+ it(rt([e]));
1813
+ }, [it, rt]) }), gt = H(null), Q = H(null), { handlePaste: _t } = xe(it, Ve ? te : Infinity), vt = z((e) => {
1814
+ if (!Ve) {
1821
1815
  let t = e.clipboardData.getData("text/plain");
1822
- t.length >= N && We?.(t.length, N);
1816
+ t.length >= P && Ue?.(t.length, P);
1823
1817
  }
1824
- Q(e);
1818
+ _t(e);
1825
1819
  }, [
1826
- He,
1827
- N,
1828
- We,
1829
- Q
1830
- ]), vt = J.trim().length > 0 || Z.length > 0, yt = vt && !ct && !R, { shouldRender: bt, isExiting: xt, instanceKey: St } = Oe(!l && vt, Ft), Ct = (ye?.some((e) => e.isSelected) ?? !1) && be != null, $ = le || J.includes("\n") || Qe || Ct, wt = ne === void 0 || ae != null, Tt = z(() => pe && !xt && !l, [
1831
- pe,
1832
- xt,
1820
+ Ve,
1821
+ P,
1822
+ Ue,
1823
+ _t
1824
+ ]), 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, $ = se || X.includes("\n") || $e || wt, Tt = ie === void 0 || F != null, Et = V(() => fe && !St && !l, [
1825
+ fe,
1826
+ St,
1833
1827
  l
1834
- ]), Et = async () => {
1835
- if (R) return;
1836
- if (!He && J.length >= N) {
1837
- We?.(J.length, N);
1828
+ ]), Dt = async () => {
1829
+ if (de) return;
1830
+ if (!Ve && X.length >= P) {
1831
+ Ue?.(X.length, P);
1838
1832
  return;
1839
1833
  }
1840
- let e = J, t = Z;
1841
- X(""), K.reset();
1834
+ let e = X, t = Z;
1835
+ Ze(""), J.reset();
1842
1836
  try {
1843
1837
  await n?.(e, t), t.forEach((e) => {
1844
1838
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
1845
- }), it([]);
1839
+ }), at([]);
1846
1840
  } catch {
1847
- X(e), it(t);
1841
+ Ze(e), at(t);
1848
1842
  }
1849
- }, Dt = (e) => {
1850
- if (!e.nativeEvent.isComposing && !I && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1851
- let t = e.currentTarget.selectionStart ?? 0, n = K.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
1843
+ }, Ot = (e) => {
1844
+ if (!e.nativeEvent.isComposing && !R && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1845
+ let t = e.currentTarget.selectionStart ?? 0, n = J.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
1852
1846
  if (n !== null) {
1853
- e.preventDefault(), X(n);
1847
+ e.preventDefault(), Ze(n);
1854
1848
  return;
1855
1849
  }
1856
1850
  }
1857
- e.key === "Enter" && (me === Le.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && yt && wt && !I && Et());
1858
- }, Ot = (e) => {
1851
+ 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());
1852
+ }, kt = (e) => {
1859
1853
  let t = Array.from(e.target.files ?? []);
1860
1854
  if (t.length === 0) return;
1861
- let n = nt(t);
1862
- e.target.value = "", rt(n);
1855
+ let n = rt(t);
1856
+ e.target.value = "", it(n);
1863
1857
  };
1864
- if (lt !== "idle") return /* @__PURE__ */ U($e, {
1865
- state: lt,
1866
- analyserNodeRef: ut,
1867
- errorMessage: dt,
1868
- onStop: pt,
1869
- onDiscard: mt,
1858
+ if (ut !== "idle") return /* @__PURE__ */ G(et, {
1859
+ state: ut,
1860
+ analyserNodeRef: dt,
1861
+ errorMessage: ft,
1862
+ onStop: mt,
1863
+ onDiscard: ht,
1870
1864
  stopLabel: T,
1871
1865
  discardLabel: E,
1872
- style: q,
1866
+ style: Je,
1873
1867
  className: k
1874
1868
  });
1875
- let kt = /* @__PURE__ */ U("textarea", {
1869
+ let At = /* @__PURE__ */ G("textarea", {
1876
1870
  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]"),
1877
- ref: Ze,
1878
- autoFocus: ke,
1879
- value: J,
1871
+ ref: Qe,
1872
+ autoFocus: Oe,
1873
+ value: X,
1880
1874
  onChange: (e) => {
1881
- X(e.target.value), K.notifyChange(), u?.(e.target.value);
1875
+ Ze(e.target.value), J.notifyChange(), u?.(e.target.value);
1882
1876
  },
1883
- onKeyDown: Dt,
1884
- onPaste: _t,
1877
+ onKeyDown: Ot,
1878
+ onPaste: vt,
1885
1879
  placeholder: p,
1886
1880
  "aria-label": m,
1887
- disabled: I,
1881
+ disabled: R,
1888
1882
  rows: 1
1889
1883
  });
1890
- return /* @__PURE__ */ W("div", {
1891
- ref: gt,
1892
- style: q,
1893
- className: o(Y.wrapper, I && 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", k),
1894
- children: [(he.length > 0 || Z.length > 0) && /* @__PURE__ */ U(ve, {
1895
- attachments: [...he, ...Z],
1884
+ return /* @__PURE__ */ K("div", {
1885
+ ref: Q,
1886
+ style: Je,
1887
+ 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", k),
1888
+ children: [(me.length > 0 || Z.length > 0) && /* @__PURE__ */ G(ge, {
1889
+ attachments: [...me, ...Z],
1896
1890
  onRemove: (e) => {
1897
- he.some((t) => t.id === e) ? ge?.(e) : at(e);
1891
+ me.some((t) => t.id === e) ? he?.(e) : ot(e);
1898
1892
  },
1899
- onRetry: ot,
1900
- onExpand: st,
1893
+ onRetry: st,
1894
+ onExpand: ct,
1901
1895
  labels: {
1902
1896
  removeLabel: b,
1903
1897
  retryLabel: x
1904
1898
  },
1905
- onAttachmentClick: Re == null ? void 0 : (e) => {
1906
- let t = [...he, ...Z].find((t) => t.id === e);
1907
- t != null && Re(t);
1899
+ onAttachmentClick: Le == null ? void 0 : (e) => {
1900
+ let t = [...me, ...Z].find((t) => t.id === e);
1901
+ t != null && Le(t);
1908
1902
  }
1909
- }), P ? $ && kt : /* @__PURE__ */ W("div", {
1903
+ }), ue ? $ && At : /* @__PURE__ */ K("div", {
1910
1904
  className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
1911
1905
  children: [
1912
- !ue && /* @__PURE__ */ W("div", {
1906
+ !ce && /* @__PURE__ */ K("div", {
1913
1907
  className: o("flex", "order-2", !$ && "desktop:order-1"),
1914
- children: [/* @__PURE__ */ U("input", {
1915
- ref: ht,
1908
+ children: [/* @__PURE__ */ G("input", {
1909
+ ref: gt,
1916
1910
  type: "file",
1917
1911
  multiple: !0,
1918
1912
  accept: g,
1919
1913
  className: "sr-only",
1920
1914
  "aria-hidden": !0,
1921
1915
  tabIndex: -1,
1922
- onChange: Ot
1923
- }), /* @__PURE__ */ U(Je, {
1924
- onAttachClick: de ? void 0 : () => ht.current?.click(),
1916
+ onChange: kt
1917
+ }), /* @__PURE__ */ G(qe, {
1918
+ onAttachClick: le ? void 0 : () => gt.current?.click(),
1925
1919
  attachLabel: h,
1926
1920
  addMenuTitle: _,
1927
1921
  menuTitle: v,
1928
1922
  menuCloseLabel: y,
1929
- style: q,
1930
- isDisabled: I,
1923
+ style: Je,
1924
+ isDisabled: R,
1931
1925
  chatSettings: _e,
1932
1926
  extraMenuItems: Ye,
1933
- toolsMenuItems: ye,
1934
- onToolToggle: be,
1935
- toolsMenuTitle: xe,
1927
+ toolsMenuItems: ve,
1928
+ onToolToggle: ye,
1929
+ toolsMenuTitle: be,
1936
1930
  toolsBackLabel: Se,
1937
- promptsMenuOverlay: Te,
1938
- promptsMenuTitle: G,
1939
- promptsBackLabel: Ee
1931
+ promptsMenuOverlay: q,
1932
+ promptsMenuTitle: we,
1933
+ promptsBackLabel: De
1940
1934
  })]
1941
1935
  }),
1942
- $ && Ct && /* @__PURE__ */ U("div", {
1936
+ $ && wt && /* @__PURE__ */ G("div", {
1943
1937
  className: "order-3 min-w-0 flex-1",
1944
- children: /* @__PURE__ */ U(Xe, {
1945
- items: ye ?? [],
1946
- onToolToggle: be,
1947
- isMobile: Ge,
1948
- countLabel: we?.countLabel,
1949
- removeLabel: we?.removeLabel
1938
+ children: /* @__PURE__ */ G(Xe, {
1939
+ items: ve ?? [],
1940
+ onToolToggle: ye,
1941
+ isMobile: We,
1942
+ countLabel: Ce?.countLabel,
1943
+ removeLabel: Ce?.removeLabel
1950
1944
  })
1951
1945
  }),
1952
- /* @__PURE__ */ U("div", {
1946
+ /* @__PURE__ */ G("div", {
1953
1947
  className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
1954
- children: kt
1948
+ children: At
1955
1949
  }),
1956
- /* @__PURE__ */ W("div", {
1957
- className: o("flex flex-shrink-0 items-center gap-2", $ && Ct ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
1958
- children: [F ? F({
1959
- canSend: yt,
1960
- onSend: Et
1961
- }) : /* @__PURE__ */ W(H, { children: [
1962
- Ue,
1963
- /* @__PURE__ */ U(Pt, {
1964
- deployments: ne,
1965
- selectedDeploymentId: ae,
1966
- onDeploymentChange: oe,
1967
- modelSelectorLabels: se,
1950
+ /* @__PURE__ */ K("div", {
1951
+ className: o("flex flex-shrink-0 items-center gap-2", $ && wt ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
1952
+ children: [L ? L({
1953
+ canSend: bt,
1954
+ onSend: Dt
1955
+ }) : /* @__PURE__ */ K(W, { children: [
1956
+ He,
1957
+ /* @__PURE__ */ G(Pt, {
1958
+ deployments: ie,
1959
+ selectedDeploymentId: F,
1960
+ onDeploymentChange: I,
1961
+ modelSelectorLabels: ae,
1968
1962
  isStreaming: l,
1969
- isMobile: Ge,
1970
- isDisabled: fe,
1971
- style: q,
1972
- modelPickerOverlay: ze,
1973
- isPickerOpen: Ke,
1974
- onPickerToggle: () => qe((e) => !e),
1975
- onPickerOpenChange: qe
1963
+ isMobile: We,
1964
+ isDisabled: B,
1965
+ style: Je,
1966
+ modelPickerOverlay: Re,
1967
+ isPickerOpen: Ge,
1968
+ onPickerToggle: () => Ke((e) => !e),
1969
+ onPickerOpenChange: Ke
1976
1970
  }),
1977
- l && i ? /* @__PURE__ */ U(tt, {
1971
+ l && i ? /* @__PURE__ */ G(nt, {
1978
1972
  onStop: i,
1979
1973
  ariaLabel: C
1980
- }) : !l && bt && /* @__PURE__ */ U(et, {
1981
- onSend: Et,
1982
- isDisabled: !wt || ct || R,
1974
+ }) : !l && xt && /* @__PURE__ */ G(tt, {
1975
+ onSend: Dt,
1976
+ isDisabled: !Tt || lt || de,
1983
1977
  ariaLabel: S,
1984
- isExiting: xt
1985
- }, St)
1986
- ] }), Tt && /* @__PURE__ */ U(j, {
1987
- icon: /* @__PURE__ */ U(ie, {
1978
+ isExiting: St
1979
+ }, Ct)
1980
+ ] }), Et && /* @__PURE__ */ G(j, {
1981
+ icon: /* @__PURE__ */ G(re, {
1988
1982
  size: d.LG,
1989
1983
  "aria-hidden": !0
1990
1984
  }),
1991
1985
  "aria-label": w,
1992
1986
  className: "size-8 flex-shrink-0",
1993
- onClick: ft,
1994
- disabled: I || l
1987
+ onClick: pt,
1988
+ disabled: R || l
1995
1989
  })]
1996
1990
  })
1997
1991
  ]
@@ -1999,15 +1993,15 @@ var kt = {
1999
1993
  });
2000
1994
  }, 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 }) => {
2001
1995
  let { colors: u, typography: d } = r ?? {};
2002
- return /* @__PURE__ */ W("div", {
1996
+ return /* @__PURE__ */ K("div", {
2003
1997
  style: a({ "--ci-welcome-color": u?.welcomeText }),
2004
1998
  className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
2005
- children: [n && /* @__PURE__ */ U("h1", {
1999
+ children: [n && /* @__PURE__ */ G("h1", {
2006
2000
  className: o(Lt.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
2007
2001
  children: n
2008
- }), /* @__PURE__ */ U("div", {
2002
+ }), /* @__PURE__ */ G("div", {
2009
2003
  className: "relative w-full max-w-[748px]",
2010
- children: /* @__PURE__ */ U(It, {
2004
+ children: /* @__PURE__ */ G(It, {
2011
2005
  placeholder: t,
2012
2006
  isStreaming: e,
2013
2007
  isInputDisabled: c,
@@ -2018,53 +2012,53 @@ var kt = {
2018
2012
  })
2019
2013
  })]
2020
2014
  });
2021
- }, 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: v, onDropFilesConsumed: y, validateAttachment: b, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: w, maximumAttachmentsAmount: T, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: ee, pasteTextThreshold: M, onMessageTooLong: te }) => {
2022
- let N = B(null), [ne, ie] = V([]);
2023
- R(() => {
2015
+ }, 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: v, onDropFilesConsumed: y, validateAttachment: b, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: w, maximumAttachmentsAmount: T, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: ee, pasteTextThreshold: M, maxMessageLength: N = 5e4, onMessageTooLong: te }) => {
2016
+ let P = H(null), [re, ie] = U([]);
2017
+ B(() => {
2024
2018
  v?.length && (ie(v), y?.());
2025
2019
  }, [v, y]);
2026
- let [ae, oe] = V(e ?? ""), [se, ce] = V([]), [le, ue] = V(t), de = se.some((e) => e.status === r.Loading || e.status === r.Error), P = (ae.trim().length > 0 || se.length > 0 || le.length > 0) && !de, F = (e) => {
2027
- ue((t) => t.filter((t) => t.id !== e));
2028
- }, I = L((e, t) => {
2029
- i(e, le, t);
2030
- }, [le, i]), fe = () => {
2031
- if (P) {
2032
- if (!x && ae.length >= (M ?? 4e3)) {
2033
- te?.(ae.length, M ?? 4e3);
2020
+ let [F, I] = U(e ?? ""), [ae, oe] = U([]), [se, ce] = U(t), le = ae.some((e) => e.status === r.Loading || e.status === r.Error), ue = (F.trim().length > 0 || ae.length > 0 || se.length > 0) && !le, L = (e) => {
2021
+ ce((t) => t.filter((t) => t.id !== e));
2022
+ }, R = z((e, t) => {
2023
+ i(e, se, t);
2024
+ }, [se, i]), de = () => {
2025
+ if (ue) {
2026
+ if (!x && F.length >= N) {
2027
+ te?.(F.length, N);
2034
2028
  return;
2035
2029
  }
2036
- I(ae, se);
2030
+ R(F, ae);
2037
2031
  }
2038
- }, pe = L(() => ie([]), []), me = L((e) => {
2032
+ }, fe = z(() => ie([]), []), pe = z((e) => {
2039
2033
  let t = Array.from(e.target.files ?? []);
2040
2034
  t.length !== 0 && (e.target.value = "", ie(t));
2041
- }, []), he = z(() => O ? [{
2035
+ }, []), me = V(() => O ? [{
2042
2036
  key: "dial-fs",
2043
2037
  label: k ?? "DIAL file system",
2044
- icon: /* @__PURE__ */ U(re, {
2038
+ icon: /* @__PURE__ */ G(ne, {
2045
2039
  size: c,
2046
2040
  "aria-hidden": !0
2047
2041
  }),
2048
2042
  onClick: O
2049
2043
  }] : [], [O, k]);
2050
- return /* @__PURE__ */ W("div", {
2044
+ return /* @__PURE__ */ K("div", {
2051
2045
  className: o("flex w-full flex-col gap-2", _),
2052
- children: [/* @__PURE__ */ U(It, {
2046
+ children: [/* @__PURE__ */ G(It, {
2053
2047
  message: e,
2054
2048
  ariaLabel: u,
2055
2049
  isStacked: !0,
2056
2050
  hideActionBar: !0,
2057
- pendingDropFiles: ne,
2058
- onDropFilesConsumed: pe,
2059
- onSend: I,
2051
+ pendingDropFiles: re,
2052
+ onDropFilesConsumed: fe,
2053
+ onSend: R,
2060
2054
  onUploadAttachment: a,
2061
- onChange: oe,
2062
- onAttachmentsChange: ce,
2055
+ onChange: I,
2056
+ onAttachmentsChange: oe,
2063
2057
  removeLabel: d,
2064
2058
  retryLabel: f,
2065
2059
  className: "max-w-full",
2066
- prefixAttachments: le,
2067
- onRemovePrefixAttachment: F,
2060
+ prefixAttachments: se,
2061
+ onRemovePrefixAttachment: L,
2068
2062
  validateAttachment: b,
2069
2063
  isAttachmentsEnabled: x,
2070
2064
  maximumAttachmentsAmount: T,
@@ -2073,41 +2067,42 @@ var kt = {
2073
2067
  onPendingAttachmentsConsumed: j,
2074
2068
  onAttachmentClick: ee,
2075
2069
  pasteTextThreshold: M,
2070
+ maxMessageLength: N,
2076
2071
  onMessageTooLong: te
2077
- }), /* @__PURE__ */ W("div", {
2072
+ }), /* @__PURE__ */ K("div", {
2078
2073
  className: "flex items-center justify-between",
2079
- children: [/* @__PURE__ */ U("div", {
2074
+ children: [/* @__PURE__ */ G("div", {
2080
2075
  className: "flex",
2081
- children: !S && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
2082
- ref: N,
2076
+ children: !S && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("input", {
2077
+ ref: P,
2083
2078
  type: "file",
2084
2079
  multiple: !0,
2085
2080
  accept: w,
2086
2081
  className: "sr-only",
2087
2082
  "aria-hidden": !0,
2088
2083
  tabIndex: -1,
2089
- onChange: me
2090
- }), /* @__PURE__ */ U(Je, {
2091
- onAttachClick: () => N.current?.click(),
2084
+ onChange: pe
2085
+ }), /* @__PURE__ */ G(qe, {
2086
+ onAttachClick: () => P.current?.click(),
2092
2087
  attachLabel: m,
2093
2088
  addMenuTitle: p,
2094
2089
  menuTitle: h,
2095
2090
  menuCloseLabel: g,
2096
- extraMenuItems: he
2091
+ extraMenuItems: me
2097
2092
  })] })
2098
- }), /* @__PURE__ */ W("div", {
2093
+ }), /* @__PURE__ */ K("div", {
2099
2094
  className: "flex gap-2",
2100
- children: [/* @__PURE__ */ U(C, {
2095
+ children: [/* @__PURE__ */ G(C, {
2101
2096
  label: s,
2102
2097
  onClick: n
2103
- }), /* @__PURE__ */ U(E, {
2098
+ }), /* @__PURE__ */ G(E, {
2104
2099
  label: l,
2105
- onClick: fe,
2106
- disabled: !P
2100
+ onClick: de,
2101
+ disabled: !ue
2107
2102
  })]
2108
2103
  })]
2109
2104
  })]
2110
2105
  });
2111
2106
  };
2112
2107
  //#endregion
2113
- export { he as AttachmentCard, ge as AttachmentGroup, _e as AttachmentTray, G as BottomSheetShell, Ge as ChatSettingsModal, Rt as ConversationInput, zt as EditMessageInput, ye as FileDndOverlay, It as Input, Le as SendOnEnter, Se as getAttachmentIcon };
2108
+ 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 };