ode-explorer 1.4.18 → 1.4.19-develop.202410251618

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