@burdenoff/microfe-files 2026.1110.2 → 2026.1111.2

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