@ynput/ayon-frontend-shared 0.6.1 → 0.6.2

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.
@@ -1,30 +1,30 @@
1
- import { jsx as T, jsxs as ce } from "react/jsx-runtime";
2
- import { useState as w, useEffect as B, useCallback as E, useMemo as j } from "react";
3
- import { registerRemotes as de } from "@module-federation/enhanced/runtime";
4
- import { ay as ue, bi as pe } from "./chunks/searchTerms.es.js";
5
- import { cQ as fe, c2 as ge, cg as me, bp as he, cS as ye, cB as Pe, bJ as ve, cY as we, dl as be, cI as Ce } from "./chunks/getUris.es.js";
1
+ import { jsx as j, jsxs as pe } from "react/jsx-runtime";
2
+ import { useState as b, useEffect as B, useCallback as E, useRef as fe, useMemo as T } from "react";
3
+ import { registerRemotes as ge } from "@module-federation/enhanced/runtime";
4
+ import { ay as me, bi as he } from "./chunks/searchTerms.es.js";
5
+ import { cQ as ye, c2 as Pe, cg as ve, bp as be, cS as we, cB as Ce, bJ as Se, cY as Ie, dl as ke, cI as Le } from "./chunks/getUris.es.js";
6
6
  import "primereact/confirmdialog";
7
- import { d as te, z as Se, a as ne, q as Ie, A as ke, B as Le, G as xe, H as Ee, I as De, J as Fe, K as Te, L as je, N as Me, O as Oe, Q as Ae, U as Ue, V as Re, W as Ne } from "./chunks/DeleteEntitiesContextInstance.es.js";
8
- import { E as Lt, M as xt, X as Et, P as Dt, Y as Ft, Z as Tt, T as jt, _ as Mt, $ as Ot, g as At, a0 as Ut, m as Rt, c as Nt, a1 as Bt, t as Gt, a2 as _t, a3 as $t, a4 as Qt, a5 as Wt, a6 as qt, v as zt, u as Vt, n as Ht, a7 as Yt, x as Jt, y as Kt, b as Xt, a8 as Zt, a9 as en, aa as tn, ab as nn, ac as on, ad as sn } from "./chunks/DeleteEntitiesContextInstance.es.js";
7
+ import { d as re, z as xe, a as ie, q as Ee, A as De, B as Fe, G as je, H as Te, I as Me, J as Oe, K as Re, L as Ae, N as Ue, O as Ne, Q as Be, U as Ge, V as _e, W as $e } from "./chunks/DeleteEntitiesContextInstance.es.js";
8
+ import { E as Ft, M as jt, X as Tt, P as Mt, Y as Ot, Z as Rt, T as At, _ as Ut, $ as Nt, g as Bt, a0 as Gt, m as _t, c as $t, a1 as Qt, t as Wt, a2 as qt, a3 as zt, a4 as Vt, a5 as Ht, a6 as Yt, v as Jt, u as Kt, n as Xt, a7 as Zt, x as en, y as tn, b as nn, a8 as on, a9 as sn, aa as rn, ab as an, ac as ln, ad as cn } from "./chunks/DeleteEntitiesContextInstance.es.js";
9
9
  import "lodash";
10
10
  import { toast as G } from "react-toastify";
11
- import { v4 as Y } from "uuid";
12
- import { g as Be, p as Ge, b as _e } from "./chunks/getBundleMode.es.js";
13
- import { u as oe } from "./chunks/useLoadModule.es.js";
14
- import { P as an, T as ln } from "./chunks/ProjectContext.es.js";
11
+ import { v4 as K } from "uuid";
12
+ import { g as Qe, p as We, b as qe } from "./chunks/getBundleMode.es.js";
13
+ import { u as ae } from "./chunks/useLoadModule.es.js";
14
+ import { P as un, T as pn } from "./chunks/ProjectContext.es.js";
15
15
  import "react-dom";
