@burdenoff/microfe-files 2026.530.1 → 2026.530.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.
@@ -39,32 +39,34 @@ import { MoveDialog as Ae } from "../components/MoveDialog.js";
39
39
  import { CopyDialog as je } from "../components/CopyDialog.js";
40
40
  import { ConfirmDialog as Me } from "../components/ConfirmDialog.js";
41
41
  import { UploadQueue as Ne } from "../components/UploadQueue.js";
42
- import { isQuotaExhaustedError as Pe } from "../utils/quotaUtils.js";
43
- import { nativeImpact as Fe, nativeNotify as Ie, nativeOpenUrl as Le } from "../../utils/nativeBridge.js";
44
- import { emitFilesEvent as Re } from "../utils/events.js";
45
- import { useEffect as ze, useMemo as Be, useState as o } from "react";
46
- import { FolderPlus as Ve, FolderUp as He, FolderX as Ue, Grid3x3 as We, Home as Ge, List as Ke, Loader2 as s, Search as qe, Trash2 as Je, Upload as Ye, X as Xe } from "lucide-react";
42
+ import { StorageBanner as Pe } from "../components/StorageBanner.js";
43
+ import { useStorageQuota as Fe } from "../hooks/useStorageQuota.js";
44
+ import { isQuotaExhaustedError as Ie } from "../utils/quotaUtils.js";
45
+ import { nativeImpact as Le, nativeNotify as Re, nativeOpenUrl as ze } from "../../utils/nativeBridge.js";
46
+ import { emitFilesEvent as Be } from "../utils/events.js";
47
+ import { useEffect as Ve, useMemo as He, useState as o } from "react";
48
+ import { FolderPlus as Ue, FolderUp as We, FolderX as Ge, Grid3x3 as Ke, Home as qe, List as Je, Loader2 as s, Search as Ye, Trash2 as Xe, Upload as Ze, X as Qe } from "lucide-react";
47
49
  import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
48
- import { useNavigate as Ze, useParams as Qe } from "react-router-dom";
49
- import { useI18n as $e } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
50
+ import { useNavigate as $e, useParams as et } from "react-router-dom";
51
+ import { useI18n as tt } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
50
52
  //#region src/files/pages/BrowserPage.tsx
