@epam/ai-dial-attachment-input 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.
Files changed (30) hide show
  1. package/components/AttachmentCard/AttachmentCard.d.ts.map +1 -1
  2. package/components/AttachmentCard/Attachments/Actions.d.ts +0 -2
  3. package/components/AttachmentCard/Attachments/Actions.d.ts.map +1 -1
  4. package/components/AttachmentCard/Attachments/File.d.ts +1 -8
  5. package/components/AttachmentCard/Attachments/File.d.ts.map +1 -1
  6. package/components/AttachmentCard/Attachments/Image.d.ts +2 -0
  7. package/components/AttachmentCard/Attachments/Image.d.ts.map +1 -1
  8. package/components/AttachmentGroup/AttachmentGroup.d.ts +1 -8
  9. package/components/AttachmentGroup/AttachmentGroup.d.ts.map +1 -1
  10. package/constants/attachment-group.d.ts +1 -3
  11. package/constants/attachment-group.d.ts.map +1 -1
  12. package/index.css +1 -1
  13. package/index.d.ts +4 -5
  14. package/index.d.ts.map +1 -1
  15. package/index.js +312 -395
  16. package/models/attachment-card.d.ts +8 -8
  17. package/models/attachment-card.d.ts.map +1 -1
  18. package/models/attachment-file-row.d.ts +4 -0
  19. package/models/attachment-file-row.d.ts.map +1 -1
  20. package/models/attachment-group.d.ts +2 -24
  21. package/models/attachment-group.d.ts.map +1 -1
  22. package/package.json +4 -4
  23. package/utils/attachment.d.ts +4 -27
  24. package/utils/attachment.d.ts.map +1 -1
  25. package/components/AttachmentCard/Attachments/Audio.d.ts +0 -16
  26. package/components/AttachmentCard/Attachments/Audio.d.ts.map +0 -1
  27. package/components/AttachmentMoreTile/AttachmentMoreTile.d.ts +0 -9
  28. package/components/AttachmentMoreTile/AttachmentMoreTile.d.ts.map +0 -1
  29. package/models/attachment-more-tile.d.ts +0 -54
  30. package/models/attachment-more-tile.d.ts.map +0 -1
