ode-explorer 1.3.2 → 1.3.3-develop.202402061659

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.
package/lib/index2.js CHANGED
@@ -1,22 +1,22 @@
1
1
  var he = Object.defineProperty;
2
2
  var fe = (e, t, s) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var $ = (e, t, s) => (fe(e, typeof t != "symbol" ? t + "" : t, s), s);
4
- import { jsx as c, jsxs as N, Fragment as oe } from "react/jsx-runtime";
5
- import { useState as ae, useRef as pe, useEffect as U, lazy as D, Suspense as v, Fragment as me } from "react";
6
- import { useScrollToTop as ye, useOdeClient as M, IconButton as ge, useToast as q, useUser as Ie, LoadingScreen as A, FormControl as we, Input as Se, SearchButton as xe, Dropdown as j, useToggle as De, TreeView as be, Button as Te, useXitiTrackPageLoad as Fe, isActionAvailable as ne, AppHeader as Ne, Breadcrumb as Ce, Grid as ee } from "@edifice-ui/react";
7
- import { ArrowLeft as Re, Filter as Pe, Delete as Ae, Plus as Ee } from "@edifice-ui/icons";
4
+ import { jsx as c, jsxs as F, Fragment as oe } from "react/jsx-runtime";
5
+ import { useState as ae, useRef as pe, useEffect as L, lazy as x, Suspense as q, Fragment as me } from "react";
6
+ import { useScrollToTop as ge, useOdeClient as U, IconButton as ye, useToast as O, useShareMutation as Ie, useUpdateMutation as Se, useUser as we, LoadingScreen as R, FormControl as xe, Input as De, SearchButton as be, Dropdown as j, useToggle as Te, TreeView as Fe, Button as Ce, useXitiTrackPageLoad as Ne, isActionAvailable as ne, AppHeader as Re, Breadcrumb as Pe, Grid as ee } from "@edifice-ui/react";
7
+ import { ArrowLeft as Ae, Filter as Qe, Delete as Ee, Plus as qe } from "@edifice-ui/icons";
8
8
  import { useTranslation as z } from "react-i18next";
