@emailmaker/filemanager 1.1.95 → 1.1.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/.build-meta.json +1 -1
  2. package/assets/icon-sets/lucide.json +6275 -0
  3. package/assets/icon-sets/tabler.json +19336 -0
  4. package/components/FilerobotEditor/FilerobotEditor.d.ts +1 -0
  5. package/components/FilerobotEditor/cornerRadius/CornerRadiusTool.d.ts +22 -0
  6. package/components/FilerobotEditor/cornerRadius/__tests__/cornerRadiusMath.test.d.ts +1 -0
  7. package/components/FilerobotEditor/cornerRadius/__tests__/cornerRadiusOutput.test.d.ts +1 -0
  8. package/components/FilerobotEditor/cornerRadius/__tests__/imageEditorTools.test.d.ts +1 -0
  9. package/components/FilerobotEditor/cornerRadius/cornerRadiusEraser.d.ts +17 -0
  10. package/components/FilerobotEditor/cornerRadius/cornerRadiusMath.d.ts +38 -0
  11. package/components/FilerobotEditor/cornerRadius/cornerRadiusOutput.d.ts +18 -0
  12. package/components/FilerobotEditor/cornerRadius/imageEditorTools.d.ts +11 -0
  13. package/components/FilerobotEditor/cornerRadius/useCornerRadiusSync.d.ts +23 -0
  14. package/components/ImageIcons/iconSets.d.ts +38 -0
  15. package/components/ImageIcons/iconSets.test.d.ts +1 -0
  16. package/components/ImageIcons/iconStockSearch.d.ts +3 -1
  17. package/components/ImageIcons/packagedIconSets.d.ts +9 -0
  18. package/core.d.ts +1 -0
  19. package/core.esm.js +272 -259
  20. package/core.js +1 -1
  21. package/file-manager-FilerobotEditor.js +576 -0
  22. package/file-manager-IconsTab.js +2083 -0
  23. package/{file-manager-ImageCodeGenerator-m06RVQr7.js → file-manager-ImageCodeGenerator.js} +8 -8
  24. package/{file-manager-JsBarcode-CyaffT5b.js → file-manager-JsBarcode.js} +30 -30
  25. package/{file-manager-browser-DDyRNDQk.js → file-manager-browser.js} +8 -8
  26. package/{file-manager-hooks-UP2zpv8z.js → file-manager-hooks-BDRRCedE.js} +4792 -2384
  27. package/file-manager-imageEditorCropPresets-en0_jYEY.js +76 -0
  28. package/{file-manager-rolldown-runtime-DAVfCfog.js → file-manager-rolldown-runtime-DawGUBAG.js} +2 -2
  29. package/{file-manager-useMediaListEngine-B9sz3gcs.js → file-manager-urls-rCuqY9r4.js} +139 -119
  30. package/file-manager.esm.js +2332 -2277
  31. package/file-manager.js +12 -12
  32. package/helpers/__tests__/applyImageEditorTranslations.test.d.ts +1 -0
  33. package/helpers/__tests__/imageEditorCropPresets.test.d.ts +1 -0
  34. package/helpers/__tests__/locales.test.d.ts +1 -0
  35. package/helpers/applyImageEditorTranslations.d.ts +6 -0
  36. package/helpers/imageEditorCropPresets.d.ts +8 -0
  37. package/index.d.ts +2 -0
  38. package/package.json +5 -1
  39. package/types.d.ts +18 -0
  40. package/utils/filerobotEditorConfig.d.ts +1 -0
  41. package/utils/generateId.d.ts +5 -0
  42. package/utils/imageCompression.d.ts +10 -0
  43. package/utils/imageCompression.editedImage.test.d.ts +1 -0
  44. package/utils/imageCompression.png.test.d.ts +1 -0
  45. package/utils/pngCompression.d.ts +23 -0
  46. package/utils/pngCompression.test.d.ts +1 -0
  47. package/file-manager-FilerobotEditor-WbM5WTct.js +0 -330
  48. package/file-manager-IconsTab-CCn0Q0ng.js +0 -2434
  49. package/file-manager-imageEditorTranslations-CtNVql-A.js +0 -38
package/core.esm.js CHANGED
@@ -168,74 +168,76 @@ function b(e) {
168
168
  };
169
169
  }
170
170
  //#endregion
171
+ //#region packages/file-manager/src/utils/generateId.ts
172
+ function x() {
173
+ if (typeof globalThis?.crypto?.randomUUID == "function") return globalThis.crypto.randomUUID();
174
+ try {
175
+ let e = globalThis.crypto || globalThis.msCrypto;
176
+ if (e && typeof e.getRandomValues == "function") {
177
+ let t = /* @__PURE__ */ new Uint8Array(16);
178
+ e.getRandomValues(t);
179
+ let n = "";
180
+ for (let e = 0; e < t.length; e++) n += t[e].toString(16).padStart(2, "0");
181
+ return `id_${n}`;
182
+ }
183
+ } catch {}
184
+ return `id_fallback_${Date.now().toString(36)}_${Math.floor(Math.random() * (2 ** 53 - 1)).toString(36).slice(0, 8)}`;
185
+ }
186
+ //#endregion
171
187
  //#region packages/file-manager/src/utils/urlNormalization.ts
