@epam/ai-dial-attachment-input 1.0.0-dev.503 → 1.0.0-dev.509

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,16 +1,16 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, CodeBlockTheme as n, Highlight as r, MIME_TYPE_EXT_MAP as i, RequestStatus as a, buildCssVars as o, mergeClasses as s } from "@epam/ai-dial-chat-shared";
2
2
  import { DIAL_ICON_SIZE as c, DialGhostIconButton as l, DialSkeleton as u, DialSkeletonVariant as d, DialSpinner as f, ElementSize as p } from "@epam/ai-dial-ui-kit";
3
- import { IconChevronUp as m, IconClipboard as h, IconDownload as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as ee, IconFileTypeDocx as te, 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 V, IconPaperclip as H, IconPhoto as U, IconReload as ne, IconTerminal2 as re, IconVideo as ie, IconX as ae } from "@tabler/icons-react";
4
- import { useCallback as W, useEffect as G, useId as oe, useMemo as se, useRef as K, useState as ce } from "react";
5
- import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
3
+ import { IconChevronUp as m, IconClipboard as h, IconDownload as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as ee, IconFileTypeDocx as S, IconFileTypeHtml as C, IconFileTypeJpg as w, IconFileTypeJs as te, 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 ne, IconPaperclip as V, IconPhoto as re, IconReload as ie, IconTerminal2 as ae, IconVideo as H, IconX as oe } from "@tabler/icons-react";
4
+ import { useCallback as se, useEffect as U, useId as W, useMemo as ce, useRef as le, useState as ue } from "react";
5
+ import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
6
6
  //#region src/hooks/useLazyImageLoad.ts
