@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.
@@ -1,179 +1,179 @@
1
- import { jsxs as s, Fragment as j, jsx as e } from "react/jsx-runtime";
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 ge, find as fe, merge as ve } from "lodash-es";
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 F, X as z, Y as g, Z as Ce } from "./index-CG2G27hJ.js";
10
+ import { W as z, X as M, Y as f, Z as Ce } from "./index-Ci9oNrDB.js";
11
11
  const Te = () => {
12
- const t = F(), n = B(), o = z();
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: i
18
- }) => o(t, {
19
- action: g.UPLOAD_ASSET,
20
- data: { file: r, folderId: c, name: i }
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: [g.GET_ASSETS]
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
- }, Pe = () => {
32
- const t = F(), n = B(), o = z();
31
+ }, Ue = () => {
32
+ const l = z(), n = B(), o = M();
33
33
  return Q({
34
- mutationFn: async (r) => o(t, {
35
- action: g.DELETE_ASSET,
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: [g.GET_ASSETS]
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
- }, Ue = () => {
48
- const t = F(), n = B(), o = z();
47
+ }, Fe = () => {
48
+ const l = z(), n = B(), o = M();
49
49
  return Q({
50
- mutationFn: async (r) => o(t, {
51
- action: g.UPDATE_ASSET,
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: [g.GET_ASSETS]
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
- }, Fe = (t = {}) => {
64
- const n = F(), o = z(), { search: r, limit: c = 10 } = t;
63
+ }, ze = (l = {}) => {
64
+ const n = z(), o = M(), { search: r, limit: c = 10 } = l;
65
65
  return Ee({
66
- queryKey: [Ce, g.GET_ASSETS, { search: r, limit: c }],
67
- queryFn: async ({ pageParam: i = 1 }) => (await o(n, {
68
- action: g.GET_ASSETS,
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: i,
71
+ page: t,
72
72
  limit: c
73
73
  }
74
74
  })).data,
75
75
  initialPageParam: 1,
76
- getNextPageParam: (i) => i.page * i.pageSize < i.total ? i.page + 1 : void 0,
77
- getPreviousPageParam: (i) => i.page > 1 ? i.page - 1 : void 0,
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 ze() {
81
+ function Me() {
82
82
  const [n, o] = T([]), [r, c] = T({
83
83
  query: "",
84
84
  pageSize: 10
85
- }), i = ge(() => r.query, 300)(), {
85
+ }), t = fe(() => r.query, 300)(), {
86
86
  data: d,
87
87
  isLoading: S,
88
88
  fetchNextPage: w,
89
89
  hasNextPage: u,
90
- isFetchingNextPage: f
91
- } = Fe({
92
- search: (i == null ? void 0 : i.toLowerCase().trim()) || "",
90
+ isFetchingNextPage: g
91
+ } = ze({
92
+ search: (t == null ? void 0 : t.toLowerCase().trim()) || "",
93
93
  limit: r.pageSize
94
- }), M = (d == null ? void 0 : d.pages.flatMap((p) => p.assets)) || [], { mutate: x, isPaused: h } = Ue(), { mutate: A, isPending: y } = Te(), { mutate: b, isPending: P } = Pe(), D = C(() => {
95
- u && !f && w();
96
- }, [w, u, f]), E = C((p) => {
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
- }, []), I = C(
101
+ }, []), k = C(
102
102
  (p) => {
103
- o((m) => fe(m, { id: p.id }) ? [] : [p]);
103
+ o((m) => ge(m, { id: p.id }) ? [] : [p]);
104
104
  },
105
105
  [!1]
106
- ), k = C(() => {
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: M,
113
+ assets: D,
114
114
  hasNextPage: u,
115
- isFetchingNextPage: f,
115
+ isFetchingNextPage: g,
116
116
  // Mutations
117
117
  uploadAsset: A,
118
118
  updateAsset: x,
119
119
  deleteAsset: b,
120
- loadMoreAssets: D,
120
+ loadMoreAssets: I,
121
121
  updateSearchQuery: E,
122
- clearSelectedAssets: k,
123
- updateSelectedAssets: I,
122
+ clearSelectedAssets: q,
123
+ updateSelectedAssets: k,
124
124
  // Loading
125
125
  isLoadingAssets: S,
126
126
  isUploadingAsset: y,
127
127
  isUpdatingAsset: h,
128
- isDeletingAsset: P
128
+ isDeletingAsset: U
129
129
  };
130
130
  }
131
- const Me = W.lazy(() => import("./asset-metadata-editor-CEFwXx62.js")), De = W.lazy(() => import("./image-editor-BQ6_F-iv.js"));
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: t,
133
+ close: l,
134
134
  onSelect: n,
135
135
  mode: o = "image"
136
136
  }) {
137
- const c = ne(() => [o], [o]), [i, d] = T("browse"), [S, w] = T(null), [u, f] = T({ show: !1, file: "", name: "" }), {
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: M,
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: P,
147
- deleteAsset: D,
146
+ updateAsset: U,
147
+ deleteAsset: I,
148
148
  loadMoreAssets: E,
149
- updateSearchQuery: I,
150
- clearSelectedAssets: k,
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
- } = ze(), G = oe(null);
157
+ } = Me(), G = oe(null);
158
158
  ce(() => {
159
- const a = G.current;
160
- if (!a) return;
161
- const l = () => {
162
- a.scrollHeight - a.scrollTop <= a.clientHeight * 1.5 && !m && A && !y && E();
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 a.addEventListener("scroll", l), () => a.removeEventListener("scroll", l);
164
+ return s.addEventListener("scroll", i), () => s.removeEventListener("scroll", i);
165
165
  }, [m, E, A, y]);
166
166
  const Z = C(
167
- async (a) => new Promise((l, q) => {
168
- const K = a[0], U = new FileReader();
169
- U.readAsDataURL(K), U.onload = async () => {
170
- const L = await b({
171
- file: U.result,
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"), l(L);
176
- }, U.onerror = (L) => q(L);
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
- }), ae = () => {
187
- n([h[0].url]), t();
188
- }, se = async (a) => {
189
- await D(a.id);
190
- }, te = (a) => {
191
- w(a);
192
- }, le = async (a, l) => {
193
- await P(ve(a, l)), t();
194
- }, ie = (a) => {
195
- I(a.target.value);
196
- }, re = async (a, l) => {
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
- l ? await b({
199
- file: a,
198
+ i ? await b({
199
+ file: s,
200
200
  folderId: null,
201
201
  name: u.name
202
- }) : await P({ id: u.id, file: a }), f({ show: !1, file: "", name: "" }), d("browse");
203
- } catch (q) {
204
- console.error("Error saving edited image:", q);
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__ */ s(j, { children: [
208
- /* @__PURE__ */ s("div", { className: "min-w-[700px] min-h-[600px] w-[900px] max-w-[900px]", children: [
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__ */ s(
210
+ /* @__PURE__ */ a(
211
211
  de,
212
212
  {
213
- value: i,
214
- onValueChange: (a) => d(a),
213
+ value: t,
214
+ onValueChange: (s) => d(s),
215
215
  className: "flex-1 flex flex-col h-full",
216
216
  children: [
217
- /* @__PURE__ */ s("div", { className: "flex justify-between items-center mb-2", children: [
218
- /* @__PURE__ */ s(ue, { children: [
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__ */ s("div", { className: "flex items-center gap-2", children: [
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: () => k(),
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: ae,
237
+ onClick: se,
238
238
  disabled: h.length === 0,
239
239
  children: "Select Asset"
240
240
  }
241
241
  )
242
242
  ] })
243
243
  ] }),
244
- /* @__PURE__ */ s(V, { value: "browse", className: "flex-1 flex flex-col", children: [
245
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mb-2", children: /* @__PURE__ */ s("div", { className: "relative w-full", children: [
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: M,
251
+ value: D,
252
252
  onChange: ie,
253
253
  className: "pl-8"
254
254
  }
255
255
  )
256
256
  ] }) }),
257
- m && x.length === 0 ? /* @__PURE__ */ s("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: [
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__ */ s("div", { className: "flex flex-col items-center justify-center h-full text-center p-12 h-[380px]", children: [
269
- /* @__PURE__ */ s("div", { className: "text-muted-foreground mb-2", children: [
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__ */ s(
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((a) => /* @__PURE__ */ e(
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((l) => l.id === a.id) ? "ring-2 ring-primary" : "hover:ring-2 hover:ring-primary/20"
285
+ h.some((i) => i.id === s.id) ? "ring-2 ring-primary" : "hover:ring-2 hover:ring-primary/20"
286
286
  ),
287
- onClick: () => p(a),
288
- children: /* @__PURE__ */ s(pe, { className: "p-0 relative group", children: [
289
- /* @__PURE__ */ s("div", { className: "aspect-square relative overflow-hidden bg-muted", children: [
290
- a.type === "image" ? /* @__PURE__ */ e(
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: a.url || "/placeholder.svg",
294
- alt: a.name,
293
+ src: s.url || "/placeholder.svg",
294
+ alt: s.name,
295
295
  className: "object-cover w-full h-full"
296
296
  }
297
- ) : /* @__PURE__ */ s("div", { className: "flex items-center justify-center h-full", children: [
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
- a.thumbnailUrl && /* @__PURE__ */ e(
299
+ s.thumbnailUrl && /* @__PURE__ */ e(
300
300
  "img",
301
301
  {
302
- src: a.thumbnailUrl || "/placeholder.svg",
303
- alt: a.name,
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__ */ s("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2", children: [
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: (l) => {
316
- l.stopPropagation(), te(a);
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: (l) => {
328
- l.stopPropagation(), f({
329
- id: a.id,
327
+ onClick: (i) => {
328
+ i.stopPropagation(), g({
329
+ id: s.id,
330
330
  show: !0,
331
- file: a.url,
332
- name: a.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: (l) => {
345
- l.stopPropagation(), se(a);
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((l) => l.id === a.id) && /* @__PURE__ */ e("div", { className: "absolute top-2 left-2", children: /* @__PURE__ */ e(
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
- (l) => l.id === a.id
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__ */ s("div", { className: "p-2", children: [
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: a.name,
369
- children: a.name
368
+ title: s.name,
369
+ children: s.name
370
370
  }
371
371
  ),
372
- /* @__PURE__ */ s("div", { className: "text-xs text-muted-foreground flex items-center justify-between", children: [
373
- /* @__PURE__ */ e("span", { children: Ie((a == null ? void 0 : a.size) || 0) }),
374
- /* @__PURE__ */ e("span", { children: ke(a.createdAt) })
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
- a.id
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__ */ s(
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__ */ s(
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__ */ s("div", { className: "flex flex-col items-center", children: [
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__ */ s(j, { children: [
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__ */ s("div", { className: "text-xs text-muted-foreground", children: [
418
- /* @__PURE__ */ s("p", { children: [
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__ */ s("p", { children: [
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
- Me,
437
+ De,
438
438
  {
439
439
  asset: S,
440
- onSave: (a) => le(S, a),
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
- De,
447
+ Ie,
448
448
  {
449
449
  imageUrl: u.file,
450
450
  onSave: re,
451
- onClose: () => f({ show: !1, file: "", name: "" }),
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 Ie(t) {
459
- return t < 1024 ? t + " B" : t < 1024 * 1024 ? (t / 1024).toFixed(1) + " KB" : t < 1024 * 1024 * 1024 ? (t / (1024 * 1024)).toFixed(1) + " MB" : (t / (1024 * 1024 * 1024)).toFixed(1) + " GB";
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 ke(t) {
462
- const n = new Date(t);
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-SiC6h0G4.js")), ee(this, wt, c)), Ca(R(this, Yt), R(this, pt)), ra(c, aa({
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-Ew2voVO9.js")), ee(this, _t, h)), Ca(R(this, en), R(this, Nt)), ra(h, aa({
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-Dh6jIXs5.js")
7605
+ () => import("./digital-asset-manager-Scnvw98W.js")
7606
7606
  );
7607
7607
  ul();
7608
7608
  ec();