@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,485 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { useTheme, colors, Box } from "@mui/material";
3
+ import useComparator from "../../../../../hooks/useComparator.js";
4
+ import useMyHighlights from "../../../../../hooks/useMyHighlights.js";
5
+ import { useMyLocalStorageItem } from "../../../../../hooks/useMyLocalStorage.js";
6
+ import { StorageKey, BUNDLE_SEPARATOR } from "../../../../../utils/constants.js";
7
+ import { c as cloneDeep } from "../../../../../cloneDeep-CjP5k9zW.js";
8
+ import { g as get } from "../../../../../get-D3C3lEU3.js";
9
+ import { i as isNil } from "../../../../../isNil-CIubwp4T.js";
10
+ import { b as baseExtremum, a as baseGt, i as isIterateeCall } from "../../../../../_baseExtremum-B1o1zHjR.js";
11
+ import { i as identity } from "../../../../../identity-CPGTqrE4.js";
12
+ import { t as toFinite } from "../../../../../toFinite-CArjry_l.js";
13
+ import { b as baseSum } from "../../../../../_baseSum-D0WC1dN0.js";
14
+ import { memo, useMemo } from "react";
15
+ import NodeCard from "../../elements/NodeCard.js";
16
+ import getIcon from "../icons/index.js";
17
+ import Leaf from "../Leaf.js";
18
+ import BundleLine from "./BundleLine.js";
19
+ function max(array) {
20
+ return array && array.length ? baseExtremum(array, identity, baseGt) : void 0;
21
+ }
22
+ var nativeCeil = Math.ceil, nativeMax = Math.max;
23
+ function baseRange(start, end, step, fromRight) {
24
+ var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length);
25
+ while (length--) {
26
+ result[++index] = start;
27
+ start += step;
28
+ }
29
+ return result;
30
+ }
31
+ function createRange(fromRight) {
32
+ return function(start, end, step) {
33
+ if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
34
+ end = step = void 0;
35
+ }
36
+ start = toFinite(start);
37
+ if (end === void 0) {
38
+ end = start;
39
+ start = 0;
40
+ } else {
41
+ end = toFinite(end);
42
+ }
43
+ step = step === void 0 ? start < end ? 1 : -1 : toFinite(step);
44
+ return baseRange(start, end, step);
45
+ };
46
+ }
47
+ var range = createRange();
48
+ function sum(array) {
49
+ return array && array.length ? baseSum(array, identity) : 0;
50
+ }
51
+ const DEFAULT_OPTIONS = {
52
+ textColor: "white",
53
+ nodeColor: {
54
+ border: "grey",
55
+ center: "white"
56
+ },
57
+ letterSize: 10,
58
+ letterWidth: 6.5,
59
+ xSpacing: 8,
60
+ ySpacing: 20,
61
+ nodeRadius: 6,
62
+ maxArcRadius: 8,
63
+ linePaddingX: 10,
64
+ linePaddingY: 10,
65
+ lineWidth: 3,
66
+ enableEntryPadding: true,
67
+ truncateLabels: true,
68
+ enableTimestamps: true,
69
+ iconOrientation: "vertical",
70
+ lineDirection: "horizontal",
71
+ rowStep: null,
72
+ // We'll make this dynamic
73
+ belowPrevious: false
74
+ };
75
+ DEFAULT_OPTIONS.rowStep = DEFAULT_OPTIONS.ySpacing * 2;
76
+ const Tree = ({ svgRef, graph, labelKeys, onNodeSelectionChanged, zoom, options = {} }) => {
77
+ var _a, _b, _c;
78
+ const combinedOptions = useMemo(
79
+ () => {
80
+ var _a2, _b2;
81
+ return {
82
+ ...DEFAULT_OPTIONS,
83
+ ...options,
84
+ ...((_b2 = (_a2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a2.visualization) == null ? void 0 : _b2.config) ?? {}
85
+ };
86
+ },
87
+ [(_b = (_a = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a.visualization) == null ? void 0 : _b.config, options]
88
+ );
89
+ const {
90
+ xSpacing: baseXSpacing,
91
+ ySpacing: baseYSpacing,
92
+ linePaddingX: baseLinePaddingX,
93
+ linePaddingY: baseLinePaddingY
94
+ } = combinedOptions;
95
+ const { runComparators, runComparator } = useComparator();
96
+ const { onNodeHoveredChanged, onNodeClicked, nodeOpacities, highlightedPath, highlightedNodes, hoveredNode } = useMyHighlights(graph, (nodeIds) => onNodeSelectionChanged(nodeIds));
97
+ const theme = useTheme();
98
+ const isDark = useMemo(() => theme.palette.mode === "dark", [theme]);
99
+ const [showCardsSettings] = useMyLocalStorageItem(StorageKey.SHOW_CARDS, false);
100
+ const [cardCutoff] = useMyLocalStorageItem(StorageKey.CARD_CUTOFF, 2.5);
101
+ const showCards = useMemo(() => zoom.k > cardCutoff && showCardsSettings, [cardCutoff, showCardsSettings, zoom.k]);
102
+ const levels = useMemo(
103
+ () => graph.data.map(
104
+ (level, levelIndex) => level.map((node) => ({
105
+ ...node,
106
+ parents: node == null ? void 0 : node.edges,
107
+ level: levelIndex
108
+ }))
109
+ ),
110
+ [graph.data]
111
+ );
112
+ const flatNodes = useMemo(() => levels.flat(), [levels]);
113
+ const [xSpacing, linePaddingX, ySpacing, linePaddingY] = useMemo(() => {
114
+ const baseValues = [
115
+ [baseXSpacing, baseLinePaddingX],
116
+ [baseYSpacing, baseLinePaddingY]
117
+ ];
118
+ if (zoom.k > 1 && showCardsSettings) {
119
+ return baseValues.flatMap(
120
+ (arr, index) => arr.map((_v) => _v * Math.pow(2.5 - index * 1.25, Math.min(zoom.k, 2.5) - 1))
121
+ );
122
+ } else {
123
+ return baseValues.flat();
124
+ }
125
+ }, [baseLinePaddingX, baseLinePaddingY, baseXSpacing, baseYSpacing, showCardsSettings, zoom.k]);
126
+ let portBounds;
127
+ if (!graph || !svgRef.current) {
128
+ portBounds = [
129
+ [0, 0],
130
+ [0, 0]
131
+ ];
132
+ } else {
133
+ const data = svgRef.current.getBoundingClientRect();
134
+ portBounds = [zoom.invert([0, 0]), zoom.invert([data.width, data.height])];
135
+ }
136
+ const bundles = useMemo(() => {
137
+ const bundlesDict = {};
138
+ flatNodes.forEach((node) => {
139
+ if (!node.parents) {
140
+ return;
141
+ }
142
+ const bundleId = node.parents.join(BUNDLE_SEPARATOR);
143
+ if (bundlesDict[bundleId]) {
144
+ bundlesDict[bundleId].destinations.push(node);
145
+ } else {
146
+ bundlesDict[bundleId] = {
147
+ id: bundleId,
148
+ sources: node.parents.map((parent) => flatNodes.find((_node) => _node.id === parent)),
149
+ destinations: [node]
150
+ };
151
+ }
152
+ });
153
+ return Object.values(bundlesDict);
154
+ }, [flatNodes]);
155
+ const layoutData = useMemo(() => {
156
+ const {
157
+ letterSize,
158
+ letterWidth,
159
+ enableEntryPadding,
160
+ truncateLabels,
161
+ rowStep,
162
+ belowPrevious
163
+ } = combinedOptions;
164
+ let currentX = 0;
165
+ let currentY = 0;
166
+ const nodeLocations = {};
167
+ const linesByLevel = {};
168
+ const paddingByLevel = {};
169
+ const inputs = {};
170
+ const outputs = {};
171
+ levels.forEach((level, levelIndex) => {
172
+ let longestLabel = 0;
173
+ level.forEach((node) => {
174
+ var _a2;
175
+ const validKeys = labelKeys == null ? void 0 : labelKeys.filter((_comparator) => runComparator(_comparator, node));
176
+ const labelKey = (_a2 = validKeys == null ? void 0 : validKeys.pop()) == null ? void 0 : _a2.label;
177
+ const labelRows = (labelKey == null ? void 0 : labelKey.split(",").map((key) => get(node, key)).filter((val) => !!val)) ?? [];
178
+ if (labelRows.length < 1) {
179
+ node.id.split("\n").forEach((line) => labelRows.push(line));
180
+ }
181
+ const labelHeight = labelRows.length * letterSize;
182
+ currentY += labelHeight;
183
+ nodeLocations[node.id] = [+currentX, +currentY, -linePaddingY];
184
+ currentY += ySpacing;
185
+ if (enableEntryPadding) {
186
+ longestLabel = Math.max(longestLabel, max((labelRows == null ? void 0 : labelRows.map((row) => row.toString().length)) ?? [node.id.length]));
187
+ }
188
+ });
189
+ currentX += xSpacing + (!truncateLabels ? longestLabel : Math.min(longestLabel, 44)) * letterWidth;
190
+ if (!belowPrevious) {
191
+ currentY = (levelIndex + 1) * rowStep;
192
+ } else {
193
+ currentY += rowStep;
194
+ }
195
+ });
196
+ bundles.forEach((bundle) => {
197
+ bundle.sources.forEach((source) => {
198
+ if (!outputs[source.id]) {
199
+ outputs[source.id] = /* @__PURE__ */ new Set();
200
+ }
201
+ outputs[source.id].add(bundle.id);
202
+ });
203
+ bundle.destinations.forEach((dest) => {
204
+ if (isNil(linesByLevel[dest.level])) {
205
+ linesByLevel[dest.level] = /* @__PURE__ */ new Set();
206
+ }
207
+ if (!inputs[dest.id]) {
208
+ inputs[dest.id] = /* @__PURE__ */ new Set();
209
+ }
210
+ linesByLevel[dest.level].add(bundle.id);
211
+ inputs[dest.id].add(bundle.id);
212
+ });
213
+ });
214
+ Object.entries(linesByLevel).forEach(([level, lines]) => paddingByLevel[level] = lines.size);
215
+ levels.forEach((level, levelIndex) => {
216
+ const indexesSoFar = range(levelIndex + 1);
217
+ const paddingArray = indexesSoFar.map((_levelIndex) => paddingByLevel[_levelIndex] ?? 0);
218
+ const totalPadding = sum(paddingArray) * linePaddingX;
219
+ level.forEach((node) => {
220
+ nodeLocations[node.id][0] += totalPadding;
221
+ });
222
+ });
223
+ flatNodes.forEach((node) => {
224
+ var _a2, _b2, _c2;
225
+ let maxHeight = max([((_a2 = inputs[node.id]) == null ? void 0 : _a2.size) - 1, ((_b2 = outputs[node.id]) == null ? void 0 : _b2.size) - 1, 0]) * linePaddingY;
226
+ if ((_c2 = inputs[node.id]) == null ? void 0 : _c2.has(node.id)) {
227
+ maxHeight += linePaddingY;
228
+ }
229
+ nodeLocations[node.id][2] = maxHeight;
230
+ const levelIndex = levels[node.level].findIndex((_node) => _node.id === node.id);
231
+ levels[node.level].filter((__, index) => levelIndex < index).forEach((_node) => {
232
+ nodeLocations[_node.id][1] += maxHeight;
233
+ });
234
+ });
235
+ return {
236
+ nodeLocations,
237
+ linesByLevel,
238
+ paddingByLevel
239
+ };
240
+ }, [
241
+ bundles,
242
+ combinedOptions,
243
+ flatNodes,
244
+ labelKeys,
245
+ levels,
246
+ linePaddingX,
247
+ linePaddingY,
248
+ runComparator,
249
+ xSpacing,
250
+ ySpacing
251
+ ]);
252
+ const [timestamps, bundleElements, nodes] = useMemo(() => {
253
+ const {
254
+ textColor,
255
+ letterSize,
256
+ letterWidth,
257
+ nodeRadius,
258
+ nodeColor,
259
+ maxArcRadius,
260
+ lineWidth,
261
+ truncateLabels,
262
+ enableTimestamps,
263
+ belowPrevious,
264
+ iconOrientation,
265
+ lineDirection,
266
+ colorTheme
267
+ } = combinedOptions;
268
+ const { nodeLocations, linesByLevel, paddingByLevel } = layoutData;
269
+ const _nodes = [];
270
+ const _timestamps = [];
271
+ flatNodes.forEach((node) => {
272
+ var _a2, _b2, _c2, _d;
273
+ const [x, y, _height] = nodeLocations[node.id];
274
+ const labelKey = ((_a2 = labelKeys == null ? void 0 : labelKeys.filter((_comparator) => runComparator(_comparator, node)).pop()) == null ? void 0 : _a2.label) ?? "id";
275
+ let label = labelKey == null ? void 0 : labelKey.split(",").map((key) => {
276
+ let labelSection = get(node, key);
277
+ if (labelSection && truncateLabels && labelSection.length > 44) {
278
+ labelSection = labelSection.replace(/^(.{32}).+$/, "$1 (TRUNCATED)");
279
+ }
280
+ return labelSection;
281
+ }).filter((section) => !!section).join("\n");
282
+ if (!label) {
283
+ if (node.id.length > 44) {
284
+ label = node.id.replace(/^(.{32}).+$/, "$1 (TRUNCATED)");
285
+ } else {
286
+ label = node.id;
287
+ }
288
+ }
289
+ if (belowPrevious && enableTimestamps && (node.timestamp || node.annotation)) {
290
+ _timestamps.push(
291
+ /* @__PURE__ */ jsxs(
292
+ "g",
293
+ {
294
+ style: {
295
+ cursor: "default",
296
+ fontFamily: '"Lucida Console", monospace',
297
+ fontSize: letterSize * 0.75 + "px"
298
+ },
299
+ children: [
300
+ /* @__PURE__ */ jsx(
301
+ "text",
302
+ {
303
+ x: portBounds[0][0] + xSpacing,
304
+ y: y + (_height + nodeRadius) / 2,
305
+ fill: theme.palette.getContrastText(theme.palette.background.paper),
306
+ style: {
307
+ fillOpacity: nodeOpacities(node.id) / 2,
308
+ transition: theme.transitions.create(["fill-opacity"], {
309
+ duration: theme.transitions.duration.short
310
+ })
311
+ },
312
+ children: node.timestamp
313
+ }
314
+ ),
315
+ node.annotation && node.annotation.split("\n").map((line, index) => {
316
+ var _a3;
317
+ return /* @__PURE__ */ jsx(
318
+ "text",
319
+ {
320
+ x: portBounds[0][0] + (((_a3 = node.timestamp) == null ? void 0 : _a3.length) ?? 0) * letterWidth,
321
+ y: y + (_height + nodeRadius) / 2 + index * letterSize,
322
+ fill: isDark ? colors.orange[300] : colors.blue[900],
323
+ style: {
324
+ fillOpacity: nodeOpacities(node.id),
325
+ transition: theme.transitions.create(["fill-opacity"], {
326
+ duration: theme.transitions.duration.short
327
+ })
328
+ },
329
+ children: line
330
+ },
331
+ line
332
+ );
333
+ })
334
+ ]
335
+ },
336
+ node.id + "-timestamp"
337
+ )
338
+ );
339
+ }
340
+ if (!showCards) {
341
+ const style = runComparators(
342
+ (_c2 = (_b2 = graph.metadata.display) == null ? void 0 : _b2.styles) == null ? void 0 : _c2.filter((comparator) => comparator.type === "node"),
343
+ node
344
+ );
345
+ const nodeOpacity = nodeOpacities(node.id);
346
+ const icons = (_d = node.icons) == null ? void 0 : _d.map((icon) => [icon, getIcon(icon)]).filter(([__, icon]) => !!icon).map(([icon, Icon], index) => /* @__PURE__ */ jsx(
347
+ Icon,
348
+ {
349
+ x: x - nodeRadius * 3 * (iconOrientation === "horizontal" ? index + 1 : 0),
350
+ y: y - nodeRadius * 3 * (iconOrientation === "vertical" ? index + 1 : 0),
351
+ size: letterSize * 1.5,
352
+ style: {
353
+ fillOpacity: nodeOpacity
354
+ },
355
+ circleStyle: {
356
+ fillOpacity: nodeOpacity
357
+ }
358
+ },
359
+ icon
360
+ ));
361
+ _nodes.push(
362
+ /* @__PURE__ */ jsx(
363
+ Leaf,
364
+ {
365
+ alwaysShowText: true,
366
+ nodeId: node.id,
367
+ label,
368
+ height: _height,
369
+ x,
370
+ y,
371
+ style,
372
+ nodeRadius,
373
+ nodeColor,
374
+ nodeOpacity,
375
+ letterSize,
376
+ letterWidth,
377
+ textColor,
378
+ selected: highlightedNodes.has(node.id),
379
+ onHoverChanged: onNodeHoveredChanged,
380
+ onClick: onNodeClicked,
381
+ children: icons
382
+ },
383
+ node.id
384
+ )
385
+ );
386
+ }
387
+ });
388
+ const readonlyNodeLocations = cloneDeep(nodeLocations);
389
+ const outputsByNode = {};
390
+ const inputsByNode = {};
391
+ const _bundleElements = bundles.map((bundle) => {
392
+ return /* @__PURE__ */ jsx(
393
+ BundleLine,
394
+ {
395
+ lineDirection,
396
+ linesByLevel,
397
+ paddingByLevel,
398
+ nodeLocations: readonlyNodeLocations,
399
+ outputsByNode,
400
+ inputsByNode,
401
+ bundle,
402
+ maxArcRadius,
403
+ lineWidth,
404
+ linePaddingX,
405
+ linePaddingY,
406
+ highlightedPath,
407
+ colorTheme
408
+ },
409
+ bundle.id
410
+ );
411
+ });
412
+ return [_timestamps, _bundleElements, _nodes];
413
+ }, [
414
+ bundles,
415
+ combinedOptions,
416
+ (_c = graph.metadata.display) == null ? void 0 : _c.styles,
417
+ flatNodes,
418
+ highlightedNodes,
419
+ highlightedPath,
420
+ isDark,
421
+ labelKeys,
422
+ layoutData,
423
+ linePaddingX,
424
+ linePaddingY,
425
+ nodeOpacities,
426
+ onNodeClicked,
427
+ onNodeHoveredChanged,
428
+ portBounds,
429
+ runComparator,
430
+ runComparators,
431
+ showCards,
432
+ theme.palette,
433
+ theme.transitions,
434
+ xSpacing
435
+ ]);
436
+ const cards = useMemo(() => {
437
+ const { nodeRadius, lineWidth } = combinedOptions;
438
+ const { nodeLocations } = layoutData;
439
+ return flatNodes.filter((node) => showCards || hoveredNode === node.id).map((node) => {
440
+ const [x, y] = nodeLocations[node.id];
441
+ return /* @__PURE__ */ jsx(
442
+ Box,
443
+ {
444
+ onMouseOver: () => onNodeHoveredChanged(node.id, true),
445
+ onMouseLeave: () => setTimeout(() => onNodeHoveredChanged(node.id, false), 100),
446
+ sx: {
447
+ position: "absolute",
448
+ left: zoom.k * x + zoom.x,
449
+ top: zoom.k * y + zoom.y,
450
+ transform: `translateX(-${nodeRadius * 2}px) translateY(${lineWidth}px)`,
451
+ backgroundColor: theme.palette.background.paper,
452
+ maxWidth: "450px",
453
+ maxHeight: "500px",
454
+ overflow: "auto"
455
+ },
456
+ children: /* @__PURE__ */ jsx(NodeCard, { node })
457
+ },
458
+ node.id
459
+ );
460
+ });
461
+ }, [
462
+ combinedOptions,
463
+ flatNodes,
464
+ hoveredNode,
465
+ layoutData,
466
+ onNodeHoveredChanged,
467
+ showCards,
468
+ theme.palette.background.paper,
469
+ zoom.k,
470
+ zoom.x,
471
+ zoom.y
472
+ ]);
473
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
474
+ /* @__PURE__ */ jsx("svg", { id: "viz", ref: svgRef, children: /* @__PURE__ */ jsxs("g", { id: "view", children: [
475
+ timestamps,
476
+ bundleElements,
477
+ nodes
478
+ ] }) }),
479
+ cards
480
+ ] });
481
+ };
482
+ const Tree$1 = memo(Tree);
483
+ export {
484
+ Tree$1 as default
485
+ };
@@ -0,0 +1,11 @@
1
+ import { RawEntry } from "../../../../../types/graph";
2
+
3
+ export interface Node extends RawEntry {
4
+ level: number;
5
+ parents: string[];
6
+ }
7
+ export interface Bundle {
8
+ id: string;
9
+ sources: Node[];
10
+ destinations: Node[];
11
+ }
@@ -0,0 +1,9 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ declare const _default: import('react').NamedExoticComponent<{
4
+ icon: string;
5
+ fontSize?: "small" | "medium" | "large" | "inherit" | number;
6
+ color?: "disabled" | "action" | "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
7
+ style?: CSSProperties;
8
+ }>;
9
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { I as Icon } from "../../../iconify-CXMreGTg.js";
3
+ import { useTheme } from "@mui/material";
4
+ import { memo, useMemo } from "react";
5
+ const Iconified = ({ icon, fontSize = "medium", color, style = {} }) => {
6
+ const theme = useTheme();
7
+ const _fontSize = useMemo(() => {
8
+ if (fontSize === "small") {
9
+ return 20;
10
+ } else if (fontSize === "medium") {
11
+ return 24;
12
+ } else if (fontSize === "large") {
13
+ return 35;
14
+ }
15
+ return fontSize;
16
+ }, [fontSize]);
17
+ const styles = useMemo(() => {
18
+ const _styles = style;
19
+ if (color) {
20
+ _styles.color = theme.palette[color].main;
21
+ }
22
+ return _styles;
23
+ }, [color, style, theme.palette]);
24
+ return /* @__PURE__ */ jsx("span", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(Icon, { icon, fontSize: _fontSize, style: styles }) });
25
+ };
26
+ const Iconified$1 = memo(Iconified);
27
+ export {
28
+ Iconified$1 as default
29
+ };
@@ -0,0 +1,14 @@
1
+ import { ReactJsonViewProps } from '@microlink/react-json-view';
2
+ import { StackProps } from '@mui/material';
3
+ import { FC } from 'react';
4
+
5
+ declare const JSONViewer: FC<{
6
+ data: object;
7
+ collapse?: boolean;
8
+ forceCompact?: boolean;
9
+ slotProps?: {
10
+ stack?: StackProps;
11
+ json?: Partial<ReactJsonViewProps>;
12
+ };
13
+ }>;
14
+ export default JSONViewer;
@@ -0,0 +1,12 @@
1
+ import "react/jsx-runtime";
2
+ import "@mui/material";
3
+ import { J } from "../../../index-BDrtH5ec.js";
4
+ import "../../../utils-CxIhC2xH.js";
5
+ import "../../../hooks/ClueComponentContext.js";
6
+ import "../../../hooks/useMyLocalStorage.js";
7
+ import "../../../utils/constants.js";
8
+ import "react";
9
+ import "../../../index-BDVjGvMI.js";
10
+ export {
11
+ J as default
12
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ declare const DynamicTabs: React.FC<{
3
+ tabs: {
4
+ title: string;
5
+ children: React.ReactNode;
6
+ }[];
7
+ }>;
8
+ export default DynamicTabs;
@@ -0,0 +1,26 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Box, Tabs, Tab } from "@mui/material";
3
+ import * as React from "react";
4
+ const CustomTabPanel = (props) => {
5
+ const { children, value, index, ...other } = props;
6
+ return /* @__PURE__ */ jsx("div", { role: "tabpanel", hidden: value !== index, id: `tabpanel-${index}`, "aria-labelledby": `tab-${index}`, ...other, children: value === index && /* @__PURE__ */ jsx(Box, { sx: { p: 1 }, children }) });
7
+ };
8
+ const a11yProps = (index) => {
9
+ return {
10
+ id: `tab-${index}`,
11
+ "aria-controls": `tabpanel-${index}`
12
+ };
13
+ };
14
+ const DynamicTabs = ({ tabs }) => {
15
+ const [value, setValue] = React.useState(0);
16
+ const handleChange = (_event, newValue) => {
17
+ setValue(newValue);
18
+ };
19
+ return /* @__PURE__ */ jsxs(Box, { sx: { width: "100%" }, children: [
20
+ /* @__PURE__ */ jsx(Box, { sx: { borderBottom: 1, borderColor: "divider" }, children: /* @__PURE__ */ jsx(Tabs, { value, onChange: handleChange, "aria-label": "dynamic tabs", children: tabs.map((t, index) => /* @__PURE__ */ jsx(Tab, { label: t.title, ...a11yProps(index) }, t.title)) }) }),
21
+ tabs.map((t, index) => /* @__PURE__ */ jsx(CustomTabPanel, { value, index, children: t.children }, t.title))
22
+ ] });
23
+ };
24
+ export {
25
+ DynamicTabs as default
26
+ };
@@ -0,0 +1,9 @@
1
+ import { FC, ReactElement } from 'react';
2
+
3
+ declare const Markdown: FC<{
4
+ md: string;
5
+ components?: {
6
+ [index: string]: ReactElement;
7
+ };
8
+ }>;
9
+ export default Markdown;