@ynput/ayon-frontend-shared 0.5.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 (92) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +307 -311
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +99 -92
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4459 -2959
  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/api.es.js +331 -329
  11. package/dist/chunks/Actions.es.js +32 -27
  12. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  13. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  14. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  15. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  16. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  17. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  18. package/dist/chunks/DetailsDialog.es.js +3 -3
  19. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  20. package/dist/chunks/EntityPath.es.js +74 -69
  21. package/dist/chunks/EntityPickerDialog.es.js +25 -21
  22. package/dist/chunks/EntityTooltip.es.js +29 -22
  23. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  24. package/dist/chunks/Feed.es.js +2321 -2668
  25. package/dist/chunks/FilterErrorActions.es.js +25 -229
  26. package/dist/chunks/Menu.es.js +21 -17
  27. package/dist/chunks/MenuContext.es.js +14 -256
  28. package/dist/chunks/MenuItem.es.js +34 -24
  29. package/dist/chunks/MetaWidget.es.js +2895 -4919
  30. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  31. package/dist/chunks/PlayableIcon.es.js +4215 -1179
  32. package/dist/chunks/ProjectContext.es.js +102 -66
  33. package/dist/chunks/RepresentationsList.es.js +4 -4
  34. package/dist/chunks/ReviewablesSelector.es.js +468 -460
  35. package/dist/chunks/SimpleForm.es.js +18 -18
  36. package/dist/chunks/SimpleTable.es.js +15 -13
  37. package/dist/chunks/Slicer.es.js +109 -98
  38. package/dist/chunks/TableSettingsFallback.es.js +22 -10
  39. package/dist/chunks/ThumbnailSimple.es.js +290 -52
  40. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  41. package/dist/chunks/VideoPlayer.es.js +24 -28
  42. package/dist/chunks/Watchers.es.js +669 -644
  43. package/dist/chunks/entityDefinitions.es.js +2 -350
  44. package/dist/chunks/expandRelativeDates.es.js +27 -0
  45. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  46. package/dist/chunks/getBundleMode.es.js +1 -1
  47. package/dist/chunks/getUris.es.js +737 -710
  48. package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
  49. package/dist/chunks/searchTerms.es.js +179 -174
  50. package/dist/chunks/useAttributeEnums.es.js +9 -9
  51. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  52. package/dist/chunks/useDateRangeFilter.es.js +3 -3
  53. package/dist/chunks/useHierarchySelection.es.js +24 -0
  54. package/dist/chunks/useLoadModule.es.js +74 -0
  55. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  56. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  57. package/dist/chunks/viewUpdateHelper.es.js +74 -57
  58. package/dist/components.es.js +1432 -1001
  59. package/dist/context.es.js +791 -78
  60. package/dist/hooks.es.js +95 -94
  61. package/dist/index.es.js +27 -26
  62. package/dist/types/Actions.d.ts +15 -15
  63. package/dist/types/ContextMenu.d.ts +19 -16
  64. package/dist/types/DetailsPanel.d.ts +110 -17
  65. package/dist/types/EntityPickerDialog.d.ts +15 -15
  66. package/dist/types/Feed.d.ts +19 -16
  67. package/dist/types/ListTable.d.ts +15 -15
  68. package/dist/types/NewEntity.d.ts +24 -18
  69. package/dist/types/ProjectTreeTable.d.ts +34 -123
  70. package/dist/types/RepresentationsList.d.ts +15 -15
  71. package/dist/types/SimpleTable.d.ts +19 -16
  72. package/dist/types/Slicer.d.ts +18 -15
  73. package/dist/types/Views.d.ts +19 -16
  74. package/dist/types/api.d.ts +515 -207
  75. package/dist/types/components.d.ts +84 -20
  76. package/dist/types/context.d.ts +108 -25
  77. package/dist/types/hooks.d.ts +15 -15
  78. package/dist/types/index.d.ts +15 -15
  79. package/dist/types/util.d.ts +20 -15
  80. package/dist/util.es.js +117 -105
  81. package/package.json +16 -4
  82. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  83. package/dist/chunks/GlobalContext.es.js +0 -52
  84. package/dist/chunks/NewEntityContext.es.js +0 -1242
  85. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  86. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  87. package/dist/chunks/VersionUploadContext.es.js +0 -232
  88. package/dist/chunks/ViewsContext.es.js +0 -878
  89. package/dist/chunks/mentionTypeOptions.es.js +0 -15
  90. package/dist/chunks/useColumnDragRestriction.es.js +0 -148
  91. package/dist/chunks/useLocalStorage.es.js +0 -355
  92. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
@@ -1,376 +1,390 @@
1
- import { C as Pe, S as Ne, A as ue, a as Ie, T as Le, D as Me, b as Fe, c as Be, d as ce, e as de, f as Ue, g as We, h as Ge, M as He, F as Ye, i as $e, j as je, k as Ke, l as Xe } from "./chunks/ReviewablesSelector.es.js";
2
- import { m as Ta, n as Va, o as Aa, p as _a, q as xa, r as ka, s as Pa, t as Na, E as Ia, u as La, v as Ma, w as Fa, x as Ba, y as Ua, G as Wa, z as Ga, L as Ha, P as Ya, B as $a, R as ja, H as Ka, I as Xa, J as za, K as Ja, N as qa, O as Qa, Q as Za, U as es, V as ts, W as as, X as ss, Y as os, Z as rs } from "./chunks/ReviewablesSelector.es.js";
3
- import { jsxs as M, jsx as g } from "react/jsx-runtime";
4
- import { useState as H, useRef as ee, useCallback as Oe, useEffect as se, useMemo as pe, useContext as ze } from "react";
5
- import { matchSorter as fe } from "match-sorter";
6
- import { InputText as Je, Icon as z, Section as qe, SEARCH_FILTER_ID as Qe } from "@ynput/ayon-react-components";
7
- import te from "clsx";
8
- import { B as ls, a as is, S as us } from "./chunks/SimpleForm.es.js";
9
- import { B as he, P as Ze } from "./chunks/MetaWidget.es.js";
10
- import { C as ds, c as ps, D as fs, E as hs, L as ms, d as gs, e as bs } from "./chunks/MetaWidget.es.js";
11
- import { createPortal as et } from "react-dom";
12
- import { format as X, parseISO as Se, isValid as De } from "date-fns";
13
- import { f as Re, e as ne, g as le } from "./chunks/PlayableIcon.es.js";
14
- import { C as ys, b as ws, D as vs, N as Cs, U as Os, h as Ss, j as Ds, d as Rs, k as Ts, l as Vs } from "./chunks/PlayableIcon.es.js";
15
- import { n as _s, o as xs, p as ks, q as Ps, R as Ns, r as Is, s as Ls, t as Ms, v as Fs } from "./chunks/DeleteEntitiesContext.es.js";
16
- import { D as Us } from "./chunks/DetailsDialog.es.js";
17
- import { q as tt, r as at, b as st } from "./chunks/Watchers.es.js";
18
- import { s as Gs, t as Hs, v as Ys, R as $s, h as js, g as Ks, w as Xs, x as zs, W as Js, i as qs } from "./chunks/Watchers.es.js";
19
- import { E as Zs, P as eo } from "./chunks/EmptyPlaceholder.es.js";
20
- import { E as ao, b as so, c as oo, d as ro, a as no, M as lo, e as io } from "./chunks/Menu.es.js";
21
- import { I as co } from "./chunks/InfoMessage.es.js";
22
- import { J as fo } from "./chunks/JsonViewer.es.js";
23
- import { E as mo, a as go, R as bo, g as Eo } from "./chunks/EntityPath.es.js";
24
- import { E as wo, a as vo } from "./chunks/EntityTooltip.es.js";
25
- import { F as Oo, a as So, u as Do, b as Ro } from "./chunks/FilterErrorActions.es.js";
26
- import { C as Vo, a as Ao, S as _o } from "./chunks/ColumnDropIndicator.es.js";
27
- import { bf as me, bn as ot, bp as rt } from "./chunks/searchTerms.es.js";
28
- import { bl as nt, di as lt, c5 as it, bM as ut } from "./chunks/getUris.es.js";
1
+ import { C as Ye, S as $e, A as Se, a as je, T as Ke, D as Xe, b as Je, c as Qe, d as ke, e as Oe, f as qe, g as Ze, h as et, M as tt, F as st, i as at, j as ot, k as nt, l as rt } from "./chunks/ReviewablesSelector.es.js";
2
+ import { m as ia, n as ca, o as ua, p as da, q as pa, r as fa, s as ma, E as ha, t as ga, u as ba, v as wa, w as ya, x as va, G as Ea, y as Ca, L as Sa, P as ka, z as Oa, R as Da, B as Va, H as Ta, I as Ra, J as Ia, K as Fa, N as Aa, O as Pa, Q as _a, U as xa, V as Na, W as La, X as Ma, Y as Ba } from "./chunks/ReviewablesSelector.es.js";
3
+ import { jsxs as z, jsx as C } from "react/jsx-runtime";
4
+ import { useState as _, useRef as oe, useCallback as ee, useEffect as Y, useMemo as me, useContext as lt } from "react";
5
+ import { matchSorter as De } from "match-sorter";
6
+ import { InputText as it, Icon as le, Section as ct, SEARCH_FILTER_ID as ut } from "@ynput/ayon-react-components";
7
+ import ue from "clsx";
8
+ import { B as Wa, a as Ha, S as za } from "./chunks/SimpleForm.es.js";
9
+ import { d as dt, P as pt } from "./chunks/MetaWidget.es.js";
10
+ import { i as Ya, D as $a, E as ja, L as Ka, j as Xa, k as Ja } from "./chunks/MetaWidget.es.js";
11
+ import { createPortal as ft } from "react-dom";
12
+ import { format as re, parseISO as Ne, isValid as Le } from "date-fns";
13
+ import { B as Ve, b as Me, c as we, g as ye } from "./chunks/PlayableIcon.es.js";
14
+ import { C as qa, a as Za, e as eo, D as to, N as so, U as ao, h as oo, i as no, d as ro, f as lo, j as io } from "./chunks/PlayableIcon.es.js";
15
+ import { d as Be, x as mt, a as ht, e as gt } from "./chunks/DeleteEntitiesContextInstance.es.js";
16
+ import { f as uo, D as po, R as fo } from "./chunks/DeleteEntitiesContextInstance.es.js";
17
+ import { p as bt, a as Te } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
18
+ import { D as ho, b as go, c as bo, d as wo, e as yo, s as vo } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
19
+ import { D as Co } from "./chunks/DetailsDialog.es.js";
20
+ import { q as wt, r as yt, b as vt } from "./chunks/Watchers.es.js";
21
+ import { s as ko, t as Oo, v as Do, R as Vo, h as To, g as Ro, w as Io, x as Fo, W as Ao, i as Po } from "./chunks/Watchers.es.js";
22
+ import { E as xo, P as No } from "./chunks/EmptyPlaceholder.es.js";
23
+ import { E as Mo, b as Bo, c as Uo, d as Wo, a as Ho, M as zo, e as Go } from "./chunks/Menu.es.js";
24
+ import { I as $o } from "./chunks/InfoMessage.es.js";
25
+ import { J as Ko } from "./chunks/JsonViewer.es.js";
26
+ import { E as Jo, a as Qo, R as qo, g as Zo } from "./chunks/EntityPath.es.js";
27
+ import { E as tn, a as sn } from "./chunks/EntityTooltip.es.js";
28
+ import { bj as Re, bp as Et, br as Ct } from "./chunks/searchTerms.es.js";
29
+ import { bK as St, bP as kt, ct as Ot, aJ as Dt, aO as Vt, bF as Tt, bm as Rt, dj as It, c6 as Ft, bN as At } from "./chunks/getUris.es.js";
29
30
  export * from "primereact/confirmdialog";
30
- import { toast as Te } from "react-toastify";
31
- import { a as ct } from "./chunks/ProjectContext.es.js";
32
- import "react-quill-ayon";
33
- import "react-markdown";
34
- import "remark-gfm";
35
- import "rehype-raw";
36
- import { isEmpty as dt, upperFirst as ae } from "lodash";
37
- import "uuid";
38
- import { u as pt, c as ft, p as ge } from "./chunks/useLocalStorage.es.js";
39
31
  import "@module-federation/enhanced/runtime";
32
+ import { isEmpty as Pt, upperFirst as de } from "lodash";
33
+ import { toast as he } from "react-toastify";
34
+ import "uuid";
40
35
  import "semver";
