react-cosmos-diagram 0.0.0

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 (236) hide show
  1. package/dist/esm/components/A11yDescriptions/index.d.ts +3 -0
  2. package/dist/esm/components/A11yDescriptions/index.d.ts.map +1 -0
  3. package/dist/esm/components/ConnectionEdge/ConnectionPath.d.ts +13 -0
  4. package/dist/esm/components/ConnectionEdge/ConnectionPath.d.ts.map +1 -0
  5. package/dist/esm/components/ConnectionEdge/index.d.ts +8 -0
  6. package/dist/esm/components/ConnectionEdge/index.d.ts.map +1 -0
  7. package/dist/esm/components/Edges/Anchor.d.ts +16 -0
  8. package/dist/esm/components/Edges/Anchor.d.ts.map +1 -0
  9. package/dist/esm/components/Edges/BaseEdge.d.ts +7 -0
  10. package/dist/esm/components/Edges/BaseEdge.d.ts.map +1 -0
  11. package/dist/esm/components/Edges/EdgeLabel.d.ts +6 -0
  12. package/dist/esm/components/Edges/EdgeLabel.d.ts.map +1 -0
  13. package/dist/esm/components/Edges/StepEdge.d.ts +25 -0
  14. package/dist/esm/components/Edges/StepEdge.d.ts.map +1 -0
  15. package/dist/esm/components/Edges/type.d.ts +91 -0
  16. package/dist/esm/components/Edges/type.d.ts.map +1 -0
  17. package/dist/esm/components/Edges/utils.d.ts +7 -0
  18. package/dist/esm/components/Edges/utils.d.ts.map +1 -0
  19. package/dist/esm/components/Edges/wrapEdge.d.ts +11 -0
  20. package/dist/esm/components/Edges/wrapEdge.d.ts.map +1 -0
  21. package/dist/esm/components/Node/index.d.ts +4 -0
  22. package/dist/esm/components/Node/index.d.ts.map +1 -0
  23. package/dist/esm/components/Node/type.d.ts +84 -0
  24. package/dist/esm/components/Node/type.d.ts.map +1 -0
  25. package/dist/esm/components/Node/utils.d.ts +18 -0
  26. package/dist/esm/components/Node/utils.d.ts.map +1 -0
  27. package/dist/esm/components/Node/wrapNode.d.ts +10 -0
  28. package/dist/esm/components/Node/wrapNode.d.ts.map +1 -0
  29. package/dist/esm/components/Port/index.d.ts +9 -0
  30. package/dist/esm/components/Port/index.d.ts.map +1 -0
  31. package/dist/esm/components/Port/type.d.ts +12 -0
  32. package/dist/esm/components/Port/type.d.ts.map +1 -0
  33. package/dist/esm/components/Port/utils.d.ts +21 -0
  34. package/dist/esm/components/Port/utils.d.ts.map +1 -0
  35. package/dist/esm/components/ReactDiagramProvider/index.d.ts +4 -0
  36. package/dist/esm/components/ReactDiagramProvider/index.d.ts.map +1 -0
  37. package/dist/esm/components/ReactDiagramProvider/type.d.ts +64 -0
  38. package/dist/esm/components/ReactDiagramProvider/type.d.ts.map +1 -0
  39. package/dist/esm/components/StoreUpdater/index.d.ts +7 -0
  40. package/dist/esm/components/StoreUpdater/index.d.ts.map +1 -0
  41. package/dist/esm/container/DiagramRenderer/index.d.ts +13 -0
  42. package/dist/esm/container/DiagramRenderer/index.d.ts.map +1 -0
  43. package/dist/esm/container/EdgeRenderer/MarkerComponent.d.ts +11 -0
  44. package/dist/esm/container/EdgeRenderer/MarkerComponent.d.ts.map +1 -0
  45. package/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts +8 -0
  46. package/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -0
  47. package/dist/esm/container/EdgeRenderer/index.d.ts +17 -0
  48. package/dist/esm/container/EdgeRenderer/index.d.ts.map +1 -0
  49. package/dist/esm/container/EdgeRenderer/type.d.ts +9 -0
  50. package/dist/esm/container/EdgeRenderer/type.d.ts.map +1 -0
  51. package/dist/esm/container/EdgeRenderer/utils.d.ts +28 -0
  52. package/dist/esm/container/EdgeRenderer/utils.d.ts.map +1 -0
  53. package/dist/esm/container/NodeRenderer/index.d.ts +15 -0
  54. package/dist/esm/container/NodeRenderer/index.d.ts.map +1 -0
  55. package/dist/esm/container/NodeRenderer/type.d.ts +9 -0
  56. package/dist/esm/container/NodeRenderer/type.d.ts.map +1 -0
  57. package/dist/esm/container/NodeRenderer/utils.d.ts +3 -0
  58. package/dist/esm/container/NodeRenderer/utils.d.ts.map +1 -0
  59. package/dist/esm/container/ReactDiagram/DiagramView.d.ts +15 -0
  60. package/dist/esm/container/ReactDiagram/DiagramView.d.ts.map +1 -0
  61. package/dist/esm/container/ReactDiagram/Wrapper.d.ts +7 -0
  62. package/dist/esm/container/ReactDiagram/Wrapper.d.ts.map +1 -0
  63. package/dist/esm/container/ReactDiagram/index.d.ts +54 -0
  64. package/dist/esm/container/ReactDiagram/index.d.ts.map +1 -0
  65. package/dist/esm/container/Viewport/index.d.ts +7 -0
  66. package/dist/esm/container/Viewport/index.d.ts.map +1 -0
  67. package/dist/esm/container/ZoomPane/index.d.ts +8 -0
  68. package/dist/esm/container/ZoomPane/index.d.ts.map +1 -0
  69. package/dist/esm/contexts/NodeIdContext.d.ts +7 -0
  70. package/dist/esm/contexts/NodeIdContext.d.ts.map +1 -0
  71. package/dist/esm/contexts/RFStoreContext.d.ts +5 -0
  72. package/dist/esm/contexts/RFStoreContext.d.ts.map +1 -0
  73. package/dist/esm/fixtures/errorMessages.d.ts +11 -0
  74. package/dist/esm/fixtures/errorMessages.d.ts.map +1 -0
  75. package/dist/esm/hooks/useDrag/index.d.ts +10 -0
  76. package/dist/esm/hooks/useDrag/index.d.ts.map +1 -0
  77. package/dist/esm/hooks/useDrag/type.d.ts +3 -0
  78. package/dist/esm/hooks/useDrag/type.d.ts.map +1 -0
  79. package/dist/esm/hooks/useDrag/utils.d.ts +16 -0
  80. package/dist/esm/hooks/useDrag/utils.d.ts.map +1 -0
  81. package/dist/esm/hooks/useGetPointerPosition.d.ts +9 -0
  82. package/dist/esm/hooks/useGetPointerPosition.d.ts.map +1 -0
  83. package/dist/esm/hooks/useGlobalKeyHandler.d.ts +4 -0
  84. package/dist/esm/hooks/useGlobalKeyHandler.d.ts.map +1 -0
  85. package/dist/esm/hooks/useNodeOrEdgeTypes.d.ts +7 -0
  86. package/dist/esm/hooks/useNodeOrEdgeTypes.d.ts.map +1 -0
  87. package/dist/esm/hooks/useNodesEdgesState/index.d.ts +8 -0
  88. package/dist/esm/hooks/useNodesEdgesState/index.d.ts.map +1 -0
  89. package/dist/esm/hooks/useNodesEdgesState/type.d.ts +49 -0
  90. package/dist/esm/hooks/useNodesEdgesState/type.d.ts.map +1 -0
  91. package/dist/esm/hooks/useStore.d.ts +14 -0
  92. package/dist/esm/hooks/useStore.d.ts.map +1 -0
  93. package/dist/esm/hooks/useVisibleNodes.d.ts +3 -0
  94. package/dist/esm/hooks/useVisibleNodes.d.ts.map +1 -0
  95. package/dist/esm/index.d.ts +14 -0
  96. package/dist/esm/index.d.ts.map +1 -0
  97. package/dist/esm/index.js +2232 -0
  98. package/dist/esm/store/index.d.ts +4 -0
  99. package/dist/esm/store/index.d.ts.map +1 -0
  100. package/dist/esm/store/initialState.d.ts +6 -0
  101. package/dist/esm/store/initialState.d.ts.map +1 -0
  102. package/dist/esm/store/utils.d.ts +18 -0
  103. package/dist/esm/store/utils.d.ts.map +1 -0
  104. package/dist/esm/types/core.d.ts +55 -0
  105. package/dist/esm/types/core.d.ts.map +1 -0
  106. package/dist/esm/types/general.d.ts +23 -0
  107. package/dist/esm/types/general.d.ts.map +1 -0
  108. package/dist/esm/types/index.d.ts +12 -0
  109. package/dist/esm/types/index.d.ts.map +1 -0
  110. package/dist/esm/types/utils.d.ts +26 -0
  111. package/dist/esm/types/utils.d.ts.map +1 -0
  112. package/dist/esm/utils/changes.d.ts +12 -0
  113. package/dist/esm/utils/changes.d.ts.map +1 -0
  114. package/dist/esm/utils/graph.d.ts +13 -0
  115. package/dist/esm/utils/graph.d.ts.map +1 -0
  116. package/dist/esm/utils/index.d.ts +22 -0
  117. package/dist/esm/utils/index.d.ts.map +1 -0
  118. package/dist/style.css +144 -0
  119. package/dist/umd/components/A11yDescriptions/index.d.ts +3 -0
  120. package/dist/umd/components/A11yDescriptions/index.d.ts.map +1 -0
  121. package/dist/umd/components/ConnectionEdge/ConnectionPath.d.ts +13 -0
  122. package/dist/umd/components/ConnectionEdge/ConnectionPath.d.ts.map +1 -0
  123. package/dist/umd/components/ConnectionEdge/index.d.ts +8 -0
  124. package/dist/umd/components/ConnectionEdge/index.d.ts.map +1 -0
  125. package/dist/umd/components/Edges/Anchor.d.ts +16 -0
  126. package/dist/umd/components/Edges/Anchor.d.ts.map +1 -0
  127. package/dist/umd/components/Edges/BaseEdge.d.ts +7 -0
  128. package/dist/umd/components/Edges/BaseEdge.d.ts.map +1 -0
  129. package/dist/umd/components/Edges/EdgeLabel.d.ts +6 -0
  130. package/dist/umd/components/Edges/EdgeLabel.d.ts.map +1 -0
  131. package/dist/umd/components/Edges/StepEdge.d.ts +25 -0
  132. package/dist/umd/components/Edges/StepEdge.d.ts.map +1 -0
  133. package/dist/umd/components/Edges/type.d.ts +91 -0
  134. package/dist/umd/components/Edges/type.d.ts.map +1 -0
  135. package/dist/umd/components/Edges/utils.d.ts +7 -0
  136. package/dist/umd/components/Edges/utils.d.ts.map +1 -0
  137. package/dist/umd/components/Edges/wrapEdge.d.ts +11 -0
  138. package/dist/umd/components/Edges/wrapEdge.d.ts.map +1 -0
  139. package/dist/umd/components/Node/index.d.ts +4 -0
  140. package/dist/umd/components/Node/index.d.ts.map +1 -0
  141. package/dist/umd/components/Node/type.d.ts +84 -0
  142. package/dist/umd/components/Node/type.d.ts.map +1 -0
  143. package/dist/umd/components/Node/utils.d.ts +18 -0
  144. package/dist/umd/components/Node/utils.d.ts.map +1 -0
  145. package/dist/umd/components/Node/wrapNode.d.ts +10 -0
  146. package/dist/umd/components/Node/wrapNode.d.ts.map +1 -0
  147. package/dist/umd/components/Port/index.d.ts +9 -0
  148. package/dist/umd/components/Port/index.d.ts.map +1 -0
  149. package/dist/umd/components/Port/type.d.ts +12 -0
  150. package/dist/umd/components/Port/type.d.ts.map +1 -0
  151. package/dist/umd/components/Port/utils.d.ts +21 -0
  152. package/dist/umd/components/Port/utils.d.ts.map +1 -0
  153. package/dist/umd/components/ReactDiagramProvider/index.d.ts +4 -0
  154. package/dist/umd/components/ReactDiagramProvider/index.d.ts.map +1 -0
  155. package/dist/umd/components/ReactDiagramProvider/type.d.ts +64 -0
  156. package/dist/umd/components/ReactDiagramProvider/type.d.ts.map +1 -0
  157. package/dist/umd/components/StoreUpdater/index.d.ts +7 -0
  158. package/dist/umd/components/StoreUpdater/index.d.ts.map +1 -0
  159. package/dist/umd/container/DiagramRenderer/index.d.ts +13 -0
  160. package/dist/umd/container/DiagramRenderer/index.d.ts.map +1 -0
  161. package/dist/umd/container/EdgeRenderer/MarkerComponent.d.ts +11 -0
  162. package/dist/umd/container/EdgeRenderer/MarkerComponent.d.ts.map +1 -0
  163. package/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts +8 -0
  164. package/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -0
  165. package/dist/umd/container/EdgeRenderer/index.d.ts +17 -0
  166. package/dist/umd/container/EdgeRenderer/index.d.ts.map +1 -0
  167. package/dist/umd/container/EdgeRenderer/type.d.ts +9 -0
  168. package/dist/umd/container/EdgeRenderer/type.d.ts.map +1 -0
  169. package/dist/umd/container/EdgeRenderer/utils.d.ts +28 -0
  170. package/dist/umd/container/EdgeRenderer/utils.d.ts.map +1 -0
  171. package/dist/umd/container/NodeRenderer/index.d.ts +15 -0
  172. package/dist/umd/container/NodeRenderer/index.d.ts.map +1 -0
  173. package/dist/umd/container/NodeRenderer/type.d.ts +9 -0
  174. package/dist/umd/container/NodeRenderer/type.d.ts.map +1 -0
  175. package/dist/umd/container/NodeRenderer/utils.d.ts +3 -0
  176. package/dist/umd/container/NodeRenderer/utils.d.ts.map +1 -0
  177. package/dist/umd/container/ReactDiagram/DiagramView.d.ts +15 -0
  178. package/dist/umd/container/ReactDiagram/DiagramView.d.ts.map +1 -0
  179. package/dist/umd/container/ReactDiagram/Wrapper.d.ts +7 -0
  180. package/dist/umd/container/ReactDiagram/Wrapper.d.ts.map +1 -0
  181. package/dist/umd/container/ReactDiagram/index.d.ts +54 -0
  182. package/dist/umd/container/ReactDiagram/index.d.ts.map +1 -0
  183. package/dist/umd/container/Viewport/index.d.ts +7 -0
  184. package/dist/umd/container/Viewport/index.d.ts.map +1 -0
  185. package/dist/umd/container/ZoomPane/index.d.ts +8 -0
  186. package/dist/umd/container/ZoomPane/index.d.ts.map +1 -0
  187. package/dist/umd/contexts/NodeIdContext.d.ts +7 -0
  188. package/dist/umd/contexts/NodeIdContext.d.ts.map +1 -0
  189. package/dist/umd/contexts/RFStoreContext.d.ts +5 -0
  190. package/dist/umd/contexts/RFStoreContext.d.ts.map +1 -0
  191. package/dist/umd/fixtures/errorMessages.d.ts +11 -0
  192. package/dist/umd/fixtures/errorMessages.d.ts.map +1 -0
  193. package/dist/umd/hooks/useDrag/index.d.ts +10 -0
  194. package/dist/umd/hooks/useDrag/index.d.ts.map +1 -0
  195. package/dist/umd/hooks/useDrag/type.d.ts +3 -0
  196. package/dist/umd/hooks/useDrag/type.d.ts.map +1 -0
  197. package/dist/umd/hooks/useDrag/utils.d.ts +16 -0
  198. package/dist/umd/hooks/useDrag/utils.d.ts.map +1 -0
  199. package/dist/umd/hooks/useGetPointerPosition.d.ts +9 -0
  200. package/dist/umd/hooks/useGetPointerPosition.d.ts.map +1 -0
  201. package/dist/umd/hooks/useGlobalKeyHandler.d.ts +4 -0
  202. package/dist/umd/hooks/useGlobalKeyHandler.d.ts.map +1 -0
  203. package/dist/umd/hooks/useNodeOrEdgeTypes.d.ts +7 -0
  204. package/dist/umd/hooks/useNodeOrEdgeTypes.d.ts.map +1 -0
  205. package/dist/umd/hooks/useNodesEdgesState/index.d.ts +8 -0
  206. package/dist/umd/hooks/useNodesEdgesState/index.d.ts.map +1 -0
  207. package/dist/umd/hooks/useNodesEdgesState/type.d.ts +49 -0
  208. package/dist/umd/hooks/useNodesEdgesState/type.d.ts.map +1 -0
  209. package/dist/umd/hooks/useStore.d.ts +14 -0
  210. package/dist/umd/hooks/useStore.d.ts.map +1 -0
  211. package/dist/umd/hooks/useVisibleNodes.d.ts +3 -0
  212. package/dist/umd/hooks/useVisibleNodes.d.ts.map +1 -0
  213. package/dist/umd/index.d.ts +14 -0
  214. package/dist/umd/index.d.ts.map +1 -0
  215. package/dist/umd/index.js +10 -0
  216. package/dist/umd/store/index.d.ts +4 -0
  217. package/dist/umd/store/index.d.ts.map +1 -0
  218. package/dist/umd/store/initialState.d.ts +6 -0
  219. package/dist/umd/store/initialState.d.ts.map +1 -0
  220. package/dist/umd/store/utils.d.ts +18 -0
  221. package/dist/umd/store/utils.d.ts.map +1 -0
  222. package/dist/umd/types/core.d.ts +55 -0
  223. package/dist/umd/types/core.d.ts.map +1 -0
  224. package/dist/umd/types/general.d.ts +23 -0
  225. package/dist/umd/types/general.d.ts.map +1 -0
  226. package/dist/umd/types/index.d.ts +12 -0
  227. package/dist/umd/types/index.d.ts.map +1 -0
  228. package/dist/umd/types/utils.d.ts +26 -0
  229. package/dist/umd/types/utils.d.ts.map +1 -0
  230. package/dist/umd/utils/changes.d.ts +12 -0
  231. package/dist/umd/utils/changes.d.ts.map +1 -0
  232. package/dist/umd/utils/graph.d.ts +13 -0
  233. package/dist/umd/utils/graph.d.ts.map +1 -0
  234. package/dist/umd/utils/index.d.ts +22 -0
  235. package/dist/umd/utils/index.d.ts.map +1 -0
  236. package/package.json +76 -0
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const NodeIdContext: import("react").Context<string | null>;
3
+ export declare const Provider: import("react").Provider<string | null>;
4
+ export declare const Consumer: import("react").Consumer<string | null>;
5
+ export declare const useNodeId: () => string | null;
6
+ export default NodeIdContext;
7
+ //# sourceMappingURL=NodeIdContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeIdContext.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/contexts/NodeIdContext.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,aAAa,wCAAqC,CAAC;AAChE,eAAO,MAAM,QAAQ,yCAAyB,CAAC;AAC/C,eAAO,MAAM,QAAQ,yCAAyB,CAAC;AAE/C,eAAO,MAAM,SAAS,QAAO,MAAM,GAAG,IAGrC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const StoreContext: import("react").Context<import("zustand").StoreApi<import("..").ReactDiagramState> | null>;
3
+ export declare const Provider: import("react").Provider<import("zustand").StoreApi<import("..").ReactDiagramState> | null>;
4
+ export default StoreContext;
5
+ //# sourceMappingURL=RFStoreContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RFStoreContext.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/contexts/RFStoreContext.ts"],"names":[],"mappings":";AAIA,QAAA,MAAM,YAAY,4FAEjB,CAAC;AAEF,eAAO,MAAM,QAAQ,6FAAwB,CAAC;AAC9C,eAAe,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ export type ErrorMessageCode = keyof typeof errorMessages;
2
+ export declare const errorMessages: {
3
+ '001': () => string;
4
+ '002': () => string;
5
+ '010': (nodeType: string) => string;
6
+ '011': () => string;
7
+ '020': () => string;
8
+ '021': (id: string) => string;
9
+ '022': (type: string) => string;
10
+ };
11
+ //# sourceMappingURL=errorMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorMessages.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/fixtures/errorMessages.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,aAAa,CAAC;AAE1D,eAAO,MAAM,aAAa;;;sBAIL,MAAM;;;gBAIZ,MAAM;kBACJ,MAAM;CACtB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { RefObject } from 'react';
2
+ type UseDragParams = {
3
+ nodeRef: RefObject<Element>;
4
+ nodeId?: string;
5
+ isSelectable?: boolean;
6
+ noDragClassName?: string;
7
+ };
8
+ declare function useDrag({ nodeRef, nodeId, isSelectable, noDragClassName, }: UseDragParams): boolean;
9
+ export default useDrag;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/hooks/useDrag/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAsB/D,KAAK,aAAa,GAAG;IAClB,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,iBAAS,OAAO,CAAC,EACd,OAAO,EACP,MAAM,EACN,YAAY,EACZ,eAAe,GACjB,EAAE,aAAa,WAqOf;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { D3DragEvent, SubjectPosition } from 'd3';
2
+ export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
3
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/hooks/useDrag/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { RefObject } from 'react';
2
+ import { XYPosition, CoordinateExtent, OnError } from '../../types';
3
+ import { Node, NodeOrigin, NodeInternals, NodeDragItem } from '../../components/Node/type';
4
+ export declare function isParentSelected(node: Node, nodeInternals: NodeInternals): boolean;
5
+ export declare function getDragItems(nodeInternals: NodeInternals, nodesDraggable: boolean, mousePosition: XYPosition, nodeId?: string): NodeDragItem[];
6
+ export declare function calcNextPosition(node: NodeDragItem | Node, nextPosition: XYPosition, nodeInternals: NodeInternals, nodeExtent?: CoordinateExtent, nodeOrigin?: NodeOrigin, onError?: OnError): {
7
+ position: XYPosition;
8
+ positionAbsolute: XYPosition;
9
+ };
10
+ export declare function getEventHandlerParams({ nodeId, dragItems, nodeInternals, }: {
11
+ nodeId?: string;
12
+ dragItems: NodeDragItem[];
13
+ nodeInternals: NodeInternals;
14
+ }): [Node, Node[]];
15
+ export declare function hasSelector(target: Element, selector: string, nodeRef: RefObject<Element>): boolean;
16
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/hooks/useDrag/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EACJ,IAAI,EACJ,UAAU,EACV,aAAa,EACb,YAAY,EACd,MAAM,4BAA4B,CAAC;AAEpC,wBAAgB,gBAAgB,CAC7B,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,GAC5B,OAAO,CAgBT;AAED,wBAAgB,YAAY,CACzB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,OAAO,EACvB,aAAa,EAAE,UAAU,EACzB,MAAM,CAAC,EAAE,MAAM,GACf,YAAY,EAAE,CA0BhB;AAED,wBAAgB,gBAAgB,CAC7B,IAAI,EAAE,YAAY,GAAG,IAAI,EACzB,YAAY,EAAE,UAAU,EACxB,aAAa,EAAE,aAAa,EAC5B,UAAU,CAAC,EAAE,gBAAgB,EAC7B,UAAU,GAAE,UAAmB,EAC/B,OAAO,CAAC,EAAE,OAAO,GACjB;IAAE,QAAQ,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,UAAU,CAAA;CAAE,CAuExD;AAED,wBAAgB,qBAAqB,CAAC,EACnC,MAAM,EACN,SAAS,EACT,aAAa,GACf,EAAE;IACA,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;CAC/B,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAiBjB;AAED,wBAAgB,WAAW,CACxB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,GAC3B,OAAO,CAUT"}
@@ -0,0 +1,9 @@
1
+ import { UseDragEvent } from './useDrag/type';
2
+ declare function useGetPointerPosition(): ({ sourceEvent }: UseDragEvent) => {
3
+ x: number;
4
+ y: number;
5
+ xSnapped: number;
6
+ ySnapped: number;
7
+ };
8
+ export default useGetPointerPosition;
9
+ //# sourceMappingURL=useGetPointerPosition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGetPointerPosition.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/hooks/useGetPointerPosition.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,iBAAS,qBAAqB;;;;;EA+B7B;AAED,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type KeyCode = string | Array<string> | null;
2
+ declare function useGlobalKeyHandler(multiSelectionKeyCode?: KeyCode): void;
3
+ export default useGlobalKeyHandler;
4
+ //# sourceMappingURL=useGlobalKeyHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGlobalKeyHandler.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/hooks/useGlobalKeyHandler.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAEpD,iBAAS,mBAAmB,CAAC,qBAAqB,GAAE,OAAgB,QA+BnE;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { EdgeTypes, EdgeTypesWrapped } from '../container/EdgeRenderer/type';
2
+ import { NodeTypes, NodeTypesWrapped } from '../container/NodeRenderer/type';
3
+ export type CreateNodeTypes = (nodeTypes: NodeTypes) => NodeTypesWrapped;
4
+ export type CreateEdgeTypes = (edgeTypes: EdgeTypes) => EdgeTypesWrapped;
5
+ export declare function useNodeOrEdgeTypes(nodeOrEdgeTypes: NodeTypes, createTypes: CreateNodeTypes): NodeTypesWrapped;
6
+ export declare function useNodeOrEdgeTypes(nodeOrEdgeTypes: EdgeTypes, createTypes: CreateEdgeTypes): EdgeTypesWrapped;
7
+ //# sourceMappingURL=useNodeOrEdgeTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNodeOrEdgeTypes.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/hooks/useNodeOrEdgeTypes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,MAAM,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,gBAAgB,CAAC;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,gBAAgB,CAAC;AAEzE,wBAAgB,kBAAkB,CAC/B,eAAe,EAAE,SAAS,EAC1B,WAAW,EAAE,eAAe,GAC5B,gBAAgB,CAAC;AACpB,wBAAgB,kBAAkB,CAC/B,eAAe,EAAE,SAAS,EAC1B,WAAW,EAAE,eAAe,GAC5B,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { SetStateAction, Dispatch } from 'react';
2
+ import { Node, Edge } from '../../types';
3
+ import { NodeChange, EdgeChange } from './type';
4
+ export type ApplyChanges<ItemType, ChangesType> = (changes: ChangesType[], items: ItemType[]) => ItemType[];
5
+ export type OnChange<ChangesType> = (changes: ChangesType[]) => void;
6
+ export declare const useNodesState: <NodeData = any>(initialItems: Node<NodeData, string | undefined>[]) => [Node<NodeData, string | undefined>[], Dispatch<SetStateAction<Node<NodeData, string | undefined>[]>>, OnChange<NodeChange>];
7
+ export declare const useEdgesState: <EdgeData = any>(initialItems: Edge<EdgeData>[]) => [Edge<EdgeData>[], Dispatch<SetStateAction<Edge<EdgeData>[]>>, OnChange<EdgeChange>];
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/hooks/useNodesEdgesState/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEhD,MAAM,MAAM,YAAY,CAAC,QAAQ,EAAE,WAAW,IAAI,CAC/C,OAAO,EAAE,WAAW,EAAE,EACtB,KAAK,EAAE,QAAQ,EAAE,KACf,QAAQ,EAAE,CAAC;AAChB,MAAM,MAAM,QAAQ,CAAC,WAAW,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;AAwCrE,eAAO,MAAM,aAAa,sMAAwC,CAAC;AACnE,eAAO,MAAM,aAAa,0IAAwC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { Dimensions, XYPosition } from '../../types';
2
+ import { Node } from '../../components/Node/type';
3
+ import { Edge } from '../../components/Edges/type';
4
+ export type NodeDimensionChange = {
5
+ id: string;
6
+ type: 'dimensions';
7
+ dimensions?: Dimensions;
8
+ updateStyle?: boolean;
9
+ resizing?: boolean;
10
+ };
11
+ export type NodePositionChange = {
12
+ id: string;
13
+ type: 'position';
14
+ position?: XYPosition;
15
+ positionAbsolute?: XYPosition;
16
+ dragging?: boolean;
17
+ };
18
+ export type NodeSelectionChange = {
19
+ id: string;
20
+ type: 'select';
21
+ selected: boolean;
22
+ };
23
+ export type NodeRemoveChange = {
24
+ id: string;
25
+ type: 'remove';
26
+ };
27
+ export type NodeAddChange<NodeData = any> = {
28
+ item: Node<NodeData>;
29
+ type: 'add';
30
+ };
31
+ export type NodeResetChange<NodeData = any> = {
32
+ item: Node<NodeData>;
33
+ type: 'reset';
34
+ };
35
+ export type NodeChange = NodeDimensionChange | NodePositionChange | NodeSelectionChange | NodeRemoveChange | NodeAddChange | NodeResetChange;
36
+ export type EdgeSelectionChange = NodeSelectionChange;
37
+ export type EdgeRemoveChange = NodeRemoveChange;
38
+ export type EdgeAddChange<EdgeData = any> = {
39
+ item: Edge<EdgeData>;
40
+ type: 'add';
41
+ };
42
+ export type EdgeResetChange<EdgeData = any> = {
43
+ item: Edge<EdgeData>;
44
+ type: 'reset';
45
+ };
46
+ export type EdgeChange = EdgeSelectionChange | EdgeRemoveChange | EdgeAddChange | EdgeResetChange;
47
+ export type OnNodesChange = (changes: NodeChange[]) => void;
48
+ export type OnEdgesChange = (changes: EdgeChange[]) => void;
49
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/src/hooks/useNodesEdgesState/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,QAAQ,GAAG,GAAG,IAAI;IACzC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,QAAQ,GAAG,GAAG,IAAI;IAC3C,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GACjB,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,GACb,eAAe,CAAC;AAErB,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAChD,MAAM,MAAM,aAAa,CAAC,QAAQ,GAAG,GAAG,IAAI;IACzC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC;CACd,CAAC;AACF,MAAM,MAAM,eAAe,CAAC,QAAQ,GAAG,GAAG,IAAI;IAC3C,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,GACb,eAAe,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { StoreApi } from 'zustand';
2
+ import { ReactDiagramState } from '../components/ReactDiagramProvider/type';
3
+ type ExtractState = StoreApi<ReactDiagramState> extends {
4
+ getState: () => infer T;
5
+ } ? T : never;
6
+ declare function useStore<StateSlice = ExtractState>(selector: (state: ReactDiagramState) => StateSlice, equalityFn?: (a: StateSlice, b: StateSlice) => boolean): StateSlice;
7
+ declare const useStoreApi: () => {
8
+ getState: () => ReactDiagramState;
9
+ setState: (partial: ReactDiagramState | Partial<ReactDiagramState> | ((state: ReactDiagramState) => ReactDiagramState | Partial<ReactDiagramState>), replace?: boolean | undefined) => void;
10
+ subscribe: (listener: (state: ReactDiagramState, prevState: ReactDiagramState) => void) => () => void;
11
+ destroy: () => void;
12
+ };
13
+ export { useStore, useStoreApi };
14
+ //# sourceMappingURL=useStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStore.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/hooks/useStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAI5E,KAAK,YAAY,GAAG,QAAQ,CAAC,iBAAiB,CAAC,SAAS;IACrD,QAAQ,EAAE,MAAM,MAAM,CAAC,CAAC;CAC1B,GACI,CAAC,GACD,KAAK,CAAC;AAEX,iBAAS,QAAQ,CAAC,UAAU,GAAG,YAAY,EACxC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,UAAU,EAClD,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,KAAK,OAAO,cASxD;AAED,QAAA,MAAM,WAAW;;;;;CAgBhB,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare function useVisibleNodes(): import("..").Node<any, string | undefined>[];
2
+ export default useVisibleNodes;
3
+ //# sourceMappingURL=useVisibleNodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVisibleNodes.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/hooks/useVisibleNodes.ts"],"names":[],"mappings":"AAMA,iBAAS,eAAe,iDAMvB;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,14 @@
1
+ export { default as ReactDiagram } from './container/ReactDiagram';
2
+ export { default as ReactDiagramProvider } from './components/ReactDiagramProvider';
3
+ export { default as Port } from './components/Port';
4
+ export { default as BaseEdge } from './components/Edges/BaseEdge';
5
+ export { default as StepEdge } from './components/Edges/StepEdge';
6
+ export * from './hooks/useNodesEdgesState';
7
+ export { useStore, useStoreApi } from './hooks/useStore';
8
+ export { default as useGetPointerPosition } from './hooks/useGetPointerPosition';
9
+ export { useNodeId } from './contexts/NodeIdContext';
10
+ export { internalsSymbol, rectToBox, clamp } from './utils';
11
+ export { addEdge, updateEdge, getNodePositionWithOrigin } from './utils/graph';
12
+ export { applyNodeChanges, applyEdgeChanges } from './utils/changes';
13
+ export * from './types';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["react-diagram/packages/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAElE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAErE,cAAc,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactCosmosDiagram={},t.jsxRuntime,t.React)}(this,(function(t,e,n){"use strict";const o=t=>{let e;const n=new Set,o=(t,o)=>{const r="function"==typeof t?t(e):t;if(!Object.is(r,e)){const t=e;e=(null!=o?o:"object"!=typeof r)?r:Object.assign({},e,r),n.forEach((n=>n(e,t)))}},r=()=>e,i={setState:o,getState:r,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(o,r,i),i};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i,a,s,u={exports:{}},l={},c={exports:{}},d={};function h(){return a||(a=1,c.exports=function(){if(i)return d;i=1;var t=n,e="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=t.useState,r=t.useEffect,a=t.useLayoutEffect,s=t.useDebugValue;function u(t){var n=t.getSnapshot;t=t.value;try{var o=n();return!e(t,o)}catch(t){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),i=o({inst:{value:n,getSnapshot:e}}),l=i[0].inst,c=i[1];return a((function(){l.value=n,l.getSnapshot=e,u(l)&&c({inst:l})}),[t,n,e]),r((function(){return u(l)&&c({inst:l}),t((function(){u(l)&&c({inst:l})}))}),[t]),s(n),n};return d.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:l,d}()),c.exports}
2
+ /**
3
+ * @license React
4
+ * use-sync-external-store-shim/with-selector.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */u.exports=function(){if(s)return l;s=1;var t=n,e=h(),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},r=e.useSyncExternalStore,i=t.useRef,a=t.useEffect,u=t.useMemo,c=t.useDebugValue;return l.useSyncExternalStoreWithSelector=function(t,e,n,s,l){var d=i(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=u((function(){function t(t){if(!a){if(a=!0,r=t,t=s(t),void 0!==l&&h.hasValue){var e=h.value;if(l(e,t))return i=e}return i=t}if(e=i,o(r,t))return e;var n=s(t);return void 0!==l&&l(e,n)?e:(r=t,i=n)}var r,i,a=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]}),[e,n,s,l]);var f=r(t,d[0],d[1]);return a((function(){h.hasValue=!0,h.value=f}),[f]),c(f),f},l}();var f=r(u.exports);const{useSyncExternalStoreWithSelector:p}=f;let g=!1;const m=n.createContext(null),y=m.Provider,v={"001":()=>"Seems like you have not used zustand provider as an ancestor","002":()=>"It looks like you`ve created a new nodeTypes or edgeTypes object. If this wasn`t on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.","010":t=>`Node type "${t}" not found. Using fallback type "default".`,"011":()=>"Only child nodes can use a parent extent","020":()=>"Can`t create edge. An edge needs a source and a target.","021":t=>`The old edge with id=${t} does not exist.`,"022":t=>`Marker type "${t}" doesn't exist.`},x=v["001"]();function b(t,e){const o=n.useContext(m);if(null===o)throw new Error(x);return function(t,e=t.getState,o){o&&!g&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),g=!0);const r=p(t.subscribe,t.getState,t.getServerState||t.getState,e,o);return n.useDebugValue(r),r}(o,t,e)}const w=()=>{const t=n.useContext(m);if(null===t)throw new Error(x);return n.useMemo((()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy})),[t])};var _={value:()=>{}};function E(){for(var t,e=0,n=arguments.length,o={};e<n;++e){if(!(t=arguments[e]+"")||t in o||/[\s.]/.test(t))throw new Error("illegal type: "+t);o[t]=[]}return new N(o)}function N(t){this._=t}function S(t,e){for(var n,o=0,r=t.length;o<r;++o)if((n=t[o]).name===e)return n.value}function M(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=_,t=t.slice(0,o).concat(t.slice(o+1));break}return null!=n&&t.push({name:e,value:n}),t}N.prototype=E.prototype={constructor:N,on:function(t,e){var n,o,r=this._,i=(o=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!o.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=i[a]).type)r[n]=M(r[n],t.name,e);else if(null==e)for(n in r)r[n]=M(r[n],t.name,null);return this}for(;++a<s;)if((n=(t=i[a]).type)&&(n=S(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new N(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),i=0;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(o=this._[t]).length;i<n;++i)o[i].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)}};var k="http://www.w3.org/1999/xhtml",P={svg:"http://www.w3.org/2000/svg",xhtml:k,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function C(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),P.hasOwnProperty(e)?{space:P[e],local:t}:t}function A(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===k&&e.documentElement.namespaceURI===k?e.createElement(t):e.createElementNS(n,t)}}function T(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function I(t){var e=C(t);return(e.local?T:A)(e)}function $(){}function z(t){return null==t?$:function(){return this.querySelector(t)}}function D(){return[]}function j(t){return null==t?D:function(){return this.querySelectorAll(t)}}function R(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function B(t){return function(){return this.matches(t)}}function O(t){return function(e){return e.matches(t)}}var L=Array.prototype.find;function X(){return this.firstElementChild}var Y=Array.prototype.filter;function U(){return Array.from(this.children)}function V(t){return new Array(t.length)}function Z(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function q(t,e,n,o,r,i){for(var a,s=0,u=e.length,l=i.length;s<l;++s)(a=e[s])?(a.__data__=i[s],o[s]=a):n[s]=new Z(t,i[s]);for(;s<u;++s)(a=e[s])&&(r[s]=a)}function F(t,e,n,o,r,i,a){var s,u,l,c=new Map,d=e.length,h=i.length,f=new Array(d);for(s=0;s<d;++s)(u=e[s])&&(f[s]=l=a.call(u,u.__data__,s,e)+"",c.has(l)?r[s]=u:c.set(l,u));for(s=0;s<h;++s)l=a.call(t,i[s],s,i)+"",(u=c.get(l))?(o[s]=u,u.__data__=i[s],c.delete(l)):n[s]=new Z(t,i[s]);for(s=0;s<d;++s)(u=e[s])&&c.get(f[s])===u&&(r[s]=u)}function W(t){return t.__data__}function H(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function K(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function G(t){return function(){this.removeAttribute(t)}}function Q(t){return function(){this.removeAttributeNS(t.space,t.local)}}function J(t,e){return function(){this.setAttribute(t,e)}}function tt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function et(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function nt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ot(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function rt(t){return function(){this.style.removeProperty(t)}}function it(t,e,n){return function(){this.style.setProperty(t,e,n)}}function at(t,e,n){return function(){var o=e.apply(this,arguments);null==o?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function st(t,e){return t.style.getPropertyValue(e)||ot(t).getComputedStyle(t,null).getPropertyValue(e)}function ut(t){return function(){delete this[t]}}function lt(t,e){return function(){this[t]=e}}function ct(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function dt(t){return t.trim().split(/^|\s+/)}function ht(t){return t.classList||new ft(t)}function ft(t){this._node=t,this._names=dt(t.getAttribute("class")||"")}function pt(t,e){for(var n=ht(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function gt(t,e){for(var n=ht(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function mt(t){return function(){pt(this,t)}}function yt(t){return function(){gt(this,t)}}function vt(t,e){return function(){(e.apply(this,arguments)?pt:gt)(this,t)}}function xt(){this.textContent=""}function bt(t){return function(){this.textContent=t}}function wt(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function _t(){this.innerHTML=""}function Et(t){return function(){this.innerHTML=t}}function Nt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function St(){this.nextSibling&&this.parentNode.appendChild(this)}function Mt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function kt(){return null}function Pt(){var t=this.parentNode;t&&t.removeChild(this)}function Ct(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function At(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Tt(t){return function(){var e=this.__on;if(e){for(var n,o=0,r=-1,i=e.length;o<i;++o)n=e[o],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function It(t,e,n){return function(){var o,r=this.__on,i=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var a=0,s=r.length;a<s;++a)if((o=r[a]).type===t.type&&o.name===t.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),void(o.value=e);this.addEventListener(t.type,i,n),o={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(o):this.__on=[o]}}function $t(t,e,n){var o=ot(t),r=o.CustomEvent;"function"==typeof r?r=new r(e,n):(r=o.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function zt(t,e){return function(){return $t(this,t,e)}}function Dt(t,e){return function(){return $t(this,t,e.apply(this,arguments))}}Z.prototype={constructor:Z,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},ft.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var jt=[null];function Rt(t,e){this._groups=t,this._parents=e}function Bt(){return new Rt([[document.documentElement]],jt)}function Ot(t){return"string"==typeof t?new Rt([[document.querySelector(t)]],[document.documentElement]):new Rt([[t]],jt)}function Lt(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(e.getScreenCTM().inverse())).x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}Rt.prototype=Bt.prototype={constructor:Rt,select:function(t){"function"!=typeof t&&(t=z(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a,s=e[r],u=s.length,l=o[r]=new Array(u),c=0;c<u;++c)(i=s[c])&&(a=t.call(i,i.__data__,c,s))&&("__data__"in i&&(a.__data__=i.__data__),l[c]=a);return new Rt(o,this._parents)},selectAll:function(t){t="function"==typeof t?R(t):j(t);for(var e=this._groups,n=e.length,o=[],r=[],i=0;i<n;++i)for(var a,s=e[i],u=s.length,l=0;l<u;++l)(a=s[l])&&(o.push(t.call(a,a.__data__,l,s)),r.push(a));return new Rt(o,r)},selectChild:function(t){return this.select(null==t?X:function(t){return function(){return L.call(this.children,t)}}("function"==typeof t?t:O(t)))},selectChildren:function(t){return this.selectAll(null==t?U:function(t){return function(){return Y.call(this.children,t)}}("function"==typeof t?t:O(t)))},filter:function(t){"function"!=typeof t&&(t=B(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a=e[r],s=a.length,u=o[r]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&u.push(i);return new Rt(o,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,W);var n,o=e?F:q,r=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,s=new Array(a),u=new Array(a),l=new Array(a),c=0;c<a;++c){var d=r[c],h=i[c],f=h.length,p=H(t.call(d,d&&d.__data__,c,r)),g=p.length,m=u[c]=new Array(g),y=s[c]=new Array(g);o(d,h,m,y,l[c]=new Array(f),p,e);for(var v,x,b=0,w=0;b<g;++b)if(v=m[b]){for(b>=w&&(w=b+1);!(x=y[w])&&++w<g;);v._next=x||null}}return(s=new Rt(s,r))._enter=u,s._exit=l,s},enter:function(){return new Rt(this._enter||this._groups.map(V),this._parents)},exit:function(){return new Rt(this._exit||this._groups.map(V),this._parents)},join:function(t,e,n){var o=this.enter(),r=this,i=this.exit();return"function"==typeof t?(o=t(o))&&(o=o.selection()):o=o.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?i.remove():n(i),o&&r?o.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,r=n.length,i=o.length,a=Math.min(r,i),s=new Array(r),u=0;u<a;++u)for(var l,c=n[u],d=o[u],h=c.length,f=s[u]=new Array(h),p=0;p<h;++p)(l=c[p]||d[p])&&(f[p]=l);for(;u<r;++u)s[u]=n[u];return new Rt(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o,r=t[e],i=r.length-1,a=r[i];--i>=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=K);for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var a,s=n[i],u=s.length,l=r[i]=new Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(e)}return new Rt(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length;r<i;++r){var a=o[r];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var r,i=e[n],a=0,s=i.length;a<s;++a)(r=i[a])&&t.call(r,r.__data__,a,i);return this},attr:function(t,e){var n=C(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==e?n.local?Q:G:"function"==typeof e?n.local?nt:et:n.local?tt:J)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?rt:"function"==typeof e?at:it)(t,e,null==n?"":n)):st(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?ut:"function"==typeof e?ct:lt)(t,e)):this.node()[t]},classed:function(t,e){var n=dt(t+"");if(arguments.length<2){for(var o=ht(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?vt:e?mt:yt)(n,e))},text:function(t){return arguments.length?this.each(null==t?xt:("function"==typeof t?wt:bt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?_t:("function"==typeof t?Nt:Et)(t)):this.node().innerHTML},raise:function(){return this.each(St)},lower:function(){return this.each(Mt)},append:function(t){var e="function"==typeof t?t:I(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:I(t),o=null==e?kt:"function"==typeof e?e:z(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(Pt)},clone:function(t){return this.select(t?At:Ct)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var o,r,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(s=e?It:Tt,o=0;o<a;++o)this.each(s(i[o],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(o=0,u=s[l];o<a;++o)if((r=i[o]).type===u.type&&r.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?Dt:zt)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o,r=t[e],i=0,a=r.length;i<a;++i)(o=r[i])&&(yield o)}};const Xt={passive:!1},Yt={capture:!0,passive:!1};function Ut(t){t.stopImmediatePropagation()}function Vt(t){t.preventDefault(),t.stopImmediatePropagation()}function Zt(t){var e=t.document.documentElement,n=Ot(t).on("dragstart.drag",Vt,Yt);"onselectstart"in e?n.on("selectstart.drag",Vt,Yt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function qt(t,e){var n=t.document.documentElement,o=Ot(t).on("dragstart.drag",null);e&&(o.on("click.drag",Vt,Yt),setTimeout((function(){o.on("click.drag",null)}),0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Ft=t=>()=>t;function Wt(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function Ht(t){return!t.ctrlKey&&!t.button}function Kt(){return this.parentNode}function Gt(t,e){return null==e?{x:t.x,y:t.y}:e}function Qt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function te(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function ee(){}Wt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var ne=.7,oe=1/ne,re="\\s*([+-]?\\d+)\\s*",ie="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",se=/^#([0-9a-f]{3,8})$/,ue=new RegExp(`^rgb\\(${re},${re},${re}\\)$`),le=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),ce=new RegExp(`^rgba\\(${re},${re},${re},${ie}\\)$`),de=new RegExp(`^rgba\\(${ae},${ae},${ae},${ie}\\)$`),he=new RegExp(`^hsl\\(${ie},${ae},${ae}\\)$`),fe=new RegExp(`^hsla\\(${ie},${ae},${ae},${ie}\\)$`),pe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ge(){return this.rgb().formatHex()}function me(){return this.rgb().formatRgb()}function ye(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=se.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ve(e):3===n?new we(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?xe(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?xe(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ue.exec(t))?new we(e[1],e[2],e[3],1):(e=le.exec(t))?new we(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ce.exec(t))?xe(e[1],e[2],e[3],e[4]):(e=de.exec(t))?xe(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=he.exec(t))?ke(e[1],e[2]/100,e[3]/100,1):(e=fe.exec(t))?ke(e[1],e[2]/100,e[3]/100,e[4]):pe.hasOwnProperty(t)?ve(pe[t]):"transparent"===t?new we(NaN,NaN,NaN,0):null}function ve(t){return new we(t>>16&255,t>>8&255,255&t,1)}function xe(t,e,n,o){return o<=0&&(t=e=n=NaN),new we(t,e,n,o)}function be(t,e,n,o){return 1===arguments.length?((r=t)instanceof ee||(r=ye(r)),r?new we((r=r.rgb()).r,r.g,r.b,r.opacity):new we):new we(t,e,n,null==o?1:o);var r}function we(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}function _e(){return`#${Me(this.r)}${Me(this.g)}${Me(this.b)}`}function Ee(){const t=Ne(this.opacity);return`${1===t?"rgb(":"rgba("}${Se(this.r)}, ${Se(this.g)}, ${Se(this.b)}${1===t?")":`, ${t})`}`}function Ne(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Se(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Me(t){return((t=Se(t))<16?"0":"")+t.toString(16)}function ke(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ce(t,e,n,o)}function Pe(t){if(t instanceof Ce)return new Ce(t.h,t.s,t.l,t.opacity);if(t instanceof ee||(t=ye(t)),!t)return new Ce;if(t instanceof Ce)return t;var e=(t=t.rgb()).r/255,n=t.g/255,o=t.b/255,r=Math.min(e,n,o),i=Math.max(e,n,o),a=NaN,s=i-r,u=(i+r)/2;return s?(a=e===i?(n-o)/s+6*(n<o):n===i?(o-e)/s+2:(e-n)/s+4,s/=u<.5?i+r:2-i-r,a*=60):s=u>0&&u<1?0:a,new Ce(a,s,u,t.opacity)}function Ce(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}function Ae(t){return(t=(t||0)%360)<0?t+360:t}function Te(t){return Math.max(0,Math.min(1,t||0))}function Ie(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Jt(ee,ye,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ge,formatHex:ge,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Pe(this).formatHsl()},formatRgb:me,toString:me}),Jt(we,be,te(ee,{brighter(t){return t=null==t?oe:Math.pow(oe,t),new we(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?ne:Math.pow(ne,t),new we(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new we(Se(this.r),Se(this.g),Se(this.b),Ne(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_e,formatHex:_e,formatHex8:function(){return`#${Me(this.r)}${Me(this.g)}${Me(this.b)}${Me(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ee,toString:Ee})),Jt(Ce,(function(t,e,n,o){return 1===arguments.length?Pe(t):new Ce(t,e,n,null==o?1:o)}),te(ee,{brighter(t){return t=null==t?oe:Math.pow(oe,t),new Ce(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?ne:Math.pow(ne,t),new Ce(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,r=2*n-o;return new we(Ie(t>=240?t-240:t+120,r,o),Ie(t,r,o),Ie(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new Ce(Ae(this.h),Te(this.s),Te(this.l),Ne(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ne(this.opacity);return`${1===t?"hsl(":"hsla("}${Ae(this.h)}, ${100*Te(this.s)}%, ${100*Te(this.l)}%${1===t?")":`, ${t})`}`}}));var $e=t=>()=>t;function ze(t){return 1==(t=+t)?De:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}(e,n,t):$e(isNaN(e)?n:e)}}function De(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):$e(isNaN(t)?e:t)}var je=function t(e){var n=ze(e);function o(t,e){var o=n((t=be(t)).r,(e=be(e)).r),r=n(t.g,e.g),i=n(t.b,e.b),a=De(t.opacity,e.opacity);return function(e){return t.r=o(e),t.g=r(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function Re(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Be=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Oe=new RegExp(Be.source,"g");function Le(t,e){var n,o,r,i=Be.lastIndex=Oe.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=Be.exec(t))&&(o=Oe.exec(e));)(r=o.index)>i&&(r=e.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,u.push({i:a,x:Re(n,o)})),i=Oe.lastIndex;return i<e.length&&(r=e.slice(i),s[a]?s[a]+=r:s[++a]=r),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,o=0;o<e;++o)s[(n=u[o]).i]=n.x(t);return s.join("")})}var Xe,Ye=180/Math.PI,Ue={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ve(t,e,n,o,r,i){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*o)&&(n-=t*u,o-=e*u),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,u/=s),t*o<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(e,t)*Ye,skewX:Math.atan(u)*Ye,scaleX:a,scaleY:s}}function Ze(t,e,n,o){function r(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],u=[];return i=t(i),a=t(a),function(t,o,r,i,a,s){if(t!==r||o!==i){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:Re(t,r)},{i:u-2,x:Re(o,i)})}else(r||i)&&a.push("translate("+r+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,u),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Re(t,e)})):e&&n.push(r(n)+"rotate("+e+o)}(i.rotate,a.rotate,s,u),function(t,e,n,i){t!==e?i.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Re(t,e)}):e&&n.push(r(n)+"skewX("+e+o)}(i.skewX,a.skewX,s,u),function(t,e,n,o,i,a){if(t!==n||e!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Re(t,n)},{i:s-2,x:Re(e,o)})}else 1===n&&1===o||i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,u),i=a=null,function(t){for(var e,n=-1,o=u.length;++n<o;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var qe=Ze((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ue:Ve(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Fe=Ze((function(t){return null==t?Ue:(Xe||(Xe=document.createElementNS("http://www.w3.org/2000/svg","g")),Xe.setAttribute("transform",t),(t=Xe.transform.baseVal.consolidate())?Ve((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Ue)}),", ",")",")");function We(t){return((t=Math.exp(t))+1/t)/2}var He,Ke,Ge=function t(e,n,o){function r(t,r){var i,a,s=t[0],u=t[1],l=t[2],c=r[0],d=r[1],h=r[2],f=c-s,p=d-u,g=f*f+p*p;if(g<1e-12)a=Math.log(h/l)/e,i=function(t){return[s+t*f,u+t*p,l*Math.exp(e*t*a)]};else{var m=Math.sqrt(g),y=(h*h-l*l+o*g)/(2*l*n*m),v=(h*h-l*l-o*g)/(2*h*n*m),x=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(v*v+1)-v);a=(b-x)/e,i=function(t){var o,r=t*a,i=We(x),c=l/(n*m)*(i*(o=e*r+x,((o=Math.exp(2*o))-1)/(o+1))-function(t){return((t=Math.exp(t))-1/t)/2}(x));return[s+c*f,u+c*p,l*i/We(e*r+x)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return r.rho=function(e){var n=Math.max(.001,+e),o=n*n;return t(n,o,o*o)},r}(Math.SQRT2,2,4),Qe=0,Je=0,tn=0,en=1e3,nn=0,on=0,rn=0,an="object"==typeof performance&&performance.now?performance:Date,sn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function un(){return on||(sn(ln),on=an.now()+rn)}function ln(){on=0}function cn(){this._call=this._time=this._next=null}function dn(t,e,n){var o=new cn;return o.restart(t,e,n),o}function hn(){on=(nn=an.now())+rn,Qe=Je=0;try{!function(){un(),++Qe;for(var t,e=He;e;)(t=on-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qe}()}finally{Qe=0,function(){var t,e,n=He,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:He=e);Ke=t,pn(o)}(),on=0}}function fn(){var t=an.now(),e=t-nn;e>en&&(rn-=e,nn=t)}function pn(t){Qe||(Je&&(Je=clearTimeout(Je)),t-on>24?(t<1/0&&(Je=setTimeout(hn,t-an.now()-rn)),tn&&(tn=clearInterval(tn))):(tn||(nn=an.now(),tn=setInterval(fn,en)),Qe=1,sn(hn)))}function gn(t,e,n){var o=new cn;return e=null==e?0:+e,o.restart((n=>{o.stop(),t(n+e)}),e,n),o}cn.prototype=dn.prototype={constructor:cn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?un():+n)+(null==e?0:+e),this._next||Ke===this||(Ke?Ke._next=this:He=this,Ke=this),this._call=t,this._time=n,pn()},stop:function(){this._call&&(this._call=null,this._time=1/0,pn())}};var mn=E("start","end","cancel","interrupt"),yn=[],vn=0,xn=1,bn=2,wn=3,_n=4,En=5,Nn=6;function Sn(t,e,n,o,r,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var o,r=t.__transition;function i(t){n.state=xn,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(i){var l,c,d,h;if(n.state!==xn)return u();for(l in r)if((h=r[l]).name===n.name){if(h.state===wn)return gn(a);h.state===_n?(h.state=Nn,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[l]):+l<e&&(h.state=Nn,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[l])}if(gn((function(){n.state===wn&&(n.state=_n,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=bn,n.on.call("start",t,t.__data__,n.index,n.group),n.state===bn){for(n.state=wn,o=new Array(d=n.tween.length),l=0,c=-1;l<d;++l)(h=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(o[++c]=h);o.length=c+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=En,1),i=-1,a=o.length;++i<a;)o[i].call(t,r);n.state===En&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var o in n.state=Nn,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=dn(i,0,n.time)}(t,n,{name:e,index:o,group:r,on:mn,tween:yn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:vn})}function Mn(t,e){var n=Pn(t,e);if(n.state>vn)throw new Error("too late; already scheduled");return n}function kn(t,e){var n=Pn(t,e);if(n.state>wn)throw new Error("too late; already running");return n}function Pn(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Cn(t,e){var n,o,r,i=t.__transition,a=!0;if(i){for(r in e=null==e?null:e+"",i)(n=i[r]).name===e?(o=n.state>bn&&n.state<En,n.state=Nn,n.timer.stop(),n.on.call(o?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[r]):a=!1;a&&delete t.__transition}}function An(t,e){var n,o;return function(){var r=kn(this,t),i=r.tween;if(i!==n)for(var a=0,s=(o=n=i).length;a<s;++a)if(o[a].name===e){(o=o.slice()).splice(a,1);break}r.tween=o}}function Tn(t,e,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var i=kn(this,t),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:e,value:n},u=0,l=r.length;u<l;++u)if(r[u].name===e){r[u]=s;break}u===l&&r.push(s)}i.tween=r}}function In(t,e,n){var o=t._id;return t.each((function(){var t=kn(this,o);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Pn(t,o).value[e]}}function $n(t,e){var n;return("number"==typeof e?Re:e instanceof ye?je:(n=ye(e))?(e=n,je):Le)(t,e)}function zn(t){return function(){this.removeAttribute(t)}}function Dn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function jn(t,e,n){var o,r,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===o?r:r=e(o=a,n)}}function Rn(t,e,n){var o,r,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?r:r=e(o=a,n)}}function Bn(t,e,n){var o,r,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===o&&s===r?i:(r=s,i=e(o=a,u));this.removeAttribute(t)}}function On(t,e,n){var o,r,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===o&&s===r?i:(r=s,i=e(o=a,u));this.removeAttributeNS(t.space,t.local)}}function Ln(t,e){var n,o;function r(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Xn(t,e){var n,o;function r(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Yn(t,e){return function(){Mn(this,t).delay=+e.apply(this,arguments)}}function Un(t,e){return e=+e,function(){Mn(this,t).delay=e}}function Vn(t,e){return function(){kn(this,t).duration=+e.apply(this,arguments)}}function Zn(t,e){return e=+e,function(){kn(this,t).duration=e}}var qn=Bt.prototype.constructor;function Fn(t){return function(){this.style.removeProperty(t)}}var Wn=0;function Hn(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function Kn(){return++Wn}var Gn=Bt.prototype;Hn.prototype={constructor:Hn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=z(t));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var s,u,l=o[a],c=l.length,d=i[a]=new Array(c),h=0;h<c;++h)(s=l[h])&&(u=t.call(s,s.__data__,h,l))&&("__data__"in s&&(u.__data__=s.__data__),d[h]=u,Sn(d[h],e,n,h,d,Pn(s,n)));return new Hn(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=j(t));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var u,l=o[s],c=l.length,d=0;d<c;++d)if(u=l[d]){for(var h,f=t.call(u,u.__data__,d,l),p=Pn(u,n),g=0,m=f.length;g<m;++g)(h=f[g])&&Sn(h,e,n,g,f,p);i.push(f),a.push(u)}return new Hn(i,a,e,n)},selectChild:Gn.selectChild,selectChildren:Gn.selectChildren,filter:function(t){"function"!=typeof t&&(t=B(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a=e[r],s=a.length,u=o[r]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&u.push(i);return new Hn(o,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,r=n.length,i=Math.min(o,r),a=new Array(o),s=0;s<i;++s)for(var u,l=e[s],c=n[s],d=l.length,h=a[s]=new Array(d),f=0;f<d;++f)(u=l[f]||c[f])&&(h[f]=u);for(;s<o;++s)a[s]=e[s];return new Hn(a,this._parents,this._name,this._id)},selection:function(){return new qn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Kn(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],u=s.length,l=0;l<u;++l)if(a=s[l]){var c=Pn(a,e);Sn(a,t,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Hn(o,this._parents,t,n)},call:Gn.call,nodes:Gn.nodes,node:Gn.node,size:Gn.size,empty:Gn.empty,each:Gn.each,on:function(t,e){var n=this._id;return arguments.length<2?Pn(this.node(),n).on.on(t):this.each(function(t,e,n){var o,r,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Mn:kn;return function(){var a=i(this,t),s=a.on;s!==o&&(r=(o=s).copy()).on(e,n),a.on=r}}(n,t,e))},attr:function(t,e){var n=C(t),o="transform"===n?Fe:$n;return this.attrTween(t,"function"==typeof e?(n.local?On:Bn)(n,o,In(this,"attr."+t,e)):null==e?(n.local?Dn:zn)(n):(n.local?Rn:jn)(n,o,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var o=C(t);return this.tween(n,(o.local?Ln:Xn)(o,e))},style:function(t,e,n){var o="transform"==(t+="")?qe:$n;return null==e?this.styleTween(t,function(t,e){var n,o,r;return function(){var i=st(this,t),a=(this.style.removeProperty(t),st(this,t));return i===a?null:i===n&&a===o?r:r=e(n=i,o=a)}}(t,o)).on("end.style."+t,Fn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var o,r,i;return function(){var a=st(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=st(this,t)),a===u?null:a===o&&u===r?i:(r=u,i=e(o=a,s))}}(t,o,In(this,"style."+t,e))).each(function(t,e){var n,o,r,i,a="style."+e,s="end."+a;return function(){var u=kn(this,t),l=u.on,c=null==u.value[a]?i||(i=Fn(e)):void 0;l===n&&r===c||(o=(n=l).copy()).on(s,r=c),u.on=o}}(this._id,t)):this.styleTween(t,function(t,e,n){var o,r,i=n+"";return function(){var a=st(this,t);return a===i?null:a===o?r:r=e(o=a,n)}}(t,o,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==e)return this.tween(o,null);if("function"!=typeof e)throw new Error;return this.tween(o,function(t,e,n){var o,r;function i(){var i=e.apply(this,arguments);return i!==r&&(o=(r=i)&&function(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}(t,i,n)),o}return i._value=e,i}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(In(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function o(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&function(t){return function(e){this.textContent=t.call(this,e)}}(o)),e}return o._value=t,o}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o,r=Pn(this.node(),n).tween,i=0,a=r.length;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((null==e?An:Tn)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Yn:Un)(e,t)):Pn(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Vn:Zn)(e,t)):Pn(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){kn(this,t).ease=e}}(e,t)):Pn(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;kn(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,o=n._id,r=n.size();return new Promise((function(i,a){var s={value:a},u={value:function(){0==--r&&i()}};n.each((function(){var n=kn(this,o),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e})),0===r&&i()}))},[Symbol.iterator]:Gn[Symbol.iterator]};var Qn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Jn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Bt.prototype.interrupt=function(t){return this.each((function(){Cn(this,t)}))},Bt.prototype.transition=function(t){var e,n;t instanceof Hn?(e=t._id,t=t._name):(e=Kn(),(n=Qn).time=un(),t=null==t?null:t+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],u=s.length,l=0;l<u;++l)(a=s[l])&&Sn(a,t,e,l,s,n||Jn(a,e));return new Hn(o,this._parents,t,e)};var to=t=>()=>t;function eo(t,{sourceEvent:e,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function no(t,e,n){this.k=t,this.x=e,this.y=n}no.prototype={constructor:no,scale:function(t){return 1===t?this:new no(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new no(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var oo=new no(1,0,0);function ro(t){t.stopImmediatePropagation()}function io(t){t.preventDefault(),t.stopImmediatePropagation()}function ao(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function so(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function uo(){return this.__zoom||oo}function lo(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function co(){return navigator.maxTouchPoints||"ontouchstart"in this}function ho(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function fo(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,o]of t)if(!Object.is(o,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(e,n[o])||!Object.is(t[n[o]],e[n[o]]))return!1;return!0}no.prototype;const po=Symbol.for("internals"),go=t=>!isNaN(t)&&isFinite(t),mo=t=>({width:t.offsetWidth,height:t.offsetHeight}),yo=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),vo=(t={x:0,y:0},e)=>({x:yo(t.x,e[0][0],e[1][0]),y:yo(t.y,e[0][1],e[1][1])}),xo=t=>"clientX"in t,bo=(t,e)=>{const n=xo(t),o=n?t.clientX:t.touches?.[0].clientX,r=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:r-(e?.top??0)}},wo=(t,e,n,o)=>{const r=e-n;return t<n?yo(Math.abs(t-n),1,50)/50*o:t>r?-yo(Math.abs(t-r),1,50)/50*o:0},_o=(t,e)=>[wo(t.x,e.width,30,10),wo(t.y,e.height,30,10)],Eo=t=>{const{x:e,y:n,k:o}=t;return{x:e,y:n,zoom:o}},No=(t,e)=>t.target.closest(`.${e}`),So=(t,e)=>{const{x:n,y:o,zoom:r}=t,{x:i,y:a,k:s}=e;return n!==i||o!==a||r!==s},Mo=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection});function ko({noPanClassName:t,panning:o,minZoom:r,maxZoom:i,defaultViewport:a,translateExtent:s,children:u,onMove:l,onMoveStart:c,onMoveEnd:d}){const h=w(),f=n.useRef(!1),p=n.useRef(null),g=n.useRef(),m=n.useRef({x:0,y:0,zoom:0}),y=n.useRef(),{d3Zoom:v,d3Selection:x}=b(Mo,fo);return n.useEffect((()=>{if(p.current){const t=p.current.getBoundingClientRect(),e=function(){var t,e,n,o=ao,r=so,i=ho,a=lo,s=co,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,d=Ge,h=E("start","zoom","end"),f=500,p=150,g=0,m=10;function y(t){t.property("__zoom",uo).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",k).filter(s).on("touchstart.zoom",P).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new no(e,t.x,t.y)}function x(t,e,n){var o=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return o===t.x&&r===t.y?t:new no(t.k,o,r)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,o){t.on("start.zoom",(function(){_(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){_(this,arguments).event(o).end()})).tween("zoom",(function(){var t=this,i=arguments,a=_(t,i).event(o),s=r.apply(t,i),u=null==n?b(s):"function"==typeof n?n.apply(t,i):n,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),c=t.__zoom,h="function"==typeof e?e.apply(t,i):e,f=d(c.invert(u).concat(l/c.k),h.invert(u).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=f(t),n=l/e[2];t=new no(n,u[0]-e[0]*n,u[1]-e[1]*n)}a.zoom(null,t)}}))}function _(t,e,n){return!n&&t.__zooming||new N(t,e)}function N(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function S(t,...e){if(o.apply(this,arguments)){var n=_(this,e).event(t),r=this.__zoom,s=Math.max(u[0],Math.min(u[1],r.k*Math.pow(2,a.apply(this,arguments)))),c=Lt(t);if(n.wheel)n.mouse[0][0]===c[0]&&n.mouse[0][1]===c[1]||(n.mouse[1]=r.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[c,r.invert(c)],Cn(this),n.start()}io(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",i(x(v(r,s),n.mouse[0],n.mouse[1]),n.extent,l))}}function M(t,...e){if(!n&&o.apply(this,arguments)){var r=t.currentTarget,a=_(this,e,!0).event(t),s=Ot(t.view).on("mousemove.zoom",(function(t){if(io(t),!a.moved){var e=t.clientX-c,n=t.clientY-d;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",i(x(a.that.__zoom,a.mouse[0]=Lt(t,r),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),qt(t.view,a.moved),io(t),a.event(t).end()}),!0),u=Lt(t,r),c=t.clientX,d=t.clientY;Zt(t.view),ro(t),a.mouse=[u,this.__zoom.invert(u)],Cn(this),a.start()}}function k(t,...e){if(o.apply(this,arguments)){var n=this.__zoom,a=Lt(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),d=i(x(v(n,u),a,s),r.apply(this,e),l);io(t),c>0?Ot(this).transition().duration(c).call(w,d,a,t):Ot(this).call(y.transform,d,a,t)}}function P(n,...r){if(o.apply(this,arguments)){var i,a,s,u,l=n.touches,c=l.length,d=_(this,r,n.changedTouches.length===c).event(n);for(ro(n),a=0;a<c;++a)u=[u=Lt(s=l[a],this),this.__zoom.invert(u),s.identifier],d.touch0?d.touch1||d.touch0[2]===u[2]||(d.touch1=u,d.taps=0):(d.touch0=u,i=!0,d.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(d.taps<2&&(e=u[0],t=setTimeout((function(){t=null}),f)),Cn(this),d.start())}}function C(t,...e){if(this.__zooming){var n,o,r,a,s=_(this,e).event(t),u=t.changedTouches,c=u.length;for(io(t),n=0;n<c;++n)r=Lt(o=u[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var d=s.touch0[0],h=s.touch0[1],f=s.touch1[0],p=s.touch1[1],g=(g=f[0]-d[0])*g+(g=f[1]-d[1])*g,m=(m=p[0]-h[0])*m+(m=p[1]-h[1])*m;o=v(o,Math.sqrt(g/m)),r=[(d[0]+f[0])/2,(d[1]+f[1])/2],a=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(x(o,r,a),s.extent,l))}}function A(t,...o){if(this.__zooming){var r,i,a=_(this,o).event(t),s=t.changedTouches,u=s.length;for(ro(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),f),r=0;r<u;++r)i=s[r],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=Lt(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<m)){var l=Ot(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return y.transform=function(t,e,n,o){var r=t.selection?t.selection():t;r.property("__zoom",uo),t!==r?w(t,e,n,o):r.interrupt().each((function(){_(this,arguments).event(o).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},y.scaleBy=function(t,e,n,o){y.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,o)},y.scaleTo=function(t,e,n,o){y.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==n?b(t):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(a),u="function"==typeof e?e.apply(this,arguments):e;return i(x(v(o,u),a,s),t,l)}),n,o)},y.translateBy=function(t,e,n,o){y.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),l)}),null,o)},y.translateTo=function(t,e,n,o,a){y.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==o?b(t):"function"==typeof o?o.apply(this,arguments):o;return i(oo.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,l)}),o,a)},N.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=Ot(this.that).datum();h.call(t,this.that,new eo(t,{sourceEvent:this.sourceEvent,target:y,type:t,transform:this.that.__zoom,dispatch:h}),e)}},y.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:to(+t),y):a},y.filter=function(t){return arguments.length?(o="function"==typeof t?t:to(!!t),y):o},y.touchable=function(t){return arguments.length?(s="function"==typeof t?t:to(!!t),y):s},y.extent=function(t){return arguments.length?(r="function"==typeof t?t:to([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),y):r},y.scaleExtent=function(t){return arguments.length?(u[0]=+t[0],u[1]=+t[1],y):[u[0],u[1]]},y.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],y):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},y.constrain=function(t){return arguments.length?(i=t,y):i},y.duration=function(t){return arguments.length?(c=+t,y):c},y.interpolate=function(t){return arguments.length?(d=t,y):d},y.on=function(){var t=h.on.apply(h,arguments);return t===h?y:t},y.clickDistance=function(t){return arguments.length?(g=(t=+t)*t,y):Math.sqrt(g)},y.tapDistance=function(t){return arguments.length?(m=+t,y):m},y}().scaleExtent([r,i]).translateExtent(s),n=Ot(p.current).call(e),o=oo.translate(a.x,a.y).scale(yo(a.zoom,r,i)),u=[[0,0],[t.width,t.height]],l=e.constrain()(o,u,s);e.transform(n,l),g.current=n.on("wheel.zoom"),h.setState({d3Zoom:e,d3Selection:n,transform:[l.x,l.y,l.k],domNode:p.current.closest(".react-diagram")})}}),[s]),n.useEffect((()=>{v&&x&&x.on("wheel.zoom",((t,e)=>{t.preventDefault(),p.current&&g.current&&g.current.call(p.current,t,e)}))}),[v,x,g,o]),n.useEffect((()=>{v&&v.on("start",(t=>{if(!t.sourceEvent)return null;if(f.current=!0,c){const e=Eo(t.transform);m.current=e,c?.(t.sourceEvent,e)}}))}),[v,c]),n.useEffect((()=>{v&&v.on("zoom",(t=>{if(h.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),l){const e=Eo(t.transform);l?.(t.sourceEvent,e)}}))}),[v,l]),n.useEffect((()=>{v&&v.on("end",(t=>{if(f.current=!1,d&&So(m.current,t.transform)){const e=Eo(t.transform);m.current=e,clearTimeout(y.current),y.current=setTimeout((()=>{d?.(t.sourceEvent,e)}),0)}}))}),[v]),n.useEffect((()=>{v&&v.filter((e=>{if(No(e,t)&&"wheel"!==e.type)return!1;if(!o)return!1;return!(e.button&&!(e.button<=1))}))}),[v,o]),e.jsx("div",{className:"react-diagram__zoompane react-diagram__container",ref:p,onClick:t=>{t.target===p.current&&h.getState().resetSelectedElements()},children:u})}const Po=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function Co({children:t}){const n=b(Po);return e.jsx("div",{className:"react-diagram__viewport react-diagram__container",style:{transform:n},children:t})}const Ao=t=>{const{minZoom:e,maxZoom:n,translateExtent:o}=t;return{minZoom:e,maxZoom:n,translateExtent:o}};function To({children:t,multiSelectionKeyCode:o,noPanClassName:r,panning:i,defaultViewport:a,onMove:s,onMoveStart:u,onMoveEnd:l}){const{minZoom:c,maxZoom:d,translateExtent:h}=b(Ao);return function(t="Meta"){const e=w(),[o,r]=n.useState(!1),i=e=>{console.log(123123,e.key,t),e.key===t&&r(!0)},a=()=>{r(!1)};n.useEffect((()=>(document.addEventListener("keydown",i),document.addEventListener("keyup",a),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",a)})),[]),n.useEffect((()=>{e.setState({multiSelectionActive:o})}),[o])}(o),e.jsx(ko,{noPanClassName:r,panning:i,minZoom:c,maxZoom:d,translateExtent:h,defaultViewport:a,onMove:s,onMoveStart:u,onMoveEnd:l,children:e.jsx(Co,{children:t})})}To.displayName="DiagramRenderer";var Io,$o=n.memo(To);t.Position=void 0,(Io=t.Position||(t.Position={})).Left="left",Io.Top="top",Io.Right="right",Io.Bottom="bottom",t.MarkerType=void 0,(t.MarkerType||(t.MarkerType={})).Arrow="arrow";const zo=t=>({nodesDraggable:t.nodesDraggable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError});function Do({nodeTypes:o,onNodeClick:r,onNodeMouseEnter:i,onNodeMouseMove:a,onNodeMouseLeave:s,onNodeContextMenu:u,onNodeDoubleClick:l,...c}){const{nodesDraggable:d,elementsSelectable:h,updateNodeDimensions:f,onError:p}=b(zo,fo),g=b(n.useCallback((t=>t.getNodes()),[])),m=n.useRef(),y=n.useMemo((()=>{if("undefined"==typeof ResizeObserver)return null;const t=new ResizeObserver((t=>{const e=t.map((t=>({id:t.target.getAttribute("data-id"),nodeElement:t.target,forceUpdate:!0})));f(e)}));return m.current=t,t}),[]);return n.useEffect((()=>()=>{m?.current?.disconnect()}),[]),e.jsx("div",{className:"react-diagram__nodes react-diagram__container",children:g.map((n=>{const{data:f,type:g,id:m,className:v,style:x,ariaLabel:b,positionAbsolute:w,hidden:_,selected:E,selectable:N,draggable:S}=n;let M=g||"default";o[M]||(p?.("010",M),M="default");const k=o[M]||o.default,P=!!(S||d&&void 0===S),C=!!(N||h&&void 0===N),A={id:m,className:v,style:{...x,width:n.width,height:n.height},ariaLabel:b},T={onClick:r,onMouseEnter:i,onMouseMove:a,onMouseLeave:s,onContextMenu:u,onDoubleClick:l},I={positionX:w?.x||0,positionY:w?.y||0,sourcePosition:t.Position.Bottom,targetPosition:t.Position.Top},$={selected:!!E,isSelectable:C,isDraggable:P,hidden:_,isParent:!!n[po]?.isParent,initialized:!!n.width&&!!n.height};return e.jsx(k,{...c,...A,...I,...T,...$,zIndex:n[po]?.z??0,type:M,data:f,resizeObserver:y},m)}))})}Do.displayName="NodeRenderer";var jo=n.memo(Do);function Ro(t){if("string"==typeof t||"number"==typeof t)return""+t;let e="";if(Array.isArray(t))for(let n,o=0;o<t.length;o++)""!==(n=Ro(t[o]))&&(e+=(e&&" ")+n);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const Bo={[t.MarkerType.Arrow]:({color:t="none",strokeWidth:n=1})=>e.jsx("polyline",{stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:n,fill:t,points:"-5,-4 0,0 -5,4 -5,-4"})};const Oo=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],o=(t.height??0)*e[1],r={x:t.position.x-n,y:t.position.y-o};return{...r,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-o}:r}},Lo=(t,e)=>{if(void 0===t)return"";if("string"==typeof t)return t;return`${e?`${e}__`:""}${Object.keys(t).sort().map((e=>`${e}=${t[e]}`)).join("&")}`},Xo=({source:t,target:e})=>`reactdiagram__edge-${t}-${e}`,Yo=({id:t,type:o,color:r,width:i=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:u,orient:l="auto-start-reverse"})=>{const c=function(t){const e=w();return n.useMemo((()=>Object.prototype.hasOwnProperty.call(Bo,t)?Bo[t]:(e.getState().onError?.("022",t),null)),[t])}(o);return c?e.jsx("marker",{className:"react-diagram__arrowhead",id:t,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:e.jsx(c,{color:r,strokeWidth:u})}):null},Uo=({defaultColor:t,rfId:o})=>{const r=b(n.useCallback((({defaultColor:t,rfId:e})=>n=>{const o=[];return n.edges.reduce(((n,r)=>([r.markerStart,r.markerEnd].forEach((r=>{if(r&&"object"==typeof r){const i=Lo(r,e);o.includes(i)||(n.push({id:i,color:r.color||t,...r}),o.push(i))}})),n)),[]).sort(((t,e)=>t.id.localeCompare(e.id)))})({defaultColor:t,rfId:o}),[t,o]),((t,e)=>!(t.length!==e.length||t.some(((t,n)=>t.id!==e[n].id)))));return e.jsx("defs",{children:r.map((t=>e.jsx(Yo,{id:t.id,type:t.type,color:t.color,width:t.width,height:t.height,markerUnits:t.markerUnits,strokeWidth:t.strokeWidth,orient:t.orient},t.id)))})};Uo.displayName="MarkerComponent";var Vo=n.memo(Uo);var Zo=n.memo((function({x:t,y:o,label:r,labelStyle:i={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:u=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...h}){const f=n.useRef(null),[p,g]=n.useState({x:0,y:0,width:0,height:0}),m=Ro(["react-diagram__edge-text-wrapper",d]);return n.useEffect((()=>{if(f.current){const t=f.current.getBBox();g({x:t.x,y:t.y,width:t.width,height:t.height})}}),[r]),void 0!==r&&r?e.jsxs("g",{transform:`translate(${t-p.width/2} ${o-p.height/2})`,className:m,visibility:p.width?"visible":"hidden",...h,children:[a&&e.jsx("rect",{width:p.width+2*u[0],x:-u[0],y:-u[1],height:p.height+2*u[1],className:"react-diagram__edge-text-bg",style:s,rx:l,ry:l}),e.jsx("text",{className:"react-diagram__edge-text",y:p.height/2,dy:"0.3em",ref:f,style:i,children:r}),c]}):null}));function qo({path:t,labelX:n,labelY:o,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:s,labelBgPadding:u,labelBgBorderRadius:l,style:c,markerEnd:d,markerStart:h}){return e.jsxs(e.Fragment,{children:[e.jsx("path",{style:c,d:t,fill:"none",className:"react-diagram__edge-path",markerEnd:d,markerStart:h}),r&&go(n)&&go(o)?e.jsx(Zo,{x:n,y:o,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:s,labelBgPadding:u,labelBgBorderRadius:l}):null]})}qo.displayName="BaseEdge";const Fo={[t.Position.Left]:{x:-1,y:0},[t.Position.Right]:{x:1,y:0},[t.Position.Top]:{x:0,y:-1},[t.Position.Bottom]:{x:0,y:1}},Wo=({source:e,sourcePosition:n=t.Position.Bottom,target:o})=>n===t.Position.Left||n===t.Position.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1},Ho=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function Ko({source:e,sourcePosition:n=t.Position.Bottom,target:o,targetPosition:r=t.Position.Top,center:i,offset:a}){const s=Fo[n],u=Fo[r],l={x:e.x+s.x*a,y:e.y+s.y*a},c={x:o.x+u.x*a,y:o.y+u.y*a},d=Wo({source:l,sourcePosition:n,target:c}),h=0!==d.x?"x":"y",f=d[h];let p=[],g=0,m=0;const[y,v,x,b]=function({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,i=n<t?n+r:n-r,a=Math.abs(o-e)/2;return[i,o<e?o+a:o-a,r,a]}({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(s[h]*u[h]==-1){g=i.x||y,m=i.y||v;const t=[{x:g,y:l.y},{x:g,y:c.y}],e=[{x:l.x,y:m},{x:c.x,y:m}];p=s[h]!==f?"x"===h?e:t:"x"===h?t:e}return[[e,l,...p,c,o],g,m,x,b]}function Go({sourceX:e,sourceY:n,sourcePosition:o=t.Position.Bottom,targetX:r,targetY:i,targetPosition:a=t.Position.Top,borderRadius:s=5,centerX:u,centerY:l,offset:c=20}){const[d,h,f,p,g]=Ko({source:{x:e,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:a,center:{x:u,y:l},offset:c});return[d.reduce(((t,e,n)=>{let o="";return o=n>0&&n<d.length-1?function(t,e,n,o){const r=Math.min(Ho(t,e)/2,Ho(e,n)/2,o),{x:i,y:a}=e;if(t.x===i&&i===n.x||t.y===a&&a===n.y)return`L${i} ${a}`;if(t.y===a)return`L ${i+r*(t.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+r*(t.y<n.y?1:-1)}`;const s=t.x<n.x?1:-1;return`L ${i},${a+r*(t.y<n.y?-1:1)}Q ${i},${a} ${i+r*s},${a}`}(d[n-1],e,d[n+1],s):`${0===n?"M":"L"}${e.x} ${e.y}`,t+=o}),""),h,f,p,g]}const Qo=n.memo((({sourceX:n,sourceY:o,targetX:r,targetY:i,label:a,labelStyle:s,labelShowBg:u,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,sourcePosition:f=t.Position.Bottom,targetPosition:p=t.Position.Top,markerEnd:g,markerStart:m,pathOptions:y})=>{const[v,x,b]=Go({sourceX:n,sourceY:o,sourcePosition:f,targetX:r,targetY:i,targetPosition:p,borderRadius:y?.borderRadius,offset:y?.offset});return e.jsx(qo,{path:v,labelX:x,labelY:b,label:a,labelStyle:s,labelShowBg:u,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:g,markerStart:m})}));Qo.displayName="StepEdge";const Jo=t=>t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null,tr=(t,e,n,o)=>(e[n]||[]).reduce(((e,r)=>(`${t.id}-${n}`!==o&&e.push({type:n,nodeId:t.id,x:(t.positionAbsolute?.x??0)+r.x+r.width/2,y:(t.positionAbsolute?.y??0)+r.y+r.height/2}),e)),[]),er=({isAnchor:t=!1,event:e,nodeId:n,portType:o,getState:r,setState:i,onConnect:a,onEdgeUpdateEnd:s})=>{const u=(l=e.target,l.getRootNode?.()||window?.document);var l;const{domNode:c,autoPanOnConnect:d,getNodes:h,cancelConnection:f,onConnectStart:p,onConnectEnd:g,panBy:m}=r(),y=c?.getBoundingClientRect(),{x:v,y:x}=bo(e),b=u?.elementFromPoint(v,x),w=t?o:Jo(b),_=(({nodes:t,nodeId:e,portType:n})=>t.reduce(((t,o)=>{if(o[po]){const{portBounds:r}=o[po];let i=[],a=[];r&&(i=tr(o,r,"source",`${e}-${n}`),a=tr(o,r,"target",`${e}-${n}`)),t.push(...i,...a)}return t}),[]))({nodes:h(),nodeId:n,portType:o});let E=bo(e,y),N=null,S=!1,M=null,k=0,P=!1;if(!y||!o)return;const C=()=>{if(!d)return;const[t,e]=_o(E,y);m({x:t,y:e}),k=requestAnimationFrame(C)};i({connectionPosition:E,connectionNodeId:n,connectionPortType:w}),p?.(e,{nodeId:n,portType:o});const A=t=>{E=bo(t,y),N=((t,e,n)=>{let o=null,r=1/0;return n.forEach((n=>{const i=Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));i<=e&&i<r&&(r=i,o=n)})),o})(E,20,_),P||(C(),P=!0);const e=((t,e,n,o,r)=>{const i="target"===o,a={isValid:!1,connection:{source:null,target:null}},s=r.querySelector(`.react-diagram__port[data-id="${e?.nodeId}-${e?.type}"]`),{x:u,y:l}=bo(t),c=r.elementFromPoint(u,l),d=c?.classList.contains("react-diagram__port")?c:s;if(d){const t=Jo(d),e=d.getAttribute("data-nodeid"),o={source:i?e:n,target:i?n:e};a.connection=o,(i&&"source"===t||!i&&"target"===t)&&(a.isValid=!0)}return a})(t,N,n,o,u);if(S=e.isValid,M=e.connection,N&&S){const{x:t,y:e}=N;i({connectionPosition:{x:t,y:e}})}else i({connectionPosition:E})},T=t=>{S&&M&&a?.(M),g?.(t),o&&s?.(t),f(),cancelAnimationFrame(k),S=!1,M=null,P=!1,u.removeEventListener("mousemove",A),u.removeEventListener("mouseup",T),u.removeEventListener("touchmove",A),u.removeEventListener("touchend",T)};u.addEventListener("mousemove",A),u.addEventListener("mouseup",T),u.addEventListener("touchmove",A),u.addEventListener("touchend",T)},nr=(e,n,o)=>o===t.Position.Left?e-n:o===t.Position.Right?e+n:e,or=(e,n,o)=>o===t.Position.Top?e-n:o===t.Position.Bottom?e+n:e,rr="react-diagram__edgeupdater";function ir({position:t,centerX:n,centerY:o,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:u}){return e.jsx("circle",{className:Ro([rr,`${rr}-${u}`]),cx:nr(n,r,t),cy:or(o,r,t),r:r,stroke:"transparent",fill:"transparent",onMouseDown:i,onMouseEnter:a,onMouseOut:s})}function ar(t,e,n){return void 0===n?n:o=>{const r=e().edges.find((e=>e.id===t));r&&n(o,{...r})}}const sr=t=>{const o=o=>{const{id:r,className:i,style:a,type:s,data:u,rfId:l,ariaLabel:c,source:d,sourcePort:h,target:f,targetPort:p,markerEnd:g,markerStart:m,label:y,labelStyle:v,labelShowBg:x,labelBgStyle:b,labelBgPadding:_,labelBgBorderRadius:E,sourceX:N,sourceY:S,targetX:M,targetY:k,sourcePosition:P,targetPosition:C,selected:A,elementsSelectable:T,hidden:I,isFocusable:$,onClick:z,onDoubleClick:D,onContextMenu:j,onMouseEnter:R,onMouseMove:B,onMouseLeave:O,onEdgeUpdate:L,onEdgeUpdateStart:X,onEdgeUpdateEnd:Y}=o,U=n.useRef(null),[V,Z]=n.useState(!1),q=w(),F=n.useMemo((()=>`url(#${Lo(m,l)})`),[m,l]),W=n.useMemo((()=>`url(#${Lo(g,l)})`),[g,l]);if(I)return null;const H=t=>e=>{if(0!==e.button)return;const{edges:n}=q.getState(),i=o[t],a=n.find((t=>t.id===r));Z(!0),X?.(e,a,t);er({isAnchor:!0,event:e,nodeId:i,portType:t,getState:q.getState,setState:q.setState,onConnect:t=>L?.(a,t),onEdgeUpdateEnd:e=>{Z(!1),Y?.(e,a,t)}})},K=ar(r,q.getState,D),G=ar(r,q.getState,j),Q=ar(r,q.getState,R),J=ar(r,q.getState,B),tt=ar(r,q.getState,O),et=Ro(["react-diagram__edge",`react-diagram__edge-${s}`,i,{selected:A,inactive:!T}]),nt={markerStart:F,markerEnd:W},ot={source:d,sourcePort:h,target:f,targetPort:p},rt={label:y,labelStyle:v,labelShowBg:x,labelBgStyle:b,labelBgPadding:_,labelBgBorderRadius:E},it={sourceX:N,sourceY:S,targetX:M,targetY:k,sourcePosition:P,targetPosition:C},at={onClick:t=>{const{edges:e}=q.getState();if(z){const n=e.find((t=>t.id===r));z(t,n)}},onDoubleClick:K,onContextMenu:G,onMouseEnter:Q,onMouseMove:J,onMouseLeave:tt};return e.jsxs("g",{...at,ref:U,className:et,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-label":null===c?void 0:c||`Edge from ${d} to ${f}`,"aria-describedby":$?`react-diagram__edge-desc-${l}`:void 0,children:[!V&&e.jsx(t,{...ot,...nt,...rt,...it,id:r,data:u,style:a,selected:A}),e.jsx(ir,{position:P,centerX:N,centerY:S,radius:10,onMouseDown:H("target"),onMouseEnter:console.log,onMouseOut:console.log,type:"source"}),e.jsx(ir,{position:C,centerX:M,centerY:k,radius:10,onMouseDown:H("source"),onMouseEnter:console.log,onMouseOut:console.log,type:"target"})]})};return o.displayName="EdgeWrapper",n.memo(o)};function ur(t){return{...{step:sr(t.step||Qo)},...Object.keys(t).filter((t=>!["default","bezier"].includes(t))).reduce(((e,n)=>(e[n]=sr(t[n]||Qo),e)),{})}}function lr(e,n,o=null){const r=(o?.x||0)+n.x,i=(o?.y||0)+n.y,a=o?.width||n.width,s=o?.height||n.height;switch(e){case t.Position.Top:return{x:r+a/2,y:i};case t.Position.Right:return{x:r+a,y:i+s/2};case t.Position.Bottom:return{x:r+a/2,y:i+s};case t.Position.Left:return{x:r,y:i+s/2}}}function cr(t,e){return t?1!==t.length&&e?e&&t.find((t=>t.id===e))||null:t[0]:null}function dr(t){const e=t?.[po]?.portBounds||null,n=e&&t?.width&&t?.height&&void 0!==t?.positionAbsolute?.x&&void 0!==t?.positionAbsolute?.y;return[{x:t?.positionAbsolute?.x||0,y:t?.positionAbsolute?.y||0,width:t?.width||0,height:t?.height||0},e,!!n]}const hr=t=>({edges:t.edges,width:t.width,height:t.height,nodeInternals:t.nodeInternals,onError:t.onError});function fr({rfId:n,edgeTypes:o,children:r,noPanClassName:i,onEdgeClick:a,onEdgeDoubleClick:s,onEdgeContextMenu:u,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeUpdate:h,onEdgeUpdateStart:f,onEdgeUpdateEnd:p}){const{edges:g,width:m,height:y,nodeInternals:v}=b(hr,fo);return e.jsxs(e.Fragment,{children:[e.jsxs("svg",{width:m||"100vw",height:y||"100vh",className:"react-diagram__edges react-diagram__container",children:[e.jsx(Vo,{defaultColor:"#000000",rfId:n}),e.jsx("g",{children:g.map((r=>{const{data:g,type:m,id:y,className:x,style:b,ariaLabel:w,source:_,sourcePort:E,target:N,targetPort:S,markerEnd:M,markerStart:k,label:P,labelStyle:C,labelShowBg:A,labelBgStyle:T,labelBgPadding:I,labelBgBorderRadius:$}=r,[z,D,j]=dr(v.get(_)),[R,B,O]=dr(v.get(N));if(!j||!O)return null;const L=m||"step",X=o[L]||o.default,Y=B.target,U=cr(D.source,E),V=cr(Y,S),Z=U?.position||t.Position.Bottom,q=V?.position||t.Position.Top,F=!!r.focusable;if(!U||!V)return null;const W={id:y,className:Ro([x,i]),style:b,ariaLabel:w},H={source:_,sourcePort:E,target:N,targetPort:S},K={markerEnd:M,markerStart:k},G={label:P,labelStyle:C,labelShowBg:A,labelBgStyle:T,labelBgPadding:I,labelBgBorderRadius:$},Q=((t,e,n,o,r,i)=>{const a=lr(n,t,e),s=lr(i,o,r);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}})(z,U,Z,R,V,q),J={...Q,sourcePosition:Z,targetPosition:q},tt={onClick:a,onDoubleClick:s,onContextMenu:u,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onEdgeUpdate:h,onEdgeUpdateStart:f,onEdgeUpdateEnd:p};return e.jsx(X,{...W,...H,...K,...G,...J,...tt,rfId:n,type:L,data:g,isFocusable:F},y)}))})]}),r]})}fr.displayName="EdgeRenderer";var pr=n.memo(fr);const gr={[t.Position.Left]:t.Position.Right,[t.Position.Right]:t.Position.Left,[t.Position.Top]:t.Position.Bottom,[t.Position.Bottom]:t.Position.Top};function mr({style:t,nodeId:o,portType:r}){const{fromNode:i,toX:a,toY:s}=b(n.useCallback((t=>({fromNode:t.nodeInternals.get(o),toX:(t.connectionPosition.x-t.transform[0])/t.transform[2],toY:(t.connectionPosition.y-t.transform[1])/t.transform[2]})),[o]),fo),u=i?.[po]?.portBounds,l=u?.[r];if(!i||!l)return null;const c=l[0],d=c?c.x+c.width/2:(i.width??0)/2,h=c?c.y+c.height/2:i.height??0,f=(i.positionAbsolute?.x??0)+d,p=(i.positionAbsolute?.y??0)+h,g=c?.position,m=g?gr[g]:null;if(!g||!m)return null;let y="";const v={sourceX:f,sourceY:p,sourcePosition:g,targetX:a,targetY:s,targetPosition:m};return[y]=Go({...v,borderRadius:0}),e.jsx("path",{d:y,fill:"none",className:"react-diagram__connection-path",style:t})}mr.displayName="ConnectionPath";const yr=t=>({nodeId:t.connectionNodeId,portType:t.connectionPortType});function vr({containerStyle:t,style:n}){const{nodeId:o,portType:r}=b(yr,fo);return!(!o||!r)?e.jsx("svg",{style:t,className:"react-diagram__container react-diagram__edges react-diagram__connectionline",children:e.jsx("g",{className:"react-diagram__connection",children:e.jsx(mr,{style:n,nodeId:o,portType:r})})}):null}function xr({rfId:t,noPanClassName:n,panning:o,defaultViewport:r,multiSelectionKeyCode:i,onMove:a,onMoveStart:s,onMoveEnd:u,onlyRenderVisibleElements:l,disableKeyboardA11y:c,noDragClassName:d,nodeOrigin:h,nodeTypes:f,onNodeClick:p,onNodeDoubleClick:g,onNodeContextMenu:m,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:x,edgeTypes:b,onEdgeClick:w,onEdgeDoubleClick:_,onEdgeContextMenu:E,onEdgeMouseEnter:N,onEdgeMouseMove:S,onEdgeMouseLeave:M,onEdgeUpdate:k,onEdgeUpdateStart:P,onEdgeUpdateEnd:C}){return e.jsxs($o,{multiSelectionKeyCode:i,noPanClassName:n,panning:o,defaultViewport:r,onMove:a,onMoveStart:s,onMoveEnd:u,children:[e.jsx(jo,{rfId:t,nodeTypes:f,onlyRenderVisibleElements:l,disableKeyboardA11y:c,nodeOrigin:h,noDragClassName:d,noPanClassName:n,onNodeClick:p,onNodeDoubleClick:g,onNodeContextMenu:m,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:x}),e.jsx(pr,{rfId:t,edgeTypes:b,noPanClassName:n,onEdgeClick:w,onEdgeDoubleClick:_,onEdgeContextMenu:E,onEdgeMouseEnter:N,onEdgeMouseMove:S,onEdgeMouseLeave:M,onEdgeUpdate:k,onEdgeUpdateStart:P,onEdgeUpdateEnd:C,children:e.jsx(vr,{})}),e.jsx("div",{className:"react-diagram__edgelabel-renderer"})]})}xr.displayName="DiagramView";var br=n.memo(xr);const wr=t=>{const{setNodes:e,setEdges:n,setNodeExtent:o,setTranslateExtent:r,setMinZoom:i,setMaxZoom:a}=t;return{setNodes:e,setEdges:n,setNodeExtent:o,setTranslateExtent:r,setMinZoom:i,setMaxZoom:a}};function _r(t,e){n.useEffect((()=>{void 0!==t&&e(t)}),[t])}function Er(t,e,o){n.useEffect((()=>{void 0!==e&&o({[t]:e})}),[e])}const Nr=({nodes:t,onNodesChange:e,onNodeDrag:n,onNodeDragStart:o,onNodeDragEnd:r,edges:i,onEdgesChange:a,gridStep:s,elevateNodesOnSelect:u,nodesDraggable:l,autoPanOnNodeDrag:c,autoPanOnConnect:d,onConnect:h,onConnectStart:f,onConnectEnd:p,onError:g,nodeExtent:m,translateExtent:y,minZoom:x,maxZoom:_})=>{const{setNodes:E,setEdges:N,setNodeExtent:S,setTranslateExtent:M,setMinZoom:k,setMaxZoom:P}=b(wr,fo),C=w();return Er("gridStep",s,C.setState),_r(t,E),_r(i,N),_r(m,S),_r(y,M),_r(x,k),_r(_,P),Er("elevateNodesOnSelect",u,C.setState),Er("nodesDraggable",l,C.setState),Er("autoPanOnNodeDrag",c,C.setState),Er("autoPanOnConnect",d,C.setState),Er("onNodesChange",e,C.setState),Er("onNodeDrag",n,C.setState),Er("onNodeDragStart",o,C.setState),Er("onNodeDragEnd",r,C.setState),Er("onEdgesChange",a,C.setState),Er("onConnect",h,C.setState),Er("onConnectStart",f,C.setState),Er("onConnectEnd",p,C.setState),Er("onError",(t=>(e,n="")=>t?.(e,v[e](n)))(g),C.setState),null};function Sr(t,e){n.useRef(null);return n.useMemo((()=>e(t)),[t])}const Mr=n.createContext(null),kr=Mr.Provider;Mr.Consumer;const Pr=()=>n.useContext(Mr);function Cr({type:t,position:n}){const o=w(),r=Pr();if(!r)return null;const i=t=>{const{defaultEdgeOptions:e,onConnect:n}=o.getState(),r={...e,...t};n?.(r)},a=e=>{const n=xo(e);(n&&0===e.button||!n)&&er({event:e,nodeId:r,portType:t,getState:o.getState,setState:o.setState,onConnect:i})};return e.jsx("div",{"data-nodeid":r,"data-id":`${r}-${t}`,"data-port-position":n,className:`react-diagram__port react-diagram__port-${n} ${t} nodrag`,onMouseDown:a,onTouchStart:a})}Cr.displayName="Port";var Ar=n.memo(Cr);function Tr({data:n}){return e.jsxs(e.Fragment,{children:[e.jsx(Ar,{type:"target",position:t.Position.Top}),n.label,e.jsx(Ar,{type:"source",position:t.Position.Bottom})]})}function Ir(){const t=w(),e=n.useCallback((({sourceEvent:e})=>{const{transform:n,gridStep:o}=t.getState(),r=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,a={x:(r-n[0])/n[2],y:(i-n[1])/n[2]};return{xSnapped:o?o[0]*Math.round(a.x/o[0]):a.x,ySnapped:o?o[1]*Math.round(a.y/o[1]):a.y,...a}}),[]);return e}const $r=(t,e,n,o)=>{const r=e.querySelectorAll(t);if(!r||!r.length)return null;const i=Array.from(r),a=e.getBoundingClientRect(),s=a.width*o[0],u=a.height*o[1];return i.map((t=>{const e=t.getBoundingClientRect();return{id:t.getAttribute("data-portid"),position:t.dataset.portPosition,x:(e.left-a.left-s)/n,y:(e.top-a.top-u)/n,...mo(t)}}))};function zr(t,e,n){return void 0===n?n:o=>{const r=e().nodeInternals.get(t);n(o,{...r})}}function Dr({id:t,store:e,isSelectable:n,unselect:o=!1,nodeRef:r}){if(!n)return;const{addSelectedNodes:i,unselectNodes:a,multiSelectionActive:s,nodeInternals:u}=e.getState(),l=u.get(t);e.setState({nodesSelectionActive:!1}),l.selected?(o||l.selected&&s)&&(a({nodes:[l]}),requestAnimationFrame((()=>r?.current?.blur()))):i([t])}function jr(t,e){if(!t.parentNode)return!1;const n=e.get(t.parentNode);return!!n&&(!!n.selected||jr(n,e))}function Rr(t,e,n,o){return Array.from(t.values()).filter((n=>(n.selected||n.id===o)&&(!n.parentNode||!jr(n,t))&&(n.draggable||e&&void 0===n.draggable))).map((t=>({id:t.id,position:t.position||{x:0,y:0},positionAbsolute:t.positionAbsolute||{x:0,y:0},distance:{x:n.x-(t.positionAbsolute?.x??0),y:n.y-(t.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:t.extent,parentNode:t.parentNode,width:t.width,height:t.height})))}function Br({nodeId:t,dragItems:e,nodeInternals:n}){const o=e.map((t=>({...n.get(t.id),position:t.position,positionAbsolute:t.positionAbsolute})));return[t?o.find((e=>e.id===t)):o[0],o]}function Or({nodeRef:t,nodeId:e,isSelectable:o,noDragClassName:r}){const i=w(),a=n.useRef([]),s=n.useRef(null),u=n.useRef({x:0,y:0}),l=n.useRef({x:null,y:null}),c=n.useRef(null),d=n.useRef(!1),h=n.useRef(0),[f,p]=n.useState(!1),g=Ir();return n.useEffect((()=>{if(t?.current){const n=Ot(t.current),f=({x:t,y:n})=>{const{nodeInternals:o,onNodeDrag:r,updateNodePositions:s,nodeExtent:u,nodeOrigin:d,gridStep:h,onError:f}=i.getState();l.current={x:t,y:n};let g=!1;if(a.current=a.current.map((e=>{const r={x:t-e.distance.x,y:n-e.distance.y};h&&(r.x=h[0]*Math.round(r.x/h[0]),r.y=h[1]*Math.round(r.y/h[1]));const i=function(t,e,n,o,r=[0,0],i){let a=t.extent||o;if("parent"===t.extent)if(t.parentNode&&t.width&&t.height){const e=n.get(t.parentNode),{x:o,y:i}=Oo(e,r).positionAbsolute;a=e&&go(o)&&go(i)&&go(e.width)&&go(e.height)?[[o+t.width*r[0],i+t.height*r[1]],[o+e.width-t.width+t.width*r[0],i+e.height-t.height+t.height*r[1]]]:a}else i?.("011"),a=o;else if(t.extent&&t.parentNode){const e=n.get(t.parentNode),{x:o,y:i}=Oo(e,r).positionAbsolute;a=[[t.extent[0][0]+o,t.extent[0][1]+i],[t.extent[1][0]+o,t.extent[1][1]+i]]}let s={x:0,y:0};if(t.parentNode){const e=n.get(t.parentNode);s=Oo(e,r).positionAbsolute}const u=a?vo(e,a):e;return{position:{x:u.x-s.x,y:u.y-s.y},positionAbsolute:u}}(e,r,o,u,d,f);return g=g||e.position.x!==i.position.x||e.position.y!==i.position.y,e.position=i.position,e.positionAbsolute=i.positionAbsolute,e})),g&&(s(a.current,!0,!0),p(!0),r&&c.current)){const[t,n]=Br({nodeId:e,dragItems:a.current,nodeInternals:o});r(c.current,t,n)}},m=()=>{if(!s.current)return;const[t,e]=_o(u.current,s.current);if(0!==t||0!==e){const{transform:n,panBy:o}=i.getState();l.current.x=(l.current.x??0)-t/n[2],l.current.y=(l.current.y??0)-e/n[2],f(l.current),o({x:t,y:e})}h.current=requestAnimationFrame(m)},y=function(){var t,e,n,o,r=Ht,i=Kt,a=Gt,s=Qt,u={},l=E("start","drag","end"),c=0,d=0;function h(t){t.on("mousedown.drag",f).filter(s).on("touchstart.drag",m).on("touchmove.drag",y,Xt).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(a,s){if(!o&&r.call(this,a,s)){var u=x(this,i.call(this,a,s),a,s,"mouse");u&&(Ot(a.view).on("mousemove.drag",p,Yt).on("mouseup.drag",g,Yt),Zt(a.view),Ut(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function p(o){if(Vt(o),!n){var r=o.clientX-t,i=o.clientY-e;n=r*r+i*i>d}u.mouse("drag",o)}function g(t){Ot(t.view).on("mousemove.drag mouseup.drag",null),qt(t.view,n),Vt(t),u.mouse("end",t)}function m(t,e){if(r.call(this,t,e)){var n,o,a=t.changedTouches,s=i.call(this,t,e),u=a.length;for(n=0;n<u;++n)(o=x(this,s,t,e,a[n].identifier,a[n]))&&(Ut(t),o("start",t,a[n]))}}function y(t){var e,n,o=t.changedTouches,r=o.length;for(e=0;e<r;++e)(n=u[o[e].identifier])&&(Vt(t),n("drag",t,o[e]))}function v(t){var e,n,r=t.changedTouches,i=r.length;for(o&&clearTimeout(o),o=setTimeout((function(){o=null}),500),e=0;e<i;++e)(n=u[r[e].identifier])&&(Ut(t),n("end",t,r[e]))}function x(t,e,n,o,r,i){var s,d,f,p=l.copy(),g=Lt(i||n,e);if(null!=(f=a.call(t,new Wt("beforestart",{sourceEvent:n,target:h,identifier:r,active:c,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),o)))return s=f.x-g[0]||0,d=f.y-g[1]||0,function n(i,a,l){var m,y=g;switch(i){case"start":u[r]=n,m=c++;break;case"end":delete u[r],--c;case"drag":g=Lt(l||a,e),m=c}p.call(i,t,new Wt(i,{sourceEvent:a,subject:f,target:h,identifier:r,active:m,x:g[0]+s,y:g[1]+d,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:p}),o)}}return h.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ft(!!t),h):r},h.container=function(t){return arguments.length?(i="function"==typeof t?t:Ft(t),h):i},h.subject=function(t){return arguments.length?(a="function"==typeof t?t:Ft(t),h):a},h.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Ft(!!t),h):s},h.on=function(){var t=l.on.apply(l,arguments);return t===l?h:t},h.clickDistance=function(t){return arguments.length?(d=(t=+t)*t,h):Math.sqrt(d)},h}().on("start",(n=>{if(1!==n.sourceEvent.which)return;const{nodeInternals:r,nodesDraggable:l,domNode:c,onNodeDragStart:d}=i.getState();e&&Dr({id:e,store:i,nodeRef:t,isSelectable:o});const h=g(n);if(a.current=Rr(r,l,h,e),d&&a.current){const[t,o]=Br({nodeId:e,dragItems:a.current,nodeInternals:r});d(n.sourceEvent,t,o)}s.current=c?.getBoundingClientRect()||null,u.current=bo(n.sourceEvent,s.current)})).on("drag",(t=>{const e=g(t),{autoPanOnNodeDrag:n}=i.getState();!d.current&&n&&(d.current=!0,m()),l.current.x===e.xSnapped&&l.current.y===e.ySnapped||!a.current||(c.current=t.sourceEvent,u.current=bo(t.sourceEvent,s.current),f(e))})).on("end",(t=>{if(p(!1),d.current=!1,cancelAnimationFrame(h.current),a.current){const{nodeInternals:n,updateNodePositions:o,onNodeDragEnd:r}=i.getState();if(o(a.current,!1,!1),r){const[o,i]=Br({nodeId:e,dragItems:a.current,nodeInternals:n});r(t.sourceEvent,o,i)}}})).filter((e=>{const n=e.target,o=!e.button&&!r||!function(t,e,n){let o=t;do{if(o?.matches(e))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}(n,`.${r}`,t);return o}));return n.call(y),()=>{n.on(".drag",null)}}}),[i,t,e,o,r]),f}const Lr=t=>{function o({id:o,type:r,data:i,positionX:a,positionY:s,sourcePosition:u,targetPosition:l,onClick:c,onMouseEnter:d,onMouseMove:h,onMouseLeave:f,onContextMenu:p,onDoubleClick:g,style:m,className:y,selected:v,isSelectable:x,isDraggable:b,hidden:_,resizeObserver:E,dragHandle:N,zIndex:S,isParent:M,initialized:k,disableKeyboardA11y:P,ariaLabel:C,rfId:A,noDragClassName:T,noPanClassName:I}){const $=w(),z=n.useRef(null),D=n.useRef(u),j=n.useRef(l),R=n.useRef(r),B=b||c||d||h||f;n.useEffect((()=>{if(z.current&&!_){const t=z.current;return E?.observe(t),()=>E?.unobserve(t)}}),[_]),n.useEffect((()=>{const t=R.current!==r,e=D.current!==u,n=j.current!==l;z.current&&(t||e||n)&&(t&&(R.current=r),e&&(D.current=u),n&&(j.current=l),$.getState().updateNodeDimensions([{id:o,nodeElement:z.current,forceUpdate:!0}]))}),[o,r,u,l]);const O=Or({nodeRef:z,nodeId:o,isSelectable:x,noDragClassName:T});if(_)return null;const L=Ro(["react-diagram__node",`react-diagram__node-${r}`,{[I]:b},y,{selected:v,parent:M,dragging:O}]),X={zIndex:S,transform:`translate(${a}px,${s}px)`,pointerEvents:B?"all":"none",visibility:k?"visible":"hidden",...m},Y={onClick:t=>{if(b||Dr({id:o,store:$,nodeRef:z}),c){const e=$.getState().nodeInternals.get(o);c(t,{...e})}},onDoubleClick:zr(o,$.getState,g),onContextMenu:zr(o,$.getState,p),onMouseEnter:zr(o,$.getState,d),onMouseMove:zr(o,$.getState,h),onMouseLeave:zr(o,$.getState,f)},U={positionX:a,positionY:s,sourcePosition:u,targetPosition:l};return e.jsx("div",{...Y,ref:z,className:L,style:X,"data-id":o,tabIndex:0,role:"button","aria-describedby":P?void 0:`react-diagram__node-desc-${A}`,"aria-label":C,children:e.jsx(kr,{value:o,children:e.jsx(t,{...U,id:o,zIndex:S,type:r,data:i,dragHandle:N})})})}return o.displayName="NodeWrapper",n.memo(o)};function Xr(t){return{...{default:Lr(t.default||Tr)},...Object.keys(t).filter((t=>"default"!==t)).reduce(((e,n)=>(e[n]=Lr(t[n]||Tr),e)),{})}}function Yr(t,e,n,o){if(!t.parentNode)return n;const r=e.get(t.parentNode),i=Oo(r,o);return Yr(r,e,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(r[po]?.z??0)>(n.z??0)?r[po]?.z??0:n.z??0},o)}function Ur(t,e,n){t.forEach((o=>{if(o.parentNode&&!t.has(o.parentNode))throw new Error(`Parent node ${o.parentNode} not found`);if(o.parentNode||n?.[o.id]){const{x:r,y:i,z:a}=Yr(o,t,{...o.position,z:o[po]?.z??0},e);o.positionAbsolute={x:r,y:i},o[po].z=a,n?.[o.id]&&(o[po].isParent=!0)}}))}function Vr(t,e,n,o){const r=new Map,i={},a=o?1e3:0;return t.forEach((t=>{const n=(go(t.zIndex)?t.zIndex:0)+(t.selected?a:0),o=e.get(t.id),s={width:o?.width,height:o?.height,...t,positionAbsolute:{x:t.position.x,y:t.position.y}};t.parentNode&&(s.parentNode=t.parentNode,i[t.parentNode]=!0),Object.defineProperty(s,po,{enumerable:!1,value:{portBounds:o?.[po]?.portBounds,z:n}}),r.set(t.id,s)})),Ur(r,n,i),r}function Zr({changedNodes:t,get:e}){const{onNodesChange:n}=e();t?.length&&n?.(t)}const qr=(t,e)=>{const n=t.find((t=>t.id===e.parentNode));if(n){const t=e.position.x+e.width-n.width,o=e.position.y+e.height-n.height;if(t>0||o>0||e.position.x<0||e.position.y<0){if(n.style={...n.style}||{},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,t>0&&(n.style.width+=t),o>0&&(n.style.height+=o),e.position.x<0){const t=Math.abs(e.position.x);n.position.x=n.position.x-t,n.style.width+=t,e.position.x=0}if(e.position.y<0){const t=Math.abs(e.position.y);n.position.y=n.position.y-t,n.style.height+=t,e.position.y=0}n.width=n.style.width,n.height=n.style.height}}},Fr=(t,e)=>{if(t.some((t=>"reset"===t.type)))return t.filter((t=>"reset"===t.type)).map((t=>t.item));const n=t.filter((t=>"add"===t.type)).map((t=>t.item));return e.reduce(((e,n)=>{const o=t.filter((t=>t.id===n.id));if(0===o.length)return e.push(n),e;const r={...n};for(const t of o)if(t)switch(t.type){case"select":r.selected=t.selected;break;case"position":void 0!==t.position&&(r.position=t.position),void 0!==t.positionAbsolute&&(r.positionAbsolute=t.positionAbsolute),void 0!==t.dragging&&(r.dragging=t.dragging),r.expandParent&&qr(e,r);break;case"dimensions":void 0!==t.dimensions&&(r.width=t.dimensions.width,r.height=t.dimensions.height),void 0!==t.updateStyle&&(r.style={...r.style||{},...t.dimensions}),"boolean"==typeof t.resizing&&(r.resizing=t.resizing),r.expandParent&&qr(e,r);break;case"remove":return e}return e.push(r),e}),n)};function Wr(t,e){return Fr(t,e)}function Hr(t,e){return Fr(t,e)}const Kr=(t,e)=>({id:t,type:"select",selected:e});const Gr=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Qr={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],elementsSelectable:!0,onNodesChange:null,domNode:null,nodeOrigin:[0,0],gridStep:void 0,nodesSelectionActive:!1,elevateNodesOnSelect:!0,nodesDraggable:!0,multiSelectionActive:!1,d3Zoom:null,d3Selection:null,minZoom:.5,maxZoom:2,connectionPosition:{x:0,y:0},connectionNodeId:null,connectionPortType:"source",autoPanOnNodeDrag:!0,autoPanOnConnect:!0,nodeExtent:Gr,translateExtent:Gr,onError:(t,e="")=>{}},Jr=()=>{return t=(t,e)=>({...Qr,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:i}=e();t({nodeInternals:Vr(n,o,r,i)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=e();t({edges:n.map((t=>({...o,...t})))})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,domNode:i,nodeOrigin:a}=e(),s=i?.querySelector(".react-diagram__viewport");if(!s)return;const u=window.getComputedStyle(s),{m22:l}=new window.DOMMatrixReadOnly(u.transform),c=n.reduce(((t,e)=>{const n=r.get(e.id);if(n){const o=mo(e.nodeElement);o.width&&o.height&&(n.width!==o.width||n.height!==o.height||e.forceUpdate)&&(r.set(n.id,{...n,[po]:{...n[po],portBounds:{source:$r(".source",e.nodeElement,l,a),target:$r(".target",e.nodeElement,l,a)}},...o}),t.push({id:n.id,type:"dimensions",dimensions:o}))}return t}),[]);Ur(r,a),t({nodeInternals:new Map(r)}),c?.length>0&&o?.(c)},updateNodePositions:(t,n=!0,o=!1)=>{const{triggerNodeChanges:r}=e();r(t.map((t=>{const e={id:t.id,type:"position",dragging:o};return n&&(e.positionAbsolute=t.positionAbsolute,e.position=t.position),e})))},triggerNodeChanges:t=>{const{onNodesChange:n}=e();t?.length&&n?.(t)},addSelectedNodes:n=>{const{multiSelectionActive:o,getNodes:r}=e();let i;var a,s;o?i=n.map((t=>Kr(t,!0))):(a=r(),s=n,i=a.reduce(((t,e)=>{const n=s.includes(e.id);return!e.selected&&n?(e.selected=!0,t.push(Kr(e.id,!0))):e.selected&&!n&&(e.selected=!1,t.push(Kr(e.id,!1))),t}),[])),Zr({changedNodes:i,get:e,set:t})},unselectNodes:({nodes:n}={})=>{const{getNodes:o}=e();Zr({changedNodes:(n||o()).map((t=>(t.selected=!1,Kr(t.id,!1)))),get:e,set:t})},resetSelectedElements:()=>{const{getNodes:n}=e();Zr({changedNodes:n().filter((t=>t.selected)).map((t=>Kr(t.id,!1))),get:e,set:t})},cancelConnection:()=>t({connectionNodeId:Qr.connectionNodeId,connectionPortType:Qr.connectionPortType}),panBy:t=>{const{transform:n,width:o,height:r,d3Zoom:i,d3Selection:a}=e();if(!i||!a||!t.x&&!t.y)return;const s=oo.translate(n[0]+t.x,n[1]+t.y).scale(n[2]),u=[[0,0],[o,r]],l=i?.constrain()(s,u,Gr);i.transform(a,l)},setNodeExtent:n=>{const{nodeInternals:o}=e();o.forEach((t=>{t.positionAbsolute=vo(t.position,n)})),t({nodeExtent:n,nodeInternals:new Map(o)})},setTranslateExtent:n=>{e().d3Zoom?.translateExtent(n),t({translateExtent:n})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=e();o?.scaleExtent([n,r]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=e();o?.scaleExtent([r,n]),t({maxZoom:n})}}),t?o(t):o;var t},ti=({children:t})=>{const o=n.useRef(null);return o.current||(o.current=Jr()),e.jsx(y,{value:o.current,children:t})};function ei({children:t}){return n.useContext(m)?e.jsx(e.Fragment,{children:t}):e.jsx(ti,{children:t})}ti.displayName="ReactDiagramProvider",ei.displayName="ReactDiagramWrapper";const ni={x:0,y:0,zoom:1},oi=[0,0],ri={default:Tr},ii={step:Qo},ai=n.forwardRef((({id:t,panning:n=!0,minZoom:o,maxZoom:r,translateExtent:i,nodeExtent:a,defaultViewport:s=ni,multiSelectionKeyCode:u,onlyRenderVisibleElements:l=!1,disableKeyboardA11y:c=!1,noDragClassName:d="nodrag",noPanClassName:h="nopan",nodeOrigin:f=oi,nodeTypes:p=ri,onNodeClick:g,onNodeDoubleClick:m,onNodeContextMenu:y,onNodeMouseEnter:v,onNodeMouseMove:x,onNodeMouseLeave:b,edgeTypes:w=ii,onEdgeClick:_,onEdgeDoubleClick:E,onEdgeContextMenu:N,onEdgeMouseEnter:S,onEdgeMouseMove:M,onEdgeMouseLeave:k,onEdgeUpdate:P,onEdgeUpdateStart:C,onEdgeUpdateEnd:A,onMove:T,onMoveStart:I,onMoveEnd:$,nodes:z,edges:D,nodesDraggable:j,elevateNodesOnSelect:R,autoPanOnNodeDrag:B,autoPanOnConnect:O,onNodesChange:L,onNodeDrag:X,onNodeDragStart:Y,onNodeDragEnd:U,onEdgesChange:V,onConnect:Z,onConnectStart:q,onConnectEnd:F,onError:W},H)=>{const K=t||"1",G=Sr(p,Xr),Q=Sr(w,ur);return console.log(p,G),e.jsx("div",{ref:H,className:"react-diagram",children:e.jsxs(ei,{children:[e.jsx(br,{rfId:K,panning:n,defaultViewport:s,multiSelectionKeyCode:u,onlyRenderVisibleElements:l,disableKeyboardA11y:c,noDragClassName:d,noPanClassName:h,nodeOrigin:f,nodeTypes:G,edgeTypes:Q,onNodeClick:g,onNodeDoubleClick:m,onNodeContextMenu:y,onNodeMouseEnter:v,onNodeMouseMove:x,onNodeMouseLeave:b,onEdgeClick:_,onEdgeDoubleClick:E,onEdgeContextMenu:N,onEdgeMouseEnter:S,onEdgeMouseMove:M,onEdgeMouseLeave:k,onEdgeUpdate:P,onEdgeUpdateStart:C,onEdgeUpdateEnd:A,onMove:T,onMoveStart:I,onMoveEnd:$}),e.jsx(Nr,{rfId:K,nodes:z,edges:D,nodesDraggable:j,elevateNodesOnSelect:R,autoPanOnNodeDrag:B,autoPanOnConnect:O,nodeExtent:a,translateExtent:i,minZoom:o,maxZoom:r,onNodesChange:L,onNodeDrag:X,onNodeDragStart:Y,onNodeDragEnd:U,onEdgesChange:V,onConnect:Z,onConnectStart:q,onConnectEnd:F,onError:W})]})})}));function si(t){return e=>{const[o,r]=n.useState(e),i=n.useCallback((e=>r((n=>t(e,n)))),[]);return[o,r,i]}}ai.displayName="ReactDiagram";const ui=si(Wr),li=si(Hr);t.BaseEdge=qo,t.Port=Ar,t.ReactDiagram=ai,t.ReactDiagramProvider=ti,t.StepEdge=Qo,t.addEdge=(t,e)=>{if(!("source"in(n=t))||!("target"in n))return e;var n;if(((t,e)=>e.some((e=>e.source===t.source&&e.target===t.target)))(t,e))return e;let o;return o=t.id?{...t}:{...t,id:Xo(t)},e.concat(o)},t.applyEdgeChanges=Hr,t.applyNodeChanges=Wr,t.clamp=yo,t.getNodePositionWithOrigin=Oo,t.internalsSymbol=po,t.rectToBox=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),t.updateEdge=(t,e,n,o={shouldReplaceId:!0})=>{const{id:r,...i}=t;!e.source||e.target,n.find((t=>t.id===r));const a={...i,id:o.shouldReplaceId?Xo(e):r,source:e.source,target:e.target};return n.filter((t=>t.id!==r)).concat(a)},t.useEdgesState=li,t.useGetPointerPosition=Ir,t.useNodeId=Pr,t.useNodesState=ui,t.useStore=b,t.useStoreApi=w}));
@@ -0,0 +1,4 @@
1
+ import { ReactDiagramState } from '../components/ReactDiagramProvider/type';
2
+ declare const createRFStore: () => import("zustand").StoreApi<ReactDiagramState>;
3
+ export { createRFStore };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/store/index.ts"],"names":[],"mappings":"AA4BA,OAAO,EACJ,iBAAiB,EAEnB,MAAM,yCAAyC,CAAC;AAGjD,QAAA,MAAM,aAAa,qDA8Ob,CAAC;AAEP,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { CoordinateExtent } from '../types';
2
+ import { ReactDiagramStore } from '../components/ReactDiagramProvider/type';
3
+ export declare const infiniteExtent: CoordinateExtent;
4
+ declare const initialState: ReactDiagramStore;
5
+ export default initialState;
6
+ //# sourceMappingURL=initialState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/store/initialState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,iBAiCnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { StoreApi } from 'zustand';
2
+ import { NodeSelectionChange, EdgeSelectionChange } from '../hooks/useNodesEdgesState/type';
3
+ import { ReactDiagramState } from '../components/ReactDiagramProvider/type';
4
+ import { Node, NodeOrigin, NodeInternals } from '../components/Node/type';
5
+ import { Edge } from '../components/Edges/type';
6
+ type ParentNodes = Record<string, boolean>;
7
+ type UpdateNodesParams = {
8
+ changedNodes: NodeSelectionChange[] | null;
9
+ get: StoreApi<ReactDiagramState>['getState'];
10
+ set: StoreApi<ReactDiagramState>['setState'];
11
+ };
12
+ export declare function updateAbsoluteNodePositions(nodeInternals: NodeInternals, nodeOrigin: NodeOrigin, parentNodes?: ParentNodes): void;
13
+ export declare function createNodeInternals(nodes: Node[], nodeInternals: NodeInternals, nodeOrigin: NodeOrigin, elevateNodesOnSelect: boolean): NodeInternals;
14
+ export declare function handleControlledNodeSelectionChange(nodeChanges: NodeSelectionChange[], nodeInternals: NodeInternals): Map<string, Node<any, string | undefined>>;
15
+ export declare function handleControlledEdgeSelectionChange(edgeChanges: EdgeSelectionChange[], edges: Edge[]): Edge<any>[];
16
+ export declare function updateNodesSelections({ changedNodes, get, }: UpdateNodesParams): void;
17
+ export {};
18
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/store/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAOnC,OAAO,EACJ,mBAAmB,EACnB,mBAAmB,EACrB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C,KAAK,iBAAiB,GAAG;IACtB,YAAY,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;IAC3C,GAAG,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,CAAC;IAC7C,GAAG,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,CAAC;CAC/C,CAAC;AA6BF,wBAAgB,2BAA2B,CACxC,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,WAAW,CAAC,EAAE,WAAW,QA6B3B;AAED,wBAAgB,mBAAmB,CAChC,KAAK,EAAE,IAAI,EAAE,EACb,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,OAAO,GAC7B,aAAa,CAwCf;AAED,wBAAgB,mCAAmC,CAChD,WAAW,EAAE,mBAAmB,EAAE,EAClC,aAAa,EAAE,aAAa,8CAc9B;AAED,wBAAgB,mCAAmC,CAChD,WAAW,EAAE,mBAAmB,EAAE,EAClC,KAAK,EAAE,IAAI,EAAE,eASf;AAED,wBAAgB,qBAAqB,CAAC,EACnC,YAAY,EACZ,GAAG,GACL,EAAE,iBAAiB,QAMnB"}
@@ -0,0 +1,55 @@
1
+ import type { HTMLAttributes, MouseEvent as ReactMouseEvent } from 'react';
2
+ import { CoordinateExtent, EdgeTypes, GridStep, Viewport, Node, NodeOrigin, NodeMouseHandler, NodeDragHandler, NodeTypes, Edge, OnNodesChange, OnEdgesChange, OnConnect, OnConnectStart, OnConnectEnd, OnEdgeUpdateFunc, PortType, OnMove, EdgeMouseHandler, OnError } from '.';
3
+ import { KeyCode } from '../hooks/useGlobalKeyHandler';
4
+ export type ReactDiagramProps = HTMLAttributes<HTMLDivElement> & {
5
+ onlyRenderVisibleElements?: boolean;
6
+ disableKeyboardA11y?: boolean;
7
+ nodeExtent?: CoordinateExtent;
8
+ nodeOrigin?: NodeOrigin;
9
+ gridStep?: GridStep;
10
+ elevateNodesOnSelect?: boolean;
11
+ nodes?: Node[];
12
+ nodeTypes?: NodeTypes;
13
+ edges?: Edge[];
14
+ edgeTypes?: EdgeTypes;
15
+ onNodesChange?: OnNodesChange;
16
+ onNodeClick?: NodeMouseHandler;
17
+ onNodeDoubleClick?: NodeMouseHandler;
18
+ onNodeContextMenu?: NodeMouseHandler;
19
+ onNodeMouseEnter?: NodeMouseHandler;
20
+ onNodeMouseMove?: NodeMouseHandler;
21
+ onNodeMouseLeave?: NodeMouseHandler;
22
+ onNodeDragStart?: NodeDragHandler;
23
+ onNodeDrag?: NodeDragHandler;
24
+ onNodeDragEnd?: NodeDragHandler;
25
+ onEdgesChange?: OnEdgesChange;
26
+ onEdgeClick?: (event: ReactMouseEvent, node: Edge) => void;
27
+ onEdgeDoubleClick?: EdgeMouseHandler;
28
+ onEdgeContextMenu?: EdgeMouseHandler;
29
+ onEdgeMouseEnter?: EdgeMouseHandler;
30
+ onEdgeMouseMove?: EdgeMouseHandler;
31
+ onEdgeMouseLeave?: EdgeMouseHandler;
32
+ onEdgeUpdate?: OnEdgeUpdateFunc;
33
+ onEdgeUpdateStart?: (event: ReactMouseEvent, edge: Edge, portType: PortType) => void;
34
+ onEdgeUpdateEnd?: (event: MouseEvent | TouchEvent, edge: Edge, portType: PortType) => void;
35
+ onConnect?: OnConnect;
36
+ onConnectStart?: OnConnectStart;
37
+ onConnectEnd?: OnConnectEnd;
38
+ onMove?: OnMove;
39
+ onMoveStart?: OnMove;
40
+ onMoveEnd?: OnMove;
41
+ onError?: OnError;
42
+ minZoom?: number;
43
+ maxZoom?: number;
44
+ defaultViewport?: Viewport;
45
+ translateExtent?: CoordinateExtent;
46
+ multiSelectionKeyCode?: KeyCode;
47
+ nodesDraggable?: boolean;
48
+ noDragClassName?: string;
49
+ noPanClassName?: string;
50
+ panning?: boolean;
51
+ autoPanOnNodeDrag?: boolean;
52
+ autoPanOnConnect?: boolean;
53
+ };
54
+ export type ReactDiagramRefType = HTMLDivElement;
55
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../react-diagram/packages/src/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,EACJ,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,IAAI,EACJ,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,OAAO,EACT,MAAM,GAAG,CAAC;AACX,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACrC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACrC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,aAAa,CAAC,EAAE,eAAe,CAAC;IAEhC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC3D,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACrC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACrC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,iBAAiB,CAAC,EAAE,CACjB,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,KAChB,IAAI,CAAC;IACV,eAAe,CAAC,EAAE,CACf,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,KAChB,IAAI,CAAC;IAEV,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAEnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC"}