@burdenoff/microfe-files 2026.625.3 → 2026.625.4

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