@cccsaurora/clue-ui 1.1.3 → 1.2.0-dev.106

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-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/cloneDeep-CjP5k9zW.js +8 -0
  24. package/components/AnnotationBody.js +49 -35
  25. package/components/AnnotationDetailPopover.js +36 -30
  26. package/components/AnnotationDetails.js +6 -6
  27. package/components/AnnotationEntry.js +50 -47
  28. package/components/AnnotationPreview.js +5 -5
  29. package/components/ClassificationChip.js +44 -23
  30. package/components/CountBadge.js +31 -26
  31. package/components/EnrichedCard.js +110 -97
  32. package/components/EnrichedChip.js +130 -105
  33. package/components/EnrichedTypography.js +133 -107
  34. package/components/ErrorBoundary.js +28 -24
  35. package/components/RetryFailedEnrichments.js +10 -9
  36. package/components/SourcePicker.js +57 -49
  37. package/components/actions/ActionForm.js +4 -4
  38. package/components/actions/ExecutePopover.js +64 -50
  39. package/components/actions/ResultModal.js +5 -5
  40. package/components/actions/form/schemaAdapter.js +39 -23
  41. package/components/display/graph/ExpandMoreButton.js +10 -10
  42. package/components/display/graph/elements/NodeCard.js +111 -91
  43. package/components/display/graph/elements/NodeTag.js +15 -13
  44. package/components/display/graph/index.js +261 -202
  45. package/components/display/graph/visualizations/Leaf.js +88 -69
  46. package/components/display/graph/visualizations/cloud/index.js +98 -81
  47. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  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 +14 -13
  54. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  55. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  56. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  57. package/components/display/graph/visualizations/tree/index.js +407 -305
  58. package/components/display/icons/Iconified.js +27 -12
  59. package/components/display/json/index.js +4 -4
  60. package/components/display/markdown/index.js +8658 -5757
  61. package/components/enrichment/EnrichPopover.js +55 -47
  62. package/components/fetchers/Fetcher.js +123 -95
  63. package/components/fetchers/PreviewModal.js +20 -17
  64. package/components/fetchers/StatusChip.js +21 -17
  65. package/components/group/Entry.js +13 -11
  66. package/components/group/Group.js +13 -10
  67. package/components/group/GroupControl.js +77 -66
  68. package/components/stats/QueryStatus.js +40 -35
  69. package/countBy-C69WslUA.js +14 -0
  70. package/data/event.js +6 -4
  71. package/database/index.js +2 -2
  72. package/debounce-bV0h5FC5.js +92 -0
  73. package/get-D3C3lEU3.js +8 -0
  74. package/groupBy-DC2oOuBN.js +14 -0
  75. package/hooks/ClueActionContext.js +7 -7
  76. package/hooks/ClueComponentContext.js +29 -23
  77. package/hooks/ClueConfigProvider.js +14 -12
  78. package/hooks/ClueDatabaseContext.js +19 -13
  79. package/hooks/ClueEnrichContext.js +8 -8
  80. package/hooks/ClueFetcherContext.js +74 -46
  81. package/hooks/ClueGroupContext.js +17 -14
  82. package/hooks/CluePopupContext.js +5 -5
  83. package/hooks/ClueProvider.js +12 -10
  84. package/hooks/selectors.js +21 -10
  85. package/hooks/useActionResult.js +2 -2
  86. package/hooks/useAnnotations.js +44 -32
  87. package/hooks/useClue.js +6 -4
  88. package/hooks/useClueActions.js +3 -3
  89. package/hooks/useClueConfig.js +6 -4
  90. package/hooks/useClueTypeConfig.js +3 -3
  91. package/hooks/useComparator.js +722 -435
  92. package/hooks/useErrors.js +22 -18
  93. package/hooks/useMyHighlights.js +66 -36
  94. package/hooks/useMyLocalStorage.js +66 -37
  95. package/iconify-CXMreGTg.js +1782 -0
  96. package/icons/Action.js +66 -49
  97. package/icons/Assessment.js +84 -68
  98. package/icons/Context.js +77 -63
  99. package/icons/Opinion.js +77 -65
  100. package/icons/iconMap.js +2 -2
  101. package/identity-CPGTqrE4.js +6 -0
  102. package/index-BDVjGvMI.js +696 -0
  103. package/index-BbPn6-Mw.js +15750 -0
  104. package/index-Bi21Wb23.js +465 -0
  105. package/index-C3lkTD69.js +1172 -0
  106. package/index-CC12Ux-9.js +17654 -0
  107. package/isEmpty-BQkZubqU.js +29 -0
  108. package/isNil-CIubwp4T.js +6 -0
  109. package/isObject-FTY-5JQX.js +7 -0
  110. package/isObjectLike-OAgjjZye.js +48 -0
  111. package/isSymbol-Xd2FsJyp.js +8 -0
  112. package/last-CUCl67Im.js +7 -0
  113. package/main.js +62 -62
  114. package/package.json +1 -1
  115. package/sortBy-B-UKp4GT.js +100 -0
  116. package/sumBy-MYkDPHZL.js +8 -0
  117. package/text/Frequency.js +42 -23
  118. package/toFinite-Bc55msYj.js +16 -0
  119. package/toNumber-DPxy1FBy.js +39 -0
  120. package/useClueTypeConfig-XvGvIw2S.js +3201 -0
  121. package/utils/chain.js +91 -64
  122. package/utils/classificationParser.js +519 -256
  123. package/utils/constants.js +35 -10
  124. package/utils/graph.js +72 -45
  125. package/utils/hashUtil.js +7 -7
  126. package/utils/line.js +131 -81
  127. package/utils/loggerUtil.js +5 -3
  128. package/utils/sessionStorage.js +41 -27
  129. package/utils/time.js +423 -423
  130. package/utils/utils.js +9 -9
  131. package/utils/window.js +21 -10
  132. package/utils-7OtvGnmf.js +200 -0
  133. package/ActionForm-myEAs2UC.js +0 -435
  134. package/AnnotationDetails-BChWwaXw.js +0 -160
  135. package/AnnotationPreview-D060vmy2.js +0 -140
  136. package/ClueEnrichContext-DJNjbXu_.js +0 -418
  137. package/FlexOne-BXWFOd1T.js +0 -6
  138. package/_Map-DXNg_Z-q.js +0 -54
  139. package/_MapCache-Cu25RRDU.js +0 -129
  140. package/_Uint8Array-DlJCtTvG.js +0 -102
  141. package/_baseAssignValue-CUmzp727.js +0 -20
  142. package/_baseClone-BlMmRXeX.js +0 -208
  143. package/_baseExtremum-P_0akmCi.js +0 -27
  144. package/_baseFlatten-CN7vDNEQ.js +0 -72
  145. package/_baseGet-Dgf6_xCm.js +0 -80
  146. package/_baseIsEqual-Cpjtfb3Q.js +0 -173
  147. package/_baseIteratee-CP1bocOX.js +0 -95
  148. package/_baseSlice-M5RKzt1A.js +0 -10
  149. package/_baseSum-wEbgNeUs.js +0 -10
  150. package/_baseUniq-tMFmk80M.js +0 -61
  151. package/_commonjsHelpers-DaMA6jEr.js +0 -8
  152. package/_createAggregator-B4Cav8ZM.js +0 -53
  153. package/_getPrototype-CHAFQYL_.js +0 -5
  154. package/_getTag-BV_UoLYG.js +0 -90
  155. package/cloneDeep-BPVpFBzJ.js +0 -8
  156. package/countBy-DOutsa_w.js +0 -8
  157. package/debounce-DryYcbJ4.js +0 -56
  158. package/get-Bow1vKwx.js +0 -8
  159. package/groupBy-BheQYl6f.js +0 -8
  160. package/iconify-BBckr5AQ.js +0 -1263
  161. package/identity-ByMq8VxU.js +0 -6
  162. package/index-BXxfAxFt.js +0 -12734
  163. package/index-C15OYgRY.js +0 -358
  164. package/index-E7g8cRyW.js +0 -568
  165. package/index-p5_wX7q1.js +0 -11729
  166. package/index-vF6IyBhz.js +0 -975
  167. package/isEmpty-g47Qir2A.js +0 -21
  168. package/isNil-CjWwlQS3.js +0 -6
  169. package/isObject-B53jY8Qg.js +0 -7
  170. package/isObjectLike-BatpeCIi.js +0 -29
  171. package/isSymbol-C3_SC0Qp.js +0 -8
  172. package/last-7CdUxN0r.js +0 -7
  173. package/sortBy-ITdmD17L.js +0 -79
  174. package/sumBy-DxJUU2E8.js +0 -8
  175. package/toFinite-BMy6GObD.js +0 -14
  176. package/toNumber-YVhnnJv4.js +0 -31
  177. package/useClueTypeConfig-DyeBcXQX.js +0 -2214
  178. package/utils-BnmI_6N8.js +0 -130
