@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,67 +1,69 @@
1
- import { jsxs as k, jsx as i, Fragment as xe } from "react/jsx-runtime";
2
- import { Toolbar as Qe, Panel as yt, Button as Y, Spacer as qe, Icon as we, getMixedCounts as Me, getTextColor as Fe, applyMixedChange as kt, Dialog as wt, SEARCH_FILTER_ID as Ke, buildFilterId as Ee, getFilterFromId as xt, SearchFilter as St, AssigneeField as Ct } from "@ynput/ayon-react-components";
3
- import { useEffect as B, useRef as Z, useMemo as C, useState as X, useContext as Tt, useId as Nt } from "react";
4
- import T, { keyframes as Et } from "styled-components";
5
- import { bz as Dt, bH as It } from "./chunks/searchTerms.es.js";
6
- import { bq as Pt, bO as Ft, c3 as At, cz as Je, by as Xe, v as Ot, bS as jt, ce as Rt } from "./chunks/getUris.es.js";
1
+ import { jsxs as x, jsx as i, Fragment as Ie } from "react/jsx-runtime";
2
+ import { Toolbar as nt, Panel as At, Button as te, Spacer as st, Icon as Ee, getMixedCounts as Qe, getTextColor as Re, applyMixedChange as Ft, Dialog as jt, SEARCH_FILTER_ID as at, buildFilterId as Ae, getFilterFromId as Ot, SearchFilter as Rt, AssigneeField as Lt } from "@ynput/ayon-react-components";
3
+ import { useEffect as G, useMemo as w, useRef as le, useState as oe, useContext as Vt, useId as $t, useCallback as Ut } from "react";
4
+ import I, { keyframes as Mt } from "styled-components";
5
+ import { bz as _t, bH as Ht } from "./chunks/searchTerms.es.js";
6
+ import { bq as Bt, bO as Wt, c3 as zt, cz as ot, by as it, v as Gt, bS as Qt, ce as qt } from "./chunks/getUris.es.js";
7
7
  import "primereact/confirmdialog";
8
- import { o as Vt, y as $t, H as Lt, G as Ut, z as _t, w as Ye, A as Mt, B as Ht, E as Bt, I as Wt, J as zt, K as Gt, N as Qt, W as qt, s as Kt } from "./chunks/Watchers.es.js";
9
- import { O as Da, Q as Ia, V as Pa, X as Fa, T as Aa } from "./chunks/Watchers.es.js";
10
- import { E as Jt, R as Xt, a as Yt } from "./chunks/EntityPath.es.js";
11
- import { union as ue, upperFirst as Ze } from "lodash";
8
+ import { c as Kt, y as Jt, H as Xt, G as Yt, z as Zt, w as rt, A as en, B as tn, E as nn, I as sn, J as an, K as on, N as rn, W as ln, s as cn } from "./chunks/Watchers.es.js";
9
+ import { O as Wa, Q as za, V as Ga, X as Qa, T as qa } from "./chunks/Watchers.es.js";
10
+ import { E as dn, R as un, a as pn } from "./chunks/EntityPath.es.js";
11
+ import { union as ke, upperFirst as lt } from "lodash";
12
12
  import "react-toastify";
13
13
  import "uuid";
14
- import { a as Zt, b as es, A as He, e as ts } from "./chunks/activeEntities.es.js";
14
+ import { a as mn, b as hn, A as qe, e as gn } from "./chunks/activeEntities.es.js";
15
+ import "axios";
15
16
  import "@module-federation/enhanced/runtime";
16
- import { o as K, u as ss, T as ns, a8 as as, a2 as os, aa as is, G as rs, a9 as ls, Z as cs } from "./chunks/TableExportContextInstance.es.js";
17
+ import { menuItemsAt as Ne } from "@ynput/ayon-addon/host";
18
+ import { v as ne, u as fn, T as bn, ad as vn, a7 as yn, af as kn, a6 as Ke, K as wn, ae as xn, a1 as Sn } from "./chunks/TableExportContextInstance.es.js";
17
19
  import "semver";
18
- import { T as ds, P as et } from "./chunks/ProjectContext.es.js";
20
+ import { T as Cn, P as ct } from "./chunks/ProjectContext.es.js";
19
21
  import "react-dom";
20
22
  import "react-redux";
21
23
  import "react-router-dom";
22
- import le from "clsx";
23
- import { A as us } from "./chunks/Actions.es.js";
24
- import { f as ps, k as hs, r as ms, m as gs } from "./chunks/MetaWidget.es.js";
24
+ import fe from "clsx";
25
+ import { A as Tn } from "./chunks/Actions.es.js";
26
+ import { c as Nn, n as En, E as In, q as Pn } from "./chunks/MetaWidget.es.js";
25
27
  import "./chunks/ContextMenuContextInstance.es.js";
26
- import { g as De } from "./chunks/getEntityTypeIcon.es.js";
27
- import { _ as fs } from "./chunks/PlayableIcon.es.js";
28
- import { R as bs } from "./chunks/RepresentationsList.es.js";
29
- import { I as vs } from "./chunks/InfoMessage.es.js";
30
- import { M as ys, a as ks } from "./chunks/Menu.es.js";
31
- import { D as ws } from "./chunks/DetailsDialog.es.js";
32
- import { u as xs } from "./chunks/VersionUploadContextInstance.es.js";
33
- import { p as Ss } from "./chunks/pluralize.es.js";
34
- import { c as Cs } from "./chunks/copyToClipboard.es.js";
35
- import { u as Ts } from "./chunks/useQueryArgumentChangeLoading.es.js";
36
- import { d as tt, c as Ns } from "./chunks/Feed.es.js";
37
- import { A as Es, C as Ds } from "./chunks/ThumbnailSimple.es.js";
38
- import { t as Is, c as Ps } from "./chunks/queryFilterToClientFilter.es.js";
39
- import { u as Fs } from "./chunks/useDateRangeFilter.es.js";
40
- import { e as As } from "./chunks/expandRelativeDates.es.js";
41
- import "axios";
28
+ import { useContributions as dt, prefetchPiece as Le, runContribution as Je, ContributionView as Dn } from "@ynput/ayon-addon";
29
+ import { g as Fe } from "./chunks/getEntityTypeIcon.es.js";
30
+ import { _ as An } from "./chunks/PlayableIcon.es.js";
31
+ import { R as Fn } from "./chunks/RepresentationsList.es.js";
32
+ import { I as jn } from "./chunks/InfoMessage.es.js";
33
+ import { M as On, a as Rn } from "./chunks/Menu.es.js";
34
+ import { D as Ln } from "./chunks/DetailsDialog.es.js";
35
+ import { u as Vn } from "./chunks/VersionUploadContextInstance.es.js";
36
+ import { p as $n } from "./chunks/pluralize.es.js";
37
+ import { c as Un } from "./chunks/copyToClipboard.es.js";
38
+ import { u as Mn } from "./chunks/useQueryArgumentChangeLoading.es.js";
39
+ import { d as ut, c as _n } from "./chunks/Feed.es.js";
40
+ import { A as Hn, C as Bn } from "./chunks/ThumbnailSimple.es.js";
41
+ import { t as Wn, c as zn } from "./chunks/queryFilterToClientFilter.es.js";
42
+ import { u as Gn } from "./chunks/useDateRangeFilter.es.js";
43
+ import { e as Qn } from "./chunks/expandRelativeDates.es.js";
42
44
  import "@dnd-kit/core";
43
45
  import "@dnd-kit/sortable";
44
46
  import "@dnd-kit/utilities";
45
47
  import "custom-protocol-check";
46
48
  import "./chunks/SimpleForm.es.js";
