@cubone/react-file-manager 1.13.2 → 1.15.0

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.
@@ -1,40 +1,40 @@
1
1
  import { jsx as e, jsxs as g, Fragment as se } from "react/jsx-runtime";
2
- import at from "react-loading";
3
- import { useState as b, useRef as re, useEffect as K, createContext as ve, useContext as ge, useMemo as lt } from "react";
4
- import { BsGridFill as ct, BsScissors as dt, BsCopy as ut, BsFolderPlus as ft, BsGrid as Be } from "react-icons/bs";
2
+ import lt from "react-loading";
3
+ import Lt, { useState as b, useRef as re, useEffect as V, createContext as ve, useContext as ge, useMemo as $e } from "react";
4
+ import { BsGridFill as ct, BsScissors as dt, BsCopy as ut, BsFolderPlus as ft, BsGrid as Ue } from "react-icons/bs";
5
5
  import { FiRefreshCw as ht } from "react-icons/fi";
6
- import { MdOutlineFileDownload as $e, MdOutlineDelete as pt, MdClear as Lt, MdOutlineFileUpload as mt, MdKeyboardArrowRight as It, MdHome as At, MdOutlineNavigateNext as $t, MdMoreHoriz as jt, MdClose as zt } from "react-icons/md";
7
- import { BiRename as vt, BiSelectMultiple as Wt } from "react-icons/bi";
8
- import { FaCheck as gt, FaListUl as we, FaRegPaste as Ie, FaRegFilePdf as Bt, FaRegFileImage as Ee, FaRegFileLines as Ut, FaRegFileWord as Ue, FaRegFileVideo as qe, FaRegFileAudio as He, FaRegFileZipper as qt, FaRegFilePowerpoint as _e, FaRegFileExcel as Ke, FaLaptopFile as Ht, FaRegFileCode as J, FaRegFolderOpen as Ye, FaRegFile as be, FaChevronRight as _t } from "react-icons/fa6";
9
- import Kt from "react-collapsible";
10
- import { FaRegFolderOpen as Ve, FaRegFolder as Xe, FaRegCheckCircle as Yt, FaRegFileAlt as Vt } from "react-icons/fa";
11
- import { IoWarningOutline as Xt } from "react-icons/io5";
12
- import { PiFolderOpen as Gt } from "react-icons/pi";
13
- import { AiOutlineClose as Jt, AiOutlineCloudUpload as Zt } from "react-icons/ai";
14
- import { IoMdRefresh as Qt } from "react-icons/io";
6
+ import { MdOutlineFileDownload as je, MdOutlineDelete as pt, MdClear as It, MdOutlineFileUpload as mt, MdKeyboardArrowRight as At, MdHome as $t, MdOutlineNavigateNext as jt, MdMoreHoriz as zt, MdClose as Wt } from "react-icons/md";
7
+ import { BiRename as vt, BiSelectMultiple as Bt } from "react-icons/bi";
8
+ import { FaCheck as gt, FaListUl as we, FaRegPaste as Ie, FaRegFilePdf as Ut, FaRegFileImage as Ee, FaRegFileLines as qt, FaRegFileWord as qe, FaRegFileVideo as He, FaRegFileAudio as _e, FaRegFileZipper as Ht, FaRegFilePowerpoint as Ke, FaRegFileExcel as Ye, FaLaptopFile as _t, FaRegFileCode as J, FaRegFolderOpen as Ve, FaRegFile as be, FaChevronRight as Kt } from "react-icons/fa6";
9
+ import Yt from "react-collapsible";
10
+ import { FaRegFolderOpen as Xe, FaRegFolder as Ge, FaRegCheckCircle as Vt, FaRegFileAlt as Xt } from "react-icons/fa";
11
+ import { IoWarningOutline as Gt } from "react-icons/io5";
12
+ import { PiFolderOpen as Jt } from "react-icons/pi";
13
+ import { AiOutlineClose as Zt, AiOutlineCloudUpload as Qt } from "react-icons/ai";
14
+ import { IoMdRefresh as en } from "react-icons/io";
15
15
  import yt from "react-is";
