@ynput/ayon-frontend-shared 0.7.6 → 0.8.1

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 (70) hide show
  1. package/dist/DetailsPanel.es.js +361 -355
  2. package/dist/Feed.es.js +1 -1
  3. package/dist/ListTable.es.js +18 -18
  4. package/dist/NewEntity.es.js +30 -30
  5. package/dist/ProjectTreeTable.es.js +984 -974
  6. package/dist/ProjectsTable.es.js +3 -3
  7. package/dist/Slicer.es.js +53 -50
  8. package/dist/Views.es.js +150 -151
  9. package/dist/api.es.js +166 -165
  10. package/dist/chunks/Actions.es.js +9 -10
  11. package/dist/chunks/ColumnDropIndicator.es.js +2 -2
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +3 -4
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +2 -2
  14. package/dist/chunks/DetailsDialog.es.js +3 -3
  15. package/dist/chunks/EmptyPlaceholder.es.js +7 -7
  16. package/dist/chunks/EntityPath.es.js +38 -39
  17. package/dist/chunks/EntityPickerDialog.es.js +65 -66
  18. package/dist/chunks/EntityTooltip.es.js +18 -19
  19. package/dist/chunks/Feed.es.js +1381 -1355
  20. package/dist/chunks/FilmstripEntityCard.es.js +5201 -0
  21. package/dist/chunks/FilterErrorActions.es.js +2 -3
  22. package/dist/chunks/GroupSettingsFallback.es.js +2 -2
  23. package/dist/chunks/Menu.es.js +52 -53
  24. package/dist/chunks/MetaWidget.es.js +1948 -1875
  25. package/dist/chunks/ProjectFoldersContext.es.js +40 -40
  26. package/dist/chunks/RepresentationsList.es.js +1 -1
  27. package/dist/chunks/ReviewablesSelector.es.js +759 -742
  28. package/dist/chunks/SimpleTable.es.js +2 -1
  29. package/dist/chunks/Slicer.es.js +49 -50
  30. package/dist/chunks/TableExportContextInstance.es.js +600 -402
  31. package/dist/chunks/TableSettingsFallback.es.js +3 -4
  32. package/dist/chunks/ThumbnailSimple.es.js +114 -99
  33. package/dist/chunks/VideoPlayer.es.js +8 -9
  34. package/dist/chunks/Watchers.es.js +928 -871
  35. package/dist/chunks/expandRelativeDates.es.js +1 -1
  36. package/dist/chunks/getThumbnailUrl.es.js +33 -21
  37. package/dist/chunks/getUris.es.js +1580 -1610
  38. package/dist/chunks/queryFilterToClientFilter.es.js +1 -1
  39. package/dist/chunks/realtimeUpdatesUtils.es.js +15 -15
  40. package/dist/chunks/searchTerms.es.js +774 -696
  41. package/dist/chunks/useAttributeEnums.es.js +22 -22
  42. package/dist/chunks/useDateRangeFilter.es.js +1 -1
  43. package/dist/chunks/useHierarchySelection.es.js +3 -4
  44. package/dist/chunks/useLoadModule.es.js +3 -4
  45. package/dist/components.es.js +1261 -1206
  46. package/dist/context.es.js +615 -540
  47. package/dist/hooks.es.js +193 -171
  48. package/dist/index.es.js +2 -2
  49. package/dist/types/Actions.d.ts +10 -8
  50. package/dist/types/DetailsPanel.d.ts +54 -76
  51. package/dist/types/EntityPickerDialog.d.ts +12 -6
  52. package/dist/types/Feed.d.ts +24 -24
  53. package/dist/types/ListTable.d.ts +33 -27
  54. package/dist/types/NewEntity.d.ts +26 -39
  55. package/dist/types/ProjectTreeTable.d.ts +275 -194
  56. package/dist/types/ProjectsTable.d.ts +6 -6
  57. package/dist/types/RepresentationsList.d.ts +4 -0
  58. package/dist/types/Slicer.d.ts +63 -246
  59. package/dist/types/Views.d.ts +71 -298
  60. package/dist/types/api.d.ts +3165 -2363
  61. package/dist/types/components.d.ts +444 -473
  62. package/dist/types/context.d.ts +285 -572
  63. package/dist/types/hooks.d.ts +76 -47
  64. package/dist/types/index.d.ts +6 -0
  65. package/dist/types/util.d.ts +141 -120
  66. package/dist/util.es.js +71 -68
  67. package/package.json +6 -6
  68. package/dist/chunks/EntityUpdatesContext.es.js +0 -61
  69. package/dist/chunks/PlayableIcon.es.js +0 -5020
  70. package/dist/chunks/viewUpdateHelper.es.js +0 -153
@@ -1,79 +1,80 @@
1
- import { jsxs as g, jsx as d } from "react/jsx-runtime";
2
- import z, { createContext as h, useContext as u, useState as b, useEffect as v, useRef as S, useCallback as N, useMemo as pe, forwardRef as B } from "react";
3
- import { Button as j, Icon as F, theme as X, Dialog as he, InputText as Z } from "@ynput/ayon-react-components";
4
- import p from "styled-components";
5
- import $ from "clsx";
6
- import { a as fe, K as H } from "./platform.es.js";
7
- import { debounce as K, isEqual as me } from "lodash";
8
- import { confirmDialog as ge } from "primereact/confirmdialog";
9
- import { toast as G } from "react-toastify";
10
- import "uuid";
11
- import { bp as D, a as ve } from "./searchTerms.es.js";
1
+ import { jsxs as C, jsx as p } from "react/jsx-runtime";
2
+ import ne, { createContext as y, useContext as f, useState as I, useEffect as E, useRef as P, useCallback as V, useMemo as G, forwardRef as Z } from "react";
3
+ import { debounce as re, isEqual as Ee } from "lodash";
4
+ import { confirmDialog as Ie } from "primereact/confirmdialog";
5
+ import { toast as B } from "react-toastify";
6
+ import { v4 as Pe } from "uuid";
7
+ import { bv as D, a as Ve } from "./searchTerms.es.js";
8
+ import { f as ke } from "./realtimeUpdatesUtils.es.js";
12
9
  import "axios";
13
- import { cU as we } from "./getUris.es.js";
10
+ import { cV as Ae, aU as Te, dD as De, dG as se } from "./getUris.es.js";
11
+ import { useStore as Re } from "react-redux";
12
+ import { Button as q, Icon as K, theme as le, Dialog as $e, InputText as ue } from "@ynput/ayon-react-components";
13
+ import v from "styled-components";
14
+ import O from "clsx";
15
+ import { a as Ne, K as ae } from "./platform.es.js";
14
16
  import "@module-federation/enhanced/runtime";
15
17
  import "@ynput/ayon-addon/host";
16
18
  import "./ContextMenuContextInstance.es.js";
17
- import { createPortal as xe } from "react-dom";
18
- import { Dialog as ye } from "primereact/dialog";
19
- import be, { ReadyState as Se } from "react-use-websocket";
20
- import "react-redux";
19
+ import { createPortal as _e } from "react-dom";
20
+ import { Dialog as je } from "primereact/dialog";
21
+ import Le, { ReadyState as Oe } from "react-use-websocket";
21
22
  import "react-router-dom";
22
23
  import "semver";
