@cccsaurora/clue-ui 1.0.1-dev.70 → 1.0.2

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 (181) hide show
  1. package/ActionForm-BtTv0s4P.js +340 -0
  2. package/AnnotationDetails-D5tBIeEw.js +160 -0
  3. package/AnnotationPreview-CZr_CcZC.js +140 -0
  4. package/ClueEnrichContext-DH9lqjwH.js +401 -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-C6fGbg64.js +6 -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 +34 -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 +92 -104
  32. package/components/EnrichedChip.js +109 -134
  33. package/components/EnrichedTypography.js +110 -136
  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 +34 -37
  40. package/components/actions/form/schemaAdapter.js +20 -39
  41. package/components/display/graph/ExpandMoreButton.js +10 -10
  42. package/components/display/graph/elements/NodeCard.js +76 -92
  43. package/components/display/graph/elements/NodeTag.js +13 -15
  44. package/components/display/graph/index.js +200 -258
  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/DynamicTabs.js +17 -22
  61. package/components/display/markdown/index.js +5674 -8531
  62. package/components/display/markdown/markdownPlugins/tabs.js +1 -1
  63. package/components/enrichment/EnrichPopover.js +47 -55
  64. package/components/fetchers/Fetcher.js +95 -123
  65. package/components/fetchers/PreviewModal.js +17 -20
  66. package/components/fetchers/StatusChip.js +18 -22
  67. package/components/group/Entry.js +11 -13
  68. package/components/group/Group.js +10 -13
  69. package/components/group/GroupControl.js +65 -76
  70. package/components/stats/QueryStatus.js +28 -37
  71. package/countBy-DOutsa_w.js +8 -0
  72. package/data/event.js +4 -6
  73. package/database/index.js +2 -2
  74. package/debounce-DryYcbJ4.js +56 -0
  75. package/get-Bow1vKwx.js +8 -0
  76. package/groupBy-BheQYl6f.js +8 -0
  77. package/hooks/ClueActionContext.js +6 -6
  78. package/hooks/ClueComponentContext.js +23 -29
  79. package/hooks/ClueConfigProvider.js +12 -14
  80. package/hooks/ClueDatabaseContext.js +13 -19
  81. package/hooks/ClueEnrichContext.js +8 -8
  82. package/hooks/ClueFetcherContext.js +46 -74
  83. package/hooks/ClueGroupContext.js +14 -17
  84. package/hooks/CluePopupContext.js +5 -5
  85. package/hooks/ClueProvider.js +10 -12
  86. package/hooks/selectors.js +11 -22
  87. package/hooks/useAnnotations.js +29 -45
  88. package/hooks/useClue.js +4 -6
  89. package/hooks/useClueActions.js +3 -3
  90. package/hooks/useClueConfig.js +5 -5
  91. package/hooks/useClueTypeConfig.js +3 -3
  92. package/hooks/useComparator.js +435 -722
  93. package/hooks/useErrors.js +18 -22
  94. package/hooks/useMyHighlights.js +36 -66
  95. package/hooks/useMyLocalStorage.js +43 -63
  96. package/iconify-BBckr5AQ.js +1263 -0
  97. package/icons/Action.js +49 -66
  98. package/icons/Assessment.js +68 -84
  99. package/icons/Context.js +61 -75
  100. package/icons/Opinion.js +65 -77
  101. package/icons/iconMap.js +2 -2
  102. package/identity-ByMq8VxU.js +6 -0
  103. package/index-BUcHmehh.js +975 -0
  104. package/index-Bo-v5IAc.js +12754 -0
  105. package/index-CnaCBNrd.js +358 -0
  106. package/index-E7g8cRyW.js +568 -0
  107. package/index-p5_wX7q1.js +11729 -0
  108. package/isEmpty-g47Qir2A.js +21 -0
  109. package/isNil-CjWwlQS3.js +6 -0
  110. package/isObject-B53jY8Qg.js +7 -0
  111. package/isObjectLike-BatpeCIi.js +29 -0
  112. package/isSymbol-C3_SC0Qp.js +8 -0
  113. package/last-7CdUxN0r.js +7 -0
  114. package/main.js +58 -58
  115. package/package.json +1 -1
  116. package/sortBy-ITdmD17L.js +79 -0
  117. package/sumBy-DxJUU2E8.js +8 -0
  118. package/tabs-CgADNA57.js +195 -0
  119. package/text/Frequency.js +23 -42
  120. package/toFinite-BMy6GObD.js +14 -0
  121. package/toNumber-YVhnnJv4.js +31 -0
  122. package/useClueTypeConfig-CneP98N_.js +2260 -0
  123. package/utils/chain.js +64 -91
  124. package/utils/classificationParser.d.ts +8 -8
  125. package/utils/classificationParser.js +257 -520
  126. package/utils/constants.js +10 -35
  127. package/utils/graph.js +45 -72
  128. package/utils/hashUtil.js +7 -7
  129. package/utils/line.js +81 -131
  130. package/utils/loggerUtil.js +3 -5
  131. package/utils/sessionStorage.js +29 -41
  132. package/utils/utils.js +9 -9
  133. package/utils/window.js +10 -21
  134. package/utils-CD0rFIFU.js +2704 -0
  135. package/ActionForm-D4ryHO0M.js +0 -436
  136. package/AnnotationDetails-YAPoqw3R.js +0 -175
  137. package/AnnotationPreview-DiQDjt9s.js +0 -188
  138. package/ClueEnrichContext-DIn6g8tw.js +0 -522
  139. package/FlexOne-BSYAhhtG.js +0 -9
  140. package/_Map-kgDsDYxq.js +0 -64
  141. package/_MapCache-DabaaWfq.js +0 -161
  142. package/_Uint8Array-BlVVH1tp.js +0 -129
  143. package/_baseAssignValue-CNbcU6Nb.js +0 -25
  144. package/_baseClone-D3a8Pa4T.js +0 -284
  145. package/_baseExtremum-B1o1zHjR.js +0 -33
  146. package/_baseFlatten-D4huXoEI.js +0 -92
  147. package/_baseGet-BSK_nnoz.js +0 -109
  148. package/_baseIsEqual-B5xLoweL.js +0 -238
  149. package/_baseIteratee-p6Nj07-n.js +0 -126
  150. package/_baseSlice-GAv_YFTT.js +0 -20
  151. package/_baseSum-D0WC1dN0.js +0 -13
  152. package/_baseUniq-CpupKWcL.js +0 -89
  153. package/_commonjsHelpers-CUmg6egw.js +0 -6
  154. package/_createAggregator-BpVy5xMi.js +0 -63
  155. package/_getPrototype-D1LAdQKO.js +0 -5
  156. package/_getTag-D3ToyefI.js +0 -126
  157. package/cloneDeep-CjP5k9zW.js +0 -8
  158. package/countBy-C69WslUA.js +0 -14
  159. package/debounce-bV0h5FC5.js +0 -92
  160. package/get-D3C3lEU3.js +0 -8
  161. package/groupBy-DC2oOuBN.js +0 -14
  162. package/iconify-CXMreGTg.js +0 -1782
  163. package/identity-CPGTqrE4.js +0 -6
  164. package/index-BDVjGvMI.js +0 -696
  165. package/index-BHPT3qoB.js +0 -1172
  166. package/index-BMxyILVD.js +0 -465
  167. package/index-BbPn6-Mw.js +0 -15750
  168. package/index-Dz1kF2MU.js +0 -17654
  169. package/isEmpty-BQkZubqU.js +0 -29
  170. package/isNil-CIubwp4T.js +0 -6
  171. package/isObject-FTY-5JQX.js +0 -7
  172. package/isObjectLike-OAgjjZye.js +0 -48
  173. package/isSymbol-Xd2FsJyp.js +0 -8
  174. package/last-CUCl67Im.js +0 -7
  175. package/sortBy-B-UKp4GT.js +0 -100
  176. package/sumBy-MYkDPHZL.js +0 -8
  177. package/tabs-xGuUGsJd.js +0 -254
  178. package/toFinite-Bc55msYj.js +0 -16
  179. package/toNumber-DPxy1FBy.js +0 -39
  180. package/useClueTypeConfig-CH-nGq6a.js +0 -3184
  181. package/utils-Dr4wbKBZ.js +0 -4182