16
- import { p as $e, c as Qe, d as We, e as qe, b as Z } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
17
- import { a as dn } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
18
- import { M as pn } from "./chunks/MenuContext.es.js";
19
- import { u as ze } from "./chunks/useQueryArgumentChangeLoading.es.js";
20
- import { E as gn, F as mn } from "./chunks/EntityUpdatesContext.es.js";
21
- const ut = ({ children: f, skip: i }) => {
22
- const { data: s = [], isLoading: e } = fe(void 0, {
16
+ import { p as ze, c as Ve, d as He, e as Ye, b as oe } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
17
+ import { a as gn } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
18
+ import { M as hn } from "./chunks/MenuContext.es.js";
19
+ import { u as Je } from "./chunks/useQueryArgumentChangeLoading.es.js";
20
+ import { E as Pn, F as vn } from "./chunks/EntityUpdatesContext.es.js";
21
+ const mt = ({ children: f, skip: i }) => {
22
+ const { data: s = [], isLoading: e } = ye(void 0, {
23
23
  skip: i
24
24
  }), {
25
25
  siteInfo: r,
26
26
  isLoading: { siteInfo: c }
27
- } = te(), [d, h] = w(!1);
27
+ } = re(), [d, h] = b(!1);
28
28
  return B(() => {
29
29
  if (e || c || d) return;
30
30
  if (!s.length) {
@@ -42,7 +42,7 @@ const ut = ({ children: f, skip: i }) => {
42
42
  modules: m
43
43
  });
44
44
  });
45
- }), de(
45
+ }), ge(
46
46
  y.map((g) => ({
47
47
  name: g.remote,
48
48
  alias: g.remote,
@@ -50,8 +50,8 @@ const ut = ({ children: f, skip: i }) => {
50
50
  type: "module"
51
51
  }))
52
52
  ), h(!0);
53
- }, [s, e, c, d]), /* @__PURE__ */ T(
54
- Se.Provider,
53
+ }, [s, e, c, d]), /* @__PURE__ */ j(
54
+ xe.Provider,
55
55
  {
56
56
  value: {
57
57
  isLoading: e,
@@ -61,7 +61,7 @@ const ut = ({ children: f, skip: i }) => {
61
61
  children: f
62
62
  }
63
63
  );
64
- }, Ve = {
64
+ }, Ke = {
65
65
  planner: {
66
66
  label: "Planner",
67
67
  icon: "calendar_month",
@@ -106,63 +106,63 @@ const ut = ({ children: f, skip: i }) => {
106
106
  "dataPortability"
107
107
  ]
108
108
  }
109
- }, pt = ({
109
+ }, ht = ({
110
110
  children: f,
111
111
  defaultTab: i = "feed",
112
112
  hasLicense: s,
113
113
  debug: e = {},
114
114
  ...r
115
115
  }) => {
116
- const c = r.user, d = Be(c), h = "isGuest" in e ? e.isGuest : c?.data?.isGuest, { powerLicense: y, setPowerpackDialog: g } = ne(), p = "hasLicense" in e ? e.hasLicense : !!y || s, [l, n] = w({}), [u, m] = w([]), [C, v] = w([]), x = E(
117
- (L) => l[L] ? l[L] : !1,
116
+ const c = r.user, d = Qe(c), h = "isGuest" in e ? e.isGuest : c?.data?.isGuest, { powerLicense: y, setPowerpackDialog: g } = ie(), p = "hasLicense" in e ? e.hasLicense : !!y || s, [l, n] = b({}), [u, m] = b([]), [S, v] = b([]), x = E(
117
+ (C) => l[C] ? l[C] : !1,
118
118
  [l]
119
119
  ), D = E(
120
- (L, N) => {
121
- const A = { ...l };
122
- A[L] = N, n(A);
120
+ (C, N) => {
121
+ const R = { ...l };
122
+ R[C] = N, n(R);
123
123
  },
124
124
  [l]
125
- ), [o, a] = Ie(Ee, {}), b = E(
126
- (L) => {
127
- const N = o[L];
128
- return ke(N) ? N : i;
125
+ ), [o, a] = Ee(Te, {}), w = E(
126
+ (C) => {
127
+ const N = o[C];
128
+ return De(N) ? N : i;
129
129
  },
130
130
  [o, i]
131
- ), [P, S] = w(null), M = E((L) => {
132
- S(L);
131
+ ), [P, I] = b(null), M = E((C) => {
132
+ I(C);
133
133
  }, []), F = E(() => {
134
- S(null), P && R([]);
134
+ I(null), P && U([]);
135
135
  }, []);
136
136
  B(() => {
137
137
  F();
138
138
  }, [r.useLocation().pathname]);
139
- const [t, I] = w(null), k = E((L) => {
140
- I(L);
139
+ const [t, k] = b(null), L = E((C) => {
140
+ k(C);
141
141
  }, []), O = E(() => {
142
- I(null);
143
- }, []), [U, _] = w(null), [V, R] = w([]), { uriType: H, uri: se, entity: $, getUriEntities: re } = Le(), [Q] = r.useSearchParams(), W = Q.get("project"), q = Q.get("type"), z = Q.get("id"), J = Q.get("activity");
142
+ k(null);
143
+ }, []), [A, _] = b(null), [H, U] = b([]), { uriType: Y, uri: le, entity: $, getUriEntities: ce } = Fe(), [Q] = r.useSearchParams(), W = Q.get("project"), q = Q.get("type"), z = Q.get("id"), X = Q.get("activity");
144
144
  B(() => {
145
145
  if (!(!W && !q && !z)) {
146
- if (H === "entity" && $ && $.entityType !== "product") {
147
- re().then((L) => {
148
- if (L.length === 0) return;
149
- const N = L.find((le) => le.uri === se), A = N?.entities?.[0];
150
- if (!N || !A) return;
151
- const K = A?.projectName || $.projectName || "", X = A.representationId || A.versionId || A.productId || A.taskId || A.folderId;
152
- if (!K || !X) return;
153
- const ae = {
146
+ if (Y === "entity" && $ && $.entityType !== "product") {
147
+ ce().then((C) => {
148
+ if (C.length === 0) return;
149
+ const N = C.find((ue) => ue.uri === le), R = N?.entities?.[0];
150
+ if (!N || !R) return;
151
+ const te = R?.projectName || $.projectName || "", ne = R.representationId || R.versionId || R.productId || R.taskId || R.folderId;
152
+ if (!te || !ne) return;
153
+ const de = {
154
154
  entityType: $.entityType,
155
155
  entities: [
156
156
  {
157
- id: X,
158
- projectName: K
157
+ id: ne,
158
+ projectName: te
159
159
  }
160
160
  ],
161
161
  source: "uri"
162
162
  };
163
- _(ae);
164
- }).catch((L) => {
165
- console.warn("Failed to get URI entities:", L);
163
+ _(de);
164
+ }).catch((C) => {
165
+ console.warn("Failed to get URI entities:", C);
166
166
  });
167
167
  return;
168
168
  }
@@ -175,13 +175,13 @@ const ut = ({ children: f, skip: i }) => {
175
175
  }
176
176
  ],
177
177
  source: "url"
178
- }), J && (R([J]), a({
178
+ }), X && (U([X]), a({
179
179
  ...o,
180
180
  overview: "feed"
181
181
  })));
182
182
  }
183
183
  }, [W, q, z]);
184
- const ie = {
184
+ const V = {
185
185
  // open state for the panel by scope
186
186
  panelOpenByScope: l,
187
187
  getOpenForScope: x,
@@ -189,53 +189,53 @@ const ut = ({ children: f, skip: i }) => {
189
189
  setPanelOpenByScope: n,
190
190
  // tab preferences
191
191
  tabsByScope: o,
192
- getTabForScope: b,
192
+ getTabForScope: w,
193
193
  // slide out state
194
194
  slideOut: P,
195
195
  openSlideOut: M,
196
196
  closeSlideOut: F,
197
197
  // highlighted activities
198
- highlightedActivities: V,
199
- setHighlightedActivities: R,
198
+ highlightedActivities: H,
199
+ setHighlightedActivities: U,
200
200
  // PiP state
201
201
  pip: t,
202
- openPip: k,
202
+ openPip: L,
203
203
  closePip: O,
204
204
  // entities state
205
- entities: U,
205
+ entities: A,
206
206
  setEntities: _,
207
207
  feedAnnotations: u,
208
208
  setFeedAnnotations: m,
209
- feedFrameLinks: C,
209
+ feedFrameLinks: S,
210
210
  setFeedFrameLinks: v,
211
211
  bundleMode: d,
212
212
  isGuest: h,
213
213
  hasLicense: p,
214
214
  onPowerFeature: g,
215
215
  ...r
216
- };
217
- return /* @__PURE__ */ T(xe.Provider, { value: ie, children: f });
218
- }, He = (f) => {
219
- const { setPowerpackDialog: i } = ne();
216
+ }, J = fe(V), Z = J.current, ee = Object.keys(V);
217
+ return (ee.length !== Object.keys(Z).length || ee.some((C) => Z[C] !== V[C])) && (J.current = V), /* @__PURE__ */ j(je.Provider, { value: J.current, children: f });
218
+ }, Xe = (f) => {
219
+ const { setPowerpackDialog: i } = ie();
220
220
  return B(() => {
221
221
  i({ addon: "planner", feature: "subtasks" }), f?.onNotFound?.();
222
222
  }, [i, f.onNotFound]), null;
223
- }, ft = ({ children: f }) => {
224
- const [i, { outdated: s, isLoading: e }] = oe({
223
+ }, yt = ({ children: f }) => {
224
+ const [i, { outdated: s, isLoading: e }] = ae({
225
225
  addon: "planner",
226
226
  remote: "planner",
227
227
  module: "SubtasksManager",
228
- fallback: He
228
+ fallback: Xe
229
229
  });
230
- return /* @__PURE__ */ T(
231
- De.Provider,
230
+ return /* @__PURE__ */ j(
231
+ Me.Provider,
232
232
  {
233
233
  value: { SubtasksManager: i, requiredVersion: s?.required, isLoading: e },
234
234
  children: f
235
235
  }
236
236
  );
237
- }, gt = ({ children: f }) => {
238
- const [i, s] = w(!1), [e, r] = w(null), [c, d] = w(null), h = () => {
237
+ }, Pt = ({ children: f }) => {
238
+ const [i, s] = b(!1), [e, r] = b(null), [c, d] = b(null), h = () => {
239
239
  s(!0), r(null);
240
240
  }, y = () => {
241
241
  s(!1), r(null);
@@ -246,8 +246,8 @@ const ut = ({ children: f, skip: i }) => {
246
246
  }, l = () => {
247
247
  r(null), d(null);
248
248
  };
249
- return /* @__PURE__ */ T(
250
- Fe.Provider,
249
+ return /* @__PURE__ */ j(
250
+ Oe.Provider,
251
251
  {
252
252
  value: {
253
253
  isPanelOpen: i,
@@ -264,17 +264,17 @@ const ut = ({ children: f, skip: i }) => {
264
264
  }
265
265
  );
266
266
  };
267
- function mt({ children: f }) {
268
- const i = window.location.protocol === "https:" || window.location.hostname === "localhost", s = "documentPictureInPicture" in window && i, [e, r] = w(null), [c, d] = w(null), h = E(() => {
267
+ function vt({ children: f }) {
268
+ const i = window.location.protocol === "https:" || window.location.hostname === "localhost", s = "documentPictureInPicture" in window && i, [e, r] = b(null), [c, d] = b(null), h = E(() => {
269
269
  d(null), e != null && (e.close(), r(null));
270
270
  }, [e, c]), y = E(
271
271
  async (p, l) => {
272
272
  if (!s) {
273
- d(Y());
273
+ d(K());
274
274
  return;
275
275
  }
276
276
  if (e != null) {
277
- console.log("pipWindow is already open"), d(Y());
277
+ console.log("pipWindow is already open"), d(K());
278
278
  return;
279
279
  }
280
280
  const n = await window.documentPictureInPicture.requestWindow({
@@ -283,7 +283,7 @@ function mt({ children: f }) {
283
283
  });
284
284
  n.addEventListener("pagehide", () => {
285
285
  r(null), d(null);
286
- }), r(n), d(Y());
286
+ }), r(n), d(K());
287
287
  },
288
288
  [e, c]
289
289
  );
@@ -308,28 +308,28 @@ function mt({ children: f }) {
308
308
  }
309
309
  });
310
310
  }, [e]);
311
- const g = j(() => ({
311
+ const g = T(() => ({
312
312
  isSupported: s,
313
313
  pipWindow: e,
314
314
  pipId: c,
315
315
  requestPipWindow: y,
316
316
  closePipWindow: h
317
317
  }), [h, s, e, y]);
318
- return /* @__PURE__ */ T(Te.Provider, { value: g, children: f });
318
+ return /* @__PURE__ */ j(Re.Provider, { value: g, children: f });
319
319
  }
320
- const ht = ({
320
+ const bt = ({
321
321
  children: f,
322
322
  projectName: i,
323
323
  // utils
324
324
  toast: s,
325
325
  ...e
326
326
  }) => {
327
- const { data: r } = ge(
327
+ const { data: r } = Pe(
328
328
  { projectName: i },
329
329
  { skip: !i }
330
- ), { user: c } = te();
331
- return /* @__PURE__ */ T(
332
- je.Provider,
330
+ ), { user: c } = re();
331
+ return /* @__PURE__ */ j(
332
+ Ae.Provider,
333
333
  {
334
334
  value: {
335
335
  ...e,
@@ -341,17 +341,17 @@ const ht = ({
341
341
  children: f
342
342
  }
343
343
  );
344
- }, yt = ({ children: f, ...i }) => /* @__PURE__ */ T(Me.Provider, { value: { ...i }, children: f }), Pt = ({
344
+ }, wt = ({ children: f, ...i }) => /* @__PURE__ */ j(Ue.Provider, { value: { ...i }, children: f }), Ct = ({
345
345
  children: f,
346
346
  debug: i
347
347
  }) => {
348
- const [s, e] = w(null), [r, c] = w(null), d = (o) => o !== null && typeof o == "object" && "addon" in o, h = E((o) => {
348
+ const [s, e] = b(null), [r, c] = b(null), d = (o) => o !== null && typeof o == "object" && "addon" in o, h = E((o) => {
349
349
  o === null ? (e(null), c(null)) : d(o) ? (e(null), c(o)) : (c(null), e(o));
350
- }, []), y = (o) => o ? $e[o] : null, g = (o) => {
350
+ }, []), y = (o) => o ? ze[o] : null, g = (o) => {
351
351
  if (!o) return null;
352
- const a = Ve[o.addon];
352
+ const a = Ke[o.addon];
353
353
  return a ? { ...a, selectedFeature: o.feature } : null;
354
- }, [p, l] = w(!1), [n, u] = w(!0), m = async () => !1, [C, { isLoaded: v, isLoading: x }] = oe({
354
+ }, [p, l] = b(!1), [n, u] = b(!0), m = async () => !1, [S, { isLoaded: v, isLoading: x }] = ae({
355
355
  addon: "powerpack",
356
356
  remote: "license",
357
357
  module: "checkPowerLicense",
@@ -363,7 +363,7 @@ const ht = ({
363
363
  console.warn("Using debug power license:", i.powerLicense), l(i.powerLicense), u(!1);
364
364
  else if (v || !x) {
365
365
  try {
366
- const a = await C();
366
+ const a = await S();
367
367
  l(a);
368
368
  } catch (a) {
369
369
  console.error("Error checking power license:", a), l(!1);
@@ -373,8 +373,8 @@ const ht = ({
373
373
  u(!1);
374
374
  }
375
375
  })();
376
- }, [i, v, x, C]);
377
- const D = j(
376
+ }, [i, v, x, S]);
377
+ const D = T(
378
378
  () => ({
379
379
  powerLicense: p,
380
380
  isLoading: n,
@@ -386,23 +386,23 @@ const ht = ({
386
386
  }),
387
387
  [p, s, r, h, n]
388
388
  );
389
- return /* @__PURE__ */ T(Oe.Provider, { value: D, children: f });
390
- }, vt = ({ children: f, skip: i = !1 }) => {
389
+ return /* @__PURE__ */ j(Ne.Provider, { value: D, children: f });
390
+ }, St = ({ children: f, skip: i = !1 }) => {
391
391
  const {
392
392
  data: s = {},
393
393
  isLoading: e,
394
394
  error: r
395
- } = me({ full: !0 }, { skip: i }), { data: c, isLoading: d, error: h } = he(), {
395
+ } = ve({ full: !0 }, { skip: i }), { data: c, isLoading: d, error: h } = be(), {
396
396
  data: y = [],
397
397
  isLoading: g,
398
398
  error: p
399
- } = ye({}, { skip: i }), l = j(() => y.filter((C) => C.active), [y]), {
399
+ } = we({}, { skip: i }), l = T(() => y.filter((S) => S.active), [y]), {
400
400
  data: n,
401
401
  isLoading: u,
402
402
  error: m
403
- } = Pe(void 0, { skip: !c?.name });
404
- return /* @__PURE__ */ T(
405
- Ae.Provider,
403
+ } = Ce(void 0, { skip: !c?.name });
404
+ return /* @__PURE__ */ j(
405
+ Be.Provider,
406
406
  {
407
407
  value: {
408
408
  siteInfo: s,
@@ -429,7 +429,7 @@ const ht = ({
429
429
  children: f
430
430
  }
431
431
  );
432
- }, wt = ({
432
+ }, It = ({
433
433
  projectName: f,
434
434
  children: i
435
435
  }) => {
@@ -441,73 +441,73 @@ const ht = ({
441
441
  isUninitialized: d,
442
442
  error: h,
443
443
  refetch: y
444
- } = ve({ projectName: f, attrib: !0 }), g = ze({ projectName: f }, r || e), p = j(() => {
444
+ } = Se({ projectName: f, attrib: !0 }), g = Je({ projectName: f }, r || e), p = T(() => {
445
445
  const o = /* @__PURE__ */ new Map();
446
446
  for (const a of s)
447
447
  o.set(a.id, a);
448
448
  return o;
449
- }, [s]), l = j(() => (o) => p.get(o), [p]), n = j(
450
- () => (o, a, b = {}) => {
449
+ }, [s]), l = T(() => (o) => p.get(o), [p]), n = T(
450
+ () => (o, a, w = {}) => {
451
451
  if (!a.length) return {};
452
- const P = {}, S = new Set(a), M = /* @__PURE__ */ new Set();
452
+ const P = {}, I = new Set(a), M = /* @__PURE__ */ new Set();
453
453
  let F = o;
454
- for (; S.size > 0 && F && !M.has(F); ) {
454
+ for (; I.size > 0 && F && !M.has(F); ) {
455
455
  M.add(F);
456
456
  const t = p.get(F);
457
457
  if (!t) break;
458
- const I = t.attrib || {};
459
- for (const k of Array.from(S))
460
- t.ownAttrib?.includes(k) && k in I && (P[k] = Object.entries(I).find(
461
- ([O]) => O === k
462
- )?.[1], S.delete(k));
458
+ const k = t.attrib || {};
459
+ for (const L of Array.from(I))
460
+ t.ownAttrib?.includes(L) && L in k && (P[L] = Object.entries(k).find(
461
+ ([O]) => O === L
462
+ )?.[1], I.delete(L));
463
463
  F = t.parentId;
464
464
  }
465
- for (const t of Array.from(S))
466
- t in b && (P[t] = b[t], S.delete(t));
467
- for (const t of S)
465
+ for (const t of Array.from(I))
466
+ t in w && (P[t] = w[t], I.delete(t));
467
+ for (const t of I)
468
468
  P[t] = null;
469
469
  return P;
470
470
  },
471
471
  [p]
472
- ), u = j(
472
+ ), u = T(
473
473
  () => (o) => {
474
- const a = [], b = /* @__PURE__ */ new Set();
474
+ const a = [], w = /* @__PURE__ */ new Set();
475
475
  let P = o;
476
- for (; P && !b.has(P); ) {
477
- b.add(P);
478
- const S = p.get(P);
479
- if (!S?.parentId) break;
480
- a.push(S.parentId), P = S.parentId;
476
+ for (; P && !w.has(P); ) {
477
+ w.add(P);
478
+ const I = p.get(P);
479
+ if (!I?.parentId) break;
480
+ a.push(I.parentId), P = I.parentId;
481
481
  }
482
482
  return a;
483
483
  },
484
484
  [p]
485
- ), m = j(
485
+ ), m = T(
486
486
  () => (o) => {
487
487
  const a = new Set(o);
488
- return o.filter((b) => !u(b).some((P) => a.has(P)));
488
+ return o.filter((w) => !u(w).some((P) => a.has(P)));
489
489
  },
490
490
  [u]
491
- ), C = j(() => {
491
+ ), S = T(() => {
492
492
  const o = /* @__PURE__ */ new Map();
493
493
  for (const a of s) {
494
494
  if (!a.parentId) continue;
495
- const b = o.get(a.parentId);
496
- b ? b.push(a.id) : o.set(a.parentId, [a.id]);
495
+ const w = o.get(a.parentId);
496
+ w ? w.push(a.id) : o.set(a.parentId, [a.id]);
497
497
  }
498
498
  return o;
499
- }, [s]), v = j(
499
+ }, [s]), v = T(
500
500
  () => (o, a = !1) => {
501
- const b = a ? [...o] : [], P = [...o];
501
+ const w = a ? [...o] : [], P = [...o];
502
502
  for (; P.length > 0; ) {
503
- const S = P.shift();
504
- for (const M of C.get(S) || [])
505
- b.push(M), P.push(M);
503
+ const I = P.shift();
504
+ for (const M of S.get(I) || [])
505
+ w.push(M), P.push(M);
506
506
  }
507
- return b;
507
+ return w;
508
508
  },
509
- [C]
510
- ), x = () => y().unwrap(), D = j(
509
+ [S]
510
+ ), x = () => y().unwrap(), D = T(
511
511
  () => ({
512
512
  folders: s,
513
513
  getFolderById: l,
@@ -539,19 +539,19 @@ const ht = ({
539
539
  x
540
540
  ]
541
541
  );
542
- return /* @__PURE__ */ T(Ue.Provider, { value: D, children: i });
543
- }, bt = "uri", Ct = ({ children: f }) => {
544
- const i = location.pathname, [s, e] = w(""), r = ["projects", "settings", "dashboard/tasks"];
542
+ return /* @__PURE__ */ j(Ge.Provider, { value: D, children: i });
543
+ }, kt = "uri", Lt = ({ children: f }) => {
544
+ const i = location.pathname, [s, e] = b(""), r = ["projects", "settings", "dashboard/tasks"];
545
545
  B(() => {
546
546
  r.some((u) => i.startsWith(`/${u}`)) || e("");
547
547
  }, [i, e]);
548
- const { type: c, entity: d, settings: h } = Ge(s), y = E(
549
- ({ projectName: n, folderPath: u, taskName: m, productName: C, versionName: v }) => {
550
- const x = _e({ projectName: n, folderPath: u, taskName: m, productName: C, versionName: v });
548
+ const { type: c, entity: d, settings: h } = We(s), y = E(
549
+ ({ projectName: n, folderPath: u, taskName: m, productName: S, versionName: v }) => {
550
+ const x = qe({ projectName: n, folderPath: u, taskName: m, productName: S, versionName: v });
551
551
  e(x);
552
552
  },
553
553
  [e]
554
- ), [g] = we(), p = E(async () => {
554
+ ), [g] = Ie(), p = E(async () => {
555
555
  if (c !== "entity" || !s) return [];
556
556
  try {
557
557
  const n = await g({ resolveRequestModel: { uris: [s] } }).unwrap();
@@ -568,16 +568,16 @@ const ht = ({
568
568
  setEntityUri: y,
569
569
  getUriEntities: p
570
570
  };
571
- return /* @__PURE__ */ T(Re.Provider, { value: l, children: f });
572
- }, ee = [
571
+ return /* @__PURE__ */ j(_e.Provider, { value: l, children: f });
572
+ }, se = [
573
573
  "representation",
574
574
  "version",
575
575
  "workfile",
576
576
  "product",
577
577
  "task",
578
578
  "folder"
579
- ], Ye = "delete-folder-with-children", St = ({ children: f }) => {
580
- const [i] = be(), [s] = Ce(), [e, r] = w(null), [c, d] = w(null), h = E(
579
+ ], Ze = "delete-folder-with-children", xt = ({ children: f }) => {
580
+ const [i] = ke(), [s] = Le(), [e, r] = b(null), [c, d] = b(null), h = E(
581
581
  (l) => new Promise((n) => d({ payload: l, resolve: n })),
582
582
  []
583
583
  ), y = E(
@@ -591,25 +591,25 @@ const ht = ({
591
591
  G.error("No entities found");
592
592
  return;
593
593
  }
594
- const C = new Set(m.map((t) => t.id)), v = m.filter((t) => t.entityType === "folder" && t.parentId ? !C.has(t.parentId) : (t.entityType === "task" || t.entityType === "product") && t.folderId ? !C.has(t.folderId) : !0), x = async (t, I) => {
594
+ const S = new Set(m.map((t) => t.id)), v = m.filter((t) => t.entityType === "folder" && t.parentId ? !S.has(t.parentId) : (t.entityType === "task" || t.entityType === "product") && t.folderId ? !S.has(t.folderId) : !0), x = async (t, k) => {
595
595
  if (t.length === 0) return;
596
- const k = /* @__PURE__ */ new Map();
596
+ const L = /* @__PURE__ */ new Map();
597
597
  for (const O of t) {
598
- const U = k.get(O.projectName) || [];
599
- U.push(O), k.set(O.projectName, U);
598
+ const A = L.get(O.projectName) || [];
599
+ A.push(O), L.set(O.projectName, A);
600
600
  }
601
601
  await Promise.all(
602
- Array.from(k.entries()).map(([O, U]) => {
603
- const V = [...U].sort(
604
- (R, H) => ee.indexOf(R.entityType) - ee.indexOf(H.entityType)
605
- ).map((R) => ({
602
+ Array.from(L.entries()).map(([O, A]) => {
603
+ const H = [...A].sort(
604
+ (U, Y) => se.indexOf(U.entityType) - se.indexOf(Y.entityType)
605
+ ).map((U) => ({
606
606
  type: "delete",
607
- entityType: R.entityType,
608
- entityId: R.id,
609
- force: I
607
+ entityType: U.entityType,
608
+ entityId: U.id,
609
+ force: k
610
610
  }));
611
611
  return i({
612
- operationsRequestModel: { operations: V },
612
+ operationsRequestModel: { operations: H },
613
613
  projectName: O
614
614
  }).unwrap();
615
615
  })
@@ -618,46 +618,46 @@ const ht = ({
618
618
  try {
619
619
  await x(v, !1), n?.onSuccess?.();
620
620
  } catch (t) {
621
- throw { message: pe(t) || "Failed to delete entities", ...t };
621
+ throw { message: he(t) || "Failed to delete entities", ...t };
622
622
  }
623
623
  }, o = () => x(
624
624
  v.filter((t) => t.entityType === "folder" || t.entityType === "task"),
625
625
  !0
626
626
  ), a = v.filter((t) => t.entityType === "folder");
627
- let b = [];
627
+ let w = [];
628
628
  if (a.length > 0) {
629
629
  const t = /* @__PURE__ */ new Map();
630
- for (const I of a) {
631
- const k = t.get(I.projectName) || [];
632
- k.push(I), t.set(I.projectName, k);
630
+ for (const k of a) {
631
+ const L = t.get(k.projectName) || [];
632
+ L.push(k), t.set(k.projectName, L);
633
633
  }
634
634
  try {
635
- b = (await Promise.all(
635
+ w = (await Promise.all(
636
636
  Array.from(t.entries()).map(
637
- ([k, O]) => s({
638
- projectName: k,
639
- folderIds: O.map((U) => U.id)
637
+ ([L, O]) => s({
638
+ projectName: L,
639
+ folderIds: O.map((A) => A.id)
640
640
  }).unwrap()
641
641
  )
642
642
  )).flat();
643
- } catch (I) {
644
- console.warn("Failed to fetch folder delete info, falling back to local data", I);
643
+ } catch (k) {
644
+ console.warn("Failed to fetch folder delete info, falling back to local data", k);
645
645
  }
646
646
  }
647
- const P = Qe(a, b), S = v.filter((t) => t.entityType === "product").length;
648
- S > 0 && P.push(
649
- S > 1 ? "Deleting these products also deletes all their versions" : "Deleting this product also deletes all its versions"
647
+ const P = Ve(a, w), I = v.filter((t) => t.entityType === "product").length;
648
+ I > 0 && P.push(
649
+ I > 1 ? "Deleting these products also deletes all their versions" : "Deleting this product also deletes all its versions"
650
650
  );
651
- const M = We(v), F = v.length === 1 ? v[0] : void 0;
651
+ const M = He(v), F = v.length === 1 ? v[0] : void 0;
652
652
  r({
653
653
  payload: {
654
654
  entityLabel: M,
655
655
  childrenDetails: P,
656
- expectedCounts: qe(v, b),
656
+ expectedCounts: Ye(v, w),
657
657
  expectedName: F && (F.label || F.name || F.id)
658
658
  },
659
659
  accept: D,
660
- recover: async (t) => ue(t).includes(Ye) ? await h({
660
+ recover: async (t) => me(t).includes(Ze) ? await h({
661
661
  entityLabel: M,
662
662
  message: `Are you really sure you want to delete ${M} and all of its dependencies? This cannot be undone. (NOT RECOMMENDED)`,
663
663
  childrenDetails: [],
@@ -671,7 +671,7 @@ const ht = ({
671
671
  if (!e) return;
672
672
  const { payload: l, accept: n, recover: u } = e;
673
673
  r(null);
674
- const m = l.entityLabel, C = G.loading(`Deleting ${m}...`, { autoClose: !1 }), v = () => G.update(C, {
674
+ const m = l.entityLabel, S = G.loading(`Deleting ${m}...`, { autoClose: !1 }), v = () => G.update(S, {
675
675
  render: `${m} deleted`,
676
676
  type: "success",
677
677
  autoClose: 5e3,
@@ -685,7 +685,7 @@ const ht = ({
685
685
  const a = await u(x);
686
686
  if (a === "recovered") return v();
687
687
  if (a === "cancelled")
688
- return G.update(C, {
688
+ return G.update(S, {
689
689
  render: `${m} was not deleted`,
690
690
  type: "info",
691
691
  autoClose: 5e3,
@@ -695,26 +695,26 @@ const ht = ({
695
695
  D = a;
696
696
  }
697
697
  const o = typeof D == "string" ? D : D?.message || D?.error || `Error deleting ${m}`;
698
- G.update(C, {
698
+ G.update(S, {
699
699
  render: o,
700
700
  type: "error",
701
701
  autoClose: 5e3,
702
702
  isLoading: !1
703
703
  });
704
704
  }
705
- }, [e]), p = j(() => ({ deleteEntities: y }), [y]);
706
- return /* @__PURE__ */ ce(Ne.Provider, { value: p, children: [
705
+ }, [e]), p = T(() => ({ deleteEntities: y }), [y]);
706
+ return /* @__PURE__ */ pe($e.Provider, { value: p, children: [
707
707
  f,
708
- e && /* @__PURE__ */ T(
709
- Z,
708
+ e && /* @__PURE__ */ j(
709
+ oe,
710
710
  {
711
711
  payload: e.payload,
712
712
  onConfirm: g,
713
713
  onCancel: () => r(null)
714
714
  }
715
715
  ),
716
- c && /* @__PURE__ */ T(
717
- Z,
716
+ c && /* @__PURE__ */ j(
717
+ oe,
718
718
  {
719
719
  payload: c.payload,
720
720
  onConfirm: () => {
@@ -728,75 +728,75 @@ const ht = ({
728
728
  ] });
729
729
  };
730
730
  export {
731
- Me as AddonContext,
732
- je as AddonProjectContext,
733
- ht as AddonProjectProvider,
734
- yt as AddonProvider,
735
- Ne as DeleteEntitiesContext,
736
- St as DeleteEntitiesProvider,
737
- xe as DetailsPanelContext,
738
- pt as DetailsPanelProvider,
739
- Lt as EntityUpdatesContext,
740
- gn as EntityUpdatesProvider,
741
- mn as FORCE_AUTO_SYNC,
742
- Ae as GlobalContext,
743
- vt as GlobalProvider,
744
- xt as MenuContext,
745
- pn as MenuProvider,
746
- Te as PiPContext,
747
- mt as PiPProvider,
748
- Et as PiPWrapper,
749
- Oe as PowerpackContext,
750
- Pt as PowerpackProvider,
751
- Dt as ProjectContext,
752
- an as ProjectContextProvider,
753
- Ue as ProjectFoldersContext,
754
- wt as ProjectFoldersContextProvider,
755
- Se as RemoteModulesContext,
756
- ut as RemoteModulesProvider,
757
- Fe as SettingsPanelContext,
758
- gt as SettingsPanelProvider,
759
- Ft as SocketContext,
760
- Tt as SocketProvider,
761
- De as SubtasksModulesContext,
762
- ft as SubtasksModulesProvider,
763
- Ee as TABS_BY_SCOPE_KEY,
764
- jt as ThumbnailUploadContext,
765
- ln as ThumbnailUploadProvider,
766
- Re as URIContext,
767
- Ct as URIProvider,
768
- bt as URL_PARAM_ID,
769
- Ve as addonConfigs,
770
- Mt as getActivityFrameLink,
771
- Ot as getAutoSyncForTopic,
772
- At as getUpdateType,
773
- Ut as isDeletableEntityType,
774
- ke as isDetailsPanelTab,
775
- Rt as matchesProject,
776
- Nt as matchesTopic,
777
- dn as powerpackFeatureOrder,
778
- $e as powerpackFeatures,
779
- Bt as setDetailsPanelTabForScope,
780
- Gt as toggleSyncAll,
781
- _t as useAddonContext,
782
- $t as useAddonProjectContext,
783
- Qt as useAutoSyncSettings,
784
- Wt as useDeleteEntitiesContext,
785
- qt as useDeleteEntitiesContextOptional,
786
- zt as useDetailsPanelContext,
787
- te as useGlobalContext,
788
- Vt as useMenuContext,
789
- Ht as useOptionalProjectContext,
790
- Yt as usePiPWindow,
791
- ne as usePowerpack,
792
- Jt as useProjectContext,
793
- Kt as useProjectFoldersContext,
794
- Xt as useRemoteModules,
795
- Zt as useScopedDetailsPanel,
796
- en as useSettingsPanel,
797
- tn as useSocketContext,
798
- nn as useSubtasksModulesContext,
799
- on as useSyncUpdates,
800
- sn as useThumbnailUploadContext,
801
- Le as useURIContext
731
+ Ue as AddonContext,
732
+ Ae as AddonProjectContext,
733
+ bt as AddonProjectProvider,
734
+ wt as AddonProvider,
735
+ $e as DeleteEntitiesContext,
736
+ xt as DeleteEntitiesProvider,
737
+ je as DetailsPanelContext,
738
+ ht as DetailsPanelProvider,
739
+ Ft as EntityUpdatesContext,
740
+ Pn as EntityUpdatesProvider,
741
+ vn as FORCE_AUTO_SYNC,
742
+ Be as GlobalContext,
743
+ St as GlobalProvider,
744
+ jt as MenuContext,
745
+ hn as MenuProvider,
746
+ Re as PiPContext,
747
+ vt as PiPProvider,
748
+ Tt as PiPWrapper,
749
+ Ne as PowerpackContext,
750
+ Ct as PowerpackProvider,
751
+ Mt as ProjectContext,
752
+ un as ProjectContextProvider,
753
+ Ge as ProjectFoldersContext,
754
+ It as ProjectFoldersContextProvider,
755
+ xe as RemoteModulesContext,
756
+ mt as RemoteModulesProvider,
757
+ Oe as SettingsPanelContext,
758
+ Pt as SettingsPanelProvider,
759
+ Ot as SocketContext,
760
+ Rt as SocketProvider,
761
+ Me as SubtasksModulesContext,
762
+ yt as SubtasksModulesProvider,
763
+ Te as TABS_BY_SCOPE_KEY,
764
+ At as ThumbnailUploadContext,
765
+ pn as ThumbnailUploadProvider,
766
+ _e as URIContext,
767
+ Lt as URIProvider,
768
+ kt as URL_PARAM_ID,
769
+ Ke as addonConfigs,
770
+ Ut as getActivityFrameLink,
771
+ Nt as getAutoSyncForTopic,
772
+ Bt as getUpdateType,
773
+ Gt as isDeletableEntityType,
774
+ De as isDetailsPanelTab,
775
+ _t as matchesProject,
776
+ $t as matchesTopic,
777
+ gn as powerpackFeatureOrder,
778
+ ze as powerpackFeatures,
779
+ Qt as setDetailsPanelTabForScope,
780
+ Wt as toggleSyncAll,
781
+ qt as useAddonContext,
782
+ zt as useAddonProjectContext,
783
+ Vt as useAutoSyncSettings,
784
+ Ht as useDeleteEntitiesContext,
785
+ Yt as useDeleteEntitiesContextOptional,
786
+ Jt as useDetailsPanelContext,
787
+ re as useGlobalContext,
788
+ Kt as useMenuContext,
789
+ Xt as useOptionalProjectContext,
790
+ Zt as usePiPWindow,
791
+ ie as usePowerpack,
792
+ en as useProjectContext,
793
+ tn as useProjectFoldersContext,
794
+ nn as useRemoteModules,
795
+ on as useScopedDetailsPanel,
796
+ sn as useSettingsPanel,
797
+ rn as useSocketContext,
798
+ an as useSubtasksModulesContext,
799
+ ln as useSyncUpdates,
800
+ cn as useThumbnailUploadContext,
801
+ Fe as useURIContext
802
802
  };