@ynput/ayon-frontend-shared 0.6.5 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/DetailsPanel.es.js +3 -3
  2. package/dist/NewEntity.es.js +15 -15
  3. package/dist/ProjectTreeTable.es.js +430 -433
  4. package/dist/Slicer.es.js +11 -11
  5. package/dist/Views.es.js +213 -206
  6. package/dist/chunks/CodeEditor.es.js +30 -0
  7. package/dist/chunks/ColumnDropIndicator.styled.es.js +24 -24
  8. package/dist/chunks/ColumnHeaderMenuUI.es.js +2 -2
  9. package/dist/chunks/DeleteEntitiesContextInstance.es.js +103 -103
  10. package/dist/chunks/EntityPath.es.js +2 -2
  11. package/dist/chunks/EntityTooltip.es.js +1 -1
  12. package/dist/chunks/Feed.es.js +958 -931
  13. package/dist/chunks/JsonViewer.es.js +1 -1
  14. package/dist/chunks/Menu.es.js +169 -167
  15. package/dist/chunks/MenuItem.es.js +109 -74
  16. package/dist/chunks/MetaWidget.es.js +1537 -1516
  17. package/dist/chunks/PlayableIcon.es.js +127 -127
  18. package/dist/chunks/ReviewablesSelector.es.js +199 -196
  19. package/dist/chunks/SimpleForm.es.js +78 -75
  20. package/dist/chunks/SimpleTable.es.js +110 -110
  21. package/dist/chunks/Slicer.es.js +22 -22
  22. package/dist/chunks/TableSettingsFallback.es.js +1 -1
  23. package/dist/chunks/ThumbnailSimple.es.js +2 -2
  24. package/dist/chunks/VideoPlayer.es.js +1 -1
  25. package/dist/chunks/Watchers.es.js +19 -19
  26. package/dist/chunks/afterStartup.es.js +13 -0
  27. package/dist/chunks/getUris.es.js +926 -964
  28. package/dist/chunks/queryFilterToClientFilter.es.js +90 -81
  29. package/dist/chunks/searchTerms.es.js +1 -0
  30. package/dist/chunks/useHierarchySelection.es.js +2 -2
  31. package/dist/chunks/useLoadModule.es.js +24 -23
  32. package/dist/components.es.js +202 -200
  33. package/dist/context.es.js +521 -492
  34. package/dist/hooks.es.js +190 -166
  35. package/dist/types/ContextMenu.d.ts +1 -0
  36. package/dist/types/Feed.d.ts +1 -1
  37. package/dist/types/ProjectTreeTable.d.ts +4 -5
  38. package/dist/types/Slicer.d.ts +1 -1
  39. package/dist/types/Views.d.ts +13 -2
  40. package/dist/types/api.d.ts +203 -1175
  41. package/dist/types/components.d.ts +14 -3
  42. package/dist/types/context.d.ts +3 -2
  43. package/dist/types/hooks.d.ts +25 -1
  44. package/dist/types/util.d.ts +11 -1
  45. package/dist/util.es.js +44 -41
  46. package/package.json +2 -2
@@ -1,67 +1,83 @@
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 { cS as ye, c4 as Pe, ci as ve, bq as be, cU as we, cD as Ce, bK as Se, c_ as Ie, dn as ke, cK as Le } from "./chunks/getUris.es.js";
1
+ import { jsx as F, jsxs as ge } from "react/jsx-runtime";
2
+ import { useState as w, useRef as re, useEffect as _, useCallback as E, useMemo as T } from "react";
3
+ import { registerRemotes as me } from "@module-federation/enhanced/runtime";
4
+ import { toast as M } from "react-toastify";
5
+ import { d as ie, z as he, R as ye, a as ae, p as Pe, A as ve, B as be, G as we, H as Ce, I as Se, J as Ie, K as ke, L as Le, N as xe, O as Ee, Q as De, U as Fe, V as je, W as Te } from "./chunks/DeleteEntitiesContextInstance.es.js";
6
+ import { E as Rt, M as At, X as Mt, P as Ut, Y as Nt, Z as _t, T as Gt, _ as $t, $ as Bt, g as Wt, a0 as Qt, m as qt, c as Vt, a1 as zt, t as Ht, a2 as Yt, a3 as Kt, a4 as Jt, a5 as Xt, a6 as Zt, o as en, u as tn, n as nn, a7 as on, x as sn, y as rn, b as an, a8 as ln, a9 as cn, aa as dn, ab as un, ac as pn, ad as fn } from "./chunks/DeleteEntitiesContextInstance.es.js";
7
+ import { ay as Oe, bi as Re } from "./chunks/searchTerms.es.js";
8
+ import { cS as Ae, c4 as Me, ci as Ue, bq as Ne, cU as _e, cD as Ge, bK as $e, c_ as Be, dn as We, cK as Qe } from "./chunks/getUris.es.js";
6
9
  import "primereact/confirmdialog";
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 Ue, N as Ae, 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 Ut, _ as At, $ as Nt, g as Bt, a0 as Gt, m as _t, c as $t, a1 as Wt, t as qt, a2 as Qt, a3 as zt, a4 as Vt, a5 as Ht, a6 as Yt, v as Kt, u as Jt, 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
10
  import "lodash";
10
- import { toast as G } from "react-toastify";
11
11
  import { v4 as J } from "uuid";
