@ynput/ayon-frontend-shared 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +292 -298
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +32 -35
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4451 -2965
  7. package/dist/SimpleTable.es.js +8 -7
  8. package/dist/Slicer.es.js +451 -147
  9. package/dist/Views.es.js +918 -310
  10. package/dist/chunks/Actions.es.js +9 -4
  11. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  12. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  13. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  14. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  15. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  16. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  17. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  18. package/dist/chunks/EntityPath.es.js +58 -53
  19. package/dist/chunks/EntityPickerDialog.es.js +24 -20
  20. package/dist/chunks/EntityTooltip.es.js +20 -13
  21. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  22. package/dist/chunks/Feed.es.js +1495 -1439
  23. package/dist/chunks/FilterErrorActions.es.js +25 -229
  24. package/dist/chunks/Menu.es.js +21 -17
  25. package/dist/chunks/MenuContext.es.js +14 -65
  26. package/dist/chunks/MenuItem.es.js +34 -24
  27. package/dist/chunks/MetaWidget.es.js +2835 -4301
  28. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  29. package/dist/chunks/PlayableIcon.es.js +1532 -1594
  30. package/dist/chunks/ProjectContext.es.js +102 -66
  31. package/dist/chunks/RepresentationsList.es.js +1 -1
  32. package/dist/chunks/ReviewablesSelector.es.js +457 -458
  33. package/dist/chunks/SimpleForm.es.js +9 -9
  34. package/dist/chunks/SimpleTable.es.js +15 -13
  35. package/dist/chunks/Slicer.es.js +163 -154
  36. package/dist/chunks/TableSettingsFallback.es.js +25 -13
  37. package/dist/chunks/ThumbnailSimple.es.js +150 -261
  38. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  39. package/dist/chunks/VideoPlayer.es.js +24 -28
  40. package/dist/chunks/Watchers.es.js +384 -389
  41. package/dist/chunks/entityDefinitions.es.js +2 -350
  42. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  43. package/dist/chunks/getBundleMode.es.js +61 -16
  44. package/dist/chunks/getUris.es.js +737 -712
  45. package/dist/chunks/searchTerms.es.js +57 -56
  46. package/dist/chunks/useAttributeEnums.es.js +4 -4
  47. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  48. package/dist/chunks/useHierarchySelection.es.js +24 -0
  49. package/dist/chunks/useLoadModule.es.js +74 -0
  50. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  51. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  52. package/dist/chunks/viewUpdateHelper.es.js +67 -50
  53. package/dist/components.es.js +1425 -999
  54. package/dist/context.es.js +791 -80
  55. package/dist/hooks.es.js +115 -120
  56. package/dist/index.es.js +19 -23
  57. package/dist/types/Actions.d.ts +7 -7
  58. package/dist/types/ContextMenu.d.ts +11 -8
  59. package/dist/types/DetailsPanel.d.ts +102 -9
  60. package/dist/types/EntityPickerDialog.d.ts +7 -7
  61. package/dist/types/Feed.d.ts +11 -8
  62. package/dist/types/ListTable.d.ts +7 -7
  63. package/dist/types/NewEntity.d.ts +16 -10
  64. package/dist/types/ProjectTreeTable.d.ts +22 -115
  65. package/dist/types/RepresentationsList.d.ts +7 -7
  66. package/dist/types/SimpleTable.d.ts +11 -8
  67. package/dist/types/Slicer.d.ts +10 -7
  68. package/dist/types/Views.d.ts +10 -7
  69. package/dist/types/api.d.ts +132 -120
  70. package/dist/types/components.d.ts +13 -8
  71. package/dist/types/context.d.ts +56 -16
  72. package/dist/types/hooks.d.ts +7 -7
  73. package/dist/types/index.d.ts +7 -7
  74. package/dist/types/util.d.ts +12 -7
  75. package/dist/util.es.js +72 -71
  76. package/package.json +1 -1
  77. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  78. package/dist/chunks/DetailsPanelContext.es.js +0 -155
  79. package/dist/chunks/GlobalContext.es.js +0 -52
  80. package/dist/chunks/NewEntityContext.es.js +0 -1242
  81. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  82. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  83. package/dist/chunks/VersionUploadContext.es.js +0 -232
  84. package/dist/chunks/ViewsContext.es.js +0 -878
  85. package/dist/chunks/uriUtils.es.js +0 -48
  86. package/dist/chunks/useColumnDragRestriction.es.js +0 -158
  87. package/dist/chunks/useLocalStorage.es.js +0 -355
  88. package/dist/chunks/useSessionStorage.es.js +0 -61
  89. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
@@ -1,17 +1,17 @@
1
- import { jsx as c, jsxs as y, Fragment as be } from "react/jsx-runtime";
2
- import Bt, { useState as q, useEffect as X, lazy as Yn, Suspense as Qn, useRef as ge, useMemo as _, useCallback as He, forwardRef as ut, useId as Kn, Fragment as Jn } from "react";
3
- import { v4 as sn } from "uuid";
4
- import K, { clsx as cn } from "clsx";
5
- import ln from "react-markdown";
6
- import dn from "remark-emoji";
7
- import un from "remark-gfm";
8
- import Xn from "remark-directive";
9
- import Zn from "remark-directive-rehype";
10
- import { toast as ye } from "react-toastify";
11
- import { $createListItemNode as eo, $createListNode as to } from "@lexical/list";
12
- import { $getRoot as no } from "lexical";
13
- import { Button as rt, Dialog as oo, Icon as Z, getFileSizeString as ao, theme as ro, getTextColor as Tt, Dropdown as io, UserImage as pn, SaveButton as so, SEARCH_FILTER_ID as mn, buildFilterId as jt, getFilterFromId as co, SearchFilter as lo } from "@ynput/ayon-react-components";
14
- import { P as uo, A as it, R as po, k as mo, L as go, l as ho, V as fo, m as Gt, n as vo, o as yo, E as bo, M as wo, T as xo, p as ko, F as Ao, q as Co, r as Fo, s as To, t as Do, u as Io, S as No, v as So, w as Eo, x as Dt, y as gn, z as _o, G as Po, H as Ro, I as Mo, J as $o, K as Lo, O as Oo, Q as Vo, W as Ht, X as zo, Y as Uo, Z as Bo, _ as jo, $ as Go, a0 as Ho, a1 as qo, a2 as Wo, b as Yo, j as Qo } from "./PlayableIcon.es.js";
1
+ import { jsx as c, jsxs as b, Fragment as we } from "react/jsx-runtime";
2
+ import Ut, { useMemo as S, useState as O, useEffect as X, lazy as Jn, Suspense as Xn, useCallback as qe, forwardRef as pt, useRef as ve, useId as Zn, Fragment as eo } from "react";
3
+ import { v4 as cn } from "uuid";
4
+ import J, { clsx as ln } from "clsx";
5
+ import dn from "react-markdown";
6
+ import un from "remark-emoji";
7
+ import pn from "remark-gfm";
8
+ import to from "remark-directive";
9
+ import no from "remark-directive-rehype";
10
+ import { toast as be } from "react-toastify";
11
+ import { $createListItemNode as oo, $createListNode as ao } from "@lexical/list";
12
+ import { $getRoot as ro } from "lexical";
13
+ import { Button as rt, Dialog as io, getFileSizeString as so, Icon as oe, theme as mn, getTextColor as Tt, Dropdown as co, SaveButton as lo, UserImage as gn, SEARCH_FILTER_ID as hn, buildFilterId as Bt, getFilterFromId as uo, SearchFilter as po } from "@ynput/ayon-react-components";
14
+ import { p as mo, Y as go, q as ho, P as fo, o as fn, L as yo, l as vo, V as bo, r as Gt, s as wo, u as xo, E as ko, M as Ao, T as Fo, v as Co, F as To, w as Do, x as No, y as So, z as Io, G as Eo, S as Mo, H as _o, I as Po, J as Dt, n as yn, K as Ro, A as $o, O as Lo, Q as Oo, R as jo, W as Vo, X as zo, Z as Uo, _ as Ht, $ as Bo, a0 as Go, a1 as Ho, a2 as qo, a3 as Wo, a4 as Qo, b as Yo, j as Ko } from "./PlayableIcon.es.js";
15
15
  import "@lexical/markdown";
16
16
  import "@lexical/react/LexicalBlockWithAlignableContents";
17
17
  import "@lexical/react/LexicalDecoratorBlockNode";
@@ -19,39 +19,174 @@ import "@lexical/code";
19
19
  import "@lexical/rich-text";
20
20
  import "@lexical/selection";
21
21
  import "@lexical/utils";
22
- import A, { css as It } from "styled-components";
23
- import Ko from "@uiw/react-textarea-code-editor";
22
+ import A, { css as Nt } from "styled-components";
23
+ import Jo from "@uiw/react-textarea-code-editor";
24
24
  import { E as kt } from "./EmptyPlaceholder.es.js";
25
- import { a as Jo, M as Xo } from "./Menu.es.js";
26
- import { u as Le, F as ot, b as hn, T as Zo, C as ea } from "./ThumbnailSimple.es.js";
27
- import { u as We, g as Nt } from "./DetailsPanelContext.es.js";
28
- import { p as pe } from "./parseFilename.es.js";
29
- import St from "axios";
30
- import "lodash";
25
+ import { a as Xo, M as Zo } from "./Menu.es.js";
26
+ import { aQ as ea, bi as qt } from "./searchTerms.es.js";
27
+ import { bf as ta, bi as na, aE as oa, dd as aa, aR as ra, aL as ia, a_ as sa, K as ca, bA as la, bh as da, bs as ua, bm as pa, bg as ma, bV as ga } from "./getUris.es.js";
31
28
  import "primereact/confirmdialog";
32
- import { b as qt } from "./colorUtils.es.js";
33
- import { be as Wt } from "./searchTerms.es.js";
29
+ import { union as ha, isEqual as fa } from "lodash";
30
+ import { b as ya, F as va, u as $e, a as vn, T as ba, C as wa } from "./ThumbnailSimple.es.js";
31
+ import "@module-federation/enhanced/runtime";
32
+ import { v as ze, x as xa, _ as St, u as ka } from "./DeleteEntitiesContextInstance.es.js";
33
+ import "semver";
34
+ import "./ContextMenuContextInstance.es.js";
34
35
  import "react-dom";
35
- import { bm as ta, bg as na, bV as oa } from "./getUris.es.js";
36
+ import "react-redux";
37
+ import { p as pe } from "./parseFilename.es.js";
38
+ import It from "axios";
39
+ import { b as Wt } from "./colorUtils.es.js";
36
40
  import "./EntityTooltip.es.js";
37
- import { a as aa } from "./ProjectContext.es.js";
41
+ import { isValid as it, isToday as Aa, isSameYear as Fa, isSameDay as Ca, isSameWeek as Ta, isSameMinute as Da, format as Qt, formatISO as Na, differenceInMinutes as Sa, differenceInSeconds as Ia, compareAsc as Ea } from "date-fns";
38
42
  import "react-router-dom";
39
- import { u as ra } from "./MenuContext.es.js";
40
43
  import "./MenuItem.es.js";
41
- import "./useLocalStorage.es.js";
42
- import "@module-federation/enhanced/runtime";
43
- import "semver";
44
- import { formatISO as ia, differenceInMinutes as sa, isValid as dt, differenceInSeconds as ca, compareAsc as la } from "date-fns";
45
- import { InView as da } from "react-intersection-observer";
46
- import { t as ua, c as pa } from "./queryFilterToClientFilter.es.js";
47
- import { u as ma } from "./useDateRangeFilter.es.js";
44
+ import { InView as Ma } from "react-intersection-observer";
45
+ import { t as _a, c as Pa } from "./queryFilterToClientFilter.es.js";
46
+ import { u as Ra } from "./useDateRangeFilter.es.js";
48
47
  import "match-sorter";
49
- import { c as ga } from "./confirmDelete.es.js";
50
- import { c as fn } from "./copyToClipboard.es.js";
48
+ import { c as $a } from "./confirmDelete.es.js";
49
+ import { c as bn } from "./copyToClipboard.es.js";
51
50
  import { g as Yt } from "./realtimeUpdatesUtils.es.js";
52
- const ha = (e) => e.replace(/\r\n?/g, `
51
+ const La = (e) => e.replace(/\r\n?/g, `
53
52
  `).replace(/^\s*(```|~~~).*$/gm, "").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/<(https?:[^>]+)>/g, "$1").replace(/<\/?[a-z][^>]*>/gi, "").replace(/[<>]/g, "").replace(/&nbsp;/g, " ").replace(/^\s*#{1,6}\s+/gm, "").replace(/^\s*>\s?/gm, "").replace(/^\s*(?:[-*+]|\d+[.)])\s+(?:\[[ xX]\]\s+)?/gm, "").replace(/`([^`]*)`/g, "$1").replace(/(\*\*|__)(.+?)\1/g, "$2").replace(/~~(.+?)~~/g, "$1").replace(/(^|[^\w*])\*(?!\s)([^*]+?)\*(?!\w)/g, "$1$2").replace(/(^|[^\w])_(?!\s)([^_]+?)_(?!\w)/g, "$1$2").replace(/\\\n/g, `
54
- `).replace(/\\([\\`*_{}[\]()#+\-.!~>|])/g, "$1").replace(/\s+/g, " ").trim(), fa = A.div`
53
+ `).replace(/\\([\\`*_{}[\]()#+\-.!~>|])/g, "$1").replace(/\s+/g, " ").trim(), Oa = (e) => {
54
+ const n = (e.node?.children ?? []).filter(
55
+ (i) => !(i.type === "text" && !i.value?.trim())
56
+ );
57
+ if (n.length !== 1) return null;
58
+ const [o] = n;
59
+ if (o.type !== "element" || o.tagName !== "a") return null;
60
+ const t = o.properties?.href, a = o.children?.map((i) => i.value ?? "").join("");
61
+ if (!t || a?.trim() !== t) return null;
62
+ const r = mo(t);
63
+ return r ? /* @__PURE__ */ c(go, { video: r }) : null;
64
+ }, ja = (e, { onOpen: n } = {}) => {
65
+ const o = (e.node?.children ?? []).filter(
66
+ (s) => !(s.type === "text" && !s.value?.trim())
67
+ );
68
+ if (o.length !== 1) return null;
69
+ const [t] = o;
70
+ if (t.type !== "element" || t.tagName !== "img") return null;
71
+ const { src: a, alt: r, title: i } = t.properties ?? {};
72
+ return a ? /* @__PURE__ */ c(ho, { src: a, alt: r, mime: i, onOpen: n ? () => n(a) : void 0 }) : null;
73
+ }, Va = ({
74
+ entities: e,
75
+ filter: n,
76
+ backendFilter: o,
77
+ activityTypes: t,
78
+ projectName: a,
79
+ entityType: r
80
+ }) => {
81
+ const s = S(
82
+ () => e.map((F) => ({ id: F.id, projectName: F.projectName, entityType: r })),
83
+ [e]
84
+ ).map((F) => F.id), l = !e.length || !n || !t || !a, u = {
85
+ entityIds: s,
86
+ projectName: a,
87
+ referenceTypes: ["origin", "mention", "relation"],
88
+ activityTypes: t,
89
+ activityFilter: o,
90
+ filter: n
91
+ };
92
+ let {
93
+ data: m,
94
+ isLoading: p,
95
+ isFetchingNextPage: g,
96
+ currentData: f,
97
+ fetchNextPage: h,
98
+ hasNextPage: k
99
+ } = ta(u, { skip: l });
100
+ const C = S(() => m?.pages ? m.pages.flatMap((F) => F.activities || []) : [], [m?.pages]), I = S(() => f?.pages ? f.pages.flatMap((F) => F.activities || []) : [], [f?.pages]), y = async () => {
101
+ if (!k) {
102
+ console.log("No more activities to load");
103
+ return;
104
+ }
105
+ return console.log("loading next page..."), await h();
106
+ }, v = S(() => {
107
+ if (!p) return !1;
108
+ const F = ha(
109
+ I?.flatMap((w) => w.entityId ? w.entityId : [])
110
+ );
111
+ return !fa(F, s);
112
+ }, [I, s, p]);
113
+ return l && (p = !0), {
114
+ activitiesData: C,
115
+ isLoadingActivities: p,
116
+ isLoadingNew: v,
117
+ isLoadingNextPage: g,
118
+ hasNextPage: k,
119
+ loadNextPage: y
120
+ };
121
+ }, ot = "__new__", Zs = ({ children: e, ...n }) => {
122
+ const { isGuest: o } = ze(), { data: t = [] } = na({ projects: [n.projectName] }), { data: a = [] } = ea.useGetTeamsQuery(
123
+ { projectName: n.projectName, showMembers: !0 },
124
+ { skip: !n.projectName }
125
+ ), r = S(
126
+ () => a.filter((q) => q.members?.some((re) => re.name === n.userName)).map((q) => q.name),
127
+ [a, n.userName]
128
+ ), [i, s] = O({
129
+ operator: "and",
130
+ conditions: []
131
+ }), [l, u] = O(""), m = n.feedFilter ?? i, p = n.setFeedFilter ?? s, [g, f] = O(null), [h, k] = O(null), [C, { isLoading: I }] = oa(), [y, { isLoading: v }] = aa(), [F, { isLoading: w }] = ra(), R = I || v || w, N = async (q) => await C(q).unwrap(), $ = async (q) => await y(q).unwrap(), M = async (q) => await F(q).unwrap(), [_] = ia(), [B] = sa(), E = async (q) => await _(q).unwrap(), K = async (q) => await B(q).unwrap(), H = ca(m), le = S(() => ya(m), [m]), Z = Va({
132
+ entities: n.entities,
133
+ filter: m,
134
+ backendFilter: le,
135
+ activityTypes: H,
136
+ projectName: n.projectName,
137
+ entityType: n.entityType
138
+ }), { data: W = {} } = la(
139
+ {
140
+ suggestRequest: {
141
+ entityType: n.entityType,
142
+ entityId: n.entities[0]?.id
143
+ },
144
+ projectName: n.projectName
145
+ },
146
+ { skip: !g }
147
+ ), { data: j = [] } = da({
148
+ projectName: n.projectName
149
+ }), { data: ae } = ua(
150
+ {
151
+ projectName: n.projectName,
152
+ entityIds: n.entities.map((q) => q.id)
153
+ },
154
+ { skip: !n.projectName || !n.entities.length }
155
+ );
156
+ return /* @__PURE__ */ c(
157
+ va.Provider,
158
+ {
159
+ value: {
160
+ ...n,
161
+ ...Z,
162
+ mentionSuggestionsData: W,
163
+ categories: j,
164
+ checklistCount: ae,
165
+ users: t,
166
+ isUpdatingActivity: R,
167
+ userTeamNames: r,
168
+ refTooltip: h,
169
+ activityTypes: H,
170
+ feedFilter: m,
171
+ setFeedFilter: p,
172
+ backendFilter: le,
173
+ searchText: l,
174
+ setSearchText: u,
175
+ isGuest: o,
176
+ editingId: g,
177
+ setEditingId: f,
178
+ setRefTooltip: k,
179
+ // Query functions
180
+ createEntityActivity: N,
181
+ updateActivity: $,
182
+ deleteActivity: M,
183
+ createReaction: E,
184
+ deleteReaction: K
185
+ },
186
+ children: e
187
+ }
188
+ );
189
+ }, za = A.div`
55
190
  display: grid;
56
191
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
57
192
  gap: var(--base-gap-large);
@@ -67,7 +202,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
67
202
  301px + var(--padding-s) + var(--padding-s) + var(--base-gap-large)+ var(--base-gap-large)
68
203
  );
69
204
  overflow: auto;
70
- `, va = A.div`
205
+ `, Ua = A.div`
71
206
  position: relative;
72
207
  display: flex;
73
208
  flex-direction: column;
@@ -113,7 +248,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
113
248
  .download-icon {
114
249
  color: var(--md-sys-color-outline);
115
250
  }
116
- `, ya = A.footer`
251
+ `, Ba = A.footer`
117
252
  background-color: var(--md-sys-color-surface-container-low);
118
253
  display: flex;
119
254
  align-items: center;
@@ -213,7 +348,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
213
348
  }
214
349
  }
215
350
  }
216
- `, ba = A.div`
351
+ `, Ga = A.div`
217
352
  position: relative;
218
353
  display: flex;
219
354
  justify-content: center;
@@ -250,7 +385,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
250
385
  &:hover .image-wrapper::after {
251
386
  opacity: 0.8;
252
387
  }
253
- `, Qt = A.div`
388
+ `, Kt = A.div`
254
389
  position: absolute;
255
390
  inset: 0;
256
391
  display: flex;
@@ -289,7 +424,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
289
424
  &.posterError {
290
425
  background-color: transparent;
291
426
  }
292
- `, wa = A.div`
427
+ `, Ha = A.div`
293
428
  display: none;
294
429
  position: absolute;
295
430
  left: 0;
@@ -298,7 +433,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
298
433
  height: calc(100% - 20px);
299
434
  width: 100%;
300
435
  gap: 0;
301
- `, Kt = A(rt)`
436
+ `, Jt = A(rt)`
302
437
  height: 100%;
303
438
  width: 100%;
304
439
  border: none;
@@ -309,7 +444,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
309
444
  background: none;
310
445
  opacity: 1;
311
446
  }
312
- `, xa = A(uo)`
447
+ `, qa = A(fo)`
313
448
  --icon-size: 32px;
314
449
  top: calc(50% - 10px);
315
450
  left: 50%;
@@ -321,7 +456,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
321
456
  .icon {
322
457
  font-size: var(--icon-size);
323
458
  }
324
- `, pt = (e, n) => `/api/projects/${n}/files/${e}`, ka = A(oo)`
459
+ `, ec = A(io)`
325
460
  min-height: 90vh;
326
461
  max-height: 90vh;
327
462
  min-width: min(90vw, 100%);
@@ -406,7 +541,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
406
541
  &:focus-visible {
407
542
  outline: none;
408
543
  }
409
- `, Aa = A.img`
544
+ `, Wa = A.img`
410
545
  height: 100%;
411
546
  width: 100%;
412
547
 
@@ -416,7 +551,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
416
551
  max-width: 90vw;
417
552
  min-width: 300px;
418
553
  background-color: var(--md-sys-color-surface-container-lowest);
419
- `, Ca = A.div`
554
+ `, tc = A.div`
420
555
  &.scrollable {
421
556
  position: absolute;
422
557
  inset: 56px;
@@ -428,7 +563,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
428
563
  inset: 56px 0 0 0;
429
564
  display: flex;
430
565
  }
431
- `, Jt = A.div`
566
+ `, Xt = A.div`
432
567
  position: relative;
433
568
  display: flex;
434
569
  flex: 1;
@@ -445,45 +580,45 @@ const ha = (e) => e.replace(/\r\n?/g, `
445
580
  flex: 1;
446
581
  min-width: 0;
447
582
  }
448
- `, Fa = ({
583
+ `, st = (e, n) => `/api/projects/${n}/files/${e}`, Qa = ({
449
584
  file: e,
450
585
  fullPreviews: n = ["png", "jpg", "jpeg", "gif", "svg", "webp"]
451
586
  }) => {
452
587
  const { id: o, projectName: t, mime: a } = e;
453
- let r = pt(o, t);
454
- return n.some((s) => a.includes(s)) || (r += "/thumbnail"), /* @__PURE__ */ c(Aa, { src: r, autoFocus: !0 });
455
- }, Ta = A(Ko)`
588
+ let r = st(o, t);
589
+ return n.some((s) => a.includes(s)) || (r += "/thumbnail"), /* @__PURE__ */ c(Wa, { src: r, autoFocus: !0 });
590
+ }, Ya = A(Jo)`
456
591
  border-radius: var(--border-radius-m);
457
592
  height: 100%;
458
593
  overflow: auto !important;
