ode-explorer 1.3.2 → 1.3.3-develop-b2school.202402081140

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