@oneplatformdev/ui 0.1.99-beta.282 → 0.1.99-beta.283

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.
@@ -1,63 +1,72 @@
1
- import { jsxs as l, jsx as e, Fragment as K } from "react/jsx-runtime";
2
- import { X as j, Plus as je, UploadIcon as Me, FileTextIcon as Q, InfoIcon as U } from "lucide-react";
3
- import { forwardRef as Se, useState as V, useEffect as ke, useImperativeHandle as Be } from "react";
4
- import { useDropzone as Re } from "react-dropzone";
5
- import { cn as m } from "@oneplatformdev/utils";
6
- import { Card as We } from "../Card/Card.js";
7
- import { DEFAULT_FILE_TYPES as Ae } from "./Dropzone.types.js";
8
- import { FilePreview as ee } from "./DropzoneFilePreview.js";
9
- import { DropzoneSinglePickPreview as _e } from "./DropzoneSinglePickPreview.js";
10
- import { isFile as C, isVideoUrl as Xe, extractName as $e } from "./DropzoneUtils.js";
11
- import Pe from "./icons/file-csv.svg.js";
12
- import Te from "./icons/file-doc.svg.js";
13
- import Le from "./icons/file-docx.svg.js";
14
- import te from "./icons/file-jpg.svg.js";
15
- import Oe from "./icons/file-pdf.svg.js";
1
+ import { jsxs as r, jsx as e, Fragment as U } from "react/jsx-runtime";
2
+ import { X as B, Plus as Be, UploadIcon as Se, FileTextIcon as V, InfoIcon as ee } from "lucide-react";
3
+ import { forwardRef as Me, useState as te, useEffect as ke, useImperativeHandle as Re } from "react";
4
+ import { useDropzone as We } from "react-dropzone";
5
+ import { cn as x } from "@oneplatformdev/utils";
6
+ import { Card as Ae } from "../Card/Card.js";
7
+ import { DEFAULT_FILE_TYPES as _e } from "./Dropzone.types.js";
8
+ import { FilePreview as re } from "./DropzoneFilePreview.js";
9
+ import { DropzoneSinglePickPreview as $e } from "./DropzoneSinglePickPreview.js";
10
+ import { isFile as z, isVideoUrl as Xe, extractName as Ge } from "./DropzoneUtils.js";
11
+ import Ke from "./icons/file-csv.svg.js";
12
+ import Le from "./icons/file-doc.svg.js";
13
+ import Oe from "./icons/file-docx.svg.js";
14
+ import le from "./icons/file-jpg.svg.js";
15
+ import Te from "./icons/file-pdf.svg.js";
16
16
  import qe from "./icons/file-png.svg.js";
17
- import Ge from "./icons/file-ppt.svg.js";
18
- import He from "./icons/file-pptx.svg.js";
19
- import Je from "./icons/file-rar.svg.js";
17
+ import He from "./icons/file-ppt.svg.js";
18
+ import Je from "./icons/file-pptx.svg.js";
19
+ import Pe from "./icons/file-rar.svg.js";
20
20
  import Ye from "./icons/file-svg.svg.js";
21
21
  import Ze from "./icons/file-webp.svg.js";
