@cccsaurora/clue-ui 0.15.0-dev.28 → 0.15.0-dev.30

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 (257) hide show
  1. package/ActionForm-DgfJwTzt.js +436 -0
  2. package/AnnotationPreview-BvNpZOP0.js +188 -0
  3. package/ClueEnrichContext-DXwLVp0M.js +518 -0
  4. package/FlexOne-BSYAhhtG.js +9 -0
  5. package/_Map-kgDsDYxq.js +64 -0
  6. package/_MapCache-DabaaWfq.js +161 -0
  7. package/_Uint8Array-BlVVH1tp.js +129 -0
  8. package/_baseAssignValue-CNbcU6Nb.js +25 -0
  9. package/_baseClone-D3a8Pa4T.js +284 -0
  10. package/_baseExtremum-B1o1zHjR.js +33 -0
  11. package/_baseFlatten-D4huXoEI.js +92 -0
  12. package/_baseGet-BSK_nnoz.js +109 -0
  13. package/_baseIsEqual-B5xLoweL.js +238 -0
  14. package/_baseIteratee-p6Nj07-n.js +126 -0
  15. package/_baseSlice-GAv_YFTT.js +20 -0
  16. package/_baseSum-D0WC1dN0.js +13 -0
  17. package/_baseUniq-CpupKWcL.js +89 -0
  18. package/_commonjsHelpers-CUmg6egw.js +6 -0
  19. package/_createAggregator-BpVy5xMi.js +63 -0
  20. package/_getPrototype-D1LAdQKO.js +5 -0
  21. package/_getTag-D3ToyefI.js +126 -0
  22. package/api/lookup/enrich.d.ts +10 -0
  23. package/api/lookup/index.d.ts +5 -0
  24. package/api/lookup/types.d.ts +5 -0
  25. package/api/lookup/types_detection.d.ts +5 -0
  26. package/cloneDeep-CjP5k9zW.js +8 -0
  27. package/components/AnnotationBody.d.ts +6 -0
  28. package/components/AnnotationBody.js +56 -0
  29. package/components/AnnotationDetailPopover.d.ts +14 -0
  30. package/components/AnnotationDetailPopover.js +61 -0
  31. package/components/AnnotationDetails.d.ts +8 -0
  32. package/components/AnnotationDetails.js +172 -0
  33. package/components/AnnotationEntry.d.ts +6 -0
  34. package/components/AnnotationEntry.js +59 -0
  35. package/components/AnnotationPreview.d.ts +14 -0
  36. package/components/AnnotationPreview.js +11 -0
  37. package/components/ClassificationChip.d.ts +11 -0
  38. package/components/ClassificationChip.js +52 -0
  39. package/components/CountBadge.d.ts +8 -0
  40. package/components/CountBadge.js +34 -0
  41. package/components/EnrichedCard.d.ts +14 -0
  42. package/components/EnrichedCard.js +162 -0
  43. package/components/EnrichedChip.d.ts +9 -0
  44. package/components/EnrichedChip.js +176 -0
  45. package/components/EnrichedTypography.d.ts +16 -0
  46. package/components/EnrichedTypography.js +178 -0
  47. package/components/ErrorBoundary.d.ts +15 -0
  48. package/components/ErrorBoundary.js +36 -0
  49. package/components/RetryFailedEnrichments.d.ts +2 -0
  50. package/components/RetryFailedEnrichments.js +13 -0
  51. package/components/SourcePicker.d.ts +2 -0
  52. package/components/SourcePicker.js +98 -0
  53. package/components/actions/ActionForm.d.ts +6 -0
  54. package/components/actions/ActionForm.js +16 -0
  55. package/components/actions/ExecutePopover.d.ts +10 -0
  56. package/components/actions/ExecutePopover.js +93 -0
  57. package/components/actions/ResultModal.d.ts +9 -0
  58. package/components/actions/ResultModal.js +46 -0
  59. package/components/actions/form/schemaAdapter.d.ts +3 -0
  60. package/components/actions/form/schemaAdapter.js +47 -0
  61. package/components/display/graph/ExpandMoreButton.d.ts +7 -0
  62. package/components/display/graph/ExpandMoreButton.js +18 -0
  63. package/components/display/graph/elements/NodeCard.d.ts +10 -0
  64. package/components/display/graph/elements/NodeCard.js +146 -0
  65. package/components/display/graph/elements/NodeTag.d.ts +9 -0
  66. package/components/display/graph/elements/NodeTag.js +17 -0
  67. package/components/display/graph/index.d.ts +9 -0
  68. package/components/display/graph/index.js +438 -0
  69. package/components/display/graph/visualizations/Leaf.d.ts +25 -0
  70. package/components/display/graph/visualizations/Leaf.js +125 -0
  71. package/components/display/graph/visualizations/cloud/index.d.ts +24 -0
  72. package/components/display/graph/visualizations/cloud/index.js +141 -0
  73. package/components/display/graph/visualizations/icons/BaseIcon.d.ts +12 -0
  74. package/components/display/graph/visualizations/icons/BaseIcon.js +37 -0
  75. package/components/display/graph/visualizations/icons/BugIcon.d.ts +5 -0
  76. package/components/display/graph/visualizations/icons/BugIcon.js +18 -0
  77. package/components/display/graph/visualizations/icons/HostIcon.d.ts +5 -0
  78. package/components/display/graph/visualizations/icons/HostIcon.js +24 -0
  79. package/components/display/graph/visualizations/icons/NetworkIcon.d.ts +5 -0
  80. package/components/display/graph/visualizations/icons/NetworkIcon.js +24 -0
  81. package/components/display/graph/visualizations/icons/ProcessIcon.d.ts +5 -0
  82. package/components/display/graph/visualizations/icons/ProcessIcon.js +18 -0
  83. package/components/display/graph/visualizations/icons/TargetIcon.d.ts +5 -0
  84. package/components/display/graph/visualizations/icons/TargetIcon.js +19 -0
  85. package/components/display/graph/visualizations/icons/index.d.ts +2 -0
  86. package/components/display/graph/visualizations/icons/index.js +16 -0
  87. package/components/display/graph/visualizations/panels/NodePanel.d.ts +8 -0
  88. package/components/display/graph/visualizations/panels/NodePanel.js +12 -0
  89. package/components/display/graph/visualizations/tree/BundleLine.d.ts +29 -0
  90. package/components/display/graph/visualizations/tree/BundleLine.js +121 -0
  91. package/components/display/graph/visualizations/tree/Triangle.d.ts +9 -0
  92. package/components/display/graph/visualizations/tree/Triangle.js +26 -0
  93. package/components/display/graph/visualizations/tree/index.d.ts +36 -0
  94. package/components/display/graph/visualizations/tree/index.js +485 -0
  95. package/components/display/graph/visualizations/tree/types.d.ts +11 -0
  96. package/components/display/graph/visualizations/tree/types.js +1 -0
  97. package/components/display/icons/Iconified.d.ts +9 -0
  98. package/components/display/icons/Iconified.js +29 -0
  99. package/components/display/json/index.d.ts +14 -0
  100. package/components/display/json/index.js +12 -0
  101. package/components/display/markdown/DynamicTabs.d.ts +8 -0
  102. package/components/display/markdown/DynamicTabs.js +26 -0
  103. package/components/display/markdown/index.d.ts +9 -0
  104. package/components/display/markdown/index.js +13389 -0
  105. package/components/display/markdown/markdownPlugins/tabs.d.ts +3 -0
  106. package/components/display/markdown/markdownPlugins/tabs.js +4 -0
  107. package/components/enrichment/EnrichPopover.d.ts +10 -0
  108. package/components/enrichment/EnrichPopover.js +88 -0
  109. package/components/fetchers/Fetcher.d.ts +17 -0
  110. package/components/fetchers/Fetcher.js +188 -0
  111. package/components/fetchers/PreviewModal.d.ts +8 -0
  112. package/components/fetchers/PreviewModal.js +22 -0
  113. package/components/fetchers/StatusChip.d.ts +8 -0
  114. package/components/fetchers/StatusChip.js +30 -0
  115. package/components/group/Entry.d.ts +8 -0
  116. package/components/group/Entry.js +15 -0
  117. package/components/group/Group.d.ts +12 -0
  118. package/components/group/Group.js +15 -0
  119. package/components/group/GroupControl.d.ts +4 -0
  120. package/components/group/GroupControl.js +103 -0
  121. package/components/stats/QueryStatus.d.ts +4 -0
  122. package/components/stats/QueryStatus.js +61 -0
  123. package/countBy-C69WslUA.js +14 -0
  124. package/data/event.d.ts +12 -0
  125. package/data/event.js +8 -0
  126. package/database/index.d.ts +4 -0
  127. package/database/index.js +4 -0
  128. package/database/selector.schema.json.d.ts +119 -0
  129. package/database/status.schema.json.d.ts +38 -0
  130. package/database/types.d.ts +64 -0
  131. package/debounce-bV0h5FC5.js +92 -0
  132. package/en/translation.json +135 -0
  133. package/fr/translation.json +135 -0
  134. package/get-D3C3lEU3.js +8 -0
  135. package/groupBy-DC2oOuBN.js +14 -0
  136. package/hooks/ClueActionContext.d.ts +86 -0
  137. package/hooks/ClueActionContext.js +18 -0
  138. package/hooks/ClueComponentContext.d.ts +10 -0
  139. package/hooks/ClueComponentContext.js +40 -0
  140. package/hooks/ClueConfigProvider.d.ts +12 -0
  141. package/hooks/ClueConfigProvider.js +23 -0
  142. package/hooks/ClueDatabaseContext.d.ts +10 -0
  143. package/hooks/ClueDatabaseContext.js +23 -0
  144. package/hooks/ClueEnrichContext.d.ts +6 -0
  145. package/hooks/ClueEnrichContext.js +15 -0
  146. package/hooks/ClueEnrichContextType.d.ts +113 -0
  147. package/hooks/ClueEnrichProps.d.ts +81 -0
  148. package/hooks/ClueFetcherContext.d.ts +35 -0
  149. package/hooks/ClueFetcherContext.js +88 -0
  150. package/hooks/ClueGroupContext.d.ts +14 -0
  151. package/hooks/ClueGroupContext.js +23 -0
  152. package/hooks/CluePopupContext.d.ts +24 -0
  153. package/hooks/CluePopupContext.js +12 -0
  154. package/hooks/ClueProvider.d.ts +9 -0
  155. package/hooks/ClueProvider.js +14 -0
  156. package/hooks/selectors.d.ts +10 -0
  157. package/hooks/selectors.js +24 -0
  158. package/hooks/useAnnotations.d.ts +24 -0
  159. package/hooks/useAnnotations.js +69 -0
  160. package/hooks/useClue.d.ts +4 -0
  161. package/hooks/useClue.js +8 -0
  162. package/hooks/useClueActions.d.ts +4 -0
  163. package/hooks/useClueActions.js +5 -0
  164. package/hooks/useClueConfig.d.ts +1 -0
  165. package/hooks/useClueConfig.js +8 -0
  166. package/hooks/useClueTypeConfig.d.ts +17 -0
  167. package/hooks/useClueTypeConfig.js +7 -0
  168. package/hooks/useComparator.d.ts +16 -0
  169. package/hooks/useComparator.js +1060 -0
  170. package/hooks/useErrors.d.ts +17 -0
  171. package/hooks/useErrors.js +35 -0
  172. package/hooks/useMyHighlights.d.ts +11 -0
  173. package/hooks/useMyHighlights.js +74 -0
  174. package/hooks/useMyLocalStorage.d.ts +16 -0
  175. package/hooks/useMyLocalStorage.js +80 -0
  176. package/iconify-CXMreGTg.js +1782 -0
  177. package/icons/Action.d.ts +9 -0
  178. package/icons/Action.js +90 -0
  179. package/icons/Assessment.d.ts +11 -0
  180. package/icons/Assessment.js +123 -0
  181. package/icons/Context.d.ts +12 -0
  182. package/icons/Context.js +83 -0
  183. package/icons/Opinion.d.ts +11 -0
  184. package/icons/Opinion.js +125 -0
  185. package/icons/iconMap.d.ts +7 -0
  186. package/icons/iconMap.js +10 -0
  187. package/identity-CPGTqrE4.js +6 -0
  188. package/index-BDVjGvMI.js +696 -0
  189. package/index-BDrtH5ec.js +465 -0
  190. package/index-C9lySIVX.js +1172 -0
  191. package/index-DJYqRcxJ.js +15750 -0
  192. package/index-Dn2NHyXg.js +17654 -0
  193. package/index.css +21 -0
  194. package/isEmpty-BQkZubqU.js +29 -0
  195. package/isNil-CIubwp4T.js +6 -0
  196. package/isObject-FTY-5JQX.js +7 -0
  197. package/isObjectLike-OAgjjZye.js +48 -0
  198. package/isSymbol-Xd2FsJyp.js +8 -0
  199. package/isUndefined-CE8h73dH.js +10 -0
  200. package/last-CUCl67Im.js +7 -0
  201. package/main.d.ts +42 -0
  202. package/main.js +70 -0
  203. package/package.json +40 -40
  204. package/public/manifest.json +16 -0
  205. package/public/robots.txt +3 -0
  206. package/public/svg/dark/clue-h.svg +52 -0
  207. package/public/svg/dark/clue-icon1-simple.svg +33 -0
  208. package/public/svg/dark/clue-icon1.svg +44 -0
  209. package/public/svg/dark/clue-icon2-simple.svg +26 -0
  210. package/public/svg/dark/clue-icon2.svg +37 -0
  211. package/public/svg/dark/clue-name.svg +14 -0
  212. package/public/svg/dark/clue-v.svg +52 -0
  213. package/public/svg/light/clue-h.svg +60 -0
  214. package/public/svg/light/clue-icon1-simple.svg +37 -0
  215. package/public/svg/light/clue-icon1.svg +48 -0
  216. package/public/svg/light/clue-icon2-simple.svg +30 -0
  217. package/public/svg/light/clue-icon2.svg +41 -0
  218. package/public/svg/light/clue-name.svg +14 -0
  219. package/public/svg/light/clue-v.svg +60 -0
  220. package/sortBy-B-UKp4GT.js +100 -0
  221. package/sumBy-MYkDPHZL.js +8 -0
  222. package/tabs-xGuUGsJd.js +254 -0
  223. package/text/Frequency.d.ts +9 -0
  224. package/text/Frequency.js +49 -0
  225. package/toFinite-CArjry_l.js +16 -0
  226. package/toNumber-DPxy1FBy.js +39 -0
  227. package/types/EnrichmentProps.d.ts +73 -0
  228. package/types/RunningActionData.d.ts +15 -0
  229. package/types/WithActionData.d.ts +9 -0
  230. package/types/action.d.ts +25 -0
  231. package/types/config.d.ts +16 -0
  232. package/types/fetcher.d.ts +60 -0
  233. package/types/graph.d.ts +101 -0
  234. package/types/lookup.d.ts +62 -0
  235. package/types/network.d.ts +9 -0
  236. package/useClueTypeConfig-D9ZSxa4F.js +3096 -0
  237. package/utils/chain.d.ts +14 -0
  238. package/utils/chain.js +106 -0
  239. package/utils/classificationParser.d.ts +195 -0
  240. package/utils/classificationParser.js +553 -0
  241. package/utils/constants.d.ts +26 -0
  242. package/utils/constants.js +36 -0
  243. package/utils/graph.d.ts +13 -0
  244. package/utils/graph.js +79 -0
  245. package/utils/hashUtil.d.ts +6 -0
  246. package/utils/hashUtil.js +11 -0
  247. package/utils/line.d.ts +28 -0
  248. package/utils/line.js +136 -0
  249. package/utils/loggerUtil.d.ts +6 -0
  250. package/utils/loggerUtil.js +8 -0
  251. package/utils/sessionStorage.d.ts +9 -0
  252. package/utils/sessionStorage.js +51 -0
  253. package/utils/utils.d.ts +13 -0
  254. package/utils/utils.js +11 -0
  255. package/utils/window.d.ts +3 -0
  256. package/utils/window.js +24 -0
  257. package/utils-CxIhC2xH.js +4182 -0
