groove-dev 0.8.0 → 0.8.1

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 (2101) hide show
  1. package/node_modules/@groove-dev/cli/bin/groove.js +98 -0
  2. package/node_modules/@groove-dev/cli/package.json +15 -0
  3. package/node_modules/@groove-dev/cli/src/client.js +25 -0
  4. package/node_modules/@groove-dev/cli/src/commands/agents.js +38 -0
  5. package/node_modules/@groove-dev/cli/src/commands/approve.js +50 -0
  6. package/node_modules/@groove-dev/cli/src/commands/config.js +35 -0
  7. package/node_modules/@groove-dev/cli/src/commands/kill.js +15 -0
  8. package/node_modules/@groove-dev/cli/src/commands/nuke.js +19 -0
  9. package/node_modules/@groove-dev/cli/src/commands/providers.js +40 -0
  10. package/node_modules/@groove-dev/cli/src/commands/rotate.js +16 -0
  11. package/node_modules/@groove-dev/cli/src/commands/spawn.js +91 -0
  12. package/node_modules/@groove-dev/cli/src/commands/start.js +31 -0
  13. package/node_modules/@groove-dev/cli/src/commands/status.js +38 -0
  14. package/node_modules/@groove-dev/cli/src/commands/stop.js +15 -0
  15. package/node_modules/@groove-dev/cli/src/commands/team.js +77 -0
  16. package/node_modules/@groove-dev/daemon/package.json +18 -0
  17. package/node_modules/@groove-dev/daemon/src/adaptive.js +237 -0
  18. package/node_modules/@groove-dev/daemon/src/api.js +533 -0
  19. package/node_modules/@groove-dev/daemon/src/classifier.js +126 -0
  20. package/node_modules/@groove-dev/daemon/src/credentials.js +121 -0
  21. package/node_modules/@groove-dev/daemon/src/firstrun.js +93 -0
  22. package/node_modules/@groove-dev/daemon/src/index.js +208 -0
  23. package/node_modules/@groove-dev/daemon/src/introducer.js +238 -0
  24. package/node_modules/@groove-dev/daemon/src/journalist.js +600 -0
  25. package/node_modules/@groove-dev/daemon/src/lockmanager.js +58 -0
  26. package/node_modules/@groove-dev/daemon/src/pm.js +108 -0
  27. package/node_modules/@groove-dev/daemon/src/process.js +361 -0
  28. package/node_modules/@groove-dev/daemon/src/providers/aider.js +72 -0
  29. package/node_modules/@groove-dev/daemon/src/providers/base.js +38 -0
  30. package/node_modules/@groove-dev/daemon/src/providers/claude-code.js +167 -0
  31. package/node_modules/@groove-dev/daemon/src/providers/codex.js +68 -0
  32. package/node_modules/@groove-dev/daemon/src/providers/gemini.js +62 -0
  33. package/node_modules/@groove-dev/daemon/src/providers/index.js +38 -0
  34. package/node_modules/@groove-dev/daemon/src/providers/ollama.js +94 -0
  35. package/node_modules/@groove-dev/daemon/src/registry.js +89 -0
  36. package/node_modules/@groove-dev/daemon/src/rotator.js +185 -0
  37. package/node_modules/@groove-dev/daemon/src/router.js +132 -0
  38. package/node_modules/@groove-dev/daemon/src/state.js +34 -0
  39. package/node_modules/@groove-dev/daemon/src/supervisor.js +178 -0
  40. package/node_modules/@groove-dev/daemon/src/teams.js +203 -0
  41. package/node_modules/@groove-dev/daemon/src/terminal/base.js +27 -0
  42. package/node_modules/@groove-dev/daemon/src/terminal/generic.js +27 -0
  43. package/node_modules/@groove-dev/daemon/src/terminal/tmux.js +64 -0
  44. package/node_modules/@groove-dev/daemon/src/tokentracker.js +124 -0
  45. package/node_modules/@groove-dev/daemon/src/validate.js +122 -0
  46. package/node_modules/@groove-dev/daemon/templates/api-builder.json +18 -0
  47. package/node_modules/@groove-dev/daemon/templates/fullstack.json +18 -0
  48. package/node_modules/@groove-dev/daemon/templates/monorepo.json +24 -0
  49. package/node_modules/@groove-dev/daemon/test/adaptive.test.js +162 -0
  50. package/node_modules/@groove-dev/daemon/test/classifier.test.js +99 -0
  51. package/node_modules/@groove-dev/daemon/test/credentials.test.js +80 -0
  52. package/node_modules/@groove-dev/daemon/test/daemon.test.js +149 -0
  53. package/node_modules/@groove-dev/daemon/test/introducer.test.js +150 -0
  54. package/node_modules/@groove-dev/daemon/test/journalist.test.js +221 -0
  55. package/node_modules/@groove-dev/daemon/test/lockmanager.test.js +86 -0
  56. package/node_modules/@groove-dev/daemon/test/registry.test.js +133 -0
  57. package/node_modules/@groove-dev/daemon/test/rotator.test.js +165 -0
  58. package/node_modules/@groove-dev/daemon/test/router.test.js +96 -0
  59. package/node_modules/@groove-dev/daemon/test/state.test.js +63 -0
  60. package/node_modules/@groove-dev/daemon/test/supervisor.test.js +176 -0
  61. package/node_modules/@groove-dev/daemon/test/teams.test.js +197 -0
  62. package/node_modules/@groove-dev/daemon/test/tokentracker.test.js +112 -0
  63. package/node_modules/@groove-dev/gui/dist/assets/index-BO95Rm1F.js +73 -0
  64. package/node_modules/@groove-dev/gui/dist/assets/index-CPzm9ZE9.css +1 -0
  65. package/node_modules/@groove-dev/gui/dist/favicon.png +0 -0
  66. package/node_modules/@groove-dev/gui/dist/groove-logo-short.png +0 -0
  67. package/node_modules/@groove-dev/gui/dist/groove-logo.png +0 -0
  68. package/node_modules/@groove-dev/gui/dist/index.html +13 -0
  69. package/node_modules/@groove-dev/gui/index.html +12 -0
  70. package/node_modules/@groove-dev/gui/package.json +22 -0
  71. package/node_modules/@groove-dev/gui/public/favicon.png +0 -0
  72. package/node_modules/@groove-dev/gui/public/groove-logo-short.png +0 -0
  73. package/node_modules/@groove-dev/gui/public/groove-logo.png +0 -0
  74. package/node_modules/@groove-dev/gui/src/App.jsx +215 -0
  75. package/node_modules/@groove-dev/gui/src/components/AgentActions.jsx +347 -0
  76. package/node_modules/@groove-dev/gui/src/components/AgentChat.jsx +479 -0
  77. package/node_modules/@groove-dev/gui/src/components/AgentNode.jsx +117 -0
  78. package/node_modules/@groove-dev/gui/src/components/AgentPanel.jsx +115 -0
  79. package/node_modules/@groove-dev/gui/src/components/AgentStats.jsx +333 -0
  80. package/node_modules/@groove-dev/gui/src/components/ApprovalQueue.jsx +156 -0
  81. package/node_modules/@groove-dev/gui/src/components/EmptyState.jsx +100 -0
  82. package/node_modules/@groove-dev/gui/src/components/SpawnPanel.jsx +515 -0
  83. package/node_modules/@groove-dev/gui/src/components/TeamSelector.jsx +162 -0
  84. package/node_modules/@groove-dev/gui/src/main.jsx +9 -0
  85. package/node_modules/@groove-dev/gui/src/stores/groove.js +247 -0
  86. package/node_modules/@groove-dev/gui/src/theme.css +67 -0
  87. package/node_modules/@groove-dev/gui/src/views/AgentTree.jsx +148 -0
  88. package/node_modules/@groove-dev/gui/src/views/CommandCenter.jsx +620 -0
  89. package/node_modules/@groove-dev/gui/src/views/JournalistFeed.jsx +149 -0
  90. package/node_modules/@groove-dev/gui/vite.config.js +19 -0
  91. package/node_modules/@types/d3-color/LICENSE +21 -0
  92. package/node_modules/@types/d3-color/README.md +15 -0
  93. package/node_modules/@types/d3-color/index.d.ts +669 -0
  94. package/node_modules/@types/d3-color/package.json +55 -0
  95. package/node_modules/@types/d3-drag/LICENSE +21 -0
  96. package/node_modules/@types/d3-drag/README.md +15 -0
  97. package/node_modules/@types/d3-drag/index.d.ts +395 -0
  98. package/node_modules/@types/d3-drag/package.json +42 -0
  99. package/node_modules/@types/d3-interpolate/LICENSE +21 -0
  100. package/node_modules/@types/d3-interpolate/README.md +15 -0
  101. package/node_modules/@types/d3-interpolate/index.d.ts +387 -0
  102. package/node_modules/@types/d3-interpolate/package.json +47 -0
  103. package/node_modules/@types/d3-selection/LICENSE +21 -0
  104. package/node_modules/@types/d3-selection/README.md +15 -0
  105. package/node_modules/@types/d3-selection/index.d.ts +1173 -0
  106. package/node_modules/@types/d3-selection/package.json +50 -0
  107. package/node_modules/@types/d3-transition/LICENSE +21 -0
  108. package/node_modules/@types/d3-transition/README.md +15 -0
  109. package/node_modules/@types/d3-transition/index.d.ts +664 -0
  110. package/node_modules/@types/d3-transition/package.json +47 -0
  111. package/node_modules/@types/d3-zoom/LICENSE +21 -0
  112. package/node_modules/@types/d3-zoom/README.md +15 -0
  113. package/node_modules/@types/d3-zoom/index.d.ts +611 -0
  114. package/node_modules/@types/d3-zoom/package.json +48 -0
  115. package/node_modules/@xyflow/react/LICENSE +21 -0
  116. package/node_modules/@xyflow/react/README.md +135 -0
  117. package/node_modules/@xyflow/react/dist/base.css +504 -0
  118. package/node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts +61 -0
  119. package/node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts.map +1 -0
  120. package/node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts +15 -0
  121. package/node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts.map +1 -0
  122. package/node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts +3 -0
  123. package/node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts.map +1 -0
  124. package/node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts +59 -0
  125. package/node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts.map +1 -0
  126. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts +26 -0
  127. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts.map +1 -0
  128. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts +29 -0
  129. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts.map +1 -0
  130. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts +2 -0
  131. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts.map +1 -0
  132. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts +2 -0
  133. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts.map +1 -0
  134. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts +2 -0
  135. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts.map +1 -0
  136. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts +2 -0
  137. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts.map +1 -0
  138. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts +2 -0
  139. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts.map +1 -0
  140. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts +4 -0
  141. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts.map +1 -0
  142. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts +66 -0
  143. package/node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts.map +1 -0
  144. package/node_modules/@xyflow/react/dist/esm/additional-components/EdgeToolbar/EdgeToolbar.d.ts +26 -0
  145. package/node_modules/@xyflow/react/dist/esm/additional-components/EdgeToolbar/EdgeToolbar.d.ts.map +1 -0
  146. package/node_modules/@xyflow/react/dist/esm/additional-components/EdgeToolbar/index.d.ts +3 -0
  147. package/node_modules/@xyflow/react/dist/esm/additional-components/EdgeToolbar/index.d.ts.map +1 -0
  148. package/node_modules/@xyflow/react/dist/esm/additional-components/EdgeToolbar/types.d.ts +13 -0
  149. package/node_modules/@xyflow/react/dist/esm/additional-components/EdgeToolbar/types.d.ts.map +1 -0
  150. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts +29 -0
  151. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts.map +1 -0
  152. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts +5 -0
  153. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts.map +1 -0
  154. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts +6 -0
  155. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts.map +1 -0
  156. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts +4 -0
  157. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts.map +1 -0
  158. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts +123 -0
  159. package/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts.map +1 -0
  160. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts +11 -0
  161. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -0
  162. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts +27 -0
  163. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts.map +1 -0
  164. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts +4 -0
  165. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts.map +1 -0
  166. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts +97 -0
  167. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts.map +1 -0
  168. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts +38 -0
  169. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts.map +1 -0
  170. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts +5 -0
  171. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map +1 -0
  172. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts +3 -0
  173. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts.map +1 -0
  174. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts +32 -0
  175. package/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts.map +1 -0
  176. package/node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts +7 -0
  177. package/node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts.map +1 -0
  178. package/node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts +8 -0
  179. package/node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts.map +1 -0
  180. package/node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts +8 -0
  181. package/node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts.map +1 -0
  182. package/node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts +17 -0
  183. package/node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts.map +1 -0
  184. package/node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts +7 -0
  185. package/node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts.map +1 -0
  186. package/node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts +11 -0
  187. package/node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts.map +1 -0
  188. package/node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts +12 -0
  189. package/node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts.map +1 -0
  190. package/node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts +47 -0
  191. package/node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts.map +1 -0
  192. package/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +15 -0
  193. package/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -0
  194. package/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts +6 -0
  195. package/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts.map +1 -0
  196. package/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts +11 -0
  197. package/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts.map +1 -0
  198. package/node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts +30 -0
  199. package/node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts.map +1 -0
  200. package/node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts +31 -0
  201. package/node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts.map +1 -0
  202. package/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts +17 -0
  203. package/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts.map +1 -0
  204. package/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts +34 -0
  205. package/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts.map +1 -0
  206. package/node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts +30 -0
  207. package/node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts.map +1 -0
  208. package/node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts +31 -0
  209. package/node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts.map +1 -0
  210. package/node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts +31 -0
  211. package/node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts.map +1 -0
  212. package/node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts +29 -0
  213. package/node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts.map +1 -0
  214. package/node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts +6 -0
  215. package/node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts.map +1 -0
  216. package/node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts +39 -0
  217. package/node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts.map +1 -0
  218. package/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts +5 -0
  219. package/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts.map +1 -0
  220. package/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts +14 -0
  221. package/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts.map +1 -0
  222. package/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts +9 -0
  223. package/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts.map +1 -0
  224. package/node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts +3 -0
  225. package/node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts.map +1 -0
  226. package/node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts +2 -0
  227. package/node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts.map +1 -0
  228. package/node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts +3 -0
  229. package/node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts.map +1 -0
  230. package/node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts +3 -0
  231. package/node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts.map +1 -0
  232. package/node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts +13 -0
  233. package/node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts.map +1 -0
  234. package/node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts +13 -0
  235. package/node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts.map +1 -0
  236. package/node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts +45 -0
  237. package/node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts.map +1 -0
  238. package/node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts +83 -0
  239. package/node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts.map +1 -0
  240. package/node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts +7 -0
  241. package/node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts.map +1 -0
  242. package/node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts +9 -0
  243. package/node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts.map +1 -0
  244. package/node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts +2 -0
  245. package/node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts.map +1 -0
  246. package/node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts +30 -0
  247. package/node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts.map +1 -0
  248. package/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts +10 -0
  249. package/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts.map +1 -0
  250. package/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts +9 -0
  251. package/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -0
  252. package/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts +13 -0
  253. package/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts.map +1 -0
  254. package/node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts +14 -0
  255. package/node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts.map +1 -0
  256. package/node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts +11 -0
  257. package/node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts.map +1 -0
  258. package/node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts +10 -0
  259. package/node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map +1 -0
  260. package/node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts +2 -0
  261. package/node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts.map +1 -0
  262. package/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts +10 -0
  263. package/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts.map +1 -0
  264. package/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts +2 -0
  265. package/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts.map +1 -0
  266. package/node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts +11 -0
  267. package/node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts.map +1 -0
  268. package/node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts +20 -0
  269. package/node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts.map +1 -0
  270. package/node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts +24 -0
  271. package/node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts.map +1 -0
  272. package/node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts +4 -0
  273. package/node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts.map +1 -0
  274. package/node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts +7 -0
  275. package/node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts.map +1 -0
  276. package/node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts +7 -0
  277. package/node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts.map +1 -0
  278. package/node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts +34 -0
  279. package/node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts.map +1 -0
  280. package/node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts +4 -0
  281. package/node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts.map +1 -0
  282. package/node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts +9 -0
  283. package/node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts.map +1 -0
  284. package/node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts +33 -0
  285. package/node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts.map +1 -0
  286. package/node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts +18 -0
  287. package/node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts.map +1 -0
  288. package/node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts +21 -0
  289. package/node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts.map +1 -0
  290. package/node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts +11 -0
  291. package/node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts.map +1 -0
  292. package/node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts +23 -0
  293. package/node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts.map +1 -0
  294. package/node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts +30 -0
  295. package/node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts.map +1 -0
  296. package/node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  297. package/node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
  298. package/node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts +53 -0
  299. package/node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts.map +1 -0
  300. package/node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts +12 -0
  301. package/node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts.map +1 -0
  302. package/node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts +38 -0
  303. package/node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts.map +1 -0
  304. package/node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts +22 -0
  305. package/node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts.map +1 -0
  306. package/node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts +27 -0
  307. package/node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts.map +1 -0
  308. package/node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts +105 -0
  309. package/node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts.map +1 -0
  310. package/node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts +39 -0
  311. package/node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts.map +1 -0
  312. package/node_modules/@xyflow/react/dist/esm/hooks/useOnEdgesChangeMiddleware.d.ts +10 -0
  313. package/node_modules/@xyflow/react/dist/esm/hooks/useOnEdgesChangeMiddleware.d.ts.map +1 -0
  314. package/node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts +8 -0
  315. package/node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts.map +1 -0
  316. package/node_modules/@xyflow/react/dist/esm/hooks/useOnNodesChangeMiddleware.d.ts +10 -0
  317. package/node_modules/@xyflow/react/dist/esm/hooks/useOnNodesChangeMiddleware.d.ts.map +1 -0
  318. package/node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts +43 -0
  319. package/node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts.map +1 -0
  320. package/node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts +33 -0
  321. package/node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts.map +1 -0
  322. package/node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts +30 -0
  323. package/node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts.map +1 -0
  324. package/node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts +8 -0
  325. package/node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts.map +1 -0
  326. package/node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts +45 -0
  327. package/node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts.map +1 -0
  328. package/node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts +48 -0
  329. package/node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts.map +1 -0
  330. package/node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts +32 -0
  331. package/node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts.map +1 -0
  332. package/node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts +10 -0
  333. package/node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts.map +1 -0
  334. package/node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts +9 -0
  335. package/node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts.map +1 -0
  336. package/node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts +9 -0
  337. package/node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts.map +1 -0
  338. package/node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts +9 -0
  339. package/node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts.map +1 -0
  340. package/node_modules/@xyflow/react/dist/esm/index.d.ts +41 -0
  341. package/node_modules/@xyflow/react/dist/esm/index.d.ts.map +1 -0
  342. package/node_modules/@xyflow/react/dist/esm/index.js +4987 -0
  343. package/node_modules/@xyflow/react/dist/esm/index.mjs +4987 -0
  344. package/node_modules/@xyflow/react/dist/esm/store/index.d.ts +19 -0
  345. package/node_modules/@xyflow/react/dist/esm/store/index.d.ts.map +1 -0
  346. package/node_modules/@xyflow/react/dist/esm/store/initialState.d.ts +19 -0
  347. package/node_modules/@xyflow/react/dist/esm/store/initialState.d.ts.map +1 -0
  348. package/node_modules/@xyflow/react/dist/esm/styles/utils.d.ts +3 -0
  349. package/node_modules/@xyflow/react/dist/esm/styles/utils.d.ts.map +1 -0
  350. package/node_modules/@xyflow/react/dist/esm/types/component-props.d.ts +649 -0
  351. package/node_modules/@xyflow/react/dist/esm/types/component-props.d.ts.map +1 -0
  352. package/node_modules/@xyflow/react/dist/esm/types/edges.d.ts +217 -0
  353. package/node_modules/@xyflow/react/dist/esm/types/edges.d.ts.map +1 -0
  354. package/node_modules/@xyflow/react/dist/esm/types/general.d.ts +179 -0
  355. package/node_modules/@xyflow/react/dist/esm/types/general.d.ts.map +1 -0
  356. package/node_modules/@xyflow/react/dist/esm/types/index.d.ts +7 -0
  357. package/node_modules/@xyflow/react/dist/esm/types/index.d.ts.map +1 -0
  358. package/node_modules/@xyflow/react/dist/esm/types/instance.d.ts +242 -0
  359. package/node_modules/@xyflow/react/dist/esm/types/instance.d.ts.map +1 -0
  360. package/node_modules/@xyflow/react/dist/esm/types/nodes.d.ts +101 -0
  361. package/node_modules/@xyflow/react/dist/esm/types/nodes.d.ts.map +1 -0
  362. package/node_modules/@xyflow/react/dist/esm/types/store.d.ts +115 -0
  363. package/node_modules/@xyflow/react/dist/esm/types/store.d.ts.map +1 -0
  364. package/node_modules/@xyflow/react/dist/esm/utils/changes.d.ts +87 -0
  365. package/node_modules/@xyflow/react/dist/esm/utils/changes.d.ts.map +1 -0
  366. package/node_modules/@xyflow/react/dist/esm/utils/general.d.ts +48 -0
  367. package/node_modules/@xyflow/react/dist/esm/utils/general.d.ts.map +1 -0
  368. package/node_modules/@xyflow/react/dist/esm/utils/index.d.ts +3 -0
  369. package/node_modules/@xyflow/react/dist/esm/utils/index.d.ts.map +1 -0
  370. package/node_modules/@xyflow/react/dist/style.css +624 -0
  371. package/node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts +61 -0
  372. package/node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts.map +1 -0
  373. package/node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts +15 -0
  374. package/node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts.map +1 -0
  375. package/node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts +3 -0
  376. package/node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts.map +1 -0
  377. package/node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts +59 -0
  378. package/node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts.map +1 -0
  379. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts +26 -0
  380. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts.map +1 -0
  381. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts +29 -0
  382. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts.map +1 -0
  383. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts +2 -0
  384. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts.map +1 -0
  385. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts +2 -0
  386. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts.map +1 -0
  387. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts +2 -0
  388. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts.map +1 -0
  389. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts +2 -0
  390. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts.map +1 -0
  391. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts +2 -0
  392. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts.map +1 -0
  393. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts +4 -0
  394. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts.map +1 -0
  395. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts +66 -0
  396. package/node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts.map +1 -0
  397. package/node_modules/@xyflow/react/dist/umd/additional-components/EdgeToolbar/EdgeToolbar.d.ts +26 -0
  398. package/node_modules/@xyflow/react/dist/umd/additional-components/EdgeToolbar/EdgeToolbar.d.ts.map +1 -0
  399. package/node_modules/@xyflow/react/dist/umd/additional-components/EdgeToolbar/index.d.ts +3 -0
  400. package/node_modules/@xyflow/react/dist/umd/additional-components/EdgeToolbar/index.d.ts.map +1 -0
  401. package/node_modules/@xyflow/react/dist/umd/additional-components/EdgeToolbar/types.d.ts +13 -0
  402. package/node_modules/@xyflow/react/dist/umd/additional-components/EdgeToolbar/types.d.ts.map +1 -0
  403. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts +29 -0
  404. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts.map +1 -0
  405. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts +5 -0
  406. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts.map +1 -0
  407. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts +6 -0
  408. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts.map +1 -0
  409. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts +4 -0
  410. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts.map +1 -0
  411. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts +123 -0
  412. package/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts.map +1 -0
  413. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts +11 -0
  414. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -0
  415. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts +27 -0
  416. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts.map +1 -0
  417. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts +4 -0
  418. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts.map +1 -0
  419. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts +97 -0
  420. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts.map +1 -0
  421. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts +38 -0
  422. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts.map +1 -0
  423. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts +5 -0
  424. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map +1 -0
  425. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts +3 -0
  426. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts.map +1 -0
  427. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts +32 -0
  428. package/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts.map +1 -0
  429. package/node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts +7 -0
  430. package/node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts.map +1 -0
  431. package/node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts +8 -0
  432. package/node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts.map +1 -0
  433. package/node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts +8 -0
  434. package/node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts.map +1 -0
  435. package/node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts +17 -0
  436. package/node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts.map +1 -0
  437. package/node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts +7 -0
  438. package/node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts.map +1 -0
  439. package/node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts +11 -0
  440. package/node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts.map +1 -0
  441. package/node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts +12 -0
  442. package/node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts.map +1 -0
  443. package/node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts +47 -0
  444. package/node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts.map +1 -0
  445. package/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +15 -0
  446. package/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -0
  447. package/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts +6 -0
  448. package/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts.map +1 -0
  449. package/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts +11 -0
  450. package/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts.map +1 -0
  451. package/node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts +30 -0
  452. package/node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts.map +1 -0
  453. package/node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts +31 -0
  454. package/node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts.map +1 -0
  455. package/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts +17 -0
  456. package/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts.map +1 -0
  457. package/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts +34 -0
  458. package/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts.map +1 -0
  459. package/node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts +30 -0
  460. package/node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts.map +1 -0
  461. package/node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts +31 -0
  462. package/node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts.map +1 -0
  463. package/node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts +31 -0
  464. package/node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts.map +1 -0
  465. package/node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts +29 -0
  466. package/node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts.map +1 -0
  467. package/node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts +6 -0
  468. package/node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts.map +1 -0
  469. package/node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts +39 -0
  470. package/node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts.map +1 -0
  471. package/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts +5 -0
  472. package/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts.map +1 -0
  473. package/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts +14 -0
  474. package/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts.map +1 -0
  475. package/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts +9 -0
  476. package/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts.map +1 -0
  477. package/node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts +3 -0
  478. package/node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts.map +1 -0
  479. package/node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts +2 -0
  480. package/node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts.map +1 -0
  481. package/node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts +3 -0
  482. package/node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts.map +1 -0
  483. package/node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts +3 -0
  484. package/node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts.map +1 -0
  485. package/node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts +13 -0
  486. package/node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts.map +1 -0
  487. package/node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts +13 -0
  488. package/node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts.map +1 -0
  489. package/node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts +45 -0
  490. package/node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts.map +1 -0
  491. package/node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts +83 -0
  492. package/node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts.map +1 -0
  493. package/node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts +7 -0
  494. package/node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts.map +1 -0
  495. package/node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts +9 -0
  496. package/node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts.map +1 -0
  497. package/node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts +2 -0
  498. package/node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts.map +1 -0
  499. package/node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts +30 -0
  500. package/node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts.map +1 -0
  501. package/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts +10 -0
  502. package/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts.map +1 -0
  503. package/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts +9 -0
  504. package/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -0
  505. package/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts +13 -0
  506. package/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts.map +1 -0
  507. package/node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts +14 -0
  508. package/node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts.map +1 -0
  509. package/node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts +11 -0
  510. package/node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts.map +1 -0
  511. package/node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts +10 -0
  512. package/node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map +1 -0
  513. package/node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts +2 -0
  514. package/node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts.map +1 -0
  515. package/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts +10 -0
  516. package/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts.map +1 -0
  517. package/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts +2 -0
  518. package/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts.map +1 -0
  519. package/node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts +11 -0
  520. package/node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts.map +1 -0
  521. package/node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts +20 -0
  522. package/node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts.map +1 -0
  523. package/node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts +24 -0
  524. package/node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts.map +1 -0
  525. package/node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts +4 -0
  526. package/node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts.map +1 -0
  527. package/node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts +7 -0
  528. package/node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts.map +1 -0
  529. package/node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts +7 -0
  530. package/node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts.map +1 -0
  531. package/node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts +34 -0
  532. package/node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts.map +1 -0
  533. package/node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts +4 -0
  534. package/node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts.map +1 -0
  535. package/node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts +9 -0
  536. package/node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts.map +1 -0
  537. package/node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts +33 -0
  538. package/node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts.map +1 -0
  539. package/node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts +18 -0
  540. package/node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts.map +1 -0
  541. package/node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts +21 -0
  542. package/node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts.map +1 -0
  543. package/node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts +11 -0
  544. package/node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts.map +1 -0
  545. package/node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts +23 -0
  546. package/node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts.map +1 -0
  547. package/node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts +30 -0
  548. package/node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts.map +1 -0
  549. package/node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  550. package/node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
  551. package/node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts +53 -0
  552. package/node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts.map +1 -0
  553. package/node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts +12 -0
  554. package/node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts.map +1 -0
  555. package/node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts +38 -0
  556. package/node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts.map +1 -0
  557. package/node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts +22 -0
  558. package/node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts.map +1 -0
  559. package/node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts +27 -0
  560. package/node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts.map +1 -0
  561. package/node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts +105 -0
  562. package/node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts.map +1 -0
  563. package/node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts +39 -0
  564. package/node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts.map +1 -0
  565. package/node_modules/@xyflow/react/dist/umd/hooks/useOnEdgesChangeMiddleware.d.ts +10 -0
  566. package/node_modules/@xyflow/react/dist/umd/hooks/useOnEdgesChangeMiddleware.d.ts.map +1 -0
  567. package/node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts +8 -0
  568. package/node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts.map +1 -0
  569. package/node_modules/@xyflow/react/dist/umd/hooks/useOnNodesChangeMiddleware.d.ts +10 -0
  570. package/node_modules/@xyflow/react/dist/umd/hooks/useOnNodesChangeMiddleware.d.ts.map +1 -0
  571. package/node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts +43 -0
  572. package/node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts.map +1 -0
  573. package/node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts +33 -0
  574. package/node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts.map +1 -0
  575. package/node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts +30 -0
  576. package/node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts.map +1 -0
  577. package/node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts +8 -0
  578. package/node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts.map +1 -0
  579. package/node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts +45 -0
  580. package/node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts.map +1 -0
  581. package/node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts +48 -0
  582. package/node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts.map +1 -0
  583. package/node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts +32 -0
  584. package/node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts.map +1 -0
  585. package/node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts +10 -0
  586. package/node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts.map +1 -0
  587. package/node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts +9 -0
  588. package/node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts.map +1 -0
  589. package/node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts +9 -0
  590. package/node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts.map +1 -0
  591. package/node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts +9 -0
  592. package/node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts.map +1 -0
  593. package/node_modules/@xyflow/react/dist/umd/index.d.ts +41 -0
  594. package/node_modules/@xyflow/react/dist/umd/index.d.ts.map +1 -0
  595. package/node_modules/@xyflow/react/dist/umd/index.js +10 -0
  596. package/node_modules/@xyflow/react/dist/umd/store/index.d.ts +19 -0
  597. package/node_modules/@xyflow/react/dist/umd/store/index.d.ts.map +1 -0
  598. package/node_modules/@xyflow/react/dist/umd/store/initialState.d.ts +19 -0
  599. package/node_modules/@xyflow/react/dist/umd/store/initialState.d.ts.map +1 -0
  600. package/node_modules/@xyflow/react/dist/umd/styles/utils.d.ts +3 -0
  601. package/node_modules/@xyflow/react/dist/umd/styles/utils.d.ts.map +1 -0
  602. package/node_modules/@xyflow/react/dist/umd/types/component-props.d.ts +649 -0
  603. package/node_modules/@xyflow/react/dist/umd/types/component-props.d.ts.map +1 -0
  604. package/node_modules/@xyflow/react/dist/umd/types/edges.d.ts +217 -0
  605. package/node_modules/@xyflow/react/dist/umd/types/edges.d.ts.map +1 -0
  606. package/node_modules/@xyflow/react/dist/umd/types/general.d.ts +179 -0
  607. package/node_modules/@xyflow/react/dist/umd/types/general.d.ts.map +1 -0
  608. package/node_modules/@xyflow/react/dist/umd/types/index.d.ts +7 -0
  609. package/node_modules/@xyflow/react/dist/umd/types/index.d.ts.map +1 -0
  610. package/node_modules/@xyflow/react/dist/umd/types/instance.d.ts +242 -0
  611. package/node_modules/@xyflow/react/dist/umd/types/instance.d.ts.map +1 -0
  612. package/node_modules/@xyflow/react/dist/umd/types/nodes.d.ts +101 -0
  613. package/node_modules/@xyflow/react/dist/umd/types/nodes.d.ts.map +1 -0
  614. package/node_modules/@xyflow/react/dist/umd/types/store.d.ts +115 -0
  615. package/node_modules/@xyflow/react/dist/umd/types/store.d.ts.map +1 -0
  616. package/node_modules/@xyflow/react/dist/umd/utils/changes.d.ts +87 -0
  617. package/node_modules/@xyflow/react/dist/umd/utils/changes.d.ts.map +1 -0
  618. package/node_modules/@xyflow/react/dist/umd/utils/general.d.ts +48 -0
  619. package/node_modules/@xyflow/react/dist/umd/utils/general.d.ts.map +1 -0
  620. package/node_modules/@xyflow/react/dist/umd/utils/index.d.ts +3 -0
  621. package/node_modules/@xyflow/react/dist/umd/utils/index.d.ts.map +1 -0
  622. package/node_modules/@xyflow/react/node_modules/zustand/LICENSE +21 -0
  623. package/node_modules/@xyflow/react/node_modules/zustand/context.d.ts +25 -0
  624. package/node_modules/@xyflow/react/node_modules/zustand/context.js +60 -0
  625. package/node_modules/@xyflow/react/node_modules/zustand/esm/context.d.mts +25 -0
  626. package/node_modules/@xyflow/react/node_modules/zustand/esm/context.d.ts +25 -0
  627. package/node_modules/@xyflow/react/node_modules/zustand/esm/context.js +61 -0
  628. package/node_modules/@xyflow/react/node_modules/zustand/esm/context.mjs +61 -0
  629. package/node_modules/@xyflow/react/node_modules/zustand/esm/index.d.mts +3 -0
  630. package/node_modules/@xyflow/react/node_modules/zustand/esm/index.d.ts +3 -0
  631. package/node_modules/@xyflow/react/node_modules/zustand/esm/index.js +48 -0
  632. package/node_modules/@xyflow/react/node_modules/zustand/esm/index.mjs +48 -0
  633. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/combine.d.mts +5 -0
  634. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/combine.d.ts +5 -0
  635. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/devtools.d.mts +49 -0
  636. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/devtools.d.ts +49 -0
  637. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/immer.d.mts +25 -0
  638. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/immer.d.ts +25 -0
  639. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/immer.js +12 -0
  640. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/immer.mjs +12 -0
  641. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/persist.d.mts +119 -0
  642. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/persist.d.ts +119 -0
  643. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/redux.d.mts +21 -0
  644. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/redux.d.ts +21 -0
  645. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts +25 -0
  646. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware/subscribeWithSelector.d.ts +25 -0
  647. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware.d.mts +5 -0
  648. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware.d.ts +5 -0
  649. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware.js +583 -0
  650. package/node_modules/@xyflow/react/node_modules/zustand/esm/middleware.mjs +583 -0
  651. package/node_modules/@xyflow/react/node_modules/zustand/esm/react/shallow.d.mts +1 -0
  652. package/node_modules/@xyflow/react/node_modules/zustand/esm/react/shallow.d.ts +1 -0
  653. package/node_modules/@xyflow/react/node_modules/zustand/esm/react/shallow.js +49 -0
  654. package/node_modules/@xyflow/react/node_modules/zustand/esm/react/shallow.mjs +49 -0
  655. package/node_modules/@xyflow/react/node_modules/zustand/esm/react.d.mts +38 -0
  656. package/node_modules/@xyflow/react/node_modules/zustand/esm/react.d.ts +38 -0
  657. package/node_modules/@xyflow/react/node_modules/zustand/esm/shallow.d.mts +7 -0
  658. package/node_modules/@xyflow/react/node_modules/zustand/esm/shallow.d.ts +7 -0
  659. package/node_modules/@xyflow/react/node_modules/zustand/esm/shallow.js +47 -0
  660. package/node_modules/@xyflow/react/node_modules/zustand/esm/shallow.mjs +47 -0
  661. package/node_modules/@xyflow/react/node_modules/zustand/esm/traditional.d.mts +21 -0
  662. package/node_modules/@xyflow/react/node_modules/zustand/esm/traditional.d.ts +21 -0
  663. package/node_modules/@xyflow/react/node_modules/zustand/esm/traditional.js +27 -0
  664. package/node_modules/@xyflow/react/node_modules/zustand/esm/traditional.mjs +27 -0
  665. package/node_modules/@xyflow/react/node_modules/zustand/esm/vanilla/shallow.d.mts +1 -0
  666. package/node_modules/@xyflow/react/node_modules/zustand/esm/vanilla/shallow.d.ts +1 -0
  667. package/node_modules/@xyflow/react/node_modules/zustand/esm/vanilla/shallow.js +38 -0
  668. package/node_modules/@xyflow/react/node_modules/zustand/esm/vanilla/shallow.mjs +38 -0
  669. package/node_modules/@xyflow/react/node_modules/zustand/esm/vanilla.d.mts +81 -0
  670. package/node_modules/@xyflow/react/node_modules/zustand/esm/vanilla.d.ts +81 -0
  671. package/node_modules/@xyflow/react/node_modules/zustand/esm/vanilla.js +40 -0
  672. package/node_modules/@xyflow/react/node_modules/zustand/esm/vanilla.mjs +40 -0
  673. package/node_modules/@xyflow/react/node_modules/zustand/index.d.ts +3 -0
  674. package/node_modules/@xyflow/react/node_modules/zustand/index.js +60 -0
  675. package/node_modules/@xyflow/react/node_modules/zustand/middleware/combine.d.ts +5 -0
  676. package/node_modules/@xyflow/react/node_modules/zustand/middleware/devtools.d.ts +49 -0
  677. package/node_modules/@xyflow/react/node_modules/zustand/middleware/immer.d.ts +25 -0
  678. package/node_modules/@xyflow/react/node_modules/zustand/middleware/immer.js +19 -0
  679. package/node_modules/@xyflow/react/node_modules/zustand/middleware/persist.d.ts +119 -0
  680. package/node_modules/@xyflow/react/node_modules/zustand/middleware/redux.d.ts +21 -0
  681. package/node_modules/@xyflow/react/node_modules/zustand/middleware/subscribeWithSelector.d.ts +25 -0
  682. package/node_modules/@xyflow/react/node_modules/zustand/middleware.d.ts +5 -0
  683. package/node_modules/@xyflow/react/node_modules/zustand/middleware.js +609 -0
  684. package/node_modules/@xyflow/react/node_modules/zustand/package.json +232 -0
  685. package/node_modules/@xyflow/react/node_modules/zustand/react/shallow.d.ts +1 -0
  686. package/node_modules/@xyflow/react/node_modules/zustand/react/shallow.js +86 -0
  687. package/node_modules/@xyflow/react/node_modules/zustand/react.d.ts +38 -0
  688. package/node_modules/@xyflow/react/node_modules/zustand/readme.md +505 -0
  689. package/node_modules/@xyflow/react/node_modules/zustand/shallow.d.ts +7 -0
  690. package/node_modules/@xyflow/react/node_modules/zustand/shallow.js +87 -0
  691. package/node_modules/@xyflow/react/node_modules/zustand/system/context.development.js +73 -0
  692. package/node_modules/@xyflow/react/node_modules/zustand/system/context.production.js +1 -0
  693. package/node_modules/@xyflow/react/node_modules/zustand/system/index.development.js +71 -0
  694. package/node_modules/@xyflow/react/node_modules/zustand/system/index.production.js +1 -0
  695. package/node_modules/@xyflow/react/node_modules/zustand/system/middleware/immer.development.js +21 -0
  696. package/node_modules/@xyflow/react/node_modules/zustand/system/middleware/immer.production.js +1 -0
  697. package/node_modules/@xyflow/react/node_modules/zustand/system/middleware.development.js +592 -0
  698. package/node_modules/@xyflow/react/node_modules/zustand/system/middleware.production.js +5 -0
  699. package/node_modules/@xyflow/react/node_modules/zustand/system/react/shallow.development.js +60 -0
  700. package/node_modules/@xyflow/react/node_modules/zustand/system/react/shallow.production.js +1 -0
  701. package/node_modules/@xyflow/react/node_modules/zustand/system/shallow.development.js +56 -0
  702. package/node_modules/@xyflow/react/node_modules/zustand/system/shallow.production.js +1 -0
  703. package/node_modules/@xyflow/react/node_modules/zustand/system/traditional.development.js +40 -0
  704. package/node_modules/@xyflow/react/node_modules/zustand/system/traditional.production.js +1 -0
  705. package/node_modules/@xyflow/react/node_modules/zustand/system/vanilla/shallow.development.js +47 -0
  706. package/node_modules/@xyflow/react/node_modules/zustand/system/vanilla/shallow.production.js +1 -0
  707. package/node_modules/@xyflow/react/node_modules/zustand/system/vanilla.development.js +47 -0
  708. package/node_modules/@xyflow/react/node_modules/zustand/system/vanilla.production.js +1 -0
  709. package/node_modules/@xyflow/react/node_modules/zustand/traditional.d.ts +21 -0
  710. package/node_modules/@xyflow/react/node_modules/zustand/traditional.js +36 -0
  711. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/context.d.ts +25 -0
  712. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/context.d.ts +25 -0
  713. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/index.d.ts +3 -0
  714. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/middleware/combine.d.ts +13 -0
  715. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/middleware/devtools.d.ts +102 -0
  716. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/middleware/immer.d.ts +60 -0
  717. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/middleware/persist.d.ts +139 -0
  718. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/middleware/redux.d.ts +30 -0
  719. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/middleware/subscribeWithSelector.d.ts +42 -0
  720. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/middleware.d.ts +5 -0
  721. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/react/shallow.d.ts +1 -0
  722. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/react.d.ts +48 -0
  723. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/shallow.d.ts +7 -0
  724. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/traditional.d.ts +31 -0
  725. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/vanilla/shallow.d.ts +1 -0
  726. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/esm/vanilla.d.ts +106 -0
  727. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/index.d.ts +3 -0
  728. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/middleware/combine.d.ts +13 -0
  729. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/middleware/devtools.d.ts +102 -0
  730. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/middleware/immer.d.ts +60 -0
  731. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/middleware/persist.d.ts +139 -0
  732. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/middleware/redux.d.ts +30 -0
  733. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/middleware/subscribeWithSelector.d.ts +42 -0
  734. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/middleware.d.ts +5 -0
  735. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/react/shallow.d.ts +1 -0
  736. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/react.d.ts +48 -0
  737. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/shallow.d.ts +7 -0
  738. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/traditional.d.ts +31 -0
  739. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/vanilla/shallow.d.ts +1 -0
  740. package/node_modules/@xyflow/react/node_modules/zustand/ts3.4/vanilla.d.ts +106 -0
  741. package/node_modules/@xyflow/react/node_modules/zustand/umd/context.development.js +63 -0
  742. package/node_modules/@xyflow/react/node_modules/zustand/umd/context.production.js +1 -0
  743. package/node_modules/@xyflow/react/node_modules/zustand/umd/index.development.js +58 -0
  744. package/node_modules/@xyflow/react/node_modules/zustand/umd/index.production.js +1 -0
  745. package/node_modules/@xyflow/react/node_modules/zustand/umd/middleware/immer.development.js +23 -0
  746. package/node_modules/@xyflow/react/node_modules/zustand/umd/middleware/immer.production.js +1 -0
  747. package/node_modules/@xyflow/react/node_modules/zustand/umd/middleware.development.js +615 -0
  748. package/node_modules/@xyflow/react/node_modules/zustand/umd/middleware.production.js +1 -0
  749. package/node_modules/@xyflow/react/node_modules/zustand/umd/react/shallow.development.js +90 -0
  750. package/node_modules/@xyflow/react/node_modules/zustand/umd/react/shallow.production.js +1 -0
  751. package/node_modules/@xyflow/react/node_modules/zustand/umd/shallow.development.js +91 -0
  752. package/node_modules/@xyflow/react/node_modules/zustand/umd/shallow.production.js +1 -0
  753. package/node_modules/@xyflow/react/node_modules/zustand/umd/traditional.development.js +38 -0
  754. package/node_modules/@xyflow/react/node_modules/zustand/umd/traditional.production.js +1 -0
  755. package/node_modules/@xyflow/react/node_modules/zustand/umd/vanilla/shallow.development.js +81 -0
  756. package/node_modules/@xyflow/react/node_modules/zustand/umd/vanilla/shallow.production.js +1 -0
  757. package/node_modules/@xyflow/react/node_modules/zustand/umd/vanilla.development.js +63 -0
  758. package/node_modules/@xyflow/react/node_modules/zustand/umd/vanilla.production.js +1 -0
  759. package/node_modules/@xyflow/react/node_modules/zustand/vanilla/shallow.d.ts +1 -0
  760. package/node_modules/@xyflow/react/node_modules/zustand/vanilla/shallow.js +75 -0
  761. package/node_modules/@xyflow/react/node_modules/zustand/vanilla.d.ts +81 -0
  762. package/node_modules/@xyflow/react/node_modules/zustand/vanilla.js +59 -0
  763. package/node_modules/@xyflow/react/package.json +98 -0
  764. package/node_modules/@xyflow/system/LICENSE +21 -0
  765. package/node_modules/@xyflow/system/README.md +62 -0
  766. package/node_modules/@xyflow/system/dist/esm/constants.d.ts +43 -0
  767. package/node_modules/@xyflow/system/dist/esm/constants.d.ts.map +1 -0
  768. package/node_modules/@xyflow/system/dist/esm/index.d.ts +9 -0
  769. package/node_modules/@xyflow/system/dist/esm/index.d.ts.map +1 -0
  770. package/node_modules/@xyflow/system/dist/esm/index.js +3514 -0
  771. package/node_modules/@xyflow/system/dist/esm/index.mjs +3514 -0
  772. package/node_modules/@xyflow/system/dist/esm/types/changes.d.ts +64 -0
  773. package/node_modules/@xyflow/system/dist/esm/types/changes.d.ts.map +1 -0
  774. package/node_modules/@xyflow/system/dist/esm/types/edges.d.ts +140 -0
  775. package/node_modules/@xyflow/system/dist/esm/types/edges.d.ts.map +1 -0
  776. package/node_modules/@xyflow/system/dist/esm/types/general.d.ts +296 -0
  777. package/node_modules/@xyflow/system/dist/esm/types/general.d.ts.map +1 -0
  778. package/node_modules/@xyflow/system/dist/esm/types/handles.d.ts +58 -0
  779. package/node_modules/@xyflow/system/dist/esm/types/handles.d.ts.map +1 -0
  780. package/node_modules/@xyflow/system/dist/esm/types/index.d.ts +8 -0
  781. package/node_modules/@xyflow/system/dist/esm/types/index.d.ts.map +1 -0
  782. package/node_modules/@xyflow/system/dist/esm/types/nodes.d.ts +157 -0
  783. package/node_modules/@xyflow/system/dist/esm/types/nodes.d.ts.map +1 -0
  784. package/node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts +55 -0
  785. package/node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts.map +1 -0
  786. package/node_modules/@xyflow/system/dist/esm/types/utils.d.ts +61 -0
  787. package/node_modules/@xyflow/system/dist/esm/types/utils.d.ts.map +1 -0
  788. package/node_modules/@xyflow/system/dist/esm/utils/connections.d.ts +13 -0
  789. package/node_modules/@xyflow/system/dist/esm/utils/connections.d.ts.map +1 -0
  790. package/node_modules/@xyflow/system/dist/esm/utils/dom.d.ts +21 -0
  791. package/node_modules/@xyflow/system/dist/esm/utils/dom.d.ts.map +1 -0
  792. package/node_modules/@xyflow/system/dist/esm/utils/edge-toolbar.d.ts +2 -0
  793. package/node_modules/@xyflow/system/dist/esm/utils/edge-toolbar.d.ts.map +1 -0
  794. package/node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts +77 -0
  795. package/node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts.map +1 -0
  796. package/node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts +91 -0
  797. package/node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts.map +1 -0
  798. package/node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts +6 -0
  799. package/node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts.map +1 -0
  800. package/node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts +17 -0
  801. package/node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts.map +1 -0
  802. package/node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts +66 -0
  803. package/node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts.map +1 -0
  804. package/node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts +41 -0
  805. package/node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts.map +1 -0
  806. package/node_modules/@xyflow/system/dist/esm/utils/general.d.ts +85 -0
  807. package/node_modules/@xyflow/system/dist/esm/utils/general.d.ts.map +1 -0
  808. package/node_modules/@xyflow/system/dist/esm/utils/graph.d.ts +191 -0
  809. package/node_modules/@xyflow/system/dist/esm/utils/graph.d.ts.map +1 -0
  810. package/node_modules/@xyflow/system/dist/esm/utils/index.d.ts +12 -0
  811. package/node_modules/@xyflow/system/dist/esm/utils/index.d.ts.map +1 -0
  812. package/node_modules/@xyflow/system/dist/esm/utils/marker.d.ts +9 -0
  813. package/node_modules/@xyflow/system/dist/esm/utils/marker.d.ts.map +1 -0
  814. package/node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts +3 -0
  815. package/node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts.map +1 -0
  816. package/node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts +5 -0
  817. package/node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts.map +1 -0
  818. package/node_modules/@xyflow/system/dist/esm/utils/store.d.ts +34 -0
  819. package/node_modules/@xyflow/system/dist/esm/utils/store.d.ts.map +1 -0
  820. package/node_modules/@xyflow/system/dist/esm/utils/types.d.ts +8 -0
  821. package/node_modules/@xyflow/system/dist/esm/utils/types.d.ts.map +1 -0
  822. package/node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts +55 -0
  823. package/node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts.map +1 -0
  824. package/node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts +2 -0
  825. package/node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts.map +1 -0
  826. package/node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts +24 -0
  827. package/node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts.map +1 -0
  828. package/node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts +3 -0
  829. package/node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts.map +1 -0
  830. package/node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts +2 -0
  831. package/node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts.map +1 -0
  832. package/node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts +50 -0
  833. package/node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts.map +1 -0
  834. package/node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts +10 -0
  835. package/node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts.map +1 -0
  836. package/node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts +28 -0
  837. package/node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts.map +1 -0
  838. package/node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts +12 -0
  839. package/node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts.map +1 -0
  840. package/node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts +46 -0
  841. package/node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts.map +1 -0
  842. package/node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts +15 -0
  843. package/node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts.map +1 -0
  844. package/node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts +2 -0
  845. package/node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts.map +1 -0
  846. package/node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts +9 -0
  847. package/node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts.map +1 -0
  848. package/node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts +49 -0
  849. package/node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts.map +1 -0
  850. package/node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts +3 -0
  851. package/node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts.map +1 -0
  852. package/node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts +59 -0
  853. package/node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts.map +1 -0
  854. package/node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts +76 -0
  855. package/node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts.map +1 -0
  856. package/node_modules/@xyflow/system/dist/umd/constants.d.ts +43 -0
  857. package/node_modules/@xyflow/system/dist/umd/constants.d.ts.map +1 -0
  858. package/node_modules/@xyflow/system/dist/umd/index.d.ts +9 -0
  859. package/node_modules/@xyflow/system/dist/umd/index.d.ts.map +1 -0
  860. package/node_modules/@xyflow/system/dist/umd/index.js +1 -0
  861. package/node_modules/@xyflow/system/dist/umd/types/changes.d.ts +64 -0
  862. package/node_modules/@xyflow/system/dist/umd/types/changes.d.ts.map +1 -0
  863. package/node_modules/@xyflow/system/dist/umd/types/edges.d.ts +140 -0
  864. package/node_modules/@xyflow/system/dist/umd/types/edges.d.ts.map +1 -0
  865. package/node_modules/@xyflow/system/dist/umd/types/general.d.ts +296 -0
  866. package/node_modules/@xyflow/system/dist/umd/types/general.d.ts.map +1 -0
  867. package/node_modules/@xyflow/system/dist/umd/types/handles.d.ts +58 -0
  868. package/node_modules/@xyflow/system/dist/umd/types/handles.d.ts.map +1 -0
  869. package/node_modules/@xyflow/system/dist/umd/types/index.d.ts +8 -0
  870. package/node_modules/@xyflow/system/dist/umd/types/index.d.ts.map +1 -0
  871. package/node_modules/@xyflow/system/dist/umd/types/nodes.d.ts +157 -0
  872. package/node_modules/@xyflow/system/dist/umd/types/nodes.d.ts.map +1 -0
  873. package/node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts +55 -0
  874. package/node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts.map +1 -0
  875. package/node_modules/@xyflow/system/dist/umd/types/utils.d.ts +61 -0
  876. package/node_modules/@xyflow/system/dist/umd/types/utils.d.ts.map +1 -0
  877. package/node_modules/@xyflow/system/dist/umd/utils/connections.d.ts +13 -0
  878. package/node_modules/@xyflow/system/dist/umd/utils/connections.d.ts.map +1 -0
  879. package/node_modules/@xyflow/system/dist/umd/utils/dom.d.ts +21 -0
  880. package/node_modules/@xyflow/system/dist/umd/utils/dom.d.ts.map +1 -0
  881. package/node_modules/@xyflow/system/dist/umd/utils/edge-toolbar.d.ts +2 -0
  882. package/node_modules/@xyflow/system/dist/umd/utils/edge-toolbar.d.ts.map +1 -0
  883. package/node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts +77 -0
  884. package/node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts.map +1 -0
  885. package/node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts +91 -0
  886. package/node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts.map +1 -0
  887. package/node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts +6 -0
  888. package/node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts.map +1 -0
  889. package/node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts +17 -0
  890. package/node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts.map +1 -0
  891. package/node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts +66 -0
  892. package/node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts.map +1 -0
  893. package/node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts +41 -0
  894. package/node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts.map +1 -0
  895. package/node_modules/@xyflow/system/dist/umd/utils/general.d.ts +85 -0
  896. package/node_modules/@xyflow/system/dist/umd/utils/general.d.ts.map +1 -0
  897. package/node_modules/@xyflow/system/dist/umd/utils/graph.d.ts +191 -0
  898. package/node_modules/@xyflow/system/dist/umd/utils/graph.d.ts.map +1 -0
  899. package/node_modules/@xyflow/system/dist/umd/utils/index.d.ts +12 -0
  900. package/node_modules/@xyflow/system/dist/umd/utils/index.d.ts.map +1 -0
  901. package/node_modules/@xyflow/system/dist/umd/utils/marker.d.ts +9 -0
  902. package/node_modules/@xyflow/system/dist/umd/utils/marker.d.ts.map +1 -0
  903. package/node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts +3 -0
  904. package/node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts.map +1 -0
  905. package/node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts +5 -0
  906. package/node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts.map +1 -0
  907. package/node_modules/@xyflow/system/dist/umd/utils/store.d.ts +34 -0
  908. package/node_modules/@xyflow/system/dist/umd/utils/store.d.ts.map +1 -0
  909. package/node_modules/@xyflow/system/dist/umd/utils/types.d.ts +8 -0
  910. package/node_modules/@xyflow/system/dist/umd/utils/types.d.ts.map +1 -0
  911. package/node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts +55 -0
  912. package/node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts.map +1 -0
  913. package/node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts +2 -0
  914. package/node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts.map +1 -0
  915. package/node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts +24 -0
  916. package/node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts.map +1 -0
  917. package/node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts +3 -0
  918. package/node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts.map +1 -0
  919. package/node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts +2 -0
  920. package/node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts.map +1 -0
  921. package/node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts +50 -0
  922. package/node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts.map +1 -0
  923. package/node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts +10 -0
  924. package/node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts.map +1 -0
  925. package/node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts +28 -0
  926. package/node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts.map +1 -0
  927. package/node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts +12 -0
  928. package/node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts.map +1 -0
  929. package/node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts +46 -0
  930. package/node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts.map +1 -0
  931. package/node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts +15 -0
  932. package/node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts.map +1 -0
  933. package/node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts +2 -0
  934. package/node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts.map +1 -0
  935. package/node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts +9 -0
  936. package/node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts.map +1 -0
  937. package/node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts +49 -0
  938. package/node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts.map +1 -0
  939. package/node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts +3 -0
  940. package/node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts.map +1 -0
  941. package/node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts +59 -0
  942. package/node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts.map +1 -0
  943. package/node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts +76 -0
  944. package/node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts.map +1 -0
  945. package/node_modules/@xyflow/system/package.json +79 -0
  946. package/node_modules/accepts/HISTORY.md +243 -0
  947. package/node_modules/accepts/LICENSE +23 -0
  948. package/node_modules/accepts/README.md +140 -0
  949. package/node_modules/accepts/index.js +238 -0
  950. package/node_modules/accepts/package.json +47 -0
  951. package/node_modules/array-flatten/LICENSE +21 -0
  952. package/node_modules/array-flatten/README.md +43 -0
  953. package/node_modules/array-flatten/array-flatten.js +64 -0
  954. package/node_modules/array-flatten/package.json +39 -0
  955. package/node_modules/balanced-match/LICENSE.md +23 -0
  956. package/node_modules/balanced-match/README.md +57 -0
  957. package/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
  958. package/node_modules/balanced-match/dist/commonjs/index.d.ts.map +1 -0
  959. package/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  960. package/node_modules/balanced-match/dist/commonjs/index.js.map +1 -0
  961. package/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  962. package/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
  963. package/node_modules/balanced-match/dist/esm/index.d.ts.map +1 -0
  964. package/node_modules/balanced-match/dist/esm/index.js +54 -0
  965. package/node_modules/balanced-match/dist/esm/index.js.map +1 -0
  966. package/node_modules/balanced-match/dist/esm/package.json +3 -0
  967. package/node_modules/balanced-match/package.json +68 -0
  968. package/node_modules/body-parser/HISTORY.md +680 -0
  969. package/node_modules/body-parser/LICENSE +23 -0
  970. package/node_modules/body-parser/README.md +476 -0
  971. package/node_modules/body-parser/index.js +156 -0
  972. package/node_modules/body-parser/lib/read.js +205 -0
  973. package/node_modules/body-parser/lib/types/json.js +247 -0
  974. package/node_modules/body-parser/lib/types/raw.js +101 -0
  975. package/node_modules/body-parser/lib/types/text.js +121 -0
  976. package/node_modules/body-parser/lib/types/urlencoded.js +300 -0
  977. package/node_modules/body-parser/node_modules/debug/.coveralls.yml +1 -0
  978. package/node_modules/body-parser/node_modules/debug/.eslintrc +11 -0
  979. package/node_modules/body-parser/node_modules/debug/.npmignore +9 -0
  980. package/node_modules/body-parser/node_modules/debug/.travis.yml +14 -0
  981. package/node_modules/body-parser/node_modules/debug/CHANGELOG.md +362 -0
  982. package/node_modules/body-parser/node_modules/debug/LICENSE +19 -0
  983. package/node_modules/body-parser/node_modules/debug/Makefile +50 -0
  984. package/node_modules/body-parser/node_modules/debug/README.md +312 -0
  985. package/node_modules/body-parser/node_modules/debug/component.json +19 -0
  986. package/node_modules/body-parser/node_modules/debug/karma.conf.js +70 -0
  987. package/node_modules/body-parser/node_modules/debug/node.js +1 -0
  988. package/node_modules/body-parser/node_modules/debug/package.json +49 -0
  989. package/node_modules/body-parser/node_modules/debug/src/browser.js +185 -0
  990. package/node_modules/body-parser/node_modules/debug/src/debug.js +202 -0
  991. package/node_modules/body-parser/node_modules/debug/src/index.js +10 -0
  992. package/node_modules/body-parser/node_modules/debug/src/inspector-log.js +15 -0
  993. package/node_modules/body-parser/node_modules/debug/src/node.js +248 -0
  994. package/node_modules/body-parser/node_modules/ms/index.js +152 -0
  995. package/node_modules/body-parser/node_modules/ms/license.md +21 -0
  996. package/node_modules/body-parser/node_modules/ms/package.json +37 -0
  997. package/node_modules/body-parser/node_modules/ms/readme.md +51 -0
  998. package/node_modules/body-parser/package.json +55 -0
  999. package/node_modules/brace-expansion/LICENSE +23 -0
  1000. package/node_modules/brace-expansion/README.md +94 -0
  1001. package/node_modules/brace-expansion/dist/commonjs/index.d.ts +6 -0
  1002. package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
  1003. package/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
  1004. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -0
  1005. package/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  1006. package/node_modules/brace-expansion/dist/esm/index.d.ts +6 -0
  1007. package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -0
  1008. package/node_modules/brace-expansion/dist/esm/index.js +197 -0
  1009. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
  1010. package/node_modules/brace-expansion/dist/esm/package.json +3 -0
  1011. package/node_modules/brace-expansion/package.json +64 -0
  1012. package/node_modules/bytes/History.md +97 -0
  1013. package/node_modules/bytes/LICENSE +23 -0
  1014. package/node_modules/bytes/Readme.md +152 -0
  1015. package/node_modules/bytes/index.js +170 -0
  1016. package/node_modules/bytes/package.json +42 -0
  1017. package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  1018. package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  1019. package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  1020. package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  1021. package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  1022. package/node_modules/call-bind-apply-helpers/README.md +62 -0
  1023. package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  1024. package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  1025. package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  1026. package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  1027. package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  1028. package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  1029. package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  1030. package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  1031. package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  1032. package/node_modules/call-bind-apply-helpers/index.js +15 -0
  1033. package/node_modules/call-bind-apply-helpers/package.json +85 -0
  1034. package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  1035. package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  1036. package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  1037. package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  1038. package/node_modules/call-bound/.eslintrc +13 -0
  1039. package/node_modules/call-bound/.github/FUNDING.yml +12 -0
  1040. package/node_modules/call-bound/.nycrc +9 -0
  1041. package/node_modules/call-bound/CHANGELOG.md +42 -0
  1042. package/node_modules/call-bound/LICENSE +21 -0
  1043. package/node_modules/call-bound/README.md +53 -0
  1044. package/node_modules/call-bound/index.d.ts +94 -0
  1045. package/node_modules/call-bound/index.js +19 -0
  1046. package/node_modules/call-bound/package.json +99 -0
  1047. package/node_modules/call-bound/test/index.js +61 -0
  1048. package/node_modules/call-bound/tsconfig.json +10 -0
  1049. package/node_modules/chalk/license +9 -0
  1050. package/node_modules/chalk/package.json +83 -0
  1051. package/node_modules/chalk/readme.md +297 -0
  1052. package/node_modules/chalk/source/index.d.ts +325 -0
  1053. package/node_modules/chalk/source/index.js +225 -0
  1054. package/node_modules/chalk/source/utilities.js +33 -0
  1055. package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
  1056. package/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
  1057. package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
  1058. package/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
  1059. package/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
  1060. package/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
  1061. package/node_modules/classcat/LICENSE.md +7 -0
  1062. package/node_modules/classcat/README.md +88 -0
  1063. package/node_modules/classcat/index.cjs +19 -0
  1064. package/node_modules/classcat/index.d.ts +15 -0
  1065. package/node_modules/classcat/index.js +19 -0
  1066. package/node_modules/classcat/package.json +38 -0
  1067. package/node_modules/commander/LICENSE +22 -0
  1068. package/node_modules/commander/Readme.md +1157 -0
  1069. package/node_modules/commander/esm.mjs +16 -0
  1070. package/node_modules/commander/index.js +24 -0
  1071. package/node_modules/commander/lib/argument.js +149 -0
  1072. package/node_modules/commander/lib/command.js +2509 -0
  1073. package/node_modules/commander/lib/error.js +39 -0
  1074. package/node_modules/commander/lib/help.js +520 -0
  1075. package/node_modules/commander/lib/option.js +330 -0
  1076. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  1077. package/node_modules/commander/package-support.json +16 -0
  1078. package/node_modules/commander/package.json +84 -0
  1079. package/node_modules/commander/typings/esm.d.mts +3 -0
  1080. package/node_modules/commander/typings/index.d.ts +969 -0
  1081. package/node_modules/content-disposition/HISTORY.md +60 -0
  1082. package/node_modules/content-disposition/LICENSE +22 -0
  1083. package/node_modules/content-disposition/README.md +142 -0
  1084. package/node_modules/content-disposition/index.js +458 -0
  1085. package/node_modules/content-disposition/package.json +44 -0
  1086. package/node_modules/content-type/HISTORY.md +29 -0
  1087. package/node_modules/content-type/LICENSE +22 -0
  1088. package/node_modules/content-type/README.md +94 -0
  1089. package/node_modules/content-type/index.js +225 -0
  1090. package/node_modules/content-type/package.json +42 -0
  1091. package/node_modules/cookie/LICENSE +24 -0
  1092. package/node_modules/cookie/README.md +317 -0
  1093. package/node_modules/cookie/SECURITY.md +25 -0
  1094. package/node_modules/cookie/index.js +335 -0
  1095. package/node_modules/cookie/package.json +44 -0
  1096. package/node_modules/cookie-signature/History.md +42 -0
  1097. package/node_modules/cookie-signature/Readme.md +42 -0
  1098. package/node_modules/cookie-signature/index.js +51 -0
  1099. package/node_modules/cookie-signature/package.json +18 -0
  1100. package/node_modules/d3-color/LICENSE +13 -0
  1101. package/node_modules/d3-color/README.md +203 -0
  1102. package/node_modules/d3-color/dist/d3-color.js +606 -0
  1103. package/node_modules/d3-color/dist/d3-color.min.js +2 -0
  1104. package/node_modules/d3-color/package.json +54 -0
  1105. package/node_modules/d3-color/src/color.js +396 -0
  1106. package/node_modules/d3-color/src/cubehelix.js +61 -0
  1107. package/node_modules/d3-color/src/define.js +10 -0
  1108. package/node_modules/d3-color/src/index.js +3 -0
  1109. package/node_modules/d3-color/src/lab.js +123 -0
  1110. package/node_modules/d3-color/src/math.js +2 -0
  1111. package/node_modules/d3-dispatch/LICENSE +13 -0
  1112. package/node_modules/d3-dispatch/README.md +94 -0
  1113. package/node_modules/d3-dispatch/dist/d3-dispatch.js +95 -0
  1114. package/node_modules/d3-dispatch/dist/d3-dispatch.min.js +2 -0
  1115. package/node_modules/d3-dispatch/package.json +50 -0
  1116. package/node_modules/d3-dispatch/src/dispatch.js +84 -0
  1117. package/node_modules/d3-dispatch/src/index.js +1 -0
  1118. package/node_modules/d3-drag/LICENSE +13 -0
  1119. package/node_modules/d3-drag/README.md +248 -0
  1120. package/node_modules/d3-drag/dist/d3-drag.js +273 -0
  1121. package/node_modules/d3-drag/dist/d3-drag.min.js +2 -0
  1122. package/node_modules/d3-drag/package.json +54 -0
  1123. package/node_modules/d3-drag/src/constant.js +1 -0
  1124. package/node_modules/d3-drag/src/drag.js +194 -0
  1125. package/node_modules/d3-drag/src/event.js +28 -0
  1126. package/node_modules/d3-drag/src/index.js +2 -0
  1127. package/node_modules/d3-drag/src/nodrag.js +28 -0
  1128. package/node_modules/d3-drag/src/noevent.js +13 -0
  1129. package/node_modules/d3-ease/LICENSE +28 -0
  1130. package/node_modules/d3-ease/README.md +253 -0
  1131. package/node_modules/d3-ease/dist/d3-ease.js +262 -0
  1132. package/node_modules/d3-ease/dist/d3-ease.min.js +2 -0
  1133. package/node_modules/d3-ease/package.json +51 -0
  1134. package/node_modules/d3-ease/src/back.js +37 -0
  1135. package/node_modules/d3-ease/src/bounce.js +22 -0
  1136. package/node_modules/d3-ease/src/circle.js +11 -0
  1137. package/node_modules/d3-ease/src/cubic.js +11 -0
  1138. package/node_modules/d3-ease/src/elastic.js +46 -0
  1139. package/node_modules/d3-ease/src/exp.js +13 -0
  1140. package/node_modules/d3-ease/src/index.js +66 -0
  1141. package/node_modules/d3-ease/src/linear.js +1 -0
  1142. package/node_modules/d3-ease/src/math.js +4 -0
  1143. package/node_modules/d3-ease/src/poly.js +37 -0
  1144. package/node_modules/d3-ease/src/quad.js +11 -0
  1145. package/node_modules/d3-ease/src/sin.js +14 -0
  1146. package/node_modules/d3-interpolate/LICENSE +13 -0
  1147. package/node_modules/d3-interpolate/README.md +268 -0
  1148. package/node_modules/d3-interpolate/dist/d3-interpolate.js +590 -0
  1149. package/node_modules/d3-interpolate/dist/d3-interpolate.min.js +2 -0
  1150. package/node_modules/d3-interpolate/package.json +53 -0
  1151. package/node_modules/d3-interpolate/src/array.js +22 -0
  1152. package/node_modules/d3-interpolate/src/basis.js +19 -0
  1153. package/node_modules/d3-interpolate/src/basisClosed.js +13 -0
  1154. package/node_modules/d3-interpolate/src/color.js +29 -0
  1155. package/node_modules/d3-interpolate/src/constant.js +1 -0
  1156. package/node_modules/d3-interpolate/src/cubehelix.js +29 -0
  1157. package/node_modules/d3-interpolate/src/date.js +6 -0
  1158. package/node_modules/d3-interpolate/src/discrete.js +6 -0
  1159. package/node_modules/d3-interpolate/src/hcl.js +21 -0
  1160. package/node_modules/d3-interpolate/src/hsl.js +21 -0
  1161. package/node_modules/d3-interpolate/src/hue.js +9 -0
  1162. package/node_modules/d3-interpolate/src/index.js +21 -0
  1163. package/node_modules/d3-interpolate/src/lab.js +16 -0
  1164. package/node_modules/d3-interpolate/src/number.js +5 -0
  1165. package/node_modules/d3-interpolate/src/numberArray.js +14 -0
  1166. package/node_modules/d3-interpolate/src/object.js +23 -0
  1167. package/node_modules/d3-interpolate/src/piecewise.js +11 -0
  1168. package/node_modules/d3-interpolate/src/quantize.js +5 -0
  1169. package/node_modules/d3-interpolate/src/rgb.js +55 -0
  1170. package/node_modules/d3-interpolate/src/round.js +5 -0
  1171. package/node_modules/d3-interpolate/src/string.js +64 -0
  1172. package/node_modules/d3-interpolate/src/transform/decompose.js +26 -0
  1173. package/node_modules/d3-interpolate/src/transform/index.js +63 -0
  1174. package/node_modules/d3-interpolate/src/transform/parse.js +18 -0
  1175. package/node_modules/d3-interpolate/src/value.js +22 -0
  1176. package/node_modules/d3-interpolate/src/zoom.js +71 -0
  1177. package/node_modules/d3-selection/LICENSE +13 -0
  1178. package/node_modules/d3-selection/README.md +863 -0
  1179. package/node_modules/d3-selection/dist/d3-selection.js +1022 -0
  1180. package/node_modules/d3-selection/dist/d3-selection.min.js +2 -0
  1181. package/node_modules/d3-selection/package.json +51 -0
  1182. package/node_modules/d3-selection/src/array.js +9 -0
  1183. package/node_modules/d3-selection/src/constant.js +5 -0
  1184. package/node_modules/d3-selection/src/create.js +6 -0
  1185. package/node_modules/d3-selection/src/creator.js +25 -0
  1186. package/node_modules/d3-selection/src/identity.js +3 -0
  1187. package/node_modules/d3-selection/src/index.js +15 -0
  1188. package/node_modules/d3-selection/src/local.js +27 -0
  1189. package/node_modules/d3-selection/src/matcher.js +12 -0
  1190. package/node_modules/d3-selection/src/namespace.js +7 -0
  1191. package/node_modules/d3-selection/src/namespaces.js +9 -0
  1192. package/node_modules/d3-selection/src/pointer.js +20 -0
  1193. package/node_modules/d3-selection/src/pointers.js +11 -0
  1194. package/node_modules/d3-selection/src/select.js +7 -0
  1195. package/node_modules/d3-selection/src/selectAll.js +8 -0
  1196. package/node_modules/d3-selection/src/selection/append.js +8 -0
  1197. package/node_modules/d3-selection/src/selection/attr.js +57 -0
  1198. package/node_modules/d3-selection/src/selection/call.js +6 -0
  1199. package/node_modules/d3-selection/src/selection/classed.js +75 -0
  1200. package/node_modules/d3-selection/src/selection/clone.js +13 -0
  1201. package/node_modules/d3-selection/src/selection/data.js +128 -0
  1202. package/node_modules/d3-selection/src/selection/datum.js +5 -0
  1203. package/node_modules/d3-selection/src/selection/dispatch.js +34 -0
  1204. package/node_modules/d3-selection/src/selection/each.js +10 -0
  1205. package/node_modules/d3-selection/src/selection/empty.js +3 -0
  1206. package/node_modules/d3-selection/src/selection/enter.js +22 -0
  1207. package/node_modules/d3-selection/src/selection/exit.js +6 -0
  1208. package/node_modules/d3-selection/src/selection/filter.js +16 -0
  1209. package/node_modules/d3-selection/src/selection/html.js +25 -0
  1210. package/node_modules/d3-selection/src/selection/index.js +90 -0
  1211. package/node_modules/d3-selection/src/selection/insert.js +14 -0
  1212. package/node_modules/d3-selection/src/selection/iterator.js +7 -0
  1213. package/node_modules/d3-selection/src/selection/join.js +15 -0
  1214. package/node_modules/d3-selection/src/selection/lower.js +7 -0
  1215. package/node_modules/d3-selection/src/selection/merge.js +19 -0
  1216. package/node_modules/d3-selection/src/selection/node.js +11 -0
  1217. package/node_modules/d3-selection/src/selection/nodes.js +3 -0
  1218. package/node_modules/d3-selection/src/selection/on.js +67 -0
  1219. package/node_modules/d3-selection/src/selection/order.js +13 -0
  1220. package/node_modules/d3-selection/src/selection/property.js +28 -0
  1221. package/node_modules/d3-selection/src/selection/raise.js +7 -0
  1222. package/node_modules/d3-selection/src/selection/remove.js +8 -0
  1223. package/node_modules/d3-selection/src/selection/select.js +17 -0
  1224. package/node_modules/d3-selection/src/selection/selectAll.js +25 -0
  1225. package/node_modules/d3-selection/src/selection/selectChild.js +18 -0
  1226. package/node_modules/d3-selection/src/selection/selectChildren.js +18 -0
  1227. package/node_modules/d3-selection/src/selection/size.js +5 -0
  1228. package/node_modules/d3-selection/src/selection/sort.js +24 -0
  1229. package/node_modules/d3-selection/src/selection/sparse.js +3 -0
  1230. package/node_modules/d3-selection/src/selection/style.js +35 -0
  1231. package/node_modules/d3-selection/src/selection/text.js +25 -0
  1232. package/node_modules/d3-selection/src/selector.js +7 -0
  1233. package/node_modules/d3-selection/src/selectorAll.js +9 -0
  1234. package/node_modules/d3-selection/src/sourceEvent.js +5 -0
  1235. package/node_modules/d3-selection/src/window.js +5 -0
  1236. package/node_modules/d3-timer/LICENSE +13 -0
  1237. package/node_modules/d3-timer/README.md +87 -0
  1238. package/node_modules/d3-timer/dist/d3-timer.js +153 -0
  1239. package/node_modules/d3-timer/dist/d3-timer.min.js +2 -0
  1240. package/node_modules/d3-timer/package.json +53 -0
  1241. package/node_modules/d3-timer/src/index.js +13 -0
  1242. package/node_modules/d3-timer/src/interval.js +17 -0
  1243. package/node_modules/d3-timer/src/timeout.js +11 -0
  1244. package/node_modules/d3-timer/src/timer.js +110 -0
  1245. package/node_modules/d3-transition/LICENSE +13 -0
  1246. package/node_modules/d3-transition/README.md +490 -0
  1247. package/node_modules/d3-transition/dist/d3-transition.js +900 -0
  1248. package/node_modules/d3-transition/dist/d3-transition.min.js +2 -0
  1249. package/node_modules/d3-transition/package.json +65 -0
  1250. package/node_modules/d3-transition/src/active.js +21 -0
  1251. package/node_modules/d3-transition/src/index.js +4 -0
  1252. package/node_modules/d3-transition/src/interrupt.js +24 -0
  1253. package/node_modules/d3-transition/src/selection/index.js +6 -0
  1254. package/node_modules/d3-transition/src/selection/interrupt.js +7 -0
  1255. package/node_modules/d3-transition/src/selection/transition.js +42 -0
  1256. package/node_modules/d3-transition/src/transition/attr.js +78 -0
  1257. package/node_modules/d3-transition/src/transition/attrTween.js +44 -0
  1258. package/node_modules/d3-transition/src/transition/delay.js +23 -0
  1259. package/node_modules/d3-transition/src/transition/duration.js +23 -0
  1260. package/node_modules/d3-transition/src/transition/ease.js +16 -0
  1261. package/node_modules/d3-transition/src/transition/easeVarying.js +14 -0
  1262. package/node_modules/d3-transition/src/transition/end.js +29 -0
  1263. package/node_modules/d3-transition/src/transition/filter.js +16 -0
  1264. package/node_modules/d3-transition/src/transition/index.js +73 -0
  1265. package/node_modules/d3-transition/src/transition/interpolate.js +10 -0
  1266. package/node_modules/d3-transition/src/transition/merge.js +19 -0
  1267. package/node_modules/d3-transition/src/transition/on.js +32 -0
  1268. package/node_modules/d3-transition/src/transition/remove.js +11 -0
  1269. package/node_modules/d3-transition/src/transition/schedule.js +153 -0
  1270. package/node_modules/d3-transition/src/transition/select.js +22 -0
  1271. package/node_modules/d3-transition/src/transition/selectAll.js +26 -0
  1272. package/node_modules/d3-transition/src/transition/selection.js +7 -0
  1273. package/node_modules/d3-transition/src/transition/style.js +80 -0
  1274. package/node_modules/d3-transition/src/transition/styleTween.js +24 -0
  1275. package/node_modules/d3-transition/src/transition/text.js +20 -0
  1276. package/node_modules/d3-transition/src/transition/textTween.js +24 -0
  1277. package/node_modules/d3-transition/src/transition/transition.js +24 -0
  1278. package/node_modules/d3-transition/src/transition/tween.js +81 -0
  1279. package/node_modules/d3-zoom/LICENSE +13 -0
  1280. package/node_modules/d3-zoom/README.md +414 -0
  1281. package/node_modules/d3-zoom/dist/d3-zoom.js +531 -0
  1282. package/node_modules/d3-zoom/dist/d3-zoom.min.js +2 -0
  1283. package/node_modules/d3-zoom/package.json +57 -0
  1284. package/node_modules/d3-zoom/src/constant.js +1 -0
  1285. package/node_modules/d3-zoom/src/event.js +14 -0
  1286. package/node_modules/d3-zoom/src/index.js +2 -0
  1287. package/node_modules/d3-zoom/src/noevent.js +8 -0
  1288. package/node_modules/d3-zoom/src/transform.js +51 -0
  1289. package/node_modules/d3-zoom/src/zoom.js +447 -0
  1290. package/node_modules/depd/History.md +103 -0
  1291. package/node_modules/depd/LICENSE +22 -0
  1292. package/node_modules/depd/Readme.md +280 -0
  1293. package/node_modules/depd/index.js +538 -0
  1294. package/node_modules/depd/lib/browser/index.js +77 -0
  1295. package/node_modules/depd/package.json +45 -0
  1296. package/node_modules/destroy/LICENSE +23 -0
  1297. package/node_modules/destroy/README.md +63 -0
  1298. package/node_modules/destroy/index.js +209 -0
  1299. package/node_modules/destroy/package.json +48 -0
  1300. package/node_modules/dunder-proto/.eslintrc +5 -0
  1301. package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  1302. package/node_modules/dunder-proto/.nycrc +13 -0
  1303. package/node_modules/dunder-proto/CHANGELOG.md +24 -0
  1304. package/node_modules/dunder-proto/LICENSE +21 -0
  1305. package/node_modules/dunder-proto/README.md +54 -0
  1306. package/node_modules/dunder-proto/get.d.ts +5 -0
  1307. package/node_modules/dunder-proto/get.js +30 -0
  1308. package/node_modules/dunder-proto/package.json +76 -0
  1309. package/node_modules/dunder-proto/set.d.ts +5 -0
  1310. package/node_modules/dunder-proto/set.js +35 -0
  1311. package/node_modules/dunder-proto/test/get.js +34 -0
  1312. package/node_modules/dunder-proto/test/index.js +4 -0
  1313. package/node_modules/dunder-proto/test/set.js +50 -0
  1314. package/node_modules/dunder-proto/tsconfig.json +9 -0
  1315. package/node_modules/ee-first/LICENSE +22 -0
  1316. package/node_modules/ee-first/README.md +80 -0
  1317. package/node_modules/ee-first/index.js +95 -0
  1318. package/node_modules/ee-first/package.json +29 -0
  1319. package/node_modules/encodeurl/LICENSE +22 -0
  1320. package/node_modules/encodeurl/README.md +109 -0
  1321. package/node_modules/encodeurl/index.js +60 -0
  1322. package/node_modules/encodeurl/package.json +40 -0
  1323. package/node_modules/es-define-property/.eslintrc +13 -0
  1324. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  1325. package/node_modules/es-define-property/.nycrc +9 -0
  1326. package/node_modules/es-define-property/CHANGELOG.md +29 -0
  1327. package/node_modules/es-define-property/LICENSE +21 -0
  1328. package/node_modules/es-define-property/README.md +49 -0
  1329. package/node_modules/es-define-property/index.d.ts +3 -0
  1330. package/node_modules/es-define-property/index.js +14 -0
  1331. package/node_modules/es-define-property/package.json +81 -0
  1332. package/node_modules/es-define-property/test/index.js +56 -0
  1333. package/node_modules/es-define-property/tsconfig.json +10 -0
  1334. package/node_modules/es-errors/.eslintrc +5 -0
  1335. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  1336. package/node_modules/es-errors/CHANGELOG.md +40 -0
  1337. package/node_modules/es-errors/LICENSE +21 -0
  1338. package/node_modules/es-errors/README.md +55 -0
  1339. package/node_modules/es-errors/eval.d.ts +3 -0
  1340. package/node_modules/es-errors/eval.js +4 -0
  1341. package/node_modules/es-errors/index.d.ts +3 -0
  1342. package/node_modules/es-errors/index.js +4 -0
  1343. package/node_modules/es-errors/package.json +80 -0
  1344. package/node_modules/es-errors/range.d.ts +3 -0
  1345. package/node_modules/es-errors/range.js +4 -0
  1346. package/node_modules/es-errors/ref.d.ts +3 -0
  1347. package/node_modules/es-errors/ref.js +4 -0
  1348. package/node_modules/es-errors/syntax.d.ts +3 -0
  1349. package/node_modules/es-errors/syntax.js +4 -0
  1350. package/node_modules/es-errors/test/index.js +19 -0
  1351. package/node_modules/es-errors/tsconfig.json +49 -0
  1352. package/node_modules/es-errors/type.d.ts +3 -0
  1353. package/node_modules/es-errors/type.js +4 -0
  1354. package/node_modules/es-errors/uri.d.ts +3 -0
  1355. package/node_modules/es-errors/uri.js +4 -0
  1356. package/node_modules/es-object-atoms/.eslintrc +16 -0
  1357. package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  1358. package/node_modules/es-object-atoms/CHANGELOG.md +37 -0
  1359. package/node_modules/es-object-atoms/LICENSE +21 -0
  1360. package/node_modules/es-object-atoms/README.md +63 -0
  1361. package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  1362. package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  1363. package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  1364. package/node_modules/es-object-atoms/ToObject.js +10 -0
  1365. package/node_modules/es-object-atoms/index.d.ts +3 -0
  1366. package/node_modules/es-object-atoms/index.js +4 -0
  1367. package/node_modules/es-object-atoms/isObject.d.ts +3 -0
  1368. package/node_modules/es-object-atoms/isObject.js +6 -0
  1369. package/node_modules/es-object-atoms/package.json +80 -0
  1370. package/node_modules/es-object-atoms/test/index.js +38 -0
  1371. package/node_modules/es-object-atoms/tsconfig.json +6 -0
  1372. package/node_modules/escape-html/LICENSE +24 -0
  1373. package/node_modules/escape-html/Readme.md +43 -0
  1374. package/node_modules/escape-html/index.js +78 -0
  1375. package/node_modules/escape-html/package.json +24 -0
  1376. package/node_modules/etag/HISTORY.md +83 -0
  1377. package/node_modules/etag/LICENSE +22 -0
  1378. package/node_modules/etag/README.md +159 -0
  1379. package/node_modules/etag/index.js +131 -0
  1380. package/node_modules/etag/package.json +47 -0
  1381. package/node_modules/express/History.md +3667 -0
  1382. package/node_modules/express/LICENSE +24 -0
  1383. package/node_modules/express/Readme.md +260 -0
  1384. package/node_modules/express/index.js +11 -0
  1385. package/node_modules/express/lib/application.js +661 -0
  1386. package/node_modules/express/lib/express.js +116 -0
  1387. package/node_modules/express/lib/middleware/init.js +43 -0
  1388. package/node_modules/express/lib/middleware/query.js +47 -0
  1389. package/node_modules/express/lib/request.js +525 -0
  1390. package/node_modules/express/lib/response.js +1179 -0
  1391. package/node_modules/express/lib/router/index.js +673 -0
  1392. package/node_modules/express/lib/router/layer.js +181 -0
  1393. package/node_modules/express/lib/router/route.js +230 -0
  1394. package/node_modules/express/lib/utils.js +303 -0
  1395. package/node_modules/express/lib/view.js +182 -0
  1396. package/node_modules/express/node_modules/debug/.coveralls.yml +1 -0
  1397. package/node_modules/express/node_modules/debug/.eslintrc +11 -0
  1398. package/node_modules/express/node_modules/debug/.npmignore +9 -0
  1399. package/node_modules/express/node_modules/debug/.travis.yml +14 -0
  1400. package/node_modules/express/node_modules/debug/CHANGELOG.md +362 -0
  1401. package/node_modules/express/node_modules/debug/LICENSE +19 -0
  1402. package/node_modules/express/node_modules/debug/Makefile +50 -0
  1403. package/node_modules/express/node_modules/debug/README.md +312 -0
  1404. package/node_modules/express/node_modules/debug/component.json +19 -0
  1405. package/node_modules/express/node_modules/debug/karma.conf.js +70 -0
  1406. package/node_modules/express/node_modules/debug/node.js +1 -0
  1407. package/node_modules/express/node_modules/debug/package.json +49 -0
  1408. package/node_modules/express/node_modules/debug/src/browser.js +185 -0
  1409. package/node_modules/express/node_modules/debug/src/debug.js +202 -0
  1410. package/node_modules/express/node_modules/debug/src/index.js +10 -0
  1411. package/node_modules/express/node_modules/debug/src/inspector-log.js +15 -0
  1412. package/node_modules/express/node_modules/debug/src/node.js +248 -0
  1413. package/node_modules/express/node_modules/ms/index.js +152 -0
  1414. package/node_modules/express/node_modules/ms/license.md +21 -0
  1415. package/node_modules/express/node_modules/ms/package.json +37 -0
  1416. package/node_modules/express/node_modules/ms/readme.md +51 -0
  1417. package/node_modules/express/package.json +102 -0
  1418. package/node_modules/finalhandler/HISTORY.md +216 -0
  1419. package/node_modules/finalhandler/LICENSE +22 -0
  1420. package/node_modules/finalhandler/README.md +147 -0
  1421. package/node_modules/finalhandler/SECURITY.md +25 -0
  1422. package/node_modules/finalhandler/index.js +341 -0
  1423. package/node_modules/finalhandler/node_modules/debug/.coveralls.yml +1 -0
  1424. package/node_modules/finalhandler/node_modules/debug/.eslintrc +11 -0
  1425. package/node_modules/finalhandler/node_modules/debug/.npmignore +9 -0
  1426. package/node_modules/finalhandler/node_modules/debug/.travis.yml +14 -0
  1427. package/node_modules/finalhandler/node_modules/debug/CHANGELOG.md +362 -0
  1428. package/node_modules/finalhandler/node_modules/debug/LICENSE +19 -0
  1429. package/node_modules/finalhandler/node_modules/debug/Makefile +50 -0
  1430. package/node_modules/finalhandler/node_modules/debug/README.md +312 -0
  1431. package/node_modules/finalhandler/node_modules/debug/component.json +19 -0
  1432. package/node_modules/finalhandler/node_modules/debug/karma.conf.js +70 -0
  1433. package/node_modules/finalhandler/node_modules/debug/node.js +1 -0
  1434. package/node_modules/finalhandler/node_modules/debug/package.json +49 -0
  1435. package/node_modules/finalhandler/node_modules/debug/src/browser.js +185 -0
  1436. package/node_modules/finalhandler/node_modules/debug/src/debug.js +202 -0
  1437. package/node_modules/finalhandler/node_modules/debug/src/index.js +10 -0
  1438. package/node_modules/finalhandler/node_modules/debug/src/inspector-log.js +15 -0
  1439. package/node_modules/finalhandler/node_modules/debug/src/node.js +248 -0
  1440. package/node_modules/finalhandler/node_modules/ms/index.js +152 -0
  1441. package/node_modules/finalhandler/node_modules/ms/license.md +21 -0
  1442. package/node_modules/finalhandler/node_modules/ms/package.json +37 -0
  1443. package/node_modules/finalhandler/node_modules/ms/readme.md +51 -0
  1444. package/node_modules/finalhandler/package.json +47 -0
  1445. package/node_modules/forwarded/HISTORY.md +21 -0
  1446. package/node_modules/forwarded/LICENSE +22 -0
  1447. package/node_modules/forwarded/README.md +57 -0
  1448. package/node_modules/forwarded/index.js +90 -0
  1449. package/node_modules/forwarded/package.json +45 -0
  1450. package/node_modules/fresh/HISTORY.md +70 -0
  1451. package/node_modules/fresh/LICENSE +23 -0
  1452. package/node_modules/fresh/README.md +119 -0
  1453. package/node_modules/fresh/index.js +137 -0
  1454. package/node_modules/fresh/package.json +46 -0
  1455. package/node_modules/function-bind/.eslintrc +21 -0
  1456. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  1457. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  1458. package/node_modules/function-bind/.nycrc +13 -0
  1459. package/node_modules/function-bind/CHANGELOG.md +136 -0
  1460. package/node_modules/function-bind/LICENSE +20 -0
  1461. package/node_modules/function-bind/README.md +46 -0
  1462. package/node_modules/function-bind/implementation.js +84 -0
  1463. package/node_modules/function-bind/index.js +5 -0
  1464. package/node_modules/function-bind/package.json +87 -0
  1465. package/node_modules/function-bind/test/.eslintrc +9 -0
  1466. package/node_modules/function-bind/test/index.js +252 -0
  1467. package/node_modules/get-intrinsic/.eslintrc +42 -0
  1468. package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  1469. package/node_modules/get-intrinsic/.nycrc +9 -0
  1470. package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  1471. package/node_modules/get-intrinsic/LICENSE +21 -0
  1472. package/node_modules/get-intrinsic/README.md +71 -0
  1473. package/node_modules/get-intrinsic/index.js +378 -0
  1474. package/node_modules/get-intrinsic/package.json +97 -0
  1475. package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  1476. package/node_modules/get-proto/.eslintrc +10 -0
  1477. package/node_modules/get-proto/.github/FUNDING.yml +12 -0
  1478. package/node_modules/get-proto/.nycrc +9 -0
  1479. package/node_modules/get-proto/CHANGELOG.md +21 -0
  1480. package/node_modules/get-proto/LICENSE +21 -0
  1481. package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  1482. package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  1483. package/node_modules/get-proto/README.md +50 -0
  1484. package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  1485. package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  1486. package/node_modules/get-proto/index.d.ts +5 -0
  1487. package/node_modules/get-proto/index.js +27 -0
  1488. package/node_modules/get-proto/package.json +81 -0
  1489. package/node_modules/get-proto/test/index.js +68 -0
  1490. package/node_modules/get-proto/tsconfig.json +9 -0
  1491. package/node_modules/gopd/.eslintrc +16 -0
  1492. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  1493. package/node_modules/gopd/CHANGELOG.md +45 -0
  1494. package/node_modules/gopd/LICENSE +21 -0
  1495. package/node_modules/gopd/README.md +40 -0
  1496. package/node_modules/gopd/gOPD.d.ts +1 -0
  1497. package/node_modules/gopd/gOPD.js +4 -0
  1498. package/node_modules/gopd/index.d.ts +5 -0
  1499. package/node_modules/gopd/index.js +15 -0
  1500. package/node_modules/gopd/package.json +77 -0
  1501. package/node_modules/gopd/test/index.js +36 -0
  1502. package/node_modules/gopd/tsconfig.json +9 -0
  1503. package/node_modules/has-symbols/.eslintrc +11 -0
  1504. package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  1505. package/node_modules/has-symbols/.nycrc +9 -0
  1506. package/node_modules/has-symbols/CHANGELOG.md +91 -0
  1507. package/node_modules/has-symbols/LICENSE +21 -0
  1508. package/node_modules/has-symbols/README.md +46 -0
  1509. package/node_modules/has-symbols/index.d.ts +3 -0
  1510. package/node_modules/has-symbols/index.js +14 -0
  1511. package/node_modules/has-symbols/package.json +111 -0
  1512. package/node_modules/has-symbols/shams.d.ts +3 -0
  1513. package/node_modules/has-symbols/shams.js +45 -0
  1514. package/node_modules/has-symbols/test/index.js +22 -0
  1515. package/node_modules/has-symbols/test/shams/core-js.js +29 -0
  1516. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  1517. package/node_modules/has-symbols/test/tests.js +58 -0
  1518. package/node_modules/has-symbols/tsconfig.json +10 -0
  1519. package/node_modules/hasown/.eslintrc +5 -0
  1520. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  1521. package/node_modules/hasown/.nycrc +13 -0
  1522. package/node_modules/hasown/CHANGELOG.md +40 -0
  1523. package/node_modules/hasown/LICENSE +21 -0
  1524. package/node_modules/hasown/README.md +40 -0
  1525. package/node_modules/hasown/index.d.ts +3 -0
  1526. package/node_modules/hasown/index.js +8 -0
  1527. package/node_modules/hasown/package.json +92 -0
  1528. package/node_modules/hasown/tsconfig.json +6 -0
  1529. package/node_modules/http-errors/HISTORY.md +186 -0
  1530. package/node_modules/http-errors/LICENSE +23 -0
  1531. package/node_modules/http-errors/README.md +169 -0
  1532. package/node_modules/http-errors/index.js +290 -0
  1533. package/node_modules/http-errors/package.json +54 -0
  1534. package/node_modules/iconv-lite/Changelog.md +162 -0
  1535. package/node_modules/iconv-lite/LICENSE +21 -0
  1536. package/node_modules/iconv-lite/README.md +156 -0
  1537. package/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
  1538. package/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
  1539. package/node_modules/iconv-lite/encodings/index.js +22 -0
  1540. package/node_modules/iconv-lite/encodings/internal.js +188 -0
  1541. package/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  1542. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  1543. package/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
  1544. package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  1545. package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  1546. package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  1547. package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  1548. package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  1549. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  1550. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
  1551. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  1552. package/node_modules/iconv-lite/encodings/utf16.js +177 -0
  1553. package/node_modules/iconv-lite/encodings/utf7.js +290 -0
  1554. package/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  1555. package/node_modules/iconv-lite/lib/extend-node.js +217 -0
  1556. package/node_modules/iconv-lite/lib/index.d.ts +24 -0
  1557. package/node_modules/iconv-lite/lib/index.js +153 -0
  1558. package/node_modules/iconv-lite/lib/streams.js +121 -0
  1559. package/node_modules/iconv-lite/package.json +46 -0
  1560. package/node_modules/inherits/LICENSE +16 -0
  1561. package/node_modules/inherits/README.md +42 -0
  1562. package/node_modules/inherits/inherits.js +9 -0
  1563. package/node_modules/inherits/inherits_browser.js +27 -0
  1564. package/node_modules/inherits/package.json +29 -0
  1565. package/node_modules/ipaddr.js/LICENSE +19 -0
  1566. package/node_modules/ipaddr.js/README.md +233 -0
  1567. package/node_modules/ipaddr.js/ipaddr.min.js +1 -0
  1568. package/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
  1569. package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
  1570. package/node_modules/ipaddr.js/package.json +35 -0
  1571. package/node_modules/math-intrinsics/.eslintrc +16 -0
  1572. package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  1573. package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  1574. package/node_modules/math-intrinsics/LICENSE +21 -0
  1575. package/node_modules/math-intrinsics/README.md +50 -0
  1576. package/node_modules/math-intrinsics/abs.d.ts +1 -0
  1577. package/node_modules/math-intrinsics/abs.js +4 -0
  1578. package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  1579. package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  1580. package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  1581. package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  1582. package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  1583. package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  1584. package/node_modules/math-intrinsics/floor.d.ts +1 -0
  1585. package/node_modules/math-intrinsics/floor.js +4 -0
  1586. package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  1587. package/node_modules/math-intrinsics/isFinite.js +12 -0
  1588. package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  1589. package/node_modules/math-intrinsics/isInteger.js +16 -0
  1590. package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  1591. package/node_modules/math-intrinsics/isNaN.js +6 -0
  1592. package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  1593. package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  1594. package/node_modules/math-intrinsics/max.d.ts +1 -0
  1595. package/node_modules/math-intrinsics/max.js +4 -0
  1596. package/node_modules/math-intrinsics/min.d.ts +1 -0
  1597. package/node_modules/math-intrinsics/min.js +4 -0
  1598. package/node_modules/math-intrinsics/mod.d.ts +3 -0
  1599. package/node_modules/math-intrinsics/mod.js +9 -0
  1600. package/node_modules/math-intrinsics/package.json +86 -0
  1601. package/node_modules/math-intrinsics/pow.d.ts +1 -0
  1602. package/node_modules/math-intrinsics/pow.js +4 -0
  1603. package/node_modules/math-intrinsics/round.d.ts +1 -0
  1604. package/node_modules/math-intrinsics/round.js +4 -0
  1605. package/node_modules/math-intrinsics/sign.d.ts +3 -0
  1606. package/node_modules/math-intrinsics/sign.js +11 -0
  1607. package/node_modules/math-intrinsics/test/index.js +192 -0
  1608. package/node_modules/math-intrinsics/tsconfig.json +3 -0
  1609. package/node_modules/media-typer/HISTORY.md +22 -0
  1610. package/node_modules/media-typer/LICENSE +22 -0
  1611. package/node_modules/media-typer/README.md +81 -0
  1612. package/node_modules/media-typer/index.js +270 -0
  1613. package/node_modules/media-typer/package.json +26 -0
  1614. package/node_modules/merge-descriptors/HISTORY.md +21 -0
  1615. package/node_modules/merge-descriptors/LICENSE +23 -0
  1616. package/node_modules/merge-descriptors/README.md +49 -0
  1617. package/node_modules/merge-descriptors/index.js +60 -0
  1618. package/node_modules/merge-descriptors/package.json +39 -0
  1619. package/node_modules/methods/HISTORY.md +29 -0
  1620. package/node_modules/methods/LICENSE +24 -0
  1621. package/node_modules/methods/README.md +51 -0
  1622. package/node_modules/methods/index.js +69 -0
  1623. package/node_modules/methods/package.json +36 -0
  1624. package/node_modules/mime/.npmignore +0 -0
  1625. package/node_modules/mime/CHANGELOG.md +164 -0
  1626. package/node_modules/mime/LICENSE +21 -0
  1627. package/node_modules/mime/README.md +90 -0
  1628. package/node_modules/mime/cli.js +8 -0
  1629. package/node_modules/mime/mime.js +108 -0
  1630. package/node_modules/mime/package.json +44 -0
  1631. package/node_modules/mime/src/build.js +53 -0
  1632. package/node_modules/mime/src/test.js +60 -0
  1633. package/node_modules/mime/types.json +1 -0
  1634. package/node_modules/mime-db/HISTORY.md +507 -0
  1635. package/node_modules/mime-db/LICENSE +23 -0
  1636. package/node_modules/mime-db/README.md +100 -0
  1637. package/node_modules/mime-db/db.json +8519 -0
  1638. package/node_modules/mime-db/index.js +12 -0
  1639. package/node_modules/mime-db/package.json +60 -0
  1640. package/node_modules/mime-types/HISTORY.md +397 -0
  1641. package/node_modules/mime-types/LICENSE +23 -0
  1642. package/node_modules/mime-types/README.md +113 -0
  1643. package/node_modules/mime-types/index.js +188 -0
  1644. package/node_modules/mime-types/package.json +44 -0
  1645. package/node_modules/minimatch/LICENSE.md +55 -0
  1646. package/node_modules/minimatch/README.md +528 -0
  1647. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
  1648. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
  1649. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  1650. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
  1651. package/node_modules/minimatch/dist/commonjs/ast.d.ts +22 -0
  1652. package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
  1653. package/node_modules/minimatch/dist/commonjs/ast.js +845 -0
  1654. package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
  1655. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
  1656. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
  1657. package/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
  1658. package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
  1659. package/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
  1660. package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
  1661. package/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  1662. package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
  1663. package/node_modules/minimatch/dist/commonjs/index.d.ts +174 -0
  1664. package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
  1665. package/node_modules/minimatch/dist/commonjs/index.js +1127 -0
  1666. package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
  1667. package/node_modules/minimatch/dist/commonjs/package.json +3 -0
  1668. package/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
  1669. package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
  1670. package/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  1671. package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
  1672. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
  1673. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
  1674. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  1675. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
  1676. package/node_modules/minimatch/dist/esm/ast.d.ts +22 -0
  1677. package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
  1678. package/node_modules/minimatch/dist/esm/ast.js +841 -0
  1679. package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
  1680. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
  1681. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
  1682. package/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
  1683. package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
  1684. package/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
  1685. package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
  1686. package/node_modules/minimatch/dist/esm/escape.js +26 -0
  1687. package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
  1688. package/node_modules/minimatch/dist/esm/index.d.ts +174 -0
  1689. package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
  1690. package/node_modules/minimatch/dist/esm/index.js +1114 -0
  1691. package/node_modules/minimatch/dist/esm/index.js.map +1 -0
  1692. package/node_modules/minimatch/dist/esm/package.json +3 -0
  1693. package/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
  1694. package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
  1695. package/node_modules/minimatch/dist/esm/unescape.js +34 -0
  1696. package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
  1697. package/node_modules/minimatch/package.json +73 -0
  1698. package/node_modules/ms/index.js +162 -0
  1699. package/node_modules/ms/license.md +21 -0
  1700. package/node_modules/ms/package.json +38 -0
  1701. package/node_modules/ms/readme.md +59 -0
  1702. package/node_modules/negotiator/HISTORY.md +108 -0
  1703. package/node_modules/negotiator/LICENSE +24 -0
  1704. package/node_modules/negotiator/README.md +203 -0
  1705. package/node_modules/negotiator/index.js +82 -0
  1706. package/node_modules/negotiator/lib/charset.js +169 -0
  1707. package/node_modules/negotiator/lib/encoding.js +184 -0
  1708. package/node_modules/negotiator/lib/language.js +179 -0
  1709. package/node_modules/negotiator/lib/mediaType.js +294 -0
  1710. package/node_modules/negotiator/package.json +42 -0
  1711. package/node_modules/object-inspect/.eslintrc +53 -0
  1712. package/node_modules/object-inspect/.github/FUNDING.yml +12 -0
  1713. package/node_modules/object-inspect/.nycrc +13 -0
  1714. package/node_modules/object-inspect/CHANGELOG.md +424 -0
  1715. package/node_modules/object-inspect/LICENSE +21 -0
  1716. package/node_modules/object-inspect/example/all.js +23 -0
  1717. package/node_modules/object-inspect/example/circular.js +6 -0
  1718. package/node_modules/object-inspect/example/fn.js +5 -0
  1719. package/node_modules/object-inspect/example/inspect.js +10 -0
  1720. package/node_modules/object-inspect/index.js +544 -0
  1721. package/node_modules/object-inspect/package-support.json +20 -0
  1722. package/node_modules/object-inspect/package.json +105 -0
  1723. package/node_modules/object-inspect/readme.markdown +84 -0
  1724. package/node_modules/object-inspect/test/bigint.js +58 -0
  1725. package/node_modules/object-inspect/test/browser/dom.js +15 -0
  1726. package/node_modules/object-inspect/test/circular.js +16 -0
  1727. package/node_modules/object-inspect/test/deep.js +12 -0
  1728. package/node_modules/object-inspect/test/element.js +53 -0
  1729. package/node_modules/object-inspect/test/err.js +48 -0
  1730. package/node_modules/object-inspect/test/fakes.js +29 -0
  1731. package/node_modules/object-inspect/test/fn.js +76 -0
  1732. package/node_modules/object-inspect/test/global.js +17 -0
  1733. package/node_modules/object-inspect/test/has.js +15 -0
  1734. package/node_modules/object-inspect/test/holes.js +15 -0
  1735. package/node_modules/object-inspect/test/indent-option.js +271 -0
  1736. package/node_modules/object-inspect/test/inspect.js +139 -0
  1737. package/node_modules/object-inspect/test/lowbyte.js +12 -0
  1738. package/node_modules/object-inspect/test/number.js +58 -0
  1739. package/node_modules/object-inspect/test/quoteStyle.js +26 -0
  1740. package/node_modules/object-inspect/test/toStringTag.js +40 -0
  1741. package/node_modules/object-inspect/test/undef.js +12 -0
  1742. package/node_modules/object-inspect/test/values.js +261 -0
  1743. package/node_modules/object-inspect/test-core-js.js +26 -0
  1744. package/node_modules/object-inspect/util.inspect.js +1 -0
  1745. package/node_modules/on-finished/HISTORY.md +98 -0
  1746. package/node_modules/on-finished/LICENSE +23 -0
  1747. package/node_modules/on-finished/README.md +162 -0
  1748. package/node_modules/on-finished/index.js +234 -0
  1749. package/node_modules/on-finished/package.json +39 -0
  1750. package/node_modules/parseurl/HISTORY.md +58 -0
  1751. package/node_modules/parseurl/LICENSE +24 -0
  1752. package/node_modules/parseurl/README.md +133 -0
  1753. package/node_modules/parseurl/index.js +158 -0
  1754. package/node_modules/parseurl/package.json +40 -0
  1755. package/node_modules/path-to-regexp/LICENSE +21 -0
  1756. package/node_modules/path-to-regexp/Readme.md +35 -0
  1757. package/node_modules/path-to-regexp/index.js +158 -0
  1758. package/node_modules/path-to-regexp/package.json +30 -0
  1759. package/node_modules/proxy-addr/HISTORY.md +161 -0
  1760. package/node_modules/proxy-addr/LICENSE +22 -0
  1761. package/node_modules/proxy-addr/README.md +139 -0
  1762. package/node_modules/proxy-addr/index.js +327 -0
  1763. package/node_modules/proxy-addr/package.json +47 -0
  1764. package/node_modules/qs/.editorconfig +46 -0
  1765. package/node_modules/qs/.github/FUNDING.yml +12 -0
  1766. package/node_modules/qs/.github/SECURITY.md +11 -0
  1767. package/node_modules/qs/.github/THREAT_MODEL.md +78 -0
  1768. package/node_modules/qs/.nycrc +13 -0
  1769. package/node_modules/qs/CHANGELOG.md +644 -0
  1770. package/node_modules/qs/LICENSE.md +29 -0
  1771. package/node_modules/qs/README.md +740 -0
  1772. package/node_modules/qs/dist/qs.js +141 -0
  1773. package/node_modules/qs/eslint.config.mjs +56 -0
  1774. package/node_modules/qs/lib/formats.js +23 -0
  1775. package/node_modules/qs/lib/index.js +11 -0
  1776. package/node_modules/qs/lib/parse.js +371 -0
  1777. package/node_modules/qs/lib/stringify.js +356 -0
  1778. package/node_modules/qs/lib/utils.js +340 -0
  1779. package/node_modules/qs/package.json +94 -0
  1780. package/node_modules/qs/test/empty-keys-cases.js +267 -0
  1781. package/node_modules/qs/test/parse.js +1512 -0
  1782. package/node_modules/qs/test/stringify.js +1310 -0
  1783. package/node_modules/qs/test/utils.js +397 -0
  1784. package/node_modules/range-parser/HISTORY.md +56 -0
  1785. package/node_modules/range-parser/LICENSE +23 -0
  1786. package/node_modules/range-parser/README.md +84 -0
  1787. package/node_modules/range-parser/index.js +162 -0
  1788. package/node_modules/range-parser/package.json +44 -0
  1789. package/node_modules/raw-body/LICENSE +22 -0
  1790. package/node_modules/raw-body/README.md +223 -0
  1791. package/node_modules/raw-body/index.d.ts +87 -0
  1792. package/node_modules/raw-body/index.js +336 -0
  1793. package/node_modules/raw-body/package.json +47 -0
  1794. package/node_modules/react/LICENSE +21 -0
  1795. package/node_modules/react/README.md +37 -0
  1796. package/node_modules/react/cjs/react-compiler-runtime.development.js +24 -0
  1797. package/node_modules/react/cjs/react-compiler-runtime.production.js +16 -0
  1798. package/node_modules/react/cjs/react-compiler-runtime.profiling.js +16 -0
  1799. package/node_modules/react/cjs/react-jsx-dev-runtime.development.js +338 -0
  1800. package/node_modules/react/cjs/react-jsx-dev-runtime.production.js +14 -0
  1801. package/node_modules/react/cjs/react-jsx-dev-runtime.profiling.js +14 -0
  1802. package/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js +370 -0
  1803. package/node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js +40 -0
  1804. package/node_modules/react/cjs/react-jsx-runtime.development.js +352 -0
  1805. package/node_modules/react/cjs/react-jsx-runtime.production.js +34 -0
  1806. package/node_modules/react/cjs/react-jsx-runtime.profiling.js +34 -0
  1807. package/node_modules/react/cjs/react-jsx-runtime.react-server.development.js +370 -0
  1808. package/node_modules/react/cjs/react-jsx-runtime.react-server.production.js +40 -0
  1809. package/node_modules/react/cjs/react.development.js +1284 -0
  1810. package/node_modules/react/cjs/react.production.js +542 -0
  1811. package/node_modules/react/cjs/react.react-server.development.js +848 -0
  1812. package/node_modules/react/cjs/react.react-server.production.js +423 -0
  1813. package/node_modules/react/compiler-runtime.js +14 -0
  1814. package/node_modules/react/index.js +7 -0
  1815. package/node_modules/react/jsx-dev-runtime.js +7 -0
  1816. package/node_modules/react/jsx-dev-runtime.react-server.js +7 -0
  1817. package/node_modules/react/jsx-runtime.js +7 -0
  1818. package/node_modules/react/jsx-runtime.react-server.js +7 -0
  1819. package/node_modules/react/package.json +51 -0
  1820. package/node_modules/react/react.react-server.js +7 -0
  1821. package/node_modules/react-dom/LICENSE +21 -0
  1822. package/node_modules/react-dom/README.md +60 -0
  1823. package/node_modules/react-dom/cjs/react-dom-client.development.js +28121 -0
  1824. package/node_modules/react-dom/cjs/react-dom-client.production.js +16049 -0
  1825. package/node_modules/react-dom/cjs/react-dom-profiling.development.js +28503 -0
  1826. package/node_modules/react-dom/cjs/react-dom-profiling.profiling.js +18068 -0
  1827. package/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +9877 -0
  1828. package/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +6603 -0
  1829. package/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js +9877 -0
  1830. package/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +6692 -0
  1831. package/node_modules/react-dom/cjs/react-dom-server.browser.development.js +10601 -0
  1832. package/node_modules/react-dom/cjs/react-dom-server.browser.production.js +7410 -0
  1833. package/node_modules/react-dom/cjs/react-dom-server.bun.development.js +9605 -0
  1834. package/node_modules/react-dom/cjs/react-dom-server.bun.production.js +6745 -0
  1835. package/node_modules/react-dom/cjs/react-dom-server.edge.development.js +10620 -0
  1836. package/node_modules/react-dom/cjs/react-dom-server.edge.production.js +7512 -0
  1837. package/node_modules/react-dom/cjs/react-dom-server.node.development.js +10802 -0
  1838. package/node_modules/react-dom/cjs/react-dom-server.node.production.js +7707 -0
  1839. package/node_modules/react-dom/cjs/react-dom-test-utils.development.js +24 -0
  1840. package/node_modules/react-dom/cjs/react-dom-test-utils.production.js +21 -0
  1841. package/node_modules/react-dom/cjs/react-dom.development.js +424 -0
  1842. package/node_modules/react-dom/cjs/react-dom.production.js +210 -0
  1843. package/node_modules/react-dom/cjs/react-dom.react-server.development.js +340 -0
  1844. package/node_modules/react-dom/cjs/react-dom.react-server.production.js +152 -0
  1845. package/node_modules/react-dom/client.js +38 -0
  1846. package/node_modules/react-dom/client.react-server.js +5 -0
  1847. package/node_modules/react-dom/index.js +38 -0
  1848. package/node_modules/react-dom/package.json +117 -0
  1849. package/node_modules/react-dom/profiling.js +38 -0
  1850. package/node_modules/react-dom/profiling.react-server.js +5 -0
  1851. package/node_modules/react-dom/react-dom.react-server.js +7 -0
  1852. package/node_modules/react-dom/server.browser.js +16 -0
  1853. package/node_modules/react-dom/server.bun.js +17 -0
  1854. package/node_modules/react-dom/server.edge.js +17 -0
  1855. package/node_modules/react-dom/server.js +3 -0
  1856. package/node_modules/react-dom/server.node.js +18 -0
  1857. package/node_modules/react-dom/server.react-server.js +5 -0
  1858. package/node_modules/react-dom/static.browser.js +12 -0
  1859. package/node_modules/react-dom/static.edge.js +12 -0
  1860. package/node_modules/react-dom/static.js +3 -0
  1861. package/node_modules/react-dom/static.node.js +14 -0
  1862. package/node_modules/react-dom/static.react-server.js +5 -0
  1863. package/node_modules/react-dom/test-utils.js +7 -0
  1864. package/node_modules/safe-buffer/LICENSE +21 -0
  1865. package/node_modules/safe-buffer/README.md +584 -0
  1866. package/node_modules/safe-buffer/index.d.ts +187 -0
  1867. package/node_modules/safe-buffer/index.js +65 -0
  1868. package/node_modules/safe-buffer/package.json +51 -0
  1869. package/node_modules/safer-buffer/LICENSE +21 -0
  1870. package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  1871. package/node_modules/safer-buffer/Readme.md +156 -0
  1872. package/node_modules/safer-buffer/dangerous.js +58 -0
  1873. package/node_modules/safer-buffer/package.json +34 -0
  1874. package/node_modules/safer-buffer/safer.js +77 -0
  1875. package/node_modules/safer-buffer/tests.js +406 -0
  1876. package/node_modules/scheduler/LICENSE +21 -0
  1877. package/node_modules/scheduler/README.md +9 -0
  1878. package/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +414 -0
  1879. package/node_modules/scheduler/cjs/scheduler-unstable_mock.production.js +406 -0
  1880. package/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +150 -0
  1881. package/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.js +140 -0
  1882. package/node_modules/scheduler/cjs/scheduler.development.js +364 -0
  1883. package/node_modules/scheduler/cjs/scheduler.native.development.js +350 -0
  1884. package/node_modules/scheduler/cjs/scheduler.native.production.js +330 -0
  1885. package/node_modules/scheduler/cjs/scheduler.production.js +340 -0
  1886. package/node_modules/scheduler/index.js +7 -0
  1887. package/node_modules/scheduler/index.native.js +7 -0
  1888. package/node_modules/scheduler/package.json +27 -0
  1889. package/node_modules/scheduler/unstable_mock.js +7 -0
  1890. package/node_modules/scheduler/unstable_post_task.js +7 -0
  1891. package/node_modules/send/HISTORY.md +538 -0
  1892. package/node_modules/send/LICENSE +23 -0
  1893. package/node_modules/send/README.md +327 -0
  1894. package/node_modules/send/SECURITY.md +24 -0
  1895. package/node_modules/send/index.js +1142 -0
  1896. package/node_modules/send/node_modules/debug/.coveralls.yml +1 -0
  1897. package/node_modules/send/node_modules/debug/.eslintrc +11 -0
  1898. package/node_modules/send/node_modules/debug/.npmignore +9 -0
  1899. package/node_modules/send/node_modules/debug/.travis.yml +14 -0
  1900. package/node_modules/send/node_modules/debug/CHANGELOG.md +362 -0
  1901. package/node_modules/send/node_modules/debug/LICENSE +19 -0
  1902. package/node_modules/send/node_modules/debug/Makefile +50 -0
  1903. package/node_modules/send/node_modules/debug/README.md +312 -0
  1904. package/node_modules/send/node_modules/debug/component.json +19 -0
  1905. package/node_modules/send/node_modules/debug/karma.conf.js +70 -0
  1906. package/node_modules/send/node_modules/debug/node.js +1 -0
  1907. package/node_modules/send/node_modules/debug/node_modules/ms/index.js +152 -0
  1908. package/node_modules/send/node_modules/debug/node_modules/ms/license.md +21 -0
  1909. package/node_modules/send/node_modules/debug/node_modules/ms/package.json +37 -0
  1910. package/node_modules/send/node_modules/debug/node_modules/ms/readme.md +51 -0
  1911. package/node_modules/send/node_modules/debug/package.json +49 -0
  1912. package/node_modules/send/node_modules/debug/src/browser.js +185 -0
  1913. package/node_modules/send/node_modules/debug/src/debug.js +202 -0
  1914. package/node_modules/send/node_modules/debug/src/index.js +10 -0
  1915. package/node_modules/send/node_modules/debug/src/inspector-log.js +15 -0
  1916. package/node_modules/send/node_modules/debug/src/node.js +248 -0
  1917. package/node_modules/send/package.json +62 -0
  1918. package/node_modules/serve-static/HISTORY.md +493 -0
  1919. package/node_modules/serve-static/LICENSE +25 -0
  1920. package/node_modules/serve-static/README.md +257 -0
  1921. package/node_modules/serve-static/index.js +209 -0
  1922. package/node_modules/serve-static/package.json +42 -0
  1923. package/node_modules/setprototypeof/LICENSE +13 -0
  1924. package/node_modules/setprototypeof/README.md +31 -0
  1925. package/node_modules/setprototypeof/index.d.ts +2 -0
  1926. package/node_modules/setprototypeof/index.js +17 -0
  1927. package/node_modules/setprototypeof/package.json +38 -0
  1928. package/node_modules/setprototypeof/test/index.js +24 -0
  1929. package/node_modules/side-channel/.editorconfig +9 -0
  1930. package/node_modules/side-channel/.eslintrc +12 -0
  1931. package/node_modules/side-channel/.github/FUNDING.yml +12 -0
  1932. package/node_modules/side-channel/.nycrc +13 -0
  1933. package/node_modules/side-channel/CHANGELOG.md +110 -0
  1934. package/node_modules/side-channel/LICENSE +21 -0
  1935. package/node_modules/side-channel/README.md +61 -0
  1936. package/node_modules/side-channel/index.d.ts +14 -0
  1937. package/node_modules/side-channel/index.js +43 -0
  1938. package/node_modules/side-channel/package.json +85 -0
  1939. package/node_modules/side-channel/test/index.js +104 -0
  1940. package/node_modules/side-channel/tsconfig.json +9 -0
  1941. package/node_modules/side-channel-list/.editorconfig +9 -0
  1942. package/node_modules/side-channel-list/.eslintrc +11 -0
  1943. package/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
  1944. package/node_modules/side-channel-list/.nycrc +13 -0
  1945. package/node_modules/side-channel-list/CHANGELOG.md +15 -0
  1946. package/node_modules/side-channel-list/LICENSE +21 -0
  1947. package/node_modules/side-channel-list/README.md +62 -0
  1948. package/node_modules/side-channel-list/index.d.ts +13 -0
  1949. package/node_modules/side-channel-list/index.js +113 -0
  1950. package/node_modules/side-channel-list/list.d.ts +14 -0
  1951. package/node_modules/side-channel-list/package.json +77 -0
  1952. package/node_modules/side-channel-list/test/index.js +104 -0
  1953. package/node_modules/side-channel-list/tsconfig.json +9 -0
  1954. package/node_modules/side-channel-map/.editorconfig +9 -0
  1955. package/node_modules/side-channel-map/.eslintrc +11 -0
  1956. package/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
  1957. package/node_modules/side-channel-map/.nycrc +13 -0
  1958. package/node_modules/side-channel-map/CHANGELOG.md +22 -0
  1959. package/node_modules/side-channel-map/LICENSE +21 -0
  1960. package/node_modules/side-channel-map/README.md +62 -0
  1961. package/node_modules/side-channel-map/index.d.ts +15 -0
  1962. package/node_modules/side-channel-map/index.js +68 -0
  1963. package/node_modules/side-channel-map/package.json +80 -0
  1964. package/node_modules/side-channel-map/test/index.js +114 -0
  1965. package/node_modules/side-channel-map/tsconfig.json +9 -0
  1966. package/node_modules/side-channel-weakmap/.editorconfig +9 -0
  1967. package/node_modules/side-channel-weakmap/.eslintrc +12 -0
  1968. package/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
  1969. package/node_modules/side-channel-weakmap/.nycrc +13 -0
  1970. package/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
  1971. package/node_modules/side-channel-weakmap/LICENSE +21 -0
  1972. package/node_modules/side-channel-weakmap/README.md +62 -0
  1973. package/node_modules/side-channel-weakmap/index.d.ts +15 -0
  1974. package/node_modules/side-channel-weakmap/index.js +84 -0
  1975. package/node_modules/side-channel-weakmap/package.json +87 -0
  1976. package/node_modules/side-channel-weakmap/test/index.js +114 -0
  1977. package/node_modules/side-channel-weakmap/tsconfig.json +9 -0
  1978. package/node_modules/statuses/HISTORY.md +87 -0
  1979. package/node_modules/statuses/LICENSE +23 -0
  1980. package/node_modules/statuses/README.md +139 -0
  1981. package/node_modules/statuses/codes.json +65 -0
  1982. package/node_modules/statuses/index.js +146 -0
  1983. package/node_modules/statuses/package.json +49 -0
  1984. package/node_modules/toidentifier/HISTORY.md +9 -0
  1985. package/node_modules/toidentifier/LICENSE +21 -0
  1986. package/node_modules/toidentifier/README.md +61 -0
  1987. package/node_modules/toidentifier/index.js +32 -0
  1988. package/node_modules/toidentifier/package.json +38 -0
  1989. package/node_modules/type-is/HISTORY.md +259 -0
  1990. package/node_modules/type-is/LICENSE +23 -0
  1991. package/node_modules/type-is/README.md +170 -0
  1992. package/node_modules/type-is/index.js +266 -0
  1993. package/node_modules/type-is/package.json +45 -0
  1994. package/node_modules/unpipe/HISTORY.md +4 -0
  1995. package/node_modules/unpipe/LICENSE +22 -0
  1996. package/node_modules/unpipe/README.md +43 -0
  1997. package/node_modules/unpipe/index.js +69 -0
  1998. package/node_modules/unpipe/package.json +27 -0
  1999. package/node_modules/use-sync-external-store/LICENSE +21 -0
  2000. package/node_modules/use-sync-external-store/README.md +5 -0
  2001. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +97 -0
  2002. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +85 -0
  2003. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +95 -0
  2004. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +88 -0
  2005. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.js +59 -0
  2006. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +66 -0
  2007. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +96 -0
  2008. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +84 -0
  2009. package/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js +27 -0
  2010. package/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js +13 -0
  2011. package/node_modules/use-sync-external-store/index.js +7 -0
  2012. package/node_modules/use-sync-external-store/package.json +43 -0
  2013. package/node_modules/use-sync-external-store/shim/index.js +7 -0
  2014. package/node_modules/use-sync-external-store/shim/index.native.js +7 -0
  2015. package/node_modules/use-sync-external-store/shim/with-selector.js +7 -0
  2016. package/node_modules/use-sync-external-store/with-selector.js +7 -0
  2017. package/node_modules/utils-merge/.npmignore +9 -0
  2018. package/node_modules/utils-merge/LICENSE +20 -0
  2019. package/node_modules/utils-merge/README.md +34 -0
  2020. package/node_modules/utils-merge/index.js +23 -0
  2021. package/node_modules/utils-merge/package.json +40 -0
  2022. package/node_modules/vary/HISTORY.md +39 -0
  2023. package/node_modules/vary/LICENSE +22 -0
  2024. package/node_modules/vary/README.md +101 -0
  2025. package/node_modules/vary/index.js +149 -0
  2026. package/node_modules/vary/package.json +43 -0
  2027. package/node_modules/ws/LICENSE +20 -0
  2028. package/node_modules/ws/README.md +548 -0
  2029. package/node_modules/ws/browser.js +8 -0
  2030. package/node_modules/ws/index.js +22 -0
  2031. package/node_modules/ws/lib/buffer-util.js +131 -0
  2032. package/node_modules/ws/lib/constants.js +19 -0
  2033. package/node_modules/ws/lib/event-target.js +292 -0
  2034. package/node_modules/ws/lib/extension.js +203 -0
  2035. package/node_modules/ws/lib/limiter.js +55 -0
  2036. package/node_modules/ws/lib/permessage-deflate.js +528 -0
  2037. package/node_modules/ws/lib/receiver.js +706 -0
  2038. package/node_modules/ws/lib/sender.js +602 -0
  2039. package/node_modules/ws/lib/stream.js +161 -0
  2040. package/node_modules/ws/lib/subprotocol.js +62 -0
  2041. package/node_modules/ws/lib/validation.js +152 -0
  2042. package/node_modules/ws/lib/websocket-server.js +554 -0
  2043. package/node_modules/ws/lib/websocket.js +1393 -0
  2044. package/node_modules/ws/package.json +70 -0
  2045. package/node_modules/ws/wrapper.mjs +21 -0
  2046. package/node_modules/zustand/LICENSE +21 -0
  2047. package/node_modules/zustand/README.md +512 -0
  2048. package/node_modules/zustand/esm/index.d.mts +2 -0
  2049. package/node_modules/zustand/esm/index.mjs +2 -0
  2050. package/node_modules/zustand/esm/middleware/combine.d.mts +4 -0
  2051. package/node_modules/zustand/esm/middleware/devtools.d.mts +58 -0
  2052. package/node_modules/zustand/esm/middleware/immer.d.mts +29 -0
  2053. package/node_modules/zustand/esm/middleware/immer.mjs +12 -0
  2054. package/node_modules/zustand/esm/middleware/persist.d.mts +99 -0
  2055. package/node_modules/zustand/esm/middleware/redux.d.mts +21 -0
  2056. package/node_modules/zustand/esm/middleware/ssrSafe.d.mts +2 -0
  2057. package/node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts +25 -0
  2058. package/node_modules/zustand/esm/middleware.d.mts +6 -0
  2059. package/node_modules/zustand/esm/middleware.mjs +487 -0
  2060. package/node_modules/zustand/esm/react/shallow.d.mts +1 -0
  2061. package/node_modules/zustand/esm/react/shallow.mjs +12 -0
  2062. package/node_modules/zustand/esm/react.d.mts +14 -0
  2063. package/node_modules/zustand/esm/react.mjs +22 -0
  2064. package/node_modules/zustand/esm/shallow.d.mts +2 -0
  2065. package/node_modules/zustand/esm/shallow.mjs +2 -0
  2066. package/node_modules/zustand/esm/traditional.d.mts +14 -0
  2067. package/node_modules/zustand/esm/traditional.mjs +26 -0
  2068. package/node_modules/zustand/esm/vanilla/shallow.d.mts +1 -0
  2069. package/node_modules/zustand/esm/vanilla/shallow.mjs +55 -0
  2070. package/node_modules/zustand/esm/vanilla.d.mts +31 -0
  2071. package/node_modules/zustand/esm/vanilla.mjs +24 -0
  2072. package/node_modules/zustand/index.d.ts +2 -0
  2073. package/node_modules/zustand/index.js +19 -0
  2074. package/node_modules/zustand/middleware/combine.d.ts +4 -0
  2075. package/node_modules/zustand/middleware/devtools.d.ts +58 -0
  2076. package/node_modules/zustand/middleware/immer.d.ts +29 -0
  2077. package/node_modules/zustand/middleware/immer.js +14 -0
  2078. package/node_modules/zustand/middleware/persist.d.ts +99 -0
  2079. package/node_modules/zustand/middleware/redux.d.ts +21 -0
  2080. package/node_modules/zustand/middleware/ssrSafe.d.ts +2 -0
  2081. package/node_modules/zustand/middleware/subscribeWithSelector.d.ts +25 -0
  2082. package/node_modules/zustand/middleware.d.ts +6 -0
  2083. package/node_modules/zustand/middleware.js +495 -0
  2084. package/node_modules/zustand/package.json +108 -0
  2085. package/node_modules/zustand/react/shallow.d.ts +1 -0
  2086. package/node_modules/zustand/react/shallow.js +14 -0
  2087. package/node_modules/zustand/react.d.ts +14 -0
  2088. package/node_modules/zustand/react.js +25 -0
  2089. package/node_modules/zustand/shallow.d.ts +2 -0
  2090. package/node_modules/zustand/shallow.js +15 -0
  2091. package/node_modules/zustand/traditional.d.ts +14 -0
  2092. package/node_modules/zustand/traditional.js +29 -0
  2093. package/node_modules/zustand/ts_version_4.5_and_above_is_required.d.ts +0 -0
  2094. package/node_modules/zustand/vanilla/shallow.d.ts +1 -0
  2095. package/node_modules/zustand/vanilla/shallow.js +57 -0
  2096. package/node_modules/zustand/vanilla.d.ts +31 -0
  2097. package/node_modules/zustand/vanilla.js +26 -0
  2098. package/package.json +1 -1
  2099. package/packages/cli/package.json +1 -1
  2100. package/packages/daemon/package.json +1 -1
  2101. package/packages/gui/package.json +1 -1
