@epam/ai-dial-attachment-input 1.1.0-dev.23 → 1.1.0-dev.230

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