@cccsaurora/clue-ui 1.1.0-dev.98 → 1.1.0

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 (178) hide show
  1. package/ActionForm-myEAs2UC.js +435 -0
  2. package/AnnotationDetails-BdfWMISw.js +160 -0
  3. package/AnnotationPreview-CKMGCoUH.js +140 -0
  4. package/ClueEnrichContext-CrFpdYhh.js +414 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_Map-DXNg_Z-q.js +54 -0
  7. package/_MapCache-Cu25RRDU.js +129 -0
  8. package/_Uint8Array-DlJCtTvG.js +102 -0
  9. package/_baseAssignValue-CUmzp727.js +20 -0
  10. package/_baseClone-BlMmRXeX.js +208 -0
  11. package/_baseExtremum-P_0akmCi.js +27 -0
  12. package/_baseFlatten-CN7vDNEQ.js +72 -0
  13. package/_baseGet-Dgf6_xCm.js +80 -0
  14. package/_baseIsEqual-Cpjtfb3Q.js +173 -0
  15. package/_baseIteratee-CP1bocOX.js +95 -0
  16. package/_baseSlice-M5RKzt1A.js +10 -0
  17. package/_baseSum-wEbgNeUs.js +10 -0
  18. package/_baseUniq-tMFmk80M.js +61 -0
  19. package/_commonjsHelpers-DaMA6jEr.js +8 -0
  20. package/_createAggregator-B4Cav8ZM.js +53 -0
  21. package/_getPrototype-CHAFQYL_.js +5 -0
  22. package/_getTag-BV_UoLYG.js +90 -0
  23. package/cloneDeep-BPVpFBzJ.js +8 -0
  24. package/components/AnnotationBody.js +35 -49
  25. package/components/AnnotationDetailPopover.js +30 -36
  26. package/components/AnnotationDetails.js +6 -6
  27. package/components/AnnotationEntry.js +47 -50
  28. package/components/AnnotationPreview.js +5 -5
  29. package/components/ClassificationChip.js +23 -44
  30. package/components/CountBadge.js +26 -31
  31. package/components/EnrichedCard.js +97 -110
  32. package/components/EnrichedChip.js +105 -130
  33. package/components/EnrichedTypography.js +107 -133
  34. package/components/ErrorBoundary.js +24 -28
  35. package/components/RetryFailedEnrichments.js +9 -10
  36. package/components/SourcePicker.js +49 -57
  37. package/components/actions/ActionForm.js +4 -4
  38. package/components/actions/ExecutePopover.js +50 -64
  39. package/components/actions/ResultModal.js +5 -5
  40. package/components/actions/form/schemaAdapter.js +23 -39
  41. package/components/display/graph/ExpandMoreButton.js +10 -10
  42. package/components/display/graph/elements/NodeCard.js +91 -111
  43. package/components/display/graph/elements/NodeTag.js +13 -15
  44. package/components/display/graph/index.js +202 -261
  45. package/components/display/graph/visualizations/Leaf.js +69 -88
  46. package/components/display/graph/visualizations/cloud/index.js +81 -98
  47. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  48. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  49. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  53. package/components/display/graph/visualizations/icons/index.js +13 -14
  54. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  55. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  56. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  57. package/components/display/graph/visualizations/tree/index.js +305 -407
  58. package/components/display/icons/Iconified.js +12 -27
  59. package/components/display/json/index.js +4 -4
  60. package/components/display/markdown/index.js +5761 -8662
  61. package/components/enrichment/EnrichPopover.js +47 -55
  62. package/components/fetchers/Fetcher.js +95 -123
  63. package/components/fetchers/PreviewModal.js +17 -20
  64. package/components/fetchers/StatusChip.js +17 -21
  65. package/components/group/Entry.js +11 -13
  66. package/components/group/Group.js +10 -13
  67. package/components/group/GroupControl.js +66 -77
  68. package/components/stats/QueryStatus.js +31 -41
  69. package/countBy-DOutsa_w.js +8 -0
  70. package/data/event.js +4 -6
  71. package/database/index.js +2 -2
  72. package/debounce-DryYcbJ4.js +56 -0
  73. package/get-Bow1vKwx.js +8 -0
  74. package/groupBy-BheQYl6f.js +8 -0
  75. package/hooks/ClueActionContext.js +7 -7
  76. package/hooks/ClueComponentContext.js +23 -29
  77. package/hooks/ClueConfigProvider.js +12 -14
  78. package/hooks/ClueDatabaseContext.js +13 -19
  79. package/hooks/ClueEnrichContext.js +8 -8
  80. package/hooks/ClueFetcherContext.js +46 -74
  81. package/hooks/ClueGroupContext.js +14 -17
  82. package/hooks/CluePopupContext.js +5 -5
  83. package/hooks/ClueProvider.js +10 -12
  84. package/hooks/selectors.js +10 -21
  85. package/hooks/useActionResult.js +2 -2
  86. package/hooks/useAnnotations.js +29 -45
  87. package/hooks/useClue.js +4 -6
  88. package/hooks/useClueActions.js +3 -3
  89. package/hooks/useClueConfig.js +4 -6
  90. package/hooks/useClueTypeConfig.js +3 -3
  91. package/hooks/useComparator.js +435 -722
  92. package/hooks/useErrors.js +18 -22
  93. package/hooks/useMyHighlights.js +36 -66
  94. package/hooks/useMyLocalStorage.js +37 -66
  95. package/iconify-BBckr5AQ.js +1263 -0
  96. package/icons/Action.js +49 -66
  97. package/icons/Assessment.js +68 -84
  98. package/icons/Context.js +63 -77
  99. package/icons/Opinion.js +65 -77
  100. package/icons/iconMap.js +2 -2
  101. package/identity-ByMq8VxU.js +6 -0
  102. package/index-BXxfAxFt.js +12734 -0
  103. package/index-C15OYgRY.js +358 -0
  104. package/index-E7g8cRyW.js +568 -0
  105. package/index-p5_wX7q1.js +11729 -0
  106. package/index-vF6IyBhz.js +975 -0
  107. package/isEmpty-g47Qir2A.js +21 -0
  108. package/isNil-CjWwlQS3.js +6 -0
  109. package/isObject-B53jY8Qg.js +7 -0
  110. package/isObjectLike-BatpeCIi.js +29 -0
  111. package/isSymbol-C3_SC0Qp.js +8 -0
  112. package/last-7CdUxN0r.js +7 -0
  113. package/main.js +62 -62
  114. package/package.json +1 -1
  115. package/sortBy-ITdmD17L.js +79 -0
  116. package/sumBy-DxJUU2E8.js +8 -0
  117. package/text/Frequency.js +23 -42
  118. package/toFinite-BMy6GObD.js +14 -0
  119. package/toNumber-YVhnnJv4.js +31 -0
  120. package/useClueTypeConfig-DyeBcXQX.js +2214 -0
  121. package/utils/chain.js +64 -91
  122. package/utils/classificationParser.js +256 -519
  123. package/utils/constants.js +10 -35
  124. package/utils/graph.js +45 -72
  125. package/utils/hashUtil.js +7 -7
  126. package/utils/line.js +81 -131
  127. package/utils/loggerUtil.js +3 -5
  128. package/utils/sessionStorage.js +27 -41
  129. package/utils/time.js +423 -423
  130. package/utils/utils.js +9 -9
  131. package/utils/window.js +10 -21
  132. package/utils-BnmI_6N8.js +130 -0
  133. package/ActionForm-ByeOzpc4.js +0 -555
  134. package/AnnotationDetails-DknbKDyl.js +0 -175
  135. package/AnnotationPreview-CQwKs8se.js +0 -188
  136. package/ClueEnrichContext-6NJfXpUB.js +0 -536
  137. package/FlexOne-BSYAhhtG.js +0 -9
  138. package/_Map-kgDsDYxq.js +0 -64
  139. package/_MapCache-DabaaWfq.js +0 -161
  140. package/_Uint8Array-BlVVH1tp.js +0 -129
  141. package/_baseAssignValue-CNbcU6Nb.js +0 -25
  142. package/_baseClone-D3a8Pa4T.js +0 -284
  143. package/_baseExtremum-B1o1zHjR.js +0 -33
  144. package/_baseFlatten-D4huXoEI.js +0 -92
  145. package/_baseGet-BSK_nnoz.js +0 -109
  146. package/_baseIsEqual-B5xLoweL.js +0 -238
  147. package/_baseIteratee-p6Nj07-n.js +0 -126
  148. package/_baseSlice-GAv_YFTT.js +0 -20
  149. package/_baseSum-D0WC1dN0.js +0 -13
  150. package/_baseUniq-CpupKWcL.js +0 -89
  151. package/_commonjsHelpers-DWwsNxpa.js +0 -8
  152. package/_createAggregator-BpVy5xMi.js +0 -63
  153. package/_getPrototype-D1LAdQKO.js +0 -5
  154. package/_getTag-D3ToyefI.js +0 -126
  155. package/cloneDeep-CjP5k9zW.js +0 -8
  156. package/countBy-C69WslUA.js +0 -14
  157. package/debounce-bV0h5FC5.js +0 -92
  158. package/get-D3C3lEU3.js +0 -8
  159. package/groupBy-DC2oOuBN.js +0 -14
  160. package/iconify-CXMreGTg.js +0 -1782
  161. package/identity-CPGTqrE4.js +0 -6
  162. package/index-BDVjGvMI.js +0 -696
  163. package/index-BbPn6-Mw.js +0 -15750
  164. package/index-Bi21Wb23.js +0 -465
  165. package/index-C3lkTD69.js +0 -1172
  166. package/index-CC12Ux-9.js +0 -17654
  167. package/isEmpty-BQkZubqU.js +0 -29
  168. package/isNil-CIubwp4T.js +0 -6
  169. package/isObject-FTY-5JQX.js +0 -7
  170. package/isObjectLike-OAgjjZye.js +0 -48
  171. package/isSymbol-Xd2FsJyp.js +0 -8
  172. package/last-CUCl67Im.js +0 -7
  173. package/sortBy-B-UKp4GT.js +0 -100
  174. package/sumBy-MYkDPHZL.js +0 -8
  175. package/toFinite-Bc55msYj.js +0 -16
  176. package/toNumber-DPxy1FBy.js +0 -39
  177. package/useClueTypeConfig-XvGvIw2S.js +0 -3201
  178. package/utils-7OtvGnmf.js +0 -200
