@ynput/ayon-frontend-shared 0.7.3 → 0.7.5

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