@epam/ai-dial-conversation-messages 1.0.0-dev.514 → 1.0.0-dev.517

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