@@ -1,93 +1,104 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { Card as S, Stack as y, Box as b, Typography as E, Autocomplete as v, TextField as x, Button as I, CircularProgress as z } from "@mui/material";
3
- import { F as _ } from "../../FlexOne-BXWFOd1T.js";
4
- import k from "../display/icons/Iconified.js";
5
- import { SNACKBAR_EVENT_ID as w } from "../../data/event.js";
6
- import { ClueGroupContext as j } from "../../hooks/ClueGroupContext.js";
7
- import { useClueComponentSelector as A, useClueEnrichSelector as u } from "../../hooks/selectors.js";
8
- import { safeDispatchEvent as B } from "../../utils/window.js";
9
- import { c as F } from "../../ActionForm-myEAs2UC.js";
10
- import { useState as d, useMemo as O, useCallback as T } from "react";
11
- import { u as D } from "../../index-E7g8cRyW.js";
12
- import G from "../actions/ExecutePopover.js";
13
- const U = () => {
14
- const { t: s } = A((e) => e.i18next), { type: t, values: o, classification: a } = D(j, (e) => ({
15
- type: e == null ? void 0 : e.type,
16
- values: e == null ? void 0 : e.values,
17
- classification: e == null ? void 0 : e.classification
18
- })), f = u((e) => e.availableSources), c = u((e) => e.bulkEnrich), [i, p] = d(!1), [l, h] = d([]), C = O(
19
- () => (o ?? []).map((e) => ({ value: e, type: t, classification: a })),
20
- [a, t, o]
21
- ), g = T(async () => {
22
- if (!i)
23
- try {
24
- p(!0), await c(
25
- (o ?? []).map((e) => ({ type: t, value: e })),
26
- { force: !0, sources: l }
27
- );
28
- } catch (e) {
29
- console.error(e), B(
30
- new CustomEvent(w, {
31
- detail: {
32
- message: e.toString(),
33
- level: "error"
34
- }
35
- })
36
- );
37
- } finally {
38
- p(!1);
39
- }
40
- }, [c, i, l, t, o]);
41
- return /* @__PURE__ */ r(S, { sx: { p: 1 }, children: /* @__PURE__ */ m(y, { direction: "row", spacing: 1, alignItems: "center", children: [
42
- /* @__PURE__ */ r(
43
- b,
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Card, Stack, Box, Typography, Autocomplete, TextField, Button, CircularProgress } from "@mui/material";
3
+ import { F as FlexOne } from "../../FlexOne-BSYAhhtG.js";
4
+ import Iconified from "../display/icons/Iconified.js";
5
+ import { SNACKBAR_EVENT_ID } from "../../data/event.js";
6
+ import { ClueGroupContext } from "../../hooks/ClueGroupContext.js";
7
+ import { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
8
+ import { safeDispatchEvent } from "../../utils/window.js";
9
+ import { c as capitalize } from "../../ActionForm-ByeOzpc4.js";
10
+ import { useState, useMemo, useCallback } from "react";
11
+ import { u as useContextSelector } from "../../index-BDVjGvMI.js";
12
+ import ExecutePopover from "../actions/ExecutePopover.js";
13
+ const GroupControl = () => {
14
+ const { t } = useClueComponentSelector((ctx) => ctx.i18next);
15
+ const { type, values, classification } = useContextSelector(ClueGroupContext, (ctx) => ({
16
+ type: ctx == null ? void 0 : ctx.type,
17
+ values: ctx == null ? void 0 : ctx.values,
18
+ classification: ctx == null ? void 0 : ctx.classification
19
+ }));
20
+ const sources = useClueEnrichSelector((ctx) => ctx.availableSources);
21
+ const enrich = useClueEnrichSelector((ctx) => ctx.bulkEnrich);
22
+ const [loading, setLoading] = useState(false);
23
+ const [selectedSources, setSelectedSources] = useState([]);
24
+ const fullValues = useMemo(
25
+ () => (values ?? []).map((value) => ({ value, type, classification })),
26
+ [classification, type, values]
27
+ );
28
+ const runEnrichment = useCallback(async () => {
29
+ if (loading) {
30
+ return;
31
+ }
32
+ try {
33
+ setLoading(true);
34
+ await enrich(
35
+ (values ?? []).map((value) => ({ type, value })),
36
+ { force: true, sources: selectedSources }
37
+ );
38
+ } catch (e) {
39
+ console.error(e);
40
+ safeDispatchEvent(
41
+ new CustomEvent(SNACKBAR_EVENT_ID, {
42
+ detail: {
43
+ message: e.toString(),
44
+ level: "error"
45
+ }
46
+ })
47
+ );
48
+ } finally {
49
+ setLoading(false);
50
+ }
51
+ }, [enrich, loading, selectedSources, type, values]);
52
+ return /* @__PURE__ */ jsx(Card, { sx: { p: 1 }, children: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
53
+ /* @__PURE__ */ jsx(
54
+ Box,
44
55
  {
45
- sx: (e) => ({
56
+ sx: (theme) => ({
46
57
  border: "thin solid",
47
58
  alignSelf: "stretch",
48
59
  display: "flex",
49
60
  alignItems: "center",
50
61
  px: 1,
51
62
  borderRadius: "5px",
52
- borderColor: e.palette.divider
63
+ borderColor: theme.palette.divider
53
64
  }),
54
- children: /* @__PURE__ */ m(E, { color: "text.secondary", children: [
55
- (o == null ? void 0 : o.length) ?? 0,
65
+ children: /* @__PURE__ */ jsxs(Typography, { color: "text.secondary", children: [
66
+ (values == null ? void 0 : values.length) ?? 0,
56
67
  " ",
57
- s("selected")
68
+ t("selected")
58
69
  ] })
59
70
  }
60
71
  ),
61
- /* @__PURE__ */ r(_, {}),
62
- /* @__PURE__ */ r(
63
- v,
72
+ /* @__PURE__ */ jsx(FlexOne, {}),
73
+ /* @__PURE__ */ jsx(
74
+ Autocomplete,
64
75
  {
65
76
  size: "small",
66
- multiple: !0,
67
- options: f,
77
+ multiple: true,
78
+ options: sources,
68
79
  sx: { minWidth: "400px" },
69
- renderInput: (e) => /* @__PURE__ */ r(x, { size: "small", placeholder: s("sources"), ...e }),
70
- value: l,
71
- onChange: (e, n) => h(n),
72
- disableCloseOnSelect: !0,
73
- getOptionLabel: (e) => e.split(/[_-]/).map((n) => F(n)).join(" ")
80
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, { size: "small", placeholder: t("sources"), ...params }),
81
+ value: selectedSources,
82
+ onChange: (__, value) => setSelectedSources(value),
83
+ disableCloseOnSelect: true,
84
+ getOptionLabel: (opt) => opt.split(/[_-]/).map((word) => capitalize(word)).join(" ")
74
85
  }
75
86
  ),
76
- /* @__PURE__ */ r(
77
- I,
87
+ /* @__PURE__ */ jsx(
88
+ Button,
78
89
  {
79
90
  variant: "outlined",
80
91
  color: "info",
81
- disabled: (o == null ? void 0 : o.length) < 1 || i,
82
- startIcon: i ? /* @__PURE__ */ r(z, { color: "info", size: "20px" }) : /* @__PURE__ */ r(k, { icon: "ic:outline-play-arrow" }),
92
+ disabled: (values == null ? void 0 : values.length) < 1 || loading,
93
+ startIcon: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "20px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-play-arrow" }),
83
94
  sx: { alignSelf: "stretch" },
84
- onClick: g,
85
- children: s("enrich")
95
+ onClick: runEnrichment,
96
+ children: t("enrich")
86
97
  }
87
98
  ),
88
- /* @__PURE__ */ r(G, { selectors: C, size: "medium", multiples: !0 })
99
+ /* @__PURE__ */ jsx(ExecutePopover, { selectors: fullValues, size: "medium", multiples: true })
89
100
  ] }) });
90
101
  };
91
102
  export {
92
- U as default
103
+ GroupControl as default
93
104
  };
@@ -1,60 +1,65 @@
1
- import { jsxs as s } from "react/jsx-runtime";
2
- import { Stack as C, Typography as r } from "@mui/material";
3
- import { ClueDatabaseContext as b } from "../../hooks/ClueDatabaseContext.js";
4
- import { useClueComponentSelector as y, useClueEnrichSelector as g } from "../../hooks/selectors.js";
5
- import { useContext as x, useState as u, useEffect as h } from "react";
6
- const P = () => {
7
- const { t: o } = y((t) => t.i18next), e = x(b), c = g((t) => t.ready), [i, m] = u(0), [a, d] = u(0), [l, f] = u(0);
8
- return h(() => {
9
- var p;
10
- if (!c)
11
- return;
12
- if ((p = e == null ? void 0 : e.status) != null && p.closed) {
13
- console.warn("Status collection is closed");
1
+ import { jsxs } from "react/jsx-runtime";
2
+ import { Stack, Typography } from "@mui/material";
3
+ import { ClueDatabaseContext } from "../../hooks/ClueDatabaseContext.js";
4
+ import { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
5
+ import { useContext, useState, useEffect } from "react";
6
+ const QueryStatus = () => {
7
+ const { t } = useClueComponentSelector((ctx) => ctx.i18next);
8
+ const database = useContext(ClueDatabaseContext);
9
+ const ready = useClueEnrichSelector((ctx) => ctx.ready);
10
+ const [pendingCount, setPendingCount] = useState(0);
11
+ const [inProgressCount, setInProgressCount] = useState(0);
12
+ const [completeCount, setCompleteCount] = useState(0);
13
+ useEffect(() => {
14
+ if (!ready) {
14
15
  return;
15
16
  }
16
- const t = [
17
- e.status.count({ selector: { status: "pending" } }).$.subscribe(m),
18
- e.status.count({ selector: { status: "in-progress" } }).$.subscribe(d),
19
- e.status.count({ selector: { status: "complete" } }).$.subscribe(f)
17
+ const observables = [
18
+ database.status.count({ selector: { status: "pending" } }).$.subscribe(setPendingCount),
19
+ database.status.count({ selector: { status: "in-progress" } }).$.subscribe(setInProgressCount),
20
+ database.status.count({ selector: { status: "complete" } }).$.subscribe(setCompleteCount)
20
21
  ];
21
22
  return () => {
22
23
  try {
23
- t.forEach((n) => n.unsubscribe());
24
- } catch (n) {
25
- console.warn(n);
24
+ observables.forEach((_observable) => _observable.unsubscribe());
25
+ } catch (e) {
26
+ console.warn(e);
26
27
  }
27
28
  };
28
- }, [e, c]), i + a + l < 1 ? null : /* @__PURE__ */ s(
29
- C,
29
+ }, [database, ready]);
30
+ if (pendingCount + inProgressCount + completeCount < 1) {
31
+ return null;
32
+ }
33
+ return /* @__PURE__ */ jsxs(
34
+ Stack,
30
35
  {
31
36
  spacing: 1,
32
- sx: (t) => ({
33
- border: `thin solid ${t.palette.divider}`,
34
- borderRadius: t.spacing(0.5),
37
+ sx: (theme) => ({
38
+ border: `thin solid ${theme.palette.divider}`,
39
+ borderRadius: theme.spacing(0.5),
35
40
  mx: 1,
36
41
  p: 1
37
42
  }),
38
43
  children: [
39
- /* @__PURE__ */ s(r, { sx: { fontFamily: "monospace" }, children: [
40
- o("query.status.pending"),
44
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontFamily: "monospace" }, children: [
45
+ t("query.status.pending"),
41
46
  ": ",
42
- i
47
+ pendingCount
43
48
  ] }),
44
- /* @__PURE__ */ s(r, { sx: { fontFamily: "monospace" }, children: [
45
- o("query.status.inprogress"),
49
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontFamily: "monospace" }, children: [
50
+ t("query.status.inprogress"),
46
51
  ": ",
47
- a
52
+ inProgressCount
48
53
  ] }),
49
- /* @__PURE__ */ s(r, { sx: { fontFamily: "monospace" }, children: [
50
- o("query.status.complete"),
54
+ /* @__PURE__ */ jsxs(Typography, { sx: { fontFamily: "monospace" }, children: [
55
+ t("query.status.complete"),
51
56
  ": ",
52
- l
57
+ completeCount
53
58
  ] })
54
59
  ]
55
60
  }
56
61
  );
57
62
  };
58
63
  export {
59
- P as default
64
+ QueryStatus as default
60
65
  };
@@ -0,0 +1,14 @@
1
+ import { b as baseAssignValue } from "./_baseAssignValue-CNbcU6Nb.js";
2
+ import { c as createAggregator } from "./_createAggregator-BpVy5xMi.js";
3
+ var objectProto = Object.prototype;
4
+ var hasOwnProperty = objectProto.hasOwnProperty;
5
+ var countBy = createAggregator(function(result, value, key) {
6
+ if (hasOwnProperty.call(result, key)) {
7
+ ++result[key];
8
+ } else {
9
+ baseAssignValue(result, key, 1);
10
+ }
11
+ });
12
+ export {
13
+ countBy as c
14
+ };
package/data/event.js CHANGED
@@ -1,6 +1,8 @@
1
- const o = "snackbar.message", s = "clue.showPopup", E = "clue.hidePopup";
1
+ const SNACKBAR_EVENT_ID = "snackbar.message";
2
+ const SHOW_EVENT_ID = "clue.showPopup";
3
+ const HIDE_EVENT_ID = "clue.hidePopup";
2
4
  export {
3
- E as HIDE_EVENT_ID,
4
- s as SHOW_EVENT_ID,
5
- o as SNACKBAR_EVENT_ID
5
+ HIDE_EVENT_ID,
6
+ SHOW_EVENT_ID,
7
+ SNACKBAR_EVENT_ID
6
8
  };
package/database/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as f } from "../index-BXxfAxFt.js";
1
+ import { b } from "../index-CC12Ux-9.js";
2
2
  export {
3
- f as default
3
+ b as default
4
4
  };
@@ -0,0 +1,92 @@
1
+ import { i as isObject } from "./isObject-FTY-5JQX.js";
2
+ import { r as root } from "./isObjectLike-OAgjjZye.js";
3
+ import { t as toNumber } from "./toNumber-DPxy1FBy.js";
4
+ var now = function() {
5
+ return root.Date.now();
6
+ };
7
+ var FUNC_ERROR_TEXT = "Expected a function";
8
+ var nativeMax = Math.max, nativeMin = Math.min;
9
+ function debounce(func, wait, options) {
10
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
11
+ if (typeof func != "function") {
12
+ throw new TypeError(FUNC_ERROR_TEXT);
13
+ }
14
+ wait = toNumber(wait) || 0;
15
+ if (isObject(options)) {
16
+ leading = !!options.leading;
17
+ maxing = "maxWait" in options;
18
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
19
+ trailing = "trailing" in options ? !!options.trailing : trailing;
20
+ }
21
+ function invokeFunc(time) {
22
+ var args = lastArgs, thisArg = lastThis;
23
+ lastArgs = lastThis = void 0;
24
+ lastInvokeTime = time;
25
+ result = func.apply(thisArg, args);
26
+ return result;
27
+ }
28
+ function leadingEdge(time) {
29
+ lastInvokeTime = time;
30
+ timerId = setTimeout(timerExpired, wait);
31
+ return leading ? invokeFunc(time) : result;
32
+ }
33
+ function remainingWait(time) {
34
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
35
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
36
+ }
37
+ function shouldInvoke(time) {
38
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
39
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
40
+ }
41
+ function timerExpired() {
42
+ var time = now();
43
+ if (shouldInvoke(time)) {
44
+ return trailingEdge(time);
45
+ }
46
+ timerId = setTimeout(timerExpired, remainingWait(time));
47
+ }
48
+ function trailingEdge(time) {
49
+ timerId = void 0;
50
+ if (trailing && lastArgs) {
51
+ return invokeFunc(time);
52
+ }
53
+ lastArgs = lastThis = void 0;
54
+ return result;
55
+ }
56
+ function cancel() {
57
+ if (timerId !== void 0) {
58
+ clearTimeout(timerId);
59
+ }
60
+ lastInvokeTime = 0;
61
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
62
+ }
63
+ function flush() {
64
+ return timerId === void 0 ? result : trailingEdge(now());
65
+ }
66
+ function debounced() {
67
+ var time = now(), isInvoking = shouldInvoke(time);
68
+ lastArgs = arguments;
69
+ lastThis = this;
70
+ lastCallTime = time;
71
+ if (isInvoking) {
72
+ if (timerId === void 0) {
73
+ return leadingEdge(lastCallTime);
74
+ }
75
+ if (maxing) {
76
+ clearTimeout(timerId);
77
+ timerId = setTimeout(timerExpired, wait);
78
+ return invokeFunc(lastCallTime);
79
+ }
80
+ }
81
+ if (timerId === void 0) {
82
+ timerId = setTimeout(timerExpired, wait);
83
+ }
84
+ return result;
85
+ }
86
+ debounced.cancel = cancel;
87
+ debounced.flush = flush;
88
+ return debounced;
89
+ }
90
+ export {
91
+ debounce as d
92
+ };
@@ -0,0 +1,8 @@
1
+ import { b as baseGet } from "./_baseGet-BSK_nnoz.js";
2
+ function get(object, path, defaultValue) {
3
+ var result = object == null ? void 0 : baseGet(object, path);
4
+ return result === void 0 ? defaultValue : result;
5
+ }
6
+ export {
7
+ get as g
8
+ };
@@ -0,0 +1,14 @@
1
+ import { b as baseAssignValue } from "./_baseAssignValue-CNbcU6Nb.js";
2
+ import { c as createAggregator } from "./_createAggregator-BpVy5xMi.js";
3
+ var objectProto = Object.prototype;
4
+ var hasOwnProperty = objectProto.hasOwnProperty;
5
+ var groupBy = createAggregator(function(result, value, key) {
6
+ if (hasOwnProperty.call(result, key)) {
7
+ result[key].push(value);
8
+ } else {
9
+ baseAssignValue(result, key, [value]);
10
+ }
11
+ });
12
+ export {
13
+ groupBy as g
14
+ };
@@ -1,19 +1,19 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@mui/material";
3
- import "../index-BXxfAxFt.js";
4
- import "../useClueTypeConfig-DyeBcXQX.js";
5
- import { a as d, C as f } from "../ActionForm-myEAs2UC.js";
3
+ import "../index-CC12Ux-9.js";
4
+ import "../useClueTypeConfig-XvGvIw2S.js";
5
+ import { a, C } from "../ActionForm-ByeOzpc4.js";
6
6
  import "../components/display/icons/Iconified.js";
7
7
  import "../components/ErrorBoundary.js";
8
8
  import "../data/event.js";
9
9
  import "../utils/time.js";
10
10
  import "../utils/window.js";
11
11
  import "react";
12
- import "../index-E7g8cRyW.js";
12
+ import "../index-BDVjGvMI.js";
13
13
  import "./ClueComponentContext.js";
14
14
  import "./useClue.js";
15
- import "../isNil-CjWwlQS3.js";
15
+ import "../isNil-CIubwp4T.js";
16
16
  export {
17
- d as ClueActionContext,
18
- f as ClueActionProvider
17
+ a as ClueActionContext,
18
+ C as ClueActionProvider
19
19
  };
@@ -1,34 +1,40 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useMemo as m } from "react";
3
- import { useTranslation as l } from "react-i18next";
4
- import { c as i } from "../index-E7g8cRyW.js";
5
- const u = i(null), p = ({
6
- children: t,
7
- ReactJson: o
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useTranslation } from "react-i18next";
4
+ import { c as createContext } from "../index-BDVjGvMI.js";
5
+ const ClueComponentContext = createContext(null);
6
+ const ClueComponentI18nProvider = ({
7
+ children,
8
+ ReactJson
8
9
  }) => {
9
- const r = l(), e = m(
10
+ const i18next = useTranslation();
11
+ const context = useMemo(
10
12
  () => ({
11
- ReactJson: o,
12
- i18next: r
13
+ ReactJson,
14
+ i18next
13
15
  }),
14
- [o, r]
16
+ [ReactJson, i18next]
15
17
  );
16
- return /* @__PURE__ */ n(u.Provider, { value: e, children: t });
17
- }, f = ({
18
- children: t,
19
- ReactJson: o,
20
- i18next: r = null
18
+ return /* @__PURE__ */ jsx(ClueComponentContext.Provider, { value: context, children });
19
+ };
20
+ const ClueComponentProvider = ({
21
+ children,
22
+ ReactJson,
23
+ i18next = null
21
24
  }) => {
22
- const e = m(
25
+ const context = useMemo(
23
26
  () => ({
24
- ReactJson: o,
25
- i18next: r
27
+ ReactJson,
28
+ i18next
26
29
  }),
27
- [o, r]
30
+ [ReactJson, i18next]
28
31
  );
29
- return r ? /* @__PURE__ */ n(u.Provider, { value: e, children: t }) : /* @__PURE__ */ n(p, { ReactJson: o, children: t });
32
+ if (!i18next) {
33
+ return /* @__PURE__ */ jsx(ClueComponentI18nProvider, { ReactJson, children });
34
+ }
35
+ return /* @__PURE__ */ jsx(ClueComponentContext.Provider, { value: context, children });
30
36
  };
31
37
  export {
32
- u as ClueComponentContext,
33
- f as ClueComponentProvider
38
+ ClueComponentContext,
39
+ ClueComponentProvider
34
40
  };
@@ -1,21 +1,23 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createContext as c, useState as u, useMemo as f } from "react";
3
- const l = c(null), g = ({ children: t, config: e }) => {
4
- const [o, n] = u(
5
- e ?? {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { createContext, useState, useMemo } from "react";
3
+ const ClueConfigContext = createContext(null);
4
+ const ClueConfigProvider = ({ children, config: _config }) => {
5
+ const [config, setConfig] = useState(
6
+ _config ?? {
6
7
  configuration: null,
7
8
  c12nDef: null
8
9
  }
9
- ), r = f(
10
+ );
11
+ const context = useMemo(
10
12
  () => ({
11
- config: o,
12
- setConfig: n
13
+ config,
14
+ setConfig
13
15
  }),
14
- [o, n]
16
+ [config, setConfig]
15
17
  );
16
- return /* @__PURE__ */ i(l.Provider, { value: r, children: t });
18
+ return /* @__PURE__ */ jsx(ClueConfigContext.Provider, { value: context, children });
17
19
  };
18
20
  export {
19
- l as ClueConfigContext,
20
- g as ClueConfigProvider
21
+ ClueConfigContext,
22
+ ClueConfigProvider
21
23
  };
@@ -1,17 +1,23 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { b as u } from "../index-BXxfAxFt.js";
3
- import { createContext as l, useState as n, useEffect as i } from "react";
4
- const m = l(null), p = ({
5
- children: a,
6
- database: e,
7
- databaseConfig: t
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { b as buildDatabase } from "../index-CC12Ux-9.js";
3
+ import { createContext, useState, useEffect } from "react";
4
+ const ClueDatabaseContext = createContext(null);
5
+ const ClueDatabaseProvider = ({
6
+ children,
7
+ database: _database,
8
+ databaseConfig
8
9
  }) => {
9
- const [o, r] = n();
10
- return i(() => {
11
- e ? r(e) : u(t).then(r);
12
- }, [e, t]), /* @__PURE__ */ s(m.Provider, { value: o, children: a });
10
+ const [database, setDatabase] = useState();
11
+ useEffect(() => {
12
+ if (_database) {
13
+ setDatabase(_database);
14
+ } else {
15
+ buildDatabase(databaseConfig).then(setDatabase);
16
+ }
17
+ }, [_database, databaseConfig]);
18
+ return /* @__PURE__ */ jsx(ClueDatabaseContext.Provider, { value: database, children });
13
19
  };
14
20
  export {
15
- m as ClueDatabaseContext,
16
- p as ClueDatabaseProvider
21
+ ClueDatabaseContext,
22
+ ClueDatabaseProvider
17
23
  };
@@ -1,15 +1,15 @@
1
1
  import "react/jsx-runtime";
2
- import "../iconify-BBckr5AQ.js";
3
- import "../useClueTypeConfig-DyeBcXQX.js";
2
+ import "../iconify-CXMreGTg.js";
3
+ import "../useClueTypeConfig-XvGvIw2S.js";
4
4
  import "../utils/loggerUtil.js";
5
- import { C as l, a as s } from "../ClueEnrichContext-DJNjbXu_.js";
6
- import "../debounce-DryYcbJ4.js";
7
- import "../groupBy-BheQYl6f.js";
5
+ import { C, a } from "../ClueEnrichContext-6NJfXpUB.js";
6
+ import "../debounce-bV0h5FC5.js";
7
+ import "../groupBy-DC2oOuBN.js";
8
8
  import "react";
9
- import "../index-E7g8cRyW.js";
9
+ import "../index-BDVjGvMI.js";
10
10
  import "./ClueDatabaseContext.js";
11
11
  import "./useClueConfig.js";
12
12
  export {
13
- l as ClueEnrichContext,
14
- s as ClueEnrichProvider
13
+ C as ClueEnrichContext,
14
+ a as ClueEnrichProvider
15
15
  };