47
- import { Dialog as Os } from "primereact/dialog";
48
- function js({
49
+ import { Dialog as qn } from "primereact/dialog";
50
+ function Kn({
49
51
  entityData: e,
50
- project: s,
52
+ project: n,
51
53
  activeEntityType: t,
52
54
  entitiesToQuery: o = []
53
55
  }) {
54
- B(() => {
55
- if (!e?.parents || !s) return;
56
- const n = new URL(window.location.href), a = n.searchParams;
57
- a.set("project", s), t && a.set("type", t);
58
- const r = (o || []).filter((f) => f.projectName === s).map((f) => f.id).filter(Boolean)[0];
56
+ G(() => {
57
+ if (!e?.parents || !n) return;
58
+ const s = new URL(window.location.href), a = s.searchParams;
59
+ a.set("project", n), t && a.set("type", t);
60
+ const r = (o || []).filter((f) => f.projectName === n).map((f) => f.id).filter(Boolean)[0];
59
61
  r && a.set("id", r);
60
- const c = `${n.pathname}?${a.toString()}${n.hash}`, m = `${window.location.pathname}${window.location.search}${window.location.hash}`;
61
- c !== m && window.history.replaceState(window.history.state, "", c);
62
- }, [e, s, t, o]);
62
+ const l = `${s.pathname}?${a.toString()}${s.hash}`, u = `${window.location.pathname}${window.location.search}${window.location.hash}`;
63
+ l !== u && window.history.replaceState(window.history.state, "", l);
64
+ }, [e, n, t, o]);
63
65
  }
64
- const Rs = T(Qe)`
66
+ const Jn = I(nt)`
65
67
  display: flex;
66
68
  justify-content: space-between;
67
69
  align-items: flex-start;
@@ -73,7 +75,7 @@ const Rs = T(Qe)`
73
75
  & > * {
74
76
  min-width: max-content;
75
77
  }
76
- `, Vs = T.div`
78
+ `, Xn = I.div`
77
79
  display: flex;
78
80
  align-items: flex-start;
79
81
  gap: 4px;
@@ -82,31 +84,45 @@ const Rs = T(Qe)`
82
84
  right: 0;
83
85
  padding: var(--padding-m);
84
86
  background-color: var(--md-sys-color-surface-container-low);
85
- `, $s = T(yt)`
87
+ `, Yn = I.div`
88
+ flex: 1;
89
+ min-height: 0;
90
+ overflow: auto;
91
+ display: flex;
92
+ flex-direction: column;
93
+ `, Zn = I(At)`
86
94
  gap: 0px;
87
95
  height: 100%;
88
96
  padding: 0px;
89
97
  box-shadow: -2px 0 6px #00000047;
90
98
  z-index: 300;
91
- `, Ls = T(Qe)`
99
+ `, pt = (e) => {
100
+ const { contributions: n, isLoading: t } = dt("detailsPanel.tab");
101
+ return { tabs: w(
102
+ () => n.filter(
103
+ (s) => !s.entityTypes?.length || s.entityTypes.includes(e)
104
+ ),
105
+ [n, e]
106
+ ), isLoading: t };
107
+ }, es = I(nt)`
92
108
  border-radius: 8px 8px 0 0;
93
109
  gap: var(--base-gap-small) !important;
94
110
  position: relative;
95
111
  z-index: 100;
96
112
  grid-column: span 2;
97
- `, Us = ["product", "representation"], _s = ["task"], Ms = ({
113
+ `, ts = ["product", "representation"], ns = ["task"], ss = ({
98
114
  entityType: e,
99
- currentTab: s,
115
+ currentTab: n,
100
116
  onTabChange: t,
101
117
  isLoading: o
102
118
  }) => {
103
- const n = !Us.includes(e), a = _s.includes(e);
104
- return /* @__PURE__ */ k(Ls, { className: o ? "loading" : "", children: [
105
- n && /* @__PURE__ */ i(
106
- Y,
119
+ const s = !ts.includes(e), a = ns.includes(e), r = e === "version", { tabs: l } = pt(e);
120
+ return /* @__PURE__ */ x(es, { className: o ? "loading" : "", children: [
121
+ s && /* @__PURE__ */ i(
122
+ te,
107
123
  {
108
124
  icon: "forum",
109
- selected: s === "feed",
125
+ selected: n === "feed",
110
126
  onClick: () => t("feed"),
111
127
  "data-tooltip": "Activity Feed",
112
128
  "data-tooltip-delay": 0,
@@ -114,45 +130,59 @@ const Rs = T(Qe)`
114
130
  }
115
131
  ),
116
132
  a && /* @__PURE__ */ i(
117
- Y,
133
+ te,
118
134
  {
119
135
  icon: "checklist",
120
- selected: s === "subtasks",
136
+ selected: n === "subtasks",
121
137
  onClick: () => t("subtasks"),
122
138
  "data-tooltip": "Subtasks",
123
139
  "data-tooltip-delay": 0,
124
140
  variant: "text"
125
141
  }
126
142
  ),
127
- /* @__PURE__ */ i(qe, {}),
128
- e === "version" && /* @__PURE__ */ i(
129
- Y,
143
+ l.map((u) => /* @__PURE__ */ i(
144
+ te,
145
+ {
146
+ icon: u.icon,
147
+ selected: n === u.key,
148
+ onClick: () => t(u.key),
149
+ onMouseEnter: () => Le(u.component),
150
+ "data-tooltip": u.label,
151
+ "data-tooltip-delay": 0,
152
+ "data-addon-tab": u.key,
153
+ variant: "text"
154
+ },
155
+ u.key
156
+ )),
157
+ /* @__PURE__ */ i(st, {}),
158
+ r && /* @__PURE__ */ i(
159
+ te,
130
160
  {
131
161
  icon: "order_play",
132
162
  onClick: () => t("files"),
133
- selected: s === "files",
163
+ selected: n === "files",
134
164
  "data-tooltip": "Version files",
135
165
  "data-tooltip-delay": 0,
136
166
  variant: "text"
137
167
  }
138
168
  ),
139
169
  /* @__PURE__ */ i(
140
- Y,
170
+ te,
141
171
  {
142
172
  onClick: () => t("details"),
143
- selected: s === "details",
173
+ selected: n === "details",
144
174
  style: { padding: "6px 8px" },
145
175
  variant: "text",
146
176
  children: "Details"
147
177
  }
148
178
  )
149
179
  ] });
150
- }, Hs = T.div`
180
+ }, as = I.div`
151
181
  display: flex;
152
182
  align-items: center;
153
183
  gap: var(--base-gap-small);
154
184
  overflow: hidden;
155
- `, Bs = T.button`
185
+ `, os = I.button`
156
186
  display: inline-flex;
157
187
  align-items: center;
158
188
  gap: var(--base-gap-small);
@@ -174,56 +204,56 @@ const Rs = T(Qe)`
174
204
  text-overflow: ellipsis;
175
205
  white-space: nowrap;
176
206
  }
177
- `, Ws = ({ entity: e, taskTypes: s }) => {
178
- const { openSlideOut: t } = K(), { projectName: o } = e, n = e.task?.name ? e.task : void 0;
179
- if (!n?.id) return null;
180
- const a = s.find((r) => r.name === n.taskType);
181
- return /* @__PURE__ */ k(Hs, { className: "linked-task", children: [
207
+ `, is = ({ entity: e, taskTypes: n }) => {
208
+ const { openSlideOut: t } = ne(), { projectName: o } = e, s = e.task?.name ? e.task : void 0;
209
+ if (!s?.id) return null;
210
+ const a = n.find((r) => r.name === s.taskType);
211
+ return /* @__PURE__ */ x(as, { className: "linked-task", children: [
182
212
  /* @__PURE__ */ i("span", { children: "Task" }),
183
- /* @__PURE__ */ k(
184
- Bs,
213
+ /* @__PURE__ */ x(
214
+ os,
185
215
  {
186
- onClick: () => t({ entityId: n.id, entityType: "task", projectName: o }),
216
+ onClick: () => t({ entityId: s.id, entityType: "task", projectName: o }),
187
217
  children: [
188
- /* @__PURE__ */ i(we, { icon: a?.icon || "task_alt", style: { color: a?.color || void 0 } }),
189
- /* @__PURE__ */ i("span", { className: "label", children: n.label || n.name })
218
+ /* @__PURE__ */ i(Ee, { icon: a?.icon || "task_alt", style: { color: a?.color || void 0 } }),
219
+ /* @__PURE__ */ i("span", { className: "label", children: s.label || s.name })
190
220
  ]
191
221
  }
192
222
  )
193
223
  ] });
194
- }, st = (e, s, t) => {
224
+ }, mt = (e, n, t) => {
195
225
  if (!e[0]) return [];
196
- if (s === "representation") return [{ icon: "view_in_ar" }];
197
- const o = (n) => {
198
- switch (s) {
226
+ if (n === "representation") return [{ icon: "view_in_ar" }];
227
+ const o = (s) => {
228
+ switch (n) {
199
229
  case "folder":
200
- return n.folder?.folderType ? t.folder[n.folder.folderType] : De("folder");
230
+ return s.folder?.folderType ? t.folder[s.folder.folderType] : Fe("folder");
201
231
  case "task":
202
- return n.task?.taskType ? t.task[n.task.taskType] : De("task");
232
+ return s.task?.taskType ? t.task[s.task.taskType] : Fe("task");
203
233
  case "version":
204
- return n.product?.productType ? t.product[n.product.productType] : De("version");
234
+ return s.product?.productType ? t.product[s.product.productType] : Fe("version");
205
235
  }
206
236
  };
207
- return e.slice(0, 6).map((n) => ({
208
- icon: o(n),
209
- id: n.id,
210
- type: s,
211
- thumbnailHash: n.thumbnailHash,
212
- projectName: n.projectName
237
+ return e.slice(0, 6).map((s) => ({
238
+ icon: o(s),
239
+ id: s.id,
240
+ type: n,
241
+ thumbnailHash: s.thumbnailHash,
242
+ projectName: s.projectName
213
243
  }));
214
- }, Ie = (e) => e.filter((s) => !!s.icon).reduce((s, t) => ({ ...s, [t.name]: t.icon }), {}), nt = (e) => ({
215
- task: Ie(e.taskTypes),
216
- folder: Ie(e.folderTypes),
217
- product: Ie(e.productTypes)
218
- }), at = (e, s) => {
244
+ }, je = (e) => e.filter((n) => !!n.icon).reduce((n, t) => ({ ...n, [t.name]: t.icon }), {}), ht = (e) => ({
245
+ task: je(e.taskTypes),
246
+ folder: je(e.folderTypes),
247
+ product: je(e.productTypes)
248
+ }), gt = (e, n) => {
219
249
  const t = e.length > 1, o = e[0];
220
250
  if (t)
221
251
  return {
222
- title: `${e.length} ${s}s`,
223
- subTitle: e.map((n) => n.name).join(", ")
252
+ title: `${e.length} ${n}s`,
253
+ subTitle: e.map((s) => s.name).join(", ")
224
254
  };
225
255
  if (!o) return { title: "loading...", subTitle: "loading..." };
226
- switch (s) {
256
+ switch (n) {
227
257
  case "folder":
228
258
  return {
229
259
  title: o.label || o.name || "Unknown Folder",
@@ -250,36 +280,36 @@ const Rs = T(Qe)`
250
280
  subTitle: o.entityType || "Unknown Type"
251
281
  };
252
282
  }
253
- }, zs = ({
283
+ }, rs = ({
254
284
  entityType: e,
255
- entitySubTypes: s,
285
+ entitySubTypes: n,
256
286
  entities: t = [],
257
287
  disabledAssignees: o = [],
258
- users: n = [],
288
+ users: s = [],
259
289
  disabledStatuses: a,
260
290
  tagsOptions: r = [],
261
- isFetching: c,
262
- isCompact: m = !1,
291
+ isFetching: l,
292
+ isCompact: u = !1,
263
293
  currentTab: f,
264
- onTabChange: p,
265
- projectInfo: g,
294
+ onTabChange: m,
295
+ projectInfo: h,
266
296
  onOpenViewer: b,
267
- onEntityFocus: x,
268
- thumbnailInputRef: $,
297
+ onEntityFocus: N,
298
+ thumbnailInputRef: V,
269
299
  versionsInputRef: U
270
300
  }) => {
271
- const { useSearchParams: A, useNavigate: d, bundleMode: u } = K(), h = d(), [N, j] = A(), E = Z(null), y = C(() => nt(g), [g]), w = Vt(
272
- t.map((l) => l.projectName),
301
+ const { useSearchParams: O, useNavigate: c, bundleMode: g } = ne(), C = c(), [E, T] = O(), D = le(null), y = w(() => ht(h), [h]), k = Kt(
302
+ t.map((d) => d.projectName),
273
303
  [e]
274
- ), R = C(() => e === "task" ? ue(...t.map((l) => l.task?.assignees || [])) : e === "version" ? ue(
275
- ...t.map((l) => {
276
- const S = l.version?.author;
277
- return Array.isArray(S) ? S : S ? [S] : [];
304
+ ), A = w(() => e === "task" ? ke(...t.map((d) => d.task?.assignees || [])) : e === "version" ? ke(
305
+ ...t.map((d) => {
306
+ const P = d.version?.author;
307
+ return Array.isArray(P) ? P : P ? [P] : [];
278
308
  })
279
309
  ) : [], [t, e]);
280
- let V = t[0];
281
- const M = t.length === 0 || !V || c;
282
- V || (V = {
310
+ let R = t[0];
311
+ const M = t.length === 0 || !R || l;
312
+ R || (R = {
283
313
  parents: [],
284
314
  id: "placeholder",
285
315
  name: "loading...",
@@ -294,93 +324,93 @@ const Rs = T(Qe)`
294
324
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
295
325
  path: ""
296
326
  });
297
- const ee = t.length > 1 ? void 0 : V?.projectName;
298
- t.filter((l) => l.projectName === V?.projectName && l.id).map((l) => l.id);
299
- const { data: te } = Pt({ attributeName: "priority" }), se = Zt(te, e), ne = C(
300
- () => st(t, e, y),
327
+ const se = t.length > 1 ? void 0 : R?.projectName;
328
+ t.filter((d) => d.projectName === R?.projectName && d.id).map((d) => d.id);
329
+ const { data: ce } = Bt({ attributeName: "priority" }), de = mn(ce, e), ue = w(
330
+ () => mt(t, e, y),
301
331
  [t, e, y]
302
- ), P = C(() => t.map((l) => l.status), [t]), ae = C(() => t.map((l) => l.attrib?.priority), [t]), W = C(() => t.map((l) => l.tags), [t]), ce = C(
303
- () => r.reduce((l, S) => (l[S.name] = S, l), {}),
332
+ ), F = w(() => t.map((d) => d.status), [t]), pe = w(() => t.map((d) => d.attrib?.priority), [t]), q = w(() => t.map((d) => d.tags), [t]), me = w(
333
+ () => r.reduce((d, P) => (d[P.name] = P, d), {}),
304
334
  [r]
305
- ), oe = C(() => ue(...W), [W]), pe = t.every((l) => l.projectName === V?.projectName), L = ps(
306
- pe ? V?.projectName : void 0,
335
+ ), J = w(() => ke(...q), [q]), he = t.every((d) => d.projectName === R?.projectName), j = Nn(
336
+ he ? R?.projectName : void 0,
307
337
  r
308
- ), F = t.length > 1, de = C(() => Me(W), [W]), he = C(
309
- () => Me(t.map((l) => l.task?.assignees || [])),
338
+ ), H = t.length > 1, X = w(() => Qe(q), [q]), xe = w(
339
+ () => Qe(t.map((d) => d.task?.assignees || [])),
310
340
  [t]
311
- ), ve = !F && !!V?.hasReviewables, ye = ne.length === 1, { attribAccess: D, updateEntity: me } = $t({
341
+ ), be = !H && !!R?.hasReviewables, ve = ue.length === 1, { attribAccess: S, updateEntity: ge } = Jt({
312
342
  entities: t,
313
343
  entityType: e
314
- }), { writableFields: G } = D, Se = !G || G.includes("status"), J = !G || G.includes("tags"), ie = e === "task" && (!G || G.includes("assignees")), re = (l, S) => {
315
- if (!(l !== "attrib" && G && !G.includes(l)) && !(l === "assignees" && !ie))
316
- return S == null ? console.error("value is null or undefined") : me(l, S);
317
- }, z = (l, S) => {
318
- const I = new Map(
319
- t.map((q) => [q.id, (l === "tags" ? q.tags : q.task?.assignees) || []])
344
+ }), { writableFields: v } = S, $ = !v || v.includes("status"), K = !v || v.includes("tags"), ie = e === "task" && (!v || v.includes("assignees")), ae = (d, P) => {
345
+ if (!(d !== "attrib" && v && !v.includes(d)) && !(d === "assignees" && !ie))
346
+ return P == null ? console.error("value is null or undefined") : ge(d, P);
347
+ }, Y = (d, P) => {
348
+ const B = new Map(
349
+ t.map((re) => [re.id, (d === "tags" ? re.tags : re.task?.assignees) || []])
320
350
  );
321
- l === "tags" && L?.addTags(S.add), re(l, (q) => kt(I.get(q) || [], S));
322
- }, _ = () => {
323
- let l, S = V.id, I = e + "Id";
324
- e === "version" && V.product?.id && (l = [V.id], S = V.product?.id, I = "productId"), S && b({
325
- [I]: S,
326
- projectName: ee,
327
- versionIds: l
351
+ d === "tags" && j?.addTags(P.add), ae(d, (re) => Ft(B.get(re) || [], P));
352
+ }, Se = () => {
353
+ let d, P = R.id, B = e + "Id";
354
+ e === "version" && R.product?.id && (d = [R.id], P = R.product?.id, B = "productId"), P && b({
355
+ [B]: P,
356
+ projectName: se,
357
+ versionIds: d
328
358
  });
329
- }, Q = (e === "task" || e === "version") && (R.length > 0 || e === "task"), ke = [...Dt(n, R)];
330
- if (Q) {
331
- const l = n.map((I) => I.name), S = R.filter((I) => !l.includes(I));
332
- S.length && ke.push(...S.map((I) => ({ name: I, fullName: I })));
359
+ }, ye = (e === "task" || e === "version") && (A.length > 0 || e === "task"), Ce = [..._t(s, A)];
360
+ if (ye) {
361
+ const d = s.map((B) => B.name), P = A.filter((B) => !d.includes(B));
362
+ P.length && Ce.push(...P.map((B) => ({ name: B, fullName: B })));
333
363
  }
334
- const { title: Ce, subTitle: ge } = at(t, e), fe = w?.length !== 0 && w?.find((l) => l.name === P[0]);
335
- return /* @__PURE__ */ i(Lt, { children: /* @__PURE__ */ i(
336
- Jt,
364
+ const { title: Z, subTitle: _ } = gt(t, e), ee = k?.length !== 0 && k?.find((d) => d.name === F[0]);
365
+ return /* @__PURE__ */ i(Xt, { children: /* @__PURE__ */ i(
366
+ dn,
337
367
  {
338
368
  entities: t,
339
369
  entityType: e,
340
- projectName: ee,
341
- thumbnailInputRef: $,
370
+ projectName: se,
371
+ thumbnailInputRef: V,
342
372
  versionsInputRef: U,
343
- onVersionCreated: (l) => x?.(l, "version"),
344
- children: /* @__PURE__ */ k(Ut, { className: le("details-panel-header", { isCompact: m }), children: [
345
- /* @__PURE__ */ k(
346
- _t,
373
+ onVersionCreated: (d) => N?.(d, "version"),
374
+ children: /* @__PURE__ */ x(Yt, { className: fe("details-panel-header", { isCompact: u }), children: [
375
+ /* @__PURE__ */ x(
376
+ Zt,
347
377
  {
348
- className: le("titles", { isCompact: m, loading: M }, "no-shimmer"),
378
+ className: fe("titles", { isCompact: u, loading: M }, "no-shimmer"),
349
379
  children: [
350
- /* @__PURE__ */ k("div", { style: { position: "relative" }, children: [
380
+ /* @__PURE__ */ x("div", { style: { position: "relative" }, children: [
351
381
  /* @__PURE__ */ i(
352
- Ye,
382
+ rt,
353
383
  {
354
384
  isLoading: M,
355
385
  shimmer: M,
356
- thumbnails: ne,
357
- onClick: ye ? _ : void 0,
358
- hoverIcon: ve ? "play_circle" : void 0
386
+ thumbnails: ue,
387
+ onClick: ve ? Se : void 0,
388
+ hoverIcon: be ? "play_circle" : void 0
359
389
  }
360
390
  ),
361
- ve && /* @__PURE__ */ i(fs, {})
391
+ be && /* @__PURE__ */ i(An, {})
362
392
  ] }),
363
- /* @__PURE__ */ k(Mt, { className: le({ loading: M }), children: [
364
- /* @__PURE__ */ k(Ht, { children: [
365
- /* @__PURE__ */ i("h2", { children: Ce }),
366
- J ? /* @__PURE__ */ k(xe, { children: [
393
+ /* @__PURE__ */ x(en, { className: fe({ loading: M }), children: [
394
+ /* @__PURE__ */ x(tn, { children: [
395
+ /* @__PURE__ */ i("h2", { children: Z }),
396
+ K ? /* @__PURE__ */ x(Ie, { children: [
367
397
  /* @__PURE__ */ i(
368
- Bt,
398
+ nn,
369
399
  {
370
- ref: E,
371
- value: ue(...W),
372
- tags: ce,
400
+ ref: D,
401
+ value: ke(...q),
402
+ tags: me,
373
403
  options: [],
374
404
  editable: !0,
375
405
  editor: !0,
376
- onChange: (l) => {
377
- L?.addTags(l.filter((S) => !oe.includes(S))), re("tags", l);
406
+ onChange: (d) => {
407
+ j?.addTags(d.filter((P) => !J.includes(P))), ae("tags", d);
378
408
  },
379
- mixedCounts: F ? de : void 0,
409
+ mixedCounts: H ? X : void 0,
380
410
  mixedTotal: t.length,
381
411
  mixedLabel: `${e}s`,
382
- onMixedChange: (l) => z("tags", l),
383
- onEditOption: L?.onEditOption,
412
+ onMixedChange: (d) => Y("tags", d),
413
+ onEditOption: j?.onEditOption,
384
414
  editOptionTooltip: "Change the colour in the project tags",
385
415
  align: "right",
386
416
  styleDropdown: { display: M ? "none" : "unset" },
@@ -388,117 +418,117 @@ const Rs = T(Qe)`
388
418
  itemClassName: "details-tag"
389
419
  }
390
420
  ),
391
- L && /* @__PURE__ */ i(hs, { ...L.dialog })
392
- ] }) : /* @__PURE__ */ i(Wt, { className: "tags-select", children: ue(...W).length ? ue(...W).map((l) => {
393
- const S = ce[l]?.color;
421
+ j && /* @__PURE__ */ i(En, { ...j.dialog })
422
+ ] }) : /* @__PURE__ */ i(sn, { className: "tags-select", children: ke(...q).length ? ke(...q).map((d) => {
423
+ const P = me[d]?.color;
394
424
  return /* @__PURE__ */ i(
395
425
  "span",
396
426
  {
397
427
  style: {
398
- backgroundColor: S || void 0,
399
- color: S ? Fe(S) : void 0
428
+ backgroundColor: P || void 0,
429
+ color: P ? Re(P) : void 0
400
430
  },
401
- children: l
431
+ children: d
402
432
  },
403
- l
433
+ d
404
434
  );
405
435
  }) : "-" })
406
436
  ] }),
407
- /* @__PURE__ */ k("div", { className: "sub-title", children: [
408
- /* @__PURE__ */ k("span", { className: "entity-type", children: [
409
- Ze(e),
437
+ /* @__PURE__ */ x("div", { className: "sub-title", children: [
438
+ /* @__PURE__ */ x("span", { className: "entity-type", children: [
439
+ lt(e),
410
440
  " - "
411
441
  ] }),
412
- /* @__PURE__ */ i("h3", { children: ge })
442
+ /* @__PURE__ */ i("h3", { children: _ })
413
443
  ] }),
414
- e === "version" && !F && !M && V && /* @__PURE__ */ i(
415
- Ws,
444
+ e === "version" && !H && !M && R && /* @__PURE__ */ i(
445
+ is,
416
446
  {
417
- entity: V,
418
- taskTypes: g.taskTypes
447
+ entity: R,
448
+ taskTypes: h.taskTypes
419
449
  },
420
- V.id
450
+ R.id
421
451
  )
422
452
  ] })
423
453
  ]
424
454
  }
425
455
  ),
426
456
  /* @__PURE__ */ i(
427
- zt,
457
+ an,
428
458
  {
429
- value: P,
430
- options: w || [],
459
+ value: F,
460
+ options: k || [],
431
461
  disabledValues: a,
432
- disableOpen: !Se,
462
+ disableOpen: !$,
433
463
  invert: !0,
434
464
  style: { maxWidth: "unset" },
435
- onChange: (l) => re("status", l),
436
- className: le("status-select", { loading: M }),
437
- align: m ? "right" : "left",
438
- $textColor: Fe(fe !== void 0 ? fe.color : "#OOO")
465
+ onChange: (d) => ae("status", d),
466
+ className: fe("status-select", { loading: M }),
467
+ align: u ? "right" : "left",
468
+ $textColor: Re(ee !== void 0 ? ee.color : "#OOO")
439
469
  }
440
470
  ),
441
- !m && (!Q || M ? /* @__PURE__ */ i("div", {}) : /* @__PURE__ */ i(
442
- Gt,
471
+ !u && (!ye || M ? /* @__PURE__ */ i("div", {}) : /* @__PURE__ */ i(
472
+ on,
443
473
  {
444
- value: R,
445
- options: ke,
446
- disabledValues: o.map((l) => l.name),
447
- isMultiple: F && R.length > 1 && e === "task",
474
+ value: A,
475
+ options: Ce,
476
+ disabledValues: o.map((d) => d.name),
477
+ isMultiple: H && A.length > 1 && e === "task",
448
478
  readOnly: !ie,
449
479
  emptyMessage: ie ? "Assign user" : "-",
450
480
  align: "right",
451
- onChange: (l) => re("assignees", l),
452
- mixedCounts: F && e === "task" ? he : void 0,
481
+ onChange: (d) => ae("assignees", d),
482
+ mixedCounts: H && e === "task" ? xe : void 0,
453
483
  mixedTotal: t.length,
454
484
  mixedLabel: `${e}s`,
455
- onMixedChange: (l) => z("assignees", l),
485
+ onMixedChange: (d) => Y("assignees", d),
456
486
  className: "assignee-select",
457
- "data-tooltip": R.length ? e === "task" ? "Assigned users" : "Author" : ""
487
+ "data-tooltip": A.length ? e === "task" ? "Assigned users" : "Author" : ""
458
488
  }
459
489
  )),
460
490
  /* @__PURE__ */ i(
461
- us,
491
+ Tn,
462
492
  {
463
493
  entities: t,
464
494
  entityType: e,
465
- entitySubTypes: s,
466
- isLoadingEntity: !!c || !!M,
467
- searchParams: N,
468
- bundleMode: u,
469
- onSetSearchParams: j,
470
- onNavigate: h
495
+ entitySubTypes: n,
496
+ isLoadingEntity: !!l || !!M,
497
+ searchParams: E,
498
+ bundleMode: g,
499
+ onSetSearchParams: T,
500
+ onNavigate: C
471
501
  }
472
502
  ),
473
- se ? /* @__PURE__ */ i(
474
- Qt,
503
+ de ? /* @__PURE__ */ i(
504
+ rn,
475
505
  {
476
- options: se,
506
+ options: de,
477
507
  placeholder: "No priority",
478
- value: ae,
479
- onChange: (l) => re("attrib", { priority: l[0] }),
508
+ value: pe,
509
+ onChange: (d) => ae("attrib", { priority: d[0] }),
480
510
  align: "right"
481
511
  }
482
512
  ) : /* @__PURE__ */ i("div", { style: { height: 32 } }),
483
513
  /* @__PURE__ */ i(
484
- Ms,
514
+ ss,
485
515
  {
486
516
  entityType: e,
487
517
  currentTab: f,
488
- onTabChange: p,
518
+ onTabChange: m,
489
519
  isLoading: M
490
520
  }
491
521
  )
492
522
  ] })
493
523
  }
494
524
  ) });
495
- }, Gs = T.div`
525
+ }, ls = I.div`
496
526
  display: flex;
497
527
  flex-direction: column;
498
528
 
499
529
  height: 100%;
500
530
  overflow: hidden;
501
- `, Be = T.div`
531
+ `, Xe = I.div`
502
532
  position: relative;
503
533
  flex: 1;
504
534
  display: flex;
@@ -512,40 +542,40 @@ const Rs = T(Qe)`
512
542
  &:first-child {
513
543
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
514
544
  }
515
- `, Qs = ({
545
+ `, cs = ({
516
546
  entities: e = [],
517
- scope: s,
547
+ scope: n,
518
548
  isLoadingVersion: t
519
549
  }) => {
520
550
  const o = e[0];
521
551
  if (!o) return null;
522
- let n = "Reviewables";
523
- return e.length > 1 && (n += ` (${o.name})`), e.some((a) => a.entityType !== "version") ? null : /* @__PURE__ */ k(Gs, { children: [
524
- /* @__PURE__ */ k(Be, { children: [
525
- /* @__PURE__ */ i("h4", { children: n }),
552
+ let s = "Reviewables";
553
+ return e.length > 1 && (s += ` (${o.name})`), e.some((a) => a.entityType !== "version") ? null : /* @__PURE__ */ x(ls, { children: [
554
+ /* @__PURE__ */ x(Xe, { children: [
555
+ /* @__PURE__ */ i("h4", { children: s }),
526
556
  /* @__PURE__ */ i(
527
- Xt,
557
+ un,
528
558
  {
529
559
  projectName: o.projectName,
530
560
  productId: o.product?.id,
531
561
  versionId: o.id,
532
562
  isLoadingVersion: t,
533
- scope: s
563
+ scope: n
534
564
  }
535
565
  )
536
566
  ] }),
537
- /* @__PURE__ */ k(Be, { children: [
567
+ /* @__PURE__ */ x(Xe, { children: [
538
568
  /* @__PURE__ */ i("h4", { children: "Representations" }),
539
- /* @__PURE__ */ i(bs, { entities: e })
569
+ /* @__PURE__ */ i(Fn, { entities: e })
540
570
  ] })
541
571
  ] });
542
- }, qs = ({
572
+ }, ds = ({
543
573
  latestVersion: e,
544
- resolveVersionJump: s
574
+ resolveVersionJump: n
545
575
  }) => {
546
- const t = s?.(e.id);
576
+ const t = n?.(e.id);
547
577
  return /* @__PURE__ */ i(
548
- vs,
578
+ jn,
549
579
  {
550
580
  variant: "info",
551
581
  compact: !0,
@@ -559,138 +589,142 @@ const Rs = T(Qe)`
559
589
  } : void 0
560
590
  }
561
591
  );
562
- }, Ks = (e) => {
563
- const s = e?.version?.version, t = e?.product?.latestVersion;
564
- if (!(e?.entityType !== "version" || !s || s <= 0 || !t?.active))
565
- return t.version > s ? t : void 0;
566
- }, Js = () => ({
567
- onOpenVersionUpload: xs()?.onOpenVersionUpload ?? null
568
- }), Xs = (e, s, t) => {
592
+ }, us = (e) => {
593
+ const n = e?.version?.version, t = e?.product?.latestVersion;
594
+ if (!(e?.entityType !== "version" || !n || n <= 0 || !t?.active))
595
+ return t.version > n ? t : void 0;
596
+ }, ps = () => ({
597
+ onOpenVersionUpload: Vn()?.onOpenVersionUpload ?? null
598
+ }), ms = (e, n, t) => {
569
599
  const o = e === "folder" || e === "task" ? "overview" : e === "product" || e === "version" || e === "representation" ? "products" : null;
570
- return o ? `${typeof window < "u" ? window.location.origin : ""}/projects/${t}/${o}?project=${t}&type=${e}&id=${s}` : null;
571
- }, Ys = ({
600
+ return o ? `${typeof window < "u" ? window.location.origin : ""}/projects/${t}/${o}?project=${t}&type=${e}&id=${n}` : null;
601
+ }, hs = ({
572
602
  entityType: e,
573
- entityId: s,
603
+ entityId: n,
574
604
  projectName: t,
575
605
  selectedEntities: o,
576
- deleteEntities: n,
606
+ deleteEntities: s,
577
607
  canUploadThumbnail: a,
578
608
  canUploadVersion: r,
579
- canOpenPip: c,
580
- canOpenViewer: m,
609
+ canOpenPip: l,
610
+ canOpenViewer: u,
581
611
  canDelete: f,
582
- entityListsContext: p,
583
- onPip: g,
584
- onOpenViewer: b,
585
- onUploadThumbnail: x,
586
- onUploadVersion: $,
587
- onShare: U,
588
- onViewData: A,
589
- onDelete: d
612
+ entityListsContext: m,
613
+ extraTopItems: h = [],
614
+ extraItems: b = [],
615
+ onPip: N,
616
+ onOpenViewer: V,
617
+ onUploadThumbnail: U,
618
+ onUploadVersion: O,
619
+ onShare: c,
620
+ onViewData: g,
621
+ onDelete: C
590
622
  }) => {
591
- const u = C(() => o.length ? o.filter((h) => !!h?.entityId).map((h) => ({
592
- entityId: h.entityId,
593
- entityType: h.entityType || e,
594
- hasReviewables: h.hasReviewables
595
- })) : s ? [{ entityId: s, entityType: e }] : [], [o, s, e]);
596
- return C(() => {
597
- const h = [];
598
- if (m && h.push({
623
+ const E = w(() => o.length ? o.filter((T) => !!T?.entityId).map((T) => ({
624
+ entityId: T.entityId,
625
+ entityType: T.entityType || e,
626
+ hasReviewables: T.hasReviewables
627
+ })) : n ? [{ entityId: n, entityType: e }] : [], [o, n, e]);
628
+ return w(() => {
629
+ const T = [...h];
630
+ if (u && T.push({
599
631
  id: "open-in-viewer",
600
632
  label: "Open in viewer",
601
633
  icon: "play_circle",
602
- onClick: b
603
- }), c && h.push({
634
+ onClick: V
635
+ }), l && T.push({
604
636
  id: "picture-in-picture",
605
637
  label: "Picture in picture",
606
638
  icon: "picture_in_picture",
607
- onClick: g
608
- }), a && h.push({
639
+ onClick: N
640
+ }), a && T.push({
609
641
  id: "upload-thumbnail",
610
642
  label: "Upload thumbnail",
611
643
  icon: "add_photo_alternate",
612
- onClick: x
613
- }), r && h.push({
644
+ onClick: U
645
+ }), r && T.push({
614
646
  id: "upload-version",
615
647
  label: "Upload version",
616
648
  icon: "upload",
617
- onClick: $
618
- }), p?.openAddToListDialog && t && u.length) {
619
- const E = u[0]?.entityType || e, y = p.openAddToListDialog;
620
- if (h.push({
649
+ onClick: O
650
+ }), m?.openAddToListDialog && t && E.length) {
651
+ const k = E[0]?.entityType || e, A = m.openAddToListDialog;
652
+ if (T.push({
621
653
  id: "add-to-list",
622
654
  label: "Add to list",
623
655
  icon: "list_alt_add",
624
- onClick: () => y(E, u)
625
- }), (E === "version" || E === "representation") && p.hasReviewAddon) {
626
- const R = u.some((V) => V.hasReviewables === !0);
627
- h.push({
656
+ onClick: () => A(k, E)
657
+ }), (k === "version" || k === "representation") && m.hasReviewAddon) {
658
+ const M = E.some((se) => se.hasReviewables === !0);
659
+ T.push({
628
660
  id: "add-to-review-list",
629
661
  label: "Add to session",
630
662
  icon: "list_alt_add",
631
- disabled: !R,
632
- ...R ? {} : { "data-tooltip": "No reviewables on selected version" },
633
- onClick: () => y(E, u, { isReview: !0 })
663
+ disabled: !M,
664
+ ...M ? {} : { "data-tooltip": "No reviewables on selected version" },
665
+ onClick: () => A(k, E, { isReview: !0 })
634
666
  });
635
667
  }
636
668
  }
637
- const N = u[0], j = N?.entityId && t ? Xs(
638
- N.entityType || e,
639
- N.entityId,
669
+ const D = E[0], y = D?.entityId && t ? ms(
670
+ D.entityType || e,
671
+ D.entityId,
640
672
  t
641
673
  ) : null;
642
- if (j && h.push({
674
+ if (y && T.push({
643
675
  id: "share",
644
676
  label: "Share",
645
677
  icon: "share",
646
- onClick: () => U(j)
647
- }), h.push({
678
+ onClick: () => c(y)
679
+ }), T.push(...b), T.push({
648
680
  id: "view-data",
649
681
  label: "View data",
650
682
  icon: "database",
651
- onClick: A
652
- }), f && n.length > 0) {
653
- const E = new Set(n.map((R) => R.entityType)), y = E.size === 1 ? [...E][0] : "item", w = n.length === 1 ? `Delete ${y}` : `Delete ${Ss(n.length, y)}`;
654
- h.push({
683
+ onClick: g
684
+ }), f && s.length > 0) {
685
+ const k = new Set(s.map((M) => M.entityType)), A = k.size === 1 ? [...k][0] : "item", R = s.length === 1 ? `Delete ${A}` : `Delete ${$n(s.length, A)}`;
686
+ T.push({
655
687
  id: "delete",
656
- label: w,
688
+ label: R,
657
689
  icon: "delete",
658
690
  danger: !0,
659
- onClick: d
691
+ onClick: C
660
692
  });
661
693
  }
662
- return { items: h, shareLink: j };
694
+ return { items: T, shareLink: y };
663
695
  }, [
664
- c,
665
- m,
696
+ l,
697
+ u,
666
698
  a,
667
699
  r,
668
700
  f,
669
- n,
670
- p,
701
+ s,
702
+ m,
703
+ h,
704
+ b,
671
705
  t,
672
- u,
706
+ E,
673
707
  e,
674
- g,
675
- b,
676
- x,
677
- $,
708
+ N,
709
+ V,
678
710
  U,
679
- A,
680
- d
711
+ O,
712
+ c,
713
+ g,
714
+ C
681
715
  ]);
682
- }, Zs = T.div`
716
+ }, gs = I.div`
683
717
  display: flex;
684
718
  flex-direction: column;
685
719
  gap: 16px;
686
- `, We = T.div`
720
+ `, Ye = I.div`
687
721
  display: flex;
688
722
  flex-direction: column;
689
723
  gap: 6px;
690
- `, ze = T.span`
724
+ `, Ze = I.span`
691
725
  font-size: 13px;
692
726
  color: var(--md-sys-color-on-surface);
693
- `, Ge = T.button`
727
+ `, et = I.button`
694
728
  display: flex;
695
729
  align-items: center;
696
730
  gap: 12px;
@@ -719,247 +753,308 @@ const Rs = T(Qe)`
719
753
  text-overflow: ellipsis;
720
754
  white-space: nowrap;
721
755
  }
722
- `, en = ({ link: e, entityLabel: s, visible: t, onHide: o }) => {
756
+ `, fs = ({ link: e, entityLabel: n, visible: t, onHide: o }) => {
723
757
  if (!t) return null;
724
- const n = `[${s}](${e})`, a = (r) => {
725
- Cs(r, !0), o();
758
+ const s = `[${n}](${e})`, a = (r) => {
759
+ Un(r, !0), o();
726
760
  };
727
- return /* @__PURE__ */ i(wt, { isOpen: !0, onClose: o, size: "sm", header: "Share", children: /* @__PURE__ */ k(Zs, { children: [
728
- /* @__PURE__ */ k(We, { children: [
729
- /* @__PURE__ */ i(ze, { children: "Link" }),
730
- /* @__PURE__ */ k(Ge, { type: "button", onClick: () => a(e), "aria-label": "Copy link", children: [
761
+ return /* @__PURE__ */ i(jt, { isOpen: !0, onClose: o, size: "sm", header: "Share", children: /* @__PURE__ */ x(gs, { children: [
762
+ /* @__PURE__ */ x(Ye, { children: [
763
+ /* @__PURE__ */ i(Ze, { children: "Link" }),
764
+ /* @__PURE__ */ x(et, { type: "button", onClick: () => a(e), "aria-label": "Copy link", children: [
731
765
  /* @__PURE__ */ i("span", { className: "value", children: e }),
732
- /* @__PURE__ */ i(we, { icon: "content_copy" })
766
+ /* @__PURE__ */ i(Ee, { icon: "content_copy" })
733
767
  ] })
734
768
  ] }),
735
- /* @__PURE__ */ k(We, { children: [
736
- /* @__PURE__ */ i(ze, { children: "Markdown Link" }),
737
- /* @__PURE__ */ k(Ge, { type: "button", onClick: () => a(n), "aria-label": "Copy markdown link", children: [
738
- /* @__PURE__ */ i("span", { className: "value", children: n }),
739
- /* @__PURE__ */ i(we, { icon: "content_copy" })
769
+ /* @__PURE__ */ x(Ye, { children: [
770
+ /* @__PURE__ */ i(Ze, { children: "Markdown Link" }),
771
+ /* @__PURE__ */ x(et, { type: "button", onClick: () => a(s), "aria-label": "Copy markdown link", children: [
772
+ /* @__PURE__ */ i("span", { className: "value", children: s }),
773
+ /* @__PURE__ */ i(Ee, { icon: "content_copy" })
740
774
  ] })
741
775
  ] })
742
776
  ] }) });
743
- }, tn = (e, s, t, o) => {
744
- const n = { projectName: t, quickView: !0 };
777
+ }, bs = (e, n, t, o) => {
778
+ const s = { projectName: t, quickView: !0 };
745
779
  switch (e) {
746
780
  case "folder":
747
- return { ...n, folderId: s };
781
+ return { ...s, folderId: n };
748
782
  case "task":
749
- return { ...n, taskId: s };
783
+ return { ...s, taskId: n };
750
784
  case "product":
751
- return { ...n, productId: s };
785
+ return { ...s, productId: n };
752
786
  case "version":
753
- return o ? { ...n, productId: o, versionIds: [s] } : null;
787
+ return o ? { ...s, productId: o, versionIds: [n] } : null;
754
788
  default:
755
789
  return null;
756
790
  }
757
- }, sn = ({
791
+ }, vs = ({
758
792
  entityType: e,
759
- entityId: s,
793
+ entityId: n,
760
794
  entityIds: t,
761
795
  entityLabel: o,
762
- projectName: n,
796
+ projectName: s,
763
797
  selectedEntities: a = [],
764
798
  entityListsContext: r,
765
- onOpenPip: c,
766
- onOpenViewer: m,
799
+ onOpenPip: l,
800
+ onOpenViewer: u,
767
801
  productId: f,
768
- taskId: p,
769
- folderId: g
802
+ taskId: m,
803
+ folderId: h
770
804
  }) => {
771
- const b = Z(null), [x, $] = X(!1), [U, A] = X(null), { menuOpen: d, toggleMenuOpen: u, setMenuOpen: h } = ss(), { triggerThumbnailUpload: N, canUploadVersion: j } = Tt(ns), { onOpenVersionUpload: E } = Js(), y = Nt(), w = C(() => {
772
- const L = s || t?.[0] || "noentity";
773
- return `details-more-menu-${y}-${L}-${n || "noproject"}`;
774
- }, [y, s, t, n]), R = d === w, V = !!s && !!n && !!N, M = !!j && !!E, ee = () => {
775
- E?.({ productId: f, taskId: p, folderId: g });
776
- }, te = s && n ? tn(e, s, n, f) : null, se = !!m && !!te, ne = as(), P = C(() => (a.length ? a : s ? [{ entityId: s, entityType: e, projectName: n }] : []).map((F) => {
777
- const de = F.entityType || e, he = F.projectName || n;
778
- return !os(de) || !F.entityId || !he ? null : {
779
- id: F.entityId,
780
- entityType: de,
781
- name: F.name,
782
- label: F.label,
783
- projectName: he,
784
- folderId: F.folderId,
785
- parentId: F.parentId
805
+ const b = le(null), [N, V] = oe(!1), [U, O] = oe(null), { menuOpen: c, toggleMenuOpen: g, setMenuOpen: C } = fn(), { triggerThumbnailUpload: E, canUploadVersion: T } = Vt(bn), { onOpenVersionUpload: D } = ps(), y = $t(), k = w(() => {
806
+ const v = n || t?.[0] || "noentity";
807
+ return `details-more-menu-${y}-${v}-${s || "noproject"}`;
808
+ }, [y, n, t, s]), A = c === k, R = !!n && !!s && !!E, M = !!T && !!D, se = () => {
809
+ D?.({ productId: f, taskId: m, folderId: h });
810
+ }, ce = n && s ? bs(e, n, s, f) : null, de = !!u && !!ce, ue = vn(), F = w(() => (a.length ? a : n ? [{ entityId: n, entityType: e, projectName: s }] : []).map(($) => {
811
+ const K = $.entityType || e, ie = $.projectName || s;
812
+ return !yn(K) || !$.entityId || !ie ? null : {
813
+ id: $.entityId,
814
+ entityType: K,
815
+ name: $.name,
816
+ label: $.label,
817
+ projectName: ie,
818
+ folderId: $.folderId,
819
+ parentId: $.parentId
820
+ };
821
+ }).filter(($) => $ !== null), [a, n, e, s]), pe = !!ue && F.length > 0, q = () => {
822
+ C(!1), ue?.deleteEntities(F);
823
+ }, { contributions: me } = dt("detailsPanel.menuItem"), J = w(
824
+ () => me.filter(
825
+ (v) => !v.entityTypes?.length || v.entityTypes.includes(e)
826
+ ),
827
+ [me, e]
828
+ ), he = w(() => {
829
+ const v = a.length ? a : n ? [{ entityId: n, entityType: e, projectName: s }] : [];
830
+ return {
831
+ projectName: s || "",
832
+ entityType: e,
833
+ selectedEntities: v.map(($) => ({
834
+ id: $.entityId,
835
+ entityType: $.entityType || e,
836
+ projectName: $.projectName || s || "",
837
+ name: $.name,
838
+ label: $.label || void 0
839
+ }))
786
840
  };
787
- }).filter((F) => F !== null), [a, s, e, n]), ae = !!ne && P.length > 0, W = () => {
788
- h(!1), ne?.deleteEntities(P);
789
- }, { items: ce } = Ys({
841
+ }, [a, n, e, s]), j = Ut(
842
+ (v) => ({
843
+ id: v.key,
844
+ label: v.label,
845
+ icon: v.icon,
846
+ "data-addon-item": v.key,
847
+ onClick: () => Je(v, he)
848
+ }),
849
+ [he]
850
+ ), H = w(
851
+ () => [
852
+ ...Ne(J, "top"),
853
+ ...Ne(J, "bottom")
854
+ ].filter((v) => v.pinned),
855
+ [J]
856
+ ), X = w(
857
+ () => J.filter((v) => !v.pinned),
858
+ [J]
859
+ ), xe = w(
860
+ () => Ne(X, "top").map(j),
861
+ [X, j]
862
+ ), be = w(
863
+ () => Ne(X, "bottom").map(j),
864
+ [X, j]
865
+ );
866
+ G(() => {
867
+ A && X.forEach((v) => Le(v.run));
868
+ }, [A, X]);
869
+ const { items: ve } = hs({
790
870
  entityType: e,
791
- entityId: s,
792
- projectName: n,
871
+ entityId: n,
872
+ projectName: s,
793
873
  selectedEntities: a,
794
- deleteEntities: P,
795
- canUploadThumbnail: V,
874
+ deleteEntities: F,
875
+ canUploadThumbnail: R,
796
876
  canUploadVersion: M,
797
- canOpenPip: !!c,
798
- canOpenViewer: se,
799
- canDelete: ae,
877
+ canOpenPip: !!l,
878
+ canOpenViewer: de,
879
+ canDelete: pe,
800
880
  entityListsContext: r,
801
- onPip: () => c?.(),
802
- onOpenViewer: () => te && m?.(te),
803
- onUploadThumbnail: () => N?.(),
804
- onUploadVersion: ee,
805
- onShare: (L) => A(L),
806
- onViewData: () => $(!0),
807
- onDelete: W
808
- }), oe = t?.length ? t : s ? [s] : [], pe = o || s || "";
809
- return /* @__PURE__ */ k(xe, { children: [
881
+ extraTopItems: xe,
882
+ extraItems: be,
883
+ onPip: () => l?.(),
884
+ onOpenViewer: () => ce && u?.(ce),
885
+ onUploadThumbnail: () => E?.(),
886
+ onUploadVersion: se,
887
+ onShare: (v) => O(v),
888
+ onViewData: () => V(!0),
889
+ onDelete: q
890
+ }), S = t?.length ? t : n ? [n] : [], ge = o || n || "";
891
+ return /* @__PURE__ */ x(Ie, { children: [
892
+ H.map((v) => /* @__PURE__ */ i(
893
+ te,
894
+ {
895
+ icon: v.icon,
896
+ variant: "text",
897
+ "data-tooltip": v.label,
898
+ "aria-label": v.label,
899
+ "data-addon-item": v.key,
900
+ onMouseEnter: () => Le(v.run),
901
+ onClick: () => Je(v, he)
902
+ },
903
+ v.key
904
+ )),
810
905
  /* @__PURE__ */ i(
811
- Y,
906
+ te,
812
907
  {
813
908
  ref: b,
814
909
  icon: "more_horiz",
815
910
  variant: "text",
816
911
  "data-tooltip": "More actions",
817
912
  "aria-label": "More actions",
818
- className: le({ active: R }),
819
- onClick: () => u(w)
913
+ className: fe({ active: A }),
914
+ onClick: () => g(k)
820
915
  }
821
916
  ),
822
- /* @__PURE__ */ i(ys, { id: w, target: b.current, align: "right", children: /* @__PURE__ */ i(ks, { menu: ce, onClose: () => h(!1) }) }),
823
- x && n && oe.length > 0 && /* @__PURE__ */ i(
824
- ws,
917
+ /* @__PURE__ */ i(On, { id: k, target: b.current, align: "right", children: /* @__PURE__ */ i(Rn, { menu: ve, onClose: () => C(!1) }) }),
918
+ N && s && S.length > 0 && /* @__PURE__ */ i(
919
+ Ln,
825
920
  {
826
- projectName: n,
921
+ projectName: s,
827
922
  entityType: e,
828
- entityIds: oe,
829
- visible: x,
830
- onHide: () => $(!1)
923
+ entityIds: S,
924
+ visible: N,
925
+ onHide: () => V(!1)
831
926
  }
832
927
  ),
833
928
  U && /* @__PURE__ */ i(
834
- en,
929
+ fs,
835
930
  {
836
931
  link: U,
837
- entityLabel: pe,
932
+ entityLabel: ge,
838
933
  visible: !0,
839
- onHide: () => A(null)
934
+ onHide: () => O(null)
840
935
  }
841
936
  )
842
937
  ] });
843
- }, nn = (e, s) => {
938
+ }, ys = (e, n) => {
844
939
  const t = [e];
845
940
  let o = e;
846
941
  for (; o.parentId && o.parentId !== "root"; ) {
847
- const n = s.get(o.parentId);
848
- if (!n)
942
+ const s = n.get(o.parentId);
943
+ if (!s)
849
944
  break;
850
- t.unshift(n), o = n;
945
+ t.unshift(s), o = s;
851
946
  }
852
947
  return t;
853
- }, an = (e, s) => {
948
+ }, ks = (e, n) => {
854
949
  const t = [];
855
- let o = s.get(e.folder?.id || "");
856
- if ((o ? nn(o, s) : []).forEach((a) => {
950
+ let o = n.get(e.folder?.id || "");
951
+ if ((o ? ys(o, n) : []).forEach((a) => {
857
952
  t.push({ type: "folder", label: a.label || a.name, id: a.id });
858
953
  }), e.entityType === "version") {
859
954
  const a = `${e.product?.name} - ${e.name}`;
860
955
  t.push({ type: "version", label: a, id: e.id });
861
956
  }
862
957
  return e.entityType === "task" && t.push({ type: "task", label: e.label || e.name, id: e.id }), t;
863
- }, on = ({
958
+ }, ws = ({
864
959
  entity: e,
865
- entityType: s,
960
+ entityType: n,
866
961
  projectName: t,
867
962
  isLoading: o
868
963
  }) => {
869
- const { data: { folders: n = [] } = {}, isFetching: a } = Ft(
964
+ const { data: { folders: s = [] } = {}, isFetching: a } = Wt(
870
965
  // TODO: this is major overkill, we are only using label, name and id
871
966
  // We add a patch field that allows us to specify what ws message changes should cause an update to this query
872
967
  // @ts-expect-error - patch is not part of the query args
873
968
  { projectName: t, patch: ["id", "name", "label"] },
874
969
  { skip: !t || o }
875
- ), r = Ts(
970
+ ), r = Mn(
876
971
  { projectName: t || "", isLoading: o },
877
972
  a
878
- ), { data: c } = At(
973
+ ), { data: l } = zt(
879
974
  { productId: e.product?.id || "", projectName: t },
880
- { skip: s !== "version" || !e.product?.id }
881
- ), m = C(
882
- () => c?.project.product?.versionList ? [...c.project.product?.versionList || []].sort((g, b) => g.name === "HERO" ? -1 : b.name === "HERO" ? 1 : b.name.localeCompare(g.name)).map((g) => ({
975
+ { skip: n !== "version" || !e.product?.id }
976
+ ), u = w(
977
+ () => l?.project.product?.versionList ? [...l.project.product?.versionList || []].sort((h, b) => h.name === "HERO" ? -1 : b.name === "HERO" ? 1 : b.name.localeCompare(h.name)).map((h) => ({
883
978
  type: "version",
884
- label: g.name,
885
- id: g.id
979
+ label: h.name,
980
+ id: h.id
886
981
  })) : [],
887
- [c]
888
- ), f = C(
889
- () => new Map(n.map((g) => [g.id, g])),
890
- [n]
982
+ [l]
983
+ ), f = w(
984
+ () => new Map(s.map((h) => [h.id, h])),
985
+ [s]
891
986
  );
892
- return [C(
893
- () => r ? [] : an(e, f),
894
- [r, n, e]
895
- ), m];
896
- }, ot = (e, s) => {
897
- let t = Object.entries(e).filter(([n]) => s ? s.includes(n) : !0).map(([, n]) => n?.statuses || []).flat();
898
- const o = new Map(t.map((n) => [n.name, n]));
987
+ return [w(
988
+ () => r ? [] : ks(e, f),
989
+ [r, s, e]
990
+ ), u];
991
+ }, ft = (e, n) => {
992
+ let t = Object.entries(e).filter(([s]) => n ? n.includes(s) : !0).map(([, s]) => s?.statuses || []).flat();
993
+ const o = new Map(t.map((s) => [s.name, s]));
899
994
  return Array.from(o.values());
900
- }, it = ({
995
+ }, bt = ({
901
996
  scope: e = "dashboard",
902
- entities: s,
997
+ entities: n,
903
998
  entityType: t,
904
999
  thumbnailHash: o,
905
- projectName: n,
1000
+ projectName: s,
906
1001
  projectInfo: a,
907
1002
  annotations: r,
908
- removeAnnotation: c,
909
- exportAnnotationComposite: m,
1003
+ removeAnnotation: l,
1004
+ exportAnnotationComposite: u,
910
1005
  ...f
911
1006
  }) => {
912
- const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = K(), b = g.name || "", x = g.attrib?.fullName || "";
913
- return /* @__PURE__ */ k(
914
- tt,
1007
+ const m = { annotations: r, removeAnnotation: l, exportAnnotationComposite: u }, { user: h } = ne(), b = h.name || "", N = h.attrib?.fullName || "";
1008
+ return /* @__PURE__ */ x(
1009
+ ut,
915
1010
  {
916
1011
  scope: e,
917
- entities: s,
918
- projectName: n,
1012
+ entities: n,
1013
+ projectName: s,
919
1014
  entityType: t,
920
1015
  projectInfo: a,
921
1016
  userName: b,
922
- userFullName: x,
923
- ...p,
1017
+ userFullName: N,
1018
+ ...m,
924
1019
  ...f,
925
1020
  children: [
926
- /* @__PURE__ */ i(Ns, { ...f, statuses: f.statuses }),
927
- /* @__PURE__ */ i(Es, {})
1021
+ /* @__PURE__ */ i(_n, { ...f, statuses: f.statuses }),
1022
+ /* @__PURE__ */ i(Hn, {})
928
1023
  ]
929
1024
  }
930
1025
  );
931
- }, rn = ({
1026
+ }, xs = ({
932
1027
  children: e,
933
- scope: s = "dashboard",
1028
+ scope: n = "dashboard",
934
1029
  entities: t,
935
1030
  entityType: o,
936
- projectName: n,
1031
+ projectName: s,
937
1032
  projectInfo: a,
938
1033
  annotations: r,
939
- removeAnnotation: c,
940
- exportAnnotationComposite: m,
1034
+ removeAnnotation: l,
1035
+ exportAnnotationComposite: u,
941
1036
  ...f
942
1037
  }) => {
943
- const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = K(), b = g?.name ?? "", x = g?.attrib?.fullName ?? "", [$, U] = X(null);
1038
+ const m = { annotations: r, removeAnnotation: l, exportAnnotationComposite: u }, { user: h } = ne(), b = h?.name ?? "", N = h?.attrib?.fullName ?? "", [V, U] = oe(null);
944
1039
  return /* @__PURE__ */ i(
945
- tt,
1040
+ ut,
946
1041
  {
947
- scope: s,
1042
+ scope: n,
948
1043
  entities: t,
949
- projectName: n,
1044
+ projectName: s,
950
1045
  entityType: o,
951
1046
  projectInfo: a,
952
1047
  userName: b,
953
- userFullName: x,
954
- ...p,
955
- editingId: $,
1048
+ userFullName: N,
1049
+ ...m,
1050
+ editingId: V,
956
1051
  setEditingId: U,
957
1052
  ...f,
958
1053
  children: e
959
1054
  }
960
1055
  );
961
- }, rt = (e, s) => {
962
- if (!e || Object.keys(e).length === 0 || !s?.length)
1056
+ }, vt = (e, n) => {
1057
+ if (!e || Object.keys(e).length === 0 || !n?.length)
963
1058
  return {
964
1059
  folderTypes: [],
965
1060
  taskTypes: [],
@@ -968,8 +1063,8 @@ const Rs = T(Qe)`
968
1063
  linkTypes: [],
969
1064
  productTypes: []
970
1065
  };
971
- if (s.length === 1) {
972
- const a = e[s[0]];
1066
+ if (n.length === 1) {
1067
+ const a = e[n[0]];
973
1068
  return {
974
1069
  folderTypes: a?.folderTypes || [],
975
1070
  taskTypes: a?.taskTypes || [],
@@ -981,10 +1076,10 @@ const Rs = T(Qe)`
981
1076
  }
982
1077
  const t = {}, o = (a) => {
983
1078
  const r = {};
984
- return a.flat().forEach((c) => {
985
- c && c.name && (r[c.name] = c);
1079
+ return a.flat().forEach((l) => {
1080
+ l && l.name && (r[l.name] = l);
986
1081
  }), Object.values(r);
987
- }, n = {
1082
+ }, s = {
988
1083
  statuses: [],
989
1084
  folderTypes: [],
990
1085
  taskTypes: [],
@@ -992,33 +1087,33 @@ const Rs = T(Qe)`
992
1087
  linkTypes: [],
993
1088
  productTypes: []
994
1089
  };
995
- return s.forEach((a) => {
1090
+ return n.forEach((a) => {
996
1091
  const r = e[a];
997
- r && (Object.keys(n).forEach((c) => {
998
- c === "productTypes" ? r.productTypes && n[c].push(r) : Array.isArray(r[c]) && n[c].push(r[c]);
999
- }), Object.keys(r).forEach((c) => {
1000
- c in n || (t[c] = r[c]);
1092
+ r && (Object.keys(s).forEach((l) => {
1093
+ l === "productTypes" ? r.productTypes && s[l].push(r) : Array.isArray(r[l]) && s[l].push(r[l]);
1094
+ }), Object.keys(r).forEach((l) => {
1095
+ l in s || (t[l] = r[l]);
1001
1096
  }));
1002
- }), Object.keys(n).forEach((a) => {
1003
- (a === "productTypes" || n[a].length > 0) && (t[a] = o(n[a]));
1097
+ }), Object.keys(s).forEach((a) => {
1098
+ (a === "productTypes" || s[a].length > 0) && (t[a] = o(s[a]));
1004
1099
  }), t;
1005
- }, ln = T.div`
1100
+ }, Ss = I.div`
1006
1101
  display: flex;
1007
1102
  align-items: center;
1008
1103
  padding: 4px 8px;
1009
1104
  gap: var(--base-gap-small);
1010
- `, cn = T.span`
1105
+ `, Cs = I.span`
1011
1106
  font-weight: 600;
1012
1107
  user-select: none;
1013
- `, dn = T.div`
1108
+ `, Ts = I.div`
1014
1109
  display: flex;
1015
1110
  gap: var(--base-gap-small);
1016
- `, Pe = T(Y)`
1111
+ `, Oe = I(te)`
1017
1112
  background-color: unset;
1018
1113
  &.hasIcon {
1019
1114
  padding: 4px;
1020
1115
  }
1021
- `, un = T.div`
1116
+ `, Ns = I.div`
1022
1117
  display: flex;
1023
1118
  align-items: center;
1024
1119
  gap: var(--base-gap-small);
@@ -1035,10 +1130,10 @@ const Rs = T(Qe)`
1035
1130
  box-shadow: 0 0 0 1px var(--md-sys-color-primary-container);
1036
1131
  background-color: var(--md-sys-color-surface-container-lowest);
1037
1132
  }
1038
- `, pn = T(ms)`
1133
+ `, Es = I(In)`
1039
1134
  width: 28px;
1040
1135
  height: 28px;
1041
- `, hn = T.input`
1136
+ `, Is = I.input`
1042
1137
  flex: 1;
1043
1138
  min-width: 0;
1044
1139
  border: none;
@@ -1051,172 +1146,172 @@ const Rs = T(Qe)`
1051
1146
  &::placeholder {
1052
1147
  color: var(--md-sys-color-outline);
1053
1148
  }
1054
- `, mn = T(Y)`
1149
+ `, Ps = I(te)`
1055
1150
  background-color: unset;
1056
1151
  min-width: unset;
1057
1152
  &.hasIcon {
1058
1153
  padding: 2px;
1059
1154
  }
1060
- `, Oe = (e) => !!e && "key" in e, be = (e, s) => Oe(e) ? e.key === s : !!e.conditions?.some((t) => be(t, s)), Ae = (e) => {
1061
- if (Oe(e)) return String(e.value || "");
1062
- const s = e.operator === "or" ? ", " : ".";
1063
- return e.conditions?.map((t) => Ae(t)).join(s) || "";
1064
- }, lt = (e, s, t) => {
1155
+ `, $e = (e) => !!e && "key" in e, we = (e, n) => $e(e) ? e.key === n : !!e.conditions?.some((t) => we(t, n)), Ve = (e) => {
1156
+ if ($e(e)) return String(e.value || "");
1157
+ const n = e.operator === "or" ? ", " : ".";
1158
+ return e.conditions?.map((t) => Ve(t)).join(n) || "";
1159
+ }, yt = (e, n, t) => {
1065
1160
  const o = e.split(",").map((r) => r.trim()).filter(Boolean);
1066
1161
  if (o.length > 1)
1067
1162
  return {
1068
1163
  operator: "or",
1069
- conditions: o.map((r) => lt(r, s, t))
1164
+ conditions: o.map((r) => yt(r, n, t))
1070
1165
  };
1071
- const n = o[0] || e.trim();
1072
- if (!n || n === "," || n === ".")
1166
+ const s = o[0] || e.trim();
1167
+ if (!s || s === "," || s === ".")
1073
1168
  return {
1074
- key: s,
1169
+ key: n,
1075
1170
  operator: t,
1076
1171
  value: ""
1077
1172
  };
1078
- const a = n.split(".").map((r) => r.trim()).filter(Boolean);
1173
+ const a = s.split(".").map((r) => r.trim()).filter(Boolean);
1079
1174
  return a.length > 1 ? {
1080
1175
  operator: "and",
1081
1176
  conditions: a.map((r) => ({
1082
- key: s,
1177
+ key: n,
1083
1178
  operator: t,
1084
1179
  value: r
1085
1180
  }))
1086
1181
  } : {
1087
- key: s,
1182
+ key: n,
1088
1183
  operator: t,
1089
1184
  value: a[0] || ""
1090
1185
  };
1091
- }, gn = ({
1186
+ }, Ds = ({
1092
1187
  label: e,
1093
- filters: s,
1188
+ filters: n,
1094
1189
  currentFilter: t,
1095
1190
  onFilterChange: o,
1096
- isLoading: n
1191
+ isLoading: s
1097
1192
  }) => {
1098
- const [a, r] = X(null), [c, m] = X(""), f = Z(null), p = (d) => typeof d == "object" && d !== null && !Array.isArray(d);
1099
- B(() => {
1193
+ const [a, r] = oe(null), [l, u] = oe(""), f = le(null), m = (c) => typeof c == "object" && c !== null && !Array.isArray(c);
1194
+ G(() => {
1100
1195
  a && f.current && f.current.focus();
1101
- }, [a]), B(() => {
1102
- if (a && p(t)) {
1196
+ }, [a]), G(() => {
1197
+ if (a && m(t)) {
1103
1198
  if (document.activeElement === f.current) return;
1104
- const d = t.conditions?.find((u) => be(u, a));
1105
- m(d ? Ae(d) : "");
1199
+ const c = t.conditions?.find((g) => we(g, a));
1200
+ u(c ? Ve(c) : "");
1106
1201
  }
1107
1202
  }, [a, t]);
1108
- const g = (d, u) => {
1109
- if (!p(t)) {
1110
- o(d.id);
1203
+ const h = (c, g) => {
1204
+ if (!m(t)) {
1205
+ o(c.id);
1111
1206
  return;
1112
1207
  }
1113
- const h = t.conditions ? [...t.conditions] : [], N = {
1208
+ const C = t.conditions ? [...t.conditions] : [], E = {
1114
1209
  ...t,
1115
- conditions: h,
1210
+ conditions: C,
1116
1211
  operator: t.operator || "and"
1117
- }, j = String(d.id), E = h.findIndex((w) => be(w, j)), y = d.type || "boolean";
1212
+ }, T = String(c.id), D = C.findIndex((k) => we(k, T)), y = c.type || "boolean";
1118
1213
  if (y === "boolean")
1119
- E > -1 ? h.splice(E, 1) : h.push({ key: j, operator: d.operator || "eq", value: !0 });
1214
+ D > -1 ? C.splice(D, 1) : C.push({ key: T, operator: c.operator || "eq", value: !0 });
1120
1215
  else if (y === "enum") {
1121
- const w = Array.isArray(u) ? u : [u];
1122
- if (w.length === 0 || w.length === 1 && w[0] === void 0)
1123
- E > -1 && h.splice(E, 1);
1216
+ const k = Array.isArray(g) ? g : [g];
1217
+ if (k.length === 0 || k.length === 1 && k[0] === void 0)
1218
+ D > -1 && C.splice(D, 1);
1124
1219
  else {
1125
- const R = {
1126
- key: j,
1127
- operator: d.operator || "in",
1128
- value: w
1220
+ const A = {
1221
+ key: T,
1222
+ operator: c.operator || "in",
1223
+ value: k
1129
1224
  };
1130
- E > -1 ? h[E] = R : h.push(R);
1225
+ D > -1 ? C[D] = A : C.push(A);
1131
1226
  }
1132
1227
  } else if (y === "search") {
1133
- const w = typeof u == "string" ? u : "";
1134
- if (!w)
1135
- E > -1 && h.splice(E, 1);
1228
+ const k = typeof g == "string" ? g : "";
1229
+ if (!k)
1230
+ D > -1 && C.splice(D, 1);
1136
1231
  else {
1137
- const R = lt(w, j, d.operator || "like");
1138
- E > -1 ? h[E] = R : h.push(R);
1232
+ const A = yt(k, T, c.operator || "like");
1233
+ D > -1 ? C[D] = A : C.push(A);
1139
1234
  }
1140
1235
  }
1141
- o(N);
1142
- }, b = (d) => {
1143
- const u = String(d.id);
1144
- if (a !== u && (r(u), p(t))) {
1145
- const h = t.conditions?.find((N) => be(N, u));
1146
- m(h ? Ae(h) : "");
1236
+ o(E);
1237
+ }, b = (c) => {
1238
+ const g = String(c.id);
1239
+ if (a !== g && (r(g), m(t))) {
1240
+ const C = t.conditions?.find((E) => we(E, g));
1241
+ u(C ? Ve(C) : "");
1147
1242
  }
1148
- }, x = (d, u) => {
1149
- m(u), g(d, u);
1150
- }, $ = (d) => {
1151
- m(""), r(null), g(d, "");
1152
- }, U = (d) => p(t) ? t.conditions?.some((u) => be(u, String(d.id))) : d.id === t, A = (d) => p(t) ? t.conditions?.find(
1153
- (h) => Oe(h) && h.key === String(d.id)
1243
+ }, N = (c, g) => {
1244
+ u(g), h(c, g);
1245
+ }, V = (c) => {
1246
+ u(""), r(null), h(c, "");
1247
+ }, U = (c) => m(t) ? t.conditions?.some((g) => we(g, String(c.id))) : c.id === t, O = (c) => m(t) ? t.conditions?.find(
1248
+ (C) => $e(C) && C.key === String(c.id)
1154
1249
  )?.value || [] : [];
1155
- return /* @__PURE__ */ k(ln, { className: le("panel-tabs", { loading: n }), children: [
1156
- /* @__PURE__ */ i(cn, { className: "panel-header-label", children: e }),
1157
- /* @__PURE__ */ i(qe, {}),
1158
- /* @__PURE__ */ i(dn, { className: "panel-header-filters", children: s.map((d) => {
1159
- const u = U(d), h = d.type || "boolean";
1160
- if (h === "enum")
1250
+ return /* @__PURE__ */ x(Ss, { className: fe("panel-tabs", { loading: s }), children: [
1251
+ /* @__PURE__ */ i(Cs, { className: "panel-header-label", children: e }),
1252
+ /* @__PURE__ */ i(st, {}),
1253
+ /* @__PURE__ */ i(Ts, { className: "panel-header-filters", children: n.map((c) => {
1254
+ const g = U(c), C = c.type || "boolean";
1255
+ if (C === "enum")
1161
1256
  return /* @__PURE__ */ i(
1162
- pn,
1257
+ Es,
1163
1258
  {
1164
- options: d.options || [],
1165
- value: A(d),
1166
- onChange: (N) => g(d, N),
1259
+ options: c.options || [],
1260
+ value: O(c),
1261
+ onChange: (E) => h(c, E),
1167
1262
  isEditing: !0,
1168
1263
  autoOpen: !1,
1169
1264
  align: "right",
1170
1265
  type: "list_of_strings",
1171
1266
  valueTemplate: () => /* @__PURE__ */ i(
1172
- Pe,
1267
+ Oe,
1173
1268
  {
1174
- selected: u,
1175
- icon: d.icon,
1176
- "data-tooltip": d.tooltip,
1269
+ selected: g,
1270
+ icon: c.icon,
1271
+ "data-tooltip": c.tooltip,
1177
1272
  "data-tooltip-delay": 0
1178
1273
  }
1179
1274
  ),
1180
1275
  widthExpand: !0,
1181
1276
  className: "panel-filter panel-filter-enum"
1182
1277
  },
1183
- String(d.id)
1278
+ String(c.id)
1184
1279
  );
1185
- if (h === "search") {
1186
- const N = a === String(d.id);
1187
- return /* @__PURE__ */ k(
1188
- un,
1280
+ if (C === "search") {
1281
+ const E = a === String(c.id);
1282
+ return /* @__PURE__ */ x(
1283
+ Ns,
1189
1284
  {
1190
- className: le("panel-filter", "panel-filter-search", { expanded: N }),
1285
+ className: fe("panel-filter", "panel-filter-search", { expanded: E }),
1191
1286
  children: [
1192
1287
  /* @__PURE__ */ i(
1193
- Pe,
1288
+ Oe,
1194
1289
  {
1195
- selected: u || N,
1196
- onClick: () => b(d),
1197
- icon: d.icon,
1198
- "data-tooltip": N ? void 0 : d.tooltip,
1290
+ selected: g || E,
1291
+ onClick: () => b(c),
1292
+ icon: c.icon,
1293
+ "data-tooltip": E ? void 0 : c.tooltip,
1199
1294
  "data-tooltip-delay": 0
1200
1295
  }
1201
1296
  ),
1202
- N && /* @__PURE__ */ k(xe, { children: [
1297
+ E && /* @__PURE__ */ x(Ie, { children: [
1203
1298
  /* @__PURE__ */ i(
1204
- hn,
1299
+ Is,
1205
1300
  {
1206
1301
  ref: f,
1207
- value: c,
1208
- onChange: (j) => x(d, j.target.value),
1209
- onKeyDown: (j) => {
1210
- j.key === "Escape" && $(d);
1302
+ value: l,
1303
+ onChange: (T) => N(c, T.target.value),
1304
+ onKeyDown: (T) => {
1305
+ T.key === "Escape" && V(c);
1211
1306
  },
1212
- placeholder: d.placeholder || "Search..."
1307
+ placeholder: c.placeholder || "Search..."
1213
1308
  }
1214
1309
  ),
1215
1310
  /* @__PURE__ */ i(
1216
- mn,
1311
+ Ps,
1217
1312
  {
1218
1313
  icon: "close",
1219
- onClick: () => $(d),
1314
+ onClick: () => V(c),
1220
1315
  "data-tooltip": "Clear",
1221
1316
  "data-tooltip-delay": 0
1222
1317
  }
@@ -1224,59 +1319,59 @@ const Rs = T(Qe)`
1224
1319
  ] })
1225
1320
  ]
1226
1321
  },
1227
- String(d.id)
1322
+ String(c.id)
1228
1323
  );
1229
1324
  }
1230
1325
  return /* @__PURE__ */ i(
1231
- Pe,
1326
+ Oe,
1232
1327
  {
1233
- selected: u,
1234
- onClick: () => g(d),
1235
- icon: d.icon,
1236
- "data-tooltip": d.tooltip,
1328
+ selected: g,
1329
+ onClick: () => h(c),
1330
+ icon: c.icon,
1331
+ "data-tooltip": c.tooltip,
1237
1332
  "data-tooltip-delay": 0,
1238
1333
  className: "panel-filter panel-filter-boolean"
1239
1334
  },
1240
- String(d.id)
1335
+ String(c.id)
1241
1336
  );
1242
1337
  }) })
1243
1338
  ] });
1244
- }, ct = ["done", "isDone"], dt = (e) => !!e && "key" in e, fn = (e, s) => {
1245
- const t = [], o = [], n = (a) => {
1339
+ }, kt = ["done", "isDone"], wt = (e) => !!e && "key" in e, As = (e, n) => {
1340
+ const t = [], o = [], s = (a) => {
1246
1341
  if (!a) return;
1247
- if (dt(a)) {
1248
- const c = a.key;
1249
- if (c === "search") {
1250
- const p = String(a.value ?? "");
1251
- p && o.push({ id: p, label: p });
1342
+ if (wt(a)) {
1343
+ const l = a.key;
1344
+ if (l === "search") {
1345
+ const m = String(a.value ?? "");
1346
+ m && o.push({ id: m, label: m });
1252
1347
  return;
1253
1348
  }
1254
- const m = s.find((p) => p.id === c);
1255
- if (!m) return;
1256
- if (ct.includes(c)) {
1349
+ const u = n.find((m) => m.id === l);
1350
+ if (!u) return;
1351
+ if (kt.includes(l)) {
1257
1352
  a.value !== void 0 && t.push({
1258
- id: Ee(c),
1259
- label: m.label,
1260
- icon: m.icon,
1353
+ id: Ae(l),
1354
+ label: u.label,
1355
+ icon: u.icon,
1261
1356
  type: "boolean",
1262
1357
  singleSelect: !0,
1263
1358
  values: [{ id: String(a.value), label: a.value ? "Done" : "Not Done" }]
1264
1359
  });
1265
1360
  return;
1266
1361
  }
1267
- if (m.type === "datetime") {
1268
- const p = Array.isArray(a.value) ? a.value[0] : a.value;
1362
+ if (u.type === "datetime") {
1363
+ const m = Array.isArray(a.value) ? a.value[0] : a.value;
1269
1364
  t.push({
1270
- id: Ee(c),
1271
- label: m.label,
1365
+ id: Ae(l),
1366
+ label: u.label,
1272
1367
  type: "datetime",
1273
- icon: m.icon,
1368
+ icon: u.icon,
1274
1369
  values: [
1275
1370
  {
1276
- id: String(p),
1277
- label: String(p),
1371
+ id: String(m),
1372
+ label: String(m),
1278
1373
  // @ts-expect-error - values is okay
1279
- values: [{ id: String(p) }]
1374
+ values: [{ id: String(m) }]
1280
1375
  }
1281
1376
  ]
1282
1377
  });
@@ -1284,45 +1379,45 @@ const Rs = T(Qe)`
1284
1379
  }
1285
1380
  const f = Array.isArray(a.value) ? a.value : [a.value];
1286
1381
  t.push({
1287
- id: Ee(c),
1288
- label: m.label,
1289
- type: m.type,
1290
- icon: m.icon,
1382
+ id: Ae(l),
1383
+ label: u.label,
1384
+ type: u.type,
1385
+ icon: u.icon,
1291
1386
  operator: "OR",
1292
- values: f.map((p) => {
1293
- const g = m.values?.find((b) => b.id === String(p));
1294
- return g ? { ...g } : { id: String(p), label: String(p) };
1387
+ values: f.map((m) => {
1388
+ const h = u.values?.find((b) => b.id === String(m));
1389
+ return h ? { ...h } : { id: String(m), label: String(m) };
1295
1390
  })
1296
1391
  });
1297
1392
  return;
1298
1393
  }
1299
- const r = Is(a, s);
1394
+ const r = Wn(a, n);
1300
1395
  if (r) {
1301
1396
  t.push(r);
1302
1397
  return;
1303
1398
  }
1304
- a.conditions?.forEach(n);
1399
+ a.conditions?.forEach(s);
1305
1400
  };
1306
- return e?.conditions?.forEach(n), o.length && t.push({ id: Ke, label: "", values: o }), t;
1307
- }, bn = (e) => {
1308
- const s = [], t = [];
1401
+ return e?.conditions?.forEach(s), o.length && t.push({ id: at, label: "", values: o }), t;
1402
+ }, Fs = (e) => {
1403
+ const n = [], t = [];
1309
1404
  return e.forEach((o) => {
1310
- const n = xt(o.id), a = (o.values || []).map((r) => r.id);
1405
+ const s = Ot(o.id), a = (o.values || []).map((r) => r.id);
1311
1406
  if (a.length)
1312
- if (n === Ke)
1407
+ if (s === at)
1313
1408
  a.forEach(
1314
1409
  (r) => t.push({ key: "search", operator: "like", value: String(r) })
1315
1410
  );
1316
- else if (ct.includes(n)) {
1411
+ else if (kt.includes(s)) {
1317
1412
  const r = a[0] === "true";
1318
- s.push({ key: n, operator: "eq", value: r });
1413
+ n.push({ key: s, operator: "eq", value: r });
1319
1414
  } else if (o.type === "datetime") {
1320
- const r = Ps(n, o);
1321
- r && s.push(r);
1415
+ const r = zn(s, o);
1416
+ r && n.push(r);
1322
1417
  } else
1323
- s.push({ key: n, operator: "in", value: a.map(String) });
1324
- }), t.length === 1 ? s.push(t[0]) : t.length > 1 && s.push({ operator: "or", conditions: t }), { operator: "and", conditions: s };
1325
- }, ut = (e) => dt(e) ? e.key !== "search" || typeof e.value != "string" ? e : It(e.value, (s) => ({ ...e, value: s })) ?? e : { ...e, conditions: e.conditions?.map(ut) }, vn = T.div`
1418
+ n.push({ key: s, operator: "in", value: a.map(String) });
1419
+ }), t.length === 1 ? n.push(t[0]) : t.length > 1 && n.push({ operator: "or", conditions: t }), { operator: "and", conditions: n };
1420
+ }, xt = (e) => wt(e) ? e.key !== "search" || typeof e.value != "string" ? e : Ht(e.value, (n) => ({ ...e, value: n })) ?? e : { ...e, conditions: e.conditions?.map(xt) }, js = I.div`
1326
1421
  padding: 4px 8px;
1327
1422
  padding-bottom: 0;
1328
1423
 
@@ -1330,16 +1425,16 @@ const Rs = T(Qe)`
1330
1425
  opacity: 0.5;
1331
1426
  pointer-events: none;
1332
1427
  }
1333
- `, yn = ({
1428
+ `, Os = ({
1334
1429
  subtasksFilter: e,
1335
- setSubtasksFilter: s,
1430
+ setSubtasksFilter: n,
1336
1431
  users: t,
1337
1432
  isLoading: o,
1338
- totalCount: n = 0,
1433
+ totalCount: s = 0,
1339
1434
  doneCount: a = 0,
1340
1435
  onSearchTextChange: r
1341
1436
  }) => {
1342
- const c = C(
1437
+ const l = w(
1343
1438
  () => [
1344
1439
  {
1345
1440
  id: "isDone",
@@ -1360,10 +1455,10 @@ const Rs = T(Qe)`
1360
1455
  operator: "OR",
1361
1456
  allowHasValue: !0,
1362
1457
  allowNoValue: !0,
1363
- values: t.map((u) => ({
1364
- id: u.name,
1365
- label: u.attrib?.fullName || u.name,
1366
- img: `/api/users/${u.name}/avatar`
1458
+ values: t.map((g) => ({
1459
+ id: g.name,
1460
+ label: g.attrib?.fullName || g.name,
1461
+ img: `/api/users/${g.name}/avatar`
1367
1462
  }))
1368
1463
  }
1369
1464
  // dates disabled until planner update with support is released
@@ -1383,48 +1478,48 @@ const Rs = T(Qe)`
1383
1478
  // },
1384
1479
  ],
1385
1480
  [t]
1386
- ), m = C(() => fn(e, c), [e, c]), [f, p] = X(m), g = Z(null), b = Fs();
1387
- B(() => {
1388
- p(m);
1389
- }, [JSON.stringify(m)]);
1390
- const x = (u) => {
1391
- const h = bn(u);
1392
- s(h), r?.("");
1393
- }, $ = (u) => {
1394
- b.wrapFilterChange(u, f, p);
1395
- }, U = (u, h) => {
1396
- h || r?.(u);
1481
+ ), u = w(() => As(e, l), [e, l]), [f, m] = oe(u), h = le(null), b = Gn();
1482
+ G(() => {
1483
+ m(u);
1484
+ }, [JSON.stringify(u)]);
1485
+ const N = (g) => {
1486
+ const C = Fs(g);
1487
+ n(C), r?.("");
1488
+ }, V = (g) => {
1489
+ b.wrapFilterChange(g, f, m);
1490
+ }, U = (g, C) => {
1491
+ C || r?.(g);
1397
1492
  };
1398
- let A = "";
1399
- n > 0 && (A = `${a}/${n}`);
1400
- const d = C(
1401
- () => [{ id: "isDone", label: A, tooltip: "Status" }],
1402
- [A]
1493
+ let O = "";
1494
+ s > 0 && (O = `${a}/${s}`);
1495
+ const c = w(
1496
+ () => [{ id: "isDone", label: O, tooltip: "Status" }],
1497
+ [O]
1403
1498
  );
1404
- return /* @__PURE__ */ k(vn, { className: o ? "loading" : void 0, children: [
1499
+ return /* @__PURE__ */ x(js, { className: o ? "loading" : void 0, children: [
1405
1500
  /* @__PURE__ */ i(
1406
- St,
1501
+ Rt,
1407
1502
  {
1408
- ref: g,
1503
+ ref: h,
1409
1504
  compact: !0,
1410
- options: c,
1505
+ options: l,
1411
1506
  filters: f,
1412
- onChange: $,
1413
- onFinish: x,
1507
+ onChange: V,
1508
+ onFinish: N,
1414
1509
  enableGlobalSearch: !0,
1415
1510
  enableMultipleSameFilters: !1,
1416
1511
  enableAutosuggestion: !1,
1417
1512
  onSearchChange: U,
1418
- quickActions: d,
1513
+ quickActions: c,
1419
1514
  placeholder: "Search and filter subtasks...",
1420
1515
  pt: {
1421
1516
  searchBar: {
1422
- onClickCapture: (u) => b.handleSearchBarClickCapture(u, f)
1517
+ onClickCapture: (g) => b.handleSearchBarClickCapture(g, f)
1423
1518
  },
1424
1519
  dropdown: {
1425
1520
  pt: {
1426
1521
  item: {
1427
- onClick: (u) => b.handleDropdownItemClick(u, f, c)
1522
+ onClick: (g) => b.handleDropdownItemClick(g, f, l)
1428
1523
  }
1429
1524
  }
1430
1525
  }
@@ -1432,398 +1527,422 @@ const Rs = T(Qe)`
1432
1527
  }
1433
1528
  ),
1434
1529
  /* @__PURE__ */ i(
1435
- Ds,
1530
+ Bn,
1436
1531
  {
1437
1532
  isOpen: !!b.customRangeFilterId,
1438
- header: c.find((u) => u.id === b.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
1533
+ header: l.find((g) => g.id === b.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
1439
1534
  startDate: b.customStartDate,
1440
1535
  endDate: b.customEndDate,
1441
1536
  onStartDateChange: b.setCustomStartDate,
1442
1537
  onEndDateChange: b.setCustomEndDate,
1443
- onApply: () => b.handleCustomRangeApply(f, c, x, g),
1538
+ onApply: () => b.handleCustomRangeApply(f, l, N, h),
1444
1539
  onClose: b.handleCustomRangeClose
1445
1540
  }
1446
1541
  )
1447
1542
  ] });
1448
- }, kn = ({ ...e }) => {
1449
- const [s, t] = X({}), [o, n] = X(""), [a, r] = X([]), { dispatch: c } = K(), { data: m = [] } = Je({ projectName: e.projectName }), f = e.subtasks?.length || 0, p = e.subtasks?.filter((b) => b.isDone).length || 0, g = C(() => {
1450
- let b = s;
1543
+ }, Rs = ({ ...e }) => {
1544
+ const [n, t] = oe({}), [o, s] = oe(""), [a, r] = oe([]), { dispatch: l } = ne(), { data: u = [] } = ot({ projectName: e.projectName }), f = e.subtasks?.length || 0, m = e.subtasks?.filter((b) => b.isDone).length || 0, h = w(() => {
1545
+ let b = n;
1451
1546
  if (o) {
1452
- const x = { key: "search", operator: "like", value: o };
1547
+ const N = { key: "search", operator: "like", value: o };
1453
1548
  b = {
1454
- ...s,
1455
- conditions: [...s.conditions || [], x],
1549
+ ...n,
1550
+ conditions: [...n.conditions || [], N],
1456
1551
  operator: "and"
1457
1552
  };
1458
1553
  }
1459
- return As(ut(b));
1460
- }, [s, o]);
1461
- return /* @__PURE__ */ k(xe, { children: [
1554
+ return Qn(xt(b));
1555
+ }, [n, o]);
1556
+ return /* @__PURE__ */ x(Ie, { children: [
1462
1557
  /* @__PURE__ */ i(
1463
- gn,
1558
+ Ds,
1464
1559
  {
1465
1560
  label: `Subtasks (${f})`,
1466
1561
  filters: [],
1467
- currentFilter: s,
1562
+ currentFilter: n,
1468
1563
  onFilterChange: t
1469
1564
  }
1470
1565
  ),
1471
1566
  /* @__PURE__ */ i(
1472
- yn,
1567
+ Os,
1473
1568
  {
1474
- subtasksFilter: s,
1569
+ subtasksFilter: n,
1475
1570
  setSubtasksFilter: t,
1476
- users: m,
1571
+ users: u,
1477
1572
  totalCount: f,
1478
- doneCount: p,
1479
- onSearchTextChange: n
1573
+ doneCount: m,
1574
+ onSearchTextChange: s
1480
1575
  }
1481
1576
  ),
1482
1577
  /* @__PURE__ */ i(
1483
- gs,
1578
+ Pn,
1484
1579
  {
1485
1580
  ...e,
1486
1581
  style: { padding: 8, height: "unset" },
1487
1582
  title: null,
1488
1583
  selectedSubtaskIds: a,
1489
1584
  onSelectSubtasks: r,
1490
- filters: g,
1585
+ filters: h,
1491
1586
  actionsPortalClassName: "panel-header-filters",
1492
- dispatch: c
1587
+ dispatch: l
1493
1588
  }
1494
1589
  )
1495
1590
  ] });
1496
- }, wn = ["product", "representation"], xn = ({
1591
+ }, tt = ["product", "representation"], Ls = ({
1497
1592
  entityType: e,
1498
- entitySubTypes: s = [],
1593
+ entitySubTypes: n = [],
1499
1594
  // entities is data we already have from kanban
1500
1595
  entitiesData: t = [],
1501
1596
  // entityIds are used to get the full details data for the entities
1502
1597
  entities: o = [],
1503
- tagsOptions: n = [],
1598
+ tagsOptions: s = [],
1504
1599
  disabledStatuses: a,
1505
1600
  projectUsers: r,
1506
- disabledProjectUsers: c,
1507
- activeProjectUsers: m,
1601
+ disabledProjectUsers: l,
1602
+ activeProjectUsers: u,
1508
1603
  projectsInfo: f = {},
1509
- projectNames: p = [],
1510
- isSlideOut: g = !1,
1604
+ projectNames: m = [],
1605
+ isSlideOut: h = !1,
1511
1606
  style: b = {},
1512
- scope: x,
1513
- isCompact: $ = !1,
1607
+ scope: N,
1608
+ isCompact: V = !1,
1514
1609
  onClose: U,
1515
- onWatchersUpdate: A,
1516
- onOpenViewer: d,
1517
- onEntityFocus: u,
1518
- onOpen: h,
1519
- onUriOpen: N,
1610
+ onWatchersUpdate: O,
1611
+ onOpenViewer: c,
1612
+ onEntityFocus: g,
1613
+ onOpen: C,
1614
+ onUriOpen: E,
1520
1615
  // when the details panel is opened from uri
1521
1616
  // annotations
1522
- annotations: j,
1523
- removeAnnotation: E,
1617
+ annotations: T,
1618
+ removeAnnotation: D,
1524
1619
  exportAnnotationComposite: y,
1525
- entityListId: w,
1526
- guestCategories: R = {},
1527
- entityListsContext: V,
1620
+ entityListId: k,
1621
+ guestCategories: A = {},
1622
+ entityListsContext: R,
1528
1623
  resolveVersionJump: M
1529
1624
  }) => {
1530
1625
  const {
1531
- closeSlideOut: ee,
1532
- openPip: te,
1533
- user: se,
1534
- isGuest: ne,
1535
- entities: P,
1536
- setEntities: ae,
1537
- slideOut: W,
1538
- useSearchParams: ce,
1539
- SubtasksManager: oe,
1540
- useNavigate: pe
1541
- } = K(), { currentTab: L, setTab: F, isFeed: de } = is(x), [he, ve] = ce(), ye = Z(!1), D = P?.entityType ?? e, me = P?.entities ?? o, G = P?.entitySubTypes ?? s, Se = P?.entities ? [] : t, J = P?.entities ? P.entities.map((v) => v.projectName) : p;
1542
- es(
1543
- D ? me.map((v) => ({ ...v, entityType: D })) : [],
1544
- g ? He.slideOut : He.detailsPanel
1545
- ), B(() => {
1546
- h && !ye.current && (ye.current = !0, h());
1547
- }, []), B(() => {
1548
- wn.includes(D) && L !== "details" && F("details");
1549
- }, [D, L, F]), B(() => {
1550
- o.length && P && ae(null);
1551
- }, [o, P, ae]);
1552
- const ie = C(
1553
- () => rt(f, J),
1554
- [f, J]
1555
- ), re = C(() => nt(ie), [ie]);
1556
- B(() => {
1557
- L === "files" && D !== "version" && F("feed"), L === "subtasks" && D !== "task" && F("feed");
1558
- }, [D, L, x]);
1559
- let z = me.length ? me.map((v) => ({ id: v.id, projectName: v.projectName })) : (
1626
+ closeSlideOut: se,
1627
+ openPip: ce,
1628
+ user: de,
1629
+ isGuest: ue,
1630
+ entities: F,
1631
+ setEntities: pe,
1632
+ slideOut: q,
1633
+ useSearchParams: me,
1634
+ SubtasksManager: J,
1635
+ useNavigate: he
1636
+ } = ne(), { currentTab: j, setTab: H, isFeed: X } = kn(N), [xe, be] = me(), ve = le(!1), S = F?.entityType ?? e, ge = F?.entities ?? o, v = F?.entitySubTypes ?? n, $ = F?.entities ? [] : t, K = F?.entities ? F.entities.map((p) => p.projectName) : m;
1637
+ hn(
1638
+ S ? ge.map((p) => ({ ...p, entityType: S })) : [],
1639
+ h ? qe.slideOut : qe.detailsPanel
1640
+ ), G(() => {
1641
+ C && !ve.current && (ve.current = !0, C());
1642
+ }, []);
1643
+ const { tabs: ie, isLoading: ae } = pt(S), Y = ie.find((p) => p.key === j), Se = Ke(j) && ae;
1644
+ G(() => {
1645
+ tt.includes(S) && j !== "details" && !Y && !Se && H("details");
1646
+ }, [S, j, H, Y, Se]), G(() => {
1647
+ o.length && F && pe(null);
1648
+ }, [o, F, pe]);
1649
+ const ye = w(
1650
+ () => vt(f, K),
1651
+ [f, K]
1652
+ ), Ce = w(() => ht(ye), [ye]);
1653
+ G(() => {
1654
+ j === "files" && S !== "version" && H("feed"), j === "subtasks" && S !== "task" && H("feed"), Ke(j) && !ae && !Y && H(tt.includes(S) ? "details" : "feed");
1655
+ }, [S, j, N, ae, Y]);
1656
+ let Z = ge.length ? ge.map((p) => ({ id: p.id, projectName: p.projectName })) : (
1560
1657
  // @ts-expect-error = not sure what's going on with activeEntitiesData, we should try and remove it
1561
- Se.map((v) => ({ id: v.id, projectName: v.projectName }))
1658
+ $.map((p) => ({ id: p.id, projectName: p.projectName }))
1562
1659
  );
1563
- z = z.filter((v) => v.id);
1660
+ Z = Z.filter((p) => p.id);
1564
1661
  const {
1565
1662
  data: _ = [],
1566
- isFetching: Q,
1567
- isError: ke,
1568
- originalArgs: Ce
1569
- } = Xe(
1570
- { entityType: D, entities: z },
1663
+ isFetching: ee,
1664
+ isError: d,
1665
+ originalArgs: P
1666
+ } = it(
1667
+ { entityType: S, entities: Z },
1571
1668
  {
1572
- skip: !z.length || !Ot.includes(D)
1669
+ skip: !Z.length || !Gt.includes(S)
1573
1670
  }
1574
1671
  );
1575
- B(() => {
1576
- g || ee();
1577
- }, [Ce, g]);
1578
- const ge = Z(null);
1579
- B(() => {
1580
- P || (ge.current = null);
1581
- }, [P]), B(() => {
1582
- if (!Q && (P?.source === "uri" || P?.source === "url") && P?.entities?.length && N) {
1583
- const v = P.entities[0].id;
1584
- if (ge.current === v) return;
1585
- const O = _.find((H) => H.id === v);
1586
- if (!O) return;
1587
- ge.current = v, N(O, P.source);
1672
+ G(() => {
1673
+ h || se();
1674
+ }, [P, h]);
1675
+ const B = le(null);
1676
+ G(() => {
1677
+ F || (B.current = null);
1678
+ }, [F]), G(() => {
1679
+ if (!ee && (F?.source === "uri" || F?.source === "url") && F?.entities?.length && E) {
1680
+ const p = F.entities[0].id;
1681
+ if (B.current === p) return;
1682
+ const L = _.find((Q) => Q.id === p);
1683
+ if (!L) return;
1684
+ B.current = p, E(L, F.source);
1588
1685
  }
1589
- }, [_, Q, P, N]);
1590
- const fe = ot(f), l = J[0], S = f[l] || {}, I = _[0] || {}, q = _[_.length - 1], Te = J[J.length - 1], je = x === "inbox" && D === "version" && _.length === 1 ? Ks(_[0]) : void 0, [Re, pt] = on({
1591
- entity: I,
1592
- entityType: D,
1593
- projectName: l,
1594
- isLoading: Q
1595
- }), { setEntityUri: ht, setUri: Ve } = rs();
1596
- B(() => {
1597
- if (!q?.parents || !Te) return;
1598
- const { folderPath: v, taskName: O, versionName: H, productName: _e } = ts(
1599
- q.parents,
1600
- D,
1601
- q.name
1686
+ }, [_, ee, F, E]);
1687
+ const re = ft(f), W = K[0], Ue = f[W] || {}, z = _[0] || {}, Te = _[_.length - 1], Pe = K[K.length - 1], Me = N === "inbox" && S === "version" && _.length === 1 ? us(_[0]) : void 0, [_e, St] = ws({
1688
+ entity: z,
1689
+ entityType: S,
1690
+ projectName: W,
1691
+ isLoading: ee
1692
+ }), { setEntityUri: Ct, setUri: He } = wn();
1693
+ G(() => {
1694
+ if (!Te?.parents || !Pe) return;
1695
+ const { folderPath: p, taskName: L, versionName: Q, productName: Ge } = gn(
1696
+ Te.parents,
1697
+ S,
1698
+ Te.name
1602
1699
  );
1603
- return ht({
1604
- projectName: Te,
1605
- folderPath: v,
1606
- taskName: O,
1607
- productName: _e,
1608
- versionName: H
1700
+ return Ct({
1701
+ projectName: Pe,
1702
+ folderPath: p,
1703
+ taskName: L,
1704
+ productName: Ge,
1705
+ versionName: Q
1609
1706
  }), () => {
1610
- Ve("");
1707
+ He("");
1611
1708
  };
1612
- }, [_, J, D]), js({
1613
- entityData: q,
1614
- project: Te,
1615
- activeEntityType: D,
1616
- entitiesToQuery: z
1709
+ }, [_, K, S]), Kn({
1710
+ entityData: Te,
1711
+ project: Pe,
1712
+ activeEntityType: S,
1713
+ entitiesToQuery: Z
1617
1714
  });
1618
- const mt = () => {
1619
- ve(
1620
- (v) => {
1621
- const O = new URLSearchParams(v);
1622
- return O.delete("project"), O.delete("type"), O.delete("id"), O;
1715
+ const Tt = () => {
1716
+ be(
1717
+ (p) => {
1718
+ const L = new URLSearchParams(p);
1719
+ return L.delete("project"), L.delete("type"), L.delete("id"), L;
1623
1720
  },
1624
1721
  { replace: !0 }
1625
1722
  );
1626
- }, Ne = () => {
1627
- U?.(), ae(null), Ve(""), mt(), ee();
1723
+ }, De = () => {
1724
+ U?.(), pe(null), He(""), Tt(), se();
1628
1725
  };
1629
- B(() => {
1630
- const v = (O) => {
1631
- if (O.key === "Escape" && U) {
1632
- const H = O.target;
1633
- if (["INPUT", "TEXTAREA", "SELECT"].includes(H.tagName) || H.isContentEditable || g === !1 && (H.closest("#viewer-dialog") || W)) return;
1634
- Ne();
1726
+ G(() => {
1727
+ const p = (L) => {
1728
+ if (L.key === "Escape" && U) {
1729
+ const Q = L.target;
1730
+ if (["INPUT", "TEXTAREA", "SELECT"].includes(Q.tagName) || Q.isContentEditable || h === !1 && (Q.closest("#viewer-dialog") || q)) return;
1731
+ De();
1635
1732
  }
1636
1733
  };
1637
- return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
1638
- }, [Ne, g, W]);
1639
- const { requestPipWindow: gt } = ls(), $e = Z(null), Le = Z(null), ft = _.length === 1 && D !== "representation", bt = C(() => {
1640
- const v = I?.label || I?.name || "", O = I?.parents || [], H = [l];
1641
- switch (D) {
1734
+ return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
1735
+ }, [De, h, q]);
1736
+ const { requestPipWindow: Nt } = xn(), Be = le(null), We = le(null), Et = _.length === 1 && S !== "representation", It = w(() => {
1737
+ const p = z?.label || z?.name || "", L = z?.parents || [], Q = [W];
1738
+ switch (S) {
1642
1739
  case "folder":
1643
1740
  case "task":
1644
1741
  case "product":
1645
- H.push(O.at(-1), v);
1742
+ Q.push(L.at(-1), p);
1646
1743
  break;
1647
1744
  case "version":
1648
- H.push(O.at(-2), O.at(-1), v);
1745
+ Q.push(L.at(-2), L.at(-1), p);
1649
1746
  break;
1650
1747
  case "representation":
1651
- H.push(O.at(-3), O.at(-2), O.at(-1), v);
1748
+ Q.push(L.at(-3), L.at(-2), L.at(-1), p);
1652
1749
  break;
1653
1750
  default:
1654
- H.push(v);
1751
+ Q.push(p);
1655
1752
  }
1656
- return H.filter(Boolean).join(" - ");
1657
- }, [I, D, l]), vt = () => {
1658
- te({
1659
- entityType: D,
1660
- entities: z,
1661
- scope: x
1662
- }), gt(500, 500);
1663
- }, Ue = () => !(J.length > 1 || ne && (!w || !Object.prototype.hasOwnProperty.call(
1664
- R,
1665
- se.attrib?.email || ""
1753
+ return Q.filter(Boolean).join(" - ");
1754
+ }, [z, S, W]), Pt = () => {
1755
+ ce({
1756
+ entityType: S,
1757
+ entities: Z,
1758
+ scope: N
1759
+ }), Nt(500, 500);
1760
+ }, Dt = w(
1761
+ () => ({
1762
+ projectName: W,
1763
+ entityType: S,
1764
+ entities: _.filter((p) => !!p?.id).map((p) => ({
1765
+ id: p.id,
1766
+ entityType: p.entityType || S,
1767
+ projectName: p.projectName || W,
1768
+ name: p.name,
1769
+ label: p.label || void 0
1770
+ })),
1771
+ scope: N
1772
+ }),
1773
+ [W, S, _, N]
1774
+ ), ze = () => !(K.length > 1 || ue && (!k || !Object.prototype.hasOwnProperty.call(
1775
+ A,
1776
+ de.attrib?.email || ""
1666
1777
  )));
1667
1778
  return /* @__PURE__ */ i(
1668
- ds,
1779
+ Cn,
1669
1780
  {
1670
- thumbnailInputRef: $e,
1671
- versionsInputRef: Le,
1672
- canUploadVersion: ft,
1673
- children: /* @__PURE__ */ k($s, { className: "details-panel", children: [
1674
- /* @__PURE__ */ k(Rs, { children: [
1781
+ thumbnailInputRef: Be,
1782
+ versionsInputRef: We,
1783
+ canUploadVersion: Et,
1784
+ children: /* @__PURE__ */ x(Zn, { className: "details-panel", children: [
1785
+ /* @__PURE__ */ x(Jn, { children: [
1675
1786
  /* @__PURE__ */ i(
1676
- Yt,
1787
+ pn,
1677
1788
  {
1678
- segments: Re,
1679
- versions: pt,
1680
- projectName: l,
1681
- hideProjectName: g,
1682
- isLoading: Q || !Re.length,
1683
- entityType: D,
1684
- scope: x,
1685
- entityTypeIcons: re
1789
+ segments: _e,
1790
+ versions: St,
1791
+ projectName: W,
1792
+ hideProjectName: h,
1793
+ isLoading: ee || !_e.length,
1794
+ entityType: S,
1795
+ scope: N,
1796
+ entityTypeIcons: Ce
1686
1797
  }
1687
1798
  ),
1688
- /* @__PURE__ */ k(Vs, { className: "right-tools", children: [
1799
+ /* @__PURE__ */ x(Xn, { className: "right-tools", children: [
1689
1800
  /* @__PURE__ */ i(
1690
- sn,
1801
+ vs,
1691
1802
  {
1692
- entityType: D,
1693
- entityId: I?.id,
1694
- entityIds: z.map((v) => v.id).filter(Boolean),
1695
- entityLabel: bt,
1696
- projectName: l,
1697
- selectedEntities: _.filter((v) => !!v?.id).map((v) => {
1698
- const O = v.entityType || D;
1803
+ entityType: S,
1804
+ entityId: z?.id,
1805
+ entityIds: Z.map((p) => p.id).filter(Boolean),
1806
+ entityLabel: It,
1807
+ projectName: W,
1808
+ selectedEntities: _.filter((p) => !!p?.id).map((p) => {
1809
+ const L = p.entityType || S;
1699
1810
  return {
1700
- entityId: v.id,
1701
- entityType: O,
1702
- hasReviewables: !!v.hasReviewables,
1703
- name: v.name,
1704
- label: v.label,
1705
- projectName: v.projectName || l,
1706
- folderId: O === "task" ? v.folder?.id : void 0
1811
+ entityId: p.id,
1812
+ entityType: L,
1813
+ hasReviewables: !!p.hasReviewables,
1814
+ name: p.name,
1815
+ label: p.label,
1816
+ projectName: p.projectName || W,
1817
+ folderId: L === "task" ? p.folder?.id : void 0
1707
1818
  };
1708
1819
  }),
1709
- entityListsContext: V,
1710
- onOpenPip: vt,
1711
- onOpenViewer: d,
1712
- productId: I?.product?.id,
1713
- taskId: I?.task?.id,
1714
- folderId: I?.folder?.id
1820
+ entityListsContext: R,
1821
+ onOpenPip: Pt,
1822
+ onOpenViewer: c,
1823
+ productId: z?.product?.id,
1824
+ taskId: z?.task?.id,
1825
+ folderId: z?.folder?.id
1715
1826
  }
1716
1827
  ),
1717
1828
  /* @__PURE__ */ i(
1718
- qt,
1829
+ ln,
1719
1830
  {
1720
- entities: z,
1721
- entityType: D,
1831
+ entities: Z,
1832
+ entityType: S,
1722
1833
  options: r || [],
1723
- onWatchersUpdate: A && A,
1724
- userName: se.name
1834
+ onWatchersUpdate: O && O,
1835
+ userName: de.name
1725
1836
  }
1726
1837
  ),
1727
1838
  U && /* @__PURE__ */ i(
1728
- Y,
1839
+ te,
1729
1840
  {
1730
1841
  icon: "close",
1731
1842
  variant: "text",
1732
- onClick: Ne,
1843
+ onClick: De,
1733
1844
  "data-shortcut": "Escape"
1734
1845
  }
1735
1846
  )
1736
1847
  ] })
1737
1848
  ] }),
1738
- je && /* @__PURE__ */ i(
1739
- qs,
1849
+ Me && /* @__PURE__ */ i(
1850
+ ds,
1740
1851
  {
1741
- latestVersion: je,
1852
+ latestVersion: Me,
1742
1853
  resolveVersionJump: M
1743
1854
  }
1744
1855
  ),
1745
1856
  /* @__PURE__ */ i(
1746
- zs,
1857
+ rs,
1747
1858
  {
1748
- entityType: D,
1749
- entitySubTypes: G,
1859
+ entityType: S,
1860
+ entitySubTypes: v,
1750
1861
  entities: _,
1751
1862
  users: r,
1752
- disabledAssignees: c,
1863
+ disabledAssignees: l,
1753
1864
  disabledStatuses: a,
1754
- tagsOptions: n,
1755
- isFetching: Q,
1756
- isCompact: $,
1757
- currentTab: L,
1758
- onTabChange: F,
1759
- projectInfo: ie,
1760
- onOpenViewer: (v) => d?.(v),
1761
- onEntityFocus: u,
1762
- thumbnailInputRef: $e,
1763
- versionsInputRef: Le
1865
+ tagsOptions: s,
1866
+ isFetching: ee,
1867
+ isCompact: V,
1868
+ currentTab: j,
1869
+ onTabChange: H,
1870
+ projectInfo: ye,
1871
+ onOpenViewer: (p) => c?.(p),
1872
+ onEntityFocus: g,
1873
+ thumbnailInputRef: Be,
1874
+ versionsInputRef: We
1764
1875
  }
1765
1876
  ),
1766
- /* @__PURE__ */ k(et, { projectName: l, children: [
1767
- de && !ke && /* @__PURE__ */ i(
1768
- it,
1877
+ /* @__PURE__ */ x(ct, { projectName: W, children: [
1878
+ X && !d && /* @__PURE__ */ i(
1879
+ bt,
1769
1880
  {
1770
- entityType: D,
1881
+ entityType: S,
1771
1882
  entities: _,
1772
- activeUsers: m || [],
1773
- projectInfo: S,
1774
- projectName: l,
1775
- disabled: !Ue(),
1776
- scope: x,
1777
- statuses: fe,
1883
+ activeUsers: u || [],
1884
+ projectInfo: Ue,
1885
+ projectName: W,
1886
+ disabled: !ze(),
1887
+ scope: N,
1888
+ statuses: re,
1778
1889
  readOnly: !1,
1779
- entityListId: w,
1780
- annotations: j,
1781
- removeAnnotation: E,
1890
+ entityListId: k,
1891
+ annotations: T,
1892
+ removeAnnotation: D,
1782
1893
  exportAnnotationComposite: y,
1783
- isSlideOut: g
1894
+ isSlideOut: h
1784
1895
  }
1785
1896
  ),
1786
- L === "subtasks" && D === "task" && I?.id && oe && /* @__PURE__ */ i(
1787
- kn,
1897
+ j === "subtasks" && S === "task" && z?.id && J && /* @__PURE__ */ i(
1898
+ Rs,
1788
1899
  {
1789
- projectName: l,
1790
- taskId: I.id,
1791
- taskName: I.name,
1792
- folderId: I.folder?.id,
1793
- subtasks: I.task?.subtasks || [],
1794
- SubtasksManager: oe,
1795
- useNavigate: pe,
1796
- onNotFound: () => F("feed")
1900
+ projectName: W,
1901
+ taskId: z.id,
1902
+ taskName: z.name,
1903
+ folderId: z.folder?.id,
1904
+ subtasks: z.task?.subtasks || [],
1905
+ SubtasksManager: J,
1906
+ useNavigate: he,
1907
+ onNotFound: () => H("feed")
1797
1908
  }
1798
1909
  ),
1799
- L === "files" && /* @__PURE__ */ i(
1800
- Qs,
1910
+ Y && /* @__PURE__ */ i(Yn, { children: /* @__PURE__ */ i(
1911
+ Dn,
1912
+ {
1913
+ contribution: Y,
1914
+ context: Dt
1915
+ },
1916
+ Y.key
1917
+ ) }),
1918
+ j === "files" && /* @__PURE__ */ i(
1919
+ cs,
1801
1920
  {
1802
1921
  entities: _,
1803
- scope: x,
1804
- isLoadingVersion: Q
1922
+ scope: N,
1923
+ isLoadingVersion: ee
1805
1924
  }
1806
1925
  ),
1807
- L === "details" && /* @__PURE__ */ i(
1808
- rn,
1926
+ j === "details" && /* @__PURE__ */ i(
1927
+ xs,
1809
1928
  {
1810
- entityType: D,
1929
+ entityType: S,
1811
1930
  entities: _,
1812
- activeUsers: m || [],
1813
- projectInfo: S,
1814
- projectName: l,
1815
- disabled: !Ue(),
1816
- scope: x,
1817
- statuses: fe,
1931
+ activeUsers: u || [],
1932
+ projectInfo: Ue,
1933
+ projectName: W,
1934
+ disabled: !ze(),
1935
+ scope: N,
1936
+ statuses: re,
1818
1937
  readOnly: !1,
1819
- annotations: j,
1820
- removeAnnotation: E,
1938
+ annotations: T,
1939
+ removeAnnotation: D,
1821
1940
  exportAnnotationComposite: y,
1822
1941
  children: /* @__PURE__ */ i(
1823
- Kt,
1942
+ cn,
1824
1943
  {
1825
1944
  entities: _,
1826
- isLoading: Q
1945
+ isLoading: ee
1827
1946
  }
1828
1947
  )
1829
1948
  }
@@ -1832,14 +1951,14 @@ const Rs = T(Qe)`
1832
1951
  ] })
1833
1952
  }
1834
1953
  );
1835
- }, Sn = ({
1954
+ }, Vs = ({
1836
1955
  isOpen: e,
1837
- entityType: s,
1956
+ entityType: n,
1838
1957
  ...t
1839
1958
  }) => {
1840
- const { entities: o } = K();
1841
- return !e && !o || !s && !o ? null : /* @__PURE__ */ i(xn, { ...t, entityType: s || o?.entityType });
1842
- }, Cn = Et`
1959
+ const { entities: o } = ne();
1960
+ return !e && !o || !n && !o ? null : /* @__PURE__ */ i(Ls, { ...t, entityType: n || o?.entityType });
1961
+ }, $s = Mt`
1843
1962
  from {
1844
1963
  translate: 0 0;
1845
1964
  }
@@ -1847,7 +1966,7 @@ to {
1847
1966
  translate: calc(-100% - 8px) 0;
1848
1967
 
1849
1968
  }
1850
- `, Tn = T.div`
1969
+ `, Us = I.div`
1851
1970
  position: absolute;
1852
1971
  left: 0;
1853
1972
  top: 0;
@@ -1856,42 +1975,42 @@ to {
1856
1975
  width: 100%;
1857
1976
  max-width: 533px;
1858
1977
 
1859
- animation: ${Cn} 0.2s ease forwards;
1860
- `, Ca = ({ projectsInfo: e, scope: s }) => {
1861
- const { slideOut: t, onOpenViewer: o } = K(), { entityType: n, entityId: a, projectName: r } = t || {}, c = !!n && !!a && !!r, { data: m } = Je({ projectName: r }, { skip: !r }), f = e[r || ""] || {}, { tags: p = [] } = f, { closeSlideOut: g } = K(), b = () => g(), x = ($) => o?.($);
1862
- return c ? /* @__PURE__ */ i(Tn, { children: /* @__PURE__ */ i(
1863
- Sn,
1978
+ animation: ${$s} 0.2s ease forwards;
1979
+ `, Ma = ({ projectsInfo: e, scope: n }) => {
1980
+ const { slideOut: t, onOpenViewer: o } = ne(), { entityType: s, entityId: a, projectName: r } = t || {}, l = !!s && !!a && !!r, { data: u } = ot({ projectName: r }, { skip: !r }), f = e[r || ""] || {}, { tags: m = [] } = f, { closeSlideOut: h } = ne(), b = () => h(), N = (V) => o?.(V);
1981
+ return l ? /* @__PURE__ */ i(Us, { children: /* @__PURE__ */ i(
1982
+ Vs,
1864
1983
  {
1865
1984
  isOpen: !0,
1866
- entityType: n,
1985
+ entityType: s,
1867
1986
  entitySubTypes: [],
1868
1987
  entities: [{ id: a, projectName: r }],
1869
1988
  projectsInfo: { [r]: f },
1870
1989
  projectNames: [r],
1871
- tagsOptions: p,
1872
- projectUsers: m,
1873
- activeProjectUsers: m,
1990
+ tagsOptions: m,
1991
+ projectUsers: u,
1992
+ activeProjectUsers: u,
1874
1993
  isSlideOut: !0,
1875
- scope: s,
1994
+ scope: n,
1876
1995
  onClose: b,
1877
- onOpenViewer: x
1996
+ onOpenViewer: N
1878
1997
  }
1879
1998
  ) }) : null;
1880
1999
  };
1881
- T(Os)`
2000
+ I(qn)`
1882
2001
  .p-dialog-header-icons {
1883
2002
  display: none;
1884
2003
  }
1885
2004
  .p-dialog-content {
1886
2005
  }
1887
2006
  `;
1888
- const Nn = T.div`
2007
+ const Ms = I.div`
1889
2008
  display: flex;
1890
2009
  flex-direction: column;
1891
2010
  margin: -8px;
1892
2011
  width: calc(100% + 16px);
1893
2012
  height: calc(100% + 16px);
1894
- `, En = T.header`
2013
+ `, _s = I.header`
1895
2014
  display: flex;
1896
2015
  align-items: flex-start;
1897
2016
  gap: var(--base-gap-large);
@@ -1903,7 +2022,7 @@ const Nn = T.div`
1903
2022
  display: none;
1904
2023
  }
1905
2024
  }
1906
- `, Dn = T.div`
2025
+ `, Hs = I.div`
1907
2026
  display: flex;
1908
2027
  flex-direction: column;
1909
2028
  height: 100%;
@@ -1940,12 +2059,12 @@ const Nn = T.div`
1940
2059
  align-items: center;
1941
2060
  gap: var(--base-gap-medium);
1942
2061
  }
1943
- `, In = T.div`
2062
+ `, Bs = I.div`
1944
2063
  display: flex;
1945
2064
  justify-content: space-between;
1946
2065
  padding: 8px;
1947
2066
  padding-top: 0;
1948
- `, Pn = T.div`
2067
+ `, Ws = I.div`
1949
2068
  border-top: solid 1px var(--md-sys-color-outline-variant);
1950
2069
  height: 100%;
1951
2070
  overflow: hidden;
@@ -1964,7 +2083,7 @@ const Nn = T.div`
1964
2083
  display: none;
1965
2084
  }
1966
2085
  }
1967
- `, Fn = T.div`
2086
+ `, zs = I.div`
1968
2087
  display: flex;
1969
2088
  align-items: center;
1970
2089
  gap: var(--base-gap-small);
@@ -1975,87 +2094,87 @@ const Nn = T.div`
1975
2094
  .icon {
1976
2095
  font-variation-settings: 'FILL' 1;
1977
2096
  }
1978
- `, Ta = () => {
1979
- const { pip: e } = K(), s = e?.entityType, t = e?.entities || [], o = e?.scope || "", n = t.length > 0 && !!s, a = t.map((y) => y.projectName), { data: r = [] } = jt({ projects: a }, { skip: !n }), { data: c = {}, isFetching: m } = Rt(
2097
+ `, _a = () => {
2098
+ const { pip: e } = ne(), n = e?.entityType, t = e?.entities || [], o = e?.scope || "", s = t.length > 0 && !!n, a = t.map((y) => y.projectName), { data: r = [] } = Qt({ projects: a }, { skip: !s }), { data: l = {}, isFetching: u } = qt(
1980
2099
  {
1981
2100
  projects: a
1982
2101
  },
1983
- { skip: !n }
1984
- ), f = C(
1985
- () => ot(c, a),
1986
- [c, a]
1987
- ), { data: p = [], isFetching: g } = Xe(
2102
+ { skip: !s }
2103
+ ), f = w(
2104
+ () => ft(l, a),
2105
+ [l, a]
2106
+ ), { data: m = [], isFetching: h } = it(
1988
2107
  // @ts-expect-error
1989
- { entityType: s, entities: t },
2108
+ { entityType: n, entities: t },
1990
2109
  {
1991
- skip: !n || m
2110
+ skip: !s || u
1992
2111
  }
1993
- ), b = C(
1994
- () => rt(c, a),
1995
- [c, a]
1996
- ), x = C(
2112
+ ), b = w(
2113
+ () => vt(l, a),
2114
+ [l, a]
2115
+ ), N = w(
1997
2116
  () => ({
1998
- task: b.taskTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {}),
1999
- folder: b.folderTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {}),
2000
- product: b.productTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {})
2117
+ task: b.taskTypes.filter((y) => !!y.icon).reduce((y, k) => ({ ...y, [k.name]: k.icon }), {}),
2118
+ folder: b.folderTypes.filter((y) => !!y.icon).reduce((y, k) => ({ ...y, [k.name]: k.icon }), {}),
2119
+ product: b.productTypes.filter((y) => !!y.icon).reduce((y, k) => ({ ...y, [k.name]: k.icon }), {})
2001
2120
  }),
2002
2121
  [b]
2003
- ), $ = C(
2004
- () => s ? st(p, s, x) : [],
2005
- [p, s]
2006
- ), U = C(() => r.filter((y) => p.some((w) => w?.task?.assignees?.includes(y.name))).map((y) => ({ ...y, avatarUrl: `/api/users/${y.name}/avatar` })), [r, t]), A = p[0];
2007
- if (!p.length || !A) return null;
2008
- if (g) return /* @__PURE__ */ i("div", { children: "Loading..." });
2009
- const d = A?.projectName, N = p.some((y) => y?.status !== A?.status) ? {
2122
+ ), V = w(
2123
+ () => n ? mt(m, n, N) : [],
2124
+ [m, n]
2125
+ ), U = w(() => r.filter((y) => m.some((k) => k?.task?.assignees?.includes(y.name))).map((y) => ({ ...y, avatarUrl: `/api/users/${y.name}/avatar` })), [r, t]), O = m[0];
2126
+ if (!m.length || !O) return null;
2127
+ if (h) return /* @__PURE__ */ i("div", { children: "Loading..." });
2128
+ const c = O?.projectName, E = m.some((y) => y?.status !== O?.status) ? {
2010
2129
  icon: "question_mark",
2011
2130
  color: "var(--md-sys-color-surface-container-highest)",
2012
2131
  name: "Mixed statuses"
2013
- } : f.find((y) => y.name === A?.status) || {
2132
+ } : f.find((y) => y.name === O?.status) || {
2014
2133
  icon: "",
2015
2134
  color: "",
2016
2135
  name: "None"
2017
2136
  };
2018
- if (!s) return null;
2019
- const { title: j, subTitle: E } = at(p, s);
2020
- return /* @__PURE__ */ i(cs, { children: /* @__PURE__ */ i(et, { projectName: d, children: /* @__PURE__ */ k(Nn, { children: [
2021
- /* @__PURE__ */ k(En, { children: [
2022
- /* @__PURE__ */ i(Ye, { thumbnails: $ }),
2023
- /* @__PURE__ */ k(Dn, { children: [
2024
- /* @__PURE__ */ i("h2", { children: j }),
2025
- /* @__PURE__ */ k("div", { className: "sub-title", children: [
2026
- /* @__PURE__ */ k("span", { children: [
2027
- Ze(s),
2137
+ if (!n) return null;
2138
+ const { title: T, subTitle: D } = gt(m, n);
2139
+ return /* @__PURE__ */ i(Sn, { children: /* @__PURE__ */ i(ct, { projectName: c, children: /* @__PURE__ */ x(Ms, { children: [
2140
+ /* @__PURE__ */ x(_s, { children: [
2141
+ /* @__PURE__ */ i(rt, { thumbnails: V }),
2142
+ /* @__PURE__ */ x(Hs, { children: [
2143
+ /* @__PURE__ */ i("h2", { children: T }),
2144
+ /* @__PURE__ */ x("div", { className: "sub-title", children: [
2145
+ /* @__PURE__ */ x("span", { children: [
2146
+ lt(n),
2028
2147
  " - "
2029
2148
  ] }),
2030
- /* @__PURE__ */ i("h3", { children: E })
2149
+ /* @__PURE__ */ i("h3", { children: D })
2031
2150
  ] })
2032
2151
  ] })
2033
2152
  ] }),
2034
- /* @__PURE__ */ k(In, { children: [
2035
- /* @__PURE__ */ k(
2036
- Fn,
2153
+ /* @__PURE__ */ x(Bs, { children: [
2154
+ /* @__PURE__ */ x(
2155
+ zs,
2037
2156
  {
2038
2157
  style: {
2039
- backgroundColor: N?.color,
2040
- color: Fe(N?.color)
2158
+ backgroundColor: E?.color,
2159
+ color: Re(E?.color)
2041
2160
  },
2042
2161
  children: [
2043
- /* @__PURE__ */ i(we, { icon: N.icon || "question_mark", style: { color: "inherit" } }),
2044
- /* @__PURE__ */ i("span", { className: "label", children: N?.name })
2162
+ /* @__PURE__ */ i(Ee, { icon: E.icon || "question_mark", style: { color: "inherit" } }),
2163
+ /* @__PURE__ */ i("span", { className: "label", children: E?.name })
2045
2164
  ]
2046
2165
  }
2047
2166
  ),
2048
- /* @__PURE__ */ i(Ct, { users: U, style: { pointerEvents: "none" } })
2167
+ /* @__PURE__ */ i(Lt, { users: U, style: { pointerEvents: "none" } })
2049
2168
  ] }),
2050
- /* @__PURE__ */ i(Pn, { children: /* @__PURE__ */ i(
2051
- it,
2169
+ /* @__PURE__ */ i(Ws, { children: /* @__PURE__ */ i(
2170
+ bt,
2052
2171
  {
2053
- entityType: s,
2054
- entities: p,
2055
- thumbnailHash: A?.thumbnailHash,
2172
+ entityType: n,
2173
+ entities: m,
2174
+ thumbnailHash: O?.thumbnailHash,
2056
2175
  activeUsers: [],
2057
- projectInfo: c[d],
2058
- projectName: d,
2176
+ projectInfo: l[c],
2177
+ projectName: c,
2059
2178
  disabled: !1,
2060
2179
  scope: o,
2061
2180
  readOnly: !0,
@@ -2065,23 +2184,23 @@ const Nn = T.div`
2065
2184
  ] }) }) });
2066
2185
  };
2067
2186
  export {
2068
- Gt as AssigneeSelect,
2069
- Da as CloseButton,
2070
- Mt as Content,
2071
- Ia as ContentRow,
2072
- Sn as DetailsPanel,
2073
- Ta as DetailsPanelFloating,
2074
- Ca as DetailsPanelSlideOut,
2075
- Pa as Footer,
2076
- Ut as Grid,
2077
- _t as Header,
2078
- Lt as HeaderContainer,
2079
- Fa as LabelWrapper,
2080
- Qt as PriorityEnumDropdown,
2081
- Wt as ReadOnlyTags,
2082
- zt as StatusSelect,
2083
- Bt as TagsSelect,
2084
- Aa as ThumbnailWrapper,
2085
- Ht as Title,
2086
- wn as entitiesWithoutFeed
2187
+ on as AssigneeSelect,
2188
+ Wa as CloseButton,
2189
+ en as Content,
2190
+ za as ContentRow,
2191
+ Vs as DetailsPanel,
2192
+ _a as DetailsPanelFloating,
2193
+ Ma as DetailsPanelSlideOut,
2194
+ Ga as Footer,
2195
+ Yt as Grid,
2196
+ Zt as Header,
2197
+ Xt as HeaderContainer,
2198
+ Qa as LabelWrapper,
2199
+ rn as PriorityEnumDropdown,
2200
+ sn as ReadOnlyTags,
2201
+ an as StatusSelect,
2202
+ nn as TagsSelect,
2203
+ qa as ThumbnailWrapper,
2204
+ tn as Title,
2205
+ tt as entitiesWithoutFeed
2087
2206
  };