@ynput/ayon-frontend-shared 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/LICENSE +105 -0
  2. package/dist/DetailsPanel.es.js +1088 -969
  3. package/dist/ListTable.es.js +70 -67
  4. package/dist/NewEntity.es.js +8 -5
  5. package/dist/ProjectTreeTable.es.js +4134 -3825
  6. package/dist/ProjectsTable.es.js +526 -0
  7. package/dist/Slicer.es.js +75 -73
  8. package/dist/Views.es.js +86 -84
  9. package/dist/chunks/Actions.es.js +4 -2
  10. package/dist/chunks/ColumnDropIndicator.es.js +21 -18
  11. package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
  14. package/dist/chunks/EmptyPlaceholder.es.js +9 -8
  15. package/dist/chunks/EntityPath.es.js +15 -14
  16. package/dist/chunks/EntityPickerDialog.es.js +5 -3
  17. package/dist/chunks/EntityTooltip.es.js +10 -8
  18. package/dist/chunks/EntityUpdatesContext.es.js +13 -12
  19. package/dist/chunks/Feed.es.js +12 -11
  20. package/dist/chunks/FilterErrorActions.es.js +6 -4
  21. package/dist/chunks/GroupSettingsFallback.es.js +75 -0
  22. package/dist/chunks/JsonViewer.es.js +3 -2
  23. package/dist/chunks/Menu.es.js +105 -103
  24. package/dist/chunks/MetaWidget.es.js +278 -275
  25. package/dist/chunks/PlayableIcon.es.js +868 -862
  26. package/dist/chunks/ProjectContext.es.js +5 -4
  27. package/dist/chunks/RepresentationsList.es.js +3 -2
  28. package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
  29. package/dist/chunks/SimpleTable.es.js +492 -402
  30. package/dist/chunks/Slicer.es.js +936 -896
  31. package/dist/chunks/TableExportContextInstance.es.js +437 -339
  32. package/dist/chunks/TableSettingsFallback.es.js +5 -3
  33. package/dist/chunks/ThumbnailSimple.es.js +15 -13
  34. package/dist/chunks/VideoPlayer.es.js +14 -12
  35. package/dist/chunks/Watchers.es.js +97 -95
  36. package/dist/chunks/getProjectDisplayName.es.js +4 -0
  37. package/dist/chunks/getUris.es.js +375 -374
  38. package/dist/chunks/useHierarchySelection.es.js +5 -3
  39. package/dist/chunks/useLoadModule.es.js +10 -8
  40. package/dist/chunks/viewUpdateHelper.es.js +12 -10
  41. package/dist/components.es.js +1488 -1186
  42. package/dist/context.es.js +589 -539
  43. package/dist/hooks.es.js +169 -212
  44. package/dist/index.es.js +17 -12
  45. package/dist/types/Actions.d.ts +17 -14
  46. package/dist/types/ContextMenu.d.ts +17 -14
  47. package/dist/types/DetailsPanel.d.ts +17 -14
  48. package/dist/types/EntityPickerDialog.d.ts +17 -14
  49. package/dist/types/Feed.d.ts +17 -14
  50. package/dist/types/ListTable.d.ts +17 -14
  51. package/dist/types/NewEntity.d.ts +17 -14
  52. package/dist/types/ProjectTreeTable.d.ts +749 -15
  53. package/dist/types/ProjectsTable.d.ts +228 -0
  54. package/dist/types/RepresentationsList.d.ts +17 -14
  55. package/dist/types/SimpleTable.d.ts +31 -14
  56. package/dist/types/Slicer.d.ts +18 -14
  57. package/dist/types/Views.d.ts +17 -14
  58. package/dist/types/api.d.ts +17 -14
  59. package/dist/types/components.d.ts +822 -25
  60. package/dist/types/context.d.ts +53 -15
  61. package/dist/types/hooks.d.ts +17 -14
  62. package/dist/types/index.d.ts +17 -14
  63. package/dist/types/util.d.ts +21 -14
  64. package/dist/util.es.js +152 -144
  65. package/package.json +16 -9
  66. /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
@@ -1,24 +1,26 @@
1
- import { jsx as E, jsxs as H, Fragment as _e } from "react/jsx-runtime";
2
- import { useState as z, useCallback as N, useMemo as M, useContext as pt, useEffect as se, forwardRef as ft, useRef as Ie, useId as mt, useImperativeHandle as ht, useLayoutEffect as we } from "react";
3
- import { Splitter as gt, SplitterPanel as yt } from "primereact/splitter";
1
+ import { jsx as E, jsxs as G, Fragment as je } from "react/jsx-runtime";
2
+ import { useState as z, useCallback as O, useMemo as _, useContext as vt, useEffect as de, forwardRef as It, useRef as xe, useId as xt, useImperativeHandle as Ct, useLayoutEffect as Me } from "react";
3
+ import { Splitter as Lt, SplitterPanel as wt } from "primereact/splitter";
4
4
  import U from "styled-components";
5
- import { i as bt, P as St, d as Me, U as Ye } from "./MetaWidget.es.js";
5
+ import { i as Et, P as Dt, e as $e, U as at } from "./MetaWidget.es.js";
6
6
  import "@module-federation/enhanced/runtime";
7
- import { toast as $e } from "react-toastify";
8
- import { InputText as Tt, Button as vt, Icon as It } from "@ynput/ayon-react-components";
9
- import { bt as ze, bD as xt, bB as Qe, bA as Ct, bG as Lt } from "./searchTerms.es.js";
10
- import { dw as Je, cO as wt, bZ as Et, bD as Dt } from "./getUris.es.js";
7
+ import { menuItemsAt as Rt } from "@ynput/ayon-addon/host";
8
+ import { toast as Ye } from "react-toastify";
9
+ import { InputText as kt, Button as At, Icon as Mt } from "@ynput/ayon-react-components";
10
+ import { bt as Qe, bD as _t, bB as it, bA as Pt, bG as Ot } from "./searchTerms.es.js";
11
+ import { dw as rt, cO as Nt, bZ as Ft, bD as jt } from "./getUris.es.js";
11
12
  import "primereact/confirmdialog";
12
- import { p as Xe, y as Pe, x as me, d as Rt, a as Oe, o as kt, a7 as At, a6 as _t, u as Ze, ae as Mt } from "./TableExportContextInstance.es.js";
13
+ import { o as lt, y as ze, x as ye, d as $t, b as Ue, v as zt, ac as Ut, ab as Bt, u as ct, aj as Vt } from "./TableExportContextInstance.es.js";
13
14
  import "lodash";
14
15
  import "uuid";
16
+ import "axios";
15
17
  import "semver";
16
18
  import "./ContextMenuContextInstance.es.js";
17
- import W from "clsx";
19
+ import q from "clsx";
18
20
  import "react-dom";
19
21
  import "react-redux";
20
22
  import "react-router-dom";
21
- import { E as Pt, u as Ot } from "./EntityPickerDialog.es.js";
23
+ import { E as Ht, u as Gt } from "./EntityPickerDialog.es.js";
22
24
  import "./PlayableIcon.es.js";
23
25
  import "date-fns";
24
26
  import "lexical";
@@ -32,483 +34,484 @@ import "@lexical/utils";
32
34
  import "@lexical/react/LexicalBlockWithAlignableContents";
33
35
  import "@lexical/react/LexicalDecoratorBlockNode";
34
36
  import "@tanstack/react-table";