9
- import { odeServices as C, FOLDER as F } from "edifice-ts-client";
10
- import { t as x } from "i18next";
11
- import { create as Qe } from "zustand";
12
- import { useQuery as ve, useInfiniteQuery as qe, useQueryClient as k, useMutation as O } from "@tanstack/react-query";
9
+ import { odeServices as A, FOLDER as T } from "edifice-ts-client";
10
+ import { t as P } from "i18next";
11
+ import { create as ve } from "zustand";
12
+ import { useQuery as ke, useInfiniteQuery as Oe, useQueryClient as v, useMutation as M } from "@tanstack/react-query";
13
13
  const ce = async (e) => {
14
- const t = await C.resource(e.application).searchContext(e);
14
+ const t = await A.resource(e.application).searchContext(e);
15
15
  return {
16
16
  ...t,
17
17
  folders: t.folders.filter((s) => !s.trashed)
18
18
  };
19
- }, ke = async ({
19
+ }, Le = async ({
20
20
  searchParams: e,
21
21
  name: t,
22
22
  parentId: s
@@ -27,8 +27,8 @@ const ce = async (e) => {
27
27
  application: e.application,
28
28
  type: e.types[0]
29
29
  };
30
- return await C.resource(e.application).createFolder(r);
31
- }, Oe = async ({
30
+ return await A.resource(e.application).createFolder(r);
31
+ }, Ue = async ({
32
32
  folderId: e,
33
33
  searchParams: t,
34
34
  parentId: s,
@@ -41,8 +41,8 @@ const ce = async (e) => {
41
41
  application: t.application,
42
42
  type: t.types[0]
43
43
  };
44
- return await C.resource(t.application).updateFolder(n);
45
- }, Le = async ({
44
+ return await A.resource(t.application).updateFolder(n);
45
+ }, Me = async ({
46
46
  searchParams: e,
47
47
  resourceIds: t,
48
48
  useAssetIds: s,
@@ -54,8 +54,8 @@ const ce = async (e) => {
54
54
  resourceIds: t,
55
55
  folderIds: r
56
56
  };
57
- return await C.resource(e.application).trashAll(n, s);
58
- }, Ue = async ({
57
+ return await A.resource(e.application).trashAll(n, s);
58
+ }, Be = async ({
59
59
  searchParams: e,
60
60
  resourceIds: t,
61
61
  useAssetIds: s,
@@ -67,8 +67,8 @@ const ce = async (e) => {
67
67
  resourceIds: t,
68
68
  folderIds: r
69
69
  };
70
- return await C.resource(e.application).deleteAll(n, s);
71
- }, Me = async ({
70
+ return await A.resource(e.application).deleteAll(n, s);
71
+ }, Ke = async ({
72
72
  searchParams: e,
73
73
  resourceIds: t,
74
74
  folderIds: s,
@@ -80,8 +80,8 @@ const ce = async (e) => {
80
80
  resourceIds: t,
81
81
  folderIds: s
82
82
  };
83
- return await C.resource(e.application).restoreAll(n, r);
84
- }, Be = async ({
83
+ return await A.resource(e.application).restoreAll(n, r);
84
+ }, $e = async ({
85
85
  searchParams: e,
86
86
  resourceIds: t,
87
87
  folderId: s,
@@ -94,28 +94,22 @@ const ce = async (e) => {
94
94
  resourceIds: t,
95
95
  folderIds: r
96
96
  };
97
- return await C.resource(e.application).moveToFolder(a, n);
98
- }, Ke = async ({
99
- searchParams: e,
100
- resourceId: t,
101
- rights: s
102
- }) => await C.share().saveRights(e.application, t, s), $e = async ({
103
- searchParams: e,
104
- params: t
105
- }) => await C.resource(e.application).update(t), je = async (e) => await C.rights().sessionHasWorkflowRights(e), ze = ({
97
+ return await A.resource(e.application).moveToFolder(a, n);
98
+ };
99
+ const je = async (e) => await A.rights().sessionHasWorkflowRights(e), ze = ({
106
100
  searchParams: e,
107
101
  assetId: t
108
102
  }) => {
109
- const s = C.resource(e.application).getViewUrl(t);
103
+ const s = A.resource(e.application).getViewUrl(t);
110
104
  window.open(s, "_self");
111
105
  }, _e = ({
112
106
  searchParams: e,
113
107
  params: t
114
- }) => C.resource(e.application).create(t), Ve = ({
108
+ }) => A.resource(e.application).create(t), Ve = ({
115
109
  searchParams: e,
116
110
  assetId: t
117
111
  }) => {
118
- const s = C.resource(e.application).getPrintUrl(t);
112
+ const s = A.resource(e.application).getPrintUrl(t);
119
113
  return window.open(s, "_blank");
120
114
  };
121
115
  function se(e) {
@@ -129,7 +123,7 @@ function V(e, t) {
129
123
  function He(e, t) {
130
124
  var r;
131
125
  const s = V(e, t);
132
- return (r = s == null ? void 0 : s.folder) != null && r.ancestors ? [...(s == null ? void 0 : s.folder.ancestors) || [], e] : e === F.BIN ? [F.BIN] : [F.DEFAULT];
126
+ return (r = s == null ? void 0 : s.folder) != null && r.ancestors ? [...(s == null ? void 0 : s.folder.ancestors) || [], e] : e === T.BIN ? [T.BIN] : [T.DEFAULT];
133
127
  }
134
128
  function ie(e, t) {
135
129
  return t.id === e && t.children ? t.children.length > 0 : t.children ? t.children.some((s) => ie(t.id, s)) : !1;
@@ -163,7 +157,7 @@ class G {
163
157
  this.folder = t, this.id = t.id, this.name = t.name, this.childNumber = t.childNumber;
164
158
  }
165
159
  }
166
- const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? void 0 : t.map((n) => new G(n))), r)), w = Qe()((e, t) => ({
160
+ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? void 0 : t.map((n) => new G(n))), r)), S = ve()((e, t) => ({
167
161
  config: null,
168
162
  searchConfig: {
169
163
  minLength: 1
@@ -188,8 +182,8 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
188
182
  trashed: !1
189
183
  },
190
184
  treeData: {
191
- id: F.DEFAULT,
192
- name: x("explorer.filters.mine"),
185
+ id: T.DEFAULT,
186
+ name: P("explorer.filters.mine"),
193
187
  section: !0,
194
188
  children: []
195
189
  },
@@ -328,13 +322,13 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
328
322
  const {
329
323
  searchParams: n,
330
324
  treeData: a
331
- } = t(), o = n.filters.folder, l = He(s, a), h = se([...l, s]);
332
- o !== s && e((d) => ({
333
- ...d,
325
+ } = t(), o = n.filters.folder, l = He(s, a), f = se([...l, s]);
326
+ o !== s && e((u) => ({
327
+ ...u,
334
328
  // reset selection when changing folder
335
329
  folderIds: [],
336
330
  resourceIds: [],
337
- selectedNodesIds: h,
331
+ selectedNodesIds: f,
338
332
  currentFolder: r || {
339
333
  id: s
340
334
  },
@@ -345,7 +339,7 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
345
339
  ...n.filters,
346
340
  folder: s
347
341
  },
348
- trashed: s === F.BIN
342
+ trashed: s === T.BIN
349
343
  }
350
344
  }));
351
345
  },
@@ -381,10 +375,10 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
381
375
  trashed: !1
382
376
  }]);
383
377
  e((l) => {
384
- var h;
378
+ var f;
385
379
  return {
386
380
  ...l,
387
- treeData: de(n, (h = o == null ? void 0 : o.pages[0]) == null ? void 0 : h.folders, s || F.DEFAULT)
381
+ treeData: de(n, (f = o == null ? void 0 : o.pages[0]) == null ? void 0 : f.folders, s || T.DEFAULT)
388
382
  };
389
383
  });
390
384
  }
@@ -395,7 +389,7 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
395
389
  } = t(), {
396
390
  openFolder: n
397
391
  } = t().updaters, a = V(s, r);
398
- ye()(), e((l) => ({
392
+ ge()(), e((l) => ({
399
393
  ...l,
400
394
  searchParams: {
401
395
  ...l.searchParams,
@@ -420,7 +414,7 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
420
414
  const o = V(s[a - 2], r);
421
415
  n({
422
416
  folder: o,
423
- folderId: (o == null ? void 0 : o.id) || F.DEFAULT
417
+ folderId: (o == null ? void 0 : o.id) || T.DEFAULT
424
418
  });
425
419
  },
426
420
  goToTrash: () => e((s) => ({
@@ -434,82 +428,82 @@ const de = (e, t, s) => H(e, (r) => (r.id === s && (r.children = t == null ? voi
434
428
  ...s.searchParams,
435
429
  search: void 0,
436
430
  filters: {
437
- folder: F.BIN
431
+ folder: T.BIN
438
432
  },
439
433
  trashed: !0
440
434
  },
441
435
  currentFolder: {
442
- id: F.BIN
436
+ id: T.BIN
443
437
  }
444
438
  }))
445
439
  }
446
- })), b = () => w((e) => e.searchParams), te = () => w((e) => e.selectedNodesIds), _ = () => w((e) => e.treeData), Us = () => w((e) => e.selectedFolders), Ms = () => w((e) => e.selectedResources), We = () => w((e) => e.searchConfig), J = () => w((e) => e.folderIds), X = () => w((e) => e.resourceIds), Y = () => w((e) => e.selectedResources.map((t) => t.assetId)), Z = () => w((e) => e.selectedResources.filter((t) => t.assetId === t.id)), W = () => w((e) => e.currentFolder), S = () => w((e) => e.updaters), re = () => {
440
+ })), D = () => S((e) => e.searchParams), te = () => S((e) => e.selectedNodesIds), _ = () => S((e) => e.treeData), Us = () => S((e) => e.selectedFolders), Ms = () => S((e) => e.selectedResources), We = () => S((e) => e.searchConfig), J = () => S((e) => e.folderIds), X = () => S((e) => e.resourceIds), Y = () => S((e) => e.selectedResources.map((t) => t.assetId)), Z = () => S((e) => e.selectedResources.filter((t) => t.assetId === t.id)), W = () => S((e) => e.currentFolder), w = () => S((e) => e.updaters), re = () => {
447
441
  const e = W();
448
- return (e == null ? void 0 : e.id) === F.BIN;
449
- }, Ge = () => w((e) => e.resourceIsTrash), Je = () => w((e) => e.resourceActionDisable), Xe = () => {
442
+ return (e == null ? void 0 : e.id) === T.BIN;
443
+ }, Ge = () => S((e) => e.resourceIsTrash), Je = () => S((e) => e.resourceActionDisable), Xe = () => {
450
444
  const e = W();
451
445
  return (e == null ? void 0 : e.id) === "default";
452
- }, Ye = () => te().length > 1, Ze = () => w((e) => e.status), ue = () => {
453
- const e = b(), [t, s] = ae(""), r = We(), n = Ze(), a = pe(null), {
446
+ }, Ye = () => te().length > 1, Ze = () => S((e) => e.status), ue = () => {
447
+ const e = D(), [t, s] = ae(""), r = We(), n = Ze(), a = pe(null), {
454
448
  setSearchParams: o
455
- } = S(), l = (u) => {
456
- const f = u.target.value;
457
- s(f.toString());
458
- }, h = (u) => {
459
- (u.key === "Enter" || u.key === "Return") && (u.preventDefault(), o({
449
+ } = w(), l = (d) => {
450
+ const h = d.target.value;
451
+ s(h.toString());
452
+ }, f = (d) => {
453
+ (d.key === "Enter" || d.key === "Return") && (d.preventDefault(), o({
460
454
  search: t || void 0
461
455
  }));
462
- }, d = (u) => {
463
- u.preventDefault(), o({
456
+ }, u = (d) => {
457
+ d.preventDefault(), o({
464
458
  search: t || void 0
465
459
  });
466
460
  };
467
- return U(() => {
468
- const f = t.length == 0 || t.length >= r.minLength ? {
461
+ return L(() => {
462
+ const h = t.length == 0 || t.length >= r.minLength ? {
469
463
  search: t || void 0
470
464
  } : {};
471
465
  o({
472
466
  ...e,
473
- ...f
467
+ ...h
474
468
  });
475
- }, [t, r.minLength]), U(() => {
469
+ }, [t, r.minLength]), L(() => {
476
470
  n === "select" && s("");
477
- }, [n]), U(() => {
471
+ }, [n]), L(() => {
478
472
  s(() => {
479
- var u;
480
- return ((u = e.search) == null ? void 0 : u.toString()) ?? "";
473
+ var d;
474
+ return ((d = e.search) == null ? void 0 : d.toString()) ?? "";
481
475
  });
482
476
  }, [e]), {
483
477
  formRef: a,
484
478
  inputSearch: t,
485
479
  handleInputSearchChange: l,
486
- handleKeyPress: h,
487
- handleSearchSubmit: d
480
+ handleKeyPress: f,
481
+ handleSearchSubmit: u
488
482
  };
489
483
  };
490
484
  function es() {
491
485
  const {
492
486
  appCode: e
493
- } = M(), {
487
+ } = U(), {
494
488
  gotoPreviousFolder: t
495
- } = S(), {
489
+ } = w(), {
496
490
  t: s
497
491
  } = z(), {
498
492
  inputSearch: r
499
- } = ue(), n = te(), a = re(), o = W(), l = s("explorer.tree.trash"), h = s("explorer.tree.search"), d = s("explorer.filters.mine", {
493
+ } = ue(), n = te(), a = re(), o = W(), l = s("explorer.tree.trash"), f = s("explorer.tree.search"), u = s("explorer.filters.mine", {
500
494
  ns: e
501
- }), u = (o == null ? void 0 : o.name) || d;
502
- return /* @__PURE__ */ c("div", { className: "py-16", children: n.length > 1 && !a ? /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8", children: [
503
- /* @__PURE__ */ c(ge, { icon: /* @__PURE__ */ c(Re, {}), variant: "ghost", color: "tertiary", "aria-label": s("back"), className: "ms-n16", onClick: t }),
504
- /* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: u }) })
505
- ] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? h : a ? l : d }) });
495
+ }), d = (o == null ? void 0 : o.name) || u;
496
+ return /* @__PURE__ */ c("div", { className: "py-16", children: n.length > 1 && !a ? /* @__PURE__ */ F("div", { className: "d-flex align-items-center gap-8", children: [
497
+ /* @__PURE__ */ c(ye, { icon: /* @__PURE__ */ c(Ae, {}), variant: "ghost", color: "tertiary", "aria-label": s("back"), className: "ms-n16", onClick: t }),
498
+ /* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: d }) })
499
+ ] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? f : a ? l : u }) });
506
500
  }
507
501
  const ss = () => {
508
502
  const e = Je(), {
509
503
  clearSelectedIds: t,
510
504
  setResourceActionDisable: s,
511
505
  clearSelectedItems: r
512
- } = S();
506
+ } = w();
513
507
  return {
514
508
  isActionDisableModalOpen: e,
515
509
  onActionDisableCancel: () => {
@@ -521,7 +515,7 @@ const ss = () => {
521
515
  clearSelectedIds: t,
522
516
  setResourceIsTrash: s,
523
517
  clearSelectedItems: r
524
- } = S();
518
+ } = w();
525
519
  return {
526
520
  isTrashedModalOpen: e,
527
521
  onTrashedCancel: () => {
@@ -563,21 +557,21 @@ function os(e, {
563
557
  return H(e, (r, n) => {
564
558
  var a, o;
565
559
  if (t === r.id) {
566
- const l = [...((a = r.folder) == null ? void 0 : a.ancestors) || []], h = se([...l, r.id]), d = [...r.children || []], u = ((o = r.children) == null ? void 0 : o.map((i) => i.id)) || [];
560
+ const l = [...((a = r.folder) == null ? void 0 : a.ancestors) || []], f = se([...l, r.id]), u = [...r.children || []], d = ((o = r.children) == null ? void 0 : o.map((i) => i.id)) || [];
567
561
  for (const i of s)
568
- if (!u.includes(i)) {
562
+ if (!d.includes(i)) {
569
563
  const p = V(i, e);
570
- p && d.push({
564
+ p && u.push({
571
565
  ...p,
572
566
  folder: {
573
567
  ...p == null ? void 0 : p.folder,
574
- ancestors: h
568
+ ancestors: f
575
569
  }
576
570
  });
577
571
  }
578
572
  return {
579
573
  ...r,
580
- children: d
574
+ children: u
581
575
  };
582
576
  } else
583
577
  return s.includes(r.id) && t !== (n == null ? void 0 : n.id) ? void 0 : r;
@@ -590,8 +584,8 @@ function as(e, {
590
584
  return H(e, (r) => r.id === t ? new G(s) : r);
591
585
  }
592
586
  const cs = () => {
593
- const e = w((t) => t.config);
594
- return ve({
587
+ const e = S((t) => t.config);
588
+ return ke({
595
589
  queryKey: ["actions"],
596
590
  queryFn: async () => {
597
591
  const t = e == null ? void 0 : e.actions.map((r) => r.workflow);
@@ -605,7 +599,7 @@ const cs = () => {
605
599
  enabled: !!e
606
600
  });
607
601
  }, is = () => {
608
- const e = w((o) => o.config), t = b(), {
602
+ const e = S((o) => o.config), t = D(), {
609
603
  filters: s,
610
604
  trashed: r,
611
605
  search: n
@@ -615,7 +609,7 @@ const cs = () => {
615
609
  trashed: r,
616
610
  search: n
617
611
  }];
618
- return qe({
612
+ return Oe({
619
613
  queryKey: a,
620
614
  queryFn: async ({
621
615
  pageParam: o
@@ -628,82 +622,83 @@ const cs = () => {
628
622
  startIdx: o
629
623
  }
630
624
  }),
625
+ staleTime: 5e3,
631
626
  initialPageParam: 0,
632
627
  enabled: !!e,
633
628
  retry: !1,
634
629
  getNextPageParam: (o) => o.pagination.startIdx + o.pagination.pageSize
635
630
  });
636
631
  }, Bs = () => {
637
- const e = q(), t = k(), s = b(), r = _(), n = J(), a = Y(), o = X(), l = Z().length > 0, h = l ? a : o, {
638
- clearSelectedItems: d,
639
- clearSelectedIds: u,
640
- setTreeData: f,
632
+ const e = O(), t = v(), s = D(), r = _(), n = J(), a = Y(), o = X(), l = Z().length > 0, f = l ? a : o, {
633
+ clearSelectedItems: u,
634
+ clearSelectedIds: d,
635
+ setTreeData: h,
641
636
  setSearchParams: i
642
- } = S(), {
637
+ } = w(), {
643
638
  filters: p,
644
639
  trashed: m
645
- } = s, g = ["context", {
640
+ } = s, y = ["context", {
646
641
  folderId: p.folder,
647
642
  filters: p,
648
643
  trashed: m
649
644
  }];
650
- return O({
651
- mutationFn: async () => await Le({
645
+ return M({
646
+ mutationFn: async () => await Me({
652
647
  searchParams: s,
653
648
  folderIds: n,
654
- resourceIds: h,
649
+ resourceIds: f,
655
650
  useAssetIds: l
656
651
  }),
657
- onError(y) {
658
- typeof y == "string" && e.error(x(y));
652
+ onError(g) {
653
+ typeof g == "string" && e.error(P(g));
659
654
  },
660
- onSuccess: async (y) => {
655
+ onSuccess: async (g) => {
661
656
  if (await t.cancelQueries({
662
- queryKey: g
663
- }), t.getQueryData(g))
664
- return e.success(x("explorer.trash.title")), t.setQueryData(g, (T) => {
665
- var E;
666
- if (T) {
667
- const L = {
668
- ...T,
669
- pages: T == null ? void 0 : T.pages.map((R) => {
670
- var P;
657
+ queryKey: y
658
+ }), t.getQueryData(y))
659
+ return e.success(P("explorer.trash.title")), t.setQueryData(y, (b) => {
660
+ var Q;
661
+ if (b) {
662
+ const k = {
663
+ ...b,
664
+ pages: b == null ? void 0 : b.pages.map((C) => {
665
+ var N;
671
666
  return {
672
- ...R,
673
- folders: R.folders.filter((Q) => !n.includes(Q.id)),
667
+ ...C,
668
+ folders: C.folders.filter((E) => !n.includes(E.id)),
674
669
  pagination: {
675
- ...R.pagination,
670
+ ...C.pagination,
676
671
  // @ts-ignore
677
- maxIdx: ((P = R == null ? void 0 : R.pagination) == null ? void 0 : P.maxIdx) - y.resources.length
672
+ maxIdx: ((N = C == null ? void 0 : C.pagination) == null ? void 0 : N.maxIdx) - g.resources.length
678
673
  },
679
- resources: R.resources.filter((Q) => l ? !a.includes(Q.assetId) : !h.includes(Q.id))
674
+ resources: C.resources.filter((E) => l ? !a.includes(E.assetId) : !f.includes(E.id))
680
675
  };
681
676
  })
682
677
  }, B = ns(r, {
683
678
  folders: n
684
679
  });
685
- return f(B), i({
680
+ return h(B), i({
686
681
  ...s,
687
682
  pagination: {
688
683
  ...s.pagination,
689
684
  // @ts-ignore
690
- maxIdx: ((E = s.pagination) == null ? void 0 : E.maxIdx) - y.resources.length
685
+ maxIdx: ((Q = s.pagination) == null ? void 0 : Q.maxIdx) - g.resources.length
691
686
  }
692
- }), L;
687
+ }), k;
693
688
  }
694
689
  });
695
690
  },
696
691
  onSettled: () => {
697
- d(), u();
692
+ u(), d();
698
693
  }
699
694
  });
700
695
  }, Ks = () => {
701
- const e = q(), t = k(), s = b(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
702
- setFolderIds: h,
703
- setResourceIds: d,
704
- setSelectedResources: u,
705
- setSelectedFolders: f
706
- } = S(), {
696
+ const e = O(), t = v(), s = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
697
+ setFolderIds: f,
698
+ setResourceIds: u,
699
+ setSelectedResources: d,
700
+ setSelectedFolders: h
701
+ } = w(), {
707
702
  filters: i,
708
703
  trashed: p
709
704
  } = s, m = ["context", {
@@ -711,146 +706,146 @@ const cs = () => {
711
706
  filters: i,
712
707
  trashed: p
713
708
  }];
714
- return O({
715
- mutationFn: async () => await Me({
709
+ return M({
710
+ mutationFn: async () => await Ke({
716
711
  searchParams: s,
717
712
  folderIds: r,
718
713
  resourceIds: l,
719
714
  useAssetIds: o
720
715
  }),
721
- onError(g) {
722
- typeof g == "string" && e.error(x(g));
716
+ onError(y) {
717
+ typeof y == "string" && e.error(P(y));
723
718
  },
724
719
  onSuccess: async () => {
725
720
  if (await t.cancelQueries({
726
721
  queryKey: m
727
722
  }), t.getQueryData(m))
728
- return e.success(x("explorer.trash.toast")), t.setQueryData(m, (y) => {
729
- if (y)
723
+ return e.success(P("explorer.trash.toast")), t.setQueryData(m, (g) => {
724
+ if (g)
730
725
  return {
731
- ...y,
732
- pages: y == null ? void 0 : y.pages.map((I) => ({
726
+ ...g,
727
+ pages: g == null ? void 0 : g.pages.map((I) => ({
733
728
  ...I,
734
- folders: I.folders.filter((T) => !r.includes(T.id)),
735
- resources: I.resources.filter((T) => o ? !n.includes(T.assetId) : !l.includes(T.id))
729
+ folders: I.folders.filter((b) => !r.includes(b.id)),
730
+ resources: I.resources.filter((b) => o ? !n.includes(b.assetId) : !l.includes(b.id))
736
731
  }))
737
732
  };
738
733
  });
739
734
  },
740
735
  onSettled: () => {
741
- d([]), u([]), h([]), f([]);
736
+ u([]), d([]), f([]), h([]);
742
737
  }
743
738
  });
744
739
  }, $s = () => {
745
- const e = q(), t = k(), s = b(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
746
- clearSelectedItems: h,
747
- clearSelectedIds: d
748
- } = S(), {
749
- filters: u,
750
- trashed: f
740
+ const e = O(), t = v(), s = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
741
+ clearSelectedItems: f,
742
+ clearSelectedIds: u
743
+ } = w(), {
744
+ filters: d,
745
+ trashed: h
751
746
  } = s, i = ["context", {
752
- folderId: u.folder,
753
- filters: u,
754
- trashed: f
747
+ folderId: d.folder,
748
+ filters: d,
749
+ trashed: h
755
750
  }];
756
- return O({
757
- mutationFn: async () => await Ue({
751
+ return M({
752
+ mutationFn: async () => await Be({
758
753
  searchParams: s,
759
754
  folderIds: r,
760
755
  resourceIds: l,
761
756
  useAssetIds: o
762
757
  }),
763
758
  onError(p) {
764
- typeof p == "string" && e.error(x(p));
759
+ typeof p == "string" && e.error(P(p));
765
760
  },
766
761
  onSuccess: async () => {
767
762
  if (await t.cancelQueries({
768
763
  queryKey: i
769
764
  }), t.getQueryData(i))
770
- return e.success(x("explorer.removed.from.trash")), t.setQueryData(i, (m) => {
765
+ return e.success(P("explorer.removed.from.trash")), t.setQueryData(i, (m) => {
771
766
  if (m)
772
767
  return {
773
768
  ...m,
774
- pages: m == null ? void 0 : m.pages.map((y) => ({
775
- ...y,
776
- folders: y.folders.filter((I) => !r.includes(I.id)),
777
- resources: y.resources.filter((I) => o ? !n.includes(I.assetId) : !l.includes(I.id))
769
+ pages: m == null ? void 0 : m.pages.map((g) => ({
770
+ ...g,
771
+ folders: g.folders.filter((I) => !r.includes(I.id)),
772
+ resources: g.resources.filter((I) => o ? !n.includes(I.assetId) : !l.includes(I.id))
778
773
  }))
779
774
  };
780
775
  });
781
776
  },
782
777
  onSettled: () => {
783
- h(), d();
778
+ f(), u();
784
779
  }
785
780
  });
786
781
  }, js = () => {
787
- const e = q(), t = k(), s = b(), r = _(), n = J(), a = Y(), o = X(), l = Z().length > 0, h = l ? a : o, {
788
- clearSelectedIds: d,
789
- clearSelectedItems: u,
790
- setTreeData: f,
782
+ const e = O(), t = v(), s = D(), r = _(), n = J(), a = Y(), o = X(), l = Z().length > 0, f = l ? a : o, {
783
+ clearSelectedIds: u,
784
+ clearSelectedItems: d,
785
+ setTreeData: h,
791
786
  setSearchParams: i
792
- } = S(), {
787
+ } = w(), {
793
788
  filters: p,
794
789
  trashed: m
795
- } = s, g = ["context", {
790
+ } = s, y = ["context", {
796
791
  folderId: p.folder,
797
792
  filters: p,
798
793
  trashed: m
799
794
  }];
800
- return O({
801
- mutationFn: async (y) => await Be({
795
+ return M({
796
+ mutationFn: async (g) => await $e({
802
797
  searchParams: s,
803
- folderId: y,
798
+ folderId: g,
804
799
  folderIds: n,
805
- resourceIds: h,
800
+ resourceIds: f,
806
801
  useAssetIds: l
807
802
  }),
808
- onError(y) {
809
- typeof y == "string" && e.error(x(y));
803
+ onError(g) {
804
+ typeof g == "string" && e.error(P(g));
810
805
  },
811
- onSuccess: async (y, I) => {
812
- if (t.getQueryData(g))
813
- return t.setQueryData(g, (E) => {
814
- var L;
815
- if (E) {
806
+ onSuccess: async (g, I) => {
807
+ if (t.getQueryData(y))
808
+ return t.setQueryData(y, (Q) => {
809
+ var k;
810
+ if (Q) {
816
811
  const B = os(r, {
817
812
  destinationId: I,
818
813
  folders: n
819
- }), R = {
820
- ...E,
821
- pages: E == null ? void 0 : E.pages.map((P) => {
822
- var Q;
814
+ }), C = {
815
+ ...Q,
816
+ pages: Q == null ? void 0 : Q.pages.map((N) => {
817
+ var E;
823
818
  return {
824
- ...P,
825
- folders: P.folders.filter((K) => !n.includes(K.id)),
819
+ ...N,
820
+ folders: N.folders.filter((K) => !n.includes(K.id)),
826
821
  pagination: {
827
- ...P.pagination,
822
+ ...N.pagination,
828
823
  // @ts-ignore
829
- maxIdx: ((Q = P.pagination) == null ? void 0 : Q.maxIdx) - y.resources.length
824
+ maxIdx: ((E = N.pagination) == null ? void 0 : E.maxIdx) - g.resources.length
830
825
  },
831
- resources: P.resources.filter((K) => l ? !a.includes(K.assetId) : !h.includes(K.id))
826
+ resources: N.resources.filter((K) => l ? !a.includes(K.assetId) : !f.includes(K.id))
832
827
  };
833
828
  })
834
829
  };
835
- return f(B), i({
830
+ return h(B), i({
836
831
  ...s,
837
832
  pagination: {
838
833
  ...s.pagination,
839
834
  // @ts-ignore
840
- maxIdx: ((L = s.pagination) == null ? void 0 : L.maxIdx) - y.resources.length
835
+ maxIdx: ((k = s.pagination) == null ? void 0 : k.maxIdx) - g.resources.length
841
836
  }
842
- }), R;
837
+ }), C;
843
838
  }
844
839
  });
845
840
  },
846
841
  onSettled: () => {
847
- u(), d();
842
+ d(), u();
848
843
  }
849
844
  });
850
845
  }, zs = () => {
851
- const e = q(), t = k(), s = b(), r = _(), {
846
+ const e = O(), t = v(), s = D(), r = _(), {
852
847
  setTreeData: n
853
- } = S(), {
848
+ } = w(), {
854
849
  filters: a,
855
850
  trashed: o
856
851
  } = s, l = ["context", {
@@ -858,40 +853,40 @@ const cs = () => {
858
853
  filters: a,
859
854
  trashed: o
860
855
  }];
861
- return O({
856
+ return M({
862
857
  mutationFn: async ({
863
- name: h,
864
- parentId: d
865
- }) => await ke({
858
+ name: f,
859
+ parentId: u
860
+ }) => await Le({
866
861
  searchParams: s,
867
- name: h,
868
- parentId: d
862
+ name: f,
863
+ parentId: u
869
864
  }),
870
- onError(h) {
871
- typeof h == "string" && e.error(x(h));
865
+ onError(f) {
866
+ typeof f == "string" && e.error(P(f));
872
867
  },
873
- onSuccess: async (h, d) => {
868
+ onSuccess: async (f, u) => {
874
869
  await t.cancelQueries({
875
870
  queryKey: l
876
871
  });
877
- const u = t.getQueryData(l), f = {
878
- ...h,
879
- parentId: d.parentId,
872
+ const d = t.getQueryData(l), h = {
873
+ ...f,
874
+ parentId: u.parentId,
880
875
  children: [],
881
- rights: [`creator:${h == null ? void 0 : h.creator_id}`]
876
+ rights: [`creator:${f == null ? void 0 : f.creator_id}`]
882
877
  };
883
- if (u)
878
+ if (d)
884
879
  return t.setQueryData(l, (i) => {
885
880
  if (i) {
886
881
  const p = {
887
882
  ...i,
888
- pages: i == null ? void 0 : i.pages.map((g) => ({
889
- ...g,
890
- folders: [...g.folders, f]
883
+ pages: i == null ? void 0 : i.pages.map((y) => ({
884
+ ...y,
885
+ folders: [...y.folders, h]
891
886
  }))
892
887
  }, m = rs(r, {
893
- parentId: d.parentId,
894
- newFolder: f
888
+ parentId: u.parentId,
889
+ newFolder: h
895
890
  });
896
891
  return n(m), p;
897
892
  }
@@ -899,53 +894,53 @@ const cs = () => {
899
894
  }
900
895
  });
901
896
  }, _s = () => {
902
- const e = q(), t = k(), s = b(), r = _(), {
897
+ const e = O(), t = v(), s = D(), r = _(), {
903
898
  setFolderIds: n,
904
899
  setSelectedFolders: a,
905
900
  setTreeData: o
906
- } = S(), {
901
+ } = w(), {
907
902
  filters: l,
908
- trashed: h
909
- } = s, d = ["context", {
903
+ trashed: f
904
+ } = s, u = ["context", {
910
905
  folderId: l.folder,
911
906
  filters: l,
912
- trashed: h
907
+ trashed: f
913
908
  }];
914
- return O({
909
+ return M({
915
910
  mutationFn: async ({
916
- folderId: u,
917
- name: f,
911
+ folderId: d,
912
+ name: h,
918
913
  parentId: i
919
- }) => await Oe({
914
+ }) => await Ue({
920
915
  searchParams: s,
921
- folderId: u,
916
+ folderId: d,
922
917
  parentId: i,
923
- name: f
918
+ name: h
924
919
  }),
925
- onError(u) {
926
- typeof u == "string" && e.error(x(u));
920
+ onError(d) {
921
+ typeof d == "string" && e.error(P(d));
927
922
  },
928
- onSuccess: async (u, f) => {
923
+ onSuccess: async (d, h) => {
929
924
  if (await t.cancelQueries({
930
- queryKey: d
931
- }), t.getQueryData(d))
932
- return t.setQueryData(d, (p) => {
925
+ queryKey: u
926
+ }), t.getQueryData(u))
927
+ return t.setQueryData(u, (p) => {
933
928
  if (p) {
934
929
  const m = {
935
930
  ...p,
936
- pages: p == null ? void 0 : p.pages.map((y) => ({
937
- ...y,
938
- folders: y.folders.map((I) => I.id === u.id ? {
939
- ...u,
940
- parentId: f.parentId,
931
+ pages: p == null ? void 0 : p.pages.map((g) => ({
932
+ ...g,
933
+ folders: g.folders.map((I) => I.id === d.id ? {
934
+ ...d,
935
+ parentId: h.parentId,
941
936
  rights: I.rights
942
937
  } : I)
943
938
  }))
944
- }, g = as(r, {
945
- folderId: f.folderId,
946
- newFolder: u
939
+ }, y = as(r, {
940
+ folderId: h.folderId,
941
+ newFolder: d
947
942
  });
948
- return o(g), m;
943
+ return o(y), m;
949
944
  }
950
945
  });
951
946
  },
@@ -953,11 +948,11 @@ const cs = () => {
953
948
  n([]), a([]);
954
949
  }
955
950
  });
956
- }, Vs = () => {
957
- const e = q(), t = k(), s = b(), {
951
+ }, Vs = (e) => {
952
+ const t = v(), s = D(), {
958
953
  setResourceIds: r,
959
954
  setSelectedResources: n
960
- } = S(), {
955
+ } = w(), {
961
956
  filters: a,
962
957
  trashed: o
963
958
  } = s, l = ["context", {
@@ -965,48 +960,40 @@ const cs = () => {
965
960
  filters: a,
966
961
  trashed: o
967
962
  }];
968
- return O({
969
- mutationFn: async ({
970
- resourceId: h,
971
- rights: d
972
- }) => await Ke({
973
- searchParams: s,
974
- resourceId: h,
975
- rights: d
976
- }),
977
- onError(h) {
978
- typeof h == "string" && e.error(x("explorer.shared.status.error"));
979
- },
980
- onSuccess: async (h, d) => {
981
- if (await t.cancelQueries({
982
- queryKey: l
983
- }), t.getQueryData(l))
984
- return e.success(x("explorer.shared.status.saved")), t.setQueryData(l, (f) => {
985
- if (f)
986
- return {
987
- ...f,
988
- pages: f == null ? void 0 : f.pages.map((i) => ({
989
- ...i,
990
- resources: i.resources.map((p) => {
991
- if (p.assetId === (d == null ? void 0 : d.resourceId)) {
992
- let m = [`creator:${p.creatorId}`];
993
- return (d == null ? void 0 : d.rights.length) >= 1 && (m = [...m, ...d.rights.flatMap((g) => g.actions.map((y) => `${g.type}:${g.id}:${y.id}`))]), {
994
- ...p,
995
- rights: m
996
- };
997
- } else
998
- return p;
999
- })
1000
- }))
1001
- };
1002
- });
1003
- },
1004
- onSettled: () => {
1005
- r([]), n([]);
963
+ return Ie({
964
+ application: e,
965
+ options: {
966
+ onSuccess: async (f, u) => {
967
+ if (await t.cancelQueries({
968
+ queryKey: l
969
+ }), t.getQueryData(l))
970
+ return t.setQueryData(l, (h) => {
971
+ if (h)
972
+ return {
973
+ ...h,
974
+ pages: h == null ? void 0 : h.pages.map((i) => ({
975
+ ...i,
976
+ resources: i.resources.map((p) => {
977
+ if (p.assetId === (u == null ? void 0 : u.resourceId)) {
978
+ let m = [`creator:${p.creatorId}`];
979
+ return (u == null ? void 0 : u.rights.length) >= 1 && (m = [...m, ...u.rights.flatMap((y) => y.actions.map((g) => `${y.type}:${y.id}:${g.id}`))]), {
980
+ ...p,
981
+ rights: m
982
+ };
983
+ } else
984
+ return p;
985
+ })
986
+ }))
987
+ };
988
+ });
989
+ },
990
+ onSettled: () => {
991
+ r([]), n([]);
992
+ }
1006
993
  }
1007
994
  });
1008
- }, Hs = () => {
1009
- const e = q(), t = k(), s = b(), {
995
+ }, Hs = (e) => {
996
+ const t = v(), s = D(), {
1010
997
  filters: r,
1011
998
  trashed: n
1012
999
  } = s, a = ["context", {
@@ -1014,80 +1001,77 @@ const cs = () => {
1014
1001
  filters: r,
1015
1002
  trashed: n
1016
1003
  }];
1017
- return O({
1018
- mutationFn: async (o) => await $e({
1019
- searchParams: s,
1020
- params: o
1021
- }),
1022
- onError(o) {
1023
- typeof o == "string" && e.error(x(o));
1024
- },
1025
- onSuccess: async (o, l) => {
1026
- if (await t.cancelQueries({
1027
- queryKey: a
1028
- }), t.getQueryData(a))
1029
- return t.setQueryData(a, (d) => {
1030
- if (d)
1031
- return {
1032
- ...d,
1033
- pages: d == null ? void 0 : d.pages.map((u) => ({
1004
+ return Se({
1005
+ application: e,
1006
+ options: {
1007
+ onSuccess: async (o, l) => {
1008
+ if (await t.cancelQueries({
1009
+ queryKey: a
1010
+ }), t.getQueryData(a))
1011
+ return t.setQueryData(a, (u) => {
1012
+ if (u)
1013
+ return {
1034
1014
  ...u,
1035
- resources: u.resources.map((f) => {
1036
- if (f.assetId === (l == null ? void 0 : l.entId)) {
1037
- const {
1038
- name: i,
1039
- thumbnail: p,
1040
- public: m,
1041
- description: g,
1042
- slug: y,
1043
- ...I
1044
- } = l;
1045
- return {
1046
- ...f,
1047
- ...I,
1048
- // add any custom field
1049
- name: i,
1050
- thumbnail: typeof p == "string" ? p : URL.createObjectURL(p),
1051
- public: m,
1052
- description: g,
1053
- slug: y
1054
- };
1055
- } else
1056
- return f;
1057
- })
1058
- }))
1059
- };
1060
- });
1015
+ pages: u == null ? void 0 : u.pages.map((d) => ({
1016
+ ...d,
1017
+ resources: d.resources.map((h) => {
1018
+ if (h.assetId === (l == null ? void 0 : l.entId)) {
1019
+ const {
1020
+ name: i,
1021
+ thumbnail: p,
1022
+ public: m,
1023
+ description: y,
1024
+ slug: g,
1025
+ ...I
1026
+ } = l;
1027
+ return {
1028
+ ...h,
1029
+ ...I,
1030
+ // add any custom field
1031
+ name: i,
1032
+ thumbnail: typeof p == "string" ? p : URL.createObjectURL(p),
1033
+ public: m,
1034
+ description: y,
1035
+ slug: g
1036
+ };
1037
+ } else
1038
+ return h;
1039
+ })
1040
+ }))
1041
+ };
1042
+ });
1043
+ }
1061
1044
  }
1062
1045
  });
1063
- }, Ws = () => {
1064
- const e = q(), t = k(), s = b(), {
1046
+ };
1047
+ const Ws = () => {
1048
+ const e = O(), t = v(), s = D(), {
1065
1049
  user: r
1066
- } = Ie(), {
1050
+ } = we(), {
1067
1051
  appCode: n
1068
- } = M(), a = ["context", {
1052
+ } = U(), a = ["context", {
1069
1053
  folderId: s.filters.folder,
1070
1054
  filters: s.filters,
1071
1055
  trashed: s.trashed
1072
1056
  }];
1073
- return O({
1057
+ return M({
1074
1058
  mutationFn: async (o) => await _e({
1075
1059
  searchParams: s,
1076
1060
  params: o
1077
1061
  }),
1078
1062
  onError(o) {
1079
- typeof o == "string" && e.error(x(o));
1063
+ typeof o == "string" && e.error(P(o));
1080
1064
  },
1081
1065
  onSuccess: async (o, l) => {
1082
- var f, i, p;
1066
+ var h, i, p;
1083
1067
  await t.cancelQueries({
1084
1068
  queryKey: a
1085
1069
  });
1086
- const h = t.getQueryData(a), {
1087
- thumbnail: d
1088
- } = l, u = {
1070
+ const f = t.getQueryData(a), {
1071
+ thumbnail: u
1072
+ } = l, d = {
1089
1073
  ...l,
1090
- thumbnail: d ? URL.createObjectURL(d) : "",
1074
+ thumbnail: u ? URL.createObjectURL(u) : "",
1091
1075
  application: n,
1092
1076
  assetId: o._id || o.entId || "",
1093
1077
  id: o._id || o.entId || "",
@@ -1095,93 +1079,93 @@ const cs = () => {
1095
1079
  creatorName: r == null ? void 0 : r.username,
1096
1080
  createdAt: Date.now(),
1097
1081
  slug: l.slug || "",
1098
- modifiedAt: ((f = o.modified) == null ? void 0 : f.$date) || "",
1082
+ modifiedAt: ((h = o.modified) == null ? void 0 : h.$date) || "",
1099
1083
  modifierId: ((i = o.author) == null ? void 0 : i.userId) || "",
1100
1084
  modifierName: ((p = o.author) == null ? void 0 : p.username) || "",
1101
1085
  updatedAt: Date.now(),
1102
1086
  trashed: !1,
1103
1087
  rights: [`creator:${r == null ? void 0 : r.userId}`]
1104
1088
  };
1105
- if (h)
1089
+ if (f)
1106
1090
  return t.setQueryData(a, (m) => {
1107
1091
  if (m)
1108
1092
  return {
1109
1093
  ...m,
1110
- pages: m == null ? void 0 : m.pages.map((g) => ({
1111
- ...g,
1112
- resources: [u, ...g.resources]
1094
+ pages: m == null ? void 0 : m.pages.map((y) => ({
1095
+ ...y,
1096
+ resources: [d, ...y.resources]
1113
1097
  }))
1114
1098
  };
1115
1099
  });
1116
1100
  }
1117
1101
  });
1118
- }, ls = /* @__PURE__ */ D(async () => await import("./EmptyScreenApp.js")), ds = /* @__PURE__ */ D(async () => await import("./EmptyScreenSearch.js")), us = /* @__PURE__ */ D(async () => await import("./EmptyScreenError.js")), hs = /* @__PURE__ */ D(async () => await import("./EmptyScreenNoContentInFolder.js")), fs = /* @__PURE__ */ D(async () => await import("./EmptyScreenTrash.js")), ps = /* @__PURE__ */ D(async () => await import("./FoldersList.js")), ms = /* @__PURE__ */ D(async () => await import("./ResourcesList.js")), ys = () => {
1119
- const e = Xe(), t = re(), s = Ye(), r = b(), n = W(), a = _(), o = q(), {
1102
+ }, ls = /* @__PURE__ */ x(async () => await import("./EmptyScreenApp.js")), ds = /* @__PURE__ */ x(async () => await import("./EmptyScreenSearch.js")), us = /* @__PURE__ */ x(async () => await import("./EmptyScreenError.js")), hs = /* @__PURE__ */ x(async () => await import("./EmptyScreenNoContentInFolder.js")), fs = /* @__PURE__ */ x(async () => await import("./EmptyScreenTrash.js")), ps = /* @__PURE__ */ x(async () => await import("./FoldersList.js")), ms = /* @__PURE__ */ x(async () => await import("./ResourcesList.js")), gs = () => {
1103
+ const e = Xe(), t = re(), s = Ye(), r = D(), n = W(), a = _(), o = O(), {
1120
1104
  appCode: l
1121
- } = M(), {
1122
- t: h
1105
+ } = U(), {
1106
+ t: f
1123
1107
  } = z(), {
1124
- setSearchParams: d,
1125
- setSearchConfig: u,
1126
- setTreeData: f
1127
- } = S(), {
1108
+ setSearchParams: u,
1109
+ setSearchConfig: d,
1110
+ setTreeData: h
1111
+ } = w(), {
1128
1112
  data: i,
1129
1113
  isError: p,
1130
1114
  error: m,
1131
- isLoading: g,
1132
- isFetching: y,
1115
+ isLoading: y,
1116
+ isFetching: g,
1133
1117
  fetchNextPage: I
1134
- } = is(), T = (i == null ? void 0 : i.pages[0].folders.length) === 0, E = (i == null ? void 0 : i.pages[0].resources.length) === 0, L = T && E;
1135
- return U(() => {
1136
- var B, R, P;
1118
+ } = is(), b = (i == null ? void 0 : i.pages[0].folders.length) === 0, Q = (i == null ? void 0 : i.pages[0].resources.length) === 0, k = b && Q;
1119
+ return L(() => {
1120
+ var B, C, N;
1137
1121
  if (i) {
1138
- const Q = [...((B = i == null ? void 0 : i.pages[0]) == null ? void 0 : B.folders) ?? []];
1139
- (R = i == null ? void 0 : i.pages[0]) != null && R.searchConfig && u(i.pages[0].searchConfig), r.search || ((n == null ? void 0 : n.id) === "default" ? f({
1140
- id: F.DEFAULT,
1122
+ const E = [...((B = i == null ? void 0 : i.pages[0]) == null ? void 0 : B.folders) ?? []];
1123
+ (C = i == null ? void 0 : i.pages[0]) != null && C.searchConfig && d(i.pages[0].searchConfig), r.search || ((n == null ? void 0 : n.id) === "default" ? h({
1124
+ id: T.DEFAULT,
1141
1125
  section: !0,
1142
- children: Q.map((K) => new G(K)),
1143
- name: h("explorer.filters.mine", {
1126
+ children: E.map((K) => new G(K)),
1127
+ name: f("explorer.filters.mine", {
1144
1128
  ns: l
1145
1129
  })
1146
- }) : f(de(a, Q, r.filters.folder || F.DEFAULT))), d({
1130
+ }) : h(de(a, E, r.filters.folder || T.DEFAULT))), u({
1147
1131
  ...r,
1148
- pagination: (P = i == null ? void 0 : i.pages[(i == null ? void 0 : i.pages.length) - 1]) == null ? void 0 : P.pagination
1132
+ pagination: (N = i == null ? void 0 : i.pages[(i == null ? void 0 : i.pages.length) - 1]) == null ? void 0 : N.pagination
1149
1133
  });
1150
1134
  }
1151
- }, [i]), U(() => {
1152
- m && typeof m == "string" && o.error(h(m));
1153
- }, [m]), g ? /* @__PURE__ */ c(A, {}) : p ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(us, {}) }) : r.search && L ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ds, {}) }) : e && L ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ls, {}) }) : s && L && !t ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(hs, {}) }) : t && (i == null ? void 0 : i.pages[0].resources.length) === 0 ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(fs, {}) }) : /* @__PURE__ */ N(v, { fallback: /* @__PURE__ */ c(A, {}), children: [
1154
- /* @__PURE__ */ c(ps, { data: i, isFetching: y }),
1155
- /* @__PURE__ */ c(ms, { data: i, isFetching: y, fetchNextPage: I })
1135
+ }, [i]), L(() => {
1136
+ m && typeof m == "string" && o.error(f(m));
1137
+ }, [m]), y ? /* @__PURE__ */ c(R, {}) : p ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(us, {}) }) : r.search && k ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(ds, {}) }) : e && k ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(ls, {}) }) : s && k && !t ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(hs, {}) }) : t && (i == null ? void 0 : i.pages[0].resources.length) === 0 ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(fs, {}) }) : /* @__PURE__ */ F(q, { fallback: /* @__PURE__ */ c(R, {}), children: [
1138
+ /* @__PURE__ */ c(ps, { data: i, isFetching: g }),
1139
+ /* @__PURE__ */ c(ms, { data: i, isFetching: g, fetchNextPage: I })
1156
1140
  ] });
1157
- }, gs = () => {
1141
+ }, ys = () => {
1158
1142
  const {
1159
1143
  appCode: e,
1160
1144
  currentApp: t
1161
- } = M(), {
1145
+ } = U(), {
1162
1146
  t: s
1163
- } = z(), [r, n] = ae(""), a = (u) => {
1164
- if (u === "0") {
1147
+ } = z(), [r, n] = ae(""), a = (d) => {
1148
+ if (d === "0") {
1165
1149
  n("");
1166
1150
  return;
1167
1151
  }
1168
- n(u);
1169
- }, o = W(), l = b(), {
1170
- setSearchParams: h
1171
- } = S();
1172
- U(() => {
1173
- const u = () => r.includes("1") ? !0 : void 0, f = () => r.includes("2") ? !0 : void 0, i = () => r.includes("7") ? !0 : void 0;
1174
- h({
1152
+ n(d);
1153
+ }, o = W(), l = D(), {
1154
+ setSearchParams: f
1155
+ } = w();
1156
+ L(() => {
1157
+ const d = () => r.includes("1") ? !0 : void 0, h = () => r.includes("2") ? !0 : void 0, i = () => r.includes("7") ? !0 : void 0;
1158
+ f({
1175
1159
  ...l,
1176
1160
  filters: {
1177
- owner: u(),
1161
+ owner: d(),
1178
1162
  public: i(),
1179
- shared: f(),
1163
+ shared: h(),
1180
1164
  folder: o ? o.id : "default"
1181
1165
  }
1182
1166
  });
1183
- }, [o, h, r]);
1184
- const d = [{
1167
+ }, [o, f, r]);
1168
+ const u = [{
1185
1169
  label: s("explorer.filter.all", {
1186
1170
  ns: e
1187
1171
  }),
@@ -1216,43 +1200,43 @@ const cs = () => {
1216
1200
  }] : []];
1217
1201
  return {
1218
1202
  selectedFilters: r,
1219
- options: d,
1203
+ options: u,
1220
1204
  handleOnSelectFilter: a
1221
1205
  };
1222
1206
  }, Is = () => {
1223
1207
  const {
1224
1208
  appCode: e
1225
- } = M(), {
1209
+ } = U(), {
1226
1210
  t
1227
1211
  } = z(), {
1228
1212
  selectedFilters: s,
1229
1213
  options: r,
1230
1214
  handleOnSelectFilter: n
1231
- } = gs(), {
1215
+ } = ys(), {
1232
1216
  formRef: a,
1233
1217
  inputSearch: o,
1234
1218
  handleInputSearchChange: l,
1235
- handleKeyPress: h,
1236
- handleSearchSubmit: d
1237
- } = ue(), u = s.length > 0 ? s.length : void 0;
1238
- return /* @__PURE__ */ N("form", { noValidate: !0, className: "bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative z-3 d-flex gap-8", ref: a, children: [
1239
- /* @__PURE__ */ N(we, { id: "search", className: "input-group", children: [
1240
- /* @__PURE__ */ c(Se, { type: "search", placeholder: t("explorer.label.search", {
1219
+ handleKeyPress: f,
1220
+ handleSearchSubmit: u
1221
+ } = ue(), d = s.length > 0 ? s.length : void 0;
1222
+ return /* @__PURE__ */ F("form", { noValidate: !0, className: "bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative z-3 d-flex gap-8", ref: a, children: [
1223
+ /* @__PURE__ */ F(xe, { id: "search", className: "input-group", children: [
1224
+ /* @__PURE__ */ c(De, { type: "search", placeholder: t("explorer.label.search", {
1241
1225
  ns: e
1242
- }), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown: h }),
1243
- /* @__PURE__ */ c(xe, { type: "submit", "aria-label": t("explorer.label.search", {
1226
+ }), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown: f }),
1227
+ /* @__PURE__ */ c(be, { type: "submit", "aria-label": t("explorer.label.search", {
1244
1228
  ns: e
1245
- }), onClick: d })
1229
+ }), onClick: u })
1246
1230
  ] }),
1247
- /* @__PURE__ */ N(j, { placement: "bottom-end", children: [
1248
- /* @__PURE__ */ c(j.Trigger, { label: t("explorer.filters"), icon: /* @__PURE__ */ c(Pe, { width: 20 }), variant: "ghost", badgeContent: u }),
1249
- /* @__PURE__ */ c(j.Menu, { children: r.map((f) => f.value === "0" ? /* @__PURE__ */ N(me, { children: [
1250
- /* @__PURE__ */ c(j.RadioItem, { value: f.value, model: s, onChange: () => n(f.value), children: f.label }),
1231
+ /* @__PURE__ */ F(j, { placement: "bottom-end", children: [
1232
+ /* @__PURE__ */ c(j.Trigger, { label: t("explorer.filters"), icon: /* @__PURE__ */ c(Qe, { width: 20 }), variant: "ghost", badgeContent: d }),
1233
+ /* @__PURE__ */ c(j.Menu, { children: r.map((h) => h.value === "0" ? /* @__PURE__ */ F(me, { children: [
1234
+ /* @__PURE__ */ c(j.RadioItem, { value: h.value, model: s, onChange: () => n(h.value), children: h.label }),
1251
1235
  /* @__PURE__ */ c(j.Separator, {})
1252
- ] }, "0") : /* @__PURE__ */ c(j.RadioItem, { value: f.value, model: s, onChange: () => n(f.value), children: f.label }, f.value)) })
1236
+ ] }, "0") : /* @__PURE__ */ c(j.RadioItem, { value: h.value, model: s, onChange: () => n(h.value), children: h.label }, h.value)) })
1253
1237
  ] })
1254
1238
  ] });
1255
- }, ws = ({
1239
+ }, Ss = ({
1256
1240
  id: e,
1257
1241
  selected: t,
1258
1242
  onSelect: s
@@ -1260,41 +1244,41 @@ const cs = () => {
1260
1244
  const {
1261
1245
  t: r
1262
1246
  } = z();
1263
- return /* @__PURE__ */ c("div", { className: "treeview", children: /* @__PURE__ */ c("ul", { role: "tree", className: "m-0 p-0", children: /* @__PURE__ */ c("li", { id: e, role: "treeitem", "aria-selected": t, children: /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("div", { className: "action-container", children: /* @__PURE__ */ c("div", { onClick: s, role: "button", tabIndex: 0, children: /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
1264
- /* @__PURE__ */ c(Ae, { width: "20", height: "20" }),
1247
+ return /* @__PURE__ */ c("div", { className: "treeview", children: /* @__PURE__ */ c("ul", { role: "tree", className: "m-0 p-0", children: /* @__PURE__ */ c("li", { id: e, role: "treeitem", "aria-selected": t, children: /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("div", { className: "action-container", children: /* @__PURE__ */ c("div", { onClick: s, role: "button", tabIndex: 0, children: /* @__PURE__ */ F("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
1248
+ /* @__PURE__ */ c(Ee, { width: "20", height: "20" }),
1265
1249
  /* @__PURE__ */ c("span", { children: r("explorer.tree.trash") })
1266
1250
  ] }) }) }) }) }) }) });
1267
- }, Ss = /* @__PURE__ */ D(async () => await import("./FolderModal.js")), xs = () => {
1268
- const e = k(), [t, s] = De(), r = _(), n = re(), a = te(), {
1251
+ }, ws = /* @__PURE__ */ x(async () => await import("./FolderModal.js")), xs = () => {
1252
+ const e = v(), [t, s] = Te(), r = _(), n = re(), a = te(), {
1269
1253
  appCode: o
1270
- } = M(), {
1254
+ } = U(), {
1271
1255
  t: l
1272
1256
  } = z(["common", o]), {
1273
- goToTrash: h,
1274
- selectTreeItem: d,
1275
- unfoldTreeItem: u,
1276
- foldTreeItem: f,
1257
+ goToTrash: f,
1258
+ selectTreeItem: u,
1259
+ unfoldTreeItem: d,
1260
+ foldTreeItem: h,
1277
1261
  clearSelectedItems: i,
1278
1262
  clearSelectedIds: p
1279
- } = S(), m = async (y) => {
1280
- await u(y, e);
1281
- }, g = () => {
1263
+ } = w(), m = async (g) => {
1264
+ await d(g, e);
1265
+ }, y = () => {
1282
1266
  i(), p(), s();
1283
1267
  };
1284
- return /* @__PURE__ */ N(oe, { children: [
1285
- /* @__PURE__ */ c(be, { data: r, selectedNodesIds: a, onTreeItemSelect: d, onTreeItemFold: f, onTreeItemUnfold: m }),
1286
- /* @__PURE__ */ c(ws, { id: F.BIN, selected: n, onSelect: h }),
1287
- /* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Te, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(Ee, {}), onClick: g, children: l("explorer.folder.new") }) }),
1288
- /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: t && /* @__PURE__ */ c(Ss, { edit: !1, isOpen: t, onSuccess: s, onCancel: s }) })
1268
+ return /* @__PURE__ */ F(oe, { children: [
1269
+ /* @__PURE__ */ c(Fe, { data: r, selectedNodesIds: a, onTreeItemSelect: u, onTreeItemFold: h, onTreeItemUnfold: m }),
1270
+ /* @__PURE__ */ c(Ss, { id: T.BIN, selected: n, onSelect: f }),
1271
+ /* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Ce, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(qe, {}), onClick: y, children: l("explorer.folder.new") }) }),
1272
+ /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: t && /* @__PURE__ */ c(ws, { edit: !1, isOpen: t, onSuccess: s, onCancel: s }) })
1289
1273
  ] });
1290
- }, Ds = /* @__PURE__ */ D(async () => await import("./AppAction.js")), bs = /* @__PURE__ */ D(async () => await import("./Library.js")), Ts = /* @__PURE__ */ D(async () => await import("./ActionBarContainer.js")), Fs = /* @__PURE__ */ D(async () => await import("./DisableModal.js")), Ns = /* @__PURE__ */ D(async () => await import("./TrashModal.js")), Cs = /* @__PURE__ */ D(async () => await import("./OnboardingModal.js")), Gs = ({
1274
+ }, Ds = /* @__PURE__ */ x(async () => await import("./AppAction.js")), bs = /* @__PURE__ */ x(async () => await import("./Library.js")), Ts = /* @__PURE__ */ x(async () => await import("./ActionBarContainer.js")), Fs = /* @__PURE__ */ x(async () => await import("./DisableModal.js")), Cs = /* @__PURE__ */ x(async () => await import("./TrashModal.js")), Ns = /* @__PURE__ */ x(async () => await import("./OnboardingModal.js")), Gs = ({
1291
1275
  config: e
1292
1276
  }) => {
1293
- const t = b(), {
1277
+ const t = D(), {
1294
1278
  setConfig: s,
1295
1279
  setSearchParams: r
1296
- } = S();
1297
- U(() => {
1280
+ } = w();
1281
+ L(() => {
1298
1282
  s(e || {}), r({
1299
1283
  ...t,
1300
1284
  application: e.app,
@@ -1303,32 +1287,32 @@ const cs = () => {
1303
1287
  }, [e]);
1304
1288
  const {
1305
1289
  currentApp: n
1306
- } = M(), {
1290
+ } = U(), {
1307
1291
  data: a
1308
1292
  } = cs(), {
1309
1293
  isTrashedModalOpen: o,
1310
1294
  onTrashedCancel: l
1311
1295
  } = ts(), {
1312
- isActionDisableModalOpen: h,
1313
- onActionDisableCancel: d
1296
+ isActionDisableModalOpen: f,
1297
+ onActionDisableCancel: u
1314
1298
  } = ss();
1315
- Fe();
1316
- const u = ne("publish", a), f = ne("create", a);
1317
- return e && /* @__PURE__ */ N(oe, { children: [
1318
- /* @__PURE__ */ c(Ne, { render: () => f ? /* @__PURE__ */ c(v, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(Ds, {}) }) : null, children: /* @__PURE__ */ c(Ce, { app: n }) }),
1319
- /* @__PURE__ */ N(ee, { className: "flex-grow-1", children: [
1320
- /* @__PURE__ */ c(ee.Col, { sm: "3", lg: "2", xl: "3", className: "border-end pt-16 pe-16 d-none d-lg-block", as: "aside", children: /* @__PURE__ */ N(v, { fallback: /* @__PURE__ */ c(A, {}), children: [
1299
+ Ne();
1300
+ const d = ne("publish", a), h = ne("create", a);
1301
+ return e && /* @__PURE__ */ F(oe, { children: [
1302
+ /* @__PURE__ */ c(Re, { render: () => h ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(R, {}), children: /* @__PURE__ */ c(Ds, {}) }) : null, children: /* @__PURE__ */ c(Pe, { app: n }) }),
1303
+ /* @__PURE__ */ F(ee, { className: "flex-grow-1", children: [
1304
+ /* @__PURE__ */ c(ee.Col, { sm: "3", lg: "2", xl: "3", className: "border-end pt-16 pe-16 d-none d-lg-block", as: "aside", children: /* @__PURE__ */ F(q, { fallback: /* @__PURE__ */ c(R, {}), children: [
1321
1305
  /* @__PURE__ */ c(xs, {}),
1322
- u && /* @__PURE__ */ c(bs, {})
1306
+ d && /* @__PURE__ */ c(bs, {})
1323
1307
  ] }) }),
1324
- /* @__PURE__ */ N(ee.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
1308
+ /* @__PURE__ */ F(ee.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
1325
1309
  /* @__PURE__ */ c(Is, {}),
1326
1310
  /* @__PURE__ */ c(es, {}),
1327
- /* @__PURE__ */ c(ys, {})
1311
+ /* @__PURE__ */ c(gs, {})
1328
1312
  ] }),
1329
- /* @__PURE__ */ N(v, { fallback: /* @__PURE__ */ c(A, {}), children: [
1313
+ /* @__PURE__ */ F(q, { fallback: /* @__PURE__ */ c(R, {}), children: [
1330
1314
  /* @__PURE__ */ c(Ts, {}),
1331
- /* @__PURE__ */ c(Cs, { id: "showOnboardingTrash", items: [{
1315
+ /* @__PURE__ */ c(Ns, { id: "showOnboardingTrash", items: [{
1332
1316
  src: "onboarding/illu-trash-menu.svg",
1333
1317
  alt: "explorer.modal.onboarding.trash.screen1.alt",
1334
1318
  text: "explorer.modal.onboarding.trash.screen1.title"
@@ -1346,8 +1330,8 @@ const cs = () => {
1346
1330
  nextText: "explorer.modal.onboarding.trash.next",
1347
1331
  closeText: "explorer.modal.onboarding.trash.close"
1348
1332
  } }),
1349
- o && /* @__PURE__ */ c(Ns, { isOpen: o, onCancel: l }),
1350
- h && /* @__PURE__ */ c(Fs, { isOpen: h, onCancel: d })
1333
+ o && /* @__PURE__ */ c(Cs, { isOpen: o, onCancel: l }),
1334
+ f && /* @__PURE__ */ c(Fs, { isOpen: f, onCancel: u })
1351
1335
  ] })
1352
1336
  ] })
1353
1337
  ] });
@@ -1358,7 +1342,7 @@ export {
1358
1342
  W as b,
1359
1343
  Ws as c,
1360
1344
  re as d,
1361
- w as e,
1345
+ S as e,
1362
1346
  X as f,
1363
1347
  Ms as g,
1364
1348
  Us as h,
@@ -1367,12 +1351,12 @@ export {
1367
1351
  Ge as k,
1368
1352
  Vs as l,
1369
1353
  Hs as m,
1370
- b as n,
1354
+ D as n,
1371
1355
  zs as o,
1372
1356
  _s as p,
1373
1357
  $s as q,
1374
1358
  Bs as r,
1375
1359
  js as s,
1376
1360
  _ as t,
1377
- S as u
1361
+ w as u
1378
1362
  };