@ynput/ayon-frontend-shared 0.7.0 → 0.7.2

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 (36) hide show
  1. package/dist/DetailsPanel.es.js +765 -739
  2. package/dist/ListTable.es.js +80 -80
  3. package/dist/NewEntity.es.js +2 -2
  4. package/dist/ProjectTreeTable.es.js +1424 -1409
  5. package/dist/Views.es.js +572 -570
  6. package/dist/api.es.js +300 -298
  7. package/dist/chunks/Actions.es.js +5 -5
  8. package/dist/chunks/DetailsDialog.es.js +3 -3
  9. package/dist/chunks/EntityPath.es.js +14 -14
  10. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  11. package/dist/chunks/EntityTooltip.es.js +18 -18
  12. package/dist/chunks/Feed.es.js +2 -2
  13. package/dist/chunks/MetaWidget.es.js +2422 -2149
  14. package/dist/chunks/PlayableIcon.es.js +20 -20
  15. package/dist/chunks/ProjectContext.es.js +6 -6
  16. package/dist/chunks/RepresentationsList.es.js +1 -1
  17. package/dist/chunks/ReviewablesSelector.es.js +2 -2
  18. package/dist/chunks/Slicer.es.js +2 -2
  19. package/dist/chunks/TableExportContextInstance.es.js +1 -1
  20. package/dist/chunks/ThumbnailSimple.es.js +12 -12
  21. package/dist/chunks/Watchers.es.js +907 -855
  22. package/dist/chunks/getUris.es.js +1272 -1209
  23. package/dist/chunks/searchTerms.es.js +30 -66
  24. package/dist/chunks/useAttributeEnums.es.js +37 -37
  25. package/dist/chunks/viewUpdateHelper.es.js +10 -10
  26. package/dist/components.es.js +132 -131
  27. package/dist/context.es.js +76 -76
  28. package/dist/hooks.es.js +51 -50
  29. package/dist/types/ProjectTreeTable.d.ts +21 -1
  30. package/dist/types/Slicer.d.ts +6 -4
  31. package/dist/types/Views.d.ts +4 -0
  32. package/dist/types/api.d.ts +411 -438
  33. package/dist/types/components.d.ts +22 -0
  34. package/dist/types/context.d.ts +2 -0
  35. package/dist/types/hooks.d.ts +36 -1
  36. package/package.json +4 -4
@@ -1,25 +1,25 @@
1
- import { jsx as m, jsxs as z, Fragment as Z } from "react/jsx-runtime";
2
- import { useMemo as W, useCallback as Q, useState as L, useEffect as V, useRef as X, forwardRef as q, useContext as Ee } from "react";
3
- import { snakeCase as Te, upperFirst as Se, intersectionBy as le } from "lodash";
1
+ import { jsx as g, jsxs as R, Fragment as ae } from "react/jsx-runtime";
2
+ import { useMemo as I, useCallback as Y, useState as O, useEffect as q, useRef as ne, forwardRef as ee, useContext as Se } from "react";
3
+ import { getMixedCounts as Te, BorderedSection as J, Button as _, applyMixedChange as je, StatusSelect as De, AssigneeSelect as Fe, TagsSelect as Ce, EnumDropdown as Ae, Icon as V, getMimeTypeIcon as Ne, theme as $e, getFileSizeString as Me, WatcherSelect as ze } from "@ynput/ayon-react-components";
4
+ import { snakeCase as Re, upperFirst as Ue, intersectionBy as he } from "lodash";
4
5
  import "primereact/confirmdialog";
5
- import { toast as G } from "react-toastify";
6
- import { c as K } from "./copyToClipboard.es.js";
6
+ import { toast as te } from "react-toastify";
7
+ import { c as oe } from "./copyToClipboard.es.js";
7
8
  import "uuid";
8
- import { aF as ce, b6 as De, bs as de, b9 as je, ba as Fe, bb as Ce, bB as Ae, by as Ne, bJ as $e, br as Re, a as B, bz as ze } from "./searchTerms.es.js";
9
- import p, { keyframes as pe, css as ue } from "styled-components";
9
+ import { aF as fe, b6 as Le, bs as ve, b9 as Pe, ba as We, bb as Oe, bB as Ie, by as Ve, bJ as Be, br as He, a as K, bz as _e } from "./searchTerms.es.js";
10
+ import p, { keyframes as ye, css as be } from "styled-components";
10
11
  import U from "clsx";
11
- import { BorderedSection as H, Button as O, StatusSelect as Me, AssigneeSelect as Ue, TagsSelect as Le, EnumDropdown as Pe, Icon as P, getMimeTypeIcon as We, theme as Oe, getFileSizeString as Ie, WatcherSelect as Ve } from "@ynput/ayon-react-components";
12
- import { o as Be, M as He, T as _e, n as Qe, B as qe, D as Ge } from "./MetaWidget.es.js";
12
+ import { r as Qe, t as qe, M as Ge, T as Ke, q as Je, B as Ze, D as Xe } from "./MetaWidget.es.js";
13
13
  import "./PlayableIcon.es.js";
14
- import { dn as Ke, b$ as Je, cd as me, bj as Ze, ar as Xe, by as Ye, db as et } from "./getUris.es.js";
14
+ import { dq as Ye, c0 as et, ce as xe, bk as tt, as as ot, bz as rt, dd as at } from "./getUris.es.js";
15
15
  import "@module-federation/enhanced/runtime";
16
- import { o as J, d as tt, x as ot, T as rt } from "./TableExportContextInstance.es.js";
16
+ import { o as re, d as nt, x as it, T as st } from "./TableExportContextInstance.es.js";
17
17
  import "semver";
18
18
  import "./ContextMenuContextInstance.es.js";
19
19
  import "react-dom";
20
20
  import "react-redux";
21
21
  import "react-router-dom";
22
- import { format as nt } from "date-fns";
22
+ import { format as lt } from "date-fns";
23
23
  import "lexical";
24
24
  import "@lexical/markdown";
25
25
  import "match-sorter";
@@ -31,16 +31,16 @@ import "@lexical/utils";
31
31
  import "@lexical/react/LexicalBlockWithAlignableContents";
32
32
  import "@lexical/react/LexicalDecoratorBlockNode";
33
33
  import "@tanstack/react-table";
