@burdenoff/microfe-files 2026.1111.2 → 2026.1113.1

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.
Files changed (72) hide show
  1. package/README.md +14 -0
  2. package/dist/files/components/CopyDialog.d.ts +10 -0
  3. package/dist/files/components/CopyDialog.js +83 -85
  4. package/dist/files/components/CopyDialog.js.map +1 -1
  5. package/dist/files/components/FileBrowser.d.ts +0 -2
  6. package/dist/files/components/FileBrowser.js +256 -232
  7. package/dist/files/components/FileBrowser.js.map +1 -1
  8. package/dist/files/components/FileCard.d.ts +0 -1
  9. package/dist/files/components/FileCard.js +57 -63
  10. package/dist/files/components/FileCard.js.map +1 -1
  11. package/dist/files/components/FileInfoPanel.js +106 -104
  12. package/dist/files/components/FileInfoPanel.js.map +1 -1
  13. package/dist/files/components/FileListItem.d.ts +0 -1
  14. package/dist/files/components/FileListItem.js +141 -147
  15. package/dist/files/components/FileListItem.js.map +1 -1
  16. package/dist/files/components/FilePreviewModal.js +87 -86
  17. package/dist/files/components/FilePreviewModal.js.map +1 -1
  18. package/dist/files/components/FileVisibilityControl.d.ts +5 -0
  19. package/dist/files/components/FileVisibilityControl.js +99 -0
  20. package/dist/files/components/FileVisibilityControl.js.map +1 -0
  21. package/dist/files/components/FolderCard.d.ts +0 -1
  22. package/dist/files/components/FolderCard.js +122 -128
  23. package/dist/files/components/FolderCard.js.map +1 -1
  24. package/dist/files/components/SearchBar.js.map +1 -1
  25. package/dist/files/components/ShareDialog.d.ts +8 -12
  26. package/dist/files/components/ShareDialog.js +128 -146
  27. package/dist/files/components/ShareDialog.js.map +1 -1
  28. package/dist/files/components/ToolbarMoreMenu.d.ts +13 -0
  29. package/dist/files/components/ToolbarMoreMenu.js +36 -0
  30. package/dist/files/components/ToolbarMoreMenu.js.map +1 -0
  31. package/dist/files/components/UploadQueue.d.ts +3 -1
  32. package/dist/files/components/UploadQueue.js +99 -72
  33. package/dist/files/components/UploadQueue.js.map +1 -1
  34. package/dist/files/components/UploadVisibilitySelect.d.ts +7 -0
  35. package/dist/files/components/UploadVisibilitySelect.js +45 -0
  36. package/dist/files/components/UploadVisibilitySelect.js.map +1 -0
  37. package/dist/files/components/contextMenuItems.d.ts +0 -1
  38. package/dist/files/components/contextMenuItems.js +50 -55
  39. package/dist/files/components/contextMenuItems.js.map +1 -1
  40. package/dist/files/hooks/useUploadFile.d.ts +5 -1
  41. package/dist/files/hooks/useUploadFile.js +47 -42
  42. package/dist/files/hooks/useUploadFile.js.map +1 -1
  43. package/dist/files/pages/BrowserPage.js +621 -563
  44. package/dist/files/pages/BrowserPage.js.map +1 -1
  45. package/dist/files/pages/ShareAccessPage.js +120 -75
  46. package/dist/files/pages/ShareAccessPage.js.map +1 -1
  47. package/dist/files/types.d.ts +13 -1
  48. package/dist/files/utils/bulkResults.d.ts +35 -0
  49. package/dist/files/utils/bulkResults.js +30 -0
  50. package/dist/files/utils/bulkResults.js.map +1 -0
  51. package/dist/files/utils/copyForm.d.ts +9 -0
  52. package/dist/files/utils/copyForm.js +10 -0
  53. package/dist/files/utils/copyForm.js.map +1 -0
  54. package/dist/files/utils/desktopDrop.d.ts +10 -0
  55. package/dist/files/utils/desktopDrop.js +10 -0
  56. package/dist/files/utils/desktopDrop.js.map +1 -0
  57. package/dist/files/utils/index.d.ts +6 -1
  58. package/dist/files/utils/index.js +6 -0
  59. package/dist/files/utils/index.js.map +1 -1
  60. package/dist/files/utils/shareAccess.d.ts +32 -0
  61. package/dist/files/utils/shareAccess.js +24 -0
  62. package/dist/files/utils/shareAccess.js.map +1 -0
  63. package/dist/files/utils/shareForm.d.ts +26 -0
  64. package/dist/files/utils/shareForm.js +23 -0
  65. package/dist/files/utils/shareForm.js.map +1 -0
  66. package/dist/files/utils/uploadVisibility.d.ts +5 -0
  67. package/dist/files/utils/uploadVisibility.js +12 -0
  68. package/dist/files/utils/uploadVisibility.js.map +1 -0
  69. package/dist/translations/en.d.ts +39 -2
  70. package/dist/translations/en.js +43 -4
  71. package/dist/translations/en.js.map +1 -1
  72. package/package.json +1 -1
@@ -9,70 +9,75 @@ import { useStarredItems as ne } from "../hooks/useStarredItems.js";
9
9
  import { useBinItems as re } from "../hooks/useBinItems.js";
10
10
  import { useCreateFolder as ie } from "../hooks/useCreateFolder.js";
11
11
  import { useUploadFile as ae } from "../hooks/useUploadFile.js";
12
- import { useDeleteFile as oe } from "../hooks/useDeleteFile.js";
13
- import { useDeleteFolder as se } from "../hooks/useDeleteFolder.js";
14
- import { useRestoreFile as ce } from "../hooks/useRestoreFile.js";
15
- import { useRestoreFolder as le } from "../hooks/useRestoreFolder.js";
16
- import { usePermanentlyDeleteFile as ue } from "../hooks/usePermanentlyDeleteFile.js";
17
- import { usePermanentlyDeleteFolder as de } from "../hooks/usePermanentlyDeleteFolder.js";
18
- import { useToggleStar as fe } from "../hooks/useToggleStar.js";
19
- import { useRenameFile as pe } from "../hooks/useRenameFile.js";
20
- import { useRenameFolder as me } from "../hooks/useRenameFolder.js";
21
- import { useCreateShare as he } from "../hooks/useCreateShare.js";
22
- import { useCreateFolderShare as ge } from "../hooks/useCreateFolderShare.js";
23
- import { useCopyFile as _e } from "../hooks/useCopyFile.js";
24
- import { useItemSharePermission as ve } from "../hooks/useSharePermissions.js";
25
- import { fileCapabilities as ye, isShareOffered as be, shareLookupTarget as xe } from "../utils/itemCapabilities.js";
26
- import { shareEntryDeniedReason as Se, sharePermissionMessages as Ce } from "../utils/sharePermission.js";
27
- import { useMoveFile as we } from "../hooks/useMoveFile.js";
28
- import { useMoveFolder as Te } from "../hooks/useMoveFolder.js";
29
- import { useBulkDelete as Ee } from "../hooks/useBatchOperations.js";
30
- import { useSearch as De } from "../hooks/useSearch.js";
31
- import { useToast as Oe } from "../hooks/useToast.js";
32
- import { FileBrowser as ke } from "../components/FileBrowser.js";
33
- import { TabBar as Ae } from "../components/TabBar.js";
34
- import { generateThumbnail as je } from "../utils/thumbnail.js";
35
- import { ShareDialog as Me } from "../components/ShareDialog.js";
36
- import { FilePreviewModal as Ne } from "../components/FilePreviewModal.js";
37
- import { FileInfoPanel as Pe } from "../components/FileInfoPanel.js";
38
- import { EmptyState as Fe } from "../components/EmptyState.js";
39
- import { ToastContainer as Ie } from "../components/Toast.js";
40
- import { SearchBar as Le } from "../components/SearchBar.js";
41
- import { MoveDialog as Re } from "../components/MoveDialog.js";
42
- import { CopyDialog as ze } from "../components/CopyDialog.js";
43
- import { ConfirmDialog as Be } from "../components/ConfirmDialog.js";
44
- import { UploadQueue as Ve } from "../components/UploadQueue.js";
45
- import { StorageBanner as He } from "../components/StorageBanner.js";
46
- import { useStorageQuota as Ue } from "../hooks/useStorageQuota.js";
47
- import { isQuotaExhaustedError as We } from "../utils/quotaUtils.js";
48
- import { nativeImpact as Ge, nativeNotify as Ke, nativeOpenUrl as qe } from "../../utils/nativeBridge.js";
49
- import { emitFilesEvent as Je } from "../utils/events.js";
12
+ import { FileVisibility as oe } from "../../generated/wspace-types.js";
13
+ import { UploadVisibilitySelect as se } from "../components/UploadVisibilitySelect.js";
14
+ import { useDeleteFile as ce } from "../hooks/useDeleteFile.js";
15
+ import { useDeleteFolder as le } from "../hooks/useDeleteFolder.js";
16
+ import { useRestoreFile as ue } from "../hooks/useRestoreFile.js";
17
+ import { useRestoreFolder as de } from "../hooks/useRestoreFolder.js";
18
+ import { usePermanentlyDeleteFile as fe } from "../hooks/usePermanentlyDeleteFile.js";
19
+ import { usePermanentlyDeleteFolder as pe } from "../hooks/usePermanentlyDeleteFolder.js";
20
+ import { useToggleStar as me } from "../hooks/useToggleStar.js";
21
+ import { useRenameFile as he } from "../hooks/useRenameFile.js";
22
+ import { useRenameFolder as ge } from "../hooks/useRenameFolder.js";
23
+ import { useCreateShare as _e } from "../hooks/useCreateShare.js";
24
+ import { useCreateFolderShare as ve } from "../hooks/useCreateFolderShare.js";
25
+ import { useCopyFile as ye } from "../hooks/useCopyFile.js";
26
+ import { useItemSharePermission as be } from "../hooks/useSharePermissions.js";
27
+ import { fileCapabilities as xe, isShareOffered as Se, shareLookupTarget as Ce } from "../utils/itemCapabilities.js";
28
+ import { shareEntryDeniedReason as we, sharePermissionMessages as Te } from "../utils/sharePermission.js";
29
+ import { useMoveFile as Ee } from "../hooks/useMoveFile.js";
30
+ import { useMoveFolder as De } from "../hooks/useMoveFolder.js";
31
+ import { useBulkDelete as Oe } from "../hooks/useBatchOperations.js";
32
+ import { useSearch as ke } from "../hooks/useSearch.js";
33
+ import { useToast as Ae } from "../hooks/useToast.js";
34
+ import { FileBrowser as je } from "../components/FileBrowser.js";
35
+ import { TabBar as Me } from "../components/TabBar.js";
36
+ import { generateThumbnail as Ne } from "../utils/thumbnail.js";
37
+ import { ShareDialog as Pe } from "../components/ShareDialog.js";
38
+ import { FilePreviewModal as Fe } from "../components/FilePreviewModal.js";
39
+ import { FileInfoPanel as Ie } from "../components/FileInfoPanel.js";
40
+ import { EmptyState as Le } from "../components/EmptyState.js";
41
+ import { ToastContainer as Re } from "../components/Toast.js";
42
+ import { SearchBar as ze } from "../components/SearchBar.js";
43
+ import { MoveDialog as Be } from "../components/MoveDialog.js";
44
+ import { CopyDialog as Ve } from "../components/CopyDialog.js";
45
+ import { ConfirmDialog as He } from "../components/ConfirmDialog.js";
46
+ import { UploadQueue as Ue } from "../components/UploadQueue.js";
47
+ import { StorageBanner as We } from "../components/StorageBanner.js";
48
+ import { useStorageQuota as Ge } from "../hooks/useStorageQuota.js";
49
+ import { isQuotaExhaustedError as Ke } from "../utils/quotaUtils.js";
50
+ import { nativeImpact as qe, nativeNotify as Je, nativeOpenUrl as Ye } from "../../utils/nativeBridge.js";
51
+ import { emitFilesEvent as Xe } from "../utils/events.js";
50
52
  import { tWithFallback as o } from "../utils/i18n.js";
51
53
  import "../utils/index.js";