@@ -1,4 +1,4 @@
1
- import { c } from "../../../../tabs-xGuUGsJd.js";
1
+ import { c } from "../../../../tabs-CgADNA57.js";
2
2
  export {
3
3
  c as codeTabs
4
4
  };
@@ -1,88 +1,80 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Box, Typography, Divider } from "@mui/material";
3
- import { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
4
- import { c as capitalize } from "../../ActionForm-D4ryHO0M.js";
5
- import { useState, useRef, useCallback, useEffect } from "react";
6
- import Iconified from "../display/icons/Iconified.js";
7
- const EnrichPopover = ({ show = false, size = "small", selector }) => {
8
- const { t } = useClueComponentSelector((ctx) => ctx.i18next);
9
- const theme = useTheme();
10
- const availableSources = useClueEnrichSelector((ctx) => ctx.availableSources);
11
- const _enrich = useClueEnrichSelector((ctx) => ctx.enrich);
12
- const [showEnrichMenu, setShowEnrichMenu] = useState(show);
13
- const [loading, setLoading] = useState(false);
14
- const enrichEl = useRef(null);
15
- const enrich = useCallback(
16
- async (_source) => {
17
- setLoading(true);
1
+ import { jsxs as y, Fragment as C, jsx as e } from "react/jsx-runtime";
2
+ import { useTheme as k, Tooltip as S, IconButton as E, CircularProgress as d, Button as z, Popover as I, Paper as j, Stack as c, Box as P, Typography as B, Divider as O } from "@mui/material";
3
+ import { useClueComponentSelector as T, useClueEnrichSelector as p } from "../../hooks/selectors.js";
4
+ import { c as w } from "../../ActionForm-BtTv0s4P.js";
5
+ import { useState as m, useRef as M, useCallback as D, useEffect as F } from "react";
6
+ import g from "../display/icons/Iconified.js";
7
+ const J = ({ show: t = !1, size: b = "small", selector: n }) => {
8
+ const { t: s } = T((i) => i.i18next), h = k(), l = p((i) => i.availableSources), u = p((i) => i.enrich), [x, o] = m(t), [r, f] = m(!1), a = M(null), v = D(
9
+ async (i) => {
10
+ f(!0);
18
11
  try {
19
- await _enrich(selector.type, selector.value, {
20
- classification: selector.classification,
12
+ await u(n.type, n.value, {
13
+ classification: n.classification,
21
14
  timeout: 30,
22
- force: true,
23
- noCache: true,
24
- sources: [_source],
25
- append: true
15
+ force: !0,
16
+ noCache: !0,
17
+ sources: [i],
18
+ append: !0
26
19
  });
27
20
  } finally {
28
- setLoading(false);
21
+ f(!1);
29
22
  }
30
23
  },
31
- [_enrich, selector.classification, selector.type, selector.value]
24
+ [u, n.classification, n.type, n.value]
32
25
  );
33
- useEffect(() => {
34
- setShowEnrichMenu(show);
35
- }, [show]);
36
- return /* @__PURE__ */ jsxs(Fragment, { children: [
37
- size === "small" ? /* @__PURE__ */ jsx(Tooltip, { ref: enrichEl, title: t("enrich"), children: /* @__PURE__ */ jsx("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ jsx(
38
- IconButton,
26
+ return F(() => {
27
+ o(t);
28
+ }, [t]), /* @__PURE__ */ y(C, { children: [
29
+ b === "small" ? /* @__PURE__ */ e(S, { ref: a, title: s("enrich"), children: /* @__PURE__ */ e("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ e(
30
+ E,
39
31
  {
40
- onClick: () => setShowEnrichMenu(true),
41
- disabled: Object.keys(availableSources).length < 1 || loading,
32
+ onClick: () => o(!0),
33
+ disabled: Object.keys(l).length < 1 || r,
42
34
  color: "info",
43
- children: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "24px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-auto-fix-high" })
35
+ children: r ? /* @__PURE__ */ e(d, { color: "info", size: "24px" }) : /* @__PURE__ */ e(g, { icon: "ic:baseline-auto-fix-high" })
44
36
  }
45
- ) }) }) : /* @__PURE__ */ jsx(
46
- Button,
37
+ ) }) }) : /* @__PURE__ */ e(
38
+ z,
47
39
  {
48
- ref: enrichEl,
40
+ ref: a,
49
41
  variant: "outlined",
50
42
  color: "info",
51
- disabled: Object.keys(availableSources).length < 1 || loading,
52
- startIcon: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "20px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-auto-fix-high" }),
43
+ disabled: Object.keys(l).length < 1 || r,
44
+ startIcon: r ? /* @__PURE__ */ e(d, { color: "info", size: "20px" }) : /* @__PURE__ */ e(g, { icon: "ic:baseline-auto-fix-high" }),
53
45
  sx: { alignSelf: "stretch" },
54
- onClick: () => setShowEnrichMenu(true),
55
- children: t("enrich")
46
+ onClick: () => o(!0),
47
+ children: s("enrich")
56
48
  }
57
49
  ),
58
- /* @__PURE__ */ jsx(
59
- Popover,
50
+ /* @__PURE__ */ e(
51
+ I,
60
52
  {
61
53
  sx: { zIndex: 2e3 },
62
- open: showEnrichMenu,
63
- disablePortal: true,
64
- onClose: () => setShowEnrichMenu(false),
65
- anchorEl: enrichEl.current,
54
+ open: x,
55
+ disablePortal: !0,
56
+ onClose: () => o(!1),
57
+ anchorEl: a.current,
66
58
  anchorOrigin: { horizontal: "left", vertical: "bottom" },
67
- children: /* @__PURE__ */ jsx(Paper, { onClick: () => setShowEnrichMenu(false), children: /* @__PURE__ */ jsx(Stack, { divider: /* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "horizontal" }), children: availableSources.map((_source) => /* @__PURE__ */ jsx(
68
- Box,
59
+ children: /* @__PURE__ */ e(j, { onClick: () => o(!1), children: /* @__PURE__ */ e(c, { divider: /* @__PURE__ */ e(O, { flexItem: !0, orientation: "horizontal" }), children: l.map((i) => /* @__PURE__ */ e(
60
+ P,
69
61
  {
70
62
  sx: {
71
63
  px: 3,
72
64
  py: 1,
73
65
  cursor: "pointer",
74
- transition: theme.transitions.create("background-color"),
75
- "&:hover": { backgroundColor: theme.palette.background.default }
66
+ transition: h.transitions.create("background-color"),
67
+ "&:hover": { backgroundColor: h.palette.background.default }
76
68
  },
77
- onClick: () => enrich(_source),
78
- children: /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, alignItems: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "body1", children: _source.split("-").map(capitalize).join(" ") }) }) })
69
+ onClick: () => v(i),
70
+ children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(c, { direction: "row", spacing: 1, alignItems: "center", children: /* @__PURE__ */ e(B, { variant: "body1", children: i.split("-").map(w).join(" ") }) }) })
79
71
  },
80
- _source
72
+ i
81
73
  )) }) })
82
74
  }
83
75
  )
84
76
  ] });
85
77
  };