12
- import { g as We, p as qe, 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";
12
+ import { g as qe, p as Ve, b as ze } from "./chunks/getBundleMode.es.js";
13
+ import { u as le } from "./chunks/useLoadModule.es.js";
14
+ import { P as mn, T as hn } from "./chunks/ProjectContext.es.js";
15
15
  import "react-dom";
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 Ke } 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, {
16
+ import { p as He, c as Ye, d as Ke, e as Je, b as oe } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
17
+ import { a as Pn } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
18
+ import { M as bn } from "./chunks/MenuContext.es.js";
19
+ import { u as Xe } from "./chunks/useQueryArgumentChangeLoading.es.js";
20
+ import { E as Cn, F as Sn } from "./chunks/EntityUpdatesContext.es.js";
21
+ const vt = ({ children: d, skip: i }) => {
22
+ const {
23
+ data: r = [],
24
+ isLoading: t,
25
+ isFetching: a
26
+ } = Ae(void 0, {
23
27
  skip: i
24
28
  }), {
25
- siteInfo: r,
26
- isLoading: { siteInfo: c }
27
- } = re(), [d, h] = b(!1);
28
- return B(() => {
29
- if (e || c || d) return;
30
- if (!s.length) {
31
- h(!0);
29
+ siteInfo: c,
30
+ isLoading: { siteInfo: f }
31
+ } = ie(), [y, P] = w(!1), C = re({});
32
+ return _(() => {
33
+ if (!y || a) return;
34
+ const l = r.filter(({ addonName: p, addonVersion: b }) => {
35
+ const h = C.current[p];
36
+ return h !== void 0 && h !== b;
37
+ }), e = "addon-versions-changed";
38
+ if (!l.length) {
39
+ M.dismiss(e);
40
+ return;
41
+ }
42
+ const n = l.map((p) => `${p.addonName} ${p.addonVersion}`).join(", "), u = /* @__PURE__ */ F(ye, { message: `Addons updated (${n}). Refresh to load them.` });
43
+ M.isActive(e) ? M.update(e, { render: u }) : M.info(u, { toastId: e, autoClose: !1, closeOnClick: !1 });
44
+ }, [r, a, y]), _(() => {
45
+ if (t || f || y) return;
46
+ if (!r.length) {
47
+ P(!0);
32
48
  return;
33
49
  }
34
- const y = [];
35
- s.forEach((g) => {
36
- const { addonName: p, addonVersion: l, modules: n = {} } = g;
37
- Object.entries(n).forEach(([u, m]) => {
38
- y.push({
39
- remote: u,
40
- addon: p,
41
- version: l,
42
- modules: m
50
+ const l = [];
51
+ r.forEach((e) => {
52
+ const { addonName: n, addonVersion: u, modules: p = {} } = e;
53
+ Object.entries(p).forEach(([b, h]) => {
54
+ l.push({
55
+ remote: b,
56
+ addon: n,
57
+ version: u,
58
+ modules: h
43
59
  });
44
60
  });
45
- }), ge(
46
- y.map((g) => ({
47
- name: g.remote,
48
- alias: g.remote,
49
- entry: `/addons/${g.addon || g.remote}/${g.version}/frontend/modules/${g.remote}/remoteEntry.js?server=${r?.releaseInfo?.version || r?.releaseInfo}-${r?.releaseInfo?.buildDate}-${(/* @__PURE__ */ new Date()).getTime()}`,
61
+ }), C.current = Object.fromEntries(l.map((e) => [e.addon, e.version])), me(
62
+ l.map((e) => ({
63
+ name: e.remote,
64
+ alias: e.remote,
65
+ entry: `/addons/${e.addon || e.remote}/${e.version}/frontend/modules/${e.remote}/remoteEntry.js?server=${c?.releaseInfo?.version || c?.releaseInfo}-${c?.releaseInfo?.buildDate}-${(/* @__PURE__ */ new Date()).getTime()}`,
50
66
  type: "module"
51
67
  }))
52
- ), h(!0);
53
- }, [s, e, c, d]), /* @__PURE__ */ j(
54
- xe.Provider,
68
+ ), P(!0);
69
+ }, [r, t, f, y]), /* @__PURE__ */ F(
70
+ he.Provider,
55
71
  {
56
72
  value: {
57
- isLoading: e,
58
- modules: s,
59
- remotesInitialized: d
73
+ isLoading: t,
74
+ modules: r,
75
+ remotesInitialized: y
60
76
  },
61
- children: f
77
+ children: d
62
78
  }
63
79
  );
64
- }, Je = {
80
+ }, Ze = {
65
81
  planner: {
66
82
  label: "Planner",
67
83
  icon: "calendar_month",
@@ -106,52 +122,52 @@ const mt = ({ children: f, skip: i }) => {
106
122
  "dataPortability"
107
123
  ]
108
124
  }
109
- }, ht = ({
110
- children: f,
125
+ }, bt = ({
126
+ children: d,
111
127
  defaultTab: i = "feed",
112
- hasLicense: s,
113
- debug: e = {},
114
- ...r
128
+ hasLicense: r,
129
+ debug: t = {},
130
+ ...a
115
131
  }) => {
116
- const c = r.user, d = We(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
- [l]
132
+ const c = a.user, f = qe(c), y = "isGuest" in t ? t.isGuest : c?.data?.isGuest, { powerLicense: P, setPowerpackDialog: C } = ae(), l = "hasLicense" in t ? t.hasLicense : !!P || r, [e, n] = w({}), [u, p] = w([]), [b, h] = w([]), x = E(
133
+ (S) => e[S] ? e[S] : !1,
134
+ [e]
119
135
  ), D = E(
120
- (C, N) => {
121
- const R = { ...l };
122
- R[C] = N, n(R);
136
+ (S, G) => {
137
+ const A = { ...e };
138
+ A[S] = G, n(A);
123
139
  },
124
- [l]
125
- ), [o, a] = Ee(Te, {}), w = E(
126
- (C) => {
127
- const N = o[C];
128
- return De(N) ? N : i;
140
+ [e]
141
+ ), [g, o] = Pe(Ce, {}), m = E(
142
+ (S) => {
143
+ const G = g[S];
144
+ return ve(G) ? G : i;
129
145
  },
130
- [o, i]
131
- ), [P, I] = b(null), M = E((C) => {
132
- I(C);
133
- }, []), F = E(() => {
134
- I(null), P && A([]);
146
+ [g, i]
147
+ ), [v, I] = w(null), O = E((S) => {
148
+ I(S);
149
+ }, []), j = E(() => {
150
+ I(null), v && N([]);
135
151
  }, []);
136
- B(() => {
137
- F();
138
- }, [r.useLocation().pathname]);
139
- const [t, k] = b(null), L = E((C) => {
140
- k(C);
141
- }, []), O = E(() => {
152
+ _(() => {
153
+ j();
154
+ }, [a.useLocation().pathname]);
155
+ const [s, k] = w(null), L = E((S) => {
156
+ k(S);
157
+ }, []), R = E(() => {
142
158
  k(null);
143
- }, []), [U, _] = b(null), [H, A] = b([]), { uriType: Y, uri: le, entity: $, getUriEntities: ce } = Fe(), [W] = r.useSearchParams(), q = W.get("project"), Q = W.get("type"), z = W.get("id"), X = W.get("activity");
144
- B(() => {
145
- if (!(!q && !Q && !z)) {
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;
159
+ }, []), [U, $] = w(null), [H, N] = w([]), { uriType: Y, uri: de, entity: B, getUriEntities: ue } = be(), [W] = a.useSearchParams(), Q = W.get("project"), q = W.get("type"), V = W.get("id"), X = W.get("activity");
160
+ _(() => {
161
+ if (!(!Q && !q && !V)) {
162
+ if (Y === "entity" && B && B.entityType !== "product") {
163
+ ue().then((S) => {
164
+ if (S.length === 0) return;
165
+ const G = S.find((fe) => fe.uri === de), A = G?.entities?.[0];
166
+ if (!G || !A) return;
167
+ const te = A?.projectName || B.projectName || "", ne = A.representationId || A.versionId || A.productId || A.taskId || A.folderId;
152
168
  if (!te || !ne) return;
153
- const de = {
154
- entityType: $.entityType,
169
+ const pe = {
170
+ entityType: B.entityType,
155
171
  entities: [
156
172
  {
157
173
  id: ne,
@@ -160,138 +176,138 @@ const mt = ({ children: f, skip: i }) => {
160
176
  ],
161
177
  source: "uri"
162
178
  };
163
- _(de);
164
- }).catch((C) => {
165
- console.warn("Failed to get URI entities:", C);
179
+ $(pe);
180
+ }).catch((S) => {
181
+ console.warn("Failed to get URI entities:", S);
166
182
  });
167
183
  return;
168
184
  }
169
- q && Q && z && (_({
170
- entityType: Q,
185
+ Q && q && V && ($({
186
+ entityType: q,
171
187
  entities: [
172
188
  {
173
- id: z,
174
- projectName: q
189
+ id: V,
190
+ projectName: Q
175
191
  }
176
192
  ],
177
193
  source: "url"
178
- }), X && (A([X]), a({
179
- ...o,
194
+ }), X && (N([X]), o({
195
+ ...g,
180
196
  overview: "feed"
181
197
  })));
182
198
  }
183
- }, [q, Q, z]);
184
- const V = {
199
+ }, [Q, q, V]);
200
+ const z = {
185
201
  // open state for the panel by scope
186
- panelOpenByScope: l,
202
+ panelOpenByScope: e,
187
203
  getOpenForScope: x,
188
204
  setPanelOpen: D,
189
205
  setPanelOpenByScope: n,
190
206
  // tab preferences
191
- tabsByScope: o,
192
- getTabForScope: w,
207
+ tabsByScope: g,
208
+ getTabForScope: m,
193
209
  // slide out state
194
- slideOut: P,
195
- openSlideOut: M,
196
- closeSlideOut: F,
210
+ slideOut: v,
211
+ openSlideOut: O,
212
+ closeSlideOut: j,
197
213
  // highlighted activities
198
214
  highlightedActivities: H,
199
- setHighlightedActivities: A,
215
+ setHighlightedActivities: N,
200
216
  // PiP state
201
- pip: t,
217
+ pip: s,
202
218
  openPip: L,
203
- closePip: O,
219
+ closePip: R,
204
220
  // entities state
205
221
  entities: U,
206
- setEntities: _,
222
+ setEntities: $,
207
223
  feedAnnotations: u,
208
- setFeedAnnotations: m,
209
- feedFrameLinks: S,
210
- setFeedFrameLinks: v,
211
- bundleMode: d,
212
- isGuest: h,
213
- hasLicense: p,
214
- onPowerFeature: g,
215
- ...r
216
- }, K = fe(V), Z = K.current, ee = Object.keys(V);
217
- return (ee.length !== Object.keys(Z).length || ee.some((C) => Z[C] !== V[C])) && (K.current = V), /* @__PURE__ */ j(je.Provider, { value: K.current, children: f });
218
- }, Xe = (f) => {
219
- const { setPowerpackDialog: i } = ie();
220
- return B(() => {
221
- i({ addon: "planner", feature: "subtasks" }), f?.onNotFound?.();
222
- }, [i, f.onNotFound]), null;
223
- }, yt = ({ children: f }) => {
224
- const [i, { outdated: s, isLoading: e }] = ae({
224
+ setFeedAnnotations: p,
225
+ feedFrameLinks: b,
226
+ setFeedFrameLinks: h,
227
+ bundleMode: f,
228
+ isGuest: y,
229
+ hasLicense: l,
230
+ onPowerFeature: C,
231
+ ...a
232
+ }, K = re(z), Z = K.current, ee = Object.keys(z);
233
+ return (ee.length !== Object.keys(Z).length || ee.some((S) => Z[S] !== z[S])) && (K.current = z), /* @__PURE__ */ F(we.Provider, { value: K.current, children: d });
234
+ }, et = (d) => {
235
+ const { setPowerpackDialog: i } = ae();
236
+ return _(() => {
237
+ i({ addon: "planner", feature: "subtasks" }), d?.onNotFound?.();
238
+ }, [i, d.onNotFound]), null;
239
+ }, wt = ({ children: d }) => {
240
+ const [i, { outdated: r, isLoading: t }] = le({
225
241
  addon: "planner",
226
242
  remote: "planner",
227
243
  module: "SubtasksManager",
228
- fallback: Xe
244
+ fallback: et
229
245
  });
230
- return /* @__PURE__ */ j(
231
- Me.Provider,
246
+ return /* @__PURE__ */ F(
247
+ Se.Provider,
232
248
  {
233
- value: { SubtasksManager: i, requiredVersion: s?.required, isLoading: e },
234
- children: f
249
+ value: { SubtasksManager: i, requiredVersion: r?.required, isLoading: t },
250
+ children: d
235
251
  }
236
252
  );
237
- }, Pt = ({ children: f }) => {
238
- const [i, s] = b(!1), [e, r] = b(null), [c, d] = b(null), h = () => {
239
- s(!0), r(null);
240
- }, y = () => {
241
- s(!1), r(null);
242
- }, g = (n, u = null) => {
243
- s((m) => !m), n && !i ? (r(n), d(u)) : (r(null), d(null));
244
- }, p = (n, u = null) => {
245
- r(n), d(u);
246
- }, l = () => {
247
- r(null), d(null);
253
+ }, Ct = ({ children: d }) => {
254
+ const [i, r] = w(!1), [t, a] = w(null), [c, f] = w(null), y = () => {
255
+ r(!0), a(null);
256
+ }, P = () => {
257
+ r(!1), a(null);
258
+ }, C = (n, u = null) => {
259
+ r((p) => !p), n && !i ? (a(n), f(u)) : (a(null), f(null));
260
+ }, l = (n, u = null) => {
261
+ a(n), f(u);
262
+ }, e = () => {
263
+ a(null), f(null);
248
264
  };
249
- return /* @__PURE__ */ j(
250
- Oe.Provider,
265
+ return /* @__PURE__ */ F(
266
+ Ie.Provider,
251
267
  {
252
268
  value: {
253
269
  isPanelOpen: i,
254
- selectedSetting: e,
270
+ selectedSetting: t,
255
271
  highlightedSetting: c,
256
- setHighlightedSetting: d,
257
- openPanel: h,
258
- closePanel: y,
259
- togglePanel: g,
260
- selectSetting: p,
261
- backToMainMenu: l
272
+ setHighlightedSetting: f,
273
+ openPanel: y,
274
+ closePanel: P,
275
+ togglePanel: C,
276
+ selectSetting: l,
277
+ backToMainMenu: e
262
278
  },
263
- children: f
279
+ children: d
264
280
  }
265
281
  );
266
282
  };
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
- d(null), e != null && (e.close(), r(null));
270
- }, [e, c]), y = E(
271
- async (p, l) => {
272
- if (!s) {
273
- d(J());
283
+ function St({ children: d }) {
284
+ const i = window.location.protocol === "https:" || window.location.hostname === "localhost", r = "documentPictureInPicture" in window && i, [t, a] = w(null), [c, f] = w(null), y = E(() => {
285
+ f(null), t != null && (t.close(), a(null));
286
+ }, [t, c]), P = E(
287
+ async (l, e) => {
288
+ if (!r) {
289
+ f(J());
274
290
  return;
275
291
  }
276
- if (e != null) {
277
- console.log("pipWindow is already open"), d(J());
292
+ if (t != null) {
293
+ console.log("pipWindow is already open"), f(J());
278
294
  return;
279
295
  }
280
296
  const n = await window.documentPictureInPicture.requestWindow({
281
- width: p,
282
- height: l
297
+ width: l,
298
+ height: e
283
299
  });
284
300
  n.addEventListener("pagehide", () => {
285
- r(null), d(null);
286
- }), r(n), d(J());
301
+ a(null), f(null);
302
+ }), a(n), f(J());
287
303
  },
288
- [e, c]
304
+ [t, c]
289
305
  );
290
- B(() => {
291
- [...document.styleSheets].forEach((p) => {
306
+ _(() => {
307
+ [...document.styleSheets].forEach((l) => {
292
308
  try {
293
- const l = [...p.cssRules].map((m) => m.cssText).join(""), n = document.createElement("style");
294
- n.textContent = l, e?.document.head.appendChild(n);
309
+ const e = [...l.cssRules].map((p) => p.cssText).join(""), n = document.createElement("style");
310
+ n.textContent = e, t?.document.head.appendChild(n);
295
311
  const u = document.createElement("style");
296
312
  u.textContent = `
297
313
  html, body, .pipRoot {
@@ -299,276 +315,289 @@ function vt({ children: f }) {
299
315
  margin: 0;
300
316
  padding: 0;
301
317
  overflow: hidden;
302
- }`, e?.document.head.appendChild(u);
318
+ }`, t?.document.head.appendChild(u);
303
319
  } catch {
304
320
  const n = document.createElement("link");
305
- if (p.href == null)
321
+ if (l.href == null)
306
322
  return;
307
- n.rel = "stylesheet", n.type = p.type, n.media = p.media.toString(), n.href = p.href, e?.document.head.appendChild(n);
323
+ n.rel = "stylesheet", n.type = l.type, n.media = l.media.toString(), n.href = l.href, t?.document.head.appendChild(n);
308
324
  }
309
325
  });
310
- }, [e]);
311
- const g = T(() => ({
312
- isSupported: s,
313
- pipWindow: e,
326
+ }, [t]);
327
+ const C = T(() => ({
328
+ isSupported: r,
329
+ pipWindow: t,
314
330
  pipId: c,
315
- requestPipWindow: y,
316
- closePipWindow: h
317
- }), [h, s, e, y]);
318
- return /* @__PURE__ */ j(Re.Provider, { value: g, children: f });
331
+ requestPipWindow: P,
332
+ closePipWindow: y
333
+ }), [y, r, t, P]);
334
+ return /* @__PURE__ */ F(ke.Provider, { value: C, children: d });
319
335
  }
320
- const bt = ({
321
- children: f,
336
+ const It = ({
337
+ children: d,
322
338
  projectName: i,
323
339
  // utils
324
- toast: s,
325
- ...e
340
+ toast: r,
341
+ ...t
326
342
  }) => {
327
- const { data: r } = Pe(
343
+ const { data: a } = Me(
328
344
  { projectName: i },
329
345
  { skip: !i }
330
- ), { user: c } = re();
331
- return /* @__PURE__ */ j(
332
- Ue.Provider,
346
+ ), { user: c } = ie();
347
+ return /* @__PURE__ */ F(
348
+ Le.Provider,
333
349
  {
334
350
  value: {
335
- ...e,
351
+ ...t,
336
352
  projectName: i,
337
- project: r,
353
+ project: a,
338
354
  user: c,
339
- toast: s
355
+ toast: r
340
356
  },
341
- children: f
357
+ children: d
342
358
  }
343
359
  );
344
- }, wt = ({ children: f, ...i }) => /* @__PURE__ */ j(Ae.Provider, { value: { ...i }, children: f }), Ct = ({
345
- children: f,
360
+ }, kt = ({ children: d, ...i }) => /* @__PURE__ */ F(xe.Provider, { value: { ...i }, children: d }), ce = "powerpack-license", tt = () => {
361
+ try {
362
+ const d = localStorage.getItem(ce);
363
+ return d === null ? null : d === "true";
364
+ } catch {
365
+ return null;
366
+ }
367
+ }, nt = (d) => {
368
+ try {
369
+ localStorage.setItem(ce, String(d));
370
+ } catch {
371
+ }
372
+ }, Lt = ({
373
+ children: d,
346
374
  debug: i
347
375
  }) => {
348
- const [s, e] = b(null), [r, c] = b(null), d = (o) => o !== null && typeof o == "object" && "addon" in o, h = E((o) => {
349
- o === null ? (e(null), c(null)) : d(o) ? (e(null), c(o)) : (c(null), e(o));
350
- }, []), y = (o) => o ? ze[o] : null, g = (o) => {
376
+ const [r, t] = w(null), [a, c] = w(null), f = (o) => o !== null && typeof o == "object" && "addon" in o, y = E((o) => {
377
+ o === null ? (t(null), c(null)) : f(o) ? (t(null), c(o)) : (c(null), t(o));
378
+ }, []), P = (o) => o ? He[o] : null, C = (o) => {
351
379
  if (!o) return null;
352
- const a = Je[o.addon];
353
- return a ? { ...a, selectedFeature: o.feature } : null;
354
- }, [p, l] = b(!1), [n, u] = b(!0), m = async () => !1, [S, { isLoaded: v, isLoading: x }] = ae({
380
+ const m = Ze[o.addon];
381
+ return m ? { ...m, selectedFeature: o.feature } : null;
382
+ }, [l, e] = w(!1), [n] = w(tt), [u, p] = w(!0), b = async () => !1, [h, { isLoaded: x, isLoading: D }] = le({
355
383
  addon: "powerpack",
356
384
  remote: "license",
357
385
  module: "checkPowerLicense",
358
- fallback: m
386
+ fallback: b
359
387
  });
360
- B(() => {
388
+ _(() => {
361
389
  (async () => {
362
390
  if (i?.powerLicense !== void 0)
363
- console.warn("Using debug power license:", i.powerLicense), l(i.powerLicense), u(!1);
364
- else if (v || !x) {
391
+ console.warn("Using debug power license:", i.powerLicense), e(i.powerLicense), p(!1);
392
+ else if (x || !D) {
365
393
  try {
366
- const a = await S();
367
- l(a);
368
- } catch (a) {
369
- console.error("Error checking power license:", a), l(!1);
394
+ const m = await h();
395
+ e(m), nt(m);
396
+ } catch (m) {
397
+ console.error("Error checking power license:", m), e(!1);
370
398
  } finally {
371
- u(!1);
399
+ p(!1);
372
400
  }
373
- u(!1);
401
+ p(!1);
374
402
  }
375
403
  })();
376
- }, [i, v, x, S]);
377
- const D = T(
404
+ }, [i, x, D, h]);
405
+ const g = T(
378
406
  () => ({
379
- powerLicense: p,
380
- isLoading: n,
381
- selectedPowerPack: s,
382
- selectedAddon: r,
383
- setPowerpackDialog: h,
384
- powerpackDialog: y(s),
385
- addonDialog: g(r)
407
+ powerLicense: l,
408
+ isLoading: u,
409
+ storedLicense: n,
410
+ selectedPowerPack: r,
411
+ selectedAddon: a,
412
+ setPowerpackDialog: y,
413
+ powerpackDialog: P(r),
414
+ addonDialog: C(a)
386
415
  }),
387
- [p, s, r, h, n]
416
+ [l, r, a, y, u, n]
388
417
  );
389
- return /* @__PURE__ */ j(Ne.Provider, { value: D, children: f });
390
- }, St = ({ children: f, skip: i = !1 }) => {
418
+ return /* @__PURE__ */ F(Ee.Provider, { value: g, children: d });
419
+ }, xt = ({ children: d, skip: i = !1 }) => {
391
420
  const {
392
- data: s = {},
393
- isLoading: e,
394
- error: r
395
- } = ve({ full: !0 }, { skip: i }), { data: c, isLoading: d, error: h } = be(), {
396
- data: y = [],
397
- isLoading: g,
398
- error: p
399
- } = we({}, { skip: i }), l = T(() => y.filter((S) => S.active), [y]), {
421
+ data: r = {},
422
+ isLoading: t,
423
+ error: a
424
+ } = Ue({ full: !0 }, { skip: i }), { data: c, isLoading: f, error: y } = Ne(), {
425
+ data: P = [],
426
+ isLoading: C,
427
+ error: l
428
+ } = _e({}, { skip: i }), e = T(() => P.filter((b) => b.active), [P]), {
400
429
  data: n,
401
430
  isLoading: u,
402
- error: m
403
- } = Ce(void 0, { skip: !c?.name });
404
- return /* @__PURE__ */ j(
405
- Be.Provider,
431
+ error: p
432
+ } = Ge(void 0, { skip: !c?.name });
433
+ return /* @__PURE__ */ F(
434
+ De.Provider,
406
435
  {
407
436
  value: {
408
- siteInfo: s,
409
- attributes: s?.attributes || [],
437
+ siteInfo: r,
438
+ attributes: r?.attributes || [],
410
439
  user: c,
411
440
  cloudInfo: n,
412
441
  projects: {
413
- all: y,
414
- active: l
442
+ all: P,
443
+ active: e
415
444
  },
416
445
  isLoading: {
417
- siteInfo: e,
418
- user: d,
446
+ siteInfo: t,
447
+ user: f,
419
448
  cloudInfo: u,
420
- projects: g
449
+ projects: C
421
450
  },
422
451
  error: {
423
- siteInfo: r,
424
- user: h,
425
- cloudInfo: m,
426
- projects: p
452
+ siteInfo: a,
453
+ user: y,
454
+ cloudInfo: p,
455
+ projects: l
427
456
  }
428
457
  },
429
- children: f
458
+ children: d
430
459
  }
431
460
  );
432
- }, It = ({
433
- projectName: f,
461
+ }, Et = ({
462
+ projectName: d,
434
463
  children: i
435
464
  }) => {
436
465
  const {
437
- data: { folders: s = [] } = {},
438
- isLoading: e,
439
- isFetching: r,
466
+ data: { folders: r = [] } = {},
467
+ isLoading: t,
468
+ isFetching: a,
440
469
  isSuccess: c,
441
- isUninitialized: d,
442
- error: h,
443
- refetch: y
444
- } = Se({ projectName: f, attrib: !0 }), g = Ke({ projectName: f }, r || e), p = T(() => {
445
- const o = /* @__PURE__ */ new Map();
446
- for (const a of s)
447
- o.set(a.id, a);
448
- return o;
449
- }, [s]), l = T(() => (o) => p.get(o), [p]), n = T(
450
- () => (o, a, w = {}) => {
451
- if (!a.length) return {};
452
- const P = {}, I = new Set(a), M = /* @__PURE__ */ new Set();
453
- let F = o;
454
- for (; I.size > 0 && F && !M.has(F); ) {
455
- M.add(F);
456
- const t = p.get(F);
457
- if (!t) break;
458
- const k = t.attrib || {};
470
+ isUninitialized: f,
471
+ error: y,
472
+ refetch: P
473
+ } = $e({ projectName: d, attrib: !0 }), C = Xe({ projectName: d }, a || t), l = T(() => {
474
+ const g = /* @__PURE__ */ new Map();
475
+ for (const o of r)
476
+ g.set(o.id, o);
477
+ return g;
478
+ }, [r]), e = T(() => (g) => l.get(g), [l]), n = T(
479
+ () => (g, o, m = {}) => {
480
+ if (!o.length) return {};
481
+ const v = {}, I = new Set(o), O = /* @__PURE__ */ new Set();
482
+ let j = g;
483
+ for (; I.size > 0 && j && !O.has(j); ) {
484
+ O.add(j);
485
+ const s = l.get(j);
486
+ if (!s) break;
487
+ const k = s.attrib || {};
459
488
  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
489
+ s.ownAttrib?.includes(L) && L in k && (v[L] = Object.entries(k).find(
490
+ ([R]) => R === L
462
491
  )?.[1], I.delete(L));
463
- F = t.parentId;
492
+ j = s.parentId;
464
493
  }
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
- P[t] = null;
469
- return P;
494
+ for (const s of Array.from(I))
495
+ s in m && (v[s] = m[s], I.delete(s));
496
+ for (const s of I)
497
+ v[s] = null;
498
+ return v;
470
499
  },
471
- [p]
500
+ [l]
472
501
  ), u = T(
473
- () => (o) => {
474
- const a = [], w = /* @__PURE__ */ new Set();
475
- let P = o;
476
- for (; P && !w.has(P); ) {
477
- w.add(P);
478
- const I = p.get(P);
502
+ () => (g) => {
503
+ const o = [], m = /* @__PURE__ */ new Set();
504
+ let v = g;
505
+ for (; v && !m.has(v); ) {
506
+ m.add(v);
507
+ const I = l.get(v);
479
508
  if (!I?.parentId) break;
480
- a.push(I.parentId), P = I.parentId;
509
+ o.push(I.parentId), v = I.parentId;
481
510
  }
482
- return a;
511
+ return o;
483
512
  },
484
- [p]
485
- ), m = T(
486
- () => (o) => {
487
- const a = new Set(o);
488
- return o.filter((w) => !u(w).some((P) => a.has(P)));
513
+ [l]
514
+ ), p = T(
515
+ () => (g) => {
516
+ const o = new Set(g);
517
+ return g.filter((m) => !u(m).some((v) => o.has(v)));
489
518
  },
490
519
  [u]
491
- ), S = T(() => {
492
- const o = /* @__PURE__ */ new Map();
493
- for (const a of s) {
494
- if (!a.parentId) continue;
495
- const w = o.get(a.parentId);
496
- w ? w.push(a.id) : o.set(a.parentId, [a.id]);
520
+ ), b = T(() => {
521
+ const g = /* @__PURE__ */ new Map();
522
+ for (const o of r) {
523
+ if (!o.parentId) continue;
524
+ const m = g.get(o.parentId);
525
+ m ? m.push(o.id) : g.set(o.parentId, [o.id]);
497
526
  }
498
- return o;
499
- }, [s]), v = T(
500
- () => (o, a = !1) => {
501
- const w = a ? [...o] : [], P = [...o];
502
- for (; P.length > 0; ) {
503
- const I = P.shift();
504
- for (const M of S.get(I) || [])
505
- w.push(M), P.push(M);
527
+ return g;
528
+ }, [r]), h = T(
529
+ () => (g, o = !1) => {
530
+ const m = o ? [...g] : [], v = [...g];
531
+ for (; v.length > 0; ) {
532
+ const I = v.shift();
533
+ for (const O of b.get(I) || [])
534
+ m.push(O), v.push(O);
506
535
  }
507
- return w;
536
+ return m;
508
537
  },
509
- [S]
510
- ), x = () => y().unwrap(), D = T(
538
+ [b]
539
+ ), x = () => P().unwrap(), D = T(
511
540
  () => ({
512
- folders: s,
513
- getFolderById: l,
541
+ folders: r,
542
+ getFolderById: e,
514
543
  findNonInheritedValues: n,
515
544
  getParentFolderIds: u,
516
- getFolderIdsWithoutChildren: m,
517
- getChildFolderIds: v,
518
- isLoading: g,
545
+ getFolderIdsWithoutChildren: p,
546
+ getChildFolderIds: h,
547
+ isLoading: C,
519
548
  // first time and when args change
520
- isFetching: r,
549
+ isFetching: a,
521
550
  // any background fetching
522
551
  isSuccess: c,
523
- isUninitialized: d,
524
- error: h,
552
+ isUninitialized: f,
553
+ error: y,
525
554
  refetch: x
526
555
  }),
527
556
  [
528
- s,
529
- l,
557
+ r,
558
+ e,
530
559
  n,
531
560
  u,
532
- m,
533
- v,
534
- g,
535
- r,
536
- c,
537
- d,
561
+ p,
538
562
  h,
563
+ C,
564
+ a,
565
+ c,
566
+ f,
567
+ y,
539
568
  x
540
569
  ]
541
570
  );
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
- B(() => {
546
- r.some((u) => i.startsWith(`/${u}`)) || e("");
547
- }, [i, e]);
548
- const { type: c, entity: d, settings: h } = qe(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
- e(x);
571
+ return /* @__PURE__ */ F(Fe.Provider, { value: D, children: i });
572
+ }, Dt = "uri", Ft = ({ children: d }) => {
573
+ const i = location.pathname, [r, t] = w(""), a = ["projects", "settings", "dashboard/tasks"];
574
+ _(() => {
575
+ a.some((u) => i.startsWith(`/${u}`)) || t("");
576
+ }, [i, t]);
577
+ const { type: c, entity: f, settings: y } = Ve(r), P = E(
578
+ ({ projectName: n, folderPath: u, taskName: p, productName: b, versionName: h }) => {
579
+ const x = ze({ projectName: n, folderPath: u, taskName: p, productName: b, versionName: h });
580
+ t(x);
552
581
  },
553
- [e]
554
- ), [g] = Ie(), p = E(async () => {
555
- if (c !== "entity" || !s) return [];
582
+ [t]
583
+ ), [C] = Be(), l = E(async () => {
584
+ if (c !== "entity" || !r) return [];
556
585
  try {
557
- const n = await g({ resolveRequestModel: { uris: [s] } }).unwrap();
586
+ const n = await C({ resolveRequestModel: { uris: [r] } }).unwrap();
558
587
  return console.log("Resolved entity from URI:", n), n;
559
588
  } catch (n) {
560
589
  return console.warn("Failed to resolve URI:", n), [];
561
590
  }
562
- }, [g, s, c]), l = {
563
- uri: s,
591
+ }, [C, r, c]), e = {
592
+ uri: r,
564
593
  uriType: c,
565
- entity: d,
566
- settings: h,
567
- setUri: e,
568
- setEntityUri: y,
569
- getUriEntities: p
594
+ entity: f,
595
+ settings: y,
596
+ setUri: t,
597
+ setEntityUri: P,
598
+ getUriEntities: l
570
599
  };
571
- return /* @__PURE__ */ j(_e.Provider, { value: l, children: f });
600
+ return /* @__PURE__ */ F(je.Provider, { value: e, children: d });
572
601
  }, se = [
573
602
  "representation",
574
603
  "version",
@@ -576,67 +605,67 @@ const bt = ({
576
605
  "product",
577
606
  "task",
578
607
  "folder"
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
- (l) => new Promise((n) => d({ payload: l, resolve: n })),
608
+ ], ot = "delete-folder-with-children", jt = ({ children: d }) => {
609
+ const [i] = We(), [r] = Qe(), [t, a] = w(null), [c, f] = w(null), y = E(
610
+ (e) => new Promise((n) => f({ payload: e, resolve: n })),
582
611
  []
583
- ), y = E(
584
- async (l, n) => {
585
- if (!l || l.length === 0) {
586
- G.error("No entities selected");
612
+ ), P = E(
613
+ async (e, n) => {
614
+ if (!e || e.length === 0) {
615
+ M.error("No entities selected");
587
616
  return;
588
617
  }
589
- const u = /* @__PURE__ */ new Set(), m = l.filter((t) => !t?.id || u.has(t.id) ? !1 : (u.add(t.id), !0));
590
- if (m.length === 0) {
591
- G.error("No entities found");
618
+ const u = /* @__PURE__ */ new Set(), p = e.filter((s) => !s?.id || u.has(s.id) ? !1 : (u.add(s.id), !0));
619
+ if (p.length === 0) {
620
+ M.error("No entities found");
592
621
  return;
593
622
  }
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
- if (t.length === 0) return;
623
+ const b = new Set(p.map((s) => s.id)), h = p.filter((s) => s.entityType === "folder" && s.parentId ? !b.has(s.parentId) : (s.entityType === "task" || s.entityType === "product") && s.folderId ? !b.has(s.folderId) : !0), x = async (s, k) => {
624
+ if (s.length === 0) return;
596
625
  const L = /* @__PURE__ */ new Map();
597
- for (const O of t) {
598
- const U = L.get(O.projectName) || [];
599
- U.push(O), L.set(O.projectName, U);
626
+ for (const R of s) {
627
+ const U = L.get(R.projectName) || [];
628
+ U.push(R), L.set(R.projectName, U);
600
629
  }
601
630
  await Promise.all(
602
- Array.from(L.entries()).map(([O, U]) => {
631
+ Array.from(L.entries()).map(([R, U]) => {
603
632
  const H = [...U].sort(
604
- (A, Y) => se.indexOf(A.entityType) - se.indexOf(Y.entityType)
605
- ).map((A) => ({
633
+ (N, Y) => se.indexOf(N.entityType) - se.indexOf(Y.entityType)
634
+ ).map((N) => ({
606
635
  type: "delete",
607
- entityType: A.entityType,
608
- entityId: A.id,
636
+ entityType: N.entityType,
637
+ entityId: N.id,
609
638
  force: k
610
639
  }));
611
640
  return i({
612
641
  operationsRequestModel: { operations: H },
613
- projectName: O
642
+ projectName: R
614
643
  }).unwrap();
615
644
  })
616
645
  );
617
646
  }, D = async () => {
618
647
  try {
619
- await x(v, !1), n?.onSuccess?.();
620
- } catch (t) {
621
- throw { message: he(t) || "Failed to delete entities", ...t };
648
+ await x(h, !1), n?.onSuccess?.();
649
+ } catch (s) {
650
+ throw { message: Re(s) || "Failed to delete entities", ...s };
622
651
  }
623
- }, o = () => x(
624
- v.filter((t) => t.entityType === "folder" || t.entityType === "task"),
652
+ }, g = () => x(
653
+ h.filter((s) => s.entityType === "folder" || s.entityType === "task"),
625
654
  !0
626
- ), a = v.filter((t) => t.entityType === "folder");
627
- let w = [];
628
- if (a.length > 0) {
629
- const t = /* @__PURE__ */ new Map();
630
- for (const k of a) {
631
- const L = t.get(k.projectName) || [];
632
- L.push(k), t.set(k.projectName, L);
655
+ ), o = h.filter((s) => s.entityType === "folder");
656
+ let m = [];
657
+ if (o.length > 0) {
658
+ const s = /* @__PURE__ */ new Map();
659
+ for (const k of o) {
660
+ const L = s.get(k.projectName) || [];
661
+ L.push(k), s.set(k.projectName, L);
633
662
  }
634
663
  try {
635
- w = (await Promise.all(
636
- Array.from(t.entries()).map(
637
- ([L, O]) => s({
664
+ m = (await Promise.all(
665
+ Array.from(s.entries()).map(
666
+ ([L, R]) => r({
638
667
  projectName: L,
639
- folderIds: O.map((U) => U.id)
668
+ folderIds: R.map((U) => U.id)
640
669
  }).unwrap()
641
670
  )
642
671
  )).flat();
@@ -644,159 +673,159 @@ const bt = ({
644
673
  console.warn("Failed to fetch folder delete info, falling back to local data", k);
645
674
  }
646
675
  }
647
- const P = Ve(a, w), I = v.filter((t) => t.entityType === "product").length;
648
- I > 0 && P.push(
676
+ const v = Ye(o, m), I = h.filter((s) => s.entityType === "product").length;
677
+ I > 0 && v.push(
649
678
  I > 1 ? "Deleting these products also deletes all their versions" : "Deleting this product also deletes all its versions"
650
679
  );
651
- const M = He(v), F = v.length === 1 ? v[0] : void 0;
652
- r({
680
+ const O = Ke(h), j = h.length === 1 ? h[0] : void 0;
681
+ a({
653
682
  payload: {
654
- entityLabel: M,
655
- childrenDetails: P,
656
- expectedCounts: Ye(v, w),
657
- expectedName: F && (F.label || F.name || F.id)
683
+ entityLabel: O,
684
+ childrenDetails: v,
685
+ expectedCounts: Je(h, m),
686
+ expectedName: j && (j.label || j.name || j.id)
658
687
  },
659
688
  accept: D,
660
- recover: async (t) => me(t).includes(Ze) ? await h({
661
- entityLabel: M,
662
- message: `Are you really sure you want to delete ${M} and all of its dependencies? This cannot be undone. (NOT RECOMMENDED)`,
689
+ recover: async (s) => Oe(s).includes(ot) ? await y({
690
+ entityLabel: O,
691
+ message: `Are you really sure you want to delete ${O} and all of its dependencies? This cannot be undone. (NOT RECOMMENDED)`,
663
692
  childrenDetails: [],
664
693
  expectedCounts: {},
665
694
  deleteLabel: "Force delete"
666
- }) ? (await o(), n?.onSuccess?.(), "recovered") : "cancelled" : "unhandled"
695
+ }) ? (await g(), n?.onSuccess?.(), "recovered") : "cancelled" : "unhandled"
667
696
  });
668
697
  },
669
- [i, s, h]
670
- ), g = E(async () => {
671
- if (!e) return;
672
- const { payload: l, accept: n, recover: u } = e;
673
- r(null);
674
- const m = l.entityLabel, S = G.loading(`Deleting ${m}...`, { autoClose: !1 }), v = () => G.update(S, {
675
- render: `${m} deleted`,
698
+ [i, r, y]
699
+ ), C = E(async () => {
700
+ if (!t) return;
701
+ const { payload: e, accept: n, recover: u } = t;
702
+ a(null);
703
+ const p = e.entityLabel, b = M.loading(`Deleting ${p}...`, { autoClose: !1 }), h = () => M.update(b, {
704
+ render: `${p} deleted`,
676
705
  type: "success",
677
706
  autoClose: 5e3,
678
707
  isLoading: !1
679
708
  });
680
709
  try {
681
- await n(), v();
710
+ await n(), h();
682
711
  } catch (x) {
683
712
  let D = x;
684
713
  try {
685
- const a = await u(x);
686
- if (a === "recovered") return v();
687
- if (a === "cancelled")
688
- return G.update(S, {
689
- render: `${m} was not deleted`,
714
+ const o = await u(x);
715
+ if (o === "recovered") return h();
716
+ if (o === "cancelled")
717
+ return M.update(b, {
718
+ render: `${p} was not deleted`,
690
719
  type: "info",
691
720
  autoClose: 5e3,
692
721
  isLoading: !1
693
722
  });
694
- } catch (a) {
695
- D = a;
723
+ } catch (o) {
724
+ D = o;
696
725
  }
697
- const o = typeof D == "string" ? D : D?.message || D?.error || `Error deleting ${m}`;
698
- G.update(S, {
699
- render: o,
726
+ const g = typeof D == "string" ? D : D?.message || D?.error || `Error deleting ${p}`;
727
+ M.update(b, {
728
+ render: g,
700
729
  type: "error",
701
730
  autoClose: 5e3,
702
731
  isLoading: !1
703
732
  });
704
733
  }
705
- }, [e]), p = T(() => ({ deleteEntities: y }), [y]);
706
- return /* @__PURE__ */ pe($e.Provider, { value: p, children: [
707
- f,
708
- e && /* @__PURE__ */ j(
734
+ }, [t]), l = T(() => ({ deleteEntities: P }), [P]);
735
+ return /* @__PURE__ */ ge(Te.Provider, { value: l, children: [
736
+ d,
737
+ t && /* @__PURE__ */ F(
709
738
  oe,
710
739
  {
711
- payload: e.payload,
712
- onConfirm: g,
713
- onCancel: () => r(null)
740
+ payload: t.payload,
741
+ onConfirm: C,
742
+ onCancel: () => a(null)
714
743
  }
715
744
  ),
716
- c && /* @__PURE__ */ j(
745
+ c && /* @__PURE__ */ F(
717
746
  oe,
718
747
  {
719
748
  payload: c.payload,
720
749
  onConfirm: () => {
721
- d(null), c.resolve(!0);
750
+ f(null), c.resolve(!0);
722
751
  },
723
752
  onCancel: () => {
724
- d(null), c.resolve(!1);
753
+ f(null), c.resolve(!1);
725
754
  }
726
755
  }
727
756
  )
728
757
  ] });
729
758
  };
730
759
  export {
731
- Ae as AddonContext,
732
- Ue 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
- Ut as ThumbnailUploadContext,
765
- pn as ThumbnailUploadProvider,
766
- _e as URIContext,
767
- Lt as URIProvider,
768
- kt as URL_PARAM_ID,
769
- Je as addonConfigs,
770
- At 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
- Wt as setDetailsPanelTabForScope,
780
- qt as toggleSyncAll,
781
- Qt as useAddonContext,
782
- zt as useAddonProjectContext,
783
- Vt as useAutoSyncSettings,
784
- Ht as useDeleteEntitiesContext,
785
- Yt as useDeleteEntitiesContextOptional,
786
- Kt as useDetailsPanelContext,
787
- re as useGlobalContext,
788
- Jt 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
760
+ xe as AddonContext,
761
+ Le as AddonProjectContext,
762
+ It as AddonProjectProvider,
763
+ kt as AddonProvider,
764
+ Te as DeleteEntitiesContext,
765
+ jt as DeleteEntitiesProvider,
766
+ we as DetailsPanelContext,
767
+ bt as DetailsPanelProvider,
768
+ Rt as EntityUpdatesContext,
769
+ Cn as EntityUpdatesProvider,
770
+ Sn as FORCE_AUTO_SYNC,
771
+ De as GlobalContext,
772
+ xt as GlobalProvider,
773
+ At as MenuContext,
774
+ bn as MenuProvider,
775
+ ke as PiPContext,
776
+ St as PiPProvider,
777
+ Mt as PiPWrapper,
778
+ Ee as PowerpackContext,
779
+ Lt as PowerpackProvider,
780
+ Ut as ProjectContext,
781
+ mn as ProjectContextProvider,
782
+ Fe as ProjectFoldersContext,
783
+ Et as ProjectFoldersContextProvider,
784
+ he as RemoteModulesContext,
785
+ vt as RemoteModulesProvider,
786
+ Ie as SettingsPanelContext,
787
+ Ct as SettingsPanelProvider,
788
+ Nt as SocketContext,
789
+ _t as SocketProvider,
790
+ Se as SubtasksModulesContext,
791
+ wt as SubtasksModulesProvider,
792
+ Ce as TABS_BY_SCOPE_KEY,
793
+ Gt as ThumbnailUploadContext,
794
+ hn as ThumbnailUploadProvider,
795
+ je as URIContext,
796
+ Ft as URIProvider,
797
+ Dt as URL_PARAM_ID,
798
+ Ze as addonConfigs,
799
+ $t as getActivityFrameLink,
800
+ Bt as getAutoSyncForTopic,
801
+ Wt as getUpdateType,
802
+ Qt as isDeletableEntityType,
803
+ ve as isDetailsPanelTab,
804
+ qt as matchesProject,
805
+ Vt as matchesTopic,
806
+ Pn as powerpackFeatureOrder,
807
+ He as powerpackFeatures,
808
+ zt as setDetailsPanelTabForScope,
809
+ Ht as toggleSyncAll,
810
+ Yt as useAddonContext,
811
+ Kt as useAddonProjectContext,
812
+ Jt as useAutoSyncSettings,
813
+ Xt as useDeleteEntitiesContext,
814
+ Zt as useDeleteEntitiesContextOptional,
815
+ en as useDetailsPanelContext,
816
+ ie as useGlobalContext,
817
+ tn as useMenuContext,
818
+ nn as useOptionalProjectContext,
819
+ on as usePiPWindow,
820
+ ae as usePowerpack,
821
+ sn as useProjectContext,
822
+ rn as useProjectFoldersContext,
823
+ an as useRemoteModules,
824
+ ln as useScopedDetailsPanel,
825
+ cn as useSettingsPanel,
826
+ dn as useSocketContext,
827
+ un as useSubtasksModulesContext,
828
+ pn as useSyncUpdates,
829
+ fn as useThumbnailUploadContext,
830
+ be as useURIContext
802
831
  };