@emailmaker/filemanager 1.1.85-dev.8 → 1.1.85-dev.9

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.
@@ -4619,12 +4619,17 @@ function $n(e, t) {
4619
4619
  return !!t?.lockedTabs?.includes(e);
4620
4620
  }
4621
4621
  //#endregion
4622
+ //#region packages/file-manager/src/utils/libraryTabRequest.ts
4623
+ function er(e, t, n) {
4624
+ if (t && t !== e) return n(t) ? t : g;
4625
+ }
4626
+ //#endregion
4622
4627
  //#region packages/file-manager/src/hooks/core/context.tsx
4623
- var er = i({
4628
+ var tr = i({
4624
4629
  state: {},
4625
4630
  actions: {},
4626
4631
  options: {}
4627
- }), B = () => o(er), tr = ({ children: e, options: t }) => {
4632
+ }), B = () => o(tr), nr = ({ children: e, options: t }) => {
4628
4633
  let [n, r] = u([]), [i, o] = u([]), [l, d] = u(null), [m, h] = u(t.searchQuery || ""), [_, v] = u(t.sortBySize || "name"), { config: y } = t, b = a((e) => {
4629
4634
  if (e === "gif") {
4630
4635
  let e = y?.features?.enableGif !== !1, t = !y?.enabledTabs || y.enabledTabs.includes("gif");
@@ -4652,31 +4657,30 @@ var er = i({
4652
4657
  ]), [x, S] = u("date"), [C, w] = u("desc"), [T, E] = u([{
4653
4658
  id: "folders",
4654
4659
  name: "Папки"
4655
- }]), [D, O] = u(""), [ee, te] = u(!1), [k, A] = u(g), ne = a((e) => b(e) && !$n(e, y), [y, b]);
4660
+ }]), [D, O] = u(""), [ee, te] = u(!1), [k, A] = u(g), ne = y?.lockedTabs, re = a((e) => b(e) && !$n(e, { lockedTabs: ne }), [ne, b]), ie = y?.activeLibraryItem, [ae, oe] = u(void 0);
4661
+ if (ie !== ae) {
4662
+ oe(ie);
4663
+ let e = er(ae, ie, re);
4664
+ e && A(e);
4665
+ }
4656
4666
  s(() => {
4657
- y?.activeLibraryItem && A && A(ne(y.activeLibraryItem) ? y.activeLibraryItem : g);
4658
- }, [
4659
- y?.activeLibraryItem,
4660
- ne,
4661
- A
4662
- ]), s(() => {
4663
- ne(k) || A(g);
4664
- }, [k, ne]);
4665
- let [re, ie] = u({
4667
+ re(k) || A(g);
4668
+ }, [k, re]);
4669
+ let [se, j] = u({
4666
4670
  current: 1,
4667
4671
  pageSize: 20,
4668
4672
  total: 0
4669
- }), [ae] = f.useForm(), [oe] = f.useForm(), [se] = f.useForm(), [j] = f.useForm(), [ce] = f.useForm(), [le] = f.useForm(), [ue, de] = u(!1), [fe, pe] = u(!1), [me, he] = u(!1), [ge, _e] = u(!1), [ve, ye] = u(!1), [be, xe] = u(!1), [Se, Ce] = u(!1), [we, Te] = u(null), [Ee, De] = u(null), [Oe, ke] = u(null), Ae = (e, t) => {
4673
+ }), [ce] = f.useForm(), [le] = f.useForm(), [ue] = f.useForm(), [de] = f.useForm(), [fe] = f.useForm(), [pe] = f.useForm(), [me, he] = u(!1), [ge, _e] = u(!1), [ve, ye] = u(!1), [be, xe] = u(!1), [Se, Ce] = u(!1), [we, Te] = u(!1), [Ee, De] = u(!1), [Oe, ke] = u(null), [Ae, je] = u(null), [Me, Ne] = u(null), M = (e, t) => {
4670
4674
  E((n) => n.map((n) => n.id === e ? {
4671
4675
  ...n,
4672
4676
  name: t
4673
4677
  } : n));
4674
- }, je = a((e) => {
4675
- ie((t) => ({
4678
+ }, Pe = a((e) => {
4679
+ j((t) => ({
4676
4680
  ...t,
4677
4681
  ...e
4678
4682
  }));
4679
- }, [ie]), Me = c(() => ({
4683
+ }, [j]), Fe = c(() => ({
4680
4684
  folders: n,
4681
4685
  files: i,
4682
4686
  selectedFolder: l,
@@ -4687,56 +4691,56 @@ var er = i({
4687
4691
  pathHistory: T,
4688
4692
  currentMenuFile: D,
4689
4693
  loading: ee,
4690
- pagination: re,
4691
- isModalVisible: ue,
4692
- isUrlModalVisible: fe,
4693
- isRenameModalVisible: me,
4694
- isMoveModalVisible: ge,
4695
- isRenameFolderModalVisible: ve,
4696
- isCopyModalVisible: be,
4697
- isDeleteConfirmVisible: Se,
4698
- form: ae,
4699
- urlForm: oe,
4700
- renameForm: se,
4701
- moveForm: j,
4702
- renameFolderForm: ce,
4703
- copyForm: le,
4704
- fileToRename: we,
4705
- folderToRename: Ee,
4694
+ pagination: se,
4695
+ isModalVisible: me,
4696
+ isUrlModalVisible: ge,
4697
+ isRenameModalVisible: ve,
4698
+ isMoveModalVisible: be,
4699
+ isRenameFolderModalVisible: Se,
4700
+ isCopyModalVisible: we,
4701
+ isDeleteConfirmVisible: Ee,
4702
+ form: ce,
4703
+ urlForm: le,
4704
+ renameForm: ue,
4705
+ moveForm: de,
4706
+ renameFolderForm: fe,
4707
+ copyForm: pe,
4708
+ fileToRename: Oe,
4709
+ folderToRename: Ae,
4706
4710
  activeLibraryItem: k,
4707
4711
  multiSelect: y?.multiSelect ?? !0,
4708
- undoDeletion: Oe
4712
+ undoDeletion: Me
4709
4713
  }), [
4710
4714
  k,
4711
4715
  y?.multiSelect,
4712
- le,
4716
+ pe,
4713
4717
  D,
4714
- we,
4718
+ Oe,
4715
4719
  i,
4716
4720
  n,
4717
- ae,
4721
+ ce,
4722
+ we,
4723
+ Ee,
4724
+ me,
4718
4725
  be,
4719
4726
  Se,
4720
- ue,
4721
- ge,
4722
4727
  ve,
4723
- me,
4724
- fe,
4728
+ ge,
4725
4729
  ee,
4726
- j,
4727
- re,
4728
- T,
4729
- ce,
4730
+ de,
4730
4731
  se,
4732
+ T,
4733
+ fe,
4734
+ ue,
4731
4735
  m,
4732
4736
  l,
4733
4737
  x,
4734
4738
  _,
4735
4739
  C,
4736
- Oe,
4737
- oe,
4738
- Ee
4739
- ]), Ne = c(() => ({
4740
+ Me,
4741
+ le,
4742
+ Ae
4743
+ ]), Ie = c(() => ({
4740
4744
  setFolders: r,
4741
4745
  setFiles: o,
4742
4746
  setSelectedFolder: d,
@@ -4746,34 +4750,34 @@ var er = i({
4746
4750
  setSortOrder: w,
4747
4751
  setPathHistory: E,
4748
4752
  setLoading: te,
4749
- setPagination: je,
4750
- setIsModalVisible: de,
4751
- setIsUrlModalVisible: pe,
4752
- setIsRenameModalVisible: he,
4753
- setIsMoveModalVisible: _e,
4754
- setIsRenameFolderModalVisible: ye,
4755
- setIsCopyModalVisible: xe,
4756
- setIsDeleteConfirmVisible: Ce,
4757
- setFileToRename: Te,
4758
- setFolderToRename: De,
4759
- setUndoDeletion: ke,
4760
- updatePathHistoryOnFolderRename: Ae,
4753
+ setPagination: Pe,
4754
+ setIsModalVisible: he,
4755
+ setIsUrlModalVisible: _e,
4756
+ setIsRenameModalVisible: ye,
4757
+ setIsMoveModalVisible: xe,
4758
+ setIsRenameFolderModalVisible: Ce,
4759
+ setIsCopyModalVisible: Te,
4760
+ setIsDeleteConfirmVisible: De,
4761
+ setFileToRename: ke,
4762
+ setFolderToRename: je,
4763
+ setUndoDeletion: Ne,
4764
+ updatePathHistoryOnFolderRename: M,
4761
4765
  setActiveLibraryItem: (e) => A(b(e) ? e : g),
4762
4766
  setCurrentMenuFile: O
4763
- }), [je, b]), M = c(() => ({
4764
- state: Me,
4765
- actions: Ne,
4767
+ }), [Pe, b]), Le = c(() => ({
4768
+ state: Fe,
4769
+ actions: Ie,
4766
4770
  options: t
4767
4771
  }), [
4768
- Ne,
4772
+ Ie,
4769
4773
  t,
4770
- Me
4774
+ Fe
4771
4775
  ]);
4772
- return /* @__PURE__ */ p(er.Provider, {
4773
- value: M,
4776
+ return /* @__PURE__ */ p(tr.Provider, {
4777
+ value: Le,
4774
4778
  children: e
4775
4779
  });
4776
- }, nr = /* @__PURE__ */ t(((e, t) => {
4780
+ }, rr = /* @__PURE__ */ t(((e, t) => {
4777
4781
  Pe(), (function() {
4778
4782
  var n, r = "Expected a function", i = "__lodash_hash_undefined__", a = "__lodash_placeholder__", o = 1, s = 2, c = 8, l = 16, u = 32, d = 64, f = 128, p = 256, m = 512, h = 1 / 0, g = 9007199254740991, _ = 17976931348623157e292, v = NaN, y = 4294967295, b = y - 1, x = y >>> 1, S = [
4779
4783
  ["ary", f],
@@ -5217,12 +5221,12 @@ var er = i({
5217
5221
  n[++t] = [r, e];
5218
5222
  }), n;
5219
5223
  }
5220
- function B(e, t) {
5224
+ function tr(e, t) {
5221
5225
  return function(n) {
5222
5226
  return e(t(n));
5223
5227
  };
5224
5228
  }
5225
- function tr(e, t) {
5229
+ function B(e, t) {
5226
5230
  for (var n = -1, r = e.length, i = 0, o = []; ++n < r;) {
5227
5231
  var s = e[n];
5228
5232
  (s === t || s === a) && (e[n] = a, o[i++] = n);
@@ -5275,18 +5279,18 @@ var er = i({
5275
5279
  var M = t.Array, Be = t.Date, We = t.Error, rt = t.Function, it = t.Math, N = t.Object, at = t.RegExp, ot = t.String, st = t.TypeError, ct = M.prototype, lt = rt.prototype, ut = N.prototype, dt = t["__core-js_shared__"], ft = lt.toString, P = ut.hasOwnProperty, pt = 0, mt = function() {
5276
5280
  var e = /[^.]+$/.exec(dt && dt.keys && dt.keys.IE_PROTO || "");
5277
5281
  return e ? "Symbol(src)_1." + e : "";
5278
- }(), ht = ut.toString, gt = ft.call(N), _t = $t._, F = at("^" + ft.call(P).replace(Le, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), vt = nn ? t.Buffer : n, yt = t.Symbol, bt = t.Uint8Array, xt = vt ? vt.allocUnsafe : n, St = B(N.getPrototypeOf, N), Ct = N.create, wt = ut.propertyIsEnumerable, Tt = ct.splice, Et = yt ? yt.isConcatSpreadable : n, Dt = yt ? yt.iterator : n, Ot = yt ? yt.toStringTag : n, kt = function() {
5282
+ }(), ht = ut.toString, gt = ft.call(N), _t = $t._, F = at("^" + ft.call(P).replace(Le, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), vt = nn ? t.Buffer : n, yt = t.Symbol, bt = t.Uint8Array, xt = vt ? vt.allocUnsafe : n, St = tr(N.getPrototypeOf, N), Ct = N.create, wt = ut.propertyIsEnumerable, Tt = ct.splice, Et = yt ? yt.isConcatSpreadable : n, Dt = yt ? yt.iterator : n, Ot = yt ? yt.toStringTag : n, kt = function() {
5279
5283
  try {
5280
5284
  var e = Fo(N, "defineProperty");
5281
5285
  return e({}, "", {}), e;
5282
5286
  } catch {}
5283
- }(), At = t.clearTimeout !== $t.clearTimeout && t.clearTimeout, jt = Be && Be.now !== $t.Date.now && Be.now, Mt = t.setTimeout !== $t.setTimeout && t.setTimeout, Nt = it.ceil, Pt = it.floor, Ft = N.getOwnPropertySymbols, It = vt ? vt.isBuffer : n, Lt = t.isFinite, Bt = ct.join, Vt = B(N.keys, N), I = it.max, Ht = it.min, Gt = Be.now, Kt = t.parseInt, qt = it.random, Jt = ct.reverse, Zt = Fo(t, "DataView"), Qt = Fo(t, "Map"), en = Fo(t, "Promise"), tn = Fo(t, "Set"), rn = Fo(t, "WeakMap"), an = Fo(N, "create"), wn = rn && new rn(), Tn = {}, Pn = bs(Zt), ir = bs(Qt), ur = bs(en), dr = bs(tn), mr = bs(rn), hr = yt ? yt.prototype : n, gr = hr ? hr.valueOf : n, _r = hr ? hr.toString : n;
5287
+ }(), At = t.clearTimeout !== $t.clearTimeout && t.clearTimeout, jt = Be && Be.now !== $t.Date.now && Be.now, Mt = t.setTimeout !== $t.setTimeout && t.setTimeout, Nt = it.ceil, Pt = it.floor, Ft = N.getOwnPropertySymbols, It = vt ? vt.isBuffer : n, Lt = t.isFinite, Bt = ct.join, Vt = tr(N.keys, N), I = it.max, Ht = it.min, Gt = Be.now, Kt = t.parseInt, qt = it.random, Jt = ct.reverse, Zt = Fo(t, "DataView"), Qt = Fo(t, "Map"), en = Fo(t, "Promise"), tn = Fo(t, "Set"), rn = Fo(t, "WeakMap"), an = Fo(N, "create"), wn = rn && new rn(), Tn = {}, Pn = bs(Zt), ir = bs(Qt), ur = bs(en), dr = bs(tn), mr = bs(rn), hr = yt ? yt.prototype : n, gr = hr ? hr.valueOf : n, _r = hr ? hr.toString : n;
5284
5288
  function V(e) {
5285
5289
  if (Z(e) && !J(e) && !(e instanceof U)) {
5286
- if (e instanceof yr) return e;
5290
+ if (e instanceof H) return e;
5287
5291
  if (P.call(e, "__wrapped__")) return Ss(e);
5288
5292
  }
5289
- return new yr(e);
5293
+ return new H(e);
5290
5294
  }
5291
5295
  var vr = function() {
5292
5296
  function e() {}
@@ -5298,8 +5302,8 @@ var er = i({
5298
5302
  return e.prototype = n, r;
5299
5303
  };
5300
5304
  }();
5301
- function H() {}
5302
- function yr(e, t) {
5305
+ function yr() {}
5306
+ function H(e, t) {
5303
5307
  this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = n;
5304
5308
  }
5305
5309
  V.templateSettings = {
@@ -5308,15 +5312,15 @@ var er = i({
5308
5312
  interpolate: Ne,
5309
5313
  variable: "",
5310
5314
  imports: { _: V }
5311
- }, V.prototype = H.prototype, V.prototype.constructor = V, yr.prototype = vr(H.prototype), yr.prototype.constructor = yr;
5315
+ }, V.prototype = yr.prototype, V.prototype.constructor = V, H.prototype = vr(yr.prototype), H.prototype.constructor = H;
5312
5316
  function U(e) {
5313
5317
  this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = y, this.__views__ = [];
5314
5318
  }
5315
- function W() {
5319
+ function br() {
5316
5320
  var e = new U(this.__wrapped__);
5317
5321
  return e.__actions__ = Ka(this.__actions__), e.__dir__ = this.__dir__, e.__filtered__ = this.__filtered__, e.__iteratees__ = Ka(this.__iteratees__), e.__takeCount__ = this.__takeCount__, e.__views__ = Ka(this.__views__), e;
5318
5322
  }
5319
- function br() {
5323
+ function W() {
5320
5324
  if (this.__filtered__) {
5321
5325
  var e = new U(this);
5322
5326
  e.__dir__ = -1, e.__filtered__ = !0;
@@ -5341,7 +5345,7 @@ var er = i({
5341
5345
  }
5342
5346
  return m;
5343
5347
  }
5344
- U.prototype = vr(H.prototype), U.prototype.constructor = U;
5348
+ U.prototype = vr(yr.prototype), U.prototype.constructor = U;
5345
5349
  function Sr(e) {
5346
5350
  var t = -1, n = e == null ? 0 : e.length;
5347
5351
  for (this.clear(); ++t < n;) {
@@ -5423,12 +5427,12 @@ var er = i({
5423
5427
  function Rr(e) {
5424
5428
  return No(this, e).has(e);
5425
5429
  }
5426
- function G(e, t) {
5430
+ function zr(e, t) {
5427
5431
  var n = No(this, e), r = n.size;
5428
5432
  return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
5429
5433
  }
5430
- Pr.prototype.clear = Fr, Pr.prototype.delete = Ir, Pr.prototype.get = Lr, Pr.prototype.has = Rr, Pr.prototype.set = G;
5431
- function zr(e) {
5434
+ Pr.prototype.clear = Fr, Pr.prototype.delete = Ir, Pr.prototype.get = Lr, Pr.prototype.has = Rr, Pr.prototype.set = zr;
5435
+ function G(e) {
5432
5436
  var t = -1, n = e == null ? 0 : e.length;
5433
5437
  for (this.__data__ = new Pr(); ++t < n;) this.add(e[t]);
5434
5438
  }
@@ -5438,7 +5442,7 @@ var er = i({
5438
5442
  function Vr(e) {
5439
5443
  return this.__data__.has(e);
5440
5444
  }
5441
- zr.prototype.add = zr.prototype.push = Br, zr.prototype.has = Vr;
5445
+ G.prototype.add = G.prototype.push = Br, G.prototype.has = Vr;
5442
5446
  function Hr(e) {
5443
5447
  var t = this.__data__ = new Or(e);
5444
5448
  this.size = t.size;
@@ -5572,7 +5576,7 @@ var er = i({
5572
5576
  function di(e, t, n, r) {
5573
5577
  var i = -1, a = vn, o = !0, s = e.length, c = [], l = t.length;
5574
5578
  if (!s) return c;
5575
- n && (t = z(t, Vn(n))), r ? (a = yn, o = !1) : t.length >= 200 && (a = Un, o = !1, t = new zr(t));
5579
+ n && (t = z(t, Vn(n))), r ? (a = yn, o = !1) : t.length >= 200 && (a = Un, o = !1, t = new G(t));
5576
5580
  outer: for (; ++i < s;) {
5577
5581
  var u = e[i], d = n == null ? u : n(u);
5578
5582
  if (u = r || u !== 0 ? u : 0, o && d === d) {
@@ -5654,7 +5658,7 @@ var er = i({
5654
5658
  function ji(e, t, r) {
5655
5659
  for (var i = r ? yn : vn, a = e[0].length, o = e.length, s = o, c = M(o), l = Infinity, u = []; s--;) {
5656
5660
  var d = e[s];
5657
- s && t && (d = z(d, Vn(t))), l = Ht(d.length, l), c[s] = !r && (t || a >= 120 && d.length >= 120) ? new zr(s && d) : n;
5661
+ s && t && (d = z(d, Vn(t))), l = Ht(d.length, l), c[s] = !r && (t || a >= 120 && d.length >= 120) ? new G(s && d) : n;
5658
5662
  }
5659
5663
  d = e[0];
5660
5664
  var f = -1, p = c[0];
@@ -5971,7 +5975,7 @@ var er = i({
5971
5975
  else if (a >= 200) {
5972
5976
  var l = t ? null : vo(e);
5973
5977
  if (l) return nr(l);
5974
- o = !1, i = Un, c = new zr();
5978
+ o = !1, i = Un, c = new G();
5975
5979
  } else c = t ? [] : s;
5976
5980
  outer: for (; ++r < a;) {
5977
5981
  var u = e[r], d = t ? t(u) : u;
@@ -6180,7 +6184,7 @@ var er = i({
6180
6184
  var i = ro(e);
6181
6185
  function a() {
6182
6186
  for (var o = arguments.length, s = M(o), c = o, l = Mo(a); c--;) s[c] = arguments[c];
6183
- var u = o < 3 && s[0] !== l && s[o - 1] !== l ? [] : tr(s, l);
6187
+ var u = o < 3 && s[0] !== l && s[o - 1] !== l ? [] : B(s, l);
6184
6188
  return o -= u.length, o < r ? go(e, t, so, a.placeholder, n, s, u, n, n, r - o) : fn(this && this !== $t && this instanceof a ? i : e, this, s);
6185
6189
  }
6186
6190
  return a;
@@ -6200,11 +6204,11 @@ var er = i({
6200
6204
  }
6201
6205
  function oo(e) {
6202
6206
  return Do(function(t) {
6203
- var i = t.length, a = i, o = yr.prototype.thru;
6207
+ var i = t.length, a = i, o = H.prototype.thru;
6204
6208
  for (e && t.reverse(); a--;) {
6205
6209
  var s = t[a];
6206
6210
  if (typeof s != "function") throw new st(r);
6207
- if (o && !l && jo(s) == "wrapper") var l = new yr([], !0);
6211
+ if (o && !l && jo(s) == "wrapper") var l = new H([], !0);
6208
6212
  }
6209
6213
  for (a = l ? a : i; ++a < i;) {
6210
6214
  s = t[a];
@@ -6225,7 +6229,7 @@ var er = i({
6225
6229
  for (var n = arguments.length, o = M(n), s = n; s--;) o[s] = arguments[s];
6226
6230
  if (b) var c = Mo(C), l = Kn(o, c);
6227
6231
  if (i && (o = Wa(o, i, a, b)), u && (o = Ga(o, u, d, b)), n -= l, b && n < g) {
6228
- var f = tr(o, c);
6232
+ var f = B(o, c);
6229
6233
  return go(e, t, so, C.placeholder, r, o, f, p, h, g - n);
6230
6234
  }
6231
6235
  var m = v ? r : this, w = y ? m[e] : e;
@@ -6359,7 +6363,7 @@ var er = i({
6359
6363
  if (c != l && !(s && l > c)) return !1;
6360
6364
  var u = o.get(e), d = o.get(t);
6361
6365
  if (u && d) return u == t && d == e;
6362
- var f = -1, p = !0, m = r & 2 ? new zr() : n;
6366
+ var f = -1, p = !0, m = r & 2 ? new G() : n;
6363
6367
  for (o.set(e, t), o.set(t, e); ++f < c;) {
6364
6368
  var h = e[f], g = t[f];
6365
6369
  if (i) var _ = s ? i(g, h, f, t, e, o) : i(h, g, f, e, t, o);
@@ -6635,9 +6639,9 @@ var er = i({
6635
6639
  var d = t[3];
6636
6640
  if (d) {
6637
6641
  var m = e[3];
6638
- e[3] = m ? Wa(m, d, t[4]) : d, e[4] = m ? tr(e[3], a) : t[4];
6642
+ e[3] = m ? Wa(m, d, t[4]) : d, e[4] = m ? B(e[3], a) : t[4];
6639
6643
  }
6640
- return d = t[5], d && (m = e[5], e[5] = m ? Ga(m, d, t[6]) : d, e[6] = m ? tr(e[5], a) : t[6]), d = t[7], d && (e[7] = d), r & f && (e[8] = e[8] == null ? t[8] : Ht(e[8], t[8])), e[9] ??= t[9], e[0] = t[0], e[1] = i, e;
6644
+ return d = t[5], d && (m = e[5], e[5] = m ? Ga(m, d, t[6]) : d, e[6] = m ? B(e[5], a) : t[6]), d = t[7], d && (e[7] = d), r & f && (e[8] = e[8] == null ? t[8] : Ht(e[8], t[8])), e[9] ??= t[9], e[0] = t[0], e[1] = i, e;
6641
6645
  }
6642
6646
  function os(e) {
6643
6647
  var t = [];
@@ -6723,7 +6727,7 @@ var er = i({
6723
6727
  }
6724
6728
  function Ss(e) {
6725
6729
  if (e instanceof U) return e.clone();
6726
- var t = new yr(e.__wrapped__, e.__chain__);
6730
+ var t = new H(e.__wrapped__, e.__chain__);
6727
6731
  return t.__actions__ = Ka(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t;
6728
6732
  }
6729
6733
  function Cs(e, t, r) {
@@ -6995,7 +6999,7 @@ var er = i({
6995
6999
  func: Fc,
6996
7000
  args: [a],
6997
7001
  thisArg: n
6998
- }), new yr(i, this.__chain__).thru(function(e) {
7002
+ }), new H(i, this.__chain__).thru(function(e) {
6999
7003
  return t && !e.length && e.push(n), e;
7000
7004
  }));
7001
7005
  });
@@ -7003,7 +7007,7 @@ var er = i({
7003
7007
  return Nc(this);
7004
7008
  }
7005
7009
  function Rc() {
7006
- return new yr(this.value(), this.__chain__);
7010
+ return new H(this.value(), this.__chain__);
7007
7011
  }
7008
7012
  function zc() {
7009
7013
  this.__values__ === n && (this.__values__ = Au(this.value()));
@@ -7017,7 +7021,7 @@ var er = i({
7017
7021
  return this;
7018
7022
  }
7019
7023
  function Vc(e) {
7020
- for (var t, r = this; r instanceof H;) {
7024
+ for (var t, r = this; r instanceof yr;) {
7021
7025
  var i = Ss(r);
7022
7026
  i.__index__ = 0, i.__values__ = n, t ? a.__wrapped__ = i : t = i;
7023
7027
  var a = i;
@@ -7033,7 +7037,7 @@ var er = i({
7033
7037
  func: Fc,
7034
7038
  args: [nc],
7035
7039
  thisArg: n
7036
- }), new yr(t, this.__chain__);
7040
+ }), new H(t, this.__chain__);
7037
7041
  }
7038
7042
  return this.thru(nc);
7039
7043
  }
@@ -7149,14 +7153,14 @@ var er = i({
7149
7153
  var bl = K(function(e, t, n) {
7150
7154
  var r = o;
7151
7155
  if (n.length) {
7152
- var i = tr(n, Mo(bl));
7156
+ var i = B(n, Mo(bl));
7153
7157
  r |= u;
7154
7158
  }
7155
7159
  return bo(e, r, t, n, i);
7156
7160
  }), xl = K(function(e, t, n) {
7157
7161
  var r = o | s;
7158
7162
  if (n.length) {
7159
- var i = tr(n, Mo(xl));
7163
+ var i = B(n, Mo(xl));
7160
7164
  r |= u;
7161
7165
  }
7162
7166
  return bo(t, r, e, n, i);
@@ -7257,9 +7261,9 @@ var er = i({
7257
7261
  return fn(e, this, r);
7258
7262
  });
7259
7263
  }), Ml = K(function(e, t) {
7260
- return bo(e, u, n, t, tr(t, Mo(Ml)));
7264
+ return bo(e, u, n, t, B(t, Mo(Ml)));
7261
7265
  }), Nl = K(function(e, t) {
7262
- return bo(e, d, n, t, tr(t, Mo(Nl)));
7266
+ return bo(e, d, n, t, B(t, Mo(Nl)));
7263
7267
  }), Pl = Do(function(e, t) {
7264
7268
  return bo(e, p, n, n, n, t);
7265
7269
  });
@@ -8030,7 +8034,7 @@ var er = i({
8030
8034
  func: Fc,
8031
8035
  args: [d],
8032
8036
  thisArg: n
8033
- }), new yr(g, f);
8037
+ }), new H(g, f);
8034
8038
  }
8035
8039
  return m && h ? e.apply(this, s) : (g = this.thru(d), m ? i ? g.value()[0] : g.value() : g);
8036
8040
  });
@@ -8065,23 +8069,23 @@ var er = i({
8065
8069
  }), Tn[so(n, s).name] = [{
8066
8070
  name: "wrapper",
8067
8071
  func: n
8068
- }], U.prototype.clone = W, U.prototype.reverse = br, U.prototype.value = xr, V.prototype.at = Ic, V.prototype.chain = Lc, V.prototype.commit = Rc, V.prototype.next = zc, V.prototype.plant = Vc, V.prototype.reverse = Hc, V.prototype.toJSON = V.prototype.valueOf = V.prototype.value = Uc, V.prototype.first = V.prototype.head, Dt && (V.prototype[Dt] = Bc), V;
8072
+ }], U.prototype.clone = br, U.prototype.reverse = W, U.prototype.value = xr, V.prototype.at = Ic, V.prototype.chain = Lc, V.prototype.commit = Rc, V.prototype.next = zc, V.prototype.plant = Vc, V.prototype.reverse = Hc, V.prototype.toJSON = V.prototype.valueOf = V.prototype.value = Uc, V.prototype.first = V.prototype.head, Dt && (V.prototype[Dt] = Bc), V;
8069
8073
  })();
8070
8074
  typeof define == "function" && typeof define.amd == "object" && define.amd ? ($t._ = pr, define(function() {
8071
8075
  return pr;
8072
8076
  })) : tn ? ((tn.exports = pr)._ = pr, en._ = pr) : $t._ = pr;
8073
8077
  }).call(e);
8074
- })), rr = (e) => !e || e === "root" || e === "folders" || e === "null" || e === null, ir = (e) => e.parentId === null || e.parentId === "null" || !e.parentId, ar = (e, t) => {
8078
+ })), ir = (e) => !e || e === "root" || e === "folders" || e === "null" || e === null, ar = (e) => e.parentId === null || e.parentId === "null" || !e.parentId, or = (e, t) => {
8075
8079
  let n = Array.isArray(e) ? e : [];
8076
- return rr(t.folderId) ? n.filter(ir) : n.filter((e) => e.parentId === t.folderId);
8077
- }, or = async (e, t, n) => {
8080
+ return ir(t.folderId) ? n.filter(ar) : n.filter((e) => e.parentId === t.folderId);
8081
+ }, sr = async (e, t, n) => {
8078
8082
  if (t?.itemType === "file") return e;
8079
8083
  let r = [];
8080
8084
  if (n) {
8081
8085
  let e = await n({ parentId: t.folderId });
8082
8086
  r = Array.isArray(e) ? e : [];
8083
8087
  } else return e;
8084
- let i = ar(r, t);
8088
+ let i = or(r, t);
8085
8089
  if (t?.search?.trim()) {
8086
8090
  let e = t.search.trim().toLowerCase();
8087
8091
  i = i.filter((t) => t.name?.toLowerCase().includes(e));
@@ -8102,8 +8106,8 @@ var er = i({
8102
8106
  if (t?.itemType === "folder") return a;
8103
8107
  let o = e.filter((e) => !e.isFolder);
8104
8108
  return [...a, ...o];
8105
- }, sr = nr(), cr = (e) => {
8106
- let { state: t, actions: n, options: r } = B(), { searchTerm: i, sortBy: o, sortOrder: c, selectedFolder: u, pagination: d, pathHistory: f } = t, { setSearchTerm: p, setSortBy: m, setSortOrder: h, setPagination: g } = n, _ = e || n.fetchFiles, v = l(null), y = l((0, sr.debounce)((e) => {
8109
+ }, cr = rr(), lr = (e) => {
8110
+ let { state: t, actions: n, options: r } = B(), { searchTerm: i, sortBy: o, sortOrder: c, selectedFolder: u, pagination: d, pathHistory: f } = t, { setSearchTerm: p, setSortBy: m, setSortOrder: h, setPagination: g } = n, _ = e || n.fetchFiles, v = l(null), y = l((0, cr.debounce)((e) => {
8107
8111
  let t = JSON.stringify(e);
8108
8112
  v.current !== t && (v.current = t, _?.(e));
8109
8113
  }, 150)).current, b = a(() => {
@@ -8234,8 +8238,8 @@ var er = i({
8234
8238
  getCurrentQueryParams: x
8235
8239
  }
8236
8240
  };
8237
- }, lr = /* @__PURE__ */ new Map();
8238
- function ur(e) {
8241
+ }, ur = /* @__PURE__ */ new Map();
8242
+ function dr(e) {
8239
8243
  if (e == null) return "";
8240
8244
  try {
8241
8245
  return JSON.stringify(e, Object.keys(e).sort());
@@ -8243,21 +8247,21 @@ function ur(e) {
8243
8247
  return String(e);
8244
8248
  }
8245
8249
  }
8246
- function dr(e) {
8250
+ function fr(e) {
8247
8251
  let t = "id" in e && e.id !== void 0 ? String(e.id) : "unknown", n = "data" in e ? e.data : void 0;
8248
- return `${e.type}:${t}:${ur(n)}`;
8252
+ return `${e.type}:${t}:${dr(n)}`;
8249
8253
  }
8250
- function fr(e, t) {
8254
+ function pr(e, t) {
8251
8255
  if (t <= 0) return;
8252
- let n = dr(e), r = Date.now(), i = lr.get(n);
8256
+ let n = fr(e), r = Date.now(), i = ur.get(n);
8253
8257
  i !== void 0 && r - i < t && (e.visibility = !1);
8254
8258
  }
8255
- function pr(e, t) {
8256
- t <= 0 || lr.set(dr(e), Date.now());
8259
+ function mr(e, t) {
8260
+ t <= 0 || ur.set(fr(e), Date.now());
8257
8261
  }
8258
8262
  //#endregion
8259
8263
  //#region packages/file-manager/src/hooks/notifications/useNotificationsBase.tsx
8260
- var mr = 12e3, hr = () => {
8264
+ var hr = 12e3, gr = () => {
8261
8265
  let { notification: e } = d.useApp(), { options: t } = B(), n = a(async (e) => {
8262
8266
  let n;
8263
8267
  if (t.handleNotify) {
@@ -8292,8 +8296,8 @@ var mr = 12e3, hr = () => {
8292
8296
  r.visibility === void 0 && (r.visibility = !i);
8293
8297
  let a = await n(r);
8294
8298
  typeof a == "object" && (r = a);
8295
- let o = t.config?.notificationDedupeTtlMs ?? mr, s = r.type === "error" && r.notificationDedupe === !0;
8296
- if (s && fr(r, o), r.visibility === !1 || a === !1 || t.config?.showNotifications === !1) return r;
8299
+ let o = t.config?.notificationDedupeTtlMs ?? hr, s = r.type === "error" && r.notificationDedupe === !0;
8300
+ if (s && pr(r, o), r.visibility === !1 || a === !1 || t.config?.showNotifications === !1) return r;
8297
8301
  let c = e[r.type];
8298
8302
  if (typeof c == "function") {
8299
8303
  let { message: e, btn: t, ...n } = r;
@@ -8301,7 +8305,7 @@ var mr = 12e3, hr = () => {
8301
8305
  ...n,
8302
8306
  title: n.title ?? e,
8303
8307
  ...t === void 0 ? {} : { actions: t }
8304
- }), s && pr(r, o);
8308
+ }), s && mr(r, o);
8305
8309
  } else console.warn(`Unknown notification type: ${r.type}`, r);
8306
8310
  } catch (e) {
8307
8311
  console.error(e);
@@ -8334,7 +8338,7 @@ var mr = 12e3, hr = () => {
8334
8338
  },
8335
8339
  notify: r
8336
8340
  }), [r]);
8337
- }, gr = () => d.useApp().message, _r = "a-z A-Z 0-9 . _ -", V = {
8341
+ }, _r = () => d.useApp().message, V = "a-z A-Z 0-9 . _ -", vr = {
8338
8342
  FileNotFound: "File not found or no longer available.",
8339
8343
  FileAlreadyExists: "File with this name already exists.",
8340
8344
  FileInvalidName: "File name is not valid. Allowed characters: {{allowedChars}}",
@@ -8402,27 +8406,27 @@ var mr = 12e3, hr = () => {
8402
8406
  IntegrationError: "Error in external integration.",
8403
8407
  ThirdPartyError: "Error in a third-party service.",
8404
8408
  UnknownError: "An unknown error occurred."
8405
- }, vr = {
8409
+ }, yr = {
8406
8410
  FileTooLarge: "File is too large to upload.",
8407
8411
  PayloadTooLarge: "File is too large to upload."
8408
8412
  }, H = (e, t, n) => {
8409
8413
  if (!e) return;
8410
- let r = V[e];
8414
+ let r = vr[e];
8411
8415
  if (!r) return;
8412
8416
  let i = n?.fileSize ?? "", a = n?.maxSize ?? "";
8413
8417
  if ((e === "FileTooLarge" || e === "PayloadTooLarge") && !(i && a)) {
8414
- let n = vr[e];
8418
+ let n = yr[e];
8415
8419
  return n ? t(n) : t(r, {
8416
8420
  fileSize: "?",
8417
8421
  maxSize: "?"
8418
8422
  });
8419
8423
  }
8420
8424
  return t(r, {
8421
- allowedChars: n?.allowedChars ?? _r,
8425
+ allowedChars: n?.allowedChars ?? V,
8422
8426
  fileSize: i,
8423
8427
  maxSize: a
8424
8428
  });
8425
- }, yr = (e) => {
8429
+ }, U = (e) => {
8426
8430
  if (!e || typeof e != "string") return;
8427
8431
  let t = e.toLowerCase();
8428
8432
  if ((t.includes("maximum number of files") || t.includes("number of files exceeded")) && (t.includes("allowed") || t.includes("received"))) return "BatchItemLimitExceeded";
@@ -8432,8 +8436,8 @@ var mr = 12e3, hr = () => {
8432
8436
  if (t.includes("already exists") || t.includes("уже существует") || t.includes("дубликат")) return "FileAlreadyExists";
8433
8437
  if (t.includes("invalid") && (t.includes("name") || t.includes("имя") || t.includes("назва"))) return "FileInvalidName";
8434
8438
  if (t.includes("type") && (t.includes("not allowed") || t.includes("не поддерживается"))) return "FileTypeNotAllowed";
8435
- }, U = (e) => {
8436
- let t = yr(e);
8439
+ }, br = (e) => {
8440
+ let t = U(e);
8437
8441
  if (t === "AuthorizationFailed") {
8438
8442
  let t = (e || "").toLowerCase();
8439
8443
  if (t.includes("download") || t.includes("url") || t.includes("file_get_contents") || t.includes("failed to download")) return "UploadUrlNotReachable";
@@ -8471,23 +8475,23 @@ var mr = 12e3, hr = () => {
8471
8475
  message: String(e),
8472
8476
  raw: e
8473
8477
  };
8474
- }, br = "File too large ({{size}}). Maximum allowed size: {{maxSize}}", xr = "Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}";
8475
- function Sr(e) {
8478
+ }, xr = "File too large ({{size}}). Maximum allowed size: {{maxSize}}", Sr = "Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}";
8479
+ function Cr(e) {
8476
8480
  let t = e.match(/Allowed:\s*(\d+)/i), n = e.match(/received:\s*(\d+)/i);
8477
8481
  return {
8478
8482
  allowed: t ? parseInt(t[1], 10) : void 0,
8479
8483
  received: n ? parseInt(n[1], 10) : void 0
8480
8484
  };
8481
8485
  }
8482
- var Cr = (e, t, n) => {
8486
+ var wr = (e, t, n) => {
8483
8487
  let r = W(e), i = r?.code;
8484
- if (i === "FileTooLarge" && n?.fileSize != null && n?.maxSize != null) return t(br, {
8488
+ if (i === "FileTooLarge" && n?.fileSize != null && n?.maxSize != null) return t(xr, {
8485
8489
  size: qn(n.fileSize),
8486
8490
  maxSize: qn(n.maxSize)
8487
8491
  });
8488
8492
  if ((i === "BatchItemLimitExceeded" || i === "exceeded_max_files") && r?.message) {
8489
- let { allowed: e, received: n } = Sr(r.message);
8490
- if (e != null && n != null) return t(xr, {
8493
+ let { allowed: e, received: n } = Cr(r.message);
8494
+ if (e != null && n != null) return t(Sr, {
8491
8495
  allowed: e,
8492
8496
  received: n
8493
8497
  });
@@ -8496,28 +8500,28 @@ var Cr = (e, t, n) => {
8496
8500
  fileSize: qn(n.fileSize),
8497
8501
  maxSize: qn(n.maxSize)
8498
8502
  } : void 0) ?? t("Error uploading file");
8499
- }, wr = (e) => W(e)?.code === "path_folder_not_found", Tr = [
8503
+ }, Tr = (e) => W(e)?.code === "path_folder_not_found", Er = [
8500
8504
  "file_get_contents",
8501
8505
  "open stream",
8502
8506
  "failed to open stream",
8503
8507
  "http request failed",
8504
8508
  "curl_error"
8505
8509
  ];
8506
- function Er(e) {
8510
+ function Dr(e) {
8507
8511
  if (!e || e.length > 200) return !1;
8508
8512
  let t = e.toLowerCase();
8509
- return !Tr.some((e) => t.includes(e));
8513
+ return !Er.some((e) => t.includes(e));
8510
8514
  }
8511
- var Dr = (e, t, n) => {
8515
+ var Or = (e, t, n) => {
8512
8516
  if (!e) return t("Error when downloading a file by URL");
8513
- let r = H(U(e?.message) ?? e?.code, t, n);
8517
+ let r = H(br(e?.message) ?? e?.code, t, n);
8514
8518
  if (r) return r;
8515
8519
  let i = e?.message && typeof e.message == "string" ? e.message.trim() : null;
8516
- return i && Er(i) ? i : t("Failed to download file from the URL.");
8517
- }, Or = (e) => Array.isArray(e) ? e.filter((e) => e?.id && e.id !== "folders").map((e) => e.name).filter(Boolean).join("/") : "", kr = (e) => {
8520
+ return i && Dr(i) ? i : t("Failed to download file from the URL.");
8521
+ }, kr = (e) => Array.isArray(e) ? e.filter((e) => e?.id && e.id !== "folders").map((e) => e.name).filter(Boolean).join("/") : "", Ar = (e) => {
8518
8522
  let t = e.split("/").filter(Boolean);
8519
8523
  return t.length <= 1 ? "" : (t.pop(), t.join("/"));
8520
- }, Ar = (e) => {
8524
+ }, jr = (e) => {
8521
8525
  let t = e.trim();
8522
8526
  if (!t) return "";
8523
8527
  let n = t.toLowerCase(), r = [
@@ -8530,10 +8534,10 @@ var Dr = (e, t, n) => {
8530
8534
  if (r.length === 0) return t;
8531
8535
  let i = Math.min(...r);
8532
8536
  return t.slice(0, i).trim() || t;
8533
- }, jr = (e) => {
8537
+ }, Mr = (e) => {
8534
8538
  if (e && typeof e == "object") {
8535
8539
  let t = e, n = t.data?.data?.path_folder ?? t.data?.path_folder;
8536
- if (typeof n == "string" && n.trim()) return Ar(n) || null;
8540
+ if (typeof n == "string" && n.trim()) return jr(n) || null;
8537
8541
  }
8538
8542
  let t = W(e)?.message;
8539
8543
  if (!t) return null;
@@ -8545,7 +8549,7 @@ var Dr = (e, t, n) => {
8545
8549
  "not found:"
8546
8550
  ]) {
8547
8551
  let r = n.indexOf(e);
8548
- if (r >= 0) return Ar(t.slice(r + e.length).trim()) || null;
8552
+ if (r >= 0) return jr(t.slice(r + e.length).trim()) || null;
8549
8553
  }
8550
8554
  for (let e of [
8551
8555
  "not exists ",
@@ -8553,13 +8557,13 @@ var Dr = (e, t, n) => {
8553
8557
  "not found "
8554
8558
  ]) {
8555
8559
  let r = n.indexOf(e);
8556
- if (r >= 0) return Ar(t.slice(r + e.length).trim()) || null;
8560
+ if (r >= 0) return jr(t.slice(r + e.length).trim()) || null;
8557
8561
  }
8558
8562
  return null;
8559
- }, Mr = (e, t) => {
8560
- let n = jr(e);
8561
- return n ? kr(n) : Or(t);
8562
- }, Nr = (e) => Or(e), Pr = async (e) => {
8563
+ }, Nr = (e, t) => {
8564
+ let n = Mr(e);
8565
+ return n ? Ar(n) : kr(t);
8566
+ }, Pr = (e) => kr(e), Fr = async (e) => {
8563
8567
  let { options: t, pathFolder: n, dataProviders: r } = e;
8564
8568
  if (r?.clearCache) {
8565
8569
  await r.clearCache(n || null);
@@ -8574,12 +8578,12 @@ var Dr = (e, t, n) => {
8574
8578
  };
8575
8579
  //#endregion
8576
8580
  //#region packages/file-manager/src/hooks/core/useFolders.ts
8577
- function Fr(e, t) {
8581
+ function Ir(e, t) {
8578
8582
  let n = new Set(t.map((e) => e.id));
8579
8583
  return [...e.filter((e) => e.parentId && !n.has(e.id)), ...t];
8580
8584
  }
8581
- var Ir = () => {
8582
- let { state: e, actions: t, options: r } = B(), { t: i } = zn(), o = hr(), { folders: s, selectedFolder: c, pathHistory: l, form: u, loading: d, isModalVisible: f } = e, { setFolders: p, setLoading: h, setIsModalVisible: g } = t, { dataProviders: _, config: v } = r, y = a((e) => (Array.isArray(e) ? e : []).filter((e) => e && e.id && e.name).map((e) => ({
8585
+ var Lr = () => {
8586
+ let { state: e, actions: t, options: r } = B(), { t: i } = zn(), o = gr(), { folders: s, selectedFolder: c, pathHistory: l, form: u, loading: d, isModalVisible: f } = e, { setFolders: p, setLoading: h, setIsModalVisible: g } = t, { dataProviders: _, config: v } = r, y = a((e) => (Array.isArray(e) ? e : []).filter((e) => e && e.id && e.name).map((e) => ({
8583
8587
  id: e.id,
8584
8588
  name: e.name,
8585
8589
  parentId: e.folderId ? e.folderId : null
@@ -8609,7 +8613,7 @@ var Ir = () => {
8609
8613
  let e = n, t = e.filter((e) => e.id === e.parentId);
8610
8614
  return t.length > 0 && console.warn("Folders with cyclic dependencies detected:", t), e;
8611
8615
  }
8612
- let i = Fr(r, n), a = i.filter((e) => e.id === e.parentId);
8616
+ let i = Ir(r, n), a = i.filter((e) => e.id === e.parentId);
8613
8617
  return a.length > 0 && console.warn("Folders with cyclic dependencies detected:", a), i;
8614
8618
  });
8615
8619
  return;
@@ -8625,9 +8629,9 @@ var Ir = () => {
8625
8629
  console.error("Error loading folders:", t);
8626
8630
  let n = W(t);
8627
8631
  if (!e && (n?.status === 404 || n?.code === "FileNotFound")) {
8628
- let e = Mr(t, l || []);
8632
+ let e = Nr(t, l || []);
8629
8633
  try {
8630
- await Pr({
8634
+ await Fr({
8631
8635
  options: r,
8632
8636
  pathFolder: e,
8633
8637
  dataProviders: r?.dataProviders
@@ -9013,16 +9017,16 @@ var Ir = () => {
9013
9017
  renameFolder: k
9014
9018
  }
9015
9019
  };
9016
- }, Lr = (e) => e.requestId ?? e.id, Rr = () => {
9017
- let { options: e, actions: t } = B(), { dataProviders: n, config: r } = e, { setUndoDeletion: i } = t, { t: o } = zn(), s = hr();
9020
+ }, Rr = (e) => e.requestId ?? e.id, zr = () => {
9021
+ let { options: e, actions: t } = B(), { dataProviders: n, config: r } = e, { setUndoDeletion: i } = t, { t: o } = zn(), s = gr();
9018
9022
  return { deleteItems: a(async ({ items: e, selectedFolder: t, getItemNameById: a, showNotifications: c = !1 }) => {
9019
9023
  let l = 0, u = 0, d = [], f = async (t) => {
9020
9024
  if (n?.deleteItems) try {
9021
9025
  let r = await n.deleteItems(e.map((e) => e.id), { permanent: t }), i = r.detailed;
9022
9026
  if (i) {
9023
- let e = i.filter((e) => e.success), t = i.filter((e) => !e.success), n = t.filter((e) => wr(e.innerException ?? e.error)), r = t.filter((e) => !wr(e.innerException ?? e.error));
9027
+ let e = i.filter((e) => e.success), t = i.filter((e) => !e.success), n = t.filter((e) => Tr(e.innerException ?? e.error)), r = t.filter((e) => !Tr(e.innerException ?? e.error));
9024
9028
  l += e.length + n.length, u += r.length, r.forEach((e) => {
9025
- let t = Lr(e), n = W(e.innerException ?? e.error);
9029
+ let t = Rr(e), n = W(e.innerException ?? e.error);
9026
9030
  d.push({
9027
9031
  itemId: t,
9028
9032
  itemName: a(t),
@@ -9034,7 +9038,7 @@ var Ir = () => {
9034
9038
  if (r.success) l += e.length;
9035
9039
  else {
9036
9040
  let t = r.error;
9037
- if (wr(t)) l += e.length;
9041
+ if (Tr(t)) l += e.length;
9038
9042
  else if (t) {
9039
9043
  u += e.length;
9040
9044
  let n = W(t);
@@ -9043,7 +9047,7 @@ var Ir = () => {
9043
9047
  }
9044
9048
  return;
9045
9049
  } catch (n) {
9046
- if (wr(n)) l += e.length;
9050
+ if (Tr(n)) l += e.length;
9047
9051
  else {
9048
9052
  console.error(t ? "Ошибка при удалении" : "Ошибка при перемещении в корзину", n), u += e.length;
9049
9053
  let r = W(n);
@@ -9093,14 +9097,14 @@ var Ir = () => {
9093
9097
  constructor(t, n, r, i) {
9094
9098
  super(t), this.code = n, this.status = r, this.details = i, this.name = "FileManagerApiError", Error.captureStackTrace && Error.captureStackTrace(this, e);
9095
9099
  }
9096
- }, zr = 8192, Br = /^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i, Vr = /^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;
9097
- function Hr() {
9098
- return typeof window > "u" ? !1 : Br.test(window.location.hostname.toLowerCase());
9100
+ }, Br = 8192, Vr = /^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i, Hr = /^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;
9101
+ function Ur() {
9102
+ return typeof window > "u" ? !1 : Vr.test(window.location.hostname.toLowerCase());
9099
9103
  }
9100
- function Ur(e, t) {
9104
+ function Wr(e, t) {
9101
9105
  let n = e.trim();
9102
9106
  if (!n) throw new G(t("Enter the URL of the image"), "UploadUrlInvalid");
9103
- if (n.length > zr) throw new G(t("URL too long"), "UploadUrlInvalid");
9107
+ if (n.length > Br) throw new G(t("URL too long"), "UploadUrlInvalid");
9104
9108
  let r;
9105
9109
  try {
9106
9110
  r = new URL(n);
@@ -9110,11 +9114,11 @@ function Ur(e, t) {
9110
9114
  let i = r.protocol.toLowerCase();
9111
9115
  if (i !== "http:" && i !== "https:") throw new G(t("Only http and https URLs are supported"), "UploadUrlInvalid");
9112
9116
  let a = r.hostname.toLowerCase();
9113
- if (Br.test(a) && !Hr() || Vr.test(a)) throw new G(t("Private and local URLs are not allowed"), "UploadUrlInvalid");
9117
+ if (Vr.test(a) && !Ur() || Hr.test(a)) throw new G(t("Private and local URLs are not allowed"), "UploadUrlInvalid");
9114
9118
  }
9115
9119
  //#endregion
9116
9120
  //#region packages/file-manager/src/utils/fileFormatUtils.ts
9117
- function Wr(e, t) {
9121
+ function Gr(e, t) {
9118
9122
  if (e?.extension) {
9119
9123
  let t = e.extension.toLowerCase(), n = {
9120
9124
  jpg: {
@@ -9251,58 +9255,58 @@ function Wr(e, t) {
9251
9255
  filerobotFormat: "jpeg"
9252
9256
  };
9253
9257
  }
9254
- var Gr = {
9258
+ var Kr = {
9255
9259
  MAX_SIZE_MB: .48,
9256
9260
  MAX_WIDTH_OR_HEIGHT: 2e3,
9257
9261
  QUALITY: .8
9258
- }, Kr = ["gif", "svg"];
9259
- function qr(e) {
9260
- return !Kr.includes(e);
9262
+ }, qr = ["gif", "svg"];
9263
+ function Jr(e) {
9264
+ return !qr.includes(e);
9261
9265
  }
9262
- function Jr(e, t) {
9266
+ function Yr(e, t) {
9263
9267
  if (e?.compressMaxSize === 0 || e?.compressMaxWidthOrHeight === 0) return !1;
9264
9268
  let n = t?.trim() ?? "";
9265
9269
  return n.startsWith("image/") && n !== "image/gif";
9266
9270
  }
9267
9271
  //#endregion
9268
9272
  //#region packages/cssVars/index.ts
9269
- var Yr = /^(?:ant|vscode|monaco|docs)-/;
9270
- function Xr(e) {
9271
- return Yr.test(e);
9273
+ var Xr = /^(?:ant|vscode|monaco|docs)-/;
9274
+ function Zr(e) {
9275
+ return Xr.test(e);
9272
9276
  }
9273
- function Zr() {
9277
+ function Qr() {
9274
9278
  if (!/^[a-z][a-z0-9]*$/i.test("em")) throw Error("[cssVars] REACT_APP_CSS_VAR_PREFIX=\"em\" is not a valid CSS identifier fragment.");
9275
9279
  return "em";
9276
9280
  }
9277
- var Qr = /* @__PURE__ */ new Set([
9281
+ var $r = /* @__PURE__ */ new Set([
9278
9282
  "animation-opacity",
9279
9283
  "inline-edit-border-radius",
9280
9284
  "separator-border",
9281
9285
  "text-link-decoration"
9282
9286
  ]);
9283
- function $r() {
9284
- return Qr;
9287
+ function ei() {
9288
+ return $r;
9285
9289
  }
9286
- var ei = /* @__PURE__ */ new Set();
9287
- function ti(e, t, n = ei) {
9288
- return !e.startsWith(`${t}-`) && !Xr(e) && !n.has(e);
9290
+ var ti = /* @__PURE__ */ new Set();
9291
+ function ni(e, t, n = ti) {
9292
+ return !e.startsWith(`${t}-`) && !Zr(e) && !n.has(e);
9289
9293
  }
9290
- function ni(e, t) {
9294
+ function ri(e, t) {
9291
9295
  return `--${t}-${e}`;
9292
9296
  }
9293
- function ri(e) {
9294
- let t = Zr();
9295
- return ti(e, t, $r()) ? ni(e, t) : `--${e}`;
9297
+ function ii(e) {
9298
+ let t = Qr();
9299
+ return ni(e, t, ei()) ? ri(e, t) : `--${e}`;
9296
9300
  }
9297
9301
  //#endregion
9298
9302
  //#region packages/file-manager/src/utils/iconCssVars.ts
9299
- function ii(e, t = "g") {
9300
- let n = ri(e).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
9303
+ function ai(e, t = "g") {
9304
+ let n = ii(e).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
9301
9305
  return RegExp(`var\\(${n}\\)`, t);
9302
9306
  }
9303
9307
  //#endregion
9304
9308
  //#region packages/file-manager/src/utils/svgToPng.ts
9305
- function ai(e, t) {
9309
+ function oi(e, t) {
9306
9310
  let { colorHex: n, colorHex2: r, colorHex3: i } = t, a = [
9307
9311
  `--em-icon-grad-1: ${n}`,
9308
9312
  `--em-icon-grad-2: ${r}`,
@@ -9329,10 +9333,10 @@ function ai(e, t) {
9329
9333
  ["icon-grad-1", n],
9330
9334
  ["icon-grad-2", r]
9331
9335
  ];
9332
- for (let [e, t] of s) o = o.replace(ii(e), t);
9336
+ for (let [e, t] of s) o = o.replace(ai(e), t);
9333
9337
  return o = o.replace(/currentColor/g, n), o;
9334
9338
  }
9335
- function oi(e, t) {
9339
+ function si(e, t) {
9336
9340
  let n = e.match(/\swidth="([0-9.]+)(px)?"/i), r = e.match(/\sheight="([0-9.]+)(px)?"/i);
9337
9341
  if (n && r) {
9338
9342
  let e = parseFloat(n[1]), i = parseFloat(r[1]);
@@ -9369,15 +9373,15 @@ function oi(e, t) {
9369
9373
  height: t
9370
9374
  };
9371
9375
  }
9372
- function si(e) {
9376
+ function ci(e) {
9373
9377
  if (!e) return null;
9374
9378
  let t = e.trim();
9375
9379
  if (t.endsWith("%")) return null;
9376
9380
  let n = parseFloat(t.replace(/px$/i, ""));
9377
9381
  return Number.isFinite(n) && n > 0 ? n : null;
9378
9382
  }
9379
- function ci(e) {
9380
- let t = e.match(/<\s*svg\b[\s\S]*?>/i)?.[0] ?? "", n = t.match(/\bwidth\s*=\s*["']([^"']*)["']/i)?.[1], r = t.match(/\bheight\s*=\s*["']([^"']*)["']/i)?.[1], i = si(n), a = si(r);
9383
+ function li(e) {
9384
+ let t = e.match(/<\s*svg\b[\s\S]*?>/i)?.[0] ?? "", n = t.match(/\bwidth\s*=\s*["']([^"']*)["']/i)?.[1], r = t.match(/\bheight\s*=\s*["']([^"']*)["']/i)?.[1], i = ci(n), a = ci(r);
9381
9385
  if (i != null && a != null) return {
9382
9386
  width: i,
9383
9387
  height: a
@@ -9404,8 +9408,8 @@ function ci(e) {
9404
9408
  height: i
9405
9409
  };
9406
9410
  }
9407
- function li(e, t = 2, n = 4096) {
9408
- let { width: r, height: i } = ci(e), a = Math.max(1, Math.round(r * t)), o = Math.max(1, Math.round(i * t)), s = Math.max(64, n), c = Math.max(a, o);
9411
+ function ui(e, t = 2, n = 4096) {
9412
+ let { width: r, height: i } = li(e), a = Math.max(1, Math.round(r * t)), o = Math.max(1, Math.round(i * t)), s = Math.max(64, n), c = Math.max(a, o);
9409
9413
  if (c > s) {
9410
9414
  let e = s / c;
9411
9415
  a = Math.max(1, Math.round(a * e)), o = Math.max(1, Math.round(o * e));
@@ -9415,20 +9419,20 @@ function li(e, t = 2, n = 4096) {
9415
9419
  height: o
9416
9420
  };
9417
9421
  }
9418
- function ui(e) {
9422
+ function di(e) {
9419
9423
  return new Promise((t, n) => {
9420
9424
  e.toBlob((e) => {
9421
9425
  e ? t(e) : n(/* @__PURE__ */ Error("canvas.toBlob returned null"));
9422
9426
  }, "image/png");
9423
9427
  });
9424
9428
  }
9425
- function di(e) {
9429
+ function fi(e) {
9426
9430
  return new Promise((t, n) => {
9427
9431
  let r = new FileReader();
9428
9432
  r.onload = () => t(r.result), r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("readAsDataURL failed")), r.readAsDataURL(e);
9429
9433
  });
9430
9434
  }
9431
- async function fi(e, t, n, r, i) {
9435
+ async function pi(e, t, n, r, i) {
9432
9436
  let a = i?.canvasScale ?? 2, o = r == null || r === "" || r.toLowerCase() === "transparent", s = new Blob([e], { type: "image/svg+xml;charset=utf-8" }), c = URL.createObjectURL(s);
9433
9437
  try {
9434
9438
  let e = new Image();
@@ -9439,25 +9443,25 @@ async function fi(e, t, n, r, i) {
9439
9443
  i.width = s, i.height = l;
9440
9444
  let u = i.getContext("2d");
9441
9445
  if (!u) throw Error("Canvas 2D context is not available");
9442
- return u.clearRect(0, 0, s, l), o || (u.fillStyle = r, u.fillRect(0, 0, s, l)), u.drawImage(e, 0, 0, s, l), ui(i);
9446
+ return u.clearRect(0, 0, s, l), o || (u.fillStyle = r, u.fillRect(0, 0, s, l)), u.drawImage(e, 0, 0, s, l), di(i);
9443
9447
  } finally {
9444
9448
  URL.revokeObjectURL(c);
9445
9449
  }
9446
9450
  }
9447
- async function pi(e, t, n, r, i) {
9448
- return di(await fi(e, t, n, r, i));
9451
+ async function mi(e, t, n, r, i) {
9452
+ return fi(await pi(e, t, n, r, i));
9449
9453
  }
9450
- var mi = 24e3;
9451
- async function hi(e, t = mi) {
9454
+ var hi = 24e3;
9455
+ async function gi(e, t = hi) {
9452
9456
  let n = Math.min(t, Math.max(0, e.size));
9453
9457
  return e.slice(0, n).text();
9454
9458
  }
9455
- function gi(e) {
9459
+ function _i(e) {
9456
9460
  let t = e.trimStart().replace(/^\uFEFF/, "");
9457
9461
  return t.startsWith("<") ? /<\s*svg[\s>/]/i.test(t) : !1;
9458
9462
  }
9459
- async function _i(e, t = {}) {
9460
- let n = t.pixelScale ?? 2, r = t.maxLongEdge ?? 4096, i = await e.text(), { width: a, height: o } = li(i, n, r), s = await fi(i, a, o, void 0, { canvasScale: 1 }), c = t.outputFileName ?? e.name, l = /\.svg$/i.test(c) ? c.replace(/\.svg$/i, ".png") : `${c}.png`;
9463
+ async function vi(e, t = {}) {
9464
+ let n = t.pixelScale ?? 2, r = t.maxLongEdge ?? 4096, i = await e.text(), { width: a, height: o } = ui(i, n, r), s = await pi(i, a, o, void 0, { canvasScale: 1 }), c = t.outputFileName ?? e.name, l = /\.svg$/i.test(c) ? c.replace(/\.svg$/i, ".png") : `${c}.png`;
9461
9465
  return new File([s], l, {
9462
9466
  type: "image/png",
9463
9467
  lastModified: e.lastModified
@@ -9465,39 +9469,39 @@ async function _i(e, t = {}) {
9465
9469
  }
9466
9470
  //#endregion
9467
9471
  //#region packages/file-manager/src/utils/imageCompression.ts
9468
- function vi(e, t, n, r) {
9472
+ function yi(e, t, n, r) {
9469
9473
  return new File([e], t, {
9470
9474
  type: n,
9471
9475
  lastModified: r
9472
9476
  });
9473
9477
  }
9474
- function yi(e, t) {
9475
- return !t || t === e.name ? e : vi(e, t, e.type, e.lastModified);
9478
+ function bi(e, t) {
9479
+ return !t || t === e.name ? e : yi(e, t, e.type, e.lastModified);
9476
9480
  }
9477
- function bi(e, t, n, r) {
9481
+ function xi(e, t, n, r) {
9478
9482
  let i = r ?? t.name;
9479
- return e instanceof File && e.type === n && e.lastModified === t.lastModified && e.name === i ? e : vi(e, i, n, t.lastModified);
9483
+ return e instanceof File && e.type === n && e.lastModified === t.lastModified && e.name === i ? e : yi(e, i, n, t.lastModified);
9480
9484
  }
9481
- function xi(e, t) {
9485
+ function Si(e, t) {
9482
9486
  let n = t.startsWith(".") ? t.slice(1) : t, r = e.lastIndexOf(".");
9483
9487
  return r > 0 ? `${e.substring(0, r)}.${n}` : `${e}.${n}`;
9484
9488
  }
9485
- function Si(e) {
9489
+ function Ci(e) {
9486
9490
  return e === "image/webp" ? "image/jpeg" : e;
9487
9491
  }
9488
- async function Ci(e, t = {}) {
9489
- let { maxSizeMB: n = Gr.MAX_SIZE_MB, maxWidthOrHeight: r = Gr.MAX_WIDTH_OR_HEIGHT, mimeType: i, fileName: a, libURL: o, enableCompression: s = !0, convertSvgToPng: c = !1 } = t;
9492
+ async function wi(e, t = {}) {
9493
+ let { maxSizeMB: n = Kr.MAX_SIZE_MB, maxWidthOrHeight: r = Kr.MAX_WIDTH_OR_HEIGHT, mimeType: i, fileName: a, libURL: o, enableCompression: s = !0, convertSvgToPng: c = !1 } = t;
9490
9494
  if (!e || !(e instanceof File)) return e;
9491
9495
  let l = e, u = !1;
9492
9496
  if (c) {
9493
9497
  let t = (l.type || "").toLowerCase(), n = /\.svg$/i.test(l.name.trim()), i = t.includes("svg"), o = !1;
9494
9498
  if (!i && !n) try {
9495
- o = gi(await hi(l));
9499
+ o = _i(await gi(l));
9496
9500
  } catch {
9497
9501
  o = !1;
9498
9502
  }
9499
9503
  if (i || n || o) try {
9500
- l = await _i(l, {
9504
+ l = await vi(l, {
9501
9505
  maxLongEdge: r,
9502
9506
  outputFileName: a ?? l.name
9503
9507
  }), u = !0;
@@ -9507,9 +9511,9 @@ async function Ci(e, t = {}) {
9507
9511
  }
9508
9512
  if (u) return l;
9509
9513
  let d = ae((l.type && l.type.trim() !== "" ? l.type : ce(l.name)) || i || "image/jpeg");
9510
- if (!d.startsWith("image/")) return yi(l, a);
9511
- let f = Si(d), p = j(d), m = j(f), g = f === d ? a ?? l.name : xi(a ?? l.name, m), _ = s && qr(p);
9512
- if (!_ && f === d) return yi(l, g);
9514
+ if (!d.startsWith("image/")) return bi(l, a);
9515
+ let f = Ci(d), p = j(d), m = j(f), g = f === d ? a ?? l.name : Si(a ?? l.name, m), _ = s && Jr(p);
9516
+ if (!_ && f === d) return bi(l, g);
9513
9517
  try {
9514
9518
  let t = {
9515
9519
  libURL: o,
@@ -9518,19 +9522,41 @@ async function Ci(e, t = {}) {
9518
9522
  };
9519
9523
  _ ? (t.maxSizeMB = n, t.maxWidthOrHeight = r) : (t.maxSizeMB = Math.max(e.size / 1048576 + 1, 1), t.initialQuality = 1, t.alwaysKeepResolution = !0);
9520
9524
  let i = await h(l, t), a = ae(i.type || f);
9521
- return bi(i, l, a, g);
9525
+ return xi(i, l, a, g);
9522
9526
  } catch (e) {
9523
9527
  console.error("prepareImageForUpload failed", e);
9524
9528
  try {
9525
- return yi(l, g);
9529
+ return bi(l, g);
9526
9530
  } catch (e) {
9527
9531
  return console.error("Failed to create File with normalized name after image preparation error", e), l;
9528
9532
  }
9529
9533
  }
9530
9534
  }
9535
+ var Ti = ["image/png", "image/jpeg"];
9536
+ async function Ei(e) {
9537
+ if (typeof createImageBitmap != "function") return null;
9538
+ try {
9539
+ let t = await createImageBitmap(e), n = Math.max(t.width, t.height);
9540
+ return t.close(), n;
9541
+ } catch {
9542
+ return null;
9543
+ }
9544
+ }
9545
+ async function Di(e, t = {}) {
9546
+ let n = t.maxWidthOrHeight ?? Kr.MAX_WIDTH_OR_HEIGHT, r = ae(t.mimeType || e.type || "");
9547
+ if (Ti.includes(r)) {
9548
+ let r = await Ei(e);
9549
+ if (t.enableCompression === !1 || r !== null && r <= n) return bi(e, t.fileName);
9550
+ }
9551
+ return wi(e, {
9552
+ ...t,
9553
+ maxWidthOrHeight: n,
9554
+ maxSizeMB: Infinity
9555
+ });
9556
+ }
9531
9557
  //#endregion
9532
9558
  //#region packages/file-manager/src/utils/resolveItemMeta.ts
9533
- async function wi(e) {
9559
+ async function Oi(e) {
9534
9560
  let { folderId: t, dataProviders: n, folders: r, pathHistory: i, t: a } = e, o = t == null ? "" : String(t);
9535
9561
  if (!o || o === "folders") return a("Folders");
9536
9562
  if (o === "Trash") return a("Trash");
@@ -9548,10 +9574,10 @@ async function wi(e) {
9548
9574
  }
9549
9575
  //#endregion
9550
9576
  //#region packages/file-manager/src/utils/fileExtensions.ts
9551
- function Ti(e) {
9552
- return Ei(e).extension !== void 0;
9577
+ function ki(e) {
9578
+ return Ai(e).extension !== void 0;
9553
9579
  }
9554
- function Ei(e) {
9580
+ function Ai(e) {
9555
9581
  let t = e.lastIndexOf(".");
9556
9582
  if (t <= 0) return { base: e };
9557
9583
  let n = e.slice(t + 1).toLowerCase();
@@ -9562,38 +9588,38 @@ function Ei(e) {
9562
9588
  }
9563
9589
  //#endregion
9564
9590
  //#region packages/file-manager/src/utils/urlNormalization.ts
9565
- var Di = /^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;
9566
- function Oi(e) {
9591
+ var ji = /^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;
9592
+ function Mi(e) {
9567
9593
  try {
9568
9594
  return decodeURIComponent(e.replace(/\+/g, " "));
9569
9595
  } catch {
9570
9596
  return e;
9571
9597
  }
9572
9598
  }
9573
- function ki(e) {
9599
+ function Ni(e) {
9574
9600
  let t = new URL(e.trim());
9575
9601
  t.hash = "", t.hostname = t.hostname.toLowerCase(), (t.protocol === "https:" && t.port === "443" || t.protocol === "http:" && t.port === "80") && (t.port = "");
9576
9602
  let n = (t.search.startsWith("?") ? t.search.slice(1) : t.search).split("&").filter(Boolean).map((e) => {
9577
9603
  let t = e.indexOf("="), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1);
9578
9604
  return {
9579
9605
  pair: e,
9580
- key: Oi(n),
9581
- value: Oi(r)
9606
+ key: Mi(n),
9607
+ value: Mi(r)
9582
9608
  };
9583
- }).filter(({ key: e }) => !Di.test(e)).sort((e, t) => {
9609
+ }).filter(({ key: e }) => !ji.test(e)).sort((e, t) => {
9584
9610
  let n = e.key.localeCompare(t.key);
9585
9611
  return n === 0 ? e.value.localeCompare(t.value) : n;
9586
9612
  });
9587
9613
  return t.search = n.length ? `?${n.map(({ pair: e }) => e).join("&")}` : "", t.toString();
9588
9614
  }
9589
- function Ai(e) {
9615
+ function Pi(e) {
9590
9616
  try {
9591
- return ki(e);
9617
+ return Ni(e);
9592
9618
  } catch {
9593
9619
  return e.trim();
9594
9620
  }
9595
9621
  }
9596
- function ji(e) {
9622
+ function Fi(e) {
9597
9623
  let t = e.split(/[?#]/)[0].split("/").filter(Boolean).pop();
9598
9624
  if (t) try {
9599
9625
  return decodeURIComponent(t);
@@ -9601,48 +9627,48 @@ function ji(e) {
9601
9627
  return t;
9602
9628
  }
9603
9629
  }
9604
- function Mi(e) {
9630
+ function Ii(e) {
9605
9631
  let t;
9606
9632
  try {
9607
9633
  t = new URL(e.trim());
9608
9634
  } catch {
9609
9635
  return;
9610
9636
  }
9611
- let n = ji(t.pathname);
9612
- if (n && Ti(n)) return n;
9637
+ let n = Fi(t.pathname);
9638
+ if (n && ki(n)) return n;
9613
9639
  for (let [, e] of t.searchParams) {
9614
- let t = ji(e);
9615
- if (t && Ti(t)) return t;
9640
+ let t = Fi(e);
9641
+ if (t && ki(t)) return t;
9616
9642
  }
9617
9643
  return n;
9618
9644
  }
9619
9645
  //#endregion
9620
9646
  //#region packages/file-manager/src/utils/resolveUploadFileName.ts
9621
- var Ni = "uploaded-file", Pi = "png";
9622
- function Fi(e) {
9647
+ var Li = "uploaded-file", Ri = "png";
9648
+ function zi(e) {
9623
9649
  return e.split(/[\\/]/).filter(Boolean).pop() ?? "";
9624
9650
  }
9625
- var Ii = { jpeg: "jpg" };
9626
- function Li(e) {
9651
+ var Bi = { jpeg: "jpg" };
9652
+ function Vi(e) {
9627
9653
  if (!e?.toLowerCase().startsWith("image/")) return;
9628
9654
  let t = j(e);
9629
- if (re.includes(t)) return Ii[t] ?? t;
9655
+ if (re.includes(t)) return Bi[t] ?? t;
9630
9656
  }
9631
- function Ri({ preferredName: e, url: t, mimeType: n }) {
9632
- let r = e?.trim() ? Fi(e.trim()) : "", i = r ? "" : t && Mi(t) || "", { base: a, extension: o } = Ei(r || i || Ni);
9633
- return `${a || Ni}.${o ?? Li(n) ?? Pi}`;
9657
+ function Hi({ preferredName: e, url: t, mimeType: n }) {
9658
+ let r = e?.trim() ? zi(e.trim()) : "", i = r ? "" : t && Ii(t) || "", { base: a, extension: o } = Ai(r || i || Li);
9659
+ return `${a || Li}.${o ?? Vi(n) ?? Ri}`;
9634
9660
  }
9635
9661
  //#endregion
9636
9662
  //#region packages/file-manager/src/utils/directResourceFetchError.ts
9637
- function zi(e) {
9663
+ function Ui(e) {
9638
9664
  return typeof e != "object" || !e ? !1 : "name" in e && e.name === "DirectResourceFetchError" ? !("final" in e) || e.final !== !1 : "final" in e && e.final === !0;
9639
9665
  }
9640
9666
  //#endregion
9641
9667
  //#region packages/file-manager/src/utils/remoteFileFetchPipeline.ts
9642
- function Bi(e) {
9643
- if (zi(e) || e instanceof G) throw e;
9668
+ function Wi(e) {
9669
+ if (Ui(e) || e instanceof G) throw e;
9644
9670
  }
9645
- async function Vi(e, t, n, r, i) {
9671
+ async function Gi(e, t, n, r, i) {
9646
9672
  let { fetchWithProxy: a, handleFileProxy: o, handleProxyUrl: s } = t, c = {
9647
9673
  mode: "cors",
9648
9674
  ...i?.fetchInit
@@ -9651,31 +9677,31 @@ async function Vi(e, t, n, r, i) {
9651
9677
  let t = await Promise.resolve(o(e));
9652
9678
  if (t) return r(t);
9653
9679
  } catch (e) {
9654
- Bi(e), l = e, console.warn("handleFileProxy failed, falling back to next strategy", e);
9680
+ Wi(e), l = e, console.warn("handleFileProxy failed, falling back to next strategy", e);
9655
9681
  }
9656
9682
  if (s) try {
9657
9683
  let t = await Promise.resolve(s(e));
9658
9684
  if (t && t !== e) return r(await n(t));
9659
9685
  } catch (e) {
9660
- Bi(e), l = e, console.warn("handleProxyUrl fetch failed, falling back to next strategy", e);
9686
+ Wi(e), l = e, console.warn("handleProxyUrl fetch failed, falling back to next strategy", e);
9661
9687
  }
9662
9688
  if (a) try {
9663
9689
  let t = await Promise.resolve(a(e, c, { intent: "downloadBlob" }));
9664
9690
  if (!t.ok) throw Error(`HTTP ${t.status}`);
9665
9691
  return r(await t.blob());
9666
9692
  } catch (e) {
9667
- Bi(e), l = e, console.warn("fetchWithProxy failed", e);
9693
+ Wi(e), l = e, console.warn("fetchWithProxy failed", e);
9668
9694
  }
9669
9695
  if (!a) try {
9670
9696
  return r(await n(e));
9671
9697
  } catch (e) {
9672
- Bi(e), l = e;
9698
+ Wi(e), l = e;
9673
9699
  }
9674
9700
  throw l instanceof Error ? l : /* @__PURE__ */ Error("Failed to download file from the URL");
9675
9701
  }
9676
9702
  //#endregion
9677
9703
  //#region packages/file-manager/src/utils/mapWithConcurrency.ts
9678
- async function Hi(e, t, n) {
9704
+ async function Ki(e, t, n) {
9679
9705
  if (e.length === 0) return [];
9680
9706
  let r = Array(e.length), i = 0, a = Math.max(1, Math.min(t, e.length)), o = async () => {
9681
9707
  for (;;) {
@@ -9688,8 +9714,8 @@ async function Hi(e, t, n) {
9688
9714
  }
9689
9715
  //#endregion
9690
9716
  //#region packages/file-manager/src/hooks/core/files/useFilesAPI.ts
9691
- var Ui = 4;
9692
- function Wi(e, t) {
9717
+ var qi = 4;
9718
+ function Ji(e, t) {
9693
9719
  if (t === e.name) return e;
9694
9720
  try {
9695
9721
  return new File([e], t, {
@@ -9700,28 +9726,28 @@ function Wi(e, t) {
9700
9726
  return console.warn("Failed to create normalized File:", t), e;
9701
9727
  }
9702
9728
  }
9703
- function Gi(e) {
9729
+ function Yi(e) {
9704
9730
  return new Promise((t, n) => {
9705
9731
  let r = new FileReader();
9706
9732
  r.onload = () => t(r.result), r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read proxied file")), r.readAsDataURL(e);
9707
9733
  });
9708
9734
  }
9709
- function Ki(e, t) {
9735
+ function Xi(e, t) {
9710
9736
  return typeof e == "string" ? e : t;
9711
9737
  }
9712
- function qi(e) {
9738
+ function Zi(e) {
9713
9739
  return e == null || e === "" || e === "folders" ? null : e;
9714
9740
  }
9715
- function Ji(e, t) {
9741
+ function Qi(e, t) {
9716
9742
  return e.length === t.length && e.every((e, n) => e.id === t[n]?.id);
9717
9743
  }
9718
- var Yi = 1, Xi = 20;
9719
- async function Zi(e) {
9744
+ var $i = 1, ea = 20;
9745
+ async function ta(e) {
9720
9746
  let t = await fetch(e, { mode: "cors" });
9721
9747
  if (!t.ok) throw new G(`HTTP ${t.status}`, "UploadUrlDownloadFailed", t.status);
9722
9748
  return t.blob();
9723
9749
  }
9724
- function Qi(e, t) {
9750
+ function na(e, t) {
9725
9751
  if (!(e instanceof Blob) || e.size === 0) throw new G(t("Failed to download file from the URL."), "UploadUrlDownloadFailed");
9726
9752
  let n = e.type?.split(";")[0]?.trim() || "image/png";
9727
9753
  if (!n.startsWith("image/")) throw new G(t("Content type at the URL is not allowed."), "UploadUrlContentTypeNotAllowed");
@@ -9730,12 +9756,12 @@ function Qi(e, t) {
9730
9756
  mimeType: n
9731
9757
  };
9732
9758
  }
9733
- var $i = () => {
9734
- let { state: e, actions: t, options: n } = B(), { sortBy: i, sortOrder: o } = cr().state, { actions: { fetchFolders: s } } = Ir(), { t: c } = zn(), l = hr(), { deleteItems: u } = Rr(), { selectedFolder: d, urlForm: f, pagination: p, files: m, pathHistory: h, folders: _ } = e, v = r.useRef(null), y = r.useRef([]);
9759
+ var ra = () => {
9760
+ let { state: e, actions: t, options: n } = B(), { sortBy: i, sortOrder: o } = lr().state, { actions: { fetchFolders: s } } = Lr(), { t: c } = zn(), l = gr(), { deleteItems: u } = zr(), { selectedFolder: d, urlForm: f, pagination: p, files: m, pathHistory: h, folders: _ } = e, v = r.useRef(null), y = r.useRef([]);
9735
9761
  v.current = p, y.current = Array.isArray(m) ? m : [];
9736
9762
  let b = r.useRef(null), { setFiles: x, setLoading: S, setIsUrlModalVisible: C, setActiveLibraryItem: w, setPagination: T, setSelectedFolder: E, setPathHistory: D } = t, { dataProviders: O } = n, ee = a(async (e) => {
9737
9763
  if (!O?.getFiles) return [];
9738
- let t = n?.config?.disablePagination, r = t ? void 0 : e?.page ?? Yi, i = t ? void 0 : e?.limit ?? Xi, { files: a, pagination: o } = await O.getFiles({
9764
+ let t = n?.config?.disablePagination, r = t ? void 0 : e?.page ?? $i, i = t ? void 0 : e?.limit ?? ea, { files: a, pagination: o } = await O.getFiles({
9739
9765
  folderId: e?.folderId === "folders" ? void 0 : e?.folderId,
9740
9766
  noFolder: e?.noFolder,
9741
9767
  search: e?.search?.trim() || void 0,
@@ -9771,7 +9797,7 @@ var $i = () => {
9771
9797
  folderId: d || "",
9772
9798
  itemType: "all"
9773
9799
  };
9774
- n.itemType !== "file" && (t = await or(t, n, O?.getFolders)), (d || "") !== "Trash" && (t = t.filter((e) => !(e.isFolder && e.id === "Trash"))), x?.(t), qi(n.folderId) === qi(d) && (b.current = {
9800
+ n.itemType !== "file" && (t = await sr(t, n, O?.getFolders)), (d || "") !== "Trash" && (t = t.filter((e) => !(e.isFolder && e.id === "Trash"))), x?.(t), Zi(n.folderId) === Zi(d) && (b.current = {
9775
9801
  selectedFolder: d ?? null,
9776
9802
  pathHistory: (Array.isArray(h) ? h : []).map((e) => ({ ...e }))
9777
9803
  });
@@ -9779,9 +9805,9 @@ var $i = () => {
9779
9805
  if (r?.name === "StaleLoad") return;
9780
9806
  let i = W(r), a = i?.status === 404 || i?.code === "FileNotFound" || i?.code === "path_folder_not_found";
9781
9807
  if (a || console.error("Error loading files:", r), !t && a) {
9782
- let t = Mr(r, h || []);
9808
+ let t = Nr(r, h || []);
9783
9809
  try {
9784
- await Pr({
9810
+ await Fr({
9785
9811
  options: n,
9786
9812
  pathFolder: t,
9787
9813
  dataProviders: n?.dataProviders
@@ -9822,13 +9848,13 @@ var $i = () => {
9822
9848
  }
9823
9849
  let o = b.current;
9824
9850
  if (o && E && D) {
9825
- let e = Array.isArray(h) ? h : [], t = (o.selectedFolder ?? null) === (d ?? null), r = Ji(o.pathHistory, e);
9851
+ let e = Array.isArray(h) ? h : [], t = (o.selectedFolder ?? null) === (d ?? null), r = Qi(o.pathHistory, e);
9826
9852
  (!t || !r) && (E(o.selectedFolder), D(o.pathHistory.map((e) => ({ ...e }))), n.onPathChange && n.onPathChange(o.pathHistory.map((e) => e.name)));
9827
9853
  }
9828
9854
  let u = H(i?.code, c), f = e ?? {
9829
9855
  folderId: d || "",
9830
9856
  itemType: "all"
9831
- }, p = f.folderId !== void 0 && f.folderId !== "" ? f.folderId : d || "", m = Array.isArray(h) ? h.map((e) => ({ ...e })) : [], g = f.folderName?.trim(), v = g && g.length > 0 ? g : await wi({
9857
+ }, p = f.folderId !== void 0 && f.folderId !== "" ? f.folderId : d || "", m = Array.isArray(h) ? h.map((e) => ({ ...e })) : [], g = f.folderName?.trim(), v = g && g.length > 0 ? g : await Oi({
9832
9858
  folderId: p,
9833
9859
  dataProviders: O,
9834
9860
  folders: Array.isArray(_) ? _ : [],
@@ -9869,15 +9895,15 @@ var $i = () => {
9869
9895
  n
9870
9896
  ]), A = a((e) => k(e), [k]), ne = a(async (e, t) => {
9871
9897
  if (!O?.findFileByUrl) return null;
9872
- let n = ki(e);
9898
+ let n = Ni(e);
9873
9899
  try {
9874
9900
  return await O.findFileByUrl(n) ?? null;
9875
9901
  } catch (e) {
9876
9902
  return console.warn("findFileByUrl failed, falling back to direct loading", e), null;
9877
9903
  }
9878
9904
  }, [O]), re = a(async (e, t, r) => {
9879
- Ur(e, c);
9880
- let i = ki(e), a = await ne(i, t);
9905
+ Wr(e, c);
9906
+ let i = Ni(e), a = await ne(i, t);
9881
9907
  if (a) return {
9882
9908
  kind: "existing",
9883
9909
  file: a,
@@ -9885,16 +9911,16 @@ var $i = () => {
9885
9911
  };
9886
9912
  let o, s;
9887
9913
  try {
9888
- let e = await Vi(i, {
9914
+ let e = await Gi(i, {
9889
9915
  fetchWithProxy: n?.config?.fetchWithProxy,
9890
9916
  handleFileProxy: n?.config?.handleFileProxy,
9891
9917
  handleProxyUrl: n?.config?.handleProxyUrl
9892
- }, Zi, (e) => Qi(e, c));
9918
+ }, ta, (e) => na(e, c));
9893
9919
  o = e.blob, s = e.mimeType;
9894
9920
  } catch (e) {
9895
9921
  throw e instanceof G || e instanceof Error ? e : new G(c("Failed to download file from the URL."), "UploadUrlDownloadFailed");
9896
9922
  }
9897
- let l = j(s), u = Ri({
9923
+ let l = j(s), u = Hi({
9898
9924
  preferredName: r,
9899
9925
  url: i,
9900
9926
  mimeType: s
@@ -9912,12 +9938,12 @@ var $i = () => {
9912
9938
  n?.config,
9913
9939
  c
9914
9940
  ]), ie = a(async (e, t) => {
9915
- Ur(e, c);
9916
- let r = ki(e);
9941
+ Wr(e, c);
9942
+ let r = Ni(e);
9917
9943
  try {
9918
9944
  let e = await re(r, t);
9919
9945
  return e.kind === "existing" ? e.file : {
9920
- thumbnail: await Gi(e.blob),
9946
+ thumbnail: await Yi(e.blob),
9921
9947
  name: e.fileName,
9922
9948
  type: e.mimeType,
9923
9949
  extension: e.extension,
@@ -9928,12 +9954,12 @@ var $i = () => {
9928
9954
  } catch (e) {
9929
9955
  let i = e;
9930
9956
  if (O?.uploadFileByUrl) try {
9931
- let e = d ?? "", t = je(Mi(r) || "uploaded-file", n?.config), i = await te(t, e, !1), a = await O.uploadFileByUrl({
9957
+ let e = d ?? "", t = je(Ii(r) || "uploaded-file", n?.config), i = await te(t, e, !1), a = await O.uploadFileByUrl({
9932
9958
  url: r,
9933
9959
  folderId: e,
9934
9960
  name: i,
9935
9961
  eventSource: "imageEditor"
9936
- }), o = Qi((a?.id && O.getFileData ? await O.getFileData(a.id) : void 0) ?? (a?.url ? await Zi(a.url) : a?.thumbnailUrl ? await Zi(a.thumbnailUrl) : a?.sourceUrl ? await Zi(a.sourceUrl) : void 0), c), s = await Gi(o.blob);
9962
+ }), o = na((a?.id && O.getFileData ? await O.getFileData(a.id) : void 0) ?? (a?.url ? await ta(a.url) : a?.thumbnailUrl ? await ta(a.thumbnailUrl) : a?.sourceUrl ? await ta(a.sourceUrl) : void 0), c), s = await Yi(o.blob);
9937
9963
  return {
9938
9964
  ...a,
9939
9965
  thumbnail: s,
@@ -9945,7 +9971,7 @@ var $i = () => {
9945
9971
  } catch (e) {
9946
9972
  i = e, console.warn("Failed to prepare file for Filerobot via uploadByUrl fallback", e);
9947
9973
  }
9948
- let a = W(i), o = Ki(a?.code, "UploadUrlDownloadFailed"), s = i instanceof G ? i : new G(H(o, c) ?? a?.message ?? c("Failed to download file from the URL."), o, a?.status);
9974
+ let a = W(i), o = Xi(a?.code, "UploadUrlDownloadFailed"), s = i instanceof G ? i : new G(H(o, c) ?? a?.message ?? c("Failed to download file from the URL."), o, a?.status);
9949
9975
  throw s.notificationShown = !0, await l.error({
9950
9976
  id: "EDITOR_PROXY_FILE_FAILED",
9951
9977
  message: s.message,
@@ -10127,22 +10153,22 @@ var $i = () => {
10127
10153
  let o = je(t.name, n?.config), s = o.split(".").pop() || "", u = a ? "" : r ?? (d || ""), f = t;
10128
10154
  try {
10129
10155
  if (le(t)) {
10130
- let e = n?.config?.compressMaxSize ?? Gr.MAX_SIZE_MB, r = n?.config?.compressMaxWidthOrHeight ?? 2e3, i = n?.config?.compessorUrl ?? n?.config?.compressorUrl, a = t.type?.trim() || ce(t.name) || t.type;
10131
- f = await Ci(t, {
10156
+ let e = n?.config?.compressMaxSize ?? Kr.MAX_SIZE_MB, r = n?.config?.compressMaxWidthOrHeight ?? 2e3, i = n?.config?.compessorUrl ?? n?.config?.compressorUrl, a = t.type?.trim() || ce(t.name) || t.type;
10157
+ f = await wi(t, {
10132
10158
  maxSizeMB: e,
10133
10159
  maxWidthOrHeight: r,
10134
10160
  mimeType: a,
10135
10161
  fileName: o,
10136
10162
  libURL: i,
10137
- enableCompression: Jr(n?.config, a),
10163
+ enableCompression: Yr(n?.config, a),
10138
10164
  convertSvgToPng: !0
10139
10165
  });
10140
- } else f = Wi(t, o);
10166
+ } else f = Ji(t, o);
10141
10167
  } catch (e) {
10142
- console.warn("Image preparation failed, uploading original file", e), f = Wi(t, o);
10168
+ console.warn("Image preparation failed, uploading original file", e), f = Ji(t, o);
10143
10169
  }
10144
10170
  let p = f.name, m = Ne(n?.config);
10145
- m && (p = await te(p, u, a)), m && (f = Wi(f, p));
10171
+ m && (p = await te(p, u, a)), m && (f = Ji(f, p));
10146
10172
  try {
10147
10173
  if (O?.uploadFiles) try {
10148
10174
  let n = await O.uploadFiles({
@@ -10362,7 +10388,7 @@ var $i = () => {
10362
10388
  let r = (e) => {
10363
10389
  let t = e.filter(Boolean);
10364
10390
  return t.length > 0 && t.length <= 5 ? t.join(", ") : null;
10365
- }, i = (await Hi(e, Ui, async (e, r) => {
10391
+ }, i = (await Ki(e, qi, async (e, r) => {
10366
10392
  if (!le(e)) {
10367
10393
  let n = await l.warning({
10368
10394
  id: "FILES_UPLOAD_UNSUPPORTED_TYPE",
@@ -10378,18 +10404,18 @@ var $i = () => {
10378
10404
  }
10379
10405
  let i = je(e.name, n?.config), a = e;
10380
10406
  try {
10381
- let t = n?.config?.compressMaxSize ?? Gr.MAX_SIZE_MB, r = n?.config?.compressMaxWidthOrHeight ?? 2e3, o = n?.config?.compessorUrl ?? n?.config?.compressorUrl, s = e.type?.trim() || ce(e.name) || e.type;
10382
- a = await Ci(e, {
10407
+ let t = n?.config?.compressMaxSize ?? Kr.MAX_SIZE_MB, r = n?.config?.compressMaxWidthOrHeight ?? 2e3, o = n?.config?.compessorUrl ?? n?.config?.compressorUrl, s = e.type?.trim() || ce(e.name) || e.type;
10408
+ a = await wi(e, {
10383
10409
  maxSizeMB: t,
10384
10410
  maxWidthOrHeight: r,
10385
10411
  mimeType: s,
10386
10412
  fileName: i,
10387
10413
  libURL: o,
10388
- enableCompression: Jr(n?.config, s),
10414
+ enableCompression: Yr(n?.config, s),
10389
10415
  convertSvgToPng: !0
10390
10416
  });
10391
10417
  } catch (t) {
10392
- console.warn("Image preparation failed, uploading original file", t), a = Wi(e, i);
10418
+ console.warn("Image preparation failed, uploading original file", t), a = Ji(e, i);
10393
10419
  }
10394
10420
  let o = `${Date.now()}-${r}-${Math.random().toString(36).slice(2, 8)}`, s = await fe(a, d);
10395
10421
  return t?.onStart?.(a), {
@@ -10435,7 +10461,7 @@ var $i = () => {
10435
10461
  let a = Xn(t, Array.from(i));
10436
10462
  return i.add(a.toLowerCase()), a;
10437
10463
  }, p = i.map((e) => {
10438
- let t = o ? f(e.targetFolderId, e.file.name) : e.file.name, n = o ? Wi(e.file, t) : e.file;
10464
+ let t = o ? f(e.targetFolderId, e.file.name) : e.file.name, n = o ? Ji(e.file, t) : e.file;
10439
10465
  return {
10440
10466
  ...e,
10441
10467
  resolvedUploadName: t,
@@ -10456,7 +10482,7 @@ var $i = () => {
10456
10482
  allowedChars: "a-z A-Z 0-9 . _ -",
10457
10483
  fileSize: o == null ? void 0 : qn(Number(o)),
10458
10484
  maxSize: s == null ? void 0 : qn(Number(s))
10459
- }, f = a?.code, p = f === "BatchItemLimitExceeded" || f === "exceeded_max_files" ? f : yr(a?.message) ?? f, h = p === "BatchItemLimitExceeded" || p === "exceeded_max_files" ? Cr(n, c) : H(p, c, u), g = a?.message && typeof a.message == "string" && a.message.length > 0 ? a.message : null, _ = n instanceof Error ? n.message : typeof n == "string" ? n : null, v = _ && _ !== "[object Object]" ? _ : null;
10485
+ }, f = a?.code, p = f === "BatchItemLimitExceeded" || f === "exceeded_max_files" ? f : U(a?.message) ?? f, h = p === "BatchItemLimitExceeded" || p === "exceeded_max_files" ? wr(n, c) : H(p, c, u), g = a?.message && typeof a.message == "string" && a.message.length > 0 ? a.message : null, _ = n instanceof Error ? n.message : typeof n == "string" ? n : null, v = _ && _ !== "[object Object]" ? _ : null;
10460
10486
  return l.error({
10461
10487
  id: "FILE_UPLOAD_ITEM_FAILED",
10462
10488
  message: g ?? h ?? v ?? c("Error uploading file {{fileName}}", { fileName: e }),
@@ -10735,9 +10761,9 @@ var $i = () => {
10735
10761
  eventSource: a
10736
10762
  }
10737
10763
  }), new G(c("Please fill in all fields"), "UploadUrlInvalid");
10738
- Ur(m, c), m = ki(m), S?.(!0);
10764
+ Wr(m, c), m = Ni(m), S?.(!0);
10739
10765
  let _;
10740
- m && (_ = Mi(m) || "uploaded-file", _ = je(_, n?.config));
10766
+ m && (_ = Ii(m) || "uploaded-file", _ = je(_, n?.config));
10741
10767
  let v = t ? "" : d || "", y = !!(O?.uploadFiles || O?.uploadFile), b = !!O?.uploadFileByUrl, x = _;
10742
10768
  x && b && (x = await te(x, v, t));
10743
10769
  try {
@@ -10808,7 +10834,7 @@ var $i = () => {
10808
10834
  let t = W(e), n = t, r = e, i = Number(n?.fileSize), o = Number(n?.maxSize), s = Number.isFinite(i) && Number.isFinite(o) ? {
10809
10835
  fileSize: i,
10810
10836
  maxSize: o
10811
- } : void 0, u = r?.uploadUrlStage === "binaryUpload" ? Cr(t, c, s) : Dr(t, c);
10837
+ } : void 0, u = r?.uploadUrlStage === "binaryUpload" ? wr(t, c, s) : Or(t, c);
10812
10838
  l.error({
10813
10839
  id: "FILES_UPLOAD_BY_URL_FAILED",
10814
10840
  message: u,
@@ -10879,7 +10905,7 @@ var $i = () => {
10879
10905
  resolveFileForEditByUrl: ie,
10880
10906
  uploadFileWithProvider: ue
10881
10907
  };
10882
- }, ea = (e) => {
10908
+ }, ia = (e) => {
10883
10909
  let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
10884
10910
  let i = typeof e == "function" ? e(t) : e;
10885
10911
  if (!Object.is(i, t)) {
@@ -10893,28 +10919,28 @@ var $i = () => {
10893
10919
  subscribe: (e) => (n.add(e), () => n.delete(e))
10894
10920
  }, o = t = e(r, i, a);
10895
10921
  return a;
10896
- }, ta = ((e) => e ? ea(e) : ea), na = (e) => e;
10897
- function ra(e, t = na) {
10922
+ }, aa = ((e) => e ? ia(e) : ia), oa = (e) => e;
10923
+ function sa(e, t = oa) {
10898
10924
  let n = r.useSyncExternalStore(e.subscribe, r.useCallback(() => t(e.getState()), [e, t]), r.useCallback(() => t(e.getInitialState()), [e, t]));
10899
10925
  return r.useDebugValue(n), n;
10900
10926
  }
10901
- var ia = (e) => {
10902
- let t = ta(e), n = (e) => ra(t, e);
10927
+ var ca = (e) => {
10928
+ let t = aa(e), n = (e) => sa(t, e);
10903
10929
  return Object.assign(n, t), n;
10904
- }, aa = ((e) => e ? ia(e) : ia);
10930
+ }, la = ((e) => e ? ca(e) : ca);
10905
10931
  //#endregion
10906
10932
  //#region packages/file-manager/src/hooks/core/files/useFileSelectionStore.ts
10907
- function oa(e, t) {
10933
+ function K(e, t) {
10908
10934
  if (e.length !== t.length) return !1;
10909
10935
  for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
10910
10936
  return !0;
10911
10937
  }
10912
- function sa(e, t) {
10938
+ function ua(e, t) {
10913
10939
  if (e.size !== t.size) return !1;
10914
10940
  for (let n of e) if (!t.has(n)) return !1;
10915
10941
  return !0;
10916
10942
  }
10917
- var ca = aa((e) => ({
10943
+ var da = la((e) => ({
10918
10944
  selectedFiles: /* @__PURE__ */ new Set(),
10919
10945
  visibleFileIds: [],
10920
10946
  anchorId: null,
@@ -10934,7 +10960,7 @@ var ca = aa((e) => ({
10934
10960
  syncVisibleFiles: (t) => {
10935
10961
  let n = Array.isArray(t) ? t.map((e) => e.id) : [];
10936
10962
  e((e) => {
10937
- let t = new Set(n), r = new Set(Array.from(e.selectedFiles).filter((e) => t.has(e))), i = e.anchorId && t.has(e.anchorId) ? e.anchorId : null, a = oa(e.visibleFileIds, n), o = sa(e.selectedFiles, r), s = e.anchorId === i;
10963
+ let t = new Set(n), r = new Set(Array.from(e.selectedFiles).filter((e) => t.has(e))), i = e.anchorId && t.has(e.anchorId) ? e.anchorId : null, a = K(e.visibleFileIds, n), o = ua(e.selectedFiles, r), s = e.anchorId === i;
10938
10964
  return a && o && s ? e : {
10939
10965
  visibleFileIds: n,
10940
10966
  selectedFiles: r,
@@ -10945,7 +10971,7 @@ var ca = aa((e) => ({
10945
10971
  setSelectedFiles: (t) => {
10946
10972
  e((e) => {
10947
10973
  let n = new Set(e.visibleFileIds), r = new Set(Array.from(t).filter((e) => n.has(e)));
10948
- return sa(e.selectedFiles, r) ? e : {
10974
+ return ua(e.selectedFiles, r) ? e : {
10949
10975
  selectedFiles: r,
10950
10976
  anchorId: Array.from(r)[0] ?? null
10951
10977
  };
@@ -10960,7 +10986,7 @@ var ca = aa((e) => ({
10960
10986
  selectAllVisible: () => {
10961
10987
  e((e) => {
10962
10988
  let t = new Set(e.visibleFileIds), n = e.visibleFileIds[0] ?? null;
10963
- return sa(e.selectedFiles, t) && e.anchorId === n ? e : {
10989
+ return ua(e.selectedFiles, t) && e.anchorId === n ? e : {
10964
10990
  selectedFiles: t,
10965
10991
  anchorId: n
10966
10992
  };
@@ -10972,7 +10998,7 @@ var ca = aa((e) => ({
10972
10998
  if (o.length > 0 && !s.has(t)) return e;
10973
10999
  if (!r) {
10974
11000
  let n = /* @__PURE__ */ new Set([t]);
10975
- return sa(e.selectedFiles, n) && e.anchorId === t ? e : {
11001
+ return ua(e.selectedFiles, n) && e.anchorId === t ? e : {
10976
11002
  selectedFiles: n,
10977
11003
  anchorId: t
10978
11004
  };
@@ -10983,38 +11009,38 @@ var ca = aa((e) => ({
10983
11009
  let [i, s] = n < r ? [n, r] : [r, n], c = o.slice(i, s + 1), l = a ? new Set(e.selectedFiles) : /* @__PURE__ */ new Set();
10984
11010
  return c.forEach((e) => {
10985
11011
  l.add(e);
10986
- }), sa(e.selectedFiles, l) ? e : { selectedFiles: l };
11012
+ }), ua(e.selectedFiles, l) ? e : { selectedFiles: l };
10987
11013
  }
10988
11014
  if (i && !e.anchorId) {
10989
11015
  let n = /* @__PURE__ */ new Set([t]);
10990
- return sa(e.selectedFiles, n) && e.anchorId === t ? e : {
11016
+ return ua(e.selectedFiles, n) && e.anchorId === t ? e : {
10991
11017
  selectedFiles: n,
10992
11018
  anchorId: t
10993
11019
  };
10994
11020
  }
10995
11021
  if (a) {
10996
11022
  let n = new Set(e.selectedFiles);
10997
- return n.has(t) ? n.delete(t) : n.add(t), sa(e.selectedFiles, n) && e.anchorId === t ? e : {
11023
+ return n.has(t) ? n.delete(t) : n.add(t), ua(e.selectedFiles, n) && e.anchorId === t ? e : {
10998
11024
  selectedFiles: n,
10999
11025
  anchorId: t
11000
11026
  };
11001
11027
  }
11002
11028
  let c = /* @__PURE__ */ new Set([t]);
11003
- return sa(e.selectedFiles, c) && e.anchorId === t ? e : {
11029
+ return ua(e.selectedFiles, c) && e.anchorId === t ? e : {
11004
11030
  selectedFiles: c,
11005
11031
  anchorId: t
11006
11032
  };
11007
11033
  });
11008
11034
  }
11009
- })), la = () => {
11010
- let { state: e } = B(), t = e.multiSelect, n = ca((e) => e.selectedFiles), r = ca((e) => e.toggleFileSelection), i = ca((e) => e.setMultiSelect);
11035
+ })), fa = () => {
11036
+ let { state: e } = B(), t = e.multiSelect, n = da((e) => e.selectedFiles), r = da((e) => e.toggleFileSelection), i = da((e) => e.setMultiSelect);
11011
11037
  return s(() => {
11012
11038
  i(t !== !1);
11013
11039
  }, [t, i]), {
11014
11040
  state: { selectedFiles: n },
11015
11041
  actions: { toggleFileSelection: r }
11016
11042
  };
11017
- }, K = () => {
11043
+ }, pa = () => {
11018
11044
  let { options: e } = B(), { dataProviders: t } = e, { t: n } = zn();
11019
11045
  return { renameItem: a(async ({ itemId: r, newName: i, isFolder: a }) => {
11020
11046
  try {
@@ -11053,8 +11079,8 @@ var ca = aa((e) => ({
11053
11079
  n,
11054
11080
  e.config
11055
11081
  ]) };
11056
- }, ua = (e) => {
11057
- let { state: t, actions: n, options: r } = B(), { t: i } = zn(), o = Ir(), s = hr(), { fetchFolders: c } = o.actions, { renameItem: l } = K(), { files: u, selectedFolder: d, fileToRename: f, renameForm: p, isRenameModalVisible: m, pagination: h } = t, { setFileToRename: g, setIsRenameModalVisible: _ } = n, { dataProviders: v, config: y } = r, b = (e) => {
11082
+ }, ma = (e) => {
11083
+ let { state: t, actions: n, options: r } = B(), { t: i } = zn(), o = Lr(), s = gr(), { fetchFolders: c } = o.actions, { renameItem: l } = pa(), { files: u, selectedFolder: d, fileToRename: f, renameForm: p, isRenameModalVisible: m, pagination: h } = t, { setFileToRename: g, setIsRenameModalVisible: _ } = n, { dataProviders: v, config: y } = r, b = (e) => {
11058
11084
  if (!e) return null;
11059
11085
  let t = e;
11060
11086
  return t.folderId ?? t.parentId ?? null;
@@ -11214,8 +11240,8 @@ var ca = aa((e) => ({
11214
11240
  handleRenameOk: w
11215
11241
  }
11216
11242
  };
11217
- }, da = (e) => e.requestId ?? e.id, fa = () => {
11218
- let { options: e } = B(), { dataProviders: t } = e, { t: n } = zn(), r = hr();
11243
+ }, ha = (e) => e.requestId ?? e.id, ga = () => {
11244
+ let { options: e } = B(), { dataProviders: t } = e, { t: n } = zn(), r = gr();
11219
11245
  return { moveItems: a(async ({ items: e, targetFolderId: i, getItemNameById: a, showNotifications: o = !1 }) => {
11220
11246
  let s = 0, c = 0, l = [];
11221
11247
  if (t?.moveItems) try {
@@ -11223,7 +11249,7 @@ var ca = aa((e) => ({
11223
11249
  if (r) {
11224
11250
  let e = r.filter((e) => e.success), t = r.filter((e) => !e.success);
11225
11251
  s += e.length, c += t.length, t.forEach((e) => {
11226
- let t = da(e), n = e.error, r = W(n);
11252
+ let t = ha(e), n = e.error, r = W(n);
11227
11253
  l.push({
11228
11254
  itemId: t,
11229
11255
  itemName: a(t),
@@ -11276,7 +11302,7 @@ var ca = aa((e) => ({
11276
11302
  r,
11277
11303
  n
11278
11304
  ]) };
11279
- }, pa = (e) => {
11305
+ }, _a = (e) => {
11280
11306
  let t = (t) => {
11281
11307
  if (t) return e.find((e) => e.id === t)?.name;
11282
11308
  };
@@ -11285,21 +11311,21 @@ var ca = aa((e) => ({
11285
11311
  getItemNamesByIds: (e) => e.map(t).filter((e) => !!e),
11286
11312
  getNamesPreview: (e) => e.length > 0 && e.length <= 5 ? e.join(", ") : null
11287
11313
  };
11288
- }, ma = (e, t, n, r, i) => ({
11314
+ }, va = (e, t, n, r, i) => ({
11289
11315
  itemIds: e,
11290
11316
  itemNames: i && i.length ? i : void 0,
11291
11317
  successCount: t,
11292
11318
  totalCount: n,
11293
11319
  folderId: r ?? null
11294
- }), ha = (e, t, n, r, i, a) => ({
11320
+ }), ya = (e, t, n, r, i, a) => ({
11295
11321
  itemIds: e,
11296
11322
  itemNames: a && a.length ? a : void 0,
11297
11323
  failCount: t,
11298
11324
  totalCount: n,
11299
11325
  folderId: r ?? null,
11300
11326
  errors: i
11301
- }), ga = () => {
11302
- let e = hr(), { t } = zn(), { state: n, options: r } = B(), { folders: i, pathHistory: o } = n, { dataProviders: s } = r, { actions: { fetchFolders: c, fetchChildFolders: l } } = Ir();
11327
+ }), ba = () => {
11328
+ let e = gr(), { t } = zn(), { state: n, options: r } = B(), { folders: i, pathHistory: o } = n, { dataProviders: s } = r, { actions: { fetchFolders: c, fetchChildFolders: l } } = Lr();
11303
11329
  return {
11304
11330
  refreshFolders: a(async ({ parentIds: n, selectedFolder: r }) => {
11305
11331
  try {
@@ -11336,7 +11362,7 @@ var ca = aa((e) => ({
11336
11362
  });
11337
11363
  } catch (n) {
11338
11364
  console.error("Ошибка при обновлении списка файлов:", n);
11339
- let l = await wi({
11365
+ let l = await Oi({
11340
11366
  folderId: r || "",
11341
11367
  dataProviders: s,
11342
11368
  folders: Array.isArray(i) ? i : [],
@@ -11369,8 +11395,8 @@ var ca = aa((e) => ({
11369
11395
  o
11370
11396
  ])
11371
11397
  };
11372
- }, _a = (e) => {
11373
- let { state: t, actions: n, options: r } = B(), { t: i } = zn(), o = hr(), s = ca((e) => e.selectedFiles), c = ca((e) => e.clearSelection), { files: l, selectedFolder: u, moveForm: d, pagination: f, currentMenuFile: p } = t, { setIsMoveModalVisible: m, setPagination: h } = n, { dataProviders: g } = r, { moveItems: _ } = fa(), { refreshFolders: v, refreshFiles: y } = ga(), { getItemNameById: b, getItemNamesByIds: x, getNamesPreview: S } = pa(l), C = a(() => {
11398
+ }, xa = (e) => {
11399
+ let { state: t, actions: n, options: r } = B(), { t: i } = zn(), o = gr(), s = da((e) => e.selectedFiles), c = da((e) => e.clearSelection), { files: l, selectedFolder: u, moveForm: d, pagination: f, currentMenuFile: p } = t, { setIsMoveModalVisible: m, setPagination: h } = n, { dataProviders: g } = r, { moveItems: _ } = ga(), { refreshFolders: v, refreshFiles: y } = ba(), { getItemNameById: b, getItemNamesByIds: x, getNamesPreview: S } = _a(l), C = a(() => {
11374
11400
  m?.(!0);
11375
11401
  }, [m]), w = a(() => {
11376
11402
  m?.(!1), d?.resetFields();
@@ -11463,7 +11489,7 @@ var ca = aa((e) => ({
11463
11489
  id: "FILES_MOVE_SUCCESS",
11464
11490
  message: n,
11465
11491
  placement: "bottomRight",
11466
- data: ma(m, T, C, l, e)
11492
+ data: va(m, T, C, l, e)
11467
11493
  });
11468
11494
  }
11469
11495
  if (E > 0) {
@@ -11479,7 +11505,7 @@ var ca = aa((e) => ({
11479
11505
  message: n,
11480
11506
  placement: "bottomRight",
11481
11507
  innerException: D.length ? D : void 0,
11482
- data: ha(m, E, C, l, D.length ? D : void 0, e)
11508
+ data: ya(m, E, C, l, D.length ? D : void 0, e)
11483
11509
  });
11484
11510
  }
11485
11511
  w(), c();
@@ -11509,7 +11535,7 @@ var ca = aa((e) => ({
11509
11535
  innerException: e,
11510
11536
  message: t ?? i("Error moving"),
11511
11537
  placement: "bottomRight",
11512
- data: ha(m, C, C, u || null, [{ error: W(e) }], x(m))
11538
+ data: ya(m, C, C, u || null, [{ error: W(e) }], x(m))
11513
11539
  });
11514
11540
  }
11515
11541
  }, [
@@ -11532,8 +11558,8 @@ var ca = aa((e) => ({
11532
11558
  b
11533
11559
  ])
11534
11560
  } };
11535
- }, va = (e) => e.requestId ?? e.id, ya = () => {
11536
- let { options: e } = B(), { dataProviders: t } = e, { t: n } = zn(), r = hr();
11561
+ }, Sa = (e) => e.requestId ?? e.id, Ca = () => {
11562
+ let { options: e } = B(), { dataProviders: t } = e, { t: n } = zn(), r = gr();
11537
11563
  return { copyItems: a(async ({ items: e, targetFolderId: i, getItemNameById: a, showNotifications: o = !1 }) => {
11538
11564
  let s = 0, c = 0, l = [], u = i === "folders" ? "" : i;
11539
11565
  if (t?.copyItems) try {
@@ -11544,7 +11570,7 @@ var ca = aa((e) => ({
11544
11570
  if (r) {
11545
11571
  let e = r.filter((e) => e.success), t = r.filter((e) => !e.success);
11546
11572
  s += e.length, c += t.length, t.forEach((e) => {
11547
- let t = va(e), n = e.error, r = W(n);
11573
+ let t = Sa(e), n = e.error, r = W(n);
11548
11574
  l.push({
11549
11575
  itemId: t,
11550
11576
  itemName: a(t),
@@ -11614,8 +11640,8 @@ var ca = aa((e) => ({
11614
11640
  r,
11615
11641
  n
11616
11642
  ]) };
11617
- }, ba = (e) => {
11618
- let { state: t, actions: n, options: r } = B(), { t: i } = zn(), o = hr(), s = ca((e) => e.selectedFiles), c = ca((e) => e.clearSelection), { files: l, selectedFolder: u, copyForm: d, pagination: f, currentMenuFile: p } = t, { setIsCopyModalVisible: m } = n, { dataProviders: h } = r, { copyItems: g } = ya(), { refreshFolders: _, refreshFiles: v } = ga(), { getItemNameById: y, getItemNamesByIds: b, getNamesPreview: x } = pa(l), S = a(() => {
11643
+ }, wa = (e) => {
11644
+ let { state: t, actions: n, options: r } = B(), { t: i } = zn(), o = gr(), s = da((e) => e.selectedFiles), c = da((e) => e.clearSelection), { files: l, selectedFolder: u, copyForm: d, pagination: f, currentMenuFile: p } = t, { setIsCopyModalVisible: m } = n, { dataProviders: h } = r, { copyItems: g } = Ca(), { refreshFolders: _, refreshFiles: v } = ba(), { getItemNameById: y, getItemNamesByIds: b, getNamesPreview: x } = _a(l), S = a(() => {
11619
11645
  m?.(!0);
11620
11646
  }, [m]), C = a(() => {
11621
11647
  m?.(!1), d?.resetFields();
@@ -11713,7 +11739,7 @@ var ca = aa((e) => ({
11713
11739
  id: "FILES_COPY_SUCCESS",
11714
11740
  message: r,
11715
11741
  placement: "bottomRight",
11716
- data: ma(n, m, a, l, e)
11742
+ data: va(n, m, a, l, e)
11717
11743
  });
11718
11744
  }
11719
11745
  if (S > 0) {
@@ -11729,7 +11755,7 @@ var ca = aa((e) => ({
11729
11755
  message: r,
11730
11756
  placement: "bottomRight",
11731
11757
  innerException: w.length ? w : void 0,
11732
- data: ha(n, S, a, l, w.length ? w : void 0, e)
11758
+ data: ya(n, S, a, l, w.length ? w : void 0, e)
11733
11759
  });
11734
11760
  }
11735
11761
  C(), c(), E && await _({
@@ -11749,7 +11775,7 @@ var ca = aa((e) => ({
11749
11775
  message: t ?? i("Error copying"),
11750
11776
  innerException: e,
11751
11777
  placement: "bottomRight",
11752
- data: ha(n, a, a, u || null, [{ error: W(e) }], b(n))
11778
+ data: ya(n, a, a, u || null, [{ error: W(e) }], b(n))
11753
11779
  });
11754
11780
  }
11755
11781
  }, [
@@ -11770,12 +11796,12 @@ var ca = aa((e) => ({
11770
11796
  y
11771
11797
  ])
11772
11798
  } };
11773
- }, xa = (e) => {
11774
- let { state: t, actions: n, options: r } = B(), { t: i } = zn(), o = hr(), s = ca((e) => e.selectedFiles), c = ca((e) => e.clearSelection), { files: l, selectedFolder: u, pagination: d, currentMenuFile: f } = t, { setIsDeleteConfirmVisible: p, setUndoDeletion: m, setPagination: h } = n, { config: g } = r, { deleteItems: _ } = Rr(), { refreshFolders: v, refreshFiles: y } = ga(), b = (e) => {
11799
+ }, Ta = (e) => {
11800
+ let { state: t, actions: n, options: r } = B(), { t: i } = zn(), o = gr(), s = da((e) => e.selectedFiles), c = da((e) => e.clearSelection), { files: l, selectedFolder: u, pagination: d, currentMenuFile: f } = t, { setIsDeleteConfirmVisible: p, setUndoDeletion: m, setPagination: h } = n, { config: g } = r, { deleteItems: _ } = zr(), { refreshFolders: v, refreshFiles: y } = ba(), b = (e) => {
11775
11801
  if (!e) return null;
11776
11802
  let t = e;
11777
11803
  return t.folderId ?? t.parentId ?? null;
11778
- }, { getItemNameById: x, getItemNamesByIds: S, getNamesPreview: C } = pa(l);
11804
+ }, { getItemNameById: x, getItemNamesByIds: S, getNamesPreview: C } = _a(l);
11779
11805
  return { actions: {
11780
11806
  showDeleteConfirm: a(() => {
11781
11807
  p?.(!0);
@@ -11893,8 +11919,8 @@ var ca = aa((e) => ({
11893
11919
  g?.enableTrashFolder
11894
11920
  ])
11895
11921
  } };
11896
- }, Sa = (e) => {
11897
- let t = ua(e), n = _a(e), r = ba(e), i = xa(e);
11922
+ }, Ea = (e) => {
11923
+ let t = ma(e), n = xa(e), r = wa(e), i = Ta(e);
11898
11924
  return {
11899
11925
  state: t.state,
11900
11926
  actions: {
@@ -11904,8 +11930,8 @@ var ca = aa((e) => ({
11904
11930
  ...i.actions
11905
11931
  }
11906
11932
  };
11907
- }, Ca = () => {
11908
- let { state: e } = B(), { files: t, loading: n, isUrlModalVisible: r } = e, i = $i(), a = la(), o = Sa(i.fetchFiles);
11933
+ }, Da = () => {
11934
+ let { state: e } = B(), { files: t, loading: n, isUrlModalVisible: r } = e, i = ra(), a = fa(), o = Ea(i.fetchFiles);
11909
11935
  return {
11910
11936
  state: {
11911
11937
  files: t || [],
@@ -11938,7 +11964,7 @@ var ca = aa((e) => ({
11938
11964
  handleDeleteConfirmOk: o.actions.handleDeleteConfirmOk
11939
11965
  }
11940
11966
  };
11941
- }, wa = () => {
11967
+ }, Oa = () => {
11942
11968
  let { state: e, actions: t, options: n } = B(), { selectedFolder: r, pathHistory: i, folders: o } = e, { t: s } = zn(), { setSelectedFolder: c, setPathHistory: l } = t, u = a(() => `em_fm:lastFolder:${n?.config?.projectId || "default"}`, [n?.config?.projectId]), d = a((e, t = /* @__PURE__ */ new Set()) => {
11943
11969
  if (t.has(e)) return console.warn(`Cycle detected in the path to the folder with id=${e}`), [];
11944
11970
  let n = (Array.isArray(o) ? o : []).find((t) => t.id === e);
@@ -12048,7 +12074,7 @@ var ca = aa((e) => ({
12048
12074
  handleBreadcrumbClick: h,
12049
12075
  handleItemClick: g
12050
12076
  };
12051
- }, Ta = () => {
12077
+ }, ka = () => {
12052
12078
  let { state: e, actions: t } = B(), { pagination: n } = e, { setPagination: r } = t, i = a((e, t) => {
12053
12079
  let i = t || n.pageSize;
12054
12080
  r?.({
@@ -12065,16 +12091,16 @@ var ca = aa((e) => ({
12065
12091
  state: { pagination: n },
12066
12092
  actions: { handlePaginationChange: i }
12067
12093
  };
12068
- }, Ea = ({ files: e, clearSelection: t, showRenameModal: r, showMoveModal: i, showCopyModal: a, handleDeleteFile: o, handleDeleteFolder: s, showDeleteConfirm: c, onEdit: l }) => ({
12094
+ }, Aa = ({ files: e, clearSelection: t, showRenameModal: r, showMoveModal: i, showCopyModal: a, handleDeleteFile: o, handleDeleteFolder: s, showDeleteConfirm: c, onEdit: l }) => ({
12069
12095
  handleClearSelection: n.useCallback(() => {
12070
12096
  t();
12071
12097
  }, [t]),
12072
12098
  handleRename: n.useCallback((e) => {
12073
- let t = ca.getState().selectedFiles;
12099
+ let t = da.getState().selectedFiles;
12074
12100
  (t && t.size === 1 || e) && r(e || Array.from(t)[0]);
12075
12101
  }, [r]),
12076
12102
  handleDeleteSelected: n.useCallback((t) => {
12077
- let n = ca.getState().selectedFiles;
12103
+ let n = da.getState().selectedFiles;
12078
12104
  if (n && n.size > 0 || t?.id) {
12079
12105
  if (c) {
12080
12106
  c();
@@ -12100,8 +12126,8 @@ var ca = aa((e) => ({
12100
12126
  handleEdit: n.useCallback(() => {
12101
12127
  l();
12102
12128
  }, [l])
12103
- }), Da = ({ files: e, fetchFiles: t, selectedFolder: r }) => {
12104
- let { t: i } = zn(), a = hr(), { options: o, actions: s, state: c } = n.useContext(er), { setActiveLibraryItem: l } = s, { activeLibraryItem: u } = c, d = $i(), [f, p] = n.useState(!1), [m, h] = n.useState(null), _ = n.useCallback((e) => {
12129
+ }), ja = ({ files: e, fetchFiles: t, selectedFolder: r }) => {
12130
+ let { t: i } = zn(), a = gr(), { options: o, actions: s, state: c } = n.useContext(tr), { setActiveLibraryItem: l } = s, { activeLibraryItem: u } = c, d = ra(), [f, p] = n.useState(!1), [m, h] = n.useState(null), _ = n.useCallback((e) => {
12105
12131
  if (e.type && e.type.startsWith("image/")) return !0;
12106
12132
  if (e.extension) {
12107
12133
  let t = e.extension.toLowerCase();
@@ -12135,7 +12161,7 @@ var ca = aa((e) => ({
12135
12161
  let n;
12136
12162
  if (t) n = t;
12137
12163
  else {
12138
- let t = ca.getState().selectedFiles;
12164
+ let t = da.getState().selectedFiles;
12139
12165
  if (t.size !== 1) return;
12140
12166
  let r = Array.from(t)[0];
12141
12167
  if (n = e.find((e) => e.id === r), !n || n.isFolder || !_(n)) return;
@@ -12233,8 +12259,8 @@ var ca = aa((e) => ({
12233
12259
  ]),
12234
12260
  handleFilerobotEditorClose: S
12235
12261
  };
12236
- }, Oa = 6;
12237
- function ka({ maxConcurrent: e = Oa } = {}) {
12262
+ }, Ma = 6;
12263
+ function Na({ maxConcurrent: e = Ma } = {}) {
12238
12264
  let t = l(/* @__PURE__ */ new Map()), n = l([]), r = l(0), i = c(() => {
12239
12265
  let i = (e) => ({
12240
12266
  status: e.status,
@@ -12308,7 +12334,7 @@ function ka({ maxConcurrent: e = Oa } = {}) {
12308
12334
  }
12309
12335
  //#endregion
12310
12336
  //#region packages/file-manager/src/hooks/useProxyDisplayFallback.ts
12311
- function Aa(e) {
12337
+ function Pa(e) {
12312
12338
  if (e && e !== "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q==") {
12313
12339
  if (e.startsWith("data:image/")) {
12314
12340
  let t = e.split(",")[1];
@@ -12318,25 +12344,25 @@ function Aa(e) {
12318
12344
  if (e.startsWith("http://") || e.startsWith("https://") || e.startsWith("/")) return Zn(e) ?? e;
12319
12345
  }
12320
12346
  }
12321
- function ja(e) {
12347
+ function Fa(e) {
12322
12348
  return e.startsWith("http://") || e.startsWith("https://");
12323
12349
  }
12324
- function Ma(e) {
12350
+ function Ia(e) {
12325
12351
  let t = /* @__PURE__ */ new Set();
12326
12352
  return e.filter((e) => !e.src || t.has(e.src) ? !1 : (t.add(e.src), !0));
12327
12353
  }
12328
- function Na(e, t) {
12354
+ function La(e, t) {
12329
12355
  return e === t || e.length === t.length && e.every((e, n) => e === t[n]);
12330
12356
  }
12331
- function Pa(e, t) {
12357
+ function Ra(e, t) {
12332
12358
  return e === t || e.length === t.length && e.every((e, n) => {
12333
12359
  let r = t[n];
12334
12360
  return e.originalSrc === r.originalSrc && e.src === r.src && e.stabilityKey === r.stabilityKey;
12335
12361
  });
12336
12362
  }
12337
- function Fa(e, t) {
12363
+ function za(e, t) {
12338
12364
  if (!e) return null;
12339
- let n = Aa(e.src ?? void 0);
12365
+ let n = Pa(e.src ?? void 0);
12340
12366
  return e.exhausted ? {
12341
12367
  ...e,
12342
12368
  src: null
@@ -12350,13 +12376,13 @@ function Fa(e, t) {
12350
12376
  reason: "unchanged"
12351
12377
  };
12352
12378
  }
12353
- function Ia(e) {
12379
+ function Ba(e) {
12354
12380
  return Math.max(8, e * 6);
12355
12381
  }
12356
- function La(e) {
12382
+ function Va(e) {
12357
12383
  let { options: t } = B(), n = t.config?.getProxiedUrl, r = l([]), i = l(!1), o = l(0), d = l(null), [f, p] = u(!1), m = c(() => {
12358
- let t = e.map((e) => Aa(e)).filter((e, t, n) => !!e && n.indexOf(e) === t);
12359
- return Na(r.current, t) ? r.current : (r.current = t, t);
12384
+ let t = e.map((e) => Pa(e)).filter((e, t, n) => !!e && n.indexOf(e) === t);
12385
+ return La(r.current, t) ? r.current : (r.current = t, t);
12360
12386
  }, [e]), [h, g] = u([]), [_, v] = u(0);
12361
12387
  s(() => {
12362
12388
  let e = !1;
@@ -12366,12 +12392,12 @@ function La(e) {
12366
12392
  }
12367
12393
  return (async () => {
12368
12394
  let t = await Promise.all(m.map(async (e) => {
12369
- if (!n || !ja(e)) return [{
12395
+ if (!n || !Fa(e)) return [{
12370
12396
  originalSrc: e,
12371
12397
  src: e
12372
12398
  }];
12373
12399
  try {
12374
- let t = await Promise.resolve(n(e)), r = Aa(t?.src);
12400
+ let t = await Promise.resolve(n(e)), r = Pa(t?.src);
12375
12401
  return r ? [{
12376
12402
  originalSrc: e,
12377
12403
  src: r,
@@ -12392,8 +12418,8 @@ function La(e) {
12392
12418
  }
12393
12419
  }));
12394
12420
  if (!e) {
12395
- let e = Ma(t.flat());
12396
- g((t) => Pa(t, e) ? t : e);
12421
+ let e = Ia(t.flat());
12422
+ g((t) => Ra(t, e) ? t : e);
12397
12423
  }
12398
12424
  })(), () => {
12399
12425
  e = !0;
@@ -12405,7 +12431,7 @@ function La(e) {
12405
12431
  let e, t = !1;
12406
12432
  return Promise.resolve(y.subscribeToSrcChange((e) => {
12407
12433
  if (t || i.current) return;
12408
- let n = Fa(e, y.src);
12434
+ let n = za(e, y.src);
12409
12435
  n?.changed && n.src && !t && g((e) => e.map((e, t) => t === _ ? {
12410
12436
  ...e,
12411
12437
  src: n.src
@@ -12426,7 +12452,7 @@ function La(e) {
12426
12452
  d.current = e;
12427
12453
  let t = !1;
12428
12454
  return Promise.resolve(y.handleChangeSrc()).then((e) => {
12429
- let n = Fa(e, y.src);
12455
+ let n = za(e, y.src);
12430
12456
  n?.changed && n.src && !t && g((e) => e.map((e, t) => t === _ ? {
12431
12457
  ...e,
12432
12458
  src: n.src
@@ -12448,7 +12474,7 @@ function La(e) {
12448
12474
  exhausted: !0,
12449
12475
  reason: "exhausted"
12450
12476
  };
12451
- let e = Fa(await Promise.resolve(y.handleChangeSrc()), y.src);
12477
+ let e = za(await Promise.resolve(y.handleChangeSrc()), y.src);
12452
12478
  return !e?.changed || !e.src || e.src === y.src ? e ?? {
12453
12479
  src: y.src,
12454
12480
  changed: !1,
@@ -12471,7 +12497,7 @@ function La(e) {
12471
12497
  exhausted: !0,
12472
12498
  reason: "exhausted"
12473
12499
  };
12474
- let e = Ia(h.length);
12500
+ let e = Ba(h.length);
12475
12501
  if (o.current >= e) return i.current = !0, p(!0), {
12476
12502
  src: null,
12477
12503
  changed: !1,
@@ -12479,7 +12505,7 @@ function La(e) {
12479
12505
  reason: "exhausted"
12480
12506
  };
12481
12507
  o.current += 1;
12482
- let t = y.handleError ? Fa(await Promise.resolve(y.handleError()), y.src) : null;
12508
+ let t = y.handleError ? za(await Promise.resolve(y.handleError()), y.src) : null;
12483
12509
  return t?.exhausted ? (i.current = !0, p(!0), t) : t?.changed && t.src && t.src !== y.src ? (g((e) => e.map((e, n) => n === _ ? {
12484
12510
  ...e,
12485
12511
  src: t.src
@@ -12511,88 +12537,88 @@ function La(e) {
12511
12537
  }
12512
12538
  //#endregion
12513
12539
  //#region packages/file-manager/src/presentation/list-core/viewportMetrics.ts
12514
- var Ra = /(auto|scroll|overlay)/, za = 1;
12515
- function Ba(e) {
12540
+ var Ha = /(auto|scroll|overlay)/, Ua = 1;
12541
+ function Wa(e) {
12516
12542
  if (typeof window > "u") return 0;
12517
12543
  let t = window.getComputedStyle(e);
12518
12544
  return (Number.parseFloat(t.paddingLeft || "0") || 0) + (Number.parseFloat(t.paddingRight || "0") || 0);
12519
12545
  }
12520
- function Va(e, t) {
12546
+ function Ga(e, t) {
12521
12547
  let n = Math.max(0, t ?? e.clientWidth);
12522
- return Math.max(1, Math.round(n - Ba(e)));
12548
+ return Math.max(1, Math.round(n - Wa(e)));
12523
12549
  }
12524
- function Ha(e) {
12550
+ function Ka(e) {
12525
12551
  if (typeof window > "u") return !1;
12526
12552
  let t = window.getComputedStyle(e);
12527
- return Ra.test(t.overflowY) || Ra.test(t.overflow) || Ra.test(t.overflowX);
12553
+ return Ha.test(t.overflowY) || Ha.test(t.overflow) || Ha.test(t.overflowX);
12528
12554
  }
12529
- function Ua(e) {
12530
- return e.scrollHeight - e.clientHeight > za;
12555
+ function qa(e) {
12556
+ return e.scrollHeight - e.clientHeight > Ua;
12531
12557
  }
12532
- function Wa(e) {
12558
+ function Ja(e) {
12533
12559
  if (typeof window > "u") return e;
12534
12560
  let t = e;
12535
12561
  for (; t;) {
12536
- if (Ha(t)) return t;
12562
+ if (Ka(t)) return t;
12537
12563
  t = t.parentElement;
12538
12564
  }
12539
12565
  return null;
12540
12566
  }
12541
- function Ga(e) {
12567
+ function Ya(e) {
12542
12568
  if (typeof window > "u") return [e];
12543
- let t = Wa(e);
12569
+ let t = Ja(e);
12544
12570
  return t ? t === e ? [window, e] : [window, t] : [window];
12545
12571
  }
12546
- function Ka(e, t, n) {
12572
+ function Xa(e, t, n) {
12547
12573
  return Math.max(0, e.clientHeight), Math.max(0, Math.round(e.getBoundingClientRect().height)), Math.max(1, t);
12548
12574
  }
12549
- function qa(e) {
12575
+ function Za(e) {
12550
12576
  if (typeof window > "u") return Math.max(1, e.clientHeight);
12551
12577
  let t = e.getBoundingClientRect(), n = window.innerHeight || document.documentElement?.clientHeight || 0, r = Math.max(0, t.top), i = Math.min(n, t.bottom);
12552
12578
  return Math.max(0, Math.round(i - r));
12553
12579
  }
12554
- function Ja(e) {
12580
+ function Qa(e) {
12555
12581
  let t = e.getBoundingClientRect(), n = window.innerHeight || document.documentElement?.clientHeight || 0, r = window.innerWidth || document.documentElement?.clientWidth || t.width, i = Math.max(0, t.top), a = Math.min(n, t.bottom), o = Math.max(0, Math.round(a - i));
12556
12582
  return {
12557
12583
  scrollTop: Math.max(0, Math.round(-t.top)),
12558
- viewportHeight: Ka(e, o, o),
12559
- viewportWidth: Va(e, Math.min(Math.round(t.width), r)),
12584
+ viewportHeight: Xa(e, o, o),
12585
+ viewportWidth: Ga(e, Math.min(Math.round(t.width), r)),
12560
12586
  scrollHeight: e.scrollHeight
12561
12587
  };
12562
12588
  }
12563
- function Ya(e, t) {
12589
+ function $a(e, t) {
12564
12590
  if (e === t) {
12565
- let n = qa(t);
12591
+ let n = Za(t);
12566
12592
  return {
12567
12593
  scrollTop: t.scrollTop,
12568
- viewportHeight: Ka(e, Math.min(t.clientHeight, n || t.clientHeight), n),
12569
- viewportWidth: Va(t),
12594
+ viewportHeight: Xa(e, Math.min(t.clientHeight, n || t.clientHeight), n),
12595
+ viewportWidth: Ga(t),
12570
12596
  scrollHeight: e.scrollHeight
12571
12597
  };
12572
12598
  }
12573
12599
  let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = Math.max(n.top, r.top), a = Math.min(n.bottom, r.bottom), o = Math.max(n.left, r.left), s = Math.min(n.right, r.right), c = Math.max(0, Math.round(a - i)), l = Math.max(0, Math.round(s - o));
12574
12600
  return {
12575
12601
  scrollTop: Math.max(0, Math.round(i - r.top)),
12576
- viewportHeight: Ka(e, c, c),
12577
- viewportWidth: Va(e, l || t.clientWidth || e.clientWidth),
12602
+ viewportHeight: Xa(e, c, c),
12603
+ viewportWidth: Ga(e, l || t.clientWidth || e.clientWidth),
12578
12604
  scrollHeight: e.scrollHeight
12579
12605
  };
12580
12606
  }
12581
- function Xa(e) {
12607
+ function eo(e) {
12582
12608
  if (typeof window > "u") return {
12583
12609
  scrollTop: e.scrollTop,
12584
12610
  viewportHeight: Math.max(1, e.clientHeight),
12585
- viewportWidth: Va(e),
12611
+ viewportWidth: Ga(e),
12586
12612
  scrollHeight: e.scrollHeight
12587
12613
  };
12588
- let t = Wa(e);
12589
- return !t || !Ua(t) ? Ja(e) : Ya(e, t);
12614
+ let t = Ja(e);
12615
+ return !t || !qa(t) ? Qa(e) : $a(e, t);
12590
12616
  }
12591
12617
  //#endregion
12592
12618
  //#region packages/file-manager/src/hooks/useViewportMetricsSync.ts
12593
- function Za(e, t) {
12619
+ function to(e, t) {
12594
12620
  let n = l(null), r = a((t) => {
12595
- e(Xa(t));
12621
+ e(eo(t));
12596
12622
  }, [e]);
12597
12623
  return s(() => {
12598
12624
  n.current && r(n.current);
@@ -12607,7 +12633,7 @@ function Za(e, t) {
12607
12633
  if (!e) return;
12608
12634
  let t = () => {
12609
12635
  r(e);
12610
- }, i = Ga(e);
12636
+ }, i = Ya(e);
12611
12637
  return i.forEach((e) => {
12612
12638
  e.addEventListener("scroll", t, { passive: !0 });
12613
12639
  }), () => {
@@ -12618,6 +12644,6 @@ function Za(e, t) {
12618
12644
  }, [r, ...t]), n;
12619
12645
  }
12620
12646
  //#endregion
12621
- export { Ne as $, Rr as A, tr as B, ii as C, O as Ct, Jr as D, Wr as E, Dr as F, Kn as G, $n as H, gr as I, Hn as J, Wn as K, hr as L, Pr as M, Nr as N, Ur as O, W as P, Pn as Q, cr as R, pi as S, x as St, Gr as T, Qn as U, B as V, Yn as W, Bn as X, Vn as Y, zn as Z, Ei as _, g as _t, ka as a, se as at, ai as b, _ as bt, Ta as c, C as ct, ca as d, k as dt, je as et, $i as f, v as ft, Ti as g, S as gt, Ai as h, ne as ht, La as i, ae as it, Ir as j, G as k, wa as l, b as lt, Mi as m, A as mt, Xa as n, oe as nt, Da as o, ee as ot, Vi as p, y as pt, Un as q, Ga as r, j as rt, Ea as s, te as st, Za as t, me as tt, Ca as u, D as ut, wi as v, E as vt, ri as w, ie as wt, oi as x, w as xt, Ci as y, T as yt, nr as z };
12647
+ export { Ne as $, zr as A, nr as B, ai as C, O as Ct, Yr as D, Gr as E, Or as F, Kn as G, $n as H, _r as I, Hn as J, Wn as K, gr as L, Fr as M, Pr as N, Wr as O, W as P, Pn as Q, lr as R, mi as S, x as St, Kr as T, Qn as U, B as V, Yn as W, Bn as X, Vn as Y, zn as Z, Ai as _, g as _t, Na as a, se as at, oi as b, _ as bt, ka as c, C as ct, da as d, k as dt, je as et, ra as f, v as ft, ki as g, S as gt, Pi as h, ne as ht, Va as i, ae as it, Lr as j, G as k, Oa as l, b as lt, Ii as m, A as mt, eo as n, oe as nt, ja as o, ee as ot, Gi as p, y as pt, Un as q, Ya as r, j as rt, Aa as s, te as st, to as t, me as tt, Da as u, D as ut, Oi as v, E as vt, ii as w, ie as wt, si as x, w as xt, Di as y, T as yt, rr as z };
12622
12648
 
12623
- //# sourceMappingURL=file-manager-hooks-sL2VIffX.js.map
12649
+ //# sourceMappingURL=file-manager-hooks-fhltHD9p.js.map