@@ -0,0 +1,141 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { o as ordinal, d as d3, S as Spectral, a as index, h as hierarchy } from "../../../../../index-DJYqRcxJ.js";
3
+ import useMyHighlights from "../../../../../hooks/useMyHighlights.js";
4
+ import { useMyLocalStorageItem } from "../../../../../hooks/useMyLocalStorage.js";
5
+ import { StorageKey } from "../../../../../utils/constants.js";
6
+ import { cyrb53 } from "../../../../../utils/graph.js";
7
+ import { c as countBy } from "../../../../../countBy-C69WslUA.js";
8
+ import { s as sumBy } from "../../../../../sumBy-MYkDPHZL.js";
9
+ import { memo, useRef, useMemo, useCallback } from "react";
10
+ import Leaf from "../Leaf.js";
11
+ const DEFAULT_OPTIONS = {
12
+ width: "100%",
13
+ backgroundColor: "grey",
14
+ textColor: "black",
15
+ nodeColor: {
16
+ border: "black",
17
+ center: "white"
18
+ },
19
+ letterSize: 12,
20
+ letterWidth: 8,
21
+ nodeRadius: 8,
22
+ lineWidth: 2,
23
+ circlePadding: null
24
+ // We'll make this dynamic
25
+ };
26
+ DEFAULT_OPTIONS.circlePadding = 3 * DEFAULT_OPTIONS.nodeRadius;
27
+ const Cloud = ({ svgRef, graph, options = {} }) => {
28
+ const {
29
+ width,
30
+ backgroundColor,
31
+ textColor,
32
+ letterSize,
33
+ letterWidth,
34
+ circlePadding,
35
+ nodeRadius,
36
+ nodeColor,
37
+ lineWidth
38
+ } = {
39
+ ...DEFAULT_OPTIONS,
40
+ ...options
41
+ };
42
+ const { onNodeHoveredChanged, onNodeClicked, nodeOpacities, highlightedPath } = useMyHighlights(graph);
43
+ const [colorScheme] = useMyLocalStorageItem(StorageKey.COLOR_SCHEME, "Spectral");
44
+ const currentX = useRef(2 * nodeRadius);
45
+ const currentY = useRef(letterSize + nodeRadius);
46
+ const nodeLocations = useRef({});
47
+ const nodes = useMemo(
48
+ () => graph.data.flatMap(
49
+ (cloud, cloudIndex) => cloud.map((node) => ({
50
+ ...node,
51
+ cloud: cloudIndex.toString()
52
+ }))
53
+ ),
54
+ [graph.data]
55
+ );
56
+ const clouds = useMemo(() => countBy(nodes, (node) => node.cloud), [nodes]);
57
+ const colors = useMemo(
58
+ () => ordinal(
59
+ Object.keys(clouds).map((cloud) => (d3[`interpolate${colorScheme}`] ?? Spectral)(cyrb53(cloud)))
60
+ ),
61
+ [clouds, colorScheme]
62
+ );
63
+ const links = useMemo(
64
+ () => nodes.flatMap(
65
+ (node) => ((node == null ? void 0 : node.edges) ?? []).map((parent) => ({
66
+ source: node.id,
67
+ target: parent
68
+ }))
69
+ ),
70
+ [nodes]
71
+ );
72
+ const pack = useMemo(() => index().size([600, 600]).padding(circlePadding), [circlePadding]);
73
+ const cloudLocations = useMemo(() => {
74
+ const data = Object.entries(clouds).map(([id]) => ({
75
+ id,
76
+ children: nodes.filter((node) => node.cloud === id).map((node) => ({
77
+ ...node,
78
+ value: 1
79
+ }))
80
+ }));
81
+ return pack(
82
+ hierarchy({ children: data }).sum((d) => d.children ? sumBy(d.children, (c) => c.value) : d.value)
83
+ ).children;
84
+ }, [clouds, nodes, pack]);
85
+ const opacities = useCallback(
86
+ (link) => highlightedPath.size === 0 || highlightedPath.has(link.source) && highlightedPath.has(link.target) ? 1 : 0.2,
87
+ [highlightedPath]
88
+ );
89
+ currentX.current = 2 * nodeRadius;
90
+ currentY.current = letterSize + nodeRadius;
91
+ nodeLocations.current = {};
92
+ return /* @__PURE__ */ jsx("svg", { id: "viz", ref: svgRef, width, height: 600, style: { backgroundColor }, children: /* @__PURE__ */ jsxs("g", { id: "view", children: [
93
+ cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("circle", { cx: cloud.x, cy: cloud.y, r: cloud.r, strokeWidth: 4, stroke: colors(cloud.data.id), fill: "none" }) }, cloud.data.id)),
94
+ links.map((link) => {
95
+ const source = cloudLocations.flatMap((c) => c.children).find((node) => node.data.id === link.source);
96
+ const target = cloudLocations.flatMap((c) => c.children).find((node) => node.data.id === link.target);
97
+ return /* @__PURE__ */ jsxs("g", { children: [
98
+ /* @__PURE__ */ jsx(
99
+ "path",
100
+ {
101
+ d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
102
+ stroke: "black",
103
+ strokeWidth: lineWidth + 3,
104
+ strokeOpacity: opacities(link)
105
+ }
106
+ ),
107
+ /* @__PURE__ */ jsx(
108
+ "path",
109
+ {
110
+ d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
111
+ stroke: "white",
112
+ strokeWidth: lineWidth,
113
+ strokeOpacity: opacities(link)
114
+ }
115
+ )
116
+ ] }, source.data.id + target.data.id);
117
+ }),
118
+ cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: cloud.children.map((node) => /* @__PURE__ */ jsx(
119
+ Leaf,
120
+ {
121
+ nodeId: node.data.id,
122
+ height: 0,
123
+ x: node.x,
124
+ y: node.y,
125
+ nodeRadius,
126
+ nodeColor,
127
+ nodeOpacity: nodeOpacities(node.data.id),
128
+ letterSize,
129
+ letterWidth,
130
+ textColor,
131
+ onHoverChanged: onNodeHoveredChanged,
132
+ onClick: onNodeClicked
133
+ },
134
+ node.data.id
135
+ )) }, cloud.id))
136
+ ] }) });
137
+ };
138
+ const Cloud$1 = memo(Cloud);
139
+ export {
140
+ Cloud$1 as default
141
+ };
@@ -0,0 +1,12 @@
1
+ import { CSSProperties, FC, SVGProps } from 'react';
2
+
3
+ export interface IconProps extends SVGProps<SVGSVGElement> {
4
+ x?: number;
5
+ y?: number;
6
+ width?: number;
7
+ height?: number;
8
+ size?: number;
9
+ circleStyle?: CSSProperties;
10
+ }
11
+ declare const BaseIcon: FC<IconProps>;
12
+ export default BaseIcon;
@@ -0,0 +1,37 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ const DEFAULTS = {
4
+ size: 20
5
+ };
6
+ const BaseIcon = (props) => {
7
+ const { width, height, size } = {
8
+ ...DEFAULTS,
9
+ ...props
10
+ };
11
+ const x = (props.x ?? 0) - (width ?? size) / 2;
12
+ const y = (props.y ?? 0) - (height ?? size) / 2;
13
+ const trimmedProps = useMemo(() => {
14
+ const _props = { ...props };
15
+ delete _props.circleStyle;
16
+ return _props;
17
+ }, [props]);
18
+ return /* @__PURE__ */ jsxs("g", { children: [
19
+ /* @__PURE__ */ jsx("circle", { cx: props.x, cy: props.y, r: size / 2, style: props.circleStyle ?? {} }),
20
+ /* @__PURE__ */ jsx(
21
+ "svg",
22
+ {
23
+ xmlns: "http://www.w3.org/2000/svg",
24
+ viewBox: "0 -960 960 960",
25
+ width: width ?? size,
26
+ height: height ?? size,
27
+ ...trimmedProps,
28
+ x,
29
+ y,
30
+ children: props.children
31
+ }
32
+ )
33
+ ] });
34
+ };
35
+ export {
36
+ BaseIcon as default
37
+ };
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './BaseIcon';
3
+
4
+ declare const BugIcon: FC<IconProps>;
5
+ export default BugIcon;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "@mui/material";
3
+ import BaseIcon from "./BaseIcon.js";
4
+ const BugIcon = (props) => {
5
+ const theme = useTheme();
6
+ return /* @__PURE__ */ jsx(
7
+ BaseIcon,
8
+ {
9
+ ...props,
10
+ style: { fill: theme.palette.getContrastText(theme.palette.error.dark), ...props.style },
11
+ circleStyle: { fill: theme.palette.error.dark, ...props.style },
12
+ children: /* @__PURE__ */ jsx("path", { d: "M480-200q66 0 113-47t47-113v-160q0-66-47-113t-113-47q-66 0-113 47t-47 113v160q0 66 47 113t113 47Zm-80-120h160v-80H400v80Zm0-160h160v-80H400v80Zm80 40Zm0 320q-65 0-120.5-32T272-240H160v-80h84q-3-20-3.5-40t-.5-40h-80v-80h80q0-20 .5-40t3.5-40h-84v-80h112q14-23 31.5-43t40.5-35l-64-66 56-56 86 86q28-9 57-9t57 9l88-86 56 56-66 66q23 15 41.5 34.5T688-640h112v80h-84q3 20 3.5 40t.5 40h80v80h-80q0 20-.5 40t-3.5 40h84v80H688q-32 56-87.5 88T480-120Z" })
13
+ }
14
+ );
15
+ };
16
+ export {
17
+ BugIcon as default
18
+ };
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './BaseIcon';
3
+
4
+ declare const HostIcon: FC<IconProps>;
5
+ export default HostIcon;
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "@mui/material";
3
+ import BaseIcon from "./BaseIcon.js";
4
+ const HostIcon = (props) => {
5
+ const theme = useTheme();
6
+ return /* @__PURE__ */ jsx(
7
+ BaseIcon,
8
+ {
9
+ ...props,
10
+ style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
11
+ circleStyle: { fill: theme.palette.info.dark, ...props.style },
12
+ children: /* @__PURE__ */ jsx(
13
+ "path",
14
+ {
15
+ style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
16
+ d: "M40-120v-80h880v80H40Zm120-120q-33 0-56.5-23.5T80-320v-440q0-33 23.5-56.5T160-840h640q33 0 56.5 23.5T880-760v440q0 33-23.5 56.5T800-240H160Zm0-80h640v-440H160v440Zm0 0v-440 440Z"
17
+ }
18
+ )
19
+ }
20
+ );
21
+ };
22
+ export {
23
+ HostIcon as default
24
+ };
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './BaseIcon';
3
+
4
+ declare const NetworkIcon: FC<IconProps>;
5
+ export default NetworkIcon;
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "@mui/material";
3
+ import BaseIcon from "./BaseIcon.js";
4
+ const NetworkIcon = (props) => {
5
+ const theme = useTheme();
6
+ return /* @__PURE__ */ jsx(
7
+ BaseIcon,
8
+ {
9
+ ...props,
10
+ style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
11
+ circleStyle: { fill: theme.palette.info.dark, ...props.style },
12
+ children: /* @__PURE__ */ jsx(
13
+ "path",
14
+ {
15
+ style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
16
+ d: "M120-80v-280h120v-160h200v-80H320v-280h320v280H520v80h200v160h120v280H520v-280h120v-80H320v80h120v280H120Zm280-600h160v-120H400v120ZM200-160h160v-120H200v120Zm400 0h160v-120H600v120ZM480-680ZM360-280Zm240 0Z"
17
+ }
18
+ )
19
+ }
20
+ );
21
+ };
22
+ export {
23
+ NetworkIcon as default
24
+ };
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './BaseIcon';
3
+
4
+ declare const ProcessIcon: FC<IconProps>;
5
+ export default ProcessIcon;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTheme, colors } from "@mui/material";
3
+ import BaseIcon from "./BaseIcon.js";
4
+ const ProcessIcon = (props) => {
5
+ const theme = useTheme();
6
+ return /* @__PURE__ */ jsx(
7
+ BaseIcon,
8
+ {
9
+ ...props,
10
+ style: { fill: theme.palette.getContrastText(colors.grey[500]), ...props.style },
11
+ circleStyle: { fill: colors.grey[500], ...props.style },
12
+ children: /* @__PURE__ */ jsx("path", { d: "M360-360v-240h240v240H360Zm80-80h80v-80h-80v80Zm-80 320v-80h-80q-33 0-56.5-23.5T200-280v-80h-80v-80h80v-80h-80v-80h80v-80q0-33 23.5-56.5T280-760h80v-80h80v80h80v-80h80v80h80q33 0 56.5 23.5T760-680v80h80v80h-80v80h80v80h-80v80q0 33-23.5 56.5T680-200h-80v80h-80v-80h-80v80h-80Zm320-160v-400H280v400h400ZM480-480Z" })
13
+ }
14
+ );
15
+ };
16
+ export {
17
+ ProcessIcon as default
18
+ };
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './BaseIcon';
3
+
4
+ declare const TargetIcon: FC<IconProps>;
5
+ export default TargetIcon;
@@ -0,0 +1,19 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "@mui/material";
3
+ import BaseIcon from "./BaseIcon.js";
4
+ const TargetIcon = (props) => {
5
+ const theme = useTheme();
6
+ return /* @__PURE__ */ jsx(
7
+ BaseIcon,
8
+ {
9
+ ...props,
10
+ ...props,
11
+ style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
12
+ circleStyle: { fill: theme.palette.info.dark, ...props.style },
13
+ children: /* @__PURE__ */ jsx("path", { d: "M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-80q-100 0-170-70t-70-170q0-100 70-170t170-70q100 0 170 70t70 170q0 100-70 170t-170 70Zm0-80q66 0 113-47t47-113q0-66-47-113t-113-47q-66 0-113 47t-47 113q0 66 47 113t113 47Zm0-80q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Z" })
14
+ }
15
+ );
16
+ };
17
+ export {
18
+ TargetIcon as default
19
+ };
@@ -0,0 +1,2 @@
1
+ declare const getIcon: (icon: string) => any;
2
+ export default getIcon;
@@ -0,0 +1,16 @@
1
+ import BugIcon from "./BugIcon.js";
2
+ import HostIcon from "./HostIcon.js";
3
+ import NetworkIcon from "./NetworkIcon.js";
4
+ import ProcessIcon from "./ProcessIcon.js";
5
+ import TargetIcon from "./TargetIcon.js";
6
+ const ICON_MAP = {
7
+ bug: BugIcon,
8
+ target: TargetIcon,
9
+ host: HostIcon,
10
+ network: NetworkIcon,
11
+ process: ProcessIcon
12
+ };
13
+ const getIcon = (icon) => ICON_MAP[icon];
14
+ export {
15
+ getIcon as default
16
+ };
@@ -0,0 +1,8 @@
1
+ import { RawEntry } from "../../../../../types/graph";
2
+ import { FC } from 'react';
3
+
4
+ declare const NodePanel: FC<{
5
+ selectedNodeIds: string[];
6
+ findNode: (id: string) => RawEntry;
7
+ }>;
8
+ export default NodePanel;
@@ -0,0 +1,12 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Skeleton } from "@mui/material";
3
+ import NodeCard from "../../elements/NodeCard.js";
4
+ const NodePanel = ({ selectedNodeIds, findNode }) => {
5
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
6
+ selectedNodeIds.map((selectedNodeId) => findNode(selectedNodeId)).filter((node) => !!node).map((node) => /* @__PURE__ */ jsx(NodeCard, { node }, node.id)),
7
+ selectedNodeIds.length < 1 && /* @__PURE__ */ jsx(Skeleton, { variant: "rounded", height: 150 })
8
+ ] });
9
+ };
10
+ export {
11
+ NodePanel as default
12
+ };
@@ -0,0 +1,29 @@
1
+ import { FC } from 'react';
2
+ import { Bundle } from './types';
3
+
4
+ declare const BundleLine: FC<{
5
+ bundle: Bundle;
6
+ linesByLevel: {
7
+ [level: number]: Set<string>;
8
+ };
9
+ paddingByLevel: {
10
+ [level: number]: number;
11
+ };
12
+ nodeLocations: {
13
+ [id: string]: [number, number, number];
14
+ };
15
+ inputsByNode: {
16
+ [id: string]: Set<string>;
17
+ };
18
+ outputsByNode: {
19
+ [id: string]: Set<string>;
20
+ };
21
+ lineWidth: number;
22
+ linePaddingX: number;
23
+ linePaddingY: number;
24
+ maxArcRadius: number;
25
+ highlightedPath: Set<string>;
26
+ lineDirection: 'horizontal' | 'vertical';
27
+ colorTheme?: string;
28
+ }>;
29
+ export default BundleLine;
@@ -0,0 +1,121 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "@mui/material";
3
+ import { d as d3, S as Spectral } from "../../../../../index-DJYqRcxJ.js";
4
+ import { useMyLocalStorageItem } from "../../../../../hooks/useMyLocalStorage.js";
5
+ import { StorageKey } from "../../../../../utils/constants.js";
6
+ import { buildHorizontalLine, buildVerticalLine } from "../../../../../utils/line.js";
7
+ import { i as isNil } from "../../../../../isNil-CIubwp4T.js";
8
+ import { useMemo } from "react";
9
+ import { cyrb53 } from "../../../../../utils/graph.js";
10
+ const BundleLine = ({
11
+ bundle,
12
+ linesByLevel,
13
+ paddingByLevel,
14
+ maxArcRadius,
15
+ lineWidth,
16
+ linePaddingX,
17
+ linePaddingY,
18
+ highlightedPath,
19
+ nodeLocations,
20
+ inputsByNode,
21
+ outputsByNode,
22
+ lineDirection,
23
+ colorTheme
24
+ }) => {
25
+ const theme = useTheme();
26
+ const [colorSetting] = useMyLocalStorageItem(StorageKey.COLOR_SCHEME, "Spectral");
27
+ const [forceColorSetting] = useMyLocalStorageItem(StorageKey.FORCE_COLOR_SETTING, "Spectral");
28
+ const colorScheme = useMemo(
29
+ () => forceColorSetting ? colorSetting : colorTheme || colorSetting,
30
+ [colorSetting, colorTheme, forceColorSetting]
31
+ );
32
+ const color = useMemo(
33
+ () => (d3[`interpolate${colorScheme}`] ?? Spectral)(cyrb53(JSON.stringify(bundle))),
34
+ [bundle, colorScheme]
35
+ );
36
+ const opacities = useMemo(
37
+ () => (_bundle) => highlightedPath.size === 0 || _bundle.sources.some((source) => highlightedPath.has(source.id)) && _bundle.destinations.some((destination) => highlightedPath.has(destination.id)) ? 1 : 0.2,
38
+ [highlightedPath]
39
+ );
40
+ const arrows = [];
41
+ const d = bundle.sources.flatMap((source) => {
42
+ const result = bundle.destinations.flatMap((dest) => {
43
+ var _a, _b;
44
+ linesByLevel[dest.level].delete(bundle.id);
45
+ const [parentX, rawParentY] = nodeLocations[source.id];
46
+ const parentY = rawParentY + (((_a = outputsByNode[source.id]) == null ? void 0 : _a.size) ?? 0) * linePaddingY;
47
+ const [childX, rawChildY, childHeight] = nodeLocations[dest.id];
48
+ const childY = rawChildY + (((_b = inputsByNode[dest.id]) == null ? void 0 : _b.size) ?? 0 + +(source.id === dest.id)) * linePaddingY;
49
+ const distanceX = childX - parentX;
50
+ const distanceY = childY - parentY;
51
+ const arcRadius = Math.min(Math.abs(distanceY / 3), maxArcRadius);
52
+ if (lineDirection === "horizontal") {
53
+ return buildHorizontalLine({
54
+ paddingAtLevel: paddingByLevel[dest.level],
55
+ numLines: linesByLevel[dest.level].size,
56
+ nodeLocations,
57
+ dest,
58
+ distanceX,
59
+ distanceY,
60
+ childX,
61
+ childY,
62
+ childHeight,
63
+ parentX,
64
+ parentY,
65
+ linePaddingX,
66
+ arcRadius
67
+ });
68
+ } else {
69
+ return buildVerticalLine({
70
+ paddingAtLevel: paddingByLevel[dest.level],
71
+ numLines: linesByLevel[dest.level].size,
72
+ distanceX,
73
+ distanceY,
74
+ childX,
75
+ childY,
76
+ childHeight,
77
+ parentX,
78
+ parentY,
79
+ linePaddingX,
80
+ arcRadius
81
+ });
82
+ }
83
+ });
84
+ return result;
85
+ }).join("\n");
86
+ bundle.destinations.forEach((dest) => {
87
+ if (isNil(inputsByNode[dest.id])) {
88
+ inputsByNode[dest.id] = /* @__PURE__ */ new Set();
89
+ }
90
+ inputsByNode[dest.id].add(bundle.id);
91
+ });
92
+ bundle.sources.forEach((source) => {
93
+ if (isNil(outputsByNode[source.id])) {
94
+ outputsByNode[source.id] = /* @__PURE__ */ new Set();
95
+ }
96
+ outputsByNode[source.id].add(bundle.id);
97
+ });
98
+ return /* @__PURE__ */ jsxs("g", { className: "path", style: { opacity: opacities(bundle) }, children: [
99
+ /* @__PURE__ */ jsx(
100
+ "path",
101
+ {
102
+ d,
103
+ style: { fill: "none", stroke: theme.palette.background.paper, strokeWidth: lineWidth + 3 }
104
+ },
105
+ bundle.id + "-bg"
106
+ ),
107
+ /* @__PURE__ */ jsx(
108
+ "path",
109
+ {
110
+ d,
111
+ strokeWidth: lineWidth,
112
+ style: { fill: "none", stroke: color, strokeWidth: lineWidth }
113
+ },
114
+ bundle.id + "-fg"
115
+ ),
116
+ arrows
117
+ ] }, bundle.id);
118
+ };
119
+ export {
120
+ BundleLine as default
121
+ };
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+
3
+ declare const Triangle: FC<{
4
+ x: number;
5
+ y: number;
6
+ fill: string;
7
+ lineWidth: number;
8
+ }>;
9
+ export default Triangle;
@@ -0,0 +1,26 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "@mui/material";
3
+ const Triangle = ({ x, y, fill, lineWidth }) => {
4
+ const theme = useTheme();
5
+ return /* @__PURE__ */ jsxs("g", { className: "arrow", children: [
6
+ /* @__PURE__ */ jsx(
7
+ "polygon",
8
+ {
9
+ points: `${x},${y - 1.5 * lineWidth} ${x - 2 * lineWidth},${y + 1.5 * lineWidth} ${x + 2 * lineWidth},${y + 1.5 * lineWidth}`,
10
+ style: { fill },
11
+ stroke: theme.palette.background.paper,
12
+ strokeWidth: 2
13
+ }
14
+ ),
15
+ /* @__PURE__ */ jsx(
16
+ "polygon",
17
+ {
18
+ points: `${x - lineWidth / 2},${y - 2 * lineWidth} ${x + lineWidth / 2},${y - 2 * lineWidth} ${x + lineWidth / 2},${y + 2 * lineWidth} ${x - lineWidth / 2},${y + 2 * lineWidth}`,
19
+ style: { fill }
20
+ }
21
+ )
22
+ ] });
23
+ };
24
+ export {
25
+ Triangle as default
26
+ };
@@ -0,0 +1,36 @@
1
+ import { NestedDataset, ZoomField } from "../../../../../types/graph";
2
+ import { MutableRefObject } from 'react';
3
+
4
+ interface TreeOptions {
5
+ textColor: string;
6
+ nodeColor: {
7
+ border: string;
8
+ center: string;
9
+ };
10
+ letterSize: number;
11
+ letterWidth: number;
12
+ xSpacing: number;
13
+ ySpacing: number;
14
+ nodeRadius: number;
15
+ maxArcRadius: number;
16
+ linePaddingX: number;
17
+ linePaddingY: number;
18
+ lineWidth: number;
19
+ enableEntryPadding: boolean;
20
+ truncateLabels: boolean;
21
+ enableTimestamps: boolean;
22
+ rowStep: number;
23
+ belowPrevious: boolean;
24
+ iconOrientation: 'horizontal' | 'vertical';
25
+ lineDirection: 'horizontal' | 'vertical';
26
+ colorTheme?: string;
27
+ }
28
+ declare const _default: import('react').NamedExoticComponent<{
29
+ svgRef?: MutableRefObject<SVGSVGElement>;
30
+ graph: NestedDataset;
31
+ labelKeys: ZoomField[];
32
+ onNodeSelectionChanged: (nodeIds: string[]) => void;
33
+ options?: Partial<TreeOptions>;
34
+ zoom: d3.ZoomTransform;
35
+ }>;
36
+ export default _default;