package/index.js CHANGED
@@ -1,286 +1,252 @@
1
- import { AttachmentErrorReason as e, AttachmentType as t, Highlight as n, MIME_TYPE_EXT_MAP as r, RequestStatus as i, buildCssVars as a, mergeClasses as o } from "@epam/ai-dial-chat-shared";
2
- import { useCallback as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
3
- import { IconChevronUp as p, IconClipboard as m, IconDownload as h, IconExternalLink as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as S, IconFileTypeDocx as C, IconFileTypeHtml as w, IconFileTypeJpg as T, IconFileTypeJs as E, IconFileTypeJsx as D, IconFileTypePdf as O, IconFileTypePhp as k, IconFileTypePng as A, IconFileTypePpt as j, IconFileTypeRs as M, IconFileTypeSql as N, IconFileTypeSvg as P, IconFileTypeTs as F, IconFileTypeTsx as I, IconFileTypeTxt as L, IconFileTypeVue as R, IconFileTypeXls as z, IconFileTypeXml as B, IconFileTypeZip as V, IconFileX as ee, IconMusic as te, IconPaperclip as H, IconPhoto as U, IconReload as ne, IconTerminal2 as re, IconVideo as ie, IconX as ae } from "@tabler/icons-react";
4
- import { DIAL_ICON_SIZE as W, DialGhostIconButton as oe, DialSkeleton as se, DialSkeletonVariant as ce, ElementSize as le } from "@epam/ai-dial-ui-kit";
5
- import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
6
- //#region src/constants/attachment-group.ts
7
- var ue = 5, de = 4, fe = "flex size-[84px] items-center justify-center rounded-xl border", J = /* @__PURE__ */ function(e) {
8
- return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
9
- }({}), pe = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, me = (e) => {
1
+ import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, RequestStatus as r, buildCssVars as i, mergeClasses as a } from "@epam/ai-dial-chat-shared";
2
+ import { useCallback as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
3
+ import { IconClipboard as f, IconDownload as p, IconExternalLink as m, IconFile as h, IconFileDescription as g, IconFileTypeBmp as _, IconFileTypeCss as v, IconFileTypeCsv as y, IconFileTypeDoc as b, IconFileTypeDocx as x, IconFileTypeHtml as S, IconFileTypeJpg as C, IconFileTypeJs as w, IconFileTypeJsx as T, IconFileTypePdf as E, IconFileTypePhp as D, IconFileTypePng as O, IconFileTypePpt as k, IconFileTypeRs as A, IconFileTypeSql as j, IconFileTypeSvg as M, IconFileTypeTs as N, IconFileTypeTsx as P, IconFileTypeTxt as F, IconFileTypeVue as I, IconFileTypeXls as L, IconFileTypeXml as R, IconFileTypeZip as z, IconFileX as B, IconMusic as ee, IconPaperclip as V, IconPhoto as H, IconReload as te, IconTerminal2 as ne, IconVideo as re, IconX as ie } from "@tabler/icons-react";
4
+ import { DIAL_ICON_SIZE as U, DialSkeleton as ae, DialSkeletonVariant as oe, DialSpinner as se, ElementSize as ce, GhostIconButton as le, Highlight as ue, StaticIconButton as de } from "@epam/ai-dial-ui-kit";
5
+ import { Fragment as fe, jsx as W, jsxs as G } from "react/jsx-runtime";
6
+ //#region src/utils/attachment.ts
7
+ var K = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) => {
8
+ if (e == null) return "";
10
9
  let t = e.lastIndexOf(".");
11
10
  return t > 0 ? e.slice(0, t) : e;
12
- }, he = {
11
+ }, me = {
13
12
  image: "Image files",
14
13
  audio: "Audio files",
15
14
  video: "Video files",
16
15
  text: "Text files"
17
- }, ge = (e, t = he) => e.map((e) => {
16
+ }, he = (e, t = me) => e.map((e) => {
18
17
  if (e.endsWith("/*")) {
19
18
  let n = e.slice(0, -2);
20
19
  return t[n] ?? `${n} files`;
21
20
  }
22
21
  let n = e.split("/")[1];
23
22
  return n == null ? e.toUpperCase() : n.toUpperCase();
24
- }).join(", "), _e = (e, t) => t.length === 0 ? !1 : t.some((t) => {
23
+ }).join(", "), ge = (e, t) => t.length === 0 ? !1 : t.some((t) => {
25
24
  if (t === "*" || t === "*/*") return !0;
26
25
  if (t.endsWith("/*")) {
27
26
  let n = t.slice(0, -2);
28
27
  return e.startsWith(`${n}/`);
29
28
  }
30
29
  return e === t;
31
- }), ve = (e) => {
32
- if (!e) return _;
30
+ }), _e = (e) => {
31
+ if (!e) return h;
33
32
  if (e.startsWith("image/")) switch (e) {
34
33
  case "image/jpeg":
35
- case "image/jpg": return T;
36
- case "image/png": return A;
37
- case "image/svg+xml": return P;
38
- case "image/bmp": return y;
39
- default: return U;
34
+ case "image/jpg": return C;
35
+ case "image/png": return O;
36
+ case "image/svg+xml": return M;
37
+ case "image/bmp": return _;
38
+ default: return H;
40
39
  }
41
- if (e.startsWith("video/")) return ie;
42
- if (e.startsWith("audio/")) return te;
40
+ if (e.startsWith("video/")) return re;
41
+ if (e.startsWith("audio/")) return ee;
43
42
  switch (e) {
44
- case "application/pdf": return O;
43
+ case "application/pdf": return E;
45
44
  case "application/msword":
46
- case "application/vnd.ms-word": return S;
47
- case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return C;
48
- case "application/vnd.ms-powerpoint": return j;
49
- case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return j;
50
- case "application/vnd.ms-excel": return z;
51
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return z;
45
+ case "application/vnd.ms-word": return b;
46
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return x;
47
+ case "application/vnd.ms-powerpoint": return k;
48
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return k;
49
+ case "application/vnd.ms-excel": return L;
50
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return L;
52
51
  case "application/zip":
53
52
  case "application/x-zip-compressed":
54
53
  case "application/x-rar-compressed":
55
54
  case "application/x-7z-compressed":
56
55
  case "application/gzip":
57
- case "application/x-tar": return V;
58
- case "text/csv": return x;
59
- case "text/plain": return L;
56
+ case "application/x-tar": return z;
57
+ case "text/csv": return y;
58
+ case "text/plain": return F;
60
59
  case "text/html":
61
- case "application/xhtml+xml": return w;
60
+ case "application/xhtml+xml": return S;
62
61
  case "text/xml":
63
- case "application/xml": return B;
62
+ case "application/xml": return R;
64
63
  case "application/sql":
65
- case "text/x-sql": return N;
64
+ case "text/x-sql": return j;
66
65
  case "text/javascript":
67
- case "application/javascript": return E;
68
- case "text/jsx": return D;
66
+ case "application/javascript": return w;
67
+ case "text/jsx": return T;
69
68
  case "application/typescript":
70
- case "text/typescript": return F;
71
- case "text/tsx": return I;
72
- case "text/css": return b;
69
+ case "text/typescript": return N;
70
+ case "text/tsx": return P;
71
+ case "text/css": return v;
73
72
  case "text/x-php":
74
- case "application/x-php": return k;
73
+ case "application/x-php": return D;
75
74
  case "text/x-rustsrc":
76
- case "application/x-rust": return M;
77
- case "text/x-vue": return R;
78
- default: return _;
75
+ case "application/x-rust": return A;
76
+ case "text/x-vue": return I;
77
+ default: return h;
79
78
  }
80
- }, ye = (e) => {
79
+ }, ve = (e) => {
81
80
  let { type: n, contentType: r } = e;
82
- return n === t.Prompt ? re : n === t.Pasted ? m : n === t.Image ? U : ve(r ?? "");
83
- }, be = (e) => {
84
- let t = e.toLowerCase().split(";")[0].trim(), n = r[t];
85
- if (n) return n;
81
+ return n === t.Prompt ? ne : n === t.Pasted ? f : n === t.Image ? H : _e(r ?? "");
82
+ }, ye = (e) => {
83
+ let t = e.toLowerCase().split(";")[0].trim(), r = n[t];
84
+ if (r) return r;
86
85
  let i = t.split("/")[1];
87
86
  if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
88
- }, xe = (e, n) => {
87
+ }, be = (e, n) => {
89
88
  let { type: r, name: i, contentType: a } = e;
90
89
  if (r === t.Prompt) return n.promptLabel ?? "Prompt";
91
90
  if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
92
91
  if (r === t.Image) return n.imageLabel ?? "Image";
93
92
  if (a) {
94
- let e = be(a);
93
+ let e = ye(a);
95
94
  if (e) return `.${e}`;
96
95
  }
97
96
  let o = i.lastIndexOf(".");
98
97
  return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
99
- }, Y = (e, n = {}) => {
100
- let { type: r, status: a, previewUrl: o, url: s } = e, c = a === i.Loading, l = a === i.Error, u = r === t.Image && !!(o ?? s) && !l, d = r === t.Audio && !l, f = r === t.Link && !l;
98
+ }, q = (e, n = {}) => {
99
+ let { type: i, status: a, previewUrl: o, url: s } = e, c = a === r.Loading, l = a === r.Error, u = i === t.Image && !!(o ?? s) && !l, d = i === t.Link && !l;
101
100
  return {
102
101
  isLoading: c,
103
102
  isError: l,
104
103
  isImage: u,
105
- isAudio: d,
106
- isLink: f,
107
- BottomIcon: f ? null : ye(e),
108
- typeLabel: f ? null : xe(e, n)
104
+ isLink: d,
105
+ BottomIcon: d ? null : ve(e),
106
+ typeLabel: d ? null : be(e, n)
109
107
  };
110
- }, Se = (e, t) => e <= 0 ? {
111
- layout: J.None,
112
- visibleCount: 0,
113
- hiddenCount: 0
114
- } : e < 5 || t ? {
115
- layout: J.AllVisible,
116
- visibleCount: e,
117
- hiddenCount: 0
118
- } : {
119
- layout: J.Collapsed,
120
- visibleCount: 4,
121
- hiddenCount: e - 4
122
- }, X = {
123
- tile: "_tile_3x6ks_1",
124
- tileLight: "_tileLight_3x6ks_12",
125
- tileError: "_tileError_3x6ks_16",
126
- nameText: "_nameText_3x6ks_23",
127
- typeText: "_typeText_3x6ks_24",
128
- retryIcon: "_retryIcon_3x6ks_36",
129
- hoverIcon: "_hoverIcon_3x6ks_40",
130
- track: "_track_3x6ks_48",
131
- indeterminateFill: "_indeterminateFill_3x6ks_52",
132
- "attachment-tile-indeterminate": "_attachment-tile-indeterminate_3x6ks_1"
133
- }, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: s }) => /* @__PURE__ */ K(oe, {
134
- icon: a,
135
- size: le.Small,
136
- className: o("absolute end-1 top-1 h-6 w-6 rounded-lg", s ?? X.hoverIcon),
108
+ }, xe = 5, Se = "flex size-[84px] items-center justify-center rounded-xl border", J = {
109
+ tile: "_tile_3jao2_1",
110
+ hovered: "_hovered_3jao2_5",
111
+ selected: "_selected_3jao2_15",
112
+ tileError: "_tileError_3jao2_20",
113
+ nameText: "_nameText_3jao2_25",
114
+ typeText: "_typeText_3jao2_29",
115
+ retryIcon: "_retryIcon_3jao2_33",
116
+ track: "_track_3jao2_37",
117
+ actionButton: "_actionButton_3jao2_43",
118
+ imageActionButton: "_imageActionButton_3jao2_47"
119
+ }, Y = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: o, className: s }) => /* @__PURE__ */ W(de, {
120
+ icon: o,
121
+ size: ce.Small,
122
+ className: a("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", J.actionButton, s),
137
123
  "aria-label": e,
138
124
  "aria-describedby": t ? n : void 0,
139
125
  onClick: (e) => {
140
126
  e.stopPropagation(), r(i);
141
127
  }
142
- }), Ce = ({ ...e }) => /* @__PURE__ */ K(Z, {
143
- icon: /* @__PURE__ */ K(ne, {
144
- size: W.SM,
128
+ }), Ce = ({ ...e }) => /* @__PURE__ */ W(Y, {
129
+ icon: /* @__PURE__ */ W(te, {
130
+ size: U.SM,
145
131
  "aria-hidden": !0
146
132
  }),
147
- className: X.retryIcon,
133
+ className: J.retryIcon,
148
134
  ...e
149
- }), we = ({ ...e }) => /* @__PURE__ */ K(Z, {
150
- icon: /* @__PURE__ */ K(h, {
151
- size: W.SM,
135
+ }), we = ({ ...e }) => /* @__PURE__ */ W(Y, {
136
+ icon: /* @__PURE__ */ W(p, {
137
+ size: U.SM,
152
138
  "aria-hidden": !0
153
139
  }),
154
140
  ...e
155
- }), Te = ({ ...e }) => /* @__PURE__ */ K(Z, {
156
- icon: /* @__PURE__ */ K(g, {
157
- size: W.SM,
141
+ }), Te = ({ ...e }) => /* @__PURE__ */ W(Y, {
142
+ icon: /* @__PURE__ */ W(m, {
143
+ size: U.SM,
158
144
  "aria-hidden": !0
159
145
  }),
160
146
  ...e
161
- }), Ee = ({ ...e }) => /* @__PURE__ */ K(Z, {
162
- icon: /* @__PURE__ */ K(ae, {
163
- size: W.SM,
147
+ }), Ee = ({ ...e }) => /* @__PURE__ */ W(Y, {
148
+ icon: /* @__PURE__ */ W(ie, {
149
+ size: U.SM,
164
150
  "aria-hidden": !0
165
151
  }),
166
- className: X.hoverIcon,
167
152
  ...e
168
- }), De = ({ attachment: e, searchQuery: t = "", onClick: r, labels: i, styles: a, cssVars: s }) => {
169
- let { clickLabel: c = "Open attachment" } = i ?? {}, { typography: l, className: u } = a ?? {};
170
- return /* @__PURE__ */ q("div", {
171
- style: s,
172
- className: o("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", u),
173
- children: [/* @__PURE__ */ q("div", {
174
- className: "flex items-center justify-between gap-2",
175
- children: [/* @__PURE__ */ K("span", {
176
- title: e.name,
177
- className: o(l?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
178
- children: t ? /* @__PURE__ */ K(n, {
179
- text: e.name,
180
- query: t,
181
- maxLines: 1
182
- }) : e.name
183
- }), r && /* @__PURE__ */ K(we, {
184
- ariaLabel: c,
185
- onClick: r,
186
- id: e.id
187
- })]
188
- }), e.playUrl && /* @__PURE__ */ K("audio", {
189
- controls: !0,
190
- src: e.playUrl,
191
- "aria-label": e.name,
192
- className: "w-full",
193
- preload: "metadata"
194
- })]
195
- });
196
- }, Oe = {
153
+ }), De = {
197
154
  [e.Network]: "Upload failed · network error",
198
155
  [e.UnsupportedType]: "Upload failed · unsupported file type"
199
- }, ke = ({ attachment: t, onClick: n, onRetry: r, labels: a, styles: c, onDownload: d, isPasted: f, isLink: p, cssVars: m, onExpand: h, isExpandable: g, onRemove: _ }) => {
200
- let { clickLabel: v = "Download attachment", retryLabel: y = "Retry upload", sizeLabel: b, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: { nameClassName: w = "dial-caption-text", metaClassName: T = "dial-caption-text" } = {}, className: E } = c ?? {}, { id: D, name: O, status: k, errorReason: A } = t, j = k === i.Loading, M = k === i.Error, N = l(), P = M ? A && (S?.[A] ?? Oe[A]) || C : "", { BottomIcon: F, typeLabel: I } = Y(t), L = !M && !j && d && !p, R = M && !!r && A !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
201
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.(t.id));
202
- }, V = u(() => f ? O : me(O), [f, O]), ee = s(() => {
156
+ }, Oe = ({ attachment: t, searchQuery: n = "", onClick: i, onRetry: s, labels: u, styles: d, onDownload: f, isPasted: p, isLink: m, cssVars: h, onExpand: g, isExpandable: _, onRemove: v, isSelected: y }) => {
157
+ let { clickLabel: b = "Download attachment", retryLabel: x = "Retry upload", sizeLabel: S, uploadingLabel: C = "Uploading", errorReasonLabels: w, genericErrorLabel: T = "Upload failed" } = u ?? {}, { typography: E, className: D } = d ?? {}, { id: O, name: k, status: A, errorReason: j } = t, M = A === r.Loading, N = A === r.Error, P = c(), F = N ? j && (w?.[j] ?? De[j]) || T : "", { BottomIcon: I, typeLabel: L } = q(t), R = !N && !M && f && !m, z = N && !!s && j !== e.UnsupportedType, B = R || z ? "pe-5" : void 0, ee = (e) => {
158
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.(t.id));
159
+ }, V = l(() => p ? k : pe(k), [p, k]), H = o(() => {
203
160
  window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
204
- }, [t]), te = o(fe, "group relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !M && X.tileLight, M && X.tileError), H = /* @__PURE__ */ K("div", {
161
+ }, [t]), te = a(Se, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", J.tile, !N && J.hovered, y && J.selected, N && J.tileError), ne = /* @__PURE__ */ W("div", {
205
162
  title: V,
206
- className: o(w, "line-clamp-2 min-w-0 break-all", X.nameText, !M && z),
207
- children: V
208
- }), U = F && /* @__PURE__ */ q("div", {
209
- className: o("flex w-full items-center gap-1", M && z),
210
- children: [/* @__PURE__ */ K(F, {
163
+ className: a(E?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", J.nameText, !N && B),
164
+ children: n ? /* @__PURE__ */ W(ue, {
165
+ text: V,
166
+ query: n,
167
+ maxLines: 2
168
+ }) : V
169
+ }), re = I && /* @__PURE__ */ G("div", {
170
+ className: a("flex w-full items-center gap-1", N && B),
171
+ children: [/* @__PURE__ */ W(I, {
211
172
  size: 16,
212
- className: X.typeText,
173
+ className: J.typeText,
213
174
  "aria-hidden": !0
214
- }), /* @__PURE__ */ K("span", {
215
- className: o(T, "min-w-0 flex-1 truncate", X.typeText),
216
- children: b ? `${I} · ${b}` : I
175
+ }), /* @__PURE__ */ W("span", {
176
+ className: a(E?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", J.typeText),
177
+ children: S ? `${L} · ${S}` : L
217
178
  })]
218
- }), ne = () => {
219
- g && h ? h(D) : n && n(D);
220
- }, re = /* @__PURE__ */ q(G, { children: [
221
- M ? /* @__PURE__ */ q(G, { children: [U, H] }) : /* @__PURE__ */ q(G, { children: [H, U] }),
222
- j && /* @__PURE__ */ K("div", {
223
- role: "progressbar",
224
- "aria-label": x,
225
- className: o("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", X.track),
226
- children: /* @__PURE__ */ K("div", { className: o("h-full w-1/3 rounded-full", X.indeterminateFill) })
227
- }),
228
- L && /* @__PURE__ */ K(we, {
229
- ariaLabel: v,
230
- errorTitle: P,
231
- errorDescId: N,
232
- onClick: d,
233
- id: D
234
- }),
235
- R && /* @__PURE__ */ K(Ce, {
236
- ariaLabel: y,
237
- errorTitle: P,
238
- errorDescId: N,
239
- onClick: r,
240
- id: D
179
+ }), ie = () => {
180
+ _ && g ? g(O) : i && i(O);
181
+ }, U = /* @__PURE__ */ G(fe, { children: [
182
+ ne,
183
+ re,
184
+ M && /* @__PURE__ */ W("div", {
185
+ "aria-label": C,
186
+ className: a("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", J.track),
187
+ children: /* @__PURE__ */ W(se, { size: 32 })
241
188
  }),
242
- p && /* @__PURE__ */ K(Te, {
243
- ariaLabel: y,
244
- errorTitle: P,
245
- errorDescId: N,
246
- onClick: ee
247
- }),
248
- _ && /* @__PURE__ */ K(Ee, {
249
- ariaLabel: y,
250
- errorTitle: P,
251
- errorDescId: N,
252
- onClick: _,
253
- id: D
189
+ /* @__PURE__ */ G("div", {
190
+ className: a("absolute right-0 top-0 flex gap-1"),
191
+ children: [
192
+ R && /* @__PURE__ */ W(we, {
193
+ ariaLabel: b,
194
+ errorTitle: F,
195
+ errorDescId: P,
196
+ onClick: f,
197
+ id: O
198
+ }),
199
+ z && /* @__PURE__ */ W(Ce, {
200
+ ariaLabel: x,
201
+ errorTitle: F,
202
+ errorDescId: P,
203
+ onClick: s,
204
+ id: O
205
+ }),
206
+ m && /* @__PURE__ */ W(Te, {
207
+ ariaLabel: x,
208
+ errorTitle: F,
209
+ errorDescId: P,
210
+ onClick: H
211
+ }),
212
+ v && /* @__PURE__ */ W(Ee, {
213
+ ariaLabel: x,
214
+ errorTitle: F,
215
+ errorDescId: P,
216
+ onClick: v,
217
+ id: O
218
+ })
219
+ ]
254
220
  }),
255
- M && /* @__PURE__ */ K("span", {
256
- id: N,
221
+ N && /* @__PURE__ */ W("span", {
222
+ id: P,
257
223
  role: "status",
258
224
  "aria-live": "polite",
259
225
  className: "sr-only",
260
- children: P
226
+ children: F
261
227
  })
262
228
  ] });
263
- return /* @__PURE__ */ K("div", {
264
- style: m,
265
- className: o("inline-flex", E),
266
- children: /* @__PURE__ */ K("div", {
229
+ return /* @__PURE__ */ W("div", {
230
+ style: h,
231
+ className: a("inline-flex", D),
232
+ children: /* @__PURE__ */ W("div", {
267
233
  role: "button",
268
234
  tabIndex: 0,
269
- "aria-label": v,
270
- onClick: ne,
271
- onKeyDown: B,
272
- style: m,
273
- className: o(te, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
274
- children: re
235
+ "aria-label": b,
236
+ onClick: ie,
237
+ onKeyDown: ee,
238
+ style: h,
239
+ className: a(te, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
240
+ children: U
275
241
  })
276
242
  });
277
- }, Q = /* @__PURE__ */ function(e) {
243
+ }, X = /* @__PURE__ */ function(e) {
278
244
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
279
- }({}), Ae = ({ enabled: e, src: t }) => {
280
- let n = d(null), [r, i] = f("idle");
281
- return c(() => {
245
+ }({}), ke = ({ enabled: e, src: t }) => {
246
+ let n = u(null), [r, i] = d("idle");
247
+ return s(() => {
282
248
  i(e && t ? "loading" : "idle");
283
- }, [e, t]), c(() => {
249
+ }, [e, t]), s(() => {
284
250
  let r = n.current;
285
251
  if (!r || !e || !t) return;
286
252
  let a = () => i("loaded"), o = () => i("error");
@@ -291,15 +257,15 @@ var ue = 5, de = 4, fe = "flex size-[84px] items-center justify-center rounded-x
291
257
  imageRef: n,
292
258
  imageLoadStatus: r
293
259
  };
294
- }, je = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: s, onDownload: c, styles: l }) => {
295
- let { clickLabel: d = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { typography: p, className: m } = l ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = u(() => Y(e), [e]), S = r !== void 0 && !v && !y && !b, { imageRef: C, imageLoadStatus: w } = Ae({
260
+ }, Ae = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: o, cssVars: s, onDownload: c, styles: u, isSelected: d }) => {
261
+ let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text" } = i ?? {}, { className: m } = u ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = l(() => q(e), [e]), S = r !== void 0 && !v && !y && !b, { imageRef: C, imageLoadStatus: w } = ke({
296
262
  enabled: x,
297
263
  src: _
298
264
  }), T = () => {
299
265
  v && n ? n(h) : S && r && r(h);
300
266
  };
301
- return /* @__PURE__ */ K("div", {
302
- className: o(fe, S && "cursor-pointer", X.tile, m),
267
+ return /* @__PURE__ */ W("div", {
268
+ className: a(Se, "group/attachment-tile", S && "cursor-pointer", J.tile, d && J.selected, m),
303
269
  onClick: T,
304
270
  onKeyDown: (e) => {
305
271
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), T());
@@ -307,96 +273,96 @@ var ue = 5, de = 4, fe = "flex size-[84px] items-center justify-center rounded-x
307
273
  tabIndex: 0,
308
274
  role: "button",
309
275
  style: s,
310
- "aria-label": S ? d : v ? f : void 0,
311
- children: /* @__PURE__ */ q("div", {
276
+ "aria-label": S ? f : v ? p : void 0,
277
+ children: /* @__PURE__ */ G("div", {
312
278
  className: "relative h-full w-full overflow-hidden",
313
279
  children: [
314
- a && /* @__PURE__ */ K(Ee, {
315
- onClick: a,
316
- id: h
280
+ o && /* @__PURE__ */ W(Ee, {
281
+ onClick: o,
282
+ id: h,
283
+ className: J.imageActionButton
317
284
  }),
318
- c && /* @__PURE__ */ K(we, {
285
+ c && /* @__PURE__ */ W(we, {
319
286
  onClick: c,
320
- id: h
287
+ id: h,
288
+ className: J.imageActionButton
321
289
  }),
322
- w !== Q.Loaded && /* @__PURE__ */ K(se, {
323
- variant: ce.Rectangular,
290
+ w !== X.Loaded && /* @__PURE__ */ W(ae, {
291
+ variant: oe.Rectangular,
324
292
  width: "100%",
325
293
  height: "100%",
326
- active: w === Q.Loading,
327
- overlay: /* @__PURE__ */ K(U, {
328
- size: W.LG,
329
- className: p?.placeholderIconClassName ?? "text-secondary",
294
+ active: w === X.Loading,
295
+ overlay: /* @__PURE__ */ W(H, {
296
+ size: U.LG,
297
+ className: J.typeText,
330
298
  "aria-hidden": !0
331
299
  }),
332
300
  className: "absolute inset-0 rounded-xl"
333
301
  }),
334
- /* @__PURE__ */ K("img", {
302
+ /* @__PURE__ */ W("img", {
335
303
  ref: C,
336
304
  src: _,
337
305
  alt: g,
338
306
  loading: "lazy",
339
307
  decoding: "async",
340
- className: o("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === Q.Loaded ? "opacity-100" : "opacity-0")
308
+ className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === X.Loaded ? "opacity-100" : "opacity-0")
341
309
  })
342
310
  ]
343
311
  })
344
312
  });
345
- }, Me = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: o, onClick: s, onDownload: c, labels: l, styles: d }) => {
346
- let { colors: f } = d ?? {}, p = e.type === t.Pasted, m = p && o !== void 0, h = a({
347
- "--ci-tile-bg": f?.background,
348
- "--ci-tile-border": f?.border,
349
- "--ci-tile-border-hover": f?.borderHover,
350
- "--ci-tile-focus-outline": f?.focusOutline,
351
- "--ci-tile-bg-error": f?.backgroundError,
352
- "--ci-tile-border-error": f?.borderError,
353
- "--ci-tile-error-text": f?.errorText,
354
- "--ci-tile-name-text": f?.nameText,
355
- "--ci-tile-type-text": f?.typeText,
356
- "--ci-tile-hover-icon-bg": f?.hoverIconBackground,
357
- "--ci-tile-hover-icon-color": f?.hoverIconColor,
358
- "--ci-tile-track-bg": f?.trackBackground,
359
- "--ci-tile-fill-bg": f?.fillBackground
360
- }), { isImage: g, isAudio: _, isLink: v } = u(() => Y(e), [e]);
361
- return _ ? /* @__PURE__ */ K(De, {
362
- attachment: e,
363
- labels: l,
364
- onClick: s,
365
- searchQuery: n,
366
- styles: d,
367
- cssVars: h
368
- }) : g ? /* @__PURE__ */ K(je, {
313
+ }, Z = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: u, styles: d, isSelected: f }) => {
314
+ let { colors: p } = d ?? {}, m = e.type === t.Pasted, h = m && o !== void 0, g = i({
315
+ "--ai-tile-bg": p?.background,
316
+ "--ai-tile-border": p?.border,
317
+ "--ai-tile-bg-hover": p?.backgroundHover,
318
+ "--ai-tile-border-hover": p?.borderHover,
319
+ "--ai-tile-bg-selected": p?.backgroundSelected,
320
+ "--ai-tile-border-selected": p?.borderSelected,
321
+ "--ai-tile-focus-outline": p?.focusOutline,
322
+ "--ai-tile-bg-error": p?.backgroundError,
323
+ "--ai-tile-border-error": p?.borderError,
324
+ "--ai-tile-error-text": p?.errorText,
325
+ "--ai-tile-name-text": p?.nameText,
326
+ "--ai-tile-type-text": p?.typeText,
327
+ "--ai-tile-hover-icon-bg": p?.hoverIconBackground,
328
+ "--ai-tile-hover-icon-color": p?.hoverIconColor,
329
+ "--ai-tile-progress-track": p?.trackBackground
330
+ }), { isImage: _, isLink: v } = l(() => q(e), [e]);
331
+ return _ ? /* @__PURE__ */ W(Ae, {
369
332
  attachment: e,
370
- labels: l,
333
+ labels: u,
371
334
  onClick: s,
372
335
  onExpand: o,
373
336
  styles: d,
374
337
  onRemove: r,
375
- cssVars: h,
376
- onDownload: c
377
- }) : /* @__PURE__ */ K(ke, {
338
+ cssVars: g,
339
+ onDownload: c,
340
+ isSelected: f
341
+ }) : /* @__PURE__ */ W(Oe, {
378
342
  attachment: e,
343
+ searchQuery: n,
379
344
  onClick: s,
380
- onRetry: i,
345
+ onRetry: a,
381
346
  onRemove: r,
382
347
  onDownload: c,
383
348
  isLink: v,
384
- isPasted: p,
349
+ isPasted: m,
385
350
  styles: d,
386
- labels: l,
351
+ labels: u,
387
352
  onExpand: o,
388
- cssVars: h,
389
- isExpandable: m
353
+ cssVars: g,
354
+ isExpandable: h,
355
+ isSelected: f
390
356
  });
391
- }, Ne = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a, styles: s }) => {
392
- let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = a ?? {}, { className: f } = s ?? {};
393
- return e.length === 0 ? null : /* @__PURE__ */ K("div", {
357
+ }, je = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: o, styles: s }) => {
358
+ let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = o ?? {}, { className: f } = s ?? {};
359
+ return e.length === 0 ? null : /* @__PURE__ */ W("div", {
394
360
  role: "list",
395
361
  "aria-label": c,
396
- className: o("flex w-full min-w-0 gap-2 overflow-x-auto", f),
397
- children: e.map((e) => /* @__PURE__ */ K("div", {
362
+ className: a("flex w-full min-w-0 gap-2 overflow-x-auto", f),
363
+ children: e.map((e) => /* @__PURE__ */ W("div", {
398
364
  role: "listitem",
399
- children: /* @__PURE__ */ K(Me, {
365
+ children: /* @__PURE__ */ W(Z, {
400
366
  attachment: e,
401
367
  onRemove: t,
402
368
  onRetry: n,
@@ -410,200 +376,151 @@ var ue = 5, de = 4, fe = "flex size-[84px] items-center justify-center rounded-x
410
376
  })
411
377
  }, e.id))
412
378
  });
413
- }, Pe = { tile: "_tile_nzsrz_1" }, Fe = ({ count: e, onClick: t, labels: n, children: r, styles: i }) => {
414
- let { ariaLabel: s } = n ?? {}, { typography: { fontClassName: c = "dial-small-semi-text" } = {}, className: l, colors: u } = i ?? {}, d = a({
415
- "--ci-more-tile-bg": u?.background,
416
- "--ci-more-tile-border": u?.border,
417
- "--ci-more-tile-color": u?.color,
418
- "--ci-more-tile-bg-hover": u?.backgroundHover,
419
- "--ci-more-tile-color-hover": u?.colorHover,
420
- "--ci-more-tile-border-hover": u?.borderHover,
421
- "--ci-more-tile-focus-outline": u?.focusOutline
422
- });
423
- return /* @__PURE__ */ K("button", {
424
- type: "button",
425
- onClick: t,
426
- "aria-label": s ?? `Show ${e} more attachments`,
427
- style: d,
428
- className: o(fe, c, Pe.tile, l),
429
- children: r ?? /* @__PURE__ */ K("bdi", {
430
- dir: "ltr",
431
- children: `+${e}`
432
- })
433
- });
434
- }, $ = {
435
- container: "_container_7fktb_1",
436
- headerIcon: "_headerIcon_7fktb_6",
437
- headerLabel: "_headerLabel_7fktb_7",
438
- downloadAllButton: "_downloadAllButton_7fktb_8",
439
- imageTile: "_imageTile_7fktb_12"
440
- }, Ie = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Le = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: s, labels: c, styles: l }) => {
441
- let { ariaLabel: d = "Attachments", clickLabel: m = "Download attachment", retryLabel: g = "Retry upload", showLessLabel: v = "Show less", downloadAllLabel: y = "Download all", openInNewTabLabel: b, getHeaderLabel: x = (e) => Ie(e, "attachment"), promptLabel: S, pastedLabel: C, imageLabel: w } = c ?? {}, { typography: { headerLabelClassName: T = "dial-tiny-semi-text" } = {}, colors: E, className: D } = l ?? {}, O = a({
442
- "--ci-group-bg": E?.background,
443
- "--ci-group-border": E?.border,
444
- "--ci-group-text": E?.text
445
- }), [k, A] = f(!1), j = u(() => Se(e.length, k), [e.length, k]);
379
+ }, Q = {
380
+ headerIcon: "_headerIcon_1dmgi_1",
381
+ headerLabel: "_headerLabel_1dmgi_2"
382
+ }, Me = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ne = ({ attachments: e, onAttachmentClick: n, onDownloadAll: o, onRetry: s, labels: c, styles: l, selectedAttachmentId: u }) => {
383
+ let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => Me(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = c ?? {}, { typography: S, colors: C, className: w } = l ?? {}, T = i({ "--ai-group-text": C?.text });
446
384
  if (e.length === 0) return null;
447
- let M = e.some((e) => e.type === t.Image), N = e.some((e) => e.type !== t.Image), P = M && N, F = e.length >= 5, I = P ? H : M ? U : _, L = x(e.length), R = e.slice(0, j.visibleCount), z = () => {
448
- let t = e.filter((e) => e.status === i.Idle);
449
- r ? r(t) : t.forEach((e) => n?.(e.id));
450
- }, B = (t) => {
385
+ let E = e.some((e) => e.type === t.Image), D = e.some((e) => e.type !== t.Image), O = E && D, k = e.length >= 5, A = O ? V : E ? H : h, j = v(e.length), M = () => {
386
+ let t = e.filter((e) => e.status === r.Idle);
387
+ o ? o(t) : t.forEach((e) => n?.(e.id));
388
+ }, N = (t) => {
451
389
  let n = e.find((e) => e.id === t);
452
- n && r?.([n]);
390
+ n && o?.([n]);
453
391
  };
454
- return /* @__PURE__ */ q("div", {
392
+ return /* @__PURE__ */ G("div", {
455
393
  role: "group",
456
394
  "aria-label": d,
457
- style: O,
458
- className: o("rounded-2xl border p-3", F ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, D),
459
- children: [/* @__PURE__ */ q("div", {
460
- className: "mb-3 flex min-h-6 items-center gap-2",
461
- children: [
462
- /* @__PURE__ */ K(I, {
463
- size: W.SM,
464
- className: o("shrink-0", $.headerIcon),
395
+ style: T,
396
+ className: a("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Q.container, w),
397
+ children: [/* @__PURE__ */ G("div", {
398
+ className: "flex items-center justify-between",
399
+ children: [/* @__PURE__ */ G("div", {
400
+ className: "flex items-center gap-1",
401
+ children: [/* @__PURE__ */ W(A, {
402
+ size: U.SM,
403
+ className: a("shrink-0", Q.headerIcon),
404
+ "aria-hidden": !0
405
+ }), /* @__PURE__ */ W("span", {
406
+ className: a(S?.headerLabelClassName ?? "dial-tiny-semi-text", Q.headerLabel),
407
+ children: j
408
+ })]
409
+ }), e.length >= 2 && (o || n) && /* @__PURE__ */ W(le, {
410
+ icon: /* @__PURE__ */ W(p, {
411
+ size: U.SM,
465
412
  "aria-hidden": !0
466
413
  }),
467
- /* @__PURE__ */ K("span", {
468
- className: o(T, $.headerLabel),
469
- children: L
470
- }),
471
- e.length >= 2 && (r || n) && /* @__PURE__ */ K(oe, {
472
- icon: /* @__PURE__ */ K(h, {
473
- size: W.SM,
474
- "aria-hidden": !0
475
- }),
476
- className: o("ms-auto h-6 w-6 rounded-lg", $.downloadAllButton),
477
- "aria-label": y,
478
- onClick: z
479
- })
480
- ]
481
- }), /* @__PURE__ */ q("div", {
414
+ size: ce.Small,
415
+ "aria-label": g,
416
+ onClick: M
417
+ })]
418
+ }), /* @__PURE__ */ W("div", {
482
419
  role: "list",
483
- "aria-label": L,
484
- className: o("gap-3", F ? "grid grid-cols-[repeat(5,83px)] overflow-x-auto" : "flex flex-wrap"),
485
- children: [
486
- R.map((e) => /* @__PURE__ */ K("div", {
487
- role: "listitem",
488
- children: /* @__PURE__ */ K(Me, {
489
- attachment: e,
490
- onClick: n,
491
- onDownload: B,
492
- onRetry: s,
493
- labels: {
494
- clickLabel: m,
495
- retryLabel: g,
496
- promptLabel: S,
497
- pastedLabel: C,
498
- imageLabel: w,
499
- openInNewTabLabel: b
500
- }
501
- })
502
- }, e.id)),
503
- j.layout === J.Collapsed && /* @__PURE__ */ K("div", {
504
- role: "listitem",
505
- children: /* @__PURE__ */ K(Fe, {
506
- count: j.hiddenCount,
507
- onClick: () => A(!0)
508
- })
509
- }),
510
- F && k && /* @__PURE__ */ K("div", {
511
- role: "listitem",
512
- children: /* @__PURE__ */ K(Fe, {
513
- count: 0,
514
- onClick: () => A(!1),
515
- labels: { ariaLabel: v },
516
- children: /* @__PURE__ */ K(p, {
517
- size: W.MD,
518
- "aria-hidden": !0
519
- })
520
- })
420
+ "aria-label": j,
421
+ className: a("gap-3", k ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
422
+ children: e.map((e, t) => /* @__PURE__ */ W("div", {
423
+ role: "listitem",
424
+ children: /* @__PURE__ */ W(Z, {
425
+ attachment: e,
426
+ onClick: n,
427
+ onDownload: N,
428
+ onRetry: s,
429
+ labels: {
430
+ clickLabel: f,
431
+ retryLabel: m,
432
+ promptLabel: y,
433
+ pastedLabel: b,
434
+ imageLabel: x,
435
+ openInNewTabLabel: _
436
+ },
437
+ isSelected: e.id === u
521
438
  })
522
- ]
439
+ }, `${e.id}-${t}`))
523
440
  })]
524
441
  });
525
- }, Re = {
526
- overlay: "_overlay_1f3nw_1",
527
- icon: "_icon_1f3nw_5",
528
- deniedIcon: "_deniedIcon_1f3nw_9"
529
- }, ze = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
530
- let { title: i, subtitle: s } = n ?? {}, { colors: c, typography: l } = r ?? {};
442
+ }, $ = {
443
+ overlay: "_overlay_mzpdp_1",
444
+ icon: "_icon_mzpdp_5",
445
+ deniedIcon: "_deniedIcon_mzpdp_9"
446
+ }, Pe = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
447
+ let { title: o, subtitle: s } = n ?? {}, { colors: c, typography: l } = r ?? {};
531
448
  if (!e) return null;
532
- let u = a({
533
- "--fd-bg": c?.background,
534
- "--fd-icon": c?.icon,
535
- "--fd-denied-icon": c?.deniedIcon
536
- }), d = i ?? (t ? "Attach files" : "No attachments allowed"), f = s ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), p = t ? Re.icon : Re.deniedIcon, m = (e) => {
449
+ let u = i({
450
+ "--ai-fd-bg": c?.background,
451
+ "--ai-fd-icon": c?.icon,
452
+ "--ai-fd-denied-icon": c?.deniedIcon
453
+ }), d = o ?? (t ? "Attach files" : "No attachments allowed"), f = s ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), p = t ? $.icon : $.deniedIcon, m = (e) => {
537
454
  e.preventDefault();
538
- }, h = t ? v : ee;
539
- return /* @__PURE__ */ K("div", {
455
+ }, h = t ? g : B;
456
+ return /* @__PURE__ */ W("div", {
540
457
  role: "status",
541
458
  "aria-live": "polite",
542
- className: o("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", Re.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
459
+ className: a("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", $.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
543
460
  onDragOver: t ? void 0 : m,
544
461
  onDrop: t ? void 0 : m,
545
462
  style: u,
546
- children: /* @__PURE__ */ q("div", {
463
+ children: /* @__PURE__ */ G("div", {
547
464
  className: "flex flex-col items-center text-center",
548
465
  children: [
549
- /* @__PURE__ */ K(h, {
466
+ /* @__PURE__ */ W(h, {
550
467
  size: 100,
551
468
  className: p,
552
469
  "aria-hidden": !0
553
470
  }),
554
- /* @__PURE__ */ K("span", {
555
- className: o("mt-5", l?.titleClassName ?? "dial-h3-text"),
471
+ /* @__PURE__ */ W("span", {
472
+ className: a("mt-5", l?.titleClassName ?? "dial-h3-text"),
556
473
  children: d
557
474
  }),
558
- /* @__PURE__ */ K("span", {
559
- className: o("mt-4", l?.subtitleClassName ?? "dial-small-text"),
475
+ /* @__PURE__ */ W("span", {
476
+ className: a("mt-4", l?.subtitleClassName ?? "dial-small-text"),
560
477
  children: f
561
478
  })
562
479
  ]
563
480
  })
564
481
  });
565
- }, Be = (e, n, r = {}) => {
566
- let { screenshotName: a = "Screenshot.png", pastedTextName: o = "Pasted text" } = r;
567
- return { handlePaste: s((r) => {
568
- if (!r.clipboardData) return;
569
- let s = Array.from(r.clipboardData.items).filter((e) => e.kind === "file" && e.type.startsWith("image/")), c = r.clipboardData.getData("text/plain").length > 0;
570
- if (s.length > 0 && !c) {
482
+ }, Fe = (e, n, i = {}) => {
483
+ let { screenshotName: a = "Screenshot.png", pastedTextName: s = "Pasted text" } = i;
484
+ return { handlePaste: o((i) => {
485
+ if (!i.clipboardData) return;
486
+ let o = Array.from(i.clipboardData.items).filter((e) => e.kind === "file" && e.type.startsWith("image/")), c = i.clipboardData.getData("text/plain").length > 0;
487
+ if (o.length > 0 && !c) {
571
488
  let n = [];
572
- for (let e of s) {
573
- let r = e.getAsFile();
574
- if (!r) continue;
575
- let o = new File([r], a, { type: r.type }), s = {
576
- id: pe(),
489
+ for (let e of o) {
490
+ let i = e.getAsFile();
491
+ if (!i) continue;
492
+ let o = new File([i], a, { type: i.type }), s = {
493
+ id: K(),
577
494
  name: a,
578
- contentType: r.type,
495
+ contentType: i.type,
579
496
  file: o,
580
497
  type: t.Image,
581
- status: i.Idle,
498
+ status: r.Idle,
582
499
  previewUrl: URL.createObjectURL(o)
583
500
  };
584
501
  n.push(s);
585
502
  }
586
- r.preventDefault(), e(n);
503
+ i.preventDefault(), e(n);
587
504
  return;
588
505
  }
589
- let l = r.clipboardData.getData("text/plain");
506
+ let l = i.clipboardData.getData("text/plain");
590
507
  if (l.length > n) {
591
- let n = l.trim(), a = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || o, s = new File([l], a, { type: "text/plain" }), c = {
592
- id: pe(),
508
+ let n = l.trim(), a = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || s, o = new File([l], a, { type: "text/plain" }), c = {
509
+ id: K(),
593
510
  name: a,
594
511
  contentType: "text/plain",
595
- file: s,
512
+ file: o,
596
513
  type: t.Pasted,
597
- status: i.Idle
514
+ status: r.Idle
598
515
  };
599
- r.preventDefault(), e([c]);
516
+ i.preventDefault(), e([c]);
600
517
  }
601
518
  }, [
602
519
  e,
603
520
  n,
604
521
  a,
605
- o
522
+ s
606
523
  ]) };
607
- }, Ve = 100;
524
+ }, Ie = 100;
608
525
  //#endregion
609
- export { de as ATTACHMENT_COLLAPSED_VISIBLE_COUNT, ue as ATTACHMENT_COLLAPSE_THRESHOLD, Me as AttachmentCard, Le as AttachmentGroup, Fe as AttachmentMoreTile, J as AttachmentTilesLayout, Ne as AttachmentTray, ze as FileDndOverlay, Q as LazyImageLoadStatus, Ve as MAX_UPLOADS_PER_MINUTE, pe as generateAttachmentId, Y as getAttachmentCardState, ve as getAttachmentIcon, Se as getAttachmentTilesPlan, be as getExtFromContentType, me as getNameWithoutExtension, _e as isMimeTypeAllowed, ge as mimeTypesToExtensionLabels, Be as useClipboardPaste, Ae as useLazyImageLoad };
526
+ export { xe as ATTACHMENT_COLLAPSE_THRESHOLD, Z as AttachmentCard, Ne as AttachmentGroup, je as AttachmentTray, Pe as FileDndOverlay, X as LazyImageLoadStatus, Ie as MAX_UPLOADS_PER_MINUTE, K as generateAttachmentId, q as getAttachmentCardState, _e as getAttachmentIcon, ye as getExtFromContentType, pe as getNameWithoutExtension, ge as isMimeTypeAllowed, he as mimeTypesToExtensionLabels, Fe as useClipboardPaste, ke as useLazyImageLoad };