51
53
  function d() {
52
- let { t: d } = $e(), { folderId: f } = Qe(), p = Ze(), et = e(), { workspaceId: m } = et, { viewMode: tt, setViewMode: nt, breadcrumbs: rt, selectedFiles: h, selectedFolders: g, clearSelection: _ } = t(), [v, it] = o("all"), at = Be(() => [
54
+ let { t: d } = tt(), { folderId: f } = et(), p = $e(), nt = e(), { workspaceId: m } = nt, rt = Fe(m ?? ""), { viewMode: it, setViewMode: at, breadcrumbs: ot, selectedFiles: h, selectedFolders: g, clearSelection: _ } = t(), [v, st] = o("all"), ct = He(() => [
53
55
  "all",
54
56
  "recent",
55
57
  "starred"
56
58
  ], []);
57
- ze(() => {
58
- at.includes(v) || it("all");
59
- }, [at, v]);
60
- let [y, ot] = o(""), [st, ct] = o(), b = y.trim().length >= 2, [lt, ut] = o(null), [x, dt] = o(null), S = be(), C = r({
59
+ Ve(() => {
60
+ ct.includes(v) || st("all");
61
+ }, [ct, v]);
62
+ let [lt, ut] = o(""), [dt, ft] = o(), y = lt.trim().length >= 2, [pt, mt] = o(null), [b, ht] = o(null), x = be(), S = r({
61
63
  folderId: f || void 0,
62
64
  pageSize: 100,
63
- skip: v !== "all" || b
64
- }), w = i({ skip: v !== "recent" || b }), T = ee({ skip: v !== "starred" || b }), ft = te({ skip: v !== "bin" || b }), E = ye(y, b, st);
65
- ze(() => {
66
- if (f && C.data?.folderPath && C.data?.currentFolder) {
67
- let e = C.data.folderPath.folders || [], n = C.data.currentFolder, r = [...e.map((e) => ({
65
+ skip: v !== "all" || y
66
+ }), C = i({ skip: v !== "recent" || y }), w = ee({ skip: v !== "starred" || y }), T = te({ skip: v !== "bin" || y }), E = ye(lt, y, dt);
67
+ Ve(() => {
68
+ if (f && S.data?.folderPath && S.data?.currentFolder) {
69
+ let e = S.data.folderPath.folders || [], n = S.data.currentFolder, r = [...e.map((e) => ({
68
70
  id: e.id,
69
71
  name: e.name
70
72
  })), {
@@ -73,26 +75,26 @@ function d() {
73
75
  }];
74
76
  t.getState().setBreadcrumbs(r);
75
77
  } else t.getState().setBreadcrumbs([]);
76
- }, [f, C.data]);
78
+ }, [f, S.data]);
77
79
  let D = [], O = [], k = !1, A = null, j = !1;
78
- if (b && E.data) D = E.data.files || [], O = E.data.folders || [], k = E.isLoading, A = E.error;
80
+ if (y && E.data) D = E.data.files || [], O = E.data.folders || [], k = E.isLoading, A = E.error;
79
81
  else switch (v) {
80
82
  case "all":
81
- D = C.data?.filesList?.files || [], O = C.data?.foldersList?.folders || [], k = C.loading, A = C.error || null, j = !1;
83
+ D = S.data?.filesList?.files || [], O = S.data?.foldersList?.folders || [], k = S.loading, A = S.error || null, j = !1;
82
84
  break;
83
85
  case "recent":
84
- D = w.files || [], O = w.folders || [], k = w.isLoading, A = w.error || null, j = !0;
86
+ D = C.files || [], O = C.folders || [], k = C.isLoading, A = C.error || null, j = !0;
85
87
  break;
86
88
  case "starred":
87
- D = T.files, O = T.folders, k = T.isLoading, A = T.error || null, j = !0;
89
+ D = w.files, O = w.folders, k = w.isLoading, A = w.error || null, j = !0;
88
90
  break;
89
91
  case "bin":
90
- D = ft.files, O = ft.folders, k = ft.isLoading, A = ft.error || null, j = !0;
92
+ D = T.files, O = T.folders, k = T.isLoading, A = T.error || null, j = !0;
91
93
  break;
92
94
  }
93
- let pt = v === "all" ? (C.data?.filesList?.total ?? D.length) + (C.data?.foldersList?.total ?? O.length) : null, M = h.size + g.size, [mt, N] = o(!1), [ht, gt] = o(!1), [_t, P] = o(!1), [vt, F] = o(!1), [yt, I] = o(!1), [bt, xt] = o(!1), [St, L] = o(null), [R, z] = o(null), [B, Ct] = o(null), [V, H] = o(null), [U, W] = o(""), [G, K] = o(""), [wt, q] = o(!1), [Tt, J] = o([]), [Et, Y] = o(!1), [X, Z] = o(null), Q = (e, t) => {
94
- Re(et, e, t);
95
- }, Dt = async () => {
95
+ let gt = v === "all" ? (S.data?.filesList?.total ?? D.length) + (S.data?.foldersList?.total ?? O.length) : null, M = h.size + g.size, [_t, N] = o(!1), [vt, yt] = o(!1), [bt, P] = o(!1), [xt, F] = o(!1), [St, I] = o(!1), [Ct, wt] = o(!1), [Tt, L] = o(null), [R, z] = o(null), [B, Et] = o(null), [V, H] = o(null), [U, W] = o(""), [G, K] = o(""), [Dt, q] = o(!1), [Ot, J] = o([]), [kt, Y] = o(!1), [X, Z] = o(null), Q = (e, t) => {
96
+ Be(nt, e, t);
97
+ }, At = async () => {
96
98
  if (!X || X.loading) return;
97
99
  let e = X.onConfirm;
98
100
  Z({
@@ -110,7 +112,7 @@ function d() {
110
112
  loading: !1
111
113
  });
112
114
  }
113
- }, $ = ne(), Ot = re(), kt = ie(), At = ae(), jt = oe(), Mt = se(), Nt = ce(), Pt = le(), Ft = ue(), It = de(), Lt = fe(), Rt = pe(), zt = me(), Bt = he(), Vt = ge(), Ht = _e(), Ut = ve(), Wt = () => {
115
+ }, $ = ne(), jt = re(), Mt = ie(), Nt = ae(), Pt = oe(), Ft = se(), It = ce(), Lt = le(), Rt = ue(), zt = de(), Bt = fe(), Vt = pe(), Ht = me(), Ut = he(), Wt = ge(), Gt = _e(), Kt = ve(), qt = () => {
114
116
  let e = document.createElement("input");
115
117
  e.type = "file", e.multiple = !0, e.onchange = async (e) => {
116
118
  let t = e.target.files;
@@ -127,11 +129,11 @@ function d() {
127
129
  };
128
130
  }));
129
131
  J((t) => [...t, ...e]), Y(!0), q(!0);
130
- for (let t of e) await Gt(t);
132
+ for (let t of e) await Jt(t);
131
133
  q(!1);
132
134
  }
133
135
  }, e.click();
134
- }, Gt = async (e) => {
136
+ }, Jt = async (e) => {
135
137
  let t = (t) => {
136
138
  J((n) => n.map((n) => n.id === e.id ? {
137
139
  ...n,
@@ -140,7 +142,7 @@ function d() {
140
142
  };
141
143
  t({ status: "uploading" });
142
144
  try {
143
- let n = await Ot.mutateAsync({
145
+ let n = await jt.mutateAsync({
144
146
  file: e.file,
145
147
  folderId: e.folderId,
146
148
  onProgress: (e) => {
@@ -160,7 +162,7 @@ function d() {
160
162
  r === "Upload paused" ? t({ status: "paused" }) : r === "QUOTA_EXHAUSTED" ? (t({
161
163
  status: "failed",
162
164
  error: a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded")
163
- }), S.error(a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded. Please upgrade your plan or delete files."))) : (t({
165
+ }), x.error(a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded. Please upgrade your plan or delete files."))) : (t({
164
166
  status: "failed",
165
167
  error: r
166
168
  }), Q("files.api.failed", {
@@ -169,30 +171,30 @@ function d() {
169
171
  message: r
170
172
  }));
171
173
  }
172
- }, Kt = (e) => {
173
- Ot.pause(), J((t) => t.map((t) => t.id === e ? {
174
+ }, Yt = (e) => {
175
+ jt.pause(), J((t) => t.map((t) => t.id === e ? {
174
176
  ...t,
175
177
  status: "paused"
176
178
  } : t));
177
- }, qt = (e) => {
178
- let t = Tt.find((t) => t.id === e);
179
- t && Gt(t);
180
- }, Jt = (e) => {
181
- let t = Tt.find((t) => t.id === e);
179
+ }, Xt = (e) => {
180
+ let t = Ot.find((t) => t.id === e);
181
+ t && Jt(t);
182
+ }, Zt = (e) => {
183
+ let t = Ot.find((t) => t.id === e);
182
184
  t && (J((t) => t.map((t) => t.id === e ? {
183
185
  ...t,
184
186
  status: "pending",
185
187
  progress: 0,
186
188
  error: void 0
187
- } : t)), Gt(t));
188
- }, Yt = (e) => {
189
+ } : t)), Jt(t));
190
+ }, Qt = (e) => {
189
191
  J((t) => {
190
192
  let n = t.filter((t) => t.id !== e);
191
193
  return n.length === 0 && (Y(!1), q(!1)), n;
192
194
  });
193
- }, Xt = () => {
195
+ }, $t = () => {
194
196
  if (!m) {
195
- S.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
197
+ x.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
196
198
  return;
197
199
  }
198
200
  let e = document.createElement("input");
@@ -233,23 +235,23 @@ function d() {
233
235
  }
234
236
  }
235
237
  J((e) => [...e, ...i]), Y(!0), q(!0);
236
- for (let e of i) await Gt(e);
237
- q(!1), S.success(a(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
238
+ for (let e of i) await Jt(e);
239
+ q(!1), x.success(a(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
238
240
  count: i.length,
239
241
  plural: i.length > 1 ? "s" : ""
240
242
  }));
241
243
  }
242
244
  }, e.click();
243
- }, Zt = () => {
245
+ }, en = () => {
244
246
  N(!0);
245
- }, Qt = async () => {
247
+ }, tn = async () => {
246
248
  if (G.trim() && m) {
247
249
  let { data: e, error: t } = await $.mutateAsync({
248
250
  name: G,
249
251
  parentFolderId: f
250
252
  });
251
253
  if (t) {
252
- Pe(t) ? (N(!1), K(""), gt(!0)) : (S.error(t instanceof Error ? t.message : a(d, "files.folder.errors.createFailed", "Folder creation failed")), Q("files.api.failed", {
254
+ Ie(t) ? (N(!1), K(""), yt(!0)) : (x.error(t instanceof Error ? t.message : a(d, "files.folder.errors.createFailed", "Folder creation failed")), Q("files.api.failed", {
253
255
  action: "createFolder",
254
256
  message: t instanceof Error ? t.message : "Folder creation failed"
255
257
  }));
@@ -260,13 +262,13 @@ function d() {
260
262
  parentFolderId: f
261
263
  }));
262
264
  }
263
- }, $t = (e) => {
264
- dt(e);
265
- }, en = (e) => {
265
+ }, nn = (e) => {
266
+ ht(e);
267
+ }, rn = (e) => {
266
268
  L(e), F(!0);
267
- }, tn = (e) => {
269
+ }, an = (e) => {
268
270
  L(e), F(!0);
269
- }, nn = async (e) => {
271
+ }, on = async (e) => {
270
272
  if (!e.fileId && !e.folderId) throw Error(a(d, "files.share.errors.targetRequired", "Share requires a file id or folder id"));
271
273
  let t = e.invitedEmail ? "EMAIL_INVITE" : "PUBLIC_LINK", n = "";
272
274
  if (e.fileId) {
@@ -279,7 +281,7 @@ function d() {
279
281
  shareType: t,
280
282
  accessLevel: "DOWNLOAD"
281
283
  };
282
- n = (await Rt.mutateAsync(r))?.token ?? "", Q("files.share.created", {
284
+ n = (await Vt.mutateAsync(r))?.token ?? "", Q("files.share.created", {
283
285
  entityType: "file",
284
286
  fileId: e.fileId,
285
287
  shareType: t
@@ -294,7 +296,7 @@ function d() {
294
296
  shareType: t,
295
297
  accessLevel: "DOWNLOAD"
296
298
  };
297
- n = (await zt.mutateAsync(r))?.createFolderShare?.token ?? "", Q("files.share.created", {
299
+ n = (await Ht.mutateAsync(r))?.createFolderShare?.token ?? "", Q("files.share.created", {
298
300
  entityType: "folder",
299
301
  folderId: e.folderId,
300
302
  shareType: t
@@ -304,21 +306,21 @@ function d() {
304
306
  publicUrl: n ? `${window.location.origin}/files/share/${n}` : "",
305
307
  token: n
306
308
  };
307
- }, rn = async (e) => {
308
- Fe("medium"), Z({
309
+ }, sn = async (e) => {
310
+ Le("medium"), Z({
309
311
  title: a(d, "files.confirm.deleteFile.title", "Delete file"),
310
312
  description: a(d, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
311
313
  confirmLabel: a(d, "files.common.actions.delete", "Delete"),
312
314
  variant: "danger",
313
315
  onConfirm: async () => {
314
316
  try {
315
- await kt.mutateAsync({ id: e.id }), Ie("success"), S.success(a(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Q("files.file.deleted", {
317
+ await Mt.mutateAsync({ id: e.id }), Re("success"), x.success(a(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Q("files.file.deleted", {
316
318
  fileId: e.id,
317
319
  fileName: e.name,
318
320
  permanent: !1
319
321
  });
320
322
  } catch (t) {
321
- S.error(t instanceof Error ? t.message : a(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Ie("error"), Q("files.api.failed", {
323
+ x.error(t instanceof Error ? t.message : a(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Re("error"), Q("files.api.failed", {
322
324
  action: "deleteFile",
323
325
  fileId: e.id,
324
326
  message: t instanceof Error ? t.message : "Failed to delete file"
@@ -326,36 +328,36 @@ function d() {
326
328
  }
327
329
  }
328
330
  });
329
- }, an = async (e) => {
331
+ }, cn = async (e) => {
330
332
  try {
331
- await jt.mutateAsync({ id: e.id }), S.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), Q("files.file.restored", {
333
+ await Pt.mutateAsync({ id: e.id }), x.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), Q("files.file.restored", {
332
334
  fileId: e.id,
333
335
  fileName: e.name
334
336
  });
335
337
  } catch (e) {
336
- S.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
338
+ x.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
337
339
  }
338
- }, on = async (e) => {
339
- Fe("heavy"), Z({
340
+ }, ln = async (e) => {
341
+ Le("heavy"), Z({
340
342
  title: a(d, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
341
343
  description: a(d, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
342
344
  confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
343
345
  variant: "danger",
344
346
  onConfirm: async () => {
345
347
  try {
346
- await Nt.mutateAsync({ id: e.id }), S.success(a(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Q("files.file.deleted", {
348
+ await It.mutateAsync({ id: e.id }), x.success(a(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Q("files.file.deleted", {
347
349
  fileId: e.id,
348
350
  fileName: e.name,
349
351
  permanent: !0
350
352
  });
351
353
  } catch (e) {
352
- S.error(e instanceof Error ? e.message : a(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
354
+ x.error(e instanceof Error ? e.message : a(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
353
355
  }
354
356
  }
355
357
  });
356
- }, sn = async (e) => {
358
+ }, un = async (e) => {
357
359
  try {
358
- await Ft.mutateAsync({
360
+ await Rt.mutateAsync({
359
361
  id: e.id,
360
362
  type: "file"
361
363
  }), Q("files.file.starred", {
@@ -364,77 +366,77 @@ function d() {
364
366
  starred: !e.starred
365
367
  });
366
368
  } catch {
367
- S.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), Q("files.api.failed", {
369
+ x.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), Q("files.api.failed", {
368
370
  action: "toggleFileStar",
369
371
  fileId: e.id
370
372
  });
371
373
  }
372
- }, cn = (e) => {
374
+ }, dn = (e) => {
373
375
  H({
374
376
  id: e.id,
375
377
  name: e.name,
376
378
  type: "file"
377
379
  }), W(e.name), P(!0);
378
- }, ln = async (e) => {
380
+ }, fn = async (e) => {
379
381
  try {
380
382
  let t = e.downloadUrl || e.url;
381
383
  if (!t) throw Error(a(d, "files.file.errors.downloadUrlUnavailable", "Download URL is unavailable"));
382
384
  let n = document.createElement("a");
383
- n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n), S.success(a(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), Q("files.file.downloaded", {
385
+ n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n), x.success(a(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), Q("files.file.downloaded", {
384
386
  fileId: e.id,
385
387
  fileName: e.name
386
388
  });
387
389
  } catch (e) {
388
- S.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
390
+ x.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
389
391
  }
390
- }, un = (e) => {
391
- Ct({
392
+ }, pn = (e) => {
393
+ Et({
392
394
  item: e,
393
395
  type: "file"
394
- }), xt(!0);
395
- }, dn = (e) => {
396
+ }), wt(!0);
397
+ }, mn = (e) => {
396
398
  z({
397
399
  item: e,
398
400
  type: "file"
399
401
  }), I(!0);
400
- }, fn = (e) => {
401
- ut({
402
+ }, hn = (e) => {
403
+ mt({
402
404
  item: e,
403
405
  type: "file"
404
406
  });
405
- }, pn = (e) => {
407
+ }, gn = (e) => {
406
408
  p(`/files/browse/${e.id}`);
407
- }, mn = async (e) => {
408
- Fe("medium"), Z({
409
+ }, _n = async (e) => {
410
+ Le("medium"), Z({
409
411
  title: a(d, "files.confirm.deleteFolder.title", "Delete folder"),
410
412
  description: a(d, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
411
413
  confirmLabel: a(d, "files.common.actions.delete", "Delete"),
412
414
  variant: "danger",
413
415
  onConfirm: async () => {
414
416
  try {
415
- await At.mutateAsync({
417
+ await Nt.mutateAsync({
416
418
  id: e.id,
417
419
  recursive: !0
418
- }), S.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Q("files.folder.deleted", {
420
+ }), x.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Q("files.folder.deleted", {
419
421
  folderId: e.id,
420
422
  folderName: e.name,
421
423
  permanent: !1
422
424
  });
423
425
  } catch (e) {
424
- S.error(e instanceof Error ? e.message : a(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
426
+ x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
425
427
  }
426
428
  }
427
429
  });
428
- }, hn = async (e) => {
430
+ }, vn = async (e) => {
429
431
  try {
430
- await Mt.mutateAsync({ id: e.id }), S.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), Q("files.folder.restored", {
432
+ await Ft.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), Q("files.folder.restored", {
431
433
  folderId: e.id,
432
434
  folderName: e.name
433
435
  });
434
436
  } catch (e) {
435
- S.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
437
+ x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
436
438
  }
437
- }, gn = async (e) => {
439
+ }, yn = async (e) => {
438
440
  Z({
439
441
  title: a(d, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
440
442
  description: a(d, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
@@ -442,30 +444,30 @@ function d() {
442
444
  variant: "danger",
443
445
  onConfirm: async () => {
444
446
  try {
445
- await Pt.mutateAsync({ id: e.id }), S.success(a(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Q("files.folder.deleted", {
447
+ await Lt.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Q("files.folder.deleted", {
446
448
  folderId: e.id,
447
449
  folderName: e.name,
448
450
  permanent: !0
449
451
  });
450
452
  } catch (e) {
451
- S.error(e instanceof Error ? e.message : a(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
453
+ x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
452
454
  }
453
455
  }
454
456
  });
455
- }, _n = (e) => {
457
+ }, bn = (e) => {
456
458
  H({
457
459
  id: e.id,
458
460
  name: e.name,
459
461
  type: "folder"
460
462
  }), W(e.name), P(!0);
461
- }, vn = (e) => {
463
+ }, xn = (e) => {
462
464
  z({
463
465
  item: e,
464
466
  type: "folder"
465
467
  }), I(!0);
466
- }, yn = async (e) => {
468
+ }, Sn = async (e) => {
467
469
  try {
468
- await Ft.mutateAsync({
470
+ await Rt.mutateAsync({
469
471
  id: e.id,
470
472
  type: "folder"
471
473
  }), Q("files.folder.starred", {
@@ -474,80 +476,80 @@ function d() {
474
476
  starred: !e.starred
475
477
  });
476
478
  } catch {
477
- S.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), Q("files.api.failed", {
479
+ x.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), Q("files.api.failed", {
478
480
  action: "toggleFolderStar",
479
481
  folderId: e.id
480
482
  });
481
483
  }
482
- }, bn = (e) => {
483
- ut({
484
+ }, Cn = (e) => {
485
+ mt({
484
486
  item: e,
485
487
  type: "folder"
486
488
  });
487
- }, xn = async (e) => {
489
+ }, wn = async (e) => {
488
490
  if (R) try {
489
- R.type === "file" ? (await Vt.mutateAsync({
491
+ R.type === "file" ? (await Wt.mutateAsync({
490
492
  fileId: R.item.id,
491
493
  targetFolderId: e || null
492
- }), S.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: R.item.name })), Q("files.file.moved", {
494
+ }), x.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: R.item.name })), Q("files.file.moved", {
493
495
  fileId: R.item.id,
494
496
  fileName: R.item.name,
495
497
  destinationFolderId: e
496
- })) : (await Ht.mutateAsync({
498
+ })) : (await Gt.mutateAsync({
497
499
  folderId: R.item.id,
498
500
  targetParentFolderId: e
499
- }), S.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: R.item.name })), Q("files.folder.moved", {
501
+ }), x.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: R.item.name })), Q("files.folder.moved", {
500
502
  folderId: R.item.id,
501
503
  folderName: R.item.name,
502
504
  destinationFolderId: e
503
505
  })), I(!1), z(null);
504
506
  } catch (e) {
505
- S.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: R.item.name })), Q("files.api.failed", {
507
+ x.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: R.item.name })), Q("files.api.failed", {
506
508
  action: R.type === "file" ? "moveFile" : "moveFolder",
507
509
  itemId: R.item.id,
508
510
  itemType: R.type,
509
511
  message: e instanceof Error ? e.message : void 0
510
512
  });
511
513
  }
512
- }, Sn = async (e, t) => {
514
+ }, Tn = async (e, t) => {
513
515
  if (B) try {
514
516
  if (B.type !== "file") throw Error(a(d, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
515
- await Bt.mutateAsync({
517
+ await Ut.mutateAsync({
516
518
  id: B.item.id,
517
519
  newName: t || `Copy of ${B.item.name}`,
518
520
  targetFolderId: e || void 0
519
- }), S.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: B.item.name })), Q("files.file.copied", {
521
+ }), x.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: B.item.name })), Q("files.file.copied", {
520
522
  fileId: B.item.id,
521
523
  fileName: B.item.name,
522
524
  destinationFolderId: e
523
- }), xt(!1), Ct(null);
525
+ }), wt(!1), Et(null);
524
526
  } catch (e) {
525
- S.error(e instanceof Error ? e.message : a(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: B.item.name })), Q("files.api.failed", {
527
+ x.error(e instanceof Error ? e.message : a(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: B.item.name })), Q("files.api.failed", {
526
528
  action: "copyFile",
527
529
  fileId: B.item.id,
528
530
  message: e instanceof Error ? e.message : void 0
529
531
  });
530
532
  }
531
- }, Cn = async () => {
533
+ }, En = async () => {
532
534
  if (!(!V || !U.trim())) try {
533
535
  let e = V.name, t = U.trim();
534
- V.type === "file" ? (await It.mutateAsync({
536
+ V.type === "file" ? (await zt.mutateAsync({
535
537
  fileId: V.id,
536
538
  newName: t
537
- }), S.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), Q("files.file.renamed", {
539
+ }), x.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), Q("files.file.renamed", {
538
540
  fileId: V.id,
539
541
  previousName: e,
540
542
  name: t
541
- })) : (await Lt.mutateAsync({
543
+ })) : (await Bt.mutateAsync({
542
544
  folderId: V.id,
543
545
  newName: t
544
- }), S.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), Q("files.folder.renamed", {
546
+ }), x.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), Q("files.folder.renamed", {
545
547
  folderId: V.id,
546
548
  previousName: e,
547
549
  name: t
548
550
  })), P(!1), H(null), W("");
549
551
  } catch (e) {
550
- S.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: V.type })), Q("files.api.failed", {
552
+ x.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: V.type })), Q("files.api.failed", {
551
553
  action: V.type === "file" ? "renameFile" : "renameFolder",
552
554
  itemId: V.id,
553
555
  itemType: V.type,
@@ -558,10 +560,10 @@ function d() {
558
560
  return n({
559
561
  files: D,
560
562
  folders: O,
561
- onFilePreview: $t,
562
- onFileDelete: rn,
563
- onFolderOpen: pn,
564
- onFolderDelete: mn,
563
+ onFilePreview: nn,
564
+ onFileDelete: sn,
565
+ onFolderOpen: gn,
566
+ onFolderDelete: _n,
565
567
  activeTab: v
566
568
  }), m === void 0 ? /* @__PURE__ */ u("div", {
567
569
  className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
@@ -571,7 +573,7 @@ function d() {
571
573
  })]
572
574
  }) : m === "" ? /* @__PURE__ */ u("div", {
573
575
  className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
574
- children: [/* @__PURE__ */ l(Ue, { className: "size-8 text-text-tertiary" }), /* @__PURE__ */ l("p", {
576
+ children: [/* @__PURE__ */ l(Ge, { className: "size-8 text-text-tertiary" }), /* @__PURE__ */ l("p", {
575
577
  className: "text-sm text-text-secondary max-w-md",
576
578
  children: a(d, "files.browser.workspace.notSelected", "No workspace selected. Please select a workspace to view files.")
577
579
  })]
@@ -590,11 +592,11 @@ function d() {
590
592
  onClick: () => p("/files/browse"),
591
593
  className: "flex items-center gap-1 text-text-primary hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap",
592
594
  title: a(d, "files.browser.actions.goToRoot", "Go to root"),
593
- children: [/* @__PURE__ */ l(Ge, { className: "size-4" }), /* @__PURE__ */ l("span", {
595
+ children: [/* @__PURE__ */ l(qe, { className: "size-4" }), /* @__PURE__ */ l("span", {
594
596
  className: "hidden sm:inline",
595
597
  children: a(d, "files.browser.rootLabel", "My Drive")
596
598
  })]
597
- }), rt.map((e, t) => /* @__PURE__ */ u("div", {
599
+ }), ot.map((e, t) => /* @__PURE__ */ u("div", {
598
600
  className: "flex items-center gap-1 sm:gap-2",
599
601
  children: [/* @__PURE__ */ l("span", {
600
602
  className: "text-text-tertiary",
@@ -602,7 +604,7 @@ function d() {
602
604
  }), /* @__PURE__ */ l("button", {
603
605
  type: "button",
604
606
  onClick: () => p(`/files/browse/${e.id}`),
605
- className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === rt.length - 1 ? "text-text-primary font-medium" : "text-text-secondary"}`,
607
+ className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === ot.length - 1 ? "text-text-primary font-medium" : "text-text-secondary"}`,
606
608
  title: `Go to ${e.name}`,
607
609
  children: e.name
608
610
  })]
@@ -614,8 +616,8 @@ function d() {
614
616
  "data-tour": "files-tab-bar",
615
617
  children: /* @__PURE__ */ l(Ce, {
616
618
  activeTab: v,
617
- onTabChange: it,
618
- tabs: at
619
+ onTabChange: st,
620
+ tabs: ct
619
621
  })
620
622
  }),
621
623
  /* @__PURE__ */ u("div", {
@@ -630,17 +632,17 @@ function d() {
630
632
  className: "relative w-full max-w-2xl",
631
633
  children: /* @__PURE__ */ l(ke, {
632
634
  onSearch: (e, t) => {
633
- ot(e), ct(t);
635
+ ut(e), ft(t);
634
636
  },
635
637
  placeholder: a(d, "files.search.input.placeholder", "Search files and folders..."),
636
- initialQuery: y,
638
+ initialQuery: lt,
637
639
  showFilters: !0
638
640
  })
639
641
  })
640
642
  }), /* @__PURE__ */ u("div", {
641
643
  className: "flex items-center gap-2 order-1 sm:order-2 w-full sm:w-auto justify-between sm:justify-end",
642
644
  children: [
643
- !b && (D.length > 0 || O.length > 0) && /* @__PURE__ */ l("button", {
645
+ !y && (D.length > 0 || O.length > 0) && /* @__PURE__ */ l("button", {
644
646
  type: "button",
645
647
  onClick: () => {
646
648
  let e = D.map((e) => e.id), n = O.map((e) => e.id);
@@ -649,38 +651,38 @@ function d() {
649
651
  className: "flex items-center gap-2 px-3 py-2 text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover hover:border-border-default transition-all duration-200",
650
652
  children: a(d, "files.browser.actions.selectAll", "Select All")
651
653
  }),
652
- !b && /* @__PURE__ */ u(c, { children: [
654
+ !y && /* @__PURE__ */ u(c, { children: [
653
655
  /* @__PURE__ */ u("button", {
654
656
  type: "button",
655
- onClick: Zt,
657
+ onClick: en,
656
658
  className: "flex items-center gap-1 sm:gap-2 px-2 sm:px-4 py-2 text-xs sm:text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover hover:border-border-default transition-all duration-200 shadow-sm",
657
659
  "data-tour": "files-new-folder-button",
658
- children: [/* @__PURE__ */ l(Ve, { className: "size-4" }), /* @__PURE__ */ l("span", {
660
+ children: [/* @__PURE__ */ l(Ue, { className: "size-4" }), /* @__PURE__ */ l("span", {
659
661
  className: "hidden sm:inline",
660
662
  children: a(d, "files.browser.actions.newFolder", "New Folder")
661
663
  })]
662
664
  }),
663
665
  /* @__PURE__ */ l("button", {
664
666
  type: "button",
665
- onClick: Wt,
666
- disabled: wt,
667
+ onClick: qt,
668
+ disabled: Dt,
667
669
  className: "flex items-center gap-1 sm:gap-2 px-2 sm:px-4 py-2 text-xs sm:text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover hover:border-border-default transition-all duration-200 shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
668
670
  "data-tour": "files-upload-files-button",
669
- children: wt ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), /* @__PURE__ */ l("span", {
671
+ children: Dt ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), /* @__PURE__ */ l("span", {
670
672
  className: "hidden sm:inline",
671
673
  children: a(d, "files.browser.upload.uploading", "Uploading...")
672
- })] }) : /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(Ye, { className: "size-4" }), /* @__PURE__ */ l("span", {
674
+ })] }) : /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(Ze, { className: "size-4" }), /* @__PURE__ */ l("span", {
673
675
  className: "hidden sm:inline",
674
676
  children: a(d, "files.browser.actions.uploadFiles", "Upload Files")
675
677
  })] })
676
678
  }),
677
679
  /* @__PURE__ */ u("button", {
678
680
  type: "button",
679
- onClick: Xt,
680
- disabled: wt,
681
+ onClick: $t,
682
+ disabled: Dt,
681
683
  className: "hidden sm:flex items-center gap-2 px-4 py-2.5 text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover hover:border-border-default transition-all duration-200 shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
682
684
  title: a(d, "files.browser.actions.uploadFolderTitle", "Upload entire folder with structure"),
683
- children: [/* @__PURE__ */ l(He, { className: "size-4" }), a(d, "files.browser.actions.uploadFolder", "Upload Folder")]
685
+ children: [/* @__PURE__ */ l(We, { className: "size-4" }), a(d, "files.browser.actions.uploadFolder", "Upload Folder")]
684
686
  })
685
687
  ] }),
686
688
  /* @__PURE__ */ u("div", {
@@ -688,31 +690,31 @@ function d() {
688
690
  "data-tour": "files-view-mode-toggle",
689
691
  children: [/* @__PURE__ */ l("button", {
690
692
  type: "button",
691
- onClick: () => nt("grid"),
692
- className: `p-2 transition-colors duration-200 ${tt === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
693
+ onClick: () => at("grid"),
694
+ className: `p-2 transition-colors duration-200 ${it === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
693
695
  "aria-label": a(d, "files.browser.view.grid", "Grid view"),
694
- children: /* @__PURE__ */ l(We, { className: "size-5" })
696
+ children: /* @__PURE__ */ l(Ke, { className: "size-5" })
695
697
  }), /* @__PURE__ */ l("button", {
696
698
  type: "button",
697
- onClick: () => nt("list"),
698
- className: `p-2 transition-colors duration-200 ${tt === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
699
+ onClick: () => at("list"),
700
+ className: `p-2 transition-colors duration-200 ${it === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
699
701
  "aria-label": a(d, "files.browser.view.list", "List view"),
700
- children: /* @__PURE__ */ l(Ke, { className: "size-5" })
702
+ children: /* @__PURE__ */ l(Je, { className: "size-5" })
701
703
  })]
702
704
  })
703
705
  ]
704
706
  })]
705
707
  }),
706
- b && /* @__PURE__ */ u("div", {
708
+ y && /* @__PURE__ */ u("div", {
707
709
  className: "mt-3 flex items-center justify-between p-3 bg-status-success-bg-subtle rounded-lg border border-status-success-border transition-all duration-200",
708
710
  children: [/* @__PURE__ */ u("span", {
709
711
  className: "text-sm font-medium text-status-success-text",
710
- children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: y }), E.data && ` (${(E.data.files?.length || 0) + (E.data.folders?.length || 0)} items)`]
712
+ children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: lt }), E.data && ` (${(E.data.files?.length || 0) + (E.data.folders?.length || 0)} items)`]
711
713
  }), /* @__PURE__ */ u("button", {
712
714
  type: "button",
713
- onClick: () => ot(""),
715
+ onClick: () => ut(""),
714
716
  className: "flex items-center gap-2 text-status-success-text hover:text-status-success-text/80 text-sm font-medium transition-colors duration-200",
715
- children: [/* @__PURE__ */ l(Xe, { className: "size-4" }), a(d, "files.browser.search.clear", "Clear search")]
717
+ children: [/* @__PURE__ */ l(Qe, { className: "size-4" }), a(d, "files.browser.search.clear", "Clear search")]
716
718
  })]
717
719
  }),
718
720
  M > 0 && /* @__PURE__ */ u("div", {
@@ -731,9 +733,9 @@ function d() {
731
733
  type: "button",
732
734
  onClick: async () => {
733
735
  try {
734
- await Promise.all([...Array.from(h).map((e) => jt.mutateAsync({ id: e })), ...Array.from(g).map((e) => Mt.mutateAsync({ id: e }))]), _(), S.success(`${M} item${M > 1 ? "s" : ""} restored`);
736
+ await Promise.all([...Array.from(h).map((e) => Pt.mutateAsync({ id: e })), ...Array.from(g).map((e) => Ft.mutateAsync({ id: e }))]), _(), x.success(`${M} item${M > 1 ? "s" : ""} restored`);
735
737
  } catch (e) {
736
- S.error(e instanceof Error ? e.message : "Failed to restore some items");
738
+ x.error(e instanceof Error ? e.message : "Failed to restore some items");
737
739
  }
738
740
  },
739
741
  className: "flex items-center gap-1.5 rounded-lg border border-status-success-border bg-bg-surface px-3 py-1.5 text-sm font-medium text-status-success-text transition-colors duration-200 hover:bg-status-success-bg-subtle",
@@ -751,18 +753,18 @@ function d() {
751
753
  variant: "danger",
752
754
  onConfirm: async () => {
753
755
  try {
754
- await Promise.all([...Array.from(h).map((e) => Nt.mutateAsync({ id: e })), ...Array.from(g).map((e) => Pt.mutateAsync({ id: e }))]), _(), S.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
756
+ await Promise.all([...Array.from(h).map((e) => It.mutateAsync({ id: e })), ...Array.from(g).map((e) => Lt.mutateAsync({ id: e }))]), _(), x.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
755
757
  count: M,
756
758
  plural: M > 1 ? "s" : ""
757
759
  }));
758
760
  } catch (e) {
759
- S.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
761
+ x.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
760
762
  }
761
763
  }
762
764
  });
763
765
  },
764
766
  className: "flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-status-error-text bg-bg-surface border border-status-error-border rounded-lg hover:bg-status-error-bg-subtle transition-colors duration-200",
765
- children: [/* @__PURE__ */ l(Je, { className: "size-4" }), a(d, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
767
+ children: [/* @__PURE__ */ l(Xe, { className: "size-4" }), a(d, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
766
768
  })] }) : /* @__PURE__ */ u("button", {
767
769
  type: "button",
768
770
  onClick: async () => {
@@ -777,32 +779,36 @@ function d() {
777
779
  onConfirm: async () => {
778
780
  try {
779
781
  let e = Array.from(h), t = Array.from(g);
780
- e.length > 0 && await Ut.mutateAsync(e), await Promise.all(t.map((e) => At.mutateAsync({
782
+ e.length > 0 && await Kt.mutateAsync(e), await Promise.all(t.map((e) => Nt.mutateAsync({
781
783
  id: e,
782
784
  recursive: !0
783
- }))), _(), S.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
785
+ }))), _(), x.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
784
786
  count: M,
785
787
  plural: M > 1 ? "s" : ""
786
788
  }));
787
789
  } catch (e) {
788
- S.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
790
+ x.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
789
791
  }
790
792
  }
791
793
  });
792
794
  },
793
795
  className: "flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-status-error-text bg-bg-surface border border-status-error-border rounded-lg hover:bg-status-error-bg-subtle transition-colors duration-200",
794
- children: [/* @__PURE__ */ l(Je, { className: "size-4" }), a(d, "files.browser.selection.actions.delete", "Delete")]
796
+ children: [/* @__PURE__ */ l(Xe, { className: "size-4" }), a(d, "files.browser.selection.actions.delete", "Delete")]
795
797
  })
796
798
  })]
797
799
  }), /* @__PURE__ */ u("button", {
798
800
  type: "button",
799
801
  onClick: _,
800
802
  className: "flex items-center gap-2 text-text-link hover:text-action-primary-bg-hover text-sm font-medium transition-colors duration-200",
801
- children: [/* @__PURE__ */ l(Xe, { className: "size-4" }), a(d, "files.common.actions.clear", "Clear")]
803
+ children: [/* @__PURE__ */ l(Qe, { className: "size-4" }), a(d, "files.common.actions.clear", "Clear")]
802
804
  })]
803
805
  })
804
806
  ]
805
807
  }),
808
+ (rt.isExhausted || rt.isNearLimit) && /* @__PURE__ */ l("div", {
809
+ className: "px-4 sm:px-6 pt-3",
810
+ children: /* @__PURE__ */ l(Pe, { quota: rt })
811
+ }),
806
812
  /* @__PURE__ */ u("div", {
807
813
  className: "px-2 sm:px-4 md:px-6 py-3 sm:py-4",
808
814
  "data-tour": "files-browser-grid",
@@ -812,30 +818,30 @@ function d() {
812
818
  loading: k,
813
819
  error: A,
814
820
  preserveSortOrder: j,
815
- onFilePreview: $t,
816
- onFileShare: v === "bin" ? void 0 : en,
817
- onFileDelete: v === "bin" ? on : rn,
818
- onFileRestore: v === "bin" ? an : void 0,
819
- onFileFavorite: v === "bin" ? void 0 : sn,
820
- onFileRename: v === "bin" ? void 0 : cn,
821
- onFileDownload: ln,
822
- onFileCopy: v === "bin" ? void 0 : un,
823
- onFileMove: v === "bin" ? void 0 : dn,
824
- onFileInfo: fn,
825
- onFolderOpen: pn,
826
- onFolderShare: v === "bin" ? void 0 : tn,
827
- onFolderDelete: v === "bin" ? gn : mn,
828
- onFolderRestore: v === "bin" ? hn : void 0,
829
- onFolderRename: v === "bin" ? void 0 : _n,
830
- onFolderFavorite: v === "bin" ? void 0 : yn,
831
- onFolderMove: v === "bin" ? void 0 : vn,
832
- onFolderInfo: bn
821
+ onFilePreview: nn,
822
+ onFileShare: v === "bin" ? void 0 : rn,
823
+ onFileDelete: v === "bin" ? ln : sn,
824
+ onFileRestore: v === "bin" ? cn : void 0,
825
+ onFileFavorite: v === "bin" ? void 0 : un,
826
+ onFileRename: v === "bin" ? void 0 : dn,
827
+ onFileDownload: fn,
828
+ onFileCopy: v === "bin" ? void 0 : pn,
829
+ onFileMove: v === "bin" ? void 0 : mn,
830
+ onFileInfo: hn,
831
+ onFolderOpen: gn,
832
+ onFolderShare: v === "bin" ? void 0 : an,
833
+ onFolderDelete: v === "bin" ? yn : _n,
834
+ onFolderRestore: v === "bin" ? vn : void 0,
835
+ onFolderRename: v === "bin" ? void 0 : bn,
836
+ onFolderFavorite: v === "bin" ? void 0 : Sn,
837
+ onFolderMove: v === "bin" ? void 0 : xn,
838
+ onFolderInfo: Cn
833
839
  }), !k && (D.length > 0 || O.length > 0) && /* @__PURE__ */ u("div", {
834
840
  className: "mt-4 px-2 text-sm text-text-secondary",
835
- children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: D.length + O.length }), !b && v === "all" && pt !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: pt })}`]
841
+ children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: D.length + O.length }), !y && v === "all" && gt !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: gt })}`]
836
842
  })]
837
843
  }),
838
- mt && /* @__PURE__ */ l("div", {
844
+ _t && /* @__PURE__ */ l("div", {
839
845
  className: "fixed inset-0 backdrop-blur-sm flex items-center justify-center z-[100] animate-in fade-in duration-200",
840
846
  role: "dialog",
841
847
  "aria-modal": "true",
@@ -853,7 +859,7 @@ function d() {
853
859
  value: G,
854
860
  onChange: (e) => K(e.target.value),
855
861
  onKeyDown: (e) => {
856
- e.key === "Enter" && Qt(), e.key === "Escape" && (N(!1), K(""));
862
+ e.key === "Enter" && tn(), e.key === "Escape" && (N(!1), K(""));
857
863
  },
858
864
  "aria-label": a(d, "files.browser.newFolderDialog.title", "New folder"),
859
865
  placeholder: a(d, "files.browser.newFolderDialog.placeholder", "Folder name"),
@@ -870,7 +876,7 @@ function d() {
870
876
  children: a(d, "files.common.actions.cancel", "Cancel")
871
877
  }), /* @__PURE__ */ u("button", {
872
878
  type: "button",
873
- onClick: Qt,
879
+ onClick: tn,
874
880
  disabled: !G.trim() || $.isPending,
875
881
  className: "px-6 py-2.5 text-sm font-medium text-text-inverse bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover disabled:bg-bg-muted disabled:text-text-tertiary disabled:cursor-not-allowed transition-colors duration-200 flex items-center gap-2",
876
882
  children: [$.isPending && /* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), $.isPending ? a(d, "files.browser.newFolderDialog.actions.creating", "Creating...") : a(d, "files.common.actions.create", "Create")]
@@ -879,7 +885,7 @@ function d() {
879
885
  ]
880
886
  })
881
887
  }),
882
- _t && V && /* @__PURE__ */ l("div", {
888
+ bt && V && /* @__PURE__ */ l("div", {
883
889
  className: "fixed inset-0 backdrop-blur-sm flex items-center justify-center z-[100] animate-in fade-in duration-200",
884
890
  role: "dialog",
885
891
  "aria-modal": "true",
@@ -897,7 +903,7 @@ function d() {
897
903
  value: U,
898
904
  onChange: (e) => W(e.target.value),
899
905
  onKeyDown: (e) => {
900
- e.key === "Enter" && Cn(), e.key === "Escape" && (P(!1), H(null), W(""));
906
+ e.key === "Enter" && En(), e.key === "Escape" && (P(!1), H(null), W(""));
901
907
  },
902
908
  "aria-label": a(d, "files.browser.renameDialog.title", "Rename"),
903
909
  placeholder: a(d, "files.browser.renameDialog.placeholder", "New name"),
@@ -914,23 +920,23 @@ function d() {
914
920
  children: a(d, "files.common.actions.cancel", "Cancel")
915
921
  }), /* @__PURE__ */ u("button", {
916
922
  type: "button",
917
- onClick: Cn,
918
- disabled: !U.trim() || U.trim() === V.name || It.isPending || Lt.isPending,
923
+ onClick: En,
924
+ disabled: !U.trim() || U.trim() === V.name || zt.isPending || Bt.isPending,
919
925
  className: "px-6 py-2.5 text-sm font-medium text-text-inverse bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover disabled:bg-bg-muted disabled:text-text-tertiary disabled:cursor-not-allowed transition-colors duration-200 flex items-center gap-2",
920
- children: [(It.isPending || Lt.isPending) && /* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), It.isPending || Lt.isPending ? a(d, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(d, "files.common.actions.rename", "Rename")]
926
+ children: [(zt.isPending || Bt.isPending) && /* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), zt.isPending || Bt.isPending ? a(d, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(d, "files.common.actions.rename", "Rename")]
921
927
  })]
922
928
  })
923
929
  ]
924
930
  })
925
931
  }),
926
- vt && St && /* @__PURE__ */ l(we, {
927
- item: St,
928
- itemType: "mimeType" in St ? "file" : "folder",
932
+ xt && Tt && /* @__PURE__ */ l(we, {
933
+ item: Tt,
934
+ itemType: "mimeType" in Tt ? "file" : "folder",
929
935
  onClose: () => {
930
936
  F(!1), L(null);
931
937
  },
932
- onCreateShare: nn,
933
- isLoading: Rt.isPending
938
+ onCreateShare: on,
939
+ isLoading: Vt.isPending
934
940
  }),
935
941
  X && /* @__PURE__ */ l(Me, {
936
942
  title: X.title,
@@ -939,77 +945,77 @@ function d() {
939
945
  cancelLabel: a(d, "files.common.actions.cancel", "Cancel"),
940
946
  variant: X.variant,
941
947
  loading: X.loading,
942
- onConfirm: Dt,
948
+ onConfirm: At,
943
949
  onCancel: () => {
944
950
  X.loading || Z(null);
945
951
  }
946
952
  }),
947
- ht && /* @__PURE__ */ l(Me, {
953
+ vt && /* @__PURE__ */ l(Me, {
948
954
  title: a(d, "files.folder.quota.title", "Folder Limit Reached"),
949
955
  description: a(d, "files.folder.quota.description", "You've reached the folder limit for your plan. Upgrade your plan or purchase an add-on to create more folders."),
950
956
  confirmLabel: a(d, "files.folder.quota.upgrade", "View Billing"),
951
957
  cancelLabel: a(d, "files.common.actions.dismiss", "Dismiss"),
952
958
  onConfirm: () => {
953
- gt(!1), p("/billing");
959
+ yt(!1), p("/billing");
954
960
  },
955
- onCancel: () => gt(!1)
961
+ onCancel: () => yt(!1)
956
962
  }),
957
- yt && R && /* @__PURE__ */ l(Ae, {
963
+ St && R && /* @__PURE__ */ l(Ae, {
958
964
  item: R.item,
959
965
  type: R.type,
960
966
  onClose: () => {
961
967
  I(!1), z(null);
962
968
  },
963
- onMove: xn,
964
- isLoading: Vt.isPending || Ht.isPending
969
+ onMove: wn,
970
+ isLoading: Wt.isPending || Gt.isPending
965
971
  }),
966
- bt && B && /* @__PURE__ */ l(je, {
972
+ Ct && B && /* @__PURE__ */ l(je, {
967
973
  item: B.item,
968
974
  type: B.type,
969
975
  onClose: () => {
970
- xt(!1), Ct(null);
976
+ wt(!1), Et(null);
971
977
  },
972
- onCopy: Sn,
973
- isLoading: Bt.isPending
978
+ onCopy: Tn,
979
+ isLoading: Ut.isPending
974
980
  }),
975
- x && /* @__PURE__ */ l(Te, {
976
- file: x,
977
- onClose: () => dt(null),
981
+ b && /* @__PURE__ */ l(Te, {
982
+ file: b,
983
+ onClose: () => ht(null),
978
984
  onDownload: () => {
979
- Le(x.downloadUrl || x.url);
985
+ ze(b.downloadUrl || b.url);
980
986
  },
981
987
  onShare: v === "bin" ? void 0 : () => {
982
- L(x), F(!0);
988
+ L(b), F(!0);
983
989
  },
984
- onStar: v === "bin" ? void 0 : () => sn(x),
985
- onDelete: () => v === "bin" ? on(x) : rn(x)
990
+ onStar: v === "bin" ? void 0 : () => un(b),
991
+ onDelete: () => v === "bin" ? ln(b) : sn(b)
986
992
  }),
987
- lt && /* @__PURE__ */ l(Ee, {
988
- item: lt.item,
989
- type: lt.type,
990
- onClose: () => ut(null)
993
+ pt && /* @__PURE__ */ l(Ee, {
994
+ item: pt.item,
995
+ type: pt.type,
996
+ onClose: () => mt(null)
991
997
  }),
992
998
  /* @__PURE__ */ l(Ne, {
993
- items: Tt,
994
- isOpen: Et,
999
+ items: Ot,
1000
+ isOpen: kt,
995
1001
  onClose: () => Y(!1),
996
- onPause: Kt,
997
- onResume: qt,
998
- onRetry: Jt,
999
- onCancel: Yt
1002
+ onPause: Yt,
1003
+ onResume: Xt,
1004
+ onRetry: Zt,
1005
+ onCancel: Qt
1000
1006
  }),
1001
1007
  /* @__PURE__ */ l(Oe, {
1002
- toasts: S.toasts,
1003
- onClose: S.removeToast
1008
+ toasts: x.toasts,
1009
+ onClose: x.removeToast
1004
1010
  }),
1005
1011
  !k && D.length === 0 && O.length === 0 && /* @__PURE__ */ l("div", {
1006
1012
  className: "px-6 py-12",
1007
- children: b ? /* @__PURE__ */ u("div", {
1013
+ children: y ? /* @__PURE__ */ u("div", {
1008
1014
  className: "text-center animate-in fade-in duration-300",
1009
1015
  children: [
1010
1016
  /* @__PURE__ */ l("div", {
1011
1017
  className: "inline-flex items-center justify-center size-16 bg-bg-muted rounded-full mb-4",
1012
- children: /* @__PURE__ */ l(qe, { className: "size-8 text-text-tertiary" })
1018
+ children: /* @__PURE__ */ l(Ye, { className: "size-8 text-text-tertiary" })
1013
1019
  }),
1014
1020
  /* @__PURE__ */ l("h3", {
1015
1021
  className: "text-lg font-medium text-text-primary mb-2",
@@ -1022,7 +1028,7 @@ function d() {
1022
1028
  /* @__PURE__ */ l("button", {
1023
1029
  type: "button",
1024
1030
  onClick: () => {
1025
- ot(""), ct(void 0);
1031
+ ut(""), ft(void 0);
1026
1032
  },
1027
1033
  className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-text-inverse bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover transition-colors duration-200",
1028
1034
  children: a(d, "files.browser.search.clear", "Clear search")
@@ -1030,8 +1036,8 @@ function d() {
1030
1036
  ]
1031
1037
  }) : /* @__PURE__ */ l(De, {
1032
1038
  type: v,
1033
- onUpload: v === "all" ? Wt : void 0,
1034
- onNewFolder: v === "all" ? Zt : void 0
1039
+ onUpload: v === "all" ? qt : void 0,
1040
+ onNewFolder: v === "all" ? en : void 0
1035
1041
  })
1036
1042
  })
1037
1043
  ]