@rpcbase/ui 0.221.0 → 0.223.0
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/dist/components/FilesUploadField/index.d.ts.map +1 -1
- package/dist/components/Image/index.d.ts +14 -5
- package/dist/components/Image/index.d.ts.map +1 -1
- package/dist/components/ImagesField/index.d.ts.map +1 -1
- package/dist/index.js +59 -55
- package/dist/index10.js +3 -3
- package/dist/index100.js +4 -5
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +8 -4
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +5 -8
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +4 -5
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +3 -3
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +6 -4
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +145 -6
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +38 -144
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +4 -39
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +7 -4
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +2 -2
- package/dist/index110.js +12 -6
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +13 -13
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +7 -13
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +30 -6
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +10 -31
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +10 -10
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +8 -10
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +13 -8
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +101 -13
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +20 -102
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +116 -66
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +54 -20
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +70 -51
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +9 -72
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +20 -9
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +16 -20
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +23 -16
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +6 -23
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +5 -6
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +23 -5
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +35 -24
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +17 -16
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +16 -35
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +7 -16
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +4 -6
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +4 -4
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +4 -4
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +4 -4
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +3 -4
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +6 -3
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +24 -7
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +8 -24
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +2 -2
- package/dist/index140.js +6 -7
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +5 -6
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +3 -5
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +3 -3
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +4 -3
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +3 -4
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +4 -3
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +3 -4
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +3 -3
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +3 -3
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +2 -2
- package/dist/index150.js +46 -3
- package/dist/index150.js.map +1 -1
- package/dist/index16.js +2 -2
- package/dist/index17.js +1 -1
- package/dist/index172.js +2 -2
- package/dist/index174.js +2 -2
- package/dist/index175.js +1 -1
- package/dist/index18.js +7 -7
- package/dist/index181.js +1 -1
- package/dist/index19.js +3 -3
- package/dist/index21.js +1 -1
- package/dist/index22.js +2 -2
- package/dist/index228.js +1 -1
- package/dist/index229.js +1 -1
- package/dist/index23.js +1 -1
- package/dist/index231.js +1 -1
- package/dist/index233.js +1 -1
- package/dist/index234.js +1 -1
- package/dist/index235.js +4 -4
- package/dist/index236.js +2 -2
- package/dist/index24.js +1 -1
- package/dist/index25.js +1 -1
- package/dist/index28.js +2 -2
- package/dist/index29.js +37 -3
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +2 -2
- package/dist/index30.js +3 -125
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +120 -227
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +229 -21
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +23 -50
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +50 -21
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +18 -126
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +113 -205
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +205 -74
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +87 -115
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +118 -5
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +2 -2
- package/dist/index40.js +5 -819
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +819 -56
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +57 -37
- package/dist/index42.js.map +1 -1
- package/dist/index45.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index49.js +1 -1
- package/dist/index5.js +2 -2
- package/dist/index50.js +1 -1
- package/dist/index51.js +2 -7
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +2 -34
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +5 -47
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +33 -7
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +48 -11
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +7 -3
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +11 -47
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +2 -51
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +2 -8
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +5 -5
- package/dist/index60.js +5 -14
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +7 -133
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +5 -10
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +3 -216
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +48 -13
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +47 -43
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +7 -49
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +15 -4
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +133 -5
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +11 -28
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +2 -2
- package/dist/index70.js +216 -49
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +12 -8
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +46 -5
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +49 -7
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +4 -6
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +6 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +28 -2
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +50 -2
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +9 -2
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +52 -47
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +376 -365
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +5 -52
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +4 -4
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +15 -4
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +5 -15
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +7 -5
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +15 -6
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +4 -16
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +1 -1
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +5 -4
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +4 -4
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +1 -1
- package/dist/index90.js +4 -5
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +2 -2
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +5 -3
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +24 -6
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +6 -24
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +4 -6
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +5 -3
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +5 -6
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +4 -5
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +4 -3
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index8.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { j as n } from "./
|
|
2
|
-
import { c as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { DismissableLayerBranch as
|
|
6
|
-
import { useSensors as
|
|
7
|
-
import { useSortable as
|
|
8
|
-
import { CSS as
|
|
9
|
-
import { X as
|
|
1
|
+
import { j as n } from "./index30.js";
|
|
2
|
+
import { c as Lt } from "./index28.js";
|
|
3
|
+
import { useRef as D, useState as ze, useEffect as Q } from "react";
|
|
4
|
+
import { createPortal as Et } from "react-dom";
|
|
5
|
+
import { DismissableLayerBranch as Tt } from "./index31.js";
|
|
6
|
+
import { useSensors as Ft, useSensor as It, PointerSensor as Ht, KeyboardSensor as Ot, DragOverlay as $t, DndContext as Bt, closestCenter as _t } from "@dnd-kit/core";
|
|
7
|
+
import { useSortable as Vt, sortableKeyboardCoordinates as Xt, arrayMove as Wt, SortableContext as Jt, rectSortingStrategy as qt } from "@dnd-kit/sortable";
|
|
8
|
+
import { CSS as Gt } from "@dnd-kit/utilities";
|
|
9
|
+
import { X as Mt, Maximize2 as Qt, Loader2 as Yt, Plus as Zt } from "lucide-react";
|
|
10
10
|
import { cn as mt } from "./index2.js";
|
|
11
|
-
|
|
11
|
+
import { Image as ht } from "./index12.js";
|
|
12
|
+
const er = async (s) => {
|
|
12
13
|
if (typeof crypto > "u" || typeof crypto.subtle > "u") return null;
|
|
13
14
|
try {
|
|
14
15
|
const e = await crypto.subtle.digest("SHA-256", s);
|
|
@@ -16,7 +17,7 @@ const Qt = async (s) => {
|
|
|
16
17
|
} catch {
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
|
-
},
|
|
20
|
+
}, Rt = async (s, e, r) => {
|
|
20
21
|
const o = await fetch(s, {
|
|
21
22
|
method: "POST",
|
|
22
23
|
headers: {
|
|
@@ -26,13 +27,13 @@ const Qt = async (s) => {
|
|
|
26
27
|
credentials: "include",
|
|
27
28
|
body: JSON.stringify(e),
|
|
28
29
|
signal: r?.signal
|
|
29
|
-
}),
|
|
30
|
+
}), m = await o.json().catch(() => ({}));
|
|
30
31
|
return {
|
|
31
32
|
ok: o.ok,
|
|
32
33
|
status: o.status,
|
|
33
|
-
data:
|
|
34
|
+
data: m
|
|
34
35
|
};
|
|
35
|
-
},
|
|
36
|
+
}, tr = async (s, e) => {
|
|
36
37
|
const r = await fetch(s, {
|
|
37
38
|
credentials: "include",
|
|
38
39
|
headers: e?.headers,
|
|
@@ -43,30 +44,30 @@ const Qt = async (s) => {
|
|
|
43
44
|
status: r.status,
|
|
44
45
|
data: o
|
|
45
46
|
};
|
|
46
|
-
},
|
|
47
|
+
}, rr = async ({
|
|
47
48
|
url: s,
|
|
48
49
|
body: e,
|
|
49
50
|
sha256: r,
|
|
50
51
|
uploadKey: o,
|
|
51
|
-
signal:
|
|
52
|
+
signal: m
|
|
52
53
|
}) => {
|
|
53
|
-
const
|
|
54
|
+
const x = {
|
|
54
55
|
"Content-Type": "application/octet-stream"
|
|
55
56
|
};
|
|
56
|
-
r && (
|
|
57
|
-
const
|
|
57
|
+
r && (x["X-Chunk-SHA256"] = r), o && (x["X-Upload-Key"] = o);
|
|
58
|
+
const I = await fetch(s, {
|
|
58
59
|
method: "PUT",
|
|
59
60
|
credentials: "include",
|
|
60
|
-
headers:
|
|
61
|
+
headers: x,
|
|
61
62
|
body: e,
|
|
62
|
-
signal:
|
|
63
|
+
signal: m
|
|
63
64
|
});
|
|
64
65
|
return {
|
|
65
|
-
ok:
|
|
66
|
-
status:
|
|
66
|
+
ok: I.ok,
|
|
67
|
+
status: I.status
|
|
67
68
|
};
|
|
68
|
-
},
|
|
69
|
-
const o = await
|
|
69
|
+
}, sr = async (s, e, r) => {
|
|
70
|
+
const o = await Rt("/api/rb/file-uploads", {
|
|
70
71
|
filename: s.name,
|
|
71
72
|
mimeType: s.type || "application/octet-stream",
|
|
72
73
|
...typeof r?.isPublic == "boolean" ? {
|
|
@@ -78,56 +79,56 @@ const Qt = async (s) => {
|
|
|
78
79
|
});
|
|
79
80
|
if (!o.ok || !o.data?.ok)
|
|
80
81
|
throw new Error(o.data?.error ?? `Init failed (${o.status})`);
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
82
|
+
const m = String(o.data?.uploadId ?? ""), x = typeof o.data?.uploadKey == "string" ? String(o.data.uploadKey) : null, I = Number(o.data?.chunkSize ?? 0), U = Number(o.data?.chunksTotal ?? 0);
|
|
83
|
+
if (!m || !I || !U)
|
|
83
84
|
throw new Error("Upload init missing required fields");
|
|
84
85
|
const K = async (h) => {
|
|
85
|
-
const a = h *
|
|
86
|
-
url: `/api/rb/file-uploads/${encodeURIComponent(
|
|
86
|
+
const a = h * I, v = Math.min(s.size, a + I), c = await s.slice(a, v).arrayBuffer(), z = await er(c), j = await rr({
|
|
87
|
+
url: `/api/rb/file-uploads/${encodeURIComponent(m)}/chunks/${h}`,
|
|
87
88
|
body: c,
|
|
88
89
|
sha256: z ?? void 0,
|
|
89
|
-
uploadKey:
|
|
90
|
+
uploadKey: x ?? void 0,
|
|
90
91
|
signal: r?.signal
|
|
91
92
|
});
|
|
92
|
-
if (
|
|
93
|
-
throw new Error(`Chunk ${h} failed (${
|
|
93
|
+
if (j.status !== 204)
|
|
94
|
+
throw new Error(`Chunk ${h} failed (${j.status})`);
|
|
94
95
|
}, B = async (h, a = 0) => {
|
|
95
96
|
let v = a;
|
|
96
|
-
for (const
|
|
97
|
-
await K(
|
|
98
|
-
const c = Math.min(99, Math.floor(v /
|
|
97
|
+
for (const L of h) {
|
|
98
|
+
await K(L), v += 1;
|
|
99
|
+
const c = Math.min(99, Math.floor(v / U * 99));
|
|
99
100
|
e(c);
|
|
100
101
|
}
|
|
101
|
-
},
|
|
102
|
-
length:
|
|
102
|
+
}, R = Array.from({
|
|
103
|
+
length: U
|
|
103
104
|
}, (h, a) => a);
|
|
104
|
-
await B(
|
|
105
|
+
await B(R, 0);
|
|
105
106
|
const T = async () => {
|
|
106
|
-
const h = await
|
|
107
|
-
headers:
|
|
108
|
-
"X-Upload-Key":
|
|
107
|
+
const h = await Rt(`/api/rb/file-uploads/${encodeURIComponent(m)}/complete`, {}, {
|
|
108
|
+
headers: x ? {
|
|
109
|
+
"X-Upload-Key": x
|
|
109
110
|
} : void 0,
|
|
110
111
|
signal: r?.signal
|
|
111
112
|
});
|
|
112
113
|
if (h.ok && h.data?.ok) {
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
115
|
-
return
|
|
114
|
+
const j = String(h.data?.fileId ?? "");
|
|
115
|
+
if (!j) throw new Error("Upload completed without fileId");
|
|
116
|
+
return j;
|
|
116
117
|
}
|
|
117
118
|
const a = String(h.data?.error ?? "");
|
|
118
119
|
if (h.status !== 409 || a !== "missing_chunks")
|
|
119
120
|
throw new Error(a || `Complete failed (${h.status})`);
|
|
120
|
-
const v = await
|
|
121
|
-
headers:
|
|
122
|
-
"X-Upload-Key":
|
|
121
|
+
const v = await tr(`/api/rb/file-uploads/${encodeURIComponent(m)}/status`, {
|
|
122
|
+
headers: x ? {
|
|
123
|
+
"X-Upload-Key": x
|
|
123
124
|
} : void 0,
|
|
124
125
|
signal: r?.signal
|
|
125
126
|
});
|
|
126
127
|
if (!v.ok || !v.data?.ok)
|
|
127
128
|
throw new Error(v.data?.error ?? `Status failed (${v.status})`);
|
|
128
|
-
const
|
|
129
|
-
for (let
|
|
130
|
-
c.has(
|
|
129
|
+
const L = Array.isArray(v.data?.received) ? v.data.received : [], c = new Set(L), z = [];
|
|
130
|
+
for (let j = 0; j < U; j += 1)
|
|
131
|
+
c.has(j) || z.push(j);
|
|
131
132
|
if (!z.length)
|
|
132
133
|
throw new Error("missing_chunks");
|
|
133
134
|
return await B(z, c.size), T();
|
|
@@ -136,28 +137,28 @@ const Qt = async (s) => {
|
|
|
136
137
|
id: F,
|
|
137
138
|
url: `/api/rb/files/${encodeURIComponent(F)}`,
|
|
138
139
|
alt: s.name,
|
|
139
|
-
...
|
|
140
|
-
uploadKey:
|
|
140
|
+
...x ? {
|
|
141
|
+
uploadKey: x
|
|
141
142
|
} : {}
|
|
142
143
|
};
|
|
143
144
|
};
|
|
144
|
-
function
|
|
145
|
-
const e =
|
|
145
|
+
function nr(s) {
|
|
146
|
+
const e = Lt.c(80), {
|
|
146
147
|
item: r,
|
|
147
148
|
isHovered: o,
|
|
148
|
-
enableImagePreview:
|
|
149
|
-
renderItem:
|
|
150
|
-
onHoverEnter:
|
|
151
|
-
onHoverLeave:
|
|
149
|
+
enableImagePreview: m,
|
|
150
|
+
renderItem: x,
|
|
151
|
+
onHoverEnter: I,
|
|
152
|
+
onHoverLeave: U,
|
|
152
153
|
onRemove: K,
|
|
153
154
|
onRetry: B,
|
|
154
|
-
startFullscreen:
|
|
155
|
+
startFullscreen: R,
|
|
155
156
|
isUploading: T,
|
|
156
157
|
isError: F,
|
|
157
158
|
tileClasses: h,
|
|
158
159
|
disabled: a,
|
|
159
160
|
isDraggingExternal: v,
|
|
160
|
-
removeButtonAriaLabel:
|
|
161
|
+
removeButtonAriaLabel: L
|
|
161
162
|
} = s;
|
|
162
163
|
let c;
|
|
163
164
|
e[0] !== a || e[1] !== r.id ? (c = {
|
|
@@ -166,15 +167,15 @@ function tr(s) {
|
|
|
166
167
|
}, e[0] = a, e[1] = r.id, e[2] = c) : c = e[2];
|
|
167
168
|
const {
|
|
168
169
|
setNodeRef: z,
|
|
169
|
-
attributes:
|
|
170
|
+
attributes: j,
|
|
170
171
|
listeners: be,
|
|
171
|
-
transform:
|
|
172
|
+
transform: ne,
|
|
172
173
|
transition: l,
|
|
173
|
-
isDragging:
|
|
174
|
-
} =
|
|
175
|
-
let
|
|
176
|
-
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
177
|
-
const g =
|
|
174
|
+
isDragging: E
|
|
175
|
+
} = Vt(c), Ae = D(null), ve = D(null), [H, q] = ze(null);
|
|
176
|
+
let le;
|
|
177
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (le = () => {
|
|
178
|
+
const g = Ae.current;
|
|
178
179
|
if (!g)
|
|
179
180
|
return;
|
|
180
181
|
const k = g.getBoundingClientRect();
|
|
@@ -182,35 +183,35 @@ function tr(s) {
|
|
|
182
183
|
left: k.left + k.width / 2,
|
|
183
184
|
top: k.top - 10
|
|
184
185
|
});
|
|
185
|
-
}, e[3] =
|
|
186
|
-
const
|
|
187
|
-
let
|
|
188
|
-
e[4] !==
|
|
189
|
-
if (!
|
|
186
|
+
}, e[3] = le) : le = e[3];
|
|
187
|
+
const pe = le;
|
|
188
|
+
let C, Y;
|
|
189
|
+
e[4] !== m || e[5] !== o ? (C = () => {
|
|
190
|
+
if (!m || !o) {
|
|
190
191
|
q(null);
|
|
191
192
|
return;
|
|
192
193
|
}
|
|
193
|
-
|
|
194
|
+
pe();
|
|
194
195
|
let g = 0;
|
|
195
196
|
const k = () => {
|
|
196
197
|
g && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
197
|
-
g = 0,
|
|
198
|
+
g = 0, pe();
|
|
198
199
|
});
|
|
199
200
|
};
|
|
200
201
|
return window.addEventListener("resize", k), window.addEventListener("scroll", k, !0), () => {
|
|
201
202
|
g && cancelAnimationFrame(g), window.removeEventListener("resize", k), window.removeEventListener("scroll", k, !0);
|
|
202
203
|
};
|
|
203
|
-
}, Y = [
|
|
204
|
-
let
|
|
205
|
-
e[8] !==
|
|
206
|
-
let
|
|
207
|
-
e[10] !==
|
|
208
|
-
transform:
|
|
204
|
+
}, Y = [m, o], e[4] = m, e[5] = o, e[6] = C, e[7] = Y) : (C = e[6], Y = e[7]), Q(C, Y);
|
|
205
|
+
let O;
|
|
206
|
+
e[8] !== ne ? (O = Gt.Transform.toString(ne), e[8] = ne, e[9] = O) : O = e[9];
|
|
207
|
+
let oe;
|
|
208
|
+
e[10] !== O || e[11] !== l ? (oe = {
|
|
209
|
+
transform: O,
|
|
209
210
|
transition: l
|
|
210
|
-
}, e[10] =
|
|
211
|
-
const
|
|
212
|
-
let
|
|
213
|
-
e[13] !==
|
|
211
|
+
}, e[10] = O, e[11] = l, e[12] = oe) : oe = e[12];
|
|
212
|
+
const ae = oe;
|
|
213
|
+
let ie;
|
|
214
|
+
e[13] !== m || e[14] !== F || e[15] !== T || e[16] !== r.alt || e[17] !== r.fileName || e[18] !== r.id || e[19] !== r.previewUrl || e[20] !== r.progress || e[21] !== r.status || e[22] !== r.uploadKey || e[23] !== r.url || e[24] !== x ? (ie = x ? x({
|
|
214
215
|
file: {
|
|
215
216
|
id: r.id,
|
|
216
217
|
url: r.url,
|
|
@@ -221,51 +222,51 @@ function tr(s) {
|
|
|
221
222
|
status: r.status,
|
|
222
223
|
progress: r.progress,
|
|
223
224
|
fileName: r.fileName
|
|
224
|
-
}) :
|
|
225
|
-
const ye =
|
|
225
|
+
}) : m ? /* @__PURE__ */ n.jsx(ht, { src: r.previewUrl, alt: r.alt ?? "Uploaded file", sizes: "96px", className: mt("size-full rounded-md object-cover", T && "opacity-75", F && "grayscale") }) : /* @__PURE__ */ n.jsx("div", { className: "flex size-full items-center justify-center rounded-md bg-slate-100 px-2 text-center text-[10px] font-medium text-slate-700 dark:bg-slate-800 dark:text-slate-200", children: /* @__PURE__ */ n.jsx("span", { className: "w-full truncate", children: r.fileName ?? r.alt ?? "Fichier" }) }), e[13] = m, e[14] = F, e[15] = T, e[16] = r.alt, e[17] = r.fileName, e[18] = r.id, e[19] = r.previewUrl, e[20] = r.progress, e[21] = r.status, e[22] = r.uploadKey, e[23] = r.url, e[24] = x, e[25] = ie) : ie = e[25];
|
|
226
|
+
const ye = ie;
|
|
226
227
|
let Z;
|
|
227
228
|
e[26] !== z ? (Z = (g) => {
|
|
228
|
-
|
|
229
|
+
Ae.current = g, z(g);
|
|
229
230
|
}, e[26] = z, e[27] = Z) : Z = e[27];
|
|
230
|
-
const we =
|
|
231
|
-
let
|
|
232
|
-
e[28] !==
|
|
231
|
+
const we = E && "z-20 ring-2 ring-primary shadow-xl", ce = v && "opacity-0", G = !a && "cursor-grab active:cursor-grabbing", ue = E && "cursor-grabbing", $ = a && "cursor-default";
|
|
232
|
+
let _;
|
|
233
|
+
e[28] !== ce || e[29] !== G || e[30] !== ue || e[31] !== $ || e[32] !== we || e[33] !== h ? (_ = mt(h, we, ce, G, ue, $), e[28] = ce, e[29] = G, e[30] = ue, e[31] = $, e[32] = we, e[33] = h, e[34] = _) : _ = e[34];
|
|
233
234
|
let b;
|
|
234
|
-
e[35] !==
|
|
235
|
-
|
|
236
|
-
}, e[35] =
|
|
235
|
+
e[35] !== I ? (b = () => {
|
|
236
|
+
pe(), I();
|
|
237
|
+
}, e[35] = I, e[36] = b) : b = e[36];
|
|
237
238
|
let V;
|
|
238
|
-
e[37] !==
|
|
239
|
+
e[37] !== U ? (V = (g) => {
|
|
239
240
|
const k = g.relatedTarget;
|
|
240
|
-
k instanceof Node && ve.current?.contains(k) ||
|
|
241
|
-
}, e[37] =
|
|
241
|
+
k instanceof Node && ve.current?.contains(k) || U();
|
|
242
|
+
}, e[37] = U, e[38] = V) : V = e[38];
|
|
242
243
|
let y;
|
|
243
244
|
e[39] !== a || e[40] !== r.id || e[41] !== K ? (y = () => {
|
|
244
245
|
a || K(r.id);
|
|
245
246
|
}, e[39] = a, e[40] = r.id, e[41] = K, e[42] = y) : y = e[42];
|
|
246
247
|
let ee;
|
|
247
|
-
e[43] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = /* @__PURE__ */ n.jsx(
|
|
248
|
-
let
|
|
249
|
-
e[44] !== a || e[45] !==
|
|
250
|
-
let
|
|
251
|
-
e[48] !==
|
|
252
|
-
const g = /* @__PURE__ */ n.jsx(
|
|
253
|
-
left:
|
|
254
|
-
top:
|
|
248
|
+
e[43] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = /* @__PURE__ */ n.jsx(Mt, { className: "h-4 w-4" }), e[43] = ee) : ee = e[43];
|
|
249
|
+
let X;
|
|
250
|
+
e[44] !== a || e[45] !== L || e[46] !== y ? (X = /* @__PURE__ */ n.jsx("button", { type: "button", onClick: y, disabled: a, className: "absolute right-1 top-1 inline-flex size-6 items-center justify-center rounded-full bg-white text-slate-700 shadow-sm transition hover:scale-105 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary dark:bg-slate-900 dark:text-slate-200", "aria-label": L, children: ee }), e[44] = a, e[45] = L, e[46] = y, e[47] = X) : X = e[47];
|
|
251
|
+
let de;
|
|
252
|
+
e[48] !== m || e[49] !== o || e[50] !== r.alt || e[51] !== r.id || e[52] !== r.url || e[53] !== I || e[54] !== U || e[55] !== H || e[56] !== R ? (de = m && o && H && (() => {
|
|
253
|
+
const g = /* @__PURE__ */ n.jsx(Tt, { children: /* @__PURE__ */ n.jsx("div", { ref: ve, className: "pointer-events-auto fixed z-[60] w-52 -translate-x-1/2 -translate-y-full rounded-xl border border-slate-200 bg-white/95 p-3 shadow-2xl backdrop-blur dark:border-slate-700 dark:bg-slate-900/95", style: {
|
|
254
|
+
left: H.left,
|
|
255
|
+
top: H.top
|
|
255
256
|
}, onMouseEnter: () => {
|
|
256
|
-
|
|
257
|
+
pe(), I();
|
|
257
258
|
}, onMouseLeave: (k) => {
|
|
258
|
-
const
|
|
259
|
-
|
|
259
|
+
const me = k.relatedTarget;
|
|
260
|
+
me instanceof Node && Ae.current?.contains(me) || U();
|
|
260
261
|
}, children: /* @__PURE__ */ n.jsxs("div", { className: "relative overflow-hidden rounded-lg", children: [
|
|
261
|
-
/* @__PURE__ */ n.jsx(
|
|
262
|
-
/* @__PURE__ */ n.jsx("button", { type: "button", onClick: () =>
|
|
262
|
+
/* @__PURE__ */ n.jsx(ht, { src: r.url, alt: r.alt ?? "Preview", sizes: "208px", className: "h-40 w-full object-cover" }),
|
|
263
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", onClick: () => R(r.id), className: "absolute right-2 top-2 inline-flex items-center justify-center rounded-full bg-black/70 p-2 text-white transition hover:bg-black", "aria-label": "Plein écran", children: /* @__PURE__ */ n.jsx(Qt, { className: "h-3.5 w-3.5" }) })
|
|
263
264
|
] }) }) });
|
|
264
|
-
return typeof document > "u" ? g :
|
|
265
|
-
})(), e[48] =
|
|
266
|
-
let
|
|
267
|
-
e[58] !== T || e[59] !== r.progress ? (
|
|
268
|
-
/* @__PURE__ */ n.jsx(
|
|
265
|
+
return typeof document > "u" ? g : Et(g, document.body);
|
|
266
|
+
})(), e[48] = m, e[49] = o, e[50] = r.alt, e[51] = r.id, e[52] = r.url, e[53] = I, e[54] = U, e[55] = H, e[56] = R, e[57] = de) : de = e[57];
|
|
267
|
+
let W;
|
|
268
|
+
e[58] !== T || e[59] !== r.progress ? (W = T && /* @__PURE__ */ n.jsxs("div", { className: "absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 rounded-lg bg-black/40 text-white", children: [
|
|
269
|
+
/* @__PURE__ */ n.jsx(Yt, { className: "h-5 w-5 animate-spin" }),
|
|
269
270
|
/* @__PURE__ */ n.jsx("div", { className: "h-1.5 w-5/6 rounded-full bg-white/20", children: /* @__PURE__ */ n.jsx("div", { className: "h-full rounded-full bg-primary", style: {
|
|
270
271
|
width: `${r.progress}%`
|
|
271
272
|
} }) }),
|
|
@@ -273,78 +274,79 @@ function tr(s) {
|
|
|
273
274
|
r.progress,
|
|
274
275
|
"%"
|
|
275
276
|
] })
|
|
276
|
-
] }), e[58] = T, e[59] = r.progress, e[60] =
|
|
277
|
-
let
|
|
278
|
-
e[61] !== a || e[62] !== F || e[63] !== r.
|
|
279
|
-
/* @__PURE__ */ n.jsx("div", { className: "text-
|
|
277
|
+
] }), e[58] = T, e[59] = r.progress, e[60] = W) : W = e[60];
|
|
278
|
+
let J;
|
|
279
|
+
e[61] !== a || e[62] !== F || e[63] !== r.errorMessage || e[64] !== r.id || e[65] !== B ? (J = F && /* @__PURE__ */ n.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-lg bg-red-600/70 text-white", children: [
|
|
280
|
+
/* @__PURE__ */ n.jsx("div", { className: "max-w-[92%] break-words text-center text-[10px] font-semibold leading-tight", title: r.errorMessage, children: or(r.errorMessage) }),
|
|
280
281
|
/* @__PURE__ */ n.jsx("button", { type: "button", onClick: () => B(r.id), disabled: a, className: "rounded-full bg-white/90 px-3 py-1 text-xs font-semibold text-red-700 shadow-sm transition hover:bg-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", children: "Réessayer" })
|
|
281
|
-
] }), e[61] = a, e[62] = F, e[63] = r.
|
|
282
|
+
] }), e[61] = a, e[62] = F, e[63] = r.errorMessage, e[64] = r.id, e[65] = B, e[66] = J) : J = e[66];
|
|
282
283
|
let te;
|
|
283
|
-
return e[
|
|
284
|
+
return e[67] !== j || e[68] !== be || e[69] !== ae || e[70] !== _ || e[71] !== b || e[72] !== V || e[73] !== X || e[74] !== de || e[75] !== W || e[76] !== J || e[77] !== Z || e[78] !== ye ? (te = /* @__PURE__ */ n.jsxs("div", { ref: Z, style: ae, className: _, onMouseEnter: b, onMouseLeave: V, ...j, ...be, children: [
|
|
284
285
|
ye,
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
] }), e[
|
|
286
|
+
X,
|
|
287
|
+
de,
|
|
288
|
+
W,
|
|
289
|
+
J
|
|
290
|
+
] }), e[67] = j, e[68] = be, e[69] = ae, e[70] = _, e[71] = b, e[72] = V, e[73] = X, e[74] = de, e[75] = W, e[76] = J, e[77] = Z, e[78] = ye, e[79] = te) : te = e[79], te;
|
|
290
291
|
}
|
|
291
|
-
function
|
|
292
|
+
function lr(s) {
|
|
292
293
|
return URL.createObjectURL(s);
|
|
293
294
|
}
|
|
294
|
-
|
|
295
|
-
|
|
295
|
+
const Ct = (s) => s instanceof Error ? s.message : typeof s == "string" ? s : "Upload failed", or = (s) => s ? s.startsWith("heif_decode_unsupported") ? "HEIC/HEVC non supporté" : s : "Échec";
|
|
296
|
+
function Lr(s) {
|
|
297
|
+
const e = Lt.c(125), {
|
|
296
298
|
initialFiles: r,
|
|
297
299
|
onChange: o,
|
|
298
|
-
upload:
|
|
299
|
-
uploadIsPublic:
|
|
300
|
-
disabled:
|
|
301
|
-
onUploadingChange:
|
|
300
|
+
upload: m,
|
|
301
|
+
uploadIsPublic: x,
|
|
302
|
+
disabled: I,
|
|
303
|
+
onUploadingChange: U,
|
|
302
304
|
accept: K,
|
|
303
305
|
renderHeader: B,
|
|
304
|
-
renderItem:
|
|
306
|
+
renderItem: R,
|
|
305
307
|
addButtonAriaLabel: T,
|
|
306
308
|
removeButtonAriaLabel: F
|
|
307
309
|
} = s;
|
|
308
310
|
let h;
|
|
309
311
|
e[0] !== r ? (h = r === void 0 ? [] : r, e[0] = r, e[1] = h) : h = e[1];
|
|
310
|
-
const a = h, v =
|
|
311
|
-
let
|
|
312
|
-
e[2] !== a ? (
|
|
313
|
-
const [l,
|
|
314
|
-
let
|
|
315
|
-
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
316
|
-
const
|
|
317
|
-
let ie;
|
|
318
|
-
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ie = /* @__PURE__ */ new Map(), e[5] = ie) : ie = e[5];
|
|
319
|
-
const G = M(ie);
|
|
312
|
+
const a = h, v = m === void 0 ? sr : m, L = x === void 0 ? !1 : x, c = I === void 0 ? !1 : I, z = T === void 0 ? "Ajouter un fichier" : T, j = F === void 0 ? "Supprimer le fichier" : F, be = D(null);
|
|
313
|
+
let ne;
|
|
314
|
+
e[2] !== a ? (ne = () => a.map(vr), e[2] = a, e[3] = ne) : ne = e[3];
|
|
315
|
+
const [l, E] = ze(ne), [Ae, ve] = ze(!1), [H, q] = ze(null), [le, pe] = ze(null), [C, Y] = ze(null), O = D(null), oe = D(!0);
|
|
316
|
+
let ae;
|
|
317
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ae = [], e[4] = ae) : ae = e[4];
|
|
318
|
+
const ie = D(ae), ye = D(a), Z = D(o), we = D(U);
|
|
320
319
|
let ce;
|
|
321
|
-
e[
|
|
322
|
-
const
|
|
323
|
-
let
|
|
324
|
-
e[
|
|
325
|
-
const
|
|
320
|
+
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = /* @__PURE__ */ new Map(), e[5] = ce) : ce = e[5];
|
|
321
|
+
const G = D(ce);
|
|
322
|
+
let ue;
|
|
323
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ue = /* @__PURE__ */ new Map(), e[6] = ue) : ue = e[6];
|
|
324
|
+
const $ = D(ue);
|
|
325
|
+
let _;
|
|
326
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ new Map(), e[7] = _) : _ = e[7];
|
|
327
|
+
const b = D(_);
|
|
326
328
|
let V;
|
|
327
329
|
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ new Map(), e[8] = V) : V = e[8];
|
|
328
|
-
const y =
|
|
330
|
+
const y = D(V);
|
|
329
331
|
let ee;
|
|
330
332
|
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = {
|
|
331
333
|
activationConstraint: {
|
|
332
334
|
distance: 6
|
|
333
335
|
}
|
|
334
336
|
}, e[9] = ee) : ee = e[9];
|
|
335
|
-
let
|
|
336
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
337
|
-
coordinateGetter:
|
|
338
|
-
}, e[10] =
|
|
339
|
-
const
|
|
340
|
-
let
|
|
341
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
337
|
+
let X;
|
|
338
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = {
|
|
339
|
+
coordinateGetter: Xt
|
|
340
|
+
}, e[10] = X) : X = e[10];
|
|
341
|
+
const de = Ft(It(Ht, ee), It(Ot, X));
|
|
342
|
+
let W, J;
|
|
343
|
+
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => () => {
|
|
342
344
|
for (const t of b.current.values())
|
|
343
345
|
try {
|
|
344
346
|
t.abort();
|
|
345
347
|
} catch {
|
|
346
348
|
}
|
|
347
|
-
b.current.clear(),
|
|
349
|
+
b.current.clear(), $.current.clear(), G.current.clear();
|
|
348
350
|
for (const t of y.current.values())
|
|
349
351
|
if (typeof URL < "u")
|
|
350
352
|
try {
|
|
@@ -352,87 +354,87 @@ function Ur(s) {
|
|
|
352
354
|
} catch {
|
|
353
355
|
}
|
|
354
356
|
y.current.clear();
|
|
355
|
-
},
|
|
357
|
+
}, J = [], e[11] = W, e[12] = J) : (W = e[11], J = e[12]), Q(W, J);
|
|
356
358
|
let te, g;
|
|
357
|
-
e[13] !==
|
|
359
|
+
e[13] !== C ? (te = () => {
|
|
358
360
|
if (!(typeof document > "u")) {
|
|
359
|
-
if (
|
|
360
|
-
return document.body.style.cursor = "grabbing",
|
|
361
|
+
if (C)
|
|
362
|
+
return document.body.style.cursor = "grabbing", br;
|
|
361
363
|
document.body.style.cursor = "";
|
|
362
364
|
}
|
|
363
|
-
}, g = [
|
|
364
|
-
let k,
|
|
365
|
+
}, g = [C], e[13] = C, e[14] = te, e[15] = g) : (te = e[14], g = e[15]), Q(te, g);
|
|
366
|
+
let k, me;
|
|
365
367
|
e[16] !== l ? (k = () => {
|
|
366
|
-
|
|
367
|
-
},
|
|
368
|
+
ie.current = l;
|
|
369
|
+
}, me = [l], e[16] = l, e[17] = k, e[18] = me) : (k = e[17], me = e[18]), Q(k, me);
|
|
368
370
|
let Te, Fe;
|
|
369
371
|
e[19] !== o ? (Te = () => {
|
|
370
372
|
Z.current = o;
|
|
371
373
|
}, Fe = [o], e[19] = o, e[20] = Te, e[21] = Fe) : (Te = e[20], Fe = e[21]), Q(Te, Fe);
|
|
372
|
-
let
|
|
373
|
-
e[22] !==
|
|
374
|
-
we.current =
|
|
375
|
-
},
|
|
376
|
-
let
|
|
377
|
-
e[25] !== a ? (
|
|
374
|
+
let He, Oe;
|
|
375
|
+
e[22] !== U ? (He = () => {
|
|
376
|
+
we.current = U;
|
|
377
|
+
}, Oe = [U], e[22] = U, e[23] = He, e[24] = Oe) : (He = e[23], Oe = e[24]), Q(He, Oe);
|
|
378
|
+
let $e, Be;
|
|
379
|
+
e[25] !== a ? ($e = () => {
|
|
378
380
|
const t = ye.current;
|
|
379
|
-
if (t.length === a.length && t.every((f,
|
|
380
|
-
const
|
|
381
|
-
return
|
|
381
|
+
if (t.length === a.length && t.every((f, p) => {
|
|
382
|
+
const w = a[p];
|
|
383
|
+
return w && f.id === w.id && f.url === w.url && f.alt === w.alt;
|
|
382
384
|
}))
|
|
383
385
|
return;
|
|
384
386
|
ye.current = a;
|
|
385
|
-
const i = a.map(
|
|
386
|
-
for (const [f,
|
|
387
|
-
|
|
388
|
-
const
|
|
387
|
+
const i = a.map(gr), N = new Set(i.map(hr));
|
|
388
|
+
for (const [f, p] of G.current.entries())
|
|
389
|
+
N.has(p) && G.current.delete(f);
|
|
390
|
+
const M = new Set(ie.current.map(mr));
|
|
389
391
|
if (i.some((f) => {
|
|
390
|
-
const
|
|
391
|
-
return
|
|
392
|
+
const p = G.current.get(f.id);
|
|
393
|
+
return p ? M.has(p) : !1;
|
|
392
394
|
}))
|
|
393
395
|
return;
|
|
394
|
-
const
|
|
395
|
-
for (const f of
|
|
396
|
-
if (
|
|
396
|
+
const S = new Set(i.map(pr));
|
|
397
|
+
for (const f of ie.current) {
|
|
398
|
+
if (S.has(f.id))
|
|
397
399
|
continue;
|
|
398
|
-
const
|
|
399
|
-
if (
|
|
400
|
+
const p = b.current.get(f.id);
|
|
401
|
+
if (p) {
|
|
400
402
|
b.current.delete(f.id);
|
|
401
403
|
try {
|
|
402
|
-
|
|
404
|
+
p.abort();
|
|
403
405
|
} catch {
|
|
404
406
|
}
|
|
405
407
|
}
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
if (
|
|
408
|
+
$.current.delete(f.id);
|
|
409
|
+
const w = y.current.get(f.id);
|
|
410
|
+
if (w) {
|
|
409
411
|
y.current.delete(f.id);
|
|
410
412
|
try {
|
|
411
|
-
URL.revokeObjectURL(
|
|
413
|
+
URL.revokeObjectURL(w);
|
|
412
414
|
} catch {
|
|
413
415
|
}
|
|
414
416
|
}
|
|
415
417
|
}
|
|
416
|
-
|
|
417
|
-
const
|
|
418
|
-
return
|
|
419
|
-
}) ? f : (
|
|
420
|
-
}, Be = [a], e[25] = a, e[26] =
|
|
421
|
-
let
|
|
422
|
-
e[28] !== l ? (
|
|
423
|
-
if (
|
|
424
|
-
|
|
418
|
+
E((f) => f.length === i.length && f.every((A, se) => {
|
|
419
|
+
const P = i[se];
|
|
420
|
+
return P && A.id === P.id && A.url === P.url && A.alt === P.alt && A.uploadKey === P.uploadKey;
|
|
421
|
+
}) ? f : (oe.current = !0, i));
|
|
422
|
+
}, Be = [a], e[25] = a, e[26] = $e, e[27] = Be) : ($e = e[26], Be = e[27]), Q($e, Be);
|
|
423
|
+
let _e, Ve;
|
|
424
|
+
e[28] !== l ? (_e = () => {
|
|
425
|
+
if (oe.current) {
|
|
426
|
+
oe.current = !1;
|
|
425
427
|
return;
|
|
426
428
|
}
|
|
427
|
-
Z.current?.(l.map(
|
|
428
|
-
}, Ve = [l], e[28] = l, e[29] =
|
|
429
|
-
let
|
|
430
|
-
e[31] !== l ? (
|
|
431
|
-
we.current?.(l.some(
|
|
432
|
-
},
|
|
433
|
-
let
|
|
434
|
-
e[34] !==
|
|
435
|
-
if (
|
|
429
|
+
Z.current?.(l.map(fr));
|
|
430
|
+
}, Ve = [l], e[28] = l, e[29] = _e, e[30] = Ve) : (_e = e[29], Ve = e[30]), Q(_e, Ve);
|
|
431
|
+
let Xe, We;
|
|
432
|
+
e[31] !== l ? (Xe = () => {
|
|
433
|
+
we.current?.(l.some(dr));
|
|
434
|
+
}, We = [l], e[31] = l, e[32] = Xe, e[33] = We) : (Xe = e[32], We = e[33]), Q(Xe, We);
|
|
435
|
+
let Je, qe;
|
|
436
|
+
e[34] !== H || e[35] !== l.length ? (Je = () => {
|
|
437
|
+
if (H === null)
|
|
436
438
|
return;
|
|
437
439
|
const t = (d) => {
|
|
438
440
|
if (d.key === "Escape") {
|
|
@@ -446,92 +448,96 @@ function Ur(s) {
|
|
|
446
448
|
d.key === "ArrowLeft" && q((i) => i === null ? i : (i - 1 + l.length) % l.length);
|
|
447
449
|
};
|
|
448
450
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
449
|
-
}, qe = [
|
|
451
|
+
}, qe = [H, l.length], e[34] = H, e[35] = l.length, e[36] = Je, e[37] = qe) : (Je = e[36], qe = e[37]), Q(Je, qe);
|
|
450
452
|
let Ge;
|
|
451
|
-
e[38] !== c || e[39] !== v || e[40] !==
|
|
453
|
+
e[38] !== c || e[39] !== v || e[40] !== L ? (Ge = async (t) => {
|
|
452
454
|
if (c)
|
|
453
455
|
return;
|
|
454
|
-
const i = Array.from(t).map((
|
|
455
|
-
const
|
|
456
|
-
y.current.set(u,
|
|
457
|
-
const
|
|
456
|
+
const i = Array.from(t).map((N) => {
|
|
457
|
+
const M = lr(N), u = crypto.randomUUID();
|
|
458
|
+
y.current.set(u, M), $.current.set(u, N);
|
|
459
|
+
const S = {
|
|
458
460
|
id: u,
|
|
459
|
-
url:
|
|
460
|
-
previewUrl:
|
|
461
|
-
alt:
|
|
461
|
+
url: M,
|
|
462
|
+
previewUrl: M,
|
|
463
|
+
alt: N.name,
|
|
462
464
|
status: "uploading",
|
|
463
465
|
progress: 0,
|
|
464
|
-
fileName:
|
|
466
|
+
fileName: N.name
|
|
465
467
|
};
|
|
466
|
-
|
|
467
|
-
const f = (
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
...
|
|
471
|
-
progress:
|
|
468
|
+
E((w) => [...w, S]);
|
|
469
|
+
const f = (w) => {
|
|
470
|
+
const A = Math.max(0, Math.min(99, w));
|
|
471
|
+
E((se) => se.map((P) => P.id === u ? {
|
|
472
|
+
...P,
|
|
473
|
+
progress: A,
|
|
472
474
|
status: "uploading"
|
|
473
|
-
} :
|
|
475
|
+
} : P));
|
|
474
476
|
};
|
|
475
477
|
return (async () => {
|
|
476
|
-
const
|
|
477
|
-
b.current.set(u,
|
|
478
|
+
const w = new AbortController();
|
|
479
|
+
b.current.set(u, w);
|
|
478
480
|
try {
|
|
479
|
-
const
|
|
480
|
-
signal:
|
|
481
|
-
isPublic:
|
|
481
|
+
const A = await v(N, f, {
|
|
482
|
+
signal: w.signal,
|
|
483
|
+
isPublic: L
|
|
482
484
|
});
|
|
483
|
-
G.current.set(u,
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
485
|
+
G.current.set(u, A.id);
|
|
486
|
+
const se = y.current.get(u);
|
|
487
|
+
if (se) {
|
|
486
488
|
y.current.delete(u);
|
|
487
489
|
try {
|
|
488
|
-
URL.revokeObjectURL(
|
|
490
|
+
URL.revokeObjectURL(se);
|
|
489
491
|
} catch {
|
|
490
492
|
}
|
|
491
493
|
}
|
|
492
|
-
b.current.delete(u),
|
|
494
|
+
b.current.delete(u), $.current.delete(u), E((P) => P.map((fe) => fe.id === u ? {
|
|
493
495
|
...fe,
|
|
494
|
-
...
|
|
495
|
-
previewUrl:
|
|
496
|
-
url:
|
|
496
|
+
...A,
|
|
497
|
+
previewUrl: A.url,
|
|
498
|
+
url: A.url,
|
|
497
499
|
status: "uploaded",
|
|
498
|
-
progress: 100
|
|
500
|
+
progress: 100,
|
|
501
|
+
errorMessage: void 0
|
|
499
502
|
} : fe));
|
|
500
|
-
} catch (
|
|
501
|
-
const
|
|
502
|
-
if (b.current.delete(u),
|
|
503
|
-
|
|
504
|
-
const
|
|
505
|
-
if (
|
|
503
|
+
} catch (A) {
|
|
504
|
+
const se = A;
|
|
505
|
+
if (b.current.delete(u), w.signal.aborted) {
|
|
506
|
+
$.current.delete(u);
|
|
507
|
+
const fe = y.current.get(u);
|
|
508
|
+
if (fe) {
|
|
506
509
|
y.current.delete(u);
|
|
507
510
|
try {
|
|
508
|
-
URL.revokeObjectURL(
|
|
511
|
+
URL.revokeObjectURL(fe);
|
|
509
512
|
} catch {
|
|
510
513
|
}
|
|
511
514
|
}
|
|
512
515
|
return;
|
|
513
516
|
}
|
|
514
|
-
console.error("Upload failed",
|
|
515
|
-
|
|
517
|
+
console.error("Upload failed", se);
|
|
518
|
+
const P = Ct(se);
|
|
519
|
+
E((fe) => fe.map((pt) => pt.id === u ? {
|
|
520
|
+
...pt,
|
|
516
521
|
status: "error",
|
|
517
|
-
progress: Math.max(0, Math.min(99,
|
|
518
|
-
|
|
522
|
+
progress: Math.max(0, Math.min(99, pt.progress)),
|
|
523
|
+
errorMessage: P
|
|
524
|
+
} : pt));
|
|
519
525
|
}
|
|
520
526
|
})();
|
|
521
527
|
});
|
|
522
528
|
await Promise.allSettled(i);
|
|
523
|
-
}, e[38] = c, e[39] = v, e[40] =
|
|
529
|
+
}, e[38] = c, e[39] = v, e[40] = L, e[41] = Ge) : Ge = e[41];
|
|
524
530
|
const xe = Ge;
|
|
525
531
|
let Qe;
|
|
526
532
|
e[42] !== xe ? (Qe = (t) => {
|
|
527
533
|
t.target.files && (xe(t.target.files), t.target.value = "");
|
|
528
534
|
}, e[42] = xe, e[43] = Qe) : Qe = e[43];
|
|
529
|
-
const
|
|
535
|
+
const gt = Qe;
|
|
530
536
|
let Ye;
|
|
531
537
|
e[44] !== c ? (Ye = () => {
|
|
532
538
|
c || be.current?.click();
|
|
533
539
|
}, e[44] = c, e[45] = Ye) : Ye = e[45];
|
|
534
|
-
const
|
|
540
|
+
const bt = Ye;
|
|
535
541
|
let Ze;
|
|
536
542
|
e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ze = (t) => {
|
|
537
543
|
const d = b.current.get(t);
|
|
@@ -542,7 +548,7 @@ function Ur(s) {
|
|
|
542
548
|
} catch {
|
|
543
549
|
}
|
|
544
550
|
}
|
|
545
|
-
|
|
551
|
+
$.current.delete(t);
|
|
546
552
|
const i = y.current.get(t);
|
|
547
553
|
if (i) {
|
|
548
554
|
y.current.delete(t);
|
|
@@ -551,14 +557,14 @@ function Ur(s) {
|
|
|
551
557
|
} catch {
|
|
552
558
|
}
|
|
553
559
|
}
|
|
554
|
-
|
|
560
|
+
E((N) => N.filter((M) => M.id !== t));
|
|
555
561
|
}, e[46] = Ze) : Ze = e[46];
|
|
556
|
-
const
|
|
562
|
+
const zt = Ze;
|
|
557
563
|
let et;
|
|
558
|
-
e[47] !== c || e[48] !== v || e[49] !==
|
|
564
|
+
e[47] !== c || e[48] !== v || e[49] !== L ? (et = (t) => {
|
|
559
565
|
if (c)
|
|
560
566
|
return;
|
|
561
|
-
const d =
|
|
567
|
+
const d = $.current.get(t);
|
|
562
568
|
if (!d)
|
|
563
569
|
return;
|
|
564
570
|
const i = b.current.get(t);
|
|
@@ -569,60 +575,65 @@ function Ur(s) {
|
|
|
569
575
|
}
|
|
570
576
|
b.current.delete(t);
|
|
571
577
|
}
|
|
572
|
-
|
|
573
|
-
...
|
|
578
|
+
E((u) => u.map((S) => S.id === t ? {
|
|
579
|
+
...S,
|
|
574
580
|
status: "uploading",
|
|
575
|
-
progress: 0
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
581
|
+
progress: 0,
|
|
582
|
+
errorMessage: void 0
|
|
583
|
+
} : S));
|
|
584
|
+
const N = (u) => {
|
|
585
|
+
const S = Math.max(0, Math.min(99, u));
|
|
586
|
+
E((f) => f.map((p) => p.id === t ? {
|
|
587
|
+
...p,
|
|
588
|
+
progress: S,
|
|
582
589
|
status: "uploading"
|
|
583
|
-
} :
|
|
584
|
-
},
|
|
585
|
-
b.current.set(t,
|
|
590
|
+
} : p));
|
|
591
|
+
}, M = new AbortController();
|
|
592
|
+
b.current.set(t, M), (async () => {
|
|
586
593
|
try {
|
|
587
|
-
const u = await v(d,
|
|
588
|
-
signal:
|
|
589
|
-
isPublic:
|
|
594
|
+
const u = await v(d, N, {
|
|
595
|
+
signal: M.signal,
|
|
596
|
+
isPublic: L
|
|
590
597
|
});
|
|
591
598
|
G.current.set(t, u.id);
|
|
592
|
-
const
|
|
593
|
-
if (
|
|
599
|
+
const S = y.current.get(t);
|
|
600
|
+
if (S) {
|
|
594
601
|
y.current.delete(t);
|
|
595
602
|
try {
|
|
596
|
-
URL.revokeObjectURL(
|
|
603
|
+
URL.revokeObjectURL(S);
|
|
597
604
|
} catch {
|
|
598
605
|
}
|
|
599
606
|
}
|
|
600
|
-
b.current.delete(t),
|
|
601
|
-
...
|
|
607
|
+
b.current.delete(t), $.current.delete(t), E((f) => f.map((p) => p.id === t ? {
|
|
608
|
+
...p,
|
|
602
609
|
...u,
|
|
603
610
|
previewUrl: u.url,
|
|
604
611
|
url: u.url,
|
|
605
612
|
status: "uploaded",
|
|
606
|
-
progress: 100
|
|
607
|
-
|
|
613
|
+
progress: 100,
|
|
614
|
+
errorMessage: void 0
|
|
615
|
+
} : p));
|
|
608
616
|
} catch (u) {
|
|
609
|
-
const
|
|
610
|
-
if (b.current.delete(t),
|
|
617
|
+
const S = u;
|
|
618
|
+
if (b.current.delete(t), M.signal.aborted)
|
|
611
619
|
return;
|
|
612
|
-
console.error("Retry failed",
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
620
|
+
console.error("Retry failed", S);
|
|
621
|
+
const f = Ct(S);
|
|
622
|
+
E((p) => p.map((w) => w.id === t ? {
|
|
623
|
+
...w,
|
|
624
|
+
status: "error",
|
|
625
|
+
errorMessage: f
|
|
626
|
+
} : w));
|
|
616
627
|
}
|
|
617
628
|
})();
|
|
618
|
-
}, e[47] = c, e[48] = v, e[49] =
|
|
619
|
-
const
|
|
629
|
+
}, e[47] = c, e[48] = v, e[49] = L, e[50] = et) : et = e[50];
|
|
630
|
+
const vt = et;
|
|
620
631
|
let tt;
|
|
621
632
|
e[51] !== l ? (tt = (t) => {
|
|
622
633
|
const d = l.findIndex((i) => i.id === t);
|
|
623
634
|
d !== -1 && q(d);
|
|
624
635
|
}, e[51] = l, e[52] = tt) : tt = e[52];
|
|
625
|
-
const
|
|
636
|
+
const yt = tt;
|
|
626
637
|
let rt;
|
|
627
638
|
e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (rt = (t) => {
|
|
628
639
|
Y(String(t.active.id));
|
|
@@ -638,10 +649,10 @@ function Ur(s) {
|
|
|
638
649
|
Y(null);
|
|
639
650
|
return;
|
|
640
651
|
}
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
const
|
|
644
|
-
return
|
|
652
|
+
const N = String(d.id), M = String(i.id);
|
|
653
|
+
N !== M && E((u) => {
|
|
654
|
+
const S = u.findIndex((p) => p.id === N), f = u.findIndex((p) => p.id === M);
|
|
655
|
+
return S === -1 || f === -1 ? u : Wt(u, S, f);
|
|
645
656
|
}), Y(null);
|
|
646
657
|
}, e[54] = st) : st = e[54];
|
|
647
658
|
const Pt = st;
|
|
@@ -649,24 +660,24 @@ function Ur(s) {
|
|
|
649
660
|
e[55] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (nt = () => {
|
|
650
661
|
Y(null);
|
|
651
662
|
}, e[55] = nt) : nt = e[55];
|
|
652
|
-
const
|
|
663
|
+
const Dt = nt;
|
|
653
664
|
let lt;
|
|
654
665
|
e[56] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (lt = () => {
|
|
655
|
-
|
|
666
|
+
O.current !== null && (window.clearTimeout(O.current), O.current = null);
|
|
656
667
|
}, e[56] = lt) : lt = e[56];
|
|
657
|
-
const
|
|
658
|
-
let
|
|
668
|
+
const Nt = lt;
|
|
669
|
+
let wt;
|
|
659
670
|
e: {
|
|
660
|
-
if (
|
|
661
|
-
|
|
671
|
+
if (H === null) {
|
|
672
|
+
wt = null;
|
|
662
673
|
break e;
|
|
663
674
|
}
|
|
664
|
-
|
|
675
|
+
wt = l[H] ?? null;
|
|
665
676
|
}
|
|
666
|
-
const
|
|
677
|
+
const Pe = wt, xt = Ae && "border-primary ring-2 ring-primary/50", jt = c && "opacity-70";
|
|
667
678
|
let ot;
|
|
668
|
-
e[57] !==
|
|
669
|
-
const
|
|
679
|
+
e[57] !== xt || e[58] !== jt ? (ot = mt("rounded-xl border border-dashed border-slate-300 bg-white/70 p-4 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/60", xt, jt), e[57] = xt, e[58] = jt, e[59] = ot) : ot = e[59];
|
|
680
|
+
const kt = ot;
|
|
670
681
|
let at;
|
|
671
682
|
e: {
|
|
672
683
|
if (!K) {
|
|
@@ -682,9 +693,9 @@ function Ur(s) {
|
|
|
682
693
|
}
|
|
683
694
|
const he = at;
|
|
684
695
|
let ge;
|
|
685
|
-
if (e[62] !== he || e[63] !==
|
|
696
|
+
if (e[62] !== he || e[63] !== R) {
|
|
686
697
|
e: {
|
|
687
|
-
if (
|
|
698
|
+
if (R) {
|
|
688
699
|
ge = !1;
|
|
689
700
|
break e;
|
|
690
701
|
}
|
|
@@ -692,111 +703,111 @@ function Ur(s) {
|
|
|
692
703
|
ge = !1;
|
|
693
704
|
break e;
|
|
694
705
|
}
|
|
695
|
-
const t = he.split(",").map(
|
|
706
|
+
const t = he.split(",").map(ur).filter(Boolean);
|
|
696
707
|
if (!t.length) {
|
|
697
708
|
ge = !1;
|
|
698
709
|
break e;
|
|
699
710
|
}
|
|
700
|
-
ge = t.every(
|
|
711
|
+
ge = t.every(cr);
|
|
701
712
|
}
|
|
702
|
-
e[62] = he, e[63] =
|
|
713
|
+
e[62] = he, e[63] = R, e[64] = ge;
|
|
703
714
|
} else
|
|
704
715
|
ge = e[64];
|
|
705
|
-
const re = ge,
|
|
716
|
+
const re = ge, Kt = ir;
|
|
706
717
|
let it;
|
|
707
|
-
e[65] !==
|
|
708
|
-
const t = l.find((d) => d.id ===
|
|
718
|
+
e[65] !== C || e[66] !== re || e[67] !== l || e[68] !== R ? (it = C ? (() => {
|
|
719
|
+
const t = l.find((d) => d.id === C);
|
|
709
720
|
if (!t)
|
|
710
721
|
return null;
|
|
711
|
-
if (
|
|
712
|
-
const d =
|
|
722
|
+
if (R) {
|
|
723
|
+
const d = R(Kt(t));
|
|
713
724
|
return d == null || d === !1 ? null : /* @__PURE__ */ n.jsx("div", { className: "pointer-events-none", children: /* @__PURE__ */ n.jsx("div", { className: "h-24 w-24 overflow-hidden rounded-lg shadow-2xl", children: d }) });
|
|
714
725
|
}
|
|
715
|
-
return re ? /* @__PURE__ */ n.jsx("div", { className: "pointer-events-none", children: /* @__PURE__ */ n.jsx(
|
|
716
|
-
})() : null, e[65] =
|
|
717
|
-
const
|
|
718
|
-
let
|
|
719
|
-
e[70] !== c ? (
|
|
726
|
+
return re ? /* @__PURE__ */ n.jsx("div", { className: "pointer-events-none", children: /* @__PURE__ */ n.jsx(ht, { src: t.previewUrl, alt: t.alt ?? "Dragged image", sizes: "96px", className: "h-24 w-24 rounded-lg object-cover shadow-2xl" }) }) : null;
|
|
727
|
+
})() : null, e[65] = C, e[66] = re, e[67] = l, e[68] = R, e[69] = it) : it = e[69];
|
|
728
|
+
const De = it, St = De != null;
|
|
729
|
+
let je;
|
|
730
|
+
e[70] !== c ? (je = (t) => {
|
|
720
731
|
t.preventDefault(), c || ve(!0);
|
|
721
|
-
}, e[70] = c, e[71] =
|
|
732
|
+
}, e[70] = c, e[71] = je) : je = e[71];
|
|
722
733
|
let ct;
|
|
723
734
|
e[72] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ct = () => ve(!1), e[72] = ct) : ct = e[72];
|
|
724
|
-
let
|
|
725
|
-
e[73] !== xe ? (
|
|
735
|
+
let ke;
|
|
736
|
+
e[73] !== xe ? (ke = (t) => {
|
|
726
737
|
t.preventDefault(), ve(!1), t.dataTransfer.files?.length && xe(t.dataTransfer.files);
|
|
727
|
-
}, e[73] = xe, e[74] =
|
|
738
|
+
}, e[73] = xe, e[74] = ke) : ke = e[74];
|
|
728
739
|
let Se;
|
|
729
740
|
e[75] !== B ? (Se = B ? /* @__PURE__ */ n.jsx("div", { className: "mb-3", children: B() }) : null, e[75] = B, e[76] = Se) : Se = e[76];
|
|
730
|
-
const
|
|
741
|
+
const Ut = c ? void 0 : de;
|
|
731
742
|
let Ue;
|
|
732
|
-
e[77] !== l ? (Ue = l.map(
|
|
743
|
+
e[77] !== l ? (Ue = l.map(ar), e[77] = l, e[78] = Ue) : Ue = e[78];
|
|
733
744
|
let Ne;
|
|
734
|
-
e[79] !==
|
|
745
|
+
e[79] !== C || e[80] !== c || e[81] !== re || e[82] !== St || e[83] !== le || e[84] !== l || e[85] !== j || e[86] !== R || e[87] !== vt || e[88] !== yt ? (Ne = l.map((t) => {
|
|
735
746
|
const d = t.status === "uploading", i = t.status === "error";
|
|
736
|
-
return /* @__PURE__ */ n.jsx(
|
|
737
|
-
|
|
747
|
+
return /* @__PURE__ */ n.jsx(nr, { item: t, isHovered: le === t.id, enableImagePreview: re, renderItem: R, onHoverEnter: () => {
|
|
748
|
+
Nt(), pe(t.id);
|
|
738
749
|
}, onHoverLeave: () => {
|
|
739
|
-
|
|
740
|
-
|
|
750
|
+
Nt(), O.current = window.setTimeout(() => {
|
|
751
|
+
pe((N) => N === t.id ? null : N), O.current = null;
|
|
741
752
|
}, 120);
|
|
742
|
-
}, onRemove:
|
|
743
|
-
}), e[79] =
|
|
753
|
+
}, onRemove: zt, onRetry: vt, startFullscreen: yt, isUploading: d, isError: i, tileClasses: "group relative size-20 overflow-visible rounded-lg border border-slate-200 bg-slate-50 shadow-inner transition hover:shadow md:size-24 dark:border-slate-700 dark:bg-slate-800", disabled: c, isDraggingExternal: St && C === t.id, removeButtonAriaLabel: j }, t.id);
|
|
754
|
+
}), e[79] = C, e[80] = c, e[81] = re, e[82] = St, e[83] = le, e[84] = l, e[85] = j, e[86] = R, e[87] = vt, e[88] = yt, e[89] = Ne) : Ne = e[89];
|
|
744
755
|
let ut;
|
|
745
756
|
e[90] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ut = mt("group relative size-20 overflow-visible rounded-lg border border-slate-200 bg-slate-50 shadow-inner transition hover:shadow md:size-24 dark:border-slate-700 dark:bg-slate-800", "flex items-center justify-center border-dashed bg-white text-slate-500 hover:border-slate-300 dark:bg-slate-900"), e[90] = ut) : ut = e[90];
|
|
746
757
|
let dt;
|
|
747
758
|
e[91] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (dt = /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
|
|
748
|
-
/* @__PURE__ */ n.jsx("div", { className: "flex size-9 items-center justify-center rounded-full border border-slate-300 bg-slate-100 text-slate-600 shadow-inner dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200", children: /* @__PURE__ */ n.jsx(
|
|
759
|
+
/* @__PURE__ */ n.jsx("div", { className: "flex size-9 items-center justify-center rounded-full border border-slate-300 bg-slate-100 text-slate-600 shadow-inner dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200", children: /* @__PURE__ */ n.jsx(Zt, { className: "h-5 w-5" }) }),
|
|
749
760
|
/* @__PURE__ */ n.jsx("span", { className: "text-xs font-medium", children: "Ajouter" })
|
|
750
761
|
] }), e[91] = dt) : dt = e[91];
|
|
751
762
|
let Ie;
|
|
752
|
-
e[92] !== z || e[93] !== c || e[94] !==
|
|
763
|
+
e[92] !== z || e[93] !== c || e[94] !== bt ? (Ie = /* @__PURE__ */ n.jsx("button", { type: "button", onClick: bt, disabled: c, className: ut, "aria-label": z, children: dt }), e[92] = z, e[93] = c, e[94] = bt, e[95] = Ie) : Ie = e[95];
|
|
753
764
|
let Re;
|
|
754
765
|
e[96] !== Ne || e[97] !== Ie ? (Re = /* @__PURE__ */ n.jsxs("div", { className: "flex flex-wrap gap-3", children: [
|
|
755
766
|
Ne,
|
|
756
767
|
Ie
|
|
757
768
|
] }), e[96] = Ne, e[97] = Ie, e[98] = Re) : Re = e[98];
|
|
758
769
|
let Ce;
|
|
759
|
-
e[99] !== Ue || e[100] !== Re ? (Ce = /* @__PURE__ */ n.jsx(
|
|
770
|
+
e[99] !== Ue || e[100] !== Re ? (Ce = /* @__PURE__ */ n.jsx(Jt, { items: Ue, strategy: qt, children: Re }), e[99] = Ue, e[100] = Re, e[101] = Ce) : Ce = e[101];
|
|
760
771
|
let Ke;
|
|
761
772
|
e: {
|
|
762
773
|
let t;
|
|
763
|
-
e[102] !==
|
|
774
|
+
e[102] !== De ? (t = /* @__PURE__ */ n.jsx($t, { children: De }), e[102] = De, e[103] = t) : t = e[103];
|
|
764
775
|
const d = t;
|
|
765
776
|
if (typeof document > "u") {
|
|
766
777
|
Ke = d;
|
|
767
778
|
break e;
|
|
768
779
|
}
|
|
769
780
|
let i;
|
|
770
|
-
e[104] !== d ? (i =
|
|
781
|
+
e[104] !== d ? (i = Et(d, document.body), e[104] = d, e[105] = i) : i = e[105], Ke = i;
|
|
771
782
|
}
|
|
772
783
|
let Le;
|
|
773
|
-
e[106] !==
|
|
784
|
+
e[106] !== Ut || e[107] !== Ce || e[108] !== Ke ? (Le = /* @__PURE__ */ n.jsxs(Bt, { sensors: Ut, collisionDetection: _t, onDragStart: At, onDragEnd: Pt, onDragCancel: Dt, children: [
|
|
774
785
|
Ce,
|
|
775
786
|
Ke
|
|
776
|
-
] }), e[106] =
|
|
777
|
-
let
|
|
778
|
-
e[110] !== he || e[111] !==
|
|
779
|
-
let
|
|
780
|
-
e[113] !== re || e[114] !==
|
|
787
|
+
] }), e[106] = Ut, e[107] = Ce, e[108] = Ke, e[109] = Le) : Le = e[109];
|
|
788
|
+
let Ee;
|
|
789
|
+
e[110] !== he || e[111] !== gt ? (Ee = /* @__PURE__ */ n.jsx("input", { ref: be, type: "file", accept: he, multiple: !0, className: "hidden", onChange: gt, "aria-hidden": !0 }), e[110] = he, e[111] = gt, e[112] = Ee) : Ee = e[112];
|
|
790
|
+
let Me;
|
|
791
|
+
e[113] !== re || e[114] !== Pe || e[115] !== l.length ? (Me = re && Pe && /* @__PURE__ */ n.jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/90", children: [
|
|
781
792
|
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute left-6 top-1/2 -translate-y-1/2 rounded-full bg-white/10 p-3 text-white shadow-lg transition hover:bg-white/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () => q((t) => t === null ? t : (t - 1 + l.length) % l.length), "aria-label": "Précédent", children: /* @__PURE__ */ n.jsx("svg", { viewBox: "0 0 24 24", className: "h-6 w-6", stroke: "currentColor", strokeWidth: 2, fill: "none", children: /* @__PURE__ */ n.jsx("path", { d: "M15 18l-6-6 6-6", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
782
793
|
/* @__PURE__ */ n.jsxs("div", { className: "relative max-h-[80vh] max-w-4xl", children: [
|
|
783
|
-
/* @__PURE__ */ n.jsx(
|
|
784
|
-
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute right-3 top-3 inline-flex size-9 items-center justify-center rounded-full bg-black/70 text-white transition hover:bg-black focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () => q(null), "aria-label": "Fermer", children: /* @__PURE__ */ n.jsx(
|
|
794
|
+
/* @__PURE__ */ n.jsx(ht, { src: Pe.url, alt: Pe.alt ?? "Fullscreen", sizes: "(max-width: 1024px) 100vw, 1024px", className: "max-h-[80vh] max-w-full rounded-lg object-contain shadow-2xl" }),
|
|
795
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute right-3 top-3 inline-flex size-9 items-center justify-center rounded-full bg-black/70 text-white transition hover:bg-black focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () => q(null), "aria-label": "Fermer", children: /* @__PURE__ */ n.jsx(Mt, { className: "h-5 w-5" }) })
|
|
785
796
|
] }),
|
|
786
797
|
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute right-6 top-1/2 -translate-y-1/2 rounded-full bg-white/10 p-3 text-white shadow-lg transition hover:bg-white/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () => q((t) => t === null ? t : (t + 1) % l.length), "aria-label": "Suivant", children: /* @__PURE__ */ n.jsx("svg", { viewBox: "0 0 24 24", className: "h-6 w-6", stroke: "currentColor", strokeWidth: 2, fill: "none", children: /* @__PURE__ */ n.jsx("path", { d: "M9 6l6 6-6 6", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
787
|
-
] }), e[113] = re, e[114] =
|
|
798
|
+
] }), e[113] = re, e[114] = Pe, e[115] = l.length, e[116] = Me) : Me = e[116];
|
|
788
799
|
let ft;
|
|
789
|
-
return e[117] !==
|
|
800
|
+
return e[117] !== kt || e[118] !== je || e[119] !== ke || e[120] !== Se || e[121] !== Le || e[122] !== Ee || e[123] !== Me ? (ft = /* @__PURE__ */ n.jsxs("div", { onDragOver: je, onDragLeave: ct, onDrop: ke, className: kt, children: [
|
|
790
801
|
Se,
|
|
791
802
|
Le,
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
] }), e[117] =
|
|
803
|
+
Ee,
|
|
804
|
+
Me
|
|
805
|
+
] }), e[117] = kt, e[118] = je, e[119] = ke, e[120] = Se, e[121] = Le, e[122] = Ee, e[123] = Me, e[124] = ft) : ft = e[124], ft;
|
|
795
806
|
}
|
|
796
|
-
function
|
|
807
|
+
function ar(s) {
|
|
797
808
|
return s.id;
|
|
798
809
|
}
|
|
799
|
-
function
|
|
810
|
+
function ir(s) {
|
|
800
811
|
return {
|
|
801
812
|
file: {
|
|
802
813
|
id: s.id,
|
|
@@ -810,39 +821,39 @@ function nr(s) {
|
|
|
810
821
|
fileName: s.fileName
|
|
811
822
|
};
|
|
812
823
|
}
|
|
813
|
-
function
|
|
814
|
-
return s === "image/*" || s.startsWith("image/");
|
|
824
|
+
function cr(s) {
|
|
825
|
+
return s === "image/*" || s.startsWith("image/") || s === ".heic" || s === ".heif" || s === ".heics" || s === ".heifs";
|
|
815
826
|
}
|
|
816
|
-
function
|
|
827
|
+
function ur(s) {
|
|
817
828
|
return s.trim();
|
|
818
829
|
}
|
|
819
|
-
function
|
|
830
|
+
function dr(s) {
|
|
820
831
|
return s.status === "uploading";
|
|
821
832
|
}
|
|
822
|
-
function
|
|
833
|
+
function fr(s) {
|
|
823
834
|
const {
|
|
824
835
|
id: e,
|
|
825
836
|
url: r,
|
|
826
837
|
alt: o,
|
|
827
|
-
uploadKey:
|
|
838
|
+
uploadKey: m
|
|
828
839
|
} = s;
|
|
829
840
|
return {
|
|
830
841
|
id: e,
|
|
831
842
|
url: r,
|
|
832
843
|
alt: o,
|
|
833
|
-
uploadKey:
|
|
844
|
+
uploadKey: m
|
|
834
845
|
};
|
|
835
846
|
}
|
|
836
|
-
function
|
|
847
|
+
function pr(s) {
|
|
837
848
|
return s.id;
|
|
838
849
|
}
|
|
839
|
-
function
|
|
850
|
+
function mr(s) {
|
|
840
851
|
return s.id;
|
|
841
852
|
}
|
|
842
|
-
function
|
|
853
|
+
function hr(s) {
|
|
843
854
|
return s.id;
|
|
844
855
|
}
|
|
845
|
-
function
|
|
856
|
+
function gr(s) {
|
|
846
857
|
return {
|
|
847
858
|
...s,
|
|
848
859
|
previewUrl: s.url,
|
|
@@ -850,10 +861,10 @@ function fr(s) {
|
|
|
850
861
|
progress: 100
|
|
851
862
|
};
|
|
852
863
|
}
|
|
853
|
-
function
|
|
864
|
+
function br() {
|
|
854
865
|
document.body.style.cursor = "";
|
|
855
866
|
}
|
|
856
|
-
function
|
|
867
|
+
function vr(s) {
|
|
857
868
|
return {
|
|
858
869
|
...s,
|
|
859
870
|
previewUrl: s.url,
|
|
@@ -862,6 +873,6 @@ function pr(s) {
|
|
|
862
873
|
};
|
|
863
874
|
}
|
|
864
875
|
export {
|
|
865
|
-
|
|
876
|
+
Lr as FilesUploadField
|
|
866
877
|
};
|
|
867
878
|
//# sourceMappingURL=index8.js.map
|