459
- `, Da = ({ file: e }) => {
460
- let n = pt(e.id, e.projectName);
461
- const [o, t] = q(""), [a, r] = q(null);
594
+ `, Ka = ({ file: e }) => {
595
+ let n = st(e.id, e.projectName);
596
+ const [o, t] = O(""), [a, r] = O(null);
462
597
  return X(() => {
463
598
  (async () => {
464
599
  try {
465
600
  const s = await fetch(n);
466
601
  if (!s.ok)
467
602
  throw new Error(`HTTP error! status: ${s.status}`);
468
- const d = await s.text();
469
- t(d);
603
+ const l = await s.text();
604
+ t(l);
470
605
  } catch (s) {
471
606
  r(s.message);
472
607
  }
473
608
  })();
474
- }, [e.projectName, e.id, n]), a ? /* @__PURE__ */ y("div", { children: [
609
+ }, [e.projectName, e.id, n]), a ? /* @__PURE__ */ b("div", { children: [
475
610
  "Error: ",
476
611
  a
477
- ] }) : e.mime?.includes("markdown") ? /* @__PURE__ */ c(ln, { remarkPlugins: [un, dn], children: o }) : /* @__PURE__ */ c(Ta, { value: o, language: e.extension, readOnly: !0 });
478
- }, vn = () => import("./VideoPlayer.es.js"), Ia = Yn(vn), Na = ({ duration: e, width: n, height: o }) => Number.isFinite(e) && e > 0 && n > 0 && o > 0, Sa = 1e4, Ea = (e) => e ? `code ${e.code}${e.message ? `: ${e.message}` : ""}` : "no MediaError", _a = (e, n) => {
479
- const [o, t] = q({ status: "loading" });
612
+ ] }) : e.mime?.includes("markdown") ? /* @__PURE__ */ c(dn, { remarkPlugins: [pn, un], children: o }) : /* @__PURE__ */ c(Ya, { value: o, language: e.extension, readOnly: !0 });
613
+ }, wn = () => import("./VideoPlayer.es.js"), Ja = Jn(wn), Xa = ({ duration: e, width: n, height: o }) => Number.isFinite(e) && e > 0 && n > 0 && o > 0, Za = 1e4, er = (e) => e ? `code ${e.code}${e.message ? `: ${e.message}` : ""}` : "no MediaError", tr = (e, n) => {
614
+ const [o, t] = O({ status: "loading" });
480
615
  return X(() => {
481
616
  t({ status: "loading" });
482
617
  let a = !1, r = null, i;
483
618
  const s = () => {
484
- r && (r.removeEventListener("loadedmetadata", d), r.removeEventListener("error", u), r.removeAttribute("src"), r.load(), r = null);
619
+ r && (r.removeEventListener("loadedmetadata", l), r.removeEventListener("error", u), r.removeAttribute("src"), r.load(), r = null);
485
620
  };
486
- function d() {
621
+ function l() {
487
622
  if (a || !r) return;
488
623
  clearTimeout(i);
489
624
  const g = {
@@ -491,14 +626,14 @@ const ha = (e) => e.replace(/\r\n?/g, `
491
626
  width: r.videoWidth,
492
627
  height: r.videoHeight
493
628
  };
494
- if (Na(g)) {
629
+ if (Xa(g)) {
495
630
  s(), t({ status: "ready", metadata: g });
496
631
  return;
497
632
  }
498
633
  m(`unusable metadata ${JSON.stringify(g)}`);
499
634
  }
500
635
  function u() {
501
- a || (clearTimeout(i), m(Ea(r?.error ?? null)));
636
+ a || (clearTimeout(i), m(er(r?.error ?? null)));
502
637
  }
503
638
  const m = (g) => {
504
639
  const f = r?.preload === "metadata";
@@ -509,7 +644,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
509
644
  console.warn(`[VideoMime] video cannot be played: ${g}`, e), t({ status: "error" });
510
645
  };
511
646
  function p(g) {
512
- r = document.createElement("video"), r.preload = g, r.muted = !0, r.playsInline = !0, i = setTimeout(() => !a && m("timed out"), Sa), r.addEventListener("loadedmetadata", d), r.addEventListener("error", u), r.src = e;
647
+ r = document.createElement("video"), r.preload = g, r.muted = !0, r.playsInline = !0, i = setTimeout(() => !a && m("timed out"), Za), r.addEventListener("loadedmetadata", l), r.addEventListener("error", u), r.src = e;
513
648
  }
514
649
  return p("metadata"), () => {
515
650
  a = !0, clearTimeout(i), s();
@@ -525,18 +660,18 @@ const ha = (e) => e.replace(/\r\n?/g, `
525
660
  codec: n?.codec
526
661
  }
527
662
  };
528
- }, Pa = ({ file: e }) => {
529
- const { id: n, projectName: o, name: t, mediaInfo: a } = e, r = pt(n, o), i = _a(r, a);
663
+ }, nr = ({ file: e }) => {
664
+ const { id: n, projectName: o, name: t, mediaInfo: a } = e, r = st(n, o), i = tr(r, a);
530
665
  if (X(() => {
531
- vn();
666
+ wn();
532
667
  }, []), i.status === "error")
533
- return /* @__PURE__ */ c(Jt, { children: /* @__PURE__ */ c(kt, { icon: "videocam_off", message: "This video cannot be played in the browser", children: /* @__PURE__ */ y("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: [
668
+ return /* @__PURE__ */ c(Xt, { children: /* @__PURE__ */ c(kt, { icon: "videocam_off", message: "This video cannot be played in the browser", children: /* @__PURE__ */ b("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: [
534
669
  "Download ",
535
670
  t
536
671
  ] }) }) });
537
- const s = /* @__PURE__ */ c(Jt, { children: /* @__PURE__ */ c(kt, { icon: "hourglass_empty", message: "Loading video..." }) });
538
- return i.status === "loading" ? s : /* @__PURE__ */ c(Qn, { fallback: s, children: /* @__PURE__ */ c(
539
- Ia,
672
+ const s = /* @__PURE__ */ c(Xt, { children: /* @__PURE__ */ c(kt, { icon: "hourglass_empty", message: "Loading video..." }) });
673
+ return i.status === "loading" ? s : /* @__PURE__ */ c(Xn, { fallback: s, children: /* @__PURE__ */ c(
674
+ Ja,
540
675
  {
541
676
  id: n,
542
677
  name: t,
@@ -549,49 +684,20 @@ const ha = (e) => e.replace(/\r\n?/g, `
549
684
  codec: i.metadata.codec
550
685
  }
551
686
  ) });
552
- }, Ra = ({ files: e, index: n, activityId: o, onNavigate: t }) => {
553
- const a = e, r = n, i = o, s = () => a[0].id != i, d = () => a[a.length - 1].id != i, u = () => r > 0 || s(), m = () => r < a.find((k) => k.id == i).files.length - 1 || d(), p = () => a[a.findIndex((k) => k.id == i) - 1], g = () => a[a.findIndex((k) => k.id == i) + 1], f = () => p().id, h = () => g().id;
554
- return {
555
- canNavigateDown: d,
556
- canNavigateUp: s,
557
- canNavigateLeft: u,
558
- canNavigateRight: m,
559
- getPreviousActivity: p,
560
- getNextActivityId: h,
561
- getByIndexActivity: (k, v) => !k === null || v == null ? { id: null, projectName: null, mime: null, extension: null } : a.find((T) => T.id == k).files[v],
562
- navigateUp: () => {
563
- t({ activityId: f(), index: 0 });
564
- },
565
- navigateDown: () => t({ activityId: h(), index: 0 }),
566
- navigateLeft: () => {
567
- if (r > 0)
568
- return t({ delta: -1 });
569
- const k = p();
570
- t({
571
- activityId: k.id,
572
- index: k.files.length - 1
573
- });
574
- },
575
- navigateRight: () => {
576
- if (r < a.find((k) => k.id == i).files.length - 1)
577
- return t({ delta: 1 });
578
- t({ activityId: h(), index: 0 });
579
- }
580
- };
581
- }, yn = {
687
+ }, or = {
582
688
  image: {
583
- component: Fa,
689
+ component: Qa,
584
690
  mimeTypes: ["image/"],
585
691
  fullPreviews: ["png", "jpg", "jpeg", "gif", "svg", "webp"],
586
692
  id: "image"
587
693
  },
588
694
  video: {
589
- component: Pa,
695
+ component: nr,
590
696
  mimeTypes: ["video/"],
591
697
  id: "video"
592
698
  },
593
699
  text: {
594
- component: Da,
700
+ component: Ka,
595
701
  mimeTypes: ["text/", "application/json", "scss", "jsx"],
596
702
  id: "text"
597
703
  },
@@ -599,106 +705,11 @@ const ha = (e) => e.replace(/\r\n?/g, `
599
705
  component: null,
600
706
  mimeTypes: ["pdf"],
601
707
  id: "pdf",
602
- callback: (e) => window.open(pt(e.id, e.projectName), "_blank")
708
+ callback: (e) => window.open(st(e.id, e.projectName), "_blank")
603
709
  }
604
- }, mt = (e = "", n = "") => Object.values(yn).some(
710
+ }, mt = (e = "", n = "") => Object.values(or).some(
605
711
  ({ mimeTypes: o = [] }) => o.some((t) => (e || n)?.includes(t))
606
- ), Ss = ({
607
- files: e,
608
- index: n,
609
- activityId: o,
610
- projectName: t,
611
- onFilePreviewClose: a,
612
- onNavigate: r
613
- }) => {
614
- const {
615
- canNavigateDown: i,
616
- canNavigateUp: s,
617
- canNavigateLeft: d,
618
- canNavigateRight: u,
619
- getByIndexActivity: m,
620
- navigateUp: p,
621
- navigateDown: g,
622
- navigateLeft: f,
623
- navigateRight: h
624
- } = Ra({ files: e, index: n, activityId: o, onNavigate: r }), C = { ...m(o, n), projectName: t }, { id: F, mime: P, extension: x, name: b } = C, k = ge(null);
625
- X(() => {
626
- F && t && k.current?.focus();
627
- }, [F, t]);
628
- const v = () => {
629
- a();
630
- }, $ = Object.values(yn).find(
631
- ({ mimeTypes: J }) => J.some((B) => (P || x)?.includes(B))
632
- ), { component: T, id: L, callback: N, fullPreviews: R } = $ || {};
633
- if (X(() => {
634
- if (!F || !t || !T || N) return;
635
- const J = {
636
- ArrowUp: [s, p],
637
- ArrowDown: [i, g],
638
- ArrowLeft: [d, f],
639
- ArrowRight: [u, h]
640
- }, B = (E) => {
641
- if (E.key === "Escape") {
642
- E.preventDefault(), E.stopPropagation(), v();
643
- return;
644
- }
645
- const ae = J[E.code];
646
- if (!ae) return;
647
- if (E.target instanceof HTMLElement) {
648
- const { tagName: re, isContentEditable: Re } = E.target;
649
- if (re === "INPUT" || re === "TEXTAREA" || Re) return;
650
- }
651
- E.preventDefault(), E.stopPropagation();
652
- const [Te, ie] = ae;
653
- Te() && ie();
654
- };
655
- return document.addEventListener("keydown", B, !0), () => document.removeEventListener("keydown", B, !0);
656
- }, [F, t, e, n, o, T, N]), !F || !t) return null;
657
- if (N)
658
- return N(C), null;
659
- const j = () => d() && f(), S = () => u() && h(), Y = L === "image", H = L === "video", oe = 50;
660
- return T ? /* @__PURE__ */ y(
661
- ka,
662
- {
663
- size: "full",
664
- isOpen: !!(F && t),
665
- onClose: v,
666
- hideCancelButton: Y,
667
- ref: k,
668
- className: K({ isImage: Y }, "block-shortcuts"),
669
- header: Y ? null : b,
670
- children: [
671
- /* @__PURE__ */ c("div", { style: { position: "absolute", inset: 0, zIndex: oe }, onClick: v }),
672
- /* @__PURE__ */ c(
673
- Z,
674
- {
675
- style: { zIndex: oe + 1 },
676
- icon: "chevron_left",
677
- className: K("navIcon", "left", { disabled: !d() }),
678
- onClick: j
679
- }
680
- ),
681
- /* @__PURE__ */ c(
682
- Ca,
683
- {
684
- style: { zIndex: oe + 1 },
685
- className: K({ scrollable: !Y && !H, fill: H }),
686
- children: /* @__PURE__ */ c(T, { file: C, fullPreviews: R })
687
- }
688
- ),
689
- /* @__PURE__ */ c(
690
- Z,
691
- {
692
- style: { zIndex: oe + 1 },
693
- icon: "chevron_right",
694
- className: K("navIcon", "right", { disabled: !u() }),
695
- onClick: S
696
- }
697
- )
698
- ]
699
- }
700
- ) : null;
701
- }, Ma = {
712
+ ), ar = {
702
713
  // special cases
703
714
  description: ["doc"],
704
715
  folder_zip: ["zip"],
@@ -740,12 +751,12 @@ const ha = (e) => e.replace(/\r\n?/g, `
740
751
  filter_none: ["sequence"],
741
752
  font_download: ["font"],
742
753
  deployed_code: ["model", ".obj", ".abc", ".stl", ".fbx", ".gltf", ".glb", ".usd"]
743
- }, $a = (e) => {
744
- for (const [n, o] of Object.entries(Ma))
754
+ }, rr = (e) => {
755
+ for (const [n, o] of Object.entries(ar))
745
756
  if (o.some((t) => e.includes(t)))
746
757
  return n;
747
758
  return "draft";
748
- }, La = ({
759
+ }, ir = ({
749
760
  name: e,
750
761
  mime: n,
751
762
  src: o,
@@ -754,7 +765,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
754
765
  size: r,
755
766
  progress: i,
756
767
  onRemove: s,
757
- isCompact: d,
768
+ isCompact: l,
758
769
  isDownloadable: u = !1,
759
770
  onExpand: m,
760
771
  disableExpand: p,
@@ -762,76 +773,76 @@ const ha = (e) => e.replace(/\r\n?/g, `
762
773
  className: f,
763
774
  ...h
764
775
  }) => {
765
- const C = i && i < 100, [F, P] = q(!1), [x, b] = q(!1), { feedAnnotationsEnabled: k } = We(), { entities: v } = Le(), $ = e.split("."), T = $.pop() || "", L = $.join("."), N = mt(n || "." + T), R = n?.includes("image/") || !!t, S = !!n?.includes("video/") && !t && o ? `${o}/thumbnail` : void 0, Y = /* @__PURE__ */ y(be, { children: [
766
- /* @__PURE__ */ c("span", { className: "size", children: ao(r) }),
767
- /* @__PURE__ */ c(Z, { icon: "download", className: "download-icon" })
768
- ] }), H = _(
776
+ const k = i && i < 100, [C, I] = O(!1), [y, v] = O(!1), { feedAnnotationsEnabled: F } = ze(), { entities: w } = $e(), R = e.split("."), N = R.pop() || "", $ = R.join("."), M = mt(n || "." + N), _ = n?.includes("image/") || !!t, E = !!n?.includes("video/") && !t && o ? `${o}/thumbnail` : void 0, K = /* @__PURE__ */ b(we, { children: [
777
+ /* @__PURE__ */ c("span", { className: "size", children: so(r) }),
778
+ /* @__PURE__ */ c(oe, { icon: "download", className: "download-icon" })
779
+ ] }), H = S(
769
780
  () => t ?? a,
770
781
  [t, a]
771
- ), oe = _(() => v.at(0), [v]), J = _(() => {
782
+ ), le = S(() => w.at(0), [w]), Z = S(() => {
772
783
  if (!H?.range)
773
784
  return [1, 1];
774
- if (!oe?.attrib)
785
+ if (!le?.attrib)
775
786
  return H?.range ?? [1, 1];
776
- const { frameStart: B } = oe?.attrib;
777
- return isNaN(B) ? H?.range ?? [1, 1] : [B - 1 + H.range[0], B - 1 + H.range[1]];
787
+ const { frameStart: W } = le?.attrib;
788
+ return isNaN(W) ? H?.range ?? [1, 1] : [W - 1 + H.range[0], W - 1 + H.range[1]];
778
789
  }, [H]);
779
- return /* @__PURE__ */ y(
780
- va,
790
+ return /* @__PURE__ */ b(
791
+ Ua,
781
792
  {
782
- className: K(f, {
783
- compact: d,
793
+ className: J(f, {
794
+ compact: l,
784
795
  isDownloadable: u,
785
- isPreviewable: N,
796
+ isPreviewable: M,
786
797
  isUnsavedAnnotation: !!t
787
798
  }),
788
799
  ...h,
789
800
  children: [
790
- /* @__PURE__ */ y(
791
- ba,
801
+ /* @__PURE__ */ b(
802
+ Ga,
792
803
  {
793
- className: K("content-wrapper", {
794
- isPreviewable: N,
804
+ className: J("content-wrapper", {
805
+ isPreviewable: M,
795
806
  isUnsavedAnnotation: !!t
796
807
  }),
797
808
  children: [
798
- /* @__PURE__ */ c(Z, { icon: $a(n || "." + T), className: "type-icon" }),
799
- R && o && /* @__PURE__ */ c(
800
- Qt,
809
+ /* @__PURE__ */ c(oe, { icon: rr(n || "." + N), className: "type-icon" }),
810
+ _ && o && /* @__PURE__ */ c(
811
+ Kt,
801
812
  {
802
- className: K({
813
+ className: J({
803
814
  "image-wrapper": !0,
804
- isDownloadable: u || N || t
815
+ isDownloadable: u || M || t
805
816
  }),
806
817
  children: /* @__PURE__ */ c(
807
818
  "img",
808
819
  {
809
820
  src: o,
810
- onError: () => P(!0),
821
+ onError: () => I(!0),
811
822
  style: {
812
- display: F ? "none" : "block"
823
+ display: C ? "none" : "block"
813
824
  }
814
825
  }
815
826
  )
816
827
  }
817
828
  ),
818
- S && /* @__PURE__ */ y(
819
- Qt,
829
+ E && /* @__PURE__ */ b(
830
+ Kt,
820
831
  {
821
- className: K({
832
+ className: J({
822
833
  "image-wrapper": !0,
823
- isDownloadable: u || N,
824
- posterError: x
834
+ isDownloadable: u || M,
835
+ posterError: y
825
836
  }),
826
837
  children: [
827
- !x && /* @__PURE__ */ c("img", { src: S, onError: () => b(!0) }),
828
- /* @__PURE__ */ c(xa, {})
838
+ !y && /* @__PURE__ */ c("img", { src: E, onError: () => v(!0) }),
839
+ /* @__PURE__ */ c(qa, {})
829
840
  ]
830
841
  }
831
842
  ),
832
- /* @__PURE__ */ y(wa, { className: "expand-buttons", children: [
833
- N && !p && /* @__PURE__ */ c(
834
- Kt,
843
+ /* @__PURE__ */ b(Ha, { className: "expand-buttons", children: [
844
+ M && !p && /* @__PURE__ */ c(
845
+ Jt,
835
846
  {
836
847
  "data-tooltip": "Open preview",
837
848
  icon: "open_in_full",
@@ -839,8 +850,8 @@ const ha = (e) => e.replace(/\r\n?/g, `
839
850
  onClick: m
840
851
  }
841
852
  ),
842
- (t || k && a) && /* @__PURE__ */ c(
843
- Kt,
853
+ (t || F && a) && /* @__PURE__ */ c(
854
+ Jt,
844
855
  {
845
856
  "data-tooltip": "Jump to annotation",
846
857
  icon: "play_circle",
@@ -852,28 +863,28 @@ const ha = (e) => e.replace(/\r\n?/g, `
852
863
  ]
853
864
  }
854
865
  ),
855
- /* @__PURE__ */ y(
856
- ya,
866
+ /* @__PURE__ */ b(
867
+ Ba,
857
868
  {
858
- className: K({
859
- inProgress: C,
860
- isPreviewable: N && !p,
869
+ className: J({
870
+ inProgress: k,
871
+ isPreviewable: M && !p,
861
872
  isDownloadable: u
862
873
  }),
863
874
  children: [
864
875
  /* @__PURE__ */ c("span", { className: "progress", style: { right: `${100 - i}%` } }),
865
- /* @__PURE__ */ c("div", { className: "name-wrapper", children: H ? /* @__PURE__ */ y("span", { className: "name", children: [
866
- /* @__PURE__ */ c(Z, { icon: "draw" }),
867
- J[0],
868
- J[1] !== J[0] && ` - ${J[1]}`
869
- ] }) : /* @__PURE__ */ y("span", { className: "name", children: [
870
- L,
871
- /* @__PURE__ */ y("span", { className: "extension", children: [
876
+ /* @__PURE__ */ c("div", { className: "name-wrapper", children: H ? /* @__PURE__ */ b("span", { className: "name", children: [
877
+ /* @__PURE__ */ c(oe, { icon: "draw" }),
878
+ Z[0],
879
+ Z[1] !== Z[0] && ` - ${Z[1]}`
880
+ ] }) : /* @__PURE__ */ b("span", { className: "name", children: [
881
+ $,
882
+ /* @__PURE__ */ b("span", { className: "extension", children: [
872
883
  ".",
873
- T
884
+ N
874
885
  ] })
875
886
  ] }) }),
876
- u && (s ? /* @__PURE__ */ c("div", { className: "download", children: Y }) : /* @__PURE__ */ c("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "download", children: Y }))
887
+ u && (s ? /* @__PURE__ */ c("div", { className: "download", children: K }) : /* @__PURE__ */ c("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "download", children: K }))
877
888
  ]
878
889
  }
879
890
  ),
@@ -881,7 +892,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
881
892
  ]
882
893
  }
883
894
  );
884
- }, bn = ({
895
+ }, xn = ({
885
896
  files: e = [],
886
897
  activityId: n,
887
898
  isCompact: o,
@@ -890,26 +901,26 @@ const ha = (e) => e.replace(/\r\n?/g, `
890
901
  projectName: r,
891
902
  isDownloadable: i,
892
903
  onExpand: s,
893
- onAnnotationClick: d,
904
+ onAnnotationClick: l,
894
905
  pt: u,
895
906
  ...m
896
907
  }) => {
897
908
  if (!e.length) return null;
898
- const p = He(
909
+ const p = qe(
899
910
  (g) => {
900
- const f = e.filter((C) => mt(C.mime, C.ext)), h = f.findIndex((C) => C.id === e[g].id);
911
+ const f = e.filter((k) => mt(k.mime, k.ext)), h = f.findIndex((k) => k.id === e[g].id);
901
912
  s?.({ files: f, index: h, activityId: n || "" });
902
913
  },
903
914
  [s]
904
915
  );
905
- return /* @__PURE__ */ c(fa, { className: K({ compact: o }), ...m, children: e.map((g, f) => /* @__PURE__ */ c(
906
- La,
916
+ return /* @__PURE__ */ c(za, { className: J({ compact: o }), ...m, children: e.map((g, f) => /* @__PURE__ */ c(
917
+ ir,
907
918
  {
908
919
  id: g.id || g.name,
909
920
  name: g.name,
910
921
  mime: g.mime || g.type,
911
922
  size: g.size,
912
- src: g.unsavedAnnotation ? g.thumbnail : `/api/projects/${r}/files/${g.id}`,
923
+ src: g.unsavedAnnotation ? g.thumbnail : g.id ? st(g.id, r) : void 0,
913
924
  unsavedAnnotation: g.unsavedAnnotation,
914
925
  savedAnnotation: g.annotation,
915
926
  progress: g.progress,
@@ -917,13 +928,13 @@ const ha = (e) => e.replace(/\r\n?/g, `
917
928
  isCompact: o,
918
929
  isDownloadable: i,
919
930
  onExpand: () => p(f),
920
- onJumpTo: () => d?.(g),
931
+ onJumpTo: () => l?.(g),
921
932
  disableExpand: t,
922
933
  ...u?.file
923
934
  },
924
935
  g.id || g.name
925
936
  )) });
926
- }, Oa = (e) => {
937
+ }, sr = (e) => {
927
938
  const n = /!\[.*?\]\((.*?)\)/g, o = e.match(n);
928
939
  let t = e;
929
940
  return o && o.forEach((a) => {
@@ -931,44 +942,44 @@ const ha = (e) => e.replace(/\r\n?/g, `
931
942
  const r = a.match(/\(([^)]+)\)/)[1], i = r.split("?")[0];
932
943
  t = e.replace(r, i);
933
944
  }), t;
934
- }, Va = new AbortController(), za = St.CancelToken, Ua = za.source(), qe = (e, n, o) => new Promise((t, a) => {
945
+ }, cr = new AbortController(), lr = It.CancelToken, dr = lr.source(), We = (e, n, o) => new Promise((t, a) => {
935
946
  new FormData().append("image", e);
936
947
  const i = {
937
- signal: Va.signal,
938
- cancelToken: Ua.token,
948
+ signal: cr.signal,
949
+ cancelToken: dr.token,
939
950
  onUploadProgress: (s) => o && o(s, e),
940
951
  headers: {
941
952
  "Content-Type": e.type,
942
953
  "x-file-name": pe(e.name)
943
954
  }
944
955
  };
945
- St.post(`/api/projects/${n}/files`, e, i).then((s) => {
956
+ It.post(`/api/projects/${n}/files`, e, i).then((s) => {
946
957
  t({ file: e, data: s.data });
947
958
  }).catch((s) => {
948
959
  console.error(s), a({ message: "Upload failed: " + s.response.data.detail });
949
960
  });
950
- }), Ba = (e, n, o, t, a) => {
961
+ }), ur = (e, n, o, t, a) => {
951
962
  e.preventDefault(), e.stopPropagation();
952
963
  let r = e.dataTransfer.files;
953
964
  if (r?.length) {
954
965
  if (r.length === 0) return;
955
966
  for (const i of r)
956
- qe(i, n, o).then(
967
+ We(i, n, o).then(
957
968
  (s) => t(s),
958
969
  (s) => {
959
- a && a(i), ye.error(s.message), console.warn(s);
970
+ a && a(i), be.error(s.message), console.warn(s);
960
971
  }
961
972
  );
962
973
  }
963
- }, ja = (e, n, o) => (n || console.warn("filterEntityAnnotations: entityId is empty"), Object.values(e).forEach((t) => {
974
+ }, pr = (e, n, o) => (n || console.warn("filterEntityAnnotations: entityId is empty"), Object.values(e).forEach((t) => {
964
975
  t.versionId || console.warn("filterEntityAnnotations: annotation.versionId is empty", t);
965
976
  }), Object.values(e).filter(
966
977
  (t) => t.versionId === n && !o.some((a) => a.name === pe(t.name))
967
978
  ).map((t) => ({
968
979
  ...t,
969
980
  unsavedAnnotation: t
970
- }))), Ga = ({ entityId: e, filesUploading: n }) => {
971
- const { editingId: o, setEditingId: t, annotations: a, removeAnnotation: r } = Le(), { onGoToFrame: i } = We(), s = ja(a || [], e, n);
981
+ }))), mr = ({ entityId: e, filesUploading: n }) => {
982
+ const { editingId: o, setEditingId: t, annotations: a, removeAnnotation: r } = $e(), { onGoToFrame: i } = ze(), s = pr(a || [], e, n);
972
983
  return X(() => {
973
984
  s.length > 0 && !o && t(ot);
974
985
  }, [s]), {
@@ -979,29 +990,29 @@ const ha = (e) => e.replace(/\r\n?/g, `
979
990
  },
980
991
  removeAnnotation: r
981
992
  };
982
- }, wn = (e) => _(() => {
993
+ }, kn = (e) => S(() => {
983
994
  if (!e)
984
995
  return { primary: void 0, secondary: void 0 };
985
- const n = getComputedStyle(document.documentElement), o = n.getPropertyValue("--md-sys-color-surface-container").trim(), t = n.getPropertyValue("--md-sys-color-surface-container-high").trim(), a = o || e, r = t || e, i = qt(e, a, 0.1) || e, s = qt(e, r, 0.2) || e;
996
+ const n = getComputedStyle(document.documentElement), o = n.getPropertyValue("--md-sys-color-surface-container").trim(), t = n.getPropertyValue("--md-sys-color-surface-container-high").trim(), a = o || e, r = t || e, i = Wt(e, a, 0.1) || e, s = Wt(e, r, 0.2) || e;
986
997
  return {
987
998
  primary: i,
988
999
  secondary: s
989
1000
  };
990
- }, [e]), Ha = ({ projectName: e, onSuccess: n, onProgress: o, onStart: t, onError: a }) => {
991
- const { removeAnnotation: r, exportAnnotationComposite: i } = Le(), s = async (u) => {
1001
+ }, [e]), gr = ({ projectName: e, onSuccess: n, onProgress: o, onStart: t, onError: a }) => {
1002
+ const { removeAnnotation: r, exportAnnotationComposite: i } = $e(), s = async (u) => {
992
1003
  const m = await i?.(u.id);
993
1004
  if (!m)
994
1005
  throw new Error(`Exporting composite image for annotation ${u.id} failed`);
995
1006
  const p = new File([m], u.name, {
996
1007
  type: "image/png"
997
- }), g = await fetch(u.annotationData).then((x) => x.blob()), f = new File([g], `annotation-${u.name}`, {
1008
+ }), g = await fetch(u.annotationData).then((y) => y.blob()), f = new File([g], `annotation-${u.name}`, {
998
1009
  type: "image/png"
999
1010
  }), h = await Promise.all([
1000
- qe(p, e, o),
1001
- qe(f, e, () => {
1011
+ We(p, e, o),
1012
+ We(f, e, () => {
1002
1013
  })
1003
- ]), [C, F] = h, P = [n(C), n(F, !0)];
1004
- return r?.(u.id), { annotation: u, uploads: h, files: P };
1014
+ ]), [k, C] = h, I = [n(k), n(C, !0)];
1015
+ return r?.(u.id), { annotation: u, uploads: h, files: I };
1005
1016
  };
1006
1017
  return async (u) => {
1007
1018
  try {
@@ -1009,27 +1020,27 @@ const ha = (e) => e.replace(/\r\n?/g, `
1009
1020
  t?.(h);
1010
1021
  try {
1011
1022
  return await s(h);
1012
- } catch (C) {
1013
- throw a?.(h), C;
1023
+ } catch (k) {
1024
+ throw a?.(h), k;
1014
1025
  }
1015
1026
  }), p = await Promise.allSettled(m), g = [], f = [];
1016
1027
  return p.forEach((h) => {
1017
1028
  if (h.status === "fulfilled") {
1018
- const { uploads: C, annotation: F, files: P } = h.value;
1019
- g.push(...P), f.push({
1020
- range: F.range,
1021
- id: F.id,
1022
- composite: C[0].data.id,
1023
- transparent: C[1].data.id
1029
+ const { uploads: k, annotation: C, files: I } = h.value;
1030
+ g.push(...I), f.push({
1031
+ range: C.range,
1032
+ id: C.id,
1033
+ composite: k[0].data.id,
1034
+ transparent: k[1].data.id
1024
1035
  });
1025
1036
  } else
1026
- ye.error("Upload failed: " + h.reason.message);
1037
+ be.error("Upload failed: " + h.reason.message);
1027
1038
  }), { files: g, metadata: f };
1028
1039
  } catch (m) {
1029
- return ye.error("Upload failed: " + m.message), { files: [], metadata: [] };
1040
+ return be.error("Upload failed: " + m.message), { files: [], metadata: [] };
1030
1041
  }
1031
1042
  };
1032
- }, qa = "Category", Wa = A.div`
1043
+ }, hr = "Category", fr = A.div`
1033
1044
  display: flex;
1034
1045
  padding: 2px 4px;
1035
1046
  justify-content: center;
@@ -1055,7 +1066,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
1055
1066
 
1056
1067
  &.compact {
1057
1068
  padding: 1px 2px;
1058
- ${ro.labelMedium}
1069
+ ${mn.labelMedium}
1059
1070
  }
1060
1071
 
1061
1072
  &.editing {
@@ -1078,13 +1089,13 @@ const ha = (e) => e.replace(/\r\n?/g, `
1078
1089
  color: var(--md-sys-color-tertiary);
1079
1090
  }
1080
1091
  }
1081
- `, at = ut(
1082
- ({ value: e, color: n, isCompact: o, isEditing: t, isPower: a, isDisabled: r, style: i, className: s, ...d }, u) => /* @__PURE__ */ c(
1083
- Wa,
1092
+ `, at = pt(
1093
+ ({ value: e, color: n, isCompact: o, isEditing: t, isPower: a, isDisabled: r, style: i, className: s, ...l }, u) => /* @__PURE__ */ c(
1094
+ fr,
1084
1095
  {
1085
- ...d,
1096
+ ...l,
1086
1097
  ref: u,
1087
- className: K(s, {
1098
+ className: J(s, {
1088
1099
  none: !e,
1089
1100
  compact: o,
1090
1101
  editing: t,
@@ -1099,10 +1110,10 @@ const ha = (e) => e.replace(/\r\n?/g, `
1099
1110
  color: Tt(n)
1100
1111
  }
1101
1112
  },
1102
- children: e || qa
1113
+ children: e || hr
1103
1114
  }
1104
1115
  )
1105
- ), Ya = A.span`
1116
+ ), yr = A.span`
1106
1117
  display: flex;
1107
1118
  justify-content: flex-start;
1108
1119
  align-items: center;
@@ -1121,7 +1132,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
1121
1132
  color: var(--md-sys-color-on-surface) !important;
1122
1133
  }
1123
1134
  }
1124
- `, Qa = ut(
1135
+ `, vr = pt(
1125
1136
  ({
1126
1137
  label: e,
1127
1138
  color: n,
@@ -1131,19 +1142,19 @@ const ha = (e) => e.replace(/\r\n?/g, `
1131
1142
  endContent: r,
1132
1143
  isClear: i,
1133
1144
  style: s,
1134
- className: d,
1145
+ className: l,
1135
1146
  ...u
1136
- }, m) => /* @__PURE__ */ y(
1137
- Ya,
1147
+ }, m) => /* @__PURE__ */ b(
1148
+ yr,
1138
1149
  {
1139
1150
  ...u,
1140
- className: K(d, { selected: t }),
1151
+ className: J(l, { selected: t }),
1141
1152
  style: { backgroundColor: t && n ? n : "", color: Tt(t && n ? n : ""), ...s },
1142
1153
  ref: m,
1143
1154
  children: [
1144
1155
  a,
1145
1156
  /* @__PURE__ */ c(
1146
- Z,
1157
+ oe,
1147
1158
  {
1148
1159
  icon: o || (i ? "clear" : "crop_square"),
1149
1160
  style: { color: n || "" }
@@ -1154,7 +1165,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
1154
1165
  ]
1155
1166
  }
1156
1167
  )
1157
- ), Ka = (e, { isGuest: n, isAdmin: o }) => !!(n || !e.length && !o), Ja = "1.3.0", Xa = A(io)`
1168
+ ), br = "1.3.0", wr = A(co)`
1158
1169
  button {
1159
1170
  /* remove all styles and just use a wrapper */
1160
1171
  background-color: unset !important;
@@ -1165,7 +1176,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
1165
1176
  width: unset !important;
1166
1177
  color: var(--md-sys-color-on-surface) !important;
1167
1178
  }
1168
- `, Za = ({
1179
+ `, xr = ({
1169
1180
  value: e,
1170
1181
  categories: n,
1171
1182
  readonly: o,
@@ -1174,7 +1185,7 @@ const ha = (e) => e.replace(/\r\n?/g, `
1174
1185
  hasPowerpack: r,
1175
1186
  onPowerFeature: i,
1176
1187
  onChange: s,
1177
- ...d
1188
+ ...l
1178
1189
  }) => {
1179
1190
  if (t) return null;
1180
1191
  const u = n.find((g) => g.name === e), { color: m } = u || {};
@@ -1185,13 +1196,13 @@ const ha = (e) => e.replace(/\r\n?/g, `
1185
1196
  value: null,
1186
1197
  isPower: !0,
1187
1198
  isDisabled: !0,
1188
- style: d.style,
1199
+ style: l.style,
1189
1200
  onClick: () => i?.("commentCategories"),
1190
1201
  "data-tooltip": "Comment categories is a Powerpack feature"
1191
1202
  }
1192
1203
  );
1193
1204
  if (o)
1194
- return /* @__PURE__ */ c(at, { value: e, color: m, isCompact: a, style: d.style });
1205
+ return /* @__PURE__ */ c(at, { value: e, color: m, isCompact: a, style: l.style });
1195
1206
  if (!n.length)
1196
1207
  return /* @__PURE__ */ c(
1197
1208
  at,
@@ -1199,9 +1210,9 @@ const ha = (e) => e.replace(/\r\n?/g, `
1199
1210
  value: e,
1200
1211
  color: m,
1201
1212
  isCompact: a,
1202
- style: d.style,
1203
- onClick: () => ye.warning(
1204
- `No categories found. Ensure they are set in the Powerpack settings and the version is at least ${Ja}.`
1213
+ style: l.style,
1214
+ onClick: () => be.warning(
1215
+ `No categories found. Ensure they are set in the Powerpack settings and the version is at least ${br}.`
1205
1216
  )
1206
1217
  }
1207
1218
  );
@@ -1215,196 +1226,127 @@ const ha = (e) => e.replace(/\r\n?/g, `
1215
1226
  }))
1216
1227
  ];
1217
1228
  return /* @__PURE__ */ c(
1218
- Xa,
1229
+ wr,
1219
1230
  {
1220
1231
  options: p,
1221
1232
  value: e ? [e] : [],
1222
1233
  onChange: (g) => s(g[0]),
1223
1234
  valueTemplate: () => /* @__PURE__ */ c(at, { value: e, color: m, isCompact: a, isEditing: !0 }),
1224
- itemTemplate: (g, f, h, C) => /* @__PURE__ */ c(
1225
- Qa,
1235
+ itemTemplate: (g, f, h, k) => /* @__PURE__ */ c(
1236
+ vr,
1226
1237
  {
1227
1238
  label: g.label,
1228
1239
  color: g.color,
1229
1240
  isSelected: h,
1230
1241
  isClear: g.value === null
1231
1242
  },
1232
- C
1243
+ k
1233
1244
  ),
1234
- ...d
1245
+ ...l
1235
1246
  }
1236
1247
  );
1237
- }, er = A.li`
1238
- list-style: none;
1239
- margin: var(--padding-s) var(--padding-m);
1240
- padding: var(--padding-s) var(--padding-m) var(--padding-s) 0;
1241
-
1242
- display: flex;
1243
- gap: var(--base-gap-small);
1244
-
1245
- border: solid 1px currentColor;
1246
- border-radius: var(--border-radius-l);
1248
+ }, kr = (e, { isGuest: n, isAdmin: o }) => !!(n || !e.length && !o), An = 1e4, Ar = A.span`
1249
+ margin-left: auto;
1250
+ color: var(--md-sys-color-outline);
1247
1251
  user-select: none;
1248
-
1249
- .date, .user-image {
1250
- flex-shrink: 0;
1251
- }
1252
-
1253
- &.approve,
1254
- &.approve .icon,
1255
- &.approve .date, {
1256
- color: var(--md-sys-color-tertiary);
1257
- }
1258
-
1259
- &.request_changes,
1260
- &.request_changes .icon,
1261
- &.request_changes .date, {
1262
- color: var(--md-sys-color-error);
1263
- }
1264
- `, tr = A.div`
1252
+ white-space: nowrap;
1265
1253
  display: flex;
1266
- flex-wrap: nowrap;
1267
1254
  align-items: center;
1268
- flex: 1;
1269
- gap: var(--base-gap-medium);
1270
- padding: 0px 4px;
1271
1255
  overflow: hidden;
1272
- width: 100%;
1273
-
1274
- .icon {
1275
- font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 300, 'opsz' 20;
1276
- font-size: 16px;
1277
- }
1278
-
1279
- [icon='trending_flat'] {
1280
- color: var(--md-sys-color-outline);
1281
- opacity: 0.5;
1282
- }
1283
- `, nr = A.span`
1284
- white-space: nowrap;
1285
- font-size: 12px;
1286
1256
  text-overflow: ellipsis;
1287
- flex-shrink: 1;
1288
- overflow: hidden;
1257
+ flex-shrink: 3;
1258
+ min-width: 0;
1259
+ max-width: fit-content;
1289
1260
 
1290
- strong {
1291
- font-size: 12px;
1292
- font-weight: 800;
1293
- }
1294
- `;
1295
- var Fe = /* @__PURE__ */ ((e) => (e.APPROVE = "approve", e.REQUEST_CHANGES = "request_changes", e))(Fe || {});
1296
- const or = "#c5c5c5";
1297
- function xn(e) {
1298
- const { categories: n } = Le(), { categoryData: o, categoryNotFound: t } = _(() => {
1299
- let a = !1;
1300
- if (e) {
1301
- const r = n.find((i) => i.name === e);
1302
- return r || (a = !0), {
1303
- categoryData: r || {
1304
- name: e,
1305
- color: or
1306
- },
1307
- categoryNotFound: a
1308
- };
1309
- } else
1310
- return {
1311
- categoryData: null,
1312
- categoryNotFound: a
1313
- };
1314
- }, [e, n]);
1315
- return { categoryData: o, categoryNotFound: t };
1316
- }
1317
- const ar = "anonymous.guest", rr = "Anonymous User", ir = "unknown.user", kn = (e) => !e || !e.name ? ir : e.name === ar && !e.label ? rr : e.label ? e.label : e.name, At = "anonymous.guest", An = (e) => {
1261
+ ${mn.bodySmall}
1262
+ `, ct = ({ date: e, isExact: n, exactTooltip: o = !1, ...t }) => {
1263
+ const [a, r] = O(!0), [i, s] = O(/* @__PURE__ */ new Date());
1264
+ if (!e) return null;
1265
+ const l = new Date(e);
1266
+ if (!it(l)) return null;
1267
+ X(() => {
1268
+ const F = setInterval(
1269
+ () => s(/* @__PURE__ */ new Date()),
1270
+ An
1271
+ );
1272
+ return () => clearInterval(F);
1273
+ }, []);
1274
+ const u = Aa(l), m = Fa(l, i), p = Ca(l, new Date(i.setDate(i.getDate() - 1))), g = Ta(l, i), f = Da(l, i), h = p ? "" : m ? g ? "E" : "MMM d" : "MMM d yyyy", k = "h:mm a", C = S(() => fn(l), [l]), I = S(() => u ? Qt(l, `${h}, ${k}`) : Qt(l, `EEEE, dd MMM yyyy ${k}`), [l, u]);
1275
+ let y = a && !n ? C : I;
1276
+ p && a && !n && (y = `Yesterday${y}`), f && (y = "Just now");
1277
+ const v = () => {
1278
+ r(!a);
1279
+ };
1280
+ return /* @__PURE__ */ c(
1281
+ Ar,
1282
+ {
1283
+ className: J("date"),
1284
+ ...t,
1285
+ onClick: v,
1286
+ onMouseOver: () => !o && r(!1),
1287
+ onMouseOut: () => !o && r(!0),
1288
+ "data-tooltip": o ? I : null,
1289
+ "data-tooltip-delay": 0,
1290
+ children: y
1291
+ }
1292
+ );
1293
+ };
1294
+ var Te = /* @__PURE__ */ ((e) => (e.APPROVE = "approve", e.REQUEST_CHANGES = "request_changes", e))(Te || {});
1295
+ const Fn = (e) => {
1318
1296
  switch (e) {
1319
- case Fe.REQUEST_CHANGES:
1297
+ case Te.REQUEST_CHANGES:
1320
1298
  return "requested changes";
1321
- case Fe.APPROVE:
1299
+ case Te.APPROVE:
1322
1300
  default:
1323
1301
  return "approved this";
1324
1302
  }
1325
- }, sr = (e, n) => {
1303
+ }, Fr = (e, n) => {
1326
1304
  switch (e) {
1327
- case Fe.REQUEST_CHANGES:
1305
+ case Te.REQUEST_CHANGES:
1328
1306
  return "Requested changes on " + n;
1329
- case Fe.APPROVE:
1307
+ case Te.APPROVE:
1330
1308
  default:
1331
1309
  return "Approved " + n;
1332
1310
  }
1333
1311
  }, Cn = (e) => {
1334
1312
  switch (e) {
1335
- case Fe.REQUEST_CHANGES:
1313
+ case Te.REQUEST_CHANGES:
1336
1314
  return "refresh";
1337
- case Fe.APPROVE:
1315
+ case Te.APPROVE:
1338
1316
  default:
1339
1317
  return "task_alt";
1340
1318
  }
1341
- }, cr = ({ isGuest: e, activity: n }) => {
1342
- const { authorName: o, authorFullName: t, createdAt: a, activityData: r } = n || {}, i = _(
1343
- () => [
1344
- kn({ name: o, label: t }),
1345
- An(r?.feedback ?? Fe.APPROVE)
1346
- ].join(" "),
1347
- [t, o, r?.feedback, a]
1348
- ), { categoryData: s, categoryNotFound: d } = xn(r?.category), u = _(() => {
1349
- if (!o?.startsWith(At))
1350
- return `/api/users/${o}/avatar`;
1351
- }, [o]);
1352
- if (r?.feedback)
1353
- return /* @__PURE__ */ c(er, { className: cn(r.feedback), children: /* @__PURE__ */ y(tr, { children: [
1354
- o && /* @__PURE__ */ c(
1355
- pn,
1356
- {
1357
- name: o,
1358
- fullName: t,
1359
- src: u,
1360
- size: 22
1361
- }
1362
- ),
1363
- /* @__PURE__ */ c(Z, { icon: Cn(r.feedback) }),
1364
- s && !e && /* @__PURE__ */ c(
1365
- at,
1366
- {
1367
- value: s.name,
1368
- color: s.color,
1369
- isCompact: !0,
1370
- "data-tooltip": d ? "Category not found. It may have been deleted." : void 0,
1371
- "data-tooltip-delay": 0
1372
- }
1373
- ),
1374
- /* @__PURE__ */ c(nr, { children: i }),
1375
- /* @__PURE__ */ c(it, { date: a, exactTooltip: !0 })
1376
- ] }) });
1377
- }, lr = ({ lastOwnVersionReview: e }) => {
1378
- const [n, o] = q(/* @__PURE__ */ new Date());
1319
+ }, Cr = ({ lastOwnVersionReview: e }) => {
1320
+ const [n, o] = O(/* @__PURE__ */ new Date());
1379
1321
  X(() => {
1380
- const r = setInterval(() => o(/* @__PURE__ */ new Date()), po);
1322
+ const r = setInterval(() => o(/* @__PURE__ */ new Date()), An);
1381
1323
  return () => clearInterval(r);
1382
1324
  }, []);
1383
- const t = _(() => e?.activityData?.feedback, [e]), a = _(() => e?.createdAt ? mo(new Date(e?.createdAt)).toLowerCase() : "", [e?.createdAt, n]);
1384
- return /* @__PURE__ */ y(go, { className: cn(t), children: [
1385
- /* @__PURE__ */ c(Z, { icon: Cn(t) }),
1325
+ const t = S(() => e?.activityData?.feedback, [e]), a = S(() => e?.createdAt ? fn(new Date(e?.createdAt)).toLowerCase() : "", [e?.createdAt, n]);
1326
+ return /* @__PURE__ */ b(yo, { className: ln(t), children: [
1327
+ /* @__PURE__ */ c(oe, { icon: Cn(t) }),
1386
1328
  "You last ",
1387
- An(t),
1329
+ Fn(t),
1388
1330
  " ",
1389
1331
  a,
1390
1332
  " ",
1391
1333
  a === "just now" ? "" : "ago"
1392
1334
  ] });
1393
- }, Xt = (e) => {
1335
+ }, Zt = (e) => {
1394
1336
  const n = /^(\d+)(?:\s*-\s*(\d+))?$/.exec(e.trim());
1395
1337
  if (!n) return null;
1396
1338
  const o = Number(n[1]), t = n[2] ? Number(n[2]) : o;
1397
1339
  return Number.isSafeInteger(o) && o > 0 && Number.isSafeInteger(t) && t >= o ? { startFrame: o, endFrame: t } : null;
1398
- }, Zt = async (e, n, o, t, a) => {
1399
- const { data: r } = await St.get(`/api/projects/${e}/files/${n}`, {
1340
+ }, en = async (e, n, o, t, a) => {
1341
+ const { data: r } = await It.get(`/api/projects/${e}/files/${n}`, {
1400
1342
  responseType: "blob"
1401
1343
  }), i = new File([r], o, { type: t || r.type });
1402
- return qe(i, e, a);
1403
- }, en = (e, n) => `/api/projects/${e}/files/${n}`, tn = (e, n) => !!e && Dt(n).has(e), dr = [
1344
+ return We(i, e, a);
1345
+ }, tn = (e, n) => `/api/projects/${e}/files/${n}`, nn = (e, n) => !!e && Dt(n).has(e), Tr = [
1404
1346
  { trigger: "@", icon: "person", tooltip: "Mention user" },
1405
1347
  { trigger: "@@", icon: "layers", tooltip: "Mention version" },
1406
1348
  { trigger: "@@@", icon: "check_circle", tooltip: "Mention task" }
1407
- ], Fn = ({
1349
+ ], Tn = ({
1408
1350
  initValue: e,
1409
1351
  initFiles: n = [],
1410
1352
  initCategory: o = null,
@@ -1413,323 +1355,328 @@ const ar = "anonymous.guest", rr = "Anonymous User", ir = "unknown.user", kn = (
1413
1355
  versionReview: r,
1414
1356
  lastOwnVersionReview: i,
1415
1357
  onSubmit: s,
1416
- onReview: d,
1358
+ onReview: l,
1417
1359
  duplicate: u,
1418
1360
  onDuplicateHandled: m,
1419
1361
  isEditing: p,
1420
1362
  disabled: g,
1421
1363
  isLoading: f,
1422
1364
  isOpen: h,
1423
- onOpen: C,
1424
- onClose: F
1365
+ onOpen: k,
1366
+ onClose: C
1425
1367
  }) => {
1426
1368
  const {
1427
- projectName: P,
1428
- entities: x,
1429
- projectInfo: b,
1430
- feedFilter: k,
1431
- mentionSuggestionsData: v,
1432
- categories: $,
1433
- isGuest: T
1434
- } = Le(), { hasLicense: L, onPowerFeature: N, user: R, openSlideOut: j, commentFrameLink: S } = We(), Y = R?.data?.isAdmin, H = aa(), [, oe] = hn(), [J, B] = q(e || ""), [E, ae] = q(
1369
+ projectName: I,
1370
+ entities: y,
1371
+ projectInfo: v,
1372
+ feedFilter: F,
1373
+ mentionSuggestionsData: w,
1374
+ categories: R,
1375
+ isGuest: N
1376
+ } = $e(), { hasLicense: $, onPowerFeature: M, user: _, openSlideOut: B, commentFrameLink: E } = ze(), K = _?.data?.isAdmin, H = xa(), [, le] = vn(), [Z, W] = O(e || ""), [j, ae] = O(
1435
1377
  () => n.map(
1436
- (l) => tn(l.id, e || "") ? { ...l, isInline: !0 } : l
1378
+ (d) => nn(d.id, e || "") ? { ...d, isInline: !0 } : d
1437
1379
  )
1438
- ), [Te, ie] = q(0), re = ge(/* @__PURE__ */ new Map()), [Re, he] = q([]), [we, se] = q(!1), [xe, le] = q(!1), [De, Ie] = q([]), { annotations: Ne, removeAnnotation: Oe, goToAnnotation: Be } = Ga({
1439
- entityId: x[0]?.id,
1440
- filesUploading: Re
1441
- }), te = x.length === 1 && x[0].entityType === "version" ? x[0] : void 0, Ye = S?.draft && S.draft.entityId === te?.id ? S.draft : null, [Se, Qe] = q(
1380
+ ), [q, re] = O(0), me = ve(/* @__PURE__ */ new Map()), [Ue, he] = O([]), [xe, ie] = O(!1), [ke, de] = O(!1), [De, Ne] = O([]), { annotations: Se, removeAnnotation: Le, goToAnnotation: Be } = mr({
1381
+ entityId: y[0]?.id,
1382
+ filesUploading: Ue
1383
+ }), te = y.length === 1 && y[0].entityType === "version" ? y[0] : void 0, Qe = E?.draft && E.draft.entityId === te?.id ? E.draft : null, [Ie, Ye] = O(
1442
1384
  () => p && Number.isSafeInteger(t?.startFrame) && t.startFrame > 0 ? {
1443
1385
  startFrame: t.startFrame,
1444
1386
  endFrame: Number.isSafeInteger(t.endFrame) && t.endFrame >= t.startFrame ? t.endFrame : t.startFrame
1445
1387
  } : null
1446
- ), Ee = (l) => Qe(l && { ...l, entityId: te?.id }), Ve = p || Se?.entityId === te?.id ? Se : null, [fe, _e] = q(!1), W = p ? Ve : Ve ?? Ye, Me = p ? !!te || !!Ve : !!S && !!te, ze = S?.formatFrame ?? String, ce = W ? W.endFrame > W.startFrame ? `${ze(W.startFrame)}-${ze(W.endFrame)}` : ze(W.startFrame) : void 0, [I, M] = q(ce ?? ""), V = ge(!1), Q = ge(null), ee = (l) => {
1388
+ ), Ee = (d) => Ye(d && { ...d, entityId: te?.id }), Oe = p || Ie?.entityId === te?.id ? Ie : null, [fe, Me] = O(!1), Q = p ? Oe : Oe ?? Qe, Pe = p ? !!te || !!Oe : !!E && !!te, je = E?.formatFrame ?? String, se = Q ? Q.endFrame > Q.startFrame ? `${je(Q.startFrame)}-${je(Q.endFrame)}` : je(Q.startFrame) : void 0, [D, P] = O(se ?? ""), V = ve(!1), Y = ve(null), ee = (d) => {
1447
1389
  if (!te) return;
1448
- const w = l ? { ...l, entityId: te.id } : null;
1390
+ const x = d ? { ...d, entityId: te.id } : null;
1449
1391
  if (!p) {
1450
- S?.setDraft(w);
1392
+ E?.setDraft(x);
1451
1393
  return;
1452
1394
  }
1453
- a && S?.setEditPreview({
1395
+ a && E?.setEditPreview({
1454
1396
  activityId: a,
1455
- link: w
1397
+ link: x
1456
1398
  });
1457
- }, Ke = (l) => {
1458
- M(l);
1459
- const w = Xt(l);
1460
- w && ee(w);
1399
+ }, Ke = (d) => {
1400
+ P(d);
1401
+ const x = Zt(d);
1402
+ x && ee(x);
1461
1403
  };
1462
1404
  X(() => {
1463
- fe || M(ce ?? "");
1464
- }, [ce, fe]), X(
1405
+ fe || P(se ?? "");
1406
+ }, [se, fe]), X(
1465
1407
  () => () => {
1466
- p && S?.setEditPreview(null);
1408
+ p && E?.setEditPreview(null);
1467
1409
  },
1468
- [p, S?.setEditPreview]
1410
+ [p, E?.setEditPreview]
1469
1411
  );
1470
- const D = () => {
1412
+ const T = () => {
1471
1413
  if (V.current) {
1472
- V.current = !1, M(ce ?? ""), ee(Q.current), _e(!1);
1414
+ V.current = !1, P(se ?? ""), ee(Y.current), Me(!1);
1473
1415
  return;
1474
1416
  }
1475
- const l = Xt(I);
1476
- l ? (Ee(l), ee(l)) : (M(ce ?? ""), ee(Q.current)), _e(!1);
1477
- }, ve = () => {
1478
- Ee(null), p ? ee(null) : S?.unlink();
1479
- }, ke = () => {
1480
- !p && S && te ? S.link(te.id) : (M(""), _e(!0));
1481
- }, Je = () => W ? ve() : ke(), Pe = _(() => {
1482
- if (!Me || !p && !S || !te) return;
1483
- const l = ["frame", "time", "timecode", "link", "range"];
1417
+ const d = Zt(D);
1418
+ d ? (Ee(d), ee(d)) : (P(se ?? ""), ee(Y.current)), Me(!1);
1419
+ }, ye = () => {
1420
+ Ee(null), p ? ee(null) : E?.unlink();
1421
+ }, Ae = () => {
1422
+ !p && E && te ? E.link(te.id) : (P(""), Me(!0));
1423
+ }, Je = () => Q ? ye() : Ae(), _e = S(() => {
1424
+ if (!Pe || !p && !E || !te) return;
1425
+ const d = ["frame", "time", "timecode", "link", "range"];
1484
1426
  return [
1485
- W ? {
1427
+ Q ? {
1486
1428
  id: "frame-link",
1487
1429
  label: "Remove frame link",
1488
1430
  icon: "timer_off",
1489
- keywords: [...l, "unlink", "remove"],
1490
- hint: ce,
1491
- run: ve
1431
+ keywords: [...d, "unlink", "remove"],
1432
+ hint: se,
1433
+ run: ye
1492
1434
  } : {
1493
1435
  id: "frame-link",
1494
1436
  label: p ? "Add frame link" : "Link to current frame",
1495
1437
  icon: "timer",
1496
- keywords: l,
1497
- run: ke
1438
+ keywords: d,
1439
+ run: Ae
1498
1440
  }
1499
1441
  ];
1500
- }, [Me, p, S, te?.id, !!W, ce]), [$e, Xe] = q(o), st = $.filter((l) => l.accessLevel >= 20), Ze = $.find((l) => l.name === $e), je = wn(Ze?.color), Ue = ge(null), Et = ge(null), gt = !!J.trim(), _t = !!k?.conditions?.some(
1501
- (l) => "key" in l && l.key === "checklists" && l.value === !0
1442
+ }, [Pe, p, E, te?.id, !!Q, se]), [Re, Xe] = O(o), lt = R.filter((d) => d.accessLevel >= 20), Ze = R.find((d) => d.name === Re), Ge = kn(Ze?.color), Ve = ve(null), Et = ve(null), gt = !!Z.trim(), Mt = !!F?.conditions?.some(
1443
+ (d) => "key" in d && d.key === "checklists" && d.value === !0
1502
1444
  );
1503
1445
  X(() => {
1504
- if (!h || p || !_t) return;
1505
- const l = Ue.current;
1506
- !l || !l.isEmpty() || l.getEditor().update(() => {
1507
- const w = eo(!1);
1508
- no().clear().append(to("check").append(w)), w.select();
1446
+ if (!h || p || !Mt) return;
1447
+ const d = Ve.current;
1448
+ !d || !d.isEmpty() || d.getEditor().update(() => {
1449
+ const x = oo(!1);
1450
+ ro().clear().append(ao("check").append(x)), x.select();
1509
1451
  });
1510
- }, [h, p, _t]);
1511
- const Pt = x[0]?.entityType, Rt = H?.productTypes, _n = _(
1512
- () => T ? void 0 : {
1513
- ...ho({
1514
- suggestions: v,
1515
- project: { productTypes: Rt },
1516
- taskTypes: b?.taskTypes,
1517
- entityType: Pt
1452
+ }, [h, p, Mt]);
1453
+ const _t = y[0]?.entityType, Pt = H?.productTypes, Rn = S(
1454
+ () => N ? void 0 : {
1455
+ ...vo({
1456
+ suggestions: w,
1457
+ project: { productTypes: Pt },
1458
+ taskTypes: v?.taskTypes,
1459
+ entityType: _t
1518
1460
  }),
1519
1461
  // keep the picker short
1520
1462
  limit: 5
1521
1463
  },
1522
- [T, v, Rt, b?.taskTypes, Pt]
1523
- ), Pn = ({ type: l, id: w }) => {
1524
- l === "user" || l === "team" || j({ entityId: w, entityType: l, projectName: P });
1525
- }, Rn = ({ type: l, id: w, label: G }, z) => {
1526
- const { x: U, y: me, width: ne } = z.getBoundingClientRect();
1527
- oe({ id: w, name: w, type: l, label: G, pos: { left: U + ne / 2, top: me } });
1528
- }, Mn = () => {
1529
- h || g || C && C();
1530
- }, Mt = () => {
1531
- p && S?.setEditPreview(null), (!gt || p) && B(""), F && F();
1532
- }, et = ({ file: l, data: w }, G = !1) => {
1533
- const z = pe(l.name), U = {
1534
- id: w.id,
1464
+ [N, w, Pt, v?.taskTypes, _t]
1465
+ ), $n = ({ type: d, id: x }) => {
1466
+ d === "user" || d === "team" || B({ entityId: x, entityType: d, projectName: I });
1467
+ }, Ln = ({ type: d, id: x, label: G }, z) => {
1468
+ const { x: U, y: ge, width: ne } = z.getBoundingClientRect();
1469
+ le({ id: x, name: x, type: d, label: G, pos: { left: U + ne / 2, top: ge } });
1470
+ }, On = () => {
1471
+ h || g || k && k();
1472
+ }, Rt = () => {
1473
+ p && E?.setEditPreview(null), (!gt || p) && W(""), C && C();
1474
+ }, et = ({ file: d, data: x }, G = !1) => {
1475
+ const z = pe(d.name), U = {
1476
+ id: x.id,
1535
1477
  name: z,
1536
- mime: l.type,
1537
- size: l.size,
1538
- order: E.length,
1478
+ mime: d.type,
1479
+ size: d.size,
1480
+ order: j.length,
1539
1481
  isAnnotationLayer: G
1540
1482
  };
1541
- return ae((me) => [...me, U]), he(
1542
- (me) => me.filter((ne) => pe(ne.name) !== z)
1483
+ return ae((ge) => [...ge, U]), he(
1484
+ (ge) => ge.filter((ne) => pe(ne.name) !== z)
1543
1485
  ), U;
1544
- }, $n = (l, w, G) => {
1545
- G ? Oe?.(l) : (ae((z) => z.filter((U) => U.id !== l)), he((z) => z.filter((U) => pe(U.name) !== pe(w))));
1546
- }, tt = (l, w) => {
1547
- const G = Math.round(l.loaded * 100 / l.total);
1486
+ }, jn = (d, x, G) => {
1487
+ G ? Le?.(d) : (ae((z) => z.filter((U) => U.id !== d)), he((z) => z.filter((U) => pe(U.name) !== pe(x))));
1488
+ }, tt = (d, x) => {
1489
+ const G = Math.round(d.loaded * 100 / d.total);
1548
1490
  if (G !== 100) {
1549
- const z = pe(w.name);
1491
+ const z = pe(x.name);
1550
1492
  he((U) => {
1551
- const me = U.find((O) => pe(O.name) === z), ne = U.filter((O) => pe(O.name) !== z), Ge = {
1493
+ const ge = U.find((L) => pe(L.name) === z), ne = U.filter((L) => pe(L.name) !== z), He = {
1552
1494
  name: z,
1553
1495
  progress: G,
1554
- type: w.type,
1555
- order: me?.order ?? E.length + U.length
1496
+ type: x.type,
1497
+ order: ge?.order ?? j.length + U.length
1556
1498
  };
1557
- return [...ne, Ge];
1499
+ return [...ne, He];
1558
1500
  });
1559
1501
  }
1560
- }, ct = (l) => {
1561
- he((w) => w.filter((G) => G.name !== pe(l)));
1562
- }, $t = (l) => {
1563
- for (const w of l) {
1564
- const G = qe(w, P, tt);
1565
- re.current.set(w, G), G.then(
1502
+ }, dt = (d) => {
1503
+ he((x) => x.filter((G) => G.name !== pe(d)));
1504
+ }, $t = (d) => {
1505
+ for (const x of d) {
1506
+ const G = We(x, I, tt);
1507
+ me.current.set(x, G), G.then(
1566
1508
  (z) => et(z),
1567
1509
  (z) => {
1568
- ct(w.name), ye.error(z.message), console.warn(z);
1510
+ dt(x.name), be.error(z.message), console.warn(z);
1569
1511
  }
1570
1512
  );
1571
1513
  }
1572
- }, Ln = async (l) => {
1573
- ie((w) => w + 1);
1514
+ }, Vn = async (d) => {
1515
+ re((x) => x + 1);
1574
1516
  try {
1575
- const w = re.current.get(l);
1576
- if (w) {
1577
- const { data: U } = await w;
1578
- return ae((me) => me.map((ne) => ne.id === U.id ? { ...ne, isInline: !0 } : ne)), {
1579
- src: en(P, U.id),
1580
- name: pe(l.name),
1581
- mime: l.type
1517
+ const x = me.current.get(d);
1518
+ if (x) {
1519
+ const { data: U } = await x;
1520
+ return ae((ge) => ge.map((ne) => ne.id === U.id ? { ...ne, isInline: !0 } : ne)), {
1521
+ src: tn(I, U.id),
1522
+ name: pe(d.name),
1523
+ mime: d.type
1582
1524
  };
1583
1525
  }
1584
- const { data: G } = await qe(l, P, void 0), z = pe(l.name);
1526
+ const { data: G } = await We(d, I, void 0), z = pe(d.name);
1585
1527
  return ae((U) => [
1586
1528
  ...U,
1587
- { id: G.id, name: z, mime: l.type, size: l.size, order: U.length, isInline: !0 }
1588
- ]), { src: en(P, G.id), name: z, mime: l.type };
1589
- } catch (w) {
1590
- throw re.current.has(l) || ye.error(w?.message || "Upload failed"), w;
1529
+ { id: G.id, name: z, mime: d.type, size: d.size, order: U.length, isInline: !0 }
1530
+ ]), { src: tn(I, G.id), name: z, mime: d.type };
1531
+ } catch (x) {
1532
+ throw me.current.has(d) || be.error(x?.message || "Upload failed"), x;
1591
1533
  } finally {
1592
- ie((w) => w - 1);
1534
+ re((x) => x - 1);
1593
1535
  }
1594
- }, On = (l) => {
1595
- se(!1), !l.defaultPrevented && Ba(
1596
- l,
1597
- P,
1536
+ }, zn = (d) => {
1537
+ ie(!1), !d.defaultPrevented && ur(
1538
+ d,
1539
+ I,
1598
1540
  tt,
1599
1541
  et,
1600
- (w) => ct(w.name)
1542
+ (x) => dt(x.name)
1601
1543
  );
1602
- }, Vn = (l) => {
1603
- l.preventDefault(), l.stopPropagation(), se(!0);
1604
- }, Lt = ge(null), zn = async ({ activity: l }) => {
1605
- const w = Nt(l);
1606
- w && w.entityId === te?.id && (Ee({ startFrame: w.startFrame, endFrame: w.endFrame }), S?.setDraft(w));
1607
- const G = gn(l.body || ""), z = l.files || [], U = Dt(G), me = x.length === 1 && x[0].id === (l.origin?.id ?? l.entityId), ne = (O) => {
1608
- const Ae = l.origin ?? (l.entityId && l.entityType ? { id: l.entityId, type: l.entityType } : void 0), Ce = `[Source](${_o(l.activityId, Ae)})`, de = [O.trim(), Ce].filter(Boolean).join(`
1544
+ }, Un = (d) => {
1545
+ d.preventDefault(), d.stopPropagation(), ie(!0);
1546
+ }, Lt = ve(null), Bn = async ({ activity: d }) => {
1547
+ const x = St(d);
1548
+ x && x.entityId === te?.id && (Ee({ startFrame: x.startFrame, endFrame: x.endFrame }), E?.setDraft(x));
1549
+ const G = yn(d.body || ""), z = d.files || [], U = Dt(G), ge = y.length === 1 && y[0].id === (d.origin?.id ?? d.entityId), ne = (L) => {
1550
+ const Fe = d.origin ?? (d.entityId && d.entityType ? { id: d.entityId, type: d.entityType } : void 0), Ce = `[Source](${Ro(d.activityId, Fe)})`, ce = [L.trim(), Ce].filter(Boolean).join(`
1609
1551
 
1610
1552
  `);
1611
- B((ue) => ue.trim() ? `${ue.trim()}
1553
+ W((ue) => ue.trim() ? `${ue.trim()}
1612
1554
 
1613
- ${de}` : de), Ue.current?.focus();
1614
- }, Ge = async (O) => {
1615
- const Ae = U.has(O.id);
1555
+ ${ce}` : ce), Ve.current?.focus();
1556
+ }, He = async (L) => {
1557
+ const Fe = U.has(L.id);
1616
1558
  try {
1617
- const Ce = await Zt(
1618
- P,
1619
- O.id,
1620
- O.name,
1621
- O.mime,
1622
- Ae ? void 0 : tt
1559
+ const Ce = await en(
1560
+ I,
1561
+ L.id,
1562
+ L.name,
1563
+ L.mime,
1564
+ Fe ? void 0 : tt
1623
1565
  );
1624
- if (Ae) {
1625
- const { file: ue, data: nt } = Ce, lt = pe(ue.name);
1626
- ae((Ut) => [
1627
- ...Ut,
1628
- { id: nt.id, name: lt, mime: ue.type, size: ue.size, order: Ut.length, isInline: Ae }
1566
+ if (Fe) {
1567
+ const { file: ue, data: nt } = Ce, ut = pe(ue.name);
1568
+ ae((zt) => [
1569
+ ...zt,
1570
+ { id: nt.id, name: ut, mime: ue.type, size: ue.size, order: zt.length, isInline: Fe }
1629
1571
  ]);
1630
1572
  } else et(Ce);
1631
- const de = O.annotation;
1632
- if (de && me) {
1633
- const ue = await Zt(
1634
- P,
1635
- de.transparent,
1636
- `annotation-${O.name}`,
1573
+ const ce = L.annotation;
1574
+ if (ce && ge) {
1575
+ const ue = await en(
1576
+ I,
1577
+ ce.transparent,
1578
+ `annotation-${L.name}`,
1637
1579
  "image/png"
1638
1580
  );
1639
- et(ue, !0), Ie((nt) => [
1581
+ et(ue, !0), Ne((nt) => [
1640
1582
  ...nt,
1641
- { ...de, id: sn(), composite: Ce.data.id, transparent: ue.data.id }
1583
+ {
1584
+ ...ce,
1585
+ id: `${ce.id}-${cn()}`,
1586
+ composite: Ce.data.id,
1587
+ transparent: ue.data.id
1588
+ }
1642
1589
  ]);
1643
1590
  }
1644
- return [O.id, Ce.data.id];
1591
+ return [L.id, Ce.data.id];
1645
1592
  } catch (Ce) {
1646
- return ct(O.name), ye.error(`Could not copy ${O.name}`), console.warn(Ce), null;
1593
+ return dt(L.name), be.error(`Could not copy ${L.name}`), console.warn(Ce), null;
1647
1594
  }
1648
1595
  };
1649
- ie((O) => O + 1);
1596
+ re((L) => L + 1);
1650
1597
  try {
1651
- const O = z.filter((de) => U.has(de.id)), Ae = z.filter((de) => !U.has(de.id)), Ce = Promise.all(Ae.map(Ge));
1652
- if (O.length) {
1653
- const de = new Map(
1654
- (await Promise.all(O.map(Ge))).filter(
1598
+ const L = z.filter((ce) => U.has(ce.id)), Fe = z.filter((ce) => !U.has(ce.id)), Ce = Promise.all(Fe.map(He));
1599
+ if (L.length) {
1600
+ const ce = new Map(
1601
+ (await Promise.all(L.map(He))).filter(
1655
1602
  (ue) => !!ue
1656
1603
  )
1657
1604
  );
1658
1605
  ne(
1659
1606
  G.replace(
1660
1607
  /(\/api\/projects\/[^/]+\/files\/)([\w-]+)/g,
1661
- (ue, nt, lt) => de.has(lt) ? nt + de.get(lt) : ue
1608
+ (ue, nt, ut) => ce.has(ut) ? nt + ce.get(ut) : ue
1662
1609
  )
1663
1610
  );
1664
1611
  } else ne(G);
1665
1612
  await Ce;
1666
1613
  } finally {
1667
- ie((O) => O - 1);
1614
+ re((L) => L - 1);
1668
1615
  }
1669
1616
  };
1670
1617
  X(() => {
1671
- !u || Lt.current === u.key || (Lt.current = u.key, m?.(), zn(u));
1618
+ !u || Lt.current === u.key || (Lt.current = u.key, m?.(), Bn(u));
1672
1619
  }, [u?.key]);
1673
- const Un = Ha({
1674
- projectName: P,
1620
+ const Gn = gr({
1621
+ projectName: I,
1675
1622
  onSuccess: et,
1676
1623
  onProgress: tt,
1677
1624
  // seed progress so the card switches to uploading before the export finishes
1678
- onStart: (l) => tt({ loaded: 1, total: 100 }, { name: l.name, type: "image/png" }),
1679
- onError: (l) => ct(l.name)
1680
- }), Bn = Re.length > 0 || Te > 0, ht = xe || Bn, ft = async () => {
1625
+ onStart: (d) => tt({ loaded: 1, total: 100 }, { name: d.name, type: "image/png" }),
1626
+ onError: (d) => dt(d.name)
1627
+ }), Hn = Ue.length > 0 || q > 0, ht = ke || Hn, ft = async () => {
1681
1628
  if (!ht)
1682
1629
  try {
1683
- le(!0);
1684
- let l = [], w = De;
1685
- if (Ne.length) {
1686
- const { files: O, metadata: Ae } = await Un(Ne);
1687
- l = O, w = [...w, ...Ae];
1630
+ de(!0);
1631
+ let d = [], x = De;
1632
+ if (Se.length) {
1633
+ const { files: L, metadata: Fe } = await Gn(Se);
1634
+ d = L, x = [...x, ...Fe];
1688
1635
  }
1689
- const { annotations: G = [] } = t || {}, z = w.length ? [...G, ...w] : void 0, U = Oa(Ue.current?.getMarkdown() ?? J), ne = [...E.filter((O) => !O.isInline || tn(O.id, U)), ...l], Ge = {
1636
+ const { annotations: G = [] } = t || {}, z = x.length ? [...G, ...x] : void 0, U = sr(Ve.current?.getMarkdown() ?? Z), ne = [...j.filter((L) => !L.isInline || nn(L.id, U)), ...d], He = {
1690
1637
  ...t,
1691
1638
  annotations: z,
1692
1639
  // could be undefined
1693
- category: T ? null : $e,
1640
+ category: N ? null : Re,
1694
1641
  // guests cannot set category (it is done by default on backend)
1695
1642
  // one frame link per comment, stored as metadata rather than in the text
1696
- startFrame: W?.startFrame ?? void 0,
1697
- endFrame: W?.endFrame ?? void 0
1643
+ startFrame: Q?.startFrame ?? void 0,
1644
+ endFrame: Q?.endFrame ?? void 0
1698
1645
  };
1699
1646
  if ((U || ne.length) && s) {
1700
- const O = J;
1701
- B(""), ae([]);
1647
+ const L = Z;
1648
+ W(""), ae([]);
1702
1649
  try {
1703
- await s(U, ne, Ge), p && S?.setEditPreview(null), Ie([]), !p && W && S?.unlink(), p || Ee(null);
1650
+ await s(U, ne, He), p && E?.setEditPreview(null), Ne([]), !p && Q && E?.unlink(), p || Ee(null);
1704
1651
  } catch {
1705
- B(O), ae(ne), Ie(w);
1652
+ W(L), ae(ne), Ne(x);
1706
1653
  return;
1707
1654
  }
1708
1655
  }
1709
- } catch (l) {
1710
- console.error(l), ye.error("Something went wrong");
1656
+ } catch (d) {
1657
+ console.error(d), be.error("Something went wrong");
1711
1658
  } finally {
1712
- le(!1);
1659
+ de(!1);
1713
1660
  }
1714
1661
  }, Ot = [
1715
- ...Ne,
1716
- ...(E || []).filter((l) => !l.isAnnotationLayer && !l.isInline),
1717
- ...Re
1718
- ].sort((l, w) => l.order - w.order), jn = Ot.length > 3, Vt = (l) => g ? T ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : T || !l ? "Leave a comment" : "Comment, or type / to add mentions, checklists, code and more...", zt = async (l) => {
1719
- if (d)
1662
+ ...Se,
1663
+ ...(j || []).filter((d) => !d.isAnnotationLayer && !d.isInline),
1664
+ ...Ue
1665
+ ].sort((d, x) => d.order - x.order), qn = Ot.length > 3, jt = (d) => g ? N ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : N || !d ? "Leave a comment" : "Comment, or type / to add mentions, checklists, code and more...", Vt = async (d) => {
1666
+ if (l)
1720
1667
  try {
1721
- (gt || E.length > 0 || Ne.length > 0) && await ft(), d(l);
1722
- } catch (w) {
1723
- console.error(w), ye.error("Something went wrong while submitting the review");
1668
+ (gt || j.length > 0 || Se.length > 0) && await ft(), l(d);
1669
+ } catch (x) {
1670
+ console.error(x), be.error("Something went wrong while submitting the review");
1724
1671
  }
1725
- }, Gn = r && d && !g && /* @__PURE__ */ y(fo, { className: K("version-review-buttons", { guest: T }), children: [
1672
+ }, Wn = r && l && !g && /* @__PURE__ */ b(bo, { className: J("version-review-buttons", { guest: N }), children: [
1726
1673
  /* @__PURE__ */ c(
1727
1674
  Gt,
1728
1675
  {
1729
1676
  icon: "check",
1730
1677
  variant: "tertiary",
1731
1678
  "data-tooltip": "Approve",
1732
- onClick: () => zt(Fe.APPROVE),
1679
+ onClick: () => Vt(Te.APPROVE),
1733
1680
  children: /* @__PURE__ */ c("span", { className: "label", children: "Approve" })
1734
1681
  }
1735
1682
  ),
@@ -1739,22 +1686,22 @@ ${de}` : de), Ue.current?.focus();
1739
1686
  icon: "refresh",
1740
1687
  variant: "danger",
1741
1688
  "data-tooltip": "Request changes",
1742
- onClick: () => zt(Fe.REQUEST_CHANGES),
1689
+ onClick: () => Vt(Te.REQUEST_CHANGES),
1743
1690
  children: /* @__PURE__ */ c("span", { className: "label", children: "Request changes" })
1744
1691
  }
1745
1692
  )
1746
- ] }), vt = !T && /* @__PURE__ */ c(
1747
- Za,
1693
+ ] }), yt = !N && /* @__PURE__ */ c(
1694
+ xr,
1748
1695
  {
1749
- value: $e,
1750
- categories: st,
1751
- onChange: (l) => Xe(l),
1696
+ value: Re,
1697
+ categories: lt,
1698
+ onChange: (d) => Xe(d),
1752
1699
  isCompact: p,
1753
- hasPowerpack: L,
1754
- onPowerFeature: N,
1755
- isHidden: Ka(st, { isGuest: T, isAdmin: Y })
1700
+ hasPowerpack: $,
1701
+ onPowerFeature: M,
1702
+ isHidden: kr(lt, { isGuest: N, isAdmin: K })
1756
1703
  }
1757
- ), Hn = /* @__PURE__ */ y(be, { children: [
1704
+ ), Qn = /* @__PURE__ */ b(we, { children: [
1758
1705
  /* @__PURE__ */ c(
1759
1706
  rt,
1760
1707
  {
@@ -1762,7 +1709,7 @@ ${de}` : de), Ue.current?.focus();
1762
1709
  variant: "text",
1763
1710
  className: "md-toolbar-button",
1764
1711
  "data-tooltip": "Attach files",
1765
- onMouseDown: (l) => l.preventDefault(),
1712
+ onMouseDown: (d) => d.preventDefault(),
1766
1713
  onClick: () => Et.current?.click()
1767
1714
  }
1768
1715
  ),
@@ -1773,48 +1720,48 @@ ${de}` : de), Ue.current?.focus();
1773
1720
  type: "file",
1774
1721
  multiple: !0,
1775
1722
  hidden: !0,
1776
- onChange: (l) => {
1777
- $t(Array.from(l.target.files || [])), l.target.value = "";
1723
+ onChange: (d) => {
1724
+ $t(Array.from(d.target.files || [])), d.target.value = "";
1778
1725
  }
1779
1726
  }
1780
1727
  )
1781
- ] }), qn = !(Ne.length > 0 && E.length === 0), Wn = `calc(${Math.max((fe ? I || "Frame or range" : ce || "").length, 1) + 2}ch + 16px)`;
1782
- return /* @__PURE__ */ c(be, { children: /* @__PURE__ */ y(
1783
- vo,
1728
+ ] }), Yn = !(Se.length > 0 && j.length === 0), Kn = `calc(${Math.max((fe ? D || "Frame or range" : se || "").length, 1) + 2}ch + 16px)`;
1729
+ return /* @__PURE__ */ c(we, { children: /* @__PURE__ */ b(
1730
+ wo,
1784
1731
  {
1785
- className: K("comment-container", "md-mention-anchor", { isOpen: h, isEditing: p }),
1786
- onDragOver: Vn,
1787
- onDragLeave: () => se(!1),
1788
- onDrop: On,
1789
- onClick: () => se(!1),
1790
- onKeyDown: (l) => l.stopPropagation(),
1732
+ className: J("comment-container", "md-mention-anchor", { isOpen: h, isEditing: p }),
1733
+ onDragOver: Un,
1734
+ onDragLeave: () => ie(!1),
1735
+ onDrop: zn,
1736
+ onClick: () => ie(!1),
1737
+ onKeyDown: (d) => d.stopPropagation(),
1791
1738
  children: [
1792
- r && i && /* @__PURE__ */ c(lr, { lastOwnVersionReview: i }),
1793
- /* @__PURE__ */ y(
1794
- yo,
1739
+ r && i && /* @__PURE__ */ c(Cr, { lastOwnVersionReview: i }),
1740
+ /* @__PURE__ */ b(
1741
+ xo,
1795
1742
  {
1796
- className: K("block-shortcuts", {
1743
+ className: J("block-shortcuts", {
1797
1744
  isOpen: h,
1798
1745
  isClosed: !h || g,
1799
1746
  isEditing: p,
1800
- isDropping: we,
1747
+ isDropping: xe,
1801
1748
  disabled: g,
1802
1749
  isLoading: f,
1803
- isSubmitting: xe,
1804
- category: !!$e && !T
1750
+ isSubmitting: ke,
1751
+ category: !!Re && !N
1805
1752
  }),
1806
- onClick: Mn,
1753
+ onClick: On,
1807
1754
  $categoryPrimary: Ze?.color,
1808
- $categoryTertiary: je.primary,
1809
- $categorySecondary: je.secondary,
1755
+ $categoryTertiary: Ge.primary,
1756
+ $categorySecondary: Ge.secondary,
1810
1757
  children: [
1811
1758
  h && /* @__PURE__ */ c(
1812
- bn,
1759
+ xn,
1813
1760
  {
1814
1761
  files: Ot,
1815
- isCompact: jn || p,
1816
- onRemove: $n,
1817
- projectName: P,
1762
+ isCompact: qn || p,
1763
+ onRemove: jn,
1764
+ projectName: I,
1818
1765
  onAnnotationClick: Be,
1819
1766
  style: {
1820
1767
  borderBottom: "1px solid var(--md-sys-color-outline-variant)",
@@ -1830,109 +1777,109 @@ ${de}` : de), Ue.current?.focus();
1830
1777
  }
1831
1778
  }
1832
1779
  ),
1833
- h && !g ? /* @__PURE__ */ y(be, { children: [
1834
- p && vt && /* @__PURE__ */ c(bo, { children: vt }),
1780
+ h && !g ? /* @__PURE__ */ b(we, { children: [
1781
+ p && yt && /* @__PURE__ */ c(ko, { children: yt }),
1835
1782
  /* @__PURE__ */ c(
1836
- wo,
1783
+ Ao,
1837
1784
  {
1838
- ref: Ue,
1785
+ ref: Ve,
1839
1786
  className: "comment-editor",
1840
- value: J,
1841
- onChange: B,
1842
- placeholder: Vt(!0),
1843
- mentions: _n,
1787
+ value: Z,
1788
+ onChange: W,
1789
+ placeholder: jt(!0),
1790
+ mentions: Rn,
1844
1791
  mentionPlacement: p ? "inline" : "top",
1845
- onMentionClick: Pn,
1846
- onMentionHover: Rn,
1792
+ onMentionClick: $n,
1793
+ onMentionHover: Ln,
1847
1794
  onSubmit: ft,
1848
- onEscape: Mt,
1795
+ onEscape: Rt,
1849
1796
  onFiles: $t,
1850
- onUploadMedia: Ln,
1851
- commands: Pe,
1797
+ onUploadMedia: Vn,
1798
+ commands: _e,
1852
1799
  toolbar: !p,
1853
1800
  floatingToolbar: p,
1854
- toolbarStart: vt,
1855
- toolbarEnd: /* @__PURE__ */ y(be, { children: [
1856
- /* @__PURE__ */ c(xo, {}),
1857
- Hn
1801
+ toolbarStart: yt,
1802
+ toolbarEnd: /* @__PURE__ */ b(we, { children: [
1803
+ /* @__PURE__ */ c(Fo, {}),
1804
+ Qn
1858
1805
  ] }),
1859
1806
  bordered: !1,
1860
- autoFocus: qn,
1807
+ autoFocus: Yn,
1861
1808
  minHeight: p ? 40 : 88,
1862
1809
  maxHeight: 259
1863
1810
  }
1864
1811
  )
1865
- ] }) : /* @__PURE__ */ c(ko, { children: Vt() }),
1866
- /* @__PURE__ */ y(Ao, { children: [
1867
- (!T || Me) && /* @__PURE__ */ y(Co, { children: [
1868
- !T && dr.map(({ trigger: l, icon: w, tooltip: G }) => /* @__PURE__ */ c(
1812
+ ] }) : /* @__PURE__ */ c(Co, { children: jt() }),
1813
+ /* @__PURE__ */ b(To, { children: [
1814
+ (!N || Pe) && /* @__PURE__ */ b(Do, { children: [
1815
+ !N && Tr.map(({ trigger: d, icon: x, tooltip: G }) => /* @__PURE__ */ c(
1869
1816
  rt,
1870
1817
  {
1871
- icon: w,
1818
+ icon: x,
1872
1819
  variant: "text",
1873
1820
  onMouseDown: (z) => z.preventDefault(),
1874
- onClick: () => Ue.current?.insertMentionTrigger(l),
1821
+ onClick: () => Ve.current?.insertMentionTrigger(d),
1875
1822
  "data-tooltip": G,
1876
- "data-shortcut": l
1823
+ "data-shortcut": d
1877
1824
  },
1878
- l
1825
+ d
1879
1826
  )),
1880
- Me && /* @__PURE__ */ y(
1881
- Fo,
1827
+ Pe && /* @__PURE__ */ b(
1828
+ No,
1882
1829
  {
1883
- className: K("frame-link", { selected: !!W || fe }),
1830
+ className: J("frame-link", { selected: !!Q || fe }),
1884
1831
  children: [
1885
1832
  /* @__PURE__ */ c(
1886
- To,
1833
+ So,
1887
1834
  {
1888
1835
  icon: "timer",
1889
1836
  variant: "text",
1890
1837
  onClick: Je,
1891
- "aria-label": W ? "Remove frame link" : "Add frame link",
1892
- "data-tooltip": W ? "Remove frame link" : p ? "Add frame link" : "Link to current frame",
1838
+ "aria-label": Q ? "Remove frame link" : "Add frame link",
1839
+ "data-tooltip": Q ? "Remove frame link" : p ? "Add frame link" : "Link to current frame",
1893
1840
  "data-testid": "comment-frame-link"
1894
1841
  }
1895
1842
  ),
1896
- (W || fe) && (fe ? /* @__PURE__ */ c(
1897
- Do,
1843
+ (Q || fe) && (fe ? /* @__PURE__ */ c(
1844
+ Io,
1898
1845
  {
1899
1846
  autoFocus: !0,
1900
1847
  "aria-label": "Linked frame or range",
1901
- value: I,
1848
+ value: D,
1902
1849
  placeholder: "Frame",
1903
- onFocus: (l) => {
1904
- Q.current = W, l.currentTarget.select();
1850
+ onFocus: (d) => {
1851
+ Y.current = Q, d.currentTarget.select();
1905
1852
  },
1906
- onChange: (l) => Ke(l.target.value),
1907
- onBlur: D,
1908
- style: { width: Wn },
1909
- onKeyDown: (l) => {
1910
- l.key === "Enter" && (l.preventDefault(), l.currentTarget.blur()), l.key === "Escape" && (V.current = !0, l.currentTarget.blur());
1853
+ onChange: (d) => Ke(d.target.value),
1854
+ onBlur: T,
1855
+ style: { width: Kn },
1856
+ onKeyDown: (d) => {
1857
+ d.key === "Enter" && (d.preventDefault(), d.currentTarget.blur()), d.key === "Escape" && (V.current = !0, d.currentTarget.blur());
1911
1858
  },
1912
1859
  "data-testid": "comment-frame-link-input"
1913
1860
  }
1914
1861
  ) : /* @__PURE__ */ c(
1915
- Io,
1862
+ Eo,
1916
1863
  {
1917
1864
  variant: "text",
1918
- "aria-label": `Edit linked frame ${ce ?? ""}`,
1919
- onClick: () => _e(!0),
1865
+ "aria-label": `Edit linked frame ${se ?? ""}`,
1866
+ onClick: () => Me(!0),
1920
1867
  "data-tooltip": "Edit linked frame or range",
1921
- children: ce || "Frame or range"
1868
+ children: se || "Frame or range"
1922
1869
  }
1923
1870
  ))
1924
1871
  ]
1925
1872
  }
1926
1873
  )
1927
1874
  ] }),
1928
- /* @__PURE__ */ y(No, { children: [
1929
- p && /* @__PURE__ */ c(rt, { variant: "text", onClick: Mt, children: "Cancel" }),
1875
+ /* @__PURE__ */ b(Mo, { children: [
1876
+ p && /* @__PURE__ */ c(rt, { variant: "text", onClick: Rt, children: "Cancel" }),
1930
1877
  /* @__PURE__ */ c(
1931
- so,
1878
+ lo,
1932
1879
  {
1933
1880
  label: p ? "Save" : "Comment",
1934
1881
  className: "comment",
1935
- active: gt || !!E.length,
1882
+ active: gt || !!j.length,
1936
1883
  onClick: ft,
1937
1884
  disabled: f || ht,
1938
1885
  saving: ht
@@ -1940,21 +1887,21 @@ ${de}` : de), Ue.current?.focus();
1940
1887
  )
1941
1888
  ] })
1942
1889
  ] }),
1943
- /* @__PURE__ */ c(So, { className: K({ show: we && h }), children: /* @__PURE__ */ c(Z, { icon: "cloud_upload" }) })
1890
+ /* @__PURE__ */ c(_o, { className: J({ show: xe && h }), children: /* @__PURE__ */ c(oe, { icon: "cloud_upload" }) })
1944
1891
  ]
1945
1892
  }
1946
1893
  ),
1947
- /* @__PURE__ */ c(Eo, {}),
1948
- Gn
1894
+ /* @__PURE__ */ c(Po, {}),
1895
+ Wn
1949
1896
  ]
1950
1897
  }
1951
1898
  ) });
1952
- }, ur = (e, n, o) => e && It`
1899
+ }, Dr = (e, n, o) => e && Nt`
1953
1900
  --reaction-border-color: ${e};
1954
1901
  --reaction-active-bg: ${n};
1955
1902
  --reaction-hover-bg: ${n};
1956
1903
  --reaction-active-border: ${e};
1957
- `, pr = A.div`
1904
+ `, Nr = A.div`
1958
1905
  /* VARS */
1959
1906
  --reaction-border-color: var(--md-sys-color-outline-variant);
1960
1907
  --reaction-hover-bg: var(--md-sys-color-surface-container-high-hover);
@@ -1967,7 +1914,7 @@ ${de}` : de), Ue.current?.focus();
1967
1914
  --reaction-compact-active-hover-bg: var(--md-sys-color-primary-container-hover);
1968
1915
 
1969
1916
  /* CATEGORY */
1970
- ${({ $categoryPrimary: e, $categorySecondary: n, $categoryTertiary: o }) => ur(e, n)}
1917
+ ${({ $categoryPrimary: e, $categorySecondary: n, $categoryTertiary: o }) => Dr(e, n)}
1971
1918
 
1972
1919
  display: flex;
1973
1920
  justify-content: center;
@@ -2018,23 +1965,23 @@ ${de}` : de), Ue.current?.focus();
2018
1965
  position: relative;
2019
1966
  height: 19px;
2020
1967
  }
2021
- `, mr = A.div`
1968
+ `, Sr = A.div`
2022
1969
  outline: 'solid 1px red';
2023
1970
  display: flex;
2024
1971
  gap: 8px;
2025
- `, gr = A.div`
1972
+ `, Ir = A.div`
2026
1973
  position: fixed;
2027
1974
  top: 0;
2028
1975
  bottom: 0;
2029
1976
  left: 0;
2030
1977
  right: 0;
2031
1978
  z-index: 55;
2032
- `, hr = A.div`
1979
+ `, Er = A.div`
2033
1980
  /* VARS */
2034
1981
  --panel-bg: var(--md-sys-color-surface-container-high);
2035
1982
 
2036
1983
  /* CATEGORY */
2037
- ${({ $categoryPrimary: e, $categorySecondary: n }) => n && It`
1984
+ ${({ $categoryPrimary: e, $categorySecondary: n }) => n && Nt`
2038
1985
  --panel-bg: ${n};
2039
1986
  `}
2040
1987
 
@@ -2050,14 +1997,14 @@ ${de}` : de), Ue.current?.focus();
2050
1997
  padding: 4px;
2051
1998
  border-radius: 4px;
2052
1999
  box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.15);
2053
- `, fr = A.div`
2000
+ `, Mr = A.div`
2054
2001
  /* VARS */
2055
2002
  --opener-bg: var(--md-sys-color-surface-container-high);
2056
2003
  --opener-hover-bg: var(--md-sys-color-surface-container-high-hover);
2057
2004
  --opener-color: var(--md-sys-color-outline);
2058
2005
 
2059
2006
  /* CATEGORY */
2060
- ${({ $categoryPrimary: e, $categorySecondary: n }) => n && It`
2007
+ ${({ $categoryPrimary: e, $categorySecondary: n }) => n && Nt`
2061
2008
  --opener-bg: ${n};
2062
2009
  --opener-hover-bg: ${n};
2063
2010
  --opener-color: ${e};
@@ -2080,31 +2027,31 @@ ${de}` : de), Ue.current?.focus();
2080
2027
  filter: ${({ $categoryPrimary: e }) => e ? "brightness(1.2)" : "none"};
2081
2028
  }
2082
2029
  }
2083
- `, vr = A.div`
2030
+ `, _r = A.div`
2084
2031
  display: flex;
2085
2032
  gap: 8px;
2086
2033
  position: relative;
2087
- `, yr = [
2034
+ `, Pr = [
2088
2035
  { key: "thumb_up", value: "👍" },
2089
2036
  { key: "thumb_down", value: "👎" },
2090
2037
  { key: "heart_plus", value: "❤" },
2091
2038
  { key: "celebration", value: "🎉" },
2092
2039
  { key: "notes", value: "📝" }
2093
- ], br = {
2040
+ ], Rr = {
2094
2041
  thumb_up: "👍",
2095
2042
  thumb_down: "👎",
2096
2043
  heart_plus: "❤️",
2097
2044
  celebration: "🎉",
2098
2045
  notes: "📝"
2099
- }, Ct = [
2046
+ }, At = [
2100
2047
  "thumb_up",
2101
2048
  "thumb_down",
2102
2049
  "heart_plus",
2103
2050
  "celebration",
2104
2051
  "notes"
2105
- ], wr = (e) => [...e].sort(
2106
- (o, t) => Ct.indexOf(o.type) - Ct.indexOf(t.type)
2107
- ), Tn = ({
2052
+ ], $r = (e) => [...e].sort(
2053
+ (o, t) => At.indexOf(o.type) - At.indexOf(t.type)
2054
+ ), Dn = ({
2108
2055
  reaction: e,
2109
2056
  variant: n = "standard",
2110
2057
  onClick: o,
@@ -2113,29 +2060,29 @@ ${de}` : de), Ue.current?.focus();
2113
2060
  categoryTertiary: r
2114
2061
  }) => {
2115
2062
  const i = e.users?.join(", ") || void 0;
2116
- return /* @__PURE__ */ y(
2117
- pr,
2063
+ return /* @__PURE__ */ b(
2064
+ Nr,
2118
2065
  {
2119
- className: K(n, { active: e.isActive }),
2066
+ className: J(n, { active: e.isActive }),
2120
2067
  onClick: o,
2121
2068
  "data-tooltip": i,
2122
2069
  $categoryPrimary: t,
2123
2070
  $categorySecondary: a,
2124
2071
  $categoryTertiary: r,
2125
2072
  children: [
2126
- /* @__PURE__ */ c("span", { className: "emoji", children: br[e.type] }),
2073
+ /* @__PURE__ */ c("span", { className: "emoji", children: Rr[e.type] }),
2127
2074
  e.users && /* @__PURE__ */ c("span", { children: e.users.length })
2128
2075
  ]
2129
2076
  }
2130
2077
  );
2131
- }, xr = ({
2078
+ }, Lr = ({
2132
2079
  reactions: e,
2133
2080
  changeHandler: n,
2134
2081
  categoryPrimary: o,
2135
2082
  categorySecondary: t,
2136
2083
  categoryTertiary: a
2137
- }) => /* @__PURE__ */ c(mr, { children: e.map((r) => /* @__PURE__ */ c(
2138
- Tn,
2084
+ }) => /* @__PURE__ */ c(Sr, { children: e.map((r) => /* @__PURE__ */ c(
2085
+ Dn,
2139
2086
  {
2140
2087
  reaction: r,
2141
2088
  isActive: r.isActive,
@@ -2147,44 +2094,44 @@ ${de}` : de), Ue.current?.focus();
2147
2094
  categoryTertiary: a
2148
2095
  },
2149
2096
  r.type
2150
- )) }), kr = ({
2097
+ )) }), Or = ({
2151
2098
  reactions: e,
2152
2099
  changeHandler: n,
2153
2100
  categoryPrimary: o,
2154
2101
  categorySecondary: t,
2155
2102
  categoryTertiary: a
2156
2103
  }) => {
2157
- const [r, i] = q(!1), s = e.filter((d) => d.isActive).map((d) => d.type);
2158
- return /* @__PURE__ */ y(
2159
- fr,
2104
+ const [r, i] = O(!1), s = e.filter((l) => l.isActive).map((l) => l.type);
2105
+ return /* @__PURE__ */ b(
2106
+ Mr,
2160
2107
  {
2161
2108
  $categoryPrimary: o,
2162
2109
  $categorySecondary: t,
2163
2110
  $categoryTertiary: a,
2164
2111
  children: [
2165
2112
  /* @__PURE__ */ c(
2166
- Z,
2113
+ oe,
2167
2114
  {
2168
2115
  icon: "add_reaction",
2169
2116
  className: "add-reaction",
2170
2117
  onClick: () => i(!r)
2171
2118
  }
2172
2119
  ),
2173
- r && /* @__PURE__ */ y(be, { children: [
2174
- /* @__PURE__ */ c(gr, { onClick: () => i(!1) }),
2120
+ r && /* @__PURE__ */ b(we, { children: [
2121
+ /* @__PURE__ */ c(Ir, { onClick: () => i(!1) }),
2175
2122
  /* @__PURE__ */ c(
2176
- hr,
2123
+ Er,
2177
2124
  {
2178
2125
  $categoryPrimary: o,
2179
2126
  $categorySecondary: t,
2180
2127
  $categoryTertiary: a,
2181
- children: yr.map((d) => {
2128
+ children: Pr.map((l) => {
2182
2129
  const u = {
2183
- type: d.key,
2184
- isActive: s.includes(d.key)
2130
+ type: l.key,
2131
+ isActive: s.includes(l.key)
2185
2132
  };
2186
2133
  return /* @__PURE__ */ c(
2187
- Tn,
2134
+ Dn,
2188
2135
  {
2189
2136
  reaction: u,
2190
2137
  variant: "compact",
@@ -2204,7 +2151,7 @@ ${de}` : de), Ue.current?.focus();
2204
2151
  ]
2205
2152
  }
2206
2153
  );
2207
- }, Ar = ({
2154
+ }, jr = ({
2208
2155
  reactions: e,
2209
2156
  changeHandler: n,
2210
2157
  readOnly: o,
@@ -2214,34 +2161,34 @@ ${de}` : de), Ue.current?.focus();
2214
2161
  categoryTertiary: i
2215
2162
  }) => {
2216
2163
  const s = t ? { categoryPrimary: a, categorySecondary: r, categoryTertiary: i } : {};
2217
- return /* @__PURE__ */ y(vr, { children: [
2164
+ return /* @__PURE__ */ b(_r, { children: [
2218
2165
  !o && /* @__PURE__ */ c(
2219
- kr,
2166
+ Or,
2220
2167
  {
2221
2168
  reactions: e,
2222
2169
  changeHandler: n,
2223
2170
  ...s
2224
2171
  }
2225
2172
  ),
2226
- /* @__PURE__ */ c(xr, { reactions: e, changeHandler: n, ...s })
2173
+ /* @__PURE__ */ c(Lr, { reactions: e, changeHandler: n, ...s })
2227
2174
  ] });
2228
- }, Cr = (e = "") => (e.match(/\((.*?)\)/g) || []).flatMap((o) => {
2175
+ }, Vr = (e = "") => (e.match(/\((.*?)\)/g) || []).flatMap((o) => {
2229
2176
  if (o.includes("http")) return [];
2230
2177
  const t = o.match(/\(([^)]+)\)/), a = t ? t[1].split(":") : [];
2231
2178
  return { type: a[0], id: a[1] };
2232
- }), Fr = (e) => e.replace(/@(?=@|\[)/g, ""), Tr = {
2179
+ }), zr = (e) => e.replace(/@(?=@|\[)/g, ""), Ur = {
2233
2180
  "&": "&amp;",
2234
2181
  "<": "&lt;",
2235
2182
  ">": "&gt;",
2236
2183
  '"': "&quot;"
2237
- }, yt = (e) => e.replace(/[&<>"]/g, (n) => Tr[n]), Dr = (e) => e.replaceAll(" ", "%20"), Ir = (e, n) => {
2184
+ }, vt = (e) => e.replace(/[&<>"]/g, (n) => Ur[n]), Br = (e) => e.replaceAll(" ", "%20"), Gr = (e, n) => {
2238
2185
  const o = n.cloneContents();
2239
2186
  if (!o.querySelector("[data-mention-value]")) return null;
2240
2187
  let t = "", a = "";
2241
2188
  const r = (i) => {
2242
2189
  if (i.nodeType === Node.TEXT_NODE) {
2243
2190
  const u = i.data;
2244
- t += u, a += yt(u);
2191
+ t += u, a += vt(u);
2245
2192
  return;
2246
2193
  }
2247
2194
  if (i.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
@@ -2249,12 +2196,12 @@ ${de}` : de), Ue.current?.focus();
2249
2196
  return;
2250
2197
  }
2251
2198
  if (i.nodeType !== Node.ELEMENT_NODE) return;
2252
- const s = i, d = s.getAttribute("data-mention-value");
2253
- if (d) {
2199
+ const s = i, l = s.getAttribute("data-mention-value");
2200
+ if (l) {
2254
2201
  const u = s.getAttribute("data-mention-label") || (s.textContent || "").trim();
2255
2202
  if (u) {
2256
- const m = Dr(d);
2257
- t += `[${u}](${m})`, a += `<a href="@${yt(m)}">@${yt(u)}</a>`;
2203
+ const m = Br(l);
2204
+ t += `[${u}](${m})`, a += `<a href="@${vt(m)}">@${vt(u)}</a>`;
2258
2205
  }
2259
2206
  return;
2260
2207
  }
@@ -2272,37 +2219,37 @@ ${de}` : de), Ue.current?.focus();
2272
2219
  i.childNodes.forEach(r);
2273
2220
  };
2274
2221
  return r(o), t ? { text: t, html: a } : null;
2275
- }, Nr = ({ children: e }) => {
2276
- const n = Bt.Children.map(e, (t) => {
2277
- if (!Bt.isValidElement(t)) return t;
2222
+ }, Hr = ({ children: e }) => {
2223
+ const n = Ut.Children.map(e, (t) => {
2224
+ if (!Ut.isValidElement(t)) return t;
2278
2225
  const a = t.props.children;
2279
2226
  return typeof a != "string" ? t : {
2280
2227
  ...t,
2281
2228
  props: {
2282
2229
  ...t.props,
2283
- children: Fr(a)
2230
+ children: zr(a)
2284
2231
  }
2285
2232
  };
2286
- }), o = He((t) => {
2233
+ }), o = qe((t) => {
2287
2234
  const a = window.getSelection();
2288
2235
  if (!a || a.rangeCount === 0 || a.isCollapsed) return;
2289
2236
  const r = a.getRangeAt(0), i = t.currentTarget;
2290
2237
  if (!i.contains(r.startContainer) || !i.contains(r.endContainer)) return;
2291
- const s = Ir(i, r);
2238
+ const s = Gr(i, r);
2292
2239
  s && (t.preventDefault(), t.clipboardData.setData("text/plain", s.text), t.clipboardData.setData("text/html", s.html));
2293
2240
  }, []);
2294
2241
  return /* @__PURE__ */ c("div", { className: "comment-text", onCopy: o, children: n });
2295
- }, Sr = (e = [], n) => {
2242
+ }, qr = (e = [], n) => {
2296
2243
  let o = {};
2297
2244
  return e.forEach((t) => {
2298
2245
  const a = t.reaction;
2299
- Ct.includes(a) && (o[a] === void 0 && (o[a] = { type: a, isActive: !1, users: [] }), n == t.userName && (o[a].isActive = !0), o[a].users?.push(t.fullName || t.userName));
2300
- }), wr(Object.values(o));
2301
- }, Er = A.div`
2246
+ At.includes(a) && (o[a] === void 0 && (o[a] = { type: a, isActive: !1, users: [] }), n == t.userName && (o[a].isActive = !0), o[a].users?.push(t.fullName || t.userName));
2247
+ }), $r(Object.values(o));
2248
+ }, Wr = A.div`
2302
2249
  display: flex;
2303
2250
  align-items: center;
2304
2251
  gap: var(--base-gap-small);
2305
- `, _r = A.span`
2252
+ `, Qr = A.span`
2306
2253
  border-radius: var(--border-radius-m);
2307
2254
  padding: 2px 6px;
2308
2255
  margin: 0 2px;
@@ -2319,19 +2266,19 @@ ${de}` : de), Ue.current?.focus();
2319
2266
  font-size: 16px;
2320
2267
  font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 300, 'opsz' 20;
2321
2268
  }
2322
- `, Pr = ({ name: e, statuses: n, children: o }) => {
2323
- const t = Rr(e, n);
2324
- return /* @__PURE__ */ y(Er, { children: [
2269
+ `, Yr = ({ name: e, statuses: n, children: o }) => {
2270
+ const t = Kr(e, n);
2271
+ return /* @__PURE__ */ b(Wr, { children: [
2325
2272
  o,
2326
- /* @__PURE__ */ y(_r, { $color: Tt(t.color), style: { backgroundColor: t.color }, children: [
2327
- t.icon && /* @__PURE__ */ c(Z, { icon: t.icon }),
2273
+ /* @__PURE__ */ b(Qr, { $color: Tt(t.color), style: { backgroundColor: t.color }, children: [
2274
+ t.icon && /* @__PURE__ */ c(oe, { icon: t.icon }),
2328
2275
  e
2329
2276
  ] })
2330
2277
  ] });
2331
- }, Rr = (e, n) => {
2278
+ }, Kr = (e, n) => {
2332
2279
  const o = { name: e, color: "var(--md-sys-color-primary)", icon: void 0 };
2333
2280
  return n.find((t) => t.name === e) || o;
2334
- }, Mr = A.header`
2281
+ }, Jr = A.header`
2335
2282
  display: flex;
2336
2283
  align-items: flex-end;
2337
2284
  gap: var(--base-gap-small);
@@ -2343,7 +2290,7 @@ ${de}` : de), Ue.current?.focus();
2343
2290
  margin-left: 4px;
2344
2291
  font-weight: 800;
2345
2292
  }
2346
- `, $r = A.div`
2293
+ `, Xr = A.div`
2347
2294
  display: flex;
2348
2295
  gap: var(--base-gap-small);
2349
2296
  align-items: center;
@@ -2372,7 +2319,121 @@ const bt = A.span`
2372
2319
  strong {
2373
2320
  font-weight: 800;
2374
2321
  }
2375
- `, Dn = ({
2322
+ `, Zr = A.li`
2323
+ list-style: none;
2324
+ margin: var(--padding-s) var(--padding-m);
2325
+ padding: var(--padding-s) var(--padding-m) var(--padding-s) 0;
2326
+
2327
+ display: flex;
2328
+ gap: var(--base-gap-small);
2329
+
2330
+ border: solid 1px currentColor;
2331
+ border-radius: var(--border-radius-l);
2332
+ user-select: none;
2333
+
2334
+ .date, .user-image {
2335
+ flex-shrink: 0;
2336
+ }
2337
+
2338
+ &.approve,
2339
+ &.approve .icon,
2340
+ &.approve .date, {
2341
+ color: var(--md-sys-color-tertiary);
2342
+ }
2343
+
2344
+ &.request_changes,
2345
+ &.request_changes .icon,
2346
+ &.request_changes .date, {
2347
+ color: var(--md-sys-color-error);
2348
+ }
2349
+ `, ei = A.div`
2350
+ display: flex;
2351
+ flex-wrap: nowrap;
2352
+ align-items: center;
2353
+ flex: 1;
2354
+ gap: var(--base-gap-medium);
2355
+ padding: 0px 4px;
2356
+ overflow: hidden;
2357
+ width: 100%;
2358
+
2359
+ .icon {
2360
+ font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 300, 'opsz' 20;
2361
+ font-size: 16px;
2362
+ }
2363
+
2364
+ [icon='trending_flat'] {
2365
+ color: var(--md-sys-color-outline);
2366
+ opacity: 0.5;
2367
+ }
2368
+ `, ti = A.span`
2369
+ white-space: nowrap;
2370
+ font-size: 12px;
2371
+ text-overflow: ellipsis;
2372
+ flex-shrink: 1;
2373
+ overflow: hidden;
2374
+
2375
+ strong {
2376
+ font-size: 12px;
2377
+ font-weight: 800;
2378
+ }
2379
+ `, ni = "#c5c5c5";
2380
+ function Nn(e) {
2381
+ const { categories: n } = $e(), { categoryData: o, categoryNotFound: t } = S(() => {
2382
+ let a = !1;
2383
+ if (e) {
2384
+ const r = n.find((i) => i.name === e);
2385
+ return r || (a = !0), {
2386
+ categoryData: r || {
2387
+ name: e,
2388
+ color: ni
2389
+ },
2390
+ categoryNotFound: a
2391
+ };
2392
+ } else
2393
+ return {
2394
+ categoryData: null,
2395
+ categoryNotFound: a
2396
+ };
2397
+ }, [e, n]);
2398
+ return { categoryData: o, categoryNotFound: t };
2399
+ }
2400
+ const oi = "anonymous.guest", ai = "Anonymous User", ri = "unknown.user", Sn = (e) => !e || !e.name ? ri : e.name === oi && !e.label ? ai : e.label ? e.label : e.name, Ft = "anonymous.guest", ii = ({ isGuest: e, activity: n }) => {
2401
+ const { authorName: o, authorFullName: t, createdAt: a, activityData: r } = n || {}, i = S(
2402
+ () => [
2403
+ Sn({ name: o, label: t }),
2404
+ Fn(r?.feedback ?? Te.APPROVE)
2405
+ ].join(" "),
2406
+ [t, o, r?.feedback, a]
2407
+ ), { categoryData: s, categoryNotFound: l } = Nn(r?.category), u = S(() => {
2408
+ if (!o?.startsWith(Ft))
2409
+ return `/api/users/${o}/avatar`;
2410
+ }, [o]);
2411
+ if (r?.feedback)
2412
+ return /* @__PURE__ */ c(Zr, { className: ln(r.feedback), children: /* @__PURE__ */ b(ei, { children: [
2413
+ o && /* @__PURE__ */ c(
2414
+ gn,
2415
+ {
2416
+ name: o,
2417
+ fullName: t,
2418
+ src: u,
2419
+ size: 22
2420
+ }
2421
+ ),
2422
+ /* @__PURE__ */ c(oe, { icon: Cn(r.feedback) }),
2423
+ s && !e && /* @__PURE__ */ c(
2424
+ at,
2425
+ {
2426
+ value: s.name,
2427
+ color: s.color,
2428
+ isCompact: !0,
2429
+ "data-tooltip": l ? "Category not found. It may have been deleted." : void 0,
2430
+ "data-tooltip-delay": 0
2431
+ }
2432
+ ),
2433
+ /* @__PURE__ */ c(ti, { children: i }),
2434
+ /* @__PURE__ */ c(ct, { date: a, exactTooltip: !0 })
2435
+ ] }) });
2436
+ }, In = ({
2376
2437
  name: e,
2377
2438
  fullName: n,
2378
2439
  date: o,
@@ -2381,59 +2442,51 @@ const bt = A.span`
2381
2442
  children: r,
2382
2443
  projectName: i,
2383
2444
  entityType: s,
2384
- onReferenceClick: d,
2445
+ onReferenceClick: l,
2385
2446
  onReferenceTooltip: u
2386
2447
  }) => {
2387
- const { referenceType: m, origin: p, activityType: g, versions: f, activityId: h } = a, C = m === "mention", F = g === "version.publish", x = f && f?.length > 1 ? "published versions" : "published a version", b = C ? "mentioned" : "commented", k = C ? ` ${s} on` : "on", v = e?.startsWith("guest.") || e?.startsWith(At), $ = (a.author?.deleted || !a.author?.active) && !v, T = _(() => {
2388
- if (!e?.startsWith(At))
2448
+ const { referenceType: m, origin: p, activityType: g, versions: f, activityId: h } = a, k = m === "mention", C = g === "version.publish", y = f && f?.length > 1 ? "published versions" : "published a version", v = k ? "mentioned" : "commented", F = k ? ` ${s} on` : "on", w = e?.startsWith("guest.") || e?.startsWith(Ft), R = (a.author?.deleted || !a.author?.active) && !w, N = S(() => {
2449
+ if (!e?.startsWith(Ft))
2389
2450
  return `/api/users/${e}/avatar`;
2390
2451
  }, [e]);
2391
- return /* @__PURE__ */ y(Mr, { children: [
2392
- /* @__PURE__ */ y($r, { children: [
2393
- e && !$ && /* @__PURE__ */ c(
2394
- pn,
2395
- {
2396
- name: e,
2397
- fullName: n,
2398
- src: T,
2399
- size: 22
2400
- }
2401
- ),
2402
- $ && /* @__PURE__ */ c(Z, { icon: "account_circle" }),
2452
+ return /* @__PURE__ */ b(Jr, { children: [
2453
+ /* @__PURE__ */ b(Xr, { children: [
2454
+ e && !R && /* @__PURE__ */ c(gn, { name: e, fullName: n, src: N, size: 22 }),
2455
+ R && /* @__PURE__ */ c(oe, { icon: "account_circle" }),
2403
2456
  /* @__PURE__ */ c("h5", { children: n || a.activityData?.author || "Unknown" }),
2404
- t && /* @__PURE__ */ y(be, { children: [
2405
- /* @__PURE__ */ c(bt, { children: /* @__PURE__ */ c("strong", { children: b }) }),
2406
- /* @__PURE__ */ c(bt, { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: k }),
2457
+ t && /* @__PURE__ */ b(we, { children: [
2458
+ /* @__PURE__ */ c(bt, { children: /* @__PURE__ */ c("strong", { children: v }) }),
2459
+ /* @__PURE__ */ c(bt, { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: F }),
2407
2460
  p && /* @__PURE__ */ c(
2408
- Po,
2461
+ $o,
2409
2462
  {
2410
2463
  id: p.id,
2411
2464
  type: p.type,
2412
2465
  variant: "text",
2413
- onClick: () => d?.({
2466
+ onClick: () => l?.({
2414
2467
  entityId: p.id,
2415
2468
  entityType: p.type,
2416
2469
  projectName: i,
2417
2470
  activityId: h
2418
2471
  }),
2419
- onMouseEnter: (L, N) => u?.({
2472
+ onMouseEnter: ($, M) => u?.({
2420
2473
  type: p.type,
2421
2474
  id: p.id,
2422
2475
  label: p.label,
2423
2476
  name: p.id,
2424
- pos: N
2477
+ pos: M
2425
2478
  }),
2426
2479
  children: p.label || p.name
2427
2480
  }
2428
2481
  )
2429
2482
  ] }),
2430
- F && /* @__PURE__ */ c(bt, { children: x }),
2483
+ C && /* @__PURE__ */ c(bt, { children: y }),
2431
2484
  r
2432
2485
  ] }),
2433
- /* @__PURE__ */ c(it, { date: o })
2486
+ /* @__PURE__ */ c(ct, { date: o })
2434
2487
  ] });
2435
- }, Lr = ({ flags: e }) => e.length ? /* @__PURE__ */ c(Ro, { children: e.map(({ id: n, label: o, icon: t, tooltip: a, onClick: r, disabled: i, testId: s }) => /* @__PURE__ */ y(
2436
- Mo,
2488
+ }, si = ({ flags: e }) => e.length ? /* @__PURE__ */ c(Lo, { children: e.map(({ id: n, label: o, icon: t, tooltip: a, onClick: r, disabled: i, testId: s }) => /* @__PURE__ */ b(
2489
+ Oo,
2437
2490
  {
2438
2491
  as: r ? "button" : "span",
2439
2492
  type: r ? "button" : void 0,
@@ -2443,12 +2496,12 @@ const bt = A.span`
2443
2496
  "data-tooltip-delay": 0,
2444
2497
  "data-testid": s,
2445
2498
  children: [
2446
- t && /* @__PURE__ */ c(Z, { icon: t }),
2499
+ t && /* @__PURE__ */ c(oe, { icon: t }),
2447
2500
  o
2448
2501
  ]
2449
2502
  },
2450
2503
  n
2451
- )) }) : null, Or = ({
2504
+ )) }) : null, ci = ({
2452
2505
  category: e,
2453
2506
  categoryNotFound: n,
2454
2507
  frameLink: o,
@@ -2475,7 +2528,7 @@ const bt = A.span`
2475
2528
  testId: "comment-frame-link-chip"
2476
2529
  }
2477
2530
  ] : []
2478
- ], Vr = ({
2531
+ ], li = ({
2479
2532
  onDelete: e,
2480
2533
  onEdit: n,
2481
2534
  onCopyText: o,
@@ -2485,37 +2538,37 @@ const bt = A.span`
2485
2538
  projectName: i,
2486
2539
  entity: s
2487
2540
  }) => {
2488
- const d = [], u = (m) => () => {
2541
+ const l = [], u = (m) => () => {
2489
2542
  a?.(), m();
2490
2543
  };
2491
- return n && d.push({
2544
+ return n && l.push({
2492
2545
  id: "edit",
2493
2546
  label: "Edit",
2494
2547
  icon: "edit_square",
2495
2548
  onClick: u(n)
2496
- }), o && d.push({
2549
+ }), o && l.push({
2497
2550
  id: "copy-text",
2498
2551
  label: "Copy text",
2499
2552
  icon: "content_copy",
2500
2553
  onClick: u(o)
2501
- }), t && d.push({
2554
+ }), t && l.push({
2502
2555
  id: "duplicate",
2503
2556
  label: "Duplicate",
2504
2557
  icon: "library_add",
2505
2558
  onClick: u(t)
2506
- }), d.push({
2559
+ }), l.push({
2507
2560
  id: "copy-link",
2508
2561
  label: "Copy link",
2509
2562
  icon: "link",
2510
- onClick: u(() => fn($o(i, r, s)))
2511
- }), e && d.push({
2563
+ onClick: u(() => bn(jo(i, r, s)))
2564
+ }), e && l.push({
2512
2565
  id: "delete",
2513
2566
  label: "Delete",
2514
2567
  icon: "delete",
2515
2568
  onClick: u(e),
2516
2569
  danger: !0
2517
- }), /* @__PURE__ */ c(Jo, { menu: d });
2518
- }, zr = ({
2570
+ }), /* @__PURE__ */ c(Xo, { menu: l });
2571
+ }, di = ({
2519
2572
  activity: e = {},
2520
2573
  onCheckChange: n,
2521
2574
  onDelete: o,
@@ -2524,7 +2577,7 @@ const bt = A.span`
2524
2577
  projectInfo: r,
2525
2578
  editProps: i,
2526
2579
  projectName: s,
2527
- entityType: d,
2580
+ entityType: l,
2528
2581
  onReferenceClick: u,
2529
2582
  onFileExpand: m,
2530
2583
  showOrigin: p,
@@ -2533,227 +2586,227 @@ const bt = A.span`
2533
2586
  statuses: h = []
2534
2587
  }) => {
2535
2588
  const {
2536
- userName: C,
2537
- createReaction: F,
2538
- deleteReaction: P,
2539
- editingId: x,
2540
- setEditingId: b,
2541
- isGuest: k,
2542
- userTeamNames: v
2543
- } = Le(), $ = ge(null), { toggleMenuOpen: T, menuOpen: L } = ra(), { categoryData: N, categoryNotFound: R } = xn(e?.activityData?.category), j = wn(N?.color);
2589
+ userName: k,
2590
+ createReaction: C,
2591
+ deleteReaction: I,
2592
+ editingId: y,
2593
+ setEditingId: v,
2594
+ isGuest: F,
2595
+ userTeamNames: w
2596
+ } = $e(), R = ve(null), { toggleMenuOpen: N, menuOpen: $ } = ka(), { categoryData: M, categoryNotFound: _ } = Nn(e?.activityData?.category), B = kn(M?.color);
2544
2597
  let {
2545
- body: S,
2546
- authorName: Y,
2598
+ body: E,
2599
+ authorName: K,
2547
2600
  authorFullName: H,
2548
- createdAt: oe,
2549
- referenceType: J,
2550
- entityId: B,
2551
- activityId: E,
2601
+ createdAt: le,
2602
+ referenceType: Z,
2603
+ entityId: W,
2604
+ activityId: j,
2552
2605
  author: ae,
2553
- isOwner: Te,
2554
- files: ie = [],
2555
- origin: re
2606
+ isOwner: q,
2607
+ files: re = [],
2608
+ origin: me
2556
2609
  } = e;
2557
- Y || (Y = ae?.name || ""), H = kn({ name: Y, label: H });
2558
- const Re = Kn(), he = `activity-comment-menu-${E}-${Re}`, we = L === he, { onGoToFrame: se, setHighlightedActivities: xe, user: le, commentFrameLink: De } = We(), Ie = !!le?.data?.isAdmin, Ne = Te || Ie, Oe = Te || Ie, Be = () => {
2559
- b(E);
2610
+ K || (K = ae?.name || ""), H = Sn({ name: K, label: H });
2611
+ const Ue = Zn(), he = `activity-comment-menu-${j}-${Ue}`, xe = $ === he, { onGoToFrame: ie, setHighlightedActivities: ke, user: de, commentFrameLink: De } = ze(), Ne = !!de?.data?.isAdmin, Se = q || Ne, Le = q || Ne, Be = () => {
2612
+ v(j);
2560
2613
  }, te = () => {
2561
- b(null);
2562
- }, Ye = async (D, ve, ke) => {
2563
- await t?.(D, ve, void 0, ke), b(null);
2564
- }, Se = x === E, Qe = ({ activityId: D, url: ve }) => {
2565
- document.getElementById(D) ? xe([D]) : window.open(ve, "_blank", "noreferrer");
2566
- }, Ee = J !== "origin" || p, Ve = async () => {
2567
- const D = Cr(S);
2568
- Ee && re && D.push({ id: re.id, type: re.type }), o && await o(E, B, D);
2614
+ v(null);
2615
+ }, Qe = async (T, ye, Ae) => {
2616
+ await t?.(T, ye, void 0, Ae), v(null);
2617
+ }, Ie = y === j, Ye = ({ activityId: T, url: ye }) => {
2618
+ document.getElementById(T) ? ke([T]) : window.open(ye, "_blank", "noreferrer");
2619
+ }, Ee = Z !== "origin" || p, Oe = async () => {
2620
+ const T = Vr(E);
2621
+ Ee && me && T.push({ id: me.id, type: me.type }), o && await o(j, W, T);
2569
2622
  }, fe = () => {
2570
- ga({
2623
+ $a({
2571
2624
  title: "Delete comment",
2572
2625
  message: "Are you sure you want to delete this comment?",
2573
2626
  accept: async () => {
2574
- await Ve();
2627
+ await Oe();
2575
2628
  }
2576
2629
  });
2577
- }, [, _e] = hn(), W = _(
2578
- () => Sr(e.reactions, C),
2630
+ }, [, Me] = vn(), Q = S(
2631
+ () => qr(e.reactions, k),
2579
2632
  [[...e.reactions || []]]
2580
- ), Me = (D) => {
2581
- D.isActive ? F({
2633
+ ), Pe = (T) => {
2634
+ T.isActive ? C({
2582
2635
  projectName: s,
2583
2636
  // @ts-ignore exposed endpoint doesn't need the username, we still need to pass it for the optimistic update
2584
- userName: C,
2585
- activityId: E,
2637
+ userName: k,
2638
+ activityId: j,
2586
2639
  createReactionModel: {
2587
- reaction: D.type
2640
+ reaction: T.type
2588
2641
  }
2589
- }) : P({
2642
+ }) : I({
2590
2643
  projectName: s,
2591
2644
  // @ts-ignore exposed endpoint doesn't need the username, we still need to pass it for the optimistic update
2592
- userName: C,
2593
- activityId: E,
2594
- reaction: D.type
2645
+ userName: k,
2646
+ activityId: j,
2647
+ reaction: T.type
2595
2648
  });
2596
- }, ze = He(
2597
- (D) => {
2598
- D.annotation && (se?.(D.annotation.range[0]), xe([E]));
2649
+ }, je = qe(
2650
+ (T) => {
2651
+ T.annotation && (ie?.(T.annotation.range[0]), ke([j]));
2599
2652
  },
2600
- [se]
2601
- ), ce = _(() => Dt(S), [S]), I = _(
2602
- () => (ie || []).filter((D) => !ce.has(D.id)),
2603
- [ie, ce]
2604
- ), M = (D) => {
2605
- const ve = Wo(D), ke = (ie || []).filter((Pe) => mt(Pe.mime, Pe.ext)), Je = ke.findIndex((Pe) => Pe.id === ve);
2606
- Je !== -1 && m?.({ files: ke, index: Je, activityId: E });
2607
- }, V = _(() => gn(S || ""), [S]), Q = _(() => Nt(e), [e]), ee = De?.formatFrame ?? String, Ke = () => {
2608
- Q && (De ? De.goTo(Q) : se?.(Q.startFrame), xe([E]));
2653
+ [ie]
2654
+ ), se = S(() => Dt(E), [E]), D = S(
2655
+ () => (re || []).filter((T) => !se.has(T.id)),
2656
+ [re, se]
2657
+ ), P = (T) => {
2658
+ const ye = Qo(T), Ae = (re || []).filter((_e) => mt(_e.mime, _e.ext)), Je = Ae.findIndex((_e) => _e.id === ye);
2659
+ Je !== -1 && m?.({ files: Ae, index: Je, activityId: j });
2660
+ }, V = S(() => yn(E || ""), [E]), Y = S(() => St(e), [e]), ee = De?.formatFrame ?? String, Ke = () => {
2661
+ Y && (De ? De.goTo(Y) : ie?.(Y.startFrame), ke([j]));
2609
2662
  };
2610
- return /* @__PURE__ */ y(be, { children: [
2611
- /* @__PURE__ */ y(
2612
- Lo,
2663
+ return /* @__PURE__ */ b(we, { children: [
2664
+ /* @__PURE__ */ b(
2665
+ Vo,
2613
2666
  {
2614
- className: K("comment", {
2615
- isOwner: Te,
2616
- isEditing: Se,
2667
+ className: J("comment", {
2668
+ isOwner: q,
2669
+ isEditing: Ie,
2617
2670
  isHighlighted: g,
2618
- category: !!N && !k,
2619
- menuOpen: we
2671
+ category: !!M && !F,
2672
+ menuOpen: xe
2620
2673
  }),
2621
- id: E,
2622
- $categoryPrimary: N?.color,
2623
- $categoryTertiary: j.primary,
2624
- $categorySecondary: j.secondary,
2674
+ id: j,
2675
+ $categoryPrimary: M?.color,
2676
+ $categoryTertiary: B.primary,
2677
+ $categorySecondary: B.secondary,
2625
2678
  children: [
2626
2679
  /* @__PURE__ */ c(
2627
- Dn,
2680
+ In,
2628
2681
  {
2629
- name: Y,
2682
+ name: K,
2630
2683
  fullName: H,
2631
- date: oe,
2684
+ date: le,
2632
2685
  isRef: Ee,
2633
2686
  activity: e,
2634
2687
  projectName: s,
2635
- entityType: d,
2688
+ entityType: l,
2636
2689
  onReferenceClick: u,
2637
- onReferenceTooltip: _e,
2690
+ onReferenceTooltip: Me,
2638
2691
  children: void 0
2639
2692
  }
2640
2693
  ),
2641
- /* @__PURE__ */ y(Oo, { className: K("comment-body", { isEditing: Se }), children: [
2642
- !f && /* @__PURE__ */ y(Vo, { className: "tools", children: [
2643
- Oe && /* @__PURE__ */ c(Ht, { icon: "edit_square", onClick: Be, variant: "text" }),
2694
+ /* @__PURE__ */ b(zo, { className: J("comment-body", { isEditing: Ie }), children: [
2695
+ !f && /* @__PURE__ */ b(Uo, { className: "tools", children: [
2696
+ Le && /* @__PURE__ */ c(Ht, { icon: "edit_square", onClick: Be, variant: "text" }),
2644
2697
  /* @__PURE__ */ c(
2645
2698
  Ht,
2646
2699
  {
2647
2700
  icon: "more_horiz",
2648
- ref: $,
2649
- onClick: (D) => {
2650
- D.stopPropagation(), T(he);
2701
+ ref: R,
2702
+ onClick: (T) => {
2703
+ T.stopPropagation(), N(he);
2651
2704
  },
2652
- className: we ? "active" : ""
2705
+ className: xe ? "active" : ""
2653
2706
  }
2654
2707
  )
2655
2708
  ] }),
2656
- Se ? /* @__PURE__ */ c(
2657
- Fn,
2709
+ Ie ? /* @__PURE__ */ c(
2710
+ Tn,
2658
2711
  {
2659
- initValue: S,
2660
- initFiles: ie,
2661
- initCategory: N?.name,
2712
+ initValue: E,
2713
+ initFiles: re,
2714
+ initCategory: M?.name,
2662
2715
  data: e.activityData,
2663
- activityId: E,
2716
+ activityId: j,
2664
2717
  versionReview: !1,
2665
2718
  isEditing: !0,
2666
2719
  onClose: te,
2667
- onSubmit: Ye,
2720
+ onSubmit: Qe,
2668
2721
  isOpen: !0,
2669
2722
  ...i
2670
2723
  }
2671
- ) : /* @__PURE__ */ y(be, { children: [
2724
+ ) : /* @__PURE__ */ b(we, { children: [
2672
2725
  /* @__PURE__ */ c(
2673
- Lr,
2726
+ si,
2674
2727
  {
2675
- flags: Or({
2676
- category: N,
2677
- categoryNotFound: R,
2678
- frameLink: Q,
2728
+ flags: ci({
2729
+ category: M,
2730
+ categoryNotFound: _,
2731
+ frameLink: Y,
2679
2732
  formatFrame: ee,
2680
2733
  onFrameLinkClick: Ke,
2681
- canNavigateToFrame: !!De || !!se,
2682
- isGuest: k
2734
+ canNavigateToFrame: !!De || !!ie,
2735
+ isGuest: F
2683
2736
  })
2684
2737
  }
2685
2738
  ),
2686
- /* @__PURE__ */ c(Nr, { children: /* @__PURE__ */ c(
2687
- ln,
2739
+ /* @__PURE__ */ c(Hr, { children: /* @__PURE__ */ c(
2740
+ dn,
2688
2741
  {
2689
- remarkPlugins: [un, dn, Xn, Zn],
2690
- urlTransform: (D) => D,
2742
+ remarkPlugins: [pn, un, to, no],
2743
+ urlTransform: (T) => T,
2691
2744
  components: {
2692
2745
  // a links
2693
2746
  // @ts-ignore
2694
- a: (D) => (
2747
+ a: (T) => (
2695
2748
  // @ts-ignore
2696
- qo(D, {
2697
- entityId: re?.id ?? B,
2698
- entityType: re?.type ?? d,
2699
- userName: C,
2700
- userTeamNames: v,
2749
+ Wo(T, {
2750
+ entityId: me?.id ?? W,
2751
+ entityType: me?.type ?? l,
2752
+ userName: k,
2753
+ userTeamNames: w,
2701
2754
  projectName: s,
2702
2755
  onReferenceClick: u,
2703
- onReferenceTooltip: _e,
2704
- activityId: E,
2705
- categoryPrimary: N?.color,
2706
- categorySecondary: j.secondary,
2707
- onActivityLinkClick: Qe
2756
+ onReferenceTooltip: Me,
2757
+ activityId: j,
2758
+ categoryPrimary: M?.color,
2759
+ categorySecondary: B.secondary,
2760
+ onActivityLinkClick: Ye
2708
2761
  })
2709
2762
  ),
2710
2763
  // checkbox inputs
2711
2764
  // @ts-ignore
2712
- input: (D) => Ho(D, { activity: e, onCheckChange: n }),
2765
+ input: (T) => qo(T, { activity: e, onCheckChange: n }),
2713
2766
  // code syntax highlighting
2714
2767
  // eslint-disable-next-line
2715
2768
  // @ts-ignore
2716
- code: (D) => Go(D),
2769
+ code: (T) => Ho(T),
2717
2770
  // @ts-ignore
2718
- blockquote: (D) => jo(D),
2771
+ blockquote: (T) => Go(T),
2719
2772
  // @ts-ignore
2720
- tip: (D) => /* @__PURE__ */ y(Bo, { children: [
2721
- /* @__PURE__ */ c(Z, { icon: "info" }),
2722
- D.children
2773
+ tip: (T) => /* @__PURE__ */ b(Bo, { children: [
2774
+ /* @__PURE__ */ c(oe, { icon: "info" }),
2775
+ T.children
2723
2776
  ] }),
2724
2777
  // a video url on its own line is an embedded video
2725
2778
  // @ts-ignore
2726
- p: (D) => zo(D, { onOpen: M }) ?? Uo(D) ?? /* @__PURE__ */ c("p", { children: D.children }),
2779
+ p: (T) => ja(T, { onOpen: P }) ?? Oa(T) ?? /* @__PURE__ */ c("p", { children: T.children }),
2727
2780
  // @ts-ignore
2728
- status: (D) => /* @__PURE__ */ c(Pr, { name: D.id, statuses: h, children: D.children })
2781
+ status: (T) => /* @__PURE__ */ c(Yr, { name: T.id, statuses: h, children: T.children })
2729
2782
  },
2730
2783
  children: V
2731
2784
  }
2732
2785
  ) }),
2733
2786
  /* @__PURE__ */ c(
2734
- bn,
2787
+ xn,
2735
2788
  {
2736
- files: I,
2737
- isCompact: I.length > 6,
2738
- activityId: E,
2789
+ files: D,
2790
+ isCompact: D.length > 6,
2791
+ activityId: j,
2739
2792
  projectName: s,
2740
2793
  isDownloadable: !0,
2741
2794
  onExpand: m,
2742
- onAnnotationClick: ze,
2795
+ onAnnotationClick: je,
2743
2796
  onRemove: void 0
2744
2797
  }
2745
2798
  )
2746
2799
  ] }),
2747
- !Se && /* @__PURE__ */ c("div", { style: { marginTop: "16px" }, children: W && /* @__PURE__ */ c(
2748
- Ar,
2800
+ !Ie && /* @__PURE__ */ c("div", { style: { marginTop: "16px" }, children: Q && /* @__PURE__ */ c(
2801
+ jr,
2749
2802
  {
2750
- reactions: W,
2751
- changeHandler: Me,
2803
+ reactions: Q,
2804
+ changeHandler: Pe,
2752
2805
  readOnly: f,
2753
- category: N && !k ? N.name : void 0,
2754
- categoryPrimary: N?.color,
2755
- categorySecondary: j.secondary,
2756
- categoryTertiary: j.primary
2806
+ category: M && !F ? M.name : void 0,
2807
+ categoryPrimary: M?.color,
2808
+ categorySecondary: B.secondary,
2809
+ categoryTertiary: B.primary
2757
2810
  }
2758
2811
  ) })
2759
2812
  ] })
@@ -2761,31 +2814,31 @@ const bt = A.span`
2761
2814
  }
2762
2815
  ),
2763
2816
  /* @__PURE__ */ c(
2764
- Xo,
2817
+ Zo,
2765
2818
  {
2766
- target: $.current,
2819
+ target: R.current,
2767
2820
  id: he,
2768
2821
  align: "right",
2769
- onClose: (D) => {
2770
- D?.stopPropagation(), T(!1);
2822
+ onClose: (T) => {
2823
+ T?.stopPropagation(), N(!1);
2771
2824
  },
2772
2825
  children: /* @__PURE__ */ c(
2773
- Vr,
2826
+ li,
2774
2827
  {
2775
- onDelete: Ne && o ? fe : void 0,
2776
- onEdit: Oe ? Be : void 0,
2777
- onCopyText: V ? () => fn(V) : void 0,
2828
+ onDelete: Se && o ? fe : void 0,
2829
+ onEdit: Le ? Be : void 0,
2830
+ onCopyText: V ? () => bn(V) : void 0,
2778
2831
  onDuplicate: a ? () => a(e) : void 0,
2779
- activityId: E,
2780
- onSelect: () => T(!1),
2832
+ activityId: j,
2833
+ onSelect: () => N(!1),
2781
2834
  projectName: s,
2782
- entity: re ?? (B ? { id: B, type: d } : void 0)
2835
+ entity: me ?? (W ? { id: W, type: l } : void 0)
2783
2836
  }
2784
2837
  )
2785
2838
  }
2786
2839
  )
2787
2840
  ] });
2788
- }, Ur = A.li`
2841
+ }, ui = A.li`
2789
2842
  list-style: none;
2790
2843
  margin: 0;
2791
2844
  padding: 0;
@@ -2795,7 +2848,7 @@ const bt = A.span`
2795
2848
  padding: 4px 8px;
2796
2849
  border-radius: var(--border-radius-m);
2797
2850
  user-select: none;
2798
- `, Br = A.div`
2851
+ `, pi = A.div`
2799
2852
  display: flex;
2800
2853
  flex-wrap: wrap;
2801
2854
  align-items: center;
@@ -2818,10 +2871,10 @@ const bt = A.span`
2818
2871
  font-size: 12px;
2819
2872
  font-weight: 800;
2820
2873
  }
2821
- `, jr = (e, n) => {
2874
+ `, mi = (e, n) => {
2822
2875
  let o = [], t = {};
2823
2876
  return e.activityData.origin.type == "folder" && !t.folder && (t.folder = !0, o.push(e.activityData.origin.name)), e.activityData.origin.type == "task" && !t.task && (t.task = !0, o.push(e.activityData.origin.name)), (n == "version" || e.activityData.origin.type == "version") && (t.product || (t.product = !0, o.push(e.activityData.parents?.find((a) => a.type == "product")?.name)), t.version || (t.version = !0, o.push(e.activityData.origin.name))), o;
2824
- }, Gr = A.div`
2877
+ }, gi = A.div`
2825
2878
  display: inline-flex;
2826
2879
  align-items: center;
2827
2880
  gap: var(--base-gap-small);
@@ -2830,7 +2883,7 @@ const bt = A.span`
2830
2883
  font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 300, 'opsz' 20;
2831
2884
  font-size: 16px;
2832
2885
  }
2833
- `, Hr = A.span`
2886
+ `, hi = A.span`
2834
2887
  color: var(--md-sys-color-outline);
2835
2888
  font-size: 12px;
2836
2889
  max-width: 300px;
@@ -2840,18 +2893,18 @@ const bt = A.span`
2840
2893
  span {
2841
2894
  font-size: inherit;
2842
2895
  }
2843
- `, Ft = ut(
2844
- ({ icon: e, color: n, name: o, items: t, ...a }, r) => /* @__PURE__ */ y(Gr, { ...a, ref: r, children: [
2845
- e && /* @__PURE__ */ c(Z, { icon: e, style: { color: n } }),
2846
- /* @__PURE__ */ c(Hr, { title: o, children: t ? t.map((i, s) => /* @__PURE__ */ y(Jn, { children: [
2896
+ `, Ct = pt(
2897
+ ({ icon: e, color: n, name: o, items: t, ...a }, r) => /* @__PURE__ */ b(gi, { ...a, ref: r, children: [
2898
+ e && /* @__PURE__ */ c(oe, { icon: e, style: { color: n } }),
2899
+ /* @__PURE__ */ c(hi, { title: o, children: t ? t.map((i, s) => /* @__PURE__ */ b(eo, { children: [
2847
2900
  /* @__PURE__ */ c("span", { style: { color: i.color }, children: i.label }),
2848
2901
  s < t.length - 1 && ", "
2849
2902
  ] }, s)) : o })
2850
2903
  ] })
2851
- ), qr = (e) => {
2904
+ ), fi = (e) => {
2852
2905
  const n = typeof e.icon == "string" ? e.icon : e.icon?.name, o = e.color ?? (typeof e.icon == "object" ? e.icon?.color : void 0);
2853
2906
  return { name: e.label, icon: n, color: o };
2854
- }, Wr = (e, n) => {
2907
+ }, yi = (e, n) => {
2855
2908
  const o = n?.data.enum?.find((t) => t.value === e)?.label;
2856
2909
  if (o) return o;
2857
2910
  if (n?.data.type === "datetime") {
@@ -2859,18 +2912,18 @@ const bt = A.span`
2859
2912
  if (!isNaN(t.getTime())) return Yo(t, "dd-MM-yyyy");
2860
2913
  }
2861
2914
  return String(e);
2862
- }, Yr = (e, n) => e === "description" || n?.data.widget === "markdown", Qr = (e, n, o) => {
2915
+ }, vi = (e, n) => e === "description" || n?.data.widget === "markdown", bi = (e, n, o) => {
2863
2916
  if (e == null || e === "" || Array.isArray(e) && !e.length) return { name: "none" };
2864
- if (typeof e == "string" && Yr(o, n))
2865
- return { name: ha(e) || "none" };
2917
+ if (typeof e == "string" && vi(o, n))
2918
+ return { name: La(e) || "none" };
2866
2919
  if (n?.data.type === "boolean") return { name: e ? "Checked" : "Unchecked" };
2867
2920
  const a = Array.isArray(e) ? e : [e];
2868
2921
  if (a.length === 1) {
2869
2922
  const r = n?.data.enum?.find((i) => i.value === a[0]);
2870
- if (r) return qr(r);
2923
+ if (r) return fi(r);
2871
2924
  }
2872
- return { name: a.map((r) => Wr(r, n)).join(", ") };
2873
- }, Kr = ({
2925
+ return { name: a.map((r) => yi(r, n)).join(", ") };
2926
+ }, wi = ({
2874
2927
  entityType: e,
2875
2928
  projectInfo: n,
2876
2929
  activity: o = {}
@@ -2881,37 +2934,37 @@ const bt = A.span`
2881
2934
  authorFullName: r,
2882
2935
  createdAt: i,
2883
2936
  oldStatus: s,
2884
- newStatus: d,
2937
+ newStatus: l,
2885
2938
  activityData: u = {}
2886
- } = o, { key: m, oldValue: p, newValue: g } = u, f = jr(o, e), h = t === "attrib.change", C = t === "tags.change", F = t === "subtype.change", { data: P = [] } = ta(void 0, { skip: !h }), x = _(() => P.find((R) => R.name === m), [P, m]), b = h ? x?.data.title || m : C ? "Tags" : F ? "Type" : void 0, k = (R) => ({
2887
- name: R?.name || "",
2888
- icon: R?.icon,
2889
- color: R?.color
2890
- }), v = (R) => {
2891
- const j = Array.isArray(R) ? R.map(String) : [];
2892
- if (!j.length) return { name: "none" };
2893
- const S = j.map((Y) => ({
2894
- label: Y,
2895
- color: n?.tags?.find((H) => H.name === Y)?.color
2939
+ } = o, { key: m, oldValue: p, newValue: g } = u, f = mi(o, e), h = t === "attrib.change", k = t === "tags.change", C = t === "subtype.change", { data: I = [] } = pa(void 0, { skip: !h }), y = S(() => I.find((_) => _.name === m), [I, m]), v = h ? y?.data.title || m : k ? "Tags" : C ? "Type" : void 0, F = (_) => ({
2940
+ name: _?.name || "",
2941
+ icon: _?.icon,
2942
+ color: _?.color
2943
+ }), w = (_) => {
2944
+ const B = Array.isArray(_) ? _.map(String) : [];
2945
+ if (!B.length) return { name: "none" };
2946
+ const E = B.map((K) => ({
2947
+ label: K,
2948
+ color: n?.tags?.find((H) => H.name === K)?.color
2896
2949
  }));
2897
- return { name: j.join(", "), items: S };
2898
- }, $ = t === "status.change", T = (R, j) => $ ? k(j) : C ? v(R) : Qr(R, x, m), L = T(p, s), N = T(g, d);
2899
- return /* @__PURE__ */ y(Ur, { children: [
2900
- /* @__PURE__ */ y(Br, { children: [
2950
+ return { name: B.join(", "), items: E };
2951
+ }, R = t === "status.change", N = (_, B) => R ? F(B) : k ? w(_) : bi(_, y, m), $ = N(p, s), M = N(g, l);
2952
+ return /* @__PURE__ */ b(ui, { children: [
2953
+ /* @__PURE__ */ b(pi, { children: [
2901
2954
  /* @__PURE__ */ c(wt, { children: r || a }),
2902
- /* @__PURE__ */ y(wt, { children: [
2955
+ /* @__PURE__ */ b(wt, { children: [
2903
2956
  "- ",
2904
2957
  f.join(" / "),
2905
2958
  " -"
2906
2959
  ] }),
2907
- b && /* @__PURE__ */ c(wt, { children: /* @__PURE__ */ c("strong", { children: b }) }),
2908
- /* @__PURE__ */ c(Ft, { ...L }),
2909
- /* @__PURE__ */ c(Z, { icon: "trending_flat" }),
2910
- /* @__PURE__ */ c(Ft, { ...N })
2960
+ v && /* @__PURE__ */ c(wt, { children: /* @__PURE__ */ c("strong", { children: v }) }),
2961
+ /* @__PURE__ */ c(Ct, { ...$ }),
2962
+ /* @__PURE__ */ c(oe, { icon: "trending_flat" }),
2963
+ /* @__PURE__ */ c(Ct, { ...M })
2911
2964
  ] }),
2912
- /* @__PURE__ */ c(it, { date: i })
2965
+ /* @__PURE__ */ c(ct, { date: i })
2913
2966
  ] });
2914
- }, Jr = A.li`
2967
+ }, xi = A.li`
2915
2968
  /* reset default */
2916
2969
  list-style: none;
2917
2970
  margin: 0;
@@ -2924,7 +2977,7 @@ const bt = A.span`
2924
2977
  padding: 4px 8px;
2925
2978
  border-radius: var(--border-radius-m);
2926
2979
  user-select: none;
2927
- `, Xr = A.div`
2980
+ `, ki = A.div`
2928
2981
  display: flex;
2929
2982
  flex-wrap: nowrap;
2930
2983
  align-items: start;
@@ -2932,18 +2985,18 @@ const bt = A.span`
2932
2985
  gap: var(--base-gap-small);
2933
2986
  padding: 0px 4px;
2934
2987
  overflow: hidden;
2935
- `, Zr = A.span`
2988
+ `, Ai = A.span`
2936
2989
  color: var(--md-sys-color-outline);
2937
2990
  white-space: wrap;
2938
2991
  font-size: 12px;
2939
- `, nn = ({ activity: e, isAdding: n }) => {
2992
+ `, on = ({ activity: e, isAdding: n }) => {
2940
2993
  const { authorFullName: o, createdAt: t, activityData: a, authorName: r } = e || {}, { assignee: i } = a || {};
2941
2994
  let s = o || r;
2942
- return s += n ? " added " : " removed ", s += "assignee: " + i, /* @__PURE__ */ c(Jr, { children: /* @__PURE__ */ y(Xr, { children: [
2943
- /* @__PURE__ */ c(Zr, { children: s }),
2944
- /* @__PURE__ */ c(it, { date: t })
2995
+ return s += n ? " added " : " removed ", s += "assignee: " + i, /* @__PURE__ */ c(xi, { children: /* @__PURE__ */ b(ki, { children: [
2996
+ /* @__PURE__ */ c(Ai, { children: s }),
2997
+ /* @__PURE__ */ c(ct, { date: t })
2945
2998
  ] }) });
2946
- }, ei = A.li`
2999
+ }, Fi = A.li`
2947
3000
  /* reset default */
2948
3001
  list-style: none;
2949
3002
  margin: 0;
@@ -2955,7 +3008,7 @@ const bt = A.span`
2955
3008
 
2956
3009
  width: 100%;
2957
3010
  padding: 8px;
2958
- `, ti = A.div`
3011
+ `, Ci = A.div`
2959
3012
  border-radius: var(--border-radius-m);
2960
3013
  padding: var(--padding-m);
2961
3014
 
@@ -2971,7 +3024,7 @@ const bt = A.span`
2971
3024
  display: inline;
2972
3025
  }
2973
3026
  }
2974
- `, ni = A.div`
3027
+ `, Ti = A.div`
2975
3028
  display: flex;
2976
3029
  flex-direction: row;
2977
3030
  justify-content: space-between;
@@ -2985,7 +3038,7 @@ const bt = A.span`
2985
3038
  min-width: 0;
2986
3039
  overflow: hidden;
2987
3040
  }
2988
- `, on = A.div`
3041
+ `, an = A.div`
2989
3042
  display: flex;
2990
3043
  align-items: center;
2991
3044
  justify-content: space-between;
@@ -3009,7 +3062,7 @@ const bt = A.span`
3009
3062
  display: none;
3010
3063
  flex: 1;
3011
3064
  }
3012
- `, oi = A(Zo)`
3065
+ `, Di = A(ba)`
3013
3066
  width: 74px;
3014
3067
  min-width: 74px;
3015
3068
  height: unset;
@@ -3023,23 +3076,23 @@ const bt = A.span`
3023
3076
  img {
3024
3077
  object-fit: cover;
3025
3078
  }
3026
- `, ai = A.span`
3079
+ `, Ni = A.span`
3027
3080
  overflow: hidden;
3028
3081
  text-overflow: ellipsis;
3029
3082
  white-space: nowrap;
3030
3083
  display: block;
3031
3084
  min-width: 0;
3032
- `, ri = A.div`
3085
+ `, Si = A.div`
3033
3086
  margin-top: var(--base-gap-small);
3034
3087
  color: var(--md-sys-color-outline);
3035
3088
  word-break: break-word;
3036
- `, ii = A.li`
3089
+ `, Ii = A.li`
3037
3090
  /* reset default */
3038
3091
  list-style: none;
3039
3092
  margin: 0;
3040
3093
  padding: 0;
3041
3094
  padding: 0px 8px;
3042
- `, In = A.div`
3095
+ `, En = A.div`
3043
3096
  width: 100%;
3044
3097
  display: flex;
3045
3098
  align-items: center;
@@ -3062,7 +3115,7 @@ const bt = A.span`
3062
3115
  &:hover {
3063
3116
  background-color: var(--md-sys-color-surface-container-hover);
3064
3117
  }
3065
- `, si = ({
3118
+ `, Ei = ({
3066
3119
  activity: e,
3067
3120
  projectName: n,
3068
3121
  entityType: o,
@@ -3070,15 +3123,15 @@ const bt = A.span`
3070
3123
  filter: a,
3071
3124
  statuses: r = []
3072
3125
  }) => {
3073
- const { onOpenViewer: i } = We();
3074
- let { authorName: s, authorFullName: d, createdAt: u, versions: m = [] } = e;
3075
- const p = a === "versions" || a && typeof a == "object" && a.conditions?.some((x) => x.key === "versions" && x.value === !0), [g, f] = q(p), h = 2, [C, F] = q(!1), P = (x, b) => i?.({ versionIds: [x], productId: b, projectName: n });
3076
- return /* @__PURE__ */ y(ei, { children: [
3126
+ const { onOpenViewer: i } = ze();
3127
+ let { authorName: s, authorFullName: l, createdAt: u, versions: m = [] } = e;
3128
+ const p = a === "versions" || a && typeof a == "object" && a.conditions?.some((y) => y.key === "versions" && y.value === !0), [g, f] = O(p), h = 2, [k, C] = O(!1), I = (y, v) => i?.({ versionIds: [y], productId: v, projectName: n });
3129
+ return /* @__PURE__ */ b(Fi, { children: [
3077
3130
  /* @__PURE__ */ c(
3078
- Dn,
3131
+ In,
3079
3132
  {
3080
3133
  name: s,
3081
- fullName: d || s,
3134
+ fullName: l || s,
3082
3135
  date: u,
3083
3136
  activity: e,
3084
3137
  projectName: n,
@@ -3086,60 +3139,60 @@ const bt = A.span`
3086
3139
  onReferenceClick: t
3087
3140
  }
3088
3141
  ),
3089
- m.flatMap((x, b) => {
3090
- const { name: k, id: v, productId: $, productName: T, thumbnailHash: L, comment: N } = x, R = r.find((j) => j.name === x.status);
3091
- return (b < h || g) && /* @__PURE__ */ y(ti, { onClick: () => P(v, $), children: [
3092
- /* @__PURE__ */ y(ni, { children: [
3093
- /* @__PURE__ */ y("div", { children: [
3094
- /* @__PURE__ */ y(on, { children: [
3095
- /* @__PURE__ */ c("span", { children: T }),
3096
- /* @__PURE__ */ c(it, { date: u, isExact: !0 })
3142
+ m.flatMap((y, v) => {
3143
+ const { name: F, id: w, productId: R, productName: N, thumbnailHash: $, comment: M } = y, _ = r.find((B) => B.name === y.status);
3144
+ return (v < h || g) && /* @__PURE__ */ b(Ci, { onClick: () => I(w, R), children: [
3145
+ /* @__PURE__ */ b(Ti, { children: [
3146
+ /* @__PURE__ */ b("div", { children: [
3147
+ /* @__PURE__ */ b(an, { children: [
3148
+ /* @__PURE__ */ c("span", { children: N }),
3149
+ /* @__PURE__ */ c(ct, { date: u, isExact: !0 })
3097
3150
  ] }),
3098
- /* @__PURE__ */ y(on, { children: [
3099
- /* @__PURE__ */ c(ai, { className: "version", children: k }),
3151
+ /* @__PURE__ */ b(an, { children: [
3152
+ /* @__PURE__ */ c(Ni, { className: "version", children: F }),
3100
3153
  " -",
3101
3154
  /* @__PURE__ */ c(
3102
- Ft,
3155
+ Ct,
3103
3156
  {
3104
- icon: R?.icon,
3105
- color: R?.color,
3106
- name: R?.name || ""
3157
+ icon: _?.icon,
3158
+ color: _?.color,
3159
+ name: _?.name || ""
3107
3160
  }
3108
3161
  )
3109
3162
  ] })
3110
3163
  ] }),
3111
3164
  /* @__PURE__ */ c(
3112
- oi,
3165
+ Di,
3113
3166
  {
3114
3167
  projectName: n,
3115
- entityId: v,
3168
+ entityId: w,
3116
3169
  entityType: "version",
3117
- onError: () => F(!0),
3118
- iconOnly: C,
3119
- thumbnailHash: L,
3170
+ onError: () => C(!0),
3171
+ iconOnly: k,
3172
+ thumbnailHash: $,
3120
3173
  icon: "play_circle"
3121
3174
  }
3122
3175
  )
3123
3176
  ] }),
3124
- N && /* @__PURE__ */ c(ri, { children: N })
3125
- ] }, v);
3177
+ M && /* @__PURE__ */ c(Si, { children: M })
3178
+ ] }, w);
3126
3179
  }),
3127
- !p && m.length > h && /* @__PURE__ */ y(In, { onClick: () => f(!g), children: [
3128
- /* @__PURE__ */ c(Z, { icon: "more" }),
3180
+ !p && m.length > h && /* @__PURE__ */ b(En, { onClick: () => f(!g), children: [
3181
+ /* @__PURE__ */ c(oe, { icon: "more" }),
3129
3182
  /* @__PURE__ */ c("span", { children: g ? "Show less" : `Show ${m.length - h} more versions` })
3130
3183
  ] })
3131
3184
  ] });
3132
- }, ci = ({ activities: e, editProps: n, ...o }) => {
3133
- const [t, a] = q(!1);
3134
- return /* @__PURE__ */ y(be, { children: [
3135
- /* @__PURE__ */ c(ii, { children: /* @__PURE__ */ y(In, { onClick: () => a(!t), children: [
3136
- /* @__PURE__ */ c(Z, { icon: t ? "expand_less" : "chevron_right" }),
3185
+ }, Mi = ({ activities: e, editProps: n, ...o }) => {
3186
+ const [t, a] = O(!1);
3187
+ return /* @__PURE__ */ b(we, { children: [
3188
+ /* @__PURE__ */ c(Ii, { children: /* @__PURE__ */ b(En, { onClick: () => a(!t), children: [
3189
+ /* @__PURE__ */ c(oe, { icon: t ? "expand_less" : "chevron_right" }),
3137
3190
  t ? "Show less" : "Show more"
3138
3191
  ] }) }),
3139
3192
  t && e.map((r) => (
3140
3193
  // @ts-expect-error
3141
3194
  /* @__PURE__ */ c(
3142
- Nn,
3195
+ Mn,
3143
3196
  {
3144
3197
  editProps: n,
3145
3198
  activity: r,
@@ -3150,7 +3203,7 @@ const bt = A.span`
3150
3203
  )
3151
3204
  ))
3152
3205
  ] });
3153
- }, Nn = ({
3206
+ }, Mn = ({
3154
3207
  activity: e,
3155
3208
  fromGroup: n,
3156
3209
  projectInfo: o,
@@ -3159,7 +3212,7 @@ const bt = A.span`
3159
3212
  filter: r,
3160
3213
  readOnly: i,
3161
3214
  statuses: s,
3162
- isSlideOut: d,
3215
+ isSlideOut: l,
3163
3216
  isGuest: u,
3164
3217
  ...m
3165
3218
  }) => {
@@ -3168,14 +3221,14 @@ const bt = A.span`
3168
3221
  return (
3169
3222
  // @ts-expect-error
3170
3223
  /* @__PURE__ */ c(
3171
- zr,
3224
+ di,
3172
3225
  {
3173
3226
  activity: e,
3174
3227
  projectInfo: o,
3175
3228
  editProps: a,
3176
3229
  readOnly: i,
3177
3230
  statuses: s,
3178
- isSlideOut: d,
3231
+ isSlideOut: l,
3179
3232
  ...m
3180
3233
  }
3181
3234
  )
@@ -3184,18 +3237,18 @@ const bt = A.span`
3184
3237
  case "attrib.change":
3185
3238
  case "tags.change":
3186
3239
  case "subtype.change":
3187
- return /* @__PURE__ */ c(Kr, { activity: e, projectInfo: o, ...m });
3240
+ return /* @__PURE__ */ c(wi, { activity: e, projectInfo: o, ...m });
3188
3241
  case "assignee.add":
3189
- return /* @__PURE__ */ c(nn, { activity: e, ...m, isAdding: !0 });
3242
+ return /* @__PURE__ */ c(on, { activity: e, ...m, isAdding: !0 });
3190
3243
  case "assignee.remove":
3191
- return /* @__PURE__ */ c(nn, { activity: e, ...m });
3244
+ return /* @__PURE__ */ c(on, { activity: e, ...m });
3192
3245
  case "version.publish":
3193
- return /* @__PURE__ */ c(si, { activity: e, projectInfo: o, filter: r, statuses: s, ...m });
3246
+ return /* @__PURE__ */ c(Ei, { activity: e, projectInfo: o, filter: r, statuses: s, ...m });
3194
3247
  case "version.review":
3195
- return /* @__PURE__ */ c(cr, { activity: e, isGuest: u, ...m });
3248
+ return /* @__PURE__ */ c(ii, { activity: e, isGuest: u, ...m });
3196
3249
  case "group":
3197
3250
  return !n && /* @__PURE__ */ c(
3198
- ci,
3251
+ Mi,
3199
3252
  {
3200
3253
  editProps: a,
3201
3254
  activities: e.items || [],
@@ -3206,7 +3259,7 @@ const bt = A.span`
3206
3259
  default:
3207
3260
  return null;
3208
3261
  }
3209
- }, li = A.section`
3262
+ }, _i = A.section`
3210
3263
  padding-bottom: 4px;
3211
3264
  overflow: hidden;
3212
3265
  position: relative;
@@ -3254,7 +3307,7 @@ A.div`
3254
3307
  color: inherit;
3255
3308
  }
3256
3309
  `;
3257
- const di = A.ul`
3310
+ const Pi = A.ul`
3258
3311
  gap: var(--base-gap-large);
3259
3312
  overflow-y: auto;
3260
3313
  padding: 24px 0;
@@ -3275,11 +3328,11 @@ const di = A.ul`
3275
3328
  & > *:last-child {
3276
3329
  margin-top: 32px;
3277
3330
  }
3278
- `, ui = A.span`
3331
+ `, Ri = A.span`
3279
3332
  padding: 16px 8px;
3280
3333
  color: var(--md-sys-color-outline);
3281
3334
  font-size: 11px;
3282
- `, pi = A.div`
3335
+ `, $i = A.div`
3283
3336
  height: 50px;
3284
3337
  border-radius: 8px;
3285
3338
  overflow: hidden;
@@ -3287,7 +3340,7 @@ const di = A.ul`
3287
3340
  opacity: 0.5;
3288
3341
 
3289
3342
  position: relative;
3290
- `, mi = ({
3343
+ `, Li = ({
3291
3344
  projectName: e,
3292
3345
  entityType: n,
3293
3346
  entities: o = [],
@@ -3298,33 +3351,33 @@ const di = A.ul`
3298
3351
  createEntityActivity: r,
3299
3352
  updateActivity: i,
3300
3353
  deleteActivity: s,
3301
- isUpdatingActivity: d,
3354
+ isUpdatingActivity: l,
3302
3355
  userName: u,
3303
3356
  userFullName: m,
3304
3357
  activityTypes: p
3305
- } = Le(), g = o.map((x) => x.id), f = ({
3306
- entityId: x,
3307
- newId: b,
3308
- subTitle: k,
3309
- value: v,
3310
- files: $ = [],
3311
- data: T = {}
3358
+ } = $e(), g = o.map((y) => y.id), f = ({
3359
+ entityId: y,
3360
+ newId: v,
3361
+ subTitle: F,
3362
+ value: w,
3363
+ files: R = [],
3364
+ data: N = {}
3312
3365
  }) => ({
3313
- body: v,
3366
+ body: w,
3314
3367
  activityType: "comment",
3315
- activityId: b,
3316
- entityId: x,
3368
+ activityId: v,
3369
+ entityId: y,
3317
3370
  referenceType: "origin",
3318
3371
  authorName: u,
3319
3372
  authorFullName: m,
3320
- createdAt: ia(/* @__PURE__ */ new Date()),
3321
- files: $,
3373
+ createdAt: Na(/* @__PURE__ */ new Date()),
3374
+ files: R,
3322
3375
  reactions: [],
3323
- activityData: T,
3376
+ activityData: N,
3324
3377
  origin: {
3325
3378
  id: "8090c2dafcc811eeaf820242c0a80002",
3326
3379
  type: n,
3327
- name: k
3380
+ name: F
3328
3381
  },
3329
3382
  author: {
3330
3383
  active: !0,
@@ -3332,95 +3385,95 @@ const di = A.ul`
3332
3385
  }
3333
3386
  });
3334
3387
  return {
3335
- submitComment: async (x, b = [], k = {}) => {
3336
- const v = o.map(({ id: L, subTitle: N }) => {
3337
- const R = Yt(), j = b.map((B) => B.id), S = a ? { ...k, entityList: a } : k, Y = {
3338
- body: x,
3388
+ submitComment: async (y, v = [], F = {}) => {
3389
+ const w = o.map(({ id: $, subTitle: M }) => {
3390
+ const _ = Yt(), B = v.map((W) => W.id), E = a ? { ...F, entityList: a } : F, K = {
3391
+ body: y,
3339
3392
  activityType: "comment",
3340
- id: R,
3341
- files: j,
3342
- data: S
3343
- }, H = b.filter(
3344
- ({ id: B }) => !k.annotations?.some(
3345
- (E) => E.transparent === B
3393
+ id: _,
3394
+ files: B,
3395
+ data: E
3396
+ }, H = v.filter(
3397
+ ({ id: W }) => !F.annotations?.some(
3398
+ (j) => j.transparent === W
3346
3399
  )
3347
- ), oe = f({ entityId: L, newId: R, subTitle: N, value: x, files: H, data: k });
3400
+ ), le = f({ entityId: $, newId: _, subTitle: M, value: y, files: H, data: F });
3348
3401
  return r({
3349
3402
  projectName: e,
3350
3403
  entityType: n,
3351
- entityId: L,
3352
- data: Y,
3353
- patch: oe,
3404
+ entityId: $,
3405
+ data: K,
3406
+ patch: le,
3354
3407
  filter: t,
3355
3408
  ...{ entityIds: g, activityTypes: p }
3356
3409
  });
3357
- }), T = (await Promise.all(v)).filter((L) => L.error);
3358
- if (T.length > 0) {
3359
- const L = Wt(T[0].error) || "Failed to create comment";
3360
- throw ye.error(L), new Error(L);
3410
+ }), N = (await Promise.all(w)).filter(($) => $.error);
3411
+ if (N.length > 0) {
3412
+ const $ = qt(N[0].error) || "Failed to create comment";
3413
+ throw be.error($), new Error($);
3361
3414
  }
3362
3415
  },
3363
- updateComment: async (x, b, k = [], v = {}) => {
3364
- const $ = k.map((R) => R.id), T = {
3365
- body: b,
3366
- files: $,
3367
- data: v
3368
- }, L = {
3369
- ...x,
3370
- ...T,
3371
- files: k,
3372
- activityData: v
3373
- }, N = { entityType: n, entityIds: g, activityTypes: p };
3416
+ updateComment: async (y, v, F = [], w = {}) => {
3417
+ const R = F.map((_) => _.id), N = {
3418
+ body: v,
3419
+ files: R,
3420
+ data: w
3421
+ }, $ = {
3422
+ ...y,
3423
+ ...N,
3424
+ files: F,
3425
+ activityData: w
3426
+ }, M = { entityType: n, entityIds: g, activityTypes: p };
3374
3427
  try {
3375
3428
  await i({
3376
3429
  projectName: e,
3377
- data: T,
3378
- activityId: x.activityId,
3379
- entityId: x.entityId,
3380
- patch: L,
3430
+ data: N,
3431
+ activityId: y.activityId,
3432
+ entityId: y.entityId,
3433
+ patch: $,
3381
3434
  filter: t,
3382
- ...N
3435
+ ...M
3383
3436
  });
3384
- } catch (R) {
3385
- throw ye.error(Wt(R)), R;
3437
+ } catch (_) {
3438
+ throw be.error(qt(_)), _;
3386
3439
  }
3387
3440
  },
3388
- deleteComment: async (x, b, k = []) => {
3389
- const v = { entityType: n, entityIds: g, activityTypes: p };
3390
- if (x)
3441
+ deleteComment: async (y, v, F = []) => {
3442
+ const w = { entityType: n, entityIds: g, activityTypes: p };
3443
+ if (y)
3391
3444
  try {
3392
3445
  await s({
3393
3446
  projectName: e,
3394
- activityId: x,
3395
- entityId: b,
3447
+ activityId: y,
3448
+ entityId: v,
3396
3449
  filter: t,
3397
- patch: { activityId: x },
3398
- refs: k,
3399
- ...v
3450
+ patch: { activityId: y },
3451
+ refs: F,
3452
+ ...w
3400
3453
  });
3401
3454
  } catch {
3402
3455
  }
3403
3456
  },
3404
- submitReview: async (x) => {
3405
- const b = o.map(({ id: k, subTitle: v }) => {
3406
- const $ = Yt(), T = { feedback: x, entityList: a }, L = {
3407
- body: sr(x, n),
3457
+ submitReview: async (y) => {
3458
+ const v = o.map(({ id: F, subTitle: w }) => {
3459
+ const R = Yt(), N = { feedback: y, entityList: a }, $ = {
3460
+ body: Fr(y, n),
3408
3461
  activityType: "version.review",
3409
- id: $,
3410
- data: T
3411
- }, N = f({ entityId: k, newId: $, subTitle: v, value: "", data: T });
3462
+ id: R,
3463
+ data: N
3464
+ }, M = f({ entityId: F, newId: R, subTitle: w, value: "", data: N });
3412
3465
  return r({
3413
3466
  projectName: e,
3414
3467
  entityType: n,
3415
- entityId: k,
3416
- data: L,
3417
- patch: N,
3468
+ entityId: F,
3469
+ data: $,
3470
+ patch: M,
3418
3471
  filter: t
3419
3472
  });
3420
3473
  });
3421
- await Promise.all(b);
3474
+ await Promise.all(v);
3422
3475
  },
3423
- isSaving: d
3476
+ isSaving: l
3424
3477
  };
3425
3478
  }, xt = (e = {}) => {
3426
3479
  const {
@@ -3429,9 +3482,9 @@ const di = A.ul`
3429
3482
  origin: t = {},
3430
3483
  activityData: { context: { productName: a, productType: r, productId: i } = {} } = {},
3431
3484
  version: s
3432
- } = e, { name: d, id: u } = t;
3485
+ } = e, { name: l, id: u } = t;
3433
3486
  return {
3434
- name: d,
3487
+ name: l,
3435
3488
  id: u,
3436
3489
  productId: i,
3437
3490
  productName: a,
@@ -3442,7 +3495,7 @@ const di = A.ul`
3442
3495
  status: s?.status,
3443
3496
  thumbnailHash: s?.thumbnailHash
3444
3497
  };
3445
- }, gi = 5, hi = (e = []) => {
3498
+ }, Oi = 5, ji = (e = []) => {
3446
3499
  const n = [];
3447
3500
  let o = null;
3448
3501
  for (const t of e) {
@@ -3454,10 +3507,10 @@ const di = A.ul`
3454
3507
  o = { ...t }, o.versions = [xt(t)];
3455
3508
  continue;
3456
3509
  }
3457
- const a = o.authorName === t.authorName, r = o.origin.id === t.origin.id, s = sa(
3510
+ const a = o.authorName === t.authorName, r = o.origin.id === t.origin.id, s = Sa(
3458
3511
  new Date(o.createdAt),
3459
3512
  new Date(t.createdAt)
3460
- ) <= gi;
3513
+ ) <= Oi;
3461
3514
  if (a && s && r) {
3462
3515
  o.versions.push(xt(t));
3463
3516
  continue;
@@ -3467,13 +3520,13 @@ const di = A.ul`
3467
3520
  }
3468
3521
  }
3469
3522
  return o && n.push(o), n;
3470
- }, fi = (e, n) => {
3523
+ }, Vi = (e, n) => {
3471
3524
  let o = {};
3472
- n.reduce((s, d) => (s[d.name] = d, s), o);
3525
+ n.reduce((s, l) => (s[l.name] = l, s), o);
3473
3526
  const t = [];
3474
3527
  let a = [];
3475
3528
  const r = (s) => {
3476
- const d = (f) => ["assignee.add", "assignee.remove"].includes(f[0].activityType) ? [
3529
+ const l = (f) => ["assignee.add", "assignee.remove"].includes(f[0].activityType) ? [
3477
3530
  {
3478
3531
  ...f[0],
3479
3532
  activityType: f[0].activityType,
@@ -3492,9 +3545,9 @@ const di = A.ul`
3492
3545
  ] : f;
3493
3546
  let u = [], m = [], p = null, g = null;
3494
3547
  return s.forEach((f) => {
3495
- p === null || p === f.activityType && g == f.authorName ? m.push(f) : (u.push(...d(m)), m = [f]), p = f.activityType, g = f.authorName;
3496
- }), m.length != 0 && u.push(...d(m)), u;
3497
- }, i = (s, d) => {
3548
+ p === null || p === f.activityType && g == f.authorName ? m.push(f) : (u.push(...l(m)), m = [f]), p = f.activityType, g = f.authorName;
3549
+ }), m.length != 0 && u.push(...l(m)), u;
3550
+ }, i = (s, l) => {
3498
3551
  if (a.length > 2) {
3499
3552
  if (s) {
3500
3553
  const u = a[0].activityData.assignee;
@@ -3509,20 +3562,20 @@ const di = A.ul`
3509
3562
  t.push({
3510
3563
  activityType: "group",
3511
3564
  items: r(s ? a.slice(1) : a),
3512
- activityId: "group-" + d
3565
+ activityId: "group-" + l
3513
3566
  });
3514
3567
  } else a.length > 0 && a.forEach((u) => t.push(u));
3515
3568
  a = [];
3516
3569
  };
3517
3570
  for (const s of e)
3518
- if (vi.includes(s.activityType))
3571
+ if (zi.includes(s.activityType))
3519
3572
  a.push(s);
3520
3573
  else {
3521
- const d = t.length === 0;
3522
- i(d, t.length), t.push(s);
3574
+ const l = t.length === 0;
3575
+ i(l, t.length), t.push(s);
3523
3576
  }
3524
3577
  return a.length > 0 && i(!1, t.length), t;
3525
- }, an = (e, n, o = "oldValue") => {
3578
+ }, rn = (e, n, o = "oldValue") => {
3526
3579
  const t = [];
3527
3580
  let a = null, r = null;
3528
3581
  for (const i of e)
@@ -3531,104 +3584,104 @@ const di = A.ul`
3531
3584
  a = { ...i }, r = new Date(i.createdAt);
3532
3585
  continue;
3533
3586
  }
3534
- const s = a.authorName === i.authorName, d = a.origin.id === i.entityId, u = a.activityData?.key === i.activityData?.key, m = new Date(i.createdAt), g = r !== null && dt(r) && dt(m) && Math.abs(ca(r, m)) <= 20;
3535
- s && g && d && u ? (i[o] !== void 0 && (a[o] = i[o]), a.activityData = {
3587
+ const s = a.authorName === i.authorName, l = a.origin.id === i.entityId, u = a.activityData?.key === i.activityData?.key, m = new Date(i.createdAt), g = r !== null && it(r) && it(m) && Math.abs(Ia(r, m)) <= 20;
3588
+ s && g && l && u ? (i[o] !== void 0 && (a[o] = i[o]), a.activityData = {
3536
3589
  ...a.activityData,
3537
3590
  oldValue: i.activityData.oldValue
3538
3591
  }, a.hasPreviousPage = i.hasPreviousPage, a.cursor = i.cursor, r = m) : (a.activityData.oldValue !== a.activityData.newValue && t.push(a), a = { ...i }, r = m);
3539
3592
  } else
3540
3593
  a && (a.activityData.oldValue !== a.activityData.newValue && t.push(a), a = null, r = null), t.push(i);
3541
3594
  return a && a.activityData.oldValue !== a.activityData.newValue && !t.some((i) => i.activityId === a.activityId) && t.push(a), t;
3542
- }, vi = [
3595
+ }, zi = [
3543
3596
  "status.change",
3544
3597
  "assignee.add",
3545
3598
  "assignee.remove",
3546
3599
  "attrib.change",
3547
3600
  "tags.change",
3548
3601
  "subtype.change"
3549
- ], yi = (e = [], n = {}) => e.map((o) => {
3602
+ ], Ui = (e = [], n = {}) => e.map((o) => {
3550
3603
  const t = { ...o, origin: { ...o.origin } };
3551
3604
  if (t.activityType === "status.change") {
3552
3605
  if (!n) return t;
3553
- const a = t.activityData?.oldValue, r = t.activityData?.newValue, i = n.statuses?.find((d) => d.name === a), s = n.statuses?.find((d) => d.name === r);
3606
+ const a = t.activityData?.oldValue, r = t.activityData?.newValue, i = n.statuses?.find((l) => l.name === a), s = n.statuses?.find((l) => l.name === r);
3554
3607
  t.oldStatus = { ...i, name: a }, t.newStatus = { ...s, name: r };
3555
3608
  }
3556
3609
  return t;
3557
- }), bi = (e = [], n = [], o) => n.includes(o) ? e.filter((t) => t.referenceType !== "relation") : e, wi = (e = [], n = [], o = {}, t, a, r) => {
3558
- const i = _(
3559
- () => yi(e, o),
3610
+ }), Bi = (e = [], n = [], o) => n.includes(o) ? e.filter((t) => t.referenceType !== "relation") : e, Gi = (e = [], n = [], o = {}, t, a, r) => {
3611
+ const i = S(
3612
+ () => Ui(e, o),
3560
3613
  [e, o]
3561
- ), s = _(() => i.map((C) => ({ ...C, isOwner: a === C.authorName })), [i, a]), d = _(
3562
- () => bi(s, ["version"], t),
3614
+ ), s = S(() => i.map((k) => ({ ...k, isOwner: a === k.authorName })), [i, a]), l = S(
3615
+ () => Bi(s, ["version"], t),
3563
3616
  [s, t]
3564
- ), u = _(() => [...d].sort((F, P) => {
3565
- const x = new Date(F.createdAt), b = new Date(P.createdAt), k = dt(x), v = dt(b);
3566
- if (!k && !v)
3617
+ ), u = S(() => [...l].sort((C, I) => {
3618
+ const y = new Date(C.createdAt), v = new Date(I.createdAt), F = it(y), w = it(v);
3619
+ if (!F && !w)
3567
3620
  return 0;
3568
- if (k) {
3569
- if (!v)
3621
+ if (F) {
3622
+ if (!w)
3570
3623
  return -1;
3571
3624
  } else return 1;
3572
- return la(b, x);
3573
- }), [d]), m = _(
3574
- () => an(u, "status.change", "oldStatus"),
3625
+ return Ea(v, y);
3626
+ }), [l]), m = S(
3627
+ () => rn(u, "status.change", "oldStatus"),
3575
3628
  [u]
3576
- ), p = _(
3577
- () => an(m, "attrib.change"),
3629
+ ), p = S(
3630
+ () => rn(m, "attrib.change"),
3578
3631
  [m]
3579
- ), g = _(() => r?.conditions?.some(
3580
- (F) => "key" in F && F.key === "updates" && F.value === !0
3581
- ) ? p : fi(p, n), [p, n, r]), f = _(
3582
- () => hi(g),
3632
+ ), g = S(() => r?.conditions?.some(
3633
+ (C) => "key" in C && C.key === "updates" && C.value === !0
3634
+ ) ? p : Vi(p, n), [p, n, r]), f = S(
3635
+ () => ji(g),
3583
3636
  [g]
3584
3637
  );
3585
- return _(() => [...new Map(
3586
- f.filter((F) => F && F.activityId).map((F) => [F.activityId, F])
3638
+ return S(() => [...new Map(
3639
+ f.filter((C) => C && C.activityId).map((C) => [C.activityId, C])
3587
3640
  ).values()], [f]);
3588
- }, rn = (e, n) => JSON.stringify({ entities: e.map((o) => o.id), filter: n }), xi = ({
3641
+ }, sn = (e, n) => JSON.stringify({ entities: e.map((o) => o.id), filter: n }), Hi = ({
3589
3642
  entities: e = [],
3590
3643
  feedRef: n,
3591
3644
  filter: o,
3592
3645
  disabled: t,
3593
3646
  isLoading: a
3594
3647
  }) => {
3595
- const r = ge({}), i = (s) => {
3596
- const d = s.current.querySelectorAll(".scroll-to"), u = Array.from(d).map((p) => p.closest("li.comment"));
3648
+ const r = ve({}), i = (s) => {
3649
+ const l = s.current.querySelectorAll(".scroll-to"), u = Array.from(l).map((p) => p.closest("li.comment"));
3597
3650
  return (u[u.length - 1]?.offsetTop || 0) - 8 || 0;
3598
3651
  };
3599
3652
  X(() => {
3600
- const s = rn(e, o);
3653
+ const s = sn(e, o);
3601
3654
  !n.current || t || a || (n.current.scrollTop = r.current[s] || i(n));
3602
3655
  }, [e, o, n.current, a]), X(() => {
3603
3656
  let s = null;
3604
3657
  if (!n.current || t) return;
3605
- const d = (u) => {
3658
+ const l = (u) => {
3606
3659
  if (s)
3607
3660
  return;
3608
3661
  s = setTimeout(() => {
3609
3662
  s = null;
3610
3663
  }, 300);
3611
- const { scrollTop: m } = u.target, p = rn(e, o);
3664
+ const { scrollTop: m } = u.target, p = sn(e, o);
3612
3665
  r.current[p] = m;
3613
3666
  };
3614
- return n.current?.addEventListener("scroll", d), () => {
3615
- n.current?.removeEventListener("scroll", d);
3667
+ return n.current?.addEventListener("scroll", l), () => {
3668
+ n.current?.removeEventListener("scroll", l);
3616
3669
  };
3617
3670
  }, [n.current, o, e, t]);
3618
- }, ki = ({ feedRef: e, isInputOpen: n, height: o }) => {
3671
+ }, qi = ({ feedRef: e, isInputOpen: n, height: o }) => {
3619
3672
  X(() => {
3620
3673
  if (!e.current) return;
3621
3674
  const t = o;
3622
3675
  e.current.scrollTop === 0 || (n ? e.current.scrollBy(0, t) : e.current.scrollBy(0, -t));
3623
3676
  }, [n, e, o]);
3624
- }, Ai = (e = 50, n = 200) => Math.floor(Math.random() * (n - e + 1) + e), Ci = (e) => new Array(e).fill(0).map((n, o) => /* @__PURE__ */ c(
3625
- pi,
3677
+ }, Wi = (e = 50, n = 200) => Math.floor(Math.random() * (n - e + 1) + e), Qi = (e) => new Array(e).fill(0).map((n, o) => /* @__PURE__ */ c(
3678
+ $i,
3626
3679
  {
3627
3680
  className: "loading",
3628
- style: { minHeight: Ai(50, 150) }
3681
+ style: { minHeight: Wi(50, 150) }
3629
3682
  },
3630
3683
  o
3631
- )), Fi = ({
3684
+ )), Yi = ({
3632
3685
  feedRef: e,
3633
3686
  highlighted: n = [],
3634
3687
  isLoading: o,
@@ -3636,26 +3689,26 @@ const di = A.ul`
3636
3689
  hasNextPage: a,
3637
3690
  activities: r
3638
3691
  }) => {
3639
- const i = ge([]), s = async (u, m = 0) => {
3692
+ const i = ve([]), s = async (u, m = 0) => {
3640
3693
  if (!t) return null;
3641
3694
  const p = u.querySelector("li.isHighlighted");
3642
3695
  if (p) return p;
3643
3696
  if (m++, m > 10) return null;
3644
3697
  const g = await t();
3645
3698
  return !g || !g.hasNextPage ? null : (await new Promise((h) => requestAnimationFrame(() => h())), s(u, m));
3646
- }, d = async (u) => {
3699
+ }, l = async (u) => {
3647
3700
  const m = await s(u);
3648
3701
  if (!m) {
3649
3702
  console.error("No highlighted element found");
3650
3703
  return;
3651
3704
  }
3652
- const p = m.offsetTop, g = m.offsetHeight, f = u.offsetHeight || 0, h = 64, F = g + h > f ? p - 16 : p + g - f + h;
3653
- console.log("FOUND: scrolling to highlighted..."), u.scrollTo({ top: F }), i.current = n;
3705
+ const p = m.offsetTop, g = m.offsetHeight, f = u.offsetHeight || 0, h = 64, C = g + h > f ? p - 16 : p + g - f + h;
3706
+ console.log("FOUND: scrolling to highlighted..."), u.scrollTo({ top: C }), i.current = n;
3654
3707
  };
3655
3708
  X(() => {
3656
- !n.length || !e.current || o || !t || n.every((u) => i.current?.includes(u)) || (console.log("trying to scroll to highlighted..."), d(e.current));
3709
+ !n.length || !e.current || o || !t || n.every((u) => i.current?.includes(u)) || (console.log("trying to scroll to highlighted..."), l(e.current));
3657
3710
  }, [e, n, r, o, t, i, a]);
3658
- }, Ti = (e) => e.map((n) => {
3711
+ }, Ki = (e) => e.map((n) => {
3659
3712
  if (n.activityType !== "comment" || !n.activityData?.annotations) return n;
3660
3713
  const o = n.files.map((a) => {
3661
3714
  const r = n.activityData.annotations.find(
@@ -3664,79 +3717,79 @@ const di = A.ul`
3664
3717
  return r ? r.transparent === a.id ? null : { ...a, annotation: r } : a;
3665
3718
  }).filter(Boolean);
3666
3719
  return { ...n, files: o };
3667
- }), Sn = [
3720
+ }), _n = [
3668
3721
  "comments",
3669
3722
  "versions",
3670
3723
  "updates",
3671
3724
  "checklists",
3672
3725
  "has_attachments",
3673
3726
  "in_review_session"
3674
- ], Di = (e) => !!e && "key" in e, Ii = (e, n) => {
3727
+ ], Ji = (e) => !!e && "key" in e, Xi = (e, n) => {
3675
3728
  const o = [], t = [], a = (r) => {
3676
3729
  if (!r) return;
3677
- if (Di(r)) {
3730
+ if (Ji(r)) {
3678
3731
  const s = r.key;
3679
3732
  if (s === "body") {
3680
3733
  const m = String(r.value ?? "");
3681
3734
  m && t.push({ id: m, label: m });
3682
3735
  return;
3683
3736
  }
3684
- const d = n.find((m) => m.id === s);
3685
- if (!d) return;
3686
- if (Sn.includes(s)) {
3737
+ const l = n.find((m) => m.id === s);
3738
+ if (!l) return;
3739
+ if (_n.includes(s)) {
3687
3740
  r.value === !0 && o.push({
3688
- id: jt(s),
3689
- label: d.label,
3690
- icon: d.icon,
3741
+ id: Bt(s),
3742
+ label: l.label,
3743
+ icon: l.icon,
3691
3744
  type: "boolean",
3692
3745
  singleSelect: !0,
3693
3746
  // value label = filter name so the compact chip (label hidden) reads
3694
3747
  // e.g. "Checklists" instead of "Yes"
3695
- values: [{ id: "true", label: d.label }]
3748
+ values: [{ id: "true", label: l.label }]
3696
3749
  });
3697
3750
  return;
3698
3751
  }
3699
3752
  const u = Array.isArray(r.value) ? r.value : [r.value];
3700
3753
  o.push({
3701
- id: jt(s),
3702
- label: d.label,
3703
- type: d.type,
3704
- icon: d.icon,
3705
- singleSelect: d.singleSelect,
3754
+ id: Bt(s),
3755
+ label: l.label,
3756
+ type: l.type,
3757
+ icon: l.icon,
3758
+ singleSelect: l.singleSelect,
3706
3759
  operator: "OR",
3707
3760
  values: u.map((m) => {
3708
- const p = d.values?.find((g) => g.id === String(m));
3761
+ const p = l.values?.find((g) => g.id === String(m));
3709
3762
  return p ? { ...p } : { id: String(m), label: String(m) };
3710
3763
  })
3711
3764
  });
3712
3765
  return;
3713
3766
  }
3714
- const i = ua(r, n);
3767
+ const i = _a(r, n);
3715
3768
  if (i) {
3716
3769
  o.push(i);
3717
3770
  return;
3718
3771
  }
3719
3772
  r.conditions?.forEach(a);
3720
3773
  };
3721
- return e?.conditions?.forEach(a), t.length && o.push({ id: mn, label: "", values: t }), o;
3722
- }, Ni = (e) => {
3774
+ return e?.conditions?.forEach(a), t.length && o.push({ id: hn, label: "", values: t }), o;
3775
+ }, Zi = (e) => {
3723
3776
  const n = [], o = [];
3724
3777
  return e.forEach((t) => {
3725
- const a = co(t.id), r = (t.values || []).map((i) => i.id);
3778
+ const a = uo(t.id), r = (t.values || []).map((i) => i.id);
3726
3779
  if (r.length)
3727
- if (a === mn)
3780
+ if (a === hn)
3728
3781
  r.forEach(
3729
3782
  (i) => o.push({ key: "body", operator: "like", value: String(i) })
3730
3783
  );
3731
- else if (Sn.includes(a))
3784
+ else if (_n.includes(a))
3732
3785
  r.includes("true") && n.push({ key: a, operator: "eq", value: !0 });
3733
3786
  else if (t.type === "datetime") {
3734
- const i = pa(a, t);
3787
+ const i = Pa(a, t);
3735
3788
  i && n.push(i);
3736
3789
  } else
3737
3790
  n.push({ key: a, operator: "in", value: r.map(String) });
3738
3791
  }), o.length === 1 ? n.push(o[0]) : o.length > 1 && n.push({ operator: "or", conditions: o }), { operator: "and", conditions: n };
3739
- }, Si = A.div`
3792
+ }, es = A.div`
3740
3793
  padding: 4px 8px;
3741
3794
  padding-bottom: 0;
3742
3795
  filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.25));
@@ -3751,7 +3804,7 @@ const di = A.ul`
3751
3804
  opacity: 0.5;
3752
3805
  pointer-events: none;
3753
3806
  }
3754
- `, En = ut(
3807
+ `, Pn = pt(
3755
3808
  ({
3756
3809
  feedFilter: e,
3757
3810
  setFeedFilter: n,
@@ -3762,22 +3815,22 @@ const di = A.ul`
3762
3815
  checklistCount: i,
3763
3816
  onSearchTextChange: s
3764
3817
  }) => {
3765
- const d = _(() => {
3766
- const b = (v, $, T) => ({
3767
- id: v,
3768
- label: $,
3769
- icon: T,
3818
+ const l = S(() => {
3819
+ const v = (w, R, N) => ({
3820
+ id: w,
3821
+ label: R,
3822
+ icon: N,
3770
3823
  type: "boolean",
3771
3824
  singleSelect: !0,
3772
3825
  values: []
3773
3826
  });
3774
3827
  return [
3775
- b("comments", "Comments", "chat"),
3776
- b("versions", "Versions", "layers"),
3777
- b("updates", "Updates", "arrow_circle_right"),
3778
- b("checklists", "Checklists", "check_circle"),
3779
- b("has_attachments", "Attachments", "attach_file"),
3780
- ...a ? [b("in_review_session", "Review session", "subscriptions")] : [],
3828
+ v("comments", "Comments", "chat"),
3829
+ v("versions", "Versions", "layers"),
3830
+ v("updates", "Updates", "arrow_circle_right"),
3831
+ v("checklists", "Checklists", "check_circle"),
3832
+ v("has_attachments", "Attachments", "attach_file"),
3833
+ ...a ? [v("in_review_session", "Review session", "subscriptions")] : [],
3781
3834
  ...t.length ? [
3782
3835
  {
3783
3836
  id: "category",
@@ -3787,11 +3840,11 @@ const di = A.ul`
3787
3840
  operator: "OR",
3788
3841
  values: [
3789
3842
  { id: "__none__", label: "No category", icon: "crop_square" },
3790
- ...t.map((v) => ({
3791
- id: v.name,
3792
- label: v.name,
3843
+ ...t.map((w) => ({
3844
+ id: w.name,
3845
+ label: w.name,
3793
3846
  icon: "crop_square",
3794
- color: v.color
3847
+ color: w.color
3795
3848
  }))
3796
3849
  ]
3797
3850
  }
@@ -3802,10 +3855,10 @@ const di = A.ul`
3802
3855
  icon: "person",
3803
3856
  type: "list_of_strings",
3804
3857
  operator: "OR",
3805
- values: o.map((v) => ({
3806
- id: v.name,
3807
- label: v.attrib?.fullName || v.name,
3808
- img: `/api/users/${v.name}/avatar`
3858
+ values: o.map((w) => ({
3859
+ id: w.name,
3860
+ label: w.attrib?.fullName || w.name,
3861
+ img: `/api/users/${w.name}/avatar`
3809
3862
  }))
3810
3863
  },
3811
3864
  {
@@ -3813,61 +3866,61 @@ const di = A.ul`
3813
3866
  label: "Posted date",
3814
3867
  icon: "calendar_today",
3815
3868
  type: "datetime",
3816
- values: Qo()
3869
+ values: Ko()
3817
3870
  }
3818
3871
  ];
3819
3872
  }, [o, t, a]);
3820
3873
  let u = "";
3821
3874
  i?.total && i.total > 0 && (u = `${i.checked}/${i.total}`);
3822
- const m = _(
3875
+ const m = S(
3823
3876
  () => ["comments", { id: "checklists", label: u, tooltip: "Checklists" }],
3824
3877
  [u]
3825
- ), p = _(
3826
- () => Ii(e, d),
3827
- [e, d]
3828
- ), [g, f] = q(p), h = ma(), C = ge(null);
3878
+ ), p = S(
3879
+ () => Xi(e, l),
3880
+ [e, l]
3881
+ ), [g, f] = O(p), h = Ra(), k = ve(null);
3829
3882
  X(() => {
3830
3883
  f(p);
3831
3884
  }, [JSON.stringify(p)]), X(() => {
3832
- const b = (k) => {
3833
- const v = C.current?.getContainerElement();
3834
- v && !v.contains(k.target) && C.current?.close();
3885
+ const v = (F) => {
3886
+ const w = k.current?.getContainerElement();
3887
+ w && !w.contains(F.target) && k.current?.close();
3835
3888
  };
3836
- return document.addEventListener("mousedown", b), () => {
3837
- document.removeEventListener("mousedown", b);
3889
+ return document.addEventListener("mousedown", v), () => {
3890
+ document.removeEventListener("mousedown", v);
3838
3891
  };
3839
- }, [C]);
3840
- const F = (b) => {
3841
- n(Ni(b)), s?.("");
3892
+ }, [k]);
3893
+ const C = (v) => {
3894
+ n(Zi(v)), s?.("");
3842
3895
  };
3843
- return /* @__PURE__ */ y(Si, { className: r ? "loading" : void 0, children: [
3896
+ return /* @__PURE__ */ b(es, { className: r ? "loading" : void 0, children: [
3844
3897
  /* @__PURE__ */ c(
3845
- lo,
3898
+ po,
3846
3899
  {
3847
- ref: C,
3900
+ ref: k,
3848
3901
  compact: !0,
3849
- options: d,
3902
+ options: l,
3850
3903
  filters: g,
3851
- onChange: (b) => {
3852
- h.wrapFilterChange(b, g, f);
3904
+ onChange: (v) => {
3905
+ h.wrapFilterChange(v, g, f);
3853
3906
  },
3854
- onFinish: F,
3907
+ onFinish: C,
3855
3908
  enableGlobalSearch: !0,
3856
3909
  enableMultipleSameFilters: !1,
3857
3910
  enableAutosuggestion: !1,
3858
- onSearchChange: (b, k) => {
3859
- k || s?.(b);
3911
+ onSearchChange: (v, F) => {
3912
+ F || s?.(v);
3860
3913
  },
3861
3914
  quickActions: m,
3862
3915
  placeholder: "Search and filter feed...",
3863
3916
  pt: {
3864
3917
  searchBar: {
3865
- onClickCapture: (b) => h.handleSearchBarClickCapture(b, g)
3918
+ onClickCapture: (v) => h.handleSearchBarClickCapture(v, g)
3866
3919
  },
3867
3920
  dropdown: {
3868
3921
  pt: {
3869
3922
  item: {
3870
- onClick: (b) => h.handleDropdownItemClick(b, g, d)
3923
+ onClick: (v) => h.handleDropdownItemClick(v, g, l)
3871
3924
  }
3872
3925
  }
3873
3926
  }
@@ -3875,23 +3928,23 @@ const di = A.ul`
3875
3928
  }
3876
3929
  ),
3877
3930
  /* @__PURE__ */ c(
3878
- ea,
3931
+ wa,
3879
3932
  {
3880
3933
  isOpen: !!h.customRangeFilterId,
3881
- header: d.find((b) => b.id === h.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
3934
+ header: l.find((v) => v.id === h.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
3882
3935
  startDate: h.customStartDate,
3883
3936
  endDate: h.customEndDate,
3884
3937
  onStartDateChange: h.setCustomStartDate,
3885
3938
  onEndDateChange: h.setCustomEndDate,
3886
- onApply: () => h.handleCustomRangeApply(g, d, F, C),
3939
+ onApply: () => h.handleCustomRangeApply(g, l, C, k),
3887
3940
  onClose: h.handleCustomRangeClose
3888
3941
  }
3889
3942
  )
3890
3943
  ] });
3891
3944
  }
3892
3945
  );
3893
- En.displayName = "FeedSearchFilter";
3894
- function Ei({
3946
+ Pn.displayName = "FeedSearchFilter";
3947
+ function ts({
3895
3948
  projectName: e,
3896
3949
  enabled: n,
3897
3950
  entityIds: o,
@@ -3899,10 +3952,10 @@ function Ei({
3899
3952
  loadingActivities: a,
3900
3953
  userName: r
3901
3954
  }) {
3902
- const i = _(
3955
+ const i = S(
3903
3956
  () => t.find((m) => m.activityType === "version.review" && m.authorName === r),
3904
3957
  [t, r]
3905
- ), s = !!(o.length === 0 || !n || a || i), { data: d } = na(
3958
+ ), s = !!(o.length === 0 || !n || a || i), { data: l } = ma(
3906
3959
  {
3907
3960
  projectName: e,
3908
3961
  entityIds: o,
@@ -3912,9 +3965,9 @@ function Ei({
3912
3965
  },
3913
3966
  { skip: s }
3914
3967
  );
3915
- return _(() => i ?? d?.activities.at(-1), [i, d]);
3968
+ return S(() => i ?? l?.activities.at(-1), [i, l]);
3916
3969
  }
3917
- const Es = 30, _s = ({
3970
+ const nc = 30, oc = ({
3918
3971
  disabled: e,
3919
3972
  readOnly: n,
3920
3973
  statuses: o = [],
@@ -3925,210 +3978,210 @@ const Es = 30, _s = ({
3925
3978
  const {
3926
3979
  projectName: i,
3927
3980
  entities: s,
3928
- entityType: d,
3981
+ entityType: l,
3929
3982
  editingId: u,
3930
3983
  projectInfo: m,
3931
3984
  setEditingId: p,
3932
3985
  userName: g,
3933
3986
  activitiesData: f,
3934
3987
  isLoadingNew: h,
3935
- isLoadingNextPage: C,
3936
- loadNextPage: F,
3937
- hasNextPage: P,
3938
- users: x,
3939
- categories: b,
3940
- checklistCount: k,
3941
- feedFilter: v,
3942
- setFeedFilter: $,
3943
- isGuest: T,
3944
- searchText: L,
3945
- setSearchText: N
3946
- } = Le(), {
3947
- openSlideOut: R,
3948
- highlightedActivities: j,
3949
- setHighlightedActivities: S,
3950
- onOpenImage: Y,
3988
+ isLoadingNextPage: k,
3989
+ loadNextPage: C,
3990
+ hasNextPage: I,
3991
+ users: y,
3992
+ categories: v,
3993
+ checklistCount: F,
3994
+ feedFilter: w,
3995
+ setFeedFilter: R,
3996
+ isGuest: N,
3997
+ searchText: $,
3998
+ setSearchText: M
3999
+ } = $e(), {
4000
+ openSlideOut: _,
4001
+ highlightedActivities: B,
4002
+ setHighlightedActivities: E,
4003
+ onOpenImage: K,
3951
4004
  setFeedAnnotations: H,
3952
- setFeedFrameLinks: oe,
3953
- user: J
3954
- } = We(), B = v.conditions?.some(
3955
- (I) => "key" in I && I.key === "versions" && I.value === !0
3956
- ), E = v.conditions?.some(
3957
- (I) => "key" in I && ["comments", "checklists", "versions", "updates"].includes(I.key) && I.value === !0
3958
- ), ae = v.conditions?.some(
3959
- (I) => "key" in I && (I.key === "comments" || I.key === "checklists") && I.value === !0
3960
- ), Te = d === "version" || d === "folder", { data: ie, isLoading: re } = oa({ projectName: i }, { skip: !i }), he = !J.data?.isManager && !J.data?.isAdmin && !re && ie?.activities?.enabled && !ie?.activities?.activities?.includes("comment") || E && !ae, we = _(
3961
- () => Ti(f),
4005
+ setFeedFrameLinks: le,
4006
+ user: Z
4007
+ } = ze(), W = w.conditions?.some(
4008
+ (D) => "key" in D && D.key === "versions" && D.value === !0
4009
+ ), j = w.conditions?.some(
4010
+ (D) => "key" in D && ["comments", "checklists", "versions", "updates"].includes(D.key) && D.value === !0
4011
+ ), ae = w.conditions?.some(
4012
+ (D) => "key" in D && (D.key === "comments" || D.key === "checklists") && D.value === !0
4013
+ ), q = l === "version" || l === "folder", { data: re, isLoading: me } = ga({ projectName: i }, { skip: !i }), he = !Z.data?.isManager && !Z.data?.isAdmin && !me && re?.activities?.enabled && !re?.activities?.activities?.includes("comment") || j && !ae, xe = S(
4014
+ () => Ki(f),
3962
4015
  [f]
3963
4016
  );
3964
4017
  X(() => {
3965
- we.length || H([]);
3966
- const I = we.map(
3967
- (M) => M.activityData?.annotations?.map((V) => ({
4018
+ xe.length || H([]);
4019
+ const D = xe.map(
4020
+ (P) => P.activityData?.annotations?.map((V) => ({
3968
4021
  ...V,
3969
- activityId: M.activityId
4022
+ activityId: P.activityId
3970
4023
  }))
3971
4024
  ).filter(Boolean).flat();
3972
- H(I);
3973
- }, [we]), X(() => {
3974
- const I = f.map((M) => {
3975
- const V = Nt(M);
3976
- return V && { ...V, activityId: M.activityId };
3977
- }).filter((M) => !!M);
3978
- oe(I);
4025
+ H(D);
4026
+ }, [xe]), X(() => {
4027
+ const D = f.map((P) => {
4028
+ const V = St(P);
4029
+ return V && { ...V, activityId: P.activityId };
4030
+ }).filter((P) => !!P);
4031
+ le(D);
3979
4032
  }, [f]);
3980
- const se = wi(
4033
+ const ie = Gi(
3981
4034
  // @ts-ignore
3982
- we,
3983
- x,
4035
+ xe,
4036
+ y,
3984
4037
  m,
3985
- d,
4038
+ l,
3986
4039
  g,
3987
- v
3988
- ), xe = _(() => {
3989
- if (!L) return se;
3990
- const I = L.toLowerCase();
3991
- return se.filter(
3992
- (M) => M.body?.toLowerCase().includes(I)
4040
+ w
4041
+ ), ke = S(() => {
4042
+ if (!$) return ie;
4043
+ const D = $.toLowerCase();
4044
+ return ie.filter(
4045
+ (P) => P.body?.toLowerCase().includes(D)
3993
4046
  );
3994
- }, [se, L]), le = ge(null);
3995
- ki({ feedRef: le, isInputOpen: u === ot, height: 93 }), xi({
4047
+ }, [ie, $]), de = ve(null);
4048
+ qi({ feedRef: de, isInputOpen: u === ot, height: 93 }), Hi({
3996
4049
  entities: s,
3997
- feedRef: le,
3998
- filter: v,
3999
- disabled: !!j.length,
4050
+ feedRef: de,
4051
+ filter: w,
4052
+ disabled: !!B.length,
4000
4053
  isLoading: h
4001
- }), Fi({
4002
- feedRef: le,
4003
- highlighted: j,
4004
- isLoading: h || C,
4005
- loadNextPage: F,
4006
- hasNextPage: !!F,
4054
+ }), Yi({
4055
+ feedRef: de,
4056
+ highlighted: B,
4057
+ isLoading: h || k,
4058
+ loadNextPage: C,
4059
+ hasNextPage: !!C,
4007
4060
  activities: f
4008
4061
  });
4009
4062
  const {
4010
4063
  submitComment: De,
4011
- updateComment: Ie,
4012
- deleteComment: Ne,
4013
- submitReview: Oe,
4064
+ updateComment: Ne,
4065
+ deleteComment: Se,
4066
+ submitReview: Le,
4014
4067
  isSaving: Be
4015
- } = mi({
4068
+ } = Li({
4016
4069
  projectName: i,
4017
- entityType: d,
4070
+ entityType: l,
4018
4071
  entities: s,
4019
- filter: v,
4072
+ filter: w,
4020
4073
  entityListId: t
4021
- }), te = He(
4022
- async (I, M = [], V = {}) => {
4023
- await De(I, M, V), le.current && le.current.scrollTo({ top: 0 });
4074
+ }), te = qe(
4075
+ async (D, P = [], V = {}) => {
4076
+ await De(D, P, V), de.current && de.current.scrollTo({ top: 0 });
4024
4077
  },
4025
- [De, le]
4026
- ), Ye = He(
4027
- async (I) => {
4028
- await Oe(I);
4078
+ [De, de]
4079
+ ), Qe = qe(
4080
+ async (D) => {
4081
+ await Le(D);
4029
4082
  },
4030
- [Oe]
4031
- ), Se = (I, M) => {
4032
- const V = I?.target;
4033
- if (!V || !M) return console.log("no target or activity");
4034
- const Q = V.checked, ee = Q ? "[ ]" : "[x]", Ke = Q ? "[x]" : "[ ]", { body: D } = M, ve = Array.from(
4083
+ [Le]
4084
+ ), Ie = (D, P) => {
4085
+ const V = D?.target;
4086
+ if (!V || !P) return console.log("no target or activity");
4087
+ const Y = V.checked, ee = Y ? "[ ]" : "[x]", Ke = Y ? "[x]" : "[ ]", { body: T } = P, ye = Array.from(
4035
4088
  V.closest(".comment-body")?.querySelectorAll(".task-list-item") || []
4036
- ).findIndex((je) => je === V.closest("li"));
4037
- let ke = ve;
4038
- (D.match(/\[.\]/g) || []).forEach((je, Ue) => {
4039
- je !== ee && Ue < ve && ke--;
4089
+ ).findIndex((Ge) => Ge === V.closest("li"));
4090
+ let Ae = ye;
4091
+ (T.match(/\[.\]/g) || []).forEach((Ge, Ve) => {
4092
+ Ge !== ee && Ve < ye && Ae--;
4040
4093
  });
4041
- const Pe = [];
4042
- let $e = -1;
4043
- for (; ($e = D.indexOf(ee, $e + 1)) > -1; )
4044
- Pe.push($e);
4045
- const Xe = Pe[ke];
4094
+ const _e = [];
4095
+ let Re = -1;
4096
+ for (; (Re = T.indexOf(ee, Re + 1)) > -1; )
4097
+ _e.push(Re);
4098
+ const Xe = _e[Ae];
4046
4099
  if (Xe === void 0) return;
4047
- const st = Xe + ee.length, Ze = D.slice(0, Xe) + Ke + D.slice(st);
4048
- Ze && Ie(M, Ze, M.files);
4049
- }, Qe = (I) => {
4050
- const { entityId: M, entityType: V, activityId: Q } = I;
4100
+ const lt = Xe + ee.length, Ze = T.slice(0, Xe) + Ke + T.slice(lt);
4101
+ Ze && Ne(P, Ze, P.files);
4102
+ }, Ye = (D) => {
4103
+ const { entityId: P, entityType: V, activityId: Y } = D;
4051
4104
  if (!V || !["version", "task", "folder"].includes(V))
4052
4105
  return console.log("Entity type not supported yet");
4053
- if (!M || !V || !i) return console.log("No entity id or type found");
4054
- R({ entityId: M, entityType: V, projectName: i }), S([Q]);
4055
- }, Ee = ({ index: I, activityId: M }) => {
4056
- const V = Object.values(xe).reverse().filter((Q) => Q.activityType == "comment").map((Q) => ({
4057
- id: Q.activityId,
4058
- files: Q.files.filter((ee) => mt(ee.mime, ee.ext))
4059
- })).filter((Q) => Q.files.length > 0);
4060
- Y?.({ files: V, activityId: M, index: I, projectName: i });
4061
- }, [Ve, fe] = q(null), _e = !he && !n && !e, W = He(
4062
- (I) => {
4063
- fe({ key: sn(), activity: I }), p(ot);
4106
+ if (!P || !V || !i) return console.log("No entity id or type found");
4107
+ _({ entityId: P, entityType: V, projectName: i }), E([Y]);
4108
+ }, Ee = ({ index: D, activityId: P }) => {
4109
+ const V = Object.values(ke).reverse().filter((Y) => Y.activityType == "comment").map((Y) => ({
4110
+ id: Y.activityId,
4111
+ files: Y.files.filter((ee) => mt(ee.mime, ee.ext))
4112
+ })).filter((Y) => Y.files.length > 0);
4113
+ K?.({ files: V, activityId: P, index: D, projectName: i });
4114
+ }, [Oe, fe] = O(null), Me = !he && !n && !e, Q = qe(
4115
+ (D) => {
4116
+ fe({ key: cn(), activity: D }), p(ot);
4064
4117
  },
4065
4118
  [p]
4066
- ), Me = _(() => Ci(10), []), ze = Ei({
4119
+ ), Pe = S(() => Qi(10), []), je = ts({
4067
4120
  projectName: i,
4068
4121
  enabled: r,
4069
- entityIds: s.map((I) => I.id),
4070
- activities: se,
4122
+ entityIds: s.map((D) => D.id),
4123
+ activities: ie,
4071
4124
  loadingActivities: h,
4072
4125
  userName: g
4073
4126
  });
4074
- return /* @__PURE__ */ c(be, { children: /* @__PURE__ */ y(li, { className: "feed", children: [
4127
+ return /* @__PURE__ */ c(we, { children: /* @__PURE__ */ b(_i, { className: "feed", children: [
4075
4128
  void 0,
4076
4129
  /* @__PURE__ */ c(
4077
- En,
4130
+ Pn,
4078
4131
  {
4079
- feedFilter: v,
4080
- setFeedFilter: $,
4081
- users: x,
4082
- categories: b,
4083
- supportsReviewSession: Te,
4132
+ feedFilter: w,
4133
+ setFeedFilter: R,
4134
+ users: y,
4135
+ categories: v,
4136
+ supportsReviewSession: q,
4084
4137
  isLoading: h,
4085
- onSearchTextChange: N,
4086
- checklistCount: k
4138
+ onSearchTextChange: M,
4139
+ checklistCount: F
4087
4140
  }
4088
4141
  ),
4089
- /* @__PURE__ */ y(di, { ref: le, className: K({ loading: h }, "no-shimmer"), children: [
4090
- h ? Me : xe.map((I) => /* @__PURE__ */ c(
4091
- Nn,
4142
+ /* @__PURE__ */ b(Pi, { ref: de, className: J({ loading: h }, "no-shimmer"), children: [
4143
+ h ? Pe : ke.map((D) => /* @__PURE__ */ c(
4144
+ Mn,
4092
4145
  {
4093
- activity: I,
4094
- onCheckChange: Se,
4095
- onDelete: Ne,
4096
- onUpdate: async (M, V, Q, ee) => await Ie(I, M, V, ee),
4097
- onDuplicate: _e ? W : void 0,
4146
+ activity: D,
4147
+ onCheckChange: Ie,
4148
+ onDelete: Se,
4149
+ onUpdate: async (P, V, Y, ee) => await Ne(D, P, V, ee),
4150
+ onDuplicate: Me ? Q : void 0,
4098
4151
  projectInfo: m,
4099
4152
  projectName: i,
4100
- entityType: d,
4101
- onReferenceClick: Qe,
4102
- createdAts: s.map((M) => M.createdAt),
4153
+ entityType: l,
4154
+ onReferenceClick: Ye,
4155
+ createdAts: s.map((P) => P.createdAt),
4103
4156
  onFileExpand: Ee,
4104
4157
  showOrigin: s.length > 1,
4105
- filter: v,
4158
+ filter: w,
4106
4159
  editProps: {
4107
4160
  projectName: i,
4108
4161
  entities: s,
4109
- entityType: d
4162
+ entityType: l
4110
4163
  },
4111
- isHighlighted: j.includes(I.activityId),
4164
+ isHighlighted: B.includes(D.activityId),
4112
4165
  readOnly: n,
4113
4166
  statuses: o,
4114
4167
  isSlideOut: a,
4115
- isGuest: T
4168
+ isGuest: N
4116
4169
  },
4117
- I.activityId
4170
+ D.activityId
4118
4171
  )),
4119
- xe.length === 0 && B && !ae && !h && /* @__PURE__ */ c(kt, { message: "No versions published yet", icon: "layers" }),
4120
- P && F && /* @__PURE__ */ c(
4121
- da,
4172
+ ke.length === 0 && W && !ae && !h && /* @__PURE__ */ c(kt, { message: "No versions published yet", icon: "layers" }),
4173
+ I && C && /* @__PURE__ */ c(
4174
+ Ma,
4122
4175
  {
4123
- root: le.current,
4124
- onChange: (I) => I && F(),
4176
+ root: de.current,
4177
+ onChange: (D) => D && C(),
4125
4178
  rootMargin: "400px 0px 0px 0px",
4126
- children: /* @__PURE__ */ c(ui, { style: { height: 0 }, onClick: () => F(), children: C ? "Loading more..." : "Click to load more" })
4179
+ children: /* @__PURE__ */ c(Ri, { style: { height: 0 }, onClick: () => C(), children: k ? "Loading more..." : "Click to load more" })
4127
4180
  }
4128
4181
  )
4129
4182
  ] }),
4130
4183
  !he && /* @__PURE__ */ c(
4131
- Fn,
4184
+ Tn,
4132
4185
  {
4133
4186
  initValue: null,
4134
4187
  onSubmit: te,
@@ -4138,23 +4191,26 @@ const Es = 30, _s = ({
4138
4191
  disabled: e,
4139
4192
  isLoading: h || !s.length || Be,
4140
4193
  versionReview: r,
4141
- lastOwnVersionReview: ze,
4142
- onReview: Ye,
4143
- duplicate: Ve,
4194
+ lastOwnVersionReview: je,
4195
+ onReview: Qe,
4196
+ duplicate: Oe,
4144
4197
  onDuplicateHandled: () => fe(null)
4145
4198
  }
4146
4199
  )
4147
4200
  ] }) });
4148
4201
  };
4149
4202
  export {
4150
- Za as A,
4151
- Qa as C,
4152
- _s as F,
4153
- Jt as P,
4203
+ xr as A,
4204
+ vr as C,
4205
+ ec as D,
4206
+ ot as F,
4207
+ Xt as P,
4208
+ tc as S,
4154
4209
  at as a,
4155
- Ss as b,
4156
- Es as c,
4157
- mt as d,
4158
- yn as e,
4159
- Ka as i
4210
+ oc as b,
4211
+ Zs as c,
4212
+ nc as d,
4213
+ or as e,
4214
+ mt as f,
4215
+ kr as i
4160
4216
  };