@chaibuilder/pages 0.4.6-beta.1 → 0.4.6-beta.2
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/{B4MFY5CR-CGzb3p_w.cjs → B4MFY5CR-CgKmoZhy.cjs} +1 -1
- package/dist/{B4MFY5CR-BSGjETfq.js → B4MFY5CR-Doi8QlXL.js} +1 -1
- package/dist/{HO4MOOFI-Ccp8Qqm_.cjs → HO4MOOFI-4Q-h7u6O.cjs} +1 -1
- package/dist/{HO4MOOFI-SiC6h0G4.js → HO4MOOFI-CWU4gOCj.js} +2 -2
- package/dist/{HUY7CZI3-Ew2voVO9.js → HUY7CZI3-BuVBFUXg.js} +2 -2
- package/dist/{HUY7CZI3-IOf8eDrC.cjs → HUY7CZI3-CEnI5Lww.cjs} +1 -1
- package/dist/digital-asset-manager-CE2qYOMT.cjs +1 -0
- package/dist/{digital-asset-manager-Dh6jIXs5.js → digital-asset-manager-Scnvw98W.js} +144 -144
- package/dist/{index-CG2G27hJ.js → index-Ci9oNrDB.js} +3 -3
- package/dist/{index-Ce2dcOYb.cjs → index-sSI8ulEa.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/digital-asset-manager-D2jxRx3b.cjs +0 -1
|
@@ -1,179 +1,179 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, Fragment as j, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import W, { useState as T, useCallback as C, useMemo as ne, useRef as oe, useEffect as ce, Suspense as Y } from "react";
|
|
3
3
|
import { mergeClasses as O } from "@chaibuilder/sdk";
|
|
4
4
|
import { Tabs as de, TabsList as ue, TabsTrigger as H, Button as v, TabsContent as V, Input as me, Card as he, CardContent as pe } from "@chaibuilder/sdk/ui";
|
|
5
|
-
import { debounce as
|
|
5
|
+
import { debounce as fe, find as ge, merge as ve } from "lodash-es";
|
|
6
6
|
import { Search as xe, Film as ye, ImageIcon as Ne, Edit as Se, Trash2 as we, Loader2 as _, Upload as Ae } from "lucide-react";
|
|
7
7
|
import { useDropzone as be } from "react-dropzone";
|
|
8
8
|
import { useQueryClient as B, useMutation as Q, useInfiniteQuery as Ee } from "@tanstack/react-query";
|
|
9
9
|
import { toast as N } from "sonner";
|
|
10
|
-
import { W as
|
|
10
|
+
import { W as z, X as M, Y as f, Z as Ce } from "./index-Ci9oNrDB.js";
|
|
11
11
|
const Te = () => {
|
|
12
|
-
const
|
|
12
|
+
const l = z(), n = B(), o = M();
|
|
13
13
|
return Q({
|
|
14
14
|
mutationFn: async ({
|
|
15
15
|
file: r,
|
|
16
16
|
folderId: c,
|
|
17
|
-
name:
|
|
18
|
-
}) => o(
|
|
19
|
-
action:
|
|
20
|
-
data: { file: r, folderId: c, name:
|
|
17
|
+
name: t
|
|
18
|
+
}) => o(l, {
|
|
19
|
+
action: f.UPLOAD_ASSET,
|
|
20
|
+
data: { file: r, folderId: c, name: t }
|
|
21
21
|
}),
|
|
22
22
|
onSuccess: () => {
|
|
23
23
|
n.invalidateQueries({
|
|
24
|
-
queryKey: [
|
|
24
|
+
queryKey: [f.GET_ASSETS]
|
|
25
25
|
}), N.success("Asset uploaded successfully");
|
|
26
26
|
},
|
|
27
27
|
onError: () => {
|
|
28
28
|
N.error("Failed to upload asset");
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
},
|
|
32
|
-
const
|
|
31
|
+
}, Ue = () => {
|
|
32
|
+
const l = z(), n = B(), o = M();
|
|
33
33
|
return Q({
|
|
34
|
-
mutationFn: async (r) => o(
|
|
35
|
-
action:
|
|
34
|
+
mutationFn: async (r) => o(l, {
|
|
35
|
+
action: f.DELETE_ASSET,
|
|
36
36
|
data: { id: r }
|
|
37
37
|
}),
|
|
38
38
|
onSuccess: () => {
|
|
39
39
|
n.invalidateQueries({
|
|
40
|
-
queryKey: [
|
|
40
|
+
queryKey: [f.GET_ASSETS]
|
|
41
41
|
}), N.success("Asset deleted successfully");
|
|
42
42
|
},
|
|
43
43
|
onError: () => {
|
|
44
44
|
N.error("Failed to delete asset");
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
},
|
|
48
|
-
const
|
|
47
|
+
}, Fe = () => {
|
|
48
|
+
const l = z(), n = B(), o = M();
|
|
49
49
|
return Q({
|
|
50
|
-
mutationFn: async (r) => o(
|
|
51
|
-
action:
|
|
50
|
+
mutationFn: async (r) => o(l, {
|
|
51
|
+
action: f.UPDATE_ASSET,
|
|
52
52
|
data: r
|
|
53
53
|
}),
|
|
54
54
|
onSuccess: () => {
|
|
55
55
|
n.invalidateQueries({
|
|
56
|
-
queryKey: [
|
|
56
|
+
queryKey: [f.GET_ASSETS]
|
|
57
57
|
}), N.success("Asset updated successfully");
|
|
58
58
|
},
|
|
59
59
|
onError: () => {
|
|
60
60
|
N.error("Failed to update asset");
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
},
|
|
64
|
-
const n =
|
|
63
|
+
}, ze = (l = {}) => {
|
|
64
|
+
const n = z(), o = M(), { search: r, limit: c = 10 } = l;
|
|
65
65
|
return Ee({
|
|
66
|
-
queryKey: [Ce,
|
|
67
|
-
queryFn: async ({ pageParam:
|
|
68
|
-
action:
|
|
66
|
+
queryKey: [Ce, f.GET_ASSETS, { search: r, limit: c }],
|
|
67
|
+
queryFn: async ({ pageParam: t = 1 }) => (await o(n, {
|
|
68
|
+
action: f.GET_ASSETS,
|
|
69
69
|
data: {
|
|
70
70
|
search: r,
|
|
71
|
-
page:
|
|
71
|
+
page: t,
|
|
72
72
|
limit: c
|
|
73
73
|
}
|
|
74
74
|
})).data,
|
|
75
75
|
initialPageParam: 1,
|
|
76
|
-
getNextPageParam: (
|
|
77
|
-
getPreviousPageParam: (
|
|
76
|
+
getNextPageParam: (t) => ((t == null ? void 0 : t.page) ?? 0) * ((t == null ? void 0 : t.pageSize) ?? 0) < ((t == null ? void 0 : t.total) ?? 0) ? (t.page ?? 0) + 1 : void 0,
|
|
77
|
+
getPreviousPageParam: (t) => (t.page ?? 0) > 1 ? (t.page ?? 0) - 1 : void 0,
|
|
78
78
|
retry: 1
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
-
function
|
|
81
|
+
function Me() {
|
|
82
82
|
const [n, o] = T([]), [r, c] = T({
|
|
83
83
|
query: "",
|
|
84
84
|
pageSize: 10
|
|
85
|
-
}),
|
|
85
|
+
}), t = fe(() => r.query, 300)(), {
|
|
86
86
|
data: d,
|
|
87
87
|
isLoading: S,
|
|
88
88
|
fetchNextPage: w,
|
|
89
89
|
hasNextPage: u,
|
|
90
|
-
isFetchingNextPage:
|
|
91
|
-
} =
|
|
92
|
-
search: (
|
|
90
|
+
isFetchingNextPage: g
|
|
91
|
+
} = ze({
|
|
92
|
+
search: (t == null ? void 0 : t.toLowerCase().trim()) || "",
|
|
93
93
|
limit: r.pageSize
|
|
94
|
-
}),
|
|
95
|
-
u && !
|
|
96
|
-
}, [w, u,
|
|
94
|
+
}), D = (d == null ? void 0 : d.pages.flatMap((p) => p.assets)) || [], { mutate: x, isPaused: h } = Fe(), { mutate: A, isPending: y } = Te(), { mutate: b, isPending: U } = Ue(), I = C(() => {
|
|
95
|
+
u && !g && w();
|
|
96
|
+
}, [w, u, g]), E = C((p) => {
|
|
97
97
|
c((m) => ({
|
|
98
98
|
...m,
|
|
99
99
|
query: p
|
|
100
100
|
}));
|
|
101
|
-
}, []),
|
|
101
|
+
}, []), k = C(
|
|
102
102
|
(p) => {
|
|
103
|
-
o((m) =>
|
|
103
|
+
o((m) => ge(m, { id: p.id }) ? [] : [p]);
|
|
104
104
|
},
|
|
105
105
|
[!1]
|
|
106
|
-
),
|
|
106
|
+
), q = C(() => {
|
|
107
107
|
o([]);
|
|
108
108
|
}, []);
|
|
109
109
|
return {
|
|
110
110
|
// Data
|
|
111
111
|
query: (r == null ? void 0 : r.query) || "",
|
|
112
112
|
selectedAssets: n,
|
|
113
|
-
assets:
|
|
113
|
+
assets: D,
|
|
114
114
|
hasNextPage: u,
|
|
115
|
-
isFetchingNextPage:
|
|
115
|
+
isFetchingNextPage: g,
|
|
116
116
|
// Mutations
|
|
117
117
|
uploadAsset: A,
|
|
118
118
|
updateAsset: x,
|
|
119
119
|
deleteAsset: b,
|
|
120
|
-
loadMoreAssets:
|
|
120
|
+
loadMoreAssets: I,
|
|
121
121
|
updateSearchQuery: E,
|
|
122
|
-
clearSelectedAssets:
|
|
123
|
-
updateSelectedAssets:
|
|
122
|
+
clearSelectedAssets: q,
|
|
123
|
+
updateSelectedAssets: k,
|
|
124
124
|
// Loading
|
|
125
125
|
isLoadingAssets: S,
|
|
126
126
|
isUploadingAsset: y,
|
|
127
127
|
isUpdatingAsset: h,
|
|
128
|
-
isDeletingAsset:
|
|
128
|
+
isDeletingAsset: U
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const De = W.lazy(() => import("./asset-metadata-editor-CEFwXx62.js")), Ie = W.lazy(() => import("./image-editor-BQ6_F-iv.js"));
|
|
132
132
|
function Oe({
|
|
133
|
-
close:
|
|
133
|
+
close: l,
|
|
134
134
|
onSelect: n,
|
|
135
135
|
mode: o = "image"
|
|
136
136
|
}) {
|
|
137
|
-
const c = ne(() => [o], [o]), [
|
|
137
|
+
const c = ne(() => [o], [o]), [t, d] = T("browse"), [S, w] = T(null), [u, g] = T({ show: !1, file: "", name: "" }), {
|
|
138
138
|
// Data
|
|
139
|
-
query:
|
|
139
|
+
query: D,
|
|
140
140
|
assets: x,
|
|
141
141
|
selectedAssets: h,
|
|
142
142
|
hasNextPage: A,
|
|
143
143
|
isFetchingNextPage: y,
|
|
144
144
|
// Mutations
|
|
145
145
|
uploadAsset: b,
|
|
146
|
-
updateAsset:
|
|
147
|
-
deleteAsset:
|
|
146
|
+
updateAsset: U,
|
|
147
|
+
deleteAsset: I,
|
|
148
148
|
loadMoreAssets: E,
|
|
149
|
-
updateSearchQuery:
|
|
150
|
-
clearSelectedAssets:
|
|
149
|
+
updateSearchQuery: k,
|
|
150
|
+
clearSelectedAssets: q,
|
|
151
151
|
updateSelectedAssets: p,
|
|
152
152
|
// Loading
|
|
153
153
|
isLoadingAssets: m,
|
|
154
154
|
isUploadingAsset: R,
|
|
155
155
|
isUpdatingAsset: X
|
|
156
156
|
// isDeletingAsset,
|
|
157
|
-
} =
|
|
157
|
+
} = Me(), G = oe(null);
|
|
158
158
|
ce(() => {
|
|
159
|
-
const
|
|
160
|
-
if (!
|
|
161
|
-
const
|
|
162
|
-
|
|
159
|
+
const s = G.current;
|
|
160
|
+
if (!s) return;
|
|
161
|
+
const i = () => {
|
|
162
|
+
s.scrollHeight - s.scrollTop <= s.clientHeight * 1.5 && !m && A && !y && E();
|
|
163
163
|
};
|
|
164
|
-
return
|
|
164
|
+
return s.addEventListener("scroll", i), () => s.removeEventListener("scroll", i);
|
|
165
165
|
}, [m, E, A, y]);
|
|
166
166
|
const Z = C(
|
|
167
|
-
async (
|
|
168
|
-
const K =
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
file:
|
|
167
|
+
async (s) => new Promise((i, L) => {
|
|
168
|
+
const K = s[0], F = new FileReader();
|
|
169
|
+
F.readAsDataURL(K), F.onload = async () => {
|
|
170
|
+
const P = await b({
|
|
171
|
+
file: F.result,
|
|
172
172
|
folderId: null,
|
|
173
173
|
name: K.name
|
|
174
174
|
});
|
|
175
|
-
d("browse"),
|
|
176
|
-
},
|
|
175
|
+
d("browse"), i(P);
|
|
176
|
+
}, F.onerror = (P) => L(P);
|
|
177
177
|
}),
|
|
178
178
|
[b]
|
|
179
179
|
), { getRootProps: J, getInputProps: $, isDragActive: ee } = be({
|
|
@@ -183,49 +183,49 @@ function Oe({
|
|
|
183
183
|
"video/*": c.includes("video") ? [] : []
|
|
184
184
|
},
|
|
185
185
|
maxSize: 10 * 1024 * 1024
|
|
186
|
-
}),
|
|
187
|
-
n([h[0].url]),
|
|
188
|
-
},
|
|
189
|
-
await
|
|
190
|
-
}, te = (
|
|
191
|
-
w(
|
|
192
|
-
}, le = async (
|
|
193
|
-
await
|
|
194
|
-
}, ie = (
|
|
195
|
-
|
|
196
|
-
}, re = async (
|
|
186
|
+
}), se = () => {
|
|
187
|
+
n([h[0].url]), l();
|
|
188
|
+
}, ae = async (s) => {
|
|
189
|
+
await I(s.id);
|
|
190
|
+
}, te = (s) => {
|
|
191
|
+
w(s);
|
|
192
|
+
}, le = async (s, i) => {
|
|
193
|
+
await U(ve(s, i)), l();
|
|
194
|
+
}, ie = (s) => {
|
|
195
|
+
k(s.target.value);
|
|
196
|
+
}, re = async (s, i) => {
|
|
197
197
|
try {
|
|
198
|
-
|
|
199
|
-
file:
|
|
198
|
+
i ? await b({
|
|
199
|
+
file: s,
|
|
200
200
|
folderId: null,
|
|
201
201
|
name: u.name
|
|
202
|
-
}) : await
|
|
203
|
-
} catch (
|
|
204
|
-
console.error("Error saving edited image:",
|
|
202
|
+
}) : await U({ id: u.id, file: s }), g({ show: !1, file: "", name: "" }), d("browse");
|
|
203
|
+
} catch (L) {
|
|
204
|
+
console.error("Error saving edited image:", L);
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
207
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
208
|
+
/* @__PURE__ */ a("div", { className: "min-w-[700px] min-h-[600px] w-[900px] max-w-[900px]", children: [
|
|
209
209
|
/* @__PURE__ */ e("h1", { className: "text-lg font-medium pb-4", children: "Digital Asset Manager" }),
|
|
210
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ a(
|
|
211
211
|
de,
|
|
212
212
|
{
|
|
213
|
-
value:
|
|
214
|
-
onValueChange: (
|
|
213
|
+
value: t,
|
|
214
|
+
onValueChange: (s) => d(s),
|
|
215
215
|
className: "flex-1 flex flex-col h-full",
|
|
216
216
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ a("div", { className: "flex justify-between items-center mb-2", children: [
|
|
218
|
+
/* @__PURE__ */ a(ue, { children: [
|
|
219
219
|
/* @__PURE__ */ e(H, { value: "browse", children: "Browse Assets" }),
|
|
220
220
|
/* @__PURE__ */ e(H, { value: "upload", children: "Upload" })
|
|
221
221
|
] }),
|
|
222
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
223
223
|
h.length > 0 && /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
|
|
224
224
|
v,
|
|
225
225
|
{
|
|
226
226
|
variant: "outline",
|
|
227
227
|
size: "sm",
|
|
228
|
-
onClick: () =>
|
|
228
|
+
onClick: () => q(),
|
|
229
229
|
title: "Clear selection",
|
|
230
230
|
children: "Clear"
|
|
231
231
|
}
|
|
@@ -234,27 +234,27 @@ function Oe({
|
|
|
234
234
|
v,
|
|
235
235
|
{
|
|
236
236
|
size: "sm",
|
|
237
|
-
onClick:
|
|
237
|
+
onClick: se,
|
|
238
238
|
disabled: h.length === 0,
|
|
239
239
|
children: "Select Asset"
|
|
240
240
|
}
|
|
241
241
|
)
|
|
242
242
|
] })
|
|
243
243
|
] }),
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mb-2", children: /* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ a(V, { value: "browse", className: "flex-1 flex flex-col", children: [
|
|
245
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mb-2", children: /* @__PURE__ */ a("div", { className: "relative w-full", children: [
|
|
246
246
|
/* @__PURE__ */ e(xe, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
247
247
|
/* @__PURE__ */ e(
|
|
248
248
|
me,
|
|
249
249
|
{
|
|
250
250
|
placeholder: "Search assets...",
|
|
251
|
-
value:
|
|
251
|
+
value: D,
|
|
252
252
|
onChange: ie,
|
|
253
253
|
className: "pl-8"
|
|
254
254
|
}
|
|
255
255
|
)
|
|
256
256
|
] }) }),
|
|
257
|
-
m && x.length === 0 ? /* @__PURE__ */
|
|
257
|
+
m && x.length === 0 ? /* @__PURE__ */ a("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2 overflow-y-auto max-h-[550px] p-1", children: [
|
|
258
258
|
/* @__PURE__ */ e("div", { className: "bg-gray-200 h-64 w-full animate-pulse rounded" }),
|
|
259
259
|
/* @__PURE__ */ e("div", { className: "bg-gray-200 h-64 w-full animate-pulse rounded" }),
|
|
260
260
|
/* @__PURE__ */ e("div", { className: "bg-gray-200 h-64 w-full animate-pulse rounded" }),
|
|
@@ -265,55 +265,55 @@ function Oe({
|
|
|
265
265
|
/* @__PURE__ */ e("div", { className: "bg-gray-200 h-64 w-full animate-pulse rounded" }),
|
|
266
266
|
/* @__PURE__ */ e("div", { className: "bg-gray-200 h-64 w-full animate-pulse rounded" }),
|
|
267
267
|
/* @__PURE__ */ e("div", { className: "bg-gray-200 h-64 w-full animate-pulse rounded" })
|
|
268
|
-
] }) : x.length === 0 ? /* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
268
|
+
] }) : x.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center h-full text-center p-12 h-[380px]", children: [
|
|
269
|
+
/* @__PURE__ */ a("div", { className: "text-muted-foreground mb-2", children: [
|
|
270
270
|
/* @__PURE__ */ e("h3", { className: "text-gray-800 font-medium", children: "No assets to display" }),
|
|
271
271
|
/* @__PURE__ */ e("p", { className: "text-sm", children: "You haven't uploaded any assets yet. Start by uploading your first asset." })
|
|
272
272
|
] }),
|
|
273
273
|
/* @__PURE__ */ e("div", { className: "flex gap-2 pt-4", children: /* @__PURE__ */ e(v, { size: "lg", onClick: () => d("upload"), children: "Upload Assets" }) })
|
|
274
|
-
] }) : /* @__PURE__ */
|
|
274
|
+
] }) : /* @__PURE__ */ a(
|
|
275
275
|
"div",
|
|
276
276
|
{
|
|
277
277
|
ref: G,
|
|
278
278
|
className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2 overflow-y-auto max-h-[550px] p-1",
|
|
279
279
|
children: [
|
|
280
|
-
x.map((
|
|
280
|
+
x.map((s) => /* @__PURE__ */ e(
|
|
281
281
|
he,
|
|
282
282
|
{
|
|
283
283
|
className: O(
|
|
284
284
|
"cursor-pointer overflow-hidden transition-all",
|
|
285
|
-
h.some((
|
|
285
|
+
h.some((i) => i.id === s.id) ? "ring-2 ring-primary" : "hover:ring-2 hover:ring-primary/20"
|
|
286
286
|
),
|
|
287
|
-
onClick: () => p(
|
|
288
|
-
children: /* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
|
|
287
|
+
onClick: () => p(s),
|
|
288
|
+
children: /* @__PURE__ */ a(pe, { className: "p-0 relative group", children: [
|
|
289
|
+
/* @__PURE__ */ a("div", { className: "aspect-square relative overflow-hidden bg-muted", children: [
|
|
290
|
+
s.type === "image" ? /* @__PURE__ */ e(
|
|
291
291
|
"img",
|
|
292
292
|
{
|
|
293
|
-
src:
|
|
294
|
-
alt:
|
|
293
|
+
src: s.url || "/placeholder.svg",
|
|
294
|
+
alt: s.name,
|
|
295
295
|
className: "object-cover w-full h-full"
|
|
296
296
|
}
|
|
297
|
-
) : /* @__PURE__ */
|
|
297
|
+
) : /* @__PURE__ */ a("div", { className: "flex items-center justify-center h-full", children: [
|
|
298
298
|
/* @__PURE__ */ e(ye, { className: "h-12 w-12 text-muted-foreground" }),
|
|
299
|
-
|
|
299
|
+
s.thumbnailUrl && /* @__PURE__ */ e(
|
|
300
300
|
"img",
|
|
301
301
|
{
|
|
302
|
-
src:
|
|
303
|
-
alt:
|
|
302
|
+
src: s.thumbnailUrl || "/placeholder.svg",
|
|
303
|
+
alt: s.name,
|
|
304
304
|
className: "absolute inset-0 object-cover w-full h-full"
|
|
305
305
|
}
|
|
306
306
|
)
|
|
307
307
|
] }),
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ a("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2", children: [
|
|
309
309
|
/* @__PURE__ */ e(
|
|
310
310
|
v,
|
|
311
311
|
{
|
|
312
312
|
variant: "secondary",
|
|
313
313
|
size: "icon",
|
|
314
314
|
className: "h-8 w-8",
|
|
315
|
-
onClick: (
|
|
316
|
-
|
|
315
|
+
onClick: (i) => {
|
|
316
|
+
i.stopPropagation(), te(s);
|
|
317
317
|
},
|
|
318
318
|
children: /* @__PURE__ */ e(Ne, { className: "h-4 w-4" })
|
|
319
319
|
}
|
|
@@ -324,12 +324,12 @@ function Oe({
|
|
|
324
324
|
variant: "secondary",
|
|
325
325
|
size: "icon",
|
|
326
326
|
className: "h-8 w-8",
|
|
327
|
-
onClick: (
|
|
328
|
-
|
|
329
|
-
id:
|
|
327
|
+
onClick: (i) => {
|
|
328
|
+
i.stopPropagation(), g({
|
|
329
|
+
id: s.id,
|
|
330
330
|
show: !0,
|
|
331
|
-
file:
|
|
332
|
-
name:
|
|
331
|
+
file: s.url,
|
|
332
|
+
name: s.name
|
|
333
333
|
});
|
|
334
334
|
},
|
|
335
335
|
children: /* @__PURE__ */ e(Se, { className: "h-4 w-4" })
|
|
@@ -341,45 +341,45 @@ function Oe({
|
|
|
341
341
|
variant: "destructive",
|
|
342
342
|
size: "icon",
|
|
343
343
|
className: "h-8 w-8",
|
|
344
|
-
onClick: (
|
|
345
|
-
|
|
344
|
+
onClick: (i) => {
|
|
345
|
+
i.stopPropagation(), ae(s);
|
|
346
346
|
},
|
|
347
347
|
children: /* @__PURE__ */ e(we, { className: "h-4 w-4" })
|
|
348
348
|
}
|
|
349
349
|
)
|
|
350
350
|
] }),
|
|
351
|
-
h.some((
|
|
351
|
+
h.some((i) => i.id === s.id) && /* @__PURE__ */ e("div", { className: "absolute top-2 left-2", children: /* @__PURE__ */ e(
|
|
352
352
|
"input",
|
|
353
353
|
{
|
|
354
354
|
type: "checkbox",
|
|
355
355
|
checked: h.some(
|
|
356
|
-
(
|
|
356
|
+
(i) => i.id === s.id
|
|
357
357
|
),
|
|
358
358
|
readOnly: !0,
|
|
359
359
|
className: "rounded-full"
|
|
360
360
|
}
|
|
361
361
|
) })
|
|
362
362
|
] }),
|
|
363
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ a("div", { className: "p-2", children: [
|
|
364
364
|
/* @__PURE__ */ e(
|
|
365
365
|
"div",
|
|
366
366
|
{
|
|
367
367
|
className: "text-sm font-medium truncate",
|
|
368
|
-
title:
|
|
369
|
-
children:
|
|
368
|
+
title: s.name,
|
|
369
|
+
children: s.name
|
|
370
370
|
}
|
|
371
371
|
),
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */ e("span", { children:
|
|
374
|
-
/* @__PURE__ */ e("span", { children:
|
|
372
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground flex items-center justify-between", children: [
|
|
373
|
+
/* @__PURE__ */ e("span", { children: ke((s == null ? void 0 : s.size) || 0) }),
|
|
374
|
+
/* @__PURE__ */ e("span", { children: qe(s.createdAt) })
|
|
375
375
|
] })
|
|
376
376
|
] })
|
|
377
377
|
] })
|
|
378
378
|
},
|
|
379
|
-
|
|
379
|
+
s.id
|
|
380
380
|
)),
|
|
381
381
|
m && x.length > 0 && /* @__PURE__ */ e("div", { className: "col-span-full flex justify-center py-4", children: /* @__PURE__ */ e(_, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }),
|
|
382
|
-
!m && A && /* @__PURE__ */ e("div", { className: "col-span-full flex justify-center py-4", children: /* @__PURE__ */
|
|
382
|
+
!m && A && /* @__PURE__ */ e("div", { className: "col-span-full flex justify-center py-4", children: /* @__PURE__ */ a(
|
|
383
383
|
v,
|
|
384
384
|
{
|
|
385
385
|
variant: "outline",
|
|
@@ -396,7 +396,7 @@ function Oe({
|
|
|
396
396
|
}
|
|
397
397
|
)
|
|
398
398
|
] }),
|
|
399
|
-
/* @__PURE__ */ e(V, { value: "upload", className: "flex-1 ", children: /* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ e(V, { value: "upload", className: "flex-1 ", children: /* @__PURE__ */ a(
|
|
400
400
|
"div",
|
|
401
401
|
{
|
|
402
402
|
...J(),
|
|
@@ -406,20 +406,20 @@ function Oe({
|
|
|
406
406
|
),
|
|
407
407
|
children: [
|
|
408
408
|
/* @__PURE__ */ e("input", { ...$() }),
|
|
409
|
-
X || R ? /* @__PURE__ */
|
|
409
|
+
X || R ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center", children: [
|
|
410
410
|
/* @__PURE__ */ e(_, { className: "h-12 w-12 text-primary animate-spin mb-4" }),
|
|
411
411
|
/* @__PURE__ */ e("h3", { className: "text-lg font-medium mb-1", children: "Uploading files..." }),
|
|
412
412
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Please wait while your files are being processed." })
|
|
413
|
-
] }) : /* @__PURE__ */
|
|
413
|
+
] }) : /* @__PURE__ */ a(j, { children: [
|
|
414
414
|
/* @__PURE__ */ e(Ae, { className: "h-12 w-12 text-muted-foreground mb-4" }),
|
|
415
415
|
/* @__PURE__ */ e("h3", { className: "text-lg font-medium mb-1", children: "Drag & drop files here" }),
|
|
416
416
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-4", children: "or click to browse your files" }),
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
|
|
418
|
+
/* @__PURE__ */ a("p", { children: [
|
|
419
419
|
"Accepted file types: ",
|
|
420
420
|
c.join(", ")
|
|
421
421
|
] }),
|
|
422
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ a("p", { children: [
|
|
423
423
|
"Maximum file size: ",
|
|
424
424
|
10,
|
|
425
425
|
"MB"
|
|
@@ -434,32 +434,32 @@ function Oe({
|
|
|
434
434
|
)
|
|
435
435
|
] }),
|
|
436
436
|
S && /* @__PURE__ */ e(Y, { fallback: /* @__PURE__ */ e("div", { children: "Loading..." }), children: /* @__PURE__ */ e(
|
|
437
|
-
|
|
437
|
+
De,
|
|
438
438
|
{
|
|
439
439
|
asset: S,
|
|
440
|
-
onSave: (
|
|
440
|
+
onSave: (s) => le(S, s),
|
|
441
441
|
onCancel: () => {
|
|
442
442
|
w(null);
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
) }),
|
|
446
446
|
u.show && /* @__PURE__ */ e(Y, { fallback: /* @__PURE__ */ e("div", { children: "Loading..." }), children: /* @__PURE__ */ e(
|
|
447
|
-
|
|
447
|
+
Ie,
|
|
448
448
|
{
|
|
449
449
|
imageUrl: u.file,
|
|
450
450
|
onSave: re,
|
|
451
|
-
onClose: () =>
|
|
451
|
+
onClose: () => g({ show: !1, file: "", name: "" }),
|
|
452
452
|
defaultSavedImageName: u.name,
|
|
453
453
|
isEditing: !!u.id
|
|
454
454
|
}
|
|
455
455
|
) })
|
|
456
456
|
] });
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
return
|
|
458
|
+
function ke(l) {
|
|
459
|
+
return l < 1024 ? l + " B" : l < 1024 * 1024 ? (l / 1024).toFixed(1) + " KB" : l < 1024 * 1024 * 1024 ? (l / (1024 * 1024)).toFixed(1) + " MB" : (l / (1024 * 1024 * 1024)).toFixed(1) + " GB";
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
const n = new Date(
|
|
461
|
+
function qe(l) {
|
|
462
|
+
const n = new Date(l);
|
|
463
463
|
return new Intl.DateTimeFormat("en-US", {
|
|
464
464
|
month: "short",
|
|
465
465
|
day: "numeric",
|
|
@@ -7390,7 +7390,7 @@ var Ed = (e, t = !1) => {
|
|
|
7390
7390
|
const t = oa(() => {
|
|
7391
7391
|
const n = this, [s] = R(this, yt), [a] = R(this, vt), [i] = R(this, Et), [l] = R(this, bt), [o] = R(this, gt);
|
|
7392
7392
|
let c;
|
|
7393
|
-
return R(this, wt) ? c = R(this, wt) : (c = ia(() => import("./HO4MOOFI-
|
|
7393
|
+
return R(this, wt) ? c = R(this, wt) : (c = ia(() => import("./HO4MOOFI-CWU4gOCj.js")), ee(this, wt, c)), Ca(R(this, Yt), R(this, pt)), ra(c, aa({
|
|
7394
7394
|
get queryFlavor() {
|
|
7395
7395
|
return R(n, zt);
|
|
7396
7396
|
},
|
|
@@ -7484,7 +7484,7 @@ var Ed = (e, t = !1) => {
|
|
|
7484
7484
|
const t = oa(() => {
|
|
7485
7485
|
const n = this, [s] = R(this, At), [a] = R(this, xt), [i] = R(this, Tt), [l] = R(this, Ct), [o] = R(this, St), [c] = R(this, Pt);
|
|
7486
7486
|
let h;
|
|
7487
|
-
return R(this, _t) ? h = R(this, _t) : (h = ia(() => import("./HUY7CZI3-
|
|
7487
|
+
return R(this, _t) ? h = R(this, _t) : (h = ia(() => import("./HUY7CZI3-BuVBFUXg.js")), ee(this, _t, h)), Ca(R(this, en), R(this, Nt)), ra(h, aa({
|
|
7488
7488
|
get queryFlavor() {
|
|
7489
7489
|
return R(n, Zt);
|
|
7490
7490
|
},
|
|
@@ -7602,7 +7602,7 @@ var Iu = process.env.NODE_ENV !== "development" ? function() {
|
|
|
7602
7602
|
} : Pu;
|
|
7603
7603
|
process.env.NODE_ENV;
|
|
7604
7604
|
const ku = Qa(
|
|
7605
|
-
() => import("./digital-asset-manager-
|
|
7605
|
+
() => import("./digital-asset-manager-Scnvw98W.js")
|
|
7606
7606
|
);
|
|
7607
7607
|
ul();
|
|
7608
7608
|
ec();
|