86
78
  export {
87
- EnrichPopover as default
79
+ J as default
88
80
  };
@@ -1,104 +1,77 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { I as Icon } from "../../iconify-CXMreGTg.js";
3
- import { useTheme, Skeleton, Chip, Tooltip, Paper, Stack, Box, IconButton } from "@mui/material";
4
- import { F as FlexOne } from "../../FlexOne-BSYAhhtG.js";
5
- import Iconified from "../display/icons/Iconified.js";
6
- import { J as JSONViewer } from "../../index-BMxyILVD.js";
7
- import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
8
- import { useClueFetcherSelector } from "../../hooks/selectors.js";
9
- import React__default, { useState, useEffect, memo } from "react";
10
- import { u as useContextSelector } from "../../index-BDVjGvMI.js";
11
- import Graph from "../display/graph/index.js";
12
- import Markdown from "../display/markdown/index.js";
13
- import PreviewModal from "./PreviewModal.js";
14
- import StatusChip from "./StatusChip.js";
15
- const Fetcher = React__default.memo(
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import { I } from "../../iconify-BBckr5AQ.js";
3
+ import { useTheme as J, Skeleton as A, Chip as N, Tooltip as z, Paper as O, Stack as x, Box as D, IconButton as E } from "@mui/material";
4
+ import { F } from "../../FlexOne-BXWFOd1T.js";
5
+ import w from "../display/icons/Iconified.js";
6
+ import { J as G } from "../../index-CnaCBNrd.js";
7
+ import { ClueComponentContext as H } from "../../hooks/ClueComponentContext.js";
8
+ import { useClueFetcherSelector as g } from "../../hooks/selectors.js";
9
+ import L, { useState as s, useEffect as V, memo as W } from "react";
10
+ import { u as $ } from "../../index-E7g8cRyW.js";
11
+ import q from "../display/graph/index.js";
12
+ import K from "../display/markdown/index.js";
13
+ import Q from "./PreviewModal.js";
14
+ import U from "./StatusChip.js";
15
+ const X = L.memo(
16
16
  ({
17
- type,
18
- value,
19
- classification,
20
- fetcherId,
17
+ type: c,
18
+ value: f,
19
+ classification: h,
20
+ fetcherId: a,
21
21
  slotProps: {
22
- paper: paperProps = {},
23
- preview: previewProps = {},
24
- stack: stackProps = {},
25
- image: imageProps = {},
26
- chip: chipProps = {},
27
- skeleton: skeletonProps = {}
22
+ paper: t = {},
23
+ preview: j = {},
24
+ stack: r = {},
25
+ image: M = {},
26
+ chip: C = {},
27
+ skeleton: n = {}
28
28
  } = {}
29
29
  }) => {
30
- var _a;
31
- const theme = useTheme();
32
- const fetchers = useClueFetcherSelector((ctx) => ctx.fetchers);
33
- const fetchSelector = useClueFetcherSelector((ctx) => ctx.fetchSelector);
34
- const fetchCompleted = useClueFetcherSelector((ctx) => ctx.fetchCompleted);
35
- const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx == null ? void 0 : ctx.i18next);
36
- const [result, setResult] = useState(null);
37
- const [loading, setLoading] = useState(true);
38
- const [showPreview, setShowPreview] = useState(false);
39
- useEffect(() => {
30
+ var v;
31
+ const l = J(), u = g((o) => o.fetchers), y = g((o) => o.fetchSelector), R = g((o) => o.fetchCompleted), { t: d } = $(H, (o) => o == null ? void 0 : o.i18next), [i, _] = s(null), [B, S] = s(!0), [T, b] = s(!1);
32
+ if (V(() => {
40
33
  (async () => {
41
34
  try {
42
- setLoading(true);
43
- setResult(await fetchSelector(fetcherId, { type, value, classification }));
35
+ S(!0), _(await y(a, { type: c, value: f, classification: h }));
44
36
  } finally {
45
- setLoading(false);
37
+ S(!1);
46
38
  }
47
39
  })();
48
- }, [classification, fetchSelector, fetcherId, type, value]);
49
- if (fetchCompleted) {
50
- if (!fetcherId) {
51
- console.warn("Missing fetcher Id. Component will not render.");
52
- return null;
53
- } else if (!fetcherId.includes(".")) {
54
- console.warn(
40
+ }, [h, y, a, c, f]), R)
41
+ if (a)
42
+ if (a.includes(".")) {
43
+ if (!(a in u))
44
+ return console.warn("Fetcher ID does not correspond to a registered fetcher. Component will not render."), null;
45
+ } else return console.warn(
55
46
  "Invalid fetcher id. Must be in the format '<plugin_id>.<fetcher_id>'. Component will not render."
56
- );
57
- return null;
58
- } else if (!(fetcherId in fetchers)) {
59
- console.warn("Fetcher ID does not correspond to a registered fetcher. Component will not render.");
60
- return null;
61
- }
62
- } else {
47
+ ), null;
48
+ else return console.warn("Missing fetcher Id. Component will not render."), null;
49
+ else
63
50
  return null;
64
- }
65
- if (loading) {
66
- if (((_a = fetchers[fetcherId]) == null ? void 0 : _a.format) === "status") {
67
- return /* @__PURE__ */ jsx(
68
- Skeleton,
69
- {
70
- variant: "rounded",
71
- height: "32px",
72
- width: "150px",
73
- ...skeletonProps,
74
- sx: [
75
- { borderRadius: "16px" },
76
- ...Array.isArray(skeletonProps == null ? void 0 : skeletonProps.sx) ? skeletonProps == null ? void 0 : skeletonProps.sx : [skeletonProps == null ? void 0 : skeletonProps.sx]
77
- ]
78
- }
79
- );
80
- } else {
81
- return /* @__PURE__ */ jsx(Skeleton, { variant: "rounded", height: "325px", width: "300px", ...skeletonProps });
51
+ return B ? ((v = u[a]) == null ? void 0 : v.format) === "status" ? /* @__PURE__ */ e(
52
+ A,
53
+ {
54
+ variant: "rounded",
55
+ height: "32px",
56
+ width: "150px",
57
+ ...n,
58
+ sx: [
59
+ { borderRadius: "16px" },
60
+ ...Array.isArray(n == null ? void 0 : n.sx) ? n == null ? void 0 : n.sx : [n == null ? void 0 : n.sx]
61
+ ]
82
62
  }
83
- }
84
- if ((result == null ? void 0 : result.outcome) === "failure" && fetchers[fetcherId].format === "status") {
85
- return /* @__PURE__ */ jsx(
86
- Chip,
87
- {
88
- icon: /* @__PURE__ */ jsx(Tooltip, { title: result.error, children: /* @__PURE__ */ jsx(Icon, { icon: "mdi:information-outline", fontSize: "1.25rem" }) }),
89
- label: t("error"),
90
- color: "error",
91
- ...chipProps
92
- }
93
- );
94
- }
95
- if ((result == null ? void 0 : result.format) === "status") {
96
- return /* @__PURE__ */ jsx(StatusChip, { data: result.data, ...chipProps });
97
- }
98
- return /* @__PURE__ */ jsx(
99
- Paper,
63
+ ) : /* @__PURE__ */ e(A, { variant: "rounded", height: "325px", width: "300px", ...n }) : (i == null ? void 0 : i.outcome) === "failure" && u[a].format === "status" ? /* @__PURE__ */ e(
64
+ N,
65
+ {
66
+ icon: /* @__PURE__ */ e(z, { title: i.error, children: /* @__PURE__ */ e(I, { icon: "mdi:information-outline", fontSize: "1.25rem" }) }),
67
+ label: d("error"),
68
+ color: "error",
69
+ ...C
70
+ }
71
+ ) : (i == null ? void 0 : i.format) === "status" ? /* @__PURE__ */ e(U, { data: i.data, ...C }) : /* @__PURE__ */ e(
72
+ O,
100
73
  {
101
- ...paperProps,
74
+ ...t,
102
75
  sx: [
103
76
  {
104
77
  p: 1,
@@ -107,16 +80,16 @@ const Fetcher = React__default.memo(
107
80
  width: "100%",
108
81
  minWidth: "300px"
109
82
  },
110
- ...Array.isArray(paperProps == null ? void 0 : paperProps.sx) ? paperProps == null ? void 0 : paperProps.sx : [paperProps == null ? void 0 : paperProps.sx]
83
+ ...Array.isArray(t == null ? void 0 : t.sx) ? t == null ? void 0 : t.sx : [t == null ? void 0 : t.sx]
111
84
  ],
112
- children: /* @__PURE__ */ jsxs(
113
- Stack,
85
+ children: /* @__PURE__ */ m(
86
+ x,
114
87
  {
115
88
  sx: {
116
89
  "& > img": {
117
90
  borderRadius: "3px",
118
91
  cursor: "zoom-in",
119
- transition: theme.transitions.create("border-color", { duration: theme.transitions.duration.shortest }),
92
+ transition: l.transitions.create("border-color", { duration: l.transitions.duration.shortest }),
120
93
  border: "3px solid transparent",
121
94
  "&:hover": {
122
95
  borderColor: "primary.main"
@@ -124,65 +97,64 @@ const Fetcher = React__default.memo(
124
97
  }
125
98
  },
126
99
  children: [
127
- (result == null ? void 0 : result.outcome) === "failure" && /* @__PURE__ */ jsx("code", { style: { color: theme.palette.error.main }, children: /* @__PURE__ */ jsx("pre", { style: { marginTop: 0, marginBottom: 0 }, children: result.error }) }),
128
- (result == null ? void 0 : result.format) === "markdown" && /* @__PURE__ */ jsx(Markdown, { md: result.data }),
129
- (result == null ? void 0 : result.format) === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, ...imageProps, onClick: () => setShowPreview(true) }),
130
- (result == null ? void 0 : result.format) === "json" && /* @__PURE__ */ jsx(Box, { sx: { ".react-json-view": { backgroundColor: "transparent !important" } }, children: /* @__PURE__ */ jsx(JSONViewer, { data: result.data }) }),
131
- (result == null ? void 0 : result.format) === "graph" && /* @__PURE__ */ jsx(Graph, { graph: result.data, sx: { minHeight: "600px" } }),
132
- /* @__PURE__ */ jsx(FlexOne, {}),
133
- /* @__PURE__ */ jsxs(
134
- Stack,
100
+ (i == null ? void 0 : i.outcome) === "failure" && /* @__PURE__ */ e("code", { style: { color: l.palette.error.main }, children: /* @__PURE__ */ e("pre", { style: { marginTop: 0, marginBottom: 0 }, children: i.error }) }),
101
+ (i == null ? void 0 : i.format) === "markdown" && /* @__PURE__ */ e(K, { md: i.data }),
102
+ (i == null ? void 0 : i.format) === "image" && /* @__PURE__ */ e("img", { src: i.data.image, alt: i.data.alt, ...M, onClick: () => b(!0) }),
103
+ (i == null ? void 0 : i.format) === "json" && /* @__PURE__ */ e(D, { sx: { ".react-json-view": { backgroundColor: "transparent !important" } }, children: /* @__PURE__ */ e(G, { data: i.data }) }),
104
+ (i == null ? void 0 : i.format) === "graph" && /* @__PURE__ */ e(q, { graph: i.data, sx: { minHeight: "600px" } }),
105
+ /* @__PURE__ */ e(F, {}),
106
+ /* @__PURE__ */ m(
107
+ x,
135
108
  {
136
109
  direction: "row",
137
110
  spacing: 1,
138
- ...stackProps,
111
+ ...r,
139
112
  sx: [
140
113
  {
141
- py: theme.spacing(0.5),
114
+ py: l.spacing(0.5),
142
115
  display: "flex",
143
116
  alignItems: "center"
144
117
  },
145
- ...Array.isArray(stackProps == null ? void 0 : stackProps.sx) ? stackProps == null ? void 0 : stackProps.sx : [stackProps == null ? void 0 : stackProps.sx]
118
+ ...Array.isArray(r == null ? void 0 : r.sx) ? r == null ? void 0 : r.sx : [r == null ? void 0 : r.sx]
146
119
  ],
147
120
  children: [
148
- /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-landscape", color: "primary", fontSize: "small" }),
149
- /* @__PURE__ */ jsx(
150
- Tooltip,
121
+ /* @__PURE__ */ e(w, { icon: "ic:baseline-landscape", color: "primary", fontSize: "small" }),
122
+ /* @__PURE__ */ e(
123
+ z,
151
124
  {
152
- title: /* @__PURE__ */ jsxs(Stack, { spacing: 0.5, children: [
153
- /* @__PURE__ */ jsxs("span", { children: [
154
- t("type"),
125
+ title: /* @__PURE__ */ m(x, { spacing: 0.5, children: [
126
+ /* @__PURE__ */ m("span", { children: [
127
+ d("type"),
155
128
  ": ",
156
- type
129
+ c
157
130
  ] }),
158
- /* @__PURE__ */ jsxs("span", { children: [
159
- t("value"),
131
+ /* @__PURE__ */ m("span", { children: [
132
+ d("value"),
160
133
  ": ",
161
- value
134
+ f
162
135
  ] }),
163
- /* @__PURE__ */ jsxs("span", { children: [
164
- t("classification"),
136
+ /* @__PURE__ */ m("span", { children: [
137
+ d("classification"),
165
138
  ": ",
166
- classification ?? "N/A"
139
+ h ?? "N/A"
167
140
  ] })
168
141
  ] }),
169
- children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-info", fontSize: "small" })
142
+ children: /* @__PURE__ */ e(w, { icon: "ic:outline-info", fontSize: "small" })
170
143
  }
171
144
  ),
172
- /* @__PURE__ */ jsx(FlexOne, {}),
173
- (result == null ? void 0 : result.link) && /* @__PURE__ */ jsx(IconButton, { size: "small", component: "a", href: result.link, children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
145
+ /* @__PURE__ */ e(F, {}),
146
+ (i == null ? void 0 : i.link) && /* @__PURE__ */ e(E, { size: "small", component: "a", href: i.link, children: /* @__PURE__ */ e(w, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
174
147
  ]
175
148
  }
176
149
  ),
177
- /* @__PURE__ */ jsx(PreviewModal, { ...previewProps, open: showPreview, result, onClose: () => setShowPreview(false) })
150
+ /* @__PURE__ */ e(Q, { ...j, open: T, result: i, onClose: () => b(!1) })
178
151
  ]
179
152
  }
180
153
  )
181
154
  }
182
155
  );
183
156
  }
184
- );
185
- const Fetcher$1 = memo(Fetcher);
157
+ ), di = W(X);
186
158
  export {
187
- Fetcher$1 as default
159
+ di as default
188
160
  };
@@ -1,22 +1,19 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Modal, Paper } from "@mui/material";
3
- import { memo } from "react";
4
- const PreviewModal = ({ result, onClose, open = false, ...otherProps }) => {
5
- return /* @__PURE__ */ jsx(
6
- Modal,
7
- {
8
- open,
9
- sx: [
10
- { display: "flex", alignItems: "center", justifyContent: "center" },
11
- ...Array.isArray(otherProps == null ? void 0 : otherProps.sx) ? otherProps == null ? void 0 : otherProps.sx : [otherProps == null ? void 0 : otherProps.sx]
12
- ],
13
- onClose,
14
- ...otherProps,
15
- children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "90%", maxWidth: "90%", p: 2, overflow: "auto" }, children: (result == null ? void 0 : result.format) === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, style: { maxWidth: "100%" } }) })
16
- }
17
- );
18
- };
19
- const PreviewModal$1 = memo(PreviewModal);
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { Modal as n, Paper as f } from "@mui/material";
3
+ import { memo as l } from "react";
4
+ const c = ({ result: i, onClose: d, open: x = !1, ...a }) => /* @__PURE__ */ m(
5
+ n,
6
+ {
7
+ open: x,
8
+ sx: [
9
+ { display: "flex", alignItems: "center", justifyContent: "center" },
10
+ ...Array.isArray(a == null ? void 0 : a.sx) ? a == null ? void 0 : a.sx : [a == null ? void 0 : a.sx]
11
+ ],
12
+ onClose: d,
13
+ ...a,
14
+ children: /* @__PURE__ */ m(f, { sx: { maxHeight: "90%", maxWidth: "90%", p: 2, overflow: "auto" }, children: (i == null ? void 0 : i.format) === "image" && /* @__PURE__ */ m("img", { src: i.data.image, alt: i.data.alt, style: { maxWidth: "100%" } }) })
15
+ }
16
+ ), t = l(c);
20
17
  export {
21
- PreviewModal$1 as default
18
+ t as default
22
19
  };
@@ -1,30 +1,26 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { I as Icon } from "../../iconify-CXMreGTg.js";
3
- import { useTheme, Chip } from "@mui/material";
4
- import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
5
- import { u as useContextSelector } from "../../index-BDVjGvMI.js";
6
- const StatusChip = ({ data, ...chipProps }) => {
7
- var _a;
8
- const theme = useTheme();
9
- const { i18n, t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
10
- if (data == null ? void 0 : data.empty) {
11
- return null;
12
- }
13
- return /* @__PURE__ */ jsx(
14
- Chip,
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { I as r } from "../../iconify-BBckr5AQ.js";
3
+ import { useTheme as f, Chip as x } from "@mui/material";
4
+ import { ClueComponentContext as g } from "../../hooks/ClueComponentContext.js";
5
+ import { u as s } from "../../index-E7g8cRyW.js";
6
+ const S = ({ data: e, ...n }) => {
7
+ var t;
8
+ const m = f(), { i18n: i, t: u } = s(g, (o) => o.i18next);
9
+ return e != null && e.empty ? null : /* @__PURE__ */ l(
10
+ x,
15
11
  {
16
- icon: data.icon && /* @__PURE__ */ jsx(Icon, { icon: data.icon, fontSize: "1.25rem" }),
17
- deleteIcon: /* @__PURE__ */ jsx("a", { href: data.link, rel: "noreferrer", target: "_blank", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(Icon, { icon: "mdi:open-in-new", color: theme.palette.text.primary, fontSize: "1.25rem" }) }),
18
- ...chipProps,
19
- onDelete: data.link ? () => console.log("Navigating to %s", data.link) : null,
20
- label: ((_a = data.labels.find((label) => label.language === i18n.language) ?? data.labels[0]) == null ? void 0 : _a.label) ?? t("unknown"),
12
+ icon: e.icon && /* @__PURE__ */ l(r, { icon: e.icon, fontSize: "1.25rem" }),
13
+ deleteIcon: /* @__PURE__ */ l("a", { href: e.link, rel: "noreferrer", target: "_blank", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ l(r, { icon: "mdi:open-in-new", color: m.palette.text.primary, fontSize: "1.25rem" }) }),
14
+ ...n,
15
+ onDelete: e.link ? () => console.log("Navigating to %s", e.link) : null,
16
+ label: ((t = e.labels.find((o) => o.language === i.language) ?? e.labels[0]) == null ? void 0 : t.label) ?? u("unknown"),
21
17
  sx: [
22
- ...Array.isArray(chipProps == null ? void 0 : chipProps.sx) ? chipProps == null ? void 0 : chipProps.sx : [chipProps == null ? void 0 : chipProps.sx],
23
- data.color && { backgroundColor: data.color }
18
+ ...Array.isArray(n == null ? void 0 : n.sx) ? n == null ? void 0 : n.sx : [n == null ? void 0 : n.sx],
19
+ e.color && { backgroundColor: e.color }
24
20
  ]
25
21
  }
26
22
  );
27
23
  };
28
24
  export {
29
- StatusChip as default
25
+ S as default
30
26
  };
@@ -1,15 +1,13 @@
1
- import { ClueGroupContext } from "../../hooks/ClueGroupContext.js";
2
- import { i as isEqual } from "../../utils-Dr4wbKBZ.js";
3
- import { memo, useEffect } from "react";
4
- import { u as useContextSelector } from "../../index-BDVjGvMI.js";
5
- const Entry = ({ children, entry, selected = false }) => {
6
- const setValues = useContextSelector(ClueGroupContext, (ctx) => ctx == null ? void 0 : ctx.setValues);
7
- useEffect(() => {
8
- setValues == null ? void 0 : setValues((_values) => [..._values.filter((value) => !isEqual(value, entry)), ...selected ? [entry] : []]);
9
- }, [entry, selected, setValues]);
10
- return children;
11
- };
12
- const Entry$1 = memo(Entry);
1
+ import { ClueGroupContext as s } from "../../hooks/ClueGroupContext.js";
2
+ import { i as u } from "../../utils-CD0rFIFU.js";
3
+ import { memo as i, useEffect as a } from "react";
4
+ import { u as n } from "../../index-E7g8cRyW.js";
5
+ const p = ({ children: e, entry: t, selected: m = !1 }) => {
6
+ const r = n(s, (o) => o == null ? void 0 : o.setValues);
7
+ return a(() => {
8
+ r == null || r((o) => [...o.filter((f) => !u(f, t)), ...m ? [t] : []]);
9
+ }, [t, m, r]), e;
10
+ }, G = i(p);
13
11
  export {
14
- Entry$1 as default
12
+ G as default
15
13
  };
@@ -1,15 +1,12 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Stack } from "@mui/material";
3
- import { ClueGroupProvider } from "../../hooks/ClueGroupContext.js";
4
- import { memo } from "react";
5
- import GroupControl from "./GroupControl.js";
6
- const Group = ({ children, showHeader = true, slotProps, ...groupProps }) => {
7
- return /* @__PURE__ */ jsx(ClueGroupProvider, { ...groupProps, children: showHeader ? /* @__PURE__ */ jsxs(Stack, { direction: "column", alignSelf: "stretch", ...(slotProps == null ? void 0 : slotProps.stack) ?? {}, children: [
8
- /* @__PURE__ */ jsx(GroupControl, {}),
9
- children
10
- ] }) : children });
11
- };
12
- const Group$1 = memo(Group);
1
+ import { jsx as m, jsxs as i } from "react/jsx-runtime";
2
+ import { Stack as u } from "@mui/material";
3
+ import { ClueGroupProvider as c } from "../../hooks/ClueGroupContext.js";
4
+ import { memo as n } from "react";
5
+ import f from "./GroupControl.js";
6
+ const p = ({ children: o, showHeader: t = !0, slotProps: r, ...e }) => /* @__PURE__ */ m(c, { ...e, children: t ? /* @__PURE__ */ i(u, { direction: "column", alignSelf: "stretch", ...(r == null ? void 0 : r.stack) ?? {}, children: [
7
+ /* @__PURE__ */ m(f, {}),
8
+ o
9
+ ] }) : o }), h = n(p);
13
10
  export {
14
- Group$1 as default
11
+ h as default
15
12
  };