ode-explorer 1.3.3 → 1.4.0-develop-pedago.202403041810

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