7
- var le = /* @__PURE__ */ function(e) {
7
+ var J = /* @__PURE__ */ function(e) {
8
8
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
9
- }({}), ue = ({ enabled: e, src: t }) => {
10
- let n = K(null), [r, i] = ce("idle");
11
- return G(() => {
9
+ }({}), de = ({ enabled: e, src: t }) => {
10
+ let n = le(null), [r, i] = ue("idle");
11
+ return U(() => {
12
12
  i(e && t ? "loading" : "idle");
13
- }, [e, t]), G(() => {
13
+ }, [e, t]), U(() => {
14
14
  let r = n.current;
15
15
  if (!r || !e || !t) return;
16
16
  let a = () => i("loaded"), o = () => i("error");
@@ -21,7 +21,7 @@ var le = /* @__PURE__ */ function(e) {
21
21
  imageRef: n,
22
22
  imageLoadStatus: r
23
23
  };
24
- }, X = {
24
+ }, Y = {
25
25
  card: "_card_ywrb5_1",
26
26
  cardError: "_cardError_ywrb5_6",
27
27
  cardSelected: "_cardSelected_ywrb5_10",
@@ -33,9 +33,9 @@ var le = /* @__PURE__ */ function(e) {
33
33
  actionBtn: "_actionBtn_ywrb5_32",
34
34
  removeBtnImage: "_removeBtnImage_ywrb5_43",
35
35
  hoverDownloadIcon: "_hoverDownloadIcon_ywrb5_51"
36
- }, de = 5, fe = 4, Z = /* @__PURE__ */ function(e) {
36
+ }, fe = 5, pe = 4, X = /* @__PURE__ */ function(e) {
37
37
  return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
38
- }({}), pe = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, me = (e) => {
38
+ }({}), Z = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, me = (e) => {
39
39
  let t = e.lastIndexOf(".");
40
40
  return t > 0 ? e.slice(0, t) : e;
41
41
  }, he = {
@@ -61,19 +61,19 @@ var le = /* @__PURE__ */ function(e) {
61
61
  if (!e) return _;
62
62
  if (e.startsWith("image/")) switch (e) {
63
63
  case "image/jpeg":
64
- case "image/jpg": return C;
64
+ case "image/jpg": return w;
65
65
  case "image/png": return O;
66
66
  case "image/svg+xml": return M;
67
67
  case "image/bmp": return y;
68
- default: return U;
68
+ default: return re;
69
69
  }
70
- if (e.startsWith("video/")) return ie;
71
- if (e.startsWith("audio/")) return V;
70
+ if (e.startsWith("video/")) return H;
71
+ if (e.startsWith("audio/")) return ne;
72
72
  switch (e) {
73
73
  case "application/pdf": return E;
74
74
  case "application/msword":
75
75
  case "application/vnd.ms-word": return ee;
76
- case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return te;
76
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return S;
77
77
  case "application/vnd.ms-powerpoint": return k;
78
78
  case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return k;
79
79
  case "application/vnd.ms-excel": return L;
@@ -87,13 +87,13 @@ var le = /* @__PURE__ */ function(e) {
87
87
  case "text/csv": return x;
88
88
  case "text/plain": return F;
89
89
  case "text/html":
90
- case "application/xhtml+xml": return S;
90
+ case "application/xhtml+xml": return C;
91
91
  case "text/xml":
92
92
  case "application/xml": return R;
93
93
  case "application/sql":
94
94
  case "text/x-sql": return j;
95
95
  case "text/javascript":
96
- case "application/javascript": return w;
96
+ case "application/javascript": return te;
97
97
  case "text/jsx": return T;
98
98
  case "application/typescript":
99
99
  case "text/typescript": return N;
@@ -108,7 +108,7 @@ var le = /* @__PURE__ */ function(e) {
108
108
  }
109
109
  }, ye = (e) => {
110
110
  let { type: n, contentType: r } = e;
111
- return n === t.Prompt ? re : n === t.Pasted ? h : n === t.Image ? U : ve(r ?? "");
111
+ return n === t.Prompt ? ae : n === t.Pasted ? h : n === t.Image ? re : ve(r ?? "");
112
112
  }, be = (e) => {
113
113
  let t = e.toLowerCase().split(";")[0].trim(), n = i[t];
114
114
  if (n) return n;
@@ -126,7 +126,7 @@ var le = /* @__PURE__ */ function(e) {
126
126
  let o = i.lastIndexOf(".");
127
127
  return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
128
128
  }, Se = (e, n, r, i = {}) => {
129
- let { type: o, status: c, previewUrl: l, url: u } = e, d = c === a.Loading, f = c === a.Error, p = o === t.Image && !!(l ?? u) && !f, m = o === t.Audio && !f, h = s(X.card, f && X.cardError, n && X.cardSelected, !f && !n && o === t.Prompt && X.cardPrompt, !f && !n && o === t.Pasted && X.cardPasted);
129
+ let { type: o, status: c, previewUrl: l, url: u } = e, d = c === a.Loading, f = c === a.Error, p = o === t.Image && !!(l ?? u) && !f, m = o === t.Audio && !f, h = s(Y.card, f && Y.cardError, n && Y.cardSelected, !f && !n && o === t.Prompt && Y.cardPrompt, !f && !n && o === t.Pasted && Y.cardPasted);
130
130
  return {
131
131
  isLoading: d,
132
132
  isError: f,
@@ -136,77 +136,77 @@ var le = /* @__PURE__ */ function(e) {
136
136
  BottomIcon: ye(e),
137
137
  typeLabel: xe(e, i),
138
138
  cardColorClass: h,
139
- removeBtnClass: p ? X.removeBtnImage : X.actionBtn
139
+ removeBtnClass: p ? Y.removeBtnImage : Y.actionBtn
140
140
  };
141
141
  }, Ce = (e, t) => e <= 0 ? {
142
- layout: Z.None,
142
+ layout: X.None,
143
143
  visibleCount: 0,
144
144
  hiddenCount: 0
145
145
  } : e < 5 || t ? {
146
- layout: Z.AllVisible,
146
+ layout: X.AllVisible,
147
147
  visibleCount: e,
148
148
  hiddenCount: 0
149
149
  } : {
150
- layout: Z.Collapsed,
150
+ layout: X.Collapsed,
151
151
  visibleCount: 4,
152
152
  hiddenCount: e - 4
153
- }, we = ({ attachment: n, searchQuery: i = "", onRemove: a, onRetry: m, onExpand: h, onClick: _, isSelected: v, shouldAlwaysShowActions: y, labels: b, typeLabels: x, styles: ee, showHoverDownloadIcon: te = !1, className: S }) => {
154
- let { removeLabel: C = "Remove attachment", retryLabel: w = "Retry upload", clickLabel: T = "Open attachment", expandLabel: E = "Expand pasted text", loadingLabel: D = "Loading attachment", uploadFailedStatusLabel: O = "Upload failed" } = b ?? {}, { colors: k, typography: A, roundedClassName: j = "rounded-xl" } = ee ?? {}, { id: M, name: N } = n, P = n.previewUrl ?? n.url, F = n.type === t.Pasted, I = F && h !== void 0, L = se(() => F ? N : me(N), [F, N]), R = o({
155
- "--ci-card-border": k?.border,
156
- "--ci-card-bg": k?.background,
157
- "--ci-card-name": k?.nameText,
158
- "--ci-card-meta": k?.metaText,
159
- "--ci-card-border-error": k?.borderError,
160
- "--ci-card-bg-selected": k?.backgroundSelected,
161
- "--ci-card-border-selected": k?.borderSelected,
162
- "--ci-card-bg-hover": k?.backgroundHover,
163
- "--ci-loading-overlay-bg": k?.loadingOverlayBackground,
164
- "--ci-card-action-color": k?.actionColor,
165
- "--ci-card-remove-bg-hover": k?.actionBackgroundHover,
166
- "--ci-card-focus-outline": k?.focusOutline,
167
- "--ci-card-remove-bg": k?.removeBackground,
168
- "--ci-card-remove-color": k?.removeColor,
169
- "--ci-card-hover-icon-bg": k?.hoverIconBackground,
170
- "--ci-card-hover-icon-color": k?.hoverIconColor
171
- }), { isLoading: z, isError: B, isImage: V, isAudio: H, areActionsVisible: re, BottomIcon: ie, typeLabel: W, cardColorClass: G, removeBtnClass: oe } = se(() => Se(n, v ?? !1, y ?? !1, x), [
153
+ }, we = ({ attachment: n, searchQuery: i = "", onRemove: a, onRetry: m, onExpand: h, onClick: _, isSelected: v, shouldAlwaysShowActions: y, labels: b, styles: x, showHoverDownloadIcon: ee = !1 }) => {
154
+ let { removeLabel: S = "Remove attachment", retryLabel: C = "Retry upload", clickLabel: w = "Open attachment", expandLabel: te = "Expand pasted text", loadingLabel: T = "Loading attachment", uploadFailedStatusLabel: E = "Upload failed" } = b ?? {}, { colors: D, typography: O, roundedClassName: k = "rounded-xl", className: A } = x ?? {}, { id: j, name: M } = n, N = n.previewUrl ?? n.url, P = n.type === t.Pasted, F = P && h !== void 0, I = ce(() => P ? M : me(M), [P, M]), L = o({
155
+ "--ci-card-border": D?.border,
156
+ "--ci-card-bg": D?.background,
157
+ "--ci-card-name": D?.nameText,
158
+ "--ci-card-meta": D?.metaText,
159
+ "--ci-card-border-error": D?.borderError,
160
+ "--ci-card-bg-selected": D?.backgroundSelected,
161
+ "--ci-card-border-selected": D?.borderSelected,
162
+ "--ci-card-bg-hover": D?.backgroundHover,
163
+ "--ci-loading-overlay-bg": D?.loadingOverlayBackground,
164
+ "--ci-card-action-color": D?.actionColor,
165
+ "--ci-card-remove-bg-hover": D?.actionBackgroundHover,
166
+ "--ci-card-focus-outline": D?.focusOutline,
167
+ "--ci-card-remove-bg": D?.removeBackground,
168
+ "--ci-card-remove-color": D?.removeColor,
169
+ "--ci-card-hover-icon-bg": D?.hoverIconBackground,
170
+ "--ci-card-hover-icon-color": D?.hoverIconColor
171
+ }), { isLoading: R, isError: z, isImage: B, isAudio: ne, areActionsVisible: V, BottomIcon: ae, typeLabel: H, cardColorClass: se, removeBtnClass: U } = ce(() => Se(n, v ?? !1, y ?? !1, b), [
172
172
  n,
173
173
  v,
174
174
  y,
175
- x
176
- ]), K = _ !== void 0 && !I && !z && !B, ce = I || K, { imageRef: de, imageLoadStatus: fe } = ue({
177
- enabled: V,
178
- src: P
179
- }), Z = () => {
180
- I && h ? h(M) : K && _ && _(M);
181
- }, pe = (e) => {
182
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Z());
175
+ b
176
+ ]), W = _ !== void 0 && !F && !R && !z, le = F || W, { imageRef: ue, imageLoadStatus: fe } = de({
177
+ enabled: B,
178
+ src: N
179
+ }), pe = () => {
180
+ F && h ? h(j) : W && _ && _(j);
181
+ }, X = (e) => {
182
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), pe());
183
183
  };
184
- if (H) return /* @__PURE__ */ Y("div", {
185
- style: R,
186
- className: s("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", j, G, S),
187
- children: [/* @__PURE__ */ Y("div", {
184
+ if (ne) return /* @__PURE__ */ q("div", {
185
+ style: L,
186
+ className: s("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", k, se, A),
187
+ children: [/* @__PURE__ */ q("div", {
188
188
  className: "flex items-center justify-between gap-2",
189
- children: [/* @__PURE__ */ J("span", {
189
+ children: [/* @__PURE__ */ K("span", {
190
190
  title: n.name,
191
- className: s(A?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.name),
192
- children: i ? /* @__PURE__ */ J(r, {
191
+ className: s(O?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.name),
192
+ children: i ? /* @__PURE__ */ K(r, {
193
193
  text: n.name,
194
194
  query: i,
195
195
  maxLines: 1
196
196
  }) : n.name
197
- }), _ && /* @__PURE__ */ J(l, {
198
- icon: /* @__PURE__ */ J(g, {
197
+ }), _ && /* @__PURE__ */ K(l, {
198
+ icon: /* @__PURE__ */ K(g, {
199
199
  size: c.SM,
200
200
  "aria-hidden": !0
201
201
  }),
202
202
  size: p.Small,
203
- className: s("h-6 w-6 shrink-0 rounded", oe),
204
- "aria-label": T,
203
+ className: s("h-6 w-6 shrink-0 rounded", U),
204
+ "aria-label": w,
205
205
  onClick: (e) => {
206
- e.stopPropagation(), _(M);
206
+ e.stopPropagation(), _(j);
207
207
  }
208
208
  })]
209
- }), n.playUrl && /* @__PURE__ */ J("audio", {
209
+ }), n.playUrl && /* @__PURE__ */ K("audio", {
210
210
  controls: !0,
211
211
  src: n.playUrl,
212
212
  "aria-label": n.name,
@@ -214,145 +214,145 @@ var le = /* @__PURE__ */ function(e) {
214
214
  preload: "metadata"
215
215
  })]
216
216
  });
217
- let he = s("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", j, G, !V && "flex-col gap-3 p-3", ce && "cursor-pointer", S), ge = /* @__PURE__ */ Y(q, { children: [
218
- V ? /* @__PURE__ */ Y("div", {
217
+ let Z = s("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", k, se, !B && "flex-col gap-3 p-3", le && "cursor-pointer", A), he = /* @__PURE__ */ q(G, { children: [
218
+ B ? /* @__PURE__ */ q("div", {
219
219
  className: "relative h-full w-full overflow-hidden",
220
- children: [fe !== le.Loaded && /* @__PURE__ */ J(u, {
220
+ children: [fe !== J.Loaded && /* @__PURE__ */ K(u, {
221
221
  variant: d.Rectangular,
222
222
  width: "100%",
223
223
  height: "100%",
224
- active: fe === le.Loading,
225
- overlay: /* @__PURE__ */ J(U, {
224
+ active: fe === J.Loading,
225
+ overlay: /* @__PURE__ */ K(re, {
226
226
  size: c.LG,
227
- className: A?.placeholderIconClassName ?? "text-secondary",
227
+ className: O?.placeholderIconClassName ?? "text-secondary",
228
228
  "aria-hidden": !0
229
229
  }),
230
- className: s("absolute inset-0", j)
231
- }), /* @__PURE__ */ J("img", {
232
- ref: de,
233
- src: P,
234
- alt: N,
230
+ className: s("absolute inset-0", k)
231
+ }), /* @__PURE__ */ K("img", {
232
+ ref: ue,
233
+ src: N,
234
+ alt: M,
235
235
  loading: "lazy",
236
236
  decoding: "async",
237
- className: s("h-full w-full object-cover transition-opacity duration-200", fe === le.Loaded ? "opacity-100" : "opacity-0", j)
237
+ className: s("h-full w-full object-cover transition-opacity duration-200", fe === J.Loaded ? "opacity-100" : "opacity-0", k)
238
238
  })]
239
- }) : B ? /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y("div", {
239
+ }) : z ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q("div", {
240
240
  className: "flex flex-row items-center gap-1 overflow-hidden",
241
- children: [/* @__PURE__ */ J(ie, {
241
+ children: [/* @__PURE__ */ K(ae, {
242
242
  size: c.SM,
243
- className: s("shrink-0", X.meta),
243
+ className: s("shrink-0", Y.meta),
244
244
  "aria-hidden": !0
245
- }), /* @__PURE__ */ J("span", {
246
- title: W,
247
- className: s(A?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
248
- children: W
245
+ }), /* @__PURE__ */ K("span", {
246
+ title: H,
247
+ className: s(O?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.meta),
248
+ children: H
249
249
  })]
250
- }), /* @__PURE__ */ J("div", {
250
+ }), /* @__PURE__ */ K("div", {
251
251
  className: "min-w-0 flex-1",
252
- children: /* @__PURE__ */ J("div", {
253
- title: L,
254
- className: s(A?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", X.name),
255
- children: i ? /* @__PURE__ */ J(r, {
256
- text: L,
252
+ children: /* @__PURE__ */ K("div", {
253
+ title: I,
254
+ className: s(O?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", Y.name),
255
+ children: i ? /* @__PURE__ */ K(r, {
256
+ text: I,
257
257
  query: i,
258
258
  maxLines: 3
259
- }) : L
259
+ }) : I
260
260
  })
261
- })] }) : /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("div", {
261
+ })] }) : /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("div", {
262
262
  className: "min-w-0 flex-1",
263
- children: /* @__PURE__ */ J("div", {
264
- title: L,
265
- className: s(A?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", X.name),
266
- children: i ? /* @__PURE__ */ J(r, {
267
- text: L,
263
+ children: /* @__PURE__ */ K("div", {
264
+ title: I,
265
+ className: s(O?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", Y.name),
266
+ children: i ? /* @__PURE__ */ K(r, {
267
+ text: I,
268
268
  query: i,
269
269
  maxLines: 3
270
- }) : L
270
+ }) : I
271
271
  })
272
- }), /* @__PURE__ */ Y("div", {
272
+ }), /* @__PURE__ */ q("div", {
273
273
  className: "flex flex-row items-center gap-1 overflow-hidden",
274
- children: [/* @__PURE__ */ J(ie, {
274
+ children: [/* @__PURE__ */ K(ae, {
275
275
  size: c.SM,
276
- className: s("shrink-0", X.meta),
276
+ className: s("shrink-0", Y.meta),
277
277
  "aria-hidden": !0
278
- }), /* @__PURE__ */ J("span", {
279
- title: W,
280
- className: s(A?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
281
- children: W
278
+ }), /* @__PURE__ */ K("span", {
279
+ title: H,
280
+ className: s(O?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.meta),
281
+ children: H
282
282
  })]
283
283
  })] }),
284
- z && /* @__PURE__ */ J("span", {
285
- className: s("absolute inset-0 flex items-center justify-center", j, X.loadingOverlay),
286
- children: /* @__PURE__ */ J(f, {
284
+ R && /* @__PURE__ */ K("span", {
285
+ className: s("absolute inset-0 flex items-center justify-center", k, Y.loadingOverlay),
286
+ children: /* @__PURE__ */ K(f, {
287
287
  size: 40,
288
- ariaLabel: D,
288
+ ariaLabel: T,
289
289
  className: "z-50"
290
290
  })
291
291
  }),
292
- /* @__PURE__ */ J("span", {
292
+ /* @__PURE__ */ K("span", {
293
293
  role: "status",
294
294
  "aria-live": "polite",
295
295
  className: "sr-only",
296
- children: B ? O : ""
296
+ children: z ? E : ""
297
297
  }),
298
- !z && /* @__PURE__ */ Y("div", {
299
- className: s("absolute end-1 top-1 flex gap-1 transition-opacity", re ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
298
+ !R && /* @__PURE__ */ q("div", {
299
+ className: s("absolute end-1 top-1 flex gap-1 transition-opacity", V ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
300
300
  children: [
301
- B && m && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ J(l, {
302
- icon: /* @__PURE__ */ J(ne, {
301
+ z && m && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ K(l, {
302
+ icon: /* @__PURE__ */ K(ie, {
303
303
  size: c.SM,
304
304
  "aria-hidden": !0
305
305
  }),
306
306
  size: p.Small,
307
- className: s("h-6 w-6 rounded", oe),
308
- "aria-label": w,
307
+ className: s("h-6 w-6 rounded", U),
308
+ "aria-label": C,
309
309
  onClick: (e) => {
310
- e.stopPropagation(), m(M);
310
+ e.stopPropagation(), m(j);
311
311
  }
312
312
  }),
313
- a && /* @__PURE__ */ J(l, {
314
- icon: /* @__PURE__ */ J(ae, {
313
+ a && /* @__PURE__ */ K(l, {
314
+ icon: /* @__PURE__ */ K(oe, {
315
315
  size: c.SM,
316
316
  "aria-hidden": !0
317
317
  }),
318
318
  size: p.Small,
319
- className: s("h-6 w-6 rounded", oe),
320
- "aria-label": C,
319
+ className: s("h-6 w-6 rounded", U),
320
+ "aria-label": S,
321
321
  onClick: (e) => {
322
- e.stopPropagation(), a?.(M);
322
+ e.stopPropagation(), a?.(j);
323
323
  }
324
324
  }),
325
- te && !a && !B && /* @__PURE__ */ J(g, {
325
+ ee && !a && !z && /* @__PURE__ */ K(g, {
326
326
  size: c.SM,
327
327
  "aria-hidden": !0,
328
- className: s("h-6 w-6 rounded-lg p-1", X.hoverDownloadIcon)
328
+ className: s("h-6 w-6 rounded-lg p-1", Y.hoverDownloadIcon)
329
329
  })
330
330
  ]
331
331
  })
332
332
  ] });
333
- return ce ? /* @__PURE__ */ J("div", {
334
- style: R,
335
- className: he,
336
- onClick: Z,
337
- onKeyDown: pe,
333
+ return le ? /* @__PURE__ */ K("div", {
334
+ style: L,
335
+ className: Z,
336
+ onClick: pe,
337
+ onKeyDown: X,
338
338
  tabIndex: 0,
339
339
  role: "button",
340
- "aria-label": K ? T : I ? E : void 0,
341
- children: ge
342
- }) : /* @__PURE__ */ J("div", {
343
- style: R,
344
- className: he,
345
- children: ge
340
+ "aria-label": W ? w : F ? te : void 0,
341
+ children: he
342
+ }) : /* @__PURE__ */ K("div", {
343
+ style: L,
344
+ className: Z,
345
+ children: he
346
346
  });
347
- }, Te = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a, className: o }) => {
348
- let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = a ?? {};
349
- return e.length === 0 ? null : /* @__PURE__ */ J("div", {
347
+ }, Te = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a, styles: o }) => {
348
+ let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = a ?? {}, { className: f } = o ?? {};
349
+ return e.length === 0 ? null : /* @__PURE__ */ K("div", {
350
350
  role: "list",
351
351
  "aria-label": c,
352
- className: s("flex w-full min-w-0 gap-2 overflow-x-auto", o),
353
- children: e.map((e) => /* @__PURE__ */ J("div", {
352
+ className: s("flex w-full min-w-0 gap-2 overflow-x-auto", f),
353
+ children: e.map((e) => /* @__PURE__ */ K("div", {
354
354
  role: "listitem",
355
- children: /* @__PURE__ */ J(we, {
355
+ children: /* @__PURE__ */ K(we, {
356
356
  attachment: e,
357
357
  onRemove: t,
358
358
  onRetry: n,
@@ -380,111 +380,111 @@ var le = /* @__PURE__ */ function(e) {
380
380
  }, Ee = {
381
381
  [e.Network]: "Upload failed · network error",
382
382
  [e.UnsupportedType]: "Upload failed · unsupported file type"
383
- }, De = ({ attachment: t, onClick: r, onRetry: i, labels: u, typeLabels: d, styles: f, theme: m = n.Dark, className: h }) => {
384
- let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: y, uploadingLabel: b = "Uploading", errorReasonLabels: x, genericErrorLabel: ee = "Upload failed" } = u ?? {}, { nameClassName: te = "dial-caption-text", metaClassName: S = "dial-caption-text", colors: C } = f ?? {}, w = o({
385
- "--ci-tile-bg": C?.background,
386
- "--ci-tile-border": C?.border,
387
- "--ci-tile-border-hover": C?.borderHover,
388
- "--ci-tile-focus-outline": C?.focusOutline,
389
- "--ci-tile-bg-error": C?.backgroundError,
390
- "--ci-tile-border-error": C?.borderError,
391
- "--ci-tile-error-text": C?.errorText,
392
- "--ci-tile-name-text": C?.nameText,
393
- "--ci-tile-type-text": C?.typeText,
394
- "--ci-tile-hover-icon-bg": C?.hoverIconBackground,
395
- "--ci-tile-hover-icon-color": C?.hoverIconColor,
396
- "--ci-tile-track-bg": C?.trackBackground,
397
- "--ci-tile-fill-bg": C?.fillBackground
398
- }), { id: T, name: E, status: D, errorReason: O } = t, k = D === a.Loading, A = D === a.Error, j = oe(), M = A && (O && (x?.[O] ?? Ee[O]) || ee), { BottomIcon: N, typeLabel: P } = Se(t, !1, !1, d), F = !A && !k && r !== void 0, I = A && !!i && O !== e.UnsupportedType, L = F || I ? "pe-5" : void 0, R = () => {
399
- F && r?.(t);
400
- }, z = (e) => {
401
- (e.key === "Enter" || e.key === " ") && F && (e.preventDefault(), R());
402
- }, B = s("group relative flex size-[84px] flex-col justify-between gap-1 overflow-hidden rounded-xl border p-1.5", Q.tile, !A && m === n.Light && Q.tileLight, A && Q.tileError), V = /* @__PURE__ */ J("div", {
403
- title: E,
404
- className: s(te, "line-clamp-2 min-w-0 break-words", Q.nameText, !A && L),
405
- children: E
406
- }), H = /* @__PURE__ */ Y("div", {
407
- className: s("flex items-center gap-1 overflow-hidden", A && L),
408
- children: [/* @__PURE__ */ J(N, {
383
+ }, De = ({ attachment: t, onClick: r, onRetry: i, labels: u, styles: d, theme: f = n.Dark }) => {
384
+ let { clickLabel: m = "Download attachment", retryLabel: h = "Retry upload", sizeLabel: _, uploadingLabel: v = "Uploading", errorReasonLabels: y, genericErrorLabel: b = "Upload failed" } = u ?? {}, { typography: { nameClassName: x = "dial-caption-text", metaClassName: ee = "dial-caption-text" } = {}, colors: S, className: C } = d ?? {}, w = o({
385
+ "--ci-tile-bg": S?.background,
386
+ "--ci-tile-border": S?.border,
387
+ "--ci-tile-border-hover": S?.borderHover,
388
+ "--ci-tile-focus-outline": S?.focusOutline,
389
+ "--ci-tile-bg-error": S?.backgroundError,
390
+ "--ci-tile-border-error": S?.borderError,
391
+ "--ci-tile-error-text": S?.errorText,
392
+ "--ci-tile-name-text": S?.nameText,
393
+ "--ci-tile-type-text": S?.typeText,
394
+ "--ci-tile-hover-icon-bg": S?.hoverIconBackground,
395
+ "--ci-tile-hover-icon-color": S?.hoverIconColor,
396
+ "--ci-tile-track-bg": S?.trackBackground,
397
+ "--ci-tile-fill-bg": S?.fillBackground
398
+ }), { id: te, name: T, status: E, errorReason: D } = t, O = E === a.Loading, k = E === a.Error, A = W(), j = k && (D && (y?.[D] ?? Ee[D]) || b), { BottomIcon: M, typeLabel: N } = Se(t, !1, !1, u), P = !k && !O && r !== void 0, F = k && !!i && D !== e.UnsupportedType, I = P || F ? "pe-5" : void 0, L = () => {
399
+ P && r?.(t);
400
+ }, R = (e) => {
401
+ (e.key === "Enter" || e.key === " ") && P && (e.preventDefault(), L());
402
+ }, z = s("group relative flex size-[84px] flex-col justify-between gap-1 overflow-hidden rounded-xl border p-1.5", Q.tile, !k && f === n.Light && Q.tileLight, k && Q.tileError), B = /* @__PURE__ */ K("div", {
403
+ title: T,
404
+ className: s(x, "line-clamp-2 min-w-0 break-words", Q.nameText, !k && I),
405
+ children: T
406
+ }), ne = /* @__PURE__ */ q("div", {
407
+ className: s("flex items-center gap-1 overflow-hidden", k && I),
408
+ children: [/* @__PURE__ */ K(M, {
409
409
  size: 16,
410
410
  className: Q.typeText,
411
411
  "aria-hidden": !0
412
- }), /* @__PURE__ */ J("span", {
413
- className: s(S, "truncate", Q.typeText),
414
- children: y ? `${P} · ${y}` : P
412
+ }), /* @__PURE__ */ K("span", {
413
+ className: s(ee, "truncate", Q.typeText),
414
+ children: _ ? `${N} · ${_}` : N
415
415
  })]
416
- }), U = /* @__PURE__ */ Y(q, { children: [
417
- A ? /* @__PURE__ */ Y(q, { children: [H, V] }) : /* @__PURE__ */ Y(q, { children: [V, H] }),
418
- k && /* @__PURE__ */ J("div", {
416
+ }), V = /* @__PURE__ */ q(G, { children: [
417
+ k ? /* @__PURE__ */ q(G, { children: [ne, B] }) : /* @__PURE__ */ q(G, { children: [B, ne] }),
418
+ O && /* @__PURE__ */ K("div", {
419
419
  role: "progressbar",
420
- "aria-label": b,
420
+ "aria-label": v,
421
421
  className: s("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", Q.track),
422
- children: /* @__PURE__ */ J("div", { className: s("h-full w-1/3 rounded-full", Q.indeterminateFill) })
422
+ children: /* @__PURE__ */ K("div", { className: s("h-full w-1/3 rounded-full", Q.indeterminateFill) })
423
423
  }),
424
- F && /* @__PURE__ */ J(g, {
424
+ P && /* @__PURE__ */ K(g, {
425
425
  size: c.SM,
426
426
  "aria-hidden": !0,
427
427
  className: s("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)
428
428
  }),
429
- I && /* @__PURE__ */ J(l, {
430
- icon: /* @__PURE__ */ J(ne, {
429
+ F && /* @__PURE__ */ K(l, {
430
+ icon: /* @__PURE__ */ K(ie, {
431
431
  size: c.SM,
432
432
  "aria-hidden": !0
433
433
  }),
434
434
  size: p.Small,
435
435
  className: s("absolute end-1 top-1 h-6 w-6 rounded-lg", Q.retryIcon),
436
- "aria-label": v,
437
- "aria-describedby": M ? j : void 0,
436
+ "aria-label": h,
437
+ "aria-describedby": j ? A : void 0,
438
438
  onClick: (e) => {
439
- e.stopPropagation(), i(T);
439
+ e.stopPropagation(), i(te);
440
440
  }
441
441
  }),
442
- A && /* @__PURE__ */ J("span", {
443
- id: j,
442
+ k && /* @__PURE__ */ K("span", {
443
+ id: A,
444
444
  role: "status",
445
445
  "aria-live": "polite",
446
446
  className: "sr-only",
447
- children: M
447
+ children: j
448
448
  })
449
449
  ] });
450
- return /* @__PURE__ */ J("div", {
451
- className: s("inline-flex", h),
452
- children: F ? /* @__PURE__ */ J("div", {
450
+ return /* @__PURE__ */ K("div", {
451
+ className: s("inline-flex", C),
452
+ children: P ? /* @__PURE__ */ K("div", {
453
453
  role: "button",
454
454
  tabIndex: 0,
455
- "aria-label": _,
456
- onClick: R,
457
- onKeyDown: z,
455
+ "aria-label": m,
456
+ onClick: L,
457
+ onKeyDown: R,
458
458
  style: w,
459
- className: s(B, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
460
- children: U
461
- }) : /* @__PURE__ */ J("div", {
462
- className: B,
463
- title: M || void 0,
464
- role: A ? "group" : void 0,
465
- "aria-describedby": A ? j : void 0,
466
- tabIndex: A ? 0 : void 0,
459
+ className: s(z, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
460
+ children: V
461
+ }) : /* @__PURE__ */ K("div", {
462
+ className: z,
463
+ title: j || void 0,
464
+ role: k ? "group" : void 0,
465
+ "aria-describedby": k ? A : void 0,
466
+ tabIndex: k ? 0 : void 0,
467
467
  style: w,
468
- children: U
468
+ children: V
469
469
  })
470
470
  });
471
- }, Oe = { tile: "_tile_1s4d7_1" }, ke = ({ count: e, onClick: t, ariaLabel: n, children: r, fontClassName: i = "dial-small-semi-text", className: a, colors: c }) => {
472
- let l = o({
473
- "--ci-more-tile-bg": c?.background,
474
- "--ci-more-tile-border": c?.border,
475
- "--ci-more-tile-color": c?.color,
476
- "--ci-more-tile-bg-hover": c?.backgroundHover,
477
- "--ci-more-tile-color-hover": c?.colorHover,
478
- "--ci-more-tile-border-hover": c?.borderHover,
479
- "--ci-more-tile-focus-outline": c?.focusOutline
471
+ }, Oe = { tile: "_tile_1s4d7_1" }, ke = ({ count: e, onClick: t, labels: n, children: r, styles: i }) => {
472
+ let { ariaLabel: a } = n ?? {}, { typography: { fontClassName: c = "dial-small-semi-text" } = {}, className: l, colors: u } = i ?? {}, d = o({
473
+ "--ci-more-tile-bg": u?.background,
474
+ "--ci-more-tile-border": u?.border,
475
+ "--ci-more-tile-color": u?.color,
476
+ "--ci-more-tile-bg-hover": u?.backgroundHover,
477
+ "--ci-more-tile-color-hover": u?.colorHover,
478
+ "--ci-more-tile-border-hover": u?.borderHover,
479
+ "--ci-more-tile-focus-outline": u?.focusOutline
480
480
  });
481
- return /* @__PURE__ */ J("button", {
481
+ return /* @__PURE__ */ K("button", {
482
482
  type: "button",
483
483
  onClick: t,
484
- "aria-label": n ?? `Show ${e} more attachments`,
485
- style: l,
486
- className: s("flex size-[84px] items-center justify-center rounded-xl border", i, Oe.tile, a),
487
- children: r ?? /* @__PURE__ */ J("bdi", {
484
+ "aria-label": a ?? `Show ${e} more attachments`,
485
+ style: d,
486
+ className: s("flex size-[84px] items-center justify-center rounded-xl border", c, Oe.tile, l),
487
+ children: r ?? /* @__PURE__ */ K("bdi", {
488
488
  dir: "ltr",
489
489
  children: `+${e}`
490
490
  })
@@ -495,90 +495,96 @@ var le = /* @__PURE__ */ function(e) {
495
495
  headerLabel: "_headerLabel_7fktb_7",
496
496
  downloadAllButton: "_downloadAllButton_7fktb_8",
497
497
  imageTile: "_imageTile_7fktb_12"
498
- }, Ae = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, je = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: u, labels: d, typeLabels: f, styles: p, theme: h, className: v }) => {
499
- let { ariaLabel: y = "Attachments", clickLabel: b = "Download attachment", retryLabel: x = "Retry upload", showLessLabel: ee = "Show less", downloadAllLabel: te = "Download all", getHeaderLabel: S = (e) => Ae(e, "attachment") } = d ?? {}, { headerLabelClassName: C = "dial-tiny-semi-text", colors: w } = p ?? {}, T = o({
500
- "--ci-group-bg": w?.background,
501
- "--ci-group-border": w?.border,
502
- "--ci-group-text": w?.text
503
- }), [E, D] = ce(!1), O = se(() => Ce(e.length, E), [e.length, E]);
498
+ }, Ae = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, je = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: u, labels: d, styles: f, theme: p }) => {
499
+ let { ariaLabel: h = "Attachments", clickLabel: v = "Download attachment", retryLabel: y = "Retry upload", showLessLabel: b = "Show less", downloadAllLabel: x = "Download all", getHeaderLabel: ee = (e) => Ae(e, "attachment"), promptLabel: S, pastedLabel: C, imageLabel: w } = d ?? {}, { typography: { headerLabelClassName: te = "dial-tiny-semi-text" } = {}, colors: T, className: E } = f ?? {}, D = o({
500
+ "--ci-group-bg": T?.background,
501
+ "--ci-group-border": T?.border,
502
+ "--ci-group-text": T?.text
503
+ }), [O, k] = ue(!1), A = ce(() => Ce(e.length, O), [e.length, O]);
504
504
  if (e.length === 0) return null;
505
- let k = e.some((e) => e.type === t.Image), A = e.some((e) => e.type !== t.Image), j = k && A, M = e.length >= 5, N = j ? H : k ? U : _, P = S(e.length), F = e.slice(0, O.visibleCount);
506
- return /* @__PURE__ */ Y("div", {
505
+ let j = e.some((e) => e.type === t.Image), M = e.some((e) => e.type !== t.Image), N = j && M, P = e.length >= 5, F = N ? V : j ? re : _, I = ee(e.length), L = e.slice(0, A.visibleCount);
506
+ return /* @__PURE__ */ q("div", {
507
507
  role: "group",
508
- "aria-label": y,
509
- style: T,
510
- className: s("rounded-2xl border p-3", M ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, v),
511
- children: [/* @__PURE__ */ Y("div", {
508
+ "aria-label": h,
509
+ style: D,
510
+ className: s("rounded-2xl border p-3", P ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, E),
511
+ children: [/* @__PURE__ */ q("div", {
512
512
  className: "mb-3 flex min-h-6 items-center gap-2",
513
513
  children: [
514
- /* @__PURE__ */ J(N, {
514
+ /* @__PURE__ */ K(F, {
515
515
  size: c.SM,
516
516
  className: s("shrink-0", $.headerIcon),
517
517
  "aria-hidden": !0
518
518
  }),
519
- /* @__PURE__ */ J("span", {
520
- className: s(C, $.headerLabel),
521
- children: P
519
+ /* @__PURE__ */ K("span", {
520
+ className: s(te, $.headerLabel),
521
+ children: I
522
522
  }),
523
- e.length >= 2 && (r || n) && /* @__PURE__ */ J(l, {
524
- icon: /* @__PURE__ */ J(g, {
523
+ e.length >= 2 && (r || n) && /* @__PURE__ */ K(l, {
524
+ icon: /* @__PURE__ */ K(g, {
525
525
  size: c.SM,
526
526
  "aria-hidden": !0
527
527
  }),
528
528
  className: s("ms-auto h-6 w-6 rounded-lg", $.downloadAllButton),
529
- "aria-label": te,
529
+ "aria-label": x,
530
530
  onClick: () => {
531
531
  let t = e.filter((e) => e.status === a.Idle);
532
532
  r ? r(t) : t.forEach((e) => n?.(e));
533
533
  }
534
534
  })
535
535
  ]
536
- }), /* @__PURE__ */ Y("div", {
536
+ }), /* @__PURE__ */ q("div", {
537
537
  role: "list",
538
- "aria-label": P,
539
- className: s("gap-3", M ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
538
+ "aria-label": I,
539
+ className: s("gap-3", P ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
540
540
  children: [
541
- F.map((e) => /* @__PURE__ */ J("div", {
541
+ L.map((e) => /* @__PURE__ */ K("div", {
542
542
  role: "listitem",
543
- children: e.type === t.Image ? /* @__PURE__ */ J(we, {
543
+ children: e.type === t.Image ? /* @__PURE__ */ K(we, {
544
544
  attachment: e,
545
545
  onClick: n ? () => n(e) : void 0,
546
546
  onRetry: i,
547
547
  labels: {
548
- clickLabel: b,
549
- retryLabel: x
548
+ clickLabel: v,
549
+ retryLabel: y,
550
+ promptLabel: S,
551
+ pastedLabel: C,
552
+ imageLabel: w
550
553
  },
551
- typeLabels: f,
552
- styles: { roundedClassName: "rounded-xl" },
553
- showHoverDownloadIcon: !0,
554
- className: s("size-[84px]", $.imageTile)
555
- }) : /* @__PURE__ */ J(De, {
554
+ styles: {
555
+ roundedClassName: "rounded-xl",
556
+ className: s("size-[84px]", $.imageTile)
557
+ },
558
+ showHoverDownloadIcon: !0
559
+ }) : /* @__PURE__ */ K(De, {
556
560
  attachment: e,
557
561
  onClick: n,
558
562
  onRetry: i,
559
563
  labels: {
560
- clickLabel: b,
561
- retryLabel: x,
562
- sizeLabel: u?.(e)
564
+ clickLabel: v,
565
+ retryLabel: y,
566
+ sizeLabel: u?.(e),
567
+ promptLabel: S,
568
+ pastedLabel: C,
569
+ imageLabel: w
563
570
  },
564
- typeLabels: f,
565
- theme: h
571
+ theme: p
566
572
  })
567
573
  }, e.id)),
568
- O.layout === Z.Collapsed && /* @__PURE__ */ J("div", {
574
+ A.layout === X.Collapsed && /* @__PURE__ */ K("div", {
569
575
  role: "listitem",
570
- children: /* @__PURE__ */ J(ke, {
571
- count: O.hiddenCount,
572
- onClick: () => D(!0)
576
+ children: /* @__PURE__ */ K(ke, {
577
+ count: A.hiddenCount,
578
+ onClick: () => k(!0)
573
579
  })
574
580
  }),
575
- M && E && /* @__PURE__ */ J("div", {
581
+ P && O && /* @__PURE__ */ K("div", {
576
582
  role: "listitem",
577
- children: /* @__PURE__ */ J(ke, {
583
+ children: /* @__PURE__ */ K(ke, {
578
584
  count: 0,
579
- onClick: () => D(!1),
580
- ariaLabel: ee,
581
- children: /* @__PURE__ */ J(m, {
585
+ onClick: () => k(!1),
586
+ labels: { ariaLabel: b },
587
+ children: /* @__PURE__ */ K(m, {
582
588
  size: c.MD,
583
589
  "aria-hidden": !0
584
590
  })
@@ -591,45 +597,45 @@ var le = /* @__PURE__ */ function(e) {
591
597
  overlay: "_overlay_wr7ez_1",
592
598
  icon: "_icon_wr7ez_5",
593
599
  deniedIcon: "_deniedIcon_wr7ez_9"
594
- }, Ne = ({ isVisible: e, isAttachmentsAllowed: t = !0, title: n, subtitle: r, styles: i }) => {
595
- let { colors: a, typography: c } = i ?? {}, { titleClassName: l = "heading-3 font-semibold", subtitleClassName: u = "dial-small-text" } = c ?? {};
600
+ }, Ne = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
601
+ let { title: i, subtitle: a } = n ?? {}, { colors: c, typography: l } = r ?? {}, { titleClassName: u = "heading-3 font-semibold", subtitleClassName: d = "dial-small-text" } = l ?? {};
596
602
  if (!e) return null;
597
- let d = o({
598
- "--fd-bg": a?.background,
599
- "--fd-icon": a?.icon,
600
- "--fd-denied-icon": a?.deniedIcon
601
- }), f = n ?? (t ? "Attach files" : "No attachments allowed"), p = r ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), m = t ? Me.icon : Me.deniedIcon, h = (e) => {
603
+ let f = o({
604
+ "--fd-bg": c?.background,
605
+ "--fd-icon": c?.icon,
606
+ "--fd-denied-icon": c?.deniedIcon
607
+ }), p = i ?? (t ? "Attach files" : "No attachments allowed"), m = a ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), h = t ? Me.icon : Me.deniedIcon, g = (e) => {
602
608
  e.preventDefault();
603
- }, g = t ? v : B;
604
- return /* @__PURE__ */ J("div", {
609
+ }, _ = t ? v : B;
610
+ return /* @__PURE__ */ K("div", {
605
611
  role: "status",
606
612
  "aria-live": "polite",
607
613
  className: s("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", Me.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
608
- onDragOver: t ? void 0 : h,
609
- onDrop: t ? void 0 : h,
610
- style: d,
611
- children: /* @__PURE__ */ Y("div", {
614
+ onDragOver: t ? void 0 : g,
615
+ onDrop: t ? void 0 : g,
616
+ style: f,
617
+ children: /* @__PURE__ */ q("div", {
612
618
  className: "flex flex-col items-center text-center",
613
619
  children: [
614
- /* @__PURE__ */ J(g, {
620
+ /* @__PURE__ */ K(_, {
615
621
  size: 100,
616
- className: m,
622
+ className: h,
617
623
  "aria-hidden": !0
618
624
  }),
619
- /* @__PURE__ */ J("span", {
620
- className: s("mt-5", l),
621
- children: f
622
- }),
623
- /* @__PURE__ */ J("span", {
624
- className: s("mt-4", u),
625
+ /* @__PURE__ */ K("span", {
626
+ className: s("mt-5", u),
625
627
  children: p
628
+ }),
629
+ /* @__PURE__ */ K("span", {
630
+ className: s("mt-4", d),
631
+ children: m
626
632
  })
627
633
  ]
628
634
  })
629
635
  });
630
636
  }, Pe = (e, n, r = {}) => {
631
637
  let { screenshotName: i = "Screenshot.png", pastedTextName: o = "Pasted text" } = r;
632
- return { handlePaste: W((r) => {
638
+ return { handlePaste: se((r) => {
633
639
  if (!r.clipboardData) return;
634
640
  let s = Array.from(r.clipboardData.items).filter((e) => e.kind === "file" && e.type.startsWith("image/")), c = r.clipboardData.getData("text/plain").length > 0;
635
641
  if (s.length > 0 && !c) {
@@ -638,7 +644,7 @@ var le = /* @__PURE__ */ function(e) {
638
644
  let r = e.getAsFile();
639
645
  if (!r) continue;
640
646
  let o = new File([r], i, { type: r.type }), s = {
641
- id: pe(),
647
+ id: Z(),
642
648
  name: i,
643
649
  contentType: r.type,
644
650
  file: o,
@@ -654,7 +660,7 @@ var le = /* @__PURE__ */ function(e) {
654
660
  let l = r.clipboardData.getData("text/plain");
655
661
  if (l.length > n) {
656
662
  let n = l.trim(), i = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || o, s = new File([l], i, { type: "text/plain" }), c = {
657
- id: pe(),
663
+ id: Z(),
658
664
  name: i,
659
665
  contentType: "text/plain",
660
666
  file: s,
@@ -671,4 +677,4 @@ var le = /* @__PURE__ */ function(e) {
671
677
  ]) };
672
678
  }, Fe = 100;
673
679
  //#endregion
674
- export { fe as ATTACHMENT_COLLAPSED_VISIBLE_COUNT, de as ATTACHMENT_COLLAPSE_THRESHOLD, we as AttachmentCard, De as AttachmentFileRow, je as AttachmentGroup, ke as AttachmentMoreTile, Z as AttachmentTilesLayout, Te as AttachmentTray, Ne as FileDndOverlay, le as LazyImageLoadStatus, Fe as MAX_UPLOADS_PER_MINUTE, pe as generateAttachmentId, Se as getAttachmentCardState, ve as getAttachmentIcon, Ce as getAttachmentTilesPlan, be as getExtFromContentType, me as getNameWithoutExtension, _e as isMimeTypeAllowed, ge as mimeTypesToExtensionLabels, Pe as useClipboardPaste, ue as useLazyImageLoad };
680
+ export { pe as ATTACHMENT_COLLAPSED_VISIBLE_COUNT, fe as ATTACHMENT_COLLAPSE_THRESHOLD, we as AttachmentCard, De as AttachmentFileRow, je as AttachmentGroup, ke as AttachmentMoreTile, X as AttachmentTilesLayout, Te as AttachmentTray, Ne as FileDndOverlay, J as LazyImageLoadStatus, Fe as MAX_UPLOADS_PER_MINUTE, Z as generateAttachmentId, Se as getAttachmentCardState, ve as getAttachmentIcon, Ce as getAttachmentTilesPlan, be as getExtFromContentType, me as getNameWithoutExtension, _e as isMimeTypeAllowed, ge as mimeTypesToExtensionLabels, Pe as useClipboardPaste, de as useLazyImageLoad };