23
- const Ce = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
24
+ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ */ C("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
24
25
  e,
25
- /* @__PURE__ */ d(j, { onClick: () => window.location.reload(), variant: "filled", children: "Refresh" })
26
- ] }), Pe = h(void 0), qt = () => u(Pe) || {}, Ee = h({
26
+ /* @__PURE__ */ p(q, { onClick: () => window.location.reload(), variant: "filled", children: "Refresh" })
27
+ ] }), Ue = y(void 0), co = () => f(Ue) || {}, We = y({
27
28
  isLoading: !0,
28
29
  modules: [],
29
30
  remotesInitialized: !1,
30
31
  addonDev: { status: "off" }
31
- }), zt = () => {
32
- const e = u(Ee);
32
+ }), lo = () => {
33
+ const e = f(We);
33
34
  if (e === void 0)
34
35
  throw new Error("useRemoteModules must be used within a RemoteModulesProvider");
35
36
  return e;
36
- }, L = "addonDev", O = "ayon-addon-dev", Ie = ["localhost", "127.0.0.1", "[::1]"], U = `use ?${L}=<addon>@http://localhost:<port>`, Q = (e) => {
37
+ }, J = "addonDev", M = "ayon-addon-dev", Fe = ["localhost", "127.0.0.1", "[::1]"], H = `use ?${J}=<addon>@http://localhost:<port>`, pe = (e) => {
37
38
  try {
38
39
  const { protocol: t, hostname: o } = new URL(e);
39
- return ["http:", "https:"].includes(t) && Ie.includes(o);
40
+ return ["http:", "https:"].includes(t) && Fe.includes(o);
40
41
  } catch {
41
42
  return !1;
42
43
  }
43
- }, Ae = (e) => {
44
+ }, Be = (e) => {
44
45
  const t = e.indexOf("@");
45
- if (t <= 0) return { request: e, reason: U };
46
+ if (t <= 0) return { request: e, reason: H };
46
47
  const o = e.slice(0, t), r = e.slice(t + 1).replace(/\/+$/, "");
47
48
  let n;
48
49
  try {
49
50
  n = new URL(r);
50
51
  } catch {
51
- return { request: e, reason: `"${r}" is not a URL: ${U}` };
52
+ return { request: e, reason: `"${r}" is not a URL: ${H}` };
52
53
  }
53
- return ["http:", "https:"].includes(n.protocol) ? Q(r) ? { override: { addon: o, url: r } } : {
54
+ return ["http:", "https:"].includes(n.protocol) ? pe(r) ? { override: { addon: o, url: r } } : {
54
55
  request: e,
55
56
  reason: `${n.hostname} is not this machine: only dev servers on localhost, 127.0.0.1 or [::1] can be loaded`
56
- } : { request: e, reason: `the dev server URL must be http(s): ${U}` };
57
- }, Ht = () => {
58
- const e = new URLSearchParams(window.location.search).get(L);
57
+ } : { request: e, reason: `the dev server URL must be http(s): ${H}` };
58
+ }, uo = () => {
59
+ const e = new URLSearchParams(window.location.search).get(J);
59
60
  if (e === "off" || e === "")
60
- return localStorage.removeItem(O), null;
61
+ return localStorage.removeItem(M), null;
61
62
  if (e) {
62
- const t = Ae(e);
63
- return "override" in t ? localStorage.setItem(O, JSON.stringify(t.override)) : console.warn(`[addon dev] ignored ?${L}=${e}: ${t.reason}`), t;
63
+ const t = Be(e);
64
+ return "override" in t ? localStorage.setItem(M, JSON.stringify(t.override)) : console.warn(`[addon dev] ignored ?${J}=${e}: ${t.reason}`), t;
64
65
  }
65
66
  try {
66
- const t = JSON.parse(localStorage.getItem(O) || "null");
67
- return t && Q(t.url) ? { override: t } : null;
67
+ const t = JSON.parse(localStorage.getItem(M) || "null");
68
+ return t && pe(t.url) ? { override: t } : null;
68
69
  } catch {
69
70
  return null;
70
71
  }
71
- }, De = () => localStorage.removeItem(O), Te = (e, { addon: t, url: o }) => {
72
+ }, Je = () => localStorage.removeItem(M), qe = (e, { addon: t, url: o }) => {
72
73
  const r = e ?? {}, n = ["name", "version", "remote", "buildId"].filter(
73
- (s) => typeof r[s] != "string" || !r[s]
74
+ (a) => typeof r[a] != "string" || !r[a]
74
75
  );
75
- return (!Array.isArray(r.modules) || r.modules.some((s) => typeof s != "string" || !s)) && n.push("modules"), typeof e != "object" || !e || n.length ? `${o}/ayon-addon.json is invalid (no ${n.join(", ")}): is it served by \`ayon-addon dev --ayon\`?` : r.name !== t ? `the dev server at ${o} serves "${r.name}", not "${t}": open ?${L}=${r.name}@${o}` : null;
76
- }, Re = async (e) => {
76
+ return (!Array.isArray(r.modules) || r.modules.some((a) => typeof a != "string" || !a)) && n.push("modules"), typeof e != "object" || !e || n.length ? `${o}/ayon-addon.json is invalid (no ${n.join(", ")}): is it served by \`ayon-addon dev --ayon\`?` : r.name !== t ? `the dev server at ${o} serves "${r.name}", not "${t}": open ?${J}=${r.name}@${o}` : null;
77
+ }, He = async (e) => {
77
78
  const { url: t } = e;
78
79
  let o;
79
80
  try {
@@ -92,10 +93,10 @@ const Ce = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
92
93
  } catch {
93
94
  throw new Error(`${t}/ayon-addon.json is not JSON: is it served by \`ayon-addon dev --ayon\`?`);
94
95
  }
95
- const n = Te(r, e);
96
+ const n = qe(r, e);
96
97
  if (n) throw new Error(n);
97
98
  return r;
98
- }, Kt = (e) => e?.attrib?.developerMode || e?.data?.isService ? null : e?.data?.isDeveloper ? "only users in developer mode can load addons from a dev server: turn on Developer Mode in the header, then reload" : "only users in developer mode can load addons from a dev server, and this user is not a developer: an admin can turn on Developer in Studio settings > Users", Y = p.div`
99
+ }, po = (e) => e?.attrib?.developerMode || e?.data?.isService ? null : e?.data?.isDeveloper ? "only users in developer mode can load addons from a dev server: turn on Developer Mode in the header, then reload" : "only users in developer mode can load addons from a dev server, and this user is not a developer: an admin can turn on Developer in Studio settings > Users", ie = v.div`
99
100
  position: fixed;
100
101
  left: 8px;
101
102
  bottom: 8px;
@@ -115,84 +116,84 @@ const Ce = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
115
116
  color: var(--md-sys-color-on-error-container);
116
117
  background: var(--md-sys-color-error-container);
117
118
  }