52
- import { useEffect as Ye, useMemo as Xe, useState as s } from "react";
53
- import { FolderPlus as Ze, FolderUp as Qe, FolderX as $e, Grid3x3 as et, Home as tt, List as nt, Loader2 as c, Star as rt, Trash2 as it, Upload as at, X as ot } from "lucide-react";
54
- import { Fragment as st, jsx as l, jsxs as u } from "react/jsx-runtime";
55
- import { useNavigate as ct, useParams as lt } from "react-router";
56
- import { useI18n as ut } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
57
- import { AuroraBackground as dt, Button as d, CTAOverflowMenu as ft, EmphasisPanel as pt, GradientText as mt, IllustratedEmptyState as ht, Input as gt, NextSteps as _t, PagePurpose as vt, ResponsiveDialog as yt, ResponsiveDialogContent as bt, ResponsiveDialogFooter as xt, ResponsiveDialogHeader as St, ResponsiveDialogTitle as Ct } from "@burdenoff/fe-libs/ui";
54
+ import { isDesktopFileDrag as Ze } from "../utils/desktopDrop.js";
55
+ import { bulkTargets as Qe, runPerItem as $e, summarizeFailedNames as et } from "../utils/bulkResults.js";
56
+ import { ToolbarMoreMenu as tt } from "../components/ToolbarMoreMenu.js";
57
+ import { useEffect as nt, useMemo as rt, useState as s } from "react";
58
+ import { FolderPlus as it, FolderUp as at, FolderX as ot, Grid3x3 as st, Home as ct, List as lt, Loader2 as ut, Star as dt, Trash2 as ft, Upload as pt, X as mt } from "lucide-react";
59
+ import { Fragment as ht, jsx as c, jsxs as l } from "react/jsx-runtime";
60
+ import { useNavigate as gt, useParams as _t } from "react-router";
61
+ import { useI18n as vt } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
62
+ import { AuroraBackground as yt, Button as u, CTAOverflowMenu as bt, EmphasisPanel as xt, GradientText as St, IllustratedEmptyState as Ct, Input as wt, NextSteps as Tt, PagePurpose as Et, ResponsiveDialog as Dt, ResponsiveDialogContent as Ot, ResponsiveDialogFooter as kt, ResponsiveDialogHeader as At, ResponsiveDialogTitle as jt } from "@burdenoff/fe-libs/ui";
58
63
  // src/files/pages/BrowserPage.tsx
