@epam/ai-dial-conversation-messages 1.1.0-dev.12 → 1.1.0-dev.121

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,268 +1,234 @@
1
- import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, Highlight as r, MDMessageViewer as i, MIME_TYPE_EXT_MAP as a, MessageRating as o, MessageRole as s, RequestStatus as c, ResponseFormat as l, buildCssVars as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
2
- import { DIAL_ICON_SIZE as p, DialGhostIconButton as m, DialInput as h, DialLinkButton as g, DialNotification as _, DialPopup as v, DialPrimaryButton as y, DialRadioGroup as b, DialRoundedButton as x, DialSkeleton as S, DialSkeletonVariant as C, DialSlider as w, DialTag as T, DialTooltip as E, ElementSize as D, PopupSize as O, RadioGroupOrientation as k } from "@epam/ai-dial-ui-kit";
3
- import { IconCheck as A, IconChevronDown as j, IconChevronUp as M, IconClipboard as N, IconCopy as P, IconDownload as F, IconExternalLink as I, IconFile as L, IconFileTypeBmp as R, IconFileTypeCss as z, IconFileTypeCsv as B, IconFileTypeDoc as ee, IconFileTypeDocx as V, IconFileTypeHtml as te, IconFileTypeJpg as ne, IconFileTypeJs as re, IconFileTypeJsx as ie, IconFileTypePdf as ae, IconFileTypePhp as oe, IconFileTypePng as se, IconFileTypePpt as ce, IconFileTypeRs as le, IconFileTypeSql as ue, IconFileTypeSvg as de, IconFileTypeTs as fe, IconFileTypeTsx as pe, IconFileTypeTxt as me, IconFileTypeVue as he, IconFileTypeXls as ge, IconFileTypeXml as _e, IconFileTypeZip as ve, IconMarkdown as ye, IconMusic as be, IconPaperclip as xe, IconPencilMinus as Se, IconPhoto as H, IconRefresh as Ce, IconReload as we, IconTerminal2 as Te, IconThumbDown as Ee, IconThumbUp as De, IconTrashX as Oe, IconVideo as ke, IconX as Ae } from "@tabler/icons-react";
1
+ import { AttachmentErrorReason as e, AttachmentType as t, CopyIconButton as n, DeploymentIcon as r, MDMessageViewer as i, MIME_TYPE_EXT_MAP as a, MessageRating as o, MessageRole as s, RequestStatus as c, ResponseFormat as l, buildCssVars as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
2
+ import { DIAL_ICON_SIZE as p, DialInput as m, DialPopup as h, DialRadioGroup as g, DialSkeleton as _, DialSkeletonVariant as v, DialSlider as y, DialSpinner as b, DialTooltip as x, ElementSize as S, GhostIconButton as C, Highlight as w, InfoMessageNotification as T, LinkButton as E, NeutralButton as D, PopupSize as O, PrimaryButton as k, RadioGroupOrientation as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
3
+ import { IconChevronDown as M, IconChevronUp as N, IconClipboard as P, IconDownload as F, IconExternalLink as I, IconFile as L, IconFileTypeBmp as R, IconFileTypeCss as z, IconFileTypeCsv as B, IconFileTypeDoc as V, IconFileTypeDocx as H, IconFileTypeHtml as U, IconFileTypeJpg as W, IconFileTypeJs as ee, IconFileTypeJsx as te, IconFileTypePdf as ne, IconFileTypePhp as re, IconFileTypePng as ie, IconFileTypePpt as ae, IconFileTypeRs as oe, IconFileTypeSql as se, IconFileTypeSvg as ce, IconFileTypeTs as le, IconFileTypeTsx as ue, IconFileTypeTxt as de, IconFileTypeVue as fe, IconFileTypeXls as pe, IconFileTypeXml as me, IconFileTypeZip as he, IconMarkdown as ge, IconMusic as _e, IconPaperclip as ve, IconPencilMinus as ye, IconPhoto as G, IconRefresh as be, IconReload as xe, IconTerminal2 as Se, IconThumbDown as Ce, IconThumbUp as we, IconTrashX as Te, IconVideo as Ee, IconX as De } from "@tabler/icons-react";
4
4
  import "react-dom";
5
- import { memo as je, useCallback as U, useEffect as Me, useId as Ne, useMemo as W, useRef as Pe, useState as G } from "react";
6
- import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
5
+ import { memo as Oe, useCallback as K, useEffect as ke, useId as Ae, useMemo as je, useRef as Me, useState as q } from "react";
6
+ import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
7
7
  //#region ../attachment-input/dist/index.js
8
- var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /* @__PURE__ */ function(e) {
9
- return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
10
- }({}), Ie = (e) => {
8
+ var Ne = (e) => {
9
+ if (e == null) return "";
11
10
  let t = e.lastIndexOf(".");
12
11
  return t > 0 ? e.slice(0, t) : e;
13
- }, Le = (e) => {
12
+ }, Pe = (e) => {
14
13
  if (!e) return L;
15
14
  if (e.startsWith("image/")) switch (e) {
16
15
  case "image/jpeg":
17
- case "image/jpg": return ne;
18
- case "image/png": return se;
19
- case "image/svg+xml": return de;
16
+ case "image/jpg": return W;
17
+ case "image/png": return ie;
18
+ case "image/svg+xml": return ce;
20
19
  case "image/bmp": return R;
21
- default: return H;
20
+ default: return G;
22
21
  }
23
- if (e.startsWith("video/")) return ke;
24
- if (e.startsWith("audio/")) return be;
22
+ if (e.startsWith("video/")) return Ee;
23
+ if (e.startsWith("audio/")) return _e;
25
24
  switch (e) {
26
- case "application/pdf": return ae;
25
+ case "application/pdf": return ne;
27
26
  case "application/msword":
28
- case "application/vnd.ms-word": return ee;
29
- case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return V;
30
- case "application/vnd.ms-powerpoint": return ce;
31
- case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return ce;
32
- case "application/vnd.ms-excel": return ge;
33
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return ge;
27
+ case "application/vnd.ms-word": return V;
28
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return H;
29
+ case "application/vnd.ms-powerpoint": return ae;
30
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return ae;
31
+ case "application/vnd.ms-excel": return pe;
32
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return pe;
34
33
  case "application/zip":
35
34
  case "application/x-zip-compressed":
36
35
  case "application/x-rar-compressed":
37
36
  case "application/x-7z-compressed":
38
37
  case "application/gzip":
39
- case "application/x-tar": return ve;
38
+ case "application/x-tar": return he;
40
39
  case "text/csv": return B;
41
- case "text/plain": return me;
40
+ case "text/plain": return de;
42
41
  case "text/html":
43
- case "application/xhtml+xml": return te;
42
+ case "application/xhtml+xml": return U;
44
43
  case "text/xml":
45
- case "application/xml": return _e;
44
+ case "application/xml": return me;
46
45
  case "application/sql":
47
- case "text/x-sql": return ue;
46
+ case "text/x-sql": return se;
48
47
  case "text/javascript":
49
- case "application/javascript": return re;
50
- case "text/jsx": return ie;
48
+ case "application/javascript": return ee;
49
+ case "text/jsx": return te;
51
50
  case "application/typescript":
52
- case "text/typescript": return fe;
53
- case "text/tsx": return pe;
51
+ case "text/typescript": return le;
52
+ case "text/tsx": return ue;
54
53
  case "text/css": return z;
55
54
  case "text/x-php":
56
- case "application/x-php": return oe;
55
+ case "application/x-php": return re;
57
56
  case "text/x-rustsrc":
58
- case "application/x-rust": return le;
59
- case "text/x-vue": return he;
57
+ case "application/x-rust": return oe;
58
+ case "text/x-vue": return fe;
60
59
  default: return L;
61
60
  }
62
- }, Re = (e) => {
61
+ }, Fe = (e) => {
63
62
  let { type: n, contentType: r } = e;
64
- return n === t.Prompt ? Te : n === t.Pasted ? N : n === t.Image ? H : Le(r ?? "");
65
- }, ze = (e) => {
63
+ return n === t.Prompt ? Se : n === t.Pasted ? P : n === t.Image ? G : Pe(r ?? "");
64
+ }, Ie = (e) => {
66
65
  let t = e.toLowerCase().split(";")[0].trim(), n = a[t];
67
66
  if (n) return n;
68
67
  let r = t.split("/")[1];
69
68
  if (r && !r.startsWith("vnd.") && !r.includes("+")) return r;
70
- }, Be = (e, n) => {
69
+ }, Le = (e, n) => {
71
70
  let { type: r, name: i, contentType: a } = e;
72
71
  if (r === t.Prompt) return n.promptLabel ?? "Prompt";
73
72
  if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
74
73
  if (r === t.Image) return n.imageLabel ?? "Image";
75
74
  if (a) {
76
- let e = ze(a);
75
+ let e = Ie(a);
77
76
  if (e) return `.${e}`;
78
77
  }
79
78
  let o = i.lastIndexOf(".");
80
79
  return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
81
- }, Ve = (e, n = {}) => {
82
- let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.Audio && !l, f = r === t.Link && !l;
80
+ }, Re = (e, n = {}) => {
81
+ let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.Link && !l;
83
82
  return {
84
83
  isLoading: s,
85
84
  isError: l,
86
85
  isImage: u,
87
- isAudio: d,
88
- isLink: f,
89
- BottomIcon: f ? null : Re(e),
90
- typeLabel: f ? null : Be(e, n)
86
+ isLink: d,
87
+ BottomIcon: d ? null : Fe(e),
88
+ typeLabel: d ? null : Le(e, n)
91
89
  };
92
- }, He = (e, t) => e <= 0 ? {
93
- layout: Y.None,
94
- visibleCount: 0,
95
- hiddenCount: 0
96
- } : e < 5 || t ? {
97
- layout: Y.AllVisible,
98
- visibleCount: e,
99
- hiddenCount: 0
100
- } : {
101
- layout: Y.Collapsed,
102
- visibleCount: 4,
103
- hiddenCount: e - 4
104
- }, X = {
105
- tile: "_tile_3x6ks_1",
106
- tileLight: "_tileLight_3x6ks_12",
107
- tileError: "_tileError_3x6ks_16",
108
- nameText: "_nameText_3x6ks_23",
109
- typeText: "_typeText_3x6ks_24",
110
- retryIcon: "_retryIcon_3x6ks_36",
111
- hoverIcon: "_hoverIcon_3x6ks_40",
112
- track: "_track_3x6ks_48",
113
- indeterminateFill: "_indeterminateFill_3x6ks_52",
114
- "attachment-tile-indeterminate": "_attachment-tile-indeterminate_3x6ks_1"
115
- }, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ q(m, {
90
+ }, ze = "flex size-[84px] items-center justify-center rounded-xl border", Z = {
91
+ tile: "_tile_3jao2_1",
92
+ hovered: "_hovered_3jao2_5",
93
+ selected: "_selected_3jao2_15",
94
+ tileError: "_tileError_3jao2_20",
95
+ nameText: "_nameText_3jao2_25",
96
+ typeText: "_typeText_3jao2_29",
97
+ retryIcon: "_retryIcon_3jao2_33",
98
+ track: "_track_3jao2_37",
99
+ actionButton: "_actionButton_3jao2_43",
100
+ imageActionButton: "_imageActionButton_3jao2_47"
101
+ }, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(j, {
116
102
  icon: a,
117
- size: D.Small,
118
- className: d("absolute end-1 top-1 h-6 w-6 rounded-lg", o ?? X.hoverIcon),
103
+ size: S.Small,
104
+ className: d("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Z.actionButton, o),
119
105
  "aria-label": e,
120
106
  "aria-describedby": t ? n : void 0,
121
107
  onClick: (e) => {
122
108
  e.stopPropagation(), r(i);
123
109
  }
124
- }), Ue = ({ ...e }) => /* @__PURE__ */ q(Z, {
125
- icon: /* @__PURE__ */ q(we, {
110
+ }), Be = ({ ...e }) => /* @__PURE__ */ Y(Q, {
111
+ icon: /* @__PURE__ */ Y(xe, {
126
112
  size: p.SM,
127
113
  "aria-hidden": !0
128
114
  }),
129
- className: X.retryIcon,
115
+ className: Z.retryIcon,
130
116
  ...e
131
- }), We = ({ ...e }) => /* @__PURE__ */ q(Z, {
132
- icon: /* @__PURE__ */ q(F, {
117
+ }), Ve = ({ ...e }) => /* @__PURE__ */ Y(Q, {
118
+ icon: /* @__PURE__ */ Y(F, {
133
119
  size: p.SM,
134
120
  "aria-hidden": !0
135
121
  }),
136
122
  ...e
137
- }), Ge = ({ ...e }) => /* @__PURE__ */ q(Z, {
138
- icon: /* @__PURE__ */ q(I, {
123
+ }), He = ({ ...e }) => /* @__PURE__ */ Y(Q, {
124
+ icon: /* @__PURE__ */ Y(I, {
139
125
  size: p.SM,
140
126
  "aria-hidden": !0
141
127
  }),
142
128
  ...e
143
- }), Ke = ({ ...e }) => /* @__PURE__ */ q(Z, {
144
- icon: /* @__PURE__ */ q(Ae, {
129
+ }), Ue = ({ ...e }) => /* @__PURE__ */ Y(Q, {
130
+ icon: /* @__PURE__ */ Y(De, {
145
131
  size: p.SM,
146
132
  "aria-hidden": !0
147
133
  }),
148
- className: X.hoverIcon,
149
134
  ...e
150
- }), qe = ({ attachment: e, searchQuery: t = "", onClick: n, labels: i, styles: a, cssVars: o }) => {
151
- let { clickLabel: s = "Open attachment" } = i ?? {}, { typography: c, className: l } = a ?? {};
152
- return /* @__PURE__ */ J("div", {
153
- style: o,
154
- className: d("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", l),
155
- children: [/* @__PURE__ */ J("div", {
156
- className: "flex items-center justify-between gap-2",
157
- children: [/* @__PURE__ */ q("span", {
158
- title: e.name,
159
- className: d(c?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
160
- children: t ? /* @__PURE__ */ q(r, {
161
- text: e.name,
162
- query: t,
163
- maxLines: 1
164
- }) : e.name
165
- }), n && /* @__PURE__ */ q(We, {
166
- ariaLabel: s,
167
- onClick: n,
168
- id: e.id
169
- })]
170
- }), e.playUrl && /* @__PURE__ */ q("audio", {
171
- controls: !0,
172
- src: e.playUrl,
173
- "aria-label": e.name,
174
- className: "w-full",
175
- preload: "metadata"
176
- })]
177
- });
178
- }, Je = {
135
+ }), We = {
179
136
  [e.Network]: "Upload failed · network error",
180
137
  [e.UnsupportedType]: "Upload failed · unsupported file type"
181
- }, Ye = ({ attachment: t, onClick: n, onRetry: r, labels: i, styles: a, onDownload: o, isPasted: s, isLink: l, cssVars: u, onExpand: f, isExpandable: p, onRemove: m }) => {
182
- let { clickLabel: h = "Download attachment", retryLabel: g = "Retry upload", sizeLabel: _, uploadingLabel: v = "Uploading", errorReasonLabels: y, genericErrorLabel: b = "Upload failed" } = i ?? {}, { typography: { nameClassName: x = "dial-caption-text", metaClassName: S = "dial-caption-text" } = {}, className: C } = a ?? {}, { id: w, name: T, status: E, errorReason: D } = t, O = E === c.Loading, k = E === c.Error, A = Ne(), j = k ? D && (y?.[D] ?? Je[D]) || b : "", { BottomIcon: M, typeLabel: N } = Ve(t), P = !k && !O && o && !l, F = k && !!r && D !== e.UnsupportedType, I = P || F ? "pe-5" : void 0, L = (e) => {
183
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.(t.id));
184
- }, R = W(() => s ? T : Ie(T), [s, T]), z = U(() => {
138
+ }, Ge = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: a, styles: o, onDownload: s, isPasted: l, isLink: u, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: g }) => {
139
+ let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: y, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: T, className: E } = o ?? {}, { id: D, name: O, status: k, errorReason: A } = t, j = k === c.Loading, M = k === c.Error, N = Ae(), P = M ? A && (S?.[A] ?? We[A]) || C : "", { BottomIcon: F, typeLabel: I } = Re(t), L = !M && !j && s && !u, R = M && !!i && A !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
140
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
141
+ }, V = je(() => l ? O : Ne(O), [l, O]), H = K(() => {
185
142
  window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
186
- }, [t]), B = d(Fe, "group relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !k && X.tileLight, k && X.tileError), ee = /* @__PURE__ */ q("div", {
187
- title: R,
188
- className: d(x, "line-clamp-2 min-w-0 break-all", X.nameText, !k && I),
189
- children: R
190
- }), V = M && /* @__PURE__ */ J("div", {
191
- className: d("flex w-full items-center gap-1", k && I),
192
- children: [/* @__PURE__ */ q(M, {
143
+ }, [t]), U = d(ze, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, !M && Z.hovered, g && Z.selected, M && Z.tileError), W = /* @__PURE__ */ Y("div", {
144
+ title: V,
145
+ className: d(T?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Z.nameText, !M && z),
146
+ children: n ? /* @__PURE__ */ Y(w, {
147
+ text: V,
148
+ query: n,
149
+ maxLines: 2
150
+ }) : V
151
+ }), ee = F && /* @__PURE__ */ X("div", {
152
+ className: d("flex w-full items-center gap-1", M && z),
153
+ children: [/* @__PURE__ */ Y(F, {
193
154
  size: 16,
194
- className: X.typeText,
155
+ className: Z.typeText,
195
156
  "aria-hidden": !0
196
- }), /* @__PURE__ */ q("span", {
197
- className: d(S, "min-w-0 flex-1 truncate", X.typeText),
198
- children: _ ? `${N} · ${_}` : N
157
+ }), /* @__PURE__ */ Y("span", {
158
+ className: d(T?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
159
+ children: y ? `${I} · ${y}` : I
199
160
  })]
200
161
  }), te = () => {
201
- p && f ? f(w) : n && n(w);
202
- }, ne = /* @__PURE__ */ J(K, { children: [
203
- k ? /* @__PURE__ */ J(K, { children: [V, ee] }) : /* @__PURE__ */ J(K, { children: [ee, V] }),
204
- O && /* @__PURE__ */ q("div", {
205
- role: "progressbar",
206
- "aria-label": v,
207
- className: d("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", X.track),
208
- children: /* @__PURE__ */ q("div", { className: d("h-full w-1/3 rounded-full", X.indeterminateFill) })
209
- }),
210
- P && /* @__PURE__ */ q(We, {
211
- ariaLabel: h,
212
- errorTitle: j,
213
- errorDescId: A,
214
- onClick: o,
215
- id: w
162
+ m && p ? p(D) : r && r(D);
163
+ }, ne = /* @__PURE__ */ X(J, { children: [
164
+ W,
165
+ ee,
166
+ j && /* @__PURE__ */ Y("div", {
167
+ "aria-label": x,
168
+ className: d("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
169
+ children: /* @__PURE__ */ Y(b, { size: 32 })
216
170
  }),
217
- F && /* @__PURE__ */ q(Ue, {
218
- ariaLabel: g,
219
- errorTitle: j,
220
- errorDescId: A,
221
- onClick: r,
222
- id: w
223
- }),
224
- l && /* @__PURE__ */ q(Ge, {
225
- ariaLabel: g,
226
- errorTitle: j,
227
- errorDescId: A,
228
- onClick: z
229
- }),
230
- m && /* @__PURE__ */ q(Ke, {
231
- ariaLabel: g,
232
- errorTitle: j,
233
- errorDescId: A,
234
- onClick: m,
235
- id: w
171
+ /* @__PURE__ */ X("div", {
172
+ className: d("absolute right-0 top-0 flex gap-1"),
173
+ children: [
174
+ L && /* @__PURE__ */ Y(Ve, {
175
+ ariaLabel: _,
176
+ errorTitle: P,
177
+ errorDescId: N,
178
+ onClick: s,
179
+ id: D
180
+ }),
181
+ R && /* @__PURE__ */ Y(Be, {
182
+ ariaLabel: v,
183
+ errorTitle: P,
184
+ errorDescId: N,
185
+ onClick: i,
186
+ id: D
187
+ }),
188
+ u && /* @__PURE__ */ Y(He, {
189
+ ariaLabel: v,
190
+ errorTitle: P,
191
+ errorDescId: N,
192
+ onClick: H
193
+ }),
194
+ h && /* @__PURE__ */ Y(Ue, {
195
+ ariaLabel: v,
196
+ errorTitle: P,
197
+ errorDescId: N,
198
+ onClick: h,
199
+ id: D
200
+ })
201
+ ]
236
202
  }),
237
- k && /* @__PURE__ */ q("span", {
238
- id: A,
203
+ M && /* @__PURE__ */ Y("span", {
204
+ id: N,
239
205
  role: "status",
240
206
  "aria-live": "polite",
241
207
  className: "sr-only",
242
- children: j
208
+ children: P
243
209
  })
244
210
  ] });
245
- return /* @__PURE__ */ q("div", {
246
- style: u,
247
- className: d("inline-flex", C),
248
- children: /* @__PURE__ */ q("div", {
211
+ return /* @__PURE__ */ Y("div", {
212
+ style: f,
213
+ className: d("inline-flex", E),
214
+ children: /* @__PURE__ */ Y("div", {
249
215
  role: "button",
250
216
  tabIndex: 0,
251
- "aria-label": h,
217
+ "aria-label": _,
252
218
  onClick: te,
253
- onKeyDown: L,
254
- style: u,
255
- className: d(B, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
219
+ onKeyDown: B,
220
+ style: f,
221
+ className: d(U, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
256
222
  children: ne
257
223
  })
258
224
  });
259
- }, Xe = /* @__PURE__ */ function(e) {
225
+ }, Ke = /* @__PURE__ */ function(e) {
260
226
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
261
- }({}), Ze = ({ enabled: e, src: t }) => {
262
- let n = Pe(null), [r, i] = G("idle");
263
- return Me(() => {
227
+ }({}), qe = ({ enabled: e, src: t }) => {
228
+ let n = Me(null), [r, i] = q("idle");
229
+ return ke(() => {
264
230
  i(e && t ? "loading" : "idle");
265
- }, [e, t]), Me(() => {
231
+ }, [e, t]), ke(() => {
266
232
  let r = n.current;
267
233
  if (!r || !e || !t) return;
268
234
  let a = () => i("loaded"), o = () => i("error");
@@ -273,15 +239,15 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
273
239
  imageRef: n,
274
240
  imageLoadStatus: r
275
241
  };
276
- }, Qe = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c }) => {
277
- let { clickLabel: l = "Open attachment", expandLabel: u = "Expand pasted text" } = i ?? {}, { typography: f, className: m } = c ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = W(() => Ve(e), [e]), w = r !== void 0 && !v && !y && !b, { imageRef: T, imageLoadStatus: E } = Ze({
278
- enabled: x,
279
- src: _
242
+ }, Je = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: l }) => {
243
+ let { clickLabel: u = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { className: m } = c ?? {}, { id: h, name: g } = e, y = e.previewUrl ?? e.url, b = e.type === t.Pasted && n !== void 0, { isLoading: x, isError: S, isImage: C } = je(() => Re(e), [e]), w = r !== void 0 && !b && !x && !S, { imageRef: T, imageLoadStatus: E } = qe({
244
+ enabled: C,
245
+ src: y
280
246
  }), D = () => {
281
- v && n ? n(h) : w && r && r(h);
247
+ b && n ? n(h) : w && r && r(h);
282
248
  };
283
- return /* @__PURE__ */ q("div", {
284
- className: d(Fe, w && "cursor-pointer", X.tile, m),
249
+ return /* @__PURE__ */ Y("div", {
250
+ className: d(ze, "group/attachment-tile", w && "cursor-pointer", Z.tile, l && Z.selected, m),
285
251
  onClick: D,
286
252
  onKeyDown: (e) => {
287
253
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
@@ -289,222 +255,153 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
289
255
  tabIndex: 0,
290
256
  role: "button",
291
257
  style: o,
292
- "aria-label": w ? l : v ? u : void 0,
293
- children: /* @__PURE__ */ J("div", {
258
+ "aria-label": w ? u : b ? f : void 0,
259
+ children: /* @__PURE__ */ X("div", {
294
260
  className: "relative h-full w-full overflow-hidden",
295
261
  children: [
296
- a && /* @__PURE__ */ q(Ke, {
262
+ a && /* @__PURE__ */ Y(Ue, {
297
263
  onClick: a,
298
- id: h
264
+ id: h,
265
+ className: Z.imageActionButton
299
266
  }),
300
- s && /* @__PURE__ */ q(We, {
267
+ s && /* @__PURE__ */ Y(Ve, {
301
268
  onClick: s,
302
- id: h
269
+ id: h,
270
+ className: Z.imageActionButton
303
271
  }),
304
- E !== Xe.Loaded && /* @__PURE__ */ q(S, {
305
- variant: C.Rectangular,
272
+ E !== Ke.Loaded && /* @__PURE__ */ Y(_, {
273
+ variant: v.Rectangular,
306
274
  width: "100%",
307
275
  height: "100%",
308
- active: E === Xe.Loading,
309
- overlay: /* @__PURE__ */ q(H, {
276
+ active: E === Ke.Loading,
277
+ overlay: /* @__PURE__ */ Y(G, {
310
278
  size: p.LG,
311
- className: f?.placeholderIconClassName ?? "text-secondary",
279
+ className: Z.typeText,
312
280
  "aria-hidden": !0
313
281
  }),
314
282
  className: "absolute inset-0 rounded-xl"
315
283
  }),
316
- /* @__PURE__ */ q("img", {
284
+ /* @__PURE__ */ Y("img", {
317
285
  ref: T,
318
- src: _,
286
+ src: y,
319
287
  alt: g,
320
288
  loading: "lazy",
321
289
  decoding: "async",
322
- className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Xe.Loaded ? "opacity-100" : "opacity-0")
290
+ className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Ke.Loaded ? "opacity-100" : "opacity-0")
323
291
  })
324
292
  ]
325
293
  })
326
294
  });
327
- }, $e = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: l }) => {
328
- let { colors: d } = l ?? {}, f = e.type === t.Pasted, p = f && a !== void 0, m = u({
329
- "--ci-tile-bg": d?.background,
330
- "--ci-tile-border": d?.border,
331
- "--ci-tile-border-hover": d?.borderHover,
332
- "--ci-tile-focus-outline": d?.focusOutline,
333
- "--ci-tile-bg-error": d?.backgroundError,
334
- "--ci-tile-border-error": d?.borderError,
335
- "--ci-tile-error-text": d?.errorText,
336
- "--ci-tile-name-text": d?.nameText,
337
- "--ci-tile-type-text": d?.typeText,
338
- "--ci-tile-hover-icon-bg": d?.hoverIconBackground,
339
- "--ci-tile-hover-icon-color": d?.hoverIconColor,
340
- "--ci-tile-track-bg": d?.trackBackground,
341
- "--ci-tile-fill-bg": d?.fillBackground
342
- }), { isImage: h, isAudio: g, isLink: _ } = W(() => Ve(e), [e]);
343
- return g ? /* @__PURE__ */ q(qe, {
344
- attachment: e,
345
- labels: c,
346
- onClick: o,
347
- searchQuery: n,
348
- styles: l,
349
- cssVars: m
350
- }) : h ? /* @__PURE__ */ q(Qe, {
295
+ }, Ye = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: l, isSelected: d }) => {
296
+ let { colors: f } = l ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = u({
297
+ "--ai-tile-bg": f?.background,
298
+ "--ai-tile-border": f?.border,
299
+ "--ai-tile-bg-hover": f?.backgroundHover,
300
+ "--ai-tile-border-hover": f?.borderHover,
301
+ "--ai-tile-bg-selected": f?.backgroundSelected,
302
+ "--ai-tile-border-selected": f?.borderSelected,
303
+ "--ai-tile-focus-outline": f?.focusOutline,
304
+ "--ai-tile-bg-error": f?.backgroundError,
305
+ "--ai-tile-border-error": f?.borderError,
306
+ "--ai-tile-error-text": f?.errorText,
307
+ "--ai-tile-name-text": f?.nameText,
308
+ "--ai-tile-type-text": f?.typeText,
309
+ "--ai-tile-hover-icon-bg": f?.hoverIconBackground,
310
+ "--ai-tile-hover-icon-color": f?.hoverIconColor,
311
+ "--ai-tile-progress-track": f?.trackBackground
312
+ }), { isImage: g, isLink: _ } = je(() => Re(e), [e]);
313
+ return g ? /* @__PURE__ */ Y(Je, {
351
314
  attachment: e,
352
315
  labels: c,
353
316
  onClick: o,
354
317
  onExpand: a,
355
318
  styles: l,
356
319
  onRemove: r,
357
- cssVars: m,
358
- onDownload: s
359
- }) : /* @__PURE__ */ q(Ye, {
320
+ cssVars: h,
321
+ onDownload: s,
322
+ isSelected: d
323
+ }) : /* @__PURE__ */ Y(Ge, {
360
324
  attachment: e,
325
+ searchQuery: n,
361
326
  onClick: o,
362
327
  onRetry: i,
363
328
  onRemove: r,
364
329
  onDownload: s,
365
330
  isLink: _,
366
- isPasted: f,
331
+ isPasted: p,
367
332
  styles: l,
368
333
  labels: c,
369
334
  onExpand: a,
370
- cssVars: m,
371
- isExpandable: p
335
+ cssVars: h,
336
+ isExpandable: m,
337
+ isSelected: d
372
338
  });
373
- }, et = { tile: "_tile_nzsrz_1" }, tt = ({ count: e, onClick: t, labels: n, children: r, styles: i }) => {
374
- let { ariaLabel: a } = n ?? {}, { typography: { fontClassName: o = "dial-small-semi-text" } = {}, className: s, colors: c } = i ?? {}, l = u({
375
- "--ci-more-tile-bg": c?.background,
376
- "--ci-more-tile-border": c?.border,
377
- "--ci-more-tile-color": c?.color,
378
- "--ci-more-tile-bg-hover": c?.backgroundHover,
379
- "--ci-more-tile-color-hover": c?.colorHover,
380
- "--ci-more-tile-border-hover": c?.borderHover,
381
- "--ci-more-tile-focus-outline": c?.focusOutline
382
- });
383
- return /* @__PURE__ */ q("button", {
384
- type: "button",
385
- onClick: t,
386
- "aria-label": a ?? `Show ${e} more attachments`,
387
- style: l,
388
- className: d(Fe, o, et.tile, s),
389
- children: r ?? /* @__PURE__ */ q("bdi", {
390
- dir: "ltr",
391
- children: `+${e}`
392
- })
393
- });
394
- }, Q = {
395
- container: "_container_7fktb_1",
396
- headerIcon: "_headerIcon_7fktb_6",
397
- headerLabel: "_headerLabel_7fktb_7",
398
- downloadAllButton: "_downloadAllButton_7fktb_8",
399
- imageTile: "_imageTile_7fktb_12"
400
- }, nt = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, rt = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o }) => {
401
- let { ariaLabel: s = "Attachments", clickLabel: l = "Download attachment", retryLabel: f = "Retry upload", showLessLabel: h = "Show less", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => nt(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = a ?? {}, { typography: { headerLabelClassName: S = "dial-tiny-semi-text" } = {}, colors: C, className: w } = o ?? {}, T = u({
402
- "--ci-group-bg": C?.background,
403
- "--ci-group-border": C?.border,
404
- "--ci-group-text": C?.text
405
- }), [E, D] = G(!1), O = W(() => He(e.length, E), [e.length, E]);
339
+ }, Xe = {
340
+ headerIcon: "_headerIcon_1dmgi_1",
341
+ headerLabel: "_headerLabel_1dmgi_2"
342
+ }, Ze = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Qe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o, selectedAttachmentId: s }) => {
343
+ let { ariaLabel: l = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: h = "Download all", openInNewTabLabel: g, getHeaderLabel: _ = (e) => Ze(e, "attachment"), promptLabel: v, pastedLabel: y, imageLabel: b } = a ?? {}, { typography: x, colors: w, className: T } = o ?? {}, E = u({ "--ai-group-text": w?.text });
406
344
  if (e.length === 0) return null;
407
- let k = e.some((e) => e.type === t.Image), A = e.some((e) => e.type !== t.Image), j = k && A, N = e.length >= 5, P = j ? xe : k ? H : L, I = v(e.length), R = e.slice(0, O.visibleCount), z = () => {
345
+ let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ? ve : D ? G : L, M = _(e.length), N = () => {
408
346
  let t = e.filter((e) => e.status === c.Idle);
409
347
  r ? r(t) : t.forEach((e) => n?.(e.id));
410
- }, B = (t) => {
348
+ }, P = (t) => {
411
349
  let n = e.find((e) => e.id === t);
412
350
  n && r?.([n]);
413
351
  };
414
- return /* @__PURE__ */ J("div", {
352
+ return /* @__PURE__ */ X("div", {
415
353
  role: "group",
416
- "aria-label": s,
417
- style: T,
418
- className: d("rounded-2xl border p-3", N ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Q.container, w),
419
- children: [/* @__PURE__ */ J("div", {
420
- className: "mb-3 flex min-h-6 items-center gap-2",
421
- children: [
422
- /* @__PURE__ */ q(P, {
354
+ "aria-label": l,
355
+ style: E,
356
+ className: d("flex flex-col gap-1", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Xe.container, T),
357
+ children: [/* @__PURE__ */ X("div", {
358
+ className: "flex items-center justify-between",
359
+ children: [/* @__PURE__ */ X("div", {
360
+ className: "flex items-center gap-1",
361
+ children: [/* @__PURE__ */ Y(j, {
362
+ size: p.SM,
363
+ className: d("shrink-0", Xe.headerIcon),
364
+ "aria-hidden": !0
365
+ }), /* @__PURE__ */ Y("span", {
366
+ className: d(x?.headerLabelClassName ?? "dial-tiny-semi-text", Xe.headerLabel),
367
+ children: M
368
+ })]
369
+ }), e.length >= 2 && (r || n) && /* @__PURE__ */ Y(C, {
370
+ icon: /* @__PURE__ */ Y(F, {
423
371
  size: p.SM,
424
- className: d("shrink-0", Q.headerIcon),
425
372
  "aria-hidden": !0
426
373
  }),
427
- /* @__PURE__ */ q("span", {
428
- className: d(S, Q.headerLabel),
429
- children: I
430
- }),
431
- e.length >= 2 && (r || n) && /* @__PURE__ */ q(m, {
432
- icon: /* @__PURE__ */ q(F, {
433
- size: p.SM,
434
- "aria-hidden": !0
435
- }),
436
- className: d("ms-auto h-6 w-6 rounded-lg", Q.downloadAllButton),
437
- "aria-label": g,
438
- onClick: z
439
- })
440
- ]
441
- }), /* @__PURE__ */ J("div", {
374
+ size: S.Small,
375
+ "aria-label": h,
376
+ onClick: N
377
+ })]
378
+ }), /* @__PURE__ */ Y("div", {
442
379
  role: "list",
443
- "aria-label": I,
444
- className: d("gap-3", N ? "grid grid-cols-[repeat(5,83px)] overflow-x-auto" : "flex flex-wrap"),
445
- children: [
446
- R.map((e) => /* @__PURE__ */ q("div", {
447
- role: "listitem",
448
- children: /* @__PURE__ */ q($e, {
449
- attachment: e,
450
- onClick: n,
451
- onDownload: B,
452
- onRetry: i,
453
- labels: {
454
- clickLabel: l,
455
- retryLabel: f,
456
- promptLabel: y,
457
- pastedLabel: b,
458
- imageLabel: x,
459
- openInNewTabLabel: _
460
- }
461
- })
462
- }, e.id)),
463
- O.layout === Y.Collapsed && /* @__PURE__ */ q("div", {
464
- role: "listitem",
465
- children: /* @__PURE__ */ q(tt, {
466
- count: O.hiddenCount,
467
- onClick: () => D(!0)
468
- })
469
- }),
470
- N && E && /* @__PURE__ */ q("div", {
471
- role: "listitem",
472
- children: /* @__PURE__ */ q(tt, {
473
- count: 0,
474
- onClick: () => D(!1),
475
- labels: { ariaLabel: h },
476
- children: /* @__PURE__ */ q(M, {
477
- size: p.MD,
478
- "aria-hidden": !0
479
- })
480
- })
380
+ "aria-label": M,
381
+ className: d("gap-3", A ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
382
+ children: e.map((e, t) => /* @__PURE__ */ Y("div", {
383
+ role: "listitem",
384
+ children: /* @__PURE__ */ Y(Ye, {
385
+ attachment: e,
386
+ onClick: n,
387
+ onDownload: P,
388
+ onRetry: i,
389
+ labels: {
390
+ clickLabel: f,
391
+ retryLabel: m,
392
+ promptLabel: v,
393
+ pastedLabel: y,
394
+ imageLabel: b,
395
+ openInNewTabLabel: g
396
+ },
397
+ isSelected: e.id === s
481
398
  })
482
- ]
399
+ }, `${e.id}-${t}`))
483
400
  })]
484
401
  });
485
- }, it = {
486
- tabContainer: "_tabContainer_rzv03_1",
487
- tabActive: "_tabActive_rzv03_13"
488
- };
489
- je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
490
- let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
491
- return /* @__PURE__ */ q("div", {
492
- className: "flex flex-nowrap gap-1",
493
- children: e.map((e) => {
494
- let r = t === e.id;
495
- return /* @__PURE__ */ q(T, {
496
- label: e.label,
497
- selected: r,
498
- onClick: () => n(e.id),
499
- "aria-selected": r,
500
- className: d("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, it.tabContainer, r && it.tabActive)
501
- }, e.id);
502
- })
503
- });
504
- });
505
- var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
506
- let [s, c] = G(t), [l, u] = G(n), [d, f] = G(r), p = Pe(o);
507
- Me(() => {
402
+ }, $e = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
403
+ let [s, c] = q(t), [l, u] = q(n), [d, f] = q(r), p = Me(o);
404
+ ke(() => {
508
405
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
509
406
  }, [
510
407
  o,
@@ -521,7 +418,7 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
521
418
  setResponseFormat: c,
522
419
  setSystemPrompt: u,
523
420
  setTemperature: f,
524
- handleSubmit: U(() => {
421
+ handleSubmit: K(() => {
525
422
  if (!m) return;
526
423
  let t = {};
527
424
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -535,55 +432,59 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
535
432
  a
536
433
  ])
537
434
  };
538
- }, st = "!dial-small-semi-text !text-primary gap-1", ct = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: g = [
435
+ }, et = { label: "_label_14i7c_1" }, tt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: b = [
539
436
  "Precise",
540
437
  "Neutral",
541
438
  "Creative"
542
- ], temperatureHint: _ }) => /* @__PURE__ */ J("div", {
543
- className: "flex flex-col gap-4 px-6 py-3",
544
- children: [
545
- e.responseFormat && /* @__PURE__ */ q(b, {
546
- fieldTitle: s,
547
- labelClassName: st,
548
- elementId: "response-format",
549
- orientation: k.Column,
550
- activeRadioButton: t ?? l.Markdown,
551
- labelDescription: c,
552
- radioButtons: [{
553
- id: l.Markdown,
554
- name: u
555
- }, {
556
- id: l.PlainText,
557
- name: d
558
- }],
559
- onChange: (e) => i(e)
560
- }),
561
- e.systemPrompt && /* @__PURE__ */ q(h, {
562
- value: n,
563
- placeholder: p,
564
- labelProps: {
565
- className: st,
566
- label: f
567
- },
568
- onChange: (e) => a(e ?? "")
569
- }),
570
- e.temperature && /* @__PURE__ */ q(w, {
571
- labelProps: {
572
- label: m,
573
- className: st,
574
- caption: _
575
- },
576
- value: r,
577
- min: 0,
578
- max: 1,
579
- step: .1,
580
- labels: g,
581
- onChange: o
582
- })
583
- ]
584
- });
585
- je(({ 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: g = "Apply changes", saveDisabledTooltip: _ }) => {
586
- let { responseFormat: y, systemPrompt: b, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: D } = ot({
439
+ ], temperatureHint: x, labelClassName: S = "!dial-small-semi-text", colors: C }) => {
440
+ let w = u({ "--csf-label-text": C?.labelText }), T = d(S, et.label, "gap-1");
441
+ return /* @__PURE__ */ X("div", {
442
+ className: "flex flex-col gap-4 px-6 py-3",
443
+ style: w,
444
+ children: [
445
+ e.responseFormat && /* @__PURE__ */ Y(g, {
446
+ fieldTitle: s,
447
+ labelClassName: T,
448
+ elementId: "response-format",
449
+ orientation: A.Column,
450
+ activeRadioButton: t ?? l.Markdown,
451
+ labelDescription: c,
452
+ radioButtons: [{
453
+ id: l.Markdown,
454
+ name: f
455
+ }, {
456
+ id: l.PlainText,
457
+ name: p
458
+ }],
459
+ onChange: (e) => i(e)
460
+ }),
461
+ e.systemPrompt && /* @__PURE__ */ Y(m, {
462
+ value: n,
463
+ placeholder: _,
464
+ labelProps: {
465
+ className: T,
466
+ label: h
467
+ },
468
+ onChange: (e) => a(e ?? "")
469
+ }),
470
+ e.temperature && /* @__PURE__ */ Y(y, {
471
+ labelProps: {
472
+ label: v,
473
+ className: T,
474
+ caption: x
475
+ },
476
+ value: r,
477
+ min: 0,
478
+ max: 1,
479
+ step: .1,
480
+ labels: b,
481
+ onChange: o
482
+ })
483
+ ]
484
+ });
485
+ }, nt = { modal: "_modal_od073_1" };
486
+ Oe(({ 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: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = nt.modal }) => {
487
+ let { responseFormat: b, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: D, handleSubmit: A } = $e({
587
488
  features: e,
588
489
  initialResponseFormat: t,
589
490
  initialSystemPrompt: n,
@@ -591,32 +492,32 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
591
492
  onSave: i,
592
493
  onClose: a
593
494
  });
594
- return /* @__PURE__ */ q(v, {
495
+ return /* @__PURE__ */ Y(h, {
595
496
  open: !0,
596
497
  header: o,
597
498
  size: O.Sm,
598
499
  onClose: a,
599
- className: "!bg-layer-2",
600
- footer: /* @__PURE__ */ q("div", {
500
+ className: y,
501
+ footer: /* @__PURE__ */ Y("div", {
601
502
  className: "flex justify-end px-6 py-4",
602
- children: /* @__PURE__ */ q(E, {
603
- tooltip: _,
604
- hideTooltip: S || !_,
605
- children: /* @__PURE__ */ q(at, {
606
- label: g,
607
- onClick: D,
608
- disabled: !S
503
+ children: /* @__PURE__ */ Y(x, {
504
+ tooltip: v,
505
+ hideTooltip: w || !v,
506
+ children: /* @__PURE__ */ Y(k, {
507
+ label: _,
508
+ onClick: A,
509
+ disabled: !w
609
510
  })
610
511
  })
611
512
  }),
612
- children: /* @__PURE__ */ q(ct, {
513
+ children: /* @__PURE__ */ Y(tt, {
613
514
  features: e,
614
- responseFormat: y,
615
- systemPrompt: b,
616
- temperature: x,
617
- onResponseFormatChange: C,
618
- onSystemPromptChange: w,
619
- onTemperatureChange: T,
515
+ responseFormat: b,
516
+ systemPrompt: S,
517
+ temperature: C,
518
+ onResponseFormatChange: T,
519
+ onSystemPromptChange: E,
520
+ onTemperatureChange: D,
620
521
  responseFormatLabel: s,
621
522
  responseFormatHint: c,
622
523
  responseFormatMarkdownLabel: l,
@@ -625,171 +526,173 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
625
526
  systemPromptTooltip: f,
626
527
  temperatureLabel: p,
627
528
  temperatureLabels: m,
628
- temperatureHint: h
529
+ temperatureHint: g
629
530
  })
630
531
  });
631
532
  });
632
- //#endregion
633
- //#region src/components/MessageActions/MessageActions.tsx
634
- var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r, onRegenerate: i, onCopy: a, onCopyMarkdown: c, onLike: l, onDislike: u, activeRating: f, isAlwaysVisible: h, className: g, labels: _ }) => {
635
- let { tooltips: v, ariaLabels: y } = _ ?? {}, [b, x] = G(null), [S, C] = G(""), w = U(() => {
636
- a?.(), x("copy"), C(y?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => x(null), lt);
637
- }, [a, y?.copiedStatus]), T = U(() => {
638
- c?.(), x("markdown"), C(y?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => x(null), lt);
639
- }, [c, y?.copiedMarkdownStatus]);
640
- return /* @__PURE__ */ J("div", {
533
+ var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e = s.User, onEdit: t, onEditHover: r, onDelete: i, onRegenerate: a, onCopy: c, onCopyMarkdown: l, onLike: f, onDislike: m, activeRating: h, isAlwaysVisible: g, className: _, labels: v, colors: y }) => {
534
+ let { tooltips: b, ariaLabels: x } = v ?? {}, [w, T] = q(null), [E, D] = q(""), O = u({ "--ma-active-rating-text": y?.activeRatingText }), k = K(() => {
535
+ c?.(), T("copy"), D(x?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => T(null), it);
536
+ }, [c, x?.copiedStatus]), A = K(() => {
537
+ l?.(), T("markdown"), D(x?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => T(null), it);
538
+ }, [l, x?.copiedMarkdownStatus]);
539
+ return /* @__PURE__ */ X("div", {
641
540
  role: "toolbar",
642
- "aria-label": y?.actionsGroup ?? "Message actions",
643
- className: d("flex gap-1", !h && "opacity-0 group-hover:opacity-100", g),
644
- children: [/* @__PURE__ */ q("span", {
541
+ "aria-label": x?.actionsGroup ?? "Message actions",
542
+ style: O,
543
+ className: d("flex gap-1", !g && "opacity-0 group-hover:opacity-100", _),
544
+ children: [/* @__PURE__ */ Y("span", {
645
545
  role: "status",
646
546
  "aria-live": "polite",
647
547
  className: "sr-only",
648
- children: S
649
- }), e === s.User ? /* @__PURE__ */ J(K, { children: [t && /* @__PURE__ */ q(m, {
650
- icon: /* @__PURE__ */ q(Se, {
548
+ children: E
549
+ }), e === s.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(C, {
550
+ icon: /* @__PURE__ */ Y(ye, {
651
551
  size: p.SM,
652
552
  "aria-hidden": !0
653
553
  }),
654
- size: D.Small,
655
- "aria-label": y?.editMessage ?? "Edit message",
656
- tooltipProps: { tooltip: v?.edit ?? "Edit" },
554
+ size: S.Small,
555
+ "aria-label": x?.editMessage ?? "Edit message",
556
+ tooltipProps: { tooltip: b?.edit ?? "Edit" },
657
557
  onClick: t,
658
- onMouseEnter: n,
659
- onFocus: n
660
- }), r && /* @__PURE__ */ q(m, {
661
- icon: /* @__PURE__ */ q(Oe, {
558
+ onMouseEnter: r,
559
+ onFocus: r
560
+ }), i && /* @__PURE__ */ Y(C, {
561
+ icon: /* @__PURE__ */ Y(Te, {
662
562
  size: p.SM,
663
563
  "aria-hidden": !0
664
564
  }),
665
- size: D.Small,
666
- "aria-label": y?.deleteMessage ?? "Delete message",
667
- tooltipProps: { tooltip: v?.delete ?? "Delete" },
668
- onClick: r
669
- })] }) : /* @__PURE__ */ J(K, { children: [
670
- i && /* @__PURE__ */ q(m, {
671
- icon: /* @__PURE__ */ q(Ce, {
565
+ size: S.Small,
566
+ "aria-label": x?.deleteMessage ?? "Delete message",
567
+ tooltipProps: { tooltip: b?.delete ?? "Delete" },
568
+ onClick: i
569
+ })] }) : /* @__PURE__ */ X(J, { children: [
570
+ a && /* @__PURE__ */ Y(C, {
571
+ icon: /* @__PURE__ */ Y(be, {
672
572
  size: p.SM,
673
573
  "aria-hidden": !0
674
574
  }),
675
- size: D.Small,
676
- "aria-label": y?.regenerateResponse ?? "Regenerate response",
677
- tooltipProps: { tooltip: v?.regenerate ?? "Regenerate" },
678
- onClick: i
575
+ size: S.Small,
576
+ "aria-label": x?.regenerateResponse ?? "Regenerate response",
577
+ tooltipProps: { tooltip: b?.regenerate ?? "Regenerate" },
578
+ onClick: a
679
579
  }),
680
- a && /* @__PURE__ */ q(m, {
681
- icon: q(b === "copy" ? A : P, {
682
- size: p.SM,
683
- "aria-hidden": !0
684
- }),
685
- size: D.Small,
686
- "aria-label": y?.copyResponse ?? "Copy response",
687
- tooltipProps: { tooltip: b === "copy" ? v?.copied ?? "Copied!" : v?.copy ?? "Copy" },
688
- onClick: w
580
+ c && /* @__PURE__ */ Y(n, {
581
+ iconSize: p.SM,
582
+ onClick: k,
583
+ size: S.Small,
584
+ isCopied: w === "copy",
585
+ copyLabel: b?.copy ?? "Copy",
586
+ copiedLabel: b?.copied ?? "Copied!",
587
+ ariaLabel: x?.copyResponse ?? "Copy response"
689
588
  }),
690
- c && /* @__PURE__ */ q(m, {
691
- icon: q(b === "markdown" ? A : ye, {
589
+ l && /* @__PURE__ */ Y(n, {
590
+ iconSize: p.SM,
591
+ onClick: A,
592
+ size: S.Small,
593
+ isCopied: w === "markdown",
594
+ iconCopy: /* @__PURE__ */ Y(ge, {
692
595
  size: p.SM,
693
596
  "aria-hidden": !0
694
597
  }),
695
- size: D.Small,
696
- "aria-label": y?.copyAsMarkdown ?? "Copy as markdown",
697
- tooltipProps: { tooltip: b === "markdown" ? v?.copiedMarkdown ?? "Copied!" : v?.copyMarkdown ?? "Copy as Markdown" },
698
- onClick: T
598
+ copyLabel: b?.copyMarkdown ?? "Copy as Markdown",
599
+ copiedLabel: b?.copiedMarkdown ?? "Copied!",
600
+ ariaLabel: x?.copyAsMarkdown ?? "Copy as markdown"
699
601
  }),
700
- l && /* @__PURE__ */ q(m, {
701
- icon: /* @__PURE__ */ q(De, {
602
+ f && /* @__PURE__ */ Y(C, {
603
+ icon: /* @__PURE__ */ Y(we, {
702
604
  size: p.SM,
703
605
  "aria-hidden": !0
704
606
  }),
705
- size: D.Small,
706
- "aria-label": y?.likeResponse ?? "Like response",
707
- "aria-pressed": f === o.Like,
708
- className: f === o.Like ? "!text-accent-primary" : void 0,
709
- tooltipProps: { tooltip: v?.like ?? "Like" },
710
- onClick: l
607
+ size: S.Small,
608
+ "aria-label": x?.likeResponse ?? "Like response",
609
+ "aria-pressed": h === o.Like,
610
+ className: h === o.Like ? rt.activeRating : void 0,
611
+ tooltipProps: { tooltip: b?.like ?? "Like" },
612
+ onClick: f
711
613
  }),
712
- u && /* @__PURE__ */ q(m, {
713
- icon: /* @__PURE__ */ q(Ee, {
614
+ m && /* @__PURE__ */ Y(C, {
615
+ icon: /* @__PURE__ */ Y(Ce, {
714
616
  size: p.SM,
715
617
  "aria-hidden": !0
716
618
  }),
717
- size: D.Small,
718
- "aria-label": y?.dislikeResponse ?? "Dislike response",
719
- "aria-pressed": f === o.Dislike,
720
- className: f === o.Dislike ? "!text-accent-primary" : void 0,
721
- tooltipProps: { tooltip: v?.dislike ?? "Dislike" },
722
- onClick: u
619
+ size: S.Small,
620
+ "aria-label": x?.dislikeResponse ?? "Dislike response",
621
+ "aria-pressed": h === o.Dislike,
622
+ className: h === o.Dislike ? rt.activeRating : void 0,
623
+ tooltipProps: { tooltip: b?.dislike ?? "Dislike" },
624
+ onClick: m
723
625
  })
724
626
  ] })]
725
627
  });
726
628
  }, $ = {
727
- userBubble: "_userBubble_1exhl_1",
728
- collapsibleText: "_collapsibleText_1exhl_6",
729
- expandedText: "_expandedText_1exhl_11",
730
- collapsedText: "_collapsedText_1exhl_15",
731
- startersDivider: "_startersDivider_1exhl_26",
732
- text: "_text_1exhl_30"
733
- }, dt = ({ text: e, styles: r, actions: a, hasAlwaysVisibleActions: o, isStreaming: c, attachments: l, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: y, onAttachmentRetry: b, codeBlockTheme: S, labels: C }) => {
734
- let { colors: w, typography: T, className: E, bubbleClassName: D } = r ?? {}, { attachmentClickLabel: O, attachmentRetryLabel: k, attachmentOpenInNewTabLabel: A, startersAriaLabel: j = "Quick reply buttons", thinkingLabel: M, codeBlockCopyLabel: N, codeBlockCopiedLabel: P, assistantMessageAriaLabel: F = "Assistant message", deploymentIconFallbackLabel: I = "AI" } = C ?? {}, L = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], R = u({
629
+ userBubble: "_userBubble_ovjc1_1",
630
+ collapsibleText: "_collapsibleText_ovjc1_6",
631
+ expandedText: "_expandedText_ovjc1_11",
632
+ collapsedText: "_collapsedText_ovjc1_15",
633
+ startersDivider: "_startersDivider_ovjc1_26",
634
+ text: "_text_ovjc1_30"
635
+ }, ot = ({ text: e, styles: n, actions: a, hasAlwaysVisibleActions: o, isStreaming: c, attachments: l, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: y, onAttachmentRetry: b, codeBlockTheme: x, labels: S, selectedAttachmentId: C }) => {
636
+ let { colors: w, typography: T, className: E, bubbleClassName: O } = n ?? {}, { attachmentClickLabel: k, attachmentRetryLabel: A, attachmentOpenInNewTabLabel: j, startersAriaLabel: M = "Quick reply buttons", thinkingLabel: N, codeBlockCopyLabel: P, codeBlockCopiedLabel: F, assistantMessageAriaLabel: I = "Assistant message", deploymentIconFallbackLabel: L = "AI" } = S ?? {}, R = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], z = u({
735
637
  "--cm-bubble-text": w?.text,
736
638
  "--cm-starters-divider": w?.startersDivider
737
- }), z = d($.text, T?.fontClassName), B = !!(h || g);
738
- return /* @__PURE__ */ J("div", {
639
+ }), B = d($.text, T?.fontClassName), V = !!(h || g);
640
+ return /* @__PURE__ */ X("div", {
739
641
  role: "group",
740
- "aria-label": F,
741
- style: R,
642
+ "aria-label": I,
643
+ style: z,
742
644
  className: d("flex w-full items-start gap-3", E),
743
- children: [B && /* @__PURE__ */ q(n, {
645
+ children: [V && /* @__PURE__ */ Y(r, {
744
646
  src: h,
745
647
  size: 28,
746
- initialsName: g || I,
747
- labels: { tooltip: g ?? I }
748
- }), /* @__PURE__ */ J("div", {
648
+ initialsName: g || L,
649
+ labels: { tooltip: g ?? L }
650
+ }), /* @__PURE__ */ X("div", {
749
651
  className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
750
- children: [/* @__PURE__ */ J("div", {
751
- className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4", D),
652
+ children: [/* @__PURE__ */ X("div", {
653
+ className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4", O),
752
654
  children: [
753
- (e || c) && /* @__PURE__ */ q("div", {
655
+ (e || c) && /* @__PURE__ */ Y("div", {
754
656
  "aria-live": "polite",
755
657
  "aria-atomic": "false",
756
- className: d(z, "min-w-0 max-w-full text-start"),
757
- children: /* @__PURE__ */ q(i, {
658
+ className: d(B, "min-w-0 max-w-full text-start"),
659
+ children: /* @__PURE__ */ Y(i, {
758
660
  content: e,
759
661
  isStreaming: c,
760
- thinkingLabel: M,
662
+ thinkingLabel: N,
761
663
  components: _,
762
- codeBlockCopyLabel: N,
763
- codeBlockCopiedLabel: P,
764
- codeBlockTheme: S
664
+ codeBlockCopyLabel: P,
665
+ codeBlockCopiedLabel: F,
666
+ codeBlockTheme: x
765
667
  })
766
668
  }),
767
- /* @__PURE__ */ q(rt, {
768
- attachments: L,
669
+ /* @__PURE__ */ Y(Qe, {
670
+ attachments: R,
769
671
  onAttachmentClick: (e) => v?.(l?.find((t) => t.id === e)),
770
672
  onDownloadAll: y,
771
673
  onRetry: b,
772
674
  labels: {
773
- clickLabel: O,
774
- retryLabel: k,
775
- openInNewTabLabel: A
776
- }
675
+ clickLabel: k,
676
+ retryLabel: A,
677
+ openInNewTabLabel: j
678
+ },
679
+ selectedAttachmentId: C
777
680
  }),
778
681
  f,
779
- /* @__PURE__ */ q(ut, {
682
+ /* @__PURE__ */ Y(at, {
780
683
  ...a,
781
684
  isAlwaysVisible: o,
782
685
  role: s.Assistant
783
686
  })
784
687
  ]
785
- }), p && p.length > 0 && m && /* @__PURE__ */ q("div", {
688
+ }), p && p.length > 0 && m && /* @__PURE__ */ Y("div", {
786
689
  role: "list",
787
- "aria-label": j,
690
+ "aria-label": M,
788
691
  className: d("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
789
- children: p.map((e, t) => /* @__PURE__ */ q("div", {
692
+ children: p.map((e, t) => /* @__PURE__ */ Y("div", {
790
693
  role: "listitem",
791
694
  className: "min-w-[40px]",
792
- children: /* @__PURE__ */ q(x, {
695
+ children: /* @__PURE__ */ Y(D, {
793
696
  label: e.title,
794
697
  className: "min-w-[40px]",
795
698
  onClick: () => m(e)
@@ -798,77 +701,77 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
798
701
  })]
799
702
  })]
800
703
  });
801
- }, ft = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ q("div", {
704
+ }, st = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ Y("div", {
802
705
  role: "status",
803
706
  "aria-live": "polite",
804
- className: "dial-info-notification dial-notification",
805
- children: /* @__PURE__ */ q(_, {
707
+ children: /* @__PURE__ */ Y(T, {
806
708
  title: e,
807
709
  message: t,
808
710
  textClassName: "flex-row flex-wrap gap-1"
809
711
  })
810
- }), pt = /* @__PURE__ */ function(e) {
712
+ }), ct = /* @__PURE__ */ function(e) {
811
713
  return e.Bottom = "Bottom", e.Top = "Top", e;
812
- }({}), mt = 10, ht = ({ text: e, position: t = pt.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = mt, labels: c, onAttachmentClick: l, onDownloadAll: m, onAttachmentRetry: h }) => {
813
- let { colors: _, typography: v, className: y, bubbleClassName: b } = n ?? {}, { showMoreLabel: x = "Show more", showLessLabel: S = "Show less", showMoreAriaLabel: C, showLessAriaLabel: w, attachmentClickLabel: T, attachmentRetryLabel: E, attachmentOpenInNewTabLabel: O, userMessageAriaLabel: k = "User message" } = c ?? {}, { textRef: A, isTextCollapsed: N, isOverflowing: P, collapsedMaxHeight: F, expandedMaxHeight: I, isCollapsed: L, toggleCollapsed: R } = f({
714
+ }({}), lt = 10, ut = ({ text: e, position: t = ct.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = lt, labels: c, onAttachmentClick: l, onDownloadAll: m, onAttachmentRetry: h, selectedAttachmentId: g }) => {
715
+ let { colors: _, typography: v, className: y, bubbleClassName: b } = n ?? {}, { showMoreLabel: x = "Show more", showLessLabel: C = "Show less", showMoreAriaLabel: w, showLessAriaLabel: T, attachmentClickLabel: D, attachmentRetryLabel: O, attachmentOpenInNewTabLabel: k, userMessageAriaLabel: A = "User message" } = c ?? {}, { textRef: j, isTextCollapsed: P, isOverflowing: F, collapsedMaxHeight: I, expandedMaxHeight: L, isCollapsed: R, toggleCollapsed: z } = f({
814
716
  text: e,
815
717
  collapsedLineCount: o
816
- }), z = u({
718
+ }), B = u({
817
719
  "--cm-bubble-user-bg": _?.userBackground,
818
720
  "--cm-bubble-user-border": _?.userBorder,
819
721
  "--cm-bubble-fade-start": _?.fadeStart,
820
722
  "--cm-bubble-text": _?.text,
821
- "--cm-bubble-collapsed-height": P ? `${F}px` : void 0,
822
- "--cm-bubble-expanded-height": P ? `${I}px` : void 0
823
- }), B = t === pt.Top ? "rounded-ee-[6px] rounded-se-[16px]" : "rounded-se-[6px] rounded-ee-[16px]", ee = d($.text, v?.fontClassName), V = C ?? x, te = w ?? S, ne = L ? x : S, re = L ? V : te, ie = L ? j : M, ae = Ne();
824
- return /* @__PURE__ */ q("div", {
723
+ "--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
724
+ "--cm-bubble-expanded-height": F ? `${L}px` : void 0
725
+ }), V = t === ct.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", H = d($.text, v?.fontClassName), U = w ?? x, W = T ?? C, ee = R ? x : C, te = R ? U : W, ne = R ? M : N, re = Ae();
726
+ return /* @__PURE__ */ Y("div", {
825
727
  role: "group",
826
- "aria-label": k,
827
- style: z,
728
+ "aria-label": A,
729
+ style: B,
828
730
  className: d("flex w-full", y),
829
- children: /* @__PURE__ */ J("div", {
731
+ children: /* @__PURE__ */ X("div", {
830
732
  className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
831
733
  children: [
832
- /* @__PURE__ */ q(rt, {
734
+ /* @__PURE__ */ Y(Qe, {
833
735
  attachments: a ?? [],
834
736
  onAttachmentClick: (e) => l?.(a?.find((t) => t.id === e)),
835
737
  onDownloadAll: m,
836
738
  onRetry: h,
837
739
  labels: {
838
- clickLabel: T,
839
- retryLabel: E,
840
- openInNewTabLabel: O
740
+ clickLabel: D,
741
+ retryLabel: O,
742
+ openInNewTabLabel: k
841
743
  },
842
- styles: { className: "max-w-[640px]" }
744
+ styles: { className: "max-w-[640px]" },
745
+ selectedAttachmentId: g
843
746
  }),
844
- e && /* @__PURE__ */ q("div", {
845
- className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", B, b),
846
- children: /* @__PURE__ */ J("div", {
747
+ e && /* @__PURE__ */ Y("div", {
748
+ className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, b),
749
+ children: /* @__PURE__ */ X("div", {
847
750
  className: "flex min-w-0 flex-col items-start",
848
- children: [/* @__PURE__ */ q("div", {
849
- id: ae,
850
- className: d("relative overflow-hidden", P && $.collapsibleText, P && !L && $.expandedText, N && $.collapsedText),
851
- children: /* @__PURE__ */ q("p", {
852
- ref: A,
853
- className: d(ee, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
751
+ children: [/* @__PURE__ */ Y("div", {
752
+ id: re,
753
+ className: d("relative overflow-hidden", F && $.collapsibleText, F && !R && $.expandedText, P && $.collapsedText),
754
+ children: /* @__PURE__ */ Y("p", {
755
+ ref: j,
756
+ className: d(H, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
854
757
  children: e
855
758
  })
856
- }), P && /* @__PURE__ */ q(g, {
857
- label: /* @__PURE__ */ q(K, { children: ne }),
858
- iconBefore: /* @__PURE__ */ q(ie, {
759
+ }), F && /* @__PURE__ */ Y(E, {
760
+ label: /* @__PURE__ */ Y(J, { children: ee }),
761
+ iconBefore: /* @__PURE__ */ Y(ne, {
859
762
  size: p.SM,
860
763
  "aria-hidden": "true"
861
764
  }),
862
- "aria-label": re,
863
- "aria-expanded": !L,
864
- "aria-controls": ae,
765
+ "aria-label": te,
766
+ "aria-expanded": !R,
767
+ "aria-controls": re,
865
768
  className: "mt-3",
866
- onClick: R,
867
- size: D.Small
769
+ onClick: z,
770
+ size: S.Small
868
771
  })]
869
772
  })
870
773
  }),
871
- /* @__PURE__ */ q(ut, {
774
+ /* @__PURE__ */ Y(at, {
872
775
  ...r,
873
776
  isAlwaysVisible: i,
874
777
  role: s.User
@@ -876,31 +779,16 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
876
779
  ]
877
780
  })
878
781
  });
879
- }, gt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === s.Status ? /* @__PURE__ */ q(ft, { labels: {
782
+ }, dt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === s.Status ? /* @__PURE__ */ Y(st, { labels: {
880
783
  titleText: r.labels?.statusTitleText,
881
784
  bodyText: r.labels?.statusBodyText ?? ""
882
- } }) : e === s.User ? /* @__PURE__ */ q(ht, {
785
+ } }) : e === s.User ? /* @__PURE__ */ Y(ut, {
883
786
  ...r,
884
787
  onAttachmentClick: t
885
- }) : /* @__PURE__ */ q(dt, {
788
+ }) : /* @__PURE__ */ Y(ot, {
886
789
  ...r,
887
790
  markdownComponents: n,
888
791
  onAttachmentClick: t
889
- }), _t = { button: "_button_15boc_1" }, vt = ({ labels: { label: e }, onClick: t, styles: n }) => {
890
- let { colors: r, typography: i, className: a } = n ?? {};
891
- return /* @__PURE__ */ q("button", {
892
- type: "button",
893
- onClick: t,
894
- style: u({
895
- "--cm-source-bg": r?.background,
896
- "--cm-source-border": r?.border,
897
- "--cm-source-text": r?.text,
898
- "--cm-source-bg-hover": r?.backgroundHover,
899
- "--cm-source-border-hover": r?.borderHover
900
- }),
901
- className: d(_t.button, "relative flex h-6 items-center justify-center px-2", "border border-solid", "outline-none focus-visible:outline focus-visible:outline-1", "focus-visible:outline-offset-[3px]", "cursor-pointer whitespace-nowrap", i?.fontClassName, a),
902
- children: e
903
- });
904
- };
792
+ });
905
793
  //#endregion
906
- export { dt as AssistantMessageBubble, pt as BubblePosition, ut as MessageActions, gt as MessageBubble, vt as MessageSource, ft as StatusMessageBubble, ht as UserMessageBubble };
794
+ export { ot as AssistantMessageBubble, ct as BubblePosition, at as MessageActions, dt as MessageBubble, st as StatusMessageBubble, ut as UserMessageBubble };