118
- `, $e = 2e3, Gt = ({ state: e }) => {
119
- const [t, o] = b(!1), r = e.status === "active" ? e.info.buildId : void 0;
120
- v(() => {
119
+ `, ze = 2e3, go = ({ state: e }) => {
120
+ const [t, o] = I(!1), r = e.status === "active" ? e.info.buildId : void 0;
121
+ E(() => {
121
122
  if (e.status !== "active" && e.status !== "error") return;
122
- const l = setInterval(() => {
123
- Re(e.override).then(
124
- (f) => {
125
- f.buildId !== r && (o(!0), window.location.reload());
123
+ const d = setInterval(() => {
124
+ He(e.override).then(
125
+ (g) => {
126
+ g.buildId !== r && (o(!0), window.location.reload());
126
127
  },
127
128
  () => {
128
129
  }
129
130
  // the dev server restarting or still failing; keep polling
130
131
  );
131
- }, $e);
132
- return () => clearInterval(l);
132
+ }, ze);
133
+ return () => clearInterval(d);
133
134
  }, [e, r]);
134
- const s = /* @__PURE__ */ d(j, { variant: "text", icon: "close", onClick: () => {
135
- De();
136
- const l = new URL(window.location.href);
137
- l.searchParams.delete("addonDev"), window.location.href = l.toString();
135
+ const a = /* @__PURE__ */ p(q, { variant: "text", icon: "close", onClick: () => {
136
+ Je();
137
+ const d = new URL(window.location.href);
138
+ d.searchParams.delete("addonDev"), window.location.href = d.toString();
138
139
  }, "data-tooltip": "Stop: load the installed addon" });
139
140
  if (e.status === "rejected")
140
- return /* @__PURE__ */ g(Y, { className: "error", "data-addon-dev-rejected": e.request, children: [
141
- /* @__PURE__ */ d(F, { icon: "error" }),
142
- /* @__PURE__ */ g("span", { children: [
141
+ return /* @__PURE__ */ C(ie, { className: "error", "data-addon-dev-rejected": e.request, children: [
142
+ /* @__PURE__ */ p(K, { icon: "error" }),
143
+ /* @__PURE__ */ C("span", { children: [
143
144
  "Addon dev: ignored ?addonDev=",
144
145
  e.request,
145
146
  ": ",
146
147
  e.reason
147
148
  ] }),
148
- s
149
+ a
149
150
  ] });
150
- const { addon: a, url: i } = e.override, c = "error" in e ? e.error : void 0;
151
- return /* @__PURE__ */ g(Y, { className: c ? "error" : void 0, "data-addon-dev": a, children: [
152
- /* @__PURE__ */ d(F, { icon: c ? "error" : "code" }),
153
- e.status === "error" ? /* @__PURE__ */ g("span", { children: [
151
+ const { addon: i, url: s } = e.override, c = "error" in e ? e.error : void 0;
152
+ return /* @__PURE__ */ C(ie, { className: c ? "error" : void 0, "data-addon-dev": i, children: [
153
+ /* @__PURE__ */ p(K, { icon: c ? "error" : "code" }),
154
+ e.status === "error" ? /* @__PURE__ */ C("span", { children: [
154
155
  "Addon dev: ",
155
- a,
156
- " could not load from ",
157
156
  i,
157
+ " could not load from ",
158
+ s,
158
159
  ": ",
159
160
  c
160
- ] }) : /* @__PURE__ */ g("span", { children: [
161
+ ] }) : /* @__PURE__ */ C("span", { children: [
161
162
  "Addon dev: ",
162
- /* @__PURE__ */ d("strong", { children: a }),
163
+ /* @__PURE__ */ p("strong", { children: i }),
163
164
  " from ",
164
- i,
165
+ s,
165
166
  e.status === "active" && ` (${e.info.version}, build ${e.info.buildId})`,
166
167
  c && `: ${c}`,
167
168
  t && ", reloading..."
168
169
  ] }),
169
- s
170
+ a
170
171
  ] });
171
- }, Oe = h(void 0), Yt = () => {
172
- const e = u(Oe);
172
+ }, Ge = y(void 0), wo = () => {
173
+ const e = f(Ge);
173
174
  if (e === void 0)
174
175
  throw new Error("usePowerpack must be used within a PowerpackProvider");
175
176
  return e;
176
- }, _e = h(void 0), Xt = () => {
177
- const e = u(_e);
177
+ }, Ke = y(void 0), fo = () => {
178
+ const e = f(Ke);
178
179
  if (e === void 0)
179
180
  throw new Error("useURIContext must be used within a URIProvider");
180
181
  return e;
181
- }, _ = (e, t = null) => {
182
+ }, U = (e, t = null) => {
182
183
  if (!e) return t;
183
184
  try {
184
185
  return JSON.parse(e);
185
186
  } catch {
186
187
  return t;
187
188
  }
188
- }, Zt = (e, t) => {
189
+ }, ho = (e, t) => {
189
190
  if (typeof window > "u") return t;
190
191
  try {
191
- return _(sessionStorage.getItem(e), t);
192
+ return U(sessionStorage.getItem(e), t);
192
193
  } catch {
193
194
  return t;
194
195
  }
195
- }, Qt = (e, t) => {
196
+ }, vo = (e, t) => {
196
197
  if (!(typeof window > "u"))
197
198
  try {
198
199
  sessionStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } }));
@@ -200,54 +201,54 @@ const Ce = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
200
201
  console.error(o);
201
202
  }
202
203
  };
203
- function ke(e, t) {
204
- const o = S(t);
204
+ function Ye(e, t) {
205
+ const o = P(t);
205
206
  o.current = t;
206
- const [r, n] = b(() => typeof window > "u" ? t : _(sessionStorage.getItem(e), t));
207
- v(() => {
208
- const a = sessionStorage.getItem(e);
209
- n(_(a, o.current)), a || sessionStorage.setItem(e, JSON.stringify(o.current));
210
- function i(c) {
207
+ const [r, n] = I(() => typeof window > "u" ? t : U(sessionStorage.getItem(e), t));
208
+ E(() => {
209
+ const i = sessionStorage.getItem(e);
210
+ n(U(i, o.current)), i || sessionStorage.setItem(e, JSON.stringify(o.current));
211
+ function s(c) {
211
212
  if ("key" in c && c.key && c.key !== e) return;
212
- const l = c.detail?.key;
213
- if (l && l !== e) return;
214
- const f = sessionStorage.getItem(e);
215
- n(_(f, o.current));
213
+ const d = c.detail?.key;
214
+ if (d && d !== e) return;
215
+ const g = sessionStorage.getItem(e);
216
+ n(U(g, o.current));
216
217
  }
217
- return window.addEventListener("session-storage", i), window.addEventListener("storage", i), () => {
218
- window.removeEventListener("session-storage", i), window.removeEventListener("storage", i);
218
+ return window.addEventListener("session-storage", s), window.addEventListener("storage", s), () => {
219
+ window.removeEventListener("session-storage", s), window.removeEventListener("storage", s);
219
220
  };
220
221
  }, [e]);
221
- const s = N(
222
- (a) => {
222
+ const a = V(
223
+ (i) => {
223
224
  try {
224
- n((i) => {
225
- const c = typeof a == "function" ? a(i) : a;
225
+ n((s) => {
226
+ const c = typeof i == "function" ? i(s) : i;
226
227
  return sessionStorage.setItem(e, JSON.stringify(c)), typeof window < "u" && window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } })), c;
227
228
  });
228
- } catch (i) {
229
- console.error(i);
229
+ } catch (s) {
230
+ console.error(s);
230
231
  }
231
232
  },
232
233
  [e]
233
234
  );
234
- return [r, s];
235
+ return [r, a];
235
236
  }
236
- const k = (e, t = null) => {
237
+ const W = (e, t = null) => {
237
238
  if (!e) return t;
238
239
  try {
239
240
  return JSON.parse(e);
240
241
  } catch {
241
242
  return t;
242
243
  }
243
- }, Le = (e, t) => {
244
+ }, Xe = (e, t) => {
244
245
  if (typeof window > "u") return t;
245
246
  try {
246
- return k(localStorage.getItem(e), t);
247
+ return W(localStorage.getItem(e), t);
247
248
  } catch {
248
249
  return t;
249
250
  }
250
- }, Ne = (e, t) => {
251
+ }, Ze = (e, t) => {
251
252
  if (!(typeof window > "u"))
252
253
  try {
253
254
  localStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new Event("storage"));
@@ -255,97 +256,97 @@ const k = (e, t = null) => {
255
256
  console.error(o);
256
257
  }
257
258
  };
258
- function eo(e, t) {
259
- const o = S(t);
259
+ function mo(e, t) {
260
+ const o = P(t);
260
261
  o.current = t;
261
- const [r, n] = b(() => {
262
- const a = localStorage.getItem(e);
263
- return k(a, t);
262
+ const [r, n] = I(() => {
263
+ const i = localStorage.getItem(e);
264
+ return W(i, t);
264
265
  });
265
- v(() => {
266
- const a = localStorage.getItem(e);
267
- n(k(a, o.current)), a || localStorage.setItem(e, JSON.stringify(o.current));
268
- function i(c) {
266
+ E(() => {
267
+ const i = localStorage.getItem(e);
268
+ n(W(i, o.current)), i || localStorage.setItem(e, JSON.stringify(o.current));
269
+ function s(c) {
269
270
  if (c.key && c.key !== e) return;
270
- const l = localStorage.getItem(e);
271
- n(k(l, o.current));
271
+ const d = localStorage.getItem(e);
272
+ n(W(d, o.current));
272
273
  }
273
- return window.addEventListener("storage", i), () => {
274
- window.removeEventListener("storage", i);
274
+ return window.addEventListener("storage", s), () => {
275
+ window.removeEventListener("storage", s);
275
276
  };
276
277
  }, [e]);
277
- const s = N(
278
- (a) => {
278
+ const a = V(
279
+ (i) => {
279
280
  try {
280
- n((i) => {
281
- const c = typeof a == "function" ? a(i) : a;
281
+ n((s) => {
282
+ const c = typeof i == "function" ? i(s) : i;
282
283
  return localStorage.setItem(e, JSON.stringify(c)), typeof window < "u" && setTimeout(() => {
283
284
  window.dispatchEvent(new Event("storage"));
284
285
  }, 0), c;
285
286
  });
286
- } catch (i) {
287
- console.error(i);
287
+ } catch (s) {
288
+ console.error(s);
288
289
  }
289
290
  },
290
291
  [e]
291
292
  );
292
- return [r, s];
293
+ return [r, a];
293
294
  }
294
- const je = h(void 0), Ue = ["feed", "subtasks", "details", "files"], Me = /^[^.\s]+\.[A-Za-z][A-Za-z0-9_]*$/, Fe = (e) => typeof e == "string" && Me.test(e), Ve = (e) => typeof e == "string" && (Ue.includes(e) || Fe(e)), to = (e) => {
295
+ const Qe = y(void 0), et = ["feed", "subtasks", "details", "files"], tt = /^[^.\s]+\.[A-Za-z][A-Za-z0-9_]*$/, ot = (e) => typeof e == "string" && tt.test(e), nt = (e) => typeof e == "string" && (et.includes(e) || ot(e)), yo = (e) => {
295
296
  const { startFrame: t, endFrame: o } = e.activityData || {}, r = e.origin?.id ?? e.entityId;
296
297
  if (!Number.isSafeInteger(t) || !r) return null;
297
- const n = t, s = Number.isSafeInteger(o) ? Math.max(n, o) : n;
298
- return { entityId: r, startFrame: n, endFrame: s };
299
- }, Be = () => {
300
- const e = u(je);
298
+ const n = t, a = Number.isSafeInteger(o) ? Math.max(n, o) : n;
299
+ return { entityId: r, startFrame: n, endFrame: a };
300
+ }, rt = () => {
301
+ const e = f(Qe);
301
302
  if (e === void 0)
302
303
  throw new Error("useDetailsPanel must be used within a DetailsPanelProvider");
303
304
  return e;
304
- }, V = "details/tabs-by-scope", oo = (e, t) => {
305
- const o = Le(V, {});
306
- Ne(V, { ...o, [e]: t });
307
- }, no = (e) => {
308
- const { getOpenForScope: t, setPanelOpen: o, getTabForScope: r } = Be(), [n, s] = ke(V, {}), a = n[e], i = Ve(a) ? a : r(e), c = N(
309
- (f) => {
310
- s((C) => ({ ...C, [e]: f }));
305
+ }, Y = "details/tabs-by-scope", xo = (e, t) => {
306
+ const o = Xe(Y, {});
307
+ Ze(Y, { ...o, [e]: t });
308
+ }, So = (e) => {
309
+ const { getOpenForScope: t, setPanelOpen: o, getTabForScope: r } = rt(), [n, a] = Ye(Y, {}), i = n[e], s = nt(i) ? i : r(e), c = V(
310
+ (g) => {
311
+ a((w) => ({ ...w, [e]: g }));
311
312
  },
312
- [e, s]
313
- ), l = i === "feed";
313
+ [e, a]
314
+ ), d = s === "feed";
314
315
  return {
315
316
  isOpen: t(e),
316
- setOpen: (f) => o(e, f),
317
- currentTab: i,
317
+ setOpen: (g) => o(e, g),
318
+ currentTab: s,
318
319
  setTab: c,
319
- isFeed: l
320
+ isFeed: d
320
321
  };
321
- }, Je = h(
322
+ }, st = y(
322
323
  void 0
323
- ), ro = () => {
324
- const e = u(Je);
324
+ ), bo = () => {
325
+ const e = f(st);
325
326
  if (!e)
326
327
  throw new Error("useSubtasksModulesContext must be used within a SubtasksModulesProvider");
327
328
  return e;
328
- }, We = h({}), so = () => {
329
- const e = u(We);
329
+ }, at = y({}), Co = () => {
330
+ const e = f(at);
330
331
  if (!e)
331
332
  throw new Error("useThumbnailUploadContext must be used within a ThumbnailUploadProvider");
332
333
  return e;
333
- }, qe = h(void 0), ao = () => {
334
- const e = u(qe);
334
+ }, it = y(void 0), Eo = () => {
335
+ const e = f(it);
335
336
  if (e === void 0)
336
337
  throw new Error("useSettingsPanel must be used within a SettingsPanelProvider");
337
338
  return e;
338
- }, ze = h(void 0);
339
- function He() {
340
- const e = u(ze);
339
+ }, ct = y(void 0);
340
+ function dt() {
341
+ const e = f(ct);
341
342
  if (e === void 0)
342
343
  throw new Error("usePiPWindow must be used within a PiPContext");
343
344
  return e;
344
345
  }
345
- function Ke({ pipWindow: e, children: t }) {
346
- return xe(t, e.document.body);
346
+ function lt({ pipWindow: e, children: t }) {
347
+ return _e(t, e.document.body);
347
348
  }
348
- const Ge = p(ye)`
349
+ const ut = v(je)`
349
350
  width: 25vw;
350
351
  height: 70vh;
351
352
  border: solid 1px var(--md-sys-color-outline-variant);
@@ -358,7 +359,7 @@ const Ge = p(ye)`
358
359
  opacity: 1;
359
360
  }
360
361
  }
361
- `, Ye = p(j)`
362
+ `, pt = v(q)`
362
363
  width: 26px;
363
364
  height: 26px;
364
365
  margin-left: auto;
@@ -374,12 +375,12 @@ const Ge = p(ye)`
374
375
  &:hover {
375
376
  background-color: #3d3e40;
376
377
  }
377
- `, io = ({ children: e }) => {
378
- const { pipWindow: t, pipId: o, isSupported: r, closePipWindow: n } = He(), s = o && z.isValidElement(e) ? z.cloneElement(e, { id: o }) : e;
379
- return !r && o ? /* @__PURE__ */ d(
380
- Ge,
378
+ `, Io = ({ children: e }) => {
379
+ const { pipWindow: t, pipId: o, isSupported: r, closePipWindow: n } = dt(), a = o && ne.isValidElement(e) ? ne.cloneElement(e, { id: o }) : e;
380
+ return !r && o ? /* @__PURE__ */ p(
381
+ ut,
381
382
  {
382
- header: /* @__PURE__ */ d(Ye, { icon: "close", className: "close", onClick: n }),
383
+ header: /* @__PURE__ */ p(pt, { icon: "close", className: "close", onClick: n }),
383
384
  headerStyle: {
384
385
  padding: 4,
385
386
  backgroundColor: "#202124",
@@ -400,134 +401,135 @@ const Ge = p(ye)`
400
401
  },
401
402
  onHide: n,
402
403
  position: "right",
403
- children: s
404
+ children: a
404
405
  }
405
- ) : t && /* @__PURE__ */ d(Ke, { pipWindow: t, children: /* @__PURE__ */ d("div", { className: "pipRoot", children: s }) });
406
- }, Xe = h(void 0), co = () => {
407
- const e = u(Xe);
406
+ ) : t && /* @__PURE__ */ p(lt, { pipWindow: t, children: /* @__PURE__ */ p("div", { className: "pipRoot", children: a }) });
407
+ }, gt = y(void 0), Po = () => {
408
+ const e = f(gt);
408
409
  if (!e)
409
410
  throw new Error("useAddonProjectContext must be used within a AddonProjectContext");
410
411
  return e;
411
- }, Ze = h(void 0), lo = () => {
412
- const e = u(Ze);
412
+ }, wt = y(void 0), Vo = () => {
413
+ const e = f(wt);
413
414
  if (!e)
414
415
  throw new Error("useAddonContext must be used within a AddonContext");
415
416
  return e;
416
- }, Qe = h(void 0), uo = () => {
417
- const e = u(Qe);
417
+ }, ft = y(void 0), ko = () => {
418
+ const e = f(ft);
418
419
  if (e === void 0)
419
420
  throw new Error("useMenuContext must be used within a MenuProvider");
420
421
  return e;
421
- }, ee = h(void 0), po = () => {
422
- const e = u(ee);
422
+ }, ge = y(void 0), Ao = () => {
423
+ const e = f(ge);
423
424
  if (e === void 0)
424
425
  throw new Error("useSocketContext must be used within a SocketProvider");
425
426
  return e;
426
- }, et = window.location.protocol.replace("http", "ws"), tt = `${et}//${window.location.host}/ws`, ho = ({
427
+ }, ht = window.location.protocol.replace("http", "ws"), vt = `${ht}//${window.location.host}/ws`, To = ({
427
428
  children: e,
428
429
  userName: t,
429
430
  projectName: o,
430
431
  dispatch: r
431
432
  }) => {
432
- const [n, s] = b(!1), [a, i] = b([]), [c] = we(), l = S(!1);
433
- v(() => {
434
- l.current = n;
433
+ const [n, a] = I(!1), [i, s] = I([]), [c] = Ae(), d = P(!1);
434
+ E(() => {
435
+ d.current = n;
435
436
  }, [n]);
436
- const f = {
437
+ const g = {
437
438
  shouldReconnect: () => !t || !localStorage.getItem("accessToken") ? !1 : (c({ full: !1 }).unwrap(), !0)
438
- }, { sendMessage: C, readyState: P, getWebSocket: E } = be(
439
- tt,
440
- f,
439
+ }, { sendMessage: w, readyState: m, getWebSocket: u } = Le(
440
+ vt,
441
+ g,
441
442
  !!t
442
- ), w = () => {
443
- C(
443
+ ), l = () => {
444
+ w(
444
445
  JSON.stringify({
445
446
  topic: "auth",
446
447
  token: localStorage.getItem("accessToken"),
447
- subscribe: a,
448
+ subscribe: i,
448
449
  project: o
449
450
  })
450
451
  );
451
452
  };
452
- v(() => {
453
- console.debug("Topics changed", a), w();
454
- }, [a, o]);
455
- const T = S(a);
456
- T.current = a;
457
- const m = pe(
458
- () => K((x) => {
459
- me(T.current, x) || (console.log("WS: Subscriptions changed"), i(x));
453
+ E(() => {
454
+ console.debug("Topics changed", i), l();
455
+ }, [i, o]);
456
+ const x = P(i);
457
+ x.current = i;
458
+ const h = G(
459
+ () => re((b) => {
460
+ Ee(x.current, b) || (console.log("WS: Subscriptions changed"), s(b));
460
461
  }, 200),
461
462
  []
462
463
  );
463
- v(() => (D.setOnSubscriptionsChange((x) => m(x)), m(D.getSubscriptions("")), () => {
464
- D.setOnSubscriptionsChange(null), m.cancel();
465
- }), [m]);
466
- const [R, se] = b(!1), [J, ae] = b(!1);
467
- v(() => {
468
- R && !J && (G.warning(/* @__PURE__ */ d(Ce, {}), {
464
+ E(() => (D.setOnSubscriptionsChange((b) => h(b)), h(D.getSubscriptions("")), () => {
465
+ D.setOnSubscriptionsChange(null), h.cancel();
466
+ }), [h]);
467
+ const [S, $] = I(!1), [R, j] = I(!1);
468
+ E(() => {
469
+ S && !R && (B.warning(/* @__PURE__ */ p(Me, {}), {
469
470
  autoClose: !1,
470
471
  closeButton: !1
471
- }), ae(!0));
472
- }, [R, J]);
473
- const I = S({ callCount: 0, lastCall: Date.now() }), ie = K(() => {
474
- console.log("Resetting API state due to server restart"), s(!1), r(ve.util.resetApiState());
475
- }, 1e3), ce = N(
476
- (x) => {
477
- if (I.current.callCount > 1e3)
478
- return se(!0), console.log(
472
+ }), j(!0));
473
+ }, [S, R]);
474
+ const k = P({ callCount: 0, windowStart: Date.now() }), N = re(() => {
475
+ console.log("Resetting API state due to server restart"), a(!1), r(Ve.util.resetApiState());
476
+ }, 1e3), A = V(
477
+ (b) => {
478
+ const L = Date.now();
479
+ if (L - k.current.windowStart >= 1e3 && (k.current.windowStart = L, k.current.callCount = 0), k.current.callCount > 1e3)
480
+ return $(!0), console.log(
479
481
  "Overload: Over 1000 messages per second. Ignoring subsequent messages."
480
482
  );
481
- let A;
483
+ let _;
482
484
  try {
483
- A = JSON.parse(x.data);
484
- } catch (ue) {
485
- console.error("Failed to parse websocket message:", ue, x.data);
485
+ _ = JSON.parse(b.data);
486
+ } catch (Ce) {
487
+ console.error("Failed to parse websocket message:", Ce, b.data);
486
488
  return;
487
489
  }
488
- const { topic: y, sender: W, summary: de, status: le } = A || {};
489
- if (l.current && (y === "heartbeat" || y === "server.started" && le === "finished")) {
490
- console.log("Server replica booted"), ie();
490
+ const { topic: T, sender: oe, summary: Se, status: be } = _ || {};
491
+ if (d.current && (T === "heartbeat" || T === "server.started" && be === "finished")) {
492
+ console.log("Server replica booted"), N();
491
493
  return;
492
494
  }
493
- if (y === "heartbeat") return;
494
- if (y === "server.restart_requested" && (console.log("Server restart requested"), s(!0)), ["import.data"].includes(y)) {
495
- if (W !== window.senderId) return;
496
- } else if (W === window.senderId)
497
- return;
498
- const q = Date.now();
499
- q - I.current.lastCall < 1e3 ? I.current.callCount += 1 : I.current.callCount = 0, console.log("Event RX", A), I.current.lastCall = q, y === "shout" && A?.summary?.text && G.info(de.text), D.publish(y, A);
495
+ if (T !== "heartbeat") {
496
+ if (T === "server.restart_requested" && (console.log("Server restart requested"), a(!0)), ["import.data"].includes(T)) {
497
+ if (oe !== window.senderId) return;
498
+ } else if (oe === window.senderId)
499
+ return;
500
+ k.current.callCount += 1, console.log("Event RX", _), T === "shout" && _?.summary?.text && B.info(Se.text), D.publish(T, _);
501
+ }
500
502
  },
501
- [s]
503
+ [a]
502
504
  );
503
- return v(() => {
504
- P === Se.OPEN && (E().onmessage = ce, w(), D.publish("client.connected", {
505
+ return E(() => {
506
+ m === Oe.OPEN && (u().onmessage = A, l(), D.publish("client.connected", {
505
507
  topic: "client.connected"
506
508
  }));
507
- }, [P, E]), /* @__PURE__ */ d(
508
- ee.Provider,
509
+ }, [m, u]), /* @__PURE__ */ p(
510
+ ge.Provider,
509
511
  {
510
512
  value: {
511
- getWebSocket: E,
512
- readyState: P,
513
+ getWebSocket: u,
514
+ readyState: m,
513
515
  serverRestartingVisible: n
514
516
  },
515
517
  children: e
516
518
  }
517
519
  );
518
- }, te = h(void 0), fo = () => {
519
- const e = u(te);
520
+ }, we = y(void 0), Do = () => {
521
+ const e = f(we);
520
522
  if (e === void 0)
521
523
  throw new Error("useProjectContext must be used within a ProjectContextProvider");
522
524
  return e;
523
- }, mo = () => u(te), oe = h(
525
+ }, Ro = () => f(we), fe = y(
524
526
  void 0
525
- ), go = () => {
526
- const e = u(oe);
527
+ ), $o = () => {
528
+ const e = f(fe);
527
529
  if (e === void 0)
528
530
  throw new Error("useProjectFoldersContext must be used within a ProjectFoldersContextProvider");
529
531
  return e;
530
- }, vo = () => u(oe), ne = h(void 0), ot = (e) => ({
532
+ }, No = () => f(fe), Q = y(void 0), ee = (e) => ({
531
533
  created: e,
532
534
  label_changed: e,
533
535
  renamed: e,
@@ -536,7 +538,7 @@ const Ge = p(ye)`
536
538
  tags_changed: e,
537
539
  attrib_changed: e,
538
540
  deleted: e
539
- }), nt = (e, t) => e === t || e.startsWith(`${t}.`), rt = (e, t) => t.length === 0 ? !0 : t.includes(e || ""), st = (e) => {
541
+ }), he = (e, t) => e === t || e.startsWith(`${t}.`), X = (e, t) => t.length === 0 ? !0 : t.includes(e || ""), ve = (e) => {
540
542
  const t = e.split(".").pop();
541
543
  if (t && [
542
544
  "created",
@@ -549,39 +551,44 @@ const Ge = p(ye)`
549
551
  "deleted"
550
552
  ].includes(t))
551
553
  return t;
552
- }, wo = ({
554
+ }, _o = ({
553
555
  projectNames: e,
554
556
  topics: t,
555
557
  isSyncing: o = !1,
556
558
  shouldSyncOnUpdate: r
557
559
  }) => {
558
- const n = u(ne);
560
+ const n = f(Q);
559
561
  if (!n)
560
562
  throw new Error("useSyncUpdates must be used within an EntityUpdatesProvider");
561
- const s = e || n.projectNames, a = S(0), i = S(!1), c = n.updates.filter(
562
- (l) => rt(l.project, s) && t.some((f) => nt(l.topic, f)) && (r?.(l) ?? !0)
563
+ const a = e || n.projectNames, i = P(0), s = P(!1), c = n.updates.filter(
564
+ (d) => X(d.project, a) && t.some((g) => he(d.topic, g)) && (r?.(d) ?? !0)
563
565
  );
564
- return v(() => {
565
- o && !i.current ? a.current = n.getLatestId() : !o && i.current && n.acknowledge(t, s, a.current), i.current = o;
566
- }, [n, o, s, t]), {
566
+ return E(() => {
567
+ o && !s.current ? i.current = n.getLatestId() : !o && s.current && n.acknowledge(t, a, i.current), s.current = o;
568
+ }, [n, o, a, t]), {
567
569
  updates: c,
568
570
  hasUpdates: c.length > 0,
569
571
  updateCount: c.length
570
572
  };
571
- }, xo = () => {
572
- const e = u(ne);
573
+ }, jo = () => {
574
+ const e = f(Q);
573
575
  if (!e)
574
576
  throw new Error("useAutoSyncSettings must be used within an EntityUpdatesProvider");
575
577
  const { autoSyncSettings: t, setAutoSyncSettings: o } = e;
576
578
  return [t, (n) => {
577
- const { settings: s, global: a } = n;
578
- o(a !== void 0 ? ot(a) : (i) => ({ ...i, ...s }));
579
+ const { settings: a, global: i } = n;
580
+ o(i !== void 0 ? ee(i) : (s) => ({ ...s, ...a }));
579
581
  }];
580
- }, yo = (e, t) => {
582
+ }, Lo = (e, t) => {
581
583
  if (!t) return !1;
582
- const o = st(e);
584
+ const o = ve(e);
583
585
  return o ? t[o] : !1;
584
- }, at = p.li`
586
+ }, mt = () => Pe().replace(/-/g, ""), yt = (e = {}) => ({
587
+ id: mt(),
588
+ label: "Working",
589
+ working: !0,
590
+ settings: e
591
+ }), xt = v.li`
585
592
  position: relative;
586
593
  padding: 4px 6px 4px 12px;
587
594
  user-select: none;
@@ -634,7 +641,7 @@ const Ge = p(ye)`
634
641
  display: flex;
635
642
  }
636
643
  }
637
- `, M = p(j)`
644
+ `, z = v(q)`
638
645
  &.hasIcon {
639
646
  padding: 2px;
640
647
  }
@@ -652,68 +659,68 @@ const Ge = p(ye)`
652
659
  }
653
660
  }
654
661
  }
655
- `, it = B(
662
+ `, St = Z(
656
663
  ({
657
664
  id: e,
658
665
  label: t,
659
666
  startContent: o,
660
667
  endContent: r,
661
668
  isSelected: n,
662
- isEditable: s,
663
- isSaveable: a,
664
- highlighted: i,
669
+ isEditable: a,
670
+ isSaveable: i,
671
+ highlighted: s,
665
672
  onEdit: c,
666
- onSave: l,
667
- onResetView: f,
668
- className: C,
669
- ...P
670
- }, E) => {
671
- const { viewAlias: w } = mt(), T = (m, R) => {
672
- m.stopPropagation(), R ? ge({
673
- message: `Save current ${w} settings and overwrite this ${w}?`,
673
+ onSave: d,
674
+ onResetView: g,
675
+ className: w,
676
+ ...m
677
+ }, u) => {
678
+ const { viewAlias: l } = te(), x = (h, S) => {
679
+ h.stopPropagation(), S ? Ie({
680
+ message: `Save current ${l} settings and overwrite this ${l}?`,
674
681
  header: "Confirm save",
675
- accept: () => l && l(m, e)
676
- }) : l && l(m, e);
682
+ accept: () => d && d(h, e)
683
+ }) : d && d(h, e);
677
684
  };
678
- return /* @__PURE__ */ g(
679
- at,
685
+ return /* @__PURE__ */ C(
686
+ xt,
680
687
  {
681
- ...P,
688
+ ...m,
682
689
  id: e,
683
- className: $(C, { selected: n }),
684
- ref: E,
690
+ className: O(w, { selected: n }),
691
+ ref: u,
685
692
  children: [
686
693
  o && o,
687
- /* @__PURE__ */ d("span", { className: "label", children: t }),
688
- f && /* @__PURE__ */ d(
689
- M,
694
+ /* @__PURE__ */ p("span", { className: "label", children: t }),
695
+ g && /* @__PURE__ */ p(
696
+ z,
690
697
  {
691
698
  icon: "restart_alt",
692
699
  variant: "text",
693
700
  className: "reset",
694
- onClick: f,
701
+ onClick: g,
695
702
  "data-tooltip": "Reset to Default",
696
- "data-shortcut": fe("0", [H.Shift, H.Ctrl])
703
+ "data-shortcut": Ne("0", [ae.Shift, ae.Ctrl])
697
704
  }
698
705
  ),
699
- s && a && !n && /* @__PURE__ */ d(
700
- M,
706
+ a && i && !n && /* @__PURE__ */ p(
707
+ z,
701
708
  {
702
709
  icon: "save",
703
710
  variant: "text",
704
- className: $("save", { active: i === "save" }),
705
- onClick: (m) => T(m, i !== "save"),
706
- "data-tooltip": `Save ${w} settings from current ${w}`
711
+ className: O("save", { active: s === "save" }),
712
+ onClick: (h) => x(h, s !== "save"),
713
+ "data-tooltip": `Save ${l} settings from current ${l}`
707
714
  }
708
715
  ),
709
- s && c && /* @__PURE__ */ d(
710
- M,
716
+ a && c && /* @__PURE__ */ p(
717
+ z,
711
718
  {
712
719
  variant: "text",
713
720
  icon: "more_horiz",
714
- className: $("more", { active: i === "edit" }),
715
- onClick: (m) => c(m, e),
716
- "data-tooltip": `Edit ${w}`
721
+ className: O("more", { active: s === "edit" }),
722
+ onClick: (h) => c(h, e),
723
+ "data-tooltip": `Edit ${l}`
717
724
  }
718
725
  ),
719
726
  r && r
@@ -721,10 +728,10 @@ const Ge = p(ye)`
721
728
  }
722
729
  );
723
730
  }
724
- ), ct = p.div`
731
+ ), bt = v.div`
725
732
  overflow: auto;
726
733
  max-height: 40vh;
727
- `, dt = p.ul`
734
+ `, Ct = v.ul`
728
735
  /* reset defaults */
729
736
  margin: 0;
730
737
  padding: 0;
@@ -734,17 +741,17 @@ const Ge = p(ye)`
734
741
  flex-direction: column;
735
742
  gap: var(--base-gap-small);
736
743
  margin-bottom: var(--padding-s);
737
- `, lt = p.li`
744
+ `, Et = v.li`
738
745
  height: 1px;
739
746
  background-color: var(--md-sys-color-outline-variant);
740
747
  margin: 4px 0;
741
748
  `;
742
- p.li`
743
- ${X.labelSmall}
749
+ v.li`
750
+ ${le.labelSmall}
744
751
  color: var(--md-sys-color-outline);
745
752
  `;
746
- const ut = p.li`
747
- ${X.labelSmall}
753
+ const It = v.li`
754
+ ${le.labelSmall}
748
755
  color: var(--md-sys-color-outline);
749
756
  user-select: none;
750
757
  border-radius: var(--border-radius-m);
@@ -779,23 +786,23 @@ const ut = p.li`
779
786
  &:hover .icon {
780
787
  display: inline-flex;
781
788
  }
782
- `, pt = B(
783
- ({ title: e, collapsed: t, className: o, ...r }, n) => /* @__PURE__ */ g(
784
- ut,
789
+ `, Pt = Z(
790
+ ({ title: e, collapsed: t, className: o, ...r }, n) => /* @__PURE__ */ C(
791
+ It,
785
792
  {
786
793
  ...r,
787
- className: $("views-section-header", { collapsed: t }, o),
794
+ className: O("views-section-header", { collapsed: t }, o),
788
795
  ref: n,
789
796
  children: [
790
- /* @__PURE__ */ d("span", { children: e }),
791
- /* @__PURE__ */ d("span", { className: "spacer" }),
792
- /* @__PURE__ */ d(F, { className: "icon", icon: "expand_more" })
797
+ /* @__PURE__ */ p("span", { children: e }),
798
+ /* @__PURE__ */ p("span", { className: "spacer" }),
799
+ /* @__PURE__ */ p(K, { className: "icon", icon: "expand_more" })
793
800
  ]
794
801
  }
795
802
  )
796
- ), bo = "_divider_", ht = (e) => typeof e == "object" && e !== null && "type" in e && e.type === "section", So = B(
797
- ({ items: e, selected: t, ...o }, r) => /* @__PURE__ */ d(ct, { children: /* @__PURE__ */ d(dt, { ...o, ref: r, children: e.map((n, s) => n === "_divider_" ? /* @__PURE__ */ d(lt, {}, s) : ht(n) ? /* @__PURE__ */ d(
798
- pt,
803
+ ), Oo = "_divider_", Vt = (e) => typeof e == "object" && e !== null && "type" in e && e.type === "section", Mo = Z(
804
+ ({ items: e, selected: t, ...o }, r) => /* @__PURE__ */ p(bt, { children: /* @__PURE__ */ p(Ct, { ...o, ref: r, children: e.map((n, a) => n === "_divider_" ? /* @__PURE__ */ p(Et, {}, a) : Vt(n) ? /* @__PURE__ */ p(
805
+ Pt,
799
806
  {
800
807
  id: n.id,
801
808
  title: n.title,
@@ -803,60 +810,244 @@ const ut = p.li`
803
810
  onClick: n.onToggle
804
811
  },
805
812
  n.id
806
- ) : /* @__PURE__ */ d(
807
- it,
813
+ ) : /* @__PURE__ */ p(
814
+ St,
808
815
  {
809
816
  tabIndex: 0,
810
817
  isSelected: n.id === t,
811
- autoFocus: s === 0,
818
+ autoFocus: a === 0,
812
819
  ...n
813
820
  },
814
- (n.id || "") + s.toString()
821
+ (n.id || "") + a.toString()
815
822
  )) }) })
816
- ), ft = h(null), mt = () => {
817
- const e = u(ft);
823
+ ), kt = y(null), te = () => {
824
+ const e = f(kt);
818
825
  if (!e)
819
826
  throw new Error("useViewsContext must be used within a ViewsProvider");
820
827
  return e;
821
- }, Co = 1, gt = p.div`
828
+ };
829
+ let F = !1;
830
+ const ce = () => {
831
+ F || (F = !0, queueMicrotask(() => {
832
+ F = !1;
833
+ }));
834
+ }, At = async (e, t, o, r = {}, n, a, i, s) => {
835
+ const {
836
+ viewSettings: c,
837
+ viewType: d,
838
+ projectName: g,
839
+ selectedView: w,
840
+ setSelectedView: m,
841
+ workingView: u,
842
+ onSettingsChanged: l,
843
+ isErrorWorkingView: x
844
+ } = n;
845
+ if (!d) throw new Error("No view type provided for updating view settings");
846
+ const h = w?.id, S = w?.working;
847
+ try {
848
+ t(o);
849
+ const { settings: $, workingViewId: R } = i(), j = $ ?? c;
850
+ if (j === void 0 && !x) {
851
+ console.warn(
852
+ "updateViewSettings: no settings baseline available, aborting to prevent data loss."
853
+ );
854
+ return;
855
+ }
856
+ const k = { ...j, ...e }, N = yt(k), A = R ?? u?.id;
857
+ A && (N.id = A);
858
+ const b = N.id, L = a(
859
+ {
860
+ payload: A ? { settings: k } : N,
861
+ viewType: d,
862
+ projectName: g
863
+ },
864
+ A
865
+ );
866
+ s(), (!S || w?.id !== A) && (w && l(!0), m(b)), await L, t(null), r.successMessage && B.success(r.successMessage);
867
+ } catch ($) {
868
+ t(null), h && m(h), w && !S && l(!1);
869
+ const R = r.errorMessage || `Failed to update view settings: ${$}`;
870
+ B.error(R);
871
+ }
872
+ }, Tt = () => {
873
+ const [e] = Te(), [t] = De(), o = te(), r = Re(), n = V(
874
+ async (s, c) => {
875
+ if (c) {
876
+ const d = {};
877
+ return ["label", "owner", "settings"].forEach((w) => {
878
+ s.payload[w] !== void 0 && (d[w] = s.payload[w]);
879
+ }), await t({
880
+ viewType: s.viewType,
881
+ projectName: s.projectName,
882
+ viewId: c,
883
+ genericViewPatchModel: d
884
+ }).unwrap();
885
+ } else
886
+ return await e({
887
+ viewType: s.viewType,
888
+ projectName: s.projectName,
889
+ genericViewPostModel: s.payload
890
+ }).unwrap();
891
+ },
892
+ [e, t]
893
+ ), a = V(() => {
894
+ const { viewType: s, projectName: c, selectedView: d, workingView: g } = o;
895
+ if (!s) return {};
896
+ const w = r.getState(), m = se.endpoints.getWorkingView.select({
897
+ viewType: s,
898
+ projectName: c
899
+ })(w), l = m?.data?.id || g?.id, x = se.endpoints.getDefaultView.select({
900
+ viewType: s,
901
+ projectName: c
902
+ })(w), h = x?.data?.id || d?.id;
903
+ return (!!l && h === l || F) && m?.data?.settings ? {
904
+ settings: m.data.settings,
905
+ workingViewId: l
906
+ } : x?.data?.settings ? {
907
+ settings: x.data.settings,
908
+ workingViewId: l
909
+ } : { workingViewId: l };
910
+ }, [r, o]);
911
+ return {
912
+ updateViewSettings: V(
913
+ async (...s) => await At(...s, o, n, a, ce),
914
+ [o, n, a]
915
+ ),
916
+ onCreateView: n,
917
+ getLatestSettings: a,
918
+ markCacheDirty: ce
919
+ };
920
+ }, de = (e, t) => t.split(".").reduce((o, r) => o?.[r], e), me = (e, t, o) => {
921
+ const [r, ...n] = t.split(".");
922
+ return r ? {
923
+ ...e,
924
+ [r]: n.length ? me(e[r] || {}, n.join("."), o) : o
925
+ } : e;
926
+ }, Dt = (e, t) => {
927
+ const { viewSettings: o, isLoadingViews: r } = te(), { updateViewSettings: n, getLatestSettings: a } = Tt(), [i, s] = I(null), c = P(null), d = o, g = i !== null ? i : de(d, e) ?? t, w = V((u) => {
928
+ c.current = u, s(u);
929
+ }, []), m = V(
930
+ (u) => {
931
+ if (r) return;
932
+ const l = a().settings ?? d ?? {}, x = c.current !== null ? c.current : de(l, e) ?? t, h = typeof u == "function" ? u(
933
+ x
934
+ ) : u;
935
+ n(
936
+ me(l, e, h),
937
+ w,
938
+ h,
939
+ {}
940
+ );
941
+ },
942
+ [
943
+ t,
944
+ a,
945
+ r,
946
+ e,
947
+ d,
948
+ w,
949
+ n
950
+ ]
951
+ );
952
+ return [g, m];
953
+ }, Uo = !0, Rt = { ...ee(!0), created: !1 }, Wo = ({ children: e, projectNames: t }) => {
954
+ const o = P(0), [r = ee(!1), n] = Dt("autoSync"), [a, i] = I([]), s = G(
955
+ () => Rt,
956
+ [r]
957
+ );
958
+ E(() => {
959
+ let d = 0;
960
+ const g = ke(
961
+ (m) => {
962
+ const u = m.map(({ project: l, topic: x, updateType: h, message: S }) => ({
963
+ id: ++o.current,
964
+ project: l,
965
+ topic: x,
966
+ updateType: h,
967
+ entityId: S.summary?.entityId,
968
+ message: S
969
+ }));
970
+ i((l) => [...l, ...u]);
971
+ },
972
+ ({ key: m }) => String(m),
973
+ 0
974
+ ), w = D.subscribeAll((m, u) => {
975
+ if (!u?.topic || !X(u.project, t)) return;
976
+ const l = ve(u.topic);
977
+ !l || s[l] || l === "created" && ![
978
+ "entity.folder.created",
979
+ "entity.task.created",
980
+ "entity.product.created",
981
+ "entity.version.created"
982
+ ].includes(u.topic) || g.add({
983
+ key: ++d,
984
+ project: u.project,
985
+ topic: u.topic,
986
+ updateType: l,
987
+ message: u
988
+ });
989
+ });
990
+ return () => {
991
+ D.unsubscribe(w), g.clear();
992
+ };
993
+ }, [s, t]);
994
+ const c = G(
995
+ () => ({
996
+ updates: a,
997
+ projectNames: t,
998
+ acknowledge: (d, g, w) => {
999
+ i(
1000
+ (m) => m.filter(
1001
+ (u) => u.id > w || !d.some((l) => he(u.topic, l)) || !X(u.project, g)
1002
+ )
1003
+ );
1004
+ },
1005
+ getLatestId: () => o.current,
1006
+ autoSyncSettings: s,
1007
+ setAutoSyncSettings: n
1008
+ }),
1009
+ [s, t, n, a]
1010
+ );
1011
+ return /* @__PURE__ */ p(Q.Provider, { value: c, children: e });
1012
+ }, Fo = 1, $t = v.div`
822
1013
  min-width: 350px;
823
- `, vt = p.div`
1014
+ `, Nt = v.div`
824
1015
  margin-top: 12px;
825
1016
  min-height: 60px;
826
1017
  min-width: 350px;
827
- `, wt = p.p`
1018
+ `, _t = v.p`
828
1019
  font-weight: 600;
829
1020
  margin-bottom: 4px;
830
- `, xt = p.p`
1021
+ `, jt = v.p`
831
1022
  margin-top: 12px;
832
1023
  font-weight: 600;
833
1024
  color: var(--md-sys-color-error);
834
- `, Po = ({
1025
+ `, Bo = ({
835
1026
  entityLabel: e,
836
1027
  childrenDetails: t,
837
1028
  totalLine: o,
838
1029
  message: r
839
- }) => /* @__PURE__ */ g(gt, { children: [
840
- /* @__PURE__ */ d("p", { children: r || `Are you sure you want to delete ${e}? This action cannot be undone.` }),
841
- t.length > 0 && /* @__PURE__ */ g(vt, { children: [
842
- /* @__PURE__ */ d(wt, { children: "The following will also be affected:" }),
843
- t.map((n, s) => /* @__PURE__ */ d("p", { children: n }, s))
1030
+ }) => /* @__PURE__ */ C($t, { children: [
1031
+ /* @__PURE__ */ p("p", { children: r || `Are you sure you want to delete ${e}? This action cannot be undone.` }),
1032
+ t.length > 0 && /* @__PURE__ */ C(Nt, { children: [
1033
+ /* @__PURE__ */ p(_t, { children: "The following will also be affected:" }),
1034
+ t.map((n, a) => /* @__PURE__ */ p("p", { children: n }, a))
844
1035
  ] }),
845
- o && /* @__PURE__ */ d(xt, { children: o })
846
- ] }), Eo = p(he)`
1036
+ o && /* @__PURE__ */ p(jt, { children: o })
1037
+ ] }), Jo = v($e)`
847
1038
  max-height: min(600px, 90vh);
848
- `, Io = p.div`
1039
+ `, qo = v.div`
849
1040
  display: flex;
850
1041
  flex-direction: column;
851
1042
  width: 100%;
852
- `, Ao = p.label`
1043
+ `, Ho = v.label`
853
1044
  margin: 2px 0 14px 0;
854
- `, Do = p.div`
1045
+ `, zo = v.div`
855
1046
  display: flex;
856
1047
  padding-top: 14px;
857
1048
  gap: 8px;
858
1049
  justify-content: flex-end;
859
- `, To = p.div`
1050
+ `, Go = v.div`
860
1051
  display: flex;
861
1052
  flex-direction: column;
862
1053
  gap: 8px;
@@ -865,111 +1056,118 @@ const ut = p.li`
865
1056
  /* scroll container clips the inputs' 2px focus outline — inset it, then pull back to keep alignment */
866
1057
  padding: 4px;
867
1058
  margin: -4px;
868
- `, Ro = p.label`
1059
+ `, Ko = v.label`
869
1060
  display: flex;
870
1061
  align-items: center;
871
1062
  justify-content: space-between;
872
1063
  gap: 12px;
873
- `, $o = p(Z)`
1064
+ `, Yo = v(ue)`
874
1065
  width: 180px;
875
- `, Oo = p(Z)`
1066
+ `, Xo = v(ue)`
876
1067
  width: 100%;
877
1068
  /* room for the 2px focus outline */
878
1069
  margin: 2px 0;
879
- `, yt = /* @__PURE__ */ new Set([
1070
+ `, Lt = /* @__PURE__ */ new Set([
880
1071
  "folder",
881
1072
  "task",
882
1073
  "product",
883
1074
  "version",
884
1075
  "representation",
885
1076
  "workfile"
886
- ]), _o = (e) => !!e && yt.has(e), re = h(null), ko = () => {
887
- const e = u(re);
1077
+ ]), Zo = (e) => !!e && Lt.has(e), ye = y(null), Qo = () => {
1078
+ const e = f(ye);
888
1079
  if (!e)
889
1080
  throw new Error("useDeleteEntitiesContext must be used within a DeleteEntitiesProvider");
890
1081
  return e;
891
- }, Lo = () => u(re), No = "tableExport", bt = h(null), jo = () => u(bt);
1082
+ }, en = () => f(ye), tn = "tableExport", Ot = y(null), on = () => f(Ot);
892
1083
  export {
893
- No as $,
894
- Ht as A,
895
- Kt as B,
896
- Oo as C,
897
- Po as D,
898
- ne as E,
899
- Io as F,
900
- Re as G,
901
- Gt as H,
902
- Ce as I,
903
- V as J,
904
- Ve as K,
905
- Xt as L,
906
- Qe as M,
907
- je as N,
908
- Je as O,
909
- te as P,
910
- qe as Q,
911
- Ee as R,
912
- Eo as S,
913
- We as T,
914
- ze as U,
915
- Xe as V,
916
- Ze as W,
917
- Oe as X,
918
- Pe as Y,
919
- _e as Z,
920
- re as _,
921
- zt as a,
922
- bt as a0,
923
- io as a1,
924
- ee as a2,
925
- ho as a3,
926
- to as a4,
927
- yo as a5,
928
- Fe as a6,
929
- _o as a7,
930
- oo as a8,
931
- lo as a9,
932
- co as aa,
933
- xo as ab,
934
- ko as ac,
935
- Lo as ad,
936
- vo as ae,
937
- He as af,
938
- no as ag,
939
- ao as ah,
940
- po as ai,
941
- ro as aj,
942
- wo as ak,
943
- jo as al,
944
- so as am,
945
- bo as an,
946
- ft as ao,
947
- pt as ap,
948
- So as aq,
949
- it as ar,
950
- Yt as b,
951
- nt as c,
952
- qt as d,
953
- mt as e,
954
- Co as f,
955
- st as g,
956
- Ao as h,
957
- To as i,
958
- Ro as j,
959
- $o as k,
960
- Do as l,
1084
+ Io as $,
1085
+ go as A,
1086
+ Y as B,
1087
+ Xo as C,
1088
+ Bo as D,
1089
+ nt as E,
1090
+ qo as F,
1091
+ fo as G,
1092
+ Qe as H,
1093
+ st as I,
1094
+ it as J,
1095
+ ct as K,
1096
+ gt as L,
1097
+ ft as M,
1098
+ wt as N,
1099
+ Ge as O,
1100
+ we as P,
1101
+ Ue as Q,
1102
+ We as R,
1103
+ Jo as S,
1104
+ at as T,
1105
+ Ke as U,
1106
+ ye as V,
1107
+ tn as W,
1108
+ Ot as X,
1109
+ Q as Y,
1110
+ Wo as Z,
1111
+ Uo as _,
1112
+ lo as a,
1113
+ ge as a0,
1114
+ To as a1,
1115
+ yo as a2,
1116
+ Lo as a3,
1117
+ ve as a4,
1118
+ ot as a5,
1119
+ Zo as a6,
1120
+ X as a7,
1121
+ he as a8,
1122
+ xo as a9,
1123
+ ee as aa,
1124
+ Vo as ab,
1125
+ Po as ac,
1126
+ jo as ad,
1127
+ Qo as ae,
1128
+ en as af,
1129
+ dt as ag,
1130
+ So as ah,
1131
+ Eo as ai,
1132
+ Ao as aj,
1133
+ bo as ak,
1134
+ _o as al,
1135
+ on as am,
1136
+ Co as an,
1137
+ yt as ao,
1138
+ Oo as ap,
1139
+ kt as aq,
1140
+ te as ar,
1141
+ Pt as as,
1142
+ Mo as at,
1143
+ St as au,
1144
+ Tt as av,
1145
+ mt as aw,
1146
+ At as ax,
1147
+ Dt as ay,
1148
+ wo as b,
1149
+ co as c,
1150
+ Fo as d,
1151
+ Ho as e,
1152
+ Go as f,
1153
+ Ko as g,
1154
+ Yo as h,
1155
+ zo as i,
1156
+ fe as j,
1157
+ Ro as k,
1158
+ Ye as l,
961
1159
  rt as m,
962
- oe as n,
1160
+ Xe as n,
963
1161
  mo as o,
964
- ke as p,
965
- Zt as q,
966
- Le as r,
967
- eo as s,
968
- ot as t,
969
- uo as u,
970
- Qt as v,
971
- Ne as w,
972
- Be as x,
973
- fo as y,
974
- go as z
1162
+ Ze as p,
1163
+ Do as q,
1164
+ ho as r,
1165
+ $o as s,
1166
+ No as t,
1167
+ ko as u,
1168
+ uo as v,
1169
+ vo as w,
1170
+ po as x,
1171
+ He as y,
1172
+ Me as z
975
1173
  };