59
- function f() {
60
- let { t: f } = ut(), { folderId: p } = lt(), m = ct(), wt = i(), { workspaceId: h } = wt, Tt = Ue(h ?? ""), { viewMode: Et, setViewMode: Dt, breadcrumbs: Ot, selectedFiles: kt, selectedFolders: g, clearSelection: _ } = a(), [v, At] = s("all"), jt = Xe(() => [
64
+ function d() {
65
+ let { t: d } = vt(), { folderId: f } = _t(), p = gt(), Mt = i(), { workspaceId: m } = Mt, h = Mt.navigationV2 === !0, Nt = Ge(m ?? ""), { viewMode: Pt, setViewMode: Ft, breadcrumbs: It, selectedFiles: Lt, selectedFolders: g, clearSelection: Rt } = a(), [_, v] = s("all"), zt = rt(() => [
61
66
  "all",
62
67
  "recent",
63
68
  "starred",
64
69
  "bin"
65
70
  ], []);
66
- Ye(() => {
67
- jt.includes(v) || At("all");
68
- }, [jt, v]);
69
- let [y, Mt] = s(""), [Nt, Pt] = s(), b = y.trim().length >= 2, [Ft, It] = s(null), [x, Lt] = s(null), S = Oe(), C = ee({
70
- folderId: p || void 0,
71
+ nt(() => {
72
+ zt.includes(_) || v("all");
73
+ }, [zt, _]);
74
+ let [y, Bt] = s(""), [Vt, Ht] = s(), b = y.trim().length >= 2, [Ut, Wt] = s(null), [x, Gt] = s(null), S = Ae(), C = ee({
75
+ folderId: f || void 0,
71
76
  pageSize: 100,
72
- skip: v !== "all" || b
73
- }), w = te({ skip: v !== "recent" || b }), T = ne({ skip: v !== "starred" || b }), Rt = re({ skip: v !== "bin" || b }), E = De(y, b, Nt);
74
- Ye(() => {
75
- if (p && C.data?.folderPath && C.data?.currentFolder) {
77
+ skip: _ !== "all" || b
78
+ }), Kt = te({ skip: _ !== "recent" || b }), qt = ne({ skip: _ !== "starred" || b }), w = re({ skip: _ !== "bin" || b }), T = ke(y, b, Vt);
79
+ nt(() => {
80
+ if (f && C.data?.folderPath && C.data?.currentFolder) {
76
81
  let e = C.data.folderPath.folders || [], t = C.data.currentFolder, n = [...e.map((e) => ({
77
82
  id: e.id,
78
83
  name: e.name
@@ -82,74 +87,84 @@ function f() {
82
87
  }];
83
88
  a.getState().setBreadcrumbs(n);
84
89
  } else a.getState().setBreadcrumbs([]);
85
- }, [p, C.data]);
86
- let D = [], O = [], k = !1, A = null, j = !1;
87
- if (b && E.data) D = E.data.files || [], O = E.data.folders || [], k = E.isLoading, A = E.error;
88
- else switch (v) {
90
+ }, [f, C.data]);
91
+ let E = [], D = [], O = !1, k = null, A = !1;
92
+ if (b && T.data) E = T.data.files || [], D = T.data.folders || [], O = T.isLoading, k = T.error;
93
+ else switch (_) {
89
94
  case "all":
90
- D = C.data?.filesList?.files.map(t) || [], O = C.data?.foldersList?.folders.map(n) || [], k = C.loading, A = C.error || null, j = !1;
95
+ E = C.data?.filesList?.files.map(t) || [], D = C.data?.foldersList?.folders.map(n) || [], O = C.loading, k = C.error || null, A = !1;
91
96
  break;
92
97
  case "recent":
93
- D = w.files || [], O = w.folders || [], k = w.isLoading, A = w.error || null, j = !0;
98
+ E = Kt.files || [], D = Kt.folders || [], O = Kt.isLoading, k = Kt.error || null, A = !0;
94
99
  break;
95
100
  case "starred":
96
- D = T.files, O = T.folders, k = T.isLoading, A = T.error || null, j = !0;
101
+ E = qt.files, D = qt.folders, O = qt.isLoading, k = qt.error || null, A = !0;
97
102
  break;
98
- case "bin": D = Rt.files, O = Rt.folders, k = Rt.isLoading, A = Rt.error || null, j = !0;
103
+ case "bin": E = w.files, D = w.folders, O = w.isLoading, k = w.error || null, A = !0;
99
104
  }
100
- let zt = v === "all" ? (C.data?.filesList?.total ?? D.length) + (C.data?.foldersList?.total ?? O.length) : null, M = kt.size + g.size, [Bt, N] = s(!1), [Vt, Ht] = s(!1), [Ut, Wt] = s(!1), [Gt, P] = s(!1), [Kt, qt] = s(!1), [Jt, F] = s(!1), [Yt, Xt] = s(!1), [Zt, Qt] = s(null), [$t, en] = s(void 0), [I, L] = s(null), [R, tn] = s(null), [z, B] = s(null), [V, H] = s(""), [U, W] = s(""), { uploading: G, uploadQueue: nn, isUploadPanelOpen: rn, setUploading: an, setUploadQueue: K, setIsUploadPanelOpen: on, cancelUpload: sn } = e(), [q, J] = s(null), Y = (e, t) => {
101
- Je(wt, e, t);
102
- }, cn = async () => {
103
- if (!q || q.loading) return;
104
- let e = q.onConfirm;
105
- J({
106
- ...q,
105
+ let Jt = _ === "all" ? (C.data?.filesList?.total ?? E.length) + (C.data?.foldersList?.total ?? D.length) : null, j = Lt.size + g.size, [Yt, M] = s(!1), [Xt, Zt] = s(!1), [Qt, $t] = s(!1), [en, N] = s(!1), [tn, nn] = s(!1), [rn, P] = s(!1), [an, on] = s(!1), [sn, cn] = s(null), [ln, un] = s(void 0), [F, I] = s(null), [L, dn] = s(null), [R, z] = s(null), [B, V] = s(""), [H, U] = s(""), [fn, pn] = s(oe.Private), { uploading: W, uploadQueue: mn, isUploadPanelOpen: hn, setUploading: gn, setUploadQueue: G, setIsUploadPanelOpen: _n, cancelUpload: vn } = e(), [K, q] = s(null), J = (e, t) => {
106
+ Xe(Mt, e, t);
107
+ }, yn = async () => {
108
+ if (!K || K.loading) return;
109
+ let e = K.onConfirm;
110
+ q({
111
+ ...K,
107
112
  loading: !0
108
113
  });
109
114
  try {
110
- await e(), J(null);
115
+ await e(), q(null);
111
116
  } catch (e) {
112
- Y("files.api.failed", {
117
+ J("files.api.failed", {
113
118
  action: "confirmDialog",
114
119
  message: e instanceof Error ? e.message : "Confirmed action failed"
115
- }), J((e) => e && {
120
+ }), q((e) => e && {
116
121
  ...e,
117
122
  loading: !1
118
123
  });
119
124
  }
120
- }, X = ie(), ln = ae(), un = oe(), dn = se(), fn = ce(), pn = le(), mn = ue(), hn = de(), gn = fe(), Z = pe(), Q = me(), _n = he(), vn = ge(), $ = x ? ye(x) : null, yn = ve($ && v !== "bin" ? xe($.share) : null), bn = _e(), xn = we(), Sn = Te(), Cn = Ee(), wn = () => {
125
+ }, Y = ie(), bn = ae(), xn = ce(), Sn = le(), Cn = ue(), wn = de(), Tn = fe(), En = pe(), Dn = me(), X = he(), Z = ge(), On = _e(), kn = ve(), Q = x ? xe(x) : null, An = be(Q && _ !== "bin" ? Ce(Q.share) : null), jn = ye(), Mn = Ee(), Nn = De(), Pn = Oe(), Fn = async (e) => {
126
+ if (e.length === 0) return;
127
+ let t = await Promise.all(e.map(async (e, t) => {
128
+ let n = await Ne(e);
129
+ return {
130
+ id: `${Date.now()}-${t}-${e.name}`,
131
+ file: e,
132
+ status: "pending",
133
+ progress: 0,
134
+ folderId: f || void 0,
135
+ visibility: fn,
136
+ thumbnailUrl: n ?? void 0
137
+ };
138
+ }));
139
+ G((e) => [...e, ...t]), _n(!0), gn(!0);
140
+ for (let e of t) await Hn(e);
141
+ gn(!1);
142
+ }, In = () => {
121
143
  let e = document.createElement("input");
122
144
  e.type = "file", e.multiple = !0, e.onchange = async (e) => {
123
145
  let t = e.target.files;
124
- if (t && t.length > 0) {
125
- let e = await Promise.all(Array.from(t).map(async (e, t) => {
126
- let n = await je(e);
127
- return {
128
- id: `${Date.now()}-${t}-${e.name}`,
129
- file: e,
130
- status: "pending",
131
- progress: 0,
132
- folderId: p || void 0,
133
- thumbnailUrl: n ?? void 0
134
- };
135
- }));
136
- K((t) => [...t, ...e]), on(!0), an(!0);
137
- for (let t of e) await Tn(t);
138
- an(!1);
139
- }
146
+ t && t.length > 0 && await Fn(Array.from(t));
140
147
  }, e.click();
141
- }, Tn = async (e) => {
148
+ }, [Ln, Rn] = s(!1), $ = h && _ === "all" && !b && !W, zn = (e) => {
149
+ $ && Ze(e.dataTransfer) && (e.preventDefault(), e.dataTransfer.dropEffect = "copy", Ln || Rn(!0));
150
+ }, Bn = (e) => {
151
+ let t = e.relatedTarget;
152
+ t instanceof Node && e.currentTarget.contains(t) || Rn(!1);
153
+ }, Vn = (e) => {
154
+ $ && Ze(e.dataTransfer) && (e.preventDefault(), Rn(!1), Fn(Array.from(e.dataTransfer.files)));
155
+ }, Hn = async (e) => {
142
156
  let t = (t) => {
143
- K((n) => n.map((n) => n.id === e.id ? {
157
+ G((n) => n.map((n) => n.id === e.id ? {
144
158
  ...n,
145
159
  ...t
146
160
  } : n));
147
161
  };
148
162
  t({ status: "uploading" });
149
163
  try {
150
- let n = await ln.mutateAsync({
164
+ let n = await bn.mutateAsync({
151
165
  file: e.file,
152
166
  folderId: e.folderId,
167
+ visibility: e.visibility,
153
168
  onProgress: (e) => {
154
169
  t({ progress: e });
155
170
  }
@@ -157,44 +172,44 @@ function f() {
157
172
  t({
158
173
  status: "completed",
159
174
  progress: 100
160
- }), Y("files.file.uploaded", {
175
+ }), J("files.file.uploaded", {
161
176
  fileId: n.id,
162
177
  fileName: n.name,
163
178
  folderId: e.folderId
164
179
  });
165
180
  } catch (n) {
166
- let r = n instanceof Error ? n.message : o(f, "files.upload.errors.failed", "Upload failed");
167
- r === "Upload paused" ? t({ status: "paused" }) : We(n) ? (t({
181
+ let r = n instanceof Error ? n.message : o(d, "files.upload.errors.failed", "Upload failed");
182
+ r === "Upload paused" ? t({ status: "paused" }) : Ke(n) ? (t({
168
183
  status: "failed",
169
- error: o(f, "files.upload.errors.quotaExceeded", "Storage quota exceeded")
170
- }), Wt(!0)) : (t({
184
+ error: o(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded")
185
+ }), $t(!0)) : (t({
171
186
  status: "failed",
172
187
  error: r
173
- }), Y("files.api.failed", {
188
+ }), J("files.api.failed", {
174
189
  action: "uploadFile",
175
190
  fileName: e.file.name,
176
191
  message: r
177
192
  }));
178
193
  }
179
- }, En = (e) => {
180
- ln.pause(), K((t) => t.map((t) => t.id === e ? {
194
+ }, Un = (e) => {
195
+ bn.pause(), G((t) => t.map((t) => t.id === e ? {
181
196
  ...t,
182
197
  status: "paused"
183
198
  } : t));
184
- }, Dn = (e) => {
185
- let t = nn.find((t) => t.id === e);
186
- t && Tn(t);
187
- }, On = (e) => {
188
- let t = nn.find((t) => t.id === e);
189
- t && (K((t) => t.map((t) => t.id === e ? {
199
+ }, Wn = (e) => {
200
+ let t = mn.find((t) => t.id === e);
201
+ t && Hn(t);
202
+ }, Gn = (e) => {
203
+ let t = mn.find((t) => t.id === e);
204
+ t && (G((t) => t.map((t) => t.id === e ? {
190
205
  ...t,
191
206
  status: "pending",
192
207
  progress: 0,
193
208
  error: void 0
194
- } : t)), Tn(t));
195
- }, kn = sn, An = () => {
196
- if (!h) {
197
- S.error(o(f, "files.workspace.errors.notSelected", "Workspace not selected"));
209
+ } : t)), Hn(t));
210
+ }, Kn = vn, qn = () => {
211
+ if (!m) {
212
+ S.error(o(d, "files.workspace.errors.notSelected", "Workspace not selected"));
198
213
  return;
199
214
  }
200
215
  let e = document.createElement("input");
@@ -209,10 +224,10 @@ function f() {
209
224
  let n = /* @__PURE__ */ new Map(), r = Array.from(e.keys()).sort();
210
225
  for (let e of r) {
211
226
  if (!e) continue;
212
- let t = e.split("/"), r = "", i = p || void 0;
227
+ let t = e.split("/"), r = "", i = f || void 0;
213
228
  for (let e of t) if (r = r ? `${r}/${e}` : e, n.has(r)) i = n.get(r);
214
229
  else try {
215
- let { data: t } = await X.mutateAsync({
230
+ let { data: t } = await Y.mutateAsync({
216
231
  name: e,
217
232
  parentFolderId: i
218
233
  });
@@ -221,57 +236,61 @@ function f() {
221
236
  }
222
237
  let i = [], a = 0;
223
238
  for (let [t, r] of e) {
224
- let e = t ? n.get(t) : p || void 0;
239
+ let e = t ? n.get(t) : f || void 0;
225
240
  for (let t of r) {
226
- let n = await je(t);
241
+ let n = await Ne(t);
227
242
  i.push({
228
243
  id: `${Date.now()}-${a++}-${t.name}`,
229
244
  file: t,
230
245
  status: "pending",
231
246
  progress: 0,
232
247
  folderId: e,
248
+ visibility: fn,
233
249
  thumbnailUrl: n ?? void 0
234
250
  });
235
251
  }
236
252
  }
237
- K((e) => [...e, ...i]), on(!0), an(!0);
238
- for (let e of i) await Tn(e);
239
- an(!1), S.success(o(f, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
253
+ G((e) => [...e, ...i]), _n(!0), gn(!0);
254
+ for (let e of i) await Hn(e);
255
+ gn(!1), S.success(o(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
240
256
  count: i.length,
241
257
  plural: i.length > 1 ? "s" : ""
242
258
  }));
243
259
  }
244
260
  }, e.click();
245
- }, jn = () => {
246
- N(!0);
247
- }, Mn = async () => {
248
- if (U.trim() && h) {
249
- let { data: e, error: t } = await X.mutateAsync({
250
- name: U,
251
- parentFolderId: p
261
+ }, Jn = () => {
262
+ M(!0);
263
+ }, Yn = () => {
264
+ let e = a.getState();
265
+ e.selectAllFiles(E.map((e) => e.id)), D.forEach((t) => e.selectFolder(t.id));
266
+ }, Xn = async () => {
267
+ if (H.trim() && m) {
268
+ let { data: e, error: t } = await Y.mutateAsync({
269
+ name: H,
270
+ parentFolderId: f
252
271
  });
253
272
  if (t) {
254
- We(t) ? (N(!1), W(""), Ht(!0)) : (S.error(t instanceof Error ? t.message : o(f, "files.folder.errors.createFailed", "Folder creation failed")), Y("files.api.failed", {
273
+ Ke(t) ? (M(!1), U(""), Zt(!0)) : (S.error(t instanceof Error ? t.message : o(d, "files.folder.errors.createFailed", "Folder creation failed")), J("files.api.failed", {
255
274
  action: "createFolder",
256
275
  message: t instanceof Error ? t.message : "Folder creation failed"
257
276
  }));
258
277
  return;
259
278
  }
260
- e && (W(""), N(!1), Y("files.folder.created", {
261
- folderName: U,
262
- parentFolderId: p
279
+ e && (U(""), M(!1), J("files.folder.created", {
280
+ folderName: H,
281
+ parentFolderId: f
263
282
  }));
264
283
  }
265
- }, Nn = (e) => {
266
- Lt(e);
267
- }, Pn = (e, t) => {
268
- Qt(e), en(t), qt(!0);
269
- }, Fn = (e, t) => {
270
- Pn(e, t);
271
- }, In = (e, t) => {
272
- Pn(e, t);
273
- }, Ln = async (e) => {
274
- if (!e.fileId && !e.folderId) throw Error(o(f, "files.share.errors.targetRequired", "Share requires a file id or folder id"));
284
+ }, Zn = (e) => {
285
+ Gt(e);
286
+ }, Qn = (e, t) => {
287
+ cn(e), un(t), nn(!0);
288
+ }, $n = (e, t) => {
289
+ Qn(e, t);
290
+ }, er = (e, t) => {
291
+ Qn(e, t);
292
+ }, tr = async (e) => {
293
+ if (!e.fileId && !e.folderId) throw Error(o(d, "files.share.errors.targetRequired", "Share requires a file id or folder id"));
275
294
  let t = e.invitedEmail ? "EMAIL_INVITE" : "PUBLIC_LINK", n = "";
276
295
  if (e.fileId) {
277
296
  let r = {
@@ -283,7 +302,7 @@ function f() {
283
302
  shareType: t,
284
303
  accessLevel: "DOWNLOAD"
285
304
  };
286
- n = (await _n.mutateAsync(r))?.token ?? "", Y("files.share.created", {
305
+ n = (await On.mutateAsync(r))?.token ?? "", J("files.share.created", {
287
306
  entityType: "file",
288
307
  fileId: e.fileId,
289
308
  shareType: t
@@ -298,7 +317,7 @@ function f() {
298
317
  shareType: t,
299
318
  accessLevel: "DOWNLOAD"
300
319
  };
301
- n = (await vn.mutateAsync(r))?.token ?? "", Y("files.share.created", {
320
+ n = (await kn.mutateAsync(r))?.token ?? "", J("files.share.created", {
302
321
  entityType: "folder",
303
322
  folderId: e.folderId,
304
323
  shareType: t
@@ -308,21 +327,21 @@ function f() {
308
327
  publicUrl: n ? `${window.location.origin}/files/share/${n}` : "",
309
328
  token: n
310
329
  };
311
- }, Rn = async (e) => {
312
- Ge("medium"), J({
313
- title: o(f, "files.confirm.deleteFile.title", "Delete file"),
314
- description: o(f, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
315
- confirmLabel: o(f, "files.common.actions.delete", "Delete"),
330
+ }, nr = async (e) => {
331
+ qe("medium"), q({
332
+ title: o(d, "files.confirm.deleteFile.title", "Delete file"),
333
+ description: o(d, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
334
+ confirmLabel: o(d, "files.common.actions.delete", "Delete"),
316
335
  variant: "danger",
317
336
  onConfirm: async () => {
318
337
  try {
319
- await un.mutateAsync({ id: e.id }), Ke("success"), S.success(o(f, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Y("files.file.deleted", {
338
+ await xn.mutateAsync({ id: e.id }), Je("success"), S.success(o(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), J("files.file.deleted", {
320
339
  fileId: e.id,
321
340
  fileName: e.name,
322
341
  permanent: !1
323
342
  });
324
343
  } catch (t) {
325
- S.error(t instanceof Error ? t.message : o(f, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Ke("error"), Y("files.api.failed", {
344
+ S.error(t instanceof Error ? t.message : o(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Je("error"), J("files.api.failed", {
326
345
  action: "deleteFile",
327
346
  fileId: e.id,
328
347
  message: t instanceof Error ? t.message : "Failed to delete file"
@@ -330,751 +349,790 @@ function f() {
330
349
  }
331
350
  }
332
351
  });
333
- }, zn = async (e) => {
352
+ }, rr = async (e) => {
334
353
  try {
335
- await fn.mutateAsync({ id: e.id }), S.success(o(f, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), Y("files.file.restored", {
354
+ await Cn.mutateAsync({ id: e.id }), S.success(o(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), J("files.file.restored", {
336
355
  fileId: e.id,
337
356
  fileName: e.name
338
357
  });
339
358
  } catch (e) {
340
- S.error(e instanceof Error ? e.message : o(f, "files.file.errors.restoreFailed", "Failed to restore file"));
359
+ S.error(e instanceof Error ? e.message : o(d, "files.file.errors.restoreFailed", "Failed to restore file"));
341
360
  }
342
- }, Bn = async (e) => {
343
- Ge("heavy"), J({
344
- title: o(f, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
345
- description: o(f, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
346
- confirmLabel: o(f, "files.common.actions.deletePermanently", "Delete permanently"),
361
+ }, ir = async (e) => {
362
+ qe("heavy"), q({
363
+ title: o(d, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
364
+ description: o(d, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
365
+ confirmLabel: o(d, "files.common.actions.deletePermanently", "Delete permanently"),
347
366
  variant: "danger",
348
367
  onConfirm: async () => {
349
368
  try {
350
- await mn.mutateAsync({ id: e.id }), S.success(o(f, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Y("files.file.deleted", {
369
+ await Tn.mutateAsync({ id: e.id }), S.success(o(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), J("files.file.deleted", {
351
370
  fileId: e.id,
352
371
  fileName: e.name,
353
372
  permanent: !0
354
373
  });
355
374
  } catch (e) {
356
- S.error(e instanceof Error ? e.message : o(f, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
375
+ S.error(e instanceof Error ? e.message : o(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
357
376
  }
358
377
  }
359
378
  });
360
- }, Vn = async (e) => {
379
+ }, ar = async (e) => {
361
380
  try {
362
- await gn.mutateAsync({
381
+ await Dn.mutateAsync({
363
382
  id: e.id,
364
383
  type: "file"
365
- }), Y("files.file.starred", {
384
+ }), J("files.file.starred", {
366
385
  fileId: e.id,
367
386
  fileName: e.name,
368
387
  starred: !e.starred
369
388
  });
370
389
  } catch {
371
- S.error(o(f, "files.file.errors.starFailed", "Failed to update starred state")), Y("files.api.failed", {
390
+ S.error(o(d, "files.file.errors.starFailed", "Failed to update starred state")), J("files.api.failed", {
372
391
  action: "toggleFileStar",
373
392
  fileId: e.id
374
393
  });
375
394
  }
376
- }, Hn = (e) => {
377
- B({
395
+ }, or = (e) => {
396
+ z({
378
397
  id: e.id,
379
398
  name: e.name,
380
399
  type: "file"
381
- }), H(e.name), P(!0);
382
- }, Un = async (e) => {
400
+ }), V(e.name), N(!0);
401
+ }, sr = async (e) => {
383
402
  try {
384
403
  let t = e.downloadUrl || e.url;
385
- if (!t) throw Error(o(f, "files.file.errors.downloadUrlUnavailable", "Download URL is unavailable"));
404
+ if (!t) throw Error(o(d, "files.file.errors.downloadUrlUnavailable", "Download URL is unavailable"));
386
405
  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(o(f, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), Y("files.file.downloaded", {
406
+ 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(o(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), J("files.file.downloaded", {
388
407
  fileId: e.id,
389
408
  fileName: e.name
390
409
  });
391
410
  } catch (e) {
392
- S.error(e instanceof Error ? e.message : o(f, "files.file.errors.downloadFailed", "Failed to download file"));
411
+ S.error(e instanceof Error ? e.message : o(d, "files.file.errors.downloadFailed", "Failed to download file"));
393
412
  }
394
- }, Wn = (e) => {
395
- tn({
413
+ }, cr = (e) => {
414
+ dn({
396
415
  item: e,
397
416
  type: "file"
398
- }), Xt(!0);
399
- }, Gn = (e) => {
400
- L({
417
+ }), on(!0);
418
+ }, lr = (e) => {
419
+ I({
401
420
  item: e,
402
421
  type: "file"
403
- }), F(!0);
404
- }, Kn = (e) => {
405
- It({
422
+ }), P(!0);
423
+ }, ur = (e) => {
424
+ Wt({
406
425
  item: e,
407
426
  type: "file"
408
427
  });
409
- }, qn = (e) => {
410
- m(`/files/browse/${e.id}`);
411
- }, Jn = async (e) => {
412
- Ge("medium"), J({
413
- title: o(f, "files.confirm.deleteFolder.title", "Delete folder"),
414
- description: o(f, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
415
- confirmLabel: o(f, "files.common.actions.delete", "Delete"),
428
+ }, dr = (e) => {
429
+ p(`/files/browse/${e.id}`);
430
+ }, fr = async (e) => {
431
+ qe("medium"), q({
432
+ title: o(d, "files.confirm.deleteFolder.title", "Delete folder"),
433
+ description: o(d, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
434
+ confirmLabel: o(d, "files.common.actions.delete", "Delete"),
416
435
  variant: "danger",
417
436
  onConfirm: async () => {
418
437
  try {
419
- await dn.mutateAsync({
438
+ await Sn.mutateAsync({
420
439
  id: e.id,
421
440
  recursive: !0
422
- }), S.success(o(f, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Y("files.folder.deleted", {
441
+ }), S.success(o(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), J("files.folder.deleted", {
423
442
  folderId: e.id,
424
443
  folderName: e.name,
425
444
  permanent: !1
426
445
  });
427
446
  } catch (e) {
428
- S.error(e instanceof Error ? e.message : o(f, "files.folder.errors.deleteFailed", "Failed to delete folder"));
447
+ S.error(e instanceof Error ? e.message : o(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
429
448
  }
430
449
  }
431
450
  });
432
- }, Yn = async (e) => {
451
+ }, pr = async (e) => {
433
452
  try {
434
- await pn.mutateAsync({ id: e.id }), S.success(o(f, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), Y("files.folder.restored", {
453
+ await wn.mutateAsync({ id: e.id }), S.success(o(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), J("files.folder.restored", {
435
454
  folderId: e.id,
436
455
  folderName: e.name
437
456
  });
438
457
  } catch (e) {
439
- S.error(e instanceof Error ? e.message : o(f, "files.folder.errors.restoreFailed", "Failed to restore folder"));
458
+ S.error(e instanceof Error ? e.message : o(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
440
459
  }
441
- }, Xn = async (e) => {
442
- J({
443
- title: o(f, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
444
- description: o(f, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
445
- confirmLabel: o(f, "files.common.actions.deletePermanently", "Delete permanently"),
460
+ }, mr = async (e) => {
461
+ q({
462
+ title: o(d, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
463
+ description: o(d, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
464
+ confirmLabel: o(d, "files.common.actions.deletePermanently", "Delete permanently"),
446
465
  variant: "danger",
447
466
  onConfirm: async () => {
448
467
  try {
449
- await hn.mutateAsync({ id: e.id }), S.success(o(f, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Y("files.folder.deleted", {
468
+ await En.mutateAsync({ id: e.id }), S.success(o(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), J("files.folder.deleted", {
450
469
  folderId: e.id,
451
470
  folderName: e.name,
452
471
  permanent: !0
453
472
  });
454
473
  } catch (e) {
455
- S.error(e instanceof Error ? e.message : o(f, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
474
+ S.error(e instanceof Error ? e.message : o(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
456
475
  }
457
476
  }
458
477
  });
459
- }, Zn = (e) => {
460
- B({
478
+ }, hr = (e) => {
479
+ z({
461
480
  id: e.id,
462
481
  name: e.name,
463
482
  type: "folder"
464
- }), H(e.name), P(!0);
465
- }, Qn = (e) => {
466
- L({
483
+ }), V(e.name), N(!0);
484
+ }, gr = (e) => {
485
+ I({
467
486
  item: e,
468
487
  type: "folder"
469
- }), F(!0);
470
- }, $n = async (e) => {
488
+ }), P(!0);
489
+ }, _r = async (e) => {
471
490
  try {
472
- await gn.mutateAsync({
491
+ await Dn.mutateAsync({
473
492
  id: e.id,
474
493
  type: "folder"
475
- }), Y("files.folder.starred", {
494
+ }), J("files.folder.starred", {
476
495
  folderId: e.id,
477
496
  folderName: e.name,
478
497
  starred: !e.starred
479
498
  });
480
499
  } catch {
481
- S.error(o(f, "files.folder.errors.starFailed", "Failed to update starred state")), Y("files.api.failed", {
500
+ S.error(o(d, "files.folder.errors.starFailed", "Failed to update starred state")), J("files.api.failed", {
482
501
  action: "toggleFolderStar",
483
502
  folderId: e.id
484
503
  });
485
504
  }
486
- }, er = (e) => {
487
- It({
505
+ }, vr = (e) => {
506
+ Wt({
488
507
  item: e,
489
508
  type: "folder"
490
509
  });
491
- }, tr = async (e) => {
492
- if (I) try {
493
- I.type === "file" ? (await xn.mutateAsync({
494
- fileId: I.item.id,
510
+ }, yr = async (e) => {
511
+ if (F) try {
512
+ F.type === "file" ? (await Mn.mutateAsync({
513
+ fileId: F.item.id,
495
514
  targetFolderId: e || null
496
- }), S.success(o(f, "files.file.move.success", "\"{{name}}\" moved", { name: I.item.name })), Y("files.file.moved", {
497
- fileId: I.item.id,
498
- fileName: I.item.name,
515
+ }), S.success(o(d, "files.file.move.success", "\"{{name}}\" moved", { name: F.item.name })), J("files.file.moved", {
516
+ fileId: F.item.id,
517
+ fileName: F.item.name,
499
518
  destinationFolderId: e
500
- })) : (await Sn.mutateAsync({
501
- folderId: I.item.id,
519
+ })) : (await Nn.mutateAsync({
520
+ folderId: F.item.id,
502
521
  targetParentFolderId: e
503
- }), S.success(o(f, "files.folder.move.success", "\"{{name}}\" moved", { name: I.item.name })), Y("files.folder.moved", {
504
- folderId: I.item.id,
505
- folderName: I.item.name,
522
+ }), S.success(o(d, "files.folder.move.success", "\"{{name}}\" moved", { name: F.item.name })), J("files.folder.moved", {
523
+ folderId: F.item.id,
524
+ folderName: F.item.name,
506
525
  destinationFolderId: e
507
- })), F(!1), L(null);
526
+ })), P(!1), I(null);
508
527
  } catch (e) {
509
- S.error(e instanceof Error ? e.message : o(f, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: I.item.name })), Y("files.api.failed", {
510
- action: I.type === "file" ? "moveFile" : "moveFolder",
511
- itemId: I.item.id,
512
- itemType: I.type,
528
+ S.error(e instanceof Error ? e.message : o(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: F.item.name })), J("files.api.failed", {
529
+ action: F.type === "file" ? "moveFile" : "moveFolder",
530
+ itemId: F.item.id,
531
+ itemType: F.type,
513
532
  message: e instanceof Error ? e.message : void 0
514
533
  });
515
534
  }
516
- }, nr = async (e, t) => {
517
- if (R) try {
518
- if (R.type !== "file") throw Error(o(f, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
519
- await bn.mutateAsync({
520
- id: R.item.id,
521
- newName: t || `Copy of ${R.item.name}`,
535
+ }, br = async (e, t) => {
536
+ if (L) try {
537
+ if (L.type !== "file") throw Error(o(d, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
538
+ await jn.mutateAsync({
539
+ id: L.item.id,
540
+ newName: t || `${o(d, "files.copyDialog.copyOf", "Copy of")} ${L.item.name}`,
522
541
  targetFolderId: e || void 0
523
- }), S.success(o(f, "files.file.copy.success", "\"{{name}}\" copied", { name: R.item.name })), Y("files.file.copied", {
524
- fileId: R.item.id,
525
- fileName: R.item.name,
542
+ }), S.success(o(d, "files.file.copy.success", "\"{{name}}\" copied", { name: L.item.name })), J("files.file.copied", {
543
+ fileId: L.item.id,
544
+ fileName: L.item.name,
526
545
  destinationFolderId: e
527
- }), Xt(!1), tn(null);
546
+ }), on(!1), dn(null);
528
547
  } catch (e) {
529
- S.error(e instanceof Error ? e.message : o(f, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: R.item.name })), Y("files.api.failed", {
548
+ S.error(e instanceof Error ? e.message : o(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: L.item.name })), J("files.api.failed", {
530
549
  action: "copyFile",
531
- fileId: R.item.id,
550
+ fileId: L.item.id,
532
551
  message: e instanceof Error ? e.message : void 0
533
552
  });
534
553
  }
535
- }, rr = async () => {
536
- if (z && V.trim()) try {
537
- let e = z.name, t = V.trim();
538
- z.type === "file" ? (await Z.mutateAsync({
539
- fileId: z.id,
554
+ }, xr = async () => {
555
+ if (R && B.trim()) try {
556
+ let e = R.name, t = B.trim();
557
+ R.type === "file" ? (await X.mutateAsync({
558
+ fileId: R.id,
540
559
  newName: t
541
- }), S.success(o(f, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), Y("files.file.renamed", {
542
- fileId: z.id,
560
+ }), S.success(o(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), J("files.file.renamed", {
561
+ fileId: R.id,
543
562
  previousName: e,
544
563
  name: t
545
- })) : (await Q.mutateAsync({
546
- folderId: z.id,
564
+ })) : (await Z.mutateAsync({
565
+ folderId: R.id,
547
566
  newName: t
548
- }), S.success(o(f, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), Y("files.folder.renamed", {
549
- folderId: z.id,
567
+ }), S.success(o(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), J("files.folder.renamed", {
568
+ folderId: R.id,
550
569
  previousName: e,
551
570
  name: t
552
- })), P(!1), B(null), H("");
571
+ })), N(!1), z(null), V("");
553
572
  } catch (e) {
554
- S.error(e instanceof Error ? e.message : o(f, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: z.type })), Y("files.api.failed", {
555
- action: z.type === "file" ? "renameFile" : "renameFolder",
556
- itemId: z.id,
557
- itemType: z.type,
573
+ S.error(e instanceof Error ? e.message : o(d, R.type === "folder" ? "files.folder.errors.renameFailed" : "files.file.errors.renameFailed", R.type === "folder" ? "Failed to rename folder" : "Failed to rename file")), J("files.api.failed", {
574
+ action: R.type === "file" ? "renameFile" : "renameFolder",
575
+ itemId: R.id,
576
+ itemType: R.type,
558
577
  message: e instanceof Error ? e.message : void 0
559
578
  });
560
579
  }
580
+ }, Sr = (e, t) => {
581
+ Rt();
582
+ let n = a.getState();
583
+ for (let t of e.failed) t.type === "file" ? n.selectFile(t.id) : n.selectFolder(t.id);
584
+ let r = e.succeeded.length + e.failed.length;
585
+ e.failed.length === 0 ? S.success(o(d, t.successKey, t.successFallback, {
586
+ count: r,
587
+ plural: r > 1 ? "s" : ""
588
+ })) : S.error(o(d, t.partialKey, t.partialFallback, {
589
+ done: e.succeeded.length,
590
+ total: r,
591
+ names: et(e.failed, 3, (e) => o(d, "files.bulk.moreNames", "+{{count}} more", { count: e }))
592
+ }));
593
+ }, Cr = async () => {
594
+ let e = await $e(Qe(Lt, g, E, D), (e) => e.type === "file" ? Cn.mutateAsync({ id: e.id }) : wn.mutateAsync({ id: e.id }));
595
+ Sr(e, {
596
+ successKey: "files.bulk.restore.success",
597
+ successFallback: "{{count}} item{{plural}} restored",
598
+ partialKey: "files.bulk.restore.partial",
599
+ partialFallback: "Restored {{done}} of {{total}} items. Couldn't restore {{names}}."
600
+ });
601
+ }, wr = async () => {
602
+ let e = await $e(Qe(Lt, g, E, D), (e) => e.type === "file" ? Tn.mutateAsync({ id: e.id }) : En.mutateAsync({ id: e.id }));
603
+ Sr(e, {
604
+ successKey: "files.bulk.permanentDelete.success",
605
+ successFallback: "{{count}} item{{plural}} deleted permanently",
606
+ partialKey: "files.bulk.permanentDelete.partial",
607
+ partialFallback: "Deleted {{done}} of {{total}} items permanently. Couldn't delete {{names}}."
608
+ });
561
609
  };
562
610
  return r({
563
- files: D,
564
- folders: O,
565
- onFilePreview: Nn,
566
- onFileDelete: Rn,
567
- onFolderOpen: qn,
568
- onFolderDelete: Jn,
569
- activeTab: v
570
- }), h === void 0 ? /* @__PURE__ */ u("div", {
611
+ files: E,
612
+ folders: D,
613
+ onFilePreview: Zn,
614
+ onFileDelete: nr,
615
+ onFolderOpen: dr,
616
+ onFolderDelete: fr,
617
+ activeTab: _
618
+ }), m === void 0 ? /* @__PURE__ */ l("div", {
571
619
  className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
572
- children: [/* @__PURE__ */ l(c, { className: "size-8 animate-spin text-text-tertiary" }), /* @__PURE__ */ l("p", {
620
+ children: [/* @__PURE__ */ c(ut, { className: "size-8 animate-spin text-text-tertiary" }), /* @__PURE__ */ c("p", {
573
621
  className: "text-sm text-text-secondary max-w-md",
574
- children: o(f, "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.")
622
+ children: o(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
623
  })]
576
- }) : h === "" ? /* @__PURE__ */ u("div", {
624
+ }) : m === "" ? /* @__PURE__ */ l("div", {
577
625
  className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
578
- children: [/* @__PURE__ */ l($e, { className: "size-8 text-text-tertiary" }), /* @__PURE__ */ l("p", {
626
+ children: [/* @__PURE__ */ c(ot, { className: "size-8 text-text-tertiary" }), /* @__PURE__ */ c("p", {
579
627
  className: "text-sm text-text-secondary max-w-md",
580
- children: o(f, "files.browser.workspace.notSelected", "No workspace selected. Please select a workspace to view files.")
628
+ children: o(d, "files.browser.workspace.notSelected", "No workspace selected. Please select a workspace to view files.")
581
629
  })]
582
- }) : /* @__PURE__ */ u("div", {
630
+ }) : /* @__PURE__ */ l("div", {
583
631
  className: "min-h-screen bg-bg-surface",
584
632
  children: [
585
- /* @__PURE__ */ u("div", {
633
+ /* @__PURE__ */ l("div", {
586
634
  className: "relative overflow-hidden bg-bg-surface border-b border-border-seam px-4 py-3 sm:px-6 sm:py-4",
587
635
  "data-tour": "files-breadcrumb-nav",
588
636
  children: [
589
- /* @__PURE__ */ l(dt, { intensity: "subtle" }),
590
- /* @__PURE__ */ l("h1", {
637
+ /* @__PURE__ */ c(yt, { intensity: "subtle" }),
638
+ /* @__PURE__ */ c("h1", {
591
639
  className: "mb-2 text-lg font-semibold tracking-tight sm:text-xl",
592
- children: /* @__PURE__ */ l(mt, { children: o(f, "files.browser.rootLabel", "My Drive") })
640
+ children: /* @__PURE__ */ c(St, { children: o(d, "files.browser.rootLabel", "My Drive") })
593
641
  }),
594
- /* @__PURE__ */ l("div", {
642
+ /* @__PURE__ */ c("div", {
595
643
  className: "flex items-center gap-2 sm:gap-4",
596
- children: /* @__PURE__ */ u("div", {
644
+ children: /* @__PURE__ */ l("div", {
597
645
  className: "flex items-center gap-1 sm:gap-2 text-sm overflow-x-auto",
598
- children: [/* @__PURE__ */ u("button", {
646
+ children: [/* @__PURE__ */ l("button", {
599
647
  type: "button",
600
- onClick: () => m("/files/browse"),
648
+ onClick: () => p("/files/browse"),
601
649
  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
- title: o(f, "files.browser.actions.goToRoot", "Go to root"),
603
- children: [/* @__PURE__ */ l(tt, { className: "size-4" }), /* @__PURE__ */ l("span", {
650
+ title: o(d, "files.browser.actions.goToRoot", "Go to root"),
651
+ children: [/* @__PURE__ */ c(ct, { className: "size-4" }), /* @__PURE__ */ c("span", {
604
652
  className: "hidden sm:inline",
605
- children: o(f, "files.browser.rootLabel", "My Drive")
653
+ children: o(d, "files.browser.rootLabel", "My Drive")
606
654
  })]
607
- }), Ot.map((e, t) => /* @__PURE__ */ u("div", {
655
+ }), It.map((e, t) => /* @__PURE__ */ l("div", {
608
656
  className: "flex items-center gap-1 sm:gap-2",
609
- children: [/* @__PURE__ */ l("span", {
657
+ children: [/* @__PURE__ */ c("span", {
610
658
  className: "text-text-tertiary",
611
659
  children: "/"
612
- }), /* @__PURE__ */ l("button", {
660
+ }), /* @__PURE__ */ c("button", {
613
661
  type: "button",
614
- onClick: () => m(`/files/browse/${e.id}`),
615
- 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"}`,
616
- title: `Go to ${e.name}`,
662
+ onClick: () => p(`/files/browse/${e.id}`),
663
+ className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === It.length - 1 ? "text-text-primary font-medium" : "text-text-secondary"}`,
664
+ title: o(d, "files.browser.breadcrumb.goTo", "Go to {{name}}", { name: e.name }),
617
665
  children: e.name
618
666
  })]
619
667
  }, e.id))]
620
668
  })
621
669
  }),
622
- /* @__PURE__ */ l(vt, {
670
+ /* @__PURE__ */ c(Et, {
623
671
  className: "relative mt-2 max-w-3xl",
624
- children: o(f, "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.")
672
+ children: o(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.")
625
673
  })
626
674
  ]
627
675
  }),
628
- !b && /* @__PURE__ */ l("div", {
676
+ !b && /* @__PURE__ */ c("div", {
629
677
  className: "px-4 pt-3 sm:px-6",
630
- children: /* @__PURE__ */ l(_t, {
678
+ children: /* @__PURE__ */ c(Tt, {
631
679
  storageKey: "files-browser",
632
- title: o(f, "files.browser.nextSteps.title", "Get started with Files"),
680
+ title: o(d, "files.browser.nextSteps.title", "Get started with Files"),
633
681
  steps: [
634
682
  {
635
683
  id: "upload",
636
- label: o(f, "files.browser.nextSteps.upload.label", "Upload your first files"),
637
- description: o(f, "files.browser.nextSteps.upload.description", "Add documents, images or videos to this drive."),
638
- icon: /* @__PURE__ */ l(at, { className: "size-4" }),
639
- onClick: wn
684
+ label: o(d, "files.browser.nextSteps.upload.label", "Upload your first files"),
685
+ description: o(d, "files.browser.nextSteps.upload.description", "Add documents, images or videos to this drive."),
686
+ icon: /* @__PURE__ */ c(pt, { className: "size-4" }),
687
+ onClick: In
640
688
  },
641
689
  {
642
690
  id: "new-folder",
643
- label: o(f, "files.browser.nextSteps.newFolder.label", "Create a folder to organise"),
644
- description: o(f, "files.browser.nextSteps.newFolder.description", "Group related files so they are easy to find later."),
645
- icon: /* @__PURE__ */ l(Ze, { className: "size-4" }),
646
- onClick: jn
691
+ label: o(d, "files.browser.nextSteps.newFolder.label", "Create a folder to organise"),
692
+ description: o(d, "files.browser.nextSteps.newFolder.description", "Group related files so they are easy to find later."),
693
+ icon: /* @__PURE__ */ c(it, { className: "size-4" }),
694
+ onClick: Jn
647
695
  },
648
696
  {
649
697
  id: "starred",
650
- label: o(f, "files.browser.nextSteps.starred.label", "Star items you use often"),
651
- description: o(f, "files.browser.nextSteps.starred.description", "Starred files and folders show up under the Starred tab."),
652
- icon: /* @__PURE__ */ l(rt, { className: "size-4" }),
653
- onClick: () => At("starred")
698
+ label: o(d, "files.browser.nextSteps.starred.label", "Star items you use often"),
699
+ description: o(d, "files.browser.nextSteps.starred.description", "Starred files and folders show up under the Starred tab."),
700
+ icon: /* @__PURE__ */ c(dt, { className: "size-4" }),
701
+ onClick: () => v("starred")
654
702
  },
655
703
  {
656
704
  id: "bin",
657
- label: o(f, "files.browser.nextSteps.bin.label", "Recover deleted items from the Bin"),
658
- description: o(f, "files.browser.nextSteps.bin.description", "Deleted files stay in the Bin so you can restore them."),
659
- icon: /* @__PURE__ */ l(it, { className: "size-4" }),
660
- onClick: () => At("bin")
705
+ label: o(d, "files.browser.nextSteps.bin.label", "Recover deleted items from the Bin"),
706
+ description: o(d, "files.browser.nextSteps.bin.description", "Deleted files stay in the Bin so you can restore them."),
707
+ icon: /* @__PURE__ */ c(ft, { className: "size-4" }),
708
+ onClick: () => v("bin")
661
709
  }
662
710
  ]
663
711
  })
664
712
  }),
665
- /* @__PURE__ */ l("div", {
713
+ /* @__PURE__ */ c("div", {
666
714
  "data-tour": "files-tab-bar",
667
- children: /* @__PURE__ */ l(Ae, {
668
- activeTab: v,
669
- onTabChange: At,
670
- tabs: jt
715
+ children: /* @__PURE__ */ c(Me, {
716
+ activeTab: _,
717
+ onTabChange: v,
718
+ tabs: zt
671
719
  })
672
720
  }),
673
- /* @__PURE__ */ u("div", {
721
+ /* @__PURE__ */ l("div", {
674
722
  className: "bg-bg-surface border-b border-border-seam px-4 py-2 sm:px-6 sm:py-3",
675
723
  children: [
676
- /* @__PURE__ */ u("div", {
724
+ /* @__PURE__ */ l("div", {
677
725
  className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 sm:gap-inline-gap",
678
- children: [/* @__PURE__ */ l("div", {
726
+ children: [/* @__PURE__ */ c("div", {
679
727
  className: "w-full sm:flex-1 min-w-0 order-2 sm:order-1",
680
728
  "data-tour": "files-search-bar",
681
- children: /* @__PURE__ */ l("div", {
729
+ children: /* @__PURE__ */ c("div", {
682
730
  className: "relative w-full max-w-2xl",
683
- children: /* @__PURE__ */ l(Le, {
731
+ children: /* @__PURE__ */ c(ze, {
684
732
  onSearch: (e, t) => {
685
- Mt(e), Pt(t);
733
+ Bt(e), Ht(t);
686
734
  },
687
- placeholder: o(f, "files.search.input.placeholder", "Search files and folders..."),
735
+ placeholder: o(d, "files.search.input.placeholder", "Search files and folders..."),
688
736
  initialQuery: y,
689
737
  showFilters: !0
690
738
  })
691
739
  })
692
- }), /* @__PURE__ */ u("div", {
740
+ }), /* @__PURE__ */ l("div", {
693
741
  className: "flex items-center gap-2 order-1 sm:order-2 w-full sm:w-auto justify-between sm:justify-end",
694
- children: [!b && /* @__PURE__ */ u("div", {
695
- className: "flex items-center gap-2",
742
+ children: [!b && /* @__PURE__ */ l("div", {
743
+ className: "flex flex-wrap items-center gap-2",
696
744
  "data-tour": "files-upload-files-button",
697
- children: [/* @__PURE__ */ u(d, {
698
- type: "button",
699
- variant: "default",
700
- onClick: wn,
701
- disabled: G,
702
- children: [G ? /* @__PURE__ */ l(c, { className: "size-4 animate-spin" }) : /* @__PURE__ */ l(at, { className: "size-4" }), G ? o(f, "files.browser.upload.uploading", "Uploading...") : o(f, "files.browser.actions.uploadFiles", "Upload Files")]
703
- }), /* @__PURE__ */ l("div", {
704
- "data-tour": "files-more-actions-trigger",
705
- children: /* @__PURE__ */ l(ft, { actions: [
706
- {
707
- label: o(f, "files.browser.actions.newFolder", "New Folder"),
708
- icon: /* @__PURE__ */ l(Ze, { className: "size-4" }),
709
- onSelect: jn,
710
- dataTour: "files-new-folder-button"
711
- },
712
- {
713
- label: o(f, "files.browser.actions.uploadFolder", "Upload Folder"),
714
- icon: /* @__PURE__ */ l(Qe, { className: "size-4" }),
715
- onSelect: An,
716
- disabled: G
717
- },
718
- ...D.length > 0 || O.length > 0 ? [{
719
- label: o(f, "files.browser.actions.selectAll", "Select All"),
720
- onSelect: () => {
721
- let e = D.map((e) => e.id), t = O.map((e) => e.id);
722
- a.getState().selectAllFiles(e), t.forEach((e) => a.getState().selectFolder(e));
723
- }
724
- }] : []
725
- ] })
726
- })]
727
- }), /* @__PURE__ */ u("div", {
745
+ children: [
746
+ /* @__PURE__ */ c(se, {
747
+ value: fn,
748
+ onChange: pn,
749
+ disabled: W
750
+ }),
751
+ /* @__PURE__ */ l(u, {
752
+ type: "button",
753
+ variant: "default",
754
+ onClick: In,
755
+ disabled: W,
756
+ children: [W ? /* @__PURE__ */ c(ut, { className: "size-4 animate-spin" }) : /* @__PURE__ */ c(pt, { className: "size-4" }), W ? o(d, "files.browser.upload.uploading", "Uploading...") : o(d, "files.browser.actions.uploadFiles", "Upload Files")]
757
+ }),
758
+ /* @__PURE__ */ c("div", {
759
+ "data-tour": "files-more-actions-trigger",
760
+ children: h ? /* @__PURE__ */ c(tt, {
761
+ onNewFolder: Jn,
762
+ onUploadFolder: qn,
763
+ onSelectAll: E.length > 0 || D.length > 0 ? Yn : void 0,
764
+ uploading: W
765
+ }) : /* @__PURE__ */ c(bt, { actions: [
766
+ {
767
+ label: o(d, "files.browser.actions.newFolder", "New Folder"),
768
+ icon: /* @__PURE__ */ c(it, { className: "size-4" }),
769
+ onSelect: Jn,
770
+ dataTour: "files-new-folder-button"
771
+ },
772
+ {
773
+ label: o(d, "files.browser.actions.uploadFolder", "Upload Folder"),
774
+ icon: /* @__PURE__ */ c(at, { className: "size-4" }),
775
+ onSelect: qn,
776
+ disabled: W
777
+ },
778
+ ...E.length > 0 || D.length > 0 ? [{
779
+ label: o(d, "files.browser.actions.selectAll", "Select All"),
780
+ onSelect: Yn
781
+ }] : []
782
+ ] })
783
+ })
784
+ ]
785
+ }), /* @__PURE__ */ l("div", {
728
786
  className: "flex items-center border border-border-seam rounded-lg overflow-hidden",
729
787
  "data-tour": "files-view-mode-toggle",
730
- children: [/* @__PURE__ */ l("button", {
788
+ children: [/* @__PURE__ */ c("button", {
731
789
  type: "button",
732
- onClick: () => Dt("grid"),
733
- className: `p-2 transition-colors duration-200 ${Et === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
734
- "aria-label": o(f, "files.browser.view.grid", "Grid view"),
735
- children: /* @__PURE__ */ l(et, { className: "size-5" })
736
- }), /* @__PURE__ */ l("button", {
790
+ onClick: () => Ft("grid"),
791
+ className: `p-2 transition-colors duration-200 ${Pt === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
792
+ "aria-label": o(d, "files.browser.view.grid", "Grid view"),
793
+ children: /* @__PURE__ */ c(st, { className: "size-5" })
794
+ }), /* @__PURE__ */ c("button", {
737
795
  type: "button",
738
- onClick: () => Dt("list"),
739
- className: `p-2 transition-colors duration-200 ${Et === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
740
- "aria-label": o(f, "files.browser.view.list", "List view"),
741
- children: /* @__PURE__ */ l(nt, { className: "size-5" })
796
+ onClick: () => Ft("list"),
797
+ className: `p-2 transition-colors duration-200 ${Pt === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
798
+ "aria-label": o(d, "files.browser.view.list", "List view"),
799
+ children: /* @__PURE__ */ c(lt, { className: "size-5" })
742
800
  })]
743
801
  })]
744
802
  })]
745
803
  }),
746
- b && /* @__PURE__ */ u("div", {
804
+ b && /* @__PURE__ */ l("div", {
747
805
  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",
748
- children: [/* @__PURE__ */ u("span", {
806
+ children: [/* @__PURE__ */ l("span", {
749
807
  className: "text-sm font-medium text-status-success-text",
750
- children: [o(f, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: y }), E.data && ` (${(E.data.files?.length || 0) + (E.data.folders?.length || 0)} items)`]
751
- }), /* @__PURE__ */ u("button", {
808
+ children: [o(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: y }), T.data && ` (${(T.data.files?.length || 0) + (T.data.folders?.length || 0)} items)`]
809
+ }), /* @__PURE__ */ l("button", {
752
810
  type: "button",
753
- onClick: () => Mt(""),
811
+ onClick: () => Bt(""),
754
812
  className: "flex items-center gap-2 text-status-success-text hover:text-status-success-text/80 text-sm font-medium transition-colors duration-200",
755
- children: [/* @__PURE__ */ l(ot, { className: "size-4" }), o(f, "files.browser.search.clear", "Clear search")]
813
+ children: [/* @__PURE__ */ c(mt, { className: "size-4" }), o(d, "files.browser.search.clear", "Clear search")]
756
814
  })]
757
815
  }),
758
- M > 0 && /* @__PURE__ */ u(pt, {
816
+ j > 0 && /* @__PURE__ */ l(xt, {
759
817
  className: "mt-3 flex items-center justify-between p-3",
760
- children: [/* @__PURE__ */ u("div", {
818
+ children: [/* @__PURE__ */ l("div", {
761
819
  className: "flex items-center gap-4",
762
- children: [/* @__PURE__ */ l("span", {
820
+ children: [/* @__PURE__ */ c("span", {
763
821
  className: "text-sm font-medium text-text-primary",
764
- children: o(f, "files.browser.selection.selectedCount", "{{count}} item{{suffix}} selected", {
765
- count: M,
766
- suffix: M > 1 ? "s" : ""
822
+ children: o(d, "files.browser.selection.selectedCount", "{{count}} item{{suffix}} selected", {
823
+ count: j,
824
+ suffix: j > 1 ? "s" : ""
767
825
  })
768
- }), /* @__PURE__ */ l("div", {
826
+ }), /* @__PURE__ */ c("div", {
769
827
  className: "flex items-center gap-2",
770
- children: v === "bin" ? /* @__PURE__ */ u(st, { children: [/* @__PURE__ */ l("button", {
828
+ children: _ === "bin" ? /* @__PURE__ */ l(ht, { children: [/* @__PURE__ */ c("button", {
771
829
  type: "button",
772
- onClick: async () => {
773
- try {
774
- await Promise.all([...Array.from(kt).map((e) => fn.mutateAsync({ id: e })), ...Array.from(g).map((e) => pn.mutateAsync({ id: e }))]), _(), S.success(`${M} item${M > 1 ? "s" : ""} restored`);
775
- } catch (e) {
776
- S.error(e instanceof Error ? e.message : "Failed to restore some items");
777
- }
778
- },
830
+ onClick: Cr,
779
831
  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",
780
- children: o(f, "files.browser.selection.actions.restore", "Restore")
781
- }), /* @__PURE__ */ u("button", {
832
+ children: o(d, "files.browser.selection.actions.restore", "Restore")
833
+ }), /* @__PURE__ */ l("button", {
782
834
  type: "button",
783
835
  onClick: async () => {
784
- J({
785
- title: o(f, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
786
- description: o(f, "files.confirm.bulkPermanentDelete.description", "Permanently delete {{count}} selected item{{plural}}? This cannot be undone.", {
787
- count: M,
788
- plural: M > 1 ? "s" : ""
836
+ q({
837
+ title: o(d, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
838
+ description: o(d, "files.confirm.bulkPermanentDelete.description", "Permanently delete {{count}} selected item{{plural}}? This cannot be undone.", {
839
+ count: j,
840
+ plural: j > 1 ? "s" : ""
789
841
  }),
790
- confirmLabel: o(f, "files.common.actions.deletePermanently", "Delete permanently"),
842
+ confirmLabel: o(d, "files.common.actions.deletePermanently", "Delete permanently"),
791
843
  variant: "danger",
792
- onConfirm: async () => {
793
- try {
794
- await Promise.all([...Array.from(kt).map((e) => mn.mutateAsync({ id: e })), ...Array.from(g).map((e) => hn.mutateAsync({ id: e }))]), _(), S.success(o(f, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
795
- count: M,
796
- plural: M > 1 ? "s" : ""
797
- }));
798
- } catch (e) {
799
- S.error(e instanceof Error ? e.message : o(f, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
800
- }
801
- }
844
+ onConfirm: wr
802
845
  });
803
846
  },
804
847
  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",
805
- children: [/* @__PURE__ */ l(it, { className: "size-4" }), o(f, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
806
- })] }) : /* @__PURE__ */ u("button", {
848
+ children: [/* @__PURE__ */ c(ft, { className: "size-4" }), o(d, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
849
+ })] }) : /* @__PURE__ */ l("button", {
807
850
  type: "button",
808
851
  onClick: async () => {
809
- J({
810
- title: o(f, "files.confirm.bulkDelete.title", "Delete selected items"),
811
- description: o(f, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
812
- count: M,
813
- plural: M > 1 ? "s" : ""
852
+ q({
853
+ title: o(d, "files.confirm.bulkDelete.title", "Delete selected items"),
854
+ description: o(d, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
855
+ count: j,
856
+ plural: j > 1 ? "s" : ""
814
857
  }),
815
- confirmLabel: o(f, "files.common.actions.delete", "Delete"),
858
+ confirmLabel: o(d, "files.common.actions.delete", "Delete"),
816
859
  variant: "danger",
817
860
  onConfirm: async () => {
818
861
  try {
819
- let e = Array.from(kt), t = Array.from(g);
820
- e.length > 0 && await Cn.mutateAsync(e), await Promise.all(t.map((e) => dn.mutateAsync({
862
+ let e = Array.from(Lt), t = Array.from(g);
863
+ e.length > 0 && await Pn.mutateAsync(e), await Promise.all(t.map((e) => Sn.mutateAsync({
821
864
  id: e,
822
865
  recursive: !0
823
- }))), _(), S.success(o(f, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
824
- count: M,
825
- plural: M > 1 ? "s" : ""
866
+ }))), Rt(), S.success(o(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
867
+ count: j,
868
+ plural: j > 1 ? "s" : ""
826
869
  }));
827
870
  } catch (e) {
828
- S.error(e instanceof Error ? e.message : o(f, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
871
+ S.error(e instanceof Error ? e.message : o(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
829
872
  }
830
873
  }
831
874
  });
832
875
  },
833
876
  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",
834
- children: [/* @__PURE__ */ l(it, { className: "size-4" }), o(f, "files.browser.selection.actions.delete", "Delete")]
877
+ children: [/* @__PURE__ */ c(ft, { className: "size-4" }), o(d, "files.browser.selection.actions.delete", "Delete")]
835
878
  })
836
879
  })]
837
- }), /* @__PURE__ */ u("button", {
880
+ }), /* @__PURE__ */ l("button", {
838
881
  type: "button",
839
- onClick: _,
882
+ onClick: Rt,
840
883
  className: "flex items-center gap-2 text-text-link hover:text-action-primary-bg-hover text-sm font-medium transition-colors duration-200",
841
- children: [/* @__PURE__ */ l(ot, { className: "size-4" }), o(f, "files.common.actions.clear", "Clear")]
884
+ children: [/* @__PURE__ */ c(mt, { className: "size-4" }), o(d, "files.common.actions.clear", "Clear")]
842
885
  })]
843
886
  })
844
887
  ]
845
888
  }),
846
- (Tt.isExhausted || Tt.isNearLimit) && /* @__PURE__ */ l("div", {
889
+ (Nt.isExhausted || Nt.isNearLimit) && /* @__PURE__ */ c("div", {
847
890
  className: "px-4 sm:px-6 pt-3",
848
- children: /* @__PURE__ */ l(He, { quota: Tt })
891
+ children: /* @__PURE__ */ c(We, { quota: Nt })
849
892
  }),
850
- /* @__PURE__ */ u("div", {
851
- className: "px-2 sm:px-4 md:px-6 py-3 sm:py-4",
893
+ /* @__PURE__ */ l("div", {
894
+ className: `relative px-2 sm:px-4 md:px-6 py-3 sm:py-4 ${Ln ? "rounded-lg outline-2 outline-dashed outline-action-primary-border bg-bg-accent" : ""}`,
852
895
  "data-tour": "files-browser-grid",
853
- children: [/* @__PURE__ */ l(ke, {
854
- files: D,
855
- folders: O,
856
- loading: k,
857
- error: A,
858
- preserveSortOrder: j,
859
- onFilePreview: Nn,
860
- onFileShare: v === "bin" ? void 0 : Fn,
861
- onFileDelete: v === "bin" ? Bn : Rn,
862
- onFileRestore: v === "bin" ? zn : void 0,
863
- onFileFavorite: v === "bin" ? void 0 : Vn,
864
- onFileRename: v === "bin" ? void 0 : Hn,
865
- onFileDownload: Un,
866
- onFileCopy: v === "bin" ? void 0 : Wn,
867
- onFileMove: v === "bin" ? void 0 : Gn,
868
- onFileInfo: Kn,
869
- onFolderOpen: qn,
870
- onFolderShare: v === "bin" ? void 0 : In,
871
- onFolderDelete: v === "bin" ? Xn : Jn,
872
- onFolderRestore: v === "bin" ? Yn : void 0,
873
- onFolderRename: v === "bin" ? void 0 : Zn,
874
- onFolderFavorite: v === "bin" ? void 0 : $n,
875
- onFolderMove: v === "bin" ? void 0 : Qn,
876
- onFolderInfo: er
877
- }), !k && (D.length > 0 || O.length > 0) && /* @__PURE__ */ u("div", {
878
- className: "mt-4 px-2 text-sm text-text-secondary",
879
- children: [o(f, "files.browser.results.showingItems", "Showing {{count}} items", { count: D.length + O.length }), !b && v === "all" && zt !== null && ` ${o(f, "files.browser.results.ofItems", "of {{count}} items", { count: zt })}`]
880
- })]
896
+ onDragOver: $ ? zn : void 0,
897
+ onDragLeave: $ ? Bn : void 0,
898
+ onDrop: $ ? Vn : void 0,
899
+ children: [
900
+ Ln && /* @__PURE__ */ c("p", {
901
+ role: "status",
902
+ className: "pointer-events-none mb-3 text-center text-sm font-medium text-text-link",
903
+ children: o(d, "files.browser.dropToUpload", "Drop files to upload them here")
904
+ }),
905
+ /* @__PURE__ */ c(je, {
906
+ files: E,
907
+ folders: D,
908
+ loading: O,
909
+ error: k,
910
+ preserveSortOrder: A,
911
+ onFilePreview: Zn,
912
+ onFileShare: _ === "bin" ? void 0 : $n,
913
+ onFileDelete: _ === "bin" ? ir : nr,
914
+ onFileRestore: _ === "bin" ? rr : void 0,
915
+ onFileFavorite: _ === "bin" ? void 0 : ar,
916
+ onFileRename: _ === "bin" ? void 0 : or,
917
+ onFileDownload: sr,
918
+ onFileCopy: _ === "bin" ? void 0 : cr,
919
+ onFileMove: _ === "bin" ? void 0 : lr,
920
+ onFileInfo: ur,
921
+ onFolderOpen: dr,
922
+ onFolderShare: _ === "bin" ? void 0 : er,
923
+ onFolderDelete: _ === "bin" ? mr : fr,
924
+ onFolderRestore: _ === "bin" ? pr : void 0,
925
+ onFolderRename: _ === "bin" ? void 0 : hr,
926
+ onFolderFavorite: _ === "bin" ? void 0 : _r,
927
+ onFolderMove: _ === "bin" ? void 0 : gr,
928
+ onFolderInfo: vr
929
+ }),
930
+ !O && (E.length > 0 || D.length > 0) && /* @__PURE__ */ l("div", {
931
+ className: "mt-4 px-2 text-sm text-text-secondary",
932
+ children: [o(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: E.length + D.length }), !b && _ === "all" && Jt !== null && ` ${o(d, "files.browser.results.ofItems", "of {{count}} items", { count: Jt })}`]
933
+ })
934
+ ]
881
935
  }),
882
- Bt && /* @__PURE__ */ l(yt, {
936
+ Yt && /* @__PURE__ */ c(Dt, {
883
937
  open: !0,
884
938
  onOpenChange: (e) => {
885
- !e && !X.isPending && (N(!1), W(""));
939
+ !e && !Y.isPending && (M(!1), U(""));
886
940
  },
887
- children: /* @__PURE__ */ u(bt, {
941
+ children: /* @__PURE__ */ l(Ot, {
888
942
  className: "w-full max-w-xs",
889
943
  children: [
890
- /* @__PURE__ */ l(St, {
944
+ /* @__PURE__ */ c(At, {
891
945
  className: "text-left",
892
- children: /* @__PURE__ */ l(Ct, {
946
+ children: /* @__PURE__ */ c(jt, {
893
947
  id: "files-new-folder-title",
894
948
  className: "text-base font-semibold text-text-primary",
895
- children: o(f, "files.browser.newFolderDialog.title", "New folder")
949
+ children: o(d, "files.browser.newFolderDialog.title", "New folder")
896
950
  })
897
951
  }),
898
- /* @__PURE__ */ l(gt, {
952
+ /* @__PURE__ */ c(wt, {
899
953
  type: "text",
900
- value: U,
901
- onChange: (e) => W(e.target.value),
954
+ value: H,
955
+ onChange: (e) => U(e.target.value),
902
956
  onKeyDown: (e) => {
903
- e.key === "Enter" && Mn();
957
+ e.key === "Enter" && Xn();
904
958
  },
905
- "aria-label": o(f, "files.browser.newFolderDialog.title", "New folder"),
906
- placeholder: o(f, "files.browser.newFolderDialog.placeholder", "Folder name")
959
+ "aria-label": o(d, "files.browser.newFolderDialog.title", "New folder"),
960
+ placeholder: o(d, "files.browser.newFolderDialog.placeholder", "Folder name")
907
961
  }),
908
- /* @__PURE__ */ u(xt, { children: [/* @__PURE__ */ l(d, {
962
+ /* @__PURE__ */ l(kt, { children: [/* @__PURE__ */ c(u, {
909
963
  type: "button",
910
964
  variant: "outline",
911
965
  onClick: () => {
912
- N(!1), W("");
966
+ M(!1), U("");
913
967
  },
914
- children: o(f, "files.common.actions.cancel", "Cancel")
915
- }), /* @__PURE__ */ u(d, {
968
+ children: o(d, "files.common.actions.cancel", "Cancel")
969
+ }), /* @__PURE__ */ l(u, {
916
970
  type: "button",
917
- onClick: Mn,
918
- disabled: !U.trim() || X.isPending,
919
- children: [X.isPending && /* @__PURE__ */ l(c, { className: "size-4 animate-spin" }), X.isPending ? o(f, "files.browser.newFolderDialog.actions.creating", "Creating...") : o(f, "files.common.actions.create", "Create")]
971
+ onClick: Xn,
972
+ disabled: !H.trim() || Y.isPending,
973
+ children: [Y.isPending && /* @__PURE__ */ c(ut, { className: "size-4 animate-spin" }), Y.isPending ? o(d, "files.browser.newFolderDialog.actions.creating", "Creating...") : o(d, "files.common.actions.create", "Create")]
920
974
  })] })
921
975
  ]
922
976
  })
923
977
  }),
924
- Gt && z && /* @__PURE__ */ l(yt, {
978
+ en && R && /* @__PURE__ */ c(Dt, {
925
979
  open: !0,
926
980
  onOpenChange: (e) => {
927
- e || Z.isPending || Q.isPending || (P(!1), B(null), H(""));
981
+ e || X.isPending || Z.isPending || (N(!1), z(null), V(""));
928
982
  },
929
- children: /* @__PURE__ */ u(bt, {
983
+ children: /* @__PURE__ */ l(Ot, {
930
984
  className: "w-full max-w-xs",
931
985
  children: [
932
- /* @__PURE__ */ l(St, {
986
+ /* @__PURE__ */ c(At, {
933
987
  className: "text-left",
934
- children: /* @__PURE__ */ l(Ct, {
988
+ children: /* @__PURE__ */ c(jt, {
935
989
  id: "files-rename-title",
936
990
  className: "text-base font-semibold text-text-primary",
937
- children: o(f, "files.browser.renameDialog.title", "Rename {{type}}", { type: z.type })
991
+ children: h ? R.type === "folder" ? o(d, "files.browser.renameDialog.titleFolder", "Rename folder") : o(d, "files.browser.renameDialog.titleFile", "Rename file") : o(d, "files.browser.renameDialog.title", "Rename {{type}}", { type: R.type })
938
992
  })
939
993
  }),
940
- /* @__PURE__ */ l(gt, {
994
+ /* @__PURE__ */ c(wt, {
941
995
  type: "text",
942
- value: V,
943
- onChange: (e) => H(e.target.value),
996
+ value: B,
997
+ onChange: (e) => V(e.target.value),
944
998
  onKeyDown: (e) => {
945
- e.key === "Enter" && rr();
999
+ e.key === "Enter" && xr();
946
1000
  },
947
- "aria-label": o(f, "files.browser.renameDialog.title", "Rename"),
948
- placeholder: o(f, "files.browser.renameDialog.placeholder", "New name")
1001
+ "aria-label": o(d, "files.browser.renameDialog.title", "Rename"),
1002
+ placeholder: o(d, "files.browser.renameDialog.placeholder", "New name")
949
1003
  }),
950
- /* @__PURE__ */ u(xt, { children: [/* @__PURE__ */ l(d, {
1004
+ /* @__PURE__ */ l(kt, { children: [/* @__PURE__ */ c(u, {
951
1005
  type: "button",
952
1006
  variant: "outline",
953
1007
  onClick: () => {
954
- P(!1), B(null), H("");
1008
+ N(!1), z(null), V("");
955
1009
  },
956
- children: o(f, "files.common.actions.cancel", "Cancel")
957
- }), /* @__PURE__ */ u(d, {
1010
+ children: o(d, "files.common.actions.cancel", "Cancel")
1011
+ }), /* @__PURE__ */ l(u, {
958
1012
  type: "button",
959
- onClick: rr,
960
- disabled: !V.trim() || V.trim() === z.name || Z.isPending || Q.isPending,
961
- children: [(Z.isPending || Q.isPending) && /* @__PURE__ */ l(c, { className: "size-4 animate-spin" }), Z.isPending || Q.isPending ? o(f, "files.browser.renameDialog.actions.renaming", "Renaming...") : o(f, "files.common.actions.rename", "Rename")]
1013
+ onClick: xr,
1014
+ disabled: !B.trim() || B.trim() === R.name || X.isPending || Z.isPending,
1015
+ children: [(X.isPending || Z.isPending) && /* @__PURE__ */ c(ut, { className: "size-4 animate-spin" }), X.isPending || Z.isPending ? o(d, "files.browser.renameDialog.actions.renaming", "Renaming...") : o(d, "files.common.actions.rename", "Rename")]
962
1016
  })] })
963
1017
  ]
964
1018
  })
965
1019
  }),
966
- Kt && Zt && /* @__PURE__ */ l(Me, {
967
- item: Zt,
968
- itemType: "mimeType" in Zt ? "file" : "folder",
1020
+ tn && sn && /* @__PURE__ */ c(Pe, {
1021
+ item: sn,
1022
+ itemType: "mimeType" in sn ? "file" : "folder",
969
1023
  onClose: () => {
970
- qt(!1), Qt(null);
1024
+ nn(!1), cn(null);
971
1025
  },
972
- onCreateShare: Ln,
973
- knownPermission: $t,
974
- isLoading: _n.isPending || vn.isPending
1026
+ onCreateShare: tr,
1027
+ knownPermission: ln,
1028
+ showReach: h,
1029
+ isLoading: On.isPending || kn.isPending
975
1030
  }),
976
- q && /* @__PURE__ */ l(Be, {
977
- title: q.title,
978
- description: q.description,
979
- confirmLabel: q.confirmLabel,
980
- cancelLabel: o(f, "files.common.actions.cancel", "Cancel"),
981
- variant: q.variant,
982
- loading: q.loading,
983
- onConfirm: cn,
1031
+ K && /* @__PURE__ */ c(He, {
1032
+ title: K.title,
1033
+ description: K.description,
1034
+ confirmLabel: K.confirmLabel,
1035
+ cancelLabel: o(d, "files.common.actions.cancel", "Cancel"),
1036
+ variant: K.variant,
1037
+ loading: K.loading,
1038
+ onConfirm: yn,
984
1039
  onCancel: () => {
985
- q.loading || J(null);
1040
+ K.loading || q(null);
986
1041
  }
987
1042
  }),
988
- Vt && /* @__PURE__ */ l(Be, {
989
- title: o(f, "files.folder.quota.title", "Folder Limit Reached"),
990
- description: o(f, "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."),
991
- confirmLabel: o(f, "files.folder.quota.upgrade", "View Billing"),
992
- cancelLabel: o(f, "files.common.actions.dismiss", "Dismiss"),
1043
+ Xt && /* @__PURE__ */ c(He, {
1044
+ title: o(d, "files.folder.quota.title", "Folder Limit Reached"),
1045
+ description: o(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."),
1046
+ confirmLabel: o(d, "files.folder.quota.upgrade", "View Billing"),
1047
+ cancelLabel: o(d, "files.common.actions.dismiss", "Dismiss"),
993
1048
  onConfirm: () => {
994
- Ht(!1), m("/billing");
1049
+ Zt(!1), p("/billing");
995
1050
  },
996
- onCancel: () => Ht(!1)
1051
+ onCancel: () => Zt(!1)
997
1052
  }),
998
- Ut && /* @__PURE__ */ l(Be, {
999
- title: o(f, "files.storage.quota.title", "Storage Limit Reached"),
1000
- description: o(f, "files.storage.quota.description", "You've reached the storage limit for your plan. Upgrade your plan or delete files to continue uploading."),
1001
- confirmLabel: o(f, "files.storage.quota.upgrade", "View Billing"),
1002
- cancelLabel: o(f, "files.common.actions.dismiss", "Dismiss"),
1053
+ Qt && /* @__PURE__ */ c(He, {
1054
+ title: o(d, "files.storage.quota.title", "Storage Limit Reached"),
1055
+ description: o(d, "files.storage.quota.description", "You've reached the storage limit for your plan. Upgrade your plan or delete files to continue uploading."),
1056
+ confirmLabel: o(d, "files.storage.quota.upgrade", "View Billing"),
1057
+ cancelLabel: o(d, "files.common.actions.dismiss", "Dismiss"),
1003
1058
  onConfirm: () => {
1004
- Wt(!1), m("/billing");
1059
+ $t(!1), p("/billing");
1005
1060
  },
1006
- onCancel: () => Wt(!1)
1061
+ onCancel: () => $t(!1)
1007
1062
  }),
1008
- Jt && I && /* @__PURE__ */ l(Re, {
1009
- item: I.item,
1010
- type: I.type,
1063
+ rn && F && /* @__PURE__ */ c(Be, {
1064
+ item: F.item,
1065
+ type: F.type,
1011
1066
  onClose: () => {
1012
- F(!1), L(null);
1067
+ P(!1), I(null);
1013
1068
  },
1014
- onMove: tr,
1015
- isLoading: xn.isPending || Sn.isPending
1069
+ onMove: yr,
1070
+ isLoading: Mn.isPending || Nn.isPending
1016
1071
  }),
1017
- Yt && R && /* @__PURE__ */ l(ze, {
1018
- item: R.item,
1019
- type: R.type,
1072
+ an && L && /* @__PURE__ */ c(Ve, {
1073
+ item: L.item,
1074
+ type: L.type,
1020
1075
  onClose: () => {
1021
- Xt(!1), tn(null);
1076
+ on(!1), dn(null);
1022
1077
  },
1023
- onCopy: nr,
1024
- isLoading: bn.isPending
1078
+ onCopy: br,
1079
+ isLoading: jn.isPending,
1080
+ initialFolderId: h ? f ?? null : null,
1081
+ initialBreadcrumbs: h ? It : []
1025
1082
  }),
1026
- x && /* @__PURE__ */ l(Ne, {
1083
+ x && /* @__PURE__ */ c(Fe, {
1027
1084
  file: x,
1028
- onClose: () => Lt(null),
1085
+ onClose: () => Gt(null),
1029
1086
  onDownload: () => {
1030
1087
  let e = x.downloadUrl || x.url;
1031
- e && qe(e);
1088
+ e && Ye(e);
1032
1089
  },
1033
- onShare: v === "bin" || !$ || !be($.share) ? void 0 : () => Pn(x, yn === "denied" ? "denied" : void 0),
1034
- shareDeniedReason: v === "bin" ? void 0 : Se(yn, Ce(f)),
1035
- onStar: v === "bin" || !$?.canUpdate ? void 0 : () => Vn(x),
1036
- onDelete: v === "bin" ? () => Bn(x) : $?.canDelete ? () => Rn(x) : void 0
1090
+ onShare: _ === "bin" || !Q || !Se(Q.share) ? void 0 : () => Qn(x, An === "denied" ? "denied" : void 0),
1091
+ shareDeniedReason: _ === "bin" ? void 0 : we(An, Te(d)),
1092
+ onStar: _ === "bin" || !Q?.canUpdate ? void 0 : () => ar(x),
1093
+ onDelete: _ === "bin" ? () => ir(x) : Q?.canDelete ? () => nr(x) : void 0
1037
1094
  }),
1038
- Ft && /* @__PURE__ */ l(Pe, {
1039
- item: Ft.item,
1040
- type: Ft.type,
1041
- onClose: () => It(null)
1095
+ Ut && /* @__PURE__ */ c(Ie, {
1096
+ item: Ut.item,
1097
+ type: Ut.type,
1098
+ onClose: () => Wt(null)
1042
1099
  }),
1043
- /* @__PURE__ */ l(Ve, {
1044
- items: nn,
1045
- isOpen: rn,
1046
- onClose: () => on(!1),
1047
- onPause: En,
1048
- onResume: Dn,
1049
- onRetry: On,
1050
- onCancel: kn
1100
+ /* @__PURE__ */ c(Ue, {
1101
+ items: mn,
1102
+ isOpen: hn,
1103
+ onClose: () => _n(!1),
1104
+ onPause: Un,
1105
+ onResume: Wn,
1106
+ onRetry: Gn,
1107
+ onCancel: Kn,
1108
+ navigationV2: h
1051
1109
  }),
1052
- /* @__PURE__ */ l(Ie, {
1110
+ /* @__PURE__ */ c(Re, {
1053
1111
  toasts: S.toasts,
1054
1112
  onClose: S.removeToast
1055
1113
  }),
1056
- !k && D.length === 0 && O.length === 0 && /* @__PURE__ */ l("div", {
1114
+ !O && E.length === 0 && D.length === 0 && /* @__PURE__ */ c("div", {
1057
1115
  className: "px-6 py-12",
1058
- children: b ? /* @__PURE__ */ l(ht, {
1116
+ children: b ? /* @__PURE__ */ c(Ct, {
1059
1117
  illustration: "empty-search",
1060
- title: o(f, "files.browser.empty.search.title", "No results found"),
1061
- description: o(f, "files.browser.empty.search.description", "Try adjusting your search query or filters"),
1062
- action: /* @__PURE__ */ l(d, {
1118
+ title: o(d, "files.browser.empty.search.title", "No results found"),
1119
+ description: o(d, "files.browser.empty.search.description", "Try adjusting your search query or filters"),
1120
+ action: /* @__PURE__ */ c(u, {
1063
1121
  type: "button",
1064
1122
  onClick: () => {
1065
- Mt(""), Pt(void 0);
1123
+ Bt(""), Ht(void 0);
1066
1124
  },
1067
- children: o(f, "files.browser.search.clear", "Clear search")
1125
+ children: o(d, "files.browser.search.clear", "Clear search")
1068
1126
  })
1069
- }) : /* @__PURE__ */ l(Fe, {
1070
- type: v,
1071
- onUpload: v === "all" ? wn : void 0,
1072
- onNewFolder: v === "all" ? jn : void 0
1127
+ }) : /* @__PURE__ */ c(Le, {
1128
+ type: _,
1129
+ onUpload: _ === "all" ? In : void 0,
1130
+ onNewFolder: _ === "all" ? Jn : void 0
1073
1131
  })
1074
1132
  })
1075
1133
  ]
1076
1134
  });
1077
1135
  }
1078
- export { f as BrowserPage };
1136
+ export { d as BrowserPage };
1079
1137
 
1080
1138
  //# sourceMappingURL=BrowserPage.js.map