ode-explorer 1.3.2-dev.202401101530 → 1.3.2-dev.202401161251

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