34
- import { g as at, h as Y } from "./humanizeFieldName.es.js";
35
- import { a as it, A as st } from "./ThumbnailSimple.es.js";
36
- import ge from "axios";
37
- import { p as I } from "./parseFilename.es.js";
38
- import { classNames as lt } from "primereact/utils";
39
- import { u as ct } from "./useCreateContextMenu.es.js";
40
- import { g as dt } from "./getThumbnailUrl.es.js";
41
- const ee = [], pt = (e) => {
42
- const { data: t, isError: r } = Ce(void 0, { skip: !e });
43
- return W(
34
+ import { g as ct, h as ie } from "./humanizeFieldName.es.js";
35
+ import { a as dt, A as pt } from "./ThumbnailSimple.es.js";
36
+ import we from "axios";
37
+ import { p as Q } from "./parseFilename.es.js";
38
+ import { classNames as ut } from "primereact/utils";
39
+ import { u as mt } from "./useCreateContextMenu.es.js";
40
+ import { g as gt } from "./getThumbnailUrl.es.js";
41
+ const se = [], ht = (e) => {
42
+ const { data: t, isError: r } = Oe(void 0, { skip: !e });
43
+ return I(
44
44
  () => ({
45
45
  // a failed registry is settled too: every param is sent, same fallback as the batch
46
46
  isRegistryLoaded: !!t || r,
@@ -48,55 +48,55 @@ const ee = [], pt = (e) => {
48
48
  }),
49
49
  [t, r, e]
50
50
  );
51
- }, Bo = () => {
52
- const [e] = je(), [t] = Fe();
53
- return Q(
51
+ }, Go = () => {
52
+ const [e] = Pe(), [t] = We();
53
+ return Y(
54
54
  async (r, o) => {
55
- const a = (await t(void 0, !0).unwrap().catch(() => {
56
- }))?.find(({ name: n }) => n === r.enumResolver)?.acceptedParams;
55
+ const n = (await t(void 0, !0).unwrap().catch(() => {
56
+ }))?.find(({ name: a }) => a === r.enumResolver)?.acceptedParams;
57
57
  try {
58
- const n = await e(
59
- ce(r, { projectName: o }, a),
58
+ const a = await e(
59
+ fe(r, { projectName: o }, n),
60
60
  !0
61
61
  ).unwrap();
62
- if (n.error) throw new Error(n.error);
63
- return de(n.items);
64
- } catch (n) {
65
- throw ut(n);
62
+ if (a.error) throw new Error(a.error);
63
+ return ve(a.items);
64
+ } catch (a) {
65
+ throw ft(a);
66
66
  }
67
67
  },
68
68
  [e, t]
69
69
  );
70
- }, ut = (e) => {
70
+ }, ft = (e) => {
71
71
  if (e instanceof Error) return e;
72
72
  const {
73
73
  message: t,
74
74
  data: r,
75
75
  status: o,
76
- error: l
76
+ error: c
77
77
  } = e || {};
78
- return typeof r?.detail == "string" ? new Error(r.detail) : typeof l == "string" ? new Error(l) : typeof t == "string" ? new Error(t) : new Error(o ? `Request failed (${o})` : "Request failed");
79
- }, mt = (e, { projectName: t, skip: r } = {}) => {
80
- const o = e?.enumResolver, { acceptedParams: l, isRegistryLoaded: a } = pt(o), n = W(
81
- () => ce(e, { projectName: t }, l),
78
+ return typeof r?.detail == "string" ? new Error(r.detail) : typeof c == "string" ? new Error(c) : typeof t == "string" ? new Error(t) : new Error(o ? `Request failed (${o})` : "Request failed");
79
+ }, vt = (e, { projectName: t, skip: r } = {}) => {
80
+ const o = e?.enumResolver, { acceptedParams: c, isRegistryLoaded: n } = ht(o), a = I(
81
+ () => fe(e, { projectName: t }, c),
82
82
  // eslint-disable-next-line react-hooks/exhaustive-deps
83
- [o, e?.enumResolverSettings, t, l]
83
+ [o, e?.enumResolverSettings, t, c]
84
84
  ), {
85
- currentData: c,
86
- isFetching: g,
87
- isError: s
88
- } = De(n, {
85
+ currentData: d,
86
+ isFetching: h,
87
+ isError: i
88
+ } = Le(a, {
89
89
  // waiting for the registry keeps the cache key final: no request is sent with params that get dropped
90
- skip: !o || !!r || !a
91
- }), u = W(() => o ? c ? de(c.items) : ee : e?.enum || ee, [o, c, e?.enum]), i = !!o && !g && (s || !!c?.error);
90
+ skip: !o || !!r || !n
91
+ }), u = I(() => o ? d ? ve(d.items) : se : e?.enum || se, [o, d, e?.enum]), f = !!o && !h && (i || !!d?.error);
92
92
  return {
93
93
  options: u,
94
94
  // a background refetch (tag invalidation) keeps the cached options, so it is not a load
95
- isLoading: !!o && !r && (!a || g && !c),
96
- isError: i,
97
- errorMessage: i ? c?.error : void 0
95
+ isLoading: !!o && !r && (!n || h && !d),
96
+ isError: f,
97
+ errorMessage: f ? d?.error : void 0
98
98
  };
99
- }, gt = [
99
+ }, yt = [
100
100
  "id",
101
101
  "name",
102
102
  "label",
@@ -111,14 +111,14 @@ const ee = [], pt = (e) => {
111
111
  "projectName",
112
112
  "path",
113
113
  "description"
114
- ], te = [
114
+ ], le = [
115
115
  "id",
116
116
  "entityType",
117
117
  "projectName",
118
118
  "path",
119
119
  "createdAt",
120
120
  "updatedAt"
121
- ], ht = [
121
+ ], bt = [
122
122
  "name",
123
123
  "label",
124
124
  "taskType",
@@ -126,68 +126,68 @@ const ee = [], pt = (e) => {
126
126
  "productType",
127
127
  "tags",
128
128
  "status"
129
- ], ft = (e, t) => {
130
- const [r, o] = L([]), [l, a] = L(null), n = () => {
131
- const s = {}, u = /* @__PURE__ */ new Set();
132
- e.forEach((h) => {
129
+ ], xt = (e, t) => {
130
+ const [r, o] = O([]), [c, n] = O(null), a = () => {
131
+ const i = {}, u = /* @__PURE__ */ new Set();
132
+ e.forEach((s) => {
133
133
  const v = {
134
- id: h.id,
135
- name: h.name,
136
- label: h.label,
137
- entityType: h.entityType,
138
- createdAt: h.createdAt,
139
- updatedAt: h.updatedAt,
140
- projectName: h.projectName,
141
- status: h.status,
142
- tags: h.tags || [],
143
- path: h.path,
144
- folderType: h.folder?.folderType,
145
- productType: h.product?.productType,
146
- taskType: h.task?.taskType,
147
- description: h.attrib?.description?.toString() ?? ""
134
+ id: s.id,
135
+ name: s.name,
136
+ label: s.label,
137
+ entityType: s.entityType,
138
+ createdAt: s.createdAt,
139
+ updatedAt: s.updatedAt,
140
+ projectName: s.projectName,
141
+ status: s.status,
142
+ tags: s.tags || [],
143
+ path: s.path,
144
+ folderType: s.folder?.folderType,
145
+ productType: s.product?.productType,
146
+ taskType: s.task?.taskType,
147
+ description: s.attrib?.description?.toString() ?? ""
148
148
  };
149
- Object.keys(v).forEach((f) => {
150
- gt.includes(f) && (s[f] = s[f] || [], s[f].push(v[f]));
151
- }), h.attrib && Object.keys(h.attrib).forEach((f) => {
152
- if (f !== "description") {
153
- const w = `attrib.${f}`;
154
- s[w] = s[w] || [], s[w].push(h.attrib?.[f]);
149
+ Object.keys(v).forEach((m) => {
150
+ yt.includes(m) && (i[m] = i[m] || [], i[m].push(v[m]));
151
+ }), s.attrib && Object.keys(s.attrib).forEach((m) => {
152
+ if (m !== "description") {
153
+ const w = `attrib.${m}`;
154
+ i[w] = i[w] || [], i[w].push(s.attrib?.[m]);
155
155
  }
156
156
  });
157
157
  });
158
- const i = Object.entries(s).reduce((h, [v, f]) => {
159
- const { value: w, isMixed: y } = at(f);
160
- return h[v] = w, y && u.add(v), h;
158
+ const f = Object.entries(i).reduce((s, [v, m]) => {
159
+ const { value: w, isMixed: T } = ct(m);
160
+ return s[v] = w, T && u.add(v), s;
161
161
  }, {});
162
- a(i), o(Array.from(u));
162
+ n(f), o(Array.from(u));
163
163
  };
164
- return V(() => {
165
- t || e.length === 0 || n();
164
+ return q(() => {
165
+ t || e.length === 0 || a();
166
166
  }, [e, t]), {
167
- formData: l,
167
+ formData: c,
168
168
  mixedFields: r,
169
- updateFormData: (s, u) => {
170
- a((i) => i && {
171
- ...i,
172
- [s]: u
169
+ updateFormData: (i, u) => {
170
+ n((f) => f && {
171
+ ...f,
172
+ [i]: u
173
173
  });
174
174
  },
175
- clearMixedField: (s) => {
176
- o((u) => u.filter((i) => i !== s));
175
+ clearMixedField: (i) => {
176
+ o((u) => u.filter((f) => f !== i));
177
177
  }
178
178
  };
179
- }, vt = ({
179
+ }, wt = ({
180
180
  attributes: e,
181
181
  folderTypes: t,
182
182
  taskTypes: r,
183
183
  statuses: o,
184
- tags: l,
185
- entityType: a,
186
- folderHasVersions: n,
187
- attribAccess: c
184
+ tags: c,
185
+ entityType: n,
186
+ folderHasVersions: a,
187
+ attribAccess: d
188
188
  }) => {
189
- const g = W(() => {
190
- const { readableAttributes: i, writableAttributes: h, writableFields: v } = c || {}, w = [
189
+ const h = I(() => {
190
+ const { readableAttributes: f, writableAttributes: s, writableFields: v } = d || {}, w = [
191
191
  {
192
192
  name: "name",
193
193
  data: {
@@ -206,29 +206,29 @@ const ee = [], pt = (e) => {
206
206
  },
207
207
  {
208
208
  name: "folderType",
209
- hidden: a !== "folder",
209
+ hidden: n !== "folder",
210
210
  data: {
211
211
  type: "string",
212
212
  title: "Folder Type",
213
213
  description: "Type of the folder",
214
- enum: t.map((d) => ({
215
- value: d.name,
216
- label: d.name,
217
- icon: d.icon
214
+ enum: t.map((l) => ({
215
+ value: l.name,
216
+ label: l.name,
217
+ icon: l.icon
218
218
  }))
219
219
  }
220
220
  },
221
221
  {
222
222
  name: "taskType",
223
- hidden: a !== "task",
223
+ hidden: n !== "task",
224
224
  data: {
225
225
  type: "string",
226
226
  title: "Task Type",
227
227
  description: "Type of the task",
228
- enum: r.map((d) => ({
229
- value: d.name,
230
- label: d.name,
231
- icon: d.icon
228
+ enum: r.map((l) => ({
229
+ value: l.name,
230
+ label: l.name,
231
+ icon: l.icon
232
232
  }))
233
233
  }
234
234
  },
@@ -238,11 +238,11 @@ const ee = [], pt = (e) => {
238
238
  type: "string",
239
239
  title: "Status",
240
240
  description: "The state the entity is in, is it approved or in progress etc.",
241
- enum: o.map((d) => ({
242
- value: d.name,
243
- label: d.name,
244
- icon: d.icon,
245
- color: d.color
241
+ enum: o.map((l) => ({
242
+ value: l.name,
243
+ label: l.name,
244
+ icon: l.icon,
245
+ color: l.color
246
246
  }))
247
247
  }
248
248
  },
@@ -251,161 +251,162 @@ const ee = [], pt = (e) => {
251
251
  data: {
252
252
  type: "list_of_strings",
253
253
  title: "Tags",
254
- enum: l.map((d) => ({
255
- value: d.name,
256
- label: d.name,
257
- color: d.color
254
+ widget: "tags",
255
+ enum: c.map((l) => ({
256
+ value: l.name,
257
+ label: l.name,
258
+ color: l.color
258
259
  }))
259
260
  }
260
261
  }
261
262
  ].map(
262
- (d) => d.name === "folderType" && a === "folder" && n ? {
263
- ...d,
263
+ (l) => l.name === "folderType" && n === "folder" && a ? {
264
+ ...l,
264
265
  readonly: !0,
265
266
  data: {
266
- ...d.data,
267
+ ...l.data,
267
268
  description: "Folder type is locked because the folder has published versions."
268
269
  }
269
- } : d
270
- ), y = a === "version" ? [
270
+ } : l
271
+ ), T = n === "version" ? [
271
272
  ...w.map(
272
- (d) => ["tags", "status"].includes(d.name) ? d : { ...d, readonly: !0 }
273
+ (l) => ["tags", "status"].includes(l.name) ? l : { ...l, readonly: !0 }
273
274
  )
274
- ] : w, x = v ? y.map(
275
- (d) => v.includes(d.name) || v.includes(Te(d.name)) ? d : { ...d, readonly: !0 }
276
- ) : y, F = a ? e.filter((d) => d.scope?.includes(a) && d.name !== "description").filter((d) => !i || i.includes(d.name)).map((d) => ({
277
- name: "attrib." + d.name,
278
- data: d.data,
279
- ...a === "version" && d.builtin ? { readonly: !0 } : {},
280
- ...h && !h.includes(d.name) ? { readonly: !0 } : {}
281
- })) : [], T = te.map((d) => ({
282
- name: d,
275
+ ] : w, S = v ? T.map(
276
+ (l) => v.includes(l.name) || v.includes(Re(l.name)) ? l : { ...l, readonly: !0 }
277
+ ) : T, b = n ? e.filter((l) => l.scope?.includes(n) && l.name !== "description").filter((l) => !f || f.includes(l.name)).map((l) => ({
278
+ name: "attrib." + l.name,
279
+ data: l.data,
280
+ ...n === "version" && l.builtin ? { readonly: !0 } : {},
281
+ ...s && !s.includes(l.name) ? { readonly: !0 } : {}
282
+ })) : [], k = le.map((l) => ({
283
+ name: l,
283
284
  readonly: !0,
284
285
  data: {
285
286
  type: "string",
286
- title: Se(d)
287
+ title: Ue(l)
287
288
  }
288
- })), A = [
289
- ...x,
290
- ...F,
291
- ...T
292
- ], k = ["path", "name"];
293
- return [...A].sort((d, D) => {
294
- const N = k.indexOf(d.name), C = k.indexOf(D.name);
295
- return N === -1 && C === -1 ? 0 : N === -1 ? 1 : C === -1 ? -1 : N - C;
289
+ })), C = [
290
+ ...S,
291
+ ...b,
292
+ ...k
293
+ ], E = ["path", "name"];
294
+ return [...C].sort((l, N) => {
295
+ const $ = E.indexOf(l.name), z = E.indexOf(N.name);
296
+ return $ === -1 && z === -1 ? 0 : $ === -1 ? 1 : z === -1 ? -1 : $ - z;
296
297
  });
297
298
  }, [
298
299
  e,
299
300
  t,
300
301
  r,
301
302
  o,
302
- l,
303
- a,
303
+ c,
304
304
  n,
305
- c
306
- ]), s = g.filter(
307
- (i) => ht.includes(i.name) || i.name.startsWith("attrib.")
308
- ), u = g.filter(
309
- (i) => te.includes(i.name)
305
+ a,
306
+ d
307
+ ]), i = h.filter(
308
+ (f) => bt.includes(f.name) || f.name.startsWith("attrib.")
309
+ ), u = h.filter(
310
+ (f) => le.includes(f.name)
310
311
  );
311
312
  return {
312
- fields: g,
313
- editableFields: s,
313
+ fields: h,
314
+ editableFields: i,
314
315
  readOnlyFieldsData: u
315
316
  };
316
- }, yt = ({ entities: e, entityType: t }) => {
317
- const [r] = Ke(), { onUpdateEntity: o } = J();
318
- return { updateEntity: async (a, n) => {
319
- if (n == null) {
317
+ }, kt = ({ entities: e, entityType: t }) => {
318
+ const [r] = Ye(), { onUpdateEntity: o } = re();
319
+ return { updateEntity: async (n, a) => {
320
+ if (a == null) {
320
321
  console.error("value is null or undefined");
321
322
  return;
322
323
  }
323
324
  try {
324
- const c = e.map((g) => ({
325
- id: g.id,
326
- projectName: g.projectName,
325
+ const d = e.map((h) => ({
326
+ id: h.id,
327
+ projectName: h.projectName,
327
328
  data: {
328
- [a]: n
329
+ [n]: typeof a == "function" ? a(h.id) : a
329
330
  },
330
- currentAssignees: g.users,
331
+ currentAssignees: h.users,
331
332
  meta: {
332
- folderId: g.folderId
333
+ folderId: h.folderId
333
334
  }
334
335
  }));
335
- await r({ operations: c, entityType: t }), o?.({ operations: c, entityType: t });
336
+ await r({ operations: d, entityType: t }), o?.({ operations: d, entityType: t });
336
337
  } catch {
337
- G.error(`Error updating ${t}`);
338
+ te.error(`Error updating ${t}`);
338
339
  }
339
340
  } };
340
- }, _ = (e) => e.reduce(
341
+ }, X = (e) => e.reduce(
341
342
  (t, r) => r ? t ? t.filter((o) => r.includes(o)) : r : t,
342
343
  void 0
343
- ), bt = ({ entities: e, entityType: t }) => {
344
- const { data: o } = Je(), l = W(() => {
344
+ ), Et = ({ entities: e, entityType: t }) => {
345
+ const { data: o } = et(), c = I(() => {
345
346
  if (!o?.projects) return {};
346
- const n = [...new Set(e.map((s) => s.projectName))].map(
347
- (s) => o.projects?.[s] || {}
348
- ), c = n.map((s) => s.attrib_read), g = n.map((s) => s.attrib_write);
347
+ const a = [...new Set(e.map((i) => i.projectName))].map(
348
+ (i) => o.projects?.[i] || {}
349
+ ), d = a.map((i) => i.attrib_read), h = a.map((i) => i.attrib_write);
349
350
  return {
350
- readableAttributes: _(
351
- c.map((s) => s?.enabled ? s.attributes ?? [] : void 0)
351
+ readableAttributes: X(
352
+ d.map((i) => i?.enabled ? i.attributes ?? [] : void 0)
352
353
  ),
353
- writableAttributes: _(
354
- g.map((s) => s?.enabled ? s.attributes ?? [] : void 0)
354
+ writableAttributes: X(
355
+ h.map((i) => i?.enabled ? i.attributes ?? [] : void 0)
355
356
  ),
356
- writableFields: _(g.map((s) => s?.enabled ? s.fields ?? [] : void 0))
357
+ writableFields: X(h.map((i) => i?.enabled ? i.fields ?? [] : void 0))
357
358
  };
358
- }, [o, e]), { updateEntity: a } = yt({
359
- entities: e.map((n) => ({
360
- id: n.id,
361
- projectName: n.projectName || "",
362
- folderId: n.folder?.id,
363
- productId: n.product?.id,
364
- users: n.task?.assignees || []
359
+ }, [o, e]), { updateEntity: n } = kt({
360
+ entities: e.map((a) => ({
361
+ id: a.id,
362
+ projectName: a.projectName || "",
363
+ folderId: a.folder?.id,
364
+ productId: a.product?.id,
365
+ users: a.task?.assignees || []
365
366
  })),
366
367
  entityType: t
367
368
  });
368
369
  return {
369
370
  enableEditing: !0,
370
- attribAccess: l,
371
- updateEntity: a
371
+ attribAccess: c,
372
+ updateEntity: n
372
373
  };
373
- }, xt = (e, t) => {
374
- const r = me({ projects: [...new Set(e).values()] });
374
+ }, St = (e, t) => {
375
+ const r = xe({ projects: [...new Set(e).values()] });
375
376
  if (!r || !r.data)
376
377
  return [];
377
378
  let o;
378
- for (const l of Object.values(r.data)) {
379
- const a = l.statuses?.filter(
380
- (n) => t.every((c) => !n.scope || n.scope?.includes(c))
379
+ for (const c of Object.values(r.data)) {
380
+ const n = c.statuses?.filter(
381
+ (a) => t.every((d) => !a.scope || a.scope?.includes(d))
381
382
  ) || [];
382
383
  if (o === void 0) {
383
- o = a;
384
+ o = n;
384
385
  continue;
385
386
  }
386
- o = le(o, a, "name");
387
+ o = he(o, n, "name");
387
388
  }
388
389
  return o;
389
- }, Ho = (e, t) => {
390
+ }, Ko = (e, t) => {
390
391
  let r = Object.values(e || {});
391
392
  return r.length == 0 || r[0].scope === void 0 ? r : r.filter(
392
- (o) => t.every((l) => o.scope === void 0 || o.scope.includes(l))
393
+ (o) => t.every((c) => o.scope === void 0 || o.scope.includes(c))
393
394
  );
394
- }, wt = (e, t) => {
395
- const r = me({ projects: [...new Set(e).values()] });
395
+ }, Tt = (e, t) => {
396
+ const r = xe({ projects: [...new Set(e).values()] });
396
397
  if (!r || !r.data)
397
398
  return [];
398
399
  let o;
399
- for (const l of Object.values(r.data)) {
400
- let a = [];
401
- if (t === "task" ? a = l.taskTypes || [] : t === "folder" && (a = l.folderTypes || []), o === void 0) {
402
- o = a;
400
+ for (const c of Object.values(r.data)) {
401
+ let n = [];
402
+ if (t === "task" ? n = c.taskTypes || [] : t === "folder" && (n = c.folderTypes || []), o === void 0) {
403
+ o = n;
403
404
  continue;
404
405
  }
405
- o = le(o, a, "name");
406
+ o = he(o, n, "name");
406
407
  }
407
408
  return o || [];
408
- }, oe = p.div`
409
+ }, ce = p.div`
409
410
  width: 100%;
410
411
  overflow: hidden;
411
412
  text-overflow: ellipsis;
@@ -415,7 +416,7 @@ const ee = [], pt = (e) => {
415
416
  input {
416
417
  text-align: left;
417
418
  }
418
- `, kt = p(Be)`
419
+ `, jt = p(Qe)`
419
420
  .enum,
420
421
  .edit-trigger {
421
422
  &:hover {
@@ -425,144 +426,179 @@ const ee = [], pt = (e) => {
425
426
  &:hover {
426
427
  background-color: unset;
427
428
  }
428
- `, Et = ({
429
+ `, Dt = p(qe)`
430
+ &.enum:hover {
431
+ background-color: unset;
432
+ }
433
+ `, Ft = ({
429
434
  field: e,
430
435
  value: t,
431
436
  isEditing: r,
432
437
  isReadOnly: o,
433
- isMixed: l,
434
- onChange: a,
435
- onCancelEdit: n,
436
- onExpand: c,
437
- entities: g = [],
438
- entityType: s = "task",
439
- projectName: u
438
+ isMixed: c,
439
+ onChange: n,
440
+ onMixedChange: a,
441
+ onCancelEdit: d,
442
+ onExpand: h,
443
+ entities: i = [],
444
+ entityType: u = "task",
445
+ projectName: f
440
446
  }) => {
441
- const { type: i, widget: h } = e.data, v = {
447
+ const { type: s, widget: v } = e.data, m = {
442
448
  isEditing: r && !o,
443
449
  isReadOnly: o,
444
450
  isInherited: !1,
445
- onChange: ($) => a(e.name, $)
446
- }, f = g.map(($) => $.projectName), w = xt(f, [s]), y = wt(f, s), x = u || f[0], {
447
- options: F,
448
- isLoading: T,
449
- isError: A,
450
- errorMessage: k
451
- } = mt(e.data, { projectName: x }), S = A ? Re(k) : void 0, d = e.name === "attrib.endDate" && g.length > 0 && g.every(($) => $.data?.schedulerSyncData?.allDay === !0);
452
- let D = t ?? "";
453
- const N = e.data.title || e.name, C = t == null || t === "" || Array.isArray(t) && t.length === 0;
454
- if (i !== "boolean" && o && !l && C)
455
- return /* @__PURE__ */ m(oe, { children: "-" });
451
+ onChange: (A) => n(e.name, A)
452
+ }, w = i.map((A) => A.projectName), T = St(w, [u]), S = Tt(w, u), b = f || w[0], {
453
+ options: k,
454
+ isLoading: C,
455
+ isError: E,
456
+ errorMessage: D
457
+ } = vt(e.data, { projectName: b }), l = E ? He(D) : void 0, N = I(() => {
458
+ if (!(!a || i.length < 2 || s !== "list_of_strings"))
459
+ return Te(
460
+ i.map((A) => {
461
+ const L = e.name === "tags" ? A.tags : e.name.startsWith("attrib.") ? A.attrib?.[e.name.slice(7)] : void 0;
462
+ return Array.isArray(L) ? L.map(String) : [];
463
+ })
464
+ );
465
+ }, [a, i, s, e.name]), $ = N && {
466
+ mixedCounts: N,
467
+ mixedTotal: i.length,
468
+ mixedLabel: `${u}s`,
469
+ onMixedChange: (A) => a?.(e.name, A)
470
+ }, z = e.name === "attrib.endDate" && i.length > 0 && i.every((A) => A.data?.schedulerSyncData?.allDay === !0);
471
+ let F = t ?? "";
472
+ const y = e.data.title || e.name, j = t == null || t === "" || Array.isArray(t) && t.length === 0;
473
+ if (s !== "boolean" && o && !c && j)
474
+ return /* @__PURE__ */ g(ce, { children: "-" });
456
475
  switch (!0) {
457
- case i === "boolean":
458
- return /* @__PURE__ */ m(qe, { value: !!D, ...v, style: { margin: 0 } });
459
- case i === "datetime":
460
- return /* @__PURE__ */ m(
461
- Qe,
476
+ case s === "boolean":
477
+ return /* @__PURE__ */ g(Ze, { value: !!F, ...m, style: { margin: 0 } });
478
+ case s === "datetime":
479
+ return /* @__PURE__ */ g(
480
+ Je,
462
481
  {
463
- value: D,
464
- ...v,
482
+ value: F,
483
+ ...m,
465
484
  isEditing: !0,
466
- onCancelEdit: n,
485
+ onCancelEdit: d,
467
486
  style: { width: "fit-content" },
468
487
  autoFocus: !1,
469
- isMidnightExclusive: d
488
+ isMidnightExclusive: z
470
489
  }
471
490
  );
472
- case Ae(e.data): {
473
- const $ = i?.includes("list");
474
- let b = [];
475
- $ ? b = Array.isArray(D) ? D : [] : l ? b = [] : b = [D];
476
- let E = F.map((j) => ({
477
- value: j.value,
478
- label: j.label,
479
- icon: Ne(j.icon),
480
- color: j.color,
481
- group: j.group,
482
- hidden: j.hidden
491
+ case v === "tags":
492
+ return /* @__PURE__ */ g(
493
+ Dt,
494
+ {
495
+ value: Array.isArray(F) ? F : [],
496
+ options: k,
497
+ projectName: b,
498
+ isProjectTags: e.name === "tags" && new Set(w).size <= 1,
499
+ pt: { template: { style: { height: 32 }, className: "enum" } },
500
+ placeholder: c ? `Mixed ${y}` : `Select ${y}...`,
501
+ ...$,
502
+ onCancelEdit: d,
503
+ align: "right",
504
+ ...m
505
+ }
506
+ );
507
+ case Ie(e.data): {
508
+ const A = s?.includes("list");
509
+ let L = [];
510
+ A ? L = Array.isArray(F) ? F : [] : c ? L = [] : L = [F];
511
+ let P = k.map((x) => ({
512
+ value: x.value,
513
+ label: x.label,
514
+ icon: Ve(x.icon),
515
+ color: x.color,
516
+ group: x.group,
517
+ hidden: x.hidden
483
518
  }));
484
- return e.name === "status" && g.length > 0 && w && w.length > 0 && (E = w.map((j) => ({
485
- value: j.name,
486
- label: j.name,
487
- icon: j.icon,
488
- color: j.color
489
- }))), e.name === "taskType" && g.length > 0 && y && y.length > 0 && (E = y.map((j) => ({
490
- value: j.name,
491
- label: j.name,
492
- icon: j.icon,
493
- color: j.color
494
- }))), e.allowNone && b.length && !$ && D && D !== "" && (E = [
519
+ return e.name === "status" && i.length > 0 && T && T.length > 0 && (P = T.map((x) => ({
520
+ value: x.name,
521
+ label: x.name,
522
+ icon: x.icon,
523
+ color: x.color
524
+ }))), e.name === "taskType" && i.length > 0 && S && S.length > 0 && (P = S.map((x) => ({
525
+ value: x.name,
526
+ label: x.name,
527
+ icon: x.icon,
528
+ color: x.color
529
+ }))), e.allowNone && L.length && !A && F && F !== "" && (P = [
495
530
  { value: "", label: `No ${e.data.title || e.name}` },
496
- ...E
497
- ]), /* @__PURE__ */ m(
498
- kt,
531
+ ...P
532
+ ]), /* @__PURE__ */ g(
533
+ jt,
499
534
  {
500
- "data-tooltip": S,
501
- value: b,
502
- options: E,
503
- type: i,
535
+ "data-tooltip": l,
536
+ value: L,
537
+ options: P,
538
+ type: s,
504
539
  pt: {
505
540
  template: {
506
541
  style: { height: 32 },
507
542
  className: "enum"
508
543
  }
509
544
  },
510
- placeholder: S ? `Could not load ${N}` : l ? `Mixed ${N}` : `Select ${N}...`,
511
- error: $e(S),
512
- onCancelEdit: n,
545
+ placeholder: l ? `Could not load ${y}` : c ? `Mixed ${y}` : `Select ${y}...`,
546
+ error: Be(l),
547
+ onCancelEdit: d,
513
548
  align: "right",
514
549
  enableCustomValues: e.enableCustomValues,
515
- isLoadingOptions: T,
516
- search: e.enableSearch ?? E.length >= 5,
517
- sortBySelected: !E,
518
- ...v
550
+ isLoadingOptions: C,
551
+ search: e.enableSearch ?? P.length >= 5,
552
+ sortBySelected: !P,
553
+ ...$,
554
+ ...m
519
555
  }
520
556
  );
521
557
  }
522
- case (i === "string" || i === "integer" || i === "float"):
558
+ case (s === "string" || s === "integer" || s === "float"):
523
559
  default:
524
- return h === "markdown" ? /* @__PURE__ */ m(
525
- He,
560
+ return v === "markdown" ? /* @__PURE__ */ g(
561
+ Ge,
526
562
  {
527
- value: D.toString(),
528
- onCancelEdit: n,
529
- onExpand: c,
530
- showExpand: !!c,
531
- ...v
563
+ value: F.toString(),
564
+ onCancelEdit: d,
565
+ onExpand: h,
566
+ showExpand: !!h,
567
+ ...m
532
568
  }
533
- ) : /* @__PURE__ */ m(oe, { children: /* @__PURE__ */ m(
534
- _e,
569
+ ) : /* @__PURE__ */ g(ce, { children: /* @__PURE__ */ g(
570
+ Ke,
535
571
  {
536
- value: D.toString(),
537
- onCancelEdit: n,
538
- type: i,
539
- ...v
572
+ value: F.toString(),
573
+ onCancelEdit: d,
574
+ type: s,
575
+ ...m
540
576
  }
541
577
  ) });
542
578
  }
543
- }, Tt = p.div`
579
+ }, Ct = p.div`
544
580
  color: var(--md-sys-color-outline);
545
581
  white-space: nowrap;
546
582
  overflow: hidden;
547
583
  text-overflow: ellipsis;
548
584
  font-size: 14px;
549
- `, he = ({
585
+ `, ke = ({
550
586
  name: e,
551
587
  data: t,
552
588
  showDetailedTooltip: r = !1,
553
589
  ...o
554
590
  }) => {
555
- const l = t.title ? Y(t.title) : Y(e), a = r ? `${l} (${e}) ${t.description ? "-" : ""} ${t.description || ""}` : t.description || l;
556
- return /* @__PURE__ */ m(
557
- Tt,
591
+ const c = t.title ? ie(t.title) : ie(e), n = r ? `${c} (${e}) ${t.description ? "-" : ""} ${t.description || ""}` : t.description || c;
592
+ return /* @__PURE__ */ g(
593
+ Ct,
558
594
  {
559
- "data-tooltip": r ? a : void 0,
595
+ "data-tooltip": r ? n : void 0,
560
596
  "data-tooltip-delay": 700,
561
597
  ...o,
562
- children: l
598
+ children: c
563
599
  }
564
600
  );
565
- }, fe = p.div`
601
+ }, Ee = p.div`
566
602
  display: grid;
567
603
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1fr) 32px;
568
604
  row-gap: 2px;
@@ -596,7 +632,7 @@ const ee = [], pt = (e) => {
596
632
  margin-top: 6px;
597
633
  }
598
634
  }
599
- `, St = p.div`
635
+ `, At = p.div`
600
636
  height: 32px;
601
637
  overflow: hidden;
602
638
  width: 100%;
@@ -632,7 +668,7 @@ const ee = [], pt = (e) => {
632
668
  &.readonly {
633
669
  pointer-events: none;
634
670
  }
635
- `, Dt = p.div`
671
+ `, Nt = p.div`
636
672
  display: flex;
637
673
  flex-direction: column;
638
674
  gap: var(--base-gap-small);
@@ -642,7 +678,7 @@ const ee = [], pt = (e) => {
642
678
  height: 32px;
643
679
  padding: 2px;
644
680
  }
645
- `, jt = p(fe)`
681
+ `, $t = p(Ee)`
646
682
  &.loading {
647
683
  width: 100%;
648
684
  height: 33px;
@@ -650,110 +686,114 @@ const ee = [], pt = (e) => {
650
686
  border-radius: 4px;
651
687
  margin-bottom: 4px;
652
688
  }
653
- `, Ft = ({
689
+ `, Mt = ({
654
690
  title: e,
655
691
  isLoading: t,
656
692
  form: r,
657
693
  fields: o,
658
- enableEditing: l,
659
- mixedFields: a,
660
- onChange: n,
661
- entities: c = [],
662
- projectName: g,
663
- entityType: s = "task"
694
+ enableEditing: c,
695
+ mixedFields: n,
696
+ onChange: a,
697
+ onMixedChange: d,
698
+ entities: h = [],
699
+ projectName: i,
700
+ entityType: u = "task"
664
701
  }) => {
665
- const [u, i] = L(null), h = W(
666
- () => c.map((y) => y?.id).join("|"),
667
- [c]
702
+ const [f, s] = O(null), v = I(
703
+ () => h.map((b) => b?.id).join("|"),
704
+ [h]
668
705
  );
669
- V(() => {
670
- i(null);
671
- }, [h]);
672
- const v = (y) => {
673
- l && !o.find((x) => x.name === y)?.readonly ? i(y) : console.log("Editing not allowed:", {
674
- enableEditing: l,
675
- fieldReadonly: o.find((x) => x.name === y)?.readonly
706
+ q(() => {
707
+ s(null);
708
+ }, [v]);
709
+ const m = (b) => {
710
+ c && !o.find((k) => k.name === b)?.readonly ? s(b) : console.log("Editing not allowed:", {
711
+ enableEditing: c,
712
+ fieldReadonly: o.find((k) => k.name === b)?.readonly
676
713
  });
677
- }, f = (y, x) => {
678
- i(null), n?.(y, x);
679
- }, w = () => {
680
- i(null);
714
+ }, w = (b, k) => {
715
+ s(null), a?.(b, k);
716
+ }, T = (b, k) => {
717
+ s(null), d?.(b, k);
718
+ }, S = () => {
719
+ s(null);
681
720
  };
682
- return t ? /* @__PURE__ */ m(H, { title: "Attributes", withPadding: !0, children: Array.from({ length: 10 }).map((y, x) => /* @__PURE__ */ z(jt, { children: [
683
- /* @__PURE__ */ m("div", { className: "loading" }),
684
- /* @__PURE__ */ m("div", { className: "loading" })
685
- ] }, x)) }) : /* @__PURE__ */ m(
686
- H,
721
+ return t ? /* @__PURE__ */ g(J, { title: "Attributes", withPadding: !0, children: Array.from({ length: 10 }).map((b, k) => /* @__PURE__ */ R($t, { children: [
722
+ /* @__PURE__ */ g("div", { className: "loading" }),
723
+ /* @__PURE__ */ g("div", { className: "loading" })
724
+ ] }, k)) }) : /* @__PURE__ */ g(
725
+ J,
687
726
  {
688
727
  title: "Attributes",
689
728
  autoHeight: !0,
690
729
  showHeader: !0,
691
730
  withPadding: !0,
692
731
  pt: { content: { style: { minHeight: "unset" } } },
693
- children: o.filter((y) => !y.hidden).map((y) => {
694
- const x = r[y.name], F = u === y.name, T = y.readonly || !l, A = a?.includes(y.name) || !1;
695
- return /* @__PURE__ */ z(
696
- fe,
732
+ children: o.filter((b) => !b.hidden).map((b) => {
733
+ const k = r[b.name], C = f === b.name, E = b.readonly || !c, D = n?.includes(b.name) || !1;
734
+ return /* @__PURE__ */ R(
735
+ Ee,
697
736
  {
698
- className: U("field-row", { "multi-line": y.data.widget === "markdown" }),
737
+ className: U("field-row", { "multi-line": b.data.widget === "markdown" }),
699
738
  children: [
700
- /* @__PURE__ */ m(
701
- he,
739
+ /* @__PURE__ */ g(
740
+ ke,
702
741
  {
703
- name: y.name,
704
- data: y.data,
742
+ name: b.name,
743
+ data: b.data,
705
744
  showDetailedTooltip: !0,
706
745
  className: "field-label"
707
746
  }
708
747
  ),
709
- /* @__PURE__ */ m(
710
- St,
748
+ /* @__PURE__ */ g(
749
+ At,
711
750
  {
712
751
  className: U("field-value", {
713
- editing: F,
714
- readonly: T
752
+ editing: C,
753
+ readonly: E
715
754
  }),
716
- onClick: (k) => {
717
- k.target.closest("a") || (k.preventDefault(), !F && !T && y.data.type !== "boolean" && v(y.name));
755
+ onClick: (l) => {
756
+ l.target.closest("a") || (l.preventDefault(), !C && !E && b.data.type !== "boolean" && m(b.name));
718
757
  },
719
- children: /* @__PURE__ */ m(
720
- Et,
758
+ children: /* @__PURE__ */ g(
759
+ Ft,
721
760
  {
722
- field: y,
723
- value: x,
724
- isEditing: F,
725
- isReadOnly: T,
726
- isMixed: A,
727
- onChange: f,
728
- onCancelEdit: w,
761
+ field: b,
762
+ value: k,
763
+ isEditing: C,
764
+ isReadOnly: E,
765
+ isMixed: D,
766
+ onChange: w,
767
+ onMixedChange: d && T,
768
+ onCancelEdit: S,
729
769
  onExpand: () => {
730
770
  },
731
- entities: c,
732
- projectName: g,
733
- entityType: s
771
+ entities: h,
772
+ projectName: i,
773
+ entityType: u
734
774
  }
735
775
  )
736
776
  }
737
777
  ),
738
- /* @__PURE__ */ m(Dt, { className: "field-tools", children: /* @__PURE__ */ m(
739
- O,
778
+ /* @__PURE__ */ g(Nt, { className: "field-tools", children: /* @__PURE__ */ g(
779
+ _,
740
780
  {
741
781
  className: "tool",
742
782
  variant: "text",
743
783
  icon: "content_copy",
744
- onClick: (k) => {
745
- k.preventDefault(), k.stopPropagation(), K((x ?? "").toString(), !0);
784
+ onClick: (l) => {
785
+ l.preventDefault(), l.stopPropagation(), oe((k ?? "").toString(), !0);
746
786
  }
747
787
  }
748
788
  ) })
749
789
  ]
750
790
  },
751
- y.name
791
+ b.name
752
792
  );
753
793
  })
754
794
  }
755
795
  );
756
- }, re = p.div`
796
+ }, de = p.div`
757
797
  display: grid;
758
798
  grid-template-columns: minmax(200px, 1fr) 1fr 32px;
759
799
  row-gap: 2px;
@@ -776,7 +816,7 @@ const ee = [], pt = (e) => {
776
816
  &:hover .copy-icon {
777
817
  opacity: 1;
778
818
  }
779
- `, Ct = p.div`
819
+ `, zt = p.div`
780
820
  text-align: left;
781
821
  color: var(--md-sys-color-on-surface);
782
822
  white-space: nowrap;
@@ -785,7 +825,7 @@ const ee = [], pt = (e) => {
785
825
  justify-self: end;
786
826
  font-size: 14px;
787
827
  width: 100%;
788
- `, ne = p.div`
828
+ `, pe = p.div`
789
829
  height: 20px;
790
830
  background: var(--md-sys-color-surface-container-low);
791
831
  border-radius: 4px;
@@ -802,55 +842,55 @@ const ee = [], pt = (e) => {
802
842
  opacity: 0.5;
803
843
  }
804
844
  }
805
- `, At = ({
845
+ `, Rt = ({
806
846
  fields: e,
807
847
  form: t,
808
848
  mixedFields: r = [],
809
849
  isLoading: o
810
850
  }) => {
811
- const l = (a, n) => {
812
- if (a == null)
851
+ const c = (n, a) => {
852
+ if (n == null)
813
853
  return "-";
814
- if (n === "createdAt" || n === "updatedAt")
854
+ if (a === "createdAt" || a === "updatedAt")
815
855
  try {
816
- return nt(new Date(a), "PPpp");
856
+ return lt(new Date(n), "PPpp");
817
857
  } catch {
818
- return a.toString();
858
+ return n.toString();
819
859
  }
820
- return a.toString();
860
+ return n.toString();
821
861
  };
822
- return o ? /* @__PURE__ */ m(H, { title: "Details", withPadding: !0, children: Array.from({ length: 6 }).map((a, n) => /* @__PURE__ */ z(re, { children: [
823
- /* @__PURE__ */ m(ne, { style: { width: "80px" } }),
824
- /* @__PURE__ */ m(ne, { style: { width: "120px", justifySelf: "end" } }),
825
- /* @__PURE__ */ m("div", { style: { width: "24px" } })
826
- ] }, n)) }) : /* @__PURE__ */ m(H, { title: "Details", autoHeight: !0, showHeader: !0, withPadding: !0, children: e.filter((a) => !a.hidden).map((a) => {
827
- const n = t[a.name], c = r.includes(a.name), g = c ? "Multiple values" : l(n, a.name);
828
- return /* @__PURE__ */ z(re, { children: [
829
- /* @__PURE__ */ m(he, { name: a.name, data: a.data, showDetailedTooltip: !0 }),
830
- /* @__PURE__ */ m(
831
- Ct,
862
+ return o ? /* @__PURE__ */ g(J, { title: "Details", withPadding: !0, children: Array.from({ length: 6 }).map((n, a) => /* @__PURE__ */ R(de, { children: [
863
+ /* @__PURE__ */ g(pe, { style: { width: "80px" } }),
864
+ /* @__PURE__ */ g(pe, { style: { width: "120px", justifySelf: "end" } }),
865
+ /* @__PURE__ */ g("div", { style: { width: "24px" } })
866
+ ] }, a)) }) : /* @__PURE__ */ g(J, { title: "Details", autoHeight: !0, showHeader: !0, withPadding: !0, children: e.filter((n) => !n.hidden).map((n) => {
867
+ const a = t[n.name], d = r.includes(n.name), h = d ? "Multiple values" : c(a, n.name);
868
+ return /* @__PURE__ */ R(de, { children: [
869
+ /* @__PURE__ */ g(ke, { name: n.name, data: n.data, showDetailedTooltip: !0 }),
870
+ /* @__PURE__ */ g(
871
+ zt,
832
872
  {
833
873
  style: {
834
- color: c ? "var(--md-sys-color-on-surface-variant)" : "var(--md-sys-color-on-surface)",
835
- fontStyle: c ? "italic" : "normal"
874
+ color: d ? "var(--md-sys-color-on-surface-variant)" : "var(--md-sys-color-on-surface)",
875
+ fontStyle: d ? "italic" : "normal"
836
876
  },
837
- children: g
877
+ children: h
838
878
  }
839
879
  ),
840
- /* @__PURE__ */ m(
841
- O,
880
+ /* @__PURE__ */ g(
881
+ _,
842
882
  {
843
883
  className: "copy-icon",
844
884
  variant: "text",
845
885
  icon: "content_copy",
846
- onClick: (s) => {
847
- s.stopPropagation(), K((n ?? "").toString(), !0);
886
+ onClick: (i) => {
887
+ i.stopPropagation(), oe((a ?? "").toString(), !0);
848
888
  }
849
889
  }
850
890
  )
851
- ] }, a.name);
891
+ ] }, n.name);
852
892
  }) });
853
- }, Nt = p.div`
893
+ }, Ut = p.div`
854
894
  display: flex;
855
895
  flex-direction: column;
856
896
  height: 100%;
@@ -859,94 +899,106 @@ const ee = [], pt = (e) => {
859
899
  padding-right: 8px;
860
900
  padding-left: 8px;
861
901
  margin-top: 16px;
862
- `, _o = ({ entities: e = [], isLoading: t }) => {
863
- const { formData: r, mixedFields: o, updateFormData: l, clearMixedField: a } = ft(
902
+ `, Jo = ({ entities: e = [], isLoading: t }) => {
903
+ const { formData: r, mixedFields: o, updateFormData: c, clearMixedField: n } = xt(
864
904
  e,
865
905
  t
866
- ), { attributes: n } = tt(), {
867
- folderTypes: c = [],
868
- taskTypes: g = [],
869
- statuses: s = [],
906
+ ), { attributes: a } = nt(), {
907
+ folderTypes: d = [],
908
+ taskTypes: h = [],
909
+ statuses: i = [],
870
910
  tags: u = [],
871
- productTypes: i
872
- } = ot(), { openSlideOut: h } = J(), [, v] = it(), f = (e || []).filter((R) => R.entityType === "folder"), { data: w } = Ze(
911
+ productTypes: f
912
+ } = it(), { openSlideOut: s } = re(), [, v] = dt(), m = (e || []).filter((x) => x.entityType === "folder"), { data: w } = tt(
873
913
  {
874
- entityIds: f.map((R) => R.id),
914
+ entityIds: m.map((x) => x.id),
875
915
  projectName: r?.projectName || "",
876
916
  referenceTypes: ["origin", "mention", "relation"],
877
917
  activityTypes: ["version.publish"]
878
918
  },
879
919
  {
880
- skip: !r?.projectName || f.length === 0
920
+ skip: !r?.projectName || m.length === 0
881
921
  }
882
- ), y = !!w?.pages?.[0]?.activities?.length, x = r?.entityType || "task", { enableEditing: F, attribAccess: T, updateEntity: A } = bt({
922
+ ), T = !!w?.pages?.[0]?.activities?.length, S = r?.entityType || "task", { enableEditing: b, attribAccess: k, updateEntity: C } = Et({
883
923
  entities: e,
884
- entityType: x
885
- }), { editableFields: k, readOnlyFieldsData: S } = vt({
886
- attributes: n,
887
- folderTypes: c,
888
- taskTypes: g,
889
- statuses: s,
924
+ entityType: S
925
+ }), { editableFields: E, readOnlyFieldsData: D } = wt({
926
+ attributes: a,
927
+ folderTypes: d,
928
+ taskTypes: h,
929
+ statuses: i,
890
930
  tags: u,
891
931
  entityType: r?.entityType,
892
- folderHasVersions: y,
893
- attribAccess: T
894
- }), { writableAttributes: d } = T, D = !d || d.includes("description"), N = (R, M) => {
895
- R === "tags" && (Array.isArray(M) || (M == null || M === "" ? M = [] : M = [String(M)])), R.startsWith("attrib.") && (M = {
896
- [R.replace("attrib.", "")]: M
897
- }, R = "attrib"), l(R, M), A(R, M);
898
- }, C = r?.projectName || e[0]?.projectName, $ = e[0]?.id, b = W(
899
- () => C && $ ? { projectName: C, entityType: x, entityId: $, productTypes: i, taskTypes: g } : void 0,
900
- [C, x, $, i, g]
901
- ), E = ({ type: R, id: M }) => {
902
- R === "user" || R === "team" || !C || h({ entityId: M, entityType: R, projectName: C });
903
- }, j = ({ type: R, id: M, label: ye }, be) => {
904
- const { x: xe, y: we, width: ke } = be.getBoundingClientRect();
905
- v({ id: M, name: M, type: R, label: ye, pos: { left: xe + ke / 2, top: we } });
906
- }, ve = (R) => {
907
- l("description", R), a("description"), A("attrib", { description: R });
932
+ folderHasVersions: T,
933
+ attribAccess: k
934
+ }), { writableAttributes: l } = k, N = !l || l.includes("description"), $ = (x, M) => {
935
+ x === "tags" && (Array.isArray(M) || (M == null || M === "" ? M = [] : M = [String(M)])), x.startsWith("attrib.") && (M = {
936
+ [x.replace("attrib.", "")]: M
937
+ }, x = "attrib"), c(x, M), C(x, M);
938
+ }, z = (x, M) => {
939
+ const B = x.startsWith("attrib.") ? x.replace("attrib.", "") : void 0, Z = (W) => {
940
+ const H = B ? W.attrib?.[B] : W.tags;
941
+ return Array.isArray(H) ? H.map(String) : [];
942
+ }, G = new Map(
943
+ e.map((W) => [W.id, je(Z(W), M)])
944
+ );
945
+ c(x, [...new Set([...G.values()].flat())]), C(B ? "attrib" : x, (W) => {
946
+ const H = G.get(W) || [];
947
+ return B ? { [B]: H } : H;
948
+ });
949
+ }, F = r?.projectName || e[0]?.projectName, y = e[0]?.id, j = I(
950
+ () => F && y ? { projectName: F, entityType: S, entityId: y, productTypes: f, taskTypes: h } : void 0,
951
+ [F, S, y, f, h]
952
+ ), A = ({ type: x, id: M }) => {
953
+ x === "user" || x === "team" || !F || s({ entityId: M, entityType: x, projectName: F });
954
+ }, L = ({ type: x, id: M, label: B }, Z) => {
955
+ const { x: G, y: W, width: H } = Z.getBoundingClientRect();
956
+ v({ id: M, name: M, type: x, label: B, pos: { left: G + H / 2, top: W } });
957
+ }, P = (x) => {
958
+ c("description", x), n("description"), C("attrib", { description: x });
908
959
  };
909
- return /* @__PURE__ */ z(Nt, { children: [
910
- /* @__PURE__ */ m(
911
- Ge,
960
+ return /* @__PURE__ */ R(Ut, { children: [
961
+ /* @__PURE__ */ g(
962
+ Xe,
912
963
  {
913
964
  description: r?.description || "",
914
965
  isMixed: o.includes("description"),
915
- enableEditing: D,
916
- onChange: ve,
966
+ enableEditing: N,
967
+ onChange: P,
917
968
  isLoading: t,
918
- mentionsContext: b,
919
- onMentionClick: E,
920
- onMentionHover: j
969
+ mentionsContext: j,
970
+ onMentionClick: A,
971
+ onMentionHover: L
921
972
  }
922
973
  ),
923
- /* @__PURE__ */ m(st, {}),
924
- /* @__PURE__ */ m(
925
- Ft,
974
+ /* @__PURE__ */ g(pt, {}),
975
+ /* @__PURE__ */ g(
976
+ Mt,
926
977
  {
927
- fields: k,
978
+ fields: E,
928
979
  form: r || {},
929
980
  mixedFields: o,
930
981
  isLoading: t,
931
- enableEditing: F,
932
- onChange: N,
982
+ enableEditing: b,
983
+ onChange: $,
984
+ onMixedChange: z,
933
985
  entities: e,
934
- entityType: x
986
+ entityType: S
935
987
  }
936
988
  ),
937
- /* @__PURE__ */ m(
938
- At,
989
+ /* @__PURE__ */ g(
990
+ Rt,
939
991
  {
940
- fields: S,
992
+ fields: D,
941
993
  form: r || {},
942
994
  mixedFields: o,
943
995
  isLoading: t
944
996
  }
945
997
  )
946
998
  ] });
947
- }, Qo = p.div`
999
+ }, Zo = p.div`
948
1000
  position: relative;
949
- `, qo = p.div`
1001
+ `, Xo = p.div`
950
1002
  position: relative;
951
1003
  padding: 8px;
952
1004
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
@@ -978,13 +1030,13 @@ const ee = [], pt = (e) => {
978
1030
  /* align center */
979
1031
  align-items: center;
980
1032
  }
981
- `, Go = p(O)`
1033
+ `, Yo = p(_)`
982
1034
  position: absolute;
983
1035
  right: 4px;
984
1036
  top: 4px;
985
1037
  width: fit-content;
986
1038
  z-index: 50;
987
- `, Ko = p.header`
1039
+ `, er = p.header`
988
1040
  display: flex;
989
1041
  align-items: center;
990
1042
  gap: var(--base-gap-large);
@@ -999,7 +1051,7 @@ const ee = [], pt = (e) => {
999
1051
  display: none;
1000
1052
  }
1001
1053
  }
1002
- `, Jo = p.div`
1054
+ `, tr = p.div`
1003
1055
  display: flex;
1004
1056
  align-items: center;
1005
1057
  gap: var(--base-gap-small);
@@ -1007,7 +1059,7 @@ const ee = [], pt = (e) => {
1007
1059
  h2 {
1008
1060
  min-width: fit-content;
1009
1061
  }
1010
- `, Zo = p.div`
1062
+ `, or = p.div`
1011
1063
  position: relative;
1012
1064
  height: 100%;
1013
1065
 
@@ -1022,7 +1074,7 @@ const ee = [], pt = (e) => {
1022
1074
  flex-direction: column;
1023
1075
  gap: var(--base-gap-small);
1024
1076
  }
1025
- `, Xo = p.div`
1077
+ `, rr = p.div`
1026
1078
  display: flex;
1027
1079
  flex-direction: column;
1028
1080
  height: 100%;
@@ -1060,7 +1112,7 @@ const ee = [], pt = (e) => {
1060
1112
  align-items: center;
1061
1113
  gap: var(--base-gap-medium);
1062
1114
  }
1063
- `, Yo = p.div`
1115
+ `, ar = p.div`
1064
1116
  display: flex;
1065
1117
  justify-content: space-between;
1066
1118
  align-items: flex-start;
@@ -1069,10 +1121,10 @@ const ee = [], pt = (e) => {
1069
1121
  label {
1070
1122
  color: var(--md-sys-color-outline);
1071
1123
  }
1072
- `, er = p.div`
1124
+ `, nr = p.div`
1073
1125
  display: flex;
1074
1126
  flex-direction: column;
1075
- `, tr = p(Me)`
1127
+ `, ir = p(De)`
1076
1128
  width: fit-content;
1077
1129
  .status-field.value {
1078
1130
  position: relative;
@@ -1083,11 +1135,11 @@ const ee = [], pt = (e) => {
1083
1135
  margin-bottom: 2px;
1084
1136
  color: ${(e) => e.$textColor};
1085
1137
  }
1086
- `, or = p(Ue)`
1138
+ `, sr = p(Fe)`
1087
1139
  width: fit-content;
1088
1140
  justify-self: end;
1089
1141
  max-width: 100%;
1090
- `, rr = p(Le)`
1142
+ `, lr = p(Ce)`
1091
1143
  height: 24px;
1092
1144
  .template-value {
1093
1145
  padding: 0 2px;
@@ -1101,7 +1153,7 @@ const ee = [], pt = (e) => {
1101
1153
  display: none;
1102
1154
  }
1103
1155
  }
1104
- `, nr = p.div`
1156
+ `, cr = p.div`
1105
1157
  display: flex;
1106
1158
  align-items: center;
1107
1159
  gap: 4px;
@@ -1121,7 +1173,7 @@ const ee = [], pt = (e) => {
1121
1173
  border-radius: 3px;
1122
1174
  padding: 0 4px;
1123
1175
  }
1124
- `, ar = p(Pe)`
1176
+ `, dr = p(Ae)`
1125
1177
  width: max-content;
1126
1178
  justify-self: end;
1127
1179
  /* remove text and dropdown icon */
@@ -1145,12 +1197,12 @@ const ee = [], pt = (e) => {
1145
1197
  background-color: var(--md-sys-color-surface-container-low-hover);
1146
1198
  }
1147
1199
  }
1148
- `, ir = p.footer`
1200
+ `, pr = p.footer`
1149
1201
  display: flex;
1150
1202
  align-items: center;
1151
1203
  gap: var(--base-gap-small);
1152
1204
  justify-content: space-between;
1153
- `, sr = p.div`
1205
+ `, ur = p.div`
1154
1206
  height: 100%;
1155
1207
 
1156
1208
  > input[type='file'] {
@@ -1161,7 +1213,7 @@ const ee = [], pt = (e) => {
1161
1213
  input[type='file'] {
1162
1214
  display: none;
1163
1215
  }
1164
- `, lr = p.div`
1216
+ `, mr = p.div`
1165
1217
  z-index: 100;
1166
1218
  position: absolute;
1167
1219
  inset: 0;
@@ -1173,7 +1225,7 @@ const ee = [], pt = (e) => {
1173
1225
  display: flex;
1174
1226
  align-items: center;
1175
1227
  justify-content: center;
1176
- `, cr = p.div`
1228
+ `, gr = p.div`
1177
1229
  flex: 1;
1178
1230
  height: 100%;
1179
1231
  border-radius: var(--border-radius-l);
@@ -1202,11 +1254,11 @@ const ee = [], pt = (e) => {
1202
1254
  /* show children */
1203
1255
  opacity: 1;
1204
1256
  }
1205
- `, dr = p(O)`
1257
+ `, hr = p(_)`
1206
1258
  position: absolute;
1207
1259
  top: 4px;
1208
1260
  right: 4px;
1209
- `, pr = p.div`
1261
+ `, fr = p.div`
1210
1262
  display: flex;
1211
1263
  flex-direction: column;
1212
1264
  align-items: center;
@@ -1219,7 +1271,7 @@ const ee = [], pt = (e) => {
1219
1271
  top: 12px;
1220
1272
  position: relative;
1221
1273
  }
1222
- `, ur = p.div`
1274
+ `, vr = p.div`
1223
1275
  height: 8px;
1224
1276
  position: absolute;
1225
1277
  border-radius: 4px;
@@ -1228,14 +1280,14 @@ const ee = [], pt = (e) => {
1228
1280
  background-color: var(--md-sys-color-primary);
1229
1281
 
1230
1282
  transition: right 0.2s;
1231
- `, $t = pe`
1283
+ `, Lt = ye`
1232
1284
  from {
1233
1285
  transform: rotate(0deg);
1234
1286
  }
1235
1287
  to {
1236
1288
  transform: rotate(360deg);
1237
1289
  }
1238
- `, Rt = p.div`
1290
+ `, Pt = p.div`
1239
1291
  position: relative;
1240
1292
  display: flex;
1241
1293
  justify-content: center;
@@ -1244,10 +1296,10 @@ const ee = [], pt = (e) => {
1244
1296
  overflow: hidden;
1245
1297
 
1246
1298
  background-color: var(--md-sys-color-surface-container-low);
1247
- `, zt = p(P)`
1248
- animation: ${$t} 1s linear infinite;
1299
+ `, Wt = p(V)`
1300
+ animation: ${Lt} 1s linear infinite;
1249
1301
  opacity: 0.6;
1250
- `, Mt = p.img`
1302
+ `, Ot = p.img`
1251
1303
  position: absolute;
1252
1304
  inset: 0;
1253
1305
  object-fit: cover;
@@ -1259,56 +1311,56 @@ const ee = [], pt = (e) => {
1259
1311
  &.hidden {
1260
1312
  opacity: 0;
1261
1313
  }
1262
- `, Ut = ({ mimetype: e = "", src: t, ...r }) => {
1263
- const [o, l] = L(!1), [a, n] = L(!1), c = X(null), g = X(0);
1264
- return V(() => {
1265
- const s = g.current + 1;
1266
- g.current = s, n(!1), l(!1);
1267
- const u = c.current;
1268
- let i = !1, h = 0, v = 0, f = 0;
1269
- const w = (T) => {
1270
- i || s !== g.current || (i = !0, cancelAnimationFrame(h), window.clearInterval(v), window.clearTimeout(f), T());
1271
- }, y = () => {
1272
- !u || s !== g.current || u.complete && u.naturalWidth > 0 && w(() => {
1273
- n(!0), l(!1);
1314
+ `, It = ({ mimetype: e = "", src: t, ...r }) => {
1315
+ const [o, c] = O(!1), [n, a] = O(!1), d = ne(null), h = ne(0);
1316
+ return q(() => {
1317
+ const i = h.current + 1;
1318
+ h.current = i, a(!1), c(!1);
1319
+ const u = d.current;
1320
+ let f = !1, s = 0, v = 0, m = 0;
1321
+ const w = (k) => {
1322
+ f || i !== h.current || (f = !0, cancelAnimationFrame(s), window.clearInterval(v), window.clearTimeout(m), k());
1323
+ }, T = () => {
1324
+ !u || i !== h.current || u.complete && u.naturalWidth > 0 && w(() => {
1325
+ a(!0), c(!1);
1274
1326
  });
1275
- }, x = () => w(() => {
1276
- n(!0), l(!1);
1277
- }), F = () => w(() => {
1278
- n(!0), l(!0);
1327
+ }, S = () => w(() => {
1328
+ a(!0), c(!1);
1329
+ }), b = () => w(() => {
1330
+ a(!0), c(!0);
1279
1331
  });
1280
- return u && (u.addEventListener("load", x), u.addEventListener("error", F), typeof u.decode == "function" && u.decode().then(
1332
+ return u && (u.addEventListener("load", S), u.addEventListener("error", b), typeof u.decode == "function" && u.decode().then(
1281
1333
  () => w(() => {
1282
- n(!0), l(!1);
1334
+ a(!0), c(!1);
1283
1335
  })
1284
1336
  ).catch(() => {
1285
- y();
1286
- })), h = requestAnimationFrame(y), v = window.setInterval(y, 250), f = window.setTimeout(() => {
1337
+ T();
1338
+ })), s = requestAnimationFrame(T), v = window.setInterval(T, 250), m = window.setTimeout(() => {
1287
1339
  w(() => {
1288
- u && u.naturalWidth > 0 ? (n(!0), l(!1)) : n(!0);
1340
+ u && u.naturalWidth > 0 ? (a(!0), c(!1)) : a(!0);
1289
1341
  });
1290
1342
  }, 1e4), () => {
1291
- cancelAnimationFrame(h), window.clearInterval(v), window.clearTimeout(f), u && (u.removeEventListener("load", x), u.removeEventListener("error", F));
1343
+ cancelAnimationFrame(s), window.clearInterval(v), window.clearTimeout(m), u && (u.removeEventListener("load", S), u.removeEventListener("error", b));
1292
1344
  };
1293
- }, [t]), /* @__PURE__ */ z(Rt, { ...r, className: U("file-thumbnail", r.className), children: [
1294
- a ? /* @__PURE__ */ m(P, { icon: We(e) }) : /* @__PURE__ */ m(zt, { icon: "progress_activity" }),
1295
- /* @__PURE__ */ m(
1296
- Mt,
1345
+ }, [t]), /* @__PURE__ */ R(Pt, { ...r, className: U("file-thumbnail", r.className), children: [
1346
+ n ? /* @__PURE__ */ g(V, { icon: Ne(e) }) : /* @__PURE__ */ g(Wt, { icon: "progress_activity" }),
1347
+ /* @__PURE__ */ g(
1348
+ Ot,
1297
1349
  {
1298
- ref: c,
1350
+ ref: d,
1299
1351
  src: t,
1300
1352
  ...r,
1301
- onError: (s) => {
1302
- s.currentTarget === c.current && (n(!0), l(!0));
1353
+ onError: (i) => {
1354
+ i.currentTarget === d.current && (a(!0), c(!0));
1303
1355
  },
1304
- onLoad: (s) => {
1305
- s.currentTarget === c.current && (n(!0), l(!1));
1356
+ onLoad: (i) => {
1357
+ i.currentTarget === d.current && (a(!0), c(!1));
1306
1358
  },
1307
- className: U({ hidden: !a || o })
1359
+ className: U({ hidden: !n || o })
1308
1360
  }
1309
1361
  )
1310
1362
  ] });
1311
- }, Lt = p.div`
1363
+ }, Vt = p.div`
1312
1364
  display: flex;
1313
1365
  align-items: center;
1314
1366
  overflow: hidden;
@@ -1375,7 +1427,7 @@ const ee = [], pt = (e) => {
1375
1427
  background-color: var(--md-sys-color-primary-container);
1376
1428
  }
1377
1429
  }
1378
- `, Pt = p.div`
1430
+ `, Bt = p.div`
1379
1431
  display: flex;
1380
1432
  flex-direction: column;
1381
1433
  flex: 1;
@@ -1400,15 +1452,15 @@ const ee = [], pt = (e) => {
1400
1452
  .name {
1401
1453
  color: var(--md-sys-color-outline);
1402
1454
  }
1403
- `, Wt = p.div`
1455
+ `, Ht = p.div`
1404
1456
  display: flex;
1405
1457
  align-items: center;
1406
1458
  gap: var(--base-gap-small);
1407
1459
 
1408
1460
  h4 {
1409
- ${Oe.titleSmall}
1461
+ ${$e.titleSmall}
1410
1462
  }
1411
- `, Ot = p(O)`
1463
+ `, _t = p(_)`
1412
1464
  /* hidden by default and show on card hover */
1413
1465
  display: none;
1414
1466
  .icon {
@@ -1420,78 +1472,78 @@ const ee = [], pt = (e) => {
1420
1472
  }
1421
1473
 
1422
1474
  margin: -2px;
1423
- `, It = p(Ut)`
1475
+ `, Qt = p(It)`
1424
1476
  width: 71px;
1425
1477
  height: 40px;
1426
1478
 
1427
1479
  border-radius: var(--border-radius-m);
1428
1480
 
1429
1481
  object-fit: cover;
1430
- `, Vt = p(P)`
1482
+ `, qt = p(V)`
1431
1483
  font-size: 25px;
1432
1484
 
1433
1485
  cursor: grab;
1434
1486
 
1435
1487
  /* default hidden */
1436
1488
  opacity: 0;
1437
- `, mr = q(
1489
+ `, yr = ee(
1438
1490
  ({
1439
1491
  availability: e,
1440
1492
  projectName: t,
1441
1493
  fileId: r,
1442
1494
  filename: o,
1443
- label: l,
1444
- processing: a,
1445
- mimetype: n,
1446
- isDragOverlay: c,
1447
- isDropPlaceholder: g,
1448
- isSelected: s,
1495
+ label: c,
1496
+ processing: n,
1497
+ mimetype: a,
1498
+ isDragOverlay: d,
1499
+ isDropPlaceholder: h,
1500
+ isSelected: i,
1449
1501
  isDragging: u,
1450
- dragProps: i = {},
1451
- sortingDisabled: h,
1502
+ dragProps: f = {},
1503
+ sortingDisabled: s,
1452
1504
  onEdit: v,
1453
- ...f
1505
+ ...m
1454
1506
  }, w) => {
1455
- const y = (i || c) && !h, x = e === "conversionRecommended", F = x && !!a;
1456
- let T = o;
1457
- x && (T = "Unoptimized - conversion recommended"), F && (T = "Unoptimized - queued for conversion");
1458
- let A = l;
1459
- return x && (A = o), /* @__PURE__ */ z(
1460
- Lt,
1507
+ const T = (f || d) && !s, S = e === "conversionRecommended", b = S && !!n;
1508
+ let k = o;
1509
+ S && (k = "Unoptimized - conversion recommended"), b && (k = "Unoptimized - queued for conversion");
1510
+ let C = c;
1511
+ return S && (C = o), /* @__PURE__ */ R(
1512
+ Vt,
1461
1513
  {
1462
1514
  id: r,
1463
1515
  ref: w,
1464
1516
  className: U({
1465
- draggable: y,
1466
- "drop-placeholder": g,
1467
- "drag-overlay": c,
1517
+ draggable: T,
1518
+ "drop-placeholder": h,
1519
+ "drag-overlay": d,
1468
1520
  dragging: u,
1469
1521
  // is anything dragging
1470
- selected: s,
1522
+ selected: i,
1471
1523
  editable: !!v
1472
1524
  }),
1473
- ...f,
1525
+ ...m,
1474
1526
  children: [
1475
- /* @__PURE__ */ m(
1476
- It,
1527
+ /* @__PURE__ */ g(
1528
+ Qt,
1477
1529
  {
1478
1530
  src: `/api/projects/${t}/files/${r}/thumbnail`,
1479
- mimetype: n
1531
+ mimetype: a
1480
1532
  }
1481
1533
  ),
1482
- /* @__PURE__ */ z(Pt, { children: [
1483
- /* @__PURE__ */ z(Wt, { children: [
1484
- /* @__PURE__ */ m("h4", { children: A }),
1485
- !!v && /* @__PURE__ */ m(Ot, { icon: "edit", variant: "text", className: "edit", onClick: v })
1534
+ /* @__PURE__ */ R(Bt, { children: [
1535
+ /* @__PURE__ */ R(Ht, { children: [
1536
+ /* @__PURE__ */ g("h4", { children: C }),
1537
+ !!v && /* @__PURE__ */ g(_t, { icon: "edit", variant: "text", className: "edit", onClick: v })
1486
1538
  ] }),
1487
- /* @__PURE__ */ m("span", { className: "name", children: T })
1539
+ /* @__PURE__ */ g("span", { className: "name", children: k })
1488
1540
  ] }),
1489
- y && /* @__PURE__ */ m(Vt, { className: "handle", ...i, icon: "drag_indicator" })
1541
+ T && /* @__PURE__ */ g(qt, { className: "handle", ...f, icon: "drag_indicator" })
1490
1542
  ]
1491
1543
  }
1492
1544
  );
1493
1545
  }
1494
- ), Bt = pe`
1546
+ ), Gt = ye`
1495
1547
  from {
1496
1548
  transform: rotate(360deg);
1497
1549
  }
@@ -1500,7 +1552,7 @@ const ee = [], pt = (e) => {
1500
1552
  transform: rotate(0deg);
1501
1553
  }
1502
1554
 
1503
- `, Ht = p.div`
1555
+ `, Kt = p.div`
1504
1556
  position: relative;
1505
1557
  width: 100%;
1506
1558
  min-height: 50px;
@@ -1566,13 +1618,13 @@ const ee = [], pt = (e) => {
1566
1618
  & > * {
1567
1619
  z-index: 10;
1568
1620
  }
1569
- `, _t = p.div`
1621
+ `, Jt = p.div`
1570
1622
  position: absolute;
1571
1623
  inset: 0;
1572
1624
  background-color: var(--md-sys-color-primary-container);
1573
1625
  z-index: 0;
1574
1626
  transition: right 0.2s;
1575
- `, Qt = p.div`
1627
+ `, Zt = p.div`
1576
1628
  position: relative;
1577
1629
  width: 71px;
1578
1630
  height: 40px;
@@ -1591,7 +1643,7 @@ const ee = [], pt = (e) => {
1591
1643
 
1592
1644
  &.spinning {
1593
1645
  /* spin animation */
1594
- animation: ${Bt} 1s infinite linear;
1646
+ animation: ${Gt} 1s infinite linear;
1595
1647
  }
1596
1648
  }
1597
1649
 
@@ -1603,63 +1655,63 @@ const ee = [], pt = (e) => {
1603
1655
  object-fit: cover;
1604
1656
  opacity: 0.5;
1605
1657
  }
1606
- `, ae = ({
1658
+ `, ue = ({
1607
1659
  name: e,
1608
1660
  progress: t,
1609
1661
  size: r,
1610
1662
  type: o,
1611
- fileId: l,
1612
- src: a,
1613
- error: n,
1614
- tooltip: c,
1615
- onRemove: g,
1616
- ...s
1663
+ fileId: c,
1664
+ src: n,
1665
+ error: a,
1666
+ tooltip: d,
1667
+ onRemove: h,
1668
+ ...i
1617
1669
  }) => {
1618
- let u = "", i = !1, h = "";
1670
+ let u = "", f = !1, s = "";
1619
1671
  switch (o) {
1620
1672
  case "processing":
1621
- u = "Transcoding", i = !0, h = "settings";
1673
+ u = "Transcoding", f = !0, s = "settings";
1622
1674
  break;
1623
1675
  case "unsupported":
1624
- u = "Unsupported - conversion required", h = "visibility_off";
1676
+ u = "Unsupported - conversion required", s = "visibility_off";
1625
1677
  break;
1626
1678
  case "upload":
1627
- u = "Uploading", i = !0, h = "sync";
1679
+ u = "Uploading", f = !0, s = "sync";
1628
1680
  break;
1629
1681
  case "queued":
1630
- u = "Queued - waiting to be transcoded", h = "hourglass";
1682
+ u = "Queued - waiting to be transcoded", s = "hourglass";
1631
1683
  break;
1632
1684
  case "waiting":
1633
- u = "Waiting for upload", h = "schedule";
1685
+ u = "Waiting for upload", s = "schedule";
1634
1686
  break;
1635
1687
  case "importing":
1636
- u = "Importing", h = "upload_file";
1688
+ u = "Importing", s = "upload_file";
1637
1689
  break;
1638
1690
  case "validating":
1639
- u = "Validating", h = "checklist";
1691
+ u = "Validating", s = "checklist";
1640
1692
  break;
1641
1693
  }
1642
- n && (i = !1, h = "error");
1694
+ a && (f = !1, s = "error");
1643
1695
  const v = t !== void 0 ? `- ${t}%` : "";
1644
- return /* @__PURE__ */ z(
1645
- Ht,
1696
+ return /* @__PURE__ */ R(
1697
+ Kt,
1646
1698
  {
1647
- className: U({ finished: t === 100, error: !!n, [o]: !0 }),
1648
- id: l,
1649
- ...s,
1699
+ className: U({ finished: t === 100, error: !!a, [o]: !0 }),
1700
+ id: c,
1701
+ ...i,
1650
1702
  children: [
1651
- /* @__PURE__ */ z(Qt, { children: [
1652
- a && /* @__PURE__ */ m("img", { src: a }),
1653
- h && /* @__PURE__ */ m(P, { icon: h, className: U({ spinning: i }) })
1703
+ /* @__PURE__ */ R(Zt, { children: [
1704
+ n && /* @__PURE__ */ g("img", { src: n }),
1705
+ s && /* @__PURE__ */ g(V, { icon: s, className: U({ spinning: f }) })
1654
1706
  ] }),
1655
- /* @__PURE__ */ z("span", { className: "content", children: [
1656
- /* @__PURE__ */ m("span", { className: "name", children: e }),
1657
- /* @__PURE__ */ m("span", { className: "message", children: n || `${u} ${v}` })
1707
+ /* @__PURE__ */ R("span", { className: "content", children: [
1708
+ /* @__PURE__ */ g("span", { className: "name", children: e }),
1709
+ /* @__PURE__ */ g("span", { className: "message", children: a || `${u} ${v}` })
1658
1710
  ] }),
1659
- r && /* @__PURE__ */ m("span", { className: "size", children: Ie(r) }),
1660
- c && /* @__PURE__ */ m(P, { icon: "info", className: "info", "data-tooltip": c, "data-tooltip-as": "markdown" }),
1661
- (n || o === "waiting") && /* @__PURE__ */ m(O, { icon: "close", variant: "text", onClick: g }),
1662
- /* @__PURE__ */ m(_t, { className: "progress", style: { right: `${100 - (t ?? 0)}%` } })
1711
+ r && /* @__PURE__ */ g("span", { className: "size", children: Me(r) }),
1712
+ d && /* @__PURE__ */ g(V, { icon: "info", className: "info", "data-tooltip": d, "data-tooltip-as": "markdown" }),
1713
+ (a || o === "waiting") && /* @__PURE__ */ g(_, { icon: "close", variant: "text", onClick: h }),
1714
+ /* @__PURE__ */ g(Jt, { className: "progress", style: { right: `${100 - (t ?? 0)}%` } })
1663
1715
  ]
1664
1716
  },
1665
1717
  e
@@ -1672,15 +1724,15 @@ p.div`
1672
1724
  min-height: 100%;
1673
1725
  padding-bottom: var(--padding-m);
1674
1726
  `;
1675
- const gr = p.div`
1727
+ const br = p.div`
1676
1728
  position: relative;
1677
1729
  overflow: hidden;
1678
1730
  border-radius: var(--border-radius-m);
1679
1731
  width: 100%;
1680
1732
  min-height: 50px;
1681
- `, hr = p.div`
1733
+ `, xr = p.div`
1682
1734
  word-break: break-all;
1683
- `, qt = p.div`
1735
+ `, Xt = p.div`
1684
1736
  display: flex;
1685
1737
  flex-direction: column;
1686
1738
  gap: var(--base-gap-small);
@@ -1697,7 +1749,7 @@ const gr = p.div`
1697
1749
  &.dragging {
1698
1750
  opacity: 0;
1699
1751
  }
1700
- `, Gt = p.div`
1752
+ `, Yt = p.div`
1701
1753
  position: relative;
1702
1754
  min-height: 50px;
1703
1755
  display: flex;
@@ -1726,7 +1778,7 @@ const gr = p.div`
1726
1778
  opacity: 0;
1727
1779
  cursor: pointer;
1728
1780
  }
1729
- `, Kt = p.div`
1781
+ `, eo = p.div`
1730
1782
  position: absolute;
1731
1783
  inset: var(--padding-s);
1732
1784
  background-color: var(--md-sys-color-surface-container-lowest);
@@ -1748,8 +1800,8 @@ const gr = p.div`
1748
1800
  .icon {
1749
1801
  font-size: 32px;
1750
1802
  }
1751
- `, ie = (e) => {
1752
- if (ge.isAxiosError(e)) {
1803
+ `, me = (e) => {
1804
+ if (we.isAxiosError(e)) {
1753
1805
  const t = e.response?.data;
1754
1806
  if (typeof t == "string" && t)
1755
1807
  return t;
@@ -1761,226 +1813,226 @@ const gr = p.div`
1761
1813
  return e.message || e.response?.statusText || "Unknown upload error";
1762
1814
  }
1763
1815
  return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown upload error";
1764
- }, Jt = ({
1816
+ }, to = ({
1765
1817
  projectName: e,
1766
1818
  versionId: t,
1767
1819
  taskId: r,
1768
1820
  folderId: o,
1769
- productId: l,
1770
- dispatch: a,
1771
- onUpload: n,
1772
- onProgress: c
1821
+ productId: c,
1822
+ dispatch: n,
1823
+ onUpload: a,
1824
+ onProgress: d
1773
1825
  }) => {
1774
- const [g, s] = L({}), u = Q(
1775
- (h) => {
1776
- t && s((v) => ({
1826
+ const [h, i] = O({}), u = Y(
1827
+ (s) => {
1828
+ t && i((v) => ({
1777
1829
  ...v,
1778
- [t]: v[t]?.filter((f) => f.name !== h) || []
1830
+ [t]: v[t]?.filter((m) => m.name !== s) || []
1779
1831
  }));
1780
1832
  },
1781
1833
  [t]
1782
1834
  );
1783
1835
  return {
1784
- handleFileUpload: Q(
1785
- async (h, v) => {
1786
- const f = v || t;
1787
- if (!f || !e) return;
1788
- const w = Array.from(h), y = w.map((k) => ({
1789
- name: I(k.name),
1790
- size: k.size,
1836
+ handleFileUpload: Y(
1837
+ async (s, v) => {
1838
+ const m = v || t;
1839
+ if (!m || !e) return;
1840
+ const w = Array.from(s), T = w.map((E) => ({
1841
+ name: Q(E.name),
1842
+ size: E.size,
1791
1843
  progress: 0
1792
- })), x = [...g[f] || [], ...y];
1793
- s({ ...g, [f]: x });
1794
- const F = (k) => (S) => {
1795
- if (!f) return;
1796
- console.log(`Upload successful for ${k.name}`);
1797
- const d = S.data;
1798
- e && (a(
1844
+ })), S = [...h[m] || [], ...T];
1845
+ i({ ...h, [m]: S });
1846
+ const b = (E) => (D) => {
1847
+ if (!m) return;
1848
+ console.log(`Upload successful for ${E.name}`);
1849
+ const l = D.data;
1850
+ e && (n(
1799
1851
  // @ts-ignore
1800
- Xe.util.updateQueryData(
1852
+ ot.util.updateQueryData(
1801
1853
  "getReviewablesForVersion",
1802
- { projectName: e, versionId: f },
1803
- (D) => {
1804
- D.reviewables || (D.reviewables = []), D.reviewables.push(d);
1854
+ { projectName: e, versionId: m },
1855
+ (N) => {
1856
+ N.reviewables || (N.reviewables = []), N.reviewables.push(l);
1805
1857
  }
1806
1858
  )
1807
- ), l && a(B.util.invalidateTags([{ type: "viewer", id: l }])), a(B.util.invalidateTags([{ type: "viewer", id: f }])), o && a(B.util.invalidateTags([{ type: "viewer", id: o }])), r && a(B.util.invalidateTags([{ type: "viewer", id: r }])), u(I(k.name)));
1808
- }, T = (k) => (S) => {
1809
- f && (console.error(`Upload failed for ${k.name}: ${S}`), s((d) => {
1810
- const N = (d[f] || []).map((C) => C.name !== I(k.name) ? C : {
1811
- ...C,
1812
- error: ie(S)
1859
+ ), c && n(K.util.invalidateTags([{ type: "viewer", id: c }])), n(K.util.invalidateTags([{ type: "viewer", id: m }])), o && n(K.util.invalidateTags([{ type: "viewer", id: o }])), r && n(K.util.invalidateTags([{ type: "viewer", id: r }])), u(Q(E.name)));
1860
+ }, k = (E) => (D) => {
1861
+ m && (console.error(`Upload failed for ${E.name}: ${D}`), i((l) => {
1862
+ const $ = (l[m] || []).map((z) => z.name !== Q(E.name) ? z : {
1863
+ ...z,
1864
+ error: me(D)
1813
1865
  });
1814
1866
  return {
1815
- ...d,
1816
- [f]: N
1867
+ ...l,
1868
+ [m]: $
1817
1869
  };
1818
1870
  }));
1819
- }, A = (k) => f ? (S) => s((d) => {
1820
- const N = (d[f] || []).map((b) => b.name !== I(k.name) ? b : {
1821
- ...b,
1822
- progress: S.total ? Math.round(S.loaded / S.total * 100) : 0
1823
- }), C = N.reduce(
1824
- (b, E) => b + (E.progress || 0),
1871
+ }, C = (E) => m ? (D) => i((l) => {
1872
+ const $ = (l[m] || []).map((y) => y.name !== Q(E.name) ? y : {
1873
+ ...y,
1874
+ progress: D.total ? Math.round(D.loaded / D.total * 100) : 0
1875
+ }), z = $.reduce(
1876
+ (y, j) => y + (j.progress || 0),
1825
1877
  0
1826
- ), $ = Math.round(C / N.length);
1827
- return c?.($), {
1828
- ...d,
1829
- [f]: N
1878
+ ), F = Math.round(z / $.length);
1879
+ return d?.(F), {
1880
+ ...l,
1881
+ [m]: $
1830
1882
  };
1831
1883
  }) : () => {
1832
1884
  };
1833
1885
  try {
1834
- const k = w.map((S) => {
1835
- const d = I(S.name), D = d.split(".").slice(0, -1).join(".") || "unnamed", N = `/api/projects/${e}/versions/${f}/reviewables?label=${D}`, C = { "content-type": S.type, "x-file-name": d };
1836
- return ge.post(N, S, { headers: C, onUploadProgress: A(S) }).then(F(S)).catch(($) => {
1837
- throw T(S)($), $;
1886
+ const E = w.map((D) => {
1887
+ const l = Q(D.name), N = l.split(".").slice(0, -1).join(".") || "unnamed", $ = `/api/projects/${e}/versions/${m}/reviewables?label=${N}`, z = { "content-type": D.type, "x-file-name": l };
1888
+ return we.post($, D, { headers: z, onUploadProgress: C(D) }).then(b(D)).catch((F) => {
1889
+ throw k(D)(F), F;
1838
1890
  });
1839
1891
  });
1840
- await Promise.all(k), n && n();
1841
- } catch (k) {
1842
- throw console.error(k), G.error(`Failed to upload file/s: ${ie(k)}`), k;
1892
+ await Promise.all(E), a && a();
1893
+ } catch (E) {
1894
+ throw console.error(E), te.error(`Failed to upload file/s: ${me(E)}`), E;
1843
1895
  }
1844
1896
  },
1845
1897
  [
1846
1898
  t,
1847
1899
  e,
1848
- g,
1849
- a,
1850
- l,
1900
+ h,
1901
+ n,
1902
+ c,
1851
1903
  o,
1852
1904
  r,
1853
1905
  u,
1854
- n,
1855
- c
1906
+ a,
1907
+ d
1856
1908
  ]
1857
1909
  ),
1858
1910
  handleRemoveUpload: u,
1859
- uploading: g
1911
+ uploading: h
1860
1912
  };
1861
- }, fr = ({
1913
+ }, wr = ({
1862
1914
  projectName: e,
1863
1915
  taskId: t,
1864
1916
  folderId: r,
1865
1917
  versionId: o,
1866
- productId: l,
1867
- onUpload: a,
1868
- onFilesAdded: n,
1869
- children: c,
1870
- dispatch: g,
1871
- variant: s = "normal",
1918
+ productId: c,
1919
+ onUpload: n,
1920
+ onFilesAdded: a,
1921
+ children: d,
1922
+ dispatch: h,
1923
+ variant: i = "normal",
1872
1924
  pendingFiles: u = [],
1873
- setPendingFiles: i,
1874
- className: h,
1925
+ setPendingFiles: f,
1926
+ className: s,
1875
1927
  readOnly: v = !1,
1876
- pt: f,
1928
+ pt: m,
1877
1929
  ...w
1878
1930
  }) => {
1879
- const [y, x] = L(!1), {
1880
- handleFileUpload: F,
1881
- handleRemoveUpload: T,
1882
- uploading: A
1883
- } = Jt({
1931
+ const [T, S] = O(!1), {
1932
+ handleFileUpload: b,
1933
+ handleRemoveUpload: k,
1934
+ uploading: C
1935
+ } = to({
1884
1936
  projectName: e,
1885
1937
  versionId: o,
1886
1938
  taskId: t,
1887
1939
  folderId: r,
1888
- productId: l,
1889
- dispatch: g,
1890
- onUpload: a
1891
- }), k = !!o;
1892
- V(() => {
1893
- if (k && o && u.length > 0 && i) {
1894
- const b = u.map((E) => E.file);
1895
- u.forEach((E) => {
1896
- E.preview && URL.revokeObjectURL(E.preview);
1897
- }), i([]), F(b);
1940
+ productId: c,
1941
+ dispatch: h,
1942
+ onUpload: n
1943
+ }), E = !!o;
1944
+ q(() => {
1945
+ if (E && o && u.length > 0 && f) {
1946
+ const y = u.map((j) => j.file);
1947
+ u.forEach((j) => {
1948
+ j.preview && URL.revokeObjectURL(j.preview);
1949
+ }), f([]), b(y);
1898
1950
  }
1899
- }, [k, o, u.length, F, i]);
1900
- const S = (b) => b.type.startsWith("image/"), d = (b) => b.map((E) => ({
1901
- file: E,
1902
- preview: S(E) ? URL.createObjectURL(E) : void 0
1903
- })), D = async (b) => {
1904
- const E = Array.from(b);
1905
- if (n?.(E), !k || !o) {
1906
- i && i((j) => [...j, ...d(E)]);
1951
+ }, [E, o, u.length, b, f]);
1952
+ const D = (y) => y.type.startsWith("image/"), l = (y) => y.map((j) => ({
1953
+ file: j,
1954
+ preview: D(j) ? URL.createObjectURL(j) : void 0
1955
+ })), N = async (y) => {
1956
+ const j = Array.from(y);
1957
+ if (a?.(j), !E || !o) {
1958
+ f && f((A) => [...A, ...l(j)]);
1907
1959
  return;
1908
1960
  }
1909
- await F(b);
1910
- }, N = (b) => {
1911
- const E = b.target.files;
1912
- E && D(E);
1913
- }, C = (b) => {
1914
- b.preventDefault(), x(!1);
1915
- const E = b.dataTransfer.files;
1916
- E && D(E);
1917
- }, $ = s === "large" ? { minWidth: "360px", maxWidth: "480px", alignSelf: "center" } : {};
1918
- return /* @__PURE__ */ z(Z, { children: [
1919
- /* @__PURE__ */ m(
1920
- qt,
1961
+ await b(y);
1962
+ }, $ = (y) => {
1963
+ const j = y.target.files;
1964
+ j && N(j);
1965
+ }, z = (y) => {
1966
+ y.preventDefault(), S(!1);
1967
+ const j = y.dataTransfer.files;
1968
+ j && N(j);
1969
+ }, F = i === "large" ? { minWidth: "360px", maxWidth: "480px", alignSelf: "center" } : {};
1970
+ return /* @__PURE__ */ R(ae, { children: [
1971
+ /* @__PURE__ */ g(
1972
+ Xt,
1921
1973
  {
1922
- className: U(h, s, { dragging: y }),
1974
+ className: U(s, i, { dragging: T }),
1923
1975
  ...w,
1924
- onDragEnter: () => !v && x(!0),
1925
- onDragOver: (b) => b.preventDefault(),
1926
- onDrop: (b) => {
1927
- v && (b.preventDefault(), b.stopPropagation());
1976
+ onDragEnter: () => !v && S(!0),
1977
+ onDragOver: (y) => y.preventDefault(),
1978
+ onDrop: (y) => {
1979
+ v && (y.preventDefault(), y.stopPropagation());
1928
1980
  },
1929
- children: /* @__PURE__ */ z(Z, { children: [
1930
- c,
1931
- !k && u?.map((b) => /* @__PURE__ */ m(
1932
- ae,
1981
+ children: /* @__PURE__ */ R(ae, { children: [
1982
+ d,
1983
+ !E && u?.map((y) => /* @__PURE__ */ g(
1984
+ ue,
1933
1985
  {
1934
- name: b.file.name,
1935
- size: b.file.size,
1936
- src: b.preview,
1986
+ name: y.file.name,
1987
+ size: y.file.size,
1988
+ src: y.preview,
1937
1989
  type: "waiting",
1938
1990
  onRemove: () => {
1939
- i && i((E) => E.filter((j) => j.file.name !== b.file.name));
1991
+ f && f((j) => j.filter((A) => A.file.name !== y.file.name));
1940
1992
  }
1941
1993
  },
1942
- b.file.name
1994
+ y.file.name
1943
1995
  )),
1944
- o && A[o]?.map((b) => /* @__PURE__ */ m(
1945
- ae,
1996
+ o && C[o]?.map((y) => /* @__PURE__ */ g(
1997
+ ue,
1946
1998
  {
1947
- ...b,
1999
+ ...y,
1948
2000
  type: "upload",
1949
- onRemove: () => T(b.name)
2001
+ onRemove: () => k(y.name)
1950
2002
  },
1951
- b.name
2003
+ y.name
1952
2004
  )),
1953
- !v && /* @__PURE__ */ z(
1954
- Gt,
2005
+ !v && /* @__PURE__ */ R(
2006
+ Yt,
1955
2007
  {
1956
2008
  id: "upload",
1957
- className: U("upload", s),
1958
- style: $,
1959
- ...f?.upload,
2009
+ className: U("upload", i),
2010
+ style: F,
2011
+ ...m?.upload,
1960
2012
  children: [
1961
- /* @__PURE__ */ m("span", { children: "Drop or click to upload" }),
1962
- /* @__PURE__ */ m("input", { type: "file", multiple: !0, onChange: N })
2013
+ /* @__PURE__ */ g("span", { children: "Drop or click to upload" }),
2014
+ /* @__PURE__ */ g("input", { type: "file", multiple: !0, onChange: $ })
1963
2015
  ]
1964
2016
  }
1965
2017
  )
1966
2018
  ] })
1967
2019
  }
1968
2020
  ),
1969
- y && !v && /* @__PURE__ */ z(
1970
- Kt,
2021
+ T && !v && /* @__PURE__ */ R(
2022
+ eo,
1971
2023
  {
1972
- onDragOver: (b) => b.preventDefault(),
1973
- onDragLeave: () => x(!1),
1974
- onDrop: C,
1975
- ...f?.dropzone,
2024
+ onDragOver: (y) => y.preventDefault(),
2025
+ onDragLeave: () => S(!1),
2026
+ onDrop: z,
2027
+ ...m?.dropzone,
1976
2028
  children: [
1977
- /* @__PURE__ */ m(P, { icon: "upload" }),
1978
- /* @__PURE__ */ m("span", { children: "Upload reviewable" })
2029
+ /* @__PURE__ */ g(V, { icon: "upload" }),
2030
+ /* @__PURE__ */ g("span", { children: "Upload reviewable" })
1979
2031
  ]
1980
2032
  }
1981
2033
  )
1982
2034
  ] });
1983
- }, vr = p.div`
2035
+ }, kr = p.div`
1984
2036
  position: relative;
1985
2037
  border-radius: var(--border-radius-m);
1986
2038
  display: flex;
@@ -1995,9 +2047,9 @@ const gr = p.div`
1995
2047
  }
1996
2048
 
1997
2049
  flex: 1;
1998
- `, yr = p.div`
2050
+ `, Er = p.div`
1999
2051
  position: relative;
2000
- `, br = p.span`
2052
+ `, Sr = p.span`
2001
2053
  position: relative;
2002
2054
  padding: 0px 2px;
2003
2055
  border-radius: var(--border-radius-m);
@@ -2019,29 +2071,29 @@ const gr = p.div`
2019
2071
  color: var(--md-sys-color-on-surface);
2020
2072
  }
2021
2073
  }
2022
- `, xr = p.span`
2074
+ `, Tr = p.span`
2023
2075
  text-overflow: ellipsis;
2024
2076
  overflow: hidden;
2025
2077
  display: inline-block;
2026
2078
  white-space: nowrap;
2027
- `, se = ue`
2079
+ `, ge = be`
2028
2080
  background-color: var(--md-sys-color-surface-container);
2029
2081
  &,
2030
2082
  .icon {
2031
2083
  color: var(--md-sys-color-on-surface);
2032
2084
  }
2033
- `, Zt = p.div`
2085
+ `, oo = p.div`
2034
2086
  & > span,
2035
2087
  & > li {
2036
2088
  cursor: pointer;
2037
2089
  &:hover {
2038
- ${se}
2090
+ ${ge}
2039
2091
  }
2040
2092
  }
2041
2093
 
2042
2094
  &.open {
2043
2095
  & > span {
2044
- ${se}
2096
+ ${ge}
2045
2097
  }
2046
2098
  }
2047
2099
 
@@ -2053,7 +2105,7 @@ const gr = p.div`
2053
2105
  }
2054
2106
  }
2055
2107
  }
2056
- `, wr = p.div`
2108
+ `, jr = p.div`
2057
2109
  position: absolute;
2058
2110
  top: 100%;
2059
2111
  left: 0px;
@@ -2062,7 +2114,7 @@ const gr = p.div`
2062
2114
 
2063
2115
  z-index: 200;
2064
2116
  padding-top: 4px;
2065
- `, kr = p.ul`
2117
+ `, Dr = p.ul`
2066
2118
  display: flex;
2067
2119
  flex-direction: column;
2068
2120
  gap: var(--base-gap-small);
@@ -2077,46 +2129,46 @@ const gr = p.div`
2077
2129
 
2078
2130
  max-height: 500px;
2079
2131
  overflow: auto;
2080
- `, Er = p.li`
2132
+ `, Fr = p.li`
2081
2133
  padding: var(--base-gap-small);
2082
2134
  border-radius: var(--border-radius-m);
2083
2135
  color: var(--md-sys-color-on-surface);
2084
2136
  min-width: max-content;
2085
2137
  width: 100%;
2086
- `, Tr = q(
2087
- ({ children: e, segment: t, isOpen: r, scope: o, projectName: l, ...a }, n) => {
2088
- const { openSlideOut: c } = J(), g = t?.type !== "product" && t?.type !== "project", s = () => {
2089
- if (!g) return;
2090
- const { type: v, id: f } = t || {};
2091
- !v || v === "project" || v === "product" || !f || c({
2138
+ `, Cr = ee(
2139
+ ({ children: e, segment: t, isOpen: r, scope: o, projectName: c, ...n }, a) => {
2140
+ const { openSlideOut: d } = re(), h = t?.type !== "product" && t?.type !== "project", i = () => {
2141
+ if (!h) return;
2142
+ const { type: v, id: m } = t || {};
2143
+ !v || v === "project" || v === "product" || !m || d({
2092
2144
  entityType: v,
2093
- entityId: f,
2094
- projectName: l
2145
+ entityId: m,
2146
+ projectName: c
2095
2147
  });
2096
2148
  }, u = (v) => [
2097
2149
  {
2098
2150
  label: `ID: ${v}`,
2099
2151
  icon: "content_copy",
2100
- command: () => K(v)
2152
+ command: () => oe(v)
2101
2153
  }
2102
- ], [i] = ct();
2103
- return /* @__PURE__ */ m(
2104
- Zt,
2154
+ ], [f] = mt();
2155
+ return /* @__PURE__ */ g(
2156
+ oo,
2105
2157
  {
2106
- onClick: s,
2158
+ onClick: i,
2107
2159
  onContextMenu: (v) => {
2108
2160
  if (!t) return;
2109
- const f = u(t.id);
2110
- i(v, f);
2161
+ const m = u(t.id);
2162
+ f(v, m);
2111
2163
  },
2112
- className: lt({ link: g, open: r }),
2113
- ...a,
2114
- ref: n,
2164
+ className: ut({ link: h, open: r }),
2165
+ ...n,
2166
+ ref: a,
2115
2167
  children: e
2116
2168
  }
2117
2169
  );
2118
2170
  }
2119
- ), Xt = p.div`
2171
+ ), ro = p.div`
2120
2172
  position: relative;
2121
2173
  width: 100%;
2122
2174
  height: 52px;
@@ -2206,7 +2258,7 @@ const gr = p.div`
2206
2258
  border: none;
2207
2259
  border-color: transparent;
2208
2260
  }
2209
- `, Yt = p.img`
2261
+ `, ao = p.img`
2210
2262
  width: 100%;
2211
2263
  height: 100%;
2212
2264
  object-fit: contain;
@@ -2218,63 +2270,63 @@ const gr = p.div`
2218
2270
  inset: 0;
2219
2271
 
2220
2272
  transition: scale 0.2s, opacity 0.2s;
2221
- `, eo = ({
2273
+ `, no = ({
2222
2274
  projectName: e = "",
2223
2275
  entityType: t = "",
2224
2276
  entityId: r = "",
2225
2277
  icon: o,
2226
- color: l,
2227
- thumbnailHash: a,
2228
- isLoading: n,
2229
- shimmer: c,
2230
- className: g,
2231
- disabled: s,
2278
+ color: c,
2279
+ thumbnailHash: n,
2280
+ isLoading: a,
2281
+ shimmer: d,
2282
+ className: h,
2283
+ disabled: i,
2232
2284
  src: u,
2233
- hoverIcon: i,
2234
- showBorder: h = !0,
2285
+ hoverIcon: f,
2286
+ showBorder: s = !0,
2235
2287
  ...v
2236
2288
  }) => {
2237
- const f = t === "project", w = ["product"].includes(t), y = f ? !!e : !!r;
2238
- let x = "";
2239
- t && (a || f) && y && (u ? x = u : x = dt({ projectName: e, entityType: t, entityId: r, thumbnailHash: a }) ?? "");
2240
- const [F, T] = L(!1), [A, k] = L(!1);
2241
- return V(() => {
2242
- if (x === "") {
2243
- k(!0), T(!0);
2289
+ const m = t === "project", w = ["product"].includes(t), T = m ? !!e : !!r;
2290
+ let S = "";
2291
+ t && (n || m) && T && (u ? S = u : S = gt({ projectName: e, entityType: t, entityId: r, thumbnailHash: n }) ?? "");
2292
+ const [b, k] = O(!1), [C, E] = O(!1);
2293
+ return q(() => {
2294
+ if (S === "") {
2295
+ E(!0), k(!0);
2244
2296
  return;
2245
2297
  }
2246
- k(!1), T(!1);
2247
- }, [x]), /* @__PURE__ */ z(
2248
- Xt,
2298
+ E(!1), k(!1);
2299
+ }, [S]), /* @__PURE__ */ R(
2300
+ ro,
2249
2301
  {
2250
- className: U(g, "thumbnail", {
2251
- loading: c && (n || !A),
2252
- loaded: A,
2253
- error: F,
2302
+ className: U(h, "thumbnail", {
2303
+ loading: d && (a || !C),
2304
+ loaded: C,
2305
+ error: b,
2254
2306
  clickable: !!v.onClick,
2255
- border: h
2307
+ border: s
2256
2308
  }),
2257
2309
  ...v,
2258
2310
  children: [
2259
- (!n || !A) && !s && /* @__PURE__ */ m(P, { style: { color: l || void 0 }, icon: o || "image", className: "type-icon" }),
2260
- t && e && !w && y && /* @__PURE__ */ m(
2261
- Yt,
2311
+ (!a || !C) && !i && /* @__PURE__ */ g(V, { style: { color: c || void 0 }, icon: o || "image", className: "type-icon" }),
2312
+ t && e && !w && T && /* @__PURE__ */ g(
2313
+ ao,
2262
2314
  {
2263
2315
  alt: `Entity thumbnail ${r || e}`,
2264
- src: x,
2316
+ src: S,
2265
2317
  onLoad: () => {
2266
- k(!0), T(!1);
2318
+ E(!0), k(!1);
2267
2319
  },
2268
2320
  onError: () => {
2269
- k(!0), T(!0);
2321
+ E(!0), k(!0);
2270
2322
  }
2271
2323
  }
2272
2324
  ),
2273
- i && /* @__PURE__ */ m(P, { icon: i, className: "hover-icon" })
2325
+ f && /* @__PURE__ */ g(V, { icon: f, className: "hover-icon" })
2274
2326
  ]
2275
2327
  }
2276
2328
  );
2277
- }, to = p.div`
2329
+ }, io = p.div`
2278
2330
  display: flex;
2279
2331
  z-index: 10;
2280
2332
  height: 100%;
@@ -2295,7 +2347,7 @@ const gr = p.div`
2295
2347
  font-size: 24px;
2296
2348
  }
2297
2349
 
2298
- ${({ $length: e }) => e > 1 && ue`
2350
+ ${({ $length: e }) => e > 1 && be`
2299
2351
  :not(:last-child) {
2300
2352
  box-shadow: 0 0 4px 0px black;
2301
2353
  }
@@ -2311,131 +2363,131 @@ const gr = p.div`
2311
2363
  object-fit: cover;
2312
2364
  }
2313
2365
  }
2314
- `, Sr = ({
2366
+ `, Ar = ({
2315
2367
  thumbnails: e = [],
2316
2368
  isLoading: t,
2317
2369
  className: r,
2318
2370
  style: o,
2319
- ...l
2371
+ ...c
2320
2372
  }) => {
2321
- const { onContextMenu: a } = Ee(rt);
2373
+ const { onContextMenu: n } = Se(st);
2322
2374
  e = e.slice(0, 5);
2323
- const n = e.length > 1;
2324
- return e.length ? /* @__PURE__ */ m(
2325
- to,
2375
+ const a = e.length > 1;
2376
+ return e.length ? /* @__PURE__ */ g(
2377
+ io,
2326
2378
  {
2327
2379
  $length: e.length,
2328
- className: U("stacked-thumbnails", r, { stacking: n }),
2380
+ className: U("stacked-thumbnails", r, { stacking: a }),
2329
2381
  children: e.map(
2330
- (c, g) => c ? /* @__PURE__ */ m(
2331
- eo,
2382
+ (d, h) => d ? /* @__PURE__ */ g(
2383
+ no,
2332
2384
  {
2333
- projectName: c.projectName,
2334
- entityType: c.type,
2335
- entityId: c.id,
2336
- icon: c.icon,
2337
- color: c.color,
2338
- style: { ...o, zIndex: -g },
2339
- thumbnailHash: c.thumbnailHash,
2385
+ projectName: d.projectName,
2386
+ entityType: d.type,
2387
+ entityId: d.id,
2388
+ icon: d.icon,
2389
+ color: d.color,
2390
+ style: { ...o, zIndex: -h },
2391
+ thumbnailHash: d.thumbnailHash,
2340
2392
  isLoading: t,
2341
- src: c.src,
2342
- onContextMenu: a,
2343
- ...l
2393
+ src: d.src,
2394
+ onContextMenu: n,
2395
+ ...c
2344
2396
  },
2345
- c.id || c.src || g
2397
+ d.id || d.src || h
2346
2398
  ) : null
2347
2399
  )
2348
2400
  }
2349
2401
  ) : null;
2350
- }, Dr = q(
2351
- ({ entities: e, entityType: t, onWatchersUpdate: r, userName: o, ...l }, a) => {
2352
- const n = e.map((i) => ({
2353
- entityId: i.id,
2402
+ }, Nr = ee(
2403
+ ({ entities: e, entityType: t, onWatchersUpdate: r, userName: o, ...c }, n) => {
2404
+ const a = e.map((f) => ({
2405
+ entityId: f.id,
2354
2406
  entityType: t,
2355
- projectName: i.projectName
2356
- })), { data: c = [] } = Ye(
2407
+ projectName: f.projectName
2408
+ })), { data: d = [] } = rt(
2357
2409
  {
2358
- entities: n
2410
+ entities: a
2359
2411
  },
2360
2412
  { skip: !e.length }
2361
- ), g = Array.from(new Set(c.flatMap((i) => i.watchers))), [s] = et(), u = async (i) => {
2362
- const h = i.filter((w) => !g.includes(w)), v = g.filter((w) => !i.includes(w)), f = c.map((w) => {
2363
- const y = w.watchers.filter((x) => !v.includes(x));
2364
- return y.push(...h), {
2413
+ ), h = Array.from(new Set(d.flatMap((f) => f.watchers))), [i] = at(), u = async (f) => {
2414
+ const s = f.filter((w) => !h.includes(w)), v = h.filter((w) => !f.includes(w)), m = d.map((w) => {
2415
+ const T = w.watchers.filter((S) => !v.includes(S));
2416
+ return T.push(...s), {
2365
2417
  ...w,
2366
- watchers: y
2418
+ watchers: T
2367
2419
  };
2368
2420
  });
2369
2421
  try {
2370
- await s({ entities: f }).unwrap(), r && r(h, v);
2422
+ await i({ entities: m }).unwrap(), r && r(s, v);
2371
2423
  } catch {
2372
- G.error("Failed to update watchers");
2424
+ te.error("Failed to update watchers");
2373
2425
  }
2374
2426
  };
2375
- return /* @__PURE__ */ m(
2376
- Ve,
2427
+ return /* @__PURE__ */ g(
2428
+ ze,
2377
2429
  {
2378
2430
  align: "right",
2379
- ...l,
2380
- options: ze(l.options, g),
2381
- value: g,
2431
+ ...c,
2432
+ options: _e(c.options, h),
2433
+ value: h,
2382
2434
  currentUser: o,
2383
2435
  onChange: u,
2384
- ref: a,
2436
+ ref: n,
2385
2437
  buttonProps: { "data-tooltip": "Watchers" }
2386
2438
  }
2387
2439
  );
2388
2440
  }
2389
2441
  );
2390
2442
  export {
2391
- Xo as A,
2392
- Jo as B,
2393
- dr as C,
2394
- cr as D,
2395
- rr as E,
2396
- xr as F,
2397
- qo as G,
2398
- Qo as H,
2399
- nr as I,
2400
- tr as J,
2401
- or as K,
2402
- gr as L,
2403
- wr as M,
2404
- ar as N,
2405
- Go as O,
2406
- ur as P,
2407
- Yo as Q,
2408
- mr as R,
2409
- br as S,
2410
- Zo as T,
2411
- pr as U,
2412
- ir as V,
2413
- Dr as W,
2414
- er as X,
2415
- hr as a,
2416
- fr as b,
2417
- ae as c,
2418
- sr as d,
2419
- lr as e,
2420
- vr as f,
2421
- kr as g,
2422
- Tr as h,
2423
- Er as i,
2424
- yr as j,
2425
- Ho as k,
2426
- mt as l,
2427
- yt as m,
2428
- Bo as n,
2429
- xt as o,
2430
- wt as p,
2431
- Ft as q,
2432
- At as r,
2433
- _o as s,
2434
- he as t,
2435
- Jt as u,
2436
- Ut as v,
2437
- Sr as w,
2438
- eo as x,
2439
- bt as y,
2440
- Ko as z
2443
+ rr as A,
2444
+ tr as B,
2445
+ hr as C,
2446
+ gr as D,
2447
+ lr as E,
2448
+ Tr as F,
2449
+ Xo as G,
2450
+ Zo as H,
2451
+ cr as I,
2452
+ ir as J,
2453
+ sr as K,
2454
+ br as L,
2455
+ jr as M,
2456
+ dr as N,
2457
+ Yo as O,
2458
+ vr as P,
2459
+ ar as Q,
2460
+ yr as R,
2461
+ Sr as S,
2462
+ or as T,
2463
+ fr as U,
2464
+ pr as V,
2465
+ Nr as W,
2466
+ nr as X,
2467
+ xr as a,
2468
+ wr as b,
2469
+ ue as c,
2470
+ ur as d,
2471
+ mr as e,
2472
+ kr as f,
2473
+ Dr as g,
2474
+ Cr as h,
2475
+ Fr as i,
2476
+ Er as j,
2477
+ Ko as k,
2478
+ vt as l,
2479
+ kt as m,
2480
+ Go as n,
2481
+ St as o,
2482
+ Tt as p,
2483
+ Mt as q,
2484
+ Rt as r,
2485
+ Jo as s,
2486
+ ke as t,
2487
+ to as u,
2488
+ It as v,
2489
+ Ar as w,
2490
+ no as x,
2491
+ Et as y,
2492
+ er as z
2441
2493
  };