@@ -1,55 +1,49 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Popover } from "@mui/material";
3
- import React__default, { useRef, useState, useEffect } from "react";
4
- import { A as AnnotationDetails } from "../AnnotationDetails-DknbKDyl.js";
5
- const AnnotationDetailPopover = React__default.memo(({ anchorEl, enrichRequest, open, onClose, ...otherProps }) => {
6
- var _a, _b, _c;
7
- const actionRef = useRef();
8
- const [ready, setReady] = useState(false);
9
- useEffect(() => {
10
- if (!open) {
11
- setReady(false);
12
- }
13
- }, [open]);
14
- return /* @__PURE__ */ jsx(
15
- Popover,
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { Popover as r } from "@mui/material";
3
+ import v, { useRef as c, useState as g, useEffect as R } from "react";
4
+ import { A as k } from "../AnnotationDetails-BdfWMISw.js";
5
+ const S = v.memo(({ anchorEl: t, enrichRequest: u, open: o, onClose: l, ...e }) => {
6
+ var f, s, m;
7
+ const a = c(), [x, n] = g(!1);
8
+ return R(() => {
9
+ o || n(!1);
10
+ }, [o]), /* @__PURE__ */ d(
11
+ r,
16
12
  {
17
13
  anchorOrigin: { horizontal: "left", vertical: "bottom" },
18
- ...otherProps,
19
- action: actionRef,
20
- open: !!(open && ready),
21
- keepMounted: open,
22
- anchorEl,
23
- onClose,
14
+ ...e,
15
+ action: a,
16
+ open: !!(o && x),
17
+ keepMounted: o,
18
+ anchorEl: t,
19
+ onClose: l,
24
20
  slotProps: {
25
- ...otherProps.slotProps ?? {},
21
+ ...e.slotProps ?? {},
26
22
  paper: {
27
- ...((_a = otherProps.slotProps) == null ? void 0 : _a.paper) ?? {},
23
+ ...((f = e.slotProps) == null ? void 0 : f.paper) ?? {},
28
24
  sx: [
29
25
  {
30
26
  maxHeight: "min(600px, 95vh)",
31
27
  overflowY: "auto",
32
28
  maxWidth: "500px",
33
29
  width: "100%",
34
- zIndex: ((_c = (_b = anchorEl == null ? void 0 : anchorEl.computedStyleMap) == null ? void 0 : _b.call(anchorEl).get("z-index")) == null ? void 0 : _c.toString()) || 2
30
+ zIndex: ((m = (s = t == null ? void 0 : t.computedStyleMap) == null ? void 0 : s.call(t).get("z-index")) == null ? void 0 : m.toString()) || 2
35
31
  }
36
32
  ]
37
33
  }
38
34
  },
39
- onClick: (e) => {
40
- var _a2;
41
- e.preventDefault();
42
- e.stopPropagation();
43
- (_a2 = otherProps.onClick) == null ? void 0 : _a2.call(otherProps, e);
35
+ onClick: (i) => {
36
+ var p;
37
+ i.preventDefault(), i.stopPropagation(), (p = e.onClick) == null || p.call(e, i);
44
38
  },
45
- children: /* @__PURE__ */ jsx(
46
- AnnotationDetails,
39
+ children: /* @__PURE__ */ d(
40
+ k,
47
41
  {
48
- enrichRequest,
49
- setReady,
42
+ enrichRequest: u,
43
+ setReady: n,
50
44
  updatePosition: () => {
51
- var _a2;
52
- return (_a2 = actionRef.current) == null ? void 0 : _a2.updatePosition();
45
+ var i;
46
+ return (i = a.current) == null ? void 0 : i.updatePosition();
53
47
  }
54
48
  }
55
49
  )
@@ -57,5 +51,5 @@ const AnnotationDetailPopover = React__default.memo(({ anchorEl, enrichRequest,
57
51
  );
58
52
  });
59
53
  export {
60
- AnnotationDetailPopover as default
54
+ S as default
61
55
  };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import "../iconify-CXMreGTg.js";
2
+ import "../iconify-BBckr5AQ.js";
3
3
  import "@mui/material";
4
4
  import "./display/icons/Iconified.js";
5
5
  import "../data/event.js";
@@ -9,15 +9,15 @@ import "../hooks/useAnnotations.js";
9
9
  import "../hooks/useErrors.js";
10
10
  import "../icons/iconMap.js";
11
11
  import "../utils/window.js";
12
- import "../groupBy-DC2oOuBN.js";
13
- import { A } from "../AnnotationDetails-DknbKDyl.js";
14
- import "../ClueEnrichContext-6NJfXpUB.js";
12
+ import "../groupBy-BheQYl6f.js";
13
+ import { A as n } from "../AnnotationDetails-BdfWMISw.js";
14
+ import "../ClueEnrichContext-CrFpdYhh.js";
15
15
  import "react";
16
- import "../index-BDVjGvMI.js";
16
+ import "../index-E7g8cRyW.js";
17
17
  import "./actions/ExecutePopover.js";
18
18
  import "./AnnotationEntry.js";
19
19
  import "./ClassificationChip.js";
20
20
  import "./enrichment/EnrichPopover.js";
21
21
  export {
22
- A as default
22
+ n as default
23
23
  };
@@ -1,54 +1,51 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { I as Icon } from "../iconify-CXMreGTg.js";
3
- import { Stack, Typography, Chip, IconButton } from "@mui/material";
4
- import Iconified from "./display/icons/Iconified.js";
5
- import { t as twitterShort } from "../utils-7OtvGnmf.js";
6
- import { memo } from "react";
7
- import AnnotationBody from "./AnnotationBody.js";
8
- import ClassificationChip from "./ClassificationChip.js";
9
- const AnnotatonEntry = ({ annotation }) => {
10
- return /* @__PURE__ */ jsxs(Stack, { direction: "column", spacing: 1, children: [
11
- /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
12
- annotation.analytic_icon && /* @__PURE__ */ jsx(
13
- Icon,
14
- {
15
- style: { alignSelf: "center", filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" },
16
- icon: annotation.analytic_icon
17
- }
18
- ),
19
- /* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { textTransform: "capitalize", maxWidth: "275px" }, children: annotation.analytic ?? annotation.author }),
20
- annotation.quantity > 1 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", children: [
21
- "(x",
22
- annotation.quantity,
23
- ")"
24
- ] }),
25
- /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
26
- annotation.version && /* @__PURE__ */ jsx(
27
- Chip,
28
- {
29
- size: "small",
30
- label: /* @__PURE__ */ jsxs(Fragment, { children: [
31
- "v",
32
- annotation.version.replace(/^v/, "")
33
- ] })
34
- }
35
- ),
36
- annotation.link && /* @__PURE__ */ jsx(IconButton, { component: "a", href: annotation.link, target: "_blank", rel: "noreferrer", size: "small", children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" }) }),
37
- annotation.classification && /* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: annotation.classification })
1
+ import { jsxs as e, jsx as i, Fragment as l } from "react/jsx-runtime";
2
+ import { I as o } from "../iconify-BBckr5AQ.js";
3
+ import { Stack as t, Typography as c, Chip as s, IconButton as a } from "@mui/material";
4
+ import n from "./display/icons/Iconified.js";
5
+ import { t as m } from "../utils-BnmI_6N8.js";
6
+ import { memo as p } from "react";
7
+ import d from "./AnnotationBody.js";
8
+ import f from "./ClassificationChip.js";
9
+ const y = ({ annotation: r }) => /* @__PURE__ */ e(t, { direction: "column", spacing: 1, children: [
10
+ /* @__PURE__ */ e(t, { direction: "row", spacing: 1, alignItems: "center", children: [
11
+ r.analytic_icon && /* @__PURE__ */ i(
12
+ o,
13
+ {
14
+ style: { alignSelf: "center", filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" },
15
+ icon: r.analytic_icon
16
+ }
17
+ ),
18
+ /* @__PURE__ */ i(c, { variant: "body1", sx: { textTransform: "capitalize", maxWidth: "275px" }, children: r.analytic ?? r.author }),
19
+ r.quantity > 1 && /* @__PURE__ */ e(c, { variant: "caption", color: "text.secondary", children: [
20
+ "(x",
21
+ r.quantity,
22
+ ")"
38
23
  ] }),
39
- /* @__PURE__ */ jsx(AnnotationBody, { annotation }),
40
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: annotation.summary }),
41
- /* @__PURE__ */ jsxs(Stack, { direction: "row", children: [
42
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", fontSize: "10px", children: twitterShort(annotation.timestamp) }),
43
- /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
44
- !!annotation.latency && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", fontSize: "10px", children: [
45
- Math.round(annotation.latency),
46
- "ms"
47
- ] })
24
+ /* @__PURE__ */ i("div", { style: { flex: 1 } }),
25
+ r.version && /* @__PURE__ */ i(
26
+ s,
27
+ {
28
+ size: "small",
29
+ label: /* @__PURE__ */ e(l, { children: [
30
+ "v",
31
+ r.version.replace(/^v/, "")
32
+ ] })
33
+ }
34
+ ),
35
+ r.link && /* @__PURE__ */ i(a, { component: "a", href: r.link, target: "_blank", rel: "noreferrer", size: "small", children: /* @__PURE__ */ i(n, { icon: "ic:baseline-open-in-new", fontSize: "small" }) }),
36
+ r.classification && /* @__PURE__ */ i(f, { size: "small", classification: r.classification })
37
+ ] }),
38
+ /* @__PURE__ */ i(d, { annotation: r }),
39
+ /* @__PURE__ */ i(c, { variant: "caption", color: "text.secondary", children: r.summary }),
40
+ /* @__PURE__ */ e(t, { direction: "row", children: [
41
+ /* @__PURE__ */ i(c, { variant: "caption", color: "text.secondary", fontSize: "10px", children: m(r.timestamp) }),
42
+ /* @__PURE__ */ i("div", { style: { flex: 1 } }),
43
+ !!r.latency && /* @__PURE__ */ e(c, { variant: "caption", color: "text.secondary", fontSize: "10px", children: [
44
+ Math.round(r.latency),
45
+ "ms"
48
46
  ] })
49
- ] });
50
- };
51
- const AnnotationEntry = memo(AnnotatonEntry);
47
+ ] })
48
+ ] }), w = p(y);
52
49
  export {
53
- AnnotationEntry as default
50
+ w as default
54
51
  };
@@ -1,11 +1,11 @@
1
1
  import "react/jsx-runtime";
2
- import "../iconify-CXMreGTg.js";
2
+ import "../iconify-BBckr5AQ.js";
3
3
  import "@mui/material";
4
- import { A } from "../AnnotationPreview-CQwKs8se.js";
4
+ import { A as d } from "../AnnotationPreview-CKMGCoUH.js";
5
5
  import "../hooks/useAnnotations.js";
6
- import "../utils-7OtvGnmf.js";
6
+ import "../utils-BnmI_6N8.js";
7
7
  import "react";
8
- import "../index-BDVjGvMI.js";
8
+ import "../index-E7g8cRyW.js";
9
9
  export {
10
- A as default
10
+ d as default
11
11
  };
@@ -1,52 +1,31 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Tooltip, Chip } from "@mui/material";
3
- import useClueConfig from "../hooks/useClueConfig.js";
4
- import { getParts, normalizedClassification } from "../utils/classificationParser.js";
5
- import React__default, { useMemo, memo } from "react";
6
- const THEME_TYPES = ["default", "primary", "secondary", "error", "info", "success", "warning"];
7
- const ClassificationChip = React__default.memo(
8
- ({ classification, ...otherProps }) => {
9
- var _a, _b;
10
- const { config } = useClueConfig();
11
- const parts = useMemo(() => {
12
- if (!config.c12nDef) {
13
- return null;
14
- }
15
- return getParts(classification, config.c12nDef, "short", true);
16
- }, [classification, config.c12nDef]);
17
- const normalized = useMemo(() => {
18
- if (!config.c12nDef || !parts) {
19
- return classification;
20
- }
21
- return normalizedClassification(parts, config.c12nDef, "short", true);
22
- }, [classification, config.c12nDef, parts]);
23
- const chipProps = useMemo(() => {
24
- var _a2, _b2, _c;
25
- const definedColor = (_c = (_b2 = config.c12nDef) == null ? void 0 : _b2.levels_styles_map[(_a2 = config.c12nDef) == null ? void 0 : _a2.levels_map[parts.lvlIdx]]) == null ? void 0 : _c.color;
26
- if (THEME_TYPES.includes(definedColor)) {
27
- return { color: definedColor };
28
- }
29
- if (definedColor) {
30
- return { sx: { color: definedColor } };
31
- }
32
- return { color: "default" };
33
- }, [(_a = config.c12nDef) == null ? void 0 : _a.levels_map, (_b = config.c12nDef) == null ? void 0 : _b.levels_styles_map, parts.lvlIdx]);
34
- return /* @__PURE__ */ jsx(Tooltip, { title: classification, children: /* @__PURE__ */ jsx(
35
- Chip,
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { Tooltip as p, Chip as x } from "@mui/material";
3
+ import D from "../hooks/useClueConfig.js";
4
+ import { getParts as C, normalizedClassification as _ } from "../utils/classificationParser.js";
5
+ import v, { useMemo as s, memo as y } from "react";
6
+ const g = ["default", "primary", "secondary", "error", "info", "success", "warning"], A = v.memo(
7
+ ({ classification: r, ...n }) => {
8
+ var i, f;
9
+ const { config: e } = D(), t = s(() => e.c12nDef ? C(r, e.c12nDef, "short", !0) : null, [r, e.c12nDef]), d = s(() => !e.c12nDef || !t ? r : _(t, e.c12nDef, "short", !0), [r, e.c12nDef, t]), o = s(() => {
10
+ var c, a, m;
11
+ const l = (m = (a = e.c12nDef) == null ? void 0 : a.levels_styles_map[(c = e.c12nDef) == null ? void 0 : c.levels_map[t.lvlIdx]]) == null ? void 0 : m.color;
12
+ return g.includes(l) ? { color: l } : l ? { sx: { color: l } } : { color: "default" };
13
+ }, [(i = e.c12nDef) == null ? void 0 : i.levels_map, (f = e.c12nDef) == null ? void 0 : f.levels_styles_map, t.lvlIdx]);
14
+ return /* @__PURE__ */ u(p, { title: r, children: /* @__PURE__ */ u(
15
+ x,
36
16
  {
37
- variant: otherProps.variant || "outlined",
38
- label: normalized,
39
- ...chipProps,
40
- ...otherProps,
17
+ variant: n.variant || "outlined",
18
+ label: d,
19
+ ...o,
20
+ ...n,
41
21
  sx: [
42
- ...Array.isArray(chipProps.sx) ? chipProps.sx : [chipProps.sx],
43
- ...Array.isArray(otherProps.sx) ? otherProps.sx : [otherProps.sx]
22
+ ...Array.isArray(o.sx) ? o.sx : [o.sx],
23
+ ...Array.isArray(n.sx) ? n.sx : [n.sx]
44
24
  ]
45
25
  }
46
26
  ) });
47
27
  }
48
- );
49
- const ClassificationChip$1 = memo(ClassificationChip);
28
+ ), M = y(A);
50
29
  export {
51
- ClassificationChip$1 as default
30
+ M as default
52
31
  };
@@ -1,34 +1,29 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Badge } from "@mui/material";
3
- import { forwardRef, cloneElement, Children } from "react";
4
- const CountBadge = forwardRef(({ children, color = "primary", count, disabled, ...props }, ref) => {
5
- if (disabled) {
6
- return cloneElement(Children.only(children), { ref, ...props });
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { Badge as l } from "@mui/material";
3
+ import { forwardRef as d, cloneElement as f, Children as g } from "react";
4
+ const b = d(({ children: r, color: a = "primary", count: t, disabled: n, ...e }, o) => n ? f(g.only(r), { ref: o, ...e }) : /* @__PURE__ */ m(
5
+ l,
6
+ {
7
+ ref: o,
8
+ ...e,
9
+ badgeContent: t < 100 ? t : "99+",
10
+ color: a,
11
+ sx: (i) => ({
12
+ "& .MuiBadge-badge": {
13
+ backgroundColor: "transparent",
14
+ color: i.palette[a].main,
15
+ fontWeight: "bold",
16
+ right: 0,
17
+ top: 0,
18
+ transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(t)), 3) * 10}%)`,
19
+ px: 0,
20
+ fontSize: ".85rem"
21
+ },
22
+ pr: 1.5
23
+ }),
24
+ children: r
7
25
  }
8
- return /* @__PURE__ */ jsx(
9
- Badge,
10
- {
11
- ref,
12
- ...props,
13
- badgeContent: count < 100 ? count : "99+",
14
- color,
15
- sx: (theme) => ({
16
- "& .MuiBadge-badge": {
17
- backgroundColor: "transparent",
18
- color: theme.palette[color].main,
19
- fontWeight: "bold",
20
- right: 0,
21
- top: 0,
22
- transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(count)), 3) * 10}%)`,
23
- px: 0,
24
- fontSize: ".85rem"
25
- },
26
- pr: 1.5
27
- }),
28
- children
29
- }
30
- );
31
- });
26
+ ));
32
27
  export {
33
- CountBadge as default
28
+ b as default
34
29
  };