16
16
  const Ct = ({ isLoading: t }) => {
17
17
  if (t)
18
- return /* @__PURE__ */ e("div", { className: "fm-loader", children: /* @__PURE__ */ e(at, { color: "black", type: "spokes", height: 50, width: 50 }) });
18
+ return /* @__PURE__ */ e("div", { className: "fm-loader", children: /* @__PURE__ */ e(lt, { color: "black", type: "spokes", height: 50, width: 50 }) });
19
19
  }, ye = (t = () => {
20
20
  }) => {
21
- const [n, s] = b(!1), r = re(null), o = (i) => {
22
- var a;
23
- (a = r.current) != null && a.contains(i.target) ? s(!1) : (s(!0), t(i, r));
21
+ const [n, s] = b(!1), r = re(null), o = (a) => {
22
+ var i;
23
+ (i = r.current) != null && i.contains(a.target) ? s(!1) : (s(!0), t(a, r));
24
24
  };
25
- return K(() => (document.addEventListener("click", o, !0), document.addEventListener("mousedown", o, !0), () => {
25
+ return V(() => (document.addEventListener("click", o, !0), document.addEventListener("mousedown", o, !0), () => {
26
26
  document.removeEventListener("click", o, !0), document.removeEventListener("mousedown", o, !0);
27
27
  }), []), { ref: r, isClicked: n, setIsClicked: s };
28
- }, wt = ve(), en = ({ children: t, layout: n }) => {
28
+ }, wt = ve(), tn = ({ children: t, layout: n }) => {
29
29
  const [s, r] = b(() => o(n));
30
- function o(i) {
31
- return ["list", "grid"].includes(i) ? i : "grid";
30
+ function o(a) {
31
+ return ["list", "grid"].includes(a) ? a : "grid";
32
32
  }
33
33
  return /* @__PURE__ */ e(wt.Provider, { value: { activeLayout: s, setActiveLayout: r }, children: t });
34
- }, ce = () => ge(wt), tn = ({ setShowToggleViewMenu: t, onLayoutChange: n }) => {
34
+ }, ce = () => ge(wt), nn = ({ setShowToggleViewMenu: t, onLayoutChange: n }) => {
35
35
  const s = ye(() => {
36
36
  t(!1);
37
- }), { activeLayout: r, setActiveLayout: o } = ce(), i = [
37
+ }), { activeLayout: r, setActiveLayout: o } = ce(), a = [
38
38
  {
39
39
  key: "grid",
40
40
  name: "Grid",
@@ -45,15 +45,15 @@ const Ct = ({ isLoading: t }) => {
45
45
  name: "List",
46
46
  icon: /* @__PURE__ */ e(we, { size: 18 })
47
47
  }
48
- ], a = (l) => {
48
+ ], i = (l) => {
49
49
  o(l), n(l), t(!1);
50
50
  };
51
- return /* @__PURE__ */ e("div", { ref: s.ref, className: "toggle-view", role: "dropdown", children: /* @__PURE__ */ e("ul", { role: "menu", "aria-orientation": "vertical", children: i.map((l) => /* @__PURE__ */ g(
51
+ return /* @__PURE__ */ e("div", { ref: s.ref, className: "toggle-view", role: "dropdown", children: /* @__PURE__ */ e("ul", { role: "menu", "aria-orientation": "vertical", children: a.map((l) => /* @__PURE__ */ g(
52
52
  "li",
53
53
  {
54
54
  role: "menuitem",
55
- onClick: () => a(l.key),
56
- onKeyDown: () => a(l.key),
55
+ onClick: () => i(l.key),
56
+ onKeyDown: () => i(l.key),
57
57
  children: [
58
58
  /* @__PURE__ */ e("span", { children: l.key === r && /* @__PURE__ */ e(gt, { size: 13 }) }),
59
59
  /* @__PURE__ */ e("span", { children: l.icon }),
@@ -62,29 +62,29 @@ const Ct = ({ isLoading: t }) => {
62
62
  },
63
63
  l.key
64
64
  )) }) });
65
- }, bt = ve(), nn = ({ children: t, filesData: n, onError: s }) => {
65
+ }, bt = ve(), rn = ({ children: t, filesData: n, onError: s }) => {
66
66
  const [r, o] = b([]);
67
- K(() => {
67
+ V(() => {
68
68
  o(n);
69
69
  }, [n]);
70
- const i = (a) => a.isDirectory ? r.filter((l) => l.path === `${a.path}/${l.name}`) : [];
71
- return /* @__PURE__ */ e(bt.Provider, { value: { files: r, setFiles: o, getChildren: i, onError: s }, children: t });
72
- }, ke = () => ge(bt), Ft = ve(), rn = ({ children: t, initialPath: n }) => {
73
- const { files: s } = ke(), r = re(!1), [o, i] = b(""), [a, l] = b(null), [c, f] = b([]);
74
- return K(() => {
75
- Array.isArray(s) && s.length > 0 && (f(() => s.filter((h) => h.path === `${o}/${h.name}`)), l(() => s.find((h) => h.path === o) ?? null));
76
- }, [s, o]), K(() => {
77
- !r.current && Array.isArray(s) && s.length > 0 && (i(s.some((h) => h.path === n) ? n : ""), r.current = !0);
70
+ const a = (i) => i.isDirectory ? r.filter((l) => l.path === `${i.path}/${l.name}`) : [];
71
+ return /* @__PURE__ */ e(bt.Provider, { value: { files: r, setFiles: o, getChildren: a, onError: s }, children: t });
72
+ }, ke = () => ge(bt), Ft = ve(), sn = ({ children: t, initialPath: n }) => {
73
+ const { files: s } = ke(), r = re(!1), [o, a] = b(""), [i, l] = b(null), [c, u] = b([]);
74
+ return V(() => {
75
+ Array.isArray(s) && s.length > 0 && (u(() => s.filter((h) => h.path === `${o}/${h.name}`)), l(() => s.find((h) => h.path === o) ?? null));
76
+ }, [s, o]), V(() => {
77
+ !r.current && Array.isArray(s) && s.length > 0 && (a(s.some((h) => h.path === n) ? n : ""), r.current = !0);
78
78
  }, [n, s]), /* @__PURE__ */ e(
79
79
  Ft.Provider,
80
80
  {
81
81
  value: {
82
82
  currentPath: o,
83
- setCurrentPath: i,
84
- currentFolder: a,
83
+ setCurrentPath: a,
84
+ currentFolder: i,
85
85
  setCurrentFolder: l,
86
86
  currentPathFiles: c,
87
- setCurrentPathFiles: f
87
+ setCurrentPathFiles: u
88
88
  },
89
89
  children: t
90
90
  }
@@ -100,24 +100,24 @@ const Ct = ({ isLoading: t }) => {
100
100
  } catch (r) {
101
101
  console.error(r.message);
102
102
  }
103
- }, kt = ve(), sn = ({ children: t, onDownload: n }) => {
103
+ }, kt = ve(), on = ({ children: t, onDownload: n }) => {
104
104
  const [s, r] = b([]), o = () => {
105
105
  fe(n, "onDownload", s);
106
106
  };
107
107
  return /* @__PURE__ */ e(kt.Provider, { value: { selectedFiles: s, setSelectedFiles: r, handleDownload: o }, children: t });
108
- }, le = () => ge(kt), Nt = ve(), on = ({ children: t, onPaste: n }) => {
109
- const [s, r] = b(null), { selectedFiles: o, setSelectedFiles: i } = le(), a = (c) => {
108
+ }, le = () => ge(kt), Nt = ve(), an = ({ children: t, onPaste: n }) => {
109
+ const [s, r] = b(null), { selectedFiles: o, setSelectedFiles: a } = le(), i = (c) => {
110
110
  r({
111
111
  files: o,
112
112
  isMoving: c
113
113
  });
114
114
  }, l = (c) => {
115
115
  if (c && !c.isDirectory) return;
116
- const f = s.files, h = s.isMoving ? "move" : "copy";
117
- fe(n, "onPaste", f, c, h), s.isMoving && r(null), i([]);
116
+ const u = s.files, h = s.isMoving ? "move" : "copy";
117
+ fe(n, "onPaste", u, c, h), s.isMoving && r(null), a([]);
118
118
  };
119
- return /* @__PURE__ */ e(Nt.Provider, { value: { clipBoard: s, setClipBoard: r, handleCutCopy: a, handlePasting: l }, children: t });
120
- }, Ne = () => ge(Nt), an = ({
119
+ return /* @__PURE__ */ e(Nt.Provider, { value: { clipBoard: s, setClipBoard: r, handleCutCopy: i, handlePasting: l }, children: t });
120
+ }, Ne = () => ge(Nt), ln = ({
121
121
  allowCreateFolder: t = !0,
122
122
  allowUploadFile: n = !0,
123
123
  onLayoutChange: s,
@@ -125,7 +125,7 @@ const Ct = ({ isLoading: t }) => {
125
125
  triggerAction: o
126
126
  }) => {
127
127
  var N;
128
- const [i, a] = b(!1), { currentFolder: l } = oe(), { selectedFiles: c, setSelectedFiles: f, handleDownload: h } = le(), { clipBoard: u, setClipBoard: w, handleCutCopy: x, handlePasting: S } = Ne(), { activeLayout: D } = ce(), M = [
128
+ const [a, i] = b(!1), { currentFolder: l } = oe(), { selectedFiles: c, setSelectedFiles: u, handleDownload: h } = le(), { clipBoard: f, setClipBoard: w, handleCutCopy: T, handlePasting: R } = Ne(), { activeLayout: O } = ce(), M = [
129
129
  {
130
130
  icon: /* @__PURE__ */ e(ft, { size: 17, strokeWidth: 0.3 }),
131
131
  text: "New folder",
@@ -141,14 +141,14 @@ const Ct = ({ isLoading: t }) => {
141
141
  {
142
142
  icon: /* @__PURE__ */ e(Ie, { size: 18 }),
143
143
  text: "Paste",
144
- permission: !!u,
145
- onClick: P
144
+ permission: !!f,
145
+ onClick: E
146
146
  }
147
147
  ], C = [
148
148
  {
149
- icon: D === "grid" ? /* @__PURE__ */ e(ct, { size: 16 }) : /* @__PURE__ */ e(we, { size: 16 }),
149
+ icon: O === "grid" ? /* @__PURE__ */ e(ct, { size: 16 }) : /* @__PURE__ */ e(we, { size: 16 }),
150
150
  title: "Change View",
151
- onClick: () => a((m) => !m)
151
+ onClick: () => i((m) => !m)
152
152
  },
153
153
  {
154
154
  icon: /* @__PURE__ */ e(ht, { size: 16 }),
@@ -158,27 +158,27 @@ const Ct = ({ isLoading: t }) => {
158
158
  }
159
159
  }
160
160
  ];
161
- function P() {
162
- S(l);
161
+ function E() {
162
+ R(l);
163
163
  }
164
164
  const F = () => {
165
- h(), f([]);
165
+ h(), u([]);
166
166
  };
167
167
  return c.length > 0 ? /* @__PURE__ */ e("div", { className: "toolbar file-selected", children: /* @__PURE__ */ g("div", { className: "file-action-container", children: [
168
168
  /* @__PURE__ */ g("div", { children: [
169
- /* @__PURE__ */ g("button", { className: "item-action file-action", onClick: () => x(!0), children: [
169
+ /* @__PURE__ */ g("button", { className: "item-action file-action", onClick: () => T(!0), children: [
170
170
  /* @__PURE__ */ e(dt, { size: 18 }),
171
171
  /* @__PURE__ */ e("span", { children: "Cut" })
172
172
  ] }),
173
- /* @__PURE__ */ g("button", { className: "item-action file-action", onClick: () => x(!1), children: [
173
+ /* @__PURE__ */ g("button", { className: "item-action file-action", onClick: () => T(!1), children: [
174
174
  /* @__PURE__ */ e(ut, { strokeWidth: 0.1, size: 17 }),
175
175
  /* @__PURE__ */ e("span", { children: "Copy" })
176
176
  ] }),
177
- ((N = u == null ? void 0 : u.files) == null ? void 0 : N.length) > 0 && /* @__PURE__ */ g(
177
+ ((N = f == null ? void 0 : f.files) == null ? void 0 : N.length) > 0 && /* @__PURE__ */ g(
178
178
  "button",
179
179
  {
180
180
  className: "item-action file-action",
181
- onClick: P,
181
+ onClick: E,
182
182
  children: [
183
183
  /* @__PURE__ */ e(Ie, { size: 18 }),
184
184
  /* @__PURE__ */ e("span", { children: "Paste" })
@@ -197,7 +197,7 @@ const Ct = ({ isLoading: t }) => {
197
197
  }
198
198
  ),
199
199
  !c.isDirectory && /* @__PURE__ */ g("button", { className: "item-action file-action", onClick: F, children: [
200
- /* @__PURE__ */ e($e, { size: 19 }),
200
+ /* @__PURE__ */ e(je, { size: 19 }),
201
201
  /* @__PURE__ */ e("span", { children: "Download" })
202
202
  ] }),
203
203
  /* @__PURE__ */ g(
@@ -217,7 +217,7 @@ const Ct = ({ isLoading: t }) => {
217
217
  {
218
218
  className: "item-action file-action",
219
219
  title: "Clear selection",
220
- onClick: () => f([]),
220
+ onClick: () => u([]),
221
221
  children: [
222
222
  /* @__PURE__ */ g("span", { children: [
223
223
  c.length,
@@ -225,7 +225,7 @@ const Ct = ({ isLoading: t }) => {
225
225
  c.length > 1 && "s",
226
226
  " selected"
227
227
  ] }),
228
- /* @__PURE__ */ e(Lt, { size: 18 })
228
+ /* @__PURE__ */ e(It, { size: 18 })
229
229
  ]
230
230
  }
231
231
  )
@@ -239,26 +239,26 @@ const Ct = ({ isLoading: t }) => {
239
239
  /* @__PURE__ */ e("button", { className: "item-action icon-only", title: m.title, onClick: m.onClick, children: m.icon }),
240
240
  p !== C.length - 1 && /* @__PURE__ */ e("div", { className: "item-separator" })
241
241
  ] }, p)),
242
- i && /* @__PURE__ */ e(
243
- tn,
242
+ a && /* @__PURE__ */ e(
243
+ nn,
244
244
  {
245
- setShowToggleViewMenu: a,
245
+ setShowToggleViewMenu: i,
246
246
  onLayoutChange: s
247
247
  }
248
248
  )
249
249
  ] })
250
250
  ] }) });
251
251
  }, Pt = ({ folder: t }) => {
252
- const [n, s] = b(!1), [r, o] = b(!1), { currentPath: i, setCurrentPath: a } = oe(), l = () => {
253
- o(!0), a(t.path);
254
- }, c = (f) => {
255
- f.stopPropagation(), s((h) => !h);
252
+ const [n, s] = b(!1), [r, o] = b(!1), { currentPath: a, setCurrentPath: i } = oe(), l = () => {
253
+ o(!0), i(t.path);
254
+ }, c = (u) => {
255
+ u.stopPropagation(), s((h) => !h);
256
256
  };
257
- return K(() => {
258
- o(i === t.path);
259
- const f = i.split("/");
260
- f.pop(), f.join("/") === t.path && s(!0);
261
- }, [i]), t.subDirectories.length > 0 ? /* @__PURE__ */ g(se, { children: [
257
+ return V(() => {
258
+ o(a === t.path);
259
+ const u = a.split("/");
260
+ u.pop(), u.join("/") === t.path && s(!0);
261
+ }, [a]), t.subDirectories.length > 0 ? /* @__PURE__ */ g(se, { children: [
262
262
  /* @__PURE__ */ g(
263
263
  "div",
264
264
  {
@@ -266,20 +266,20 @@ const Ct = ({ isLoading: t }) => {
266
266
  onClick: l,
267
267
  children: [
268
268
  /* @__PURE__ */ e("span", { onClick: c, children: /* @__PURE__ */ e(
269
- It,
269
+ At,
270
270
  {
271
271
  size: 20,
272
272
  className: `${n ? "folder-rotate-down" : "folder-rotate-right"}`
273
273
  }
274
274
  ) }),
275
275
  /* @__PURE__ */ g("div", { className: "sb-folder-details", children: [
276
- n || r ? /* @__PURE__ */ e(Ve, { size: 20, className: "folder-open-icon" }) : /* @__PURE__ */ e(Xe, { size: 17, className: "folder-close-icon" }),
276
+ n || r ? /* @__PURE__ */ e(Xe, { size: 20, className: "folder-open-icon" }) : /* @__PURE__ */ e(Ge, { size: 17, className: "folder-close-icon" }),
277
277
  /* @__PURE__ */ e("span", { className: "sb-folder-name", title: t.name, children: t.name })
278
278
  ] })
279
279
  ]
280
280
  }
281
281
  ),
282
- /* @__PURE__ */ e(Kt, { open: n, children: /* @__PURE__ */ e("div", { className: "folder-collapsible", children: t.subDirectories.map((f, h) => /* @__PURE__ */ e(Pt, { folder: f }, h)) }) })
282
+ /* @__PURE__ */ e(Yt, { open: n, children: /* @__PURE__ */ e("div", { className: "folder-collapsible", children: t.subDirectories.map((u, h) => /* @__PURE__ */ e(Pt, { folder: u }, h)) }) })
283
283
  ] }) : /* @__PURE__ */ g(
284
284
  "div",
285
285
  {
@@ -288,69 +288,69 @@ const Ct = ({ isLoading: t }) => {
288
288
  children: [
289
289
  /* @__PURE__ */ e("span", { className: "non-expanable" }),
290
290
  /* @__PURE__ */ g("div", { className: "sb-folder-details", children: [
291
- r ? /* @__PURE__ */ e(Ve, { size: 20, className: "folder-open-icon" }) : /* @__PURE__ */ e(Xe, { size: 17, className: "folder-close-icon" }),
291
+ r ? /* @__PURE__ */ e(Xe, { size: 20, className: "folder-open-icon" }) : /* @__PURE__ */ e(Ge, { size: 17, className: "folder-close-icon" }),
292
292
  /* @__PURE__ */ e("span", { className: "sb-folder-name", title: t.name, children: t.name })
293
293
  ] })
294
294
  ]
295
295
  }
296
296
  );
297
- }, ln = (t) => t == null ? void 0 : t.split("/").slice(0, -1).join("/"), cn = () => {
298
- const [t, n] = b([]), { files: s } = ke(), r = (o, i) => {
299
- var a;
300
- return i[o] ? (a = i[o]) == null ? void 0 : a.map((l) => ({
297
+ }, cn = (t) => t == null ? void 0 : t.split("/").slice(0, -1).join("/"), dn = () => {
298
+ const [t, n] = b([]), { files: s } = ke(), r = (o, a) => {
299
+ var i;
300
+ return a[o] ? (i = a[o]) == null ? void 0 : i.map((l) => ({
301
301
  ...l,
302
- subDirectories: r(l.path, i)
302
+ subDirectories: r(l.path, a)
303
303
  })) : [];
304
304
  };
305
- return K(() => {
305
+ return V(() => {
306
306
  if (Array.isArray(s)) {
307
- const o = s.filter((a) => a.isDirectory), i = Object.groupBy(o, ({ path: a }) => ln(a));
308
- n(() => r("", i));
307
+ const o = s.filter((i) => i.isDirectory), a = Object.groupBy(o, ({ path: i }) => cn(i));
308
+ n(() => r("", a));
309
309
  }
310
- }, [s]), /* @__PURE__ */ e("div", { className: "sb-folders-list", children: (t == null ? void 0 : t.length) > 0 ? /* @__PURE__ */ e(se, { children: t == null ? void 0 : t.map((o, i) => /* @__PURE__ */ e(Pt, { folder: o }, i)) }) : /* @__PURE__ */ e("div", { className: "empty-nav-pane", children: "Nothing here yet" }) });
311
- }, dn = () => {
312
- const [t, n] = b([]), [s, r] = b([]), [o, i] = b([]), [a, l] = b(!1), { currentPath: c, setCurrentPath: f } = oe(), h = re(null), u = re([]), w = re(null), x = ye(() => {
310
+ }, [s]), /* @__PURE__ */ e("div", { className: "sb-folders-list", children: (t == null ? void 0 : t.length) > 0 ? /* @__PURE__ */ e(se, { children: t == null ? void 0 : t.map((o, a) => /* @__PURE__ */ e(Pt, { folder: o }, a)) }) : /* @__PURE__ */ e("div", { className: "empty-nav-pane", children: "Nothing here yet" }) });
311
+ }, un = () => {
312
+ const [t, n] = b([]), [s, r] = b([]), [o, a] = b([]), [i, l] = b(!1), { currentPath: c, setCurrentPath: u } = oe(), h = re(null), f = re([]), w = re(null), T = ye(() => {
313
313
  l(!1);
314
314
  });
315
- K(() => {
315
+ V(() => {
316
316
  n(() => {
317
- let P = "";
317
+ let E = "";
318
318
  return c == null ? void 0 : c.split("/").map((F) => ({
319
319
  name: F || "Home",
320
- path: F === "" ? F : P += `/${F}`
320
+ path: F === "" ? F : E += `/${F}`
321
321
  }));
322
- }), r([]), i([]);
322
+ }), r([]), a([]);
323
323
  }, [c]);
324
- const S = (P) => {
325
- f(P);
326
- }, D = () => {
327
- const P = h.current.clientWidth, F = getComputedStyle(h.current), N = parseFloat(F.paddingLeft), m = s.length > 0 ? 1 : 0, p = parseFloat(F.gap) * (t.length + m);
328
- return P - (N + p);
324
+ const R = (E) => {
325
+ u(E);
326
+ }, O = () => {
327
+ const E = h.current.clientWidth, F = getComputedStyle(h.current), N = parseFloat(F.paddingLeft), m = s.length > 0 ? 1 : 0, p = parseFloat(F.gap) * (t.length + m);
328
+ return E - (N + p);
329
329
  }, M = () => {
330
330
  var m;
331
- const P = D(), F = u.current.reduce((p, T) => T ? p + T.clientWidth : p, 0), N = ((m = w.current) == null ? void 0 : m.clientWidth) || 0;
332
- return P - (F + N);
331
+ const E = O(), F = f.current.reduce((p, D) => D ? p + D.clientWidth : p, 0), N = ((m = w.current) == null ? void 0 : m.clientWidth) || 0;
332
+ return E - (F + N);
333
333
  }, C = () => h.current.scrollWidth > h.current.clientWidth;
334
- return K(() => {
335
- var P;
334
+ return V(() => {
335
+ var E;
336
336
  if (C()) {
337
- const F = t[1], N = (P = u.current[1]) == null ? void 0 : P.clientWidth;
338
- i((m) => [...m, N]), r((m) => [...m, F]), n((m) => m.filter((p, T) => T !== 1));
337
+ const F = t[1], N = (E = f.current[1]) == null ? void 0 : E.clientWidth;
338
+ a((m) => [...m, N]), r((m) => [...m, F]), n((m) => m.filter((p, D) => D !== 1));
339
339
  } else if (s.length > 0 && M() > o.at(-1)) {
340
340
  const F = [t[0], s.at(-1), ...t.slice(1)];
341
- n(F), r((N) => N.slice(0, -1)), i((N) => N.slice(0, -1));
341
+ n(F), r((N) => N.slice(0, -1)), a((N) => N.slice(0, -1));
342
342
  }
343
343
  }, [C]), /* @__PURE__ */ g("div", { className: "bread-crumb-container", children: [
344
- /* @__PURE__ */ e("div", { className: "breadcrumb", ref: h, children: t.map((P, F) => /* @__PURE__ */ g("div", { style: { display: "contents" }, children: [
344
+ /* @__PURE__ */ e("div", { className: "breadcrumb", ref: h, children: t.map((E, F) => /* @__PURE__ */ g("div", { style: { display: "contents" }, children: [
345
345
  /* @__PURE__ */ g(
346
346
  "span",
347
347
  {
348
348
  className: "folder-name",
349
- onClick: () => S(P.path),
350
- ref: (N) => u.current[F] = N,
349
+ onClick: () => R(E.path),
350
+ ref: (N) => f.current[F] = N,
351
351
  children: [
352
- F === 0 ? /* @__PURE__ */ e(At, {}) : /* @__PURE__ */ e($t, {}),
353
- P.name
352
+ F === 0 ? /* @__PURE__ */ e($t, {}) : /* @__PURE__ */ e(jt, {}),
353
+ E.name
354
354
  ]
355
355
  }
356
356
  ),
@@ -361,39 +361,39 @@ const Ct = ({ isLoading: t }) => {
361
361
  onClick: () => l(!0),
362
362
  ref: w,
363
363
  title: "Show more folders",
364
- children: /* @__PURE__ */ e(jt, { size: 22, className: "hidden-folders" })
364
+ children: /* @__PURE__ */ e(zt, { size: 22, className: "hidden-folders" })
365
365
  }
366
366
  )
367
367
  ] }, F)) }),
368
- a && /* @__PURE__ */ e("ul", { ref: x.ref, className: "hidden-folders-container", children: s.map((P, F) => /* @__PURE__ */ e(
368
+ i && /* @__PURE__ */ e("ul", { ref: T.ref, className: "hidden-folders-container", children: s.map((E, F) => /* @__PURE__ */ e(
369
369
  "li",
370
370
  {
371
371
  onClick: () => {
372
- S(P.path), l(!1);
372
+ R(E.path), l(!1);
373
373
  },
374
- children: P.name
374
+ children: E.name
375
375
  },
376
376
  F
377
377
  )) })
378
378
  ] });
379
379
  }, Fe = (t) => ({
380
- pdf: /* @__PURE__ */ e(Bt, { size: t }),
380
+ pdf: /* @__PURE__ */ e(Ut, { size: t }),
381
381
  jpg: /* @__PURE__ */ e(Ee, { size: t }),
382
382
  jpeg: /* @__PURE__ */ e(Ee, { size: t }),
383
383
  png: /* @__PURE__ */ e(Ee, { size: t }),
384
- txt: /* @__PURE__ */ e(Ut, { size: t }),
385
- doc: /* @__PURE__ */ e(Ue, { size: t }),
386
- docx: /* @__PURE__ */ e(Ue, { size: t }),
387
- mp4: /* @__PURE__ */ e(qe, { size: t }),
388
- webm: /* @__PURE__ */ e(qe, { size: t }),
389
- mp3: /* @__PURE__ */ e(He, { size: t }),
390
- m4a: /* @__PURE__ */ e(He, { size: t }),
391
- zip: /* @__PURE__ */ e(qt, { size: t }),
392
- ppt: /* @__PURE__ */ e(_e, { size: t }),
393
- pptx: /* @__PURE__ */ e(_e, { size: t }),
394
- xls: /* @__PURE__ */ e(Ke, { size: t }),
395
- xlsx: /* @__PURE__ */ e(Ke, { size: t }),
396
- exe: /* @__PURE__ */ e(Ht, { size: t }),
384
+ txt: /* @__PURE__ */ e(qt, { size: t }),
385
+ doc: /* @__PURE__ */ e(qe, { size: t }),
386
+ docx: /* @__PURE__ */ e(qe, { size: t }),
387
+ mp4: /* @__PURE__ */ e(He, { size: t }),
388
+ webm: /* @__PURE__ */ e(He, { size: t }),
389
+ mp3: /* @__PURE__ */ e(_e, { size: t }),
390
+ m4a: /* @__PURE__ */ e(_e, { size: t }),
391
+ zip: /* @__PURE__ */ e(Ht, { size: t }),
392
+ ppt: /* @__PURE__ */ e(Ke, { size: t }),
393
+ pptx: /* @__PURE__ */ e(Ke, { size: t }),
394
+ xls: /* @__PURE__ */ e(Ye, { size: t }),
395
+ xlsx: /* @__PURE__ */ e(Ye, { size: t }),
396
+ exe: /* @__PURE__ */ e(_t, { size: t }),
397
397
  html: /* @__PURE__ */ e(J, { size: t }),
398
398
  css: /* @__PURE__ */ e(J, { size: t }),
399
399
  js: /* @__PURE__ */ e(J, { size: t }),
@@ -414,20 +414,20 @@ const Ct = ({ isLoading: t }) => {
414
414
  }), Et = (t, n, s) => {
415
415
  if (s.find((r) => r.name === t)) {
416
416
  const r = "", o = t;
417
- let i = 0;
418
- const a = new RegExp(`${o} \\(\\d+\\)`);
419
- s.forEach((f) => {
420
- const h = f.isDirectory ? f.name : f.name.split(".").slice(0, -1).join(".");
421
- if (a.test(h)) {
422
- const u = h.split(`${o} (`).pop().slice(0, -1), w = parseInt(u);
423
- !isNaN(w) && w > i && (i = w);
417
+ let a = 0;
418
+ const i = new RegExp(`${o} \\(\\d+\\)`);
419
+ s.forEach((u) => {
420
+ const h = u.isDirectory ? u.name : u.name.split(".").slice(0, -1).join(".");
421
+ if (i.test(h)) {
422
+ const f = h.split(`${o} (`).pop().slice(0, -1), w = parseInt(f);
423
+ !isNaN(w) && w > a && (a = w);
424
424
  }
425
425
  });
426
- const l = ` (${++i})`;
426
+ const l = ` (${++a})`;
427
427
  return o + l + r;
428
428
  } else
429
429
  return t;
430
- }, Rt = ({ nameInputRef: t, maxLength: n, value: s, onChange: r, onKeyDown: o, onClick: i, rows: a }) => /* @__PURE__ */ e(
430
+ }, Rt = ({ nameInputRef: t, maxLength: n, value: s, onChange: r, onKeyDown: o, onClick: a, rows: i }) => /* @__PURE__ */ e(
431
431
  "textarea",
432
432
  {
433
433
  ref: t,
@@ -436,63 +436,63 @@ const Ct = ({ isLoading: t }) => {
436
436
  value: s,
437
437
  onChange: r,
438
438
  onKeyDown: o,
439
- onClick: i,
440
- rows: a
439
+ onClick: a,
440
+ rows: i
441
441
  }
442
- ), xt = ({ message: t, xPlacement: n, yPlacement: s }) => /* @__PURE__ */ e("p", { className: `error-tooltip ${n} ${s}`, children: t }), un = 220, fn = ({ filesViewRef: t, file: n, onCreateFolder: s, triggerAction: r }) => {
443
- const [o, i] = b(n.name), [a, l] = b(!1), [c, f] = b(""), [h, u] = b("right"), [w, x] = b("bottom"), S = ye((p) => {
442
+ ), xt = ({ message: t, xPlacement: n, yPlacement: s }) => /* @__PURE__ */ e("p", { className: `error-tooltip ${n} ${s}`, children: t }), fn = 220, hn = ({ filesViewRef: t, file: n, onCreateFolder: s, triggerAction: r }) => {
443
+ const [o, a] = b(n.name), [i, l] = b(!1), [c, u] = b(""), [h, f] = b("right"), [w, T] = b("bottom"), R = ye((p) => {
444
444
  p.preventDefault(), p.stopPropagation();
445
- }), { currentFolder: D, currentPathFiles: M, setCurrentPathFiles: C } = oe(), { activeLayout: P } = ce(), F = (p) => {
446
- i(p.target.value), l(!1);
445
+ }), { currentFolder: O, currentPathFiles: M, setCurrentPathFiles: C } = oe(), { activeLayout: E } = ce(), F = (p) => {
446
+ a(p.target.value), l(!1);
447
447
  }, N = (p) => {
448
448
  if (p.stopPropagation(), p.key === "Enter") {
449
449
  p.preventDefault(), m();
450
450
  return;
451
451
  }
452
- p.key === "Escape" && (p.preventDefault(), r.close(), C((y) => y.filter((E) => E.key !== n.key))), /[\\/:*?"<>|]/.test(p.key) ? (p.preventDefault(), f(
452
+ p.key === "Escape" && (p.preventDefault(), r.close(), C((y) => y.filter((P) => P.key !== n.key))), /[\\/:*?"<>|]/.test(p.key) ? (p.preventDefault(), u(
453
453
  `A file name can't contain any of the following characters: \\ / : * ? " < > |`
454
- ), l(!0)) : (l(!1), f(""));
454
+ ), l(!0)) : (l(!1), u(""));
455
455
  };
456
- K(() => {
457
- if (a) {
456
+ V(() => {
457
+ if (i) {
458
458
  const p = setTimeout(() => {
459
- l(!1), f("");
459
+ l(!1), u("");
460
460
  }, 7e3);
461
461
  return () => clearTimeout(p);
462
462
  }
463
- }, [a]);
463
+ }, [i]);
464
464
  function m() {
465
- var E, R;
465
+ var P, x;
466
466
  let p = o.trim();
467
- const T = M.filter((j) => !(j.key && j.key === n.key));
468
- if (T.find((j) => j.name.toLowerCase() === p.toLowerCase())) {
469
- f(`This destination already contains a folder named '${p}'.`), l(!0), (E = S.ref.current) == null || E.focus(), (R = S.ref.current) == null || R.select(), S.setIsClicked(!1);
467
+ const D = M.filter((j) => !(j.key && j.key === n.key));
468
+ if (D.find((j) => j.name.toLowerCase() === p.toLowerCase())) {
469
+ u(`This destination already contains a folder named '${p}'.`), l(!0), (P = R.ref.current) == null || P.focus(), (x = R.ref.current) == null || x.select(), R.setIsClicked(!1);
470
470
  return;
471
471
  }
472
- p === "" && (p = Et("New Folder", !0, T)), fe(s, "onCreateFolder", p, D), C((j) => j.filter((H) => H.key !== n.key)), r.close();
472
+ p === "" && (p = Et("New Folder", !0, D)), fe(s, "onCreateFolder", p, O), C((j) => j.filter((H) => H.key !== n.key)), r.close();
473
473
  }
474
- return K(() => {
475
- var p, T, y;
476
- if ((p = S.ref.current) == null || p.focus(), (T = S.ref.current) == null || T.select(), (y = S.ref) != null && y.current) {
477
- const H = t.current.getBoundingClientRect(), I = S.ref.current, Y = I.getBoundingClientRect();
478
- H.right - Y.left > 313 ? u("right") : u("left"), H.bottom - (Y.top + I.clientHeight) > 88 ? x("bottom") : x("top");
474
+ return V(() => {
475
+ var p, D, y;
476
+ if ((p = R.ref.current) == null || p.focus(), (D = R.ref.current) == null || D.select(), (y = R.ref) != null && y.current) {
477
+ const H = t.current.getBoundingClientRect(), I = R.ref.current, K = I.getBoundingClientRect();
478
+ H.right - K.left > 313 ? f("right") : f("left"), H.bottom - (K.top + I.clientHeight) > 88 ? T("bottom") : T("top");
479
479
  }
480
- }, []), K(() => {
481
- S.isClicked && m();
482
- }, [S.isClicked]), /* @__PURE__ */ g(se, { children: [
480
+ }, []), V(() => {
481
+ R.isClicked && m();
482
+ }, [R.isClicked]), /* @__PURE__ */ g(se, { children: [
483
483
  /* @__PURE__ */ e(
484
484
  Rt,
485
485
  {
486
- nameInputRef: S.ref,
487
- maxLength: un,
486
+ nameInputRef: R.ref,
487
+ maxLength: fn,
488
488
  value: o,
489
489
  onChange: F,
490
490
  onKeyDown: N,
491
491
  onClick: (p) => p.stopPropagation(),
492
- ...P === "list" && { rows: 1 }
492
+ ...E === "list" && { rows: 1 }
493
493
  }
494
494
  ),
495
- a && /* @__PURE__ */ e(
495
+ i && /* @__PURE__ */ e(
496
496
  xt,
497
497
  {
498
498
  message: c,
@@ -516,13 +516,13 @@ const Ct = ({ isLoading: t }) => {
516
516
  setShow: s,
517
517
  heading: r,
518
518
  dialogWidth: o = "25%",
519
- contentClassName: i = "",
520
- closeButton: a = !0
519
+ contentClassName: a = "",
520
+ closeButton: i = !0
521
521
  }) => {
522
- const l = re(null), c = (f) => {
523
- f.key === "Escape" && s(!1);
522
+ const l = re(null), c = (u) => {
523
+ u.key === "Escape" && s(!1);
524
524
  };
525
- return K(() => {
525
+ return V(() => {
526
526
  n ? l.current.showModal() : l.current.close();
527
527
  }, [n]), /* @__PURE__ */ g(
528
528
  "dialog",
@@ -534,29 +534,29 @@ const Ct = ({ isLoading: t }) => {
534
534
  children: [
535
535
  /* @__PURE__ */ g("div", { className: "fm-modal-header", children: [
536
536
  /* @__PURE__ */ e("span", { className: "fm-modal-heading", children: r }),
537
- a && /* @__PURE__ */ e(zt, { size: 18, onClick: () => s(!1), className: "close-icon", title: "Close" })
537
+ i && /* @__PURE__ */ e(Wt, { size: 18, onClick: () => s(!1), className: "close-icon", title: "Close" })
538
538
  ] }),
539
539
  t
540
540
  ]
541
541
  }
542
542
  );
543
- }, pe = (t) => t.split(".").pop(), hn = 220, pn = ({ filesViewRef: t, file: n, onRename: s, triggerAction: r }) => {
544
- const [o, i] = b(n == null ? void 0 : n.name), [a, l] = b(!1), [c, f] = b(!1), [h, u] = b(""), [w, x] = b("right"), [S, D] = b("bottom"), { currentPathFiles: M, setCurrentPathFiles: C } = oe(), { activeLayout: P } = ce(), F = re(null), N = ye((y) => {
545
- var E;
546
- (E = F.current) != null && E.contains(y.target) || (y.preventDefault(), y.stopPropagation());
543
+ }, pe = (t) => t.split(".").pop(), pn = 220, mn = ({ filesViewRef: t, file: n, onRename: s, triggerAction: r }) => {
544
+ const [o, a] = b(n == null ? void 0 : n.name), [i, l] = b(!1), [c, u] = b(!1), [h, f] = b(""), [w, T] = b("right"), [R, O] = b("bottom"), { currentPathFiles: M, setCurrentPathFiles: C } = oe(), { activeLayout: E } = ce(), F = re(null), N = ye((y) => {
545
+ var P;
546
+ (P = F.current) != null && P.contains(y.target) || (y.preventDefault(), y.stopPropagation());
547
547
  }), m = (y) => {
548
548
  if (y.stopPropagation(), y.key === "Enter") {
549
549
  y.preventDefault(), N.setIsClicked(!0);
550
550
  return;
551
551
  }
552
- /[\\/:*?"<>|]/.test(y.key) ? (y.preventDefault(), u(
552
+ /[\\/:*?"<>|]/.test(y.key) ? (y.preventDefault(), f(
553
553
  `A file name can't contain any of the following characters: \\ / : * ? " < > |`
554
- ), f(!0)) : f(!1);
554
+ ), u(!0)) : u(!1);
555
555
  };
556
- K(() => {
556
+ V(() => {
557
557
  if (c) {
558
558
  const y = setTimeout(() => {
559
- f(!1), u("");
559
+ u(!1), f("");
560
560
  }, 7e3);
561
561
  return () => clearTimeout(y);
562
562
  }
@@ -564,51 +564,51 @@ const Ct = ({ isLoading: t }) => {
564
564
  function p(y) {
565
565
  if (o === "" || o === n.name) {
566
566
  C(
567
- (E) => E.map((R) => (R.key === n.key && (R.isEditing = !1), R))
567
+ (P) => P.map((x) => (x.key === n.key && (x.isEditing = !1), x))
568
568
  ), r.close();
569
569
  return;
570
- } else if (M.some((E) => E.name === o)) {
571
- f(!0), u(`This destination already contains a folder named '${o}'.`), N.setIsClicked(!1);
570
+ } else if (M.some((P) => P.name === o)) {
571
+ u(!0), f(`This destination already contains a folder named '${o}'.`), N.setIsClicked(!1);
572
572
  return;
573
573
  } else if (!n.isDirectory && !y) {
574
- const E = pe(n.name), R = pe(o);
575
- if (E !== R) {
574
+ const P = pe(n.name), x = pe(o);
575
+ if (P !== x) {
576
576
  l(!0);
577
577
  return;
578
578
  }
579
579
  }
580
- f(!1), fe(s, "onRename", n, o), C((E) => E.filter((R) => R.key !== n.key)), r.close();
580
+ u(!1), fe(s, "onRename", n, o), C((P) => P.filter((x) => x.key !== n.key)), r.close();
581
581
  }
582
- const T = () => {
583
- var y, E, R, j, H, I;
584
- if ((E = (y = N.ref) == null ? void 0 : y.current) == null || E.focus(), n.isDirectory)
585
- (j = (R = N.ref) == null ? void 0 : R.current) == null || j.select();
582
+ const D = () => {
583
+ var y, P, x, j, H, I;
584
+ if ((P = (y = N.ref) == null ? void 0 : y.current) == null || P.focus(), n.isDirectory)
585
+ (j = (x = N.ref) == null ? void 0 : x.current) == null || j.select();
586
586
  else {
587
- const Y = pe(n.name), te = n.name.length - Y.length - 1;
588
- (I = (H = N.ref) == null ? void 0 : H.current) == null || I.setSelectionRange(0, te);
587
+ const K = pe(n.name), Z = n.name.length - K.length - 1;
588
+ (I = (H = N.ref) == null ? void 0 : H.current) == null || I.setSelectionRange(0, Z);
589
589
  }
590
590
  };
591
- return K(() => {
591
+ return V(() => {
592
592
  var y;
593
- if (T(), (y = N.ref) != null && y.current) {
594
- const H = t.current.getBoundingClientRect(), I = N.ref.current, Y = I.getBoundingClientRect();
595
- H.right - Y.left > 313 ? x("right") : x("left"), H.bottom - (Y.top + I.clientHeight) > 88 ? D("bottom") : D("top");
593
+ if (D(), (y = N.ref) != null && y.current) {
594
+ const H = t.current.getBoundingClientRect(), I = N.ref.current, K = I.getBoundingClientRect();
595
+ H.right - K.left > 313 ? T("right") : T("left"), H.bottom - (K.top + I.clientHeight) > 88 ? O("bottom") : O("top");
596
596
  }
597
- }, []), K(() => {
598
- N.isClicked && p(!1), T();
597
+ }, []), V(() => {
598
+ N.isClicked && p(!1), D();
599
599
  }, [N.isClicked]), /* @__PURE__ */ g(se, { children: [
600
600
  /* @__PURE__ */ e(
601
601
  Rt,
602
602
  {
603
603
  nameInputRef: N.ref,
604
- maxLength: hn,
604
+ maxLength: pn,
605
605
  value: o,
606
606
  onChange: (y) => {
607
- i(y.target.value), f(!1);
607
+ a(y.target.value), u(!1);
608
608
  },
609
609
  onKeyDown: m,
610
610
  onClick: (y) => y.stopPropagation(),
611
- ...P === "list" && { rows: 1 }
611
+ ...E === "list" && { rows: 1 }
612
612
  }
613
613
  ),
614
614
  c && /* @__PURE__ */ e(
@@ -616,20 +616,20 @@ const Ct = ({ isLoading: t }) => {
616
616
  {
617
617
  message: h,
618
618
  xPlacement: w,
619
- yPlacement: S
619
+ yPlacement: R
620
620
  }
621
621
  ),
622
622
  /* @__PURE__ */ e(
623
623
  Tt,
624
624
  {
625
625
  heading: "Rename",
626
- show: a,
626
+ show: i,
627
627
  setShow: l,
628
628
  dialogWidth: "25vw",
629
629
  closeButton: !1,
630
630
  children: /* @__PURE__ */ g("div", { className: "fm-rename-folder-container", ref: F, children: [
631
631
  /* @__PURE__ */ e("div", { className: "fm-rename-folder-input", children: /* @__PURE__ */ g("div", { className: "fm-rename-warning", children: [
632
- /* @__PURE__ */ e(Xt, { size: 70, color: "orange" }),
632
+ /* @__PURE__ */ e(Gt, { size: 70, color: "orange" }),
633
633
  /* @__PURE__ */ e("div", { children: "If you change a file name extension, the file might become unusable. Are you sure you want to change it?" })
634
634
  ] }) }),
635
635
  /* @__PURE__ */ g("div", { className: "fm-rename-folder-action", children: [
@@ -639,7 +639,7 @@ const Ct = ({ isLoading: t }) => {
639
639
  type: "secondary",
640
640
  onClick: () => {
641
641
  C(
642
- (y) => y.map((E) => (E.key === n.key && (E.isEditing = !1), E))
642
+ (y) => y.map((P) => (P.key === n.key && (P.isEditing = !1), P))
643
643
  ), l(!1), r.close();
644
644
  },
645
645
  children: "No"
@@ -669,104 +669,104 @@ const Ct = ({ isLoading: t }) => {
669
669
  return `${r.toFixed(n)} MB`;
670
670
  if (r >= 1024)
671
671
  return `${o.toFixed(n)} GB`;
672
- }, mn = (t) => {
672
+ }, vn = (t) => {
673
673
  if (!t || isNaN(Date.parse(t))) return "";
674
674
  t = new Date(t);
675
675
  let n = t.getHours();
676
676
  const s = t.getMinutes(), r = n >= 12 ? "PM" : "AM";
677
677
  n = n % 12, n = n || 12;
678
- const o = t.getMonth() + 1, i = t.getDate(), a = t.getFullYear();
679
- return `${o}/${i}/${a} ${n}:${s < 10 ? "0" + s : s} ${r}`;
680
- }, Dt = ({ name: t, id: n, checked: s, onClick: r, onChange: o, className: i = "", title: a, disabled: l = !1 }) => /* @__PURE__ */ e(
678
+ const o = t.getMonth() + 1, a = t.getDate(), i = t.getFullYear();
679
+ return `${o}/${a}/${i} ${n}:${s < 10 ? "0" + s : s} ${r}`;
680
+ }, Dt = ({ name: t, id: n, checked: s, onClick: r, onChange: o, className: a = "", title: i, disabled: l = !1 }) => /* @__PURE__ */ e(
681
681
  "input",
682
682
  {
683
- className: `fm-checkbox ${i}`,
683
+ className: `fm-checkbox ${a}`,
684
684
  type: "checkbox",
685
685
  name: t,
686
686
  id: n,
687
687
  checked: s,
688
688
  onClick: r,
689
689
  onChange: o,
690
- title: a,
690
+ title: i,
691
691
  disabled: l
692
692
  }
693
- ), Re = 50, vn = ({
693
+ ), Re = 50, gn = ({
694
694
  index: t,
695
695
  file: n,
696
696
  onCreateFolder: s,
697
697
  onRename: r,
698
698
  enableFilePreview: o,
699
- onFileOpen: i,
700
- filesViewRef: a,
699
+ onFileOpen: a,
700
+ filesViewRef: i,
701
701
  selectedFileIndexes: l,
702
702
  triggerAction: c,
703
- handleContextMenu: f,
703
+ handleContextMenu: u,
704
704
  setLastSelectedFile: h
705
705
  }) => {
706
- var Z, G, ie, ze;
707
- const [u, w] = b(!1), [x, S] = b(0), [D, M] = b("hidden"), [C, P] = b(""), [F, N] = b(null), { activeLayout: m } = ce(), p = m === "grid" ? 48 : 20, T = Fe(p), { setCurrentPath: y, currentPathFiles: E } = oe(), { setSelectedFiles: R } = le(), { clipBoard: j, handleCutCopy: H, setClipBoard: I, handlePasting: Y } = Ne(), te = re(null), X = Fe(Re), V = (j == null ? void 0 : j.isMoving) && j.files.find((W) => W.name === n.name && W.path === n.path), de = () => {
708
- i(n), n.isDirectory ? (y(n.path), R([])) : o && c.show("previewFile");
709
- }, Ce = (W, ne) => {
710
- if (l.length > 0 && W) {
706
+ var Q, G, ie, We;
707
+ const [f, w] = b(!1), [T, R] = b(0), [O, M] = b("hidden"), [C, E] = b(""), [F, N] = b(null), { activeLayout: m } = ce(), p = m === "grid" ? 48 : 20, D = Fe(p), { setCurrentPath: y, currentPathFiles: P } = oe(), { setSelectedFiles: x } = le(), { clipBoard: j, handleCutCopy: H, setClipBoard: I, handlePasting: K } = Ne(), Z = re(null), X = Fe(Re), Y = (j == null ? void 0 : j.isMoving) && j.files.find((B) => B.name === n.name && B.path === n.path), de = () => {
708
+ a(n), n.isDirectory ? (y(n.path), x([])) : o && c.show("previewFile");
709
+ }, Ce = (B, ne) => {
710
+ if (l.length > 0 && B) {
711
711
  let ae = !1, ue = l[0], he = t;
712
712
  if (ue >= he) {
713
713
  const Mt = ue;
714
714
  ue = he, he = Mt, ae = !0;
715
715
  }
716
- const We = E.slice(ue, he + 1);
717
- R(ae ? We.reverse() : We);
718
- } else l.length > 0 && ne ? R((ae) => {
716
+ const Be = P.slice(ue, he + 1);
717
+ x(ae ? Be.reverse() : Be);
718
+ } else l.length > 0 && ne ? x((ae) => {
719
719
  const ue = ae.filter((he) => he.path !== n.path);
720
720
  return ae.length === ue.length ? [...ae, n] : ue;
721
- }) : R([n]);
722
- }, d = (W) => {
723
- if (W.stopPropagation(), n.isEditing) return;
724
- Ce(W.shiftKey, W.ctrlKey);
721
+ }) : x([n]);
722
+ }, d = (B) => {
723
+ if (B.stopPropagation(), n.isEditing) return;
724
+ Ce(B.shiftKey, B.ctrlKey);
725
725
  const ne = (/* @__PURE__ */ new Date()).getTime();
726
- if (ne - x < 300) {
726
+ if (ne - T < 300) {
727
727
  de();
728
728
  return;
729
729
  }
730
- S(ne);
731
- }, v = (W) => {
732
- W.key === "Enter" && (W.stopPropagation(), R([n]), de());
733
- }, $ = (W) => {
734
- W.stopPropagation(), W.preventDefault(), !n.isEditing && (u || R([n]), h(n), f(W, !0));
730
+ R(ne);
731
+ }, v = (B) => {
732
+ B.key === "Enter" && (B.stopPropagation(), x([n]), de());
733
+ }, $ = (B) => {
734
+ B.stopPropagation(), B.preventDefault(), !n.isEditing && (f || x([n]), h(n), u(B, !0));
735
735
  }, A = () => {
736
736
  M("visible");
737
- }, O = () => {
738
- !u && M("hidden");
739
- }, z = (W) => {
740
- W.target.checked ? R((ne) => [...ne, n]) : R((ne) => ne.filter((ae) => ae.name !== n.name && ae.path !== n.path)), w(W.target.checked);
741
- }, k = (W) => {
742
- W.dataTransfer.setDragImage(te.current, 30, 50), W.dataTransfer.effectAllowed = "copy", H(!0);
743
- }, L = () => I(null), B = (W) => {
744
- W.preventDefault(), u || !n.isDirectory ? W.dataTransfer.dropEffect = "none" : (N({ x: W.clientX, y: W.clientY + 12 }), W.dataTransfer.dropEffect = "copy", P("file-drop-zone"));
745
- }, _ = (W) => {
746
- W.currentTarget.contains(W.relatedTarget) || (P((ne) => ne && ""), N(null));
747
- }, U = (W) => {
748
- W.preventDefault(), !(u || !n.isDirectory) && (Y(n), P((ne) => ne && ""), N(null));
737
+ }, S = () => {
738
+ !f && M("hidden");
739
+ }, W = (B) => {
740
+ B.target.checked ? x((ne) => [...ne, n]) : x((ne) => ne.filter((ae) => ae.name !== n.name && ae.path !== n.path)), w(B.target.checked);
741
+ }, k = (B) => {
742
+ B.dataTransfer.setDragImage(Z.current, 30, 50), B.dataTransfer.effectAllowed = "copy", H(!0);
743
+ }, L = () => I(null), U = (B) => {
744
+ B.preventDefault(), f || !n.isDirectory ? B.dataTransfer.dropEffect = "none" : (N({ x: B.clientX, y: B.clientY + 12 }), B.dataTransfer.dropEffect = "copy", E("file-drop-zone"));
745
+ }, _ = (B) => {
746
+ B.currentTarget.contains(B.relatedTarget) || (E((ne) => ne && ""), N(null));
747
+ }, q = (B) => {
748
+ B.preventDefault(), !(f || !n.isDirectory) && (K(n), E((ne) => ne && ""), N(null));
749
749
  };
750
- return K(() => {
750
+ return V(() => {
751
751
  w(l.includes(t)), M(l.includes(t) ? "visible" : "hidden");
752
752
  }, [l]), /* @__PURE__ */ g(
753
753
  "div",
754
754
  {
755
- className: `file-item-container ${C} ${u || n.isEditing ? "file-selected" : ""} ${V ? "file-moving" : ""}`,
755
+ className: `file-item-container ${C} ${f || n.isEditing ? "file-selected" : ""} ${Y ? "file-moving" : ""}`,
756
756
  tabIndex: 0,
757
757
  title: n.name,
758
758
  onClick: d,
759
759
  onKeyDown: v,
760
760
  onContextMenu: $,
761
761
  onMouseOver: A,
762
- onMouseLeave: O,
763
- draggable: u,
762
+ onMouseLeave: S,
763
+ draggable: f,
764
764
  onDragStart: k,
765
765
  onDragEnd: L,
766
- onDragEnter: B,
767
- onDragOver: B,
766
+ onDragEnter: U,
767
+ onDragOver: U,
768
768
  onDragLeave: _,
769
- onDrop: U,
769
+ onDrop: q,
770
770
  children: [
771
771
  /* @__PURE__ */ g("div", { className: "file-item", children: [
772
772
  !n.isEditing && /* @__PURE__ */ e(
@@ -774,25 +774,25 @@ const Ct = ({ isLoading: t }) => {
774
774
  {
775
775
  name: n.name,
776
776
  id: n.name,
777
- checked: u,
778
- className: `selection-checkbox ${D}`,
779
- onChange: z,
780
- onClick: (W) => W.stopPropagation()
777
+ checked: f,
778
+ className: `selection-checkbox ${O}`,
779
+ onChange: W,
780
+ onClick: (B) => B.stopPropagation()
781
781
  }
782
782
  ),
783
- n.isDirectory ? /* @__PURE__ */ e(Ye, { size: p }) : /* @__PURE__ */ e(se, { children: T[(G = (Z = n.name) == null ? void 0 : Z.split(".").pop()) == null ? void 0 : G.toLowerCase()] ?? /* @__PURE__ */ e(be, { size: p }) }),
783
+ n.isDirectory ? /* @__PURE__ */ e(Ve, { size: p }) : /* @__PURE__ */ e(se, { children: D[(G = (Q = n.name) == null ? void 0 : Q.split(".").pop()) == null ? void 0 : G.toLowerCase()] ?? /* @__PURE__ */ e(be, { size: p }) }),
784
784
  n.isEditing ? /* @__PURE__ */ e("div", { className: `rename-file-container ${m}`, children: c.actionType === "createFolder" ? /* @__PURE__ */ e(
785
- fn,
785
+ hn,
786
786
  {
787
- filesViewRef: a,
787
+ filesViewRef: i,
788
788
  file: n,
789
789
  onCreateFolder: s,
790
790
  triggerAction: c
791
791
  }
792
792
  ) : /* @__PURE__ */ e(
793
- pn,
793
+ mn,
794
794
  {
795
- filesViewRef: a,
795
+ filesViewRef: i,
796
796
  file: n,
797
797
  onRename: r,
798
798
  triggerAction: c
@@ -800,7 +800,7 @@ const Ct = ({ isLoading: t }) => {
800
800
  ) }) : /* @__PURE__ */ e("span", { className: "text-truncate file-name", children: n.name })
801
801
  ] }),
802
802
  m === "list" && /* @__PURE__ */ g(se, { children: [
803
- /* @__PURE__ */ e("div", { className: "modified-date", children: mn(n.updatedAt) }),
803
+ /* @__PURE__ */ e("div", { className: "modified-date", children: vn(n.updatedAt) }),
804
804
  /* @__PURE__ */ e("div", { className: "size", children: (n == null ? void 0 : n.size) > 0 ? Pe(n == null ? void 0 : n.size) : "" })
805
805
  ] }),
806
806
  F && /* @__PURE__ */ g(
@@ -817,57 +817,57 @@ const Ct = ({ isLoading: t }) => {
817
817
  ]
818
818
  }
819
819
  ),
820
- /* @__PURE__ */ e("div", { ref: te, className: "drag-icon", children: n.isDirectory ? /* @__PURE__ */ e(Ye, { size: Re }) : /* @__PURE__ */ e(se, { children: X[(ze = (ie = n.name) == null ? void 0 : ie.split(".").pop()) == null ? void 0 : ze.toLowerCase()] ?? /* @__PURE__ */ e(be, { size: Re }) }) })
820
+ /* @__PURE__ */ e("div", { ref: Z, className: "drag-icon", children: n.isDirectory ? /* @__PURE__ */ e(Ve, { size: Re }) : /* @__PURE__ */ e(se, { children: X[(We = (ie = n.name) == null ? void 0 : ie.split(".").pop()) == null ? void 0 : We.toLowerCase()] ?? /* @__PURE__ */ e(be, { size: Re }) }) })
821
821
  ]
822
822
  }
823
823
  );
824
- }, gn = ({ subMenuRef: t, list: n, position: s = "right" }) => /* @__PURE__ */ e("ul", { ref: t, className: `sub-menu ${s}`, children: n == null ? void 0 : n.map((r) => /* @__PURE__ */ g("li", { onClick: r.onClick, children: [
824
+ }, yn = ({ subMenuRef: t, list: n, position: s = "right" }) => /* @__PURE__ */ e("ul", { ref: t, className: `sub-menu ${s}`, children: n == null ? void 0 : n.map((r) => /* @__PURE__ */ g("li", { onClick: r.onClick, children: [
825
825
  /* @__PURE__ */ e("span", { className: "item-selected", children: r.selected && /* @__PURE__ */ e(gt, { size: 13 }) }),
826
826
  r.icon,
827
827
  /* @__PURE__ */ e("span", { children: r.title })
828
- ] }, r.title)) }), yn = ({ filesViewRef: t, contextMenuRef: n, menuItems: s, visible: r, clickPosition: o }) => {
829
- const [i, a] = b(0), [l, c] = b(0), [f, h] = b(null), [u, w] = b("right"), x = re(null), S = () => {
830
- const { clickX: C, clickY: P } = o, F = t.current, N = F.getBoundingClientRect(), m = F.offsetWidth - F.clientWidth, p = n.current.getBoundingClientRect(), T = p.width, y = p.height, E = C - N.left, R = N.width - (E + m) > T, j = !R, H = P - N.top, I = N.height - H > y, Y = !I;
831
- R ? (a(`${E}px`), w("right")) : j && (a(`${E - T}px`), w("left")), I ? c(`${H + F.scrollTop}px`) : Y && c(`${H + F.scrollTop - y}px`);
832
- }, D = (C) => {
828
+ ] }, r.title)) }), Cn = ({ filesViewRef: t, contextMenuRef: n, menuItems: s, visible: r, clickPosition: o }) => {
829
+ const [a, i] = b(0), [l, c] = b(0), [u, h] = b(null), [f, w] = b("right"), T = re(null), R = () => {
830
+ const { clickX: C, clickY: E } = o, F = t.current, N = F.getBoundingClientRect(), m = F.offsetWidth - F.clientWidth, p = n.current.getBoundingClientRect(), D = p.width, y = p.height, P = C - N.left, x = N.width - (P + m) > D, j = !x, H = E - N.top, I = N.height - H > y, K = !I;
831
+ x ? (i(`${P}px`), w("right")) : j && (i(`${P - D}px`), w("left")), I ? c(`${H + F.scrollTop}px`) : K && c(`${H + F.scrollTop - y}px`);
832
+ }, O = (C) => {
833
833
  C.preventDefault(), C.stopPropagation();
834
834
  }, M = (C) => {
835
835
  h(C);
836
836
  };
837
- if (K(() => {
838
- r && n.current ? S() : (c(0), a(0), h(null));
837
+ if (V(() => {
838
+ r && n.current ? R() : (c(0), i(0), h(null));
839
839
  }, [r]), r)
840
840
  return /* @__PURE__ */ e(
841
841
  "div",
842
842
  {
843
843
  ref: n,
844
- onContextMenu: D,
844
+ onContextMenu: O,
845
845
  onClick: (C) => C.stopPropagation(),
846
846
  className: `fm-context-menu ${l ? "visible" : "hidden"}`,
847
847
  style: {
848
848
  top: l,
849
- left: i
849
+ left: a
850
850
  },
851
- children: /* @__PURE__ */ e("div", { className: "file-context-menu-list", children: /* @__PURE__ */ e("ul", { children: s.filter((C) => !C.hidden).map((C, P) => {
852
- const F = C.hasOwnProperty("children"), N = f === P && F;
851
+ children: /* @__PURE__ */ e("div", { className: "file-context-menu-list", children: /* @__PURE__ */ e("ul", { children: s.filter((C) => !C.hidden).map((C, E) => {
852
+ const F = C.hasOwnProperty("children"), N = u === E && F;
853
853
  return /* @__PURE__ */ g("div", { children: [
854
854
  /* @__PURE__ */ g(
855
855
  "li",
856
856
  {
857
857
  onClick: C.onClick,
858
858
  className: `${C.className ?? ""} ${N ? "active" : ""}`,
859
- onMouseOver: () => M(P),
859
+ onMouseOver: () => M(E),
860
860
  children: [
861
861
  C.icon,
862
862
  /* @__PURE__ */ e("span", { children: C.title }),
863
863
  F && /* @__PURE__ */ g(se, { children: [
864
- /* @__PURE__ */ e(_t, { size: 14, className: "list-expand-icon" }),
864
+ /* @__PURE__ */ e(Kt, { size: 14, className: "list-expand-icon" }),
865
865
  N && /* @__PURE__ */ e(
866
- gn,
866
+ yn,
867
867
  {
868
- subMenuRef: x,
868
+ subMenuRef: T,
869
869
  list: C.children,
870
- position: u
870
+ position: f
871
871
  }
872
872
  )
873
873
  ] })
@@ -879,32 +879,32 @@ const Ct = ({ isLoading: t }) => {
879
879
  }) }) })
880
880
  }
881
881
  );
882
- }, Cn = (t, n, s) => {
883
- const [r, o] = b([]), [i, a] = b(!1), [l, c] = b(!1), [f, h] = b({ clickX: 0, clickY: 0 }), [u, w] = b(null), { clipBoard: x, setClipBoard: S, handleCutCopy: D, handlePasting: M } = Ne(), { selectedFiles: C, setSelectedFiles: P, handleDownload: F } = le(), { currentPath: N, setCurrentPath: m, currentPathFiles: p, setCurrentPathFiles: T } = oe(), { activeLayout: y, setActiveLayout: E } = ce(), R = () => {
884
- u.isDirectory ? (m(u.path), o([]), P([])) : n && s.show("previewFile"), a(!1);
882
+ }, wn = (t, n, s) => {
883
+ const [r, o] = b([]), [a, i] = b(!1), [l, c] = b(!1), [u, h] = b({ clickX: 0, clickY: 0 }), [f, w] = b(null), { clipBoard: T, setClipBoard: R, handleCutCopy: O, handlePasting: M } = Ne(), { selectedFiles: C, setSelectedFiles: E, handleDownload: F } = le(), { currentPath: N, setCurrentPath: m, currentPathFiles: p, setCurrentPathFiles: D } = oe(), { activeLayout: y, setActiveLayout: P } = ce(), x = () => {
884
+ f.isDirectory ? (m(f.path), o([]), E([])) : n && s.show("previewFile"), i(!1);
885
885
  }, j = (k) => {
886
- D(k), a(!1);
886
+ O(k), i(!1);
887
887
  }, H = () => {
888
- M(u), a(!1);
888
+ M(f), i(!1);
889
889
  }, I = () => {
890
- a(!1), s.show("rename");
891
- }, Y = () => {
892
- F(), a(!1);
893
- }, te = () => {
894
- a(!1), s.show("delete");
890
+ i(!1), s.show("rename");
891
+ }, K = () => {
892
+ F(), i(!1);
893
+ }, Z = () => {
894
+ i(!1), s.show("delete");
895
895
  }, d = [
896
896
  {
897
897
  title: "View",
898
- icon: y === "grid" ? /* @__PURE__ */ e(Be, { size: 18 }) : /* @__PURE__ */ e(we, { size: 18 }),
898
+ icon: y === "grid" ? /* @__PURE__ */ e(Ue, { size: 18 }) : /* @__PURE__ */ e(we, { size: 18 }),
899
899
  onClick: () => {
900
900
  },
901
901
  children: [
902
902
  {
903
903
  title: "Grid",
904
- icon: /* @__PURE__ */ e(Be, { size: 18 }),
904
+ icon: /* @__PURE__ */ e(Ue, { size: 18 }),
905
905
  selected: y === "grid",
906
906
  onClick: () => {
907
- E("grid"), a(!1);
907
+ P("grid"), i(!1);
908
908
  }
909
909
  },
910
910
  {
@@ -912,7 +912,7 @@ const Ct = ({ isLoading: t }) => {
912
912
  icon: /* @__PURE__ */ e(we, { size: 18 }),
913
913
  selected: y === "list",
914
914
  onClick: () => {
915
- E("list"), a(!1);
915
+ P("list"), i(!1);
916
916
  }
917
917
  }
918
918
  ]
@@ -921,7 +921,7 @@ const Ct = ({ isLoading: t }) => {
921
921
  title: "Refresh",
922
922
  icon: /* @__PURE__ */ e(ht, { size: 18 }),
923
923
  onClick: () => {
924
- a(!1), fe(t, "onRefresh"), S(null);
924
+ i(!1), fe(t, "onRefresh"), R(null);
925
925
  },
926
926
  divider: !0
927
927
  },
@@ -929,29 +929,29 @@ const Ct = ({ isLoading: t }) => {
929
929
  title: "New folder",
930
930
  icon: /* @__PURE__ */ e(ft, { size: 18 }),
931
931
  onClick: () => {
932
- s.show("createFolder"), a(!1);
932
+ s.show("createFolder"), i(!1);
933
933
  }
934
934
  },
935
935
  {
936
936
  title: "Upload",
937
937
  icon: /* @__PURE__ */ e(mt, { size: 18 }),
938
938
  onClick: () => {
939
- a(!1), s.show("uploadFile");
939
+ i(!1), s.show("uploadFile");
940
940
  },
941
941
  divider: !0
942
942
  },
943
943
  {
944
944
  title: "Select all",
945
- icon: /* @__PURE__ */ e(Wt, { size: 18 }),
945
+ icon: /* @__PURE__ */ e(Bt, { size: 18 }),
946
946
  onClick: () => {
947
- P(p), a(!1);
947
+ E(p), i(!1);
948
948
  }
949
949
  }
950
950
  ], v = [
951
951
  {
952
952
  title: "Open",
953
- icon: u != null && u.isDirectory ? /* @__PURE__ */ e(Gt, { size: 20 }) : /* @__PURE__ */ e(be, { size: 16 }),
954
- onClick: R,
953
+ icon: f != null && f.isDirectory ? /* @__PURE__ */ e(Jt, { size: 20 }) : /* @__PURE__ */ e(be, { size: 16 }),
954
+ onClick: x,
955
955
  divider: !0
956
956
  },
957
957
  {
@@ -963,14 +963,14 @@ const Ct = ({ isLoading: t }) => {
963
963
  title: "Copy",
964
964
  icon: /* @__PURE__ */ e(ut, { strokeWidth: 0.1, size: 17 }),
965
965
  onClick: () => j(!1),
966
- divider: !(u != null && u.isDirectory)
966
+ divider: !(f != null && f.isDirectory)
967
967
  },
968
968
  {
969
969
  title: "Paste",
970
970
  icon: /* @__PURE__ */ e(Ie, { size: 18 }),
971
971
  onClick: H,
972
- className: `${x ? "" : "disable-paste"}`,
973
- hidden: !(u != null && u.isDirectory),
972
+ className: `${T ? "" : "disable-paste"}`,
973
+ hidden: !(f != null && f.isDirectory),
974
974
  divider: !0
975
975
  },
976
976
  {
@@ -981,17 +981,17 @@ const Ct = ({ isLoading: t }) => {
981
981
  },
982
982
  {
983
983
  title: "Download",
984
- icon: /* @__PURE__ */ e($e, { size: 18 }),
985
- onClick: Y,
986
- hidden: u == null ? void 0 : u.isDirectory
984
+ icon: /* @__PURE__ */ e(je, { size: 18 }),
985
+ onClick: K,
986
+ hidden: f == null ? void 0 : f.isDirectory
987
987
  },
988
988
  {
989
989
  title: "Delete",
990
990
  icon: /* @__PURE__ */ e(pt, { size: 19 }),
991
- onClick: te
991
+ onClick: Z
992
992
  }
993
993
  ], $ = () => {
994
- T((k) => [
994
+ D((k) => [
995
995
  ...k,
996
996
  {
997
997
  name: Et("New Folder", !0, k),
@@ -1002,13 +1002,13 @@ const Ct = ({ isLoading: t }) => {
1002
1002
  }
1003
1003
  ]);
1004
1004
  }, A = () => {
1005
- T((k) => (k[r.at(-1)] && (k[r.at(-1)].isEditing = !0), k)), o([]), P([]);
1006
- }, O = () => {
1007
- o([]), P((k) => k.length > 0 ? [] : k);
1008
- }, z = (k, L = !1) => {
1009
- k.preventDefault(), h({ clickX: k.clientX, clickY: k.clientY }), c(L), !L && O(), a(!0);
1005
+ D((k) => (k[r.at(-1)] && (k[r.at(-1)].isEditing = !0), k)), o([]), E([]);
1006
+ }, S = () => {
1007
+ o([]), E((k) => k.length > 0 ? [] : k);
1008
+ }, W = (k, L = !1) => {
1009
+ k.preventDefault(), h({ clickX: k.clientX, clickY: k.clientY }), c(L), !L && S(), i(!0);
1010
1010
  };
1011
- return K(() => {
1011
+ return V(() => {
1012
1012
  if (s.isActive)
1013
1013
  switch (s.actionType) {
1014
1014
  case "createFolder":
@@ -1018,24 +1018,24 @@ const Ct = ({ isLoading: t }) => {
1018
1018
  A();
1019
1019
  break;
1020
1020
  }
1021
- }, [s.isActive]), K(() => {
1022
- o([]), P([]);
1023
- }, [N]), K(() => {
1021
+ }, [s.isActive]), V(() => {
1022
+ o([]), E([]);
1023
+ }, [N]), V(() => {
1024
1024
  C.length > 0 ? o(() => C.map((k) => p.findIndex((L) => L.path === k.path))) : o([]);
1025
1025
  }, [C, p]), {
1026
1026
  emptySelecCtxItems: d,
1027
1027
  selecCtxItems: v,
1028
- handleContextMenu: z,
1029
- unselectFiles: O,
1030
- visible: i,
1031
- setVisible: a,
1028
+ handleContextMenu: W,
1029
+ unselectFiles: S,
1030
+ visible: a,
1031
+ setVisible: i,
1032
1032
  setLastSelectedFile: w,
1033
1033
  selectedFileIndexes: r,
1034
- clickPosition: f,
1034
+ clickPosition: u,
1035
1035
  isSelectionCtx: l
1036
1036
  };
1037
- }, wn = ({ unselectFiles: t }) => {
1038
- const [n, s] = b(!1), { selectedFiles: r, setSelectedFiles: o } = le(), { currentPathFiles: i } = oe(), a = lt(() => i.length > 0 && r.length === i.length, [r, i]);
1037
+ }, bn = ({ unselectFiles: t }) => {
1038
+ const [n, s] = b(!1), { selectedFiles: r, setSelectedFiles: o } = le(), { currentPathFiles: a } = oe(), i = $e(() => a.length > 0 && r.length === a.length, [r, a]);
1039
1039
  return /* @__PURE__ */ g(
1040
1040
  "div",
1041
1041
  {
@@ -1043,46 +1043,46 @@ const Ct = ({ isLoading: t }) => {
1043
1043
  onMouseOver: () => s(!0),
1044
1044
  onMouseLeave: () => s(!1),
1045
1045
  children: [
1046
- /* @__PURE__ */ e("div", { className: "file-select-all", children: (n || a) && /* @__PURE__ */ e(Dt, { checked: a, onChange: (c) => {
1047
- c.target.checked ? (o(i), s(!0)) : t();
1048
- }, title: "Select all", disabled: i.length === 0 }) }),
1046
+ /* @__PURE__ */ e("div", { className: "file-select-all", children: (n || i) && /* @__PURE__ */ e(Dt, { checked: i, onChange: (c) => {
1047
+ c.target.checked ? (o(a), s(!0)) : t();
1048
+ }, title: "Select all", disabled: a.length === 0 }) }),
1049
1049
  /* @__PURE__ */ e("div", { className: "file-name", children: "Name" }),
1050
1050
  /* @__PURE__ */ e("div", { className: "file-date", children: "Modified" }),
1051
1051
  /* @__PURE__ */ e("div", { className: "file-size", children: "Size" })
1052
1052
  ]
1053
1053
  }
1054
1054
  );
1055
- }, bn = ({
1055
+ }, Fn = ({
1056
1056
  onCreateFolder: t,
1057
1057
  onRename: n,
1058
1058
  onFileOpen: s,
1059
1059
  onRefresh: r,
1060
1060
  enableFilePreview: o,
1061
- triggerAction: i
1061
+ triggerAction: a
1062
1062
  }) => {
1063
- const { currentPathFiles: a } = oe(), l = re(null), { activeLayout: c } = ce(), {
1064
- emptySelecCtxItems: f,
1063
+ const { currentPathFiles: i } = oe(), l = re(null), { activeLayout: c } = ce(), {
1064
+ emptySelecCtxItems: u,
1065
1065
  selecCtxItems: h,
1066
- handleContextMenu: u,
1066
+ handleContextMenu: f,
1067
1067
  unselectFiles: w,
1068
- visible: x,
1069
- setVisible: S,
1070
- setLastSelectedFile: D,
1068
+ visible: T,
1069
+ setVisible: R,
1070
+ setLastSelectedFile: O,
1071
1071
  selectedFileIndexes: M,
1072
1072
  clickPosition: C,
1073
- isSelectionCtx: P
1074
- } = Cn(r, o, i), F = ye(() => S(!1));
1073
+ isSelectionCtx: E
1074
+ } = wn(r, o, a), F = ye(() => R(!1));
1075
1075
  return /* @__PURE__ */ g(
1076
1076
  "div",
1077
1077
  {
1078
1078
  ref: l,
1079
1079
  className: `files ${c}`,
1080
- onContextMenu: u,
1080
+ onContextMenu: f,
1081
1081
  onClick: w,
1082
1082
  children: [
1083
- c === "list" && /* @__PURE__ */ e(wn, { unselectFiles: w }),
1084
- (a == null ? void 0 : a.length) > 0 ? /* @__PURE__ */ e(se, { children: a.map((N, m) => /* @__PURE__ */ e(
1085
- vn,
1083
+ c === "list" && /* @__PURE__ */ e(bn, { unselectFiles: w }),
1084
+ (i == null ? void 0 : i.length) > 0 ? /* @__PURE__ */ e(se, { children: i.map((N, m) => /* @__PURE__ */ e(
1085
+ gn,
1086
1086
  {
1087
1087
  index: m,
1088
1088
  file: N,
@@ -1090,32 +1090,32 @@ const Ct = ({ isLoading: t }) => {
1090
1090
  onRename: n,
1091
1091
  onFileOpen: s,
1092
1092
  enableFilePreview: o,
1093
- triggerAction: i,
1093
+ triggerAction: a,
1094
1094
  filesViewRef: l,
1095
1095
  selectedFileIndexes: M,
1096
- handleContextMenu: u,
1097
- setVisible: S,
1098
- setLastSelectedFile: D
1096
+ handleContextMenu: f,
1097
+ setVisible: R,
1098
+ setLastSelectedFile: O
1099
1099
  },
1100
1100
  m
1101
1101
  )) }) : /* @__PURE__ */ e("div", { className: "empty-folder", children: "This folder is empty." }),
1102
1102
  /* @__PURE__ */ e(
1103
- yn,
1103
+ Cn,
1104
1104
  {
1105
1105
  filesViewRef: l,
1106
1106
  contextMenuRef: F.ref,
1107
- menuItems: P ? h : f,
1108
- visible: x,
1109
- setVisible: S,
1107
+ menuItems: E ? h : u,
1108
+ visible: T,
1109
+ setVisible: R,
1110
1110
  clickPosition: C
1111
1111
  }
1112
1112
  )
1113
1113
  ]
1114
1114
  }
1115
1115
  );
1116
- }, Fn = ({ triggerAction: t, onDelete: n }) => {
1117
- const [s, r] = b(""), { selectedFiles: o, setSelectedFiles: i } = le();
1118
- return K(() => {
1116
+ }, kn = ({ triggerAction: t, onDelete: n }) => {
1117
+ const [s, r] = b(""), { selectedFiles: o, setSelectedFiles: a } = le();
1118
+ return V(() => {
1119
1119
  r(() => {
1120
1120
  if (o.length === 1)
1121
1121
  return `Are you sure you want to delete "${o[0].name}"?`;
@@ -1127,24 +1127,24 @@ const Ct = ({ isLoading: t }) => {
1127
1127
  /* @__PURE__ */ g("div", { className: "file-delete-confirm-actions", children: [
1128
1128
  /* @__PURE__ */ e(me, { type: "secondary", onClick: () => t.close(), children: "Cancel" }),
1129
1129
  /* @__PURE__ */ e(me, { type: "danger", onClick: () => {
1130
- n(o), i([]), t.close();
1130
+ n(o), a([]), t.close();
1131
1131
  }, children: "Delete" })
1132
1132
  ] })
1133
1133
  ] });
1134
- }, kn = ({ percent: t = 0, isCanceled: n = !1, isCompleted: s = !1, error: r }) => /* @__PURE__ */ g("div", { role: "progressbar", className: "fm-progress", children: [
1134
+ }, Nn = ({ percent: t = 0, isCanceled: n = !1, isCompleted: s = !1, error: r }) => /* @__PURE__ */ g("div", { role: "progressbar", className: "fm-progress", children: [
1135
1135
  !r && /* @__PURE__ */ e("div", { className: "fm-progress-bar", children: /* @__PURE__ */ e("div", { className: "fm-progress-bar-fill", style: { width: `${t}%` } }) }),
1136
1136
  n ? /* @__PURE__ */ e("span", { className: "fm-upload-canceled", children: "Canceled" }) : r ? /* @__PURE__ */ e("span", { className: "fm-upload-canceled", children: r }) : /* @__PURE__ */ e("div", { className: "fm-progress-status", children: /* @__PURE__ */ e("span", { children: s ? "Completed" : t + "% done" }) })
1137
- ] }), Nn = ({
1137
+ ] }), Pn = ({
1138
1138
  index: t,
1139
1139
  fileData: n,
1140
1140
  setFiles: s,
1141
1141
  setIsUploading: r,
1142
1142
  fileUploadConfig: o,
1143
- onFileUploaded: i,
1144
- handleFileRemove: a
1143
+ onFileUploaded: a,
1144
+ handleFileRemove: i
1145
1145
  }) => {
1146
- var p, T, y, E;
1147
- const [l, c] = b(0), [f, h] = b(!1), [u, w] = b(!1), [x, S] = b(!1), D = Fe(33), M = re(), { onError: C } = ke(), P = (R) => {
1146
+ var p, D, y, P;
1147
+ const [l, c] = b(0), [u, h] = b(!1), [f, w] = b(!1), [T, R] = b(!1), O = Fe(33), M = re(), { onError: C } = ke(), E = (x) => {
1148
1148
  c(0), r((H) => ({
1149
1149
  ...H,
1150
1150
  [t]: !1
@@ -1153,100 +1153,100 @@ const Ct = ({ isLoading: t }) => {
1153
1153
  type: "upload",
1154
1154
  message: "Upload failed.",
1155
1155
  response: {
1156
- status: R.status,
1157
- statusText: R.statusText,
1158
- data: R.response
1156
+ status: x.status,
1157
+ statusText: x.statusText,
1158
+ data: x.response
1159
1159
  }
1160
1160
  };
1161
1161
  s(
1162
- (H) => H.map((I, Y) => t === Y ? {
1162
+ (H) => H.map((I, K) => t === K ? {
1163
1163
  ...I,
1164
1164
  error: j.message
1165
1165
  } : I)
1166
- ), S(!0), C(j, n.file);
1167
- }, F = (R) => {
1168
- if (!R.error)
1166
+ ), R(!0), C(j, n.file);
1167
+ }, F = (x) => {
1168
+ if (!x.error)
1169
1169
  return new Promise((j, H) => {
1170
1170
  const I = new XMLHttpRequest();
1171
- M.current = I, r((V) => ({
1172
- ...V,
1171
+ M.current = I, r((Y) => ({
1172
+ ...Y,
1173
1173
  [t]: !0
1174
- })), I.upload.onprogress = (V) => {
1175
- if (V.lengthComputable) {
1176
- const de = Math.round(V.loaded / V.total * 100);
1174
+ })), I.upload.onprogress = (Y) => {
1175
+ if (Y.lengthComputable) {
1176
+ const de = Math.round(Y.loaded / Y.total * 100);
1177
1177
  c(de);
1178
1178
  }
1179
1179
  }, I.onload = () => {
1180
- r((V) => ({
1181
- ...V,
1180
+ r((Y) => ({
1181
+ ...Y,
1182
1182
  [t]: !1
1183
- })), I.status === 200 || I.status === 201 ? (h(!0), i(I.response), j(I.response)) : (H(I.statusText), P(I));
1183
+ })), I.status === 200 || I.status === 201 ? (h(!0), a(I.response), j(I.response)) : (H(I.statusText), E(I));
1184
1184
  }, I.onerror = () => {
1185
- H(I.statusText), P(I);
1185
+ H(I.statusText), E(I);
1186
1186
  }, I.open("POST", o == null ? void 0 : o.url, !0);
1187
- const Y = o == null ? void 0 : o.headers;
1188
- for (let V in Y)
1189
- I.setRequestHeader(V, Y[V]);
1190
- const te = new FormData(), X = R == null ? void 0 : R.appendData;
1191
- for (let V in X)
1192
- X[V] && te.append(V, X[V]);
1193
- te.append("file", R.file), I.send(te);
1187
+ const K = o == null ? void 0 : o.headers;
1188
+ for (let Y in K)
1189
+ I.setRequestHeader(Y, K[Y]);
1190
+ const Z = new FormData(), X = x == null ? void 0 : x.appendData;
1191
+ for (let Y in X)
1192
+ X[Y] && Z.append(Y, X[Y]);
1193
+ Z.append("file", x.file), I.send(Z);
1194
1194
  });
1195
1195
  };
1196
- K(() => {
1196
+ V(() => {
1197
1197
  M.current || F(n);
1198
1198
  }, []);
1199
1199
  const N = () => {
1200
- M.current && (M.current.abort(), r((R) => ({
1201
- ...R,
1200
+ M.current && (M.current.abort(), r((x) => ({
1201
+ ...x,
1202
1202
  [t]: !1
1203
1203
  })), w(!0), c(0));
1204
1204
  }, m = () => {
1205
1205
  n != null && n.file && (s(
1206
- (R) => R.map((j, H) => t === H ? {
1206
+ (x) => x.map((j, H) => t === H ? {
1207
1207
  ...j,
1208
1208
  error: !1
1209
1209
  } : j)
1210
- ), F({ ...n, error: !1 }), w(!1), S(!1));
1210
+ ), F({ ...n, error: !1 }), w(!1), R(!1));
1211
1211
  };
1212
1212
  return n.removed ? null : /* @__PURE__ */ g("li", { children: [
1213
- /* @__PURE__ */ e("div", { className: "file-icon", children: D[pe((p = n.file) == null ? void 0 : p.name)] ?? /* @__PURE__ */ e(be, { size: 33 }) }),
1213
+ /* @__PURE__ */ e("div", { className: "file-icon", children: O[pe((p = n.file) == null ? void 0 : p.name)] ?? /* @__PURE__ */ e(be, { size: 33 }) }),
1214
1214
  /* @__PURE__ */ g("div", { className: "file", children: [
1215
1215
  /* @__PURE__ */ g("div", { className: "file-details", children: [
1216
1216
  /* @__PURE__ */ g("div", { className: "file-info", children: [
1217
- /* @__PURE__ */ e("span", { className: "file-name text-truncate", title: (T = n.file) == null ? void 0 : T.name, children: (y = n.file) == null ? void 0 : y.name }),
1218
- /* @__PURE__ */ e("span", { className: "file-size", children: Pe((E = n.file) == null ? void 0 : E.size) })
1217
+ /* @__PURE__ */ e("span", { className: "file-name text-truncate", title: (D = n.file) == null ? void 0 : D.name, children: (y = n.file) == null ? void 0 : y.name }),
1218
+ /* @__PURE__ */ e("span", { className: "file-size", children: Pe((P = n.file) == null ? void 0 : P.size) })
1219
1219
  ] }),
1220
- f ? /* @__PURE__ */ e(Yt, { color: "#5c5bb1", title: "Uploaded" }) : u || x ? /* @__PURE__ */ e(Qt, { className: "retry-upload", title: "Retry", onClick: m }) : /* @__PURE__ */ e(
1220
+ u ? /* @__PURE__ */ e(Vt, { title: "Uploaded", className: "upload-success" }) : f || T ? /* @__PURE__ */ e(en, { className: "retry-upload", title: "Retry", onClick: m }) : /* @__PURE__ */ e(
1221
1221
  "div",
1222
1222
  {
1223
1223
  className: "rm-file",
1224
1224
  title: `${n.error ? "Remove" : "Abort Upload"}`,
1225
- onClick: n.error ? () => a(t) : N,
1226
- children: /* @__PURE__ */ e(Jt, {})
1225
+ onClick: n.error ? () => i(t) : N,
1226
+ children: /* @__PURE__ */ e(Zt, {})
1227
1227
  }
1228
1228
  )
1229
1229
  ] }),
1230
1230
  /* @__PURE__ */ e(
1231
- kn,
1231
+ Nn,
1232
1232
  {
1233
1233
  percent: l,
1234
- isCanceled: u,
1235
- isCompleted: f,
1234
+ isCanceled: f,
1235
+ isCompleted: u,
1236
1236
  error: n.error
1237
1237
  }
1238
1238
  )
1239
1239
  ] })
1240
1240
  ] });
1241
- }, Pn = ({
1241
+ }, En = ({
1242
1242
  fileUploadConfig: t,
1243
1243
  maxFileSize: n,
1244
1244
  acceptedFileTypes: s,
1245
1245
  onFileUploading: r,
1246
1246
  onFileUploaded: o
1247
1247
  }) => {
1248
- const [i, a] = b([]), [l, c] = b(!1), [f, h] = b({}), { currentFolder: u, currentPathFiles: w } = oe(), { onError: x } = ke(), S = re(null), D = (m) => {
1249
- m.key === "Enter" && S.current.click();
1248
+ const [a, i] = b([]), [l, c] = b(!1), [u, h] = b({}), { currentFolder: f, currentPathFiles: w } = oe(), { onError: T } = ke(), R = re(null), O = (m) => {
1249
+ m.key === "Enter" && R.current.click();
1250
1250
  }, M = (m) => {
1251
1251
  if (s && !s.includes(pe(m.name)))
1252
1252
  return "File type is not allowed.";
@@ -1256,19 +1256,19 @@ const Ct = ({ isLoading: t }) => {
1256
1256
  if (n && m.size > n) return `Maximum upload size is ${Pe(n, 0)}.`;
1257
1257
  }, C = (m) => {
1258
1258
  if (m = m.filter(
1259
- (p) => !i.some((T) => T.file.name.toLowerCase() === p.name.toLowerCase())
1259
+ (p) => !a.some((D) => D.file.name.toLowerCase() === p.name.toLowerCase())
1260
1260
  ), m.length > 0) {
1261
- const p = m.map((T) => {
1262
- const y = r(T, u), E = M(T);
1263
- return E && x({ type: "upload", message: E }, T), {
1264
- file: T,
1261
+ const p = m.map((D) => {
1262
+ const y = r(D, f), P = M(D);
1263
+ return P && T({ type: "upload", message: P }, D), {
1264
+ file: D,
1265
1265
  appendData: y,
1266
- ...E && { error: E }
1266
+ ...P && { error: P }
1267
1267
  };
1268
1268
  });
1269
- a((T) => [...T, ...p]);
1269
+ i((D) => [...D, ...p]);
1270
1270
  }
1271
- }, P = (m) => {
1271
+ }, E = (m) => {
1272
1272
  m.preventDefault(), c(!1);
1273
1273
  const p = Array.from(m.dataTransfer.files);
1274
1274
  C(p);
@@ -1276,36 +1276,36 @@ const Ct = ({ isLoading: t }) => {
1276
1276
  const p = Array.from(m.target.files);
1277
1277
  C(p);
1278
1278
  }, N = (m) => {
1279
- a((p) => {
1280
- const T = p.map((y, E) => m === E ? {
1279
+ i((p) => {
1280
+ const D = p.map((y, P) => m === P ? {
1281
1281
  ...y,
1282
1282
  removed: !0
1283
1283
  } : y);
1284
- return T.every((y) => !!y.removed) ? [] : T;
1284
+ return D.every((y) => !!y.removed) ? [] : D;
1285
1285
  });
1286
1286
  };
1287
- return /* @__PURE__ */ g("div", { className: `fm-upload-file ${i.length > 0 ? "file-selcted" : ""}`, children: [
1287
+ return /* @__PURE__ */ g("div", { className: `fm-upload-file ${a.length > 0 ? "file-selcted" : ""}`, children: [
1288
1288
  /* @__PURE__ */ g("div", { className: "select-files", children: [
1289
1289
  /* @__PURE__ */ e(
1290
1290
  "div",
1291
1291
  {
1292
1292
  className: `draggable-file-input ${l ? "dragging" : ""}`,
1293
- onDrop: P,
1293
+ onDrop: E,
1294
1294
  onDragOver: (m) => m.preventDefault(),
1295
1295
  onDragEnter: () => c(!0),
1296
1296
  onDragLeave: () => c(!1),
1297
1297
  children: /* @__PURE__ */ g("div", { className: "input-text", children: [
1298
- /* @__PURE__ */ e(Zt, { size: 30 }),
1298
+ /* @__PURE__ */ e(Qt, { size: 30 }),
1299
1299
  /* @__PURE__ */ e("span", { children: "Drag files to upload" })
1300
1300
  ] })
1301
1301
  }
1302
1302
  ),
1303
- /* @__PURE__ */ e("div", { className: "btn-choose-file", children: /* @__PURE__ */ g(me, { padding: "0", onKeyDown: D, children: [
1303
+ /* @__PURE__ */ e("div", { className: "btn-choose-file", children: /* @__PURE__ */ g(me, { padding: "0", onKeyDown: O, children: [
1304
1304
  /* @__PURE__ */ e("label", { htmlFor: "chooseFile", children: "Choose File" }),
1305
1305
  /* @__PURE__ */ e(
1306
1306
  "input",
1307
1307
  {
1308
- ref: S,
1308
+ ref: R,
1309
1309
  type: "file",
1310
1310
  id: "chooseFile",
1311
1311
  className: "choose-file-input",
@@ -1316,17 +1316,17 @@ const Ct = ({ isLoading: t }) => {
1316
1316
  )
1317
1317
  ] }) })
1318
1318
  ] }),
1319
- i.length > 0 && /* @__PURE__ */ g("div", { className: "files-progress", children: [
1320
- /* @__PURE__ */ e("div", { className: "heading", children: Object.values(f).some((m) => m) ? /* @__PURE__ */ g(se, { children: [
1319
+ a.length > 0 && /* @__PURE__ */ g("div", { className: "files-progress", children: [
1320
+ /* @__PURE__ */ e("div", { className: "heading", children: Object.values(u).some((m) => m) ? /* @__PURE__ */ g(se, { children: [
1321
1321
  /* @__PURE__ */ e("h2", { children: "Uploading" }),
1322
- /* @__PURE__ */ e(at, { type: "cylon", color: "black", height: 18, width: 20 })
1322
+ /* @__PURE__ */ e(lt, { type: "cylon", color: "black", height: 18, width: 20 })
1323
1323
  ] }) : /* @__PURE__ */ e("h2", { children: "Completed" }) }),
1324
- /* @__PURE__ */ e("ul", { children: i.map((m, p) => /* @__PURE__ */ e(
1325
- Nn,
1324
+ /* @__PURE__ */ e("ul", { children: a.map((m, p) => /* @__PURE__ */ e(
1325
+ Pn,
1326
1326
  {
1327
1327
  index: p,
1328
1328
  fileData: m,
1329
- setFiles: a,
1329
+ setFiles: i,
1330
1330
  fileUploadConfig: t,
1331
1331
  setIsUploading: h,
1332
1332
  onFileUploaded: o,
@@ -1336,76 +1336,79 @@ const Ct = ({ isLoading: t }) => {
1336
1336
  )) })
1337
1337
  ] })
1338
1338
  ] });
1339
- }, Ge = ["jpg", "jpeg", "png"], Je = ["mp4", "mov", "avi"], Ze = ["mp3", "wav", "m4a"], Qe = ["txt", "pdf"], En = ({ filePreviewPath: t }) => {
1340
- var w;
1341
- const [n, s] = b(!0), [r, o] = b(!1), { selectedFiles: i } = le(), a = Fe(73), l = (w = pe(i[0].name)) == null ? void 0 : w.toLowerCase(), c = `${t}${i[0].path}`, f = () => {
1342
- s(!1), o(!1);
1343
- }, h = () => {
1344
- s(!1), o(!0);
1345
- }, u = () => {
1346
- window.location.href = c;
1339
+ }, Je = ["jpg", "jpeg", "png"], Ze = ["mp4", "mov", "avi"], Qe = ["mp3", "wav", "m4a"], et = ["txt", "pdf"], Rn = ({ filePreviewPath: t, filePreviewComponent: n }) => {
1340
+ var R;
1341
+ const [s, r] = b(!0), [o, a] = b(!1), { selectedFiles: i } = le(), l = Fe(73), c = (R = pe(i[0].name)) == null ? void 0 : R.toLowerCase(), u = `${t}${i[0].path}`, h = $e(
1342
+ () => n == null ? void 0 : n(i[0]),
1343
+ [n]
1344
+ ), f = () => {
1345
+ r(!1), a(!1);
1346
+ }, w = () => {
1347
+ r(!1), a(!0);
1348
+ }, T = () => {
1349
+ window.location.href = u;
1347
1350
  };
1348
- return /* @__PURE__ */ g("section", { className: `file-previewer ${l === "pdf" ? "pdf-previewer" : ""}`, children: [
1349
- r || ![
1350
- ...Ge,
1351
+ return Lt.isValidElement(h) ? h : /* @__PURE__ */ g("section", { className: `file-previewer ${c === "pdf" ? "pdf-previewer" : ""}`, children: [
1352
+ o || ![
1351
1353
  ...Je,
1352
1354
  ...Ze,
1353
- ...Qe
1354
- ].includes(l) && /* @__PURE__ */ g("div", { className: "preview-error", children: [
1355
- /* @__PURE__ */ e("span", { className: "error-icon", children: a[l] ?? /* @__PURE__ */ e(Vt, { size: 73 }) }),
1355
+ ...Qe,
1356
+ ...et
1357
+ ].includes(c) && /* @__PURE__ */ g("div", { className: "preview-error", children: [
1358
+ /* @__PURE__ */ e("span", { className: "error-icon", children: l[c] ?? /* @__PURE__ */ e(Xt, { size: 73 }) }),
1356
1359
  /* @__PURE__ */ e("span", { className: "error-msg", children: "Sorry! Preview is not available for this file." }),
1357
1360
  /* @__PURE__ */ g("div", { className: "file-info", children: [
1358
1361
  /* @__PURE__ */ e("span", { className: "file-name", children: i[0].name }),
1359
1362
  i[0].size && /* @__PURE__ */ e("span", { children: "-" }),
1360
1363
  /* @__PURE__ */ e("span", { className: "file-size", children: Pe(i[0].size) })
1361
1364
  ] }),
1362
- /* @__PURE__ */ e(me, { onClick: u, padding: "0.45rem .9rem", children: /* @__PURE__ */ g("div", { className: "download-btn", children: [
1363
- /* @__PURE__ */ e($e, { size: 18 }),
1365
+ /* @__PURE__ */ e(me, { onClick: T, padding: "0.45rem .9rem", children: /* @__PURE__ */ g("div", { className: "download-btn", children: [
1366
+ /* @__PURE__ */ e(je, { size: 18 }),
1364
1367
  /* @__PURE__ */ e("span", { children: "Download" })
1365
1368
  ] }) })
1366
1369
  ] }),
1367
- Ge.includes(l) && /* @__PURE__ */ g(se, { children: [
1368
- /* @__PURE__ */ e(Ct, { isLoading: n }),
1370
+ Je.includes(c) && /* @__PURE__ */ g(se, { children: [
1371
+ /* @__PURE__ */ e(Ct, { isLoading: s }),
1369
1372
  /* @__PURE__ */ e(
1370
1373
  "img",
1371
1374
  {
1372
- src: c,
1375
+ src: u,
1373
1376
  alt: "Preview Unavailable",
1374
- className: `photo-popup-image ${n ? "img-loading" : ""}`,
1377
+ className: `photo-popup-image ${s ? "img-loading" : ""}`,
1375
1378
  onLoad: f,
1376
- onError: h,
1379
+ onError: w,
1377
1380
  loading: "lazy"
1378
1381
  }
1379
1382
  )
1380
1383
  ] }),
1381
- Je.includes(l) && /* @__PURE__ */ e("video", { src: c, className: "video-preview", controls: !0, autoPlay: !0 }),
1382
- Ze.includes(l) && /* @__PURE__ */ e("audio", { src: c, controls: !0, autoPlay: !0, className: "audio-preview" }),
1383
- Qe.includes(l) && /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(
1384
+ Ze.includes(c) && /* @__PURE__ */ e("video", { src: u, className: "video-preview", controls: !0, autoPlay: !0 }),
1385
+ Qe.includes(c) && /* @__PURE__ */ e("audio", { src: u, controls: !0, autoPlay: !0, className: "audio-preview" }),
1386
+ et.includes(c) && /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(
1384
1387
  "iframe",
1385
1388
  {
1386
- src: c,
1389
+ src: u,
1387
1390
  onLoad: f,
1388
- onError: h,
1391
+ onError: w,
1389
1392
  frameBorder: "0",
1390
- className: `photo-popup-iframe ${n ? "img-loading" : ""}`
1393
+ className: `photo-popup-iframe ${s ? "img-loading" : ""}`
1391
1394
  }
1392
1395
  ) })
1393
1396
  ] });
1394
- }, xe = (t) => t.toLowerCase(), Q = (t, n, s = !1) => {
1395
- const r = re(/* @__PURE__ */ new Set([])), o = lt(() => new Set(t.map((c) => xe(c))), [t]), i = (c) => {
1397
+ }, xe = (t) => t.toLowerCase(), ee = (t, n, s = !1) => {
1398
+ const r = re(/* @__PURE__ */ new Set([])), o = $e(() => new Set(t.map((c) => xe(c))), [t]), a = (c) => {
1396
1399
  if (!c.repeat && (r.current.add(xe(c.key)), o.isSubsetOf(r.current) && !s)) {
1397
1400
  c.preventDefault(), n(c);
1398
1401
  return;
1399
1402
  }
1400
- }, a = (c) => {
1403
+ }, i = (c) => {
1401
1404
  r.current.delete(xe(c.key));
1402
1405
  }, l = () => {
1403
1406
  r.current.clear();
1404
1407
  };
1405
- K(() => (window.addEventListener("keydown", i), window.addEventListener("keyup", a), window.addEventListener("blur", l), () => {
1406
- window.removeEventListener("keydown", i), window.removeEventListener("keyup", a), window.removeEventListener("blur", l);
1408
+ V(() => (window.addEventListener("keydown", a), window.addEventListener("keyup", i), window.addEventListener("blur", l), () => {
1409
+ window.removeEventListener("keydown", a), window.removeEventListener("keyup", i), window.removeEventListener("blur", l);
1407
1410
  }), [o, n, s]);
1408
- }, ee = {
1411
+ }, te = {
1409
1412
  createFolder: ["Alt", "Shift", "N"],
1410
1413
  uploadFiles: ["Control", "U"],
1411
1414
  cut: ["Control", "X"],
@@ -1427,61 +1430,62 @@ const Ct = ({ isLoading: t }) => {
1427
1430
  // Act as Ctrl + Shift + 2 but could cause problems for QWERTZ or DVORAK etc. keyborad layouts.
1428
1431
  refresh: ["F5"],
1429
1432
  clearSelection: ["Escape"]
1430
- }, Rn = (t, n) => {
1431
- const { setClipBoard: s, handleCutCopy: r, handlePasting: o } = Ne(), { currentFolder: i, currentPathFiles: a } = oe(), { setSelectedFiles: l, handleDownload: c } = le(), { setActiveLayout: f } = ce(), h = () => {
1433
+ }, xn = (t, n) => {
1434
+ const { setClipBoard: s, handleCutCopy: r, handlePasting: o } = Ne(), { currentFolder: a, currentPathFiles: i } = oe(), { setSelectedFiles: l, handleDownload: c } = le(), { setActiveLayout: u } = ce(), h = () => {
1432
1435
  t.show("createFolder");
1433
- }, u = () => {
1436
+ }, f = () => {
1434
1437
  t.show("uploadFile");
1435
1438
  }, w = () => {
1436
1439
  r(!0);
1437
- }, x = () => {
1440
+ }, T = () => {
1438
1441
  r(!1);
1439
- }, S = () => {
1440
- o(i);
1441
- }, D = () => {
1442
+ }, R = () => {
1443
+ o(a);
1444
+ }, O = () => {
1442
1445
  t.show("rename");
1443
1446
  }, M = () => {
1444
1447
  c();
1445
1448
  }, C = () => {
1446
1449
  t.show("delete");
1447
- }, P = () => {
1448
- a.length > 0 && l([a[0]]);
1450
+ }, E = () => {
1451
+ i.length > 0 && l([i[0]]);
1449
1452
  }, F = () => {
1450
- a.length > 0 && l([a.at(-1)]);
1453
+ i.length > 0 && l([i.at(-1)]);
1451
1454
  }, N = () => {
1452
- l(a);
1455
+ l(i);
1453
1456
  }, m = () => {
1454
- l((E) => E.length > 0 ? [] : E);
1457
+ l((P) => P.length > 0 ? [] : P);
1455
1458
  }, p = () => {
1456
1459
  fe(n, "onRefresh"), s(null);
1457
- }, T = () => {
1458
- f("grid");
1460
+ }, D = () => {
1461
+ u("grid");
1459
1462
  }, y = () => {
1460
- f("list");
1463
+ u("list");
1461
1464
  };
1462
- Q(ee.createFolder, h, t.isActive), Q(ee.uploadFiles, u, t.isActive), Q(ee.cut, w, t.isActive), Q(ee.copy, x, t.isActive), Q(ee.paste, S, t.isActive), Q(ee.rename, D, t.isActive), Q(ee.download, M, t.isActive), Q(ee.delete, C, t.isActive), Q(ee.jumpToFirst, P, t.isActive), Q(ee.jumpToLast, F, t.isActive), Q(ee.selectAll, N, t.isActive), Q(ee.clearSelection, m, t.isActive), Q(ee.refresh, p, t.isActive), Q(ee.gridLayout, T, t.isActive), Q(ee.listLayout, y, t.isActive);
1463
- }, xn = ({
1465
+ ee(te.createFolder, h, t.isActive), ee(te.uploadFiles, f, t.isActive), ee(te.cut, w, t.isActive), ee(te.copy, T, t.isActive), ee(te.paste, R, t.isActive), ee(te.rename, O, t.isActive), ee(te.download, M, t.isActive), ee(te.delete, C, t.isActive), ee(te.jumpToFirst, E, t.isActive), ee(te.jumpToLast, F, t.isActive), ee(te.selectAll, N, t.isActive), ee(te.clearSelection, m, t.isActive), ee(te.refresh, p, t.isActive), ee(te.gridLayout, D, t.isActive), ee(te.listLayout, y, t.isActive);
1466
+ }, Tn = ({
1464
1467
  fileUploadConfig: t,
1465
1468
  onFileUploading: n,
1466
1469
  onFileUploaded: s,
1467
1470
  onDelete: r,
1468
1471
  onRefresh: o,
1469
- maxFileSize: i,
1470
- filePreviewPath: a,
1471
- acceptedFileTypes: l,
1472
- triggerAction: c
1472
+ maxFileSize: a,
1473
+ filePreviewPath: i,
1474
+ filePreviewComponent: l,
1475
+ acceptedFileTypes: c,
1476
+ triggerAction: u
1473
1477
  }) => {
1474
- const [f, h] = b(null), { selectedFiles: u } = le();
1475
- Rn(c, o);
1476
- const w = {
1478
+ const [h, f] = b(null), { selectedFiles: w } = le();
1479
+ xn(u, o);
1480
+ const T = {
1477
1481
  uploadFile: {
1478
1482
  title: "Upload",
1479
1483
  component: /* @__PURE__ */ e(
1480
- Pn,
1484
+ En,
1481
1485
  {
1482
1486
  fileUploadConfig: t,
1483
- maxFileSize: i,
1484
- acceptedFileTypes: l,
1487
+ maxFileSize: a,
1488
+ acceptedFileTypes: c,
1485
1489
  onFileUploading: n,
1486
1490
  onFileUploaded: s
1487
1491
  }
@@ -1490,66 +1494,72 @@ const Ct = ({ isLoading: t }) => {
1490
1494
  },
1491
1495
  delete: {
1492
1496
  title: "Delete",
1493
- component: /* @__PURE__ */ e(Fn, { triggerAction: c, onDelete: r }),
1497
+ component: /* @__PURE__ */ e(kn, { triggerAction: u, onDelete: r }),
1494
1498
  width: "25%"
1495
1499
  },
1496
1500
  previewFile: {
1497
1501
  title: "Preview",
1498
- component: /* @__PURE__ */ e(En, { filePreviewPath: a }),
1502
+ component: /* @__PURE__ */ e(
1503
+ Rn,
1504
+ {
1505
+ filePreviewPath: i,
1506
+ filePreviewComponent: l
1507
+ }
1508
+ ),
1499
1509
  width: "50%"
1500
1510
  }
1501
1511
  };
1502
- if (K(() => {
1503
- if (c.isActive) {
1504
- const x = c.actionType;
1505
- x === "previewFile" && (w[x].title = (u == null ? void 0 : u.name) ?? "Preview"), h(w[x]);
1512
+ if (V(() => {
1513
+ if (u.isActive) {
1514
+ const R = u.actionType;
1515
+ R === "previewFile" && (T[R].title = (w == null ? void 0 : w.name) ?? "Preview"), f(T[R]);
1506
1516
  } else
1507
- h(null);
1508
- }, [c.isActive]), f)
1517
+ f(null);
1518
+ }, [u.isActive]), h)
1509
1519
  return /* @__PURE__ */ e(
1510
1520
  Tt,
1511
1521
  {
1512
- heading: f.title,
1513
- show: c.isActive,
1514
- setShow: c.close,
1515
- dialogWidth: f.width,
1516
- children: f == null ? void 0 : f.component
1522
+ heading: h.title,
1523
+ show: u.isActive,
1524
+ setShow: u.close,
1525
+ dialogWidth: h.width,
1526
+ children: h == null ? void 0 : h.component
1517
1527
  }
1518
1528
  );
1519
- }, Tn = () => {
1529
+ }, Dn = () => {
1520
1530
  const [t, n] = b(!1), [s, r] = b(null);
1521
1531
  return {
1522
1532
  isActive: t,
1523
1533
  actionType: s,
1524
- show: (a) => {
1525
- n(!0), r(a);
1534
+ show: (i) => {
1535
+ n(!0), r(i);
1526
1536
  },
1527
1537
  close: () => {
1528
1538
  n(!1), r(null);
1529
1539
  }
1530
1540
  };
1531
- }, Dn = (t, n) => {
1532
- const [s, r] = b({ col1: t, col2: n }), [o, i] = b(!1), a = re(null);
1541
+ }, On = (t, n) => {
1542
+ const [s, r] = b({ col1: t, col2: n }), [o, a] = b(!1), i = re(null);
1533
1543
  return {
1534
- containerRef: a,
1544
+ containerRef: i,
1535
1545
  colSizes: s,
1536
1546
  setColSizes: r,
1537
1547
  isDragging: o,
1538
1548
  handleMouseDown: () => {
1539
- i(!0);
1549
+ a(!0);
1540
1550
  },
1541
1551
  handleMouseUp: () => {
1542
- i(!1);
1552
+ a(!1);
1543
1553
  },
1544
1554
  handleMouseMove: (h) => {
1545
1555
  if (!o) return;
1546
1556
  h.preventDefault();
1547
- const w = a.current.getBoundingClientRect(), x = (h.clientX - w.left) / w.width * 100;
1548
- x >= 15 && x <= 60 && r({ col1: x, col2: 100 - x });
1557
+ const w = i.current.getBoundingClientRect(), T = (h.clientX - w.left) / w.width * 100;
1558
+ T >= 15 && T <= 60 && r({ col1: T, col2: 100 - T });
1549
1559
  }
1550
1560
  };
1551
1561
  };
1552
- function On(t) {
1562
+ function Sn(t) {
1553
1563
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1554
1564
  }
1555
1565
  var Ae = { exports: {} };
@@ -1558,103 +1568,103 @@ object-assign
1558
1568
  (c) Sindre Sorhus
1559
1569
  @license MIT
1560
1570
  */
1561
- var Te, et;
1562
- function Sn() {
1563
- if (et) return Te;
1564
- et = 1;
1571
+ var Te, tt;
1572
+ function Mn() {
1573
+ if (tt) return Te;
1574
+ tt = 1;
1565
1575
  var t = Object.getOwnPropertySymbols, n = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
1566
- function r(i) {
1567
- if (i == null)
1576
+ function r(a) {
1577
+ if (a == null)
1568
1578
  throw new TypeError("Object.assign cannot be called with null or undefined");
1569
- return Object(i);
1579
+ return Object(a);
1570
1580
  }
1571
1581
  function o() {
1572
1582
  try {
1573
1583
  if (!Object.assign)
1574
1584
  return !1;
1575
- var i = new String("abc");
1576
- if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
1585
+ var a = new String("abc");
1586
+ if (a[5] = "de", Object.getOwnPropertyNames(a)[0] === "5")
1577
1587
  return !1;
1578
- for (var a = {}, l = 0; l < 10; l++)
1579
- a["_" + String.fromCharCode(l)] = l;
1580
- var c = Object.getOwnPropertyNames(a).map(function(h) {
1581
- return a[h];
1588
+ for (var i = {}, l = 0; l < 10; l++)
1589
+ i["_" + String.fromCharCode(l)] = l;
1590
+ var c = Object.getOwnPropertyNames(i).map(function(h) {
1591
+ return i[h];
1582
1592
  });
1583
1593
  if (c.join("") !== "0123456789")
1584
1594
  return !1;
1585
- var f = {};
1595
+ var u = {};
1586
1596
  return "abcdefghijklmnopqrst".split("").forEach(function(h) {
1587
- f[h] = h;
1588
- }), Object.keys(Object.assign({}, f)).join("") === "abcdefghijklmnopqrst";
1597
+ u[h] = h;
1598
+ }), Object.keys(Object.assign({}, u)).join("") === "abcdefghijklmnopqrst";
1589
1599
  } catch {
1590
1600
  return !1;
1591
1601
  }
1592
1602
  }
1593
- return Te = o() ? Object.assign : function(i, a) {
1594
- for (var l, c = r(i), f, h = 1; h < arguments.length; h++) {
1603
+ return Te = o() ? Object.assign : function(a, i) {
1604
+ for (var l, c = r(a), u, h = 1; h < arguments.length; h++) {
1595
1605
  l = Object(arguments[h]);
1596
- for (var u in l)
1597
- n.call(l, u) && (c[u] = l[u]);
1606
+ for (var f in l)
1607
+ n.call(l, f) && (c[f] = l[f]);
1598
1608
  if (t) {
1599
- f = t(l);
1600
- for (var w = 0; w < f.length; w++)
1601
- s.call(l, f[w]) && (c[f[w]] = l[f[w]]);
1609
+ u = t(l);
1610
+ for (var w = 0; w < u.length; w++)
1611
+ s.call(l, u[w]) && (c[u[w]] = l[u[w]]);
1602
1612
  }
1603
1613
  }
1604
1614
  return c;
1605
1615
  }, Te;
1606
1616
  }
1607
- var De, tt;
1608
- function je() {
1609
- if (tt) return De;
1610
- tt = 1;
1617
+ var De, nt;
1618
+ function ze() {
1619
+ if (nt) return De;
1620
+ nt = 1;
1611
1621
  var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
1612
1622
  return De = t, De;
1613
1623
  }
1614
- var Oe, nt;
1624
+ var Oe, rt;
1615
1625
  function Ot() {
1616
- return nt || (nt = 1, Oe = Function.call.bind(Object.prototype.hasOwnProperty)), Oe;
1626
+ return rt || (rt = 1, Oe = Function.call.bind(Object.prototype.hasOwnProperty)), Oe;
1617
1627
  }
1618
- var Se, rt;
1619
- function Mn() {
1620
- if (rt) return Se;
1621
- rt = 1;
1628
+ var Se, st;
1629
+ function Ln() {
1630
+ if (st) return Se;
1631
+ st = 1;
1622
1632
  var t = function() {
1623
1633
  };
1624
1634
  if (process.env.NODE_ENV !== "production") {
1625
- var n = je(), s = {}, r = Ot();
1626
- t = function(i) {
1627
- var a = "Warning: " + i;
1628
- typeof console < "u" && console.error(a);
1635
+ var n = ze(), s = {}, r = Ot();
1636
+ t = function(a) {
1637
+ var i = "Warning: " + a;
1638
+ typeof console < "u" && console.error(i);
1629
1639
  try {
1630
- throw new Error(a);
1640
+ throw new Error(i);
1631
1641
  } catch {
1632
1642
  }
1633
1643
  };
1634
1644
  }
1635
- function o(i, a, l, c, f) {
1645
+ function o(a, i, l, c, u) {
1636
1646
  if (process.env.NODE_ENV !== "production") {
1637
- for (var h in i)
1638
- if (r(i, h)) {
1639
- var u;
1647
+ for (var h in a)
1648
+ if (r(a, h)) {
1649
+ var f;
1640
1650
  try {
1641
- if (typeof i[h] != "function") {
1651
+ if (typeof a[h] != "function") {
1642
1652
  var w = Error(
1643
- (c || "React class") + ": " + l + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
1653
+ (c || "React class") + ": " + l + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
1644
1654
  );
1645
1655
  throw w.name = "Invariant Violation", w;
1646
1656
  }
1647
- u = i[h](a, h, c, l, null, n);
1648
- } catch (S) {
1649
- u = S;
1657
+ f = a[h](i, h, c, l, null, n);
1658
+ } catch (R) {
1659
+ f = R;
1650
1660
  }
1651
- if (u && !(u instanceof Error) && t(
1652
- (c || "React class") + ": type specification of " + l + " `" + h + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof u + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
1653
- ), u instanceof Error && !(u.message in s)) {
1654
- s[u.message] = !0;
1655
- var x = f ? f() : "";
1661
+ if (f && !(f instanceof Error) && t(
1662
+ (c || "React class") + ": type specification of " + l + " `" + h + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof f + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
1663
+ ), f instanceof Error && !(f.message in s)) {
1664
+ s[f.message] = !0;
1665
+ var T = u ? u() : "";
1656
1666
  t(
1657
- "Failed " + l + " type: " + u.message + (x ?? "")
1667
+ "Failed " + l + " type: " + f.message + (T ?? "")
1658
1668
  );
1659
1669
  }
1660
1670
  }
@@ -1664,13 +1674,13 @@ function Mn() {
1664
1674
  process.env.NODE_ENV !== "production" && (s = {});
1665
1675
  }, Se = o, Se;
1666
1676
  }
1667
- var Me, st;
1668
- function Ln() {
1669
- if (st) return Me;
1670
- st = 1;
1671
- var t = yt, n = Sn(), s = je(), r = Ot(), o = Mn(), i = function() {
1677
+ var Me, ot;
1678
+ function In() {
1679
+ if (ot) return Me;
1680
+ ot = 1;
1681
+ var t = yt, n = Mn(), s = ze(), r = Ot(), o = Ln(), a = function() {
1672
1682
  };
1673
- process.env.NODE_ENV !== "production" && (i = function(l) {
1683
+ process.env.NODE_ENV !== "production" && (a = function(l) {
1674
1684
  var c = "Warning: " + l;
1675
1685
  typeof console < "u" && console.error(c);
1676
1686
  try {
@@ -1678,17 +1688,17 @@ function Ln() {
1678
1688
  } catch {
1679
1689
  }
1680
1690
  });
1681
- function a() {
1691
+ function i() {
1682
1692
  return null;
1683
1693
  }
1684
1694
  return Me = function(l, c) {
1685
- var f = typeof Symbol == "function" && Symbol.iterator, h = "@@iterator";
1686
- function u(d) {
1687
- var v = d && (f && d[f] || d[h]);
1695
+ var u = typeof Symbol == "function" && Symbol.iterator, h = "@@iterator";
1696
+ function f(d) {
1697
+ var v = d && (u && d[u] || d[h]);
1688
1698
  if (typeof v == "function")
1689
1699
  return v;
1690
1700
  }
1691
- var w = "<<anonymous>>", x = {
1701
+ var w = "<<anonymous>>", T = {
1692
1702
  array: C("array"),
1693
1703
  bigint: C("bigint"),
1694
1704
  bool: C("boolean"),
@@ -1697,55 +1707,55 @@ function Ln() {
1697
1707
  object: C("object"),
1698
1708
  string: C("string"),
1699
1709
  symbol: C("symbol"),
1700
- any: P(),
1710
+ any: E(),
1701
1711
  arrayOf: F,
1702
1712
  element: N(),
1703
1713
  elementType: m(),
1704
1714
  instanceOf: p,
1705
- node: R(),
1715
+ node: x(),
1706
1716
  objectOf: y,
1707
- oneOf: T,
1708
- oneOfType: E,
1717
+ oneOf: D,
1718
+ oneOfType: P,
1709
1719
  shape: H,
1710
1720
  exact: I
1711
1721
  };
1712
- function S(d, v) {
1722
+ function R(d, v) {
1713
1723
  return d === v ? d !== 0 || 1 / d === 1 / v : d !== d && v !== v;
1714
1724
  }
1715
- function D(d, v) {
1725
+ function O(d, v) {
1716
1726
  this.message = d, this.data = v && typeof v == "object" ? v : {}, this.stack = "";
1717
1727
  }
1718
- D.prototype = Error.prototype;
1728
+ O.prototype = Error.prototype;
1719
1729
  function M(d) {
1720
1730
  if (process.env.NODE_ENV !== "production")
1721
1731
  var v = {}, $ = 0;
1722
- function A(z, k, L, B, _, U, Z) {
1723
- if (B = B || w, U = U || L, Z !== s) {
1732
+ function A(W, k, L, U, _, q, Q) {
1733
+ if (U = U || w, q = q || L, Q !== s) {
1724
1734
  if (c) {
1725
1735
  var G = new Error(
1726
1736
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
1727
1737
  );
1728
1738
  throw G.name = "Invariant Violation", G;
1729
1739
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
1730
- var ie = B + ":" + L;
1740
+ var ie = U + ":" + L;
1731
1741
  !v[ie] && // Avoid spamming the console because they are often not actionable except for lib authors
1732
- $ < 3 && (i(
1733
- "You are manually calling a React.PropTypes validation function for the `" + U + "` prop on `" + B + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
1742
+ $ < 3 && (a(
1743
+ "You are manually calling a React.PropTypes validation function for the `" + q + "` prop on `" + U + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
1734
1744
  ), v[ie] = !0, $++);
1735
1745
  }
1736
1746
  }
1737
- return k[L] == null ? z ? k[L] === null ? new D("The " + _ + " `" + U + "` is marked as required " + ("in `" + B + "`, but its value is `null`.")) : new D("The " + _ + " `" + U + "` is marked as required in " + ("`" + B + "`, but its value is `undefined`.")) : null : d(k, L, B, _, U);
1747
+ return k[L] == null ? W ? k[L] === null ? new O("The " + _ + " `" + q + "` is marked as required " + ("in `" + U + "`, but its value is `null`.")) : new O("The " + _ + " `" + q + "` is marked as required in " + ("`" + U + "`, but its value is `undefined`.")) : null : d(k, L, U, _, q);
1738
1748
  }
1739
- var O = A.bind(null, !1);
1740
- return O.isRequired = A.bind(null, !0), O;
1749
+ var S = A.bind(null, !1);
1750
+ return S.isRequired = A.bind(null, !0), S;
1741
1751
  }
1742
1752
  function C(d) {
1743
- function v($, A, O, z, k, L) {
1744
- var B = $[A], _ = X(B);
1753
+ function v($, A, S, W, k, L) {
1754
+ var U = $[A], _ = X(U);
1745
1755
  if (_ !== d) {
1746
- var U = V(B);
1747
- return new D(
1748
- "Invalid " + z + " `" + k + "` of type " + ("`" + U + "` supplied to `" + O + "`, expected ") + ("`" + d + "`."),
1756
+ var q = Y(U);
1757
+ return new O(
1758
+ "Invalid " + W + " `" + k + "` of type " + ("`" + q + "` supplied to `" + S + "`, expected ") + ("`" + d + "`."),
1749
1759
  { expectedType: d }
1750
1760
  );
1751
1761
  }
@@ -1753,159 +1763,159 @@ function Ln() {
1753
1763
  }
1754
1764
  return M(v);
1755
1765
  }
1756
- function P() {
1757
- return M(a);
1766
+ function E() {
1767
+ return M(i);
1758
1768
  }
1759
1769
  function F(d) {
1760
- function v($, A, O, z, k) {
1770
+ function v($, A, S, W, k) {
1761
1771
  if (typeof d != "function")
1762
- return new D("Property `" + k + "` of component `" + O + "` has invalid PropType notation inside arrayOf.");
1772
+ return new O("Property `" + k + "` of component `" + S + "` has invalid PropType notation inside arrayOf.");
1763
1773
  var L = $[A];
1764
1774
  if (!Array.isArray(L)) {
1765
- var B = X(L);
1766
- return new D("Invalid " + z + " `" + k + "` of type " + ("`" + B + "` supplied to `" + O + "`, expected an array."));
1775
+ var U = X(L);
1776
+ return new O("Invalid " + W + " `" + k + "` of type " + ("`" + U + "` supplied to `" + S + "`, expected an array."));
1767
1777
  }
1768
1778
  for (var _ = 0; _ < L.length; _++) {
1769
- var U = d(L, _, O, z, k + "[" + _ + "]", s);
1770
- if (U instanceof Error)
1771
- return U;
1779
+ var q = d(L, _, S, W, k + "[" + _ + "]", s);
1780
+ if (q instanceof Error)
1781
+ return q;
1772
1782
  }
1773
1783
  return null;
1774
1784
  }
1775
1785
  return M(v);
1776
1786
  }
1777
1787
  function N() {
1778
- function d(v, $, A, O, z) {
1788
+ function d(v, $, A, S, W) {
1779
1789
  var k = v[$];
1780
1790
  if (!l(k)) {
1781
1791
  var L = X(k);
1782
- return new D("Invalid " + O + " `" + z + "` of type " + ("`" + L + "` supplied to `" + A + "`, expected a single ReactElement."));
1792
+ return new O("Invalid " + S + " `" + W + "` of type " + ("`" + L + "` supplied to `" + A + "`, expected a single ReactElement."));
1783
1793
  }
1784
1794
  return null;
1785
1795
  }
1786
1796
  return M(d);
1787
1797
  }
1788
1798
  function m() {
1789
- function d(v, $, A, O, z) {
1799
+ function d(v, $, A, S, W) {
1790
1800
  var k = v[$];
1791
1801
  if (!t.isValidElementType(k)) {
1792
1802
  var L = X(k);
1793
- return new D("Invalid " + O + " `" + z + "` of type " + ("`" + L + "` supplied to `" + A + "`, expected a single ReactElement type."));
1803
+ return new O("Invalid " + S + " `" + W + "` of type " + ("`" + L + "` supplied to `" + A + "`, expected a single ReactElement type."));
1794
1804
  }
1795
1805
  return null;
1796
1806
  }
1797
1807
  return M(d);
1798
1808
  }
1799
1809
  function p(d) {
1800
- function v($, A, O, z, k) {
1810
+ function v($, A, S, W, k) {
1801
1811
  if (!($[A] instanceof d)) {
1802
- var L = d.name || w, B = Ce($[A]);
1803
- return new D("Invalid " + z + " `" + k + "` of type " + ("`" + B + "` supplied to `" + O + "`, expected ") + ("instance of `" + L + "`."));
1812
+ var L = d.name || w, U = Ce($[A]);
1813
+ return new O("Invalid " + W + " `" + k + "` of type " + ("`" + U + "` supplied to `" + S + "`, expected ") + ("instance of `" + L + "`."));
1804
1814
  }
1805
1815
  return null;
1806
1816
  }
1807
1817
  return M(v);
1808
1818
  }
1809
- function T(d) {
1819
+ function D(d) {
1810
1820
  if (!Array.isArray(d))
1811
- return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
1821
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
1812
1822
  "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
1813
- ) : i("Invalid argument supplied to oneOf, expected an array.")), a;
1814
- function v($, A, O, z, k) {
1815
- for (var L = $[A], B = 0; B < d.length; B++)
1816
- if (S(L, d[B]))
1823
+ ) : a("Invalid argument supplied to oneOf, expected an array.")), i;
1824
+ function v($, A, S, W, k) {
1825
+ for (var L = $[A], U = 0; U < d.length; U++)
1826
+ if (R(L, d[U]))
1817
1827
  return null;
1818
- var _ = JSON.stringify(d, function(Z, G) {
1819
- var ie = V(G);
1828
+ var _ = JSON.stringify(d, function(Q, G) {
1829
+ var ie = Y(G);
1820
1830
  return ie === "symbol" ? String(G) : G;
1821
1831
  });
1822
- return new D("Invalid " + z + " `" + k + "` of value `" + String(L) + "` " + ("supplied to `" + O + "`, expected one of " + _ + "."));
1832
+ return new O("Invalid " + W + " `" + k + "` of value `" + String(L) + "` " + ("supplied to `" + S + "`, expected one of " + _ + "."));
1823
1833
  }
1824
1834
  return M(v);
1825
1835
  }
1826
1836
  function y(d) {
1827
- function v($, A, O, z, k) {
1837
+ function v($, A, S, W, k) {
1828
1838
  if (typeof d != "function")
1829
- return new D("Property `" + k + "` of component `" + O + "` has invalid PropType notation inside objectOf.");
1830
- var L = $[A], B = X(L);
1831
- if (B !== "object")
1832
- return new D("Invalid " + z + " `" + k + "` of type " + ("`" + B + "` supplied to `" + O + "`, expected an object."));
1839
+ return new O("Property `" + k + "` of component `" + S + "` has invalid PropType notation inside objectOf.");
1840
+ var L = $[A], U = X(L);
1841
+ if (U !== "object")
1842
+ return new O("Invalid " + W + " `" + k + "` of type " + ("`" + U + "` supplied to `" + S + "`, expected an object."));
1833
1843
  for (var _ in L)
1834
1844
  if (r(L, _)) {
1835
- var U = d(L, _, O, z, k + "." + _, s);
1836
- if (U instanceof Error)
1837
- return U;
1845
+ var q = d(L, _, S, W, k + "." + _, s);
1846
+ if (q instanceof Error)
1847
+ return q;
1838
1848
  }
1839
1849
  return null;
1840
1850
  }
1841
1851
  return M(v);
1842
1852
  }
1843
- function E(d) {
1853
+ function P(d) {
1844
1854
  if (!Array.isArray(d))
1845
- return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), a;
1855
+ return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), i;
1846
1856
  for (var v = 0; v < d.length; v++) {
1847
1857
  var $ = d[v];
1848
1858
  if (typeof $ != "function")
1849
- return i(
1859
+ return a(
1850
1860
  "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + de($) + " at index " + v + "."
1851
- ), a;
1861
+ ), i;
1852
1862
  }
1853
- function A(O, z, k, L, B) {
1854
- for (var _ = [], U = 0; U < d.length; U++) {
1855
- var Z = d[U], G = Z(O, z, k, L, B, s);
1863
+ function A(S, W, k, L, U) {
1864
+ for (var _ = [], q = 0; q < d.length; q++) {
1865
+ var Q = d[q], G = Q(S, W, k, L, U, s);
1856
1866
  if (G == null)
1857
1867
  return null;
1858
1868
  G.data && r(G.data, "expectedType") && _.push(G.data.expectedType);
1859
1869
  }
1860
1870
  var ie = _.length > 0 ? ", expected one of type [" + _.join(", ") + "]" : "";
1861
- return new D("Invalid " + L + " `" + B + "` supplied to " + ("`" + k + "`" + ie + "."));
1871
+ return new O("Invalid " + L + " `" + U + "` supplied to " + ("`" + k + "`" + ie + "."));
1862
1872
  }
1863
1873
  return M(A);
1864
1874
  }
1865
- function R() {
1866
- function d(v, $, A, O, z) {
1867
- return Y(v[$]) ? null : new D("Invalid " + O + " `" + z + "` supplied to " + ("`" + A + "`, expected a ReactNode."));
1875
+ function x() {
1876
+ function d(v, $, A, S, W) {
1877
+ return K(v[$]) ? null : new O("Invalid " + S + " `" + W + "` supplied to " + ("`" + A + "`, expected a ReactNode."));
1868
1878
  }
1869
1879
  return M(d);
1870
1880
  }
1871
- function j(d, v, $, A, O) {
1872
- return new D(
1873
- (d || "React class") + ": " + v + " type `" + $ + "." + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + O + "`."
1881
+ function j(d, v, $, A, S) {
1882
+ return new O(
1883
+ (d || "React class") + ": " + v + " type `" + $ + "." + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + S + "`."
1874
1884
  );
1875
1885
  }
1876
1886
  function H(d) {
1877
- function v($, A, O, z, k) {
1878
- var L = $[A], B = X(L);
1879
- if (B !== "object")
1880
- return new D("Invalid " + z + " `" + k + "` of type `" + B + "` " + ("supplied to `" + O + "`, expected `object`."));
1887
+ function v($, A, S, W, k) {
1888
+ var L = $[A], U = X(L);
1889
+ if (U !== "object")
1890
+ return new O("Invalid " + W + " `" + k + "` of type `" + U + "` " + ("supplied to `" + S + "`, expected `object`."));
1881
1891
  for (var _ in d) {
1882
- var U = d[_];
1883
- if (typeof U != "function")
1884
- return j(O, z, k, _, V(U));
1885
- var Z = U(L, _, O, z, k + "." + _, s);
1886
- if (Z)
1887
- return Z;
1892
+ var q = d[_];
1893
+ if (typeof q != "function")
1894
+ return j(S, W, k, _, Y(q));
1895
+ var Q = q(L, _, S, W, k + "." + _, s);
1896
+ if (Q)
1897
+ return Q;
1888
1898
  }
1889
1899
  return null;
1890
1900
  }
1891
1901
  return M(v);
1892
1902
  }
1893
1903
  function I(d) {
1894
- function v($, A, O, z, k) {
1895
- var L = $[A], B = X(L);
1896
- if (B !== "object")
1897
- return new D("Invalid " + z + " `" + k + "` of type `" + B + "` " + ("supplied to `" + O + "`, expected `object`."));
1904
+ function v($, A, S, W, k) {
1905
+ var L = $[A], U = X(L);
1906
+ if (U !== "object")
1907
+ return new O("Invalid " + W + " `" + k + "` of type `" + U + "` " + ("supplied to `" + S + "`, expected `object`."));
1898
1908
  var _ = n({}, $[A], d);
1899
- for (var U in _) {
1900
- var Z = d[U];
1901
- if (r(d, U) && typeof Z != "function")
1902
- return j(O, z, k, U, V(Z));
1903
- if (!Z)
1904
- return new D(
1905
- "Invalid " + z + " `" + k + "` key `" + U + "` supplied to `" + O + "`.\nBad object: " + JSON.stringify($[A], null, " ") + `
1909
+ for (var q in _) {
1910
+ var Q = d[q];
1911
+ if (r(d, q) && typeof Q != "function")
1912
+ return j(S, W, k, q, Y(Q));
1913
+ if (!Q)
1914
+ return new O(
1915
+ "Invalid " + W + " `" + k + "` key `" + q + "` supplied to `" + S + "`.\nBad object: " + JSON.stringify($[A], null, " ") + `
1906
1916
  Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
1907
1917
  );
1908
- var G = Z(L, U, O, z, k + "." + U, s);
1918
+ var G = Q(L, q, S, W, k + "." + q, s);
1909
1919
  if (G)
1910
1920
  return G;
1911
1921
  }
@@ -1913,7 +1923,7 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
1913
1923
  }
1914
1924
  return M(v);
1915
1925
  }
1916
- function Y(d) {
1926
+ function K(d) {
1917
1927
  switch (typeof d) {
1918
1928
  case "number":
1919
1929
  case "string":
@@ -1923,20 +1933,20 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
1923
1933
  return !d;
1924
1934
  case "object":
1925
1935
  if (Array.isArray(d))
1926
- return d.every(Y);
1936
+ return d.every(K);
1927
1937
  if (d === null || l(d))
1928
1938
  return !0;
1929
- var v = u(d);
1939
+ var v = f(d);
1930
1940
  if (v) {
1931
1941
  var $ = v.call(d), A;
1932
1942
  if (v !== d.entries) {
1933
1943
  for (; !(A = $.next()).done; )
1934
- if (!Y(A.value))
1944
+ if (!K(A.value))
1935
1945
  return !1;
1936
1946
  } else
1937
1947
  for (; !(A = $.next()).done; ) {
1938
- var O = A.value;
1939
- if (O && !Y(O[1]))
1948
+ var S = A.value;
1949
+ if (S && !K(S[1]))
1940
1950
  return !1;
1941
1951
  }
1942
1952
  } else
@@ -1946,14 +1956,14 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
1946
1956
  return !1;
1947
1957
  }
1948
1958
  }
1949
- function te(d, v) {
1959
+ function Z(d, v) {
1950
1960
  return d === "symbol" ? !0 : v ? v["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && v instanceof Symbol : !1;
1951
1961
  }
1952
1962
  function X(d) {
1953
1963
  var v = typeof d;
1954
- return Array.isArray(d) ? "array" : d instanceof RegExp ? "object" : te(v, d) ? "symbol" : v;
1964
+ return Array.isArray(d) ? "array" : d instanceof RegExp ? "object" : Z(v, d) ? "symbol" : v;
1955
1965
  }
1956
- function V(d) {
1966
+ function Y(d) {
1957
1967
  if (typeof d > "u" || d === null)
1958
1968
  return "" + d;
1959
1969
  var v = X(d);
@@ -1966,7 +1976,7 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
1966
1976
  return v;
1967
1977
  }
1968
1978
  function de(d) {
1969
- var v = V(d);
1979
+ var v = Y(d);
1970
1980
  switch (v) {
1971
1981
  case "array":
1972
1982
  case "object":
@@ -1982,21 +1992,21 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
1982
1992
  function Ce(d) {
1983
1993
  return !d.constructor || !d.constructor.name ? w : d.constructor.name;
1984
1994
  }
1985
- return x.checkPropTypes = o, x.resetWarningCache = o.resetWarningCache, x.PropTypes = x, x;
1995
+ return T.checkPropTypes = o, T.resetWarningCache = o.resetWarningCache, T.PropTypes = T, T;
1986
1996
  }, Me;
1987
1997
  }
1988
- var Le, ot;
1989
- function In() {
1990
- if (ot) return Le;
1991
- ot = 1;
1992
- var t = je();
1998
+ var Le, it;
1999
+ function An() {
2000
+ if (it) return Le;
2001
+ it = 1;
2002
+ var t = ze();
1993
2003
  function n() {
1994
2004
  }
1995
2005
  function s() {
1996
2006
  }
1997
2007
  return s.resetWarningCache = n, Le = function() {
1998
- function r(a, l, c, f, h, u) {
1999
- if (u !== t) {
2008
+ function r(i, l, c, u, h, f) {
2009
+ if (f !== t) {
2000
2010
  var w = new Error(
2001
2011
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
2002
2012
  );
@@ -2007,7 +2017,7 @@ function In() {
2007
2017
  function o() {
2008
2018
  return r;
2009
2019
  }
2010
- var i = {
2020
+ var a = {
2011
2021
  array: r,
2012
2022
  bigint: r,
2013
2023
  bool: r,
@@ -2030,22 +2040,22 @@ function In() {
2030
2040
  checkPropTypes: s,
2031
2041
  resetWarningCache: n
2032
2042
  };
2033
- return i.PropTypes = i, i;
2043
+ return a.PropTypes = a, a;
2034
2044
  }, Le;
2035
2045
  }
2036
2046
  if (process.env.NODE_ENV !== "production") {
2037
- var An = yt, $n = !0;
2038
- Ae.exports = Ln()(An.isElement, $n);
2047
+ var $n = yt, jn = !0;
2048
+ Ae.exports = In()($n.isElement, jn);
2039
2049
  } else
2040
- Ae.exports = In()();
2041
- var jn = Ae.exports;
2042
- const q = /* @__PURE__ */ On(jn), zn = (t, n, s) => {
2050
+ Ae.exports = An()();
2051
+ var zn = Ae.exports;
2052
+ const z = /* @__PURE__ */ Sn(zn), Wn = (t, n, s) => {
2043
2053
  const r = t[n];
2044
2054
  if (r && isNaN(Date.parse(r)))
2045
2055
  return new Error(
2046
2056
  `Invalid prop \`${n}\` supplied to \`${s}\`. Expected a valid date string (ISO 8601) but received \`${r}\`.`
2047
2057
  );
2048
- }, it = (t, n, s) => {
2058
+ }, at = (t, n, s) => {
2049
2059
  const r = t[n];
2050
2060
  try {
2051
2061
  new URL(r);
@@ -2062,137 +2072,141 @@ const q = /* @__PURE__ */ On(jn), zn = (t, n, s) => {
2062
2072
  onCreateFolder: r,
2063
2073
  onFileUploading: o = () => {
2064
2074
  },
2065
- onFileUploaded: i = () => {
2075
+ onFileUploaded: a = () => {
2066
2076
  },
2067
- onPaste: a,
2077
+ onPaste: i,
2068
2078
  onRename: l,
2069
2079
  onDownload: c,
2070
- onDelete: f = () => null,
2080
+ onDelete: u = () => null,
2071
2081
  onLayoutChange: h = () => {
2072
2082
  },
2073
- onRefresh: u,
2083
+ onRefresh: f,
2074
2084
  onFileOpen: w = () => {
2075
2085
  },
2076
- onError: x = () => {
2086
+ onError: T = () => {
2077
2087
  },
2078
- layout: S = "grid",
2079
- enableFilePreview: D = !0,
2088
+ layout: R = "grid",
2089
+ enableFilePreview: O = !0,
2080
2090
  maxFileSize: M,
2081
2091
  filePreviewPath: C,
2082
- acceptedFileTypes: P,
2092
+ acceptedFileTypes: E,
2083
2093
  height: F = "600px",
2084
2094
  width: N = "100%",
2085
- initialPath: m = ""
2095
+ initialPath: m = "",
2096
+ filePreviewComponent: p,
2097
+ primaryColor: D = "#6155b4",
2098
+ fontFamily: y = "Nunito Sans, sans-serif"
2086
2099
  }) => {
2087
- const p = Tn(), { containerRef: T, colSizes: y, isDragging: E, handleMouseMove: R, handleMouseUp: j, handleMouseDown: H } = Dn(20, 80);
2088
- return /* @__PURE__ */ g(
2089
- "main",
2090
- {
2091
- className: "file-explorer",
2092
- onContextMenu: (I) => I.preventDefault(),
2093
- style: { height: F, width: N },
2094
- children: [
2095
- /* @__PURE__ */ e(Ct, { isLoading: s }),
2096
- /* @__PURE__ */ e(nn, { filesData: t, onError: x, children: /* @__PURE__ */ e(rn, { initialPath: m, children: /* @__PURE__ */ e(sn, { onDownload: c, children: /* @__PURE__ */ e(on, { onPaste: a, children: /* @__PURE__ */ g(en, { layout: S, children: [
2097
- /* @__PURE__ */ e(
2098
- an,
2099
- {
2100
- allowCreateFolder: !0,
2101
- allowUploadFile: !0,
2102
- onLayoutChange: h,
2103
- onRefresh: u,
2104
- triggerAction: p
2105
- }
2106
- ),
2107
- /* @__PURE__ */ g(
2108
- "section",
2109
- {
2110
- ref: T,
2111
- onMouseMove: R,
2112
- onMouseUp: j,
2113
- className: "files-container",
2114
- children: [
2115
- /* @__PURE__ */ g("div", { className: "navigation-pane", style: { width: y.col1 + "%" }, children: [
2116
- /* @__PURE__ */ e(cn, {}),
2117
- /* @__PURE__ */ e(
2118
- "div",
2119
- {
2120
- className: `sidebar-resize ${E ? "sidebar-dragging" : ""}`,
2121
- onMouseDown: H
2122
- }
2123
- )
2124
- ] }),
2125
- /* @__PURE__ */ g("div", { className: "folders-preview", style: { width: y.col2 + "%" }, children: [
2126
- /* @__PURE__ */ e(dn, {}),
2127
- /* @__PURE__ */ e(
2128
- bn,
2129
- {
2130
- onCreateFolder: r,
2131
- onRename: l,
2132
- onFileOpen: w,
2133
- onRefresh: u,
2134
- enableFilePreview: D,
2135
- triggerAction: p
2136
- }
2137
- )
2138
- ] })
2139
- ]
2140
- }
2141
- ),
2142
- /* @__PURE__ */ e(
2143
- xn,
2144
- {
2145
- fileUploadConfig: n,
2146
- onFileUploading: o,
2147
- onFileUploaded: i,
2148
- onDelete: f,
2149
- onRefresh: u,
2150
- maxFileSize: M,
2151
- filePreviewPath: C,
2152
- acceptedFileTypes: P,
2153
- triggerAction: p
2154
- }
2155
- )
2156
- ] }) }) }) }) })
2157
- ]
2158
- }
2159
- );
2100
+ const P = Dn(), { containerRef: x, colSizes: j, isDragging: H, handleMouseMove: I, handleMouseUp: K, handleMouseDown: Z } = On(20, 80);
2101
+ return /* @__PURE__ */ g("main", { className: "file-explorer", onContextMenu: (Y) => Y.preventDefault(), style: {
2102
+ "--file-manager-font-family": y,
2103
+ "--file-manager-primary-color": D,
2104
+ height: F,
2105
+ width: N
2106
+ }, children: [
2107
+ /* @__PURE__ */ e(Ct, { isLoading: s }),
2108
+ /* @__PURE__ */ e(rn, { filesData: t, onError: T, children: /* @__PURE__ */ e(sn, { initialPath: m, children: /* @__PURE__ */ e(on, { onDownload: c, children: /* @__PURE__ */ e(an, { onPaste: i, children: /* @__PURE__ */ g(tn, { layout: R, children: [
2109
+ /* @__PURE__ */ e(
2110
+ ln,
2111
+ {
2112
+ allowCreateFolder: !0,
2113
+ allowUploadFile: !0,
2114
+ onLayoutChange: h,
2115
+ onRefresh: f,
2116
+ triggerAction: P
2117
+ }
2118
+ ),
2119
+ /* @__PURE__ */ g(
2120
+ "section",
2121
+ {
2122
+ ref: x,
2123
+ onMouseMove: I,
2124
+ onMouseUp: K,
2125
+ className: "files-container",
2126
+ children: [
2127
+ /* @__PURE__ */ g("div", { className: "navigation-pane", style: { width: j.col1 + "%" }, children: [
2128
+ /* @__PURE__ */ e(dn, {}),
2129
+ /* @__PURE__ */ e(
2130
+ "div",
2131
+ {
2132
+ className: `sidebar-resize ${H ? "sidebar-dragging" : ""}`,
2133
+ onMouseDown: Z
2134
+ }
2135
+ )
2136
+ ] }),
2137
+ /* @__PURE__ */ g("div", { className: "folders-preview", style: { width: j.col2 + "%" }, children: [
2138
+ /* @__PURE__ */ e(un, {}),
2139
+ /* @__PURE__ */ e(
2140
+ Fn,
2141
+ {
2142
+ onCreateFolder: r,
2143
+ onRename: l,
2144
+ onFileOpen: w,
2145
+ onRefresh: f,
2146
+ enableFilePreview: O,
2147
+ triggerAction: P
2148
+ }
2149
+ )
2150
+ ] })
2151
+ ]
2152
+ }
2153
+ ),
2154
+ /* @__PURE__ */ e(
2155
+ Tn,
2156
+ {
2157
+ fileUploadConfig: n,
2158
+ onFileUploading: o,
2159
+ onFileUploaded: a,
2160
+ onDelete: u,
2161
+ onRefresh: f,
2162
+ maxFileSize: M,
2163
+ filePreviewPath: C,
2164
+ filePreviewComponent: p,
2165
+ acceptedFileTypes: E,
2166
+ triggerAction: P
2167
+ }
2168
+ )
2169
+ ] }) }) }) }) })
2170
+ ] });
2160
2171
  };
2161
2172
  St.displayName = "FileManager";
2162
2173
  St.propTypes = {
2163
- files: q.arrayOf(
2164
- q.shape({
2165
- name: q.string.isRequired,
2166
- isDirectory: q.bool.isRequired,
2167
- path: q.string.isRequired,
2168
- updatedAt: zn,
2169
- size: q.number
2174
+ files: z.arrayOf(
2175
+ z.shape({
2176
+ name: z.string.isRequired,
2177
+ isDirectory: z.bool.isRequired,
2178
+ path: z.string.isRequired,
2179
+ updatedAt: Wn,
2180
+ size: z.number
2170
2181
  })
2171
2182
  ).isRequired,
2172
- fileUploadConfig: q.shape({
2173
- url: it,
2174
- headers: q.objectOf(q.string)
2183
+ fileUploadConfig: z.shape({
2184
+ url: at,
2185
+ headers: z.objectOf(z.string)
2175
2186
  }),
2176
- isLoading: q.bool,
2177
- onCreateFolder: q.func,
2178
- onFileUploading: q.func,
2179
- onFileUploaded: q.func,
2180
- onRename: q.func,
2181
- onDelete: q.func,
2182
- onPaste: q.func,
2183
- onDownload: q.func,
2184
- onLayoutChange: q.func,
2185
- onRefresh: q.func,
2186
- onFileOpen: q.func,
2187
- onError: q.func,
2188
- layout: q.oneOf(["grid", "list"]),
2189
- maxFileSize: q.number,
2190
- enableFilePreview: q.bool,
2191
- filePreviewPath: it,
2192
- acceptedFileTypes: q.string,
2193
- height: q.oneOfType([q.string, q.number]),
2194
- width: q.oneOfType([q.string, q.number]),
2195
- initialPath: q.string
2187
+ isLoading: z.bool,
2188
+ onCreateFolder: z.func,
2189
+ onFileUploading: z.func,
2190
+ onFileUploaded: z.func,
2191
+ onRename: z.func,
2192
+ onDelete: z.func,
2193
+ onPaste: z.func,
2194
+ onDownload: z.func,
2195
+ onLayoutChange: z.func,
2196
+ onRefresh: z.func,
2197
+ onFileOpen: z.func,
2198
+ onError: z.func,
2199
+ layout: z.oneOf(["grid", "list"]),
2200
+ maxFileSize: z.number,
2201
+ enableFilePreview: z.bool,
2202
+ filePreviewPath: at,
2203
+ acceptedFileTypes: z.string,
2204
+ height: z.oneOfType([z.string, z.number]),
2205
+ width: z.oneOfType([z.string, z.number]),
2206
+ initialPath: z.string,
2207
+ filePreviewComponent: z.func,
2208
+ primaryColor: z.string,
2209
+ fontFamily: z.string
2196
2210
  };
2197
2211
  export {
2198
2212
  St as FileManager