@burdenoff/microfe-files 2026.1111.2 → 2026.1111.3

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