35
- import { b as pe, H as Nt, a as Ft, e as jt, S as $t } from "./SimpleTable.es.js";
36
- import { D as zt, L as Ut, s as Vt } from "./sortLists.es.js";
37
- import { a as Ue, g as Ee } from "./getEntityTypeIcon.es.js";
38
- import { g as Bt } from "./iconUtils.es.js";
39
- import { u as Ht, a as Gt } from "./useAttributeEnums.es.js";
40
- import { b as Wt, s as Kt } from "./buildHierarchicalTableRows.es.js";
41
- import { n as Te } from "./entityDefinitions.es.js";
42
- import { a as qt, K as Yt } from "./platform.es.js";
43
- import { u as Qt } from "./NewEntityContextInstance.es.js";
44
- import { u as Jt } from "./VersionUploadContextInstance.es.js";
45
- import { F as Ve } from "./EntityUpdatesContext.es.js";
46
- import { M as Xt, a as Zt } from "./Menu.es.js";
47
- const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) => ({
48
- id: et,
37
+ import { useContributions as Wt, prefetchPiece as Kt, runContribution as qt } from "@ynput/ayon-addon";
38
+ import { b as he, H as Yt, a as Qt, e as Jt, S as Xt } from "./SimpleTable.es.js";
39
+ import { D as Zt, L as en, s as tn } from "./sortLists.es.js";
40
+ import { a as Je, g as _e } from "./getEntityTypeIcon.es.js";
41
+ import { g as nn } from "./iconUtils.es.js";
42
+ import { u as sn, a as on } from "./useAttributeEnums.es.js";
43
+ import { b as an, s as rn } from "./buildHierarchicalTableRows.es.js";
44
+ import { n as ve } from "./entityDefinitions.es.js";
45
+ import { a as ln, K as cn } from "./platform.es.js";
46
+ import { u as dn } from "./NewEntityContextInstance.es.js";
47
+ import { u as un } from "./VersionUploadContextInstance.es.js";
48
+ import { F as Xe } from "./EntityUpdatesContext.es.js";
49
+ import { M as pn, a as mn } from "./Menu.es.js";
50
+ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) => ({
51
+ id: dt,
49
52
  label: e,
50
53
  desc: !1
51
- }), en = ["hierarchy", "assignees", "author"], tn = ["status", "type", "taskType", "folderType"], Ne = (e) => en.includes(e) ? [ve] : e === "entityList" ? Ut : e.startsWith("attrib.") ? [De("Attribute order"), ve] : tn.includes(e) ? [De("Anatomy order"), ve] : [De("Default order"), ve], tt = (e) => {
52
- if (e === "entityList") return zt;
53
- const [t] = Ne(e);
54
+ }), fn = ["hierarchy", "assignees", "author"], hn = ["status", "type", "taskType", "folderType"], Be = (e) => fn.includes(e) ? [Ie] : e === "entityList" ? en : e.startsWith("attrib.") ? [Pe("Attribute order"), Ie] : hn.includes(e) ? [Pe("Anatomy order"), Ie] : [Pe("Default order"), Ie], ut = (e) => {
55
+ if (e === "entityList") return Zt;
56
+ const [t] = Be(e);
54
57
  return { by: t.id, desc: t.desc };
55
- }, Ns = (e, t) => {
56
- const { by: n, desc: s } = t || {};
57
- return Ne(e).some((d) => d.id === n) ? { by: n, desc: !!s } : tt(e);
58
- }, nn = ["noValue", "hasValue"], sn = (e) => e.id.startsWith("folder-"), an = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), Re = (e) => e.label || e.name || "", nt = (e, t, { by: n, desc: s }) => {
59
- const d = (l) => nn.includes(l.id) || t === "entityList" && sn(l), c = e.filter(d), p = e.filter((l) => !d(l));
60
- let h;
58
+ }, Xs = (e, t) => {
59
+ const { by: s, desc: a } = t || {};
60
+ return Be(e).some((u) => u.id === s) ? { by: s, desc: !!a } : ut(e);
61
+ }, gn = ["noValue", "hasValue"], yn = (e) => e.id.startsWith("folder-"), bn = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), Oe = (e) => e.label || e.name || "", pt = (e, t, { by: s, desc: a }) => {
62
+ const u = (l) => gn.includes(l.id) || t === "entityList" && yn(l), c = e.filter(u), p = e.filter((l) => !u(l));
63
+ let g;
61
64
  if (t === "entityList")
62
- h = Vt(
65
+ g = tn(
63
66
  p.map((l) => ({
64
67
  row: l,
65
- label: Re(l),
68
+ label: Oe(l),
66
69
  active: l.data?.active ?? !0,
67
70
  createdAt: l.data?.createdAt,
68
71
  updatedAt: l.data?.updatedAt
69
72
  })),
70
- { by: n, desc: s }
73
+ { by: s, desc: a }
71
74
  ).map(({ row: l }) => l);
72
- else if (n === et)
73
- h = s ? [...p].reverse() : p;
75
+ else if (s === dt)
76
+ g = a ? [...p].reverse() : p;
74
77
  else {
75
- const l = s ? -1 : 1;
76
- h = [...p].sort(
77
- (f, y) => an.compare(Re(f), Re(y)) * l
78
+ const l = a ? -1 : 1;
79
+ g = [...p].sort(
80
+ (m, y) => bn.compare(Oe(m), Oe(y)) * l
78
81
  );
79
82
  }
80
- return [...c, ...h].map(
81
- (l) => l.subRows?.length ? { ...l, subRows: nt(l.subRows, t, { by: n, desc: s }) } : l
83
+ return [...c, ...g].map(
84
+ (l) => l.subRows?.length ? { ...l, subRows: pt(l.subRows, t, { by: s, desc: a }) } : l
82
85
  );
83
- }, on = (e, t, n) => {
84
- const s = tt(t);
85
- return n.by !== "label" && n.by === s.by && n.desc === s.desc ? e : nt(e, t, n);
86
- }, rn = ({
86
+ }, Sn = (e, t, s) => {
87
+ const a = ut(t);
88
+ return s.by !== "label" && s.by === a.by && s.desc === a.desc ? e : pt(e, t, s);
89
+ }, Tn = ({
87
90
  options: e,
88
91
  sort: t,
89
- onChange: n,
90
- id: s = "sort",
91
- label: d = "Sort",
92
+ onChange: s,
93
+ id: a = "sort",
94
+ label: u = "Sort",
92
95
  icon: c = "sort"
93
96
  }) => ({
94
- id: s,
95
- label: d,
97
+ id: a,
98
+ label: u,
96
99
  icon: c,
97
100
  items: e.map((p) => {
98
- const h = t.by === p.id;
101
+ const g = t.by === p.id;
99
102
  return {
100
- id: `${s}-${p.id}`,
103
+ id: `${a}-${p.id}`,
101
104
  label: p.label,
102
- onClick: () => n({ by: p.id, desc: p.desc }),
103
- selected: h,
104
- endActions: h ? [
105
+ onClick: () => s({ by: p.id, desc: p.desc }),
106
+ selected: g,
107
+ endActions: g ? [
105
108
  {
106
109
  icon: t.desc ? "arrow_downward" : "arrow_upward",
107
110
  tooltip: t.desc ? "Descending" : "Ascending",
108
- onClick: () => n({ ...t, desc: !t.desc })
111
+ onClick: () => s({ ...t, desc: !t.desc })
109
112
  }
110
113
  ] : void 0
111
114
  };
112
115
  })
113
- }), ln = 180, st = 100, at = 34, cn = (e, t = [], n = st) => e.map((s) => t.includes(s) ? at : n), dn = (e, t, n, s) => {
114
- const d = e.reduce((f, y) => f + y, 0), c = s.filter(Boolean).length;
115
- if (!c || d === n) return e;
116
- if (d < n) {
117
- const f = (n - d) / c;
118
- return e.map((y, C) => s[C] ? y + f : y);
116
+ }), vn = 180, mt = 100, ft = 34, In = (e, t = [], s = mt) => e.map((a) => t.includes(a) ? ft : s), xn = (e, t, s, a) => {
117
+ const u = e.reduce((m, y) => m + y, 0), c = a.filter(Boolean).length;
118
+ if (!c || u === s) return e;
119
+ if (u < s) {
120
+ const m = (s - u) / c;
121
+ return e.map((y, C) => a[C] ? y + m : y);
119
122
  }
120
- const p = e.map((f, y) => s[y] ? f - t[y] : 0), h = p.reduce((f, y) => f + y, 0);
121
- if (!h) return e;
122
- const l = d - n;
123
- return e.map((f, y) => f - l * (p[y] / h));
124
- }, un = (e, t, n = [], s = 0, d = ln) => {
123
+ const p = e.map((m, y) => a[y] ? m - t[y] : 0), g = p.reduce((m, y) => m + y, 0);
124
+ if (!g) return e;
125
+ const l = u - s;
126
+ return e.map((m, y) => m - l * (p[y] / g));
127
+ }, Cn = (e, t, s = [], a = 0, u = vn) => {
125
128
  if (!t.length)
126
- return { heights: [], mins: [], sizes: [], minSize: 2, height: s };
127
- const c = t.filter((S) => !n.includes(S)).length, p = (t.length - c) * at, h = s && c ? Math.min(
128
- d,
129
+ return { heights: [], mins: [], sizes: [], minSize: 2, height: a };
130
+ const c = t.filter((b) => !s.includes(b)).length, p = (t.length - c) * ft, g = a && c ? Math.min(
131
+ u,
129
132
  Math.max(
130
- st,
131
- Math.floor((s - p) / c)
133
+ mt,
134
+ Math.floor((a - p) / c)
132
135
  )
133
- ) : d, l = cn(t, n), f = t.map(
134
- (S, r) => n.includes(S) ? l[r] : Math.max(e[S] ?? h, l[r])
135
- ), y = t.map((S) => !n.includes(S)), C = l.reduce((S, r) => S + r, 0), m = y.some(Boolean) ? Math.max(s, C) : C, g = dn(f, l, m, y);
136
+ ) : u, l = In(t, s), m = t.map(
137
+ (b, i) => s.includes(b) ? l[i] : Math.max(e[b] ?? g, l[i])
138
+ ), y = t.map((b) => !s.includes(b)), C = l.reduce((b, i) => b + i, 0), f = y.some(Boolean) ? Math.max(a, C) : C, h = xn(m, l, f, y);
136
139
  return {
137
- heights: g,
140
+ heights: h,
138
141
  mins: l,
139
- sizes: g.map((S) => S / m * 100),
142
+ sizes: h.map((b) => b / f * 100),
140
143
  // primereact must allow the drag past the min; clampDraggedHeights puts it back
141
144
  minSize: 2,
142
- height: m
145
+ height: f
143
146
  };
144
- }, pn = (e, t, n) => {
145
- const s = e.map((l, f) => Math.max(l / 100 * t, n[f])), d = Math.max(
147
+ }, Ln = (e, t, s) => {
148
+ const a = e.map((l, m) => Math.max(l / 100 * t, s[m])), u = Math.max(
146
149
  t,
147
- n.reduce((l, f) => l + f, 0)
148
- ), c = s.reduce((l, f) => l + f, 0) - d;
149
- if (c <= 0) return s;
150
- const p = s.map((l, f) => l - n[f]), h = p.reduce((l, f) => l + f, 0);
151
- return h ? s.map((l, f) => l - c * (p[f] / h)) : s;
152
- }, fn = "slicer-splitter", Be = {
150
+ s.reduce((l, m) => l + m, 0)
151
+ ), c = a.reduce((l, m) => l + m, 0) - u;
152
+ if (c <= 0) return a;
153
+ const p = a.map((l, m) => l - s[m]), g = p.reduce((l, m) => l + m, 0);
154
+ return g ? a.map((l, m) => l - c * (p[m] / g)) : a;
155
+ }, wn = "slicer-splitter", Ze = {
153
156
  minSize: 2,
154
157
  size: 12
155
- }, Fs = () => {
156
- const [e, t] = Xe(fn, [
157
- Be.size,
158
- 100 - Be.size
158
+ }, Zs = () => {
159
+ const [e, t] = lt(wn, [
160
+ Ze.size,
161
+ 100 - Ze.size
159
162
  ]);
160
- return [e, (s) => {
161
- t(s.sizes);
163
+ return [e, (a) => {
164
+ t(a.sizes);
162
165
  }];
163
- }, mn = (e, t, n = [], s = 0) => {
164
- const [d, c] = Xe(
166
+ }, En = (e, t, s = [], a = 0) => {
167
+ const [u, c] = lt(
165
168
  `slicer-panel-heights-${e}`,
166
169
  {}
167
- ), [p, h] = z(0), l = Array.isArray(d) ? {} : d, {
168
- sizes: f,
170
+ ), [p, g] = z(0), l = Array.isArray(u) ? {} : u, {
171
+ sizes: m,
169
172
  mins: y,
170
173
  minSize: C,
171
- height: m,
172
- heights: g
173
- } = un(l, t, n, s), S = (r) => {
174
- const u = pn(r.sizes, m, y);
174
+ height: f,
175
+ heights: h
176
+ } = Cn(l, t, s, a), b = (i) => {
177
+ const I = Ln(i.sizes, f, y);
175
178
  c({
176
179
  ...l,
177
180
  ...Object.fromEntries(
178
- t.map((i, b) => [i, u[b]]).filter(([i]) => !n.includes(i))
181
+ t.map((d, o) => [d, I[o]]).filter(([d]) => !s.includes(d))
179
182
  )
180
- }), u.some(
181
- (i, b) => Math.abs(i - r.sizes[b] / 100 * m) > 1
182
- ) && h((i) => i + 1);
183
+ }), I.some(
184
+ (d, o) => Math.abs(d - i.sizes[o] / 100 * f) > 1
185
+ ) && g((d) => d + 1);
183
186
  };
184
187
  return {
185
- sizes: f,
188
+ sizes: m,
186
189
  minSize: C,
187
- height: m,
188
- panelHeights: g,
189
- layoutKey: `${t.join("|")}#${n.join("|")}#${p}`,
190
- handleResizeEnd: S
190
+ height: f,
191
+ panelHeights: h,
192
+ layoutKey: `${t.join("|")}#${s.join("|")}#${p}`,
193
+ handleResizeEnd: b
191
194
  };
192
- }, hn = ({
195
+ }, Dn = ({
193
196
  projectName: e,
194
197
  movingEntities: t,
195
- onClose: n,
196
- onMoveComplete: s
198
+ onClose: s,
199
+ onMoveComplete: a
197
200
  }) => {
198
- const [d] = Je(), c = bt(), { folders: p } = Pe(), h = c?.tableData || [], l = N(
199
- (S) => c?.getEntityById(S) || p.find((r) => r.id === S),
201
+ const [u] = rt(), c = Et(), { folders: p } = ze(), g = c?.tableData || [], l = O(
202
+ (b) => c?.getEntityById(b) || p.find((i) => i.id === b),
200
203
  [p, c]
201
- ), f = N(
202
- async (S) => {
203
- if (!t || S.length === 0) return;
204
- const r = S[0];
204
+ ), m = O(
205
+ async (b) => {
206
+ if (!t || b.length === 0) return;
207
+ const i = b[0];
205
208
  try {
206
- const u = t.entities.map(
207
- (b, a) => ({
208
- id: `move-${b.entityId}-${Date.now()}-${a}`,
209
+ const I = t.entities.map(
210
+ (o, n) => ({
211
+ id: `move-${o.entityId}-${Date.now()}-${n}`,
209
212
  type: "update",
210
- entityType: b.entityType,
211
- entityId: b.entityId,
212
- data: b.entityType === "folder" ? { parentId: r } : { folderId: r }
213
+ entityType: o.entityType,
214
+ entityId: o.entityId,
215
+ data: o.entityType === "folder" ? { parentId: i } : { folderId: i }
213
216
  })
214
- ), i = (await d({
217
+ ), d = (await u({
215
218
  projectName: e,
216
219
  operationsRequestModel: {
217
- operations: u
220
+ operations: I
218
221
  }
219
- }).unwrap())?.operations?.filter((b) => b.success === !1) || [];
220
- if (i.length > 0) {
221
- const b = i.map((a) => a.detail).join(", ");
222
- throw new Error(b || "Some move operations failed");
222
+ }).unwrap())?.operations?.filter((o) => o.success === !1) || [];
223
+ if (d.length > 0) {
224
+ const o = d.map((n) => n.detail).join(", ");
225
+ throw new Error(o || "Some move operations failed");
223
226
  }
224
- s?.(r);
225
- } catch (u) {
226
- let o = ze(u) || "Failed to move entities";
227
- if (o.includes("already exists"))
227
+ a?.(i);
228
+ } catch (I) {
229
+ let r = Qe(I) || "Failed to move entities";
230
+ if (r.includes("already exists"))
228
231
  if (t.entities.length > 1)
229
- o = "Cannot move some entities - one or more entities with the same name already exist in the target location";
232
+ r = "Cannot move some entities - one or more entities with the same name already exist in the target location";
230
233
  else if (t.entities[0].entityType === "task") {
231
- const b = o.match(/name '.*?, (.+?)' already exists/);
232
- o = `Cannot move "${b ? b[1] : "this task"}" - a task with this name already exists in the target folder`;
234
+ const o = r.match(/name '.*?, (.+?)' already exists/);
235
+ r = `Cannot move "${o ? o[1] : "this task"}" - a task with this name already exists in the target folder`;
233
236
  } else {
234
- const b = o.match(/name '.*?, (.+?)' already exists/);
235
- o = `Cannot move "${b ? b[1] : "this folder"}" - a folder with this name already exists in the target location`;
237
+ const o = r.match(/name '.*?, (.+?)' already exists/);
238
+ r = `Cannot move "${o ? o[1] : "this folder"}" - a folder with this name already exists in the target location`;
236
239
  }
237
- $e.error(o);
240
+ Ye.error(r);
238
241
  } finally {
239
- n();
242
+ s();
240
243
  }
241
244
  },
242
- [t, e, d, n, s]
243
- ), y = N(async () => {
245
+ [t, e, u, s, a]
246
+ ), y = O(async () => {
244
247
  if (t)
245
248
  try {
246
- const S = t.entities.map(
247
- (o, i) => ({
248
- id: `move-to-root-${o.entityId}-${Date.now()}-${i}`,
249
+ const b = t.entities.map(
250
+ (r, d) => ({
251
+ id: `move-to-root-${r.entityId}-${Date.now()}-${d}`,
249
252
  type: "update",
250
- entityType: o.entityType,
251
- entityId: o.entityId,
252
- data: o.entityType === "folder" ? { parentId: null } : { folderId: null }
253
+ entityType: r.entityType,
254
+ entityId: r.entityId,
255
+ data: r.entityType === "folder" ? { parentId: null } : { folderId: null }
253
256
  })
254
- ), u = (await d({
257
+ ), I = (await u({
255
258
  projectName: e,
256
259
  operationsRequestModel: {
257
- operations: S
260
+ operations: b
258
261
  }
259
- }).unwrap())?.operations?.filter((o) => o.success === !1) || [];
260
- if (u.length > 0) {
261
- const o = u.map((i) => i.detail).join(", ");
262
- throw new Error(o || "Some move operations failed");
262
+ }).unwrap())?.operations?.filter((r) => r.success === !1) || [];
263
+ if (I.length > 0) {
264
+ const r = I.map((d) => d.detail).join(", ");
265
+ throw new Error(r || "Some move operations failed");
263
266
  }
264
- } catch (S) {
265
- let r = ze(S) || "Failed to move entities to root";
266
- $e.error(r);
267
+ } catch (b) {
268
+ let i = Qe(b) || "Failed to move entities to root";
269
+ Ye.error(i);
267
270
  } finally {
268
- n();
271
+ s();
269
272
  }
270
- }, [t, e, d, n]), C = N(() => {
273
+ }, [t, e, u, s]), C = O(() => {
271
274
  if (!t) return [];
272
- const S = [];
273
- return t.entities.forEach((r) => {
274
- S.push(r.entityId);
275
- }), p.forEach((r) => {
276
- t.entities.some((o) => {
277
- const i = l(o.entityId);
278
- return i?.name ? h.filter((a) => o.entityType === "folder" ? a.entityType === "folder" && a.parentId === r.id : o.entityType === "task" ? a.entityType === "task" && a.folderId === r.id : !1).some(
279
- (a) => a.name === i.name && a.entityId !== o.entityId
275
+ const b = [];
276
+ return t.entities.forEach((i) => {
277
+ b.push(i.entityId);
278
+ }), p.forEach((i) => {
279
+ t.entities.some((r) => {
280
+ const d = l(r.entityId);
281
+ return d?.name ? g.filter((n) => r.entityType === "folder" ? n.entityType === "folder" && n.parentId === i.id : r.entityType === "task" ? n.entityType === "task" && n.folderId === i.id : !1).some(
282
+ (n) => n.name === d.name && n.entityId !== r.entityId
280
283
  ) : !1;
281
- }) && S.push(r.id);
282
- }), [...new Set(S)];
283
- }, [t, p, h, l]), m = N(
284
- (S) => {
284
+ }) && b.push(i.id);
285
+ }), [...new Set(b)];
286
+ }, [t, p, g, l]), f = O(
287
+ (b) => {
285
288
  if (!t) return;
286
289
  if (t.entities.some(
287
- (b) => b.entityType === "folder" && b.entityId === S
290
+ (o) => o.entityType === "folder" && o.entityId === b
288
291
  ))
289
292
  return "Cannot move folder to itself";
290
293
  if (t.entities.some(
291
- (b) => b.currentParentId === S
294
+ (o) => o.currentParentId === b
292
295
  ))
293
296
  return "Cannot move to the same location";
294
- const o = p.find((b) => b.id === S);
295
- if (o) {
296
- const b = t.entities.find((a) => {
297
- const x = l(a.entityId);
298
- return x?.name ? h.filter((v) => a.entityType === "folder" ? v.entityType === "folder" && v.parentId === o.id : a.entityType === "task" ? v.entityType === "task" && v.folderId === o.id : !1).some(
299
- (v) => v.name === x.name && v.entityId !== a.entityId
297
+ const r = p.find((o) => o.id === b);
298
+ if (r) {
299
+ const o = t.entities.find((n) => {
300
+ const v = l(n.entityId);
301
+ return v?.name ? g.filter((x) => n.entityType === "folder" ? x.entityType === "folder" && x.parentId === r.id : n.entityType === "task" ? x.entityType === "task" && x.folderId === r.id : !1).some(
302
+ (x) => x.name === v.name && x.entityId !== n.entityId
300
303
  ) : !1;
301
304
  });
302
- if (b)
303
- return `Cannot move "${l(b.entityId)?.name || "Entity"}" - an entity with the same name already exists in this folder`;
305
+ if (o)
306
+ return `Cannot move "${l(o.entityId)?.name || "Entity"}" - an entity with the same name already exists in this folder`;
304
307
  }
305
308
  return t.entities.some(
306
- (b) => b.entityType === "folder"
309
+ (o) => o.entityType === "folder"
307
310
  ) ? "Cannot move folder to its child" : "Cannot move to this location";
308
311
  },
309
- [t, p, h, l]
310
- ), g = M(() => t?.entities.every((S) => S.entityType === "folder") || !1, [t]);
312
+ [t, p, g, l]
313
+ ), h = _(() => t?.entities.every((b) => b.entityType === "folder") || !1, [t]);
311
314
  return {
312
- handleMoveSubmit: f,
315
+ handleMoveSubmit: m,
313
316
  handleMoveToRoot: y,
314
317
  getDisabledFolderIds: C,
315
- getDisabledMessage: m,
316
- canMoveToRoot: g
318
+ getDisabledMessage: f,
319
+ canMoveToRoot: h
317
320
  };
318
- }, gn = ({
321
+ }, Rn = ({
319
322
  projectName: e,
320
323
  movingEntities: t,
321
- onClose: n,
322
- onMoveComplete: s
324
+ onClose: s,
325
+ onMoveComplete: a
323
326
  }) => {
324
- const { handleMoveSubmit: d, handleMoveToRoot: c, getDisabledFolderIds: p, getDisabledMessage: h } = hn({
327
+ const { handleMoveSubmit: u, handleMoveToRoot: c, getDisabledFolderIds: p, getDisabledMessage: g } = Dn({
325
328
  projectName: e,
326
329
  movingEntities: t ?? null,
327
- onClose: n,
328
- onMoveComplete: s
330
+ onClose: s,
331
+ onMoveComplete: a
329
332
  });
330
333
  return t?.entities.length ? /* @__PURE__ */ E(
331
- Pt,
334
+ Ht,
332
335
  {
333
336
  projectName: e,
334
337
  entityType: "folder",
335
- onSubmit: d,
336
- onClose: n,
338
+ onSubmit: u,
339
+ onClose: s,
337
340
  showMoveToRoot: t.entities.every(
338
341
  (l) => l.entityType === "folder"
339
342
  ),
340
343
  onMoveToRoot: c,
341
344
  disabledIds: p(),
342
- getDisabledMessage: h
345
+ getDisabledMessage: g
343
346
  }
344
347
  ) : null;
345
- }, yn = ({ projectName: e, useExtraSlices: t }) => {
346
- const [n, { isLoading: s, isFetching: d }] = wt(), { formatAssignees: c } = t();
348
+ }, kn = ({ projectName: e, useExtraSlices: t }) => {
349
+ const [s, { isLoading: a, isFetching: u }] = Nt(), { formatAssignees: c } = t();
347
350
  return {
348
351
  getData: async () => {
349
- const h = await n({ projectName: e || "" }, !0).unwrap();
350
- return c(h);
352
+ const g = await s({ projectName: e || "" }, !0).unwrap();
353
+ return c(g);
351
354
  },
352
- isLoading: s || d
355
+ isLoading: a || u
353
356
  };
354
- }, bn = ({ scopes: e, useExtraSlices: t }) => {
355
- const { isLoading: n, productTypes: s, ...d } = me(), { formatStatuses: c, formatTaskTypes: p, formatProductTypes: h, formatTypes: l, formatAttribute: f } = t();
356
- return { project: d, getStatuses: async () => c(d, e), getTypes: async () => l(d), getTaskTypes: async () => p(d), getProductTypes: async () => h(s), getAttribute: async (r) => f ? f(r).map(
357
- (u) => xt(u.icon ?? void 0) ? { ...u, icon: void 0, img: u.icon, imgShape: "circle" } : u
358
- ) : void 0, isLoading: n };
359
- }, Sn = ({ entityTypes: e, request: t }) => {
357
+ }, An = ({ scopes: e, useExtraSlices: t }) => {
358
+ const { isLoading: s, productTypes: a, ...u } = ye(), { formatStatuses: c, formatTaskTypes: p, formatProductTypes: g, formatTypes: l, formatAttribute: m } = t();
359
+ return { project: u, getStatuses: async () => c(u, e), getTypes: async () => l(u), getTaskTypes: async () => p(u), getProductTypes: async () => g(a), getAttribute: async (i) => m ? m(i).map(
360
+ (I) => _t(I.icon ?? void 0) ? { ...I, icon: void 0, img: I.icon, imgShape: "circle" } : I
361
+ ) : void 0, isLoading: s };
362
+ }, Mn = ({ entityTypes: e, request: t }) => {
360
363
  const {
361
- attributes: n,
362
- isLoading: { siteInfo: s }
363
- } = Rt(), d = pt(St), c = d?.attribFields?.length ? d.attribFields : n, { projectName: p } = me();
364
- return { attributes: Ht(c, { projectName: p, request: t ?? [] }).filter((f) => Qe(f.data)).filter((f) => e.some((y) => f.scope?.includes(y))).map(
365
- (f) => f.data.enum?.some((y) => y.hidden) ? { ...f, data: { ...f.data, enum: Ct(f.data.enum) } } : f
366
- ), isLoading: s };
367
- }, Tn = "snippet_folder", fe = "folder", vn = (e) => `${fe}-${e}`, ke = (e) => [...e].sort((t, n) => {
368
- if (t.active && !n.active) return -1;
369
- if (!t.active && n.active) return 1;
370
- const s = new Date(t.createdAt || 0);
371
- return new Date(n.createdAt || 0).getTime() - s.getTime();
372
- }), In = (e = !0) => {
373
- const { projectName: t } = me(), { powerLicense: n } = Oe(), {
374
- data: s,
375
- isLoading: d,
364
+ attributes: s,
365
+ isLoading: { siteInfo: a }
366
+ } = $t(), u = vt(Dt), c = u?.attribFields?.length ? u.attribFields : s, { projectName: p } = ye();
367
+ return { attributes: sn(c, { projectName: p, request: t ?? [] }).filter((m) => it(m.data)).filter((m) => e.some((y) => m.scope?.includes(y))).map(
368
+ (m) => m.data.enum?.some((y) => y.hidden) ? { ...m, data: { ...m.data, enum: Pt(m.data.enum) } } : m
369
+ ), isLoading: a };
370
+ }, _n = "snippet_folder", ge = "folder", Pn = (e) => `${ge}-${e}`, Ne = (e) => [...e].sort((t, s) => {
371
+ if (t.active && !s.active) return -1;
372
+ if (!t.active && s.active) return 1;
373
+ const a = new Date(t.createdAt || 0);
374
+ return new Date(s.createdAt || 0).getTime() - a.getTime();
375
+ }), On = (e = !0) => {
376
+ const { projectName: t } = ye(), { powerLicense: s } = Ue(), {
377
+ data: a,
378
+ isLoading: u,
376
379
  isFetching: c
377
- } = Et(
380
+ } = Ft(
378
381
  { projectName: t || "" },
379
382
  {
380
383
  initialPageParam: { cursor: "" },
381
384
  skip: !t || !e
382
385
  }
383
- ), { data: p = [], isLoading: h } = Dt(
386
+ ), { data: p = [], isLoading: g } = jt(
384
387
  { projectName: t || "" },
385
- { skip: !t || !n || !e }
386
- ), l = M(() => {
387
- if (!s?.pages) return [];
388
- const C = s.pages.flatMap((m) => m.lists);
389
- if (n && p.length > 0) {
390
- const m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set();
391
- for (const a of p)
392
- m.set(a.id, {
393
- id: a.id,
394
- folder: a,
388
+ { skip: !t || !s || !e }
389
+ ), l = _(() => {
390
+ if (!a?.pages) return [];
391
+ const C = a.pages.flatMap((f) => f.lists);
392
+ if (s && p.length > 0) {
393
+ const f = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Set();
394
+ for (const n of p)
395
+ f.set(n.id, {
396
+ id: n.id,
397
+ folder: n,
395
398
  children: /* @__PURE__ */ new Map(),
396
399
  items: [],
397
400
  hasAnyItems: !1
398
- }), a.parentId || g.add(a.id);
399
- for (const a of p)
400
- if (a.parentId && m.has(a.parentId)) {
401
- const x = m.get(a.parentId), T = m.get(a.id);
402
- x.children.set(a.id, T);
401
+ }), n.parentId || h.add(n.id);
402
+ for (const n of p)
403
+ if (n.parentId && f.has(n.parentId)) {
404
+ const v = f.get(n.parentId), T = f.get(n.id);
405
+ v.children.set(n.id, T);
403
406
  }
404
- const S = [];
405
- for (const a of C) {
406
- const x = a.entityListFolderId;
407
- if (x && m.has(x)) {
408
- const T = m.get(x);
409
- T.items.push(a), T.hasAnyItems = !0;
407
+ const b = [];
408
+ for (const n of C) {
409
+ const v = n.entityListFolderId;
410
+ if (v && f.has(v)) {
411
+ const T = f.get(v);
412
+ T.items.push(n), T.hasAnyItems = !0;
410
413
  } else
411
- S.push(a);
414
+ b.push(n);
412
415
  }
413
- for (const a of m.values())
414
- if (a.hasAnyItems) {
415
- let x = a.folder;
416
- for (; x.parentId; ) {
417
- const T = m.get(x.parentId);
416
+ for (const n of f.values())
417
+ if (n.hasAnyItems) {
418
+ let v = n.folder;
419
+ for (; v.parentId; ) {
420
+ const T = f.get(v.parentId);
418
421
  if (T)
419
- T.hasAnyItems = !0, x = T.folder;
422
+ T.hasAnyItems = !0, v = T.folder;
420
423
  else
421
424
  break;
422
425
  }
423
426
  }
424
- const r = (a, x, T = []) => ({
425
- id: a.id,
426
- name: a.label,
427
- label: a.label,
427
+ const i = (n, v, T = []) => ({
428
+ id: n.id,
429
+ name: n.label,
430
+ label: n.label,
428
431
  ...T.length > 0 && { parents: T },
429
- icon: Ue(a),
432
+ icon: Je(n),
430
433
  subRows: [],
431
434
  data: {
432
- id: a.id,
433
- name: a.label,
434
- label: a.label,
435
- entityType: a.entityType,
436
- listId: a.id,
435
+ id: n.id,
436
+ name: n.label,
437
+ label: n.label,
438
+ entityType: n.entityType,
439
+ listId: n.id,
437
440
  // for sorting
438
- active: a.active,
439
- createdAt: a.createdAt,
440
- updatedAt: a.updatedAt
441
+ active: n.active,
442
+ createdAt: n.createdAt,
443
+ updatedAt: n.updatedAt
441
444
  }
442
- }), u = (a) => a.sort((x, T) => {
443
- const v = p.findIndex((K) => K.id === x.id), D = p.findIndex((K) => K.id === T.id);
444
- return v === -1 && D === -1 ? x.folder.label.localeCompare(T.folder.label) : v === -1 ? 1 : D === -1 ? -1 : v - D;
445
- }), o = (a) => {
446
- const x = a.items.map((T) => T.id);
447
- for (const T of a.children.values())
448
- x.push(...o(T));
449
- return x;
450
- }, i = Wt({
451
- folderNodes: m,
452
- rootFolderIds: g,
445
+ }), I = (n) => n.sort((v, T) => {
446
+ const x = p.findIndex((Y) => Y.id === v.id), D = p.findIndex((Y) => Y.id === T.id);
447
+ return x === -1 && D === -1 ? v.folder.label.localeCompare(T.folder.label) : x === -1 ? 1 : D === -1 ? -1 : x - D;
448
+ }), r = (n) => {
449
+ const v = n.items.map((T) => T.id);
450
+ for (const T of n.children.values())
451
+ v.push(...r(T));
452
+ return v;
453
+ }, d = an({
454
+ folderNodes: f,
455
+ rootFolderIds: h,
453
456
  showEmptyFolders: !1,
454
- buildFolderRowId: vn,
455
- createItemRow: r,
456
- sortFolderNodes: u,
457
- sortItems: ke,
458
- getFolderLabel: (a) => a.label,
459
- getFolderIcon: (a) => a.data?.icon || Tn,
460
- getFolderColor: (a) => a.data?.color,
461
- getItemCount: (a) => a.items.length + Array.from(a.children.values()).reduce((x, T) => x + T.items.length, 0)
457
+ buildFolderRowId: Pn,
458
+ createItemRow: i,
459
+ sortFolderNodes: I,
460
+ sortItems: Ne,
461
+ getFolderLabel: (n) => n.label,
462
+ getFolderIcon: (n) => n.data?.icon || _n,
463
+ getFolderColor: (n) => n.data?.color,
464
+ getItemCount: (n) => n.items.length + Array.from(n.children.values()).reduce((v, T) => v + T.items.length, 0)
462
465
  });
463
- for (const a of i) {
464
- if (a.id.startsWith(fe + "-")) {
465
- const T = a.id.substring((fe + "-").length), v = m.get(T);
466
- v && (a.data = { ...a.data, childListIds: o(v) });
466
+ for (const n of d) {
467
+ if (n.id.startsWith(ge + "-")) {
468
+ const T = n.id.substring((ge + "-").length), x = f.get(T);
469
+ x && (n.data = { ...n.data, childListIds: r(x) });
467
470
  }
468
- const x = [...a.subRows || []];
469
- for (; x.length > 0; ) {
470
- const T = x.shift();
471
- if (T.id.startsWith(fe + "-")) {
472
- const v = T.id.substring((fe + "-").length), D = m.get(v);
473
- D && (T.data = { ...T.data, childListIds: o(D) });
471
+ const v = [...n.subRows || []];
472
+ for (; v.length > 0; ) {
473
+ const T = v.shift();
474
+ if (T.id.startsWith(ge + "-")) {
475
+ const x = T.id.substring((ge + "-").length), D = f.get(x);
476
+ D && (T.data = { ...T.data, childListIds: r(D) });
474
477
  }
475
- T.subRows && x.push(...T.subRows);
478
+ T.subRows && v.push(...T.subRows);
476
479
  }
477
480
  }
478
- const b = ke(S).map((a) => r(a));
479
- return [...i, ...b];
481
+ const o = Ne(b).map((n) => i(n));
482
+ return [...d, ...o];
480
483
  }
481
- return ke(C).map((m) => ({
482
- id: m.id,
483
- name: m.label,
484
- label: m.label,
485
- icon: Ue(m),
484
+ return Ne(C).map((f) => ({
485
+ id: f.id,
486
+ name: f.label,
487
+ label: f.label,
488
+ icon: Je(f),
486
489
  subRows: [],
487
490
  data: {
488
- id: m.id,
489
- name: m.label,
490
- label: m.label,
491
- entityType: m.entityType,
492
- listId: m.id,
493
- active: m.active,
494
- createdAt: m.createdAt,
495
- updatedAt: m.updatedAt
491
+ id: f.id,
492
+ name: f.label,
493
+ label: f.label,
494
+ entityType: f.entityType,
495
+ listId: f.id,
496
+ active: f.active,
497
+ createdAt: f.createdAt,
498
+ updatedAt: f.updatedAt
496
499
  }
497
500
  }));
498
- }, [s, n, p]), f = n && p.length > 0;
501
+ }, [a, s, p]), m = s && p.length > 0;
499
502
  return {
500
- getData: N(async () => l, [l]),
501
- isLoading: d || c || h,
502
- isExpandable: f
503
+ getData: O(async () => l, [l]),
504
+ isLoading: u || c || g,
505
+ isExpandable: m
503
506
  };
504
- }, xn = (e, t, n, s) => e.id === "noValue" ? t.get(Ye)?.count ?? (s ? 0 : void 0) : e.id === "hasValue" ? s ? n : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (s ? 0 : void 0), ot = (e, t, n, s) => t ? e.map((d) => {
505
- const c = xn(d, t, n, s);
507
+ }, Nn = (e, t, s, a) => e.id === "noValue" ? t.get(at)?.count ?? (a ? 0 : void 0) : e.id === "hasValue" ? a ? s : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (a ? 0 : void 0), ht = (e, t, s, a) => t ? e.map((u) => {
508
+ const c = Nn(u, t, s, a);
506
509
  return {
507
- ...d,
508
- badge: c != null ? String(c) : d.badge,
509
- subRows: d.subRows?.length ? ot(d.subRows, t, n, s) : d.subRows
510
+ ...u,
511
+ badge: c != null ? String(c) : u.badge,
512
+ subRows: u.subRows?.length ? ht(u.subRows, t, s, a) : u.subRows
510
513
  };
511
- }) : e, Cn = (e) => ({
514
+ }) : e, Fn = (e) => ({
512
515
  id: "noValue",
513
516
  name: "noValue",
514
517
  label: `No ${e}`,
@@ -517,7 +520,7 @@ const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) =>
517
520
  data: {
518
521
  id: "noValue"
519
522
  }
520
- }), Ln = (e) => ({
523
+ }), jn = (e) => ({
521
524
  id: "hasValue",
522
525
  name: "hasValue",
523
526
  label: `Some ${e}`,
@@ -526,7 +529,7 @@ const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) =>
526
529
  data: {
527
530
  id: "hasValue"
528
531
  }
529
- }), He = [
532
+ }), et = [
530
533
  {
531
534
  label: "Hierarchy",
532
535
  value: "hierarchy",
@@ -545,17 +548,17 @@ const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) =>
545
548
  {
546
549
  label: "Task Type",
547
550
  value: "taskType",
548
- icon: Ee("task")
551
+ icon: _e("task")
549
552
  },
550
553
  {
551
554
  label: "Folder Type",
552
555
  value: "folderType",
553
- icon: Ee("folder")
556
+ icon: _e("folder")
554
557
  },
555
558
  {
556
559
  label: "Product Type",
557
560
  value: "productType",
558
- icon: Ee("product")
561
+ icon: _e("product")
559
562
  },
560
563
  {
561
564
  label: "Author",
@@ -567,191 +570,191 @@ const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) =>
567
570
  value: "entityList",
568
571
  icon: "list_alt"
569
572
  }
570
- ], wn = ({
573
+ ], $n = ({
571
574
  sliceFields: e,
572
575
  usedSliceTypes: t = [],
573
- entityTypes: n = [],
574
- counts: s,
575
- filled: d = 0,
576
+ entityTypes: s = [],
577
+ counts: a,
578
+ filled: u = 0,
576
579
  countsComplete: c = !1,
577
580
  sliceType: p,
578
- onSliceTypeChange: h,
581
+ onSliceTypeChange: g,
579
582
  sort: l
580
583
  }) => {
581
584
  const {
582
- sliceType: f,
585
+ sliceType: m,
583
586
  onSliceTypeChange: y,
584
587
  useExtraSlices: C,
585
- isLoadingExtraSlices: m
586
- } = Me(), g = p ?? f, S = h ?? y, { projectName: r } = me(), { formatAttribute: u } = C(), o = e.filter((I) => He.some((A) => A.value === I.value)).map((I) => ({
587
- ...He.find((O) => O.value === I.value),
588
- ...I
589
- })), i = e.some((I) => I.value === "attributes"), b = g?.startsWith("attrib.") ? g.slice(7) : void 0, a = M(
590
- () => b ? [b] : [],
591
- [b]
592
- ), { attributes: x, isLoading: T } = Sn({
593
- entityTypes: n,
594
- request: a
588
+ isLoadingExtraSlices: f
589
+ } = $e(), h = p ?? m, b = g ?? y, { projectName: i } = ye(), { formatAttribute: I } = C(), r = e.filter((w) => et.some((k) => k.value === w.value)).map((w) => ({
590
+ ...et.find((F) => F.value === w.value),
591
+ ...w
592
+ })), d = e.some((w) => w.value === "attributes"), o = h?.startsWith("attrib.") ? h.slice(7) : void 0, n = _(
593
+ () => o ? [o] : [],
594
+ [o]
595
+ ), { attributes: v, isLoading: T } = Mn({
596
+ entityTypes: s,
597
+ request: n
595
598
  });
596
- i && typeof u == "function" && x.forEach(
597
- (I) => o.push({
598
- label: I.data.title || I.name,
599
- value: "attrib." + I.name,
600
- icon: Bt(I.name, I.data.type, Qe(I.data))
599
+ d && typeof I == "function" && v.forEach(
600
+ (w) => r.push({
601
+ label: w.data.title || w.name,
602
+ value: "attrib." + w.name,
603
+ icon: nn(w.name, w.data.type, it(w.data))
601
604
  })
602
605
  );
603
- const [v, D] = z(!1), ae = !!x.find((I) => I.name === b)?.enumIsLoading, {
604
- project: oe,
605
- getStatuses: Z,
606
- getTypes: ie,
607
- getTaskTypes: re,
608
- getProductTypes: q,
609
- getAttribute: ee,
610
- isLoading: V
611
- } = bn({ scopes: n, useExtraSlices: C }), {
612
- data: le,
613
- getData: te,
606
+ const [x, D] = z(!1), ue = !!v.find((w) => w.name === o)?.enumIsLoading, {
607
+ project: pe,
608
+ getStatuses: ne,
609
+ getTypes: me,
610
+ getTaskTypes: se,
611
+ getProductTypes: oe,
612
+ getAttribute: Q,
613
+ isLoading: W
614
+ } = An({ scopes: s, useExtraSlices: C }), {
615
+ data: J,
616
+ getData: ae,
614
617
  isFetching: L
615
- } = Ot({
616
- projectName: r || "",
617
- folderTypes: oe?.folderTypes || [],
618
+ } = Gt({
619
+ projectName: i || "",
620
+ folderTypes: pe?.folderTypes || [],
618
621
  includeColors: !0
619
- }), { getData: R, isLoading: k } = yn({
620
- projectName: r,
622
+ }), { getData: A, isLoading: R } = kn({
623
+ projectName: i,
621
624
  useExtraSlices: C
622
625
  }), {
623
- getData: Q,
624
- isLoading: he,
625
- isExpandable: xe
626
- } = In(g === "entityList"), J = L || V || k || m && g !== "hierarchy" || he && g === "entityList" || T || ae, B = {
626
+ getData: ee,
627
+ isLoading: be,
628
+ isExpandable: Ce
629
+ } = On(h === "entityList"), te = L || W || R || f && h !== "hierarchy" || be && h === "entityList" || T || ue, X = {
627
630
  hierarchy: {
628
- getData: te,
631
+ getData: ae,
629
632
  isLoading: L,
630
633
  isExpandable: !0
631
634
  },
632
635
  assignees: {
633
- getData: R,
634
- isLoading: k,
636
+ getData: A,
637
+ isLoading: R,
635
638
  isExpandable: !1,
636
639
  noValue: !0,
637
640
  hasValue: !0
638
641
  },
639
642
  author: {
640
- getData: R,
641
- isLoading: k,
643
+ getData: A,
644
+ isLoading: R,
642
645
  isExpandable: !1
643
646
  },
644
647
  status: {
645
- getData: Z,
646
- isLoading: V,
648
+ getData: ne,
649
+ isLoading: W,
647
650
  isExpandable: !1
648
651
  },
649
652
  type: {
650
- getData: ie,
651
- isLoading: V,
653
+ getData: me,
654
+ isLoading: W,
652
655
  isExpandable: !0
653
656
  },
654
657
  taskType: {
655
- getData: re,
656
- isLoading: V,
658
+ getData: se,
659
+ isLoading: W,
657
660
  isExpandable: !1
658
661
  },
659
662
  productType: {
660
- getData: q,
663
+ getData: oe,
661
664
  isLoading: !1,
662
665
  isExpandable: !1
663
666
  },
664
667
  entityList: {
665
- getData: Q,
666
- isLoading: he,
667
- isExpandable: xe
668
+ getData: ee,
669
+ isLoading: be,
670
+ isExpandable: Ce
668
671
  }
669
672
  };
670
- for (const I of x)
671
- B["attrib." + I.name] = {
672
- getData: () => ee(I),
673
- isLoading: T || !!I.enumIsLoading,
673
+ for (const w of v)
674
+ X["attrib." + w.name] = {
675
+ getData: () => Q(w),
676
+ isLoading: T || !!w.enumIsLoading,
674
677
  isExpandable: !1,
675
678
  isAttribute: !0
676
679
  };
677
- const Y = { data: [], isExpandable: !1 }, [P, ge] = z(Y), G = B[g], ne = o.find(
678
- (I) => B[I.value] && !t.includes(I.value)
680
+ const ie = { data: [], isExpandable: !1 }, [B, P] = z(ie), K = X[h], re = r.find(
681
+ (w) => X[w.value] && !t.includes(w.value)
679
682
  )?.value;
680
- se(() => {
681
- J || G || !ne || S(ne, !1);
682
- }, [J, G, ne]);
683
- const ce = (I, A) => {
684
- const O = B[I];
685
- if (!O) {
686
- console.warn(`Slice type ${I} not found`);
683
+ de(() => {
684
+ te || K || !re || b(re, !1);
685
+ }, [te, K, re]);
686
+ const Le = (w, k) => {
687
+ const F = X[w];
688
+ if (!F) {
689
+ console.warn(`Slice type ${w} not found`);
687
690
  return;
688
691
  }
689
- (O.isAttribute && i || e.some(($) => $.value === I)) && S(I, A);
692
+ (F.isAttribute && d || e.some((le) => le.value === w)) && b(w, k);
690
693
  };
691
- se(() => {
692
- if (J) return;
694
+ de(() => {
695
+ if (te) return;
693
696
  (async () => {
694
697
  try {
695
- if (!G) return;
698
+ if (!K) return;
696
699
  D(!0);
697
- const A = await G.getData();
698
- if (A === void 0)
700
+ const k = await K.getData();
701
+ if (k === void 0)
699
702
  throw window.alert(
700
703
  "Slice options failed to load. This likely means the PowerFeatures addon is out of date. Please update to the latest version."
701
- ), S(ne ?? "hierarchy", !1), new Error("Slice data is undefined");
702
- G.hasValue && A.unshift(Ln(g)), G.noValue && A.unshift(Cn(g)), ge({
703
- data: A,
704
- isExpandable: G.isExpandable
704
+ ), b(re ?? "hierarchy", !1), new Error("Slice data is undefined");
705
+ K.hasValue && k.unshift(jn(h)), K.noValue && k.unshift(Fn(h)), P({
706
+ data: k,
707
+ isExpandable: K.isExpandable
705
708
  });
706
- } catch (A) {
707
- console.error("Error fetching slice data:", A), ge(Y);
709
+ } catch (k) {
710
+ console.error("Error fetching slice data:", k), P(ie);
708
711
  } finally {
709
712
  D(!1);
710
713
  }
711
714
  })();
712
- }, [g, r, J, g === "hierarchy" ? le : null]);
713
- const de = l?.by, F = !!l?.desc, j = M(
714
- () => de ? on(P.data, g, { by: de, desc: F }) : P.data,
715
- [P.data, g, de, F]
716
- ), ye = M(
717
- () => ot(j, s, d, c),
718
- [j, s, d, c]
719
- ), be = M(() => {
720
- const I = /* @__PURE__ */ new Map(), A = [...ye];
721
- for (; A.length > 0; ) {
722
- const O = A.shift();
723
- if (O && (I.set(O.id, O), O.subRows && O.subRows.length > 0))
724
- for (const $ of O.subRows)
725
- A.push($);
715
+ }, [h, i, te, h === "hierarchy" ? J : null]);
716
+ const Z = l?.by, Se = !!l?.desc, N = _(
717
+ () => Z ? Sn(B.data, h, { by: Z, desc: Se }) : B.data,
718
+ [B.data, h, Z, Se]
719
+ ), j = _(
720
+ () => ht(N, a, u, c),
721
+ [N, a, u, c]
722
+ ), Ve = _(() => {
723
+ const w = /* @__PURE__ */ new Map(), k = [...j];
724
+ for (; k.length > 0; ) {
725
+ const F = k.shift();
726
+ if (F && (w.set(F.id, F), F.subRows && F.subRows.length > 0))
727
+ for (const le of F.subRows)
728
+ k.push(le);
726
729
  }
727
- return I;
728
- }, [ye]);
730
+ return w;
731
+ }, [j]);
729
732
  return {
730
- sliceOptions: o,
731
- table: { ...P, data: ye },
732
- sliceMap: be,
733
- isLoading: B[g] && B[g].isLoading || v || J,
734
- sliceType: g,
735
- handleSliceTypeChange: ce
733
+ sliceOptions: r,
734
+ table: { ...B, data: j },
735
+ sliceMap: Ve,
736
+ isLoading: X[h] && X[h].isLoading || x || te,
737
+ sliceType: h,
738
+ handleSliceTypeChange: Le
736
739
  };
737
- }, En = /* @__PURE__ */ new Map(), Dn = (e, t, n, s) => {
738
- const d = M(() => ({ id: t, desc: !1 }), [t]), c = M(
739
- () => (n ?? []).filter((S) => S !== t).map((S) => ({ id: S, desc: !1 })),
740
- [n, t]
741
- ), p = !!s || !e, h = e?.entity === "version" ? { entity: "version", groupBy: d, extraGroupBys: c, args: e.args, skip: p } : {
740
+ }, zn = /* @__PURE__ */ new Map(), Un = (e, t, s, a) => {
741
+ const u = _(() => ({ id: t, desc: !1 }), [t]), c = _(
742
+ () => (s ?? []).filter((b) => b !== t).map((b) => ({ id: b, desc: !1 })),
743
+ [s, t]
744
+ ), p = !!a || !e, g = e?.entity === "version" ? { entity: "version", groupBy: u, extraGroupBys: c, args: e.args, skip: p } : {
742
745
  entity: "task",
743
- groupBy: d,
746
+ groupBy: u,
744
747
  extraGroupBys: c,
745
748
  args: e?.args ?? { projectName: "" },
746
749
  skip: p
747
- }, { counts: l, total: f, complete: y } = Gt(h), C = l?.get(Ye)?.count ?? 0, m = Math.max(f - C, 0);
750
+ }, { counts: l, total: m, complete: y } = on(g), C = l?.get(at)?.count ?? 0, f = Math.max(m - C, 0);
748
751
  return {
749
- counts: p ? void 0 : l ?? (y ? En : void 0),
750
- total: f,
751
- filled: m,
752
+ counts: p ? void 0 : l ?? (y ? zn : void 0),
753
+ total: m,
754
+ filled: f,
752
755
  complete: !p && y
753
756
  };
754
- }, Rn = U.div`
757
+ }, Bn = U.div`
755
758
  display: flex;
756
759
  align-items: center;
757
760
 
@@ -759,27 +762,27 @@ const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) =>
759
762
  flex: 1;
760
763
  min-width: 0;
761
764
  }
762
- `, kn = U(Tt)`
765
+ `, Vn = U(kt)`
763
766
  flex: 1;
764
767
  min-width: 0;
765
768
  height: 28px;
766
769
  min-height: 28px;
767
- `, An = ({ open: e, value: t, subject: n, onChange: s }) => {
768
- const d = () => s(e ? void 0 : ""), c = (h) => {
769
- h.key === "Escape" && s(void 0);
770
- }, p = (h) => {
771
- const l = Lt(h.clipboardData.getData("text"));
770
+ `, Hn = ({ open: e, value: t, subject: s, onChange: a }) => {
771
+ const u = () => a(e ? void 0 : ""), c = (g) => {
772
+ g.key === "Escape" && a(void 0);
773
+ }, p = (g) => {
774
+ const l = Ot(g.clipboardData.getData("text"));
772
775
  if (l === null) return;
773
- h.preventDefault();
774
- const f = h.currentTarget, y = f.selectionStart ?? t.length, C = f.selectionEnd ?? t.length, m = y + l.length;
775
- s(t.slice(0, y) + l + t.slice(C)), requestAnimationFrame(() => f.setSelectionRange(m, m));
776
+ g.preventDefault();
777
+ const m = g.currentTarget, y = m.selectionStart ?? t.length, C = m.selectionEnd ?? t.length, f = y + l.length;
778
+ a(t.slice(0, y) + l + t.slice(C)), requestAnimationFrame(() => m.setSelectionRange(f, f));
776
779
  };
777
- return /* @__PURE__ */ H(Rn, { className: W({ open: e }), children: [
780
+ return /* @__PURE__ */ G(Bn, { className: q({ open: e }), children: [
778
781
  e && /* @__PURE__ */ E(
779
- kn,
782
+ Vn,
780
783
  {
781
784
  value: t,
782
- onChange: (h) => s(h.target.value),
785
+ onChange: (g) => a(g.target.value),
783
786
  placeholder: "Search",
784
787
  autoFocus: !0,
785
788
  onKeyDown: c,
@@ -787,75 +790,75 @@ const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) =>
787
790
  }
788
791
  ),
789
792
  /* @__PURE__ */ E(
790
- pe,
793
+ he,
791
794
  {
792
795
  icon: e ? "close" : "search",
793
- onClick: d,
794
- className: W({ open: e }),
795
- "data-tooltip": e ? "Close search" : `Search ${n}`
796
+ onClick: u,
797
+ className: q({ open: e }),
798
+ "data-tooltip": e ? "Close search" : `Search ${s}`
796
799
  }
797
800
  )
798
801
  ] });
799
- }, Ae = (e, t) => {
800
- e.toggleExpanded(t), e.subRows?.forEach((n) => Ae(n, t));
801
- }, Ge = (e) => e.map((t) => t.id).filter(Boolean), _n = (e, t, n, s) => {
802
- const { onOpenNew: d } = Qt(), { projectName: c } = me(), { setEntities: p } = kt(), h = Jt(), [l] = Je(), { deleteEntities: f } = At(), [y, C] = z(null), m = N(
803
- (u, o) => o.map((i) => t?.get(i) || (i === u.id ? u : void 0)).filter((i) => !!i),
802
+ }, Fe = (e, t) => {
803
+ e.toggleExpanded(t), e.subRows?.forEach((s) => Fe(s, t));
804
+ }, tt = (e) => e.map((t) => t.id).filter(Boolean), Gn = (e, t, s, a) => {
805
+ const { onOpenNew: u } = dn(), { projectName: c } = ye(), { setEntities: p } = zt(), g = un(), [l] = rt(), { deleteEntities: m } = Ut(), [y, C] = z(null), f = O(
806
+ (r, d) => d.map((o) => t?.get(o) || (o === r.id ? r : void 0)).filter((o) => !!o),
804
807
  [t]
805
- ), g = M(
808
+ ), h = _(
806
809
  () => ({
807
- onShowDetails: (u, o = [u.id]) => {
810
+ onShowDetails: (r, d = [r.id]) => {
808
811
  p({
809
812
  entityType: "folder",
810
- entities: o.map((i) => ({ id: i, projectName: c }))
813
+ entities: d.map((o) => ({ id: o, projectName: c }))
811
814
  });
812
815
  },
813
816
  onAddToList: e,
814
- onMove: (u) => {
815
- s?.({
816
- entities: u.map((o) => ({
817
- entityId: o.id,
818
- entityType: o.data?.entityType === "task" ? "task" : "folder",
819
- currentParentId: o.parentId || o.data?.parentId
817
+ onMove: (r) => {
818
+ a?.({
819
+ entities: r.map((d) => ({
820
+ entityId: d.id,
821
+ entityType: d.data?.entityType === "task" ? "task" : "folder",
822
+ currentParentId: d.parentId || d.data?.parentId
820
823
  }))
821
824
  });
822
825
  },
823
- onRename: (u) => C(u),
824
- onOpenViewer: (u) => n?.(u, c),
825
- onUploadVersion: (u) => {
826
- const o = u.data?.entityType === "task", i = o ? u.parentId || u.data?.parentId : u.id;
827
- i && h?.onOpenVersionUpload({
828
- folderId: i,
829
- taskId: o ? u.id : void 0
826
+ onRename: (r) => C(r),
827
+ onOpenViewer: (r) => s?.(r, c),
828
+ onUploadVersion: (r) => {
829
+ const d = r.data?.entityType === "task", o = d ? r.parentId || r.data?.parentId : r.id;
830
+ o && g?.onOpenVersionUpload({
831
+ folderId: o,
832
+ taskId: d ? r.id : void 0
830
833
  });
831
834
  },
832
- onDelete: (u) => {
833
- const o = u.map((i) => {
834
- const b = i.data?.entityType === "task" ? "task" : "folder", a = i.parentId || i.data?.parentId;
835
+ onDelete: (r) => {
836
+ const d = r.map((o) => {
837
+ const n = o.data?.entityType === "task" ? "task" : "folder", v = o.parentId || o.data?.parentId;
835
838
  return {
836
- id: i.id,
837
- entityType: b,
838
- name: i.name,
839
- label: i.label,
839
+ id: o.id,
840
+ entityType: n,
841
+ name: o.name,
842
+ label: o.label,
840
843
  projectName: c,
841
- folderId: b === "task" ? a : void 0,
842
- parentId: b === "folder" ? a : void 0
844
+ folderId: n === "task" ? v : void 0,
845
+ parentId: n === "folder" ? v : void 0
843
846
  };
844
847
  });
845
- f(o);
848
+ m(d);
846
849
  }
847
850
  }),
848
851
  [
849
852
  e,
850
- n,
851
853
  s,
854
+ a,
852
855
  c,
853
856
  p,
854
- f,
855
- h
857
+ m,
858
+ g
856
859
  ]
857
- ), S = N(
858
- (u) => {
860
+ ), b = O(
861
+ (r) => {
859
862
  y && (l({
860
863
  projectName: c,
861
864
  operationsRequestModel: {
@@ -864,101 +867,104 @@ const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) =>
864
867
  type: "update",
865
868
  entityType: y.data?.entityType === "task" ? "task" : "folder",
866
869
  entityId: y.id,
867
- data: { label: u }
870
+ data: { label: r }
868
871
  }
869
872
  ]
870
873
  }
871
874
  }), C(null));
872
875
  },
873
876
  [c, y, l]
874
- );
875
- return {
876
- rowContextMenuBuilders: M(
877
- () => [
878
- (u, { row: o, selectedRows: i }) => ({
879
- label: "Show details",
880
- icon: "dock_to_left",
881
- shortcut: qt("click", [Yt.Alt]),
882
- command: () => g.onShowDetails(o.original, i)
883
- }),
884
- (u, { row: o }) => ({
885
- label: "Rename label",
886
- icon: "titlecase",
887
- shortcut: "R",
888
- command: () => g.onRename(o.original)
889
- }),
890
- (u, { row: o }) => ({
891
- label: "Open in viewer",
892
- icon: "play_circle",
893
- command: () => g.onOpenViewer(o.original),
894
- hidden: !n
895
- }),
896
- (u, { selectedTableRows: o }) => ({
897
- label: "Expand all children",
898
- icon: "expand_all",
899
- command: () => o.filter((i) => i.getCanExpand() && !i.getIsExpanded()).forEach((i) => Ae(i, !0)),
900
- hidden: !o.some(
901
- (i) => i.getCanExpand() && !i.getIsExpanded()
877
+ ), i = _(
878
+ () => [
879
+ (r, { row: d, selectedRows: o }) => ({
880
+ label: "Show details",
881
+ icon: "dock_to_left",
882
+ shortcut: ln("click", [cn.Alt]),
883
+ command: () => h.onShowDetails(d.original, o)
884
+ }),
885
+ (r, { row: d }) => ({
886
+ label: "Rename label",
887
+ icon: "titlecase",
888
+ shortcut: "R",
889
+ command: () => h.onRename(d.original)
890
+ }),
891
+ (r, { row: d }) => ({
892
+ label: "Open in viewer",
893
+ icon: "play_circle",
894
+ command: () => h.onOpenViewer(d.original),
895
+ hidden: !s
896
+ }),
897
+ (r, { selectedTableRows: d }) => ({
898
+ label: "Expand all children",
899
+ icon: "expand_all",
900
+ command: () => d.filter((o) => o.getCanExpand() && !o.getIsExpanded()).forEach((o) => Fe(o, !0)),
901
+ hidden: !d.some(
902
+ (o) => o.getCanExpand() && !o.getIsExpanded()
903
+ )
904
+ }),
905
+ (r, { selectedTableRows: d }) => ({
906
+ label: "Collapse all children",
907
+ icon: "collapse_all",
908
+ command: () => d.filter((o) => o.getCanExpand() && o.getIsExpanded()).forEach((o) => Fe(o, !1)),
909
+ hidden: !d.some(
910
+ (o) => o.getCanExpand() && o.getIsExpanded()
911
+ )
912
+ }),
913
+ (r, { row: d, selectedRows: o }) => {
914
+ const n = h.onAddToList?.(d.original, o);
915
+ return n ? Array.isArray(n) ? n : [n] : void 0;
916
+ },
917
+ (r, { row: d }) => ({
918
+ label: "Upload version",
919
+ icon: "upload",
920
+ command: () => h.onUploadVersion(d.original)
921
+ }),
922
+ (r, { row: d, selectedRows: o }) => ({
923
+ label: "Move",
924
+ icon: "drive_file_move",
925
+ command: () => h.onMove(f(d.original, o)),
926
+ hidden: !a
927
+ }),
928
+ (r, { row: d, selectedRows: o }) => ({
929
+ label: ve.folder.createLabel,
930
+ icon: ve.folder.icon,
931
+ command: () => u?.("folder", {
932
+ parentFolderIds: tt(
933
+ f(d.original, o)
902
934
  )
903
- }),
904
- (u, { selectedTableRows: o }) => ({
905
- label: "Collapse all children",
906
- icon: "collapse_all",
907
- command: () => o.filter((i) => i.getCanExpand() && i.getIsExpanded()).forEach((i) => Ae(i, !1)),
908
- hidden: !o.some(
909
- (i) => i.getCanExpand() && i.getIsExpanded()
935
+ })
936
+ }),
937
+ (r, { row: d, selectedRows: o }) => ({
938
+ label: ve.task.createLabel,
939
+ icon: ve.task.icon,
940
+ command: () => u?.("task", {
941
+ parentFolderIds: tt(
942
+ f(d.original, o)
910
943
  )
911
- }),
912
- (u, { row: o, selectedRows: i }) => {
913
- const b = g.onAddToList?.(o.original, i);
914
- return b ? Array.isArray(b) ? b : [b] : void 0;
915
- },
916
- (u, { row: o }) => ({
917
- label: "Upload version",
918
- icon: "upload",
919
- command: () => g.onUploadVersion(o.original)
920
- }),
921
- (u, { row: o, selectedRows: i }) => ({
922
- label: "Move",
923
- icon: "drive_file_move",
924
- command: () => g.onMove(m(o.original, i)),
925
- hidden: !s
926
- }),
927
- (u, { row: o, selectedRows: i }) => ({
928
- label: Te.folder.createLabel,
929
- icon: Te.folder.icon,
930
- command: () => d?.("folder", {
931
- parentFolderIds: Ge(
932
- m(o.original, i)
933
- )
934
- })
935
- }),
936
- (u, { row: o, selectedRows: i }) => ({
937
- label: Te.task.createLabel,
938
- icon: Te.task.icon,
939
- command: () => d?.("task", {
940
- parentFolderIds: Ge(
941
- m(o.original, i)
942
- )
943
- })
944
- }),
945
- (u, { row: o, selectedRows: i }) => ({
946
- label: "Delete",
947
- icon: "delete",
948
- danger: !0,
949
- command: () => g.onDelete(m(o.original, i))
950
944
  })
951
- ],
952
- [g, m, d]
953
- ),
954
- onOptionClick: g.onShowDetails,
955
- onRename: g.onRename,
945
+ })
946
+ ],
947
+ [h, f, u]
948
+ ), I = O(
949
+ (r, { row: d, selectedRows: o }) => ({
950
+ label: "Delete",
951
+ icon: "delete",
952
+ danger: !0,
953
+ command: () => h.onDelete(f(d.original, o))
954
+ }),
955
+ [h, f]
956
+ );
957
+ return {
958
+ rowContextMenuBuilders: i,
959
+ deleteContextMenuBuilder: I,
960
+ onOptionClick: h.onShowDetails,
961
+ onRename: h.onRename,
956
962
  renamingRow: y,
957
963
  renameInitialValue: y?.label || y?.name || "",
958
- onSubmitRename: S,
964
+ onSubmitRename: b,
959
965
  onCancelRename: () => C(null)
960
966
  };
961
- }, Mn = U(vt)`
967
+ }, Wn = U(At)`
962
968
  /* put above the menu so it's still clickable */
963
969
  /* NOTE: this will need fixing as this also puts it above dialogs */
964
970
  /* z-index: 1001; */
@@ -1011,82 +1017,82 @@ U.div`
1011
1017
  font-weight: 600;
1012
1018
  }
1013
1019
  `;
1014
- const Pn = (e, t, n) => {
1015
- const s = `${t}${n === 1 ? "" : "s"}`;
1016
- return e === "created" ? `new ${s}` : e === "deleted" ? `${s} deleted` : `${n} ${s} ${e.replaceAll("_", " ")}`;
1017
- }, On = (e) => {
1020
+ const Kn = (e, t, s) => {
1021
+ const a = `${t}${s === 1 ? "" : "s"}`;
1022
+ return e === "created" ? `new ${a}` : e === "deleted" ? `${a} deleted` : `${s} ${a} ${e.replaceAll("_", " ")}`;
1023
+ }, qn = (e) => {
1018
1024
  const t = /* @__PURE__ */ new Map();
1019
- return e.forEach((s) => {
1020
- const [, d, c] = s.topic.split(".");
1021
- if (!d || !c) return;
1022
- const p = `${d}.${c}`, h = t.get(p) || {
1023
- entityType: d,
1025
+ return e.forEach((a) => {
1026
+ const [, u, c] = a.topic.split(".");
1027
+ if (!u || !c) return;
1028
+ const p = `${u}.${c}`, g = t.get(p) || {
1029
+ entityType: u,
1024
1030
  updateType: c,
1025
1031
  ids: /* @__PURE__ */ new Set()
1026
1032
  };
1027
- h.ids.add(s.entityId || String(s.id)), t.set(p, h);
1033
+ g.ids.add(a.entityId || String(a.id)), t.set(p, g);
1028
1034
  }), `${Array.from(t.values()).map(
1029
- ({ entityType: s, updateType: d, ids: c }) => Pn(d, s, c.size)
1035
+ ({ entityType: a, updateType: u, ids: c }) => Kn(u, a, c.size)
1030
1036
  ).join(", ")} since last sync`;
1031
- }, Nn = ft(
1032
- ({ projectNames: e, topics: t, onSync: n, shouldSyncOnUpdate: s, hideWhenNoUpdates: d = !1, ...c }, p) => {
1033
- const [h, l] = z(!1), [f, y] = _t(), { setMenuOpen: C } = Ze(), m = Ie(null), g = Ie(), S = mt();
1034
- se(() => () => {
1035
- const v = g.current;
1036
- g.current = void 0, v !== void 0 && clearTimeout(v);
1037
- }, []), ht(p, () => m.current, []);
1038
- const r = async () => {
1037
+ }, Yn = It(
1038
+ ({ projectNames: e, topics: t, onSync: s, shouldSyncOnUpdate: a, hideWhenNoUpdates: u = !1, ...c }, p) => {
1039
+ const [g, l] = z(!1), [m, y] = Bt(), { setMenuOpen: C } = ct(), f = xe(null), h = xe(), b = xt();
1040
+ de(() => () => {
1041
+ const x = h.current;
1042
+ h.current = void 0, x !== void 0 && clearTimeout(x);
1043
+ }, []), Ct(p, () => f.current, []);
1044
+ const i = async () => {
1039
1045
  l(!0);
1040
1046
  try {
1041
- await n?.(u);
1047
+ await s?.(I);
1042
1048
  } finally {
1043
1049
  l(!1);
1044
1050
  }
1045
- }, { updates: u, hasUpdates: o } = Mt({
1051
+ }, { updates: I, hasUpdates: r } = Vt({
1046
1052
  projectNames: e,
1047
1053
  topics: t,
1048
- isSyncing: h,
1049
- shouldSyncOnUpdate: s
1054
+ isSyncing: g,
1055
+ shouldSyncOnUpdate: a
1050
1056
  });
1051
- if (se(() => {
1052
- const v = (D) => {
1053
- D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" || Kt(D) || (D.preventDefault(), D.stopPropagation(), r());
1057
+ if (de(() => {
1058
+ const x = (D) => {
1059
+ D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" || rn(D) || (D.preventDefault(), D.stopPropagation(), i());
1054
1060
  };
1055
- return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
1056
- }, [r]), d && !o) return null;
1057
- const i = On(u), b = Object.values(f).some(Boolean);
1058
- Object.values(f).every(Boolean);
1059
- const a = () => {
1060
- g.current && clearTimeout(g.current);
1061
+ return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
1062
+ }, [i]), u && !r) return null;
1063
+ const d = qn(I), o = Object.values(m).some(Boolean);
1064
+ Object.values(m).every(Boolean);
1065
+ const n = () => {
1066
+ h.current && clearTimeout(h.current);
1061
1067
  };
1062
- return /* @__PURE__ */ H(_e, { children: [
1068
+ return /* @__PURE__ */ G(je, { children: [
1063
1069
  /* @__PURE__ */ E(
1064
- Mn,
1070
+ Wn,
1065
1071
  {
1066
1072
  ...c,
1067
1073
  icon: "sync",
1068
- ref: m,
1069
- onClick: r,
1074
+ ref: f,
1075
+ onClick: i,
1070
1076
  onMouseEnter: () => {
1071
- a(), C(S);
1077
+ n(), C(b);
1072
1078
  },
1073
1079
  onMouseLeave: () => {
1074
- a(), g.current = setTimeout(() => C(!1), 100);
1080
+ n(), h.current = setTimeout(() => C(!1), 100);
1075
1081
  },
1076
- className: W(c.className, {
1077
- syncing: h,
1078
- "has-updates": o,
1079
- "auto-sync": b && !Ve
1082
+ className: q(c.className, {
1083
+ syncing: g,
1084
+ "has-updates": r,
1085
+ "auto-sync": o && !Xe
1080
1086
  }),
1081
1087
  "data-shortcut": "Shift+R",
1082
- "data-tooltip": o ? i : "Refresh data",
1083
- variant: o ? "filled" : "surface"
1088
+ "data-tooltip": r ? d : "Refresh data",
1089
+ variant: r ? "filled" : "surface"
1084
1090
  }
1085
1091
  ),
1086
- !Ve
1092
+ !Xe
1087
1093
  ] });
1088
1094
  }
1089
- ), We = U.div`
1095
+ ), nt = U.div`
1090
1096
  display: flex;
1091
1097
  align-items: center;
1092
1098
  gap: var(--base-gap-small);
@@ -1094,7 +1100,7 @@ const Pn = (e, t, n) => {
1094
1100
  flex: 1;
1095
1101
  min-width: 0;
1096
1102
  color: var(--md-sys-color-outline);
1097
- `, Fn = U.span`
1103
+ `, Qn = U.span`
1098
1104
  display: flex;
1099
1105
  align-items: center;
1100
1106
  gap: 2px;
@@ -1107,56 +1113,56 @@ const Pn = (e, t, n) => {
1107
1113
  border-radius: 50%;
1108
1114
  object-fit: cover;
1109
1115
  }
1110
- `, jn = ({ rowSelection: e, sliceMap: t }) => {
1111
- const n = Ie(null), [s, d] = z(0);
1112
- we(() => {
1113
- const r = n.current;
1114
- if (!r) return;
1115
- const u = new ResizeObserver(([o]) => d(o.contentRect.width));
1116
- return u.observe(r), () => u.disconnect();
1116
+ `, Jn = ({ rowSelection: e, sliceMap: t }) => {
1117
+ const s = xe(null), [a, u] = z(0);
1118
+ Me(() => {
1119
+ const i = s.current;
1120
+ if (!i) return;
1121
+ const I = new ResizeObserver(([r]) => u(r.contentRect.width));
1122
+ return I.observe(i), () => I.disconnect();
1117
1123
  }, []);
1118
- const c = Object.keys(e).filter((r) => e[r]).map((r) => t.get(r)).filter((r) => !!r), p = (r) => !!r.icon || !!r.img || !!r.startContent, [h, l] = z(!0), f = c.length > 1 || !h, [y, C] = z(c.length), m = c.map((r) => r.id).join("|");
1119
- if (we(() => {
1124
+ const c = Object.keys(e).filter((i) => e[i]).map((i) => t.get(i)).filter((i) => !!i), p = (i) => !!i.icon || !!i.img || !!i.startContent, [g, l] = z(!0), m = c.length > 1 || !g, [y, C] = z(c.length), f = c.map((i) => i.id).join("|");
1125
+ if (Me(() => {
1120
1126
  l(!0), C(c.length);
1121
- }, [s, m]), we(() => {
1122
- const r = n.current;
1123
- if (!r || !c.length) return;
1124
- const u = Array.from(r.querySelectorAll("[data-chip]")), o = r.querySelector("[data-overflow]")?.offsetWidth ?? 22, i = (v, D) => v.offsetLeft - r.offsetLeft + v.offsetWidth <= D;
1127
+ }, [a, f]), Me(() => {
1128
+ const i = s.current;
1129
+ if (!i || !c.length) return;
1130
+ const I = Array.from(i.querySelectorAll("[data-chip]")), r = i.querySelector("[data-overflow]")?.offsetWidth ?? 22, d = (x, D) => x.offsetLeft - i.offsetLeft + x.offsetWidth <= D;
1125
1131
  if (c.length === 1) {
1126
- h && u[0] && !i(u[0], r.clientWidth) && p(c[0]) && l(!1);
1132
+ g && I[0] && !d(I[0], i.clientWidth) && p(c[0]) && l(!1);
1127
1133
  return;
1128
1134
  }
1129
- const b = u[u.length - 1];
1130
- if (b && i(b, r.clientWidth)) return;
1131
- const a = r.clientWidth - o, x = u.filter((v) => i(v, a)).length, T = Math.max(1, x);
1135
+ const o = I[I.length - 1];
1136
+ if (o && d(o, i.clientWidth)) return;
1137
+ const n = i.clientWidth - r, v = I.filter((x) => d(x, n)).length, T = Math.max(1, v);
1132
1138
  T !== y && C(T);
1133
- }), !c.length) return /* @__PURE__ */ E(We, { ref: n });
1134
- const g = c.slice(0, y), S = c.length - g.length;
1135
- return /* @__PURE__ */ H(We, { ref: n, children: [
1136
- g.map((r) => /* @__PURE__ */ H(
1137
- Fn,
1139
+ }), !c.length) return /* @__PURE__ */ E(nt, { ref: s });
1140
+ const h = c.slice(0, y), b = c.length - h.length;
1141
+ return /* @__PURE__ */ G(nt, { ref: s, children: [
1142
+ h.map((i) => /* @__PURE__ */ G(
1143
+ Qn,
1138
1144
  {
1139
1145
  "data-chip": !0,
1140
- title: r.label || r.name,
1141
- "aria-label": r.label || r.name,
1146
+ title: i.label || i.name,
1147
+ "aria-label": i.label || i.name,
1142
1148
  children: [
1143
- r.startContent ?? (r.img ? /* @__PURE__ */ E("img", { src: r.img, alt: "" }) : r.icon && /* @__PURE__ */ E(It, { icon: r.icon, style: { color: r.iconColor } })),
1144
- !(f && p(r)) && /* @__PURE__ */ E("span", { children: r.label || r.name })
1149
+ i.startContent ?? (i.img ? /* @__PURE__ */ E("img", { src: i.img, alt: "" }) : i.icon && /* @__PURE__ */ E(Mt, { icon: i.icon, style: { color: i.iconColor } })),
1150
+ !(m && p(i)) && /* @__PURE__ */ E("span", { children: i.label || i.name })
1145
1151
  ]
1146
1152
  },
1147
- r.id
1153
+ i.id
1148
1154
  )),
1149
- S > 0 && /* @__PURE__ */ H("span", { "data-overflow": !0, children: [
1155
+ b > 0 && /* @__PURE__ */ G("span", { "data-overflow": !0, children: [
1150
1156
  "+",
1151
- S
1157
+ b
1152
1158
  ] })
1153
1159
  ] });
1154
- }, $n = U.div`
1160
+ }, Xn = U.div`
1155
1161
  height: 28px;
1156
1162
  border-radius: 4px;
1157
1163
  background: var(--md-sys-color-surface-container);
1158
1164
  width: 100px;
1159
- `, zn = U.div`
1165
+ `, Zn = U.div`
1160
1166
  display: flex;
1161
1167
  align-items: center;
1162
1168
  gap: var(--base-gap-small);
@@ -1168,7 +1174,7 @@ const Pn = (e, t, n) => {
1168
1174
  flex: 1;
1169
1175
  min-width: 0;
1170
1176
  }
1171
- `, Un = U(Nt)`
1177
+ `, es = U(Yt)`
1172
1178
  .slicer-dropdown {
1173
1179
  flex: 0 1 auto;
1174
1180
  min-width: 48px;
@@ -1189,7 +1195,7 @@ const Pn = (e, t, n) => {
1189
1195
  .power-feature .icon {
1190
1196
  color: var(--md-sys-color-tertiary);
1191
1197
  }
1192
- `, Vn = U.div`
1198
+ `, ts = U.div`
1193
1199
  display: flex;
1194
1200
  align-items: center;
1195
1201
  gap: var(--base-gap-small);
@@ -1202,111 +1208,143 @@ const Pn = (e, t, n) => {
1202
1208
  text-overflow: ellipsis;
1203
1209
  white-space: nowrap;
1204
1210
  }
1205
- `, Ke = "__splitSlicer__", qe = ({
1211
+ `, st = "__splitSlicer__", ot = ({
1206
1212
  panel: e,
1207
1213
  visibleSlices: t,
1208
- sliceFields: n,
1209
- entityTypes: s = ["task"],
1210
- pinnedSliceType: d,
1214
+ sliceFields: s,
1215
+ entityTypes: a = ["task"],
1216
+ pinnedSliceType: u,
1211
1217
  countsSource: c,
1212
1218
  onAddToList: p,
1213
- openMoveDialog: h,
1219
+ openMoveDialog: g,
1214
1220
  splitEnabled: l,
1215
- canCollapse: f,
1221
+ canCollapse: m,
1216
1222
  isPrimary: y,
1217
1223
  search: C,
1218
- onSearchChange: m
1224
+ onSearchChange: f
1219
1225
  }) => {
1220
1226
  const {
1221
- SlicerDropdown: g,
1222
- addSlicePanel: S,
1223
- removeSlicePanel: r,
1224
- collapsedPanels: u,
1225
- togglePanelCollapsed: o,
1226
- setPanelSliceType: i,
1227
- getPanelSelection: b,
1228
- setPanelSelection: a,
1229
- getPanelExpanded: x,
1227
+ SlicerDropdown: h,
1228
+ addSlicePanel: b,
1229
+ removeSlicePanel: i,
1230
+ collapsedPanels: I,
1231
+ togglePanelCollapsed: r,
1232
+ setPanelSliceType: d,
1233
+ getPanelSelection: o,
1234
+ setPanelSelection: n,
1235
+ getPanelExpanded: v,
1230
1236
  setPanelExpanded: T,
1231
- onSliceTypeChange: v,
1237
+ onSliceTypeChange: x,
1232
1238
  isViewSyncPending: D,
1233
- onOpenViewer: K,
1234
- onAddToList: ae,
1235
- page: oe,
1236
- getSliceSort: Z,
1237
- setSliceSort: ie
1238
- } = Me(), { refetch: re } = Pe(), { powerLicense: q, setPowerpackDialog: ee } = Oe(), V = b(e.id), le = x(e.id), te = (w) => {
1239
- a(e.id, w);
1240
- }, L = N(
1241
- (w) => T(e.id, w),
1239
+ onOpenViewer: Y,
1240
+ onAddToList: ue,
1241
+ page: pe,
1242
+ getSliceSort: ne,
1243
+ setSliceSort: me,
1244
+ projectName: se
1245
+ } = $e(), { refetch: oe } = ze(), { powerLicense: Q, setPowerpackDialog: W } = Ue(), J = o(e.id), ae = v(e.id), L = (S) => {
1246
+ n(e.id, S);
1247
+ }, A = O(
1248
+ (S) => T(e.id, S),
1242
1249
  [T, e.id]
1243
- ), R = M(
1250
+ ), R = _(
1244
1251
  () => typeof c == "function" ? c(e.sliceType) : c,
1245
1252
  [c, e.sliceType]
1246
- ), k = M(() => {
1247
- const w = t.map((X) => X.sliceType);
1248
- if (typeof c != "function") return w;
1249
- const _ = (X) => JSON.stringify([X?.entity, X?.args]), ut = _(R);
1250
- return w.filter((X) => X === e.sliceType || _(c(X)) === ut);
1251
- }, [c, R, t, e.sliceType]), { counts: Q, filled: he, complete: xe } = Dn(
1253
+ ), ee = _(() => {
1254
+ const S = t.map(($) => $.sliceType);
1255
+ if (typeof c != "function") return S;
1256
+ const M = ($) => JSON.stringify([$?.entity, $?.args]), ce = M(R);
1257
+ return S.filter(($) => $ === e.sliceType || M(c($)) === ce);
1258
+ }, [c, R, t, e.sliceType]), { counts: be, filled: Ce, complete: te } = Un(
1252
1259
  R,
1253
1260
  e.sliceType,
1254
- k
1255
- ), J = N(
1256
- (w, _) => {
1257
- y ? v(w, _) : i(e.id, w);
1261
+ ee
1262
+ ), X = O(
1263
+ (S, M) => {
1264
+ y ? x(S, M) : d(e.id, S);
1258
1265
  },
1259
- [y, v, i, e.id]
1260
- ), B = M(
1261
- () => t.filter((w) => w.id !== e.id).map((w) => w.sliceType),
1266
+ [y, x, d, e.id]
1267
+ ), ie = _(
1268
+ () => t.filter((S) => S.id !== e.id).map((S) => S.sliceType),
1262
1269
  [t, e.id]
1263
1270
  ), {
1264
- sliceOptions: Y,
1271
+ sliceOptions: B,
1265
1272
  sliceType: P,
1266
- handleSliceTypeChange: ge,
1267
- table: { data: G, isExpandable: ne },
1268
- sliceMap: ce,
1269
- isLoading: de
1270
- } = wn({
1271
- sliceFields: n,
1272
- usedSliceTypes: B,
1273
- entityTypes: s,
1274
- counts: Q,
1275
- filled: he,
1276
- countsComplete: xe,
1273
+ handleSliceTypeChange: K,
1274
+ table: { data: re, isExpandable: Le },
1275
+ sliceMap: Z,
1276
+ isLoading: Se
1277
+ } = $n({
1278
+ sliceFields: s,
1279
+ usedSliceTypes: ie,
1280
+ entityTypes: a,
1281
+ counts: be,
1282
+ filled: Ce,
1283
+ countsComplete: te,
1277
1284
  sliceType: e.sliceType,
1278
- onSliceTypeChange: J,
1279
- sort: Z(e.sliceType)
1280
- }), F = P === "hierarchy", j = !!f && u.includes(e.id), be = Y.find((w) => w.value === P)?.label || P, I = C !== void 0, A = C ?? "", O = F ? "Folders" : be, $ = _n(
1281
- p || ae,
1282
- ce,
1283
- K,
1284
- h
1285
- ), it = F ? $.rowContextMenuBuilders : [], Fe = M(
1286
- () => Y.map((w) => w.value).filter((w) => !t.some((_) => _.sliceType === w)),
1287
- [Y, t]
1288
- ), Se = !!l && Fe.length > 0, Ce = M(() => {
1289
- const w = Y.map(
1290
- (_) => B.includes(_.value) ? { ..._, disabled: !0, disabledMessage: "Already used by another panel" } : _
1285
+ onSliceTypeChange: X,
1286
+ sort: ne(e.sliceType)
1287
+ }), N = P === "hierarchy", j = !!m && I.includes(e.id), w = B.find((S) => S.value === P)?.label || P, k = C !== void 0, F = C ?? "", le = N ? "Folders" : w, V = Gn(
1288
+ p || ue,
1289
+ Z,
1290
+ Y,
1291
+ g
1292
+ ), { contributions: He } = Wt("slicer.menuItem"), we = _(
1293
+ () => He.filter(
1294
+ (S) => !S.sliceTypes?.length || S.sliceTypes.includes(P)
1295
+ ),
1296
+ [He, P]
1297
+ ), Ee = (S, M, ce = "bottom") => {
1298
+ if (!M.length) return [];
1299
+ const $ = M.map((H) => {
1300
+ const Ae = Z.get(H);
1301
+ return {
1302
+ id: H,
1303
+ label: Ae?.label || Ae?.name || void 0,
1304
+ entityType: Ae?.data?.entityType
1305
+ };
1306
+ }), ke = { projectName: se, sliceType: P, selected: $, menu: S };
1307
+ return Rt(we, ce).filter((H) => !H.in?.length || H.in.includes(S)).map((H) => ({
1308
+ id: H.key,
1309
+ label: H.label,
1310
+ icon: H.icon,
1311
+ [S === "context" ? "command" : "onClick"]: () => qt(H, ke)
1312
+ }));
1313
+ }, Ge = (S) => (M, { rowId: ce, selectedRows: $ }) => (S === "top" && we.forEach((ke) => Kt(ke.run)), Ee(
1314
+ "context",
1315
+ $.includes(ce) ? $ : [ce],
1316
+ S
1317
+ )), gt = we.length ? [
1318
+ Ge("top"),
1319
+ ...N ? V.rowContextMenuBuilders : [],
1320
+ Ge("bottom"),
1321
+ ...N ? [V.deleteContextMenuBuilder] : []
1322
+ ] : N ? [...V.rowContextMenuBuilders, V.deleteContextMenuBuilder] : [], We = _(
1323
+ () => B.map((S) => S.value).filter((S) => !t.some((M) => M.sliceType === S)),
1324
+ [B, t]
1325
+ ), Te = !!l && We.length > 0, De = _(() => {
1326
+ const S = B.map(
1327
+ (M) => ie.includes(M.value) ? { ...M, disabled: !0, disabledMessage: "Already used by another panel" } : M
1291
1328
  );
1292
- return Se && w.push({ label: "Split slicer", value: Ke, icon: "splitscreen_add" }), w;
1293
- }, [Y, B, Se]), Le = () => {
1294
- if (!q) return ee("slicer");
1295
- S(Fe[0]);
1296
- }, { menuOpen: rt, toggleMenuOpen: je } = Ze(), ue = `slicer-menu-${oe}-${e.id}`.replace(/[^\w-]/g, "-"), lt = rt === ue, ct = [
1329
+ return Te && S.push({ label: "Split slicer", value: st, icon: "splitscreen_add" }), S;
1330
+ }, [B, ie, Te]), Re = () => {
1331
+ if (!Q) return W("slicer");
1332
+ b(We[0]);
1333
+ }, { menuOpen: yt, toggleMenuOpen: Ke } = ct(), fe = `slicer-menu-${pe}-${e.id}`.replace(/[^\w-]/g, "-"), bt = yt === fe, qe = Object.keys(J).filter((S) => J[S]), St = [
1334
+ ...Ee("dropdown", qe, "top"),
1297
1335
  {
1298
1336
  id: "search",
1299
- label: `Search ${O}`,
1337
+ label: `Search ${le}`,
1300
1338
  icon: "search",
1301
- onClick: () => m("")
1339
+ onClick: () => f("")
1302
1340
  },
1303
- ...Se && y ? [
1341
+ ...Te && y ? [
1304
1342
  {
1305
1343
  id: "split",
1306
1344
  label: "Split slicer",
1307
1345
  icon: "splitscreen_add",
1308
1346
  powerFeature: "slicer",
1309
- onClick: Le
1347
+ onClick: Re
1310
1348
  }
1311
1349
  ] : [],
1312
1350
  ...y ? [] : [
@@ -1314,112 +1352,113 @@ const Pn = (e, t, n) => {
1314
1352
  id: "remove-panel",
1315
1353
  label: "Remove panel",
1316
1354
  icon: "close",
1317
- onClick: () => r(e.id)
1355
+ onClick: () => i(e.id)
1318
1356
  }
1319
1357
  ],
1320
- rn({
1358
+ Tn({
1321
1359
  id: "sort",
1322
- options: Ne(P),
1323
- sort: Z(P),
1324
- onChange: (w) => ie(P, w)
1325
- })
1326
- ], dt = (w) => {
1327
- const _ = String(w[0]);
1328
- if (_ === Ke) {
1329
- Le();
1360
+ options: Be(P),
1361
+ sort: ne(P),
1362
+ onChange: (S) => me(P, S)
1363
+ }),
1364
+ ...Ee("dropdown", qe)
1365
+ ], Tt = (S) => {
1366
+ const M = String(S[0]);
1367
+ if (M === st) {
1368
+ Re();
1330
1369
  return;
1331
1370
  }
1332
- ge(_, !!y && d === P);
1371
+ K(M, !!y && u === P);
1333
1372
  };
1334
- return /* @__PURE__ */ H(Ft, { children: [
1335
- /* @__PURE__ */ H(
1336
- Un,
1373
+ return /* @__PURE__ */ G(Qt, { children: [
1374
+ /* @__PURE__ */ G(
1375
+ es,
1337
1376
  {
1338
- className: W({ collapsed: j }),
1339
- onClick: j ? () => o(e.id) : void 0,
1377
+ className: q({ collapsed: j }),
1378
+ onClick: j ? () => r(e.id) : void 0,
1340
1379
  children: [
1341
- f && /* @__PURE__ */ E(
1342
- pe,
1380
+ m && /* @__PURE__ */ E(
1381
+ he,
1343
1382
  {
1344
1383
  icon: "expand_more",
1345
- className: W("collapse-toggle", { collapsed: j }),
1384
+ className: q("collapse-toggle", { collapsed: j }),
1346
1385
  "data-tooltip": j ? "Expand panel" : "Collapse panel",
1347
1386
  "data-tooltip-delay": 0,
1348
- onClick: () => o(e.id)
1387
+ onClick: () => r(e.id)
1349
1388
  }
1350
1389
  ),
1351
1390
  j ? (
1352
1391
  // the dropdown cannot be used from a collapsed panel, but the dimension it
1353
1392
  // shows has to read the same as the dropdown does when open
1354
- /* @__PURE__ */ E(Vn, { children: /* @__PURE__ */ E("span", { children: be }) })
1355
- ) : D ? /* @__PURE__ */ E($n, {}) : !I && /* @__PURE__ */ E(
1356
- g,
1393
+ /* @__PURE__ */ E(ts, { children: /* @__PURE__ */ E("span", { children: w }) })
1394
+ ) : D ? /* @__PURE__ */ E(Xn, {}) : !k && /* @__PURE__ */ E(
1395
+ h,
1357
1396
  {
1358
- options: Ce,
1397
+ options: De,
1359
1398
  value: [P],
1360
- sliceTypes: n.map((w) => w.value),
1361
- onChange: (w) => dt(w),
1362
- className: W("slicer-dropdown", { "single-option": Ce.length === 1 }),
1363
- disableOpen: Ce.length === 1
1399
+ sliceTypes: s.map((S) => S.value),
1400
+ onChange: (S) => Tt(S),
1401
+ className: q("slicer-dropdown", { "single-option": De.length === 1 }),
1402
+ disableOpen: De.length === 1
1364
1403
  }
1365
1404
  ),
1366
- j && /* @__PURE__ */ E(jn, { rowSelection: V, sliceMap: ce }),
1367
- /* @__PURE__ */ H(
1368
- zn,
1405
+ j && /* @__PURE__ */ E(Jn, { rowSelection: J, sliceMap: Z }),
1406
+ /* @__PURE__ */ G(
1407
+ Zn,
1369
1408
  {
1370
- className: W({ searching: I }),
1371
- onClick: (w) => w.stopPropagation(),
1409
+ className: q({ searching: k }),
1410
+ onClick: (S) => S.stopPropagation(),
1372
1411
  children: [
1373
- !j && !I && /* @__PURE__ */ H(_e, { children: [
1412
+ !j && !k && /* @__PURE__ */ G(je, { children: [
1374
1413
  /* @__PURE__ */ E(
1375
- pe,
1414
+ he,
1376
1415
  {
1377
1416
  icon: "more_horiz",
1378
- id: ue,
1379
- className: W("slicer-menu", { active: lt }),
1417
+ id: fe,
1418
+ className: q("slicer-menu", { active: bt }),
1380
1419
  "data-tooltip": "More",
1381
1420
  "data-tooltip-delay": 0,
1382
- onClick: () => je(ue)
1421
+ onClick: () => Ke(fe)
1383
1422
  }
1384
1423
  ),
1385
- /* @__PURE__ */ E(Xt, { targetId: ue, id: ue, align: "left", children: /* @__PURE__ */ E(Zt, { menu: ct, onClose: () => je(!1) }) })
1424
+ /* @__PURE__ */ E(pn, { targetId: fe, id: fe, align: "left", children: /* @__PURE__ */ E(mn, { menu: St, onClose: () => Ke(!1) }) })
1386
1425
  ] }),
1387
1426
  !j && /* @__PURE__ */ E(
1388
- An,
1427
+ Hn,
1389
1428
  {
1390
- open: I,
1391
- value: A,
1392
- subject: O,
1393
- onChange: m
1429
+ open: k,
1430
+ value: F,
1431
+ subject: le,
1432
+ onChange: f
1394
1433
  }
1395
1434
  ),
1396
- F && /* @__PURE__ */ E(
1397
- Nn,
1435
+ N && /* @__PURE__ */ E(
1436
+ Yn,
1398
1437
  {
1399
1438
  topics: ["entity.folder.created"],
1400
1439
  onSync: async () => {
1401
- await re();
1440
+ await oe();
1402
1441
  },
1403
1442
  hideWhenNoUpdates: !0
1404
1443
  }
1405
1444
  ),
1406
- Se && y && !I && /* @__PURE__ */ E(
1407
- pe,
1445
+ Te && y && !k && /* @__PURE__ */ E(
1446
+ he,
1408
1447
  {
1409
1448
  icon: "splitscreen_add",
1410
- className: W({ "power-feature": !q }),
1411
- "data-tooltip": q ? "Split slicer" : "Power feature - Slicer",
1449
+ className: q({ "power-feature": !Q }),
1450
+ "data-tooltip": Q ? "Split slicer" : "Power feature - Slicer",
1412
1451
  "data-tooltip-delay": 0,
1413
- onClick: Le
1452
+ onClick: Re
1414
1453
  }
1415
1454
  ),
1416
- !y && !I && /* @__PURE__ */ E(
1417
- pe,
1455
+ !y && !k && /* @__PURE__ */ E(
1456
+ he,
1418
1457
  {
1419
1458
  icon: "close",
1420
1459
  "data-tooltip": "Remove panel",
1421
1460
  "data-tooltip-delay": 0,
1422
- onClick: () => r(e.id)
1461
+ onClick: () => i(e.id)
1423
1462
  }
1424
1463
  )
1425
1464
  ]
@@ -1429,35 +1468,36 @@ const Pn = (e, t, n) => {
1429
1468
  }
1430
1469
  ),
1431
1470
  !j && /* @__PURE__ */ E(
1432
- jt,
1471
+ Jt,
1433
1472
  {
1434
- rowSelection: V,
1435
- onRowSelectionChange: te,
1436
- expanded: le,
1437
- setExpanded: L,
1438
- data: ce,
1473
+ rowSelection: J,
1474
+ onRowSelectionChange: L,
1475
+ expanded: ae,
1476
+ setExpanded: A,
1477
+ data: Z,
1439
1478
  children: /* @__PURE__ */ E(
1440
- $t,
1479
+ Xt,
1441
1480
  {
1442
- data: G,
1443
- isExpandable: ne,
1444
- isLoading: de || D,
1481
+ data: re,
1482
+ isExpandable: Le,
1483
+ isLoading: Se || D,
1445
1484
  forceUpdateTable: P,
1446
- globalFilter: A,
1485
+ globalFilter: F,
1447
1486
  rowIdPrefix: `slicer-${e.id}`,
1448
- onRename: F ? (w, _) => $.onRename(_.original) : void 0,
1449
- renamingId: F ? $.renamingRow?.id : null,
1450
- renameInitialValue: F ? $.renameInitialValue : void 0,
1451
- onSubmitRename: F ? (w, _) => $.onSubmitRename(_) : void 0,
1452
- onCancelRename: F ? $.onCancelRename : void 0,
1453
- onRowOptionClick: F ? $.onOptionClick : void 0,
1454
- rowContextMenuBuilders: it
1487
+ onRename: N ? (S, M) => V.onRename(M.original) : void 0,
1488
+ renamingId: N ? V.renamingRow?.id : null,
1489
+ renameInitialValue: N ? V.renameInitialValue : void 0,
1490
+ onSubmitRename: N ? (S, M) => V.onSubmitRename(M) : void 0,
1491
+ onCancelRename: N ? V.onCancelRename : void 0,
1492
+ onRowOptionClick: N ? V.onOptionClick : void 0,
1493
+ rowContextMenuBuilders: gt,
1494
+ addonShortcuts: { table: "slicer", projectName: se }
1455
1495
  }
1456
1496
  )
1457
1497
  }
1458
1498
  )
1459
1499
  ] });
1460
- }, Bn = U.div`
1500
+ }, ns = U.div`
1461
1501
  height: 100%;
1462
1502
  width: 100%;
1463
1503
  overflow-y: auto;
@@ -1471,139 +1511,139 @@ const Pn = (e, t, n) => {
1471
1511
  }
1472
1512
  `
1473
1513
  ).join("")}
1474
- `, js = ({
1514
+ `, eo = ({
1475
1515
  sliceFields: e = [],
1476
1516
  entityTypes: t = ["task"],
1477
- pinnedSliceType: n,
1478
- countsSource: s,
1479
- onAddToList: d,
1517
+ pinnedSliceType: s,
1518
+ countsSource: a,
1519
+ onAddToList: u,
1480
1520
  enableSplit: c
1481
1521
  }) => {
1482
- const { slices: p, page: h, setPanelExpanded: l, projectName: f, collapsedPanels: y } = Me(), { powerLicense: C } = Oe(), m = !!c, g = m && C ? p : p.slice(0, 1), [S, r] = z(null), u = N((L) => {
1483
- r("entities" in L ? L : { entities: [L] });
1484
- }, []), o = N(() => {
1485
- r(null);
1486
- }, []), { getParentFolderIds: i } = Pe(), b = N(
1522
+ const { slices: p, page: g, setPanelExpanded: l, projectName: m, collapsedPanels: y } = $e(), { powerLicense: C } = Ue(), f = !!c, h = f && C ? p : p.slice(0, 1), [b, i] = z(null), I = O((L) => {
1523
+ i("entities" in L ? L : { entities: [L] });
1524
+ }, []), r = O(() => {
1525
+ i(null);
1526
+ }, []), { getParentFolderIds: d } = ze(), o = O(
1487
1527
  (L) => {
1488
- const R = [L, ...i(L)];
1528
+ const A = [L, ...d(L)];
1489
1529
  l(
1490
1530
  "hierarchy",
1491
- (k) => typeof k == "boolean" ? k || Object.fromEntries(R.map((Q) => [Q, !0])) : {
1492
- ...k,
1493
- ...Object.fromEntries(R.map((Q) => [Q, !0]))
1531
+ (R) => typeof R == "boolean" ? R || Object.fromEntries(A.map((ee) => [ee, !0])) : {
1532
+ ...R,
1533
+ ...Object.fromEntries(A.map((ee) => [ee, !0]))
1494
1534
  }
1495
1535
  );
1496
1536
  },
1497
- [i, l]
1498
- ), a = Ie(null), [x, T] = z(0);
1499
- se(() => {
1500
- const L = a.current;
1537
+ [d, l]
1538
+ ), n = xe(null), [v, T] = z(0);
1539
+ de(() => {
1540
+ const L = n.current;
1501
1541
  if (!L) return;
1502
- const R = new ResizeObserver(([k]) => T(k.contentRect.height));
1503
- return R.observe(L), () => R.disconnect();
1504
- }, [g.length]);
1505
- const v = g.map((L) => L.id), D = g.length > 1, {
1506
- sizes: K,
1507
- minSize: ae,
1508
- height: oe,
1509
- layoutKey: Z,
1510
- handleResizeEnd: ie
1511
- } = mn(h, v, D ? y : [], x), re = v.slice(0, -1).map(
1512
- (L, R) => D && (y.includes(L) || y.includes(v[R + 1])) ? R : -1
1513
- ).filter((L) => L >= 0), [q, ee] = z({}), V = N(
1514
- (L, R) => ee((k) => ({ ...k, [L]: R })),
1542
+ const A = new ResizeObserver(([R]) => T(R.contentRect.height));
1543
+ return A.observe(L), () => A.disconnect();
1544
+ }, [h.length]);
1545
+ const x = h.map((L) => L.id), D = h.length > 1, {
1546
+ sizes: Y,
1547
+ minSize: ue,
1548
+ height: pe,
1549
+ layoutKey: ne,
1550
+ handleResizeEnd: me
1551
+ } = En(g, x, D ? y : [], v), se = x.slice(0, -1).map(
1552
+ (L, A) => D && (y.includes(L) || y.includes(x[A + 1])) ? A : -1
1553
+ ).filter((L) => L >= 0), [oe, Q] = z({}), W = O(
1554
+ (L, A) => Q((R) => ({ ...R, [L]: A })),
1515
1555
  []
1516
- ), le = v.join("|");
1517
- se(() => {
1518
- ee((L) => {
1519
- const R = Object.keys(L).filter((k) => v.includes(k));
1520
- return R.length === Object.keys(L).length ? L : Object.fromEntries(R.map((k) => [k, L[k]]));
1556
+ ), J = x.join("|");
1557
+ de(() => {
1558
+ Q((L) => {
1559
+ const A = Object.keys(L).filter((R) => x.includes(R));
1560
+ return A.length === Object.keys(L).length ? L : Object.fromEntries(A.map((R) => [R, L[R]]));
1521
1561
  });
1522
- }, [le]);
1523
- const te = {
1524
- visibleSlices: g,
1562
+ }, [J]);
1563
+ const ae = {
1564
+ visibleSlices: h,
1525
1565
  canCollapse: D,
1526
1566
  sliceFields: e,
1527
1567
  entityTypes: t,
1528
- pinnedSliceType: n,
1529
- countsSource: s,
1530
- onAddToList: d,
1531
- openMoveDialog: u,
1532
- splitEnabled: m
1568
+ pinnedSliceType: s,
1569
+ countsSource: a,
1570
+ onAddToList: u,
1571
+ openMoveDialog: I,
1572
+ splitEnabled: f
1533
1573
  };
1534
- return /* @__PURE__ */ H(_e, { children: [
1535
- g.length === 1 ? /* @__PURE__ */ E(
1536
- qe,
1574
+ return /* @__PURE__ */ G(je, { children: [
1575
+ h.length === 1 ? /* @__PURE__ */ E(
1576
+ ot,
1537
1577
  {
1538
- panel: g[0],
1578
+ panel: h[0],
1539
1579
  isPrimary: !0,
1540
- search: q[g[0].id],
1541
- onSearchChange: (L) => V(g[0].id, L),
1542
- ...te
1580
+ search: oe[h[0].id],
1581
+ onSearchChange: (L) => W(h[0].id, L),
1582
+ ...ae
1543
1583
  }
1544
- ) : /* @__PURE__ */ E(Bn, { ref: a, $deadGutters: re, children: /* @__PURE__ */ E(
1545
- gt,
1584
+ ) : /* @__PURE__ */ E(ns, { ref: n, $deadGutters: se, children: /* @__PURE__ */ E(
1585
+ Lt,
1546
1586
  {
1547
1587
  layout: "vertical",
1548
- onResizeEnd: ie,
1588
+ onResizeEnd: me,
1549
1589
  style: {
1550
1590
  width: "100%",
1551
- height: oe,
1591
+ height: pe,
1552
1592
  overflow: "hidden"
1553
1593
  },
1554
- children: g.map((L, R) => /* @__PURE__ */ E(
1555
- yt,
1594
+ children: h.map((L, A) => /* @__PURE__ */ E(
1595
+ wt,
1556
1596
  {
1557
- size: K[R],
1558
- minSize: ae,
1597
+ size: Y[A],
1598
+ minSize: ue,
1559
1599
  style: { overflow: "hidden" },
1560
1600
  children: /* @__PURE__ */ E(
1561
- qe,
1601
+ ot,
1562
1602
  {
1563
1603
  panel: L,
1564
- isPrimary: R === 0,
1565
- search: q[L.id],
1566
- onSearchChange: (k) => V(L.id, k),
1567
- ...te
1604
+ isPrimary: A === 0,
1605
+ search: oe[L.id],
1606
+ onSearchChange: (R) => W(L.id, R),
1607
+ ...ae
1568
1608
  }
1569
1609
  )
1570
1610
  },
1571
1611
  L.id
1572
1612
  ))
1573
1613
  },
1574
- Z
1614
+ ne
1575
1615
  ) }),
1576
1616
  /* @__PURE__ */ E(
1577
- gn,
1617
+ Rn,
1578
1618
  {
1579
- projectName: f,
1580
- movingEntities: S,
1581
- onClose: o,
1582
- onMoveComplete: b
1619
+ projectName: m,
1620
+ movingEntities: b,
1621
+ onClose: r,
1622
+ onMoveComplete: o
1583
1623
  }
1584
1624
  )
1585
1625
  ] });
1586
1626
  };
1587
1627
  export {
1588
- ln as S,
1589
- st as a,
1590
- Be as b,
1591
- fn as c,
1592
- et as d,
1593
- js as e,
1594
- vn as f,
1595
- pn as g,
1596
- He as h,
1597
- tt as i,
1598
- Ne as j,
1599
- un as k,
1600
- _n as l,
1601
- Dn as m,
1602
- mn as n,
1603
- Fs as o,
1604
- Nn as p,
1605
- rn as q,
1606
- Ns as r,
1607
- on as s,
1608
- In as u
1628
+ vn as S,
1629
+ mt as a,
1630
+ Ze as b,
1631
+ wn as c,
1632
+ dt as d,
1633
+ eo as e,
1634
+ Pn as f,
1635
+ Ln as g,
1636
+ et as h,
1637
+ ut as i,
1638
+ Be as j,
1639
+ Cn as k,
1640
+ Gn as l,
1641
+ Un as m,
1642
+ En as n,
1643
+ Zs as o,
1644
+ Yn as p,
1645
+ Tn as q,
1646
+ Xs as r,
1647
+ Sn as s,
1648
+ On as u
1609
1649
  };