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