172
- var x = /^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;
173
- function S(e) {
188
+ var S = /^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;
189
+ function C(e) {
174
190
  try {
175
191
  return decodeURIComponent(e.replace(/\+/g, " "));
176
192
  } catch {
177
193
  return e;
178
194
  }
179
195
  }
180
- function C(e) {
196
+ function w(e) {
181
197
  let t = new URL(e.trim());
182
198
  t.hash = "", t.hostname = t.hostname.toLowerCase(), (t.protocol === "https:" && t.port === "443" || t.protocol === "http:" && t.port === "80") && (t.port = "");
183
199
  let n = (t.search.startsWith("?") ? t.search.slice(1) : t.search).split("&").filter(Boolean).map((e) => {
184
200
  let t = e.indexOf("="), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1);
185
201
  return {
186
202
  pair: e,
187
- key: S(n),
188
- value: S(r)
203
+ key: C(n),
204
+ value: C(r)
189
205
  };
190
- }).filter(({ key: e }) => !x.test(e)).sort((e, t) => {
206
+ }).filter(({ key: e }) => !S.test(e)).sort((e, t) => {
191
207
  let n = e.key.localeCompare(t.key);
192
208
  return n === 0 ? e.value.localeCompare(t.value) : n;
193
209
  });
194
210
  return t.search = n.length ? `?${n.map(({ pair: e }) => e).join("&")}` : "", t.toString();
195
211
  }
196
- function w(e) {
212
+ function T(e) {
197
213
  try {
198
- return C(e);
214
+ return w(e);
199
215
  } catch {
200
216
  return e.trim();
201
217
  }
202
218
  }
203
219
  //#endregion
204
220
  //#region packages/file-manager/src/adapters/TreeCache.ts
205
- var T = "", E = 1800 * 1e3;
206
- function D(e) {
207
- return e == null || e === "" ? T : e;
208
- }
221
+ var E = "", D = 18e5;
209
222
  function O(e) {
223
+ return e == null || e === "" ? E : e;
224
+ }
225
+ function k(e) {
210
226
  if (e == null) return Infinity;
211
227
  let t = Number(e);
212
228
  return Number.isFinite(t) && t >= 0 ? t : Infinity;
213
229
  }
214
- function k(e) {
230
+ function A(e) {
215
231
  return !e || typeof e.search != "string" ? !1 : e.search.trim().length > 0;
216
232
  }
217
- function A(e) {
233
+ function j(e) {
218
234
  if (!e) return null;
219
235
  let t = e.folderId;
220
236
  return t == null ? null : String(t);
221
237
  }
222
- function j(e) {
238
+ function M(e) {
223
239
  return !!e && !!e.isFolder;
224
240
  }
225
- function M() {
226
- if (typeof globalThis?.crypto?.randomUUID == "function") return globalThis.crypto.randomUUID();
227
- try {
228
- let e = globalThis.crypto || globalThis.msCrypto;
229
- if (e && typeof e.getRandomValues == "function") {
230
- let t = /* @__PURE__ */ new Uint8Array(16);
231
- e.getRandomValues(t);
232
- let n = "";
233
- for (let e = 0; e < t.length; e++) n += t[e].toString(16).padStart(2, "0");
234
- return `id_${n}`;
235
- }
236
- } catch {}
237
- return `id_fallback_${Date.now().toString(36)}_${Math.floor(Math.random() * (2 ** 53 - 1)).toString(36).slice(0, 8)}`;
238
- }
239
241
  function N(e) {
240
242
  if (!e || typeof e != "object") return !1;
241
243
  let t = e;
@@ -288,32 +290,32 @@ var I = class e {
288
290
  }
289
291
  getFileSystemItem(e) {
290
292
  let t = this.getEntity(e);
291
- return t && !j(t) ? t : void 0;
293
+ return t && !M(t) ? t : void 0;
292
294
  }
293
295
  getFolder(e) {
294
296
  let t = this.getEntity(e);
295
- return t && j(t) ? t : void 0;
297
+ return t && M(t) ? t : void 0;
296
298
  }
297
299
  getChildrenIds(e, t = {}) {
298
- let n = D(e), r = this.childrenByParent.get(n);
300
+ let n = O(e), r = this.childrenByParent.get(n);
299
301
  return r ? t.onlyFileSystemItems ? Array.from(r.files) : t.onlyFolders ? Array.from(r.folders) : [...Array.from(r.folders), ...Array.from(r.files)] : [];
300
302
  }
301
303
  searchByUrl(e) {
302
- let t = w(e);
304
+ let t = T(e);
303
305
  for (let n of this.entities.values()) {
304
306
  let r = n.value.url;
305
- if (r && (r === e || w(r) === t)) return n.value;
307
+ if (r && (r === e || T(r) === t)) return n.value;
306
308
  }
307
309
  return null;
308
310
  }
309
311
  upsertEntity(e) {
310
- let t = this.entities.get(e.id) ?? null, n = t ? t.value : null, r = n ? A(n) : null, i = A(e), a = n ? j(n) : !1, o = j(e), s;
311
- if (n && j(n) && o) {
312
+ let t = this.entities.get(e.id) ?? null, n = t ? t.value : null, r = n ? j(n) : null, i = j(e), a = n ? M(n) : !1, o = M(e), s;
313
+ if (n && M(n) && o) {
312
314
  let t = n.childrenCount, r = e.childrenCount;
313
315
  t !== void 0 && r === void 0 && (s = t);
314
316
  }
315
317
  if (n && (r !== i || a !== o)) {
316
- let t = D(r), n = this.childrenByParent.get(t);
318
+ let t = O(r), n = this.childrenByParent.get(t);
317
319
  n && (a ? n.folders.delete(e.id) : n.files.delete(e.id), n.files.size === 0 && n.folders.size === 0 && this.childrenByParent.delete(t));
318
320
  }
319
321
  let c = e;
@@ -324,7 +326,7 @@ var I = class e {
324
326
  value: { ...c },
325
327
  updatedAt: this.now()
326
328
  }), this.checkCacheSize();
327
- let l = D(i), u = this.childrenByParent.get(l);
329
+ let l = O(i), u = this.childrenByParent.get(l);
328
330
  u || (u = {
329
331
  files: /* @__PURE__ */ new Set(),
330
332
  folders: /* @__PURE__ */ new Set()
@@ -333,7 +335,7 @@ var I = class e {
333
335
  updateServerChildrenCount(e, t) {
334
336
  if (e == null || t == null || Number.isNaN(t)) return;
335
337
  let n = this.entities.get(e);
336
- if (!n || !j(n.value)) return;
338
+ if (!n || !M(n.value)) return;
337
339
  let r = {
338
340
  ...n.value,
339
341
  childrenCount: t
@@ -349,32 +351,32 @@ var I = class e {
349
351
  entity: null,
350
352
  parentId: null
351
353
  };
352
- let n = t.value, r = A(n), i = D(r), a = this.childrenByParent.get(i);
353
- return a && (j(n) ? a.folders.delete(e) : a.files.delete(e), a.files.size === 0 && a.folders.size === 0 && this.childrenByParent.delete(i)), this.entities.delete(e), {
354
+ let n = t.value, r = j(n), i = O(r), a = this.childrenByParent.get(i);
355
+ return a && (M(n) ? a.folders.delete(e) : a.files.delete(e), a.files.size === 0 && a.folders.size === 0 && this.childrenByParent.delete(i)), this.entities.delete(e), {
354
356
  entity: { ...n },
355
357
  parentId: r
356
358
  };
357
359
  }
358
360
  deleteFolderRecursive(e) {
359
361
  let t = this.entities.get(e);
360
- if (!t || !j(t.value)) return {
362
+ if (!t || !M(t.value)) return {
361
363
  deletedFolderRecords: [],
362
364
  deletedFileSystemItemRecords: []
363
365
  };
364
366
  let n = [{
365
367
  id: e,
366
- parentId: A(t.value)
368
+ parentId: j(t.value)
367
369
  }], r = [], i = [];
368
370
  for (; n.length;) {
369
371
  let e = n.shift();
370
372
  r.push(e);
371
- let t = this.childrenByParent.get(D(e.id));
373
+ let t = this.childrenByParent.get(O(e.id));
372
374
  if (t) {
373
375
  for (let e of Array.from(t.folders)) {
374
376
  let t = this.entities.get(e);
375
377
  t && n.push({
376
378
  id: e,
377
- parentId: A(t.value)
379
+ parentId: j(t.value)
378
380
  });
379
381
  }
380
382
  for (let e of Array.from(t.files)) i.push(e);
@@ -384,16 +386,16 @@ var I = class e {
384
386
  for (let e of i) {
385
387
  let t = this.entities.get(e);
386
388
  if (!t) continue;
387
- let n = t.value, r = D(A(n)), i = this.childrenByParent.get(r);
389
+ let n = t.value, r = O(j(n)), i = this.childrenByParent.get(r);
388
390
  i && (i.files.delete(e), i.files.size === 0 && i.folders.size === 0 && this.childrenByParent.delete(r)), this.entities.delete(e), a.push({ ...n });
389
391
  }
390
392
  let o = [];
391
393
  for (let e = r.length - 1; e >= 0; e--) {
392
394
  let { id: t, parentId: n } = r[e], i = this.entities.get(t);
393
395
  if (!i) continue;
394
- let a = i.value, s = D(a.id);
396
+ let a = i.value, s = O(a.id);
395
397
  this.childrenByParent.delete(s);
396
- let c = D(n), l = this.childrenByParent.get(c);
398
+ let c = O(n), l = this.childrenByParent.get(c);
397
399
  l && (l.folders.delete(t), l.files.size === 0 && l.folders.size === 0 && this.childrenByParent.delete(c)), this.entities.delete(t), o.push({ ...a });
398
400
  }
399
401
  return {
@@ -404,13 +406,13 @@ var I = class e {
404
406
  moveEntityById(e, t) {
405
407
  let n = this.entities.get(e) ?? null;
406
408
  if (!n) return null;
407
- let r = n.value, i = D(A(r)), a = this.childrenByParent.get(i);
408
- a && (j(r) ? a.folders.delete(e) : a.files.delete(e), a.files.size === 0 && a.folders.size === 0 && this.childrenByParent.delete(i));
409
+ let r = n.value, i = O(j(r)), a = this.childrenByParent.get(i);
410
+ a && (M(r) ? a.folders.delete(e) : a.files.delete(e), a.files.size === 0 && a.folders.size === 0 && this.childrenByParent.delete(i));
409
411
  let o = {
410
412
  ...r,
411
413
  folderId: t
412
414
  };
413
- if (j(r) && j(o)) {
415
+ if (M(r) && M(o)) {
414
416
  let e = r.childrenCount;
415
417
  e !== void 0 && (o.childrenCount = e);
416
418
  }
@@ -418,15 +420,15 @@ var I = class e {
418
420
  value: o,
419
421
  updatedAt: this.now()
420
422
  });
421
- let s = D(t), c = this.childrenByParent.get(s);
423
+ let s = O(t), c = this.childrenByParent.get(s);
422
424
  return c || (c = {
423
425
  files: /* @__PURE__ */ new Set(),
424
426
  folders: /* @__PURE__ */ new Set()
425
- }, this.childrenByParent.set(s, c)), j(o) ? c.folders.add(e) : c.files.add(e), { ...o };
427
+ }, this.childrenByParent.set(s, c)), M(o) ? c.folders.add(e) : c.files.add(e), { ...o };
426
428
  }
427
429
  copyFileSystemItem(e, t, n) {
428
430
  let r = this.entities.get(e) ?? null;
429
- if (!r || j(r.value)) return null;
431
+ if (!r || M(r.value)) return null;
430
432
  let i = {
431
433
  ...r.value,
432
434
  id: t,
@@ -436,7 +438,7 @@ var I = class e {
436
438
  }
437
439
  copyFolderShallow(e, t, n) {
438
440
  let r = this.entities.get(e) ?? null;
439
- if (!r || !j(r.value)) return null;
441
+ if (!r || !M(r.value)) return null;
440
442
  let i = {
441
443
  ...r.value,
442
444
  id: t,
@@ -460,7 +462,7 @@ var I = class e {
460
462
  let n = t?.parentId, r = t?.recursive ?? !1, i = t?.itemType ?? "all", a = t?.caseSensitive ?? !1, o = t?.limit ?? Infinity, s = a ? e.trim() : e.trim().toLowerCase(), c = [], l = null;
461
463
  if (n !== void 0) {
462
464
  l = /* @__PURE__ */ new Set();
463
- let e = D(n);
465
+ let e = O(n);
464
466
  if (l.add(e), r) {
465
467
  let t = [e], n = /* @__PURE__ */ new Set();
466
468
  for (; t.length > 0;) {
@@ -476,10 +478,10 @@ var I = class e {
476
478
  if (c.length >= o) break;
477
479
  let t = e.value;
478
480
  if (l !== null) {
479
- let e = D(A(t));
481
+ let e = O(j(t));
480
482
  if (!l.has(e)) continue;
481
483
  }
482
- if (i === "file" && j(t) || i === "folder" && !j(t)) continue;
484
+ if (i === "file" && M(t) || i === "folder" && !M(t)) continue;
483
485
  let n = t.name ?? "";
484
486
  (a ? n : n.toLowerCase()).includes(s) && c.push({ ...t });
485
487
  }
@@ -507,7 +509,7 @@ var I = class e {
507
509
  return n;
508
510
  }
509
511
  }, L = class e {
510
- constructor(e = {}, t = E, n, r, i = new o(), a = N) {
512
+ constructor(e = {}, t = D, n, r, i = new o(), a = N) {
511
513
  this.views = /* @__PURE__ */ new Map(), this.maxViewsPerParent = 50;
512
514
  let s = g(e);
513
515
  this.strategy = {
@@ -531,7 +533,7 @@ var I = class e {
531
533
  return Date.now();
532
534
  }
533
535
  parentKey(e) {
534
- return D(e ?? null);
536
+ return O(e ?? null);
535
537
  }
536
538
  isExpired(e) {
537
539
  return e == null || this.ttl !== Infinity && this.now() - e > this.ttl;
@@ -540,13 +542,13 @@ var I = class e {
540
542
  return !e || e.some((e) => !t.getEntity(e) || t.isEntityStale(e, this.entityTtl));
541
543
  }
542
544
  isEntityTypeCompatible(e, t) {
543
- return !!(!t || t === "all" || t === "file" && !j(e) || t === "folder" && j(e));
545
+ return !!(!t || t === "all" || t === "file" && !M(e) || t === "folder" && M(e));
544
546
  }
545
547
  markViewStaleForReload(e) {
546
548
  e.view.meta = {
547
549
  ...e.view.meta ?? {},
548
550
  stale: !0
549
- }, e.view.updatedAt = this.now(), e.view.loadId = M(), e.view.abortController && (e.view.abortController.abort(), e.view.abortController = void 0);
551
+ }, e.view.updatedAt = this.now(), e.view.loadId = x(), e.view.abortController && (e.view.abortController.abort(), e.view.abortController = void 0);
550
552
  }
551
553
  cleanupOldViews(e) {
552
554
  if (e.size <= this.maxViewsPerParent) return;
@@ -580,11 +582,11 @@ var I = class e {
580
582
  };
581
583
  }
582
584
  if (l.view.promise) return l.view.promise;
583
- let d = M();
585
+ let d = x();
584
586
  l.view.loadId = d;
585
587
  let f = (async () => {
586
588
  try {
587
- let a = await n(e, t), o = k(t), s = o ? {
589
+ let a = await n(e, t), o = A(t), s = o ? {
588
590
  ...a,
589
591
  total: void 0
590
592
  } : a, u = this.views.get(i)?.get(F(t));
@@ -596,7 +598,7 @@ var I = class e {
596
598
  l.view.value = s.items.map((e) => e.id);
597
599
  let { items: f, ...p } = s, m = { ...p };
598
600
  l.view.meta = m, l.view.meta && (l.view.meta.stale = !1), this.failedRequests.delete(c), l.view.updatedAt = this.now(), !o && typeof m.total == "number" && (this.serverChildrenCountHandler ? this.serverChildrenCountHandler(e ?? null, m.total, r) : r.updateServerChildrenCount(e, m.total));
599
- let h = this.strategy.preloadPagesAfter ?? 0, g = this.strategy.preloadPagesBefore ?? 0, _ = O(t?.pageSize);
601
+ let h = this.strategy.preloadPagesAfter ?? 0, g = this.strategy.preloadPagesBefore ?? 0, _ = k(t?.pageSize);
600
602
  if ((h > 0 || g > 0) && Number.isFinite(_)) {
601
603
  let i = e, a = { ...t }, o = typeof m.totalPages == "number" ? m.totalPages : 1, s = t?.page ?? 1, c = _, l = n, u = d;
602
604
  setTimeout(() => {
@@ -707,7 +709,7 @@ var I = class e {
707
709
  syncTotalsInSameViews(e, t) {
708
710
  let n = t.view.meta;
709
711
  if (!n || typeof n.total != "number") return;
710
- let r = Number(n.total), i = O(t.params?.pageSize), a = Number.isFinite(i) && i > 0 ? Math.max(1, Math.ceil(r / i)) : void 0;
712
+ let r = Number(n.total), i = k(t.params?.pageSize), a = Number.isFinite(i) && i > 0 ? Math.max(1, Math.ceil(r / i)) : void 0;
711
713
  for (let [, n] of e) this.isParamsSame(n.params ?? {}, t.params ?? {}) && (n.view.meta || (n.view.meta = {}), n.view.meta.total = r, a !== void 0 && (n.view.meta.totalPages = a));
712
714
  }
713
715
  cascadeShiftPages(e, t, n, r, i, a, o) {
@@ -761,26 +763,28 @@ var I = class e {
761
763
  ...o,
762
764
  page: n + 1
763
765
  }, c = F(s), l = e.get(c), u = !1;
764
- if (!l?.view.value || this.isExpired(l.view.updatedAt)) if (n >= i) {
765
- l = {
766
- params: s,
767
- view: {
768
- promise: null,
769
- value: void 0,
770
- meta: void 0,
771
- updatedAt: 0,
772
- loadId: null
773
- }
774
- }, e.set(c, l), this.cleanupOldViews(e);
775
- let r = t.view.meta;
776
- r && (l.view.meta = {
777
- ...r,
778
- page: n + 1
779
- }), u = !0;
780
- } else return t.view.meta = {
781
- ...t.view.meta ?? {},
782
- stale: !0
783
- }, !1;
766
+ if (!l?.view.value || this.isExpired(l.view.updatedAt)) {
767
+ if (n >= i) {
768
+ l = {
769
+ params: s,
770
+ view: {
771
+ promise: null,
772
+ value: void 0,
773
+ meta: void 0,
774
+ updatedAt: 0,
775
+ loadId: null
776
+ }
777
+ }, e.set(c, l), this.cleanupOldViews(e);
778
+ let r = t.view.meta;
779
+ r && (l.view.meta = {
780
+ ...r,
781
+ page: n + 1
782
+ }), u = !0;
783
+ } else return t.view.meta = {
784
+ ...t.view.meta ?? {},
785
+ stale: !0
786
+ }, !1;
787
+ }
784
788
  let d = t.view.value.slice(r).filter((e) => a.getEntity(e));
785
789
  if (d.length === 0) return u && e.delete(c), !1;
786
790
  t.view.value = t.view.value.slice(0, r), t.view.updatedAt = Date.now(), l.view.value = [...d, ...l.view.value ?? []], l.view.updatedAt = Date.now();
@@ -824,7 +828,7 @@ var I = class e {
824
828
  ], e.view.updatedAt = this.now(), !0);
825
829
  }
826
830
  updateChildrenCountForOperation(e, t, n, r) {
827
- let i = A(t);
831
+ let i = j(t);
828
832
  switch (e) {
829
833
  case "delete":
830
834
  this.adjustChildrenCount(r, i, -1), this.childrenCountInvalidator?.(i);
@@ -833,9 +837,7 @@ var I = class e {
833
837
  case "copy":
834
838
  this.adjustChildrenCount(r, i, 1), this.childrenCountInvalidator?.(i);
835
839
  break;
836
- case "move":
837
- this.adjustChildrenCount(r, n ?? null, -1), this.adjustChildrenCount(r, i, 1), this.childrenCountInvalidator?.(n ?? null), this.childrenCountInvalidator?.(i);
838
- break;
840
+ case "move": this.adjustChildrenCount(r, n ?? null, -1), this.adjustChildrenCount(r, i, 1), this.childrenCountInvalidator?.(n ?? null), this.childrenCountInvalidator?.(i);
839
841
  }
840
842
  }
841
843
  adjustChildrenCount(e, t, n) {
@@ -851,14 +853,14 @@ var I = class e {
851
853
  this.updateChildrenCountForOperation(n, t, i, r);
852
854
  let o = this.parentKey(e), s = this.views.get(o);
853
855
  if (s) for (let [, e] of s) {
854
- let a = e.params ?? {}, o = a?.page ?? 1, c = O(a?.pageSize), l = Number.isFinite(c), u = !!(a?.sortBy || a?.sortOrder), d = !!a?.search, f = a?.itemType || "all";
856
+ let a = e.params ?? {}, o = a?.page ?? 1, c = k(a?.pageSize), l = Number.isFinite(c), u = !!(a?.sortBy || a?.sortOrder), d = !!a?.search, f = a?.itemType || "all";
855
857
  if (this.isEntityTypeCompatible(t, f)) {
856
858
  if (d && this.strategy.filterMatch && !this.strategy.filterMatch(t, e.params)) {
857
859
  e.view.value?.includes(t.id) && (e.view.value = e.view.value.filter((e) => e !== t.id), e.view.meta && typeof e.view.meta.total == "number" && (e.view.meta.total = Math.max(0, e.view.meta.total - 1)), this.markViewStaleForReload(e));
858
860
  continue;
859
861
  }
860
862
  if (!e.view.value) {
861
- e.view.meta && (e.view.meta.stale = !0), e.view.loadId = M(), e.view.abortController && (e.view.abortController.abort(), e.view.abortController = void 0);
863
+ e.view.meta && (e.view.meta.stale = !0), e.view.loadId = x(), e.view.abortController && (e.view.abortController.abort(), e.view.abortController = void 0);
862
864
  continue;
863
865
  }
864
866
  if (e.view.value.includes(t.id), this.shouldInvalidateCompletely(e, n, t, u, l, o)) {
@@ -876,9 +878,7 @@ var I = class e {
876
878
  case "update":
877
879
  this.handleUpdate(s, e, o, c, l, u, d, t, r);
878
880
  break;
879
- case "move":
880
- this.handleMove(s, e, o, c, l, u, t, i, r);
881
- break;
881
+ case "move": this.handleMove(s, e, o, c, l, u, t, i, r);
882
882
  }
883
883
  }
884
884
  }
@@ -908,27 +908,28 @@ var I = class e {
908
908
  t.view.meta.totalPages = n, this.updateTotalPagesForAllViews(e, n);
909
909
  }
910
910
  }
911
- t.view.loadId = M(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
911
+ t.view.loadId = x(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
912
912
  }
913
913
  handleInsert(e, t, n, r, i, a, o, s) {
914
914
  if (!t.view.value.includes(o.id)) {
915
- if (a && this.strategy.allowSortedInsert && this.strategy.comparator && s) if (this.tryInsertSorted(t, o, s)) {
916
- if (t.view.meta && typeof t.view.meta.total == "number") {
917
- if (t.view.meta.total += 1, i && Number.isFinite(r)) {
918
- let e = r;
919
- e > 0 && (t.view.meta.totalPages = Math.max(1, Math.ceil(t.view.meta.total / e)));
915
+ if (a && this.strategy.allowSortedInsert && this.strategy.comparator && s) {
916
+ if (this.tryInsertSorted(t, o, s)) {
917
+ if (t.view.meta && typeof t.view.meta.total == "number") {
918
+ if (t.view.meta.total += 1, i && Number.isFinite(r)) {
919
+ let e = r;
920
+ e > 0 && (t.view.meta.totalPages = Math.max(1, Math.ceil(t.view.meta.total / e)));
921
+ }
922
+ this.syncTotalsInSameViews(e, t);
920
923
  }
921
- this.syncTotalsInSameViews(e, t);
922
- }
923
- if (t.view.updatedAt = Date.now(), i && (t.view.value?.length ?? 0) > r && s) {
924
- let i = t.view.meta, a = i && typeof i.totalPages == "number" ? i.totalPages : 1;
925
- if (this.cascadeShiftToNextPage(e, t, n, r, a, s, t.params ?? {}) && t.view.meta && typeof t.view.meta.totalPages == "number") {
926
- let n = t.view.meta.totalPages + 1;
927
- t.view.meta.totalPages = n, this.updateTotalPagesForAllViews(e, n);
924
+ if (t.view.updatedAt = Date.now(), i && (t.view.value?.length ?? 0) > r && s) {
925
+ let i = t.view.meta, a = i && typeof i.totalPages == "number" ? i.totalPages : 1;
926
+ if (this.cascadeShiftToNextPage(e, t, n, r, a, s, t.params ?? {}) && t.view.meta && typeof t.view.meta.totalPages == "number") {
927
+ let n = t.view.meta.totalPages + 1;
928
+ t.view.meta.totalPages = n, this.updateTotalPagesForAllViews(e, n);
929
+ }
928
930
  }
929
- }
930
- } else this.markViewStaleForReload(t);
931
- else if (!i || t.view.value.length < r) {
931
+ } else this.markViewStaleForReload(t);
932
+ } else if (!i || t.view.value.length < r) {
932
933
  if (t.view.value.push(o.id), t.view.meta && typeof t.view.meta.total == "number") {
933
934
  if (t.view.meta.total += 1, i && Number.isFinite(r)) {
934
935
  let e = r;
@@ -938,7 +939,7 @@ var I = class e {
938
939
  }
939
940
  t.view.updatedAt = Date.now();
940
941
  } else this.markViewStaleForReload(t);
941
- t.view.loadId = M(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
942
+ t.view.loadId = x(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
942
943
  }
943
944
  }
944
945
  handleUpdate(e, t, n, r, i, a, o, s, c) {
@@ -955,29 +956,30 @@ var I = class e {
955
956
  t.view.meta.totalPages = n, this.updateTotalPagesForAllViews(e, n);
956
957
  }
957
958
  }
958
- t.view.loadId = M(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
959
+ t.view.loadId = x(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
959
960
  return;
960
961
  }
961
962
  if (l && (a || o)) {
962
- t.view.value = t.view.value.filter((e) => e !== s.id), this.tryReinsertEntity(t, s, c, i, r) ? (t.view.updatedAt = Date.now(), t.view.loadId = M(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0)) : this.markViewStaleForReload(t);
963
+ t.view.value = t.view.value.filter((e) => e !== s.id), this.tryReinsertEntity(t, s, c, i, r) ? (t.view.updatedAt = Date.now(), t.view.loadId = x(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0)) : this.markViewStaleForReload(t);
963
964
  return;
964
965
  }
965
966
  if (l) {
966
- t.view.updatedAt = Date.now(), t.view.loadId = M(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
967
+ t.view.updatedAt = Date.now(), t.view.loadId = x(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
967
968
  return;
968
969
  }
969
970
  if (u && !o) {
970
- if (a && this.strategy.allowSortedInsert && this.strategy.comparator && c) if (this.tryInsertSorted(t, s, c)) {
971
- if (t.view.meta && typeof t.view.meta.total == "number") {
972
- if (t.view.meta.total += 1, i && Number.isFinite(r)) {
973
- let e = r;
974
- e > 0 && (t.view.meta.totalPages = Math.max(1, Math.ceil(t.view.meta.total / e)));
971
+ if (a && this.strategy.allowSortedInsert && this.strategy.comparator && c) {
972
+ if (this.tryInsertSorted(t, s, c)) {
973
+ if (t.view.meta && typeof t.view.meta.total == "number") {
974
+ if (t.view.meta.total += 1, i && Number.isFinite(r)) {
975
+ let e = r;
976
+ e > 0 && (t.view.meta.totalPages = Math.max(1, Math.ceil(t.view.meta.total / e)));
977
+ }
978
+ this.syncTotalsInSameViews(e, t);
975
979
  }
976
- this.syncTotalsInSameViews(e, t);
977
- }
978
- t.view.updatedAt = Date.now();
979
- } else this.markViewStaleForReload(t);
980
- else if (!i || t.view.value.length < r) {
980
+ t.view.updatedAt = Date.now();
981
+ } else this.markViewStaleForReload(t);
982
+ } else if (!i || t.view.value.length < r) {
981
983
  if (t.view.value.push(s.id), t.view.meta && typeof t.view.meta.total == "number") {
982
984
  if (t.view.meta.total += 1, i && Number.isFinite(r)) {
983
985
  let e = r;
@@ -987,7 +989,7 @@ var I = class e {
987
989
  }
988
990
  t.view.updatedAt = Date.now();
989
991
  } else this.markViewStaleForReload(t);
990
- t.view.loadId = M(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
992
+ t.view.loadId = x(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
991
993
  }
992
994
  }
993
995
  handleMove(e, t, n, r, i, a, o, s, c) {
@@ -1005,13 +1007,13 @@ var I = class e {
1005
1007
  }
1006
1008
  this.syncTotalsInSameViews(e, t);
1007
1009
  }
1008
- t.view.loadId = M(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
1010
+ t.view.loadId = x(), t.view.abortController && (t.view.abortController.abort(), t.view.abortController = void 0);
1009
1011
  }
1010
1012
  forceInvalidateChildrenViews(e) {
1011
1013
  let t = this.parentKey(e ?? null);
1012
1014
  this.failedRequests.clearChildrenViewErrorsForParent(t);
1013
1015
  let n = this.views.get(t);
1014
- if (n) for (let [, e] of n) e.view.value = void 0, e.view.meta = void 0, e.view.promise = null, e.view.updatedAt = 0, e.view.loadId = M(), e.view.abortController && (e.view.abortController.abort(), e.view.abortController = void 0);
1016
+ if (n) for (let [, e] of n) e.view.value = void 0, e.view.meta = void 0, e.view.promise = null, e.view.updatedAt = 0, e.view.loadId = x(), e.view.abortController && (e.view.abortController.abort(), e.view.abortController = void 0);
1015
1017
  }
1016
1018
  getKnownTotal(e) {
1017
1019
  let t = this.parentKey(e ?? null), n = this.views.get(t);
@@ -1055,10 +1057,10 @@ var I = class e {
1055
1057
  }
1056
1058
  }, R = class e {
1057
1059
  invalidateChildrenCountCache(e) {
1058
- let t = D(e ?? "");
1060
+ let t = O(e ?? "");
1059
1061
  this.childrenCountPromises.delete(t), this.failedRequests.delete(o.childrenCountKey(t));
1060
1062
  }
1061
- constructor(e = {}, t = E, n, r) {
1063
+ constructor(e = {}, t = D, n, r) {
1062
1064
  this.childrenCountPromises = /* @__PURE__ */ new Map(), this.isFolderNotFoundError = r?.isFolderNotFoundError ?? N, this.failedRequests = new o(), this.ttl = r?.ttl ?? t, this.errorTtl = r?.errorTtl ?? n ?? this.ttl, this.entities = new I(), this.views = new L(e, this.ttl, this.errorTtl, void 0, this.failedRequests, this.isFolderNotFoundError), this.views.setServerChildrenCountHandler((e, t, n) => {
1063
1065
  this.handleServerReportedChildrenCount(e, t, n ?? this.entities);
1064
1066
  }), this.views.setChildrenCountInvalidator((e) => {
@@ -1078,7 +1080,7 @@ var I = class e {
1078
1080
  return this.views.getOrCreateChildren(e, t, n, this.entities);
1079
1081
  }
1080
1082
  upsertEntity(e) {
1081
- let t = this.entities.getEntity(e.id), n = t ? A(t) : null, r = A(e), i = t ? j(t) : !1, a = j(e);
1083
+ let t = this.entities.getEntity(e.id), n = t ? j(t) : null, r = j(e), i = t ? M(t) : !1, a = M(e);
1082
1084
  if (this.entities.upsertEntity(e), t) {
1083
1085
  if (n !== r || i !== a) {
1084
1086
  this.views.smartInvalidateChildrenViews(n, t, "delete", this.entities), this.views.smartInvalidateChildrenViews(r, e, "insert", this.entities);
@@ -1090,24 +1092,24 @@ var I = class e {
1090
1092
  isAncestor(e, t) {
1091
1093
  let n = t, r = /* @__PURE__ */ new Set();
1092
1094
  for (; n && !r.has(n);) {
1093
- if (r.add(n), D(n) === D(e)) return !0;
1095
+ if (r.add(n), O(n) === O(e)) return !0;
1094
1096
  let t = this.entities.getEntity(n);
1095
1097
  if (!t) break;
1096
- n = A(t), n === null && (n = T);
1098
+ n = j(t), n === null && (n = E);
1097
1099
  }
1098
1100
  return !1;
1099
1101
  }
1100
1102
  moveEntity(e, t) {
1101
1103
  let n = this.entities.getEntity(e);
1102
- if (!n || j(n) && t !== null && this.isAncestor(e, t)) return null;
1103
- let r = A(n), i = this.entities.moveEntityById(e, t);
1104
+ if (!n || M(n) && t !== null && this.isAncestor(e, t)) return null;
1105
+ let r = j(n), i = this.entities.moveEntityById(e, t);
1104
1106
  return i ? (this.views.smartInvalidateChildrenViews(r, n, "delete", this.entities), this.views.smartInvalidateChildrenViews(t, i, "insert", this.entities), i) : null;
1105
1107
  }
1106
1108
  copyEntity(e, t, n, r) {
1107
1109
  let i = this.entities.getEntity(e);
1108
1110
  if (!i) return null;
1109
1111
  let a = null;
1110
- if (j(i)) {
1112
+ if (M(i)) {
1111
1113
  let n = [e], i = [];
1112
1114
  for (; n.length;) {
1113
1115
  let e = n.shift();
@@ -1116,9 +1118,9 @@ var I = class e {
1116
1118
  for (let e of t) n.push(e);
1117
1119
  }
1118
1120
  let o = /* @__PURE__ */ new Map();
1119
- for (let e of i) o.set(e, M());
1121
+ for (let e of i) o.set(e, x());
1120
1122
  for (let n of i) {
1121
- let i = this.entities.getFolder(n), a = o.get(n), s = A(i), c = s === null ? t : o.get(s) ?? null, l = {
1123
+ let i = this.entities.getFolder(n), a = o.get(n), s = j(i), c = s === null ? t : o.get(s) ?? null, l = {
1122
1124
  ...i,
1123
1125
  ...n === e ? r : void 0,
1124
1126
  id: a,
@@ -1131,7 +1133,7 @@ var I = class e {
1131
1133
  for (let e of n) {
1132
1134
  let n = this.entities.getFileSystemItem(e);
1133
1135
  if (!n) continue;
1134
- let r = M(), i = {
1136
+ let r = x(), i = {
1135
1137
  ...n,
1136
1138
  id: r,
1137
1139
  folderId: t
@@ -1141,7 +1143,7 @@ var I = class e {
1141
1143
  }
1142
1144
  a = this.entities.getEntity(o.get(e)) ?? null;
1143
1145
  } else {
1144
- let i = n ?? M();
1146
+ let i = n ?? x();
1145
1147
  if (a = this.entities.copyFileSystemItem(e, i, t ?? null), a && r) {
1146
1148
  let e = {
1147
1149
  ...a,
@@ -1160,13 +1162,14 @@ var I = class e {
1160
1162
  deleteEntity(e) {
1161
1163
  let t = this.entities.getEntity(e);
1162
1164
  if (!t) return null;
1163
- if (j(t)) {
1165
+ if (M(t)) {
1164
1166
  let { deletedFolderRecords: n, deletedFileSystemItemRecords: r } = this.entities.deleteFolderRecursive(e);
1165
1167
  for (let e of r) this.views.smartInvalidateChildrenViews(e.folderId, e, "delete", this.entities);
1166
1168
  for (let e of n) this.views.smartInvalidateChildrenViews(e.folderId, e, "delete", this.entities);
1167
1169
  for (let e of n) this.views.forceInvalidateChildrenViews(e.id);
1168
1170
  return t;
1169
- } else {
1171
+ }
1172
+ {
1170
1173
  let { entity: t, parentId: n } = this.entities.deleteEntityById(e);
1171
1174
  return t && this.views.smartInvalidateChildrenViews(n, t, "delete", this.entities), t;
1172
1175
  }
@@ -1188,7 +1191,7 @@ var I = class e {
1188
1191
  return;
1189
1192
  }
1190
1193
  let n = /* @__PURE__ */ new Set();
1191
- if (j(t)) {
1194
+ if (M(t)) {
1192
1195
  let t = [e];
1193
1196
  for (; t.length;) {
1194
1197
  let e = t.pop();
@@ -1212,7 +1215,7 @@ var I = class e {
1212
1215
  return this.entities.searchByName(e, t);
1213
1216
  }
1214
1217
  async getChildrenCount(e = "", t) {
1215
- let n = D(e), r = o.childrenCountKey(n), i = this.failedRequests.getFreshError(r, this.errorTtl);
1218
+ let n = O(e), r = o.childrenCountKey(n), i = this.failedRequests.getFreshError(r, this.errorTtl);
1216
1219
  if (i != null) return Promise.reject(i);
1217
1220
  let a = this.childrenCountPromises.get(n);
1218
1221
  if (a) return a;
@@ -1282,8 +1285,8 @@ var I = class e {
1282
1285
  let i = n.getFolder(r)?.childrenCount;
1283
1286
  i !== void 0 && i !== t && (console.warn(`Conflict: folder "${r}" has childrenCount=${i} but server says total=${t}`), this.views.forceInvalidateChildrenViews(r)), n.updateServerChildrenCount(r, t);
1284
1287
  }
1285
- }, ee = "", te = "Trash", ne = "Edited", z = 1e4, B = 1e4, V = 25, H = 10;
1286
- function U(e, t) {
1288
+ }, ee = "", te = "Trash", z = "Edited", B = 1e4, V = 1e4, H = 25, U = 10;
1289
+ function W(e, t) {
1287
1290
  let n = e ?? {}, r = Array.isArray(n.detailed) ? n.detailed.map((e) => ({
1288
1291
  requestId: e.requestId ?? e.id,
1289
1292
  success: !!e.success,
@@ -1296,28 +1299,28 @@ function U(e, t) {
1296
1299
  detailed: r
1297
1300
  };
1298
1301
  }
1299
- function W(e) {
1302
+ function G(e) {
1300
1303
  return e == null ? "" : String(e);
1301
1304
  }
1302
- function G(e) {
1305
+ function K(e) {
1303
1306
  return {
1304
1307
  ...e,
1305
- name: W(e.name)
1308
+ name: G(e.name)
1306
1309
  };
1307
1310
  }
1308
- function K(e) {
1309
- return (e ?? []).map(G);
1310
- }
1311
1311
  function q(e) {
1312
+ return (e ?? []).map(K);
1313
+ }
1314
+ function J(e) {
1312
1315
  return !e || typeof e != "object" || !("name" in e) ? e : {
1313
1316
  ...e,
1314
- name: W(e.name)
1317
+ name: G(e.name)
1315
1318
  };
1316
1319
  }
1317
- function J(e) {
1320
+ function Y(e) {
1318
1321
  return e ? e.replaceAll("\\", "/").split("/").filter(Boolean) : [];
1319
1322
  }
1320
- for (var re = class {
1323
+ var ne = class {
1321
1324
  _getTrashPath() {
1322
1325
  return this._pathOptions.trashPath || te;
1323
1326
  }
@@ -1332,7 +1335,7 @@ for (var re = class {
1332
1335
  name: t.name || t.id,
1333
1336
  parentId: t.folderId
1334
1337
  };
1335
- return this._cache.upsertEntity(G({
1338
+ return this._cache.upsertEntity(K({
1336
1339
  id: r.id,
1337
1340
  name: r.name,
1338
1341
  folderId: r.parentId ?? null,
@@ -1346,8 +1349,8 @@ for (var re = class {
1346
1349
  }
1347
1350
  }
1348
1351
  async _findOrCreateFolderByPath(t) {
1349
- let n = J(t);
1350
- if (n.length > H) throw new e("Path depth exceeds maximum limit of %s".replace("%s", String(H)), "ValidationError");
1352
+ let n = Y(t);
1353
+ if (n.length > U) throw new e("Path depth exceeds maximum limit of %s".replace("%s", String(U)), "ValidationError");
1351
1354
  let r = await this._resolveFolderByPath(t);
1352
1355
  if (r) return r;
1353
1356
  let i;
@@ -1379,7 +1382,7 @@ for (var re = class {
1379
1382
  return t;
1380
1383
  }
1381
1384
  async getTempFolder() {
1382
- let t = this._pathOptions.tempPath ?? ne;
1385
+ let t = this._pathOptions.tempPath ?? z;
1383
1386
  if (t) try {
1384
1387
  return await this._findOrCreateFolderByPath(t);
1385
1388
  } catch (t) {
@@ -1390,7 +1393,7 @@ for (var re = class {
1390
1393
  }
1391
1394
  constructor(e, t = {}, n, r = {}) {
1392
1395
  this._dataProvider = e, this._options = t, this._pathOptions = n, this._blobFetchForceReloadOnceIds = /* @__PURE__ */ new Set(), this._mutationRegistry = new s(), this._mapItem = async ({ childrenCount: e, ...t }) => {
1393
- let n = G(t);
1396
+ let n = K(t);
1394
1397
  if (n.isFolder) return {
1395
1398
  ...n,
1396
1399
  childCount: e,
@@ -1529,7 +1532,7 @@ for (var re = class {
1529
1532
  if (!this._dataProvider.pathMode) return null;
1530
1533
  let r = await this._getFileByPathStyleId(t);
1531
1534
  if (r && !r.isFolder) {
1532
- let e = G(r);
1535
+ let e = K(r);
1533
1536
  return this._cache.upsertEntity(e), await this._mapItem(e);
1534
1537
  }
1535
1538
  return null;
@@ -1544,14 +1547,14 @@ for (var re = class {
1544
1547
  }
1545
1548
  async getFiles({ folderId: e, search: t, sortBy: n, sortOrder: r, page: i, limit: a, itemType: o = "all", noFolder: s = !1 }) {
1546
1549
  s && (e = (await this.getTempFolder())?.id);
1547
- let c = this.normalizeId(e ?? this._rootId), l = this._options.enablePagination === !1, u = l ? 1 : i, d = l ? z : a, f = this._options.clientSideFilter, p = this._options.clientSideSorting, m = this._options.clientSidePaging, h = m ? Math.max(1, i ?? 1) : void 0, g = m ? typeof a == "number" && Number.isFinite(a) && a > 0 ? a : V : void 0, _ = this._emptyFilesResult(m ? h : u, m ? g : d);
1550
+ let c = this.normalizeId(e ?? this._rootId), l = this._options.enablePagination === !1, u = l ? 1 : i, d = l ? B : a, f = this._options.clientSideFilter, p = this._options.clientSideSorting, m = this._options.clientSidePaging, h = m ? Math.max(1, i ?? 1) : void 0, g = m ? typeof a == "number" && Number.isFinite(a) && a > 0 ? a : H : void 0, _ = this._emptyFilesResult(m ? h : u, m ? g : d);
1548
1551
  if (this._isDeletingId(c)) return _;
1549
1552
  let v = this._options.unifiedCatalogFetch !== !1 && l && (o === "folder" || o === "file"), y = v ? "all" : o, b = {
1550
1553
  folderId: c,
1551
1554
  itemType: y
1552
1555
  };
1553
- f || (b.search = t), p || (b.sortBy = n ?? (y === "folder" ? void 0 : "date"), b.sortOrder = r ?? (y === "folder" ? void 0 : "desc")), m || (b.page = u, b.limit = v ? B : d);
1554
- let x = v ? B : m ? void 0 : d, S = {
1556
+ f || (b.search = t), p || (b.sortBy = n ?? (y === "folder" ? void 0 : "date"), b.sortOrder = r ?? (y === "folder" ? void 0 : "desc")), m || (b.page = u, b.limit = v ? V : d);
1557
+ let x = v ? V : m ? void 0 : d, S = {
1555
1558
  folderId: c,
1556
1559
  itemType: y,
1557
1560
  search: f ? void 0 : t,
@@ -1562,11 +1565,11 @@ for (var re = class {
1562
1565
  }, C;
1563
1566
  try {
1564
1567
  C = await this._cache.getOrCreateChildren(c, S, async (e, t) => {
1565
- let n = t.pageSize, r = n != null && Number.isFinite(Number(n)) ? Number(n) : z, i = await this._dataProvider.getItems({
1568
+ let n = t.pageSize, r = n != null && Number.isFinite(Number(n)) ? Number(n) : B, i = await this._dataProvider.getItems({
1566
1569
  ...t,
1567
1570
  folderId: e,
1568
1571
  limit: r
1569
- }), a = K(i.items);
1572
+ }), a = q(i.items);
1570
1573
  return m ? {
1571
1574
  items: a,
1572
1575
  total: typeof i.pagination?.total == "number" ? i.pagination.total : a.length
@@ -1591,10 +1594,12 @@ for (var re = class {
1591
1594
  let T;
1592
1595
  T = m || f || v ? w.length : C.total ?? w.length;
1593
1596
  let E = w;
1594
- if (m) if (typeof this._options.clientSidePaging == "function") E = this._options.clientSidePaging(w, h, g);
1595
- else {
1596
- let e = (h - 1) * g, t = e + g;
1597
- E = w.slice(e, t);
1597
+ if (m) {
1598
+ if (typeof this._options.clientSidePaging == "function") E = this._options.clientSidePaging(w, h, g);
1599
+ else {
1600
+ let e = (h - 1) * g, t = e + g;
1601
+ E = w.slice(e, t);
1602
+ }
1598
1603
  }
1599
1604
  if (typeof this._dataProvider.getUrl == "function" || typeof this._dataProvider.getThumbnailUrl == "function") {
1600
1605
  let e = E.map(async (e) => {
@@ -1660,7 +1665,7 @@ for (var re = class {
1660
1665
  if (typeof this._dataProvider.findFileByUrl == "function") try {
1661
1666
  let t = await this._dataProvider.findFileByUrl(e);
1662
1667
  if (t) {
1663
- let e = G(t);
1668
+ let e = K(t);
1664
1669
  return this._cache.upsertEntity(e), e;
1665
1670
  }
1666
1671
  } catch (e) {
@@ -1678,7 +1683,7 @@ for (var re = class {
1678
1683
  folderId: t,
1679
1684
  itemType: "all",
1680
1685
  page: 1,
1681
- limit: V
1686
+ limit: H
1682
1687
  });
1683
1688
  return e.pagination.total ?? e.files.length;
1684
1689
  }
@@ -1706,7 +1711,7 @@ for (var re = class {
1706
1711
  let r = await this._dataProvider.uploadFile({
1707
1712
  ...t,
1708
1713
  folderId: n
1709
- }), i = G({
1714
+ }), i = K({
1710
1715
  name: t.name,
1711
1716
  size: t.size,
1712
1717
  ...r,
@@ -1744,10 +1749,10 @@ for (var re = class {
1744
1749
  folderId: a,
1745
1750
  items: e
1746
1751
  });
1747
- o = U(t, (e) => {
1752
+ o = W(t, (e) => {
1748
1753
  if (e) return {
1749
1754
  id: e.id,
1750
- name: W(e.name),
1755
+ name: G(e.name),
1751
1756
  folderId: e.folderId,
1752
1757
  url: e.url,
1753
1758
  thumbnailUrl: e.thumbnailUrl,
@@ -1759,7 +1764,7 @@ for (var re = class {
1759
1764
  for (let e = 0; e < o.detailed.length; e++) {
1760
1765
  let t = o.detailed[e];
1761
1766
  if (t && t.success) {
1762
- let r = t.data, i = r?.id ?? t.requestId, o = n?.[e]?.data, s = G({
1767
+ let r = t.data, i = r?.id ?? t.requestId, o = n?.[e]?.data, s = K({
1763
1768
  ...o,
1764
1769
  ...r,
1765
1770
  id: i,
@@ -1833,7 +1838,7 @@ for (var re = class {
1833
1838
  detailed: []
1834
1839
  }, i = n.permanent ? null : await this.getTrashFolder();
1835
1840
  if (typeof this._dataProvider.deleteItems == "function") {
1836
- if (r = U(await this._dataProvider.deleteItems(t.map((e) => this._cache.getEntity(e)), n), (e) => e), r.success) {
1841
+ if (r = W(await this._dataProvider.deleteItems(t.map((e) => this._cache.getEntity(e)), n), (e) => e), r.success) {
1837
1842
  let e = r.detailed || t.map((e) => ({
1838
1843
  requestId: e,
1839
1844
  success: !0,
@@ -1891,7 +1896,7 @@ for (var re = class {
1891
1896
  async createFolder({ name: t, parentId: n, is_force_create: r }) {
1892
1897
  let i = this.normalizeId(n ?? this._rootId);
1893
1898
  if (this._validateName(t, !0), this._validateDuplicates && this._checkNameExistsInCache(i, t, !0)) throw new e("Folder '%s' already exists in parent folder".replace("%s", t), "FolderAlreadyExists");
1894
- let a = await this._dataProvider.createFolder(t, i, r), o = G({
1899
+ let a = await this._dataProvider.createFolder(t, i, r), o = K({
1895
1900
  id: a.id,
1896
1901
  folderId: i,
1897
1902
  name: a.name,
@@ -1930,8 +1935,8 @@ for (var re = class {
1930
1935
  let t = this.normalizeId(i.folderId);
1931
1936
  if (this._checkNameExistsInCache(t, n, !0, r)) throw new e("Folder '%s' already exists in parent folder".replace("%s", n), "FolderAlreadyExists");
1932
1937
  }
1933
- let a = q(await this._dataProvider.renameItem(i, n));
1934
- return this._cache.upsertEntity(G({
1938
+ let a = J(await this._dataProvider.renameItem(i, n));
1939
+ return this._cache.upsertEntity(K({
1935
1940
  ...this._cache.getEntity(a.id),
1936
1941
  ...a
1937
1942
  })), this._cache.getEntity(a.id);
@@ -1945,8 +1950,8 @@ for (var re = class {
1945
1950
  let t = this.normalizeId(r.folderId);
1946
1951
  if (this._checkNameExistsInCache(t, n, !1, i)) throw new e("File '%s' already exists in parent folder".replace("%s", n), "FileAlreadyExists");
1947
1952
  }
1948
- let a = q(await this._dataProvider.renameItem(r, n));
1949
- return a && this._cache.upsertEntity(G({
1953
+ let a = J(await this._dataProvider.renameItem(r, n));
1954
+ return a && this._cache.upsertEntity(K({
1950
1955
  ...this._cache.getEntity(i),
1951
1956
  ...a
1952
1957
  })), this._cache.getEntity(i);
@@ -1957,12 +1962,12 @@ for (var re = class {
1957
1962
  this._validateTargetFolderType(n);
1958
1963
  let a = this._cache.getEntity(t);
1959
1964
  if (!a) {
1960
- let e = q(await this._dataProvider.moveItem({
1965
+ let e = J(await this._dataProvider.moveItem({
1961
1966
  id: t,
1962
1967
  folderId: i,
1963
1968
  isFolder: r
1964
1969
  }, i));
1965
- if (e.id === t) this._cache.upsertEntity(G({
1970
+ if (e.id === t) this._cache.upsertEntity(K({
1966
1971
  ...e,
1967
1972
  folderId: i
1968
1973
  }));
@@ -1970,7 +1975,7 @@ for (var re = class {
1970
1975
  try {
1971
1976
  this._cache.deleteEntity(t);
1972
1977
  } catch {}
1973
- this._cache.upsertEntity(G({
1978
+ this._cache.upsertEntity(K({
1974
1979
  ...e,
1975
1980
  folderId: i
1976
1981
  }));
@@ -1985,16 +1990,17 @@ for (var re = class {
1985
1990
  let t = a.isFolder ? "FolderAlreadyExists" : "FileAlreadyExists";
1986
1991
  throw new e(`${a.isFolder ? "Folder" : "File"} '${a.name}' already exists in target folder`, t);
1987
1992
  }
1988
- let o = q(await this._dataProvider.moveItem(a, i));
1993
+ let o = J(await this._dataProvider.moveItem(a, i));
1989
1994
  if (o.id === t) {
1990
1995
  let e = this._cache.moveEntity(t, i);
1991
- return this._cache.upsertEntity(G({
1996
+ return this._cache.upsertEntity(K({
1992
1997
  ...e,
1993
1998
  ...o
1994
1999
  })), !0;
1995
- } else {
2000
+ }
2001
+ {
1996
2002
  let e = this._cache.deleteEntity(t);
1997
- return this._cache.upsertEntity(G({
2003
+ return this._cache.upsertEntity(K({
1998
2004
  ...e,
1999
2005
  ...o,
2000
2006
  folderId: i
@@ -2019,7 +2025,7 @@ for (var re = class {
2019
2025
  detailed: Array(i.length),
2020
2026
  success: !0
2021
2027
  };
2022
- if (typeof this._dataProvider.moveItems == "function") a = U(await this._dataProvider.moveItems(i, r), (e) => e);
2028
+ if (typeof this._dataProvider.moveItems == "function") a = W(await this._dataProvider.moveItems(i, r), (e) => e);
2023
2029
  else if (typeof this._dataProvider.moveItem == "function") a.detailed = await Promise.all(n.map(async (e, t) => {
2024
2030
  let n = i[t] || {
2025
2031
  id: e,
@@ -2030,7 +2036,7 @@ for (var re = class {
2030
2036
  try {
2031
2037
  return {
2032
2038
  requestId: e,
2033
- data: q(await this._dataProvider.moveItem(n, r)),
2039
+ data: J(await this._dataProvider.moveItem(n, r)),
2034
2040
  success: !0
2035
2041
  };
2036
2042
  } catch (t) {
@@ -2048,21 +2054,24 @@ for (var re = class {
2048
2054
  success: !0,
2049
2055
  data: void 0
2050
2056
  }));
2051
- for (let t of e) if (t.success) if (!t.data || t.data.id === t.requestId) this._cache.moveEntity(t.requestId, r), t.data && this._cache.upsertEntity(G({
2052
- ...this._cache.getEntity(t.requestId),
2053
- ...t.data,
2054
- folderId: r
2055
- }));
2056
- else {
2057
- let e = this._cache.deleteEntity(t.requestId);
2058
- this._cache.upsertEntity(G({
2059
- ...e,
2057
+ for (let t of e) if (t.success) {
2058
+ if (!t.data || t.data.id === t.requestId) this._cache.moveEntity(t.requestId, r), t.data && this._cache.upsertEntity(K({
2059
+ ...this._cache.getEntity(t.requestId),
2060
2060
  ...t.data,
2061
2061
  folderId: r
2062
2062
  }));
2063
+ else {
2064
+ let e = this._cache.deleteEntity(t.requestId);
2065
+ this._cache.upsertEntity(K({
2066
+ ...e,
2067
+ ...t.data,
2068
+ folderId: r
2069
+ }));
2070
+ }
2063
2071
  }
2064
2072
  return a;
2065
- } else return {
2073
+ }
2074
+ return {
2066
2075
  success: !1,
2067
2076
  error: a.error || new e("Move items failed", "MoveNotAllowed")
2068
2077
  };
@@ -2073,11 +2082,11 @@ for (var re = class {
2073
2082
  this._validateTargetFolderType(n);
2074
2083
  let i = this._cache.getEntity(t);
2075
2084
  if (!i) {
2076
- let e = q(await this._dataProvider.copyItem({
2085
+ let e = J(await this._dataProvider.copyItem({
2077
2086
  id: t,
2078
2087
  folderId: r
2079
2088
  }, r));
2080
- return this._cache.copyEntity(t, r, e.id), this._cache.upsertEntity(G({
2089
+ return this._cache.copyEntity(t, r, e.id), this._cache.upsertEntity(K({
2081
2090
  ...e,
2082
2091
  folderId: r
2083
2092
  })), !0;
@@ -2089,11 +2098,11 @@ for (var re = class {
2089
2098
  throw new e(`${i.isFolder ? "Folder" : "File"} '${i.name}' already exists in target folder`, t);
2090
2099
  }
2091
2100
  }
2092
- let a = q(await this._dataProvider.copyItem(i, r));
2101
+ let a = J(await this._dataProvider.copyItem(i, r));
2093
2102
  return this._cache.copyEntity(t, r, a.id, {
2094
2103
  ...a,
2095
2104
  folderId: r
2096
- }) || this._cache.upsertEntity(G({
2105
+ }) || this._cache.upsertEntity(K({
2097
2106
  ...a,
2098
2107
  folderId: r
2099
2108
  })), !0;
@@ -2122,7 +2131,7 @@ for (var re = class {
2122
2131
  detailed: Array(o.length),
2123
2132
  success: !0
2124
2133
  };
2125
- if (typeof this._dataProvider.copyItems == "function") s = U(await this._dataProvider.copyItems(o, r), (e) => e);
2134
+ if (typeof this._dataProvider.copyItems == "function") s = W(await this._dataProvider.copyItems(o, r), (e) => e);
2126
2135
  else if (typeof this._dataProvider.copyItem == "function") s.detailed = await Promise.all(a.map(async (e, t) => {
2127
2136
  let n = o[t] || {
2128
2137
  id: e,
@@ -2132,7 +2141,7 @@ for (var re = class {
2132
2141
  try {
2133
2142
  return {
2134
2143
  requestId: e,
2135
- data: q(await this._dataProvider.copyItem(n, r)),
2144
+ data: J(await this._dataProvider.copyItem(n, r)),
2136
2145
  success: !0
2137
2146
  };
2138
2147
  } catch (t) {
@@ -2146,16 +2155,18 @@ for (var re = class {
2146
2155
  else throw new e("Copy items is not supported", "CopyNotAllowed");
2147
2156
  if (s.success && s.detailed) for (let e = 0, t = s.detailed.length; e < t; e++) {
2148
2157
  let t = s.detailed[e];
2149
- if (t.success) if (t.data?.id) {
2150
- let e = t.data.folderId || r;
2151
- !this._cache.copyEntity(t.requestId, e, t.data.id, {
2152
- ...t.data,
2153
- folderId: e
2154
- }) && t.data && this._cache.upsertEntity(G({
2155
- ...t.data,
2156
- folderId: e
2157
- }));
2158
- } else console.error("batchResult in copy method must have ids");
2158
+ if (t.success) {
2159
+ if (t.data?.id) {
2160
+ let e = t.data.folderId || r;
2161
+ !this._cache.copyEntity(t.requestId, e, t.data.id, {
2162
+ ...t.data,
2163
+ folderId: e
2164
+ }) && t.data && this._cache.upsertEntity(K({
2165
+ ...t.data,
2166
+ folderId: e
2167
+ }));
2168
+ } else console.error("batchResult in copy method must have ids");
2169
+ }
2159
2170
  }
2160
2171
  else if (!s.detailed) throw new e("batchResult in copy method must have detailed results", "ValidationError");
2161
2172
  return s;
@@ -2170,7 +2181,7 @@ for (var re = class {
2170
2181
  }
2171
2182
  let t = this.normalizeId(e.folderId ?? this._rootId);
2172
2183
  try {
2173
- let n = G({
2184
+ let n = K({
2174
2185
  ...await this._dataProvider.uploadFileByUrl(e.url, t, { eventSource: e.eventSource }),
2175
2186
  folderId: t
2176
2187
  });
@@ -2187,42 +2198,15 @@ for (var re = class {
2187
2198
  let t = this.normalizeId(i.folderId);
2188
2199
  if (this._checkNameExistsInCache(t, n.name, !1, r)) throw new e("File '%s' already exists in parent folder".replace("%s", n.name), "FileAlreadyExists");
2189
2200
  }
2190
- let a = q(await this._dataProvider.updateFile(i, { ...n }));
2191
- return this._cache.upsertEntity(G({
2201
+ let a = J(await this._dataProvider.updateFile(i, { ...n }));
2202
+ return this._cache.upsertEntity(K({
2192
2203
  ...this._cache.getEntity(r),
2193
2204
  ...a,
2194
2205
  ...n
2195
2206
  })), this._cache.getEntity(r);
2196
2207
  }
2197
- }, Y = [], X = 0; X < 256; ++X) Y.push((X + 256).toString(16).slice(1));
2198
- function ie(e, t = 0) {
2199
- return (Y[e[t + 0]] + Y[e[t + 1]] + Y[e[t + 2]] + Y[e[t + 3]] + "-" + Y[e[t + 4]] + Y[e[t + 5]] + "-" + Y[e[t + 6]] + Y[e[t + 7]] + "-" + Y[e[t + 8]] + Y[e[t + 9]] + "-" + Y[e[t + 10]] + Y[e[t + 11]] + Y[e[t + 12]] + Y[e[t + 13]] + Y[e[t + 14]] + Y[e[t + 15]]).toLowerCase();
2200
- }
2201
- //#endregion
2202
- //#region packages/file-manager/node_modules/uuid/dist/esm-browser/rng.js
2203
- var Z, ae = /* @__PURE__ */ new Uint8Array(16);
2204
- function oe() {
2205
- if (!Z && (Z = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Z)) throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2206
- return Z(ae);
2207
- }
2208
- var Q = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
2209
- //#endregion
2210
- //#region packages/file-manager/node_modules/uuid/dist/esm-browser/v4.js
2211
- function se(e, t, n) {
2212
- if (Q.randomUUID && !t && !e) return Q.randomUUID();
2213
- e ||= {};
2214
- var r = e.random || (e.rng || oe)();
2215
- if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
2216
- n ||= 0;
2217
- for (var i = 0; i < 16; ++i) t[n + i] = r[i];
2218
- return t;
2219
- }
2220
- return ie(r);
2221
- }
2222
- //#endregion
2223
- //#region packages/file-manager/src/adapters/PathAwareStorageAdapter.ts
2224
- var ce = "", le = "Trash", ue = class {
2225
- constructor(e, t = ce, n = _, r = le, i = !0) {
2208
+ }, re = "", ie = "Trash", ae = class {
2209
+ constructor(e, t = re, n = _, r = ie, i = !0) {
2226
2210
  this._inner = e, this.rootPath = t, this.trashId = n, this.trashPath = r, this.ensureFolderTrailingSlash = i, this._pathToId = /* @__PURE__ */ new Map(), this._idToPath = /* @__PURE__ */ new Map(), this.validateDuplicates = this._inner.validateDuplicates ?? !1, typeof e.getUrl == "function" && (this.getUrl = (t) => e.getUrl({
2227
2211
  ...t,
2228
2212
  id: this.pathForId(t.id, !1),
@@ -2283,7 +2267,7 @@ var ce = "", le = "Trash", ue = class {
2283
2267
  let t = v(e);
2284
2268
  if (t === v(this.trashPath)) return this.trashId;
2285
2269
  if (this._pathToId.has(t)) return this._pathToId.get(t);
2286
- let n = se();
2270
+ let n = x();
2287
2271
  return this._pathToId.set(t, n), this._idToPath.set(n, t), n;
2288
2272
  }
2289
2273
  pathForId(t, n, r) {
@@ -2682,15 +2666,15 @@ var ce = "", le = "Trash", ue = class {
2682
2666
  };
2683
2667
  //#endregion
2684
2668
  //#region packages/file-manager/src/utils/directResourceFetchError.ts
2685
- function de(e) {
2669
+ function oe(e) {
2686
2670
  return typeof e != "object" || !e ? !1 : "name" in e && e.name === "DirectResourceFetchError" ? !("final" in e) || e.final !== !1 : "final" in e && e.final === !0;
2687
2671
  }
2688
2672
  //#endregion
2689
2673
  //#region packages/file-manager/src/utils/remoteFileFetchPipeline.ts
2690
- function $(t) {
2691
- if (de(t) || t instanceof e) throw t;
2674
+ function X(t) {
2675
+ if (oe(t) || t instanceof e) throw t;
2692
2676
  }
2693
- async function fe(e, t, n, r, i) {
2677
+ async function se(e, t, n, r, i) {
2694
2678
  let { fetchWithProxy: a, handleFileProxy: o, handleProxyUrl: s } = t, c = {
2695
2679
  mode: "cors",
2696
2680
  ...i?.fetchInit
@@ -2699,29 +2683,58 @@ async function fe(e, t, n, r, i) {
2699
2683
  let t = await Promise.resolve(o(e));
2700
2684
  if (t) return r(t);
2701
2685
  } catch (e) {
2702
- $(e), l = e, console.warn("handleFileProxy failed, falling back to next strategy", e);
2686
+ X(e), l = e, console.warn("handleFileProxy failed, falling back to next strategy", e);
2703
2687
  }
2704
2688
  if (s) try {
2705
2689
  let t = await Promise.resolve(s(e));
2706
2690
  if (t && t !== e) return r(await n(t));
2707
2691
  } catch (e) {
2708
- $(e), l = e, console.warn("handleProxyUrl fetch failed, falling back to next strategy", e);
2692
+ X(e), l = e, console.warn("handleProxyUrl fetch failed, falling back to next strategy", e);
2709
2693
  }
2710
2694
  if (a) try {
2711
2695
  let t = await Promise.resolve(a(e, c, { intent: "downloadBlob" }));
2712
2696
  if (!t.ok) throw Error(`HTTP ${t.status}`);
2713
2697
  return r(await t.blob());
2714
2698
  } catch (e) {
2715
- $(e), l = e, console.warn("fetchWithProxy failed", e);
2699
+ X(e), l = e, console.warn("fetchWithProxy failed", e);
2716
2700
  }
2717
2701
  if (!a) try {
2718
2702
  return r(await n(e));
2719
2703
  } catch (e) {
2720
- $(e), l = e;
2704
+ X(e), l = e;
2721
2705
  }
2722
2706
  throw l instanceof Error ? l : /* @__PURE__ */ Error("Failed to download file from the URL");
2723
2707
  }
2724
2708
  //#endregion
2725
- export { E as DEFAULT_FILE_MANAGER_CACHE_TTL_MS, re as DataSourceProxyBase, o as FailedRequestCache, e as FileManagerApiError, s as MutationRegistry, ue as PathAwareStorageAdapter, _ as TRASH_FOLDER_ID, R as TreeCache, L as ViewCacheManager, i as buildAssetsPath, l as compareFileSystemItems, b as createSystemFolderByPathResolver, m as defaultChildrenViewFilterMatch, p as defaultFileSystemItemComparator, h as defaultHasSortValue, N as defaultIsFolderNotFoundError, fe as fetchRemoteImageBlobByUrl, r as getAssetsBase, y as getTrashFolderLookupCandidates, d as hasComparableSortValue, n as joinUrls, t as mapHttpStatusToErrorCode, f as matchesChildrenViewFilter, v as normalizeSystemFolderPath, c as resolveSortParams, g as resolveViewStrategyOptions };
2709
+ //#region packages/file-manager/src/utils/pngCompression.ts
2710
+ var Z = 1024, ce = Z / 4096, Q = [
2711
+ 137,
2712
+ 80,
2713
+ 78,
2714
+ 71,
2715
+ 13,
2716
+ 10,
2717
+ 26,
2718
+ 10
2719
+ ], le = 65536, ue = (e, t) => String.fromCharCode(e[t], e[t + 1], e[t + 2], e[t + 3]);
2720
+ function $(e) {
2721
+ if (e.length < Q.length || Q.some((t, n) => e[n] !== t)) return !1;
2722
+ let t = Q.length;
2723
+ for (; t + 8 <= e.length;) {
2724
+ let n = (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0, r = ue(e, t + 4);
2725
+ if (r === "acTL") return !0;
2726
+ if (r === "IDAT" || r === "IEND") return !1;
2727
+ t += 12 + n;
2728
+ }
2729
+ return !1;
2730
+ }
2731
+ async function de(e) {
2732
+ return $(new Uint8Array(await e.slice(0, le).arrayBuffer()));
2733
+ }
2734
+ function fe(e, t) {
2735
+ return t.size < e.size ? t : e;
2736
+ }
2737
+ //#endregion
2738
+ export { D as DEFAULT_FILE_MANAGER_CACHE_TTL_MS, ne as DataSourceProxyBase, o as FailedRequestCache, e as FileManagerApiError, s as MutationRegistry, Z as PNG_COMPRESSION_COLORS, ce as PNG_INITIAL_QUALITY, ae as PathAwareStorageAdapter, _ as TRASH_FOLDER_ID, R as TreeCache, L as ViewCacheManager, i as buildAssetsPath, l as compareFileSystemItems, b as createSystemFolderByPathResolver, m as defaultChildrenViewFilterMatch, p as defaultFileSystemItemComparator, h as defaultHasSortValue, N as defaultIsFolderNotFoundError, se as fetchRemoteImageBlobByUrl, r as getAssetsBase, y as getTrashFolderLookupCandidates, d as hasComparableSortValue, $ as isAnimatedPng, de as isAnimatedPngFile, n as joinUrls, fe as keepSmallerPng, t as mapHttpStatusToErrorCode, f as matchesChildrenViewFilter, v as normalizeSystemFolderPath, c as resolveSortParams, g as resolveViewStrategyOptions };
2726
2739
 
2727
2740
  //# sourceMappingURL=core.esm.js.map