41
- import "./chunks/MenuContext.es.js";
42
- import { T as Po } from "./chunks/TableSettingsFallback.es.js";
43
- import { u as ht } from "./chunks/ViewsContext.es.js";
44
- import { a as mt, b as gt } from "./chunks/viewUpdateHelper.es.js";
45
- import { useSearchParams as bt, useLocation as Et, useNavigate as yt, useParams as wt } from "react-router-dom";
46
- import { u as vt } from "./chunks/entityDefinitions.es.js";
47
- import { g as Ct, c as Ot, b as St, d as Dt } from "./chunks/Slicer.es.js";
48
- import { l as Io } from "./chunks/Slicer.es.js";
49
- import { Splitter as Rt, SplitterPanel as be } from "primereact/splitter";
50
- import { g as Y } from "./chunks/getEntityTypeIcon.es.js";
51
- import { g as B } from "./chunks/parseHtmlToPlainTextWithLinks.es.js";
52
- import { u as Tt } from "./chunks/GlobalContext.es.js";
53
- import { u as Mo } from "./chunks/useDateRangeFilter.es.js";
54
- import { C as Bo, T as Uo } from "./chunks/ThumbnailSimple.es.js";
55
- import { S as Go } from "./chunks/SimpleFormDialog.es.js";
56
- import { T as Yo } from "./chunks/EntityPickerDialog.es.js";
57
- import { V as jo, u as Ko, a as Xo } from "./chunks/VersionUploadContext.es.js";
58
- import { p as Jo } from "./chunks/parseFilename.es.js";
59
- const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
60
- shareOptions: e,
61
- existingAccess: t,
62
- owner: l,
63
- placeholder: u = "Add people or access groups",
64
- disabled: r = !1,
65
- mode: a = "internal",
66
- onSelectOption: o,
67
- pt: f,
68
- ...i
36
+ import "./chunks/ContextMenuContextInstance.es.js";
37
+ import "react-redux";
38
+ import { F as _t } from "./chunks/ColumnDropIndicator.styled.es.js";
39
+ import { C as nn, S as rn, b as ln, u as cn } from "./chunks/ColumnDropIndicator.styled.es.js";
40
+ import { F as dn } from "./chunks/FilterErrorActions.es.js";
41
+ import "lexical";
42
+ import "@lexical/markdown";
43
+ import "@lexical/react/LexicalBlockWithAlignableContents";
44
+ import "@lexical/react/LexicalDecoratorBlockNode";
45
+ import "@lexical/code";
46
+ import "@lexical/list";
47
+ import "@lexical/rich-text";
48
+ import "@lexical/selection";
49
+ import "@lexical/utils";
50
+ import { T as fn } from "./chunks/TableSettingsFallback.es.js";
51
+ import { a as xt, b as Nt } from "./chunks/viewUpdateHelper.es.js";
52
+ import { useSearchParams as Lt, useLocation as Mt, useNavigate as Bt, useParams as Ut } from "react-router-dom";
53
+ import { g as Wt, c as Ht, b as zt, d as Gt } from "./chunks/Slicer.es.js";
54
+ import { l as hn } from "./chunks/Slicer.es.js";
55
+ import { Splitter as Yt, SplitterPanel as Ie } from "primereact/splitter";
56
+ import { g as ae } from "./chunks/getEntityTypeIcon.es.js";
57
+ import { g as j } from "./chunks/parseHtmlToPlainTextWithLinks.es.js";
58
+ import { u as bn } from "./chunks/useDateRangeFilter.es.js";
59
+ import { C as yn, T as vn } from "./chunks/ThumbnailSimple.es.js";
60
+ import { S as Cn } from "./chunks/SimpleFormDialog.es.js";
61
+ import { T as kn } from "./chunks/EntityPickerDialog.es.js";
62
+ import { e as $t } from "./chunks/extractVersionFromFilename.es.js";
63
+ import { b as jt, c as Kt, v as Xt } from "./chunks/versionUploadHelpers.es.js";
64
+ import { p as Jt } from "./chunks/parseFilename.es.js";
65
+ import { V as Qt } from "./chunks/VersionUploadContextInstance.es.js";
66
+ import { u as Dn, a as Vn } from "./chunks/VersionUploadContextInstance.es.js";
67
+ import { C as Rn } from "./chunks/ColumnHeaderMenuUI.es.js";
68
+ const Fe = 500, qt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, js = ({
69
+ shareOptions: t,
70
+ existingAccess: e,
71
+ owner: i,
72
+ placeholder: c = "Add people or access groups",
73
+ disabled: o = !1,
74
+ mode: s = "internal",
75
+ onSelectOption: a,
76
+ pt: h,
77
+ ...l
69
78
  }) => {
70
- const [c, s] = H(""), [w, v] = H(!1), [D, d] = H(-1), T = ee(null), _ = e.filter((S) => !t.includes(S.value)).toSorted((S, h) => {
71
- const b = (p) => p.value === "__everyone__" ? 0 : p.value.startsWith("__") ? 1 : p.value.startsWith("team:") ? 2 : p.value.startsWith("group:") ? 3 : p.value.startsWith("user:") ? 4 : 5, O = b(S), n = b(h);
72
- return O !== n ? O - n : S.label.localeCompare(h.label);
73
- }), m = (c ? fe(_, c, {
79
+ const [f, n] = _(""), [E, y] = _(!1), [D, m] = _(-1), F = oe(null), R = t.filter((V) => !e.includes(V.value)).toSorted((V, b) => {
80
+ const v = (p) => p.value === "__everyone__" ? 0 : p.value.startsWith("__") ? 1 : p.value.startsWith("team:") ? 2 : p.value.startsWith("group:") ? 3 : p.value.startsWith("user:") ? 4 : 5, O = v(V), r = v(b);
81
+ return O !== r ? O - r : V.label.localeCompare(b.label);
82
+ }), g = (f ? De(R, f, {
74
83
  keys: ["name", "label", "value"],
75
- threshold: fe.rankings.CONTAINS
76
- }) : _).slice(0, Ee), R = Vt.test(c) && !e.some((S) => S.name === c) && a === "external", V = () => {
77
- v(!0), d(-1);
78
- }, P = () => {
84
+ threshold: De.rankings.CONTAINS
85
+ }) : R).slice(0, Fe), T = qt.test(f) && !t.some((V) => V.name === f) && s === "external", I = () => {
86
+ y(!0), m(-1);
87
+ }, L = () => {
79
88
  setTimeout(() => {
80
- v(!1), d(-1);
89
+ y(!1), m(-1);
81
90
  }, 200);
82
- }, N = (S) => {
83
- s(S.target.value), d(-1), v(!0);
84
- }, F = (S) => {
85
- if (!w || m.length === 0) {
86
- S.key === "Enter" && m.length > 0 && (S.preventDefault(), U(m[0]));
91
+ }, N = (V) => {
92
+ n(V.target.value), m(-1), y(!0);
93
+ }, M = (V) => {
94
+ if (!E || g.length === 0) {
95
+ V.key === "Enter" && g.length > 0 && (V.preventDefault(), G(g[0]));
87
96
  return;
88
97
  }
89
- switch (S.key) {
98
+ switch (V.key) {
90
99
  case "ArrowDown":
91
- S.preventDefault(), d((h) => h < m.length - 1 ? h + 1 : h);
100
+ V.preventDefault(), m((b) => b < g.length - 1 ? b + 1 : b);
92
101
  break;
93
102
  case "ArrowUp":
94
- S.preventDefault(), d((h) => h > 0 ? h - 1 : -1);
103
+ V.preventDefault(), m((b) => b > 0 ? b - 1 : -1);
95
104
  break;
96
105
  case "Enter":
97
- S.preventDefault(), D >= 0 && D < m.length ? U(m[D]) : m.length > 0 && U(m[0]);
106
+ V.preventDefault(), D >= 0 && D < g.length ? G(g[D]) : g.length > 0 && G(g[0]);
98
107
  break;
99
108
  case "Escape":
100
- v(!1), d(-1), T.current?.blur(), S.stopPropagation();
109
+ y(!1), m(-1), F.current?.blur(), V.stopPropagation();
101
110
  break;
102
111
  }
103
- }, U = (S) => {
104
- o(S, 10), s(""), v(!1), d(-1), T.current?.focus();
105
- }, K = () => {
106
- o(
112
+ }, G = (V) => {
113
+ a(V, 10), n(""), y(!1), m(-1), F.current?.focus();
114
+ }, $ = () => {
115
+ a(
107
116
  {
108
- name: c,
109
- label: c,
110
- value: c,
117
+ name: f,
118
+ label: f,
119
+ value: f,
111
120
  shareType: "guest"
112
121
  },
113
122
  10
114
- ), s(""), v(!1), d(-1), T.current?.focus();
123
+ ), n(""), y(!1), m(-1), F.current?.focus();
115
124
  };
116
- return /* @__PURE__ */ M(Pe, { ...i, children: [
117
- /* @__PURE__ */ g(
118
- Je,
125
+ return /* @__PURE__ */ z(Ye, { ...l, children: [
126
+ /* @__PURE__ */ C(
127
+ it,
119
128
  {
120
- ref: T,
121
- value: c,
122
- placeholder: u,
123
- disabled: r,
124
- onFocus: V,
125
- onClick: V,
126
- onBlur: P,
129
+ ref: F,
130
+ value: f,
131
+ placeholder: c,
132
+ disabled: o,
133
+ onFocus: I,
134
+ onClick: I,
135
+ onBlur: L,
127
136
  onChange: N,
128
- onKeyDown: F,
137
+ onKeyDown: M,
129
138
  style: { width: "100%" }
130
139
  }
131
140
  ),
132
- w && (m.length > 0 || R) && /* @__PURE__ */ M(
133
- Ne,
141
+ E && (g.length > 0 || T) && /* @__PURE__ */ z(
142
+ $e,
134
143
  {
135
- ...f?.list,
136
- className: te(f?.list?.className, { "no-owner": !l }),
144
+ ...h?.list,
145
+ className: ue(h?.list?.className, { "no-owner": !i }),
137
146
  children: [
138
- m.map((S, h) => /* @__PURE__ */ g(
139
- ue,
147
+ g.map((V, b) => /* @__PURE__ */ C(
148
+ Se,
140
149
  {
141
- name: S.name,
142
- label: S.label,
143
- shareType: S.shareType,
150
+ name: V.name,
151
+ label: V.label,
152
+ shareType: V.shareType,
144
153
  isOwner: !1,
145
154
  isMe: !1,
146
- "data-index": h,
147
- className: h === D ? "highlighted" : "",
155
+ "data-index": b,
156
+ className: b === D ? "highlighted" : "",
148
157
  style: { cursor: "pointer" },
149
- onClick: () => U(S),
150
- onMouseEnter: () => d(h),
158
+ onClick: () => G(V),
159
+ onMouseEnter: () => m(b),
151
160
  isCompact: !0,
152
161
  isSearchResult: !0
153
162
  },
154
- S.value
163
+ V.value
155
164
  )),
156
- R && /* @__PURE__ */ g(
157
- ue,
165
+ T && /* @__PURE__ */ C(
166
+ Se,
158
167
  {
159
- name: c,
160
- label: c,
168
+ name: f,
169
+ label: f,
161
170
  shareType: "guest",
162
171
  isOwner: !1,
163
172
  isMe: !1,
164
- "data-index": m.length,
165
- className: m.length === D ? "highlighted" : "",
173
+ "data-index": g.length,
174
+ className: g.length === D ? "highlighted" : "",
166
175
  style: { cursor: "pointer" },
167
- onClick: K,
168
- onMouseEnter: () => d(m.length),
176
+ onClick: $,
177
+ onMouseEnter: () => m(g.length),
169
178
  isCompact: !0,
170
179
  isSearchResult: !0
171
180
  }
172
181
  ),
173
- m.length === Ee && /* @__PURE__ */ g("li", { className: "tip", children: "More than 500 results, please refine your search..." })
182
+ g.length === Fe && /* @__PURE__ */ C("li", { className: "tip", children: "More than 500 results, please refine your search..." })
174
183
  ]
175
184
  }
176
185
  )
177
186
  ] });
178
- }, ye = (e) => {
179
- if (!e) return "";
187
+ }, Ks = {
188
+ 0: "No access",
189
+ 10: "Viewer",
190
+ 20: "Editor",
191
+ 30: "Admin"
192
+ }, Ae = (t) => {
193
+ if (!t) return "";
180
194
  try {
181
- const t = Se(e);
182
- if (De(t))
183
- return Re(t, "yyyy-MM-dd");
195
+ const e = Ne(t);
196
+ if (Le(e))
197
+ return Me(e, "yyyy-MM-dd");
184
198
  } catch {
185
199
  return "";
186
200
  }
187
201
  return "";
188
- }, we = (e, t) => {
189
- if (!e) return null;
202
+ }, Pe = (t, e) => {
203
+ if (!t) return null;
190
204
  try {
191
- const l = Se(e);
192
- if (De(l))
193
- return Re(l, t);
205
+ const i = Ne(t);
206
+ if (Le(i))
207
+ return Me(i, e);
194
208
  } catch {
195
209
  return null;
196
210
  }
197
211
  return null;
198
- }, G = (e) => {
199
- if (!e) return null;
212
+ }, se = (t) => {
213
+ if (!t) return null;
200
214
  try {
201
- const [t, l, u] = e.split("-").map(Number);
202
- if (t && l && u)
203
- return new Date(Date.UTC(t, l - 1, u)).toISOString();
215
+ const [e, i, c] = t.split("-").map(Number);
216
+ if (e && i && c)
217
+ return new Date(Date.UTC(e, i - 1, c)).toISOString();
204
218
  } catch {
205
219
  return null;
206
220
  }
207
221
  return null;
208
- }, ga = ({
209
- value: e,
210
- onChange: t,
211
- emptyTrigger: l,
212
- valueTrigger: u,
213
- align: r = "left",
214
- disabled: a = !1,
215
- className: o,
216
- displayFormat: f = "MMM d",
217
- minDate: i,
218
- maxDate: c,
219
- pt: s
222
+ }, Xs = ({
223
+ value: t,
224
+ onChange: e,
225
+ emptyTrigger: i,
226
+ valueTrigger: c,
227
+ align: o = "left",
228
+ disabled: s = !1,
229
+ className: a,
230
+ displayFormat: h = "MMM d",
231
+ minDate: l,
232
+ maxDate: f,
233
+ pt: n
220
234
  }) => {
221
- const [w, v] = H(!1), [D, d] = H(""), [T, _] = H(""), m = ee(null), R = ee(null), V = ee(null), P = ee(null), N = e.startDate || e.endDate, F = Oe(() => {
222
- const E = G(D), A = G(T);
223
- (E !== e.startDate || A !== e.endDate) && t({ startDate: E, endDate: A }), v(!1);
224
- }, [D, T, e.startDate, e.endDate, t]);
225
- se(() => {
226
- w && (d(ye(e.startDate)), _(ye(e.endDate)), !e.startDate && !e.endDate && setTimeout(() => {
235
+ const [E, y] = _(!1), [D, m] = _(""), [F, R] = _(""), g = oe(null), T = oe(null), I = oe(null), L = oe(null), N = t.startDate || t.endDate, M = ee(() => {
236
+ const w = se(D), x = se(F);
237
+ (w !== t.startDate || x !== t.endDate) && e({ startDate: w, endDate: x }), y(!1);
238
+ }, [D, F, t.startDate, t.endDate, e]);
239
+ Y(() => {
240
+ E && (m(Ae(t.startDate)), R(Ae(t.endDate)), !t.startDate && !t.endDate && setTimeout(() => {
227
241
  try {
228
- V.current?.showPicker();
242
+ I.current?.showPicker();
229
243
  } catch {
230
244
  }
231
245
  }, 100));
232
- }, [w, e.startDate, e.endDate]), se(() => {
233
- if (!w) return;
234
- const E = (A) => {
235
- const I = A.target;
236
- m.current && !m.current.contains(I) && R.current && !R.current.contains(I) && F();
246
+ }, [E, t.startDate, t.endDate]), Y(() => {
247
+ if (!E) return;
248
+ const w = (x) => {
249
+ const B = x.target;
250
+ g.current && !g.current.contains(B) && T.current && !T.current.contains(B) && M();
237
251
  };
238
- return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
239
- }, [w, F]), se(() => {
240
- if (!w) return;
241
- const E = (A) => {
242
- A.key === "Escape" && (A.stopPropagation(), F());
252
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
253
+ }, [E, M]), Y(() => {
254
+ if (!E) return;
255
+ const w = (x) => {
256
+ x.key === "Escape" && (x.stopPropagation(), M());
243
257
  };
244
- return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
245
- }, [w, F]);
246
- const U = (E) => {
247
- const A = E.target.value;
248
- d(A);
249
- const I = G(A), W = G(T);
250
- if (I && W) {
251
- const $ = new Date(I), J = new Date(W);
252
- $ > J && _(A);
258
+ return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
259
+ }, [E, M]);
260
+ const G = (w) => {
261
+ const x = w.target.value;
262
+ m(x);
263
+ const B = se(x), W = se(F);
264
+ if (B && W) {
265
+ const K = new Date(B), te = new Date(W);
266
+ K > te && R(x);
253
267
  }
254
- I && setTimeout(() => {
268
+ B && setTimeout(() => {
255
269
  try {
256
- P.current?.showPicker();
270
+ L.current?.showPicker();
257
271
  } catch {
258
272
  }
259
273
  }, 100);
260
- }, K = (E) => {
261
- const A = E.target.value;
262
- _(A);
263
- const I = G(A), W = G(D);
264
- let $ = W, J = I;
265
- if (I && W) {
266
- const re = new Date(W);
267
- new Date(I) < re && (d(A), $ = I);
274
+ }, $ = (w) => {
275
+ const x = w.target.value;
276
+ R(x);
277
+ const B = se(x), W = se(D);
278
+ let K = W, te = B;
279
+ if (B && W) {
280
+ const q = new Date(W);
281
+ new Date(B) < q && (m(x), K = B);
268
282
  }
269
- t({ startDate: $, endDate: J });
270
- }, S = () => {
271
- d(""), _(""), t({ startDate: null, endDate: null }), v(!1);
272
- }, h = (E) => {
273
- E.stopPropagation(), a || (w ? F() : v(!0));
274
- }, b = w ? G(D) : e.startDate, O = w ? G(T) : e.endDate, n = we(b, f), p = we(O, f), C = n && p ? `${n} - ${p}` : n || p || "", y = () => {
275
- if (!m.current) return { top: 0, left: 0 };
276
- const E = m.current.getBoundingClientRect();
283
+ e({ startDate: K, endDate: te });
284
+ }, V = () => {
285
+ m(""), R(""), e({ startDate: null, endDate: null }), y(!1);
286
+ }, b = (w) => {
287
+ w.stopPropagation(), s || (E ? M() : y(!0));
288
+ }, v = E ? se(D) : t.startDate, O = E ? se(F) : t.endDate, r = Pe(v, h), p = Pe(O, h), u = r && p ? `${r} - ${p}` : r || p || "", d = () => {
289
+ if (!g.current) return { top: 0, left: 0 };
290
+ const w = g.current.getBoundingClientRect();
277
291
  return {
278
- top: E.bottom + 4,
279
- left: r === "left" ? E.left : E.right
292
+ top: w.bottom + 4,
293
+ left: o === "left" ? w.left : w.right
280
294
  };
281
- }, x = () => N ? u ? u(e, C) : /* @__PURE__ */ g("span", { className: te("date-value", s?.valueDisplay?.className), ...s?.valueDisplay, children: C }) : l || /* @__PURE__ */ g(We, { icon: "calendar_add_on" }), k = y();
282
- return /* @__PURE__ */ M(
283
- Ie,
295
+ }, S = () => N ? c ? c(t, u) : /* @__PURE__ */ C("span", { className: ue("date-value", n?.valueDisplay?.className), ...n?.valueDisplay, children: u }) : i || /* @__PURE__ */ C(Ze, { icon: "calendar_add_on" }), A = d();
296
+ return /* @__PURE__ */ z(
297
+ je,
284
298
  {
285
- ...s?.root,
286
- className: te(he, o, s?.root?.className),
299
+ ...n?.root,
300
+ className: ue(Ve, a, n?.root?.className),
287
301
  children: [
288
- /* @__PURE__ */ g(
289
- Le,
302
+ /* @__PURE__ */ C(
303
+ Ke,
290
304
  {
291
- ref: m,
292
- onClick: h,
293
- disabled: a,
305
+ ref: g,
306
+ onClick: b,
307
+ disabled: s,
294
308
  type: "button",
295
- ...s?.trigger,
296
- className: te(N ? "has-value" : "empty", s?.trigger?.className),
297
- children: x()
309
+ ...n?.trigger,
310
+ className: ue(N ? "has-value" : "empty", n?.trigger?.className),
311
+ children: S()
298
312
  }
299
313
  ),
300
- w && et(
301
- /* @__PURE__ */ g(
302
- Me,
314
+ E && ft(
315
+ /* @__PURE__ */ C(
316
+ Xe,
303
317
  {
304
- ref: R,
318
+ ref: T,
305
319
  style: {
306
- top: k.top,
307
- left: r === "left" ? k.left : "auto",
308
- right: r === "right" ? window.innerWidth - k.left : "auto",
309
- ...s?.dropdown?.style
320
+ top: A.top,
321
+ left: o === "left" ? A.left : "auto",
322
+ right: o === "right" ? window.innerWidth - A.left : "auto",
323
+ ...n?.dropdown?.style
310
324
  },
311
- onMouseDown: (E) => E.stopPropagation(),
312
- ...s?.dropdown,
313
- className: te(he, r, s?.dropdown?.className),
314
- children: /* @__PURE__ */ M(Fe, { className: s?.content?.className, ...s?.content, children: [
315
- /* @__PURE__ */ g(
316
- Be,
325
+ onMouseDown: (w) => w.stopPropagation(),
326
+ ...n?.dropdown,
327
+ className: ue(Ve, o, n?.dropdown?.className),
328
+ children: /* @__PURE__ */ z(Je, { className: n?.content?.className, ...n?.content, children: [
329
+ /* @__PURE__ */ C(
330
+ Qe,
317
331
  {
318
332
  icon: "close",
319
333
  variant: "text",
320
- onClick: F,
321
- ...s?.closeButton
334
+ onClick: M,
335
+ ...n?.closeButton
322
336
  }
323
337
  ),
324
- /* @__PURE__ */ M(
325
- ce,
338
+ /* @__PURE__ */ z(
339
+ ke,
326
340
  {
327
- className: s?.startDate?.field?.className,
328
- ...s?.startDate?.field,
341
+ className: n?.startDate?.field?.className,
342
+ ...n?.startDate?.field,
329
343
  children: [
330
- /* @__PURE__ */ g("label", { ...s?.startDate?.label, children: "Start date" }),
331
- /* @__PURE__ */ g(
332
- de,
344
+ /* @__PURE__ */ C("label", { ...n?.startDate?.label, children: "Start date" }),
345
+ /* @__PURE__ */ C(
346
+ Oe,
333
347
  {
334
- ref: V,
348
+ ref: I,
335
349
  type: "date",
336
350
  value: D,
337
- onChange: U,
338
- max: c ? X(c, "yyyy-MM-dd") : void 0,
339
- min: i ? X(i, "yyyy-MM-dd") : void 0,
340
- onClick: (E) => {
351
+ onChange: G,
352
+ max: f ? re(f, "yyyy-MM-dd") : void 0,
353
+ min: l ? re(l, "yyyy-MM-dd") : void 0,
354
+ onClick: (w) => {
341
355
  try {
342
- E.currentTarget.showPicker();
356
+ w.currentTarget.showPicker();
343
357
  } catch {
344
358
  }
345
359
  },
346
- ...s?.startDate?.input
360
+ ...n?.startDate?.input
347
361
  }
348
362
  )
349
363
  ]
350
364
  }
351
365
  ),
352
- /* @__PURE__ */ M(ce, { className: s?.endDate?.field?.className, ...s?.endDate?.field, children: [
353
- /* @__PURE__ */ g("label", { ...s?.endDate?.label, children: "End date" }),
354
- /* @__PURE__ */ g(
355
- de,
366
+ /* @__PURE__ */ z(ke, { className: n?.endDate?.field?.className, ...n?.endDate?.field, children: [
367
+ /* @__PURE__ */ C("label", { ...n?.endDate?.label, children: "End date" }),
368
+ /* @__PURE__ */ C(
369
+ Oe,
356
370
  {
357
- ref: P,
371
+ ref: L,
358
372
  type: "date",
359
- value: T,
360
- onChange: K,
361
- max: c ? X(c, "yyyy-MM-dd") : void 0,
362
- min: D || (i ? X(i, "yyyy-MM-dd") : void 0),
363
- onClick: (E) => {
373
+ value: F,
374
+ onChange: $,
375
+ max: f ? re(f, "yyyy-MM-dd") : void 0,
376
+ min: D || (l ? re(l, "yyyy-MM-dd") : void 0),
377
+ onClick: (w) => {
364
378
  try {
365
- E.currentTarget.showPicker();
379
+ w.currentTarget.showPicker();
366
380
  } catch {
367
381
  }
368
382
  },
369
- ...s?.endDate?.input
383
+ ...n?.endDate?.input
370
384
  }
371
385
  )
372
386
  ] }),
373
- N && /* @__PURE__ */ g(Ue, { onClick: S, variant: "text", ...s?.clearButton, children: "Clear dates" })
387
+ N && /* @__PURE__ */ C(qe, { onClick: V, variant: "text", ...n?.clearButton, children: "Clear dates" })
374
388
  ] })
375
389
  }
376
390
  ),
@@ -379,23 +393,436 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
379
393
  ]
380
394
  }
381
395
  );
382
- }, ba = ({
396
+ }, ne = {
397
+ version: 1,
398
+ name: "review",
399
+ productType: "review"
400
+ }, Js = ({
401
+ children: t,
383
402
  projectName: e,
384
- list: t,
385
- isLoading: l,
386
- attributes: u = []
403
+ onVersionCreated: i,
404
+ dispatch: c
405
+ }) => {
406
+ const [o, s] = _(""), [a, h] = _(""), [l, f] = _(null), [n, E] = _(null), [y, D] = _(!1), [m, F] = _([]), [R, g] = _(ne), [T, I] = _(!1), [L, N] = _(""), [M, G] = _(null), [$, V] = _(null), [b, v] = _(void 0), [O, r] = _(void 0), p = oe(!1), u = oe(null), { data: d = [], isLoading: S } = St(
407
+ { projectName: e, folderId: o },
408
+ { skip: !o || !y || !!a }
409
+ ), A = me(() => {
410
+ if (!(a || !R.name || d.length === 0))
411
+ return d.find((k) => k.name === R.name);
412
+ }, [a, R.name, d]), w = a || A?.id || "", { currentData: x } = kt(
413
+ {
414
+ projectName: e,
415
+ productId: a
416
+ },
417
+ { skip: !a || !y || b != null }
418
+ ), { data: B } = Ot(
419
+ { projectName: e, versionId: O },
420
+ { skip: !O || !y || l !== null }
421
+ ), W = l ?? B?.taskId ?? "", K = !!(O && l === null && !B), te = ee(
422
+ ({ productId: k, folderId: P, taskId: U, linkedTask: Z, latestVersionNumber: ie, latestVersionId: ze }) => {
423
+ h(k || ""), s(P || ""), f(U || null), E(Z || null), v(ie), r(ze), g((Ge) => ({
424
+ ...Ge,
425
+ ...ie != null ? { version: ie + 1 } : {}
426
+ })), D(!0);
427
+ },
428
+ []
429
+ ), q = ee(() => {
430
+ m.forEach((k) => {
431
+ k.preview && URL.revokeObjectURL(k.preview);
432
+ }), F([]), g(ne), G(null), V(null), N(""), I(!1), D(!1), h(""), s(""), f(null), E(null), p.current = !1, v(void 0), r(void 0);
433
+ }, [m]), [be] = Dt(), [pe] = Vt(), X = ee(
434
+ async (k) => {
435
+ try {
436
+ if (w) {
437
+ const P = await jt(pe, e, {
438
+ productId: w,
439
+ version: k.version,
440
+ taskId: W || void 0
441
+ });
442
+ return i(w, P.id), he.success("Created new version"), {
443
+ productId: w,
444
+ versionId: P.id
445
+ };
446
+ } else {
447
+ const { product: P, version: U } = await Kt(
448
+ be,
449
+ pe,
450
+ e,
451
+ {
452
+ folderId: o,
453
+ name: k.name,
454
+ productType: k.productType || "review",
455
+ productBaseType: k.productType || "review"
456
+ },
457
+ {
458
+ version: k.version,
459
+ taskId: W || void 0
460
+ }
461
+ );
462
+ return i(P.id, U.id), he.success("Created new version"), {
463
+ productId: P.id,
464
+ versionId: U.id
465
+ };
466
+ }
467
+ } catch (P) {
468
+ throw console.error("Error uploading version:", P), P.message || P;
469
+ }
470
+ },
471
+ [q, w, o, W, e]
472
+ ), fe = ee(
473
+ (k) => {
474
+ if (w) return;
475
+ const P = k[0];
476
+ if (P) {
477
+ const U = Jt(P.name), Z = $t(U);
478
+ Z && Z !== R.version && g((ie) => ({
479
+ ...ie,
480
+ version: Z
481
+ }));
482
+ }
483
+ },
484
+ [w, R.version]
485
+ ), J = x?.version ?? b ?? A?.latestVersion?.version, Q = ee((k, P) => {
486
+ g((U) => ({
487
+ ...U,
488
+ [k]: P
489
+ })), N("");
490
+ }, []), Ee = ee(
491
+ async (k) => {
492
+ try {
493
+ I(!0), N("");
494
+ const P = Xt(k, J, !w);
495
+ if (!P.isValid)
496
+ throw P.error;
497
+ const U = await X(k);
498
+ o && (u.current = { folderId: o, productName: k.name }), U?.productId && G(U.productId), U?.versionId && V(U.versionId), m.length < 1 && (I(!1), q());
499
+ } catch (P) {
500
+ N(P), I(!1);
501
+ }
502
+ },
503
+ [X, m.length, q, J, w]
504
+ );
505
+ Y(() => {
506
+ if (!(!y || b != null))
507
+ return g(x ? (k) => ({ ...k, version: x.version + 1 }) : ne), () => {
508
+ g(ne);
509
+ };
510
+ }, [y, x, b]), Y(() => {
511
+ if (!y || a || d.length === 0 || R.name !== ne.name) return;
512
+ const k = u.current;
513
+ if (k && k.folderId === o && d.some((Z) => Z.name === k.productName)) {
514
+ g((Z) => ({ ...Z, name: k.productName }));
515
+ return;
516
+ }
517
+ const P = d[d.length - 1];
518
+ P && g((U) => ({ ...U, name: P.name }));
519
+ }, [y, a, d]), Y(() => {
520
+ if (!(!y || a))
521
+ if (A) {
522
+ g((P) => ({
523
+ ...P,
524
+ productType: A.productType,
525
+ ...A.latestVersion && {
526
+ version: A.latestVersion.version + 1
527
+ }
528
+ }));
529
+ const k = A.latestVersion?.task;
530
+ k && (l === null || p.current) ? (f(k.id), E({
531
+ id: k.id,
532
+ name: k.name,
533
+ label: k.label,
534
+ taskType: k.taskType
535
+ }), p.current = !0) : !k && p.current && (f(null), E(null), p.current = !1);
536
+ } else
537
+ g((k) => ({ ...k, version: ne.version })), (l === null || p.current) && (f(null), E(null), p.current = !1);
538
+ }, [y, a, A]);
539
+ const Ce = ee((k) => {
540
+ f(k), p.current = !1;
541
+ }, []), He = me(
542
+ () => ({
543
+ productId: a,
544
+ setProductId: h,
545
+ folderId: o,
546
+ taskId: W,
547
+ linkedTask: n,
548
+ isLoadingTask: K,
549
+ setTaskId: Ce,
550
+ setLinkedTask: E,
551
+ setFolderId: s,
552
+ isOpen: y,
553
+ projectName: e,
554
+ latestVersion: J,
555
+ pendingFiles: m,
556
+ setPendingFiles: F,
557
+ onOpenVersionUpload: te,
558
+ onCloseVersionUpload: q,
559
+ onUploadVersion: X,
560
+ extractAndSetVersionFromFiles: fe,
561
+ form: R,
562
+ setForm: g,
563
+ isSubmitting: T,
564
+ error: L,
565
+ createdProductId: M,
566
+ createdVersionId: $,
567
+ handleFormChange: Q,
568
+ handleFormSubmit: Ee,
569
+ folderProducts: d,
570
+ isFolderProductsLoading: S,
571
+ matchedProduct: A,
572
+ dispatch: c
573
+ }),
574
+ [
575
+ o,
576
+ s,
577
+ a,
578
+ W,
579
+ n,
580
+ K,
581
+ Ce,
582
+ E,
583
+ h,
584
+ y,
585
+ e,
586
+ J,
587
+ m,
588
+ F,
589
+ te,
590
+ q,
591
+ X,
592
+ fe,
593
+ R,
594
+ T,
595
+ L,
596
+ M,
597
+ $,
598
+ Q,
599
+ Ee,
600
+ d,
601
+ S,
602
+ A,
603
+ c
604
+ ]
605
+ );
606
+ return /* @__PURE__ */ C(Qt.Provider, { value: He, children: t });
607
+ }, Qs = ({ children: t }) => {
608
+ const [e, i] = _(!1), { siteInfo: c, user: o, cloudInfo: s } = Be(), { data: a, isLoading: h } = Tt(
609
+ {},
610
+ {
611
+ skip: !o?.name || !s?.connected
612
+ }
613
+ ), l = () => {
614
+ if (!e) {
615
+ const u = document.createElement("script");
616
+ u.src = "https://do.featurebase.app/js/sdk.js", u.id = "featurebase-sdk", u.async = !0, document.body.appendChild(u), i(!0);
617
+ }
618
+ }, f = () => {
619
+ const u = window;
620
+ typeof u.Featurebase != "function" && (u.Featurebase = function() {
621
+ (u.Featurebase.q = u.Featurebase.q || []).push(arguments);
622
+ });
623
+ }, n = c?.version?.split("+")[0] || "unknown", E = c?.version?.split("+")[1] || "unknown", y = () => {
624
+ if (!o?.name || !a?.available) return;
625
+ const u = {
626
+ ...a.data,
627
+ customFields: {
628
+ origin: window.location.origin,
629
+ serverVersion: n,
630
+ frontendVersion: E,
631
+ instanceId: s?.instanceId
632
+ }
633
+ };
634
+ console.log(u), window.Featurebase("identify", u, (S) => {
635
+ S ? console.error(S) : console.log("Featurebase identify completed");
636
+ });
637
+ }, [D, m] = _(!1), [F, R] = _(0), g = () => {
638
+ const u = window;
639
+ if (typeof u.Featurebase == "function") {
640
+ if (console.log("Initializing Featurebase messenger widget"), !a?.available)
641
+ return console.warn("messenger verification not available, skipping messenger init");
642
+ u.Featurebase(
643
+ "boot",
644
+ {
645
+ theme: "dark",
646
+ ...a?.data
647
+ },
648
+ (d) => {
649
+ d ? console.error(d) : (console.log("Featurebase messenger completed"), m(!0), u.Featurebase("onUnreadCountChange", function(S) {
650
+ R(S);
651
+ }));
652
+ }
653
+ );
654
+ }
655
+ }, T = () => {
656
+ const u = [];
657
+ if (o?.data?.isAdmin) {
658
+ const S = ["Server", "Addon", "Pipeline"];
659
+ u.push(...S);
660
+ } else c?.disableChangelog || u.push("Highlights");
661
+ const d = window;
662
+ return typeof d.Featurebase == "function" && d.Featurebase("init_changelog_widget", {
663
+ organization: "ayon",
664
+ dropdown: {
665
+ enabled: !0
666
+ },
667
+ popup: {
668
+ enabled: !0,
669
+ usersName: o?.attrib?.fullName,
670
+ autoOpenForNewUpdates: !0
671
+ },
672
+ category: u,
673
+ theme: "dark"
674
+ }), !1;
675
+ }, I = () => {
676
+ const u = window;
677
+ return typeof u.Featurebase == "function" && u.Featurebase(
678
+ "initialize_feedback_widget",
679
+ {
680
+ organization: "ayon",
681
+ theme: "dark",
682
+ metadata: {}
683
+ },
684
+ (d) => {
685
+ d && console.error("Error initializing feedback widget:", d);
686
+ }
687
+ ), !1;
688
+ }, L = () => {
689
+ const u = window;
690
+ return typeof u.Featurebase == "function" && u.Featurebase(
691
+ "initialize_portal_widget",
692
+ {
693
+ organization: "ayon",
694
+ fullScreen: !0,
695
+ initialPage: "MainView"
696
+ },
697
+ (d) => d ? (console.error("Error initializing portal widget:", d), !1) : !0
698
+ ), !1;
699
+ }, N = () => {
700
+ const u = window;
701
+ return typeof u.Featurebase == "function" && u.Featurebase(
702
+ "initialize_survey_widget",
703
+ {
704
+ organization: "ayon",
705
+ placement: "bottom-right",
706
+ theme: "dark",
707
+ email: o?.attrib?.email,
708
+ featurebaseJwt: a?.data?.featurebaseJwt,
709
+ locale: "en"
710
+ },
711
+ (d) => {
712
+ d ? console.error("Error initializing survey widget:", d) : console.log("Survey widget initialized successfully");
713
+ }
714
+ ), !1;
715
+ };
716
+ Y(() => {
717
+ o?.name && c && (c.disableFeedback || e || (l(), f(), T(), I(), L()));
718
+ }, [o?.name, e, c]);
719
+ const [M, G] = _(!1);
720
+ Y(() => {
721
+ !o?.name || !s || !a || !e || M || (y(), N(), G(!0));
722
+ }, [
723
+ o?.name,
724
+ s?.instanceId,
725
+ a?.available,
726
+ e,
727
+ window.location.pathname,
728
+ M
729
+ ]), Y(() => {
730
+ h || !e || g();
731
+ }, [a, h, e]);
732
+ const $ = () => {
733
+ window.postMessage({
734
+ target: "FeaturebaseWidget",
735
+ data: {
736
+ action: "openFeedbackWidget"
737
+ }
738
+ });
739
+ }, V = (u = "MainView", d) => {
740
+ window.postMessage({
741
+ target: "FeaturebaseWidget",
742
+ data: {
743
+ action: "changePage",
744
+ payload: u,
745
+ openWidget: !0,
746
+ ...d && { articleId: d }
747
+ }
748
+ });
749
+ }, [b, v] = _(!1), O = document.getElementById("fb-messenger-root"), r = (u) => O instanceof HTMLElement && (O.style.display = u ? "block" : "none");
750
+ Y(() => {
751
+ !e || !D || r(b);
752
+ }, [e, D, b]), Y(() => {
753
+ if (!e || !D) return;
754
+ const u = window;
755
+ typeof u.Featurebase == "function" && u.Featurebase("onHide", function() {
756
+ v(!1);
757
+ });
758
+ }, [e, D]);
759
+ const p = (u = "Home", d) => {
760
+ const S = window;
761
+ if (typeof S.Featurebase != "function") {
762
+ window.alert("Featurebase SDK is not loaded yet. Please try again later."), console.warn("Featurebase SDK is not loaded yet.");
763
+ return;
764
+ }
765
+ if (b) {
766
+ S.Featurebase("hide"), v(!1);
767
+ return;
768
+ }
769
+ switch (v(!0), u) {
770
+ case "Home":
771
+ S.Featurebase("show");
772
+ break;
773
+ case "Messages":
774
+ S.Featurebase("show", "messages");
775
+ break;
776
+ case "Changelog":
777
+ S.Featurebase("show", "changelog");
778
+ break;
779
+ case "Help":
780
+ S.Featurebase("show", "help");
781
+ break;
782
+ case "ShowArticle":
783
+ d ? S.Featurebase("showArticle", d) : S.Featurebase("show", "help");
784
+ break;
785
+ case "NewMessage":
786
+ S.Featurebase("showNewMessage", d);
787
+ break;
788
+ default:
789
+ S.Featurebase("show");
790
+ break;
791
+ }
792
+ };
793
+ return /* @__PURE__ */ C(
794
+ _t.Provider,
795
+ {
796
+ value: {
797
+ openSupport: p,
798
+ openFeedback: $,
799
+ openPortal: V,
800
+ messengerLoaded: D,
801
+ unreadCount: F,
802
+ messengerVisibility: b,
803
+ setMessengerVisibility: v,
804
+ loaded: e
805
+ },
806
+ children: t
807
+ }
808
+ );
809
+ }, qs = ({
810
+ projectName: t,
811
+ list: e,
812
+ isLoading: i,
813
+ attributes: c = []
387
814
  }) => {
388
- const [r, a] = H({
815
+ const [o, s] = _({
389
816
  label: "",
390
817
  tags: [],
391
818
  active: !1
392
- }), o = (t?.accessLevel || 0) >= 30, { tags: f } = ct(), { data: i = [] } = nt(), c = pe(
393
- () => i.filter((d) => d.scope?.includes("list")).map((d) => ({
394
- name: d.name,
395
- data: d.data
819
+ }), a = (e?.accessLevel || 0) >= 30, { tags: h } = mt(), { data: l = [] } = Rt(), f = me(
820
+ () => l.filter((m) => m.scope?.includes("list")).map((m) => ({
821
+ name: m.name,
822
+ data: m.data
396
823
  })),
397
- [i]
398
- ), s = pe(
824
+ [l]
825
+ ), n = me(
399
826
  () => [
400
827
  { name: "label", data: { type: "string", title: "Label" } },
401
828
  {
@@ -403,249 +830,249 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
403
830
  data: {
404
831
  type: "list_of_strings",
405
832
  title: "Tags",
406
- enum: f?.map((d) => ({ value: d.name, label: d.name, color: d.color })),
833
+ enum: h?.map((m) => ({ value: m.name, label: m.name, color: m.color })),
407
834
  enableCustomValues: !0,
408
835
  enableSearch: !0
409
836
  }
410
837
  },
411
- ...c,
838
+ ...f,
412
839
  { name: "active", data: { type: "boolean", title: "Active" } },
413
- ...u
840
+ ...c
414
841
  ],
415
- [f, c, u]
842
+ [h, f, c]
416
843
  );
417
- se(() => {
418
- if (t) {
419
- const d = t.attrib || {}, _ = [...c, ...u].reduce((m, { name: R }) => {
420
- const V = d[R];
421
- return m[R] = V || "", m;
844
+ Y(() => {
845
+ if (e) {
846
+ const m = e.attrib || {}, R = [...f, ...c].reduce((g, { name: T }) => {
847
+ const I = m[T];
848
+ return g[T] = I || "", g;
422
849
  }, {});
423
- a({
424
- label: t?.label || "",
425
- tags: t?.tags || [],
426
- active: t?.active ?? !1,
427
- ..._
850
+ s({
851
+ label: e?.label || "",
852
+ tags: e?.tags || [],
853
+ active: e?.active ?? !1,
854
+ ...R
428
855
  });
429
856
  }
430
- }, [t, JSON.stringify(u), JSON.stringify(c)]);
431
- const [w] = lt(), v = (d) => u.some((T) => T.name === d) || c.some((T) => T.name === d), D = Oe(
432
- async (d, T) => {
433
- if (!t?.id) return console.warn("No list ID provided");
434
- let _;
435
- if (v(d)) {
436
- const m = t.attrib || {};
437
- T === "" && d === "category" ? _ = {
857
+ }, [e, JSON.stringify(c), JSON.stringify(f)]);
858
+ const [E] = It(), y = (m) => c.some((F) => F.name === m) || f.some((F) => F.name === m), D = ee(
859
+ async (m, F) => {
860
+ if (!e?.id) return console.warn("No list ID provided");
861
+ let R;
862
+ if (y(m)) {
863
+ const g = e.attrib || {};
864
+ F === "" && m === "category" ? R = {
438
865
  attrib: {
439
- ...m,
440
- [d]: null
866
+ ...g,
867
+ [m]: null
441
868
  }
442
- } : _ = {
869
+ } : R = {
443
870
  attrib: {
444
- ...m,
445
- [d]: T
871
+ ...g,
872
+ [m]: F
446
873
  }
447
- }, a((R) => ({ ...R, [d]: T }));
874
+ }, s((T) => ({ ...T, [m]: F }));
448
875
  } else {
449
- const m = { [d]: T };
450
- _ = m, a((R) => ({ ...R, ...m }));
876
+ const g = { [m]: F };
877
+ R = g, s((T) => ({ ...T, ...g }));
451
878
  }
452
879
  try {
453
- await w({
454
- listId: t.id,
455
- projectName: e,
456
- entityListPatchModel: _
880
+ await E({
881
+ listId: e.id,
882
+ projectName: t,
883
+ entityListPatchModel: R
457
884
  });
458
- } catch (m) {
459
- console.error(m), Te.error("Failed to update list attribute: ", m.attrib.detail);
885
+ } catch (g) {
886
+ console.error(g), he.error("Failed to update list attribute: ", g.attrib.detail);
460
887
  }
461
888
  },
462
- [t?.id, t?.attrib, e, w, c, u]
889
+ [e?.id, e?.attrib, t, E, f, c]
463
890
  );
464
- return /* @__PURE__ */ g(
465
- tt,
891
+ return /* @__PURE__ */ C(
892
+ wt,
466
893
  {
467
- enableEditing: o,
468
- projectName: e,
469
- fields: s,
470
- form: r,
471
- isLoading: l,
894
+ enableEditing: a,
895
+ projectName: t,
896
+ fields: n,
897
+ form: o,
898
+ isLoading: i,
472
899
  onChange: D,
473
900
  title: "Attributes"
474
901
  }
475
902
  );
476
- }, Ea = ({ list: e, isLoading: t }) => {
477
- const l = Object.fromEntries(
478
- Object.entries(e?.data || {}).filter(
479
- ([a, o]) => !["category", "count"].includes(a) && o !== null && typeof o != "object"
903
+ }, Zs = ({ list: t, isLoading: e }) => {
904
+ const i = Object.fromEntries(
905
+ Object.entries(t?.data || {}).filter(
906
+ ([s, a]) => !["category", "count"].includes(s) && a !== null && typeof a != "object"
480
907
  )
481
- ), u = {
482
- Id: e?.id,
483
- "Entity type": e?.entityType,
484
- "List type": e?.entityListType,
485
- "Items count": e?.items?.length,
486
- Owner: e?.owner,
487
- "Created at": e?.createdAt && X(new Date(e?.createdAt), "PPpp"),
488
- "Created by": e?.createdBy,
489
- "Updated at": e?.updatedAt && X(new Date(e?.updatedAt), "PPpp"),
490
- "Last updated by": e?.updatedBy,
491
- ...l
492
- }, r = Object.keys(u).map((a) => ({
493
- name: a,
908
+ ), c = {
909
+ Id: t?.id,
910
+ "Entity type": t?.entityType,
911
+ "List type": t?.entityListType,
912
+ "Items count": t?.items?.length,
913
+ Owner: t?.owner,
914
+ "Created at": t?.createdAt && re(new Date(t?.createdAt), "PPpp"),
915
+ "Created by": t?.createdBy,
916
+ "Updated at": t?.updatedAt && re(new Date(t?.updatedAt), "PPpp"),
917
+ "Last updated by": t?.updatedBy,
918
+ ...i
919
+ }, o = Object.keys(c).map((s) => ({
920
+ name: s,
494
921
  data: { type: "string" },
495
922
  hidden: !1
496
923
  }));
497
- return /* @__PURE__ */ g(at, { form: u, fields: r, isLoading: !!t });
498
- }, ya = ({
499
- label: e,
500
- description: t,
501
- features: l,
502
- isCloseable: u = !0,
503
- addon: r
924
+ return /* @__PURE__ */ C(yt, { form: c, fields: o, isLoading: !!e });
925
+ }, ea = ({
926
+ label: t,
927
+ description: e,
928
+ features: i,
929
+ isCloseable: c = !0,
930
+ addon: o
504
931
  }) => {
505
- const [a, o] = H(!1), { setPowerpackDialog: f, selectedPowerPack: i, powerpackDialog: c, addonDialog: s } = pt(), w = !!r || !!s, v = e ?? c?.label ?? s?.label, D = t ?? c?.description ?? (s ? s.features[s.selectedFeature ?? ""]?.description ?? Object.values(s.features)[0]?.description : void 0), d = r?.icon ?? (s ? s.icon : "bolt");
506
- if (!c && !s && (!e || !t)) return null;
507
- const _ = (() => {
508
- if (l)
509
- return Object.entries(l);
510
- if (s) {
511
- const R = s.featureOrder.filter((V) => V in s.features).map(
512
- (V) => [V, s.features[V]]
932
+ const [s, a] = _(!1), { setPowerpackDialog: h, selectedPowerPack: l, powerpackDialog: f, addonDialog: n } = ht(), E = !!o || !!n, y = t ?? f?.label ?? n?.label, D = e ?? f?.description ?? (n ? n.features[n.selectedFeature ?? ""]?.description ?? Object.values(n.features)[0]?.description : void 0), m = o?.icon ?? (n ? n.icon : "bolt");
933
+ if (!f && !n && (!t || !e)) return null;
934
+ const R = (() => {
935
+ if (i)
936
+ return Object.entries(i);
937
+ if (n) {
938
+ const T = n.featureOrder.filter((I) => I in n.features).map(
939
+ (I) => [I, n.features[I]]
513
940
  );
514
- if (s.selectedFeature) {
515
- const V = R.findIndex(([P]) => P === s.selectedFeature);
516
- if (V > 0) {
517
- const [P] = R.splice(V, 1);
518
- R.unshift(P);
941
+ if (n.selectedFeature) {
942
+ const I = T.findIndex(([L]) => L === n.selectedFeature);
943
+ if (I > 0) {
944
+ const [L] = T.splice(I, 1);
945
+ T.unshift(L);
519
946
  }
520
947
  }
521
- return R;
948
+ return T;
522
949
  }
523
- return Object.entries(ft).sort(([R], [V]) => {
524
- if (R === i) return -1;
525
- if (V === i) return 1;
526
- const P = ge.indexOf(R), N = ge.indexOf(V);
527
- return P > -1 && N > -1 ? P - N : P > -1 ? -1 : N > -1 ? 1 : 0;
950
+ return Object.entries(bt).sort(([T], [I]) => {
951
+ if (T === l) return -1;
952
+ if (I === l) return 1;
953
+ const L = Te.indexOf(T), N = Te.indexOf(I);
954
+ return L > -1 && N > -1 ? L - N : L > -1 ? -1 : N > -1 ? 1 : 0;
528
955
  });
529
956
  })();
530
- return /* @__PURE__ */ M(
531
- Ge,
957
+ return /* @__PURE__ */ z(
958
+ et,
532
959
  {
533
960
  isOpen: !0,
534
961
  onClose: () => {
535
- u && (f(null), o(!1));
962
+ c && (h(null), a(!1));
536
963
  },
537
964
  size: "lg",
538
- hideCancelButton: !u,
539
- hideBackdrop: !u,
965
+ hideCancelButton: !c,
966
+ hideBackdrop: !c,
540
967
  children: [
541
- /* @__PURE__ */ M(He, { children: [
542
- /* @__PURE__ */ M("h1", { children: [
543
- /* @__PURE__ */ g(z, { icon: d }),
544
- v
968
+ /* @__PURE__ */ z(tt, { children: [
969
+ /* @__PURE__ */ z("h1", { children: [
970
+ /* @__PURE__ */ C(le, { icon: m }),
971
+ y
545
972
  ] }),
546
- /* @__PURE__ */ g("h2", { children: D })
973
+ /* @__PURE__ */ C("h2", { children: D })
547
974
  ] }),
548
- /* @__PURE__ */ M(Ye, { children: [
549
- w ? /* @__PURE__ */ M("h3", { children: [
975
+ /* @__PURE__ */ z(st, { children: [
976
+ E ? /* @__PURE__ */ z("h3", { children: [
550
977
  "Unlock all ",
551
- /* @__PURE__ */ g("span", { className: "green", children: "Premium Addons" }),
978
+ /* @__PURE__ */ C("span", { className: "green", children: "Premium Addons" }),
552
979
  " with an AYON Studio subscription."
553
- ] }) : /* @__PURE__ */ M("h3", { children: [
980
+ ] }) : /* @__PURE__ */ z("h3", { children: [
554
981
  "Unlock all ",
555
- /* @__PURE__ */ g(z, { icon: "bolt" }),
982
+ /* @__PURE__ */ C(le, { icon: "bolt" }),
556
983
  " ",
557
- /* @__PURE__ */ g("span", { className: "green", children: "Power Features" }),
984
+ /* @__PURE__ */ C("span", { className: "green", children: "Power Features" }),
558
985
  " with an AYON subscription."
559
986
  ] }),
560
- /* @__PURE__ */ g("ul", { children: _.slice(0, a ? void 0 : 5).map(([R, V]) => /* @__PURE__ */ M("li", { children: [
561
- /* @__PURE__ */ g(z, { icon: V.icon ?? "check" }),
562
- /* @__PURE__ */ g("span", { children: V.bullet })
563
- ] }, R)) }),
564
- !a && _.length > 5 && /* @__PURE__ */ g($e, { onClick: () => o(!0), children: "Show all" })
987
+ /* @__PURE__ */ C("ul", { children: R.slice(0, s ? void 0 : 5).map(([T, I]) => /* @__PURE__ */ z("li", { children: [
988
+ /* @__PURE__ */ C(le, { icon: I.icon ?? "check" }),
989
+ /* @__PURE__ */ C("span", { children: I.bullet })
990
+ ] }, T)) }),
991
+ !s && R.length > 5 && /* @__PURE__ */ C(at, { onClick: () => a(!0), children: "Show all" })
565
992
  ] }),
566
- /* @__PURE__ */ g(je, { addon: r?.name, children: /* @__PURE__ */ g(Ke, {}) })
993
+ /* @__PURE__ */ C(ot, { addon: o?.name, children: /* @__PURE__ */ C(nt, {}) })
567
994
  ]
568
995
  }
569
996
  );
570
- }, ve = ({
571
- Component: e,
572
- projectName: t,
573
- state: l,
574
- dispatch: u,
575
- useSelector: r,
576
- onOpenImage: a,
577
- onGoToFrame: o,
578
- onOpenViewer: f,
579
- onUpdateEntity: i,
580
- ...c
997
+ }, _e = ({
998
+ Component: t,
999
+ projectName: e,
1000
+ state: i,
1001
+ dispatch: c,
1002
+ useSelector: o,
1003
+ onOpenImage: s,
1004
+ onGoToFrame: a,
1005
+ onOpenViewer: h,
1006
+ onUpdateEntity: l,
1007
+ ...f
581
1008
  }) => {
582
- const s = ht(), { onCreateView: w, getLatestSettings: v, markCacheDirty: D } = mt();
583
- return /* @__PURE__ */ g(
584
- e,
1009
+ const n = gt(), { onCreateView: E, getLatestSettings: y, markCacheDirty: D } = xt();
1010
+ return /* @__PURE__ */ C(
1011
+ t,
585
1012
  {
586
- router: { useParams: wt, useNavigate: yt, useLocation: Et, useSearchParams: bt },
587
- projectName: t,
1013
+ router: { useParams: Ut, useNavigate: Bt, useLocation: Mt, useSearchParams: Lt },
1014
+ projectName: e,
588
1015
  views: {
589
- ...s,
590
- settings: s.viewSettings,
591
- updateViewSettings: (...d) => gt(...d, s, w, v, D)
1016
+ ...n,
1017
+ settings: n.viewSettings,
1018
+ updateViewSettings: (...m) => Nt(...m, n, E, y, D)
592
1019
  },
593
1020
  context: {},
594
- state: l,
595
- dispatch: u,
596
- useSelector: r,
597
- onOpenImage: a,
598
- onGoToFrame: o,
599
- onOpenViewer: f,
600
- onUpdateEntity: i,
601
- toast: Te,
602
- ...c
1021
+ state: i,
1022
+ dispatch: c,
1023
+ useSelector: o,
1024
+ onOpenImage: s,
1025
+ onGoToFrame: a,
1026
+ onOpenViewer: h,
1027
+ onUpdateEntity: l,
1028
+ toast: he,
1029
+ ...f
603
1030
  }
604
1031
  );
605
- }, At = ({ children: e, fields: t }) => {
606
- const l = Ct.filter((u) => t.includes(u.value));
607
- return /* @__PURE__ */ g("main", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ M(
608
- Rt,
1032
+ }, Zt = ({ children: t, fields: e }) => {
1033
+ const i = Wt.filter((c) => e.includes(c.value));
1034
+ return /* @__PURE__ */ C("main", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ z(
1035
+ Yt,
609
1036
  {
610
1037
  layout: "horizontal",
611
1038
  style: { width: "100%", height: "100%" },
612
- stateKey: Ot,
1039
+ stateKey: Ht,
613
1040
  stateStorage: "local",
614
1041
  children: [
615
- /* @__PURE__ */ g(be, { ...St, children: /* @__PURE__ */ g(qe, { wrap: !0, children: /* @__PURE__ */ g(Dt, { sliceFields: l, pinnedSliceType: "hierarchy" }) }) }),
616
- /* @__PURE__ */ g(be, { size: 80, children: e })
1042
+ /* @__PURE__ */ C(Ie, { ...zt, children: /* @__PURE__ */ C(ct, { wrap: !0, children: /* @__PURE__ */ C(Gt, { sliceFields: i, pinnedSliceType: "hierarchy" }) }) }),
1043
+ /* @__PURE__ */ C(Ie, { size: 80, children: t })
617
1044
  ]
618
1045
  }
619
1046
  ) });
620
- }, wa = ({
621
- Component: e,
622
- projectName: t,
623
- slicer: l,
624
- state: u = {},
625
- addonProps: r,
626
- ...a
1047
+ }, ta = ({
1048
+ Component: t,
1049
+ projectName: e,
1050
+ slicer: i,
1051
+ state: c = {},
1052
+ addonProps: o,
1053
+ ...s
627
1054
  }) => {
628
- let o = /* @__PURE__ */ g(ve, { Component: e, projectName: t, ...a });
629
- if (l && t) {
630
- let f = null;
1055
+ let a = /* @__PURE__ */ C(_e, { Component: t, projectName: e, ...s });
1056
+ if (i && e) {
1057
+ let h = null;
631
1058
  try {
632
- f = vt();
1059
+ h = dt();
633
1060
  } catch {
634
1061
  console.log("Slicer context not available for this addon page");
635
1062
  }
636
- o = /* @__PURE__ */ g(At, { fields: l.fields, children: /* @__PURE__ */ g(
637
- ve,
1063
+ a = /* @__PURE__ */ C(Zt, { fields: i.fields, children: /* @__PURE__ */ C(
1064
+ _e,
638
1065
  {
639
- Component: e,
640
- projectName: t,
641
- ...a,
642
- state: { slicer: f, ...u },
643
- ...r
1066
+ Component: t,
1067
+ projectName: e,
1068
+ ...s,
1069
+ state: { slicer: h, ...c },
1070
+ ...o
644
1071
  }
645
1072
  ) });
646
1073
  }
647
- return o;
648
- }, _t = /* @__PURE__ */ new Set([
1074
+ return a;
1075
+ }, es = /* @__PURE__ */ new Set([
649
1076
  "name",
650
1077
  "status",
651
1078
  "tags",
@@ -660,243 +1087,243 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
660
1087
  "hasReviewables",
661
1088
  "createdAt",
662
1089
  "updatedAt"
663
- ]), va = ({
664
- filterTypes: e = [],
665
- projectNames: t,
666
- scope: l,
667
- scopes: u,
668
- data: r,
669
- config: a,
670
- power: o
1090
+ ]), sa = ({
1091
+ filterTypes: t = [],
1092
+ projectNames: e,
1093
+ scope: i,
1094
+ scopes: c,
1095
+ data: o,
1096
+ config: s,
1097
+ power: a
671
1098
  }) => {
672
- const f = st(), i = r.productTypes || [], c = r.productBaseTypes || [];
673
- let s = [];
674
- const w = /* @__PURE__ */ new Map(), v = u || (l ? Array.isArray(l) ? l : [l] : []).map((b) => ({
675
- scope: b,
676
- filterTypes: e
677
- })), D = v.length > 1, d = new Set(
678
- Array.from(new Set(v.flatMap(({ filterTypes: h }) => h))).filter(
679
- (h) => v.filter(({ filterTypes: b }) => b.includes(h)).length > 1
1099
+ const h = vt(), l = o.productTypes || [], f = o.productBaseTypes || [];
1100
+ let n = [];
1101
+ const E = /* @__PURE__ */ new Map(), y = c || (i ? Array.isArray(i) ? i : [i] : []).map((v) => ({
1102
+ scope: v,
1103
+ filterTypes: t
1104
+ })), D = y.length > 1, m = new Set(
1105
+ Array.from(new Set(y.flatMap(({ filterTypes: b }) => b))).filter(
1106
+ (b) => y.filter(({ filterTypes: v }) => v.includes(b)).length > 1
680
1107
  )
681
- ), T = v.some(
682
- (h) => ["entitySubType", "status"].some((b) => h.filterTypes.includes(b))
683
- ), _ = v.some(
684
- (h) => ["assignees", "users", "author"].some(
685
- (b) => h.filterTypes.includes(b)
1108
+ ), F = y.some(
1109
+ (b) => ["entitySubType", "status"].some((v) => b.filterTypes.includes(v))
1110
+ ), R = y.some(
1111
+ (b) => ["assignees", "users", "author"].some(
1112
+ (v) => b.filterTypes.includes(v)
686
1113
  )
687
- ), { data: m = {} } = it(
1114
+ ), { data: g = {} } = Ft(
688
1115
  {
689
- projects: t
1116
+ projects: e
690
1117
  },
691
1118
  {
692
- skip: !t?.length || !T
1119
+ skip: !e?.length || !F
693
1120
  }
694
- ), { data: R = [] } = ut(
695
- { projects: t },
1121
+ ), { data: T = [] } = At(
1122
+ { projects: e },
696
1123
  {
697
- skip: !t?.length || !_
1124
+ skip: !e?.length || !R
698
1125
  }
699
- ), { attributes: V } = Tt(), P = ze(Ze), N = P?.attribFields?.length ? P.attribFields : V, F = /* @__PURE__ */ new Map();
700
- v.forEach(({ scope: h, filterTypes: b }) => {
701
- b.includes("attributes") && N.filter((O) => O.scope?.includes(h)).forEach((O) => {
702
- F.set(
1126
+ ), { attributes: I } = Be(), L = lt(pt), N = L?.attribFields?.length ? L.attribFields : I, M = /* @__PURE__ */ new Map();
1127
+ y.forEach(({ scope: b, filterTypes: v }) => {
1128
+ v.includes("attributes") && N.filter((O) => O.scope?.includes(b)).forEach((O) => {
1129
+ M.set(
703
1130
  O.name,
704
- (F.get(O.name) || 0) + 1
1131
+ (M.get(O.name) || 0) + 1
705
1132
  );
706
1133
  });
707
- }), v.forEach(({ scope: h, filterTypes: b }) => {
708
- const O = D ? h : void 0;
709
- if (b.includes("taskType") && h !== "user") {
710
- const n = L(
1134
+ }), y.forEach(({ scope: b, filterTypes: v }) => {
1135
+ const O = D ? b : void 0;
1136
+ if (v.includes("taskType") && b !== "user") {
1137
+ const r = H(
711
1138
  "taskType",
712
1139
  {
713
- ...a,
1140
+ ...s,
714
1141
  enableOperatorChange: !1
715
1142
  },
716
1143
  O,
717
- d.has("taskType")
1144
+ m.has("taskType")
718
1145
  );
719
- if (n) {
720
- let p = ie({ projectsInfo: m, productTypes: i }, "task");
721
- n.values?.push(...p), s.push(n);
1146
+ if (r) {
1147
+ let p = ve({ projectsInfo: g, productTypes: l }, "task");
1148
+ r.values?.push(...p), n.push(r);
722
1149
  }
723
1150
  }
724
- if (b.includes("folderType") && h !== "user") {
725
- const n = L(
1151
+ if (v.includes("folderType") && b !== "user") {
1152
+ const r = H(
726
1153
  "folderType",
727
1154
  {
728
- ...a,
1155
+ ...s,
729
1156
  enableOperatorChange: !1
730
1157
  },
731
1158
  O,
732
- d.has("folderType")
1159
+ m.has("folderType")
733
1160
  );
734
- if (n) {
735
- let p = ie({ projectsInfo: m, productTypes: i }, "folder");
736
- n.values?.push(...p), s.push(n);
1161
+ if (r) {
1162
+ let p = ve({ projectsInfo: g, productTypes: l }, "folder");
1163
+ r.values?.push(...p), n.push(r);
737
1164
  }
738
1165
  }
739
- if (b.includes("productType") && h !== "user") {
740
- const n = L(
1166
+ if (v.includes("productType") && b !== "user") {
1167
+ const r = H(
741
1168
  "productType",
742
1169
  {
743
- ...a,
1170
+ ...s,
744
1171
  enableOperatorChange: !1
745
1172
  },
746
1173
  O,
747
- d.has("productType")
1174
+ m.has("productType")
748
1175
  );
749
- if (n) {
750
- let p = ie({ projectsInfo: m, productTypes: i }, "product");
751
- n.values?.push(...p), s.push(n);
1176
+ if (r) {
1177
+ let p = ve({ projectsInfo: g, productTypes: l }, "product");
1178
+ r.values?.push(...p), n.push(r);
752
1179
  }
753
1180
  }
754
- if (b.includes("productBaseType") && h !== "user") {
755
- const n = L(
1181
+ if (v.includes("productBaseType") && b !== "user") {
1182
+ const r = H(
756
1183
  "productBaseType",
757
1184
  {
758
- ...a,
1185
+ ...s,
759
1186
  enableOperatorChange: !1
760
1187
  },
761
1188
  O,
762
- d.has("productBaseType")
1189
+ m.has("productBaseType")
763
1190
  );
764
- n && (c.forEach(({ icon: p, name: C }) => {
765
- n.values?.some((y) => y.id === C) || n.values?.push({
766
- id: C,
767
- label: C,
768
- icon: p || Y("product")
1191
+ r && (f.forEach(({ icon: p, name: u }) => {
1192
+ r.values?.some((d) => d.id === u) || r.values?.push({
1193
+ id: u,
1194
+ label: u,
1195
+ icon: p || ae("product")
769
1196
  });
770
- }), r.productBaseTypes?.forEach(({ icon: p, name: C }) => {
771
- n.values?.some((y) => y.id === C) || n.values?.push({
772
- id: C,
773
- label: C,
774
- icon: p || Y("product")
1197
+ }), o.productBaseTypes?.forEach(({ icon: p, name: u }) => {
1198
+ r.values?.some((d) => d.id === u) || r.values?.push({
1199
+ id: u,
1200
+ label: u,
1201
+ icon: p || ae("product")
775
1202
  });
776
- }), s.push(n));
1203
+ }), n.push(r));
777
1204
  }
778
- if (b.includes("productName") && h === "product") {
779
- const n = L(
1205
+ if (v.includes("productName") && b === "product") {
1206
+ const r = H(
780
1207
  "productName",
781
- a,
1208
+ s,
782
1209
  O,
783
- d.has("productName")
1210
+ m.has("productName")
784
1211
  );
785
- n && (r.productNames?.forEach((p) => {
786
- n.values?.some((C) => C.id === p) || n.values?.push({
1212
+ r && (o.productNames?.forEach((p) => {
1213
+ r.values?.some((u) => u.id === p) || r.values?.push({
787
1214
  id: p,
788
1215
  label: p
789
1216
  });
790
- }), s.push(n));
1217
+ }), n.push(r));
791
1218
  }
792
- if (b.includes("status")) {
793
- const n = L(
1219
+ if (v.includes("status")) {
1220
+ const r = H(
794
1221
  "status",
795
- { ...a, enableOperatorChange: !1 },
1222
+ { ...s, enableOperatorChange: !1 },
796
1223
  O,
797
- d.has("status")
1224
+ m.has("status")
798
1225
  );
799
- n && (Object.values(m).forEach((p) => {
800
- (p?.statuses || []).filter((y) => y.scope?.includes(h)).forEach((y) => {
801
- n.values?.some((x) => x.id === y.name) || n.values?.push({
802
- id: y.name,
803
- label: y.name,
804
- icon: y.icon,
805
- color: y.color
1226
+ r && (Object.values(g).forEach((p) => {
1227
+ (p?.statuses || []).filter((d) => d.scope?.includes(b)).forEach((d) => {
1228
+ r.values?.some((S) => S.id === d.name) || r.values?.push({
1229
+ id: d.name,
1230
+ label: d.name,
1231
+ icon: d.icon,
1232
+ color: d.color
806
1233
  });
807
1234
  });
808
- }), s.push(n));
1235
+ }), n.push(r));
809
1236
  }
810
- if (b.includes("assignees")) {
811
- const n = L(
1237
+ if (v.includes("assignees")) {
1238
+ const r = H(
812
1239
  "assignees",
813
- a,
1240
+ s,
814
1241
  O,
815
- d.has("assignees")
1242
+ m.has("assignees")
816
1243
  );
817
- n && (R.forEach((p) => {
818
- n.values?.some((C) => C.id === p.name) || n.values?.push({
1244
+ r && (T.forEach((p) => {
1245
+ r.values?.some((u) => u.id === p.name) || r.values?.push({
819
1246
  id: p.name,
820
1247
  label: p.attrib.fullName || p.name,
821
1248
  img: `/api/users/${p.name}/avatar`,
822
1249
  icon: null
823
1250
  });
824
- }), n.values?.sort((p, C) => {
825
- const y = r.assignees?.filter((k) => k === p.id).length || 0;
826
- return (r.assignees?.filter((k) => k === C.id).length || 0) - y;
827
- }), s.push(n));
1251
+ }), r.values?.sort((p, u) => {
1252
+ const d = o.assignees?.filter((A) => A === p.id).length || 0;
1253
+ return (o.assignees?.filter((A) => A === u.id).length || 0) - d;
1254
+ }), n.push(r));
828
1255
  }
829
- if (b.includes("author")) {
830
- const n = L(
1256
+ if (v.includes("author")) {
1257
+ const r = H(
831
1258
  "author",
832
- a,
1259
+ s,
833
1260
  O,
834
- d.has("author")
1261
+ m.has("author")
835
1262
  );
836
- n && (R.forEach((p) => {
837
- n.values?.some((C) => C.id === p.name) || n.values?.push({
1263
+ r && (T.forEach((p) => {
1264
+ r.values?.some((u) => u.id === p.name) || r.values?.push({
838
1265
  id: p.name,
839
1266
  label: p.attrib.fullName || p.name,
840
1267
  img: `/api/users/${p.name}/avatar`,
841
1268
  icon: null
842
1269
  });
843
- }), s.push(n));
1270
+ }), n.push(r));
844
1271
  }
845
- if (b.includes("tags")) {
846
- const n = L("tags", a, O, d.has("tags"));
847
- if (n) {
1272
+ if (v.includes("tags")) {
1273
+ const r = H("tags", s, O, m.has("tags"));
1274
+ if (r) {
848
1275
  const p = /* @__PURE__ */ new Map();
849
- Object.values(m).forEach((x) => {
850
- x?.tags && x.tags.forEach((k) => {
851
- p.has(k.name) || p.set(k.name, k);
1276
+ Object.values(g).forEach((S) => {
1277
+ S?.tags && S.tags.forEach((A) => {
1278
+ p.has(A.name) || p.set(A.name, A);
852
1279
  });
853
1280
  });
854
- const C = /* @__PURE__ */ new Map();
855
- r.tags?.forEach((x) => {
856
- const k = C.get(x);
857
- if (k) {
858
- k.count++;
1281
+ const u = /* @__PURE__ */ new Map();
1282
+ o.tags?.forEach((S) => {
1283
+ const A = u.get(S);
1284
+ if (A) {
1285
+ A.count++;
859
1286
  return;
860
1287
  } else {
861
- const E = p.get(x);
862
- C.set(x, {
863
- id: x,
1288
+ const w = p.get(S);
1289
+ u.set(S, {
1290
+ id: S,
864
1291
  type: "string",
865
- label: x,
1292
+ label: S,
866
1293
  values: [],
867
- color: E?.color || null,
1294
+ color: w?.color || null,
868
1295
  count: 1
869
1296
  });
870
1297
  }
871
1298
  });
872
- const y = Array.from(C.values()).sort(
873
- (x, k) => k.count - x.count
1299
+ const d = Array.from(u.values()).sort(
1300
+ (S, A) => A.count - S.count
874
1301
  );
875
- n.values?.push(...y), s.push(n);
1302
+ r.values?.push(...d), n.push(r);
876
1303
  }
877
1304
  }
878
- if (b.includes("version")) {
879
- const n = L("version", a, O);
880
- n && (Xe.forEach((C) => {
881
- n.values?.push({
882
- id: C.value,
883
- label: C.label,
884
- icon: C.icon
1305
+ if (v.includes("version")) {
1306
+ const r = H("version", s, O);
1307
+ r && (rt.forEach((u) => {
1308
+ r.values?.push({
1309
+ id: u.value,
1310
+ label: u.label,
1311
+ icon: u.icon
885
1312
  });
886
- }), s.push(n));
1313
+ }), n.push(r));
887
1314
  }
888
- if (b.includes("name")) {
889
- const n = L("name", a, O, d.has("name"));
890
- n && s.push(n);
1315
+ if (v.includes("name")) {
1316
+ const r = H("name", s, O, m.has("name"));
1317
+ r && n.push(r);
891
1318
  }
892
- if (b.includes("hasReviewables")) {
893
- const n = L(
1319
+ if (v.includes("hasReviewables")) {
1320
+ const r = H(
894
1321
  "hasReviewables",
895
- a,
1322
+ s,
896
1323
  O,
897
- d.has("hasReviewables")
1324
+ m.has("hasReviewables")
898
1325
  );
899
- if (n) {
1326
+ if (r) {
900
1327
  const p = [
901
1328
  {
902
1329
  id: "true",
@@ -909,81 +1336,81 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
909
1336
  values: []
910
1337
  }
911
1338
  ];
912
- n.values?.push(...p), s.push(n);
1339
+ r.values?.push(...p), n.push(r);
913
1340
  }
914
1341
  }
915
- if (b.includes("createdAt")) {
916
- const n = L(
1342
+ if (v.includes("createdAt")) {
1343
+ const r = H(
917
1344
  "createdAt",
918
- a,
1345
+ s,
919
1346
  O,
920
- d.has("createdAt")
1347
+ m.has("createdAt")
921
1348
  );
922
- n && (n.values?.push(ne), n.values?.push(
923
- ...le().map((p) => ({
1349
+ r && (r.values?.push(we), r.values?.push(
1350
+ ...ye().map((p) => ({
924
1351
  ...p,
925
- contentAfter: o ? void 0 : /* @__PURE__ */ g(z, { icon: "bolt" })
1352
+ contentAfter: a ? void 0 : /* @__PURE__ */ C(le, { icon: "bolt" })
926
1353
  }))
927
- ), s.push(n));
1354
+ ), n.push(r));
928
1355
  }
929
- if (b.includes("updatedAt")) {
930
- const n = L(
1356
+ if (v.includes("updatedAt")) {
1357
+ const r = H(
931
1358
  "updatedAt",
932
- a,
1359
+ s,
933
1360
  O,
934
- d.has("updatedAt")
1361
+ m.has("updatedAt")
935
1362
  );
936
- n && (n.values?.push(ne), n.values?.push(
937
- ...le().map((p) => ({
1363
+ r && (r.values?.push(we), r.values?.push(
1364
+ ...ye().map((p) => ({
938
1365
  ...p,
939
- contentAfter: o ? void 0 : /* @__PURE__ */ g(z, { icon: "bolt" })
1366
+ contentAfter: a ? void 0 : /* @__PURE__ */ C(le, { icon: "bolt" })
940
1367
  }))
941
- ), s.push(n));
1368
+ ), n.push(r));
942
1369
  }
943
- if (b.includes("attributes")) {
944
- const n = N.filter(
945
- (y) => y.scope?.includes(h)
946
- ), p = dt(r.attributes) ? n : n.filter(
947
- (y) => r.attributes && r.attributes[y.name]
1370
+ if (v.includes("attributes")) {
1371
+ const r = N.filter(
1372
+ (d) => d.scope?.includes(b)
1373
+ ), p = Pt(o.attributes) ? r : r.filter(
1374
+ (d) => o.attributes && o.attributes[d.name]
948
1375
  );
949
- (a?.enableRelativeValues ? p : p.filter((y) => y.data.type !== "datetime")).forEach((y) => {
950
- const x = r.attributes && r.attributes[y.name], k = y.data.enum, E = y.data.type, A = [
1376
+ (s?.enableRelativeValues ? p : p.filter((d) => d.data.type !== "datetime")).forEach((d) => {
1377
+ const S = o.attributes && o.attributes[d.name], A = d.data.enum, w = d.data.type, x = [
951
1378
  "list_of_strings",
952
1379
  "list_of_integers",
953
1380
  "list_of_any",
954
1381
  "list_of_submodels"
955
- ].includes(E || ""), I = E === "datetime", W = E === "string", $ = E === "integer" || E === "float", J = A ? a?.enableOperatorChange : !1, re = y.data.default !== void 0 && y.data.default !== null && y.data.inherit !== !1, xe = (A || I || W || $) && !re ? a?.enableRelativeValues : !1, q = xt(
956
- y,
1382
+ ].includes(w || ""), B = w === "datetime", W = w === "string", K = w === "integer" || w === "float", te = x ? s?.enableOperatorChange : !1, q = d.data.default !== void 0 && d.data.default !== null && d.data.inherit !== !1, pe = (x || B || W || K) && !q ? s?.enableRelativeValues : !1, X = ts(
1383
+ d,
957
1384
  {
958
- ...a,
1385
+ ...s,
959
1386
  allowsCustomValues: !0,
960
- enableOperatorChange: J,
961
- enableRelativeValues: xe
1387
+ enableOperatorChange: te,
1388
+ enableRelativeValues: pe
962
1389
  },
963
1390
  O,
964
- (F.get(y.name) || 0) > 1
1391
+ (M.get(d.name) || 0) > 1
965
1392
  );
966
- if (y.data.enumResolver) {
967
- const j = y.data;
968
- q.loadValuesKey = t?.[0], q.loadValues = async () => Ce(
969
- x,
970
- await f(j, t?.[0]),
971
- E
1393
+ if (d.data.enumResolver) {
1394
+ const Q = d.data;
1395
+ X.loadValuesKey = e?.[0], X.loadValues = async () => xe(
1396
+ S,
1397
+ await h(Q, e?.[0]),
1398
+ w
972
1399
  );
973
1400
  }
974
- const ke = [
1401
+ const fe = [
975
1402
  "string",
976
1403
  "integer",
977
1404
  "float",
978
1405
  "list_of_strings",
979
1406
  "list_of_integers"
980
- ], Q = [];
981
- if (ke.includes(E)) {
982
- const j = Ce(x, k, E);
983
- Q.push(...j);
1407
+ ], J = [];
1408
+ if (fe.includes(w)) {
1409
+ const Q = xe(S, A, w);
1410
+ J.push(...Q);
984
1411
  }
985
- if (E === "boolean") {
986
- const j = [
1412
+ if (w === "boolean") {
1413
+ const Q = [
987
1414
  {
988
1415
  id: "true",
989
1416
  label: "Yes",
@@ -995,56 +1422,56 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
995
1422
  values: []
996
1423
  }
997
1424
  ];
998
- Q.push(...j);
1425
+ J.push(...Q);
999
1426
  }
1000
- I && (Q.push(ne), Q.push(
1001
- ...le().map((j) => ({
1002
- ...j,
1003
- contentAfter: o ? void 0 : /* @__PURE__ */ g(z, { icon: "bolt" })
1427
+ B && (J.push(we), J.push(
1428
+ ...ye().map((Q) => ({
1429
+ ...Q,
1430
+ contentAfter: a ? void 0 : /* @__PURE__ */ C(le, { icon: "bolt" })
1004
1431
  }))
1005
- )), q.values?.push(...Q), w.set(q.id, y.name), s.push(q);
1432
+ )), X.values?.push(...J), E.set(X.id, d.name), n.push(X);
1006
1433
  });
1007
1434
  }
1008
1435
  });
1009
- const U = s.reduce((h, b) => {
1010
- if (!b.group) return h;
1011
- const O = typeof b.group == "string" ? void 0 : b.group, n = O?.name || b.group, p = v.some(({ scope: C }) => C === n);
1012
- return h.some((C) => C.name === n) || h.push({
1013
- name: n,
1014
- label: p ? ae(n) : O?.label || b.label,
1015
- icon: p ? Y(n) : O?.icon || b.icon,
1016
- color: O?.color || b.color
1017
- }), h;
1018
- }, []), K = kt(s, w, N), S = Pt(
1019
- U,
1020
- K,
1021
- w,
1436
+ const G = n.reduce((b, v) => {
1437
+ if (!v.group) return b;
1438
+ const O = typeof v.group == "string" ? void 0 : v.group, r = O?.name || v.group, p = y.some(({ scope: u }) => u === r);
1439
+ return b.some((u) => u.name === r) || b.push({
1440
+ name: r,
1441
+ label: p ? de(r) : O?.label || v.label,
1442
+ icon: p ? ae(r) : O?.icon || v.icon,
1443
+ color: O?.color || v.color
1444
+ }), b;
1445
+ }, []), $ = ss(n, E, N), V = as(
1446
+ G,
1447
+ $,
1448
+ E,
1022
1449
  N
1023
1450
  );
1024
- return { options: K, groupOptions: S };
1025
- }, ie = ({
1026
- projectsInfo: e,
1027
- productTypes: t
1028
- }, l) => {
1029
- const u = [];
1030
- return l === "product" ? t.forEach(({ icon: r, name: a }) => {
1031
- u.push({
1032
- id: a,
1451
+ return { options: $, groupOptions: V };
1452
+ }, ve = ({
1453
+ projectsInfo: t,
1454
+ productTypes: e
1455
+ }, i) => {
1456
+ const c = [];
1457
+ return i === "product" ? e.forEach(({ icon: o, name: s }) => {
1458
+ c.push({
1459
+ id: s,
1033
1460
  type: "string",
1034
- label: a,
1035
- icon: r || Y("product"),
1461
+ label: s,
1462
+ icon: o || ae("product"),
1036
1463
  inverted: !1,
1037
1464
  values: [],
1038
1465
  allowsCustomValues: !1
1039
1466
  });
1040
- }) : l === "task" ? Object.values(e).forEach((r) => {
1041
- (r?.taskTypes || []).forEach((o) => {
1042
- u.some((f) => f.id === o.name) || u.push({
1043
- id: o.name,
1467
+ }) : i === "task" ? Object.values(t).forEach((o) => {
1468
+ (o?.taskTypes || []).forEach((a) => {
1469
+ c.some((h) => h.id === a.name) || c.push({
1470
+ id: a.name,
1044
1471
  type: "string",
1045
- label: o.name,
1046
- icon: o.icon,
1047
- color: o.color,
1472
+ label: a.name,
1473
+ icon: a.icon,
1474
+ color: a.color,
1048
1475
  inverted: !1,
1049
1476
  values: [],
1050
1477
  allowsCustomValues: !1,
@@ -1055,14 +1482,14 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1055
1482
  }
1056
1483
  });
1057
1484
  });
1058
- }) : l === "folder" && Object.values(e).forEach((r) => {
1059
- (r?.folderTypes || []).forEach((o) => {
1060
- u.some((f) => f.id === o.name) || u.push({
1061
- id: o.name,
1485
+ }) : i === "folder" && Object.values(t).forEach((o) => {
1486
+ (o?.folderTypes || []).forEach((a) => {
1487
+ c.some((h) => h.id === a.name) || c.push({
1488
+ id: a.name,
1062
1489
  type: "string",
1063
- label: o.name,
1064
- icon: o.icon,
1065
- color: o.color,
1490
+ label: a.name,
1491
+ icon: a.icon,
1492
+ color: a.color,
1066
1493
  inverted: !1,
1067
1494
  values: [],
1068
1495
  allowsCustomValues: !1,
@@ -1073,85 +1500,85 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1073
1500
  }
1074
1501
  });
1075
1502
  });
1076
- }), u;
1077
- }, Ve = (e, t, l, u) => {
1078
- const { prefixes: r, keys: a } = l || {};
1079
- let o = e;
1080
- return a && t in a ? o = `${a[t]}` : r && t in r && (o = `${r[t]}${e}`), u && (o = `${u}_${o}`), o;
1081
- }, L = (e, t, l, u = !1) => {
1082
- const r = (i) => Ve(i, e, t, l);
1083
- let a = null;
1084
- switch (e) {
1503
+ }), c;
1504
+ }, Ue = (t, e, i, c) => {
1505
+ const { prefixes: o, keys: s } = i || {};
1506
+ let a = t;
1507
+ return s && e in s ? a = `${s[e]}` : o && e in o && (a = `${o[e]}${t}`), c && (a = `${c}_${a}`), a;
1508
+ }, H = (t, e, i, c = !1) => {
1509
+ const o = (l) => Ue(l, t, e, i);
1510
+ let s = null;
1511
+ switch (t) {
1085
1512
  case "taskType":
1086
- a = {
1087
- id: r("taskType"),
1513
+ s = {
1514
+ id: o("taskType"),
1088
1515
  type: "string",
1089
1516
  label: "Task Type",
1090
- icon: B("task"),
1517
+ icon: j("task"),
1091
1518
  inverted: !1,
1092
1519
  operator: "OR",
1093
1520
  values: [],
1094
1521
  allowsCustomValues: !1,
1095
1522
  allowHasValue: !1,
1096
1523
  allowNoValue: !1,
1097
- allowExcludes: t?.enableExcludes,
1524
+ allowExcludes: e?.enableExcludes,
1098
1525
  operatorChangeable: !1
1099
1526
  };
1100
1527
  break;
1101
1528
  case "folderType":
1102
- a = {
1103
- id: r("folderType"),
1529
+ s = {
1530
+ id: o("folderType"),
1104
1531
  type: "string",
1105
1532
  label: "Folder Type",
1106
- icon: B("folder"),
1533
+ icon: j("folder"),
1107
1534
  inverted: !1,
1108
1535
  operator: "OR",
1109
1536
  values: [],
1110
1537
  allowsCustomValues: !1,
1111
1538
  allowHasValue: !1,
1112
1539
  allowNoValue: !1,
1113
- allowExcludes: t?.enableExcludes,
1540
+ allowExcludes: e?.enableExcludes,
1114
1541
  operatorChangeable: !1
1115
1542
  };
1116
1543
  break;
1117
1544
  case "productType":
1118
- a = {
1119
- id: r("productType"),
1545
+ s = {
1546
+ id: o("productType"),
1120
1547
  type: "string",
1121
1548
  label: "Product Type",
1122
- icon: B("product"),
1549
+ icon: j("product"),
1123
1550
  inverted: !1,
1124
1551
  operator: "OR",
1125
1552
  values: [],
1126
1553
  allowsCustomValues: !1,
1127
1554
  allowHasValue: !1,
1128
1555
  allowNoValue: !1,
1129
- allowExcludes: t?.enableExcludes,
1556
+ allowExcludes: e?.enableExcludes,
1130
1557
  operatorChangeable: !1
1131
1558
  };
1132
1559
  break;
1133
1560
  case "productBaseType":
1134
- a = {
1135
- id: r("productBaseType"),
1561
+ s = {
1562
+ id: o("productBaseType"),
1136
1563
  type: "string",
1137
1564
  label: "Product Base Type",
1138
- icon: B("product"),
1565
+ icon: j("product"),
1139
1566
  inverted: !1,
1140
1567
  operator: "OR",
1141
1568
  values: [],
1142
1569
  allowsCustomValues: !0,
1143
1570
  allowHasValue: !1,
1144
1571
  allowNoValue: !1,
1145
- allowExcludes: t?.enableExcludes,
1572
+ allowExcludes: e?.enableExcludes,
1146
1573
  operatorChangeable: !1
1147
1574
  };
1148
1575
  break;
1149
1576
  case "productName":
1150
- a = {
1151
- id: r("productNames"),
1577
+ s = {
1578
+ id: o("productNames"),
1152
1579
  type: "string",
1153
1580
  label: "Product Name",
1154
- icon: B("productName", "string"),
1581
+ icon: j("productName", "string"),
1155
1582
  inverted: !1,
1156
1583
  operator: "OR",
1157
1584
  values: [],
@@ -1163,75 +1590,75 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1163
1590
  };
1164
1591
  break;
1165
1592
  case "status":
1166
- a = {
1167
- id: r("status"),
1593
+ s = {
1594
+ id: o("status"),
1168
1595
  type: "string",
1169
1596
  label: "Status",
1170
- icon: B("status"),
1597
+ icon: j("status"),
1171
1598
  inverted: !1,
1172
1599
  operator: "OR",
1173
1600
  values: [],
1174
1601
  allowsCustomValues: !1,
1175
1602
  allowHasValue: !1,
1176
1603
  allowNoValue: !1,
1177
- allowExcludes: t?.enableExcludes,
1604
+ allowExcludes: e?.enableExcludes,
1178
1605
  operatorChangeable: !1
1179
1606
  };
1180
1607
  break;
1181
1608
  case "assignees":
1182
- a = {
1183
- id: r("assignees"),
1609
+ s = {
1610
+ id: o("assignees"),
1184
1611
  type: "list_of_strings",
1185
1612
  label: "Assignee",
1186
- icon: B("assignees"),
1613
+ icon: j("assignees"),
1187
1614
  inverted: !1,
1188
1615
  operator: "OR",
1189
1616
  values: [],
1190
1617
  allowsCustomValues: !1,
1191
- allowHasValue: t?.enableRelativeValues,
1192
- allowNoValue: t?.enableRelativeValues,
1193
- allowExcludes: t?.enableExcludes,
1194
- operatorChangeable: t?.enableOperatorChange
1618
+ allowHasValue: e?.enableRelativeValues,
1619
+ allowNoValue: e?.enableRelativeValues,
1620
+ allowExcludes: e?.enableExcludes,
1621
+ operatorChangeable: e?.enableOperatorChange
1195
1622
  };
1196
1623
  break;
1197
1624
  case "author":
1198
- a = {
1199
- id: r("author"),
1625
+ s = {
1626
+ id: o("author"),
1200
1627
  type: "string",
1201
1628
  label: "Author",
1202
- icon: B("author"),
1629
+ icon: j("author"),
1203
1630
  inverted: !1,
1204
1631
  operator: "OR",
1205
1632
  values: [],
1206
1633
  allowsCustomValues: !1,
1207
- allowHasValue: t?.enableRelativeValues,
1208
- allowNoValue: t?.enableRelativeValues,
1209
- allowExcludes: t?.enableExcludes,
1210
- operatorChangeable: t?.enableOperatorChange
1634
+ allowHasValue: e?.enableRelativeValues,
1635
+ allowNoValue: e?.enableRelativeValues,
1636
+ allowExcludes: e?.enableExcludes,
1637
+ operatorChangeable: e?.enableOperatorChange
1211
1638
  };
1212
1639
  break;
1213
1640
  case "tags":
1214
- a = {
1215
- id: r("tags"),
1641
+ s = {
1642
+ id: o("tags"),
1216
1643
  type: "list_of_strings",
1217
1644
  label: "Tags",
1218
- icon: B("tags"),
1645
+ icon: j("tags"),
1219
1646
  inverted: !1,
1220
1647
  operator: "OR",
1221
1648
  values: [],
1222
1649
  allowsCustomValues: !0,
1223
- allowHasValue: t?.enableRelativeValues,
1224
- allowNoValue: t?.enableRelativeValues,
1225
- allowExcludes: t?.enableExcludes,
1226
- operatorChangeable: t?.enableOperatorChange
1650
+ allowHasValue: e?.enableRelativeValues,
1651
+ allowNoValue: e?.enableRelativeValues,
1652
+ allowExcludes: e?.enableExcludes,
1653
+ operatorChangeable: e?.enableOperatorChange
1227
1654
  };
1228
1655
  break;
1229
1656
  case "version":
1230
- a = {
1231
- id: r("version"),
1657
+ s = {
1658
+ id: o("version"),
1232
1659
  type: "string",
1233
1660
  label: "Version",
1234
- icon: Y("version"),
1661
+ icon: ae("version"),
1235
1662
  inverted: !1,
1236
1663
  operator: "OR",
1237
1664
  values: [],
@@ -1244,8 +1671,8 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1244
1671
  };
1245
1672
  break;
1246
1673
  case "name":
1247
- a = {
1248
- id: r("name"),
1674
+ s = {
1675
+ id: o("name"),
1249
1676
  type: "string",
1250
1677
  label: "Name",
1251
1678
  icon: "text_fields",
@@ -1260,8 +1687,8 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1260
1687
  };
1261
1688
  break;
1262
1689
  case "hasReviewables":
1263
- a = {
1264
- id: r("hasReviewables"),
1690
+ s = {
1691
+ id: o("hasReviewables"),
1265
1692
  type: "boolean",
1266
1693
  label: "Has Reviewables",
1267
1694
  icon: "play_circle",
@@ -1271,14 +1698,14 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1271
1698
  allowsCustomValues: !1,
1272
1699
  allowHasValue: !1,
1273
1700
  allowNoValue: !1,
1274
- allowExcludes: t?.enableExcludes,
1701
+ allowExcludes: e?.enableExcludes,
1275
1702
  operatorChangeable: !1,
1276
1703
  singleSelect: !0
1277
1704
  };
1278
1705
  break;
1279
1706
  case "createdAt":
1280
- a = {
1281
- id: r("createdAt"),
1707
+ s = {
1708
+ id: o("createdAt"),
1282
1709
  type: "datetime",
1283
1710
  label: "Created",
1284
1711
  icon: "calendar_add_on",
@@ -1294,8 +1721,8 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1294
1721
  };
1295
1722
  break;
1296
1723
  case "updatedAt":
1297
- a = {
1298
- id: r("updatedAt"),
1724
+ s = {
1725
+ id: o("updatedAt"),
1299
1726
  type: "datetime",
1300
1727
  label: "Updated",
1301
1728
  icon: "edit_calendar",
@@ -1311,134 +1738,136 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1311
1738
  };
1312
1739
  break;
1313
1740
  }
1314
- const o = ae(l || ""), f = (i) => l ? `${o} ${i}` : i;
1315
- if ((u || l) && a) {
1316
- const i = l || e;
1317
- a.group = {
1318
- name: i,
1319
- label: l ? ae(l) : a.label,
1320
- icon: l ? Y(l) : a.icon
1741
+ const a = de(i || ""), h = (l) => i ? `${a} ${l}` : l;
1742
+ if ((c || i) && s) {
1743
+ const l = i || t;
1744
+ s.group = {
1745
+ name: l,
1746
+ label: i ? de(i) : s.label,
1747
+ icon: i ? ae(i) : s.icon
1321
1748
  };
1322
1749
  }
1323
- return a && l && (a.tooltip = f(a.label), a.value = { label: f(a.label) }), a && e === "version" && l === "version" && (a.value = { label: "Product Version" }, a.tooltip = "Product Version"), a;
1324
- }, xt = (e, t, l, u = !1) => {
1325
- const r = e.data.title || e.name, a = u || l ? {
1326
- name: l || e.name,
1327
- label: l ? ae(l) : r,
1328
- icon: l ? Y(l) : B(e.name, e.data.type, me(e.data))
1750
+ return s && i && (s.tooltip = h(s.label), s.value = { label: h(s.label) }), s && t === "version" && i === "version" && (s.value = { label: "Product Version" }, s.tooltip = "Product Version"), s;
1751
+ }, ts = (t, e, i, c = !1) => {
1752
+ const o = t.data.title || t.name, s = c || i ? {
1753
+ name: i || t.name,
1754
+ label: i ? de(i) : o,
1755
+ icon: i ? ae(i) : j(t.name, t.data.type, Re(t.data))
1329
1756
  } : void 0;
1330
1757
  return {
1331
- id: Ve(e.name, "attributes", t, l),
1332
- type: e.data.type,
1333
- label: r,
1758
+ id: Ue(t.name, "attributes", e, i),
1759
+ type: t.data.type,
1760
+ label: o,
1334
1761
  operator: "OR",
1335
1762
  inverted: !1,
1336
1763
  values: [],
1337
- allowsCustomValues: t?.allowsCustomValues,
1338
- allowHasValue: t.enableRelativeValues,
1339
- allowNoValue: t.enableRelativeValues,
1340
- allowExcludes: t?.enableExcludes,
1341
- operatorChangeable: t?.enableOperatorChange,
1342
- icon: B(e.name, e.data.type, me(e.data)),
1343
- group: a,
1344
- tooltip: l ? `${ae(l)} ${r}` : void 0,
1345
- value: l ? { icon: Y(l) } : void 0,
1346
- singleSelect: ["boolean", "datetime"].includes(e.data.type || "")
1764
+ allowsCustomValues: e?.allowsCustomValues,
1765
+ allowHasValue: e.enableRelativeValues,
1766
+ allowNoValue: e.enableRelativeValues,
1767
+ allowExcludes: e?.enableExcludes,
1768
+ operatorChangeable: e?.enableOperatorChange,
1769
+ icon: j(t.name, t.data.type, Re(t.data)),
1770
+ group: s,
1771
+ tooltip: i ? `${de(i)} ${o}` : void 0,
1772
+ value: i ? { icon: ae(i) } : void 0,
1773
+ singleSelect: ["boolean", "datetime"].includes(t.data.type || "")
1347
1774
  };
1348
- }, Ce = (e, t, l) => {
1349
- const u = [], r = [];
1350
- if (t) {
1351
- const a = (e || []).flatMap((o) => Array.isArray(o) ? o : [o]);
1352
- ot(t, a).forEach((o) => {
1353
- const f = o.icon, i = rt(f);
1354
- u.push({
1355
- id: o.value.toString(),
1356
- type: l,
1357
- label: o.label,
1358
- values: [],
1359
- icon: i ? null : f,
1360
- img: i ? f : void 0,
1361
- color: o.color,
1362
- pt: {
1363
- style: { color: "inherit" }
1364
- }
1365
- });
1366
- });
1775
+ }, xe = (t, e, i) => {
1776
+ const c = [], o = [];
1777
+ if (e) {
1778
+ const s = (t || []).flatMap((a) => Array.isArray(a) ? a : [a]);
1779
+ Et(e, s).forEach(
1780
+ (a) => {
1781
+ const h = a.icon, l = Ct(h);
1782
+ c.push({
1783
+ id: a.value.toString(),
1784
+ type: i,
1785
+ label: a.label,
1786
+ values: [],
1787
+ icon: l ? null : h,
1788
+ img: l ? h : void 0,
1789
+ color: a.color,
1790
+ pt: {
1791
+ style: { color: "inherit" }
1792
+ }
1793
+ });
1794
+ }
1795
+ );
1367
1796
  }
1368
- return e?.forEach((a) => {
1369
- if (!a) return;
1370
- let o = "";
1371
- switch (typeof a) {
1797
+ return t?.forEach((s) => {
1798
+ if (!s) return;
1799
+ let a = "";
1800
+ switch (typeof s) {
1372
1801
  case "string":
1373
1802
  case "number":
1374
1803
  case "boolean":
1375
- o = a.toString();
1804
+ a = s.toString();
1376
1805
  break;
1377
1806
  case "object":
1378
- Array.isArray(a) ? o = a.join(", ") : o = JSON.stringify(a);
1807
+ Array.isArray(s) ? a = s.join(", ") : a = JSON.stringify(s);
1379
1808
  break;
1380
1809
  }
1381
- const f = o.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
1382
- if (u?.find((s) => s.id === f)) return;
1383
- const c = r.find((s) => s.id === f);
1384
- if (c) {
1385
- c.count++;
1810
+ const h = a.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
1811
+ if (c?.find((n) => n.id === h)) return;
1812
+ const f = o.find((n) => n.id === h);
1813
+ if (f) {
1814
+ f.count++;
1386
1815
  return;
1387
1816
  } else
1388
- r.push({
1389
- id: f,
1390
- type: l,
1391
- label: o,
1817
+ o.push({
1818
+ id: h,
1819
+ type: i,
1820
+ label: a,
1392
1821
  values: [],
1393
1822
  count: 1
1394
1823
  });
1395
- }), r.sort((a, o) => o.count - a.count), [...u, ...r];
1396
- }, kt = (e, t, l) => [...e].sort((u, r) => Ae(
1397
- oe(u),
1398
- t.get(u.id),
1399
- oe(r),
1400
- t.get(r.id),
1401
- l
1402
- )), oe = (e) => e.group ? typeof e.group == "string" ? e.group : e.group.name : e.id, Pt = (e, t, l, u) => [...e].sort((r, a) => {
1403
- const o = t.find((i) => (typeof i.group == "string" ? i.group : i.group?.name) === r.name), f = t.find((i) => (typeof i.group == "string" ? i.group : i.group?.name) === a.name);
1404
- return Ae(
1405
- o ? oe(o) : r.name,
1406
- o ? l.get(o.id) : r.name,
1407
- f ? oe(f) : a.name,
1408
- f ? l.get(f.id) : a.name,
1409
- u
1824
+ }), o.sort((s, a) => a.count - s.count), [...c, ...o];
1825
+ }, ss = (t, e, i) => [...t].sort((c, o) => We(
1826
+ ge(c),
1827
+ e.get(c.id),
1828
+ ge(o),
1829
+ e.get(o.id),
1830
+ i
1831
+ )), ge = (t) => t.group ? typeof t.group == "string" ? t.group : t.group.name : t.id, as = (t, e, i, c) => [...t].sort((o, s) => {
1832
+ const a = e.find((l) => (typeof l.group == "string" ? l.group : l.group?.name) === o.name), h = e.find((l) => (typeof l.group == "string" ? l.group : l.group?.name) === s.name);
1833
+ return We(
1834
+ a ? ge(a) : o.name,
1835
+ a ? i.get(a.id) : o.name,
1836
+ h ? ge(h) : s.name,
1837
+ h ? i.get(h.id) : s.name,
1838
+ c
1410
1839
  );
1411
- }), Ae = (e, t, l, u, r) => {
1412
- const a = new Map(r.map((c, s) => [c.name, s])), o = (c) => {
1413
- let s = 0;
1414
- for (const w of _t) {
1415
- if (c === w || c.endsWith(`_${w}`)) return s;
1416
- s++;
1840
+ }), We = (t, e, i, c, o) => {
1841
+ const s = new Map(o.map((f, n) => [f.name, n])), a = (f) => {
1842
+ let n = 0;
1843
+ for (const E of es) {
1844
+ if (f === E || f.endsWith(`_${E}`)) return n;
1845
+ n++;
1417
1846
  }
1418
1847
  return Number.MAX_SAFE_INTEGER;
1419
- }, f = t ? [1, a.get(t) ?? Number.MAX_SAFE_INTEGER] : [0, o(e)], i = u ? [1, a.get(u) ?? Number.MAX_SAFE_INTEGER] : [0, o(l)];
1420
- return f[0] - i[0] || f[1] - i[1];
1421
- }, Ca = (e, t, l, u) => {
1422
- const r = {
1423
- folder: { conditions: [], operator: e?.operator || "and" },
1424
- product: { conditions: [], operator: e?.operator || "and" },
1425
- task: { conditions: [], operator: e?.operator || "and" },
1426
- user: { conditions: [], operator: e?.operator || "and" },
1427
- version: { conditions: [], operator: e?.operator || "and" },
1428
- unscoped: { conditions: [], operator: e?.operator || "and" }
1848
+ }, h = e ? [1, s.get(e) ?? Number.MAX_SAFE_INTEGER] : [0, a(t)], l = c ? [1, s.get(c) ?? Number.MAX_SAFE_INTEGER] : [0, a(i)];
1849
+ return h[0] - l[0] || h[1] - l[1];
1850
+ }, aa = (t, e, i, c) => {
1851
+ const o = {
1852
+ folder: { conditions: [], operator: t?.operator || "and" },
1853
+ product: { conditions: [], operator: t?.operator || "and" },
1854
+ task: { conditions: [], operator: t?.operator || "and" },
1855
+ user: { conditions: [], operator: t?.operator || "and" },
1856
+ version: { conditions: [], operator: t?.operator || "and" },
1857
+ unscoped: { conditions: [], operator: t?.operator || "and" }
1429
1858
  };
1430
- if (!e?.conditions || e?.conditions.length === 0)
1431
- return r;
1432
- const a = (i) => {
1433
- const c = t.find((s) => i.startsWith(`${s}_`));
1434
- if (c) {
1435
- const s = i.substring(`${c}_`.length);
1436
- return { scope: c, cleanId: s };
1437
- } else if (l?.fallbackScope)
1438
- return { scope: l.fallbackScope, cleanId: i };
1439
- return { scope: null, cleanId: i };
1440
- }, o = (i) => {
1441
- const c = {
1859
+ if (!t?.conditions || t?.conditions.length === 0)
1860
+ return o;
1861
+ const s = (l) => {
1862
+ const f = e.find((n) => l.startsWith(`${n}_`));
1863
+ if (f) {
1864
+ const n = l.substring(`${f}_`.length);
1865
+ return { scope: f, cleanId: n };
1866
+ } else if (i?.fallbackScope)
1867
+ return { scope: i.fallbackScope, cleanId: l };
1868
+ return { scope: null, cleanId: l };
1869
+ }, a = (l) => {
1870
+ const f = {
1442
1871
  folder: [],
1443
1872
  product: [],
1444
1873
  task: [],
@@ -1446,34 +1875,34 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1446
1875
  version: [],
1447
1876
  unscoped: []
1448
1877
  };
1449
- if ("conditions" in i && !("key" in i)) {
1450
- const s = (i.conditions || []).map((w) => o(w));
1451
- Object.keys(c).forEach((w) => {
1452
- const v = w, D = s.flatMap((d) => d[v]);
1453
- D.length > 0 && (D.length === 1 && !i.operator ? c[v].push(D[0]) : c[v].push({
1878
+ if ("conditions" in l && !("key" in l)) {
1879
+ const n = (l.conditions || []).map((E) => a(E));
1880
+ Object.keys(f).forEach((E) => {
1881
+ const y = E, D = n.flatMap((m) => m[y]);
1882
+ D.length > 0 && (D.length === 1 && !l.operator ? f[y].push(D[0]) : f[y].push({
1454
1883
  conditions: D,
1455
- operator: i.operator
1884
+ operator: l.operator
1456
1885
  }));
1457
1886
  });
1458
- } else if ("key" in i) {
1459
- const { scope: s, cleanId: w } = a(i.key);
1460
- if (s)
1461
- c[s].push({ ...i, key: w });
1887
+ } else if ("key" in l) {
1888
+ const { scope: n, cleanId: E } = s(l.key);
1889
+ if (n)
1890
+ f[n].push({ ...l, key: E });
1462
1891
  else {
1463
- const v = u?.[i.key];
1464
- v ? c[v].push(i) : i.key === Qe || i.key === "name" || i.key?.endsWith("_name") ? t.forEach((D) => {
1465
- c[D].push(i);
1466
- }) : c.unscoped.push(i);
1892
+ const y = c?.[l.key];
1893
+ y ? f[y].push(l) : l.key === ut || l.key === "name" || l.key?.endsWith("_name") ? e.forEach((D) => {
1894
+ f[D].push(l);
1895
+ }) : f.unscoped.push(l);
1467
1896
  }
1468
1897
  }
1469
- return c;
1470
- }, f = (e.conditions || []).map((i) => o(i));
1471
- return Object.keys(r).forEach((i) => {
1472
- const c = i;
1473
- r[c].conditions = f.flatMap((s) => s[c]);
1474
- }), r;
1475
- }, Oa = (e, t, l) => {
1476
- const u = {
1898
+ return f;
1899
+ }, h = (t.conditions || []).map((l) => a(l));
1900
+ return Object.keys(o).forEach((l) => {
1901
+ const f = l;
1902
+ o[f].conditions = h.flatMap((n) => n[f]);
1903
+ }), o;
1904
+ }, oa = (t, e, i) => {
1905
+ const c = {
1477
1906
  folder: [],
1478
1907
  product: [],
1479
1908
  task: [],
@@ -1481,31 +1910,31 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1481
1910
  version: [],
1482
1911
  unscoped: []
1483
1912
  };
1484
- if (!e || e.length === 0)
1485
- return u;
1486
- const r = (o) => t.find((i) => o.startsWith(`${i}_`)) || null, a = (o, f) => {
1487
- const i = `${f}_`;
1488
- return o.startsWith(i) ? o.substring(i.length) : o;
1913
+ if (!t || t.length === 0)
1914
+ return c;
1915
+ const o = (a) => e.find((l) => a.startsWith(`${l}_`)) || null, s = (a, h) => {
1916
+ const l = `${h}_`;
1917
+ return a.startsWith(l) ? a.substring(l.length) : a;
1489
1918
  };
1490
- return e.forEach((o) => {
1491
- if (!o.id) return;
1492
- const f = r(o.id);
1493
- if (f) {
1494
- const i = {
1495
- ...o,
1496
- id: a(o.id, f)
1919
+ return t.forEach((a) => {
1920
+ if (!a.id) return;
1921
+ const h = o(a.id);
1922
+ if (h) {
1923
+ const l = {
1924
+ ...a,
1925
+ id: s(a.id, h)
1497
1926
  };
1498
- u[f].push(i);
1927
+ c[h].push(l);
1499
1928
  } else {
1500
- const i = l?.[o.id];
1501
- i ? u[i].push(o) : u.unscoped.push(o);
1929
+ const l = i?.[a.id];
1930
+ l ? c[l].push(a) : c.unscoped.push(a);
1502
1931
  }
1503
- }), u;
1504
- }, Z = ["status", "tags", "attributes", "createdAt", "updatedAt"], Nt = {
1505
- folder: [...Z, "name", "folderType"],
1506
- task: [...Z, "name", "taskType", "folderType", "assignees"],
1932
+ }), c;
1933
+ }, ce = ["status", "tags", "attributes", "createdAt", "updatedAt"], os = {
1934
+ folder: [...ce, "name", "folderType"],
1935
+ task: [...ce, "name", "taskType", "folderType", "assignees"],
1507
1936
  version: [
1508
- ...Z,
1937
+ ...ce,
1509
1938
  "version",
1510
1939
  "productName",
1511
1940
  "productType",
@@ -1515,139 +1944,141 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ma = ({
1515
1944
  "taskType",
1516
1945
  "folderType"
1517
1946
  ],
1518
- product: [...Z, "productName", "productBaseType"],
1519
- user: [...Z]
1520
- }, Sa = (e, t) => e.map((l) => ({
1521
- scope: l,
1522
- filterTypes: Nt[l].filter((u) => !t?.[l]?.includes(u))
1947
+ product: [...ce, "productName", "productBaseType"],
1948
+ user: [...ce]
1949
+ }, na = (t, e) => t.map((i) => ({
1950
+ scope: i,
1951
+ filterTypes: os[i].filter((c) => !e?.[i]?.includes(c))
1523
1952
  }));
1524
1953
  export {
1525
- Ta as ACCESS_LEVEL_LABELS,
1526
- ma as AccessSearchInput,
1527
- ue as AccessUser,
1528
- Va as AddColumnButton,
1529
- Aa as AddonLoadingScreen,
1530
- _a as AttributeEditor,
1531
- he as BLOCK_DIALOG_CLOSE_CLASS,
1532
- ls as Badge,
1533
- is as BadgeWrapper,
1534
- ys as CUSTOM_RANGE_ICON,
1535
- ws as CUSTOM_RANGE_ID,
1536
- ds as CellEditingDialog,
1537
- ps as Chips,
1538
- Vo as ColumnHeaderMenuUI,
1539
- Ao as ColumnMenuButton,
1540
- xa as ColumnsSettings,
1541
- ka as ColumnsSettingsWithContext,
1542
- Bo as CustomDateRangeDialog,
1543
- Pa as CustomizeButton,
1544
- Na as DEFAULT_FEATURED_ORDER,
1545
- _s as DELETE_CONFIRM_THRESHOLD,
1546
- xs as DELETE_TYPE_ORDER,
1547
- ga as DateRangePicker,
1548
- ks as DeleteConfirmContent,
1549
- Ps as DeleteEntitiesConfirmDialog,
1550
- fs as DescriptionSection,
1551
- Us as DetailsDialog,
1552
- tt as DetailsPanelAttributesEditor,
1553
- Gs as DetailsPanelDetails,
1554
- at as DetailsSection,
1555
- vs as DoneCheckbox,
1556
- wo as ENTITY_TOOLTIP_TYPES,
1557
- Ia as EVERYONE_GROUP_KEY,
1558
- La as EVERY_GUESTS_KEY,
1559
- Ma as EarlyPreview,
1560
- Zs as EmptyPlaceholder,
1561
- ao as EmptyPlaceholderFlex,
1562
- so as EmptyPlaceholderFlexWrapper,
1563
- hs as EntityIcon,
1564
- mo as EntityPanelUploader,
1565
- go as EntityPath,
1566
- vo as EntityTooltip,
1567
- Fa as EnumEditor,
1568
- Ba as EnumEditorItem,
1569
- Xe as FEATURED_VERSION_TYPES,
1570
- Nt as FILTER_TYPES_BY_SCOPE,
1571
- Ua as FeaturedVersionOrder,
1572
- Oo as FeedbackProvider,
1573
- Hs as FieldLabel,
1574
- Ys as FileThumbnail,
1575
- So as FilterErrorActions,
1576
- je as FreeTrialLink,
1577
- Wa as GROUP_KEY_PREFIX,
1578
- Ga as GUEST_KEY_PREFIX,
1579
- co as InfoMessage,
1580
- fo as JsonViewer,
1581
- Ha as LegacyBadge,
1582
- ms as LinkManagerItem,
1583
- gs as LinksManager,
1584
- ba as ListAttributeForm,
1585
- Ea as ListMetaData,
1586
- oo as MENU_PORTAL_CONTENT_ID,
1587
- ro as MENU_PORTAL_DIALOG_ID,
1588
- no as Menu,
1589
- lo as MenuContainer,
1590
- io as MenuList,
1591
- Cs as NO_DATE,
1592
- eo as Placeholder,
1593
- Ya as PowerpackButton,
1594
- ya as PowerpackDialog,
1595
- wa as ProjectPageRemote,
1596
- $a as ProjectTableSettings,
1597
- Ns as RefreshToast,
1598
- ve as RemotePageWrapper,
1599
- ja as RequiredAddonVersion,
1600
- $s as ReviewableCard,
1601
- js as ReviewableProgressCard,
1602
- Ks as ReviewableUpload,
1603
- bo as ReviewablesList,
1604
- Ka as ReviewablesSelector,
1605
- Xa as SettingOption,
1606
- za as SettingSwitch,
1607
- Ja as SettingsPanel,
1608
- qa as SettingsPanelItemTemplate,
1609
- Qa as ShareOptionIcon,
1610
- us as SimpleForm,
1611
- Go as SimpleFormDialog,
1612
- Za as SizeSlider,
1613
- Xs as StackedThumbnails,
1614
- es as StyledLink,
1615
- bs as SubtasksManagerWrapper,
1616
- _o as SupportBubble,
1617
- Io as SyncButton,
1618
- ts as TEAM_KEY_PREFIX,
1619
- as as TableGridSwitch,
1620
- Yo as TableSearch,
1621
- Po as TableSettingsFallback,
1622
- zs as Thumbnail,
1623
- Uo as ThumbnailSimple,
1624
- ss as USER_KEY_PREFIX,
1625
- os as UploadVersionDialog,
1626
- Os as UserImage,
1627
- jo as VersionUploadProvider,
1628
- Js as Watchers,
1629
- Is as buildChildrenDetails,
1630
- Ls as buildEntityLabel,
1631
- Ms as buildExpectedCounts,
1632
- Sa as buildScopes,
1633
- ne as customRangeOption,
1634
- Ss as dateOptions,
1635
- Ds as datePresetOptions,
1636
- Rs as detectRelativeDatePattern,
1637
- Ts as filterDateFunctions,
1638
- Vs as generateDateOptions,
1639
- le as generateDatePresetOptions,
1640
- Eo as getGroupedReviewables,
1641
- rs as getUiTypeLabel,
1642
- Jo as parseFilename,
1643
- Oa as splitClientFiltersByScope,
1644
- Ca as splitFiltersByScope,
1645
- Fs as sumExpectedCounts,
1646
- va as useBuildFilterOptions,
1647
- Mo as useDateRangeFilter,
1648
- Do as useFeedback,
1649
- Ro as useFeedbackSafe,
1650
- Ko as useOptionalVersionUploadContext,
1651
- qs as useReviewablesUpload,
1652
- Xo as useVersionUploadContext
1954
+ Ks as ACCESS_LEVEL_LABELS,
1955
+ js as AccessSearchInput,
1956
+ Se as AccessUser,
1957
+ ia as AddColumnButton,
1958
+ ca as AddonLoadingScreen,
1959
+ ua as AttributeEditor,
1960
+ Ve as BLOCK_DIALOG_CLOSE_CLASS,
1961
+ Wa as Badge,
1962
+ Ha as BadgeWrapper,
1963
+ qa as CUSTOM_RANGE_ICON,
1964
+ Za as CUSTOM_RANGE_ID,
1965
+ eo as CellEditingDialog,
1966
+ Ya as Chips,
1967
+ Rn as ColumnHeaderMenuUI,
1968
+ nn as ColumnMenuButton,
1969
+ da as ColumnsSettings,
1970
+ pa as ColumnsSettingsWithContext,
1971
+ yn as CustomDateRangeDialog,
1972
+ fa as CustomizeButton,
1973
+ ma as DEFAULT_FEATURED_ORDER,
1974
+ uo as DELETE_CONFIRM_THRESHOLD,
1975
+ ho as DELETE_TYPE_ORDER,
1976
+ Xs as DateRangePicker,
1977
+ po as DeleteConfirmContent,
1978
+ go as DeleteEntitiesConfirmDialog,
1979
+ $a as DescriptionSection,
1980
+ Co as DetailsDialog,
1981
+ wt as DetailsPanelAttributesEditor,
1982
+ ko as DetailsPanelDetails,
1983
+ yt as DetailsSection,
1984
+ to as DoneCheckbox,
1985
+ tn as ENTITY_TOOLTIP_TYPES,
1986
+ ha as EVERYONE_GROUP_KEY,
1987
+ ga as EVERY_GUESTS_KEY,
1988
+ ba as EarlyPreview,
1989
+ xo as EmptyPlaceholder,
1990
+ Mo as EmptyPlaceholderFlex,
1991
+ Bo as EmptyPlaceholderFlexWrapper,
1992
+ ja as EntityIcon,
1993
+ Jo as EntityPanelUploader,
1994
+ Qo as EntityPath,
1995
+ sn as EntityTooltip,
1996
+ wa as EnumEditor,
1997
+ ya as EnumEditorItem,
1998
+ rt as FEATURED_VERSION_TYPES,
1999
+ os as FILTER_TYPES_BY_SCOPE,
2000
+ va as FeaturedVersionOrder,
2001
+ _t as FeedbackContext,
2002
+ Qs as FeedbackProvider,
2003
+ Oo as FieldLabel,
2004
+ Do as FileThumbnail,
2005
+ dn as FilterErrorActions,
2006
+ ot as FreeTrialLink,
2007
+ Ea as GROUP_KEY_PREFIX,
2008
+ Ca as GUEST_KEY_PREFIX,
2009
+ $o as InfoMessage,
2010
+ Ko as JsonViewer,
2011
+ Sa as LegacyBadge,
2012
+ Ka as LinkManagerItem,
2013
+ Xa as LinksManager,
2014
+ qs as ListAttributeForm,
2015
+ Zs as ListMetaData,
2016
+ Uo as MENU_PORTAL_CONTENT_ID,
2017
+ Wo as MENU_PORTAL_DIALOG_ID,
2018
+ Ho as Menu,
2019
+ zo as MenuContainer,
2020
+ Go as MenuList,
2021
+ so as NO_DATE,
2022
+ No as Placeholder,
2023
+ ka as PowerpackButton,
2024
+ ea as PowerpackDialog,
2025
+ ta as ProjectPageRemote,
2026
+ Oa as ProjectTableSettings,
2027
+ fo as RefreshToast,
2028
+ _e as RemotePageWrapper,
2029
+ Da as RequiredAddonVersion,
2030
+ Vo as ReviewableCard,
2031
+ To as ReviewableProgressCard,
2032
+ Ro as ReviewableUpload,
2033
+ qo as ReviewablesList,
2034
+ Va as ReviewablesSelector,
2035
+ Ta as SettingOption,
2036
+ Ra as SettingSwitch,
2037
+ Ia as SettingsPanel,
2038
+ Fa as SettingsPanelItemTemplate,
2039
+ Aa as ShareOptionIcon,
2040
+ za as SimpleForm,
2041
+ Cn as SimpleFormDialog,
2042
+ Pa as SizeSlider,
2043
+ Io as StackedThumbnails,
2044
+ _a as StyledLink,
2045
+ Ja as SubtasksManagerWrapper,
2046
+ rn as SupportBubble,
2047
+ hn as SyncButton,
2048
+ xa as TEAM_KEY_PREFIX,
2049
+ Na as TableGridSwitch,
2050
+ kn as TableSearch,
2051
+ fn as TableSettingsFallback,
2052
+ Fo as Thumbnail,
2053
+ vn as ThumbnailSimple,
2054
+ La as USER_KEY_PREFIX,
2055
+ Ma as UploadVersionDialog,
2056
+ ao as UserImage,
2057
+ Qt as VersionUploadContext,
2058
+ Js as VersionUploadProvider,
2059
+ Ao as Watchers,
2060
+ bo as buildChildrenDetails,
2061
+ wo as buildEntityLabel,
2062
+ yo as buildExpectedCounts,
2063
+ na as buildScopes,
2064
+ we as customRangeOption,
2065
+ oo as dateOptions,
2066
+ no as datePresetOptions,
2067
+ ro as detectRelativeDatePattern,
2068
+ lo as filterDateFunctions,
2069
+ io as generateDateOptions,
2070
+ ye as generateDatePresetOptions,
2071
+ Zo as getGroupedReviewables,
2072
+ Ba as getUiTypeLabel,
2073
+ Jt as parseFilename,
2074
+ oa as splitClientFiltersByScope,
2075
+ aa as splitFiltersByScope,
2076
+ vo as sumExpectedCounts,
2077
+ sa as useBuildFilterOptions,
2078
+ bn as useDateRangeFilter,
2079
+ ln as useFeedback,
2080
+ cn as useFeedbackSafe,
2081
+ Dn as useOptionalVersionUploadContext,
2082
+ Po as useReviewablesUpload,
2083
+ Vn as useVersionUploadContext
1653
2084
  };