@ynput/ayon-frontend-shared 0.6.2 → 0.6.3

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