22
- import Ke from "./icons/file-xls.svg.js";
23
- import Qe from "./icons/file-xlsx.svg.js";
24
- import Ue from "./icons/file-zip.svg.js";
25
- import { Button as Ve } from "../Button/Button.js";
26
- const le = (n = 0) => `${(n / (1024 * 1024)).toFixed(0)} MB`, et = {
27
- csv: Pe,
28
- doc: Te,
29
- docx: Le,
30
- jpg: te,
31
- jpeg: te,
32
- pdf: Oe,
22
+ import Qe from "./icons/file-xls.svg.js";
23
+ import Ue from "./icons/file-xlsx.svg.js";
24
+ import Ve from "./icons/file-zip.svg.js";
25
+ import { Button as et } from "../Button/Button.js";
26
+ const b = (l = 0) => {
27
+ if (!l || l < 0) return "0 KB";
28
+ const s = 1024, m = s * 1024, a = m * 1024;
29
+ if (l >= a) return `${(l / a).toFixed(2)} GB`;
30
+ if (l >= m) {
31
+ const c = l / m;
32
+ return `${c >= 100 ? c.toFixed(0) : c.toFixed(2)} MB`;
33
+ }
34
+ return l >= s ? `${(l / s).toFixed(l / s >= 100 ? 0 : 1)} KB` : `${l} B`;
35
+ }, tt = {
36
+ csv: Ke,
37
+ doc: Le,
38
+ docx: Oe,
39
+ jpg: le,
40
+ jpeg: le,
41
+ pdf: Te,
33
42
  png: qe,
34
- ppt: Ge,
35
- pptx: He,
36
- rar: Je,
43
+ ppt: He,
44
+ pptx: Je,
45
+ rar: Pe,
37
46
  svg: Ye,
38
47
  webp: Ze,
39
- xls: Ke,
40
- xlsx: Qe,
41
- zip: Ue
42
- }, tt = (n) => {
43
- if (!n) return "";
44
- const d = n.toLowerCase().split(".");
45
- return d.length > 1 ? d[d.length - 1] : "";
46
- }, lt = (n) => {
47
- const d = tt(n);
48
- return et[d] ?? null;
49
- }, rt = (n, d) => {
50
- if (n === d) return !0;
51
- if (n.length !== d.length) return !1;
52
- for (let h = 0; h < n.length; h++) {
53
- const f = n[h], p = d[h];
54
- if (f !== p) {
55
- if (typeof f == "string" && typeof p == "string") {
56
- if (f !== p) return !1;
48
+ xls: Qe,
49
+ xlsx: Ue,
50
+ zip: Ve
51
+ }, rt = (l) => {
52
+ if (!l) return "";
53
+ const s = l.toLowerCase().split(".");
54
+ return s.length > 1 ? s[s.length - 1] : "";
55
+ }, lt = (l) => {
56
+ const s = rt(l);
57
+ return tt[s] ?? null;
58
+ }, it = (l, s) => {
59
+ if (l === s) return !0;
60
+ if (l.length !== s.length) return !1;
61
+ for (let m = 0; m < l.length; m++) {
62
+ const a = l[m], c = s[m];
63
+ if (a !== c) {
64
+ if (typeof a == "string" && typeof c == "string") {
65
+ if (a !== c) return !1;
57
66
  continue;
58
67
  }
59
- if (C(f) && C(p)) {
60
- if (f.name !== p.name || f.size !== p.size || f.type !== p.type || f.lastModified !== p.lastModified)
68
+ if (z(a) && z(c)) {
69
+ if (a.name !== c.name || a.size !== c.size || a.type !== c.type || a.lastModified !== c.lastModified)
61
70
  return !1;
62
71
  continue;
63
72
  }
@@ -65,111 +74,112 @@ const le = (n = 0) => `${(n / (1024 * 1024)).toFixed(0)} MB`, et = {
65
74
  }
66
75
  }
67
76
  return !0;
68
- }, it = Se(
77
+ }, nt = Me(
69
78
  ({
70
- acceptTypes: n = Ae,
71
- maxSizeMB: d,
72
- maxFiles: h = 1,
73
- onErrors: f,
74
- hideErrors: p = !1,
75
- disabled: c = !1,
79
+ acceptTypes: l = _e,
80
+ maxSizeMB: s,
81
+ maxFiles: m = 1,
82
+ onErrors: a,
83
+ hideErrors: c = !1,
84
+ disabled: f = !1,
76
85
  classNames: u,
77
86
  value: v,
78
- onChangeValue: X,
79
- className: re,
80
- labelDropzonePrompt: M = "Drop files here or click to select",
81
- labelDropzoneSubPrompt: ie = "",
87
+ onChangeValue: G,
88
+ className: ie,
89
+ labelDropzonePrompt: S = "Drop files here or click to select",
90
+ labelDropzoneSubPrompt: ne = "",
82
91
  labelOrClickToSelect: oe = "Upload file",
83
- labelSelectedFiles: ne = "Selected Files",
84
- labelUploadErrors: se = "Upload Errors",
85
- labelFileTooLarge: S = "File is too large",
86
- labelInvalidFileType: y = "Invalid file type",
87
- labelVideoUploaded: ce = "Uploaded",
88
- labelVideoReplace: ae = "Replace",
89
- singlePick: i = !1,
90
- labelDropzoneClassname: de,
91
- labelDropzoneSubClassname: me,
92
- isUploading: a = !1,
93
- uploadProgress: $ = 0,
94
- uploadLoadedBytes: fe = 0,
95
- uploadTotalBytes: pe = 0,
96
- onCancelUpload: P,
97
- labelUploadingTitle: xe = "Uploading video...",
98
- labelUploadingHint: he = "Please do not close this page",
99
- labelUploadingActionCancel: ue = "Cancel",
100
- labelUploadingOf: ge = "of",
101
- singlePickFileInfo: we,
102
- persistentDropzone: T = !1,
92
+ labelSelectedFiles: se = "Selected Files",
93
+ labelUploadErrors: ce = "Upload Errors",
94
+ labelFileTooLarge: M = "File is too large",
95
+ labelInvalidFileType: I = "Invalid file type",
96
+ labelVideoUploaded: ae = "Uploaded",
97
+ labelVideoReplace: de = "Replace",
98
+ singlePick: n = !1,
99
+ labelDropzoneClassname: me,
100
+ labelDropzoneSubClassname: fe,
101
+ isUploading: p = !1,
102
+ uploadProgress: K = 0,
103
+ uploadLoadedBytes: pe = 0,
104
+ uploadTotalBytes: xe = 0,
105
+ onCancelUpload: L,
106
+ labelUploadingTitle: he = "Uploading video...",
107
+ labelUploadingHint: ue = "Please do not close this page",
108
+ labelUploadingActionCancel: ge = "Cancel",
109
+ labelUploadingOf: we = "of",
110
+ playerTranslations: Ne,
111
+ singlePickFileInfo: k,
112
+ persistentDropzone: O = !1,
103
113
  previewVariant: g = "default",
104
- coverFirstItem: Ne = !1,
105
- ...k
106
- }, Fe) => {
107
- const [r, I] = V(v ?? []), [x, L] = V([]), N = r[0], B = x[0]?.file, ve = !!B?.type?.includes("image"), R = i && r.length > 0 && C(N), be = R && N.type.includes("image"), O = R && N.type.includes("video") || i && r.length > 0 && typeof N == "string" && Xe(N), q = R && !be && !O, G = i && !r.length && !!B && !ve, w = q ? N : B, z = lt(w?.name), W = i && O, Ce = W, A = i && r.length > 0, ye = (t, s) => {
108
- L(s), f?.(s);
109
- const o = i ? t.slice(0, 1) : [...r, ...t].slice(0, h);
110
- I(o), X?.(o);
114
+ coverFirstItem: Fe = !1,
115
+ ...R
116
+ }, ve) => {
117
+ const [i, y] = te(v ?? []), [h, T] = te([]), w = i[0], W = h[0]?.file, Ce = !!W?.type?.includes("image"), A = n && i.length > 0 && z(w), be = A && w.type.includes("image"), q = A && w.type.includes("video") || n && i.length > 0 && typeof w == "string" && Xe(w), H = A && !be && !q, J = n && !i.length && !!W && !Ce, N = H ? w : W, D = lt(N?.name), _ = n && q, ze = _, $ = n && i.length > 0, Ie = (t, d) => {
118
+ T(d), a?.(d);
119
+ const o = n ? t.slice(0, 1) : [...i, ...t].slice(0, m);
120
+ y(o), G?.(o);
111
121
  };
112
122
  ke(() => {
113
- v && !rt(r, v) && I(v);
114
- }, [r, v]);
115
- const D = (t, s) => {
116
- if (c) return;
123
+ v && !it(i, v) && y(v);
124
+ }, [i, v]);
125
+ const E = (t, d) => {
126
+ if (f) return;
117
127
  t.stopPropagation();
118
- const o = r.filter((F, E) => E !== s);
119
- I(o), X?.(o);
120
- }, { getRootProps: Ie, getInputProps: ze, isDragActive: De, open: _ } = Re({
121
- onDrop: ye,
122
- accept: n.reduce((t, s) => (t[s] = [], t), {}),
123
- maxSize: d * 1024 * 1024,
124
- maxFiles: i ? 1 : h,
125
- disabled: c || a,
128
+ const o = i.filter((F, j) => j !== d);
129
+ y(o), G?.(o);
130
+ }, { getRootProps: ye, getInputProps: De, isDragActive: Ee, open: X } = We({
131
+ onDrop: Ie,
132
+ accept: l.reduce((t, d) => (t[d] = [], t), {}),
133
+ maxSize: s * 1024 * 1024,
134
+ maxFiles: n ? 1 : m,
135
+ disabled: f || p,
126
136
  noClick: !0
127
137
  });
128
- Be(Fe, () => ({
129
- setItems: I
138
+ Re(ve, () => ({
139
+ setItems: y
130
140
  }), []);
131
- const b = Ne && g === "image-grid" && !i && r.length > 0, H = !a && !i && T && r.length > 0, J = b ? r.slice(1) : r, Y = !c && !i && g === "image-grid" && r.length > 0 && r.length < h, Z = !a && !i && (J.length > 0 || Y) && /* @__PURE__ */ l("div", { className: m("w-full mt-2", u?.previewWrapper), children: [
132
- g === "default" && /* @__PURE__ */ l("pre", { className: "font-semibold text-gray-600", children: [
133
- ne,
141
+ const C = Fe && g === "image-grid" && !n && i.length > 0, P = !p && !n && O && i.length > 0, Y = C ? i.slice(1) : i, Z = !f && !n && g === "image-grid" && i.length > 0 && i.length < m, Q = !p && !n && (Y.length > 0 || Z) && /* @__PURE__ */ r("div", { className: x("w-full mt-2", u?.previewWrapper), children: [
142
+ g === "default" && /* @__PURE__ */ r("pre", { className: "font-semibold text-gray-600", children: [
143
+ se,
134
144
  ":"
135
145
  ] }),
136
- /* @__PURE__ */ l(
146
+ /* @__PURE__ */ r(
137
147
  "ul",
138
148
  {
139
- className: m(
149
+ className: x(
140
150
  "mt-2 text-sm text-gray-500 flex flex-wrap items-start",
141
151
  g === "image-grid" ? "gap-2 justify-start" : "gap-4 justify-center"
142
152
  ),
143
153
  children: [
144
- J.map((t, s) => {
145
- const o = b ? s + 1 : s, F = C(t) ? t.name : $e(t), E = C(t) ? (t.size / (1024 * 1024)).toFixed(2) + " MB" : "";
146
- return /* @__PURE__ */ l(
154
+ Y.map((t, d) => {
155
+ const o = C ? d + 1 : d, F = z(t) ? t.name : Ge(t), j = z(t) ? b(t.size) : "";
156
+ return /* @__PURE__ */ r(
147
157
  "li",
148
158
  {
149
- className: m(
159
+ className: x(
150
160
  "relative",
151
161
  g === "image-grid" ? "w-[75px] h-[75px]" : "flex flex-col items-center gap-2"
152
162
  ),
153
163
  children: [
154
- /* @__PURE__ */ l("div", { className: "relative w-full h-full", children: [
155
- /* @__PURE__ */ e(ee, { item: t, styles: u }),
164
+ /* @__PURE__ */ r("div", { className: "relative w-full h-full", children: [
165
+ /* @__PURE__ */ e(re, { item: t, styles: u }),
156
166
  /* @__PURE__ */ e(
157
167
  "div",
158
168
  {
159
- className: m(
169
+ className: x(
160
170
  "absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm",
161
171
  g === "image-grid" && "top-1 right-1 bg-white/90 rounded-full p-0.5"
162
172
  ),
163
- onClick: (Ee) => D(Ee, o),
164
- children: /* @__PURE__ */ e(j, { size: 16, strokeWidth: 1, color: "black" })
173
+ onClick: (je) => E(je, o),
174
+ children: /* @__PURE__ */ e(B, { size: 16, strokeWidth: 1, color: "black" })
165
175
  }
166
176
  )
167
177
  ] }),
168
- g === "default" && /* @__PURE__ */ l("span", { className: "inline-flex flex-col items-center", children: [
178
+ g === "default" && /* @__PURE__ */ r("span", { className: "inline-flex flex-col items-center", children: [
169
179
  /* @__PURE__ */ e("span", { className: "max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap", children: F }),
170
- E && /* @__PURE__ */ l("span", { children: [
180
+ j && /* @__PURE__ */ r("span", { children: [
171
181
  "(",
172
- E,
182
+ j,
173
183
  ")"
174
184
  ] })
175
185
  ] })
@@ -178,14 +188,14 @@ const le = (n = 0) => `${(n / (1024 * 1024)).toFixed(0)} MB`, et = {
178
188
  o
179
189
  );
180
190
  }),
181
- Y && /* @__PURE__ */ e(
191
+ Z && /* @__PURE__ */ e(
182
192
  "li",
183
193
  {
184
194
  className: "relative w-[75px] h-[75px] flex items-center justify-center rounded-[8px] border border-dashed border-[#9368FF80] bg-[#FCFCFC] cursor-pointer hover:bg-[#9368FF0F]",
185
195
  onClick: (t) => {
186
- t.stopPropagation(), !(c || a) && _();
196
+ t.stopPropagation(), !(f || p) && X();
187
197
  },
188
- children: /* @__PURE__ */ e("div", { className: "flex size-6 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(je, { size: 16, className: "text-[#9368FF]" }) })
198
+ children: /* @__PURE__ */ e("div", { className: "flex size-6 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(Be, { size: 16, className: "text-[#9368FF]" }) })
189
199
  },
190
200
  "add-more"
191
201
  )
@@ -193,95 +203,95 @@ const le = (n = 0) => `${(n / (1024 * 1024)).toFixed(0)} MB`, et = {
193
203
  }
194
204
  )
195
205
  ] });
196
- return /* @__PURE__ */ l("div", { className: "w-full select-none", children: [
197
- /* @__PURE__ */ l(
198
- We,
206
+ return /* @__PURE__ */ r("div", { className: "w-full select-none", children: [
207
+ /* @__PURE__ */ r(
208
+ Ae,
199
209
  {
200
- ...k,
201
- ...Ie({
210
+ ...R,
211
+ ...ye({
202
212
  onClick: (t) => {
203
- if (!(c || a)) {
204
- if (Ce) {
205
- k.onClick?.(t);
213
+ if (!(f || p)) {
214
+ if (ze) {
215
+ R.onClick?.(t);
206
216
  return;
207
217
  }
208
- _(), k.onClick?.(t);
218
+ X(), R.onClick?.(t);
209
219
  }
210
220
  }
211
221
  }),
212
- className: m(
222
+ className: x(
213
223
  "w-full text-center flex flex-col items-center justify-center gap-6 cursor-pointer",
214
- !A && "border border-dashed border-[#9368FF80] rounded-[8px] bg-[#FCFCFC] p-4",
215
- A && "min-h-0 border-0 bg-transparent p-0",
216
- b && "relative",
217
- c && "border-[#E4E4E7] pointer-events-none",
218
- x.length > 0 && !A && "border-red-500",
219
- De && "bg-gray-100",
220
- i && "shadow-none!",
221
- i && r.length > 0 && !W && "p-0! shadow-none!",
222
- W && "h-auto! max-h-none! min-h-0! p-2!",
223
- re
224
+ !$ && "border border-dashed border-[#9368FF80] rounded-[8px] bg-[#FCFCFC] p-4",
225
+ $ && "min-h-0 border-0 bg-transparent p-0",
226
+ C && "relative",
227
+ f && "border-[#E4E4E7] pointer-events-none",
228
+ h.length > 0 && !$ && "border-red-500",
229
+ Ee && "bg-gray-100",
230
+ n && "shadow-none!",
231
+ n && i.length > 0 && !_ && "p-0! shadow-none!",
232
+ _ && "h-auto! max-h-none! min-h-0! p-2!",
233
+ ie
224
234
  ),
225
235
  children: [
226
- /* @__PURE__ */ e("input", { ...ze() }),
227
- a && /* @__PURE__ */ l(
236
+ /* @__PURE__ */ e("input", { ...De() }),
237
+ p && /* @__PURE__ */ r(
228
238
  "div",
229
239
  {
230
240
  className: "w-full h-full min-h-46 rounded-lg border border-[#E4E4E7] bg-[#FCFCFC] flex flex-col items-center justify-center gap-4 p-4",
231
241
  onClick: (t) => t.stopPropagation(),
232
242
  children: [
233
- /* @__PURE__ */ l("div", { className: "relative h-24 w-24", children: [
243
+ /* @__PURE__ */ r("div", { className: "relative h-24 w-24", children: [
234
244
  /* @__PURE__ */ e("svg", { className: "h-24 w-24", viewBox: "0 0 100 100", children: /* @__PURE__ */ e("circle", { cx: "50", cy: "50", r: "42", stroke: "#E6E1F5", strokeWidth: "8", fill: "none" }) }),
235
- /* @__PURE__ */ l("span", { className: "absolute inset-0 flex items-center justify-center text-lg font-semibold text-foreground", children: [
236
- Math.max(0, Math.min(100, Math.round($))),
245
+ /* @__PURE__ */ r("span", { className: "absolute inset-0 flex items-center justify-center text-lg font-semibold text-foreground", children: [
246
+ Math.max(0, Math.min(100, Math.round(K))),
237
247
  "%"
238
248
  ] })
239
249
  ] }),
240
- /* @__PURE__ */ l("div", { className: "text-center", children: [
241
- /* @__PURE__ */ e("p", { className: "text-xl font-semibold text-foreground", children: xe }),
242
- /* @__PURE__ */ l("p", { className: "text-sm text-[#666A78]", children: [
243
- le(fe),
250
+ /* @__PURE__ */ r("div", { className: "text-center", children: [
251
+ /* @__PURE__ */ e("p", { className: "text-xl font-semibold text-foreground", children: he }),
252
+ /* @__PURE__ */ r("p", { className: "text-sm text-[#666A78]", children: [
253
+ b(pe),
244
254
  " ",
245
- ge,
255
+ we,
246
256
  " ",
247
- le(pe)
257
+ b(xe)
248
258
  ] }),
249
- /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-[#666A78]", children: he })
259
+ /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-[#666A78]", children: ue })
250
260
  ] }),
251
261
  /* @__PURE__ */ e("div", { className: "w-full max-w-[520px] h-2 rounded-full bg-[#E6E1F5] overflow-hidden", children: /* @__PURE__ */ e(
252
262
  "div",
253
263
  {
254
264
  className: "h-full bg-[#9368FF] transition-[width] duration-150 ease-linear",
255
- style: { width: `${Math.max(0, Math.min(100, $))}%` }
265
+ style: { width: `${Math.max(0, Math.min(100, K))}%` }
256
266
  }
257
267
  ) }),
258
- P && /* @__PURE__ */ e(
268
+ L && /* @__PURE__ */ e(
259
269
  "button",
260
270
  {
261
271
  type: "button",
262
272
  className: "mt-1 h-10 min-w-36 rounded-md border border-[#E4E4E7] bg-white px-6 text-base font-medium text-foreground cursor-pointer",
263
273
  onClick: (t) => {
264
- t.stopPropagation(), P();
274
+ t.stopPropagation(), L();
265
275
  },
266
- children: ue
276
+ children: ge
267
277
  }
268
278
  )
269
279
  ]
270
280
  }
271
281
  ),
272
- !a && b && /* @__PURE__ */ l(
282
+ !p && C && /* @__PURE__ */ r(
273
283
  "div",
274
284
  {
275
285
  className: "absolute inset-0 rounded-[8px] overflow-hidden",
276
286
  onClick: (t) => t.stopPropagation(),
277
287
  children: [
278
288
  /* @__PURE__ */ e(
279
- ee,
289
+ re,
280
290
  {
281
- item: r[0],
291
+ item: i[0],
282
292
  styles: {
283
293
  ...u,
284
- previewWraper: m(
294
+ previewWraper: x(
285
295
  "w-full h-full rounded-[8px] border-0",
286
296
  u?.previewWraper?.replace(/w-\[[^\]]+\]|h-\[[^\]]+\]/g, "")
287
297
  )
@@ -292,47 +302,47 @@ const le = (n = 0) => `${(n / (1024 * 1024)).toFixed(0)} MB`, et = {
292
302
  "div",
293
303
  {
294
304
  className: "absolute top-2 right-2 cursor-pointer bg-white/90 rounded-full p-1",
295
- onClick: (t) => D(t, 0),
296
- children: /* @__PURE__ */ e(j, { size: 16, strokeWidth: 1, color: "black" })
305
+ onClick: (t) => E(t, 0),
306
+ children: /* @__PURE__ */ e(B, { size: 16, strokeWidth: 1, color: "black" })
297
307
  }
298
308
  )
299
309
  ]
300
310
  }
301
311
  ),
302
- !a && (r.length === 0 || !i && T) && (x.length === 0 || !i) && /* @__PURE__ */ l(
312
+ !p && (i.length === 0 || !n && O) && (h.length === 0 || !n) && /* @__PURE__ */ r(
303
313
  "div",
304
314
  {
305
- className: m(
315
+ className: x(
306
316
  "flex flex-col items-center gap-2 w-full",
307
317
  u?.idleWrapper,
308
- b && "invisible"
318
+ C && "invisible"
309
319
  ),
310
320
  children: [
311
- /* @__PURE__ */ e("div", { className: "flex size-12 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(Me, { className: "size-6 text-[#9368FF]" }) }),
312
- /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-1 w-full", children: !c && /* @__PURE__ */ l(K, { children: [
321
+ /* @__PURE__ */ e("div", { className: "flex size-12 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(Se, { className: "size-6 text-[#9368FF]" }) }),
322
+ /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-1 w-full", children: !f && /* @__PURE__ */ r(U, { children: [
313
323
  /* @__PURE__ */ e(
314
324
  "span",
315
325
  {
316
- className: m(
326
+ className: x(
317
327
  "font-semibold text-[14px] leading-[125%] text-[#06080D] text-center w-full whitespace-pre-line",
318
- de
328
+ me
319
329
  ),
320
- children: M
330
+ children: S
321
331
  }
322
332
  ),
323
333
  /* @__PURE__ */ e(
324
334
  "span",
325
335
  {
326
- className: m(
336
+ className: x(
327
337
  "font-medium text-[12px] leading-[120%] text-[#666A78] text-center w-full whitespace-pre-line",
328
- me
338
+ fe
329
339
  ),
330
- children: ie
340
+ children: ne
331
341
  }
332
342
  )
333
343
  ] }) }),
334
- !c && /* @__PURE__ */ e(
335
- Ve,
344
+ !f && /* @__PURE__ */ e(
345
+ et,
336
346
  {
337
347
  type: "button",
338
348
  size: "md",
@@ -342,131 +352,132 @@ const le = (n = 0) => `${(n / (1024 * 1024)).toFixed(0)} MB`, et = {
342
352
  ]
343
353
  }
344
354
  ),
345
- !a && i && x.length > 0 && !G && /* @__PURE__ */ l("div", { className: m("w-full mt-4", u?.errorWrapper), children: [
346
- /* @__PURE__ */ l("span", { className: "font-semibold text-red-500", children: [
347
- se,
355
+ !p && n && h.length > 0 && !J && /* @__PURE__ */ r("div", { className: x("w-full mt-4", u?.errorWrapper), children: [
356
+ /* @__PURE__ */ r("span", { className: "font-semibold text-red-500", children: [
357
+ ce,
348
358
  ":"
349
359
  ] }),
350
- /* @__PURE__ */ e("ul", { className: "mt-2 text-sm text-red-500 list-disc list-inside", children: x.map((t, s) => /* @__PURE__ */ l("li", { children: [
360
+ /* @__PURE__ */ e("ul", { className: "mt-2 text-sm text-red-500 list-disc list-inside", children: h.map((t, d) => /* @__PURE__ */ r("li", { children: [
351
361
  t.file.name,
352
362
  " (",
353
- (t.file.size / (1024 * 1024)).toFixed(2),
354
- " MB)",
355
- !p && /* @__PURE__ */ e("ul", { className: "ml-4 list-disc list-inside", children: t.errors.map((o, F) => /* @__PURE__ */ l("li", { children: [
356
- o.code === "file-too-large" && S,
357
- o.code === "file-invalid-type" && y,
363
+ b(t.file.size),
364
+ ")",
365
+ !c && /* @__PURE__ */ e("ul", { className: "ml-4 list-disc list-inside", children: t.errors.map((o, F) => /* @__PURE__ */ r("li", { children: [
366
+ o.code === "file-too-large" && M,
367
+ o.code === "file-invalid-type" && I,
358
368
  o.code !== "file-too-large" && o.code !== "file-invalid-type" && o.message
359
369
  ] }, F)) })
360
- ] }, s)) })
370
+ ] }, d)) })
361
371
  ] }),
362
- !a && !!(i && r.length) && /* @__PURE__ */ e(K, { children: q ? /* @__PURE__ */ l(
372
+ !p && !!(n && i.length) && /* @__PURE__ */ e(U, { children: H ? /* @__PURE__ */ r(
363
373
  "div",
364
374
  {
365
375
  className: "w-full max-w-[502px] flex flex-col items-center gap-4",
366
376
  onClick: (t) => t.stopPropagation(),
367
377
  children: [
368
- /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: M }),
369
- /* @__PURE__ */ l("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
370
- z ? /* @__PURE__ */ e(
378
+ /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: S }),
379
+ /* @__PURE__ */ r("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
380
+ D ? /* @__PURE__ */ e(
371
381
  "img",
372
382
  {
373
- src: z,
383
+ src: D,
374
384
  alt: "",
375
385
  className: "size-10 shrink-0"
376
386
  }
377
- ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(Q, { size: 20 }) }),
378
- /* @__PURE__ */ l("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
379
- /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: w?.name }),
380
- /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: w ? `${(w.size / (1024 * 1024)).toFixed(0)} MB` : "" })
387
+ ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(V, { size: 20 }) }),
388
+ /* @__PURE__ */ r("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
389
+ /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: k?.name || N?.name }),
390
+ /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: b(k?.size || N?.size) })
381
391
  ] }),
382
- !c && /* @__PURE__ */ e(
392
+ !f && /* @__PURE__ */ e(
383
393
  "div",
384
394
  {
385
395
  className: "size-6 flex items-center justify-center cursor-pointer",
386
- onClick: (t) => D(t, 0),
387
- children: /* @__PURE__ */ e(j, { size: 24, color: "#06080D" })
396
+ onClick: (t) => E(t, 0),
397
+ children: /* @__PURE__ */ e(B, { size: 24, color: "#06080D" })
388
398
  }
389
399
  )
390
400
  ] })
391
401
  ]
392
402
  }
393
403
  ) : /* @__PURE__ */ e(
394
- _e,
404
+ $e,
395
405
  {
396
- item: r[0],
397
- onRemoveClick: (t) => D(t, 0),
406
+ item: i[0],
407
+ onRemoveClick: (t) => E(t, 0),
398
408
  onReplaceClick: (t) => {
399
- t.stopPropagation(), !c && _();
409
+ t.stopPropagation(), !f && X();
400
410
  },
401
- labelUploaded: ce,
402
- labelReplace: ae,
403
- fileInfo: we,
404
- disabled: c
411
+ labelUploaded: ae,
412
+ labelReplace: de,
413
+ fileInfo: k,
414
+ disabled: f,
415
+ playerTranslations: Ne
405
416
  }
406
417
  ) }),
407
- !a && G && /* @__PURE__ */ l(
418
+ !p && J && /* @__PURE__ */ r(
408
419
  "div",
409
420
  {
410
421
  className: "w-full max-w-[502px] flex flex-col items-center gap-4",
411
422
  onClick: (t) => t.stopPropagation(),
412
423
  children: [
413
- /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: M }),
414
- /* @__PURE__ */ l("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
415
- z ? /* @__PURE__ */ e(
424
+ /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: S }),
425
+ /* @__PURE__ */ r("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
426
+ D ? /* @__PURE__ */ e(
416
427
  "img",
417
428
  {
418
- src: z,
429
+ src: D,
419
430
  alt: "",
420
431
  className: "size-10 shrink-0"
421
432
  }
422
- ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(Q, { size: 20 }) }),
423
- /* @__PURE__ */ l("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
424
- /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: w?.name }),
425
- /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: w ? `${(w.size / (1024 * 1024)).toFixed(0)} MB` : "" })
433
+ ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(V, { size: 20 }) }),
434
+ /* @__PURE__ */ r("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
435
+ /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: N?.name }),
436
+ /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: N ? `${(N.size / (1024 * 1024)).toFixed(0)} MB` : "" })
426
437
  ] }),
427
- !c && /* @__PURE__ */ e(
438
+ !f && /* @__PURE__ */ e(
428
439
  "div",
429
440
  {
430
441
  className: "size-6 flex items-center justify-center cursor-pointer",
431
442
  onClick: (t) => {
432
- t.stopPropagation(), L([]);
443
+ t.stopPropagation(), T([]);
433
444
  },
434
- children: /* @__PURE__ */ e(j, { size: 24, color: "#06080D" })
445
+ children: /* @__PURE__ */ e(B, { size: 24, color: "#06080D" })
435
446
  }
436
447
  )
437
448
  ] }),
438
- /* @__PURE__ */ l("div", { className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4", children: [
439
- /* @__PURE__ */ e(U, { size: 20, color: "#DC2626" }),
440
- /* @__PURE__ */ e("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: x[0]?.errors?.[0]?.code === "file-too-large" ? S : x[0]?.errors?.[0]?.message || y })
449
+ /* @__PURE__ */ r("div", { className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4", children: [
450
+ /* @__PURE__ */ e(ee, { size: 20, color: "#DC2626" }),
451
+ /* @__PURE__ */ e("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: h[0]?.errors?.[0]?.code === "file-too-large" ? M : h[0]?.errors?.[0]?.message || I })
441
452
  ] })
442
453
  ]
443
454
  }
444
455
  ),
445
- !H && Z
456
+ !P && Q
446
457
  ]
447
458
  }
448
459
  ),
449
- H && /* @__PURE__ */ e("div", { className: "w-full", children: Z }),
450
- !a && !i && x.length > 0 && /* @__PURE__ */ e(
460
+ P && /* @__PURE__ */ e("div", { className: "w-full", children: Q }),
461
+ !p && !n && h.length > 0 && /* @__PURE__ */ e(
451
462
  "div",
452
463
  {
453
- className: m("w-full mt-4 flex flex-col gap-2", u?.errorWrapper),
454
- children: x.map((t, s) => {
455
- const o = t.errors[0], F = o?.code === "file-too-large" ? S : o?.code === "file-invalid-type" ? y : o?.message || y;
456
- return /* @__PURE__ */ l(
464
+ className: x("w-full mt-4 flex flex-col gap-2", u?.errorWrapper),
465
+ children: h.map((t, d) => {
466
+ const o = t.errors[0], F = o?.code === "file-too-large" ? M : o?.code === "file-invalid-type" ? I : o?.message || I;
467
+ return /* @__PURE__ */ r(
457
468
  "div",
458
469
  {
459
470
  className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4 rounded-[8px]",
460
471
  children: [
461
- /* @__PURE__ */ e(U, { size: 20, color: "#DC2626", className: "shrink-0" }),
462
- /* @__PURE__ */ l("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: [
472
+ /* @__PURE__ */ e(ee, { size: 20, color: "#DC2626", className: "shrink-0" }),
473
+ /* @__PURE__ */ r("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: [
463
474
  /* @__PURE__ */ e("span", { className: "font-semibold", children: t.file.name }),
464
475
  " — ",
465
476
  F
466
477
  ] })
467
478
  ]
468
479
  },
469
- s
480
+ d
470
481
  );
471
482
  })
472
483
  }
@@ -474,8 +485,8 @@ const le = (n = 0) => `${(n / (1024 * 1024)).toFixed(0)} MB`, et = {
474
485
  ] });
475
486
  }
476
487
  );
477
- it.displayName = "Dropzone";
488
+ nt.displayName = "Dropzone";
478
489
  export {
479
- it as Dropzone
490
+ nt as Dropzone
480
491
  };
481
492
  //# sourceMappingURL=Dropzone.js.map