@ynput/ayon-frontend-shared 0.6.8 → 0.7.0

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