@@ -0,0 +1,3514 @@
1
+ import { drag } from 'd3-drag';
2
+ import { select, pointer } from 'd3-selection';
3
+ import { zoom, zoomIdentity, zoomTransform } from 'd3-zoom';
4
+ import { interpolateZoom, interpolate } from 'd3-interpolate';
5
+
6
+ const errorMessages = {
7
+ error001: () => '[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001',
8
+ error002: () => "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.",
9
+ error003: (nodeType) => `Node type "${nodeType}" not found. Using fallback type "default".`,
10
+ error004: () => 'The React Flow parent container needs a width and a height to render the graph.',
11
+ error005: () => 'Only child nodes can use a parent extent.',
12
+ error006: () => "Can't create edge. An edge needs a source and a target.",
13
+ error007: (id) => `The old edge with id=${id} does not exist.`,
14
+ error009: (type) => `Marker type "${type}" doesn't exist.`,
15
+ error008: (handleType, { id, sourceHandle, targetHandle }) => `Couldn't create edge for ${handleType} handle id: "${handleType === 'source' ? sourceHandle : targetHandle}", edge id: ${id}.`,
16
+ error010: () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.',
17
+ error011: (edgeType) => `Edge type "${edgeType}" not found. Using fallback type "default".`,
18
+ error012: (id) => `Node with id "${id}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,
19
+ error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`,
20
+ error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.',
21
+ error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.',
22
+ };
23
+ const infiniteExtent = [
24
+ [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
25
+ [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],
26
+ ];
27
+ const elementSelectionKeys = ['Enter', ' ', 'Escape'];
28
+ const defaultAriaLabelConfig = {
29
+ 'node.a11yDescription.default': 'Press enter or space to select a node. Press delete to remove it and escape to cancel.',
30
+ 'node.a11yDescription.keyboardDisabled': 'Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.',
31
+ 'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`,
32
+ 'edge.a11yDescription.default': 'Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.',
33
+ // Control elements
34
+ 'controls.ariaLabel': 'Control Panel',
35
+ 'controls.zoomIn.ariaLabel': 'Zoom In',
36
+ 'controls.zoomOut.ariaLabel': 'Zoom Out',
37
+ 'controls.fitView.ariaLabel': 'Fit View',
38
+ 'controls.interactive.ariaLabel': 'Toggle Interactivity',
39
+ // Mini map
40
+ 'minimap.ariaLabel': 'Mini Map',
41
+ // Handle
42
+ 'handle.ariaLabel': 'Handle',
43
+ };
44
+
45
+ /**
46
+ * The `ConnectionMode` is used to set the mode of connection between nodes.
47
+ * The `Strict` mode is the default one and only allows source to target edges.
48
+ * `Loose` mode allows source to source and target to target edges as well.
49
+ *
50
+ * @public
51
+ */
52
+ var ConnectionMode;
53
+ (function (ConnectionMode) {
54
+ ConnectionMode["Strict"] = "strict";
55
+ ConnectionMode["Loose"] = "loose";
56
+ })(ConnectionMode || (ConnectionMode = {}));
57
+ /**
58
+ * This enum is used to set the different modes of panning the viewport when the
59
+ * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling
60
+ * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict
61
+ * scroll panning to only the vertical or horizontal axis, respectively.
62
+ *
63
+ * @public
64
+ */
65
+ var PanOnScrollMode;
66
+ (function (PanOnScrollMode) {
67
+ PanOnScrollMode["Free"] = "free";
68
+ PanOnScrollMode["Vertical"] = "vertical";
69
+ PanOnScrollMode["Horizontal"] = "horizontal";
70
+ })(PanOnScrollMode || (PanOnScrollMode = {}));
71
+ var SelectionMode;
72
+ (function (SelectionMode) {
73
+ SelectionMode["Partial"] = "partial";
74
+ SelectionMode["Full"] = "full";
75
+ })(SelectionMode || (SelectionMode = {}));
76
+ const initialConnection = {
77
+ inProgress: false,
78
+ isValid: null,
79
+ from: null,
80
+ fromHandle: null,
81
+ fromPosition: null,
82
+ fromNode: null,
83
+ to: null,
84
+ toHandle: null,
85
+ toPosition: null,
86
+ toNode: null,
87
+ pointer: null,
88
+ };
89
+
90
+ /**
91
+ * If you set the `connectionLineType` prop on your [`<ReactFlow />`](/api-reference/react-flow#connection-connectionLineType)
92
+ *component, it will dictate the style of connection line rendered when creating
93
+ *new edges.
94
+ *
95
+ * @public
96
+ *
97
+ * @remarks If you choose to render a custom connection line component, this value will be
98
+ *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props).
99
+ */
100
+ var ConnectionLineType;
101
+ (function (ConnectionLineType) {
102
+ ConnectionLineType["Bezier"] = "default";
103
+ ConnectionLineType["Straight"] = "straight";
104
+ ConnectionLineType["Step"] = "step";
105
+ ConnectionLineType["SmoothStep"] = "smoothstep";
106
+ ConnectionLineType["SimpleBezier"] = "simplebezier";
107
+ })(ConnectionLineType || (ConnectionLineType = {}));
108
+ /**
109
+ * Edges may optionally have a marker on either end. The MarkerType type enumerates
110
+ * the options available to you when configuring a given marker.
111
+ *
112
+ * @public
113
+ */
114
+ var MarkerType;
115
+ (function (MarkerType) {
116
+ MarkerType["Arrow"] = "arrow";
117
+ MarkerType["ArrowClosed"] = "arrowclosed";
118
+ })(MarkerType || (MarkerType = {}));
119
+
120
+ /**
121
+ * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a
122
+ * component in the corners of a container, the `Position` enum is less precise and used
123
+ * primarily in relation to edges and handles.
124
+ *
125
+ * @public
126
+ */
127
+ var Position;
128
+ (function (Position) {
129
+ Position["Left"] = "left";
130
+ Position["Top"] = "top";
131
+ Position["Right"] = "right";
132
+ Position["Bottom"] = "bottom";
133
+ })(Position || (Position = {}));
134
+ const oppositePosition = {
135
+ [Position.Left]: Position.Right,
136
+ [Position.Right]: Position.Left,
137
+ [Position.Top]: Position.Bottom,
138
+ [Position.Bottom]: Position.Top,
139
+ };
140
+
141
+ /**
142
+ * @internal
143
+ */
144
+ function areConnectionMapsEqual(a, b) {
145
+ if (!a && !b) {
146
+ return true;
147
+ }
148
+ if (!a || !b || a.size !== b.size) {
149
+ return false;
150
+ }
151
+ if (!a.size && !b.size) {
152
+ return true;
153
+ }
154
+ for (const key of a.keys()) {
155
+ if (!b.has(key)) {
156
+ return false;
157
+ }
158
+ }
159
+ return true;
160
+ }
161
+ /**
162
+ * We call the callback for all connections in a that are not in b
163
+ *
164
+ * @internal
165
+ */
166
+ function handleConnectionChange(a, b, cb) {
167
+ if (!cb) {
168
+ return;
169
+ }
170
+ const diff = [];
171
+ a.forEach((connection, key) => {
172
+ if (!b?.has(key)) {
173
+ diff.push(connection);
174
+ }
175
+ });
176
+ if (diff.length) {
177
+ cb(diff);
178
+ }
179
+ }
180
+ function getConnectionStatus(isValid) {
181
+ return isValid === null ? null : isValid ? 'valid' : 'invalid';
182
+ }
183
+
184
+ /* eslint-disable @typescript-eslint/no-explicit-any */
185
+ /**
186
+ * Test whether an object is usable as an Edge
187
+ * @public
188
+ * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true
189
+ * @param element - The element to test
190
+ * @returns A boolean indicating whether the element is an Edge
191
+ */
192
+ const isEdgeBase = (element) => 'id' in element && 'source' in element && 'target' in element;
193
+ /**
194
+ * Test whether an object is usable as a Node
195
+ * @public
196
+ * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true
197
+ * @param element - The element to test
198
+ * @returns A boolean indicating whether the element is an Node
199
+ */
200
+ const isNodeBase = (element) => 'id' in element && 'position' in element && !('source' in element) && !('target' in element);
201
+ const isInternalNodeBase = (element) => 'id' in element && 'internals' in element && !('source' in element) && !('target' in element);
202
+ /**
203
+ * This util is used to tell you what nodes, if any, are connected to the given node
204
+ * as the _target_ of an edge.
205
+ * @public
206
+ * @param node - The node to get the connected nodes from.
207
+ * @param nodes - The array of all nodes.
208
+ * @param edges - The array of all edges.
209
+ * @returns An array of nodes that are connected over edges where the source is the given node.
210
+ *
211
+ * @example
212
+ * ```ts
213
+ *import { getOutgoers } from '@xyflow/react';
214
+ *
215
+ *const nodes = [];
216
+ *const edges = [];
217
+ *
218
+ *const outgoers = getOutgoers(
219
+ * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },
220
+ * nodes,
221
+ * edges,
222
+ *);
223
+ *```
224
+ */
225
+ const getOutgoers = (node, nodes, edges) => {
226
+ if (!node.id) {
227
+ return [];
228
+ }
229
+ const outgoerIds = new Set();
230
+ edges.forEach((edge) => {
231
+ if (edge.source === node.id) {
232
+ outgoerIds.add(edge.target);
233
+ }
234
+ });
235
+ return nodes.filter((n) => outgoerIds.has(n.id));
236
+ };
237
+ /**
238
+ * This util is used to tell you what nodes, if any, are connected to the given node
239
+ * as the _source_ of an edge.
240
+ * @public
241
+ * @param node - The node to get the connected nodes from.
242
+ * @param nodes - The array of all nodes.
243
+ * @param edges - The array of all edges.
244
+ * @returns An array of nodes that are connected over edges where the target is the given node.
245
+ *
246
+ * @example
247
+ * ```ts
248
+ *import { getIncomers } from '@xyflow/react';
249
+ *
250
+ *const nodes = [];
251
+ *const edges = [];
252
+ *
253
+ *const incomers = getIncomers(
254
+ * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },
255
+ * nodes,
256
+ * edges,
257
+ *);
258
+ *```
259
+ */
260
+ const getIncomers = (node, nodes, edges) => {
261
+ if (!node.id) {
262
+ return [];
263
+ }
264
+ const incomersIds = new Set();
265
+ edges.forEach((edge) => {
266
+ if (edge.target === node.id) {
267
+ incomersIds.add(edge.source);
268
+ }
269
+ });
270
+ return nodes.filter((n) => incomersIds.has(n.id));
271
+ };
272
+ const getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {
273
+ const { width, height } = getNodeDimensions(node);
274
+ const origin = node.origin ?? nodeOrigin;
275
+ const offsetX = width * origin[0];
276
+ const offsetY = height * origin[1];
277
+ return {
278
+ x: node.position.x - offsetX,
279
+ y: node.position.y - offsetY,
280
+ };
281
+ };
282
+ /**
283
+ * Returns the bounding box that contains all the given nodes in an array. This can
284
+ * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds)
285
+ * to calculate the correct transform to fit the given nodes in a viewport.
286
+ * @public
287
+ * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport.
288
+ * @param nodes - Nodes to calculate the bounds for.
289
+ * @returns Bounding box enclosing all nodes.
290
+ *
291
+ * @remarks This function was previously called `getRectOfNodes`
292
+ *
293
+ * @example
294
+ * ```js
295
+ *import { getNodesBounds } from '@xyflow/react';
296
+ *
297
+ *const nodes = [
298
+ * {
299
+ * id: 'a',
300
+ * position: { x: 0, y: 0 },
301
+ * data: { label: 'a' },
302
+ * width: 50,
303
+ * height: 25,
304
+ * },
305
+ * {
306
+ * id: 'b',
307
+ * position: { x: 100, y: 100 },
308
+ * data: { label: 'b' },
309
+ * width: 50,
310
+ * height: 25,
311
+ * },
312
+ *];
313
+ *
314
+ *const bounds = getNodesBounds(nodes);
315
+ *```
316
+ */
317
+ const getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => {
318
+ if (process.env.NODE_ENV === 'development' && !params.nodeLookup) {
319
+ console.warn('Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.');
320
+ }
321
+ if (nodes.length === 0) {
322
+ return { x: 0, y: 0, width: 0, height: 0 };
323
+ }
324
+ const box = nodes.reduce((currBox, nodeOrId) => {
325
+ const isId = typeof nodeOrId === 'string';
326
+ let currentNode = !params.nodeLookup && !isId ? nodeOrId : undefined;
327
+ if (params.nodeLookup) {
328
+ currentNode = isId
329
+ ? params.nodeLookup.get(nodeOrId)
330
+ : !isInternalNodeBase(nodeOrId)
331
+ ? params.nodeLookup.get(nodeOrId.id)
332
+ : nodeOrId;
333
+ }
334
+ const nodeBox = currentNode ? nodeToBox(currentNode, params.nodeOrigin) : { x: 0, y: 0, x2: 0, y2: 0 };
335
+ return getBoundsOfBoxes(currBox, nodeBox);
336
+ }, { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity });
337
+ return boxToRect(box);
338
+ };
339
+ /**
340
+ * Determines a bounding box that contains all given nodes in an array
341
+ * @internal
342
+ */
343
+ const getInternalNodesBounds = (nodeLookup, params = {}) => {
344
+ let box = { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity };
345
+ let hasVisibleNodes = false;
346
+ nodeLookup.forEach((node) => {
347
+ if (params.filter === undefined || params.filter(node)) {
348
+ box = getBoundsOfBoxes(box, nodeToBox(node));
349
+ hasVisibleNodes = true;
350
+ }
351
+ });
352
+ return hasVisibleNodes ? boxToRect(box) : { x: 0, y: 0, width: 0, height: 0 };
353
+ };
354
+ const getNodesInside = (nodes, rect, [tx, ty, tScale] = [0, 0, 1], partially = false,
355
+ // set excludeNonSelectableNodes if you want to pay attention to the nodes "selectable" attribute
356
+ excludeNonSelectableNodes = false) => {
357
+ const paneRect = {
358
+ ...pointToRendererPoint(rect, [tx, ty, tScale]),
359
+ width: rect.width / tScale,
360
+ height: rect.height / tScale,
361
+ };
362
+ const visibleNodes = [];
363
+ for (const node of nodes.values()) {
364
+ const { measured, selectable = true, hidden = false } = node;
365
+ if ((excludeNonSelectableNodes && !selectable) || hidden) {
366
+ continue;
367
+ }
368
+ const width = measured.width ?? node.width ?? node.initialWidth ?? null;
369
+ const height = measured.height ?? node.height ?? node.initialHeight ?? null;
370
+ const overlappingArea = getOverlappingArea(paneRect, nodeToRect(node));
371
+ const area = (width ?? 0) * (height ?? 0);
372
+ const partiallyVisible = partially && overlappingArea > 0;
373
+ const forceInitialRender = !node.internals.handleBounds;
374
+ const isVisible = forceInitialRender || partiallyVisible || overlappingArea >= area;
375
+ if (isVisible || node.dragging) {
376
+ visibleNodes.push(node);
377
+ }
378
+ }
379
+ return visibleNodes;
380
+ };
381
+ /**
382
+ * This utility filters an array of edges, keeping only those where either the source or target
383
+ * node is present in the given array of nodes.
384
+ * @public
385
+ * @param nodes - Nodes you want to get the connected edges for.
386
+ * @param edges - All edges.
387
+ * @returns Array of edges that connect any of the given nodes with each other.
388
+ *
389
+ * @example
390
+ * ```js
391
+ *import { getConnectedEdges } from '@xyflow/react';
392
+ *
393
+ *const nodes = [
394
+ * { id: 'a', position: { x: 0, y: 0 } },
395
+ * { id: 'b', position: { x: 100, y: 0 } },
396
+ *];
397
+ *
398
+ *const edges = [
399
+ * { id: 'a->c', source: 'a', target: 'c' },
400
+ * { id: 'c->d', source: 'c', target: 'd' },
401
+ *];
402
+ *
403
+ *const connectedEdges = getConnectedEdges(nodes, edges);
404
+ * // => [{ id: 'a->c', source: 'a', target: 'c' }]
405
+ *```
406
+ */
407
+ const getConnectedEdges = (nodes, edges) => {
408
+ const nodeIds = new Set();
409
+ nodes.forEach((node) => {
410
+ nodeIds.add(node.id);
411
+ });
412
+ return edges.filter((edge) => nodeIds.has(edge.source) || nodeIds.has(edge.target));
413
+ };
414
+ function getFitViewNodes(nodeLookup, options) {
415
+ const fitViewNodes = new Map();
416
+ const optionNodeIds = options?.nodes ? new Set(options.nodes.map((node) => node.id)) : null;
417
+ nodeLookup.forEach((n) => {
418
+ const isVisible = n.measured.width && n.measured.height && (options?.includeHiddenNodes || !n.hidden);
419
+ if (isVisible && (!optionNodeIds || optionNodeIds.has(n.id))) {
420
+ fitViewNodes.set(n.id, n);
421
+ }
422
+ });
423
+ return fitViewNodes;
424
+ }
425
+ async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) {
426
+ if (nodes.size === 0) {
427
+ return Promise.resolve(true);
428
+ }
429
+ const nodesToFit = getFitViewNodes(nodes, options);
430
+ const bounds = getInternalNodesBounds(nodesToFit);
431
+ const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);
432
+ await panZoom.setViewport(viewport, {
433
+ duration: options?.duration,
434
+ ease: options?.ease,
435
+ interpolate: options?.interpolate,
436
+ });
437
+ return Promise.resolve(true);
438
+ }
439
+ /**
440
+ * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin.
441
+ *
442
+ * @internal
443
+ * @returns position, positionAbsolute
444
+ */
445
+ function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin = [0, 0], nodeExtent, onError, }) {
446
+ const node = nodeLookup.get(nodeId);
447
+ const parentNode = node.parentId ? nodeLookup.get(node.parentId) : undefined;
448
+ const { x: parentX, y: parentY } = parentNode ? parentNode.internals.positionAbsolute : { x: 0, y: 0 };
449
+ const origin = node.origin ?? nodeOrigin;
450
+ let extent = node.extent || nodeExtent;
451
+ if (node.extent === 'parent' && !node.expandParent) {
452
+ if (!parentNode) {
453
+ onError?.('005', errorMessages['error005']());
454
+ }
455
+ else {
456
+ const parentWidth = parentNode.measured.width;
457
+ const parentHeight = parentNode.measured.height;
458
+ if (parentWidth && parentHeight) {
459
+ extent = [
460
+ [parentX, parentY],
461
+ [parentX + parentWidth, parentY + parentHeight],
462
+ ];
463
+ }
464
+ }
465
+ }
466
+ else if (parentNode && isCoordinateExtent(node.extent)) {
467
+ extent = [
468
+ [node.extent[0][0] + parentX, node.extent[0][1] + parentY],
469
+ [node.extent[1][0] + parentX, node.extent[1][1] + parentY],
470
+ ];
471
+ }
472
+ const positionAbsolute = isCoordinateExtent(extent)
473
+ ? clampPosition(nextPosition, extent, node.measured)
474
+ : nextPosition;
475
+ if (node.measured.width === undefined || node.measured.height === undefined) {
476
+ onError?.('015', errorMessages['error015']());
477
+ }
478
+ return {
479
+ position: {
480
+ x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0],
481
+ y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1],
482
+ },
483
+ positionAbsolute,
484
+ };
485
+ }
486
+ /**
487
+ * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted
488
+ * @internal
489
+ * @param param.nodesToRemove - The nodes to remove
490
+ * @param param.edgesToRemove - The edges to remove
491
+ * @param param.nodes - All nodes
492
+ * @param param.edges - All edges
493
+ * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted
494
+ * @returns nodes: nodes that can be deleted, edges: edges that can be deleted
495
+ */
496
+ async function getElementsToRemove({ nodesToRemove = [], edgesToRemove = [], nodes, edges, onBeforeDelete, }) {
497
+ const nodeIds = new Set(nodesToRemove.map((node) => node.id));
498
+ const matchingNodes = [];
499
+ for (const node of nodes) {
500
+ if (node.deletable === false) {
501
+ continue;
502
+ }
503
+ const isIncluded = nodeIds.has(node.id);
504
+ const parentHit = !isIncluded && node.parentId && matchingNodes.find((n) => n.id === node.parentId);
505
+ if (isIncluded || parentHit) {
506
+ matchingNodes.push(node);
507
+ }
508
+ }
509
+ const edgeIds = new Set(edgesToRemove.map((edge) => edge.id));
510
+ const deletableEdges = edges.filter((edge) => edge.deletable !== false);
511
+ const connectedEdges = getConnectedEdges(matchingNodes, deletableEdges);
512
+ const matchingEdges = connectedEdges;
513
+ for (const edge of deletableEdges) {
514
+ const isIncluded = edgeIds.has(edge.id);
515
+ if (isIncluded && !matchingEdges.find((e) => e.id === edge.id)) {
516
+ matchingEdges.push(edge);
517
+ }
518
+ }
519
+ if (!onBeforeDelete) {
520
+ return {
521
+ edges: matchingEdges,
522
+ nodes: matchingNodes,
523
+ };
524
+ }
525
+ const onBeforeDeleteResult = await onBeforeDelete({
526
+ nodes: matchingNodes,
527
+ edges: matchingEdges,
528
+ });
529
+ if (typeof onBeforeDeleteResult === 'boolean') {
530
+ return onBeforeDeleteResult ? { edges: matchingEdges, nodes: matchingNodes } : { edges: [], nodes: [] };
531
+ }
532
+ return onBeforeDeleteResult;
533
+ }
534
+
535
+ const clamp = (val, min = 0, max = 1) => Math.min(Math.max(val, min), max);
536
+ const clampPosition = (position = { x: 0, y: 0 }, extent, dimensions) => ({
537
+ x: clamp(position.x, extent[0][0], extent[1][0] - (dimensions?.width ?? 0)),
538
+ y: clamp(position.y, extent[0][1], extent[1][1] - (dimensions?.height ?? 0)),
539
+ });
540
+ function clampPositionToParent(childPosition, childDimensions, parent) {
541
+ const { width: parentWidth, height: parentHeight } = getNodeDimensions(parent);
542
+ const { x: parentX, y: parentY } = parent.internals.positionAbsolute;
543
+ return clampPosition(childPosition, [
544
+ [parentX, parentY],
545
+ [parentX + parentWidth, parentY + parentHeight],
546
+ ], childDimensions);
547
+ }
548
+ /**
549
+ * Calculates the velocity of panning when the mouse is close to the edge of the canvas
550
+ * @internal
551
+ * @param value - One dimensional poition of the mouse (x or y)
552
+ * @param min - Minimal position on canvas before panning starts
553
+ * @param max - Maximal position on canvas before panning starts
554
+ * @returns - A number between 0 and 1 that represents the velocity of panning
555
+ */
556
+ const calcAutoPanVelocity = (value, min, max) => {
557
+ if (value < min) {
558
+ return clamp(Math.abs(value - min), 1, min) / min;
559
+ }
560
+ else if (value > max) {
561
+ return -clamp(Math.abs(value - max), 1, min) / min;
562
+ }
563
+ return 0;
564
+ };
565
+ const calcAutoPan = (pos, bounds, speed = 15, distance = 40) => {
566
+ const xMovement = calcAutoPanVelocity(pos.x, distance, bounds.width - distance) * speed;
567
+ const yMovement = calcAutoPanVelocity(pos.y, distance, bounds.height - distance) * speed;
568
+ return [xMovement, yMovement];
569
+ };
570
+ const getBoundsOfBoxes = (box1, box2) => ({
571
+ x: Math.min(box1.x, box2.x),
572
+ y: Math.min(box1.y, box2.y),
573
+ x2: Math.max(box1.x2, box2.x2),
574
+ y2: Math.max(box1.y2, box2.y2),
575
+ });
576
+ const rectToBox = ({ x, y, width, height }) => ({
577
+ x,
578
+ y,
579
+ x2: x + width,
580
+ y2: y + height,
581
+ });
582
+ const boxToRect = ({ x, y, x2, y2 }) => ({
583
+ x,
584
+ y,
585
+ width: x2 - x,
586
+ height: y2 - y,
587
+ });
588
+ const nodeToRect = (node, nodeOrigin = [0, 0]) => {
589
+ const { x, y } = isInternalNodeBase(node)
590
+ ? node.internals.positionAbsolute
591
+ : getNodePositionWithOrigin(node, nodeOrigin);
592
+ return {
593
+ x,
594
+ y,
595
+ width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,
596
+ height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,
597
+ };
598
+ };
599
+ const nodeToBox = (node, nodeOrigin = [0, 0]) => {
600
+ const { x, y } = isInternalNodeBase(node)
601
+ ? node.internals.positionAbsolute
602
+ : getNodePositionWithOrigin(node, nodeOrigin);
603
+ return {
604
+ x,
605
+ y,
606
+ x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0),
607
+ y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0),
608
+ };
609
+ };
610
+ const getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2)));
611
+ const getOverlappingArea = (rectA, rectB) => {
612
+ const xOverlap = Math.max(0, Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - Math.max(rectA.x, rectB.x));
613
+ const yOverlap = Math.max(0, Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - Math.max(rectA.y, rectB.y));
614
+ return Math.ceil(xOverlap * yOverlap);
615
+ };
616
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
617
+ const isRectObject = (obj) => isNumeric(obj.width) && isNumeric(obj.height) && isNumeric(obj.x) && isNumeric(obj.y);
618
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
619
+ const isNumeric = (n) => !isNaN(n) && isFinite(n);
620
+ // used for a11y key board controls for nodes and edges
621
+ const devWarn = (id, message) => {
622
+ if (process.env.NODE_ENV === 'development') {
623
+ console.warn(`[React Flow]: ${message} Help: https://reactflow.dev/error#${id}`);
624
+ }
625
+ };
626
+ const snapPosition = (position, snapGrid = [1, 1]) => {
627
+ return {
628
+ x: snapGrid[0] * Math.round(position.x / snapGrid[0]),
629
+ y: snapGrid[1] * Math.round(position.y / snapGrid[1]),
630
+ };
631
+ };
632
+ const pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = false, snapGrid = [1, 1]) => {
633
+ const position = {
634
+ x: (x - tx) / tScale,
635
+ y: (y - ty) / tScale,
636
+ };
637
+ return snapToGrid ? snapPosition(position, snapGrid) : position;
638
+ };
639
+ const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {
640
+ return {
641
+ x: x * tScale + tx,
642
+ y: y * tScale + ty,
643
+ };
644
+ };
645
+ /**
646
+ * Parses a single padding value to a number
647
+ * @internal
648
+ * @param padding - Padding to parse
649
+ * @param viewport - Width or height of the viewport
650
+ * @returns The padding in pixels
651
+ */
652
+ function parsePadding(padding, viewport) {
653
+ if (typeof padding === 'number') {
654
+ return Math.floor((viewport - viewport / (1 + padding)) * 0.5);
655
+ }
656
+ if (typeof padding === 'string' && padding.endsWith('px')) {
657
+ const paddingValue = parseFloat(padding);
658
+ if (!Number.isNaN(paddingValue)) {
659
+ return Math.floor(paddingValue);
660
+ }
661
+ }
662
+ if (typeof padding === 'string' && padding.endsWith('%')) {
663
+ const paddingValue = parseFloat(padding);
664
+ if (!Number.isNaN(paddingValue)) {
665
+ return Math.floor(viewport * paddingValue * 0.01);
666
+ }
667
+ }
668
+ console.error(`[React Flow] The padding value "${padding}" is invalid. Please provide a number or a string with a valid unit (px or %).`);
669
+ return 0;
670
+ }
671
+ /**
672
+ * Parses the paddings to an object with top, right, bottom, left, x and y paddings
673
+ * @internal
674
+ * @param padding - Padding to parse
675
+ * @param width - Width of the viewport
676
+ * @param height - Height of the viewport
677
+ * @returns An object with the paddings in pixels
678
+ */
679
+ function parsePaddings(padding, width, height) {
680
+ if (typeof padding === 'string' || typeof padding === 'number') {
681
+ const paddingY = parsePadding(padding, height);
682
+ const paddingX = parsePadding(padding, width);
683
+ return {
684
+ top: paddingY,
685
+ right: paddingX,
686
+ bottom: paddingY,
687
+ left: paddingX,
688
+ x: paddingX * 2,
689
+ y: paddingY * 2,
690
+ };
691
+ }
692
+ if (typeof padding === 'object') {
693
+ const top = parsePadding(padding.top ?? padding.y ?? 0, height);
694
+ const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);
695
+ const left = parsePadding(padding.left ?? padding.x ?? 0, width);
696
+ const right = parsePadding(padding.right ?? padding.x ?? 0, width);
697
+ return { top, right, bottom, left, x: left + right, y: top + bottom };
698
+ }
699
+ return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };
700
+ }
701
+ /**
702
+ * Calculates the resulting paddings if the new viewport is applied
703
+ * @internal
704
+ * @param bounds - Bounds to fit inside viewport
705
+ * @param x - X position of the viewport
706
+ * @param y - Y position of the viewport
707
+ * @param zoom - Zoom level of the viewport
708
+ * @param width - Width of the viewport
709
+ * @param height - Height of the viewport
710
+ * @returns An object with the minimum padding required to fit the bounds inside the viewport
711
+ */
712
+ function calculateAppliedPaddings(bounds, x, y, zoom, width, height) {
713
+ const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]);
714
+ const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]);
715
+ const right = width - boundRight;
716
+ const bottom = height - boundBottom;
717
+ return {
718
+ left: Math.floor(left),
719
+ top: Math.floor(top),
720
+ right: Math.floor(right),
721
+ bottom: Math.floor(bottom),
722
+ };
723
+ }
724
+ /**
725
+ * Returns a viewport that encloses the given bounds with padding.
726
+ * @public
727
+ * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects}
728
+ * @param bounds - Bounds to fit inside viewport.
729
+ * @param width - Width of the viewport.
730
+ * @param height - Height of the viewport.
731
+ * @param minZoom - Minimum zoom level of the resulting viewport.
732
+ * @param maxZoom - Maximum zoom level of the resulting viewport.
733
+ * @param padding - Padding around the bounds.
734
+ * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}.
735
+ * @example
736
+ * const { x, y, zoom } = getViewportForBounds(
737
+ * { x: 0, y: 0, width: 100, height: 100},
738
+ * 1200, 800, 0.5, 2);
739
+ */
740
+ const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {
741
+ // First we resolve all the paddings to actual pixel values
742
+ const p = parsePaddings(padding, width, height);
743
+ const xZoom = (width - p.x) / bounds.width;
744
+ const yZoom = (height - p.y) / bounds.height;
745
+ // We calculate the new x, y, zoom for a centered view
746
+ const zoom = Math.min(xZoom, yZoom);
747
+ const clampedZoom = clamp(zoom, minZoom, maxZoom);
748
+ const boundsCenterX = bounds.x + bounds.width / 2;
749
+ const boundsCenterY = bounds.y + bounds.height / 2;
750
+ const x = width / 2 - boundsCenterX * clampedZoom;
751
+ const y = height / 2 - boundsCenterY * clampedZoom;
752
+ // Then we calculate the minimum padding, to respect asymmetric paddings
753
+ const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height);
754
+ // We only want to have an offset if the newPadding is smaller than the required padding
755
+ const offset = {
756
+ left: Math.min(newPadding.left - p.left, 0),
757
+ top: Math.min(newPadding.top - p.top, 0),
758
+ right: Math.min(newPadding.right - p.right, 0),
759
+ bottom: Math.min(newPadding.bottom - p.bottom, 0),
760
+ };
761
+ return {
762
+ x: x - offset.left + offset.right,
763
+ y: y - offset.top + offset.bottom,
764
+ zoom: clampedZoom,
765
+ };
766
+ };
767
+ const isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;
768
+ function isCoordinateExtent(extent) {
769
+ return extent !== undefined && extent !== null && extent !== 'parent';
770
+ }
771
+ function getNodeDimensions(node) {
772
+ return {
773
+ width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,
774
+ height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,
775
+ };
776
+ }
777
+ function nodeHasDimensions(node) {
778
+ return ((node.measured?.width ?? node.width ?? node.initialWidth) !== undefined &&
779
+ (node.measured?.height ?? node.height ?? node.initialHeight) !== undefined);
780
+ }
781
+ /**
782
+ * Convert child position to absolute position
783
+ *
784
+ * @internal
785
+ * @param position
786
+ * @param parentId
787
+ * @param nodeLookup
788
+ * @param nodeOrigin
789
+ * @returns an internal node with an absolute position
790
+ */
791
+ function evaluateAbsolutePosition(position, dimensions = { width: 0, height: 0 }, parentId, nodeLookup, nodeOrigin) {
792
+ const positionAbsolute = { ...position };
793
+ const parent = nodeLookup.get(parentId);
794
+ if (parent) {
795
+ const origin = parent.origin || nodeOrigin;
796
+ positionAbsolute.x += parent.internals.positionAbsolute.x - (dimensions.width ?? 0) * origin[0];
797
+ positionAbsolute.y += parent.internals.positionAbsolute.y - (dimensions.height ?? 0) * origin[1];
798
+ }
799
+ return positionAbsolute;
800
+ }
801
+ function areSetsEqual(a, b) {
802
+ if (a.size !== b.size) {
803
+ return false;
804
+ }
805
+ for (const item of a) {
806
+ if (!b.has(item)) {
807
+ return false;
808
+ }
809
+ }
810
+ return true;
811
+ }
812
+ /**
813
+ * Polyfill for Promise.withResolvers until we can use it in all browsers
814
+ * @internal
815
+ */
816
+ function withResolvers() {
817
+ let resolve;
818
+ let reject;
819
+ const promise = new Promise((res, rej) => {
820
+ resolve = res;
821
+ reject = rej;
822
+ });
823
+ return { promise, resolve, reject };
824
+ }
825
+ function mergeAriaLabelConfig(partial) {
826
+ return { ...defaultAriaLabelConfig, ...(partial || {}) };
827
+ }
828
+
829
+ function getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = false, transform, containerBounds }) {
830
+ const { x, y } = getEventPosition(event);
831
+ const pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform);
832
+ const { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;
833
+ // we need the snapped position in order to be able to skip unnecessary drag events
834
+ return {
835
+ xSnapped,
836
+ ySnapped,
837
+ ...pointerPos,
838
+ };
839
+ }
840
+ const getDimensions = (node) => ({
841
+ width: node.offsetWidth,
842
+ height: node.offsetHeight,
843
+ });
844
+ const getHostForElement = (element) => element?.getRootNode?.() || window?.document;
845
+ const inputTags = ['INPUT', 'SELECT', 'TEXTAREA'];
846
+ function isInputDOMNode(event) {
847
+ // using composed path for handling shadow dom
848
+ const target = (event.composedPath?.()?.[0] || event.target);
849
+ if (target?.nodeType !== 1 /* Node.ELEMENT_NODE */)
850
+ return false;
851
+ const isInput = inputTags.includes(target.nodeName) || target.hasAttribute('contenteditable');
852
+ // when an input field is focused we don't want to trigger deletion or movement of nodes
853
+ return isInput || !!target.closest('.nokey');
854
+ }
855
+ const isMouseEvent = (event) => 'clientX' in event;
856
+ const getEventPosition = (event, bounds) => {
857
+ const isMouse = isMouseEvent(event);
858
+ const evtX = isMouse ? event.clientX : event.touches?.[0].clientX;
859
+ const evtY = isMouse ? event.clientY : event.touches?.[0].clientY;
860
+ return {
861
+ x: evtX - (bounds?.left ?? 0),
862
+ y: evtY - (bounds?.top ?? 0),
863
+ };
864
+ };
865
+ /*
866
+ * The handle bounds are calculated relative to the node element.
867
+ * We store them in the internals object of the node in order to avoid
868
+ * unnecessary recalculations.
869
+ */
870
+ const getHandleBounds = (type, nodeElement, nodeBounds, zoom, nodeId) => {
871
+ const handles = nodeElement.querySelectorAll(`.${type}`);
872
+ if (!handles || !handles.length) {
873
+ return null;
874
+ }
875
+ return Array.from(handles).map((handle) => {
876
+ const handleBounds = handle.getBoundingClientRect();
877
+ return {
878
+ id: handle.getAttribute('data-handleid'),
879
+ type,
880
+ nodeId,
881
+ position: handle.getAttribute('data-handlepos'),
882
+ x: (handleBounds.left - nodeBounds.left) / zoom,
883
+ y: (handleBounds.top - nodeBounds.top) / zoom,
884
+ ...getDimensions(handle),
885
+ };
886
+ });
887
+ };
888
+
889
+ function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }) {
890
+ /*
891
+ * cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate
892
+ * https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve
893
+ */
894
+ const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125;
895
+ const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125;
896
+ const offsetX = Math.abs(centerX - sourceX);
897
+ const offsetY = Math.abs(centerY - sourceY);
898
+ return [centerX, centerY, offsetX, offsetY];
899
+ }
900
+ function calculateControlOffset(distance, curvature) {
901
+ if (distance >= 0) {
902
+ return 0.5 * distance;
903
+ }
904
+ return curvature * 25 * Math.sqrt(-distance);
905
+ }
906
+ function getControlWithCurvature({ pos, x1, y1, x2, y2, c }) {
907
+ switch (pos) {
908
+ case Position.Left:
909
+ return [x1 - calculateControlOffset(x1 - x2, c), y1];
910
+ case Position.Right:
911
+ return [x1 + calculateControlOffset(x2 - x1, c), y1];
912
+ case Position.Top:
913
+ return [x1, y1 - calculateControlOffset(y1 - y2, c)];
914
+ case Position.Bottom:
915
+ return [x1, y1 + calculateControlOffset(y2 - y1, c)];
916
+ }
917
+ }
918
+ /**
919
+ * The `getBezierPath` util returns everything you need to render a bezier edge
920
+ *between two nodes.
921
+ * @public
922
+ * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)
923
+ * and `offsetX`, `offsetY` between source handle and label.
924
+ * - `path`: the path to use in an SVG `<path>` element.
925
+ * - `labelX`: the `x` position you can use to render a label for this edge.
926
+ * - `labelY`: the `y` position you can use to render a label for this edge.
927
+ * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the
928
+ * middle of this path.
929
+ * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the
930
+ * middle of this path.
931
+ * @example
932
+ * ```js
933
+ * const source = { x: 0, y: 20 };
934
+ * const target = { x: 150, y: 100 };
935
+ *
936
+ * const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({
937
+ * sourceX: source.x,
938
+ * sourceY: source.y,
939
+ * sourcePosition: Position.Right,
940
+ * targetX: target.x,
941
+ * targetY: target.y,
942
+ * targetPosition: Position.Left,
943
+ *});
944
+ *```
945
+ *
946
+ * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to
947
+ *work with multiple edge paths at once.
948
+ */
949
+ function getBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, curvature = 0.25, }) {
950
+ const [sourceControlX, sourceControlY] = getControlWithCurvature({
951
+ pos: sourcePosition,
952
+ x1: sourceX,
953
+ y1: sourceY,
954
+ x2: targetX,
955
+ y2: targetY,
956
+ c: curvature,
957
+ });
958
+ const [targetControlX, targetControlY] = getControlWithCurvature({
959
+ pos: targetPosition,
960
+ x1: targetX,
961
+ y1: targetY,
962
+ x2: sourceX,
963
+ y2: sourceY,
964
+ c: curvature,
965
+ });
966
+ const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({
967
+ sourceX,
968
+ sourceY,
969
+ targetX,
970
+ targetY,
971
+ sourceControlX,
972
+ sourceControlY,
973
+ targetControlX,
974
+ targetControlY,
975
+ });
976
+ return [
977
+ `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,
978
+ labelX,
979
+ labelY,
980
+ offsetX,
981
+ offsetY,
982
+ ];
983
+ }
984
+
985
+ // this is used for straight edges and simple smoothstep edges (LTR, RTL, BTT, TTB)
986
+ function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }) {
987
+ const xOffset = Math.abs(targetX - sourceX) / 2;
988
+ const centerX = targetX < sourceX ? targetX + xOffset : targetX - xOffset;
989
+ const yOffset = Math.abs(targetY - sourceY) / 2;
990
+ const centerY = targetY < sourceY ? targetY + yOffset : targetY - yOffset;
991
+ return [centerX, centerY, xOffset, yOffset];
992
+ }
993
+ /**
994
+ * Returns the z-index for an edge based on the node it connects and whether it is selected.
995
+ * By default, edges are rendered below nodes. This behaviour is different for edges that are
996
+ * connected to nodes with a parent, as they are rendered above the parent node.
997
+ */
998
+ function getElevatedEdgeZIndex({ sourceNode, targetNode, selected = false, zIndex = 0, elevateOnSelect = false, zIndexMode = 'basic', }) {
999
+ if (zIndexMode === 'manual') {
1000
+ return zIndex;
1001
+ }
1002
+ const edgeZ = elevateOnSelect && selected ? zIndex + 1000 : zIndex;
1003
+ const nodeZ = Math.max(sourceNode.parentId || (elevateOnSelect && sourceNode.selected) ? sourceNode.internals.z : 0, targetNode.parentId || (elevateOnSelect && targetNode.selected) ? targetNode.internals.z : 0);
1004
+ return edgeZ + nodeZ;
1005
+ }
1006
+ function isEdgeVisible({ sourceNode, targetNode, width, height, transform }) {
1007
+ const edgeBox = getBoundsOfBoxes(nodeToBox(sourceNode), nodeToBox(targetNode));
1008
+ if (edgeBox.x === edgeBox.x2) {
1009
+ edgeBox.x2 += 1;
1010
+ }
1011
+ if (edgeBox.y === edgeBox.y2) {
1012
+ edgeBox.y2 += 1;
1013
+ }
1014
+ const viewRect = {
1015
+ x: -transform[0] / transform[2],
1016
+ y: -transform[1] / transform[2],
1017
+ width: width / transform[2],
1018
+ height: height / transform[2],
1019
+ };
1020
+ return getOverlappingArea(viewRect, boxToRect(edgeBox)) > 0;
1021
+ }
1022
+ /**
1023
+ * The default edge ID generator function. Generates an ID based on the source, target, and handles.
1024
+ * @public
1025
+ * @param params - The connection or edge to generate an ID for.
1026
+ * @returns The generated edge ID.
1027
+ */
1028
+ const getEdgeId = ({ source, sourceHandle, target, targetHandle }) => `xy-edge__${source}${sourceHandle || ''}-${target}${targetHandle || ''}`;
1029
+ const connectionExists = (edge, edges) => {
1030
+ return edges.some((el) => el.source === edge.source &&
1031
+ el.target === edge.target &&
1032
+ (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle)) &&
1033
+ (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle)));
1034
+ };
1035
+ /**
1036
+ * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one.
1037
+ * @public
1038
+ * @param edgeParams - Either an `Edge` or a `Connection` you want to add.
1039
+ * @param edges - The array of all current edges.
1040
+ * @param options - Optional configuration object.
1041
+ * @returns A new array of edges with the new edge added.
1042
+ *
1043
+ * @remarks If an edge with the same `target` and `source` already exists (and the same
1044
+ *`targetHandle` and `sourceHandle` if those are set), then this util won't add
1045
+ *a new edge even if the `id` property is different.
1046
+ *
1047
+ */
1048
+ const addEdge = (edgeParams, edges, options = {}) => {
1049
+ if (!edgeParams.source || !edgeParams.target) {
1050
+ devWarn('006', errorMessages['error006']());
1051
+ return edges;
1052
+ }
1053
+ const edgeIdGenerator = options.getEdgeId || getEdgeId;
1054
+ let edge;
1055
+ if (isEdgeBase(edgeParams)) {
1056
+ edge = { ...edgeParams };
1057
+ }
1058
+ else {
1059
+ edge = {
1060
+ ...edgeParams,
1061
+ id: edgeIdGenerator(edgeParams),
1062
+ };
1063
+ }
1064
+ if (connectionExists(edge, edges)) {
1065
+ return edges;
1066
+ }
1067
+ if (edge.sourceHandle === null) {
1068
+ delete edge.sourceHandle;
1069
+ }
1070
+ if (edge.targetHandle === null) {
1071
+ delete edge.targetHandle;
1072
+ }
1073
+ return edges.concat(edge);
1074
+ };
1075
+ /**
1076
+ * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties.
1077
+ *This searches your edge array for an edge with a matching `id` and updates its
1078
+ *properties with the connection you provide.
1079
+ * @public
1080
+ * @param oldEdge - The edge you want to update.
1081
+ * @param newConnection - The new connection you want to update the edge with.
1082
+ * @param edges - The array of all current edges.
1083
+ * @returns The updated edges array.
1084
+ *
1085
+ * @example
1086
+ * ```js
1087
+ *const onReconnect = useCallback(
1088
+ * (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]);
1089
+ *```
1090
+ */
1091
+ const reconnectEdge = (oldEdge, newConnection, edges, options = { shouldReplaceId: true }) => {
1092
+ const { id: oldEdgeId, ...rest } = oldEdge;
1093
+ if (!newConnection.source || !newConnection.target) {
1094
+ devWarn('006', errorMessages['error006']());
1095
+ return edges;
1096
+ }
1097
+ const foundEdge = edges.find((e) => e.id === oldEdge.id);
1098
+ if (!foundEdge) {
1099
+ devWarn('007', errorMessages['error007'](oldEdgeId));
1100
+ return edges;
1101
+ }
1102
+ const edgeIdGenerator = options.getEdgeId || getEdgeId;
1103
+ // Remove old edge and create the new edge with parameters of old edge.
1104
+ const edge = {
1105
+ ...rest,
1106
+ id: options.shouldReplaceId ? edgeIdGenerator(newConnection) : oldEdgeId,
1107
+ source: newConnection.source,
1108
+ target: newConnection.target,
1109
+ sourceHandle: newConnection.sourceHandle,
1110
+ targetHandle: newConnection.targetHandle,
1111
+ };
1112
+ return edges.filter((e) => e.id !== oldEdgeId).concat(edge);
1113
+ };
1114
+
1115
+ /**
1116
+ * Calculates the straight line path between two points.
1117
+ * @public
1118
+ * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)
1119
+ * and `offsetX`, `offsetY` between source handle and label.
1120
+ *
1121
+ * - `path`: the path to use in an SVG `<path>` element.
1122
+ * - `labelX`: the `x` position you can use to render a label for this edge.
1123
+ * - `labelY`: the `y` position you can use to render a label for this edge.
1124
+ * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the
1125
+ * middle of this path.
1126
+ * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the
1127
+ * middle of this path.
1128
+ * @example
1129
+ * ```js
1130
+ * const source = { x: 0, y: 20 };
1131
+ * const target = { x: 150, y: 100 };
1132
+ *
1133
+ * const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({
1134
+ * sourceX: source.x,
1135
+ * sourceY: source.y,
1136
+ * sourcePosition: Position.Right,
1137
+ * targetX: target.x,
1138
+ * targetY: target.y,
1139
+ * targetPosition: Position.Left,
1140
+ * });
1141
+ * ```
1142
+ * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.
1143
+ */
1144
+ function getStraightPath({ sourceX, sourceY, targetX, targetY, }) {
1145
+ const [labelX, labelY, offsetX, offsetY] = getEdgeCenter({
1146
+ sourceX,
1147
+ sourceY,
1148
+ targetX,
1149
+ targetY,
1150
+ });
1151
+ return [`M ${sourceX},${sourceY}L ${targetX},${targetY}`, labelX, labelY, offsetX, offsetY];
1152
+ }
1153
+
1154
+ const handleDirections = {
1155
+ [Position.Left]: { x: -1, y: 0 },
1156
+ [Position.Right]: { x: 1, y: 0 },
1157
+ [Position.Top]: { x: 0, y: -1 },
1158
+ [Position.Bottom]: { x: 0, y: 1 },
1159
+ };
1160
+ const getDirection = ({ source, sourcePosition = Position.Bottom, target, }) => {
1161
+ if (sourcePosition === Position.Left || sourcePosition === Position.Right) {
1162
+ return source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 };
1163
+ }
1164
+ return source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 };
1165
+ };
1166
+ const distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));
1167
+ /*
1168
+ * With this function we try to mimic an orthogonal edge routing behaviour
1169
+ * It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges
1170
+ */
1171
+ function getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, stepPosition, }) {
1172
+ const sourceDir = handleDirections[sourcePosition];
1173
+ const targetDir = handleDirections[targetPosition];
1174
+ const sourceGapped = { x: source.x + sourceDir.x * offset, y: source.y + sourceDir.y * offset };
1175
+ const targetGapped = { x: target.x + targetDir.x * offset, y: target.y + targetDir.y * offset };
1176
+ const dir = getDirection({
1177
+ source: sourceGapped,
1178
+ sourcePosition,
1179
+ target: targetGapped,
1180
+ });
1181
+ const dirAccessor = dir.x !== 0 ? 'x' : 'y';
1182
+ const currDir = dir[dirAccessor];
1183
+ let points = [];
1184
+ let centerX, centerY;
1185
+ const sourceGapOffset = { x: 0, y: 0 };
1186
+ const targetGapOffset = { x: 0, y: 0 };
1187
+ const [, , defaultOffsetX, defaultOffsetY] = getEdgeCenter({
1188
+ sourceX: source.x,
1189
+ sourceY: source.y,
1190
+ targetX: target.x,
1191
+ targetY: target.y,
1192
+ });
1193
+ // opposite handle positions, default case
1194
+ if (sourceDir[dirAccessor] * targetDir[dirAccessor] === -1) {
1195
+ if (dirAccessor === 'x') {
1196
+ // Primary direction is horizontal, so stepPosition affects X coordinate
1197
+ centerX = center.x ?? sourceGapped.x + (targetGapped.x - sourceGapped.x) * stepPosition;
1198
+ centerY = center.y ?? (sourceGapped.y + targetGapped.y) / 2;
1199
+ }
1200
+ else {
1201
+ // Primary direction is vertical, so stepPosition affects Y coordinate
1202
+ centerX = center.x ?? (sourceGapped.x + targetGapped.x) / 2;
1203
+ centerY = center.y ?? sourceGapped.y + (targetGapped.y - sourceGapped.y) * stepPosition;
1204
+ }
1205
+ /*
1206
+ * --->
1207
+ * |
1208
+ * >---
1209
+ */
1210
+ const verticalSplit = [
1211
+ { x: centerX, y: sourceGapped.y },
1212
+ { x: centerX, y: targetGapped.y },
1213
+ ];
1214
+ /*
1215
+ * |
1216
+ * ---
1217
+ * |
1218
+ */
1219
+ const horizontalSplit = [
1220
+ { x: sourceGapped.x, y: centerY },
1221
+ { x: targetGapped.x, y: centerY },
1222
+ ];
1223
+ if (sourceDir[dirAccessor] === currDir) {
1224
+ points = dirAccessor === 'x' ? verticalSplit : horizontalSplit;
1225
+ }
1226
+ else {
1227
+ points = dirAccessor === 'x' ? horizontalSplit : verticalSplit;
1228
+ }
1229
+ }
1230
+ else {
1231
+ // sourceTarget means we take x from source and y from target, targetSource is the opposite
1232
+ const sourceTarget = [{ x: sourceGapped.x, y: targetGapped.y }];
1233
+ const targetSource = [{ x: targetGapped.x, y: sourceGapped.y }];
1234
+ // this handles edges with same handle positions
1235
+ if (dirAccessor === 'x') {
1236
+ points = sourceDir.x === currDir ? targetSource : sourceTarget;
1237
+ }
1238
+ else {
1239
+ points = sourceDir.y === currDir ? sourceTarget : targetSource;
1240
+ }
1241
+ if (sourcePosition === targetPosition) {
1242
+ const diff = Math.abs(source[dirAccessor] - target[dirAccessor]);
1243
+ // if an edge goes from right to right for example (sourcePosition === targetPosition) and the distance between source.x and target.x is less than the offset, the added point and the gapped source/target will overlap. This leads to a weird edge path. To avoid this we add a gapOffset to the source/target
1244
+ if (diff <= offset) {
1245
+ const gapOffset = Math.min(offset - 1, offset - diff);
1246
+ if (sourceDir[dirAccessor] === currDir) {
1247
+ sourceGapOffset[dirAccessor] = (sourceGapped[dirAccessor] > source[dirAccessor] ? -1 : 1) * gapOffset;
1248
+ }
1249
+ else {
1250
+ targetGapOffset[dirAccessor] = (targetGapped[dirAccessor] > target[dirAccessor] ? -1 : 1) * gapOffset;
1251
+ }
1252
+ }
1253
+ }
1254
+ // these are conditions for handling mixed handle positions like Right -> Bottom for example
1255
+ if (sourcePosition !== targetPosition) {
1256
+ const dirAccessorOpposite = dirAccessor === 'x' ? 'y' : 'x';
1257
+ const isSameDir = sourceDir[dirAccessor] === targetDir[dirAccessorOpposite];
1258
+ const sourceGtTargetOppo = sourceGapped[dirAccessorOpposite] > targetGapped[dirAccessorOpposite];
1259
+ const sourceLtTargetOppo = sourceGapped[dirAccessorOpposite] < targetGapped[dirAccessorOpposite];
1260
+ const flipSourceTarget = (sourceDir[dirAccessor] === 1 && ((!isSameDir && sourceGtTargetOppo) || (isSameDir && sourceLtTargetOppo))) ||
1261
+ (sourceDir[dirAccessor] !== 1 && ((!isSameDir && sourceLtTargetOppo) || (isSameDir && sourceGtTargetOppo)));
1262
+ if (flipSourceTarget) {
1263
+ points = dirAccessor === 'x' ? sourceTarget : targetSource;
1264
+ }
1265
+ }
1266
+ const sourceGapPoint = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };
1267
+ const targetGapPoint = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };
1268
+ const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x));
1269
+ const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y));
1270
+ // we want to place the label on the longest segment of the edge
1271
+ if (maxXDistance >= maxYDistance) {
1272
+ centerX = (sourceGapPoint.x + targetGapPoint.x) / 2;
1273
+ centerY = points[0].y;
1274
+ }
1275
+ else {
1276
+ centerX = points[0].x;
1277
+ centerY = (sourceGapPoint.y + targetGapPoint.y) / 2;
1278
+ }
1279
+ }
1280
+ const gappedSource = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };
1281
+ const gappedTarget = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };
1282
+ const pathPoints = [
1283
+ source,
1284
+ // we only want to add the gapped source/target if they are different from the first/last point to avoid duplicates which can cause issues with the bends
1285
+ ...(gappedSource.x !== points[0].x || gappedSource.y !== points[0].y ? [gappedSource] : []),
1286
+ ...points,
1287
+ ...(gappedTarget.x !== points[points.length - 1].x || gappedTarget.y !== points[points.length - 1].y
1288
+ ? [gappedTarget]
1289
+ : []),
1290
+ target,
1291
+ ];
1292
+ return [pathPoints, centerX, centerY, defaultOffsetX, defaultOffsetY];
1293
+ }
1294
+ function getBend(a, b, c, size) {
1295
+ const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size);
1296
+ const { x, y } = b;
1297
+ // no bend
1298
+ if ((a.x === x && x === c.x) || (a.y === y && y === c.y)) {
1299
+ return `L${x} ${y}`;
1300
+ }
1301
+ // first segment is horizontal
1302
+ if (a.y === y) {
1303
+ const xDir = a.x < c.x ? -1 : 1;
1304
+ const yDir = a.y < c.y ? 1 : -1;
1305
+ return `L ${x + bendSize * xDir},${y}Q ${x},${y} ${x},${y + bendSize * yDir}`;
1306
+ }
1307
+ const xDir = a.x < c.x ? 1 : -1;
1308
+ const yDir = a.y < c.y ? -1 : 1;
1309
+ return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`;
1310
+ }
1311
+ /**
1312
+ * The `getSmoothStepPath` util returns everything you need to render a stepped path
1313
+ * between two nodes. The `borderRadius` property can be used to choose how rounded
1314
+ * the corners of those steps are.
1315
+ * @public
1316
+ * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)
1317
+ * and `offsetX`, `offsetY` between source handle and label.
1318
+ *
1319
+ * - `path`: the path to use in an SVG `<path>` element.
1320
+ * - `labelX`: the `x` position you can use to render a label for this edge.
1321
+ * - `labelY`: the `y` position you can use to render a label for this edge.
1322
+ * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the
1323
+ * middle of this path.
1324
+ * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the
1325
+ * middle of this path.
1326
+ * @example
1327
+ * ```js
1328
+ * const source = { x: 0, y: 20 };
1329
+ * const target = { x: 150, y: 100 };
1330
+ *
1331
+ * const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({
1332
+ * sourceX: source.x,
1333
+ * sourceY: source.y,
1334
+ * sourcePosition: Position.Right,
1335
+ * targetX: target.x,
1336
+ * targetY: target.y,
1337
+ * targetPosition: Position.Left,
1338
+ * });
1339
+ * ```
1340
+ * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.
1341
+ */
1342
+ function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius = 5, centerX, centerY, offset = 20, stepPosition = 0.5, }) {
1343
+ const [points, labelX, labelY, offsetX, offsetY] = getPoints({
1344
+ source: { x: sourceX, y: sourceY },
1345
+ sourcePosition,
1346
+ target: { x: targetX, y: targetY },
1347
+ targetPosition,
1348
+ center: { x: centerX, y: centerY },
1349
+ offset,
1350
+ stepPosition,
1351
+ });
1352
+ let path = `M${points[0].x} ${points[0].y}`;
1353
+ for (let i = 1; i < points.length - 1; i++) {
1354
+ path += getBend(points[i - 1], points[i], points[i + 1], borderRadius);
1355
+ }
1356
+ path += `L${points[points.length - 1].x} ${points[points.length - 1].y}`;
1357
+ return [path, labelX, labelY, offsetX, offsetY];
1358
+ }
1359
+
1360
+ function isNodeInitialized(node) {
1361
+ return (node &&
1362
+ !!(node.internals.handleBounds || node.handles?.length) &&
1363
+ !!(node.measured.width || node.width || node.initialWidth));
1364
+ }
1365
+ function getEdgePosition(params) {
1366
+ const { sourceNode, targetNode } = params;
1367
+ if (!isNodeInitialized(sourceNode) || !isNodeInitialized(targetNode)) {
1368
+ return null;
1369
+ }
1370
+ const sourceHandleBounds = sourceNode.internals.handleBounds || toHandleBounds(sourceNode.handles);
1371
+ const targetHandleBounds = targetNode.internals.handleBounds || toHandleBounds(targetNode.handles);
1372
+ const sourceHandle = getHandle$1(sourceHandleBounds?.source ?? [], params.sourceHandle);
1373
+ const targetHandle = getHandle$1(
1374
+ // when connection type is loose we can define all handles as sources and connect source -> source
1375
+ params.connectionMode === ConnectionMode.Strict
1376
+ ? targetHandleBounds?.target ?? []
1377
+ : (targetHandleBounds?.target ?? []).concat(targetHandleBounds?.source ?? []), params.targetHandle);
1378
+ if (!sourceHandle || !targetHandle) {
1379
+ params.onError?.('008', errorMessages['error008'](!sourceHandle ? 'source' : 'target', {
1380
+ id: params.id,
1381
+ sourceHandle: params.sourceHandle,
1382
+ targetHandle: params.targetHandle,
1383
+ }));
1384
+ return null;
1385
+ }
1386
+ const sourcePosition = sourceHandle?.position || Position.Bottom;
1387
+ const targetPosition = targetHandle?.position || Position.Top;
1388
+ const source = getHandlePosition(sourceNode, sourceHandle, sourcePosition);
1389
+ const target = getHandlePosition(targetNode, targetHandle, targetPosition);
1390
+ return {
1391
+ sourceX: source.x,
1392
+ sourceY: source.y,
1393
+ targetX: target.x,
1394
+ targetY: target.y,
1395
+ sourcePosition,
1396
+ targetPosition,
1397
+ };
1398
+ }
1399
+ function toHandleBounds(handles) {
1400
+ if (!handles) {
1401
+ return null;
1402
+ }
1403
+ const source = [];
1404
+ const target = [];
1405
+ for (const handle of handles) {
1406
+ handle.width = handle.width ?? 1;
1407
+ handle.height = handle.height ?? 1;
1408
+ if (handle.type === 'source') {
1409
+ source.push(handle);
1410
+ }
1411
+ else if (handle.type === 'target') {
1412
+ target.push(handle);
1413
+ }
1414
+ }
1415
+ return {
1416
+ source,
1417
+ target,
1418
+ };
1419
+ }
1420
+ function getHandlePosition(node, handle, fallbackPosition = Position.Left, center = false) {
1421
+ const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x;
1422
+ const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y;
1423
+ const { width, height } = handle ?? getNodeDimensions(node);
1424
+ if (center) {
1425
+ return { x: x + width / 2, y: y + height / 2 };
1426
+ }
1427
+ const position = handle?.position ?? fallbackPosition;
1428
+ switch (position) {
1429
+ case Position.Top:
1430
+ return { x: x + width / 2, y };
1431
+ case Position.Right:
1432
+ return { x: x + width, y: y + height / 2 };
1433
+ case Position.Bottom:
1434
+ return { x: x + width / 2, y: y + height };
1435
+ case Position.Left:
1436
+ return { x, y: y + height / 2 };
1437
+ }
1438
+ }
1439
+ function getHandle$1(bounds, handleId) {
1440
+ if (!bounds) {
1441
+ return null;
1442
+ }
1443
+ // if no handleId is given, we use the first handle, otherwise we check for the id
1444
+ return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null;
1445
+ }
1446
+
1447
+ function getMarkerId(marker, id) {
1448
+ if (!marker) {
1449
+ return '';
1450
+ }
1451
+ if (typeof marker === 'string') {
1452
+ return marker;
1453
+ }
1454
+ const idPrefix = id ? `${id}__` : '';
1455
+ return `${idPrefix}${Object.keys(marker)
1456
+ .sort()
1457
+ .map((key) => `${key}=${marker[key]}`)
1458
+ .join('&')}`;
1459
+ }
1460
+ function createMarkerIds(edges, { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }) {
1461
+ const ids = new Set();
1462
+ return edges
1463
+ .reduce((markers, edge) => {
1464
+ [edge.markerStart || defaultMarkerStart, edge.markerEnd || defaultMarkerEnd].forEach((marker) => {
1465
+ if (marker && typeof marker === 'object') {
1466
+ const markerId = getMarkerId(marker, id);
1467
+ if (!ids.has(markerId)) {
1468
+ markers.push({ id: markerId, color: marker.color || defaultColor, ...marker });
1469
+ ids.add(markerId);
1470
+ }
1471
+ }
1472
+ });
1473
+ return markers;
1474
+ }, [])
1475
+ .sort((a, b) => a.id.localeCompare(b.id));
1476
+ }
1477
+
1478
+ function getNodeToolbarTransform(nodeRect, viewport, position, offset, align) {
1479
+ let alignmentOffset = 0.5;
1480
+ if (align === 'start') {
1481
+ alignmentOffset = 0;
1482
+ }
1483
+ else if (align === 'end') {
1484
+ alignmentOffset = 1;
1485
+ }
1486
+ /*
1487
+ * position === Position.Top
1488
+ * we set the x any y position of the toolbar based on the nodes position
1489
+ */
1490
+ let pos = [
1491
+ (nodeRect.x + nodeRect.width * alignmentOffset) * viewport.zoom + viewport.x,
1492
+ nodeRect.y * viewport.zoom + viewport.y - offset,
1493
+ ];
1494
+ // and than shift it based on the alignment. The shift values are in %.
1495
+ let shift = [-100 * alignmentOffset, -100];
1496
+ switch (position) {
1497
+ case Position.Right:
1498
+ pos = [
1499
+ (nodeRect.x + nodeRect.width) * viewport.zoom + viewport.x + offset,
1500
+ (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,
1501
+ ];
1502
+ shift = [0, -100 * alignmentOffset];
1503
+ break;
1504
+ case Position.Bottom:
1505
+ pos[1] = (nodeRect.y + nodeRect.height) * viewport.zoom + viewport.y + offset;
1506
+ shift[1] = 0;
1507
+ break;
1508
+ case Position.Left:
1509
+ pos = [
1510
+ nodeRect.x * viewport.zoom + viewport.x - offset,
1511
+ (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,
1512
+ ];
1513
+ shift = [-100, -100 * alignmentOffset];
1514
+ break;
1515
+ }
1516
+ return `translate(${pos[0]}px, ${pos[1]}px) translate(${shift[0]}%, ${shift[1]}%)`;
1517
+ }
1518
+
1519
+ const alignXToPercent = {
1520
+ left: 0,
1521
+ center: 50,
1522
+ right: 100,
1523
+ };
1524
+ const alignYToPercent = {
1525
+ top: 0,
1526
+ center: 50,
1527
+ bottom: 100,
1528
+ };
1529
+ function getEdgeToolbarTransform(x, y, zoom, alignX = 'center', alignY = 'center') {
1530
+ return `translate(${x}px, ${y}px) scale(${1 / zoom}) translate(${-(alignXToPercent[alignX] ?? 50)}%, ${-(alignYToPercent[alignY] ?? 50)}%)`;
1531
+ }
1532
+
1533
+ const SELECTED_NODE_Z = 1000;
1534
+ const ROOT_PARENT_Z_INCREMENT = 10;
1535
+ const defaultOptions = {
1536
+ nodeOrigin: [0, 0],
1537
+ nodeExtent: infiniteExtent,
1538
+ elevateNodesOnSelect: true,
1539
+ zIndexMode: 'basic',
1540
+ defaults: {},
1541
+ };
1542
+ const adoptUserNodesDefaultOptions = {
1543
+ ...defaultOptions,
1544
+ checkEquality: true,
1545
+ };
1546
+ function mergeObjects(base, incoming) {
1547
+ const result = { ...base };
1548
+ for (const key in incoming) {
1549
+ if (incoming[key] !== undefined) {
1550
+ // typecast is safe here, because we check for undefined
1551
+ result[key] = incoming[key];
1552
+ }
1553
+ }
1554
+ return result;
1555
+ }
1556
+ function updateAbsolutePositions(nodeLookup, parentLookup, options) {
1557
+ const _options = mergeObjects(defaultOptions, options);
1558
+ for (const node of nodeLookup.values()) {
1559
+ if (node.parentId) {
1560
+ updateChildNode(node, nodeLookup, parentLookup, _options);
1561
+ }
1562
+ else {
1563
+ const positionWithOrigin = getNodePositionWithOrigin(node, _options.nodeOrigin);
1564
+ const extent = isCoordinateExtent(node.extent) ? node.extent : _options.nodeExtent;
1565
+ const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(node));
1566
+ node.internals.positionAbsolute = clampedPosition;
1567
+ }
1568
+ }
1569
+ }
1570
+ function parseHandles(userNode, internalNode) {
1571
+ if (!userNode.handles) {
1572
+ return !userNode.measured ? undefined : internalNode?.internals.handleBounds;
1573
+ }
1574
+ const source = [];
1575
+ const target = [];
1576
+ for (const handle of userNode.handles) {
1577
+ const handleBounds = {
1578
+ id: handle.id,
1579
+ width: handle.width ?? 1,
1580
+ height: handle.height ?? 1,
1581
+ nodeId: userNode.id,
1582
+ x: handle.x,
1583
+ y: handle.y,
1584
+ position: handle.position,
1585
+ type: handle.type,
1586
+ };
1587
+ if (handle.type === 'source') {
1588
+ source.push(handleBounds);
1589
+ }
1590
+ else if (handle.type === 'target') {
1591
+ target.push(handleBounds);
1592
+ }
1593
+ }
1594
+ return {
1595
+ source,
1596
+ target,
1597
+ };
1598
+ }
1599
+ function isManualZIndexMode(zIndexMode) {
1600
+ return zIndexMode === 'manual';
1601
+ }
1602
+ function adoptUserNodes(nodes, nodeLookup, parentLookup, options = {}) {
1603
+ const _options = mergeObjects(adoptUserNodesDefaultOptions, options);
1604
+ const rootParentIndex = { i: 0 };
1605
+ const tmpLookup = new Map(nodeLookup);
1606
+ const selectedNodeZ = _options?.elevateNodesOnSelect && !isManualZIndexMode(_options.zIndexMode) ? SELECTED_NODE_Z : 0;
1607
+ let nodesInitialized = nodes.length > 0;
1608
+ let hasSelectedNodes = false;
1609
+ nodeLookup.clear();
1610
+ parentLookup.clear();
1611
+ for (const userNode of nodes) {
1612
+ let internalNode = tmpLookup.get(userNode.id);
1613
+ if (_options.checkEquality && userNode === internalNode?.internals.userNode) {
1614
+ nodeLookup.set(userNode.id, internalNode);
1615
+ }
1616
+ else {
1617
+ const positionWithOrigin = getNodePositionWithOrigin(userNode, _options.nodeOrigin);
1618
+ const extent = isCoordinateExtent(userNode.extent) ? userNode.extent : _options.nodeExtent;
1619
+ const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(userNode));
1620
+ internalNode = {
1621
+ ..._options.defaults,
1622
+ ...userNode,
1623
+ measured: {
1624
+ width: userNode.measured?.width,
1625
+ height: userNode.measured?.height,
1626
+ },
1627
+ internals: {
1628
+ positionAbsolute: clampedPosition,
1629
+ // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured
1630
+ handleBounds: parseHandles(userNode, internalNode),
1631
+ z: calculateZ(userNode, selectedNodeZ, _options.zIndexMode),
1632
+ userNode,
1633
+ },
1634
+ };
1635
+ nodeLookup.set(userNode.id, internalNode);
1636
+ }
1637
+ if ((internalNode.measured === undefined ||
1638
+ internalNode.measured.width === undefined ||
1639
+ internalNode.measured.height === undefined) &&
1640
+ !internalNode.hidden) {
1641
+ nodesInitialized = false;
1642
+ }
1643
+ if (userNode.parentId) {
1644
+ updateChildNode(internalNode, nodeLookup, parentLookup, options, rootParentIndex);
1645
+ }
1646
+ hasSelectedNodes ||= userNode.selected ?? false;
1647
+ }
1648
+ return { nodesInitialized, hasSelectedNodes };
1649
+ }
1650
+ function updateParentLookup(node, parentLookup) {
1651
+ if (!node.parentId) {
1652
+ return;
1653
+ }
1654
+ const childNodes = parentLookup.get(node.parentId);
1655
+ if (childNodes) {
1656
+ childNodes.set(node.id, node);
1657
+ }
1658
+ else {
1659
+ parentLookup.set(node.parentId, new Map([[node.id, node]]));
1660
+ }
1661
+ }
1662
+ /**
1663
+ * Updates positionAbsolute and zIndex of a child node and the parentLookup.
1664
+ */
1665
+ function updateChildNode(node, nodeLookup, parentLookup, options, rootParentIndex) {
1666
+ const { elevateNodesOnSelect, nodeOrigin, nodeExtent, zIndexMode } = mergeObjects(defaultOptions, options);
1667
+ const parentId = node.parentId;
1668
+ const parentNode = nodeLookup.get(parentId);
1669
+ if (!parentNode) {
1670
+ console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);
1671
+ return;
1672
+ }
1673
+ updateParentLookup(node, parentLookup);
1674
+ // We just want to set the rootParentIndex for the first child
1675
+ if (rootParentIndex &&
1676
+ !parentNode.parentId &&
1677
+ parentNode.internals.rootParentIndex === undefined &&
1678
+ zIndexMode === 'auto') {
1679
+ parentNode.internals.rootParentIndex = ++rootParentIndex.i;
1680
+ parentNode.internals.z = parentNode.internals.z + rootParentIndex.i * ROOT_PARENT_Z_INCREMENT;
1681
+ }
1682
+ // But we need to update rootParentIndex.i also when parent has not been updated
1683
+ if (rootParentIndex && parentNode.internals.rootParentIndex !== undefined) {
1684
+ rootParentIndex.i = parentNode.internals.rootParentIndex;
1685
+ }
1686
+ const selectedNodeZ = elevateNodesOnSelect && !isManualZIndexMode(zIndexMode) ? SELECTED_NODE_Z : 0;
1687
+ const { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ, zIndexMode);
1688
+ const { positionAbsolute } = node.internals;
1689
+ const positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y;
1690
+ if (positionChanged || z !== node.internals.z) {
1691
+ // we create a new object to mark the node as updated
1692
+ nodeLookup.set(node.id, {
1693
+ ...node,
1694
+ internals: {
1695
+ ...node.internals,
1696
+ positionAbsolute: positionChanged ? { x, y } : positionAbsolute,
1697
+ z,
1698
+ },
1699
+ });
1700
+ }
1701
+ }
1702
+ function calculateZ(node, selectedNodeZ, zIndexMode) {
1703
+ const zIndex = isNumeric(node.zIndex) ? node.zIndex : 0;
1704
+ if (isManualZIndexMode(zIndexMode)) {
1705
+ return zIndex;
1706
+ }
1707
+ return zIndex + (node.selected ? selectedNodeZ : 0);
1708
+ }
1709
+ function calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, selectedNodeZ, zIndexMode) {
1710
+ const { x: parentX, y: parentY } = parentNode.internals.positionAbsolute;
1711
+ const childDimensions = getNodeDimensions(childNode);
1712
+ const positionWithOrigin = getNodePositionWithOrigin(childNode, nodeOrigin);
1713
+ const clampedPosition = isCoordinateExtent(childNode.extent)
1714
+ ? clampPosition(positionWithOrigin, childNode.extent, childDimensions)
1715
+ : positionWithOrigin;
1716
+ let absolutePosition = clampPosition({ x: parentX + clampedPosition.x, y: parentY + clampedPosition.y }, nodeExtent, childDimensions);
1717
+ if (childNode.extent === 'parent') {
1718
+ absolutePosition = clampPositionToParent(absolutePosition, childDimensions, parentNode);
1719
+ }
1720
+ const childZ = calculateZ(childNode, selectedNodeZ, zIndexMode);
1721
+ const parentZ = parentNode.internals.z ?? 0;
1722
+ return {
1723
+ x: absolutePosition.x,
1724
+ y: absolutePosition.y,
1725
+ z: parentZ >= childZ ? parentZ + 1 : childZ,
1726
+ };
1727
+ }
1728
+ function handleExpandParent(children, nodeLookup, parentLookup, nodeOrigin = [0, 0]) {
1729
+ const changes = [];
1730
+ const parentExpansions = new Map();
1731
+ // determine the expanded rectangle the child nodes would take for each parent
1732
+ for (const child of children) {
1733
+ const parent = nodeLookup.get(child.parentId);
1734
+ if (!parent) {
1735
+ continue;
1736
+ }
1737
+ const parentRect = parentExpansions.get(child.parentId)?.expandedRect ?? nodeToRect(parent);
1738
+ const expandedRect = getBoundsOfRects(parentRect, child.rect);
1739
+ parentExpansions.set(child.parentId, { expandedRect, parent });
1740
+ }
1741
+ if (parentExpansions.size > 0) {
1742
+ parentExpansions.forEach(({ expandedRect, parent }, parentId) => {
1743
+ // determine the position & dimensions of the parent
1744
+ const positionAbsolute = parent.internals.positionAbsolute;
1745
+ const dimensions = getNodeDimensions(parent);
1746
+ const origin = parent.origin ?? nodeOrigin;
1747
+ // determine how much the parent expands in width and position
1748
+ const xChange = expandedRect.x < positionAbsolute.x ? Math.round(Math.abs(positionAbsolute.x - expandedRect.x)) : 0;
1749
+ const yChange = expandedRect.y < positionAbsolute.y ? Math.round(Math.abs(positionAbsolute.y - expandedRect.y)) : 0;
1750
+ const newWidth = Math.max(dimensions.width, Math.round(expandedRect.width));
1751
+ const newHeight = Math.max(dimensions.height, Math.round(expandedRect.height));
1752
+ const widthChange = (newWidth - dimensions.width) * origin[0];
1753
+ const heightChange = (newHeight - dimensions.height) * origin[1];
1754
+ // We need to correct the position of the parent node if the origin is not [0,0]
1755
+ if (xChange > 0 || yChange > 0 || widthChange || heightChange) {
1756
+ changes.push({
1757
+ id: parentId,
1758
+ type: 'position',
1759
+ position: {
1760
+ x: parent.position.x - xChange + widthChange,
1761
+ y: parent.position.y - yChange + heightChange,
1762
+ },
1763
+ });
1764
+ /*
1765
+ * We move all child nodes in the oppsite direction
1766
+ * so the x,y changes of the parent do not move the children
1767
+ */
1768
+ parentLookup.get(parentId)?.forEach((childNode) => {
1769
+ if (!children.some((child) => child.id === childNode.id)) {
1770
+ changes.push({
1771
+ id: childNode.id,
1772
+ type: 'position',
1773
+ position: {
1774
+ x: childNode.position.x + xChange,
1775
+ y: childNode.position.y + yChange,
1776
+ },
1777
+ });
1778
+ }
1779
+ });
1780
+ }
1781
+ // We need to correct the dimensions of the parent node if the origin is not [0,0]
1782
+ if (dimensions.width < expandedRect.width || dimensions.height < expandedRect.height || xChange || yChange) {
1783
+ changes.push({
1784
+ id: parentId,
1785
+ type: 'dimensions',
1786
+ setAttributes: true,
1787
+ dimensions: {
1788
+ width: newWidth + (xChange ? origin[0] * xChange - widthChange : 0),
1789
+ height: newHeight + (yChange ? origin[1] * yChange - heightChange : 0),
1790
+ },
1791
+ });
1792
+ }
1793
+ });
1794
+ }
1795
+ return changes;
1796
+ }
1797
+ function updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, zIndexMode) {
1798
+ const viewportNode = domNode?.querySelector('.xyflow__viewport');
1799
+ let updatedInternals = false;
1800
+ if (!viewportNode) {
1801
+ return { changes: [], updatedInternals };
1802
+ }
1803
+ const changes = [];
1804
+ const style = window.getComputedStyle(viewportNode);
1805
+ const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);
1806
+ // in this array we collect nodes, that might trigger changes (like expanding parent)
1807
+ const parentExpandChildren = [];
1808
+ for (const update of updates.values()) {
1809
+ const node = nodeLookup.get(update.id);
1810
+ if (!node) {
1811
+ continue;
1812
+ }
1813
+ if (node.hidden) {
1814
+ nodeLookup.set(node.id, {
1815
+ ...node,
1816
+ internals: {
1817
+ ...node.internals,
1818
+ handleBounds: undefined,
1819
+ },
1820
+ });
1821
+ updatedInternals = true;
1822
+ continue;
1823
+ }
1824
+ const dimensions = getDimensions(update.nodeElement);
1825
+ const dimensionChanged = node.measured.width !== dimensions.width || node.measured.height !== dimensions.height;
1826
+ const doUpdate = !!(dimensions.width &&
1827
+ dimensions.height &&
1828
+ (dimensionChanged || !node.internals.handleBounds || update.force));
1829
+ if (doUpdate) {
1830
+ const nodeBounds = update.nodeElement.getBoundingClientRect();
1831
+ const extent = isCoordinateExtent(node.extent) ? node.extent : nodeExtent;
1832
+ let { positionAbsolute } = node.internals;
1833
+ if (node.parentId && node.extent === 'parent') {
1834
+ positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, nodeLookup.get(node.parentId));
1835
+ }
1836
+ else if (extent) {
1837
+ positionAbsolute = clampPosition(positionAbsolute, extent, dimensions);
1838
+ }
1839
+ const newNode = {
1840
+ ...node,
1841
+ measured: dimensions,
1842
+ internals: {
1843
+ ...node.internals,
1844
+ positionAbsolute,
1845
+ handleBounds: {
1846
+ source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id),
1847
+ target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id),
1848
+ },
1849
+ },
1850
+ };
1851
+ nodeLookup.set(node.id, newNode);
1852
+ if (node.parentId) {
1853
+ updateChildNode(newNode, nodeLookup, parentLookup, { nodeOrigin, zIndexMode });
1854
+ }
1855
+ updatedInternals = true;
1856
+ if (dimensionChanged) {
1857
+ changes.push({
1858
+ id: node.id,
1859
+ type: 'dimensions',
1860
+ dimensions,
1861
+ });
1862
+ if (node.expandParent && node.parentId) {
1863
+ parentExpandChildren.push({
1864
+ id: node.id,
1865
+ parentId: node.parentId,
1866
+ rect: nodeToRect(newNode, nodeOrigin),
1867
+ });
1868
+ }
1869
+ }
1870
+ }
1871
+ }
1872
+ if (parentExpandChildren.length > 0) {
1873
+ const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);
1874
+ changes.push(...parentExpandChanges);
1875
+ }
1876
+ return { changes, updatedInternals };
1877
+ }
1878
+ async function panBy({ delta, panZoom, transform, translateExtent, width, height, }) {
1879
+ if (!panZoom || (!delta.x && !delta.y)) {
1880
+ return Promise.resolve(false);
1881
+ }
1882
+ const nextViewport = await panZoom.setViewportConstrained({
1883
+ x: transform[0] + delta.x,
1884
+ y: transform[1] + delta.y,
1885
+ zoom: transform[2],
1886
+ }, [
1887
+ [0, 0],
1888
+ [width, height],
1889
+ ], translateExtent);
1890
+ const transformChanged = !!nextViewport &&
1891
+ (nextViewport.x !== transform[0] || nextViewport.y !== transform[1] || nextViewport.k !== transform[2]);
1892
+ return Promise.resolve(transformChanged);
1893
+ }
1894
+ /**
1895
+ * this function adds the connection to the connectionLookup
1896
+ * at the following keys: nodeId-type-handleId, nodeId-type and nodeId
1897
+ * @param type type of the connection
1898
+ * @param connection connection that should be added to the lookup
1899
+ * @param connectionKey at which key the connection should be added
1900
+ * @param connectionLookup reference to the connection lookup
1901
+ * @param nodeId nodeId of the connection
1902
+ * @param handleId handleId of the connection
1903
+ */
1904
+ function addConnectionToLookup(type, connection, connectionKey, connectionLookup, nodeId, handleId) {
1905
+ /*
1906
+ * We add the connection to the connectionLookup at the following keys
1907
+ * 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId
1908
+ * If the key already exists, we add the connection to the existing map
1909
+ */
1910
+ let key = nodeId;
1911
+ const nodeMap = connectionLookup.get(key) || new Map();
1912
+ connectionLookup.set(key, nodeMap.set(connectionKey, connection));
1913
+ key = `${nodeId}-${type}`;
1914
+ const typeMap = connectionLookup.get(key) || new Map();
1915
+ connectionLookup.set(key, typeMap.set(connectionKey, connection));
1916
+ if (handleId) {
1917
+ key = `${nodeId}-${type}-${handleId}`;
1918
+ const handleMap = connectionLookup.get(key) || new Map();
1919
+ connectionLookup.set(key, handleMap.set(connectionKey, connection));
1920
+ }
1921
+ }
1922
+ function updateConnectionLookup(connectionLookup, edgeLookup, edges) {
1923
+ connectionLookup.clear();
1924
+ edgeLookup.clear();
1925
+ for (const edge of edges) {
1926
+ const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge;
1927
+ const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle };
1928
+ const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`;
1929
+ const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`;
1930
+ addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle);
1931
+ addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle);
1932
+ edgeLookup.set(edge.id, edge);
1933
+ }
1934
+ }
1935
+
1936
+ function shallowNodeData(a, b) {
1937
+ if (a === null || b === null) {
1938
+ return false;
1939
+ }
1940
+ const _a = Array.isArray(a) ? a : [a];
1941
+ const _b = Array.isArray(b) ? b : [b];
1942
+ if (_a.length !== _b.length) {
1943
+ return false;
1944
+ }
1945
+ for (let i = 0; i < _a.length; i++) {
1946
+ if (_a[i].id !== _b[i].id || _a[i].type !== _b[i].type || !Object.is(_a[i].data, _b[i].data)) {
1947
+ return false;
1948
+ }
1949
+ }
1950
+ return true;
1951
+ }
1952
+
1953
+ function isParentSelected(node, nodeLookup) {
1954
+ if (!node.parentId) {
1955
+ return false;
1956
+ }
1957
+ const parentNode = nodeLookup.get(node.parentId);
1958
+ if (!parentNode) {
1959
+ return false;
1960
+ }
1961
+ if (parentNode.selected) {
1962
+ return true;
1963
+ }
1964
+ return isParentSelected(parentNode, nodeLookup);
1965
+ }
1966
+ function hasSelector(target, selector, domNode) {
1967
+ let current = target;
1968
+ do {
1969
+ if (current?.matches?.(selector))
1970
+ return true;
1971
+ if (current === domNode)
1972
+ return false;
1973
+ current = current?.parentElement;
1974
+ } while (current);
1975
+ return false;
1976
+ }
1977
+ // looks for all selected nodes and created a NodeDragItem for each of them
1978
+ function getDragItems(nodeLookup, nodesDraggable, mousePos, nodeId) {
1979
+ const dragItems = new Map();
1980
+ for (const [id, node] of nodeLookup) {
1981
+ if ((node.selected || node.id === nodeId) &&
1982
+ (!node.parentId || !isParentSelected(node, nodeLookup)) &&
1983
+ (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'))) {
1984
+ const internalNode = nodeLookup.get(id);
1985
+ if (internalNode) {
1986
+ dragItems.set(id, {
1987
+ id,
1988
+ position: internalNode.position || { x: 0, y: 0 },
1989
+ distance: {
1990
+ x: mousePos.x - internalNode.internals.positionAbsolute.x,
1991
+ y: mousePos.y - internalNode.internals.positionAbsolute.y,
1992
+ },
1993
+ extent: internalNode.extent,
1994
+ parentId: internalNode.parentId,
1995
+ origin: internalNode.origin,
1996
+ expandParent: internalNode.expandParent,
1997
+ internals: {
1998
+ positionAbsolute: internalNode.internals.positionAbsolute || { x: 0, y: 0 },
1999
+ },
2000
+ measured: {
2001
+ width: internalNode.measured.width ?? 0,
2002
+ height: internalNode.measured.height ?? 0,
2003
+ },
2004
+ });
2005
+ }
2006
+ }
2007
+ }
2008
+ return dragItems;
2009
+ }
2010
+ /*
2011
+ * returns two params:
2012
+ * 1. the dragged node (or the first of the list, if we are dragging a node selection)
2013
+ * 2. array of selected nodes (for multi selections)
2014
+ */
2015
+ function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true, }) {
2016
+ const nodesFromDragItems = [];
2017
+ for (const [id, dragItem] of dragItems) {
2018
+ const node = nodeLookup.get(id)?.internals.userNode;
2019
+ if (node) {
2020
+ nodesFromDragItems.push({
2021
+ ...node,
2022
+ position: dragItem.position,
2023
+ dragging,
2024
+ });
2025
+ }
2026
+ }
2027
+ if (!nodeId) {
2028
+ return [nodesFromDragItems[0], nodesFromDragItems];
2029
+ }
2030
+ const node = nodeLookup.get(nodeId)?.internals.userNode;
2031
+ return [
2032
+ !node
2033
+ ? nodesFromDragItems[0]
2034
+ : {
2035
+ ...node,
2036
+ position: dragItems.get(nodeId)?.position || node.position,
2037
+ dragging,
2038
+ },
2039
+ nodesFromDragItems,
2040
+ ];
2041
+ }
2042
+ /**
2043
+ * If a selection is being dragged we want to apply the same snap offset to all nodes in the selection.
2044
+ * This function calculates the snap offset based on the first node in the selection.
2045
+ */
2046
+ function calculateSnapOffset({ dragItems, snapGrid, x, y, }) {
2047
+ const refDragItem = dragItems.values().next().value;
2048
+ if (!refDragItem) {
2049
+ return null;
2050
+ }
2051
+ const refPos = {
2052
+ x: x - refDragItem.distance.x,
2053
+ y: y - refDragItem.distance.y,
2054
+ };
2055
+ const refPosSnapped = snapPosition(refPos, snapGrid);
2056
+ return {
2057
+ x: refPosSnapped.x - refPos.x,
2058
+ y: refPosSnapped.y - refPos.y,
2059
+ };
2060
+ }
2061
+
2062
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2063
+ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) {
2064
+ let lastPos = { x: null, y: null };
2065
+ let autoPanId = 0;
2066
+ let dragItems = new Map();
2067
+ let autoPanStarted = false;
2068
+ let mousePosition = { x: 0, y: 0 };
2069
+ let containerBounds = null;
2070
+ let dragStarted = false;
2071
+ let d3Selection = null;
2072
+ let abortDrag = false; // prevents unintentional dragging on multitouch
2073
+ let nodePositionsChanged = false;
2074
+ // we store the last drag event to be able to use it in the update function
2075
+ let dragEvent = null;
2076
+ // public functions
2077
+ function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {
2078
+ d3Selection = select(domNode);
2079
+ function updateNodes({ x, y }) {
2080
+ const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();
2081
+ lastPos = { x, y };
2082
+ let hasChange = false;
2083
+ const isMultiDrag = dragItems.size > 1;
2084
+ const nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null;
2085
+ const multiDragSnapOffset = isMultiDrag && snapToGrid
2086
+ ? calculateSnapOffset({
2087
+ dragItems,
2088
+ snapGrid,
2089
+ x,
2090
+ y,
2091
+ })
2092
+ : null;
2093
+ for (const [id, dragItem] of dragItems) {
2094
+ /*
2095
+ * if the node is not in the nodeLookup anymore, it was probably deleted while dragging
2096
+ */
2097
+ if (!nodeLookup.has(id)) {
2098
+ continue;
2099
+ }
2100
+ let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };
2101
+ if (snapToGrid) {
2102
+ nextPosition = multiDragSnapOffset
2103
+ ? {
2104
+ x: Math.round(nextPosition.x + multiDragSnapOffset.x),
2105
+ y: Math.round(nextPosition.y + multiDragSnapOffset.y),
2106
+ }
2107
+ : snapPosition(nextPosition, snapGrid);
2108
+ }
2109
+ let adjustedNodeExtent = null;
2110
+ if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {
2111
+ const { positionAbsolute } = dragItem.internals;
2112
+ const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0];
2113
+ const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0];
2114
+ const y1 = positionAbsolute.y - nodesBox.y + nodeExtent[0][1];
2115
+ const y2 = positionAbsolute.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1];
2116
+ adjustedNodeExtent = [
2117
+ [x1, y1],
2118
+ [x2, y2],
2119
+ ];
2120
+ }
2121
+ const { position, positionAbsolute } = calculateNodePosition({
2122
+ nodeId: id,
2123
+ nextPosition,
2124
+ nodeLookup,
2125
+ nodeExtent: adjustedNodeExtent ? adjustedNodeExtent : nodeExtent,
2126
+ nodeOrigin,
2127
+ onError,
2128
+ });
2129
+ // we want to make sure that we only fire a change event when there is a change
2130
+ hasChange = hasChange || dragItem.position.x !== position.x || dragItem.position.y !== position.y;
2131
+ dragItem.position = position;
2132
+ dragItem.internals.positionAbsolute = positionAbsolute;
2133
+ }
2134
+ nodePositionsChanged = nodePositionsChanged || hasChange;
2135
+ if (!hasChange) {
2136
+ return;
2137
+ }
2138
+ updateNodePositions(dragItems, true);
2139
+ if (dragEvent && (onDrag || onNodeDrag || (!nodeId && onSelectionDrag))) {
2140
+ const [currentNode, currentNodes] = getEventHandlerParams({
2141
+ nodeId,
2142
+ dragItems,
2143
+ nodeLookup,
2144
+ });
2145
+ onDrag?.(dragEvent, dragItems, currentNode, currentNodes);
2146
+ onNodeDrag?.(dragEvent, currentNode, currentNodes);
2147
+ if (!nodeId) {
2148
+ onSelectionDrag?.(dragEvent, currentNodes);
2149
+ }
2150
+ }
2151
+ }
2152
+ async function autoPan() {
2153
+ if (!containerBounds) {
2154
+ return;
2155
+ }
2156
+ const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems();
2157
+ if (!autoPanOnNodeDrag) {
2158
+ autoPanStarted = false;
2159
+ cancelAnimationFrame(autoPanId);
2160
+ return;
2161
+ }
2162
+ const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);
2163
+ if (xMovement !== 0 || yMovement !== 0) {
2164
+ lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2];
2165
+ lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2];
2166
+ if (await panBy({ x: xMovement, y: yMovement })) {
2167
+ updateNodes(lastPos);
2168
+ }
2169
+ }
2170
+ autoPanId = requestAnimationFrame(autoPan);
2171
+ }
2172
+ function startDrag(event) {
2173
+ const { nodeLookup, multiSelectionActive, nodesDraggable, transform, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges, } = getStoreItems();
2174
+ dragStarted = true;
2175
+ if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) {
2176
+ if (!nodeLookup.get(nodeId)?.selected) {
2177
+ // we need to reset selected nodes when selectNodesOnDrag=false
2178
+ unselectNodesAndEdges();
2179
+ }
2180
+ }
2181
+ if (isSelectable && selectNodesOnDrag && nodeId) {
2182
+ onNodeMouseDown?.(nodeId);
2183
+ }
2184
+ const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });
2185
+ lastPos = pointerPos;
2186
+ dragItems = getDragItems(nodeLookup, nodesDraggable, pointerPos, nodeId);
2187
+ if (dragItems.size > 0 && (onDragStart || onNodeDragStart || (!nodeId && onSelectionDragStart))) {
2188
+ const [currentNode, currentNodes] = getEventHandlerParams({
2189
+ nodeId,
2190
+ dragItems,
2191
+ nodeLookup,
2192
+ });
2193
+ onDragStart?.(event.sourceEvent, dragItems, currentNode, currentNodes);
2194
+ onNodeDragStart?.(event.sourceEvent, currentNode, currentNodes);
2195
+ if (!nodeId) {
2196
+ onSelectionDragStart?.(event.sourceEvent, currentNodes);
2197
+ }
2198
+ }
2199
+ }
2200
+ const d3DragInstance = drag()
2201
+ .clickDistance(nodeClickDistance)
2202
+ .on('start', (event) => {
2203
+ const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems();
2204
+ containerBounds = domNode?.getBoundingClientRect() || null;
2205
+ abortDrag = false;
2206
+ nodePositionsChanged = false;
2207
+ dragEvent = event.sourceEvent;
2208
+ if (nodeDragThreshold === 0) {
2209
+ startDrag(event);
2210
+ }
2211
+ const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });
2212
+ lastPos = pointerPos;
2213
+ mousePosition = getEventPosition(event.sourceEvent, containerBounds);
2214
+ })
2215
+ .on('drag', (event) => {
2216
+ const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems();
2217
+ const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });
2218
+ dragEvent = event.sourceEvent;
2219
+ if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) ||
2220
+ // if user deletes a node while dragging, we need to abort the drag to prevent errors
2221
+ (nodeId && !nodeLookup.has(nodeId))) {
2222
+ abortDrag = true;
2223
+ }
2224
+ if (abortDrag) {
2225
+ return;
2226
+ }
2227
+ if (!autoPanStarted && autoPanOnNodeDrag && dragStarted) {
2228
+ autoPanStarted = true;
2229
+ autoPan();
2230
+ }
2231
+ if (!dragStarted) {
2232
+ // Calculate distance in client coordinates for consistent drag threshold behavior across zoom levels
2233
+ const currentMousePosition = getEventPosition(event.sourceEvent, containerBounds);
2234
+ const x = currentMousePosition.x - mousePosition.x;
2235
+ const y = currentMousePosition.y - mousePosition.y;
2236
+ const distance = Math.sqrt(x * x + y * y);
2237
+ if (distance > nodeDragThreshold) {
2238
+ startDrag(event);
2239
+ }
2240
+ }
2241
+ // skip events without movement
2242
+ if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) {
2243
+ mousePosition = getEventPosition(event.sourceEvent, containerBounds);
2244
+ updateNodes(pointerPos);
2245
+ }
2246
+ })
2247
+ .on('end', (event) => {
2248
+ if (!dragStarted || abortDrag) {
2249
+ return;
2250
+ }
2251
+ autoPanStarted = false;
2252
+ dragStarted = false;
2253
+ cancelAnimationFrame(autoPanId);
2254
+ if (dragItems.size > 0) {
2255
+ const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems();
2256
+ if (nodePositionsChanged) {
2257
+ updateNodePositions(dragItems, false);
2258
+ nodePositionsChanged = false;
2259
+ }
2260
+ if (onDragStop || onNodeDragStop || (!nodeId && onSelectionDragStop)) {
2261
+ const [currentNode, currentNodes] = getEventHandlerParams({
2262
+ nodeId,
2263
+ dragItems,
2264
+ nodeLookup,
2265
+ dragging: false,
2266
+ });
2267
+ onDragStop?.(event.sourceEvent, dragItems, currentNode, currentNodes);
2268
+ onNodeDragStop?.(event.sourceEvent, currentNode, currentNodes);
2269
+ if (!nodeId) {
2270
+ onSelectionDragStop?.(event.sourceEvent, currentNodes);
2271
+ }
2272
+ }
2273
+ }
2274
+ })
2275
+ .filter((event) => {
2276
+ const target = event.target;
2277
+ const isDraggable = !event.button &&
2278
+ (!noDragClassName || !hasSelector(target, `.${noDragClassName}`, domNode)) &&
2279
+ (!handleSelector || hasSelector(target, handleSelector, domNode));
2280
+ return isDraggable;
2281
+ });
2282
+ d3Selection.call(d3DragInstance);
2283
+ }
2284
+ function destroy() {
2285
+ d3Selection?.on('.drag', null);
2286
+ }
2287
+ return {
2288
+ update,
2289
+ destroy,
2290
+ };
2291
+ }
2292
+
2293
+ function getNodesWithinDistance(position, nodeLookup, distance) {
2294
+ const nodes = [];
2295
+ const rect = {
2296
+ x: position.x - distance,
2297
+ y: position.y - distance,
2298
+ width: distance * 2,
2299
+ height: distance * 2,
2300
+ };
2301
+ for (const node of nodeLookup.values()) {
2302
+ if (getOverlappingArea(rect, nodeToRect(node)) > 0) {
2303
+ nodes.push(node);
2304
+ }
2305
+ }
2306
+ return nodes;
2307
+ }
2308
+ /*
2309
+ * this distance is used for the area around the user pointer
2310
+ * while doing a connection for finding the closest nodes
2311
+ */
2312
+ const ADDITIONAL_DISTANCE = 250;
2313
+ function getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {
2314
+ let closestHandles = [];
2315
+ let minDistance = Infinity;
2316
+ const closeNodes = getNodesWithinDistance(position, nodeLookup, connectionRadius + ADDITIONAL_DISTANCE);
2317
+ for (const node of closeNodes) {
2318
+ const allHandles = [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];
2319
+ for (const handle of allHandles) {
2320
+ // if the handle is the same as the fromHandle we skip it
2321
+ if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id) {
2322
+ continue;
2323
+ }
2324
+ // determine absolute position of the handle
2325
+ const { x, y } = getHandlePosition(node, handle, handle.position, true);
2326
+ const distance = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2));
2327
+ if (distance > connectionRadius) {
2328
+ continue;
2329
+ }
2330
+ if (distance < minDistance) {
2331
+ closestHandles = [{ ...handle, x, y }];
2332
+ minDistance = distance;
2333
+ }
2334
+ else if (distance === minDistance) {
2335
+ // when multiple handles are on the same distance we collect all of them
2336
+ closestHandles.push({ ...handle, x, y });
2337
+ }
2338
+ }
2339
+ }
2340
+ if (!closestHandles.length) {
2341
+ return null;
2342
+ }
2343
+ // when multiple handles overlay each other we prefer the opposite handle
2344
+ if (closestHandles.length > 1) {
2345
+ const oppositeHandleType = fromHandle.type === 'source' ? 'target' : 'source';
2346
+ return closestHandles.find((handle) => handle.type === oppositeHandleType) ?? closestHandles[0];
2347
+ }
2348
+ return closestHandles[0];
2349
+ }
2350
+ function getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode, withAbsolutePosition = false) {
2351
+ const node = nodeLookup.get(nodeId);
2352
+ if (!node) {
2353
+ return null;
2354
+ }
2355
+ const handles = connectionMode === 'strict'
2356
+ ? node.internals.handleBounds?.[handleType]
2357
+ : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];
2358
+ const handle = (handleId ? handles?.find((h) => h.id === handleId) : handles?.[0]) ?? null;
2359
+ return handle && withAbsolutePosition
2360
+ ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) }
2361
+ : handle;
2362
+ }
2363
+ function getHandleType(edgeUpdaterType, handleDomNode) {
2364
+ if (edgeUpdaterType) {
2365
+ return edgeUpdaterType;
2366
+ }
2367
+ else if (handleDomNode?.classList.contains('target')) {
2368
+ return 'target';
2369
+ }
2370
+ else if (handleDomNode?.classList.contains('source')) {
2371
+ return 'source';
2372
+ }
2373
+ return null;
2374
+ }
2375
+ function isConnectionValid(isInsideConnectionRadius, isHandleValid) {
2376
+ let isValid = null;
2377
+ if (isHandleValid) {
2378
+ isValid = true;
2379
+ }
2380
+ else if (isInsideConnectionRadius && !isHandleValid) {
2381
+ isValid = false;
2382
+ }
2383
+ return isValid;
2384
+ }
2385
+
2386
+ const alwaysValid = () => true;
2387
+ function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode, }) {
2388
+ // when xyflow is used inside a shadow root we can't use document
2389
+ const doc = getHostForElement(event.target);
2390
+ let autoPanId = 0;
2391
+ let closestHandle;
2392
+ const { x, y } = getEventPosition(event);
2393
+ const handleType = getHandleType(edgeUpdaterType, handleDomNode);
2394
+ const containerBounds = domNode?.getBoundingClientRect();
2395
+ let connectionStarted = false;
2396
+ if (!containerBounds || !handleType) {
2397
+ return;
2398
+ }
2399
+ const fromHandleInternal = getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode);
2400
+ if (!fromHandleInternal) {
2401
+ return;
2402
+ }
2403
+ let position = getEventPosition(event, containerBounds);
2404
+ let autoPanStarted = false;
2405
+ let connection = null;
2406
+ let isValid = false;
2407
+ let resultHandleDomNode = null;
2408
+ // when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas
2409
+ function autoPan() {
2410
+ if (!autoPanOnConnect || !containerBounds) {
2411
+ return;
2412
+ }
2413
+ const [x, y] = calcAutoPan(position, containerBounds, autoPanSpeed);
2414
+ panBy({ x, y });
2415
+ autoPanId = requestAnimationFrame(autoPan);
2416
+ }
2417
+ // Stays the same for all consecutive pointermove events
2418
+ const fromHandle = {
2419
+ ...fromHandleInternal,
2420
+ nodeId,
2421
+ type: handleType,
2422
+ position: fromHandleInternal.position,
2423
+ };
2424
+ const fromInternalNode = nodeLookup.get(nodeId);
2425
+ const from = getHandlePosition(fromInternalNode, fromHandle, Position.Left, true);
2426
+ let previousConnection = {
2427
+ inProgress: true,
2428
+ isValid: null,
2429
+ from,
2430
+ fromHandle,
2431
+ fromPosition: fromHandle.position,
2432
+ fromNode: fromInternalNode,
2433
+ to: position,
2434
+ toHandle: null,
2435
+ toPosition: oppositePosition[fromHandle.position],
2436
+ toNode: null,
2437
+ pointer: position,
2438
+ };
2439
+ function startConnection() {
2440
+ connectionStarted = true;
2441
+ updateConnection(previousConnection);
2442
+ onConnectStart?.(event, { nodeId, handleId, handleType });
2443
+ }
2444
+ if (dragThreshold === 0) {
2445
+ startConnection();
2446
+ }
2447
+ function onPointerMove(event) {
2448
+ if (!connectionStarted) {
2449
+ const { x: evtX, y: evtY } = getEventPosition(event);
2450
+ const dx = evtX - x;
2451
+ const dy = evtY - y;
2452
+ const nextConnectionStarted = dx * dx + dy * dy > dragThreshold * dragThreshold;
2453
+ if (!nextConnectionStarted) {
2454
+ return;
2455
+ }
2456
+ startConnection();
2457
+ }
2458
+ if (!getFromHandle() || !fromHandle) {
2459
+ onPointerUp(event);
2460
+ return;
2461
+ }
2462
+ const transform = getTransform();
2463
+ position = getEventPosition(event, containerBounds);
2464
+ closestHandle = getClosestHandle(pointToRendererPoint(position, transform, false, [1, 1]), connectionRadius, nodeLookup, fromHandle);
2465
+ if (!autoPanStarted) {
2466
+ autoPan();
2467
+ autoPanStarted = true;
2468
+ }
2469
+ const result = isValidHandle(event, {
2470
+ handle: closestHandle,
2471
+ connectionMode,
2472
+ fromNodeId: nodeId,
2473
+ fromHandleId: handleId,
2474
+ fromType: isTarget ? 'target' : 'source',
2475
+ isValidConnection,
2476
+ doc,
2477
+ lib,
2478
+ flowId,
2479
+ nodeLookup,
2480
+ });
2481
+ resultHandleDomNode = result.handleDomNode;
2482
+ connection = result.connection;
2483
+ isValid = isConnectionValid(!!closestHandle, result.isValid);
2484
+ const fromInternalNode = nodeLookup.get(nodeId);
2485
+ const from = fromInternalNode
2486
+ ? getHandlePosition(fromInternalNode, fromHandle, Position.Left, true)
2487
+ : previousConnection.from;
2488
+ const newConnection = {
2489
+ ...previousConnection,
2490
+ from,
2491
+ isValid,
2492
+ to: result.toHandle && isValid
2493
+ ? rendererPointToPoint({ x: result.toHandle.x, y: result.toHandle.y }, transform)
2494
+ : position,
2495
+ toHandle: result.toHandle,
2496
+ toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position],
2497
+ toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId) : null,
2498
+ pointer: position,
2499
+ };
2500
+ updateConnection(newConnection);
2501
+ previousConnection = newConnection;
2502
+ }
2503
+ function onPointerUp(event) {
2504
+ // Prevent multi-touch aborting connection
2505
+ if ('touches' in event && event.touches.length > 0) {
2506
+ return;
2507
+ }
2508
+ if (connectionStarted) {
2509
+ if ((closestHandle || resultHandleDomNode) && connection && isValid) {
2510
+ onConnect?.(connection);
2511
+ }
2512
+ /*
2513
+ * it's important to get a fresh reference from the store here
2514
+ * in order to get the latest state of onConnectEnd
2515
+ */
2516
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2517
+ const { inProgress, ...connectionState } = previousConnection;
2518
+ const finalConnectionState = {
2519
+ ...connectionState,
2520
+ toPosition: previousConnection.toHandle ? previousConnection.toPosition : null,
2521
+ };
2522
+ onConnectEnd?.(event, finalConnectionState);
2523
+ if (edgeUpdaterType) {
2524
+ onReconnectEnd?.(event, finalConnectionState);
2525
+ }
2526
+ }
2527
+ cancelConnection();
2528
+ cancelAnimationFrame(autoPanId);
2529
+ autoPanStarted = false;
2530
+ isValid = false;
2531
+ connection = null;
2532
+ resultHandleDomNode = null;
2533
+ doc.removeEventListener('mousemove', onPointerMove);
2534
+ doc.removeEventListener('mouseup', onPointerUp);
2535
+ doc.removeEventListener('touchmove', onPointerMove);
2536
+ doc.removeEventListener('touchend', onPointerUp);
2537
+ }
2538
+ doc.addEventListener('mousemove', onPointerMove);
2539
+ doc.addEventListener('mouseup', onPointerUp);
2540
+ doc.addEventListener('touchmove', onPointerMove);
2541
+ doc.addEventListener('touchend', onPointerUp);
2542
+ }
2543
+ // checks if and returns connection in form of an object { source: 123, target: 312 }
2544
+ function isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup, }) {
2545
+ const isTarget = fromType === 'target';
2546
+ const handleDomNode = handle
2547
+ ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`)
2548
+ : null;
2549
+ const { x, y } = getEventPosition(event);
2550
+ const handleBelow = doc.elementFromPoint(x, y);
2551
+ /*
2552
+ * we always want to prioritize the handle below the mouse cursor over the closest distance handle,
2553
+ * because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor
2554
+ */
2555
+ const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode;
2556
+ const result = {
2557
+ handleDomNode: handleToCheck,
2558
+ isValid: false,
2559
+ connection: null,
2560
+ toHandle: null,
2561
+ };
2562
+ if (handleToCheck) {
2563
+ const handleType = getHandleType(undefined, handleToCheck);
2564
+ const handleNodeId = handleToCheck.getAttribute('data-nodeid');
2565
+ const handleId = handleToCheck.getAttribute('data-handleid');
2566
+ const connectable = handleToCheck.classList.contains('connectable');
2567
+ const connectableEnd = handleToCheck.classList.contains('connectableend');
2568
+ if (!handleNodeId || !handleType) {
2569
+ return result;
2570
+ }
2571
+ const connection = {
2572
+ source: isTarget ? handleNodeId : fromNodeId,
2573
+ sourceHandle: isTarget ? handleId : fromHandleId,
2574
+ target: isTarget ? fromNodeId : handleNodeId,
2575
+ targetHandle: isTarget ? fromHandleId : handleId,
2576
+ };
2577
+ result.connection = connection;
2578
+ const isConnectable = connectable && connectableEnd;
2579
+ // in strict mode we don't allow target to target or source to source connections
2580
+ const isValid = isConnectable &&
2581
+ (connectionMode === ConnectionMode.Strict
2582
+ ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')
2583
+ : handleNodeId !== fromNodeId || handleId !== fromHandleId);
2584
+ result.isValid = isValid && isValidConnection(connection);
2585
+ result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, true);
2586
+ }
2587
+ return result;
2588
+ }
2589
+ const XYHandle = {
2590
+ onPointerDown,
2591
+ isValid: isValidHandle,
2592
+ };
2593
+
2594
+ function XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {
2595
+ const selection = select(domNode);
2596
+ function update({ translateExtent, width, height, zoomStep = 1, pannable = true, zoomable = true, inversePan = false, }) {
2597
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2598
+ const zoomHandler = (event) => {
2599
+ if (event.sourceEvent.type !== 'wheel' || !panZoom) {
2600
+ return;
2601
+ }
2602
+ const transform = getTransform();
2603
+ const factor = event.sourceEvent.ctrlKey && isMacOs() ? 10 : 1;
2604
+ const pinchDelta = -event.sourceEvent.deltaY *
2605
+ (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) *
2606
+ zoomStep;
2607
+ const nextZoom = transform[2] * Math.pow(2, pinchDelta * factor);
2608
+ panZoom.scaleTo(nextZoom);
2609
+ };
2610
+ let panStart = [0, 0];
2611
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2612
+ const panStartHandler = (event) => {
2613
+ if (event.sourceEvent.type === 'mousedown' || event.sourceEvent.type === 'touchstart') {
2614
+ panStart = [
2615
+ event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,
2616
+ event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,
2617
+ ];
2618
+ }
2619
+ };
2620
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2621
+ const panHandler = (event) => {
2622
+ const transform = getTransform();
2623
+ if ((event.sourceEvent.type !== 'mousemove' && event.sourceEvent.type !== 'touchmove') || !panZoom) {
2624
+ return;
2625
+ }
2626
+ const panCurrent = [
2627
+ event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,
2628
+ event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,
2629
+ ];
2630
+ const panDelta = [panCurrent[0] - panStart[0], panCurrent[1] - panStart[1]];
2631
+ panStart = panCurrent;
2632
+ const moveScale = getViewScale() * Math.max(transform[2], Math.log(transform[2])) * (inversePan ? -1 : 1);
2633
+ const position = {
2634
+ x: transform[0] - panDelta[0] * moveScale,
2635
+ y: transform[1] - panDelta[1] * moveScale,
2636
+ };
2637
+ const extent = [
2638
+ [0, 0],
2639
+ [width, height],
2640
+ ];
2641
+ panZoom.setViewportConstrained({
2642
+ x: position.x,
2643
+ y: position.y,
2644
+ zoom: transform[2],
2645
+ }, extent, translateExtent);
2646
+ };
2647
+ const zoomAndPanHandler = zoom()
2648
+ .on('start', panStartHandler)
2649
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2650
+ // @ts-ignore
2651
+ .on('zoom', pannable ? panHandler : null)
2652
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2653
+ // @ts-ignore
2654
+ .on('zoom.wheel', zoomable ? zoomHandler : null);
2655
+ selection.call(zoomAndPanHandler, {});
2656
+ }
2657
+ function destroy() {
2658
+ selection.on('zoom', null);
2659
+ }
2660
+ return {
2661
+ update,
2662
+ destroy,
2663
+ pointer,
2664
+ };
2665
+ }
2666
+
2667
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2668
+ const transformToViewport = (transform) => ({
2669
+ x: transform.x,
2670
+ y: transform.y,
2671
+ zoom: transform.k,
2672
+ });
2673
+ const viewportToTransform = ({ x, y, zoom }) => zoomIdentity.translate(x, y).scale(zoom);
2674
+ const isWrappedWithClass = (event, className) => event.target.closest(`.${className}`);
2675
+ const isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2);
2676
+ // taken from d3-ease: https://github.com/d3/d3-ease/blob/main/src/cubic.js
2677
+ const defaultEase = (t) => ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
2678
+ const getD3Transition = (selection, duration = 0, ease = defaultEase, onEnd = () => { }) => {
2679
+ const hasDuration = typeof duration === 'number' && duration > 0;
2680
+ if (!hasDuration) {
2681
+ onEnd();
2682
+ }
2683
+ return hasDuration ? selection.transition().duration(duration).ease(ease).on('end', onEnd) : selection;
2684
+ };
2685
+ const wheelDelta = (event) => {
2686
+ const factor = event.ctrlKey && isMacOs() ? 10 : 1;
2687
+ return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * factor;
2688
+ };
2689
+
2690
+ function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }) {
2691
+ return (event) => {
2692
+ if (isWrappedWithClass(event, noWheelClassName)) {
2693
+ if (event.ctrlKey) {
2694
+ event.preventDefault(); // stop native page zoom for pinch zooming
2695
+ }
2696
+ return false;
2697
+ }
2698
+ event.preventDefault();
2699
+ event.stopImmediatePropagation();
2700
+ const currentZoom = d3Selection.property('__zoom').k || 1;
2701
+ // macos sets ctrlKey=true for pinch gesture on a trackpad
2702
+ if (event.ctrlKey && zoomOnPinch) {
2703
+ const point = pointer(event);
2704
+ const pinchDelta = wheelDelta(event);
2705
+ const zoom = currentZoom * Math.pow(2, pinchDelta);
2706
+ // @ts-ignore
2707
+ d3Zoom.scaleTo(d3Selection, zoom, point, event);
2708
+ return;
2709
+ }
2710
+ /*
2711
+ * increase scroll speed in firefox
2712
+ * firefox: deltaMode === 1; chrome: deltaMode === 0
2713
+ */
2714
+ const deltaNormalize = event.deltaMode === 1 ? 20 : 1;
2715
+ let deltaX = panOnScrollMode === PanOnScrollMode.Vertical ? 0 : event.deltaX * deltaNormalize;
2716
+ let deltaY = panOnScrollMode === PanOnScrollMode.Horizontal ? 0 : event.deltaY * deltaNormalize;
2717
+ // this enables vertical scrolling with shift + scroll on windows
2718
+ if (!isMacOs() && event.shiftKey && panOnScrollMode !== PanOnScrollMode.Vertical) {
2719
+ deltaX = event.deltaY * deltaNormalize;
2720
+ deltaY = 0;
2721
+ }
2722
+ d3Zoom.translateBy(d3Selection, -(deltaX / currentZoom) * panOnScrollSpeed, -(deltaY / currentZoom) * panOnScrollSpeed,
2723
+ // @ts-ignore
2724
+ { internal: true });
2725
+ const nextViewport = transformToViewport(d3Selection.property('__zoom'));
2726
+ clearTimeout(zoomPanValues.panScrollTimeout);
2727
+ /*
2728
+ * for pan on scroll we need to handle the event calls on our own
2729
+ * we can't use the start, zoom and end events from d3-zoom
2730
+ * because start and move gets called on every scroll event and not once at the beginning
2731
+ */
2732
+ if (!zoomPanValues.isPanScrolling) {
2733
+ zoomPanValues.isPanScrolling = true;
2734
+ onPanZoomStart?.(event, nextViewport);
2735
+ }
2736
+ else {
2737
+ onPanZoom?.(event, nextViewport);
2738
+ zoomPanValues.panScrollTimeout = setTimeout(() => {
2739
+ onPanZoomEnd?.(event, nextViewport);
2740
+ zoomPanValues.isPanScrolling = false;
2741
+ }, 150);
2742
+ }
2743
+ };
2744
+ }
2745
+ function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {
2746
+ return function (event, d) {
2747
+ const isWheel = event.type === 'wheel';
2748
+ // we still want to enable pinch zooming even if preventScrolling is set to false
2749
+ const preventZoom = !preventScrolling && isWheel && !event.ctrlKey;
2750
+ const hasNoWheelClass = isWrappedWithClass(event, noWheelClassName);
2751
+ // if user is pinch zooming above a nowheel element, we don't want the browser to zoom
2752
+ if (event.ctrlKey && isWheel && hasNoWheelClass) {
2753
+ event.preventDefault();
2754
+ }
2755
+ if (preventZoom || hasNoWheelClass) {
2756
+ return null;
2757
+ }
2758
+ event.preventDefault();
2759
+ d3ZoomHandler.call(this, event, d);
2760
+ };
2761
+ }
2762
+ function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) {
2763
+ return (event) => {
2764
+ if (event.sourceEvent?.internal) {
2765
+ return;
2766
+ }
2767
+ const viewport = transformToViewport(event.transform);
2768
+ // we need to remember it here, because it's always 0 in the "zoom" event
2769
+ zoomPanValues.mouseButton = event.sourceEvent?.button || 0;
2770
+ zoomPanValues.isZoomingOrPanning = true;
2771
+ zoomPanValues.prevViewport = viewport;
2772
+ if (event.sourceEvent?.type === 'mousedown') {
2773
+ onDraggingChange(true);
2774
+ }
2775
+ if (onPanZoomStart) {
2776
+ onPanZoomStart?.(event.sourceEvent, viewport);
2777
+ }
2778
+ };
2779
+ }
2780
+ function createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }) {
2781
+ return (event) => {
2782
+ zoomPanValues.usedRightMouseButton = !!(onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0));
2783
+ if (!event.sourceEvent?.sync) {
2784
+ onTransformChange([event.transform.x, event.transform.y, event.transform.k]);
2785
+ }
2786
+ if (onPanZoom && !event.sourceEvent?.internal) {
2787
+ onPanZoom?.(event.sourceEvent, transformToViewport(event.transform));
2788
+ }
2789
+ };
2790
+ }
2791
+ function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }) {
2792
+ return (event) => {
2793
+ if (event.sourceEvent?.internal) {
2794
+ return;
2795
+ }
2796
+ zoomPanValues.isZoomingOrPanning = false;
2797
+ if (onPaneContextMenu &&
2798
+ isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) &&
2799
+ !zoomPanValues.usedRightMouseButton &&
2800
+ event.sourceEvent) {
2801
+ onPaneContextMenu(event.sourceEvent);
2802
+ }
2803
+ zoomPanValues.usedRightMouseButton = false;
2804
+ onDraggingChange(false);
2805
+ if (onPanZoomEnd) {
2806
+ const viewport = transformToViewport(event.transform);
2807
+ zoomPanValues.prevViewport = viewport;
2808
+ clearTimeout(zoomPanValues.timerId);
2809
+ zoomPanValues.timerId = setTimeout(() => {
2810
+ onPanZoomEnd?.(event.sourceEvent, viewport);
2811
+ },
2812
+ // we need a setTimeout for panOnScroll to suppress multiple end events fired during scroll
2813
+ panOnScroll ? 150 : 0);
2814
+ }
2815
+ };
2816
+ }
2817
+
2818
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2819
+ function createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, connectionInProgress, }) {
2820
+ return (event) => {
2821
+ const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;
2822
+ const pinchZoom = zoomOnPinch && event.ctrlKey;
2823
+ const isWheelEvent = event.type === 'wheel';
2824
+ if (event.button === 1 &&
2825
+ event.type === 'mousedown' &&
2826
+ (isWrappedWithClass(event, `${lib}-flow__node`) || isWrappedWithClass(event, `${lib}-flow__edge`))) {
2827
+ return true;
2828
+ }
2829
+ // if all interactions are disabled, we prevent all zoom events
2830
+ if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch) {
2831
+ return false;
2832
+ }
2833
+ // during a selection we prevent all other interactions
2834
+ if (userSelectionActive) {
2835
+ return false;
2836
+ }
2837
+ // we want to disable pinch-zooming while making a connection
2838
+ if (connectionInProgress && !isWheelEvent) {
2839
+ return false;
2840
+ }
2841
+ // if the target element is inside an element with the nowheel class, we prevent zooming
2842
+ if (isWrappedWithClass(event, noWheelClassName) && isWheelEvent) {
2843
+ return false;
2844
+ }
2845
+ // if the target element is inside an element with the nopan class, we prevent panning
2846
+ if (isWrappedWithClass(event, noPanClassName) &&
2847
+ (!isWheelEvent || (panOnScroll && isWheelEvent && !zoomActivationKeyPressed))) {
2848
+ return false;
2849
+ }
2850
+ if (!zoomOnPinch && event.ctrlKey && isWheelEvent) {
2851
+ return false;
2852
+ }
2853
+ if (!zoomOnPinch && event.type === 'touchstart' && event.touches?.length > 1) {
2854
+ event.preventDefault(); // if you manage to start with 2 touches, we prevent native zoom
2855
+ return false;
2856
+ }
2857
+ // when there is no scroll handling enabled, we prevent all wheel events
2858
+ if (!zoomScroll && !panOnScroll && !pinchZoom && isWheelEvent) {
2859
+ return false;
2860
+ }
2861
+ // if the pane is not movable, we prevent dragging it with mousestart or touchstart
2862
+ if (!panOnDrag && (event.type === 'mousedown' || event.type === 'touchstart')) {
2863
+ return false;
2864
+ }
2865
+ // if the pane is only movable using allowed clicks
2866
+ if (Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === 'mousedown') {
2867
+ return false;
2868
+ }
2869
+ // We only allow right clicks if pan on drag is set to right click
2870
+ const buttonAllowed = (Array.isArray(panOnDrag) && panOnDrag.includes(event.button)) || !event.button || event.button <= 1;
2871
+ // default filter for d3-zoom
2872
+ return (!event.ctrlKey || isWheelEvent) && buttonAllowed;
2873
+ };
2874
+ }
2875
+
2876
+ function XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }) {
2877
+ const zoomPanValues = {
2878
+ isZoomingOrPanning: false,
2879
+ usedRightMouseButton: false,
2880
+ prevViewport: { x: 0, y: 0, zoom: 0 },
2881
+ mouseButton: 0,
2882
+ timerId: undefined,
2883
+ panScrollTimeout: undefined,
2884
+ isPanScrolling: false,
2885
+ };
2886
+ const bbox = domNode.getBoundingClientRect();
2887
+ const d3ZoomInstance = zoom().scaleExtent([minZoom, maxZoom]).translateExtent(translateExtent);
2888
+ const d3Selection = select(domNode).call(d3ZoomInstance);
2889
+ setViewportConstrained({
2890
+ x: viewport.x,
2891
+ y: viewport.y,
2892
+ zoom: clamp(viewport.zoom, minZoom, maxZoom),
2893
+ }, [
2894
+ [0, 0],
2895
+ [bbox.width, bbox.height],
2896
+ ], translateExtent);
2897
+ const d3ZoomHandler = d3Selection.on('wheel.zoom');
2898
+ const d3DblClickZoomHandler = d3Selection.on('dblclick.zoom');
2899
+ d3ZoomInstance.wheelDelta(wheelDelta);
2900
+ function setTransform(transform, options) {
2901
+ if (d3Selection) {
2902
+ return new Promise((resolve) => {
2903
+ d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).transform(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), transform);
2904
+ });
2905
+ }
2906
+ return Promise.resolve(false);
2907
+ }
2908
+ // public functions
2909
+ function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib, onTransformChange, connectionInProgress, paneClickDistance, selectionOnDrag, }) {
2910
+ if (userSelectionActive && !zoomPanValues.isZoomingOrPanning) {
2911
+ destroy();
2912
+ }
2913
+ const isPanOnScroll = panOnScroll && !zoomActivationKeyPressed && !userSelectionActive;
2914
+ d3ZoomInstance.clickDistance(selectionOnDrag ? Infinity : !isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance);
2915
+ const wheelHandler = isPanOnScroll
2916
+ ? createPanOnScrollHandler({
2917
+ zoomPanValues,
2918
+ noWheelClassName,
2919
+ d3Selection,
2920
+ d3Zoom: d3ZoomInstance,
2921
+ panOnScrollMode,
2922
+ panOnScrollSpeed,
2923
+ zoomOnPinch,
2924
+ onPanZoomStart,
2925
+ onPanZoom,
2926
+ onPanZoomEnd,
2927
+ })
2928
+ : createZoomOnScrollHandler({
2929
+ noWheelClassName,
2930
+ preventScrolling,
2931
+ d3ZoomHandler,
2932
+ });
2933
+ d3Selection.on('wheel.zoom', wheelHandler, { passive: false });
2934
+ if (!userSelectionActive) {
2935
+ // pan zoom start
2936
+ const startHandler = createPanZoomStartHandler({
2937
+ zoomPanValues,
2938
+ onDraggingChange,
2939
+ onPanZoomStart,
2940
+ });
2941
+ d3ZoomInstance.on('start', startHandler);
2942
+ // pan zoom
2943
+ const panZoomHandler = createPanZoomHandler({
2944
+ zoomPanValues,
2945
+ panOnDrag,
2946
+ onPaneContextMenu: !!onPaneContextMenu,
2947
+ onPanZoom,
2948
+ onTransformChange,
2949
+ });
2950
+ d3ZoomInstance.on('zoom', panZoomHandler);
2951
+ // pan zoom end
2952
+ const panZoomEndHandler = createPanZoomEndHandler({
2953
+ zoomPanValues,
2954
+ panOnDrag,
2955
+ panOnScroll,
2956
+ onPaneContextMenu,
2957
+ onPanZoomEnd,
2958
+ onDraggingChange,
2959
+ });
2960
+ d3ZoomInstance.on('end', panZoomEndHandler);
2961
+ }
2962
+ const filter = createFilter({
2963
+ zoomActivationKeyPressed,
2964
+ panOnDrag,
2965
+ zoomOnScroll,
2966
+ panOnScroll,
2967
+ zoomOnDoubleClick,
2968
+ zoomOnPinch,
2969
+ userSelectionActive,
2970
+ noPanClassName,
2971
+ noWheelClassName,
2972
+ lib,
2973
+ connectionInProgress,
2974
+ });
2975
+ d3ZoomInstance.filter(filter);
2976
+ /*
2977
+ * We cannot add zoomOnDoubleClick to the filter above because
2978
+ * double tapping on touch screens circumvents the filter and
2979
+ * dblclick.zoom is fired on the selection directly
2980
+ */
2981
+ if (zoomOnDoubleClick) {
2982
+ d3Selection.on('dblclick.zoom', d3DblClickZoomHandler);
2983
+ }
2984
+ else {
2985
+ d3Selection.on('dblclick.zoom', null);
2986
+ }
2987
+ }
2988
+ function destroy() {
2989
+ d3ZoomInstance.on('zoom', null);
2990
+ }
2991
+ async function setViewportConstrained(viewport, extent, translateExtent) {
2992
+ const nextTransform = viewportToTransform(viewport);
2993
+ const contrainedTransform = d3ZoomInstance?.constrain()(nextTransform, extent, translateExtent);
2994
+ if (contrainedTransform) {
2995
+ await setTransform(contrainedTransform);
2996
+ }
2997
+ return new Promise((resolve) => resolve(contrainedTransform));
2998
+ }
2999
+ async function setViewport(viewport, options) {
3000
+ const nextTransform = viewportToTransform(viewport);
3001
+ await setTransform(nextTransform, options);
3002
+ return new Promise((resolve) => resolve(nextTransform));
3003
+ }
3004
+ function syncViewport(viewport) {
3005
+ if (d3Selection) {
3006
+ const nextTransform = viewportToTransform(viewport);
3007
+ const currentTransform = d3Selection.property('__zoom');
3008
+ if (currentTransform.k !== viewport.zoom ||
3009
+ currentTransform.x !== viewport.x ||
3010
+ currentTransform.y !== viewport.y) {
3011
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3012
+ // @ts-ignore
3013
+ d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true });
3014
+ }
3015
+ }
3016
+ }
3017
+ function getViewport() {
3018
+ const transform = d3Selection ? zoomTransform(d3Selection.node()) : { x: 0, y: 0, k: 1 };
3019
+ return { x: transform.x, y: transform.y, zoom: transform.k };
3020
+ }
3021
+ function scaleTo(zoom, options) {
3022
+ if (d3Selection) {
3023
+ return new Promise((resolve) => {
3024
+ d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleTo(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), zoom);
3025
+ });
3026
+ }
3027
+ return Promise.resolve(false);
3028
+ }
3029
+ function scaleBy(factor, options) {
3030
+ if (d3Selection) {
3031
+ return new Promise((resolve) => {
3032
+ d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleBy(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), factor);
3033
+ });
3034
+ }
3035
+ return Promise.resolve(false);
3036
+ }
3037
+ function setScaleExtent(scaleExtent) {
3038
+ d3ZoomInstance?.scaleExtent(scaleExtent);
3039
+ }
3040
+ function setTranslateExtent(translateExtent) {
3041
+ d3ZoomInstance?.translateExtent(translateExtent);
3042
+ }
3043
+ function setClickDistance(distance) {
3044
+ const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance;
3045
+ d3ZoomInstance?.clickDistance(validDistance);
3046
+ }
3047
+ return {
3048
+ update,
3049
+ destroy,
3050
+ setViewport,
3051
+ setViewportConstrained,
3052
+ getViewport,
3053
+ scaleTo,
3054
+ scaleBy,
3055
+ setScaleExtent,
3056
+ setTranslateExtent,
3057
+ syncViewport,
3058
+ setClickDistance,
3059
+ };
3060
+ }
3061
+
3062
+ /**
3063
+ * Used to determine the variant of the resize control
3064
+ *
3065
+ * @public
3066
+ */
3067
+ var ResizeControlVariant;
3068
+ (function (ResizeControlVariant) {
3069
+ ResizeControlVariant["Line"] = "line";
3070
+ ResizeControlVariant["Handle"] = "handle";
3071
+ })(ResizeControlVariant || (ResizeControlVariant = {}));
3072
+ const XY_RESIZER_HANDLE_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
3073
+ const XY_RESIZER_LINE_POSITIONS = ['top', 'right', 'bottom', 'left'];
3074
+
3075
+ /**
3076
+ * Get all connecting edges for a given set of nodes
3077
+ * @param width - new width of the node
3078
+ * @param prevWidth - previous width of the node
3079
+ * @param height - new height of the node
3080
+ * @param prevHeight - previous height of the node
3081
+ * @param affectsX - whether to invert the resize direction for the x axis
3082
+ * @param affectsY - whether to invert the resize direction for the y axis
3083
+ * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease
3084
+ */
3085
+ function getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }) {
3086
+ const deltaWidth = width - prevWidth;
3087
+ const deltaHeight = height - prevHeight;
3088
+ const direction = [deltaWidth > 0 ? 1 : deltaWidth < 0 ? -1 : 0, deltaHeight > 0 ? 1 : deltaHeight < 0 ? -1 : 0];
3089
+ if (deltaWidth && affectsX) {
3090
+ direction[0] = direction[0] * -1;
3091
+ }
3092
+ if (deltaHeight && affectsY) {
3093
+ direction[1] = direction[1] * -1;
3094
+ }
3095
+ return direction;
3096
+ }
3097
+ /**
3098
+ * Parses the control position that is being dragged to dimensions that are being resized
3099
+ * @param controlPosition - position of the control that is being dragged
3100
+ * @returns isHorizontal, isVertical, affectsX, affectsY,
3101
+ */
3102
+ function getControlDirection(controlPosition) {
3103
+ const isHorizontal = controlPosition.includes('right') || controlPosition.includes('left');
3104
+ const isVertical = controlPosition.includes('bottom') || controlPosition.includes('top');
3105
+ const affectsX = controlPosition.includes('left');
3106
+ const affectsY = controlPosition.includes('top');
3107
+ return {
3108
+ isHorizontal,
3109
+ isVertical,
3110
+ affectsX,
3111
+ affectsY,
3112
+ };
3113
+ }
3114
+ function getLowerExtentClamp(lowerExtent, lowerBound) {
3115
+ return Math.max(0, lowerBound - lowerExtent);
3116
+ }
3117
+ function getUpperExtentClamp(upperExtent, upperBound) {
3118
+ return Math.max(0, upperExtent - upperBound);
3119
+ }
3120
+ function getSizeClamp(size, minSize, maxSize) {
3121
+ return Math.max(0, minSize - size, size - maxSize);
3122
+ }
3123
+ function xor(a, b) {
3124
+ return a ? !b : b;
3125
+ }
3126
+ /**
3127
+ * Calculates new width & height and x & y of node after resize based on pointer position
3128
+ * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize,
3129
+ * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed
3130
+ * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes
3131
+ * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio!
3132
+ * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the
3133
+ * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio,
3134
+ * the resize amount is always kept in distX & distY amount (the distance in mouse movement)
3135
+ * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values.
3136
+ * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0],
3137
+ * then calculating the restrictions as usual
3138
+ * @param startValues - starting values of resize
3139
+ * @param controlDirection - dimensions affected by the resize
3140
+ * @param pointerPosition - the current pointer position corrected for snapping
3141
+ * @param boundaries - minimum and maximum dimensions of the node
3142
+ * @param keepAspectRatio - prevent changes of asprect ratio
3143
+ * @returns x, y, width and height of the node after resize
3144
+ */
3145
+ function getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, extent, childExtent) {
3146
+ let { affectsX, affectsY } = controlDirection;
3147
+ const { isHorizontal, isVertical } = controlDirection;
3148
+ const isDiagonal = isHorizontal && isVertical;
3149
+ const { xSnapped, ySnapped } = pointerPosition;
3150
+ const { minWidth, maxWidth, minHeight, maxHeight } = boundaries;
3151
+ const { x: startX, y: startY, width: startWidth, height: startHeight, aspectRatio } = startValues;
3152
+ let distX = Math.floor(isHorizontal ? xSnapped - startValues.pointerX : 0);
3153
+ let distY = Math.floor(isVertical ? ySnapped - startValues.pointerY : 0);
3154
+ const newWidth = startWidth + (affectsX ? -distX : distX);
3155
+ const newHeight = startHeight + (affectsY ? -distY : distY);
3156
+ const originOffsetX = -nodeOrigin[0] * startWidth;
3157
+ const originOffsetY = -nodeOrigin[1] * startHeight;
3158
+ // Check if maxWidth, minWWidth, maxHeight, minHeight are restricting the resize
3159
+ let clampX = getSizeClamp(newWidth, minWidth, maxWidth);
3160
+ let clampY = getSizeClamp(newHeight, minHeight, maxHeight);
3161
+ // Check if extent is restricting the resize
3162
+ if (extent) {
3163
+ let xExtentClamp = 0;
3164
+ let yExtentClamp = 0;
3165
+ if (affectsX && distX < 0) {
3166
+ xExtentClamp = getLowerExtentClamp(startX + distX + originOffsetX, extent[0][0]);
3167
+ }
3168
+ else if (!affectsX && distX > 0) {
3169
+ xExtentClamp = getUpperExtentClamp(startX + newWidth + originOffsetX, extent[1][0]);
3170
+ }
3171
+ if (affectsY && distY < 0) {
3172
+ yExtentClamp = getLowerExtentClamp(startY + distY + originOffsetY, extent[0][1]);
3173
+ }
3174
+ else if (!affectsY && distY > 0) {
3175
+ yExtentClamp = getUpperExtentClamp(startY + newHeight + originOffsetY, extent[1][1]);
3176
+ }
3177
+ clampX = Math.max(clampX, xExtentClamp);
3178
+ clampY = Math.max(clampY, yExtentClamp);
3179
+ }
3180
+ // Check if the child extent is restricting the resize
3181
+ if (childExtent) {
3182
+ let xExtentClamp = 0;
3183
+ let yExtentClamp = 0;
3184
+ if (affectsX && distX > 0) {
3185
+ xExtentClamp = getUpperExtentClamp(startX + distX, childExtent[0][0]);
3186
+ }
3187
+ else if (!affectsX && distX < 0) {
3188
+ xExtentClamp = getLowerExtentClamp(startX + newWidth, childExtent[1][0]);
3189
+ }
3190
+ if (affectsY && distY > 0) {
3191
+ yExtentClamp = getUpperExtentClamp(startY + distY, childExtent[0][1]);
3192
+ }
3193
+ else if (!affectsY && distY < 0) {
3194
+ yExtentClamp = getLowerExtentClamp(startY + newHeight, childExtent[1][1]);
3195
+ }
3196
+ clampX = Math.max(clampX, xExtentClamp);
3197
+ clampY = Math.max(clampY, yExtentClamp);
3198
+ }
3199
+ // Check if the aspect ratio resizing of the other side is restricting the resize
3200
+ if (keepAspectRatio) {
3201
+ if (isHorizontal) {
3202
+ // Check if the max dimensions might be restricting the resize
3203
+ const aspectHeightClamp = getSizeClamp(newWidth / aspectRatio, minHeight, maxHeight) * aspectRatio;
3204
+ clampX = Math.max(clampX, aspectHeightClamp);
3205
+ // Check if the extent is restricting the resize
3206
+ if (extent) {
3207
+ let aspectExtentClamp = 0;
3208
+ if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {
3209
+ aspectExtentClamp =
3210
+ getUpperExtentClamp(startY + originOffsetY + newWidth / aspectRatio, extent[1][1]) * aspectRatio;
3211
+ }
3212
+ else {
3213
+ aspectExtentClamp =
3214
+ getLowerExtentClamp(startY + originOffsetY + (affectsX ? distX : -distX) / aspectRatio, extent[0][1]) *
3215
+ aspectRatio;
3216
+ }
3217
+ clampX = Math.max(clampX, aspectExtentClamp);
3218
+ }
3219
+ // Check if the child extent is restricting the resize
3220
+ if (childExtent) {
3221
+ let aspectExtentClamp = 0;
3222
+ if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {
3223
+ aspectExtentClamp = getLowerExtentClamp(startY + newWidth / aspectRatio, childExtent[1][1]) * aspectRatio;
3224
+ }
3225
+ else {
3226
+ aspectExtentClamp =
3227
+ getUpperExtentClamp(startY + (affectsX ? distX : -distX) / aspectRatio, childExtent[0][1]) * aspectRatio;
3228
+ }
3229
+ clampX = Math.max(clampX, aspectExtentClamp);
3230
+ }
3231
+ }
3232
+ // Do the same thing for vertical resizing
3233
+ if (isVertical) {
3234
+ const aspectWidthClamp = getSizeClamp(newHeight * aspectRatio, minWidth, maxWidth) / aspectRatio;
3235
+ clampY = Math.max(clampY, aspectWidthClamp);
3236
+ if (extent) {
3237
+ let aspectExtentClamp = 0;
3238
+ if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {
3239
+ aspectExtentClamp =
3240
+ getUpperExtentClamp(startX + newHeight * aspectRatio + originOffsetX, extent[1][0]) / aspectRatio;
3241
+ }
3242
+ else {
3243
+ aspectExtentClamp =
3244
+ getLowerExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio + originOffsetX, extent[0][0]) /
3245
+ aspectRatio;
3246
+ }
3247
+ clampY = Math.max(clampY, aspectExtentClamp);
3248
+ }
3249
+ if (childExtent) {
3250
+ let aspectExtentClamp = 0;
3251
+ if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {
3252
+ aspectExtentClamp = getLowerExtentClamp(startX + newHeight * aspectRatio, childExtent[1][0]) / aspectRatio;
3253
+ }
3254
+ else {
3255
+ aspectExtentClamp =
3256
+ getUpperExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio, childExtent[0][0]) / aspectRatio;
3257
+ }
3258
+ clampY = Math.max(clampY, aspectExtentClamp);
3259
+ }
3260
+ }
3261
+ }
3262
+ distY = distY + (distY < 0 ? clampY : -clampY);
3263
+ distX = distX + (distX < 0 ? clampX : -clampX);
3264
+ if (keepAspectRatio) {
3265
+ if (isDiagonal) {
3266
+ if (newWidth > newHeight * aspectRatio) {
3267
+ distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio;
3268
+ }
3269
+ else {
3270
+ distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio;
3271
+ }
3272
+ }
3273
+ else {
3274
+ if (isHorizontal) {
3275
+ distY = distX / aspectRatio;
3276
+ affectsY = affectsX;
3277
+ }
3278
+ else {
3279
+ distX = distY * aspectRatio;
3280
+ affectsX = affectsY;
3281
+ }
3282
+ }
3283
+ }
3284
+ const x = affectsX ? startX + distX : startX;
3285
+ const y = affectsY ? startY + distY : startY;
3286
+ return {
3287
+ width: startWidth + (affectsX ? -distX : distX),
3288
+ height: startHeight + (affectsY ? -distY : distY),
3289
+ x: nodeOrigin[0] * distX * (!affectsX ? 1 : -1) + x,
3290
+ y: nodeOrigin[1] * distY * (!affectsY ? 1 : -1) + y,
3291
+ };
3292
+ }
3293
+
3294
+ const initPrevValues = { width: 0, height: 0, x: 0, y: 0 };
3295
+ const initStartValues = {
3296
+ ...initPrevValues,
3297
+ pointerX: 0,
3298
+ pointerY: 0,
3299
+ aspectRatio: 1,
3300
+ };
3301
+ function nodeToParentExtent(node) {
3302
+ return [
3303
+ [0, 0],
3304
+ [node.measured.width, node.measured.height],
3305
+ ];
3306
+ }
3307
+ function nodeToChildExtent(child, parent, nodeOrigin) {
3308
+ const x = parent.position.x + child.position.x;
3309
+ const y = parent.position.y + child.position.y;
3310
+ const width = child.measured.width ?? 0;
3311
+ const height = child.measured.height ?? 0;
3312
+ const originOffsetX = nodeOrigin[0] * width;
3313
+ const originOffsetY = nodeOrigin[1] * height;
3314
+ return [
3315
+ [x - originOffsetX, y - originOffsetY],
3316
+ [x + width - originOffsetX, y + height - originOffsetY],
3317
+ ];
3318
+ }
3319
+ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
3320
+ const selection = select(domNode);
3321
+ let params = {
3322
+ controlDirection: getControlDirection('bottom-right'),
3323
+ boundaries: {
3324
+ minWidth: 0,
3325
+ minHeight: 0,
3326
+ maxWidth: Number.MAX_VALUE,
3327
+ maxHeight: Number.MAX_VALUE,
3328
+ },
3329
+ resizeDirection: undefined,
3330
+ keepAspectRatio: false,
3331
+ };
3332
+ function update({ controlPosition, boundaries, keepAspectRatio, resizeDirection, onResizeStart, onResize, onResizeEnd, shouldResize, }) {
3333
+ let prevValues = { ...initPrevValues };
3334
+ let startValues = { ...initStartValues };
3335
+ params = {
3336
+ boundaries,
3337
+ resizeDirection,
3338
+ keepAspectRatio,
3339
+ controlDirection: getControlDirection(controlPosition),
3340
+ };
3341
+ let node = undefined;
3342
+ let containerBounds = null;
3343
+ let childNodes = [];
3344
+ let parentNode = undefined; // Needed to fix expandParent
3345
+ let parentExtent = undefined;
3346
+ let childExtent = undefined;
3347
+ // we only want to trigger onResizeEnd if onResize was actually called
3348
+ let resizeDetected = false;
3349
+ const dragHandler = drag()
3350
+ .on('start', (event) => {
3351
+ const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, paneDomNode } = getStoreItems();
3352
+ node = nodeLookup.get(nodeId);
3353
+ if (!node) {
3354
+ return;
3355
+ }
3356
+ containerBounds = paneDomNode?.getBoundingClientRect() ?? null;
3357
+ const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, {
3358
+ transform,
3359
+ snapGrid,
3360
+ snapToGrid,
3361
+ containerBounds,
3362
+ });
3363
+ prevValues = {
3364
+ width: node.measured.width ?? 0,
3365
+ height: node.measured.height ?? 0,
3366
+ x: node.position.x ?? 0,
3367
+ y: node.position.y ?? 0,
3368
+ };
3369
+ startValues = {
3370
+ ...prevValues,
3371
+ pointerX: xSnapped,
3372
+ pointerY: ySnapped,
3373
+ aspectRatio: prevValues.width / prevValues.height,
3374
+ };
3375
+ parentNode = undefined;
3376
+ if (node.parentId && (node.extent === 'parent' || node.expandParent)) {
3377
+ parentNode = nodeLookup.get(node.parentId);
3378
+ parentExtent = parentNode && node.extent === 'parent' ? nodeToParentExtent(parentNode) : undefined;
3379
+ }
3380
+ /*
3381
+ * Collect all child nodes to correct their relative positions when top/left changes
3382
+ * Determine largest minimal extent the parent node is allowed to resize to
3383
+ */
3384
+ childNodes = [];
3385
+ childExtent = undefined;
3386
+ for (const [childId, child] of nodeLookup) {
3387
+ if (child.parentId === nodeId) {
3388
+ childNodes.push({
3389
+ id: childId,
3390
+ position: { ...child.position },
3391
+ extent: child.extent,
3392
+ });
3393
+ if (child.extent === 'parent' || child.expandParent) {
3394
+ const extent = nodeToChildExtent(child, node, child.origin ?? nodeOrigin);
3395
+ if (childExtent) {
3396
+ childExtent = [
3397
+ [Math.min(extent[0][0], childExtent[0][0]), Math.min(extent[0][1], childExtent[0][1])],
3398
+ [Math.max(extent[1][0], childExtent[1][0]), Math.max(extent[1][1], childExtent[1][1])],
3399
+ ];
3400
+ }
3401
+ else {
3402
+ childExtent = extent;
3403
+ }
3404
+ }
3405
+ }
3406
+ }
3407
+ onResizeStart?.(event, { ...prevValues });
3408
+ })
3409
+ .on('drag', (event) => {
3410
+ const { transform, snapGrid, snapToGrid, nodeOrigin: storeNodeOrigin } = getStoreItems();
3411
+ const pointerPosition = getPointerPosition(event.sourceEvent, {
3412
+ transform,
3413
+ snapGrid,
3414
+ snapToGrid,
3415
+ containerBounds,
3416
+ });
3417
+ const childChanges = [];
3418
+ if (!node) {
3419
+ return;
3420
+ }
3421
+ const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues;
3422
+ const change = {};
3423
+ const nodeOrigin = node.origin ?? storeNodeOrigin;
3424
+ const { width, height, x, y } = getDimensionsAfterResize(startValues, params.controlDirection, pointerPosition, params.boundaries, params.keepAspectRatio, nodeOrigin, parentExtent, childExtent);
3425
+ const isWidthChange = width !== prevWidth;
3426
+ const isHeightChange = height !== prevHeight;
3427
+ const isXPosChange = x !== prevX && isWidthChange;
3428
+ const isYPosChange = y !== prevY && isHeightChange;
3429
+ if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange) {
3430
+ return;
3431
+ }
3432
+ if (isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) {
3433
+ change.x = isXPosChange ? x : prevValues.x;
3434
+ change.y = isYPosChange ? y : prevValues.y;
3435
+ prevValues.x = change.x;
3436
+ prevValues.y = change.y;
3437
+ /*
3438
+ * when top/left changes, correct the relative positions of child nodes
3439
+ * so that they stay in the same position
3440
+ */
3441
+ if (childNodes.length > 0) {
3442
+ const xChange = x - prevX;
3443
+ const yChange = y - prevY;
3444
+ for (const childNode of childNodes) {
3445
+ childNode.position = {
3446
+ x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth),
3447
+ y: childNode.position.y - yChange + nodeOrigin[1] * (height - prevHeight),
3448
+ };
3449
+ childChanges.push(childNode);
3450
+ }
3451
+ }
3452
+ }
3453
+ if (isWidthChange || isHeightChange) {
3454
+ change.width =
3455
+ isWidthChange && (!params.resizeDirection || params.resizeDirection === 'horizontal')
3456
+ ? width
3457
+ : prevValues.width;
3458
+ change.height =
3459
+ isHeightChange && (!params.resizeDirection || params.resizeDirection === 'vertical')
3460
+ ? height
3461
+ : prevValues.height;
3462
+ prevValues.width = change.width;
3463
+ prevValues.height = change.height;
3464
+ }
3465
+ // Fix expandParent when resizing from top/left
3466
+ if (parentNode && node.expandParent) {
3467
+ const xLimit = nodeOrigin[0] * (change.width ?? 0);
3468
+ if (change.x && change.x < xLimit) {
3469
+ prevValues.x = xLimit;
3470
+ startValues.x = startValues.x - (change.x - xLimit);
3471
+ }
3472
+ const yLimit = nodeOrigin[1] * (change.height ?? 0);
3473
+ if (change.y && change.y < yLimit) {
3474
+ prevValues.y = yLimit;
3475
+ startValues.y = startValues.y - (change.y - yLimit);
3476
+ }
3477
+ }
3478
+ const direction = getResizeDirection({
3479
+ width: prevValues.width,
3480
+ prevWidth,
3481
+ height: prevValues.height,
3482
+ prevHeight,
3483
+ affectsX: params.controlDirection.affectsX,
3484
+ affectsY: params.controlDirection.affectsY,
3485
+ });
3486
+ const nextValues = { ...prevValues, direction };
3487
+ const callResize = shouldResize?.(event, nextValues);
3488
+ if (callResize === false) {
3489
+ return;
3490
+ }
3491
+ resizeDetected = true;
3492
+ onResize?.(event, nextValues);
3493
+ onChange(change, childChanges);
3494
+ })
3495
+ .on('end', (event) => {
3496
+ if (!resizeDetected) {
3497
+ return;
3498
+ }
3499
+ onResizeEnd?.(event, { ...prevValues });
3500
+ onEnd?.({ ...prevValues });
3501
+ resizeDetected = false;
3502
+ });
3503
+ selection.call(dragHandler);
3504
+ }
3505
+ function destroy() {
3506
+ selection.on('.drag', null);
3507
+ }
3508
+ return {
3509
+ update,
3510
+ destroy,
3511
+ };
3512
+ }
3513
+
3514
+ export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, defaultAriaLabelConfig, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgeId, getEdgePosition, getEdgeToolbarTransform, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getSmoothStepPath, getStraightPath, getViewportForBounds, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isManualZIndexMode, isMouseEvent, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals, withResolvers };