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