@burdenoff/microfe-files 2026.1124.1 → 2026.1126.1

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