@cccsaurora/clue-ui 1.0.4 → 1.1.0-dev.100

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 (201) hide show
  1. package/ActionForm-ByeOzpc4.js +555 -0
  2. package/AnnotationDetails-DknbKDyl.js +175 -0
  3. package/AnnotationPreview-CQwKs8se.js +188 -0
  4. package/ClueEnrichContext-6NJfXpUB.js +536 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_Map-kgDsDYxq.js +64 -0
  7. package/_MapCache-DabaaWfq.js +161 -0
  8. package/_Uint8Array-BlVVH1tp.js +129 -0
  9. package/_baseAssignValue-CNbcU6Nb.js +25 -0
  10. package/_baseClone-D3a8Pa4T.js +284 -0
  11. package/_baseExtremum-B1o1zHjR.js +33 -0
  12. package/_baseFlatten-D4huXoEI.js +92 -0
  13. package/_baseGet-BSK_nnoz.js +109 -0
  14. package/_baseIsEqual-B5xLoweL.js +238 -0
  15. package/_baseIteratee-p6Nj07-n.js +126 -0
  16. package/_baseSlice-GAv_YFTT.js +20 -0
  17. package/_baseSum-D0WC1dN0.js +13 -0
  18. package/_baseUniq-CpupKWcL.js +89 -0
  19. package/_commonjsHelpers-DWwsNxpa.js +8 -0
  20. package/_createAggregator-BpVy5xMi.js +63 -0
  21. package/_getPrototype-D1LAdQKO.js +5 -0
  22. package/_getTag-D3ToyefI.js +126 -0
  23. package/api/lookup/index.d.ts +1 -1
  24. package/api/lookup/types.d.ts +2 -2
  25. package/api/lookup/types_detection.d.ts +2 -2
  26. package/cloneDeep-CjP5k9zW.js +8 -0
  27. package/components/AnnotationBody.js +49 -34
  28. package/components/AnnotationDetailPopover.js +36 -30
  29. package/components/AnnotationDetails.js +6 -6
  30. package/components/AnnotationEntry.js +50 -47
  31. package/components/AnnotationPreview.js +5 -5
  32. package/components/ClassificationChip.d.ts +2 -1
  33. package/components/ClassificationChip.js +44 -23
  34. package/components/CountBadge.js +31 -26
  35. package/components/EnrichedCard.js +110 -92
  36. package/components/EnrichedChip.js +130 -111
  37. package/components/EnrichedTypography.d.ts +1 -1
  38. package/components/EnrichedTypography.js +133 -112
  39. package/components/ErrorBoundary.js +28 -24
  40. package/components/RetryFailedEnrichments.js +10 -9
  41. package/components/SourcePicker.js +57 -49
  42. package/components/actions/ActionForm.js +4 -4
  43. package/components/actions/ExecutePopover.js +64 -50
  44. package/components/actions/ResultModal.js +12 -41
  45. package/components/actions/form/schemaAdapter.js +40 -20
  46. package/components/display/graph/ExpandMoreButton.js +10 -10
  47. package/components/display/graph/elements/NodeCard.js +114 -76
  48. package/components/display/graph/elements/NodeTag.js +15 -13
  49. package/components/display/graph/index.js +267 -210
  50. package/components/display/graph/visualizations/Leaf.js +88 -69
  51. package/components/display/graph/visualizations/cloud/index.js +98 -81
  52. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  53. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  56. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  57. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  58. package/components/display/graph/visualizations/icons/index.js +14 -13
  59. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  60. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  61. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  62. package/components/display/graph/visualizations/tree/index.js +407 -305
  63. package/components/display/icons/Iconified.js +27 -12
  64. package/components/display/json/index.js +4 -4
  65. package/components/display/markdown/index.js +8696 -5668
  66. package/components/enrichment/EnrichPopover.js +55 -47
  67. package/components/fetchers/Fetcher.js +123 -95
  68. package/components/fetchers/PreviewModal.js +20 -17
  69. package/components/fetchers/StatusChip.js +21 -18
  70. package/components/group/Entry.js +13 -11
  71. package/components/group/Group.js +13 -10
  72. package/components/group/GroupControl.js +78 -66
  73. package/components/stats/QueryStatus.js +44 -31
  74. package/countBy-C69WslUA.js +14 -0
  75. package/data/event.js +6 -4
  76. package/database/index.js +2 -2
  77. package/debounce-bV0h5FC5.js +92 -0
  78. package/en/translation.json +39 -59
  79. package/fr/translation.json +37 -56
  80. package/get-D3C3lEU3.js +8 -0
  81. package/groupBy-DC2oOuBN.js +14 -0
  82. package/hooks/ClueActionContext.d.ts +26 -0
  83. package/hooks/ClueActionContext.js +8 -7
  84. package/hooks/ClueComponentContext.js +29 -23
  85. package/hooks/ClueConfigProvider.js +14 -12
  86. package/hooks/ClueDatabaseContext.js +19 -13
  87. package/hooks/ClueEnrichContext.js +8 -8
  88. package/hooks/ClueEnrichProps.d.ts +3 -1
  89. package/hooks/ClueFetcherContext.js +74 -46
  90. package/hooks/ClueGroupContext.js +17 -14
  91. package/hooks/CluePopupContext.js +5 -5
  92. package/hooks/ClueProvider.js +12 -10
  93. package/hooks/selectors.d.ts +4 -5
  94. package/hooks/selectors.js +21 -11
  95. package/hooks/useActionResult.d.ts +14 -0
  96. package/hooks/useActionResult.js +5 -0
  97. package/hooks/useAnnotations.js +45 -29
  98. package/hooks/useClue.js +6 -4
  99. package/hooks/useClueActions.d.ts +1 -1
  100. package/hooks/useClueActions.js +3 -3
  101. package/hooks/useClueConfig.d.ts +2 -1
  102. package/hooks/useClueConfig.js +6 -6
  103. package/hooks/useClueTypeConfig.js +3 -3
  104. package/hooks/useComparator.js +722 -435
  105. package/hooks/useErrors.js +22 -18
  106. package/hooks/useMyHighlights.js +66 -36
  107. package/hooks/useMyLocalStorage.d.ts +4 -3
  108. package/hooks/useMyLocalStorage.js +66 -46
  109. package/iconify-CXMreGTg.js +1782 -0
  110. package/icons/Action.js +66 -49
  111. package/icons/Assessment.js +84 -68
  112. package/icons/Context.js +78 -61
  113. package/icons/Opinion.js +77 -65
  114. package/icons/iconMap.js +2 -2
  115. package/identity-CPGTqrE4.js +6 -0
  116. package/index-BDVjGvMI.js +696 -0
  117. package/index-BbPn6-Mw.js +15750 -0
  118. package/index-Bi21Wb23.js +465 -0
  119. package/index-C3lkTD69.js +1172 -0
  120. package/index-CC12Ux-9.js +17654 -0
  121. package/isEmpty-BQkZubqU.js +29 -0
  122. package/isNil-CIubwp4T.js +6 -0
  123. package/isObject-FTY-5JQX.js +7 -0
  124. package/isObjectLike-OAgjjZye.js +48 -0
  125. package/isSymbol-Xd2FsJyp.js +8 -0
  126. package/last-CUCl67Im.js +7 -0
  127. package/main.js +62 -62
  128. package/package.json +3 -3
  129. package/sortBy-B-UKp4GT.js +100 -0
  130. package/sumBy-MYkDPHZL.js +8 -0
  131. package/text/Frequency.js +42 -23
  132. package/toFinite-Bc55msYj.js +16 -0
  133. package/toNumber-DPxy1FBy.js +39 -0
  134. package/types/RunningActionData.d.ts +4 -3
  135. package/types/action.d.ts +10 -1
  136. package/useClueTypeConfig-XvGvIw2S.js +3201 -0
  137. package/utils/chain.js +91 -64
  138. package/utils/classificationParser.js +519 -256
  139. package/utils/constants.js +35 -10
  140. package/utils/graph.js +72 -45
  141. package/utils/hashUtil.js +7 -7
  142. package/utils/line.js +131 -81
  143. package/utils/loggerUtil.d.ts +1 -1
  144. package/utils/loggerUtil.js +6 -4
  145. package/utils/sessionStorage.js +41 -29
  146. package/utils/time.d.ts +3 -0
  147. package/utils/time.js +536 -0
  148. package/utils/utils.js +10 -9
  149. package/utils/window.js +21 -10
  150. package/utils-7OtvGnmf.js +200 -0
  151. package/ActionForm-Sw7D-KOE.js +0 -340
  152. package/AnnotationDetails-BoX61_IF.js +0 -160
  153. package/AnnotationPreview-dYinoSA9.js +0 -140
  154. package/ClueEnrichContext-CvCIPOMC.js +0 -412
  155. package/FlexOne-BXWFOd1T.js +0 -6
  156. package/_Map-DXNg_Z-q.js +0 -54
  157. package/_MapCache-Cu25RRDU.js +0 -129
  158. package/_Uint8Array-DlJCtTvG.js +0 -102
  159. package/_baseAssignValue-CUmzp727.js +0 -20
  160. package/_baseClone-BlMmRXeX.js +0 -208
  161. package/_baseExtremum-P_0akmCi.js +0 -27
  162. package/_baseFlatten-CN7vDNEQ.js +0 -72
  163. package/_baseGet-Dgf6_xCm.js +0 -80
  164. package/_baseIsEqual-Cpjtfb3Q.js +0 -173
  165. package/_baseIteratee-CP1bocOX.js +0 -95
  166. package/_baseSlice-M5RKzt1A.js +0 -10
  167. package/_baseSum-wEbgNeUs.js +0 -10
  168. package/_baseUniq-tMFmk80M.js +0 -61
  169. package/_commonjsHelpers-C6fGbg64.js +0 -6
  170. package/_createAggregator-B4Cav8ZM.js +0 -53
  171. package/_getPrototype-CHAFQYL_.js +0 -5
  172. package/_getTag-BV_UoLYG.js +0 -90
  173. package/cloneDeep-BPVpFBzJ.js +0 -8
  174. package/components/display/markdown/DynamicTabs.d.ts +0 -8
  175. package/components/display/markdown/DynamicTabs.js +0 -21
  176. package/components/display/markdown/markdownPlugins/tabs.d.ts +0 -3
  177. package/components/display/markdown/markdownPlugins/tabs.js +0 -4
  178. package/countBy-DOutsa_w.js +0 -8
  179. package/debounce-DryYcbJ4.js +0 -56
  180. package/get-Bow1vKwx.js +0 -8
  181. package/groupBy-BheQYl6f.js +0 -8
  182. package/iconify-BBckr5AQ.js +0 -1263
  183. package/identity-ByMq8VxU.js +0 -6
  184. package/index-CnaCBNrd.js +0 -358
  185. package/index-E7g8cRyW.js +0 -568
  186. package/index-V7wwd05F.js +0 -975
  187. package/index-p5_wX7q1.js +0 -11729
  188. package/index-pQg5VUAZ.js +0 -12734
  189. package/isEmpty-g47Qir2A.js +0 -21
  190. package/isNil-CjWwlQS3.js +0 -6
  191. package/isObject-B53jY8Qg.js +0 -7
  192. package/isObjectLike-BatpeCIi.js +0 -29
  193. package/isSymbol-C3_SC0Qp.js +0 -8
  194. package/last-7CdUxN0r.js +0 -7
  195. package/sortBy-ITdmD17L.js +0 -79
  196. package/sumBy-DxJUU2E8.js +0 -8
  197. package/tabs-CgADNA57.js +0 -195
  198. package/toFinite-BMy6GObD.js +0 -14
  199. package/toNumber-YVhnnJv4.js +0 -31
  200. package/useClueTypeConfig-CneP98N_.js +0 -2260
  201. package/utils-CD0rFIFU.js +0 -2704
@@ -1,31 +1,52 @@
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,
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,
16
36
  {
17
- variant: n.variant || "outlined",
18
- label: d,
19
- ...o,
20
- ...n,
37
+ variant: otherProps.variant || "outlined",
38
+ label: normalized,
39
+ ...chipProps,
40
+ ...otherProps,
21
41
  sx: [
22
- ...Array.isArray(o.sx) ? o.sx : [o.sx],
23
- ...Array.isArray(n.sx) ? n.sx : [n.sx]
42
+ ...Array.isArray(chipProps.sx) ? chipProps.sx : [chipProps.sx],
43
+ ...Array.isArray(otherProps.sx) ? otherProps.sx : [otherProps.sx]
24
44
  ]
25
45
  }
26
46
  ) });
27
47
  }
28
- ), M = y(A);
48
+ );
49
+ const ClassificationChip$1 = memo(ClassificationChip);
29
50
  export {
30
- M as default
51
+ ClassificationChip$1 as default
31
52
  };
@@ -1,29 +1,34 @@
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
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 });
25
7
  }
26
- ));
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
+ });
27
32
  export {
28
- b as default
33
+ CountBadge as default
29
34
  };
@@ -1,150 +1,168 @@
1
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
- import { I as h } from "../iconify-BBckr5AQ.js";
3
- import { useTheme as q, Card as F, CardHeader as M, Stack as O, CircularProgress as W, Divider as $, CardContent as B, Grid as s, Chip as C, Typography as g, Tooltip as D, Box as G } from "@mui/material";
4
- import { ClueComponentContext as H } from "../hooks/ClueComponentContext.js";
5
- import { useClueEnrichSelector as b } from "../hooks/selectors.js";
6
- import N from "../hooks/useAnnotations.js";
7
- import J from "../hooks/useErrors.js";
8
- import K from "../icons/Assessment.js";
9
- import L from "../icons/Context.js";
10
- import Q from "../icons/Opinion.js";
11
- import { ICON_MAP as T } from "../icons/iconMap.js";
12
- import R from "../text/Frequency.js";
13
- import { u as U } from "../ClueEnrichContext-CvCIPOMC.js";
14
- import { memo as V, useState as X, useMemo as z, useCallback as Y } from "react";
15
- import { u as Z } from "../index-E7g8cRyW.js";
16
- import _ from "./AnnotationEntry.js";
17
- const P = ({
18
- type: o,
19
- value: r,
20
- classification: f,
21
- contextIcon: I = !1,
22
- counters: m = !1,
23
- hideLoading: y = !1,
24
- ...e
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { I as Icon } from "../iconify-CXMreGTg.js";
3
+ import { useTheme, Card, CardHeader, Stack, CircularProgress, Divider, CardContent, Grid, Chip, Typography, Tooltip, Box } from "@mui/material";
4
+ import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
5
+ import { useClueEnrichSelector } from "../hooks/selectors.js";
6
+ import useAnnotations from "../hooks/useAnnotations.js";
7
+ import useErrors from "../hooks/useErrors.js";
8
+ import AssessmentIcon from "../icons/Assessment.js";
9
+ import ContextIcon from "../icons/Context.js";
10
+ import OpinionIcon from "../icons/Opinion.js";
11
+ import { ICON_MAP } from "../icons/iconMap.js";
12
+ import FrequencyText from "../text/Frequency.js";
13
+ import { u as uniq } from "../ClueEnrichContext-6NJfXpUB.js";
14
+ import { memo, useState, useMemo, useCallback } from "react";
15
+ import { u as useContextSelector } from "../index-BDVjGvMI.js";
16
+ import AnnotationEntry from "./AnnotationEntry.js";
17
+ import ExecutePopover from "./actions/ExecutePopover.js";
18
+ import EnrichPopover from "./enrichment/EnrichPopover.js";
19
+ const EnrichedCard = ({
20
+ type,
21
+ value,
22
+ classification: _classification,
23
+ contextIcon = false,
24
+ counters = false,
25
+ hideLoading = false,
26
+ ...otherProps
25
27
  }) => {
26
- const p = q(), { t: E } = Z(H, (i) => i.i18next), u = b((i) => i.defaultClassification), x = b((i) => i.enrich), [S, A] = X("all"), l = z(
27
- () => f ?? u,
28
- [f, u]
29
- ), [n, k] = N(o, r, l), c = J(r), v = z(() => ["all", ...U(n.map((i) => i.type))], [n]), w = Y(() => x(o, r, {
30
- classification: l,
31
- timeout: 15,
32
- force: !0
33
- }), [l, x, o, r]);
34
- return /* @__PURE__ */ a(
35
- F,
28
+ const theme = useTheme();
29
+ const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
30
+ const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
31
+ const enrich = useClueEnrichSelector((state) => state.enrich);
32
+ const [filter, setFilter] = useState("all");
33
+ const classification = useMemo(
34
+ () => _classification ?? defaultClassification,
35
+ [_classification, defaultClassification]
36
+ );
37
+ const [annotations, loading] = useAnnotations(type, value, classification);
38
+ const errors = useErrors(value);
39
+ const enrichRequest = { type, value, classification };
40
+ const options = useMemo(() => ["all", ...uniq(annotations.map((annotation) => annotation.type))], [annotations]);
41
+ const forceEnrich = useCallback(() => {
42
+ return enrich(type, value, {
43
+ classification,
44
+ timeout: 15,
45
+ force: true
46
+ });
47
+ }, [classification, enrich, type, value]);
48
+ return /* @__PURE__ */ jsxs(
49
+ Card,
36
50
  {
37
51
  sx: [
38
52
  {
39
53
  maxWidth: "900px"
40
54
  },
41
- ...Array.isArray(e == null ? void 0 : e.sx) ? e == null ? void 0 : e.sx : [e == null ? void 0 : e.sx]
55
+ ...Array.isArray(otherProps == null ? void 0 : otherProps.sx) ? otherProps == null ? void 0 : otherProps.sx : [otherProps == null ? void 0 : otherProps.sx]
42
56
  ],
43
- ...e,
57
+ ...otherProps,
44
58
  children: [
45
- /* @__PURE__ */ t(
46
- M,
59
+ /* @__PURE__ */ jsx(
60
+ CardHeader,
47
61
  {
48
- title: /* @__PURE__ */ a(O, { direction: "row", spacing: 1, alignItems: "center", children: [
49
- /* @__PURE__ */ t(R, { annotations: n, value: r, variant: "h6" }),
50
- /* @__PURE__ */ t(
51
- K,
62
+ title: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
63
+ /* @__PURE__ */ jsx(FrequencyText, { annotations, value, variant: "h6" }),
64
+ /* @__PURE__ */ jsx(
65
+ AssessmentIcon,
52
66
  {
53
- value: { type: o, value: r, classification: l },
54
- annotations: n,
55
- counters: m,
67
+ value: enrichRequest,
68
+ annotations,
69
+ counters,
56
70
  fontSize: "1em",
57
- disableTooltip: !0
71
+ disableTooltip: true
58
72
  }
59
73
  ),
60
- /* @__PURE__ */ t(
61
- Q,
74
+ /* @__PURE__ */ jsx(
75
+ OpinionIcon,
62
76
  {
63
- value: { type: o, value: r, classification: l },
64
- annotations: n,
65
- counters: m,
77
+ value: enrichRequest,
78
+ annotations,
79
+ counters,
66
80
  fontSize: "1em",
67
- disableTooltip: !0
81
+ disableTooltip: true
68
82
  }
69
83
  ),
70
- /* @__PURE__ */ t(
71
- L,
84
+ /* @__PURE__ */ jsx(
85
+ ContextIcon,
72
86
  {
73
- value: { type: o, value: r, classification: l },
74
- annotations: n,
75
- counters: m,
76
- showExtraIcon: I,
87
+ value: enrichRequest,
88
+ annotations,
89
+ counters,
90
+ showExtraIcon: contextIcon,
77
91
  fontSize: "inherit",
78
- disableTooltip: !0
92
+ disableTooltip: true
79
93
  }
80
94
  ),
81
- k && !y && /* @__PURE__ */ t(W, { color: "primary", size: 18 })
95
+ loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 18 }),
96
+ /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
97
+ /* @__PURE__ */ jsx(EnrichPopover, { selector: enrichRequest }),
98
+ /* @__PURE__ */ jsx(ExecutePopover, { selectors: [enrichRequest] })
82
99
  ] })
83
100
  }
84
101
  ),
85
- /* @__PURE__ */ t($, { sx: { mx: 1 } }),
86
- /* @__PURE__ */ a(B, { sx: { p: 1 }, children: [
87
- /* @__PURE__ */ a(s, { container: !0, spacing: 0.5, sx: { mb: 1 }, children: [
88
- v.map((i, d) => (
102
+ /* @__PURE__ */ jsx(Divider, { sx: { mx: 1 } }),
103
+ /* @__PURE__ */ jsxs(CardContent, { sx: { p: 1 }, children: [
104
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 0.5, sx: { mb: 1 }, children: [
105
+ options.map((opt, id) => (
89
106
  // eslint-disable-next-line react/no-array-index-key
90
- /* @__PURE__ */ t(s, { item: !0, children: /* @__PURE__ */ t(
91
- C,
107
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
108
+ Chip,
92
109
  {
93
110
  size: "small",
94
- variant: i === S ? "filled" : "outlined",
95
- icon: T[i] && /* @__PURE__ */ t(h, { icon: T[i] }),
96
- label: /* @__PURE__ */ a(g, { variant: "caption", textTransform: "capitalize", children: [
97
- i,
111
+ variant: opt === filter ? "filled" : "outlined",
112
+ icon: ICON_MAP[opt] && /* @__PURE__ */ jsx(Icon, { icon: ICON_MAP[opt] }),
113
+ label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
114
+ opt,
98
115
  ":",
99
116
  " ",
100
- i === "all" ? n.length : n.filter((j) => j.type === i).length
117
+ opt === "all" ? annotations.length : annotations.filter((annotation) => annotation.type === opt).length
101
118
  ] }),
102
- onClick: () => A(i)
119
+ onClick: () => setFilter(opt)
103
120
  }
104
- ) }, d)
121
+ ) }, id)
105
122
  )),
106
- (c == null ? void 0 : c.length) > 0 && /* @__PURE__ */ t(s, { item: !0, children: /* @__PURE__ */ t(
107
- D,
123
+ (errors == null ? void 0 : errors.length) > 0 && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
124
+ Tooltip,
108
125
  {
109
- title: /* @__PURE__ */ t("div", { onClick: (i) => i.stopPropagation(), children: c.map((i) => /* @__PURE__ */ a("div", { children: [
110
- /* @__PURE__ */ t("span", { style: { textTransform: "capitalize" }, children: i.source.replace(/-/g, " ") }),
126
+ title: /* @__PURE__ */ jsx("div", { onClick: (e) => e.stopPropagation(), children: errors.map((err) => /* @__PURE__ */ jsxs("div", { children: [
127
+ /* @__PURE__ */ jsx("span", { style: { textTransform: "capitalize" }, children: err.source.replace(/-/g, " ") }),
111
128
  ":",
112
129
  " ",
113
- i.message
114
- ] }, i.source)) }),
115
- children: /* @__PURE__ */ t(
116
- C,
130
+ err.message
131
+ ] }, err.source)) }),
132
+ children: /* @__PURE__ */ jsx(
133
+ Chip,
117
134
  {
118
135
  size: "small",
119
136
  variant: "outlined",
120
- icon: /* @__PURE__ */ t(
121
- h,
137
+ icon: /* @__PURE__ */ jsx(
138
+ Icon,
122
139
  {
123
140
  icon: "material-symbols:timer-outline",
124
- color: p.palette.error.main,
141
+ color: theme.palette.error.main,
125
142
  style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" }
126
143
  }
127
144
  ),
128
- label: /* @__PURE__ */ a(g, { variant: "caption", textTransform: "capitalize", children: [
129
- E("annotation.failed"),
145
+ label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
146
+ t("annotation.failed"),
130
147
  ": ",
131
- c.length
148
+ errors.length
132
149
  ] }),
133
- onClick: w
150
+ onClick: forceEnrich
134
151
  }
135
152
  )
136
153
  }
137
154
  ) })
138
155
  ] }),
139
- /* @__PURE__ */ t(s, { container: !0, spacing: 1, alignItems: "stretch", children: n.map((i, d) => (
156
+ /* @__PURE__ */ jsx(Grid, { container: true, spacing: 1, alignItems: "stretch", children: annotations.map((annotation, id) => (
140
157
  // eslint-disable-next-line react/no-array-index-key
141
- /* @__PURE__ */ t(s, { item: !0, xs: 6, minWidth: "300px", children: /* @__PURE__ */ t(G, { sx: { border: `thin solid ${p.palette.divider}`, p: 1, height: "100%" }, children: /* @__PURE__ */ t(_, { annotation: i }) }) }, d)
158
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, minWidth: "300px", children: /* @__PURE__ */ jsx(Box, { sx: { border: `thin solid ${theme.palette.divider}`, p: 1, height: "100%" }, children: /* @__PURE__ */ jsx(AnnotationEntry, { annotation }) }) }, id)
142
159
  )) })
143
160
  ] })
144
161
  ]
145
162
  }
146
163
  );
147
- }, hi = V(P);
164
+ };
165
+ const EnrichedCard$1 = memo(EnrichedCard);
148
166
  export {
149
- hi as default
167
+ EnrichedCard$1 as default
150
168
  };