dorkos 0.121.0 → 0.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/dist/bin/cli.js +532 -373
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-CtI8gbER.js → AboutPage-BmtoPqP9.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-CHTXfBS7.js → ActivityErrorState-CEzdFJiR.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-B8p4yYJL.js → ActivityPage-mFYgTr3e.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-CSuSz-92.js → ActivityRow-Bkc0kkim.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-Qnxn0cE5.js → AdapterIcon-DVgTrgnM.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-BG8H-Lld.js → AdapterSetupWizard-I03EluU5.js} +1 -1
  10. package/dist/client/assets/{AgentOptionRow-BWFQFynn.js → AgentOptionRow-DI1TzLaR.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-CL93SET3.js → AgentPicker-CBYeBzjf.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-CamX7Tvr.js → AgentRequestCard-DQ6GYoeE.js} +3 -3
  13. package/dist/client/assets/{AppearancePage-rN70_7ih.js → AppearancePage-62xIPNPn.js} +1 -1
  14. package/dist/client/assets/{ApplyToOverridesDialog-DeWaXbgm.js → ApplyToOverridesDialog-CrqkeHQb.js} +1 -1
  15. package/dist/client/assets/{AttentionSignalRow-CKcSWExi.js → AttentionSignalRow-Coe5pYX6.js} +1 -1
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BwYaLf2P.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-D07cg75s.js} +1 -1
  17. package/dist/client/assets/{BindingDialog-DqPDLYbF.js → BindingDialog-DVyxVXZM.js} +1 -1
  18. package/dist/client/assets/{BlintzCanvas-DoAZs5bz.js → BlintzCanvas-BmfkiUQJ.js} +3 -3
  19. package/dist/client/assets/{BlintzCanvas-xZ3u3nk7.css → BlintzCanvas-DCXOV_yN.css} +1 -1
  20. package/dist/client/assets/{CanvasCsvContent-ViqRJuhW.js → CanvasCsvContent-CRTr-AI7.js} +2 -2
  21. package/dist/client/assets/CanvasFileContent-rOmY1s3T.js +2 -0
  22. package/dist/client/assets/CanvasModel3dContent-D7oRT6ey.js +2 -0
  23. package/dist/client/assets/{ChatAppsOff-D0PbHYqF.js → ChatAppsOff-BmuOTq83.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorDiff-DFNSXeuV.js → CodeMirrorDiff-DidSWwYJ.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-AgkgsSqN.js → CodeMirrorEditor-BUAWGbRo.js} +1 -1
  26. package/dist/client/assets/{CommitmentList-0V6QivXH.js → CommitmentList-uK4CKaz0.js} +1 -1
  27. package/dist/client/assets/{CommitmentsPage-i3XoHwBj.js → CommitmentsPage-BWITH1r2.js} +1 -1
  28. package/dist/client/assets/{ComputerResourceView-RPoBc-km.js → ComputerResourceView-adgF_EZU.js} +1 -1
  29. package/dist/client/assets/{ComputerViewer-2ugaCd0H.js → ComputerViewer-D87LhxwL.js} +1 -1
  30. package/dist/client/assets/{ConnectionAccessLists-DaPP4U96.js → ConnectionAccessLists-BFEFqcSZ.js} +1 -1
  31. package/dist/client/assets/{ConnectionsPage-BVqYvfk5.js → ConnectionsPage-Cd_cLoSY.js} +1 -1
  32. package/dist/client/assets/{ConventionPage-BoqncrFd.js → ConventionPage-BSztD-gU.js} +1 -1
  33. package/dist/client/assets/{ExtensionPageRoute-BrOEeNX3.js → ExtensionPageRoute-BSge6XRv.js} +1 -1
  34. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-DLwix3K7.js → FloatingTanStackRouterDevtools-CqogiFob-TO2CUPG0.js} +1 -1
  35. package/dist/client/assets/HandlePage-BKiqymRF.js +1 -0
  36. package/dist/client/assets/{HeartbeatPage-DgXhbaBJ.js → HeartbeatPage-DIJzdOhj.js} +1 -1
  37. package/dist/client/assets/{KeyEntry-CRr32Ae5.js → KeyEntry-DJnzW3Mu.js} +1 -1
  38. package/dist/client/assets/{LexicalField-DeAoA6yr.js → LexicalField-BxzNvIjJ.js} +1 -1
  39. package/dist/client/assets/{ManagesPage-ZBWYLTZx.js → ManagesPage-BQj8KbYA.js} +1 -1
  40. package/dist/client/assets/{Marketplace-iL5p8Omt.js → Marketplace-CIG5_a_H.js} +4 -4
  41. package/dist/client/assets/{MarketplaceSourcesView-CsNLVOdP.js → MarketplaceSourcesView-16HKvFK-.js} +1 -1
  42. package/dist/client/assets/{McpAppFrame-B1WPswgk.js → McpAppFrame-5xlga1jD.js} +1 -1
  43. package/dist/client/assets/{McpSigninBody-CJ28yu0o.js → McpSigninBody-COIHpHq_.js} +1 -1
  44. package/dist/client/assets/{Model3dViewer-BIZWdK8g.js → Model3dViewer-CQ0sA_kr.js} +1 -1
  45. package/dist/client/assets/NamePage-D7W6VMYd.js +1 -0
  46. package/dist/client/assets/{NewDirectMessageMenu-DRx9e9kM.js → NewDirectMessageMenu-D092y0K9.js} +1 -1
  47. package/dist/client/assets/{NotificationsPage-cfqgSuVy.js → NotificationsPage-CskOPdhh.js} +1 -1
  48. package/dist/client/assets/{OpenMeshSwitch-BIIuKDku.js → OpenMeshSwitch-BHRm328L.js} +1 -1
  49. package/dist/client/assets/{OperatorIdentityForm-BKUSGrs6.js → OperatorIdentityForm-C3op6BIC.js} +1 -1
  50. package/dist/client/assets/{PermissionHistory-Ctdqhib6.js → PermissionHistory-CKebTVkq.js} +1 -1
  51. package/dist/client/assets/{PermissionsPage-CYA_zdrV.js → PermissionsPage-XuPOSYll.js} +1 -1
  52. package/dist/client/assets/{PersonalityPopover-BR4Cpr2C.js → PersonalityPopover-BrZjxakx.js} +1 -1
  53. package/dist/client/assets/PhotoPage-Ch1at4A6.js +1 -0
  54. package/dist/client/assets/{PreviewRefusedNotice-D1Tl265t.js → PreviewRefusedNotice-BANdpT9O.js} +1 -1
  55. package/dist/client/assets/{ProfileFields-T3vVbHRC.js → ProfileFields-Dp68ebW9.js} +1 -1
  56. package/dist/client/assets/{ProfilePanelContainer-CParzTPA.js → ProfilePanelContainer-BKwGdI90.js} +1 -1
  57. package/dist/client/assets/{ProfileRolePicker-BU4eiMKn.js → ProfileRolePicker-ClOdfLda.js} +1 -1
  58. package/dist/client/assets/{PromptSuggestionChips-CGNQc2Tf.js → PromptSuggestionChips-zcW4UJ_O.js} +1 -1
  59. package/dist/client/assets/{ReportsToPopover-Dj5U_Ppi.js → ReportsToPopover-BwDVGqFg.js} +1 -1
  60. package/dist/client/assets/RoomSurface-CSKIvyHH.js +44 -0
  61. package/dist/client/assets/{RoomsPage-Cvs3h6f0.js → RoomsPage-CAvrRbPk.js} +1 -1
  62. package/dist/client/assets/{RunsOnPopover-BUlYwRW4.js → RunsOnPopover-CQ4t9EZ-.js} +1 -1
  63. package/dist/client/assets/{RuntimeConnectFlow-ChrvjC84.js → RuntimeConnectFlow--fVpIf0B.js} +1 -1
  64. package/dist/client/assets/{RuntimeSetupDialog-BK9yo7YF.js → RuntimeSetupDialog-COpyPrqL.js} +1 -1
  65. package/dist/client/assets/SeenDevices-BPw3UgjX.js +19 -0
  66. package/dist/client/assets/{SessionsPage-CWUwU3US.js → SessionsPage-FDyYzuXs.js} +1 -1
  67. package/dist/client/assets/{SettingsDialog-BApzy0J8.js → SettingsDialog-Bdws5dbS.js} +4 -4
  68. package/dist/client/assets/{SkillsPage-z3XnApNX.js → SkillsPage-PLXEY0LB.js} +1 -1
  69. package/dist/client/assets/{TaskDialogWrapper-BEWUpAlk.js → TaskDialogWrapper-CTcW70s8.js} +1 -1
  70. package/dist/client/assets/{TasksEmptyState-CLwpLnIO.js → TasksEmptyState-8RZxhRh6.js} +1 -1
  71. package/dist/client/assets/{TasksPage-CyHjr9OZ.js → TasksPage-C-EtQXKb.js} +1 -1
  72. package/dist/client/assets/{TeamComputerEntry-BHHIofx3.js → TeamComputerEntry-qx_19Htj.js} +1 -1
  73. package/dist/client/assets/{ToolsPage-CckCco8x.js → ToolsPage-D5-fx1EA.js} +1 -1
  74. package/dist/client/assets/{TopologyGraph-Dox7aWP3.js → TopologyGraph-1wtG1BE9.js} +1 -1
  75. package/dist/client/assets/{TourHost-CTBewD-a.js → TourHost-C664E8OY.js} +1 -1
  76. package/dist/client/assets/{UnlinkDialog-CFRgExId.js → UnlinkDialog-Di1oBFA_.js} +1 -1
  77. package/dist/client/assets/{WidgetErrorCard-Dx5oPMlF.js → WidgetErrorCard-BfgGzyqg.js} +1 -1
  78. package/dist/client/assets/_shell-BLTSXXDw.js +80 -0
  79. package/dist/client/assets/{_shell._home-DnBkgWs4.js → _shell._home-Hz78BY6-.js} +1 -1
  80. package/dist/client/assets/{_shell._home.activity-CVCC-EEI.js → _shell._home.activity-BxvI0gkw.js} +1 -1
  81. package/dist/client/assets/{_shell._home.index-Ck6jxwIx.js → _shell._home.index-Cqq81f3P.js} +1 -1
  82. package/dist/client/assets/{_shell._home.tasks-B7QQAZnA.js → _shell._home.tasks-Cth56CwC.js} +1 -1
  83. package/dist/client/assets/{_shell._home.workspaces-DlrRd9tv.js → _shell._home.workspaces-DkoOJSWz.js} +1 -1
  84. package/dist/client/assets/{_shell.channels-CiWehoyl.js → _shell.channels-D_GQU4RB.js} +4 -4
  85. package/dist/client/assets/{_shell.connections-CGP5hZHq.js → _shell.connections-DZrlxs4G.js} +1 -1
  86. package/dist/client/assets/{_shell.feedback-requests-BxxNvw6j.js → _shell.feedback-requests-BTxHdsfb.js} +1 -1
  87. package/dist/client/assets/_shell.marketplace-CZxkAmFz.js +1 -0
  88. package/dist/client/assets/_shell.marketplace_.sources-Q0BTQIuE.js +1 -0
  89. package/dist/client/assets/_shell.session-DvGL0DoX.js +63 -0
  90. package/dist/client/assets/{_shell.team-CsXH3NkS.js → _shell.team-ZxGwa39m.js} +3 -3
  91. package/dist/client/assets/_shell.x._extensionId-B6Tm5KuT.js +1 -0
  92. package/dist/client/assets/_shell.x._extensionId_._-B6Tm5KuT.js +1 -0
  93. package/dist/client/assets/{abnfDiagram-WEYOIA3C-CMdkyiQ3.js → abnfDiagram-WEYOIA3C-CzqPVMdw.js} +1 -1
  94. package/dist/client/assets/{access-copy-CW-z1oMH.js → access-copy-Dj09Xk4b.js} +1 -1
  95. package/dist/client/assets/{arc-Bw7tftQk.js → arc-Bgy7ExYl.js} +1 -1
  96. package/dist/client/assets/{architectureDiagram-ZHVYKT53-BhpXALtX.js → architectureDiagram-ZHVYKT53-DYfb2p9r.js} +1 -1
  97. package/dist/client/assets/{banner-EomQNDOH.js → banner-dlsHTWSf.js} +1 -1
  98. package/dist/client/assets/{blockDiagram-RJAE7QA3-Bxk_BuZv.js → blockDiagram-RJAE7QA3-BkOzLL8s.js} +1 -1
  99. package/dist/client/assets/{c4Diagram-XDPPPE54-CYN0FwR8.js → c4Diagram-XDPPPE54-CsZm4qpD.js} +1 -1
  100. package/dist/client/assets/{card-ww4ebz8h.js → card-Dj6ZfRgu.js} +1 -1
  101. package/dist/client/assets/channel-CGffcDRq.js +1 -0
  102. package/dist/client/assets/{chunk-2E7WHVMD-IPDvYcPa.js → chunk-2E7WHVMD-GA96Jfps.js} +1 -1
  103. package/dist/client/assets/{chunk-2Q5K7J3B-DZ5bU5Ax.js → chunk-2Q5K7J3B-CW2i0IkT.js} +1 -1
  104. package/dist/client/assets/{chunk-4EMNKR2T-DrsWxa6Y.js → chunk-4EMNKR2T-BwFvnPZg.js} +1 -1
  105. package/dist/client/assets/{chunk-55XCU76K-CiBbKG0b.js → chunk-55XCU76K-MOezzAAB.js} +1 -1
  106. package/dist/client/assets/{chunk-5VM5RSS4-B3K3MUav.js → chunk-5VM5RSS4-woru6zOC.js} +1 -1
  107. package/dist/client/assets/{chunk-JWPE2WC7-CjV5RcIh.js → chunk-JWPE2WC7-CUrKlP2M.js} +1 -1
  108. package/dist/client/assets/{chunk-VQ5W62QI-CWoRr0H2.js → chunk-VQ5W62QI-CqZ2cdEu.js} +1 -1
  109. package/dist/client/assets/{chunk-XXDRQBXY-E0nvzXiG.js → chunk-XXDRQBXY-ByAcvWaE.js} +1 -1
  110. package/dist/client/assets/{chunk-ZCHMQSOR-DFop6Lvt.js → chunk-ZCHMQSOR-3nkba9kj.js} +2 -2
  111. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-B7JJfc9z.js → classDiagram-v2-4MYWR3UA-B-zZKAmI.js} +1 -1
  112. package/dist/client/assets/{command-D4fLpJxA.js → command-BAOEURY7.js} +1 -1
  113. package/dist/client/assets/{cose-bilkent-JH36ORCC-BjNppl29.js → cose-bilkent-JH36ORCC-sCKxRv1H.js} +1 -1
  114. package/dist/client/assets/{cpu-DCe0Yyml.js → cpu-TtYQqONc.js} +1 -1
  115. package/dist/client/assets/{cynefin-EF2NZ3EQ-PmRntJwW.js → cynefin-EF2NZ3EQ-CXzvL5Cg.js} +1 -1
  116. package/dist/client/assets/{cynefinDiagram-WF24UDRP-Ctdbp_Vg.js → cynefinDiagram-WF24UDRP-C0wjhu9X.js} +1 -1
  117. package/dist/client/assets/{dagre-NK4GIZVX-5tvLY2ZW.js → dagre-NK4GIZVX-Doi2IPkY.js} +1 -1
  118. package/dist/client/assets/{diagram-CBK3MWTC-DZO-XBOO.js → diagram-CBK3MWTC-11TVuPel.js} +1 -1
  119. package/dist/client/assets/{diagram-I5XIIV2D-CWBbA1Pv.js → diagram-I5XIIV2D-CJq7fHFM.js} +1 -1
  120. package/dist/client/assets/{diagram-ODIL2UCW-hP5A1tGl.js → diagram-ODIL2UCW-2Ae6unuU.js} +1 -1
  121. package/dist/client/assets/{diagram-PFBEJUXE-EI_-RoN7.js → diagram-PFBEJUXE-BXza6_iz.js} +1 -1
  122. package/dist/client/assets/{diagram-RJA3I4VV-TrYq9A4Z.js → diagram-RJA3I4VV-Z0i3uBW9.js} +1 -1
  123. package/dist/client/assets/{diagram-TYUNFSNR-BAQq2OM5.js → diagram-TYUNFSNR-Dq_-g1oP.js} +1 -1
  124. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-cKbeW9dQ.js → ebnfDiagram-V4P3TTPT-vxzIvg-W.js} +1 -1
  125. package/dist/client/assets/{elk-QONTBCTQ-wpfNPp0q.js → elk-QONTBCTQ-BBIXXtg_.js} +1 -1
  126. package/dist/client/assets/{empty-state-DXWQsHMf.js → empty-state-kISAAp0z.js} +1 -1
  127. package/dist/client/assets/{erDiagram-KYQIGQAA-Dk0OrvjE.js → erDiagram-KYQIGQAA-Bk2MeLBx.js} +1 -1
  128. package/dist/client/assets/{execution-config-CAyT2Qoo.js → execution-config-DYFe-VNC.js} +1 -1
  129. package/dist/client/assets/{file-Bf7D_47y.js → file-DEt4KgZG.js} +1 -1
  130. package/dist/client/assets/{file-exclamation-point-DZXE9_8o.js → file-exclamation-point-QqXJhXD9.js} +1 -1
  131. package/dist/client/assets/{file-text-C1ougnBY.js → file-text-CRw31ZWd.js} +1 -1
  132. package/dist/client/assets/{find-latest-widget-fence-B1_-pC-Z.js → find-latest-widget-fence-B3aaiBNI.js} +1 -1
  133. package/dist/client/assets/{flowDiagram-IUGLLWBU-CdlOoRZV.js → flowDiagram-IUGLLWBU-B53m4r8u.js} +1 -1
  134. package/dist/client/assets/{form-D7kF-U0d.js → form-Bjhk9zOn.js} +1 -1
  135. package/dist/client/assets/{format-cron-ZtliseYi.js → format-cron-9tmNIcgl.js} +1 -1
  136. package/dist/client/assets/{ganttDiagram-R7GPNTJY-x0MJLv5d.js → ganttDiagram-R7GPNTJY-CS6TN3R1.js} +1 -1
  137. package/dist/client/assets/{git-branch-B2k77X3Q.js → git-branch-DWerghmw.js} +1 -1
  138. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-CruCvk7w.js → gitGraphDiagram-PDYL7XHY-D096ZtqE.js} +1 -1
  139. package/dist/client/assets/{graph-5PBe05F8.js → graph-DQpTuPmX.js} +1 -1
  140. package/dist/client/assets/{heart-CmqGJPDc.js → heart-CRkjVW7-.js} +1 -1
  141. package/dist/client/assets/{highlighted-body-KPVGNVTW-Bqu2cQDj.js → highlighted-body-KPVGNVTW-DoVCXOMU.js} +1 -1
  142. package/dist/client/assets/{image-lightbox-BBbz-ThL.js → image-lightbox-BXzbN27o.js} +1 -1
  143. package/dist/client/assets/{image-off-BCtWIY4q.js → image-off-VyMBVwgK.js} +1 -1
  144. package/dist/client/assets/{index-8IAr9b71.js → index-1qv8ldHx.js} +1 -1
  145. package/dist/client/assets/{index-ClBIPuLA.js → index-2EaVZrJe.js} +1 -1
  146. package/dist/client/assets/{index-DcZPWi_I.js → index-8-iQ6PnT.js} +252 -247
  147. package/dist/client/assets/{index-CJ5v2_Cz.js → index-B2rBVMNl.js} +1 -1
  148. package/dist/client/assets/{index-BpmmNapD.js → index-BBcAekWE.js} +1 -1
  149. package/dist/client/assets/index-BFitbVs4.js +1 -0
  150. package/dist/client/assets/{index-xmk9Ohv9.js → index-BLkXoquZ.js} +1 -1
  151. package/dist/client/assets/{index-xaMF1mrN.js → index-BcFMs7lK.js} +1 -1
  152. package/dist/client/assets/{index-EdJm7ZN-.js → index-BiFJIg4n.js} +1 -1
  153. package/dist/client/assets/{index-BuGQxHrf.js → index-BpjEclkM.js} +1 -1
  154. package/dist/client/assets/{index-CtycM8wY.js → index-C24HfJir.js} +1 -1
  155. package/dist/client/assets/{index-DAdo_yIq.js → index-C3sW6rkN.js} +1 -1
  156. package/dist/client/assets/{index-JxeBJIuE.js → index-C6Fo2htT.js} +1 -1
  157. package/dist/client/assets/{index-B5rRtvWx.js → index-C6udJCgz.js} +1 -1
  158. package/dist/client/assets/{index-ChwNEkM8.js → index-CDuYKaGY.js} +1 -1
  159. package/dist/client/assets/{index-Cml5572f.js → index-CEVwhauU.js} +1 -1
  160. package/dist/client/assets/index-CI84yP-g.js +1 -0
  161. package/dist/client/assets/{index-BzPgsdPn.js → index-COMRALJO.js} +1 -1
  162. package/dist/client/assets/index-CiVeycsn.js +17 -0
  163. package/dist/client/assets/{index-BXZlDqvy.js → index-Cs3WB8yn.js} +1 -1
  164. package/dist/client/assets/{index-BrQGZ6iF.js → index-Csr_C1sk.js} +1 -1
  165. package/dist/client/assets/{index-CMNc_OrC.js → index-Ctqe81qr.js} +1 -1
  166. package/dist/client/assets/{index-Dmn03xST.js → index-CvhR1oZB.js} +1 -1
  167. package/dist/client/assets/{index-B6dEbNhI.js → index-CyGRWyhV.js} +1 -1
  168. package/dist/client/assets/{index-mFOJXyAE.js → index-Czm6C7FZ.js} +3 -3
  169. package/dist/client/assets/{index-1ShgR_xt.js → index-D5zUdnZM.js} +1 -1
  170. package/dist/client/assets/{index-Cv0GsC4n.js → index-DBo2XfNv.js} +1 -1
  171. package/dist/client/assets/{index-DIxzqCwG.js → index-DKWpwwxo.js} +1 -1
  172. package/dist/client/assets/{index-BXMxoWrk.js → index-DN2sTT2U.js} +1 -1
  173. package/dist/client/assets/index-DNzk9m1D.js +23 -0
  174. package/dist/client/assets/{index-CrflCTqO.css → index-DUZrTFYD.css} +1 -1
  175. package/dist/client/assets/{index-t4Ud6YTX.js → index-DX_2Mxwv.js} +1 -1
  176. package/dist/client/assets/{index-C11Ssk2u.js → index-Dgrk2udV.js} +2 -2
  177. package/dist/client/assets/{index-BCk4wW-T.js → index-DgyhdQnI.js} +1 -1
  178. package/dist/client/assets/{index-CQ0VLZf-.js → index-DmFNztTX.js} +1 -1
  179. package/dist/client/assets/{index-rWZWP3Wh.js → index-TnoaFCrj.js} +1 -1
  180. package/dist/client/assets/{index-DbDI5BAA.js → index-_emDKzsu.js} +1 -1
  181. package/dist/client/assets/{index-BIIH5CXj.js → index-b9p_y2Ql.js} +1 -1
  182. package/dist/client/assets/{index-yI1r4pSP.js → index-gIQ7FrL9.js} +1 -1
  183. package/dist/client/assets/{index-DsJWzmWw.js → index-igLqtuoO.js} +1 -1
  184. package/dist/client/assets/{index-Do6eeFps.js → index-n3-zWcH-.js} +2 -2
  185. package/dist/client/assets/{index-8TfzCkKR.js → index-rCvQat0D.js} +1 -1
  186. package/dist/client/assets/{index-BfRW2WTx.js → index-setKr4xl.js} +1 -1
  187. package/dist/client/assets/{index-DrA03bMq.js → index-t3eRSGcT.js} +1 -1
  188. package/dist/client/assets/{index.esm-CZZtbPRj.js → index.esm-bLeQzVWT.js} +1 -1
  189. package/dist/client/assets/{infoDiagram-MVDRKAX5-Bj9DD77n.js → infoDiagram-MVDRKAX5-nN_N76Fn.js} +1 -1
  190. package/dist/client/assets/{inline-code-g9PVHZI2.js → inline-code-D9bLKHjY.js} +1 -1
  191. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-DckI6dhS.js → ishikawaDiagram-HPEHV2GE-CiLFbWXd.js} +1 -1
  192. package/dist/client/assets/{journeyDiagram-BOSHW7O7-Ce1GAVa0.js → journeyDiagram-BOSHW7O7-Dn3yOv96.js} +1 -1
  193. package/dist/client/assets/{kanban-definition-FNSA4HC5-Kq5O9rZa.js → kanban-definition-FNSA4HC5-JxiBdBQC.js} +1 -1
  194. package/dist/client/assets/{layers-D3lEdRF0.js → layers-DTnLoRvE.js} +1 -1
  195. package/dist/client/assets/{lightbulb-BFE-KkFU.js → lightbulb-CRKLr5q3.js} +1 -1
  196. package/dist/client/assets/{link-2-Dvb6g-2Q.js → link-2-hgHg-lyw.js} +1 -1
  197. package/dist/client/assets/{list-runtime-types-8YGEK3Al.js → list-runtime-types-Bb33QiMC.js} +1 -1
  198. package/dist/client/assets/{markdown-content-Cqq_QMXA.js → markdown-content-D0FpU2cz.js} +1 -1
  199. package/dist/client/assets/{mention-pill-Bnzt4u2l.js → mention-pill-uuaUvwSW.js} +1 -1
  200. package/dist/client/assets/{mermaid.core-dpp59v7L.js → mermaid.core-x3Hh6iut.js} +4 -4
  201. package/dist/client/assets/{message-square-off-BX2XnEDx.js → message-square-off-B8N6YF9R.js} +1 -1
  202. package/dist/client/assets/{mindmap-definition-6OY57UG3-CFdfJO6g.js → mindmap-definition-6OY57UG3-D0SEv5Re.js} +1 -1
  203. package/dist/client/assets/{more-details-B4lBMpKi.js → more-details-CadxnGyH.js} +1 -1
  204. package/dist/client/assets/{owner-notice-ByjrIRmX.js → owner-notice-CJHyha58.js} +1 -1
  205. package/dist/client/assets/{package-6Rbxg35g.js → package-B8G7jQm-.js} +1 -1
  206. package/dist/client/assets/{page-container-DoZzad36.js → page-container-Bb-_N7lw.js} +1 -1
  207. package/dist/client/assets/{paperclip-B-jDXtxw.js → paperclip-BDeYGKqh.js} +1 -1
  208. package/dist/client/assets/{path-input-DpqUD8hN.js → path-input-BIfexEKz.js} +1 -1
  209. package/dist/client/assets/{pegDiagram-ECIUJNBX-eVnSw2Ma.js → pegDiagram-ECIUJNBX-7ivMd0-b.js} +1 -1
  210. package/dist/client/assets/{pieDiagram-GNMPY74T-BYG7LY5Q.js → pieDiagram-GNMPY74T-DGDkbFvu.js} +1 -1
  211. package/dist/client/assets/{plug-DnaAhcy4.js → plug-wP1d6OUX.js} +1 -1
  212. package/dist/client/assets/{primer-trigger-Da5ECjY8.js → primer-trigger-CEli_z4n.js} +1 -1
  213. package/dist/client/assets/{profile-errors-GbTNc2-M.js → profile-errors-C1qSJkiG.js} +1 -1
  214. package/dist/client/assets/{progress-DlIRjXIA.js → progress-DmUieXLn.js} +1 -1
  215. package/dist/client/assets/{quadrantDiagram-D57K4MC3-CRgNKuHR.js → quadrantDiagram-D57K4MC3-AFQRVSsK.js} +1 -1
  216. package/dist/client/assets/{query-error-state-DB-Jby7_.js → query-error-state--8AnWSSn.js} +1 -1
  217. package/dist/client/assets/query-keys-DeYqUDia.js +1 -0
  218. package/dist/client/assets/{radio-CaaE60ws.js → radio-mkA-Sqe0.js} +1 -1
  219. package/dist/client/assets/{railroadDiagram-Y72NRBL7-DGL-Hqz9.js → railroadDiagram-Y72NRBL7-3QBa2d3j.js} +1 -1
  220. package/dist/client/assets/registry-Bnd-HFt3.js +1 -0
  221. package/dist/client/assets/{relay-trace-schemas-CcCqyOrA.js → relay-trace-schemas-fScydQ3A.js} +1 -1
  222. package/dist/client/assets/{requirementDiagram-EQYSW5RA-DKsFpU3l.js → requirementDiagram-EQYSW5RA-BVBqcASy.js} +1 -1
  223. package/dist/client/assets/{room-files-source-CbbVpvSW.js → room-files-source-BhkPUTiP.js} +1 -1
  224. package/dist/client/assets/{rotate-ccw-clock-CeY00nlZ.js → rotate-ccw-clock-DiuTseKz.js} +1 -1
  225. package/dist/client/assets/{rotate-cw-Djl5J_x9.js → rotate-cw-DvoxWwSx.js} +1 -1
  226. package/dist/client/assets/{sankeyDiagram-SY24JHO5-BFRkDxic.js → sankeyDiagram-SY24JHO5-DFjfOD38.js} +1 -1
  227. package/dist/client/assets/{scroll-area-BOqrziJf.js → scroll-area-DYyyRqW_.js} +1 -1
  228. package/dist/client/assets/{search-x-B_mHjnlo.js → search-x-CA-FzEqZ.js} +1 -1
  229. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-fHea3KOI.js → sequenceDiagram-BLEHNHQU-Cr9LzoSF.js} +1 -1
  230. package/dist/client/assets/{shield-check-Csnr5rFy.js → shield-check-CpUB_Ju1.js} +1 -1
  231. package/dist/client/assets/{shield-x-Dhl4YvvW.js → shield-x-B0W_7qwR.js} +1 -1
  232. package/dist/client/assets/{signed-in-BMqAss8c.js → signed-in-X2utDqQS.js} +1 -1
  233. package/dist/client/assets/{sizeCapture-INFHLROL-CztsD3qF.js → sizeCapture-INFHLROL-Do_jfNyT.js} +1 -1
  234. package/dist/client/assets/{soul-file-DOfamgB5.js → soul-file-DgfhKQIK.js} +1 -1
  235. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-CWyOqZ9S.js → stateDiagram-v2-A6IESKWZ-BCi9yk_0.js} +1 -1
  236. package/dist/client/assets/{swimlanes-B3ENRKFQ-0EfOxSAX.js → swimlanes-B3ENRKFQ-3SSAw2av.js} +1 -1
  237. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-jpZCGfva.js +8 -0
  238. package/dist/client/assets/{table-L7FvN6Or.js → table-DvU_oS4E.js} +1 -1
  239. package/dist/client/assets/{terminal-C9M5a_PS.js → terminal-Dw2QZ7Dh.js} +1 -1
  240. package/dist/client/assets/{timeline-definition-JXYKGLGB-sFyYvZ20.js → timeline-definition-JXYKGLGB-DTLPXTMA.js} +1 -1
  241. package/dist/client/assets/{trust-posture-dl6qwDtI.js → trust-posture-2MR0ap9o.js} +1 -1
  242. package/dist/client/assets/{unplug-CFUEVRbc.js → unplug-CAVOLB2R.js} +1 -1
  243. package/dist/client/assets/{unverified-catalog-notice-CdYU3WEJ.js → unverified-catalog-notice-u4ikVg8J.js} +1 -1
  244. package/dist/client/assets/{use-adapter-catalog-YTofdqDJ.js → use-adapter-catalog-BQKfRxXC.js} +1 -1
  245. package/dist/client/assets/{use-bindings-CpyT6kNu.js → use-bindings-BV6HA0MD.js} +1 -1
  246. package/dist/client/assets/{use-composer-prefs-CK_EK_QJ.js → use-composer-prefs-DCSzOnEO.js} +1 -1
  247. package/dist/client/assets/{use-connector-management-DwoK8kon.js → use-connector-management-fr1tx-GZ.js} +1 -1
  248. package/dist/client/assets/{use-deep-link-scroll-CgRjt48R.js → use-deep-link-scroll-v02TbidQ.js} +1 -1
  249. package/dist/client/assets/{use-delete-binding-CfsnMXrL.js → use-delete-binding-CnziYpXo.js} +1 -1
  250. package/dist/client/assets/{use-dev-links-B3I-ZK34.js → use-dev-links-k4YWFO1v.js} +1 -1
  251. package/dist/client/assets/{use-external-adapter-catalog-aGlZNRrp.js → use-external-adapter-catalog-DoGUfa2F.js} +1 -1
  252. package/dist/client/assets/{use-full-activity-feed-B61Olhdw.js → use-full-activity-feed-CQNxgxnw.js} +1 -1
  253. package/dist/client/assets/use-is-below-desktop-DR8FEbRW.js +1 -0
  254. package/dist/client/assets/use-is-hub-BmpgFnFp.js +1 -0
  255. package/dist/client/assets/{use-jump-back-in-C39GOTHa.js → use-jump-back-in-BuO6A0P7.js} +1 -1
  256. package/dist/client/assets/{use-local-browser-DCwzB4D8.js → use-local-browser-BNzN5O1P.js} +1 -1
  257. package/dist/client/assets/{use-mesh-topology-LRYxFuZp.js → use-mesh-topology-CpIDE8lD.js} +1 -1
  258. package/dist/client/assets/{use-mounted-ref-CZaegwTr.js → use-mounted-ref-BAO3qunF.js} +1 -1
  259. package/dist/client/assets/{use-notification-prefs-FtOiUS5H.js → use-notification-prefs-CtqeH5Pk.js} +1 -1
  260. package/dist/client/assets/{use-panel-tab-placements-Dv2OPvKh.js → use-panel-tab-placements-DFobGBRm.js} +1 -1
  261. package/dist/client/assets/use-pending-read-Do0_vZ2I.js +1 -0
  262. package/dist/client/assets/{use-personality-commit-BB5aeh6p.js → use-personality-commit-BvqCwzAC.js} +1 -1
  263. package/dist/client/assets/{use-promo-activation-BW0u7n7m.js → use-promo-activation-Dz5cYm-X.js} +1 -1
  264. package/dist/client/assets/{use-promo-dismissals-BOXzW4kD.js → use-promo-dismissals-CuOsnqnZ.js} +1 -1
  265. package/dist/client/assets/{use-pulse-freshness-ClW-MLMo.js → use-pulse-freshness-qcTH6PM7.js} +1 -1
  266. package/dist/client/assets/{use-relay-config-hItHtkSr.js → use-relay-config-1mAMDNbc.js} +1 -1
  267. package/dist/client/assets/{use-room-follow-claim-wotzxUWc.js → use-room-follow-claim-CCGhsyH3.js} +1 -1
  268. package/dist/client/assets/{use-roving-tab-list-DkbO6xSs.js → use-roving-tab-list-Bsg2dfUx.js} +1 -1
  269. package/dist/client/assets/use-session-canvas-awPngMKg.js +25 -0
  270. package/dist/client/assets/{use-session-diagnostics-DmxvD-wy.js → use-session-diagnostics-D5g8Mc52.js} +2 -2
  271. package/dist/client/assets/{use-unclaimed-chats-DKpexDm3.js → use-unclaimed-chats-Db_wuzt0.js} +1 -1
  272. package/dist/client/assets/use-update-config-DwtH_H9Z.js +1 -0
  273. package/dist/client/assets/{useMutationState-Btf2Hp1a.js → useMutationState-BvwBDXKc.js} +1 -1
  274. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-DRngjDUq.js → usecaseDiagram-WPOLBNNX-1zKygEKR.js} +1 -1
  275. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-iK-dlS1-.js → vennDiagram-Q3Y3IDCW-BR2EbgGY.js} +1 -1
  276. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-sOS67Cks.js → wardleyDiagram-IVAIDKWA-D0OwouJc.js} +1 -1
  277. package/dist/client/assets/{xychartDiagram-4URNHDU4-EgnLiIao.js → xychartDiagram-4URNHDU4-BM-7_FQQ.js} +1 -1
  278. package/dist/client/index.html +2 -2
  279. package/dist/drizzle/20261018123612_session_route.sql +1 -0
  280. package/dist/drizzle/meta/20261018123612_snapshot.json +14027 -0
  281. package/dist/drizzle/meta/_journal.json +7 -0
  282. package/dist/server/index.js +31594 -28878
  283. package/dist/server/index.js.map +2 -2
  284. package/package.json +6 -6
  285. package/dist/client/assets/CanvasFileContent-ClcHZ_l-.js +0 -2
  286. package/dist/client/assets/CanvasModel3dContent-Cm3msNdQ.js +0 -2
  287. package/dist/client/assets/HandlePage-B_5GLHsp.js +0 -1
  288. package/dist/client/assets/NamePage-0nr288eM.js +0 -1
  289. package/dist/client/assets/PhotoPage-C3Ir3wlA.js +0 -1
  290. package/dist/client/assets/PresetPicker-zGvDOqTf.js +0 -19
  291. package/dist/client/assets/RoomSurface-BIyjtxKD.js +0 -44
  292. package/dist/client/assets/_shell-BHUZq_8C.js +0 -80
  293. package/dist/client/assets/_shell.marketplace-BoAmyvPt.js +0 -1
  294. package/dist/client/assets/_shell.marketplace_.sources-BpqWjkGL.js +0 -1
  295. package/dist/client/assets/_shell.session-KyPj3OxK.js +0 -61
  296. package/dist/client/assets/_shell.x._extensionId-CfiAgtoq.js +0 -1
  297. package/dist/client/assets/_shell.x._extensionId_._-CfiAgtoq.js +0 -1
  298. package/dist/client/assets/channel-DZpRF3QJ.js +0 -1
  299. package/dist/client/assets/index-Cl8trmnL.js +0 -1
  300. package/dist/client/assets/index-Cp3yShS8.js +0 -23
  301. package/dist/client/assets/index-DKDK-3KH.js +0 -17
  302. package/dist/client/assets/index-DPNBHwcQ.js +0 -1
  303. package/dist/client/assets/registry-DS1Ghdft.js +0 -1
  304. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-C7fkUKrq.js +0 -8
  305. package/dist/client/assets/use-is-below-desktop-Qwyg-mFb.js +0 -1
  306. package/dist/client/assets/use-is-hub-CSz6NDaP.js +0 -1
  307. package/dist/client/assets/use-pending-read-DBOl1ee_.js +0 -1
  308. package/dist/client/assets/use-session-canvas-C_fuAgW_.js +0 -24
  309. package/dist/client/assets/use-update-config-CSYwg557.js +0 -1
@@ -1,4 +1,4 @@
1
- import{kW as JFn,R as GFn,r as sn,j as ae,e3 as Ihn,iR as HFn,jM as qFn,hF as zFn,kX as UFn,ar as cN,bx as Tge,B as Phn,aj as Ohn,G as n2,aO as Sge,b7 as Ige,b6 as XFn,_ as iN,f as KFn,iB as WFn,X as VFn,en as Lln,em as QFn,ai as YFn,ap as ZFn,kY as eBn,hL as nBn,bW as AX,fq as tBn,x as $ln,hJ as iBn,hu as rBn,g9 as cBn,ga as uBn,gb as oBn,gc as sBn,gd as fBn,ge as lBn,gf as hBn,gg as aBn,h0 as dBn}from"./index-DcZPWi_I.js";import{s as $0,g as Nhn,j as Pge,T as fge,k as lge,t as bBn}from"./transform-BqqRT-Iy.js";import{i as hge}from"./value-wA6veExk.js";import{H as $X}from"./_shell.team-CsXH3NkS.js";import{H as wBn}from"./heart-CmqGJPDc.js";import{a as age,A as gBn}from"./AdapterIcon-Qnxn0cE5.js";import"./relay-trace-schemas-CcCqyOrA.js";import{d as pBn,c as mBn,a as vBn,B as yBn}from"./BindingDialog-DqPDLYbF.js";import{s as kBn}from"./session-strategy-labels-C7Wduch3.js";import{c as MX}from"./_commonjs-dynamic-modules-TDtrdbi3.js";import{u as jBn}from"./use-mesh-topology-LRYxFuZp.js";import{E as EBn}from"./empty-state-DXWQsHMf.js";import{Q as ABn}from"./query-error-state-DB-Jby7_.js";import{u as MBn}from"./use-bindings-CpyT6kNu.js";import{u as CBn}from"./use-delete-binding-CfsnMXrL.js";import{u as xBn}from"./use-relay-config-hItHtkSr.js";import"./use-pending-read-DBOl1ee_.js";import"./search-x-B_mHjnlo.js";import"./scroll-area-BOqrziJf.js";import"./OpenMeshSwitch-BIIuKDku.js";import"./table-L7FvN6Or.js";import"./use-is-hub-CSz6NDaP.js";import"./shield-check-Csnr5rFy.js";import"./page-container-DoZzad36.js";import"./profile-errors-GbTNc2-M.js";import"./CommitmentList-0V6QivXH.js";import"./TeamComputerEntry-BHHIofx3.js";import"./ComputerViewer-2ugaCd0H.js";import"./form-D7kF-U0d.js";import"./use-adapter-catalog-YTofdqDJ.js";import"./trust-posture-dl6qwDtI.js";function Kf(p){if(typeof p=="string"||typeof p=="number")return""+p;let E="";if(Array.isArray(p))for(let P=0,N;P<p.length;P++)(N=Kf(p[P]))!==""&&(E+=(E&&" ")+N);else for(let P in p)p[P]&&(E+=(E&&" ")+P);return E}function TBn(p){let E;for(;E=p.sourceEvent;)p=E;return p}function Yg(p,E){if(p=TBn(p),E===void 0&&(E=p.currentTarget),E){var P=E.ownerSVGElement||E;if(P.createSVGPoint){var N=P.createSVGPoint();return N.x=p.clientX,N.y=p.clientY,N=N.matrixTransform(E.getScreenCTM().inverse()),[N.x,N.y]}if(E.getBoundingClientRect){var D=E.getBoundingClientRect();return[p.clientX-D.left-E.clientLeft,p.clientY-D.top-E.clientTop]}}return[p.pageX,p.pageY]}const SBn={passive:!1},uN={capture:!0,passive:!1};function dge(p){p.stopImmediatePropagation()}function CA(p){p.preventDefault(),p.stopImmediatePropagation()}function Dhn(p){var E=p.document.documentElement,P=$0(p).on("dragstart.drag",CA,uN);"onselectstart"in E?P.on("selectstart.drag",CA,uN):(E.__noselect=E.style.MozUserSelect,E.style.MozUserSelect="none")}function Lhn(p,E){var P=p.document.documentElement,N=$0(p).on("dragstart.drag",null);E&&(N.on("click.drag",CA,uN),setTimeout(function(){N.on("click.drag",null)},0)),"onselectstart"in P?N.on("selectstart.drag",null):(P.style.MozUserSelect=P.__noselect,delete P.__noselect)}const CX=p=>()=>p;function kge(p,{sourceEvent:E,subject:P,target:N,identifier:D,active:F,x:v,y:q,dx:te,dy:ie,dispatch:pe}){Object.defineProperties(this,{type:{value:p,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},subject:{value:P,enumerable:!0,configurable:!0},target:{value:N,enumerable:!0,configurable:!0},identifier:{value:D,enumerable:!0,configurable:!0},active:{value:F,enumerable:!0,configurable:!0},x:{value:v,enumerable:!0,configurable:!0},y:{value:q,enumerable:!0,configurable:!0},dx:{value:te,enumerable:!0,configurable:!0},dy:{value:ie,enumerable:!0,configurable:!0},_:{value:pe}})}kge.prototype.on=function(){var p=this._.on.apply(this._,arguments);return p===this._?this:p};function IBn(p){return!p.ctrlKey&&!p.button}function PBn(){return this.parentNode}function OBn(p,E){return E??{x:p.x,y:p.y}}function NBn(){return navigator.maxTouchPoints||"ontouchstart"in this}function $hn(){var p=IBn,E=PBn,P=OBn,N=NBn,D={},F=Nhn("start","drag","end"),v=0,q,te,ie,pe,oe=0;function z(Me){Me.on("mousedown.drag",Z).filter(N).on("touchstart.drag",xe).on("touchmove.drag",ce,SBn).on("touchend.drag touchcancel.drag",ge).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function Z(Me,Ke){if(!(pe||!p.call(this,Me,Ke))){var Xe=ee(this,E.call(this,Me,Ke),Me,Ke,"mouse");Xe&&($0(Me.view).on("mousemove.drag",ne,uN).on("mouseup.drag",U,uN),Dhn(Me.view),dge(Me),ie=!1,q=Me.clientX,te=Me.clientY,Xe("start",Me))}}function ne(Me){if(CA(Me),!ie){var Ke=Me.clientX-q,Xe=Me.clientY-te;ie=Ke*Ke+Xe*Xe>oe}D.mouse("drag",Me)}function U(Me){$0(Me.view).on("mousemove.drag mouseup.drag",null),Lhn(Me.view,ie),CA(Me),D.mouse("end",Me)}function xe(Me,Ke){if(p.call(this,Me,Ke)){var Xe=Me.changedTouches,Ye=E.call(this,Me,Ke),kn=Xe.length,jn,Zn;for(jn=0;jn<kn;++jn)(Zn=ee(this,Ye,Me,Ke,Xe[jn].identifier,Xe[jn]))&&(dge(Me),Zn("start",Me,Xe[jn]))}}function ce(Me){var Ke=Me.changedTouches,Xe=Ke.length,Ye,kn;for(Ye=0;Ye<Xe;++Ye)(kn=D[Ke[Ye].identifier])&&(CA(Me),kn("drag",Me,Ke[Ye]))}function ge(Me){var Ke=Me.changedTouches,Xe=Ke.length,Ye,kn;for(pe&&clearTimeout(pe),pe=setTimeout(function(){pe=null},500),Ye=0;Ye<Xe;++Ye)(kn=D[Ke[Ye].identifier])&&(dge(Me),kn("end",Me,Ke[Ye]))}function ee(Me,Ke,Xe,Ye,kn,jn){var Zn=F.copy(),$n=Yg(jn||Xe,Ke),Vn,_,je;if((je=P.call(Me,new kge("beforestart",{sourceEvent:Xe,target:z,identifier:kn,active:v,x:$n[0],y:$n[1],dx:0,dy:0,dispatch:Zn}),Ye))!=null)return Vn=je.x-$n[0]||0,_=je.y-$n[1]||0,function on(rn,Sn,Bn){var dn=$n,Gn;switch(rn){case"start":D[kn]=on,Gn=v++;break;case"end":delete D[kn],--v;case"drag":$n=Yg(Bn||Sn,Ke),Gn=v;break}Zn.call(rn,Me,new kge(rn,{sourceEvent:Sn,subject:je,target:z,identifier:kn,active:Gn,x:$n[0]+Vn,y:$n[1]+_,dx:$n[0]-dn[0],dy:$n[1]-dn[1],dispatch:Zn}),Ye)}}return z.filter=function(Me){return arguments.length?(p=typeof Me=="function"?Me:CX(!!Me),z):p},z.container=function(Me){return arguments.length?(E=typeof Me=="function"?Me:CX(Me),z):E},z.subject=function(Me){return arguments.length?(P=typeof Me=="function"?Me:CX(Me),z):P},z.touchable=function(Me){return arguments.length?(N=typeof Me=="function"?Me:CX(!!Me),z):N},z.on=function(){var Me=F.on.apply(F,arguments);return Me===F?z:Me},z.clickDistance=function(Me){return arguments.length?(oe=(Me=+Me)*Me,z):Math.sqrt(oe)},z}var DBn=1e-12;function Fln(p){return((p=Math.exp(p))+1/p)/2}function LBn(p){return((p=Math.exp(p))-1/p)/2}function $Bn(p){return((p=Math.exp(2*p))-1)/(p+1)}const NX=(function p(E,P,N){function D(F,v){var q=F[0],te=F[1],ie=F[2],pe=v[0],oe=v[1],z=v[2],Z=pe-q,ne=oe-te,U=Z*Z+ne*ne,xe,ce;if(U<DBn)ce=Math.log(z/ie)/E,xe=function(Ye){return[q+Ye*Z,te+Ye*ne,ie*Math.exp(E*Ye*ce)]};else{var ge=Math.sqrt(U),ee=(z*z-ie*ie+N*U)/(2*ie*P*ge),Me=(z*z-ie*ie-N*U)/(2*z*P*ge),Ke=Math.log(Math.sqrt(ee*ee+1)-ee),Xe=Math.log(Math.sqrt(Me*Me+1)-Me);ce=(Xe-Ke)/E,xe=function(Ye){var kn=Ye*ce,jn=Fln(Ke),Zn=ie/(P*ge)*(jn*$Bn(E*kn+Ke)-LBn(Ke));return[q+Zn*Z,te+Zn*ne,ie*jn/Fln(E*kn+Ke)]}}return xe.duration=ce*1e3*E/Math.SQRT2,xe}return D.rho=function(F){var v=Math.max(.001,+F),q=v*v,te=q*q;return p(v,q,te)},D})(Math.SQRT2,2,4),xX=p=>()=>p;function FBn(p,{sourceEvent:E,target:P,transform:N,dispatch:D}){Object.defineProperties(this,{type:{value:p,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},target:{value:P,enumerable:!0,configurable:!0},transform:{value:N,enumerable:!0,configurable:!0},_:{value:D}})}function bge(p){p.stopImmediatePropagation()}function tN(p){p.preventDefault(),p.stopImmediatePropagation()}function BBn(p){return(!p.ctrlKey||p.type==="wheel")&&!p.button}function RBn(){var p=this;return p instanceof SVGElement?(p=p.ownerSVGElement||p,p.hasAttribute("viewBox")?(p=p.viewBox.baseVal,[[p.x,p.y],[p.x+p.width,p.y+p.height]]):[[0,0],[p.width.baseVal.value,p.height.baseVal.value]]):[[0,0],[p.clientWidth,p.clientHeight]]}function Bln(){return this.__zoom||Pge}function _Bn(p){return-p.deltaY*(p.deltaMode===1?.05:p.deltaMode?1:.002)*(p.ctrlKey?10:1)}function JBn(){return navigator.maxTouchPoints||"ontouchstart"in this}function GBn(p,E,P){var N=p.invertX(E[0][0])-P[0][0],D=p.invertX(E[1][0])-P[1][0],F=p.invertY(E[0][1])-P[0][1],v=p.invertY(E[1][1])-P[1][1];return p.translate(D>N?(N+D)/2:Math.min(0,N)||Math.max(0,D),v>F?(F+v)/2:Math.min(0,F)||Math.max(0,v))}function Fhn(){var p=BBn,E=RBn,P=GBn,N=_Bn,D=JBn,F=[0,1/0],v=[[-1/0,-1/0],[1/0,1/0]],q=250,te=NX,ie=Nhn("start","zoom","end"),pe,oe,z,Z=500,ne=150,U=0,xe=10;function ce(je){je.property("__zoom",Bln).on("wheel.zoom",kn,{passive:!1}).on("mousedown.zoom",jn).on("dblclick.zoom",Zn).filter(D).on("touchstart.zoom",$n).on("touchmove.zoom",Vn).on("touchend.zoom touchcancel.zoom",_).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}ce.transform=function(je,on,rn,Sn){var Bn=je.selection?je.selection():je;Bn.property("__zoom",Bln),je!==Bn?Ke(je,on,rn,Sn):Bn.interrupt().each(function(){Xe(this,arguments).event(Sn).start().zoom(null,typeof on=="function"?on.apply(this,arguments):on).end()})},ce.scaleBy=function(je,on,rn,Sn){ce.scaleTo(je,function(){var Bn=this.__zoom.k,dn=typeof on=="function"?on.apply(this,arguments):on;return Bn*dn},rn,Sn)},ce.scaleTo=function(je,on,rn,Sn){ce.transform(je,function(){var Bn=E.apply(this,arguments),dn=this.__zoom,Gn=rn==null?Me(Bn):typeof rn=="function"?rn.apply(this,arguments):rn,Nn=dn.invert(Gn),qn=typeof on=="function"?on.apply(this,arguments):on;return P(ee(ge(dn,qn),Gn,Nn),Bn,v)},rn,Sn)},ce.translateBy=function(je,on,rn,Sn){ce.transform(je,function(){return P(this.__zoom.translate(typeof on=="function"?on.apply(this,arguments):on,typeof rn=="function"?rn.apply(this,arguments):rn),E.apply(this,arguments),v)},null,Sn)},ce.translateTo=function(je,on,rn,Sn,Bn){ce.transform(je,function(){var dn=E.apply(this,arguments),Gn=this.__zoom,Nn=Sn==null?Me(dn):typeof Sn=="function"?Sn.apply(this,arguments):Sn;return P(Pge.translate(Nn[0],Nn[1]).scale(Gn.k).translate(typeof on=="function"?-on.apply(this,arguments):-on,typeof rn=="function"?-rn.apply(this,arguments):-rn),dn,v)},Sn,Bn)};function ge(je,on){return on=Math.max(F[0],Math.min(F[1],on)),on===je.k?je:new fge(on,je.x,je.y)}function ee(je,on,rn){var Sn=on[0]-rn[0]*je.k,Bn=on[1]-rn[1]*je.k;return Sn===je.x&&Bn===je.y?je:new fge(je.k,Sn,Bn)}function Me(je){return[(+je[0][0]+ +je[1][0])/2,(+je[0][1]+ +je[1][1])/2]}function Ke(je,on,rn,Sn){je.on("start.zoom",function(){Xe(this,arguments).event(Sn).start()}).on("interrupt.zoom end.zoom",function(){Xe(this,arguments).event(Sn).end()}).tween("zoom",function(){var Bn=this,dn=arguments,Gn=Xe(Bn,dn).event(Sn),Nn=E.apply(Bn,dn),qn=rn==null?Me(Nn):typeof rn=="function"?rn.apply(Bn,dn):rn,Jt=Math.max(Nn[1][0]-Nn[0][0],Nn[1][1]-Nn[0][1]),Kt=Bn.__zoom,Oi=typeof on=="function"?on.apply(Bn,dn):on,gr=te(Kt.invert(qn).concat(Jt/Kt.k),Oi.invert(qn).concat(Jt/Oi.k));return function(Ki){if(Ki===1)Ki=Oi;else{var Kn=gr(Ki),ei=Jt/Kn[2];Ki=new fge(ei,qn[0]-Kn[0]*ei,qn[1]-Kn[1]*ei)}Gn.zoom(null,Ki)}})}function Xe(je,on,rn){return!rn&&je.__zooming||new Ye(je,on)}function Ye(je,on){this.that=je,this.args=on,this.active=0,this.sourceEvent=null,this.extent=E.apply(je,on),this.taps=0}Ye.prototype={event:function(je){return je&&(this.sourceEvent=je),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(je,on){return this.mouse&&je!=="mouse"&&(this.mouse[1]=on.invert(this.mouse[0])),this.touch0&&je!=="touch"&&(this.touch0[1]=on.invert(this.touch0[0])),this.touch1&&je!=="touch"&&(this.touch1[1]=on.invert(this.touch1[0])),this.that.__zoom=on,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(je){var on=$0(this.that).datum();ie.call(je,this.that,new FBn(je,{sourceEvent:this.sourceEvent,target:ce,transform:this.that.__zoom,dispatch:ie}),on)}};function kn(je,...on){if(!p.apply(this,arguments))return;var rn=Xe(this,on).event(je),Sn=this.__zoom,Bn=Math.max(F[0],Math.min(F[1],Sn.k*Math.pow(2,N.apply(this,arguments)))),dn=Yg(je);if(rn.wheel)(rn.mouse[0][0]!==dn[0]||rn.mouse[0][1]!==dn[1])&&(rn.mouse[1]=Sn.invert(rn.mouse[0]=dn)),clearTimeout(rn.wheel);else{if(Sn.k===Bn)return;rn.mouse=[dn,Sn.invert(dn)],lge(this),rn.start()}tN(je),rn.wheel=setTimeout(Gn,ne),rn.zoom("mouse",P(ee(ge(Sn,Bn),rn.mouse[0],rn.mouse[1]),rn.extent,v));function Gn(){rn.wheel=null,rn.end()}}function jn(je,...on){if(z||!p.apply(this,arguments))return;var rn=je.currentTarget,Sn=Xe(this,on,!0).event(je),Bn=$0(je.view).on("mousemove.zoom",qn,!0).on("mouseup.zoom",Jt,!0),dn=Yg(je,rn),Gn=je.clientX,Nn=je.clientY;Dhn(je.view),bge(je),Sn.mouse=[dn,this.__zoom.invert(dn)],lge(this),Sn.start();function qn(Kt){if(tN(Kt),!Sn.moved){var Oi=Kt.clientX-Gn,gr=Kt.clientY-Nn;Sn.moved=Oi*Oi+gr*gr>U}Sn.event(Kt).zoom("mouse",P(ee(Sn.that.__zoom,Sn.mouse[0]=Yg(Kt,rn),Sn.mouse[1]),Sn.extent,v))}function Jt(Kt){Bn.on("mousemove.zoom mouseup.zoom",null),Lhn(Kt.view,Sn.moved),tN(Kt),Sn.event(Kt).end()}}function Zn(je,...on){if(p.apply(this,arguments)){var rn=this.__zoom,Sn=Yg(je.changedTouches?je.changedTouches[0]:je,this),Bn=rn.invert(Sn),dn=rn.k*(je.shiftKey?.5:2),Gn=P(ee(ge(rn,dn),Sn,Bn),E.apply(this,on),v);tN(je),q>0?$0(this).transition().duration(q).call(Ke,Gn,Sn,je):$0(this).call(ce.transform,Gn,Sn,je)}}function $n(je,...on){if(p.apply(this,arguments)){var rn=je.touches,Sn=rn.length,Bn=Xe(this,on,je.changedTouches.length===Sn).event(je),dn,Gn,Nn,qn;for(bge(je),Gn=0;Gn<Sn;++Gn)Nn=rn[Gn],qn=Yg(Nn,this),qn=[qn,this.__zoom.invert(qn),Nn.identifier],Bn.touch0?!Bn.touch1&&Bn.touch0[2]!==qn[2]&&(Bn.touch1=qn,Bn.taps=0):(Bn.touch0=qn,dn=!0,Bn.taps=1+!!pe);pe&&(pe=clearTimeout(pe)),dn&&(Bn.taps<2&&(oe=qn[0],pe=setTimeout(function(){pe=null},Z)),lge(this),Bn.start())}}function Vn(je,...on){if(this.__zooming){var rn=Xe(this,on).event(je),Sn=je.changedTouches,Bn=Sn.length,dn,Gn,Nn,qn;for(tN(je),dn=0;dn<Bn;++dn)Gn=Sn[dn],Nn=Yg(Gn,this),rn.touch0&&rn.touch0[2]===Gn.identifier?rn.touch0[0]=Nn:rn.touch1&&rn.touch1[2]===Gn.identifier&&(rn.touch1[0]=Nn);if(Gn=rn.that.__zoom,rn.touch1){var Jt=rn.touch0[0],Kt=rn.touch0[1],Oi=rn.touch1[0],gr=rn.touch1[1],Ki=(Ki=Oi[0]-Jt[0])*Ki+(Ki=Oi[1]-Jt[1])*Ki,Kn=(Kn=gr[0]-Kt[0])*Kn+(Kn=gr[1]-Kt[1])*Kn;Gn=ge(Gn,Math.sqrt(Ki/Kn)),Nn=[(Jt[0]+Oi[0])/2,(Jt[1]+Oi[1])/2],qn=[(Kt[0]+gr[0])/2,(Kt[1]+gr[1])/2]}else if(rn.touch0)Nn=rn.touch0[0],qn=rn.touch0[1];else return;rn.zoom("touch",P(ee(Gn,Nn,qn),rn.extent,v))}}function _(je,...on){if(this.__zooming){var rn=Xe(this,on).event(je),Sn=je.changedTouches,Bn=Sn.length,dn,Gn;for(bge(je),z&&clearTimeout(z),z=setTimeout(function(){z=null},Z),dn=0;dn<Bn;++dn)Gn=Sn[dn],rn.touch0&&rn.touch0[2]===Gn.identifier?delete rn.touch0:rn.touch1&&rn.touch1[2]===Gn.identifier&&delete rn.touch1;if(rn.touch1&&!rn.touch0&&(rn.touch0=rn.touch1,delete rn.touch1),rn.touch0)rn.touch0[1]=this.__zoom.invert(rn.touch0[0]);else if(rn.end(),rn.taps===2&&(Gn=Yg(Gn,this),Math.hypot(oe[0]-Gn[0],oe[1]-Gn[1])<xe)){var Nn=$0(this).on("dblclick.zoom");Nn&&Nn.apply(this,arguments)}}}return ce.wheelDelta=function(je){return arguments.length?(N=typeof je=="function"?je:xX(+je),ce):N},ce.filter=function(je){return arguments.length?(p=typeof je=="function"?je:xX(!!je),ce):p},ce.touchable=function(je){return arguments.length?(D=typeof je=="function"?je:xX(!!je),ce):D},ce.extent=function(je){return arguments.length?(E=typeof je=="function"?je:xX([[+je[0][0],+je[0][1]],[+je[1][0],+je[1][1]]]),ce):E},ce.scaleExtent=function(je){return arguments.length?(F[0]=+je[0],F[1]=+je[1],ce):[F[0],F[1]]},ce.translateExtent=function(je){return arguments.length?(v[0][0]=+je[0][0],v[1][0]=+je[1][0],v[0][1]=+je[0][1],v[1][1]=+je[1][1],ce):[[v[0][0],v[0][1]],[v[1][0],v[1][1]]]},ce.constrain=function(je){return arguments.length?(P=je,ce):P},ce.duration=function(je){return arguments.length?(q=+je,ce):q},ce.interpolate=function(je){return arguments.length?(te=je,ce):te},ce.on=function(){var je=ie.on.apply(ie,arguments);return je===ie?ce:je},ce.clickDistance=function(je){return arguments.length?(U=(je=+je)*je,ce):Math.sqrt(U)},ce.tapDistance=function(je){return arguments.length?(xe=+je,ce):xe},ce}const t2={error001:(p="react")=>`Seems like you have not used ${p==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${p}flow.dev/error#001`,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.",error003:p=>`Node type "${p}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:p=>`The old edge with id=${p} does not exist.`,error009:p=>`Marker type "${p}" doesn't exist.`,error008:(p,{id:E,sourceHandle:P,targetHandle:N})=>`Couldn't create edge for ${p} handle id: "${p==="source"?P:N}", edge id: ${E}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:p=>`Edge type "${p}" not found. Using fallback type "default".`,error012:p=>`Node with id "${p}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(p="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${p}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:p=>`Edge with id "${p}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},oN=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Bhn=["Enter"," ","Escape"],Rhn={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","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.","node.a11yDescription.ariaLiveMessage":({direction:p,x:E,y:P})=>`Moved selected node ${p}. New position, x: ${E}, y: ${P}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var xA;(function(p){p.Strict="strict",p.Loose="loose"})(xA||(xA={}));var V8;(function(p){p.Free="free",p.Vertical="vertical",p.Horizontal="horizontal"})(V8||(V8={}));var sN;(function(p){p.Partial="partial",p.Full="full"})(sN||(sN={}));const _hn={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var J5;(function(p){p.Bezier="default",p.Straight="straight",p.Step="step",p.SmoothStep="smoothstep",p.SimpleBezier="simplebezier"})(J5||(J5={}));var fN;(function(p){p.Arrow="arrow",p.ArrowClosed="arrowclosed"})(fN||(fN={}));var ji;(function(p){p.Left="left",p.Top="top",p.Right="right",p.Bottom="bottom"})(ji||(ji={}));const Rln={[ji.Left]:ji.Right,[ji.Right]:ji.Left,[ji.Top]:ji.Bottom,[ji.Bottom]:ji.Top},Jhn=p=>!!p&&typeof p=="object"&&"id"in p&&"source"in p&&"target"in p,HBn=p=>!!p&&typeof p=="object"&&"id"in p&&"position"in p&&!("source"in p)&&!("target"in p),Oge=p=>!!p&&typeof p=="object"&&"id"in p&&"internals"in p&&!("source"in p)&&!("target"in p),dN=(p,E=[0,0])=>{const{width:P,height:N}=i2(p),D=p.origin??E,F=P*D[0],v=N*D[1];return{x:p.position.x-F,y:p.position.y-v}},qBn=(p,E={nodeOrigin:[0,0]})=>{if(p.length===0)return{x:0,y:0,width:0,height:0};let P=!1;const N=p.reduce((D,F)=>{const v=typeof F=="string";let q=!E.nodeLookup&&!v?F:void 0;return E.nodeLookup&&(q=v?E.nodeLookup.get(F):Oge(F)?F:E.nodeLookup.get(F.id)),q?(P=!0,JX(D,FX(q,E.nodeOrigin))):D},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return P?GX(N):{x:0,y:0,width:0,height:0}},PA=(p,E={})=>{let P={x:1/0,y:1/0,x2:-1/0,y2:-1/0},N=!1;return p.forEach(D=>{(E.filter===void 0||E.filter(D))&&(P=JX(P,FX(D)),N=!0)}),N?GX(P):{x:0,y:0,width:0,height:0}},Nge=(p,E,[P,N,D]=[0,0,1],F=!1,v=!1)=>{const q=(E.x-P)/D,te=(E.y-N)/D,ie=E.width/D,pe=E.height/D,oe=[];for(const z of p.values()){const{measured:Z,selectable:ne=!0,hidden:U=!1}=z;if(v&&!ne||U)continue;const xe=Z.width??z.width??z.initialWidth??0,ce=Z.height??z.height??z.initialHeight??0,{x:ge,y:ee}=z.internals.positionAbsolute,Me=zhn(q,te,ie,pe,ge,ee,xe,ce),Ke=xe*ce,Xe=F&&Me>0;(!z.internals.handleBounds||Xe||Me>=Ke||z.dragging)&&oe.push(z)}return oe},zBn=(p,E)=>{const P=new Set;return p.forEach(N=>{P.add(N.id)}),E.filter(N=>P.has(N.source)||P.has(N.target))};function UBn(p,E){const P=new Map,N=E!=null&&E.nodes?new Set(E.nodes.map(D=>D.id)):null;return p.forEach(D=>{let F;if(E!=null&&E.includeHiddenNodes){const{width:v,height:q}=i2(D);F=v>0&&q>0}else F=!!(D.measured.width&&D.measured.height&&!D.hidden);F&&(!N||N.has(D.id))&&P.set(D.id,D)}),P}async function XBn({nodes:p,width:E,height:P,panZoom:N,minZoom:D,maxZoom:F},v){if(p.size===0)return!0;const q=UBn(p,v),te=PA(q),ie=Lge(te,E,P,(v==null?void 0:v.minZoom)??D,(v==null?void 0:v.maxZoom)??F,(v==null?void 0:v.padding)??.1);return await N.setViewport(ie,{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),!0}function Ghn({nodeId:p,nextPosition:E,nodeLookup:P,nodeOrigin:N=[0,0],nodeExtent:D,onError:F}){const v=P.get(p),q=v.parentId?P.get(v.parentId):void 0,{x:te,y:ie}=q?q.internals.positionAbsolute:{x:0,y:0},pe=v.origin??N;let oe=v.extent||D;if(v.extent==="parent"&&!v.expandParent)if(!q)F==null||F("005",t2.error005());else{const{width:Z,height:ne}=i2(q);Z&&ne&&(oe=[[te,ie],[te+Z,ie+ne]])}else q&&Y8(v.extent)&&(oe=[[v.extent[0][0]+te,v.extent[0][1]+ie],[v.extent[1][0]+te,v.extent[1][1]+ie]]);const z=Y8(oe)?Q8(E,oe,v.measured):E;return(v.measured.width===void 0||v.measured.height===void 0)&&(F==null||F("015",t2.error015())),{position:{x:z.x-te+(v.measured.width??0)*pe[0],y:z.y-ie+(v.measured.height??0)*pe[1]},positionAbsolute:z}}async function KBn({nodesToRemove:p=[],edgesToRemove:E=[],nodes:P,edges:N,onBeforeDelete:D}){const F=new Set(p.map(z=>z.id)),v=[];for(const z of P){if(z.deletable===!1)continue;const Z=F.has(z.id),ne=!Z&&z.parentId&&v.find(U=>U.id===z.parentId);(Z||ne)&&v.push(z)}const q=new Set(E.map(z=>z.id)),te=N.filter(z=>z.deletable!==!1),pe=zBn(v,te);for(const z of te)q.has(z.id)&&!pe.find(ne=>ne.id===z.id)&&pe.push(z);if(!D)return{edges:pe,nodes:v};const oe=await D({nodes:v,edges:pe});return typeof oe=="boolean"?oe?{edges:pe,nodes:v}:{edges:[],nodes:[]}:oe}const TA=(p,E=0,P=1)=>Math.min(Math.max(p,E),P),Q8=(p={x:0,y:0},E,P)=>({x:TA(p.x,E[0][0],E[1][0]-((P==null?void 0:P.width)??0)),y:TA(p.y,E[0][1],E[1][1]-((P==null?void 0:P.height)??0))});function Hhn(p,E,P){const{width:N,height:D}=i2(P),{x:F,y:v}=P.internals.positionAbsolute;return Q8(p,[[F,v],[F+N,v+D]],E)}const _ln=(p,E,P)=>p<E?TA(Math.abs(p-E),1,E)/E:p>P?-TA(Math.abs(p-P),1,E)/E:0,Dge=(p,E,P=15,N=40)=>{const D=_ln(p.x,N,E.width-N)*P,F=_ln(p.y,N,E.height-N)*P;return[D,F]},JX=(p,E)=>({x:Math.min(p.x,E.x),y:Math.min(p.y,E.y),x2:Math.max(p.x2,E.x2),y2:Math.max(p.y2,E.y2)}),jge=({x:p,y:E,width:P,height:N})=>({x:p,y:E,x2:p+P,y2:E+N}),GX=({x:p,y:E,x2:P,y2:N})=>({x:p,y:E,width:P-p,height:N-E}),lN=(p,E=[0,0])=>{var D,F;const{x:P,y:N}=Oge(p)?p.internals.positionAbsolute:dN(p,E);return{x:P,y:N,width:((D=p.measured)==null?void 0:D.width)??p.width??p.initialWidth??0,height:((F=p.measured)==null?void 0:F.height)??p.height??p.initialHeight??0}},FX=(p,E=[0,0])=>{var D,F;const{x:P,y:N}=Oge(p)?p.internals.positionAbsolute:dN(p,E);return{x:P,y:N,x2:P+(((D=p.measured)==null?void 0:D.width)??p.width??p.initialWidth??0),y2:N+(((F=p.measured)==null?void 0:F.height)??p.height??p.initialHeight??0)}},qhn=(p,E)=>GX(JX(jge(p),jge(E))),zhn=(p,E,P,N,D,F,v,q)=>{const te=Math.max(0,Math.min(p+P,D+v)-Math.max(p,D)),ie=Math.max(0,Math.min(E+N,F+q)-Math.max(E,F));return Math.ceil(te*ie)},BX=(p,E)=>zhn(p.x,p.y,p.width,p.height,E.x,E.y,E.width,E.height),Jln=p=>Zg(p.width)&&Zg(p.height)&&Zg(p.x)&&Zg(p.y),Zg=p=>!isNaN(p)&&isFinite(p),Uhn=(p,E)=>(P,N)=>{},bN=(p,E=[1,1])=>({x:E[0]*Math.round(p.x/E[0]),y:E[1]*Math.round(p.y/E[1])}),wN=({x:p,y:E},[P,N,D],F=!1,v=[1,1])=>{const q={x:(p-P)/D,y:(E-N)/D};return F?bN(q,v):q},SA=({x:p,y:E},[P,N,D])=>({x:p*D+P,y:E*D+N});function AA(p,E){if(typeof p=="number")return Math.floor((E-E/(1+p))*.5);if(typeof p=="string"&&p.endsWith("px")){const P=parseFloat(p);if(!Number.isNaN(P))return Math.floor(P)}if(typeof p=="string"&&p.endsWith("%")){const P=parseFloat(p);if(!Number.isNaN(P))return Math.floor(E*P*.01)}return console.error(`The padding value "${p}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function WBn(p,E,P){if(typeof p=="string"||typeof p=="number"){const N=AA(p,P),D=AA(p,E);return{top:N,right:D,bottom:N,left:D,x:D*2,y:N*2}}if(typeof p=="object"){const N=AA(p.top??p.y??0,P),D=AA(p.bottom??p.y??0,P),F=AA(p.left??p.x??0,E),v=AA(p.right??p.x??0,E);return{top:N,right:v,bottom:D,left:F,x:F+v,y:N+D}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function VBn(p,E,P,N,D,F){const{x:v,y:q}=SA(p,[E,P,N]),{x:te,y:ie}=SA({x:p.x+p.width,y:p.y+p.height},[E,P,N]),pe=D-te,oe=F-ie;return{left:Math.floor(v),top:Math.floor(q),right:Math.floor(pe),bottom:Math.floor(oe)}}const Lge=(p,E,P,N,D,F)=>{const v=WBn(F,E,P),q=(E-v.x)/p.width,te=(P-v.y)/p.height,ie=Math.min(q,te),pe=TA(ie,N,D),oe=p.x+p.width/2,z=p.y+p.height/2,Z=E/2-oe*pe,ne=P/2-z*pe,U=VBn(p,Z,ne,pe,E,P),xe={left:Math.min(U.left-v.left,0),top:Math.min(U.top-v.top,0),right:Math.min(U.right-v.right,0),bottom:Math.min(U.bottom-v.bottom,0)};return{x:Z-xe.left+xe.right,y:ne-xe.top+xe.bottom,zoom:pe}},hN=()=>{var p;return typeof navigator<"u"&&((p=navigator==null?void 0:navigator.userAgent)==null?void 0:p.indexOf("Mac"))>=0};function Y8(p){return p!=null&&p!=="parent"}function i2(p){var E,P;return{width:((E=p.measured)==null?void 0:E.width)??p.width??p.initialWidth??0,height:((P=p.measured)==null?void 0:P.height)??p.height??p.initialHeight??0}}function Xhn(p){var E,P;return(((E=p.measured)==null?void 0:E.width)??p.width??p.initialWidth)!==void 0&&(((P=p.measured)==null?void 0:P.height)??p.height??p.initialHeight)!==void 0}function Khn(p,E={width:0,height:0},P,N,D){const F={...p},v=N.get(P);if(v){const q=v.origin||D;F.x+=v.internals.positionAbsolute.x-(E.width??0)*q[0],F.y+=v.internals.positionAbsolute.y-(E.height??0)*q[1]}return F}function Gln(p,E){if(p.size!==E.size)return!1;for(const P of p)if(!E.has(P))return!1;return!0}function QBn(){let p,E;return{promise:new Promise((N,D)=>{p=N,E=D}),resolve:p,reject:E}}function YBn(p){return{...Rhn,...p||{}}}function Whn(p){return p===null?null:p?"valid":"invalid"}function rN(p,{snapGrid:E=[0,0],snapToGrid:P=!1,transform:N,containerBounds:D}){const{x:F,y:v}=e2(p),q=wN({x:F-((D==null?void 0:D.left)??0),y:v-((D==null?void 0:D.top)??0)},N),{x:te,y:ie}=P?bN(q,E):q;return{xSnapped:te,ySnapped:ie,...q}}const $ge=p=>({width:p.offsetWidth,height:p.offsetHeight}),Vhn=p=>{var E;return((E=p==null?void 0:p.getRootNode)==null?void 0:E.call(p))||(window==null?void 0:window.document)},ZBn=["INPUT","SELECT","TEXTAREA"];function Qhn(p){var N,D;const E=((D=(N=p.composedPath)==null?void 0:N.call(p))==null?void 0:D[0])||p.target;return(E==null?void 0:E.nodeType)!==1?!1:ZBn.includes(E.nodeName)||E.hasAttribute("contenteditable")||!!E.closest(".nokey")}const Yhn=p=>"clientX"in p,e2=(p,E)=>{var F,v;const P=Yhn(p),N=P?p.clientX:(F=p.touches)==null?void 0:F[0].clientX,D=P?p.clientY:(v=p.touches)==null?void 0:v[0].clientY;return{x:N-((E==null?void 0:E.left)??0),y:D-((E==null?void 0:E.top)??0)}},Hln=(p,E,P,N,D)=>{const F=E.querySelectorAll(`.${p}`);return!F||!F.length?null:Array.from(F).map(v=>{const q=v.getBoundingClientRect();return{id:v.getAttribute("data-handleid"),type:p,nodeId:D,position:v.getAttribute("data-handlepos"),x:(q.left-P.left)/N,y:(q.top-P.top)/N,...$ge(v)}})};function Zhn({sourceX:p,sourceY:E,targetX:P,targetY:N,sourceControlX:D,sourceControlY:F,targetControlX:v,targetControlY:q}){const te=p*.125+D*.375+v*.375+P*.125,ie=E*.125+F*.375+q*.375+N*.125,pe=Math.abs(te-p),oe=Math.abs(ie-E);return[te,ie,pe,oe]}function TX(p,E){return p>=0?.5*p:E*25*Math.sqrt(-p)}function qln({pos:p,x1:E,y1:P,x2:N,y2:D,c:F}){switch(p){case ji.Left:return[E-TX(E-N,F),P];case ji.Right:return[E+TX(N-E,F),P];case ji.Top:return[E,P-TX(P-D,F)];case ji.Bottom:return[E,P+TX(D-P,F)]}}function gN({sourceX:p,sourceY:E,sourcePosition:P=ji.Bottom,targetX:N,targetY:D,targetPosition:F=ji.Top,curvature:v=.25}){const[q,te]=qln({pos:P,x1:p,y1:E,x2:N,y2:D,c:v}),[ie,pe]=qln({pos:F,x1:N,y1:D,x2:p,y2:E,c:v}),[oe,z,Z,ne]=Zhn({sourceX:p,sourceY:E,targetX:N,targetY:D,sourceControlX:q,sourceControlY:te,targetControlX:ie,targetControlY:pe});return[`M${p},${E} C${q},${te} ${ie},${pe} ${N},${D}`,oe,z,Z,ne]}function ean({sourceX:p,sourceY:E,targetX:P,targetY:N}){const D=Math.abs(P-p)/2,F=P<p?P+D:P-D,v=Math.abs(N-E)/2,q=N<E?N+v:N-v;return[F,q,D,v]}function eRn({sourceNode:p,targetNode:E,selected:P=!1,zIndex:N=0,elevateOnSelect:D=!1,zIndexMode:F="basic"}){if(F==="manual")return N;const v=D&&P?N+1e3:N,q=Math.max(p.parentId||D&&p.selected?p.internals.z:0,E.parentId||D&&E.selected?E.internals.z:0);return v+q}function nRn({sourceNode:p,targetNode:E,width:P,height:N,transform:D}){const F=JX(FX(p),FX(E));F.x===F.x2&&(F.x2+=1),F.y===F.y2&&(F.y2+=1);const v={x:-D[0]/D[2],y:-D[1]/D[2],width:P/D[2],height:N/D[2]};return BX(v,GX(F))>0}const tRn=({source:p,sourceHandle:E,target:P,targetHandle:N})=>`xy-edge__${p}${E||""}-${P}${N||""}`,iRn=(p,E)=>E.some(P=>P.source===p.source&&P.target===p.target&&(P.sourceHandle===p.sourceHandle||!P.sourceHandle&&!p.sourceHandle)&&(P.targetHandle===p.targetHandle||!P.targetHandle&&!p.targetHandle)),rRn=(p,E,P={})=>{var F;if(!p.source||!p.target)return(F=P.onError)==null||F.call(P,"006",t2.error006()),E;const N=P.getEdgeId||tRn;let D;return Jhn(p)?D={...p}:D={...p,id:N(p)},iRn(D,E)?E:(D.sourceHandle===null&&delete D.sourceHandle,D.targetHandle===null&&delete D.targetHandle,E.concat(D))};function nan({sourceX:p,sourceY:E,targetX:P,targetY:N}){const[D,F,v,q]=ean({sourceX:p,sourceY:E,targetX:P,targetY:N});return[`M ${p},${E}L ${P},${N}`,D,F,v,q]}const zln={[ji.Left]:{x:-1,y:0},[ji.Right]:{x:1,y:0},[ji.Top]:{x:0,y:-1},[ji.Bottom]:{x:0,y:1}},cRn=({source:p,sourcePosition:E=ji.Bottom,target:P})=>E===ji.Left||E===ji.Right?p.x<P.x?{x:1,y:0}:{x:-1,y:0}:p.y<P.y?{x:0,y:1}:{x:0,y:-1},Uln=(p,E)=>Math.sqrt(Math.pow(E.x-p.x,2)+Math.pow(E.y-p.y,2));function uRn({source:p,sourcePosition:E=ji.Bottom,target:P,targetPosition:N=ji.Top,center:D,offset:F,stepPosition:v}){const q=zln[E],te=zln[N],ie={x:p.x+q.x*F,y:p.y+q.y*F},pe={x:P.x+te.x*F,y:P.y+te.y*F},oe=cRn({source:ie,sourcePosition:E,target:pe}),z=oe.x!==0?"x":"y",Z=oe[z];let ne=[],U,xe;const ce={x:0,y:0},ge={x:0,y:0},[,,ee,Me]=ean({sourceX:p.x,sourceY:p.y,targetX:P.x,targetY:P.y});if(q[z]*te[z]===-1){z==="x"?(U=D.x??ie.x+(pe.x-ie.x)*v,xe=D.y??(ie.y+pe.y)/2):(U=D.x??(ie.x+pe.x)/2,xe=D.y??ie.y+(pe.y-ie.y)*v);const kn=[{x:U,y:ie.y},{x:U,y:pe.y}],jn=[{x:ie.x,y:xe},{x:pe.x,y:xe}];q[z]===Z?ne=z==="x"?kn:jn:ne=z==="x"?jn:kn}else{const kn=[{x:ie.x,y:pe.y}],jn=[{x:pe.x,y:ie.y}];if(z==="x"?ne=q.x===Z?jn:kn:ne=q.y===Z?kn:jn,E===N){const je=Math.abs(p[z]-P[z]);if(je<=F){const on=Math.min(F-1,F-je);q[z]===Z?ce[z]=(ie[z]>p[z]?-1:1)*on:ge[z]=(pe[z]>P[z]?-1:1)*on}}if(E!==N){const je=z==="x"?"y":"x",on=q[z]===te[je],rn=ie[je]>pe[je],Sn=ie[je]<pe[je];(q[z]===1&&(!on&&rn||on&&Sn)||q[z]!==1&&(!on&&Sn||on&&rn))&&(ne=z==="x"?kn:jn)}const Zn={x:ie.x+ce.x,y:ie.y+ce.y},$n={x:pe.x+ge.x,y:pe.y+ge.y},Vn=Math.max(Math.abs(Zn.x-ne[0].x),Math.abs($n.x-ne[0].x)),_=Math.max(Math.abs(Zn.y-ne[0].y),Math.abs($n.y-ne[0].y));Vn>=_?(U=(Zn.x+$n.x)/2,xe=ne[0].y):(U=ne[0].x,xe=(Zn.y+$n.y)/2)}const Ke={x:ie.x+ce.x,y:ie.y+ce.y},Xe={x:pe.x+ge.x,y:pe.y+ge.y};return[[p,...Ke.x!==ne[0].x||Ke.y!==ne[0].y?[Ke]:[],...ne,...Xe.x!==ne[ne.length-1].x||Xe.y!==ne[ne.length-1].y?[Xe]:[],P],U,xe,ee,Me]}function oRn(p,E,P,N){const D=Math.min(Uln(p,E)/2,Uln(E,P)/2,N),{x:F,y:v}=E;if(p.x===F&&F===P.x||p.y===v&&v===P.y)return`L${F} ${v}`;if(p.y===v){const ie=p.x<P.x?-1:1,pe=p.y<P.y?1:-1;return`L ${F+D*ie},${v}Q ${F},${v} ${F},${v+D*pe}`}const q=p.x<P.x?1:-1,te=p.y<P.y?-1:1;return`L ${F},${v+D*te}Q ${F},${v} ${F+D*q},${v}`}function Ege({sourceX:p,sourceY:E,sourcePosition:P=ji.Bottom,targetX:N,targetY:D,targetPosition:F=ji.Top,borderRadius:v=5,centerX:q,centerY:te,offset:ie=20,stepPosition:pe=.5}){const[oe,z,Z,ne,U]=uRn({source:{x:p,y:E},sourcePosition:P,target:{x:N,y:D},targetPosition:F,center:{x:q,y:te},offset:ie,stepPosition:pe});let xe=`M${oe[0].x} ${oe[0].y}`;for(let ce=1;ce<oe.length-1;ce++)xe+=oRn(oe[ce-1],oe[ce],oe[ce+1],v);return xe+=`L${oe[oe.length-1].x} ${oe[oe.length-1].y}`,[xe,z,Z,ne,U]}function Xln(p){var E;return p&&!!(p.internals.handleBounds||(E=p.handles)!=null&&E.length)&&!!(p.measured.width||p.width||p.initialWidth)}function sRn(p){var oe;const{sourceNode:E,targetNode:P}=p;if(!Xln(E)||!Xln(P))return null;const N=E.internals.handleBounds||Kln(E.handles),D=P.internals.handleBounds||Kln(P.handles),F=Wln((N==null?void 0:N.source)??[],p.sourceHandle),v=Wln(p.connectionMode===xA.Strict?(D==null?void 0:D.target)??[]:((D==null?void 0:D.target)??[]).concat((D==null?void 0:D.source)??[]),p.targetHandle);if(!F||!v)return(oe=p.onError)==null||oe.call(p,"008",t2.error008(F?"target":"source",{id:p.id,sourceHandle:p.sourceHandle,targetHandle:p.targetHandle})),null;const q=(F==null?void 0:F.position)||ji.Bottom,te=(v==null?void 0:v.position)||ji.Top,ie=Z8(E,F,q),pe=Z8(P,v,te);return{sourceX:ie.x,sourceY:ie.y,targetX:pe.x,targetY:pe.y,sourcePosition:q,targetPosition:te}}function Kln(p){if(!p)return null;const E=[],P=[];for(const N of p)N.width=N.width??1,N.height=N.height??1,N.type==="source"?E.push(N):N.type==="target"&&P.push(N);return{source:E,target:P}}function Z8(p,E,P=ji.Left,N=!1){const D=((E==null?void 0:E.x)??0)+p.internals.positionAbsolute.x,F=((E==null?void 0:E.y)??0)+p.internals.positionAbsolute.y,{width:v,height:q}=E??i2(p);if(N)return{x:D+v/2,y:F+q/2};switch((E==null?void 0:E.position)??P){case ji.Top:return{x:D+v/2,y:F};case ji.Right:return{x:D+v,y:F+q/2};case ji.Bottom:return{x:D+v/2,y:F+q};case ji.Left:return{x:D,y:F+q/2}}}function Wln(p,E){return p&&(E?p.find(P=>P.id===E):p[0])||null}function Age(p,E){return p?typeof p=="string"?p:`${E?`${E}__`:""}${Object.keys(p).sort().map(N=>`${N}=${p[N]}`).join("&")}`:""}function fRn(p,{id:E,defaultColor:P,defaultMarkerStart:N,defaultMarkerEnd:D}){const F=new Set;return p.reduce((v,q)=>([q.markerStart||N,q.markerEnd||D].forEach(te=>{if(te&&typeof te=="object"){const ie=Age(te,E);F.has(ie)||(v.push({id:ie,color:te.color||P,...te}),F.add(ie))}}),v),[]).sort((v,q)=>v.id.localeCompare(q.id))}function lRn(p,E,P,N,D){let F=.5;D==="start"?F=0:D==="end"&&(F=1);let v=[(p.x+p.width*F)*E.zoom+E.x,p.y*E.zoom+E.y-N],q=[-100*F,-100];switch(P){case ji.Right:v=[(p.x+p.width)*E.zoom+E.x+N,(p.y+p.height*F)*E.zoom+E.y],q=[0,-100*F];break;case ji.Bottom:v[1]=(p.y+p.height)*E.zoom+E.y+N,q[1]=0;break;case ji.Left:v=[p.x*E.zoom+E.x-N,(p.y+p.height*F)*E.zoom+E.y],q=[-100,-100*F];break}return`translate(${v[0]}px, ${v[1]}px) translate(${q[0]}%, ${q[1]}%)`}const tan=1e3,hRn=10,Fge={nodeOrigin:[0,0],nodeExtent:oN,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},aRn={...Fge,checkEquality:!0};function Bge(p,E){const P={...p};for(const N in E)E[N]!==void 0&&(P[N]=E[N]);return P}function dRn(p,E,P){const N=Bge(Fge,P);for(const D of p.values())if(D.parentId)_ge(D,p,E,N);else{const F=dN(D,N.nodeOrigin),v=Y8(D.extent)?D.extent:N.nodeExtent,q=Q8(F,v,i2(D));D.internals.positionAbsolute=q}}function bRn(p,E){if(!p.handles)return p.measured?E==null?void 0:E.internals.handleBounds:void 0;const P=[],N=[];for(const D of p.handles){const F={id:D.id,width:D.width??1,height:D.height??1,nodeId:p.id,x:D.x,y:D.y,position:D.position,type:D.type};D.type==="source"?P.push(F):D.type==="target"&&N.push(F)}return{source:P,target:N}}function Rge(p){return p==="manual"}function Mge(p,E,P,N={}){var pe,oe;const D=Bge(aRn,N),F={i:0},v=new Map(E),q=D!=null&&D.elevateNodesOnSelect&&!Rge(D.zIndexMode)?tan:0;let te=p.length>0,ie=!1;E.clear(),P.clear();for(const z of p){let Z=v.get(z.id);if(D.checkEquality&&z===(Z==null?void 0:Z.internals.userNode))E.set(z.id,Z);else{const ne=dN(z,D.nodeOrigin),U=Y8(z.extent)?z.extent:D.nodeExtent,xe=Q8(ne,U,i2(z));Z={...D.defaults,...z,measured:{width:(pe=z.measured)==null?void 0:pe.width,height:(oe=z.measured)==null?void 0:oe.height},internals:{positionAbsolute:xe,handleBounds:bRn(z,Z),z:ian(z,q,D.zIndexMode),userNode:z}},E.set(z.id,Z)}(Z.measured===void 0||Z.measured.width===void 0||Z.measured.height===void 0)&&!Z.hidden&&(te=!1),z.parentId&&_ge(Z,E,P,N,F),ie||(ie=z.selected??!1)}return{nodesInitialized:te,hasSelectedNodes:ie}}function wRn(p,E){if(!p.parentId)return;const P=E.get(p.parentId);P?P.set(p.id,p):E.set(p.parentId,new Map([[p.id,p]]))}function _ge(p,E,P,N,D){const{elevateNodesOnSelect:F,nodeOrigin:v,nodeExtent:q,zIndexMode:te}=Bge(Fge,N),ie=p.parentId,pe=E.get(ie);if(!pe){console.warn(`Parent node ${ie} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}wRn(p,P),D&&!pe.parentId&&pe.internals.rootParentIndex===void 0&&te==="auto"&&(pe.internals.rootParentIndex=++D.i,pe.internals.z=pe.internals.z+D.i*hRn),D&&pe.internals.rootParentIndex!==void 0&&(D.i=pe.internals.rootParentIndex);const oe=F&&!Rge(te)?tan:0,{x:z,y:Z,z:ne}=gRn(p,pe,v,q,oe,te),{positionAbsolute:U}=p.internals,xe=z!==U.x||Z!==U.y;(xe||ne!==p.internals.z)&&E.set(p.id,{...p,internals:{...p.internals,positionAbsolute:xe?{x:z,y:Z}:U,z:ne}})}function ian(p,E,P){const N=Zg(p.zIndex)?p.zIndex:0;return Rge(P)?N:N+(p.selected?E:0)}function gRn(p,E,P,N,D,F){const{x:v,y:q}=E.internals.positionAbsolute,te=i2(p),ie=dN(p,P),pe=Y8(p.extent)?Q8(ie,p.extent,te):ie;let oe=Q8({x:v+pe.x,y:q+pe.y},N,te);p.extent==="parent"&&(oe=Hhn(oe,te,E));const z=ian(p,D,F),Z=E.internals.z??0;return{x:oe.x,y:oe.y,z:Z>=z?Z+1:z}}function Jge(p,E,P,N=[0,0]){var v;const D=[],F=new Map;for(const q of p){const te=E.get(q.parentId);if(!te)continue;const ie=((v=F.get(q.parentId))==null?void 0:v.expandedRect)??lN(te),pe=qhn(ie,q.rect);F.set(q.parentId,{expandedRect:pe,parent:te})}return F.size>0&&F.forEach(({expandedRect:q,parent:te},ie)=>{var ee;const pe=te.internals.positionAbsolute,oe=i2(te),z=te.origin??N,Z=q.x<pe.x?Math.round(Math.abs(pe.x-q.x)):0,ne=q.y<pe.y?Math.round(Math.abs(pe.y-q.y)):0,U=Math.max(oe.width,Math.round(q.width)),xe=Math.max(oe.height,Math.round(q.height)),ce=(U-oe.width)*z[0],ge=(xe-oe.height)*z[1];(Z>0||ne>0||ce||ge)&&(D.push({id:ie,type:"position",position:{x:te.position.x-Z+ce,y:te.position.y-ne+ge}}),(ee=P.get(ie))==null||ee.forEach(Me=>{p.some(Ke=>Ke.id===Me.id)||D.push({id:Me.id,type:"position",position:{x:Me.position.x+Z,y:Me.position.y+ne}})})),(oe.width<q.width||oe.height<q.height||Z||ne)&&D.push({id:ie,type:"dimensions",setAttributes:!0,dimensions:{width:U+(Z?z[0]*Z-ce:0),height:xe+(ne?z[1]*ne-ge:0)}})}),D}function pRn(p,E,P,N,D,F,v){const q=N==null?void 0:N.querySelector(".xyflow__viewport");let te=!1;if(!q)return{changes:[],updatedInternals:te};const ie=[],pe=window.getComputedStyle(q),{m22:oe}=new window.DOMMatrixReadOnly(pe.transform),z=[];for(const Z of p.values()){const ne=E.get(Z.id);if(!ne)continue;if(ne.hidden){E.set(ne.id,{...ne,internals:{...ne.internals,handleBounds:void 0}}),te=!0;continue}const U=$ge(Z.nodeElement),xe=ne.measured.width!==U.width||ne.measured.height!==U.height;if(!!(U.width&&U.height&&(xe||!ne.internals.handleBounds||Z.force))){const ge=Z.nodeElement.getBoundingClientRect(),ee=Y8(ne.extent)?ne.extent:F;let{positionAbsolute:Me}=ne.internals;if(ne.parentId&&ne.extent==="parent"){const Xe=E.get(ne.parentId);Xe&&(Me=Hhn(Me,U,Xe))}else ee&&(Me=Q8(Me,ee,U));const Ke={...ne,measured:U,internals:{...ne.internals,positionAbsolute:Me,handleBounds:{source:Hln("source",Z.nodeElement,ge,oe,ne.id),target:Hln("target",Z.nodeElement,ge,oe,ne.id)}}};E.set(ne.id,Ke),ne.parentId&&_ge(Ke,E,P,{nodeOrigin:D,zIndexMode:v}),te=!0,xe&&(ie.push({id:ne.id,type:"dimensions",dimensions:U}),ne.expandParent&&ne.parentId&&z.push({id:ne.id,parentId:ne.parentId,rect:lN(Ke,D)}))}}if(z.length>0){const Z=Jge(z,E,P,D);ie.push(...Z)}return{changes:ie,updatedInternals:te}}async function mRn({delta:p,panZoom:E,transform:P,translateExtent:N,width:D,height:F}){if(!E||!p.x&&!p.y)return!1;const v=await E.setViewportConstrained({x:P[0]+p.x,y:P[1]+p.y,zoom:P[2]},[[0,0],[D,F]],N);return!!v&&(v.x!==P[0]||v.y!==P[1]||v.k!==P[2])}function Vln(p,E,P,N,D,F){let v=D;const q=N.get(v)||new Map;N.set(v,q.set(P,E)),v=`${D}-${p}`;const te=N.get(v)||new Map;if(N.set(v,te.set(P,E)),F){v=`${D}-${p}-${F}`;const ie=N.get(v)||new Map;N.set(v,ie.set(P,E))}}function ran(p,E,P){p.clear(),E.clear();for(const N of P){const{source:D,target:F,sourceHandle:v=null,targetHandle:q=null}=N,te={edgeId:N.id,source:D,target:F,sourceHandle:v,targetHandle:q},ie=`${D}-${v}--${F}-${q}`,pe=`${F}-${q}--${D}-${v}`;Vln("source",te,pe,p,D,v),Vln("target",te,ie,p,F,q),E.set(N.id,N)}}function can(p,E){if(!p.parentId)return!1;const P=E.get(p.parentId);return P?P.selected?!0:can(P,E):!1}function Qln(p,E,P){var D;let N=p;do{if((D=N==null?void 0:N.matches)!=null&&D.call(N,E))return!0;if(N===P)return!1;N=N==null?void 0:N.parentElement}while(N);return!1}function vRn(p,E,P,N){const D=new Map;for(const[F,v]of p)if((v.selected||v.id===N)&&(!v.parentId||!can(v,p))&&(v.draggable||E&&typeof v.draggable>"u")){const q=p.get(F);q&&D.set(F,{id:F,position:q.position||{x:0,y:0},distance:{x:P.x-q.internals.positionAbsolute.x,y:P.y-q.internals.positionAbsolute.y},extent:q.extent,parentId:q.parentId,origin:q.origin,expandParent:q.expandParent,internals:{positionAbsolute:q.internals.positionAbsolute||{x:0,y:0}},measured:{width:q.measured.width??0,height:q.measured.height??0}})}return D}function wge({nodeId:p,dragItems:E,nodeLookup:P,dragging:N=!0}){var v,q,te;const D=[];for(const[ie,pe]of E){const oe=(v=P.get(ie))==null?void 0:v.internals.userNode;oe&&D.push({...oe,position:pe.position,dragging:N})}if(!p)return[D[0],D];const F=(q=P.get(p))==null?void 0:q.internals.userNode;return[F?{...F,position:((te=E.get(p))==null?void 0:te.position)||F.position,dragging:N}:D[0],D]}function yRn({dragItems:p,snapGrid:E,x:P,y:N}){const D=p.values().next().value;if(!D)return null;const F={x:P-D.distance.x,y:N-D.distance.y},v=bN(F,E);return{x:v.x-F.x,y:v.y-F.y}}function kRn({onNodeMouseDown:p,getStoreItems:E,onDragStart:P,onDrag:N,onDragStop:D}){let F={x:null,y:null},v=0,q=new Map,te=!1,ie={x:0,y:0},pe=null,oe=!1,z=null,Z=!1,ne=!1,U=null;function xe({noDragClassName:ge,handleSelector:ee,domNode:Me,isSelectable:Ke,nodeId:Xe,nodeClickDistance:Ye=0}){z=$0(Me);function kn({x:Vn,y:_}){const{nodeLookup:je,nodeExtent:on,snapGrid:rn,snapToGrid:Sn,nodeOrigin:Bn,onNodeDrag:dn,onSelectionDrag:Gn,onError:Nn,updateNodePositions:qn}=E();F={x:Vn,y:_};let Jt=!1;const Kt=q.size>1,Oi=Kt&&on?jge(PA(q)):null,gr=Kt&&Sn?yRn({dragItems:q,snapGrid:rn,x:Vn,y:_}):null;for(const[Ki,Kn]of q){if(!je.has(Ki))continue;let ei={x:Vn-Kn.distance.x,y:_-Kn.distance.y};Sn&&(ei=gr?{x:Math.round(ei.x+gr.x),y:Math.round(ei.y+gr.y)}:bN(ei,rn));let rr=null;if(Kt&&on&&!Kn.extent&&Oi){const{positionAbsolute:sr}=Kn.internals,ri=sr.x-Oi.x+on[0][0],bi=sr.x+Kn.measured.width-Oi.x2+on[1][0],Mc=sr.y-Oi.y+on[0][1],ku=sr.y+Kn.measured.height-Oi.y2+on[1][1];rr=[[ri,Mc],[bi,ku]]}const{position:cr,positionAbsolute:_i}=Ghn({nodeId:Ki,nextPosition:ei,nodeLookup:je,nodeExtent:rr||on,nodeOrigin:Bn,onError:Nn});Jt=Jt||Kn.position.x!==cr.x||Kn.position.y!==cr.y,Kn.position=cr,Kn.internals.positionAbsolute=_i}if(ne=ne||Jt,!!Jt&&(qn(q,!0),U&&(N||dn||!Xe&&Gn))){const[Ki,Kn]=wge({nodeId:Xe,dragItems:q,nodeLookup:je});N==null||N(U,q,Ki,Kn),dn==null||dn(U,Ki,Kn),Xe||Gn==null||Gn(U,Kn)}}async function jn(){if(!pe)return;const{transform:Vn,panBy:_,autoPanSpeed:je,autoPanOnNodeDrag:on}=E();if(!on){te=!1,cancelAnimationFrame(v);return}const[rn,Sn]=Dge(ie,pe,je);(rn!==0||Sn!==0)&&(F.x=(F.x??0)-rn/Vn[2],F.y=(F.y??0)-Sn/Vn[2],await _({x:rn,y:Sn})&&kn(F)),v=requestAnimationFrame(jn)}function Zn(Vn){var Kt;const{nodeLookup:_,multiSelectionActive:je,nodesDraggable:on,transform:rn,snapGrid:Sn,snapToGrid:Bn,selectNodesOnDrag:dn,onNodeDragStart:Gn,onSelectionDragStart:Nn,unselectNodesAndEdges:qn}=E();oe=!0,(!dn||!Ke)&&!je&&Xe&&((Kt=_.get(Xe))!=null&&Kt.selected||qn()),Ke&&dn&&Xe&&(p==null||p(Xe));const Jt=rN(Vn.sourceEvent,{transform:rn,snapGrid:Sn,snapToGrid:Bn,containerBounds:pe});if(F=Jt,q=vRn(_,on,Jt,Xe),q.size>0&&(P||Gn||!Xe&&Nn)){const[Oi,gr]=wge({nodeId:Xe,dragItems:q,nodeLookup:_});P==null||P(Vn.sourceEvent,q,Oi,gr),Gn==null||Gn(Vn.sourceEvent,Oi,gr),Xe||Nn==null||Nn(Vn.sourceEvent,gr)}}const $n=$hn().clickDistance(Ye).on("start",Vn=>{const{domNode:_,nodeDragThreshold:je,transform:on,snapGrid:rn,snapToGrid:Sn}=E();pe=(_==null?void 0:_.getBoundingClientRect())||null,Z=!1,ne=!1,U=Vn.sourceEvent,je===0&&Zn(Vn),F=rN(Vn.sourceEvent,{transform:on,snapGrid:rn,snapToGrid:Sn,containerBounds:pe}),ie=e2(Vn.sourceEvent,pe)}).on("drag",Vn=>{const{autoPanOnNodeDrag:_,transform:je,snapGrid:on,snapToGrid:rn,nodeDragThreshold:Sn,nodeLookup:Bn}=E(),dn=rN(Vn.sourceEvent,{transform:je,snapGrid:on,snapToGrid:rn,containerBounds:pe});if(U=Vn.sourceEvent,(Vn.sourceEvent.type==="touchmove"&&Vn.sourceEvent.touches.length>1||Xe&&!Bn.has(Xe))&&(Z=!0),!Z){if(!te&&_&&oe&&(te=!0,jn()),!oe){const Gn=e2(Vn.sourceEvent,pe),Nn=Gn.x-ie.x,qn=Gn.y-ie.y;Math.sqrt(Nn*Nn+qn*qn)>Sn&&Zn(Vn)}(F.x!==dn.xSnapped||F.y!==dn.ySnapped)&&q&&oe&&(ie=e2(Vn.sourceEvent,pe),kn(dn))}}).on("end",Vn=>{if(!oe||Z){Z&&q.size>0&&E().updateNodePositions(q,!1);return}if(te=!1,oe=!1,cancelAnimationFrame(v),q.size>0){const{nodeLookup:_,updateNodePositions:je,onNodeDragStop:on,onSelectionDragStop:rn}=E();if(ne&&(je(q,!1),ne=!1),D||on||!Xe&&rn){const[Sn,Bn]=wge({nodeId:Xe,dragItems:q,nodeLookup:_,dragging:!1});D==null||D(Vn.sourceEvent,q,Sn,Bn),on==null||on(Vn.sourceEvent,Sn,Bn),Xe||rn==null||rn(Vn.sourceEvent,Bn)}}}).filter(Vn=>{const _=Vn.target;return!Vn.button&&(!ge||!Qln(_,`.${ge}`,Me))&&(!ee||Qln(_,ee,Me))});z.call($n)}function ce(){z==null||z.on(".drag",null)}return{update:xe,destroy:ce}}function jRn(p,E,P){const N=[],D={x:p.x-P,y:p.y-P,width:P*2,height:P*2};for(const F of E.values())BX(D,lN(F))>0&&N.push(F);return N}const ERn=250;function ARn(p,E,P,N){var q,te;let D=[],F=1/0;const v=jRn(p,P,E+ERn);for(const ie of v){const pe=[...((q=ie.internals.handleBounds)==null?void 0:q.source)??[],...((te=ie.internals.handleBounds)==null?void 0:te.target)??[]];for(const oe of pe){if(N.nodeId===oe.nodeId&&N.type===oe.type&&N.id===oe.id)continue;const{x:z,y:Z}=Z8(ie,oe,oe.position,!0),ne=Math.sqrt(Math.pow(z-p.x,2)+Math.pow(Z-p.y,2));ne>E||(ne<F?(D=[{...oe,x:z,y:Z}],F=ne):ne===F&&D.push({...oe,x:z,y:Z}))}}if(!D.length)return null;if(D.length>1){const ie=N.type==="source"?"target":"source";return D.find(pe=>pe.type===ie)??D[0]}return D[0]}function uan(p,E,P,N,D,F=!1){var ie,pe,oe;const v=N.get(p);if(!v)return null;const q=D==="strict"?(ie=v.internals.handleBounds)==null?void 0:ie[E]:[...((pe=v.internals.handleBounds)==null?void 0:pe.source)??[],...((oe=v.internals.handleBounds)==null?void 0:oe.target)??[]],te=(P?q==null?void 0:q.find(z=>z.id===P):q==null?void 0:q[0])??null;return te&&F?{...te,...Z8(v,te,te.position,!0)}:te}function oan(p,E){return p||(E!=null&&E.classList.contains("target")?"target":E!=null&&E.classList.contains("source")?"source":null)}function MRn(p,E){let P=null;return E?P=!0:p&&!E&&(P=!1),P}const san=()=>!0;function CRn(p,{connectionMode:E,connectionRadius:P,handleId:N,nodeId:D,edgeUpdaterType:F,isTarget:v,domNode:q,nodeLookup:te,lib:ie,autoPanOnConnect:pe,flowId:oe,panBy:z,cancelConnection:Z,onConnectStart:ne,onConnect:U,onConnectEnd:xe,isValidConnection:ce=san,onReconnectEnd:ge,updateConnection:ee,getTransform:Me,getFromHandle:Ke,autoPanSpeed:Xe,dragThreshold:Ye=1,handleDomNode:kn}){const jn=Vhn(p.target);let Zn=0,$n;const{x:Vn,y:_}=e2(p),je=oan(F,kn),on=q==null?void 0:q.getBoundingClientRect();let rn=!1;if(!on||!je)return;const Sn=uan(D,je,N,te,E);if(!Sn)return;let Bn=e2(p,on),dn=!1,Gn=null,Nn=!1,qn=null;function Jt(){if(!pe||!on)return;const[cr,_i]=Dge(Bn,on,Xe);z({x:cr,y:_i}),Zn=requestAnimationFrame(Jt)}const Kt={...Sn,nodeId:D,type:je,position:Sn.position},Oi=te.get(D);let Ki={inProgress:!0,isValid:null,from:Z8(Oi,Kt,ji.Left,!0),fromHandle:Kt,fromPosition:Kt.position,fromNode:Oi,to:Bn,toHandle:null,toPosition:Rln[Kt.position],toNode:null,pointer:Bn};function Kn(){rn=!0,ee(Ki),ne==null||ne(p,{nodeId:D,handleId:N,handleType:je})}Ye===0&&Kn();function ei(cr){if(!rn){const{x:ku,y:Pr}=e2(cr),xa=ku-Vn,zl=Pr-_;if(!(xa*xa+zl*zl>Ye*Ye))return;Kn()}if(!Ke()||!Kt){rr(cr);return}const _i=Me();Bn=e2(cr,on),$n=ARn(wN(Bn,_i,!1,[1,1]),P,te,Kt),dn||(Jt(),dn=!0);const sr=fan(cr,{handle:$n,connectionMode:E,fromNodeId:D,fromHandleId:N,fromType:v?"target":"source",isValidConnection:ce,doc:jn,lib:ie,flowId:oe,nodeLookup:te});qn=sr.handleDomNode,Gn=sr.connection,Nn=MRn(!!$n,sr.isValid);const ri=te.get(D),bi=ri?Z8(ri,Kt,ji.Left,!0):Ki.from,Mc={...Ki,from:bi,isValid:Nn,to:sr.toHandle&&Nn?SA({x:sr.toHandle.x,y:sr.toHandle.y},_i):Bn,toHandle:sr.toHandle,toPosition:Nn&&sr.toHandle?sr.toHandle.position:Rln[Kt.position],toNode:sr.toHandle?te.get(sr.toHandle.nodeId):null,pointer:Bn};ee(Mc),Ki=Mc}function rr(cr){if(!("touches"in cr&&cr.touches.length>0)){if(rn){($n||qn)&&Gn&&Nn&&(U==null||U(Gn));const{inProgress:_i,...sr}=Ki,ri={...sr,toPosition:Ki.toHandle?Ki.toPosition:null};xe==null||xe(cr,ri),F&&(ge==null||ge(cr,ri))}Z(),cancelAnimationFrame(Zn),dn=!1,Nn=!1,Gn=null,qn=null,jn.removeEventListener("mousemove",ei),jn.removeEventListener("mouseup",rr),jn.removeEventListener("touchmove",ei),jn.removeEventListener("touchend",rr)}}jn.addEventListener("mousemove",ei),jn.addEventListener("mouseup",rr),jn.addEventListener("touchmove",ei),jn.addEventListener("touchend",rr)}function fan(p,{handle:E,connectionMode:P,fromNodeId:N,fromHandleId:D,fromType:F,doc:v,lib:q,flowId:te,isValidConnection:ie=san,nodeLookup:pe}){const oe=F==="target",z=E?v.querySelector(`.${q}-flow__handle[data-id="${te}-${E==null?void 0:E.nodeId}-${E==null?void 0:E.id}-${E==null?void 0:E.type}"]`):null,{x:Z,y:ne}=e2(p),U=v.elementFromPoint(Z,ne),xe=U!=null&&U.classList.contains(`${q}-flow__handle`)?U:z,ce={handleDomNode:xe,isValid:!1,connection:null,toHandle:null};if(xe){const ge=oan(void 0,xe),ee=xe.getAttribute("data-nodeid"),Me=xe.getAttribute("data-handleid"),Ke=xe.classList.contains("connectable"),Xe=xe.classList.contains("connectableend");if(!ee||!ge)return ce;const Ye={source:oe?ee:N,sourceHandle:oe?Me:D,target:oe?N:ee,targetHandle:oe?D:Me};ce.connection=Ye;const jn=Ke&&Xe&&(P===xA.Strict?oe&&ge==="source"||!oe&&ge==="target":ee!==N||Me!==D);ce.isValid=jn&&ie(Ye),ce.toHandle=uan(ee,ge,Me,pe,P,!0)}return ce}const Cge={onPointerDown:CRn,isValid:fan};function xRn({domNode:p,panZoom:E,getTransform:P,getViewScale:N}){const D=$0(p);function F({translateExtent:q,width:te,height:ie,zoomStep:pe=1,pannable:oe=!0,zoomable:z=!0,inversePan:Z=!1}){const ne=ee=>{if(ee.sourceEvent.type!=="wheel"||!E)return;const Me=P(),Ke=ee.sourceEvent.ctrlKey&&hN()?10:1,Xe=-ee.sourceEvent.deltaY*(ee.sourceEvent.deltaMode===1?.05:ee.sourceEvent.deltaMode?1:.002)*pe,Ye=Me[2]*Math.pow(2,Xe*Ke);E.scaleTo(Ye)};let U=[0,0];const xe=ee=>{(ee.sourceEvent.type==="mousedown"||ee.sourceEvent.type==="touchstart")&&(U=[ee.sourceEvent.clientX??ee.sourceEvent.touches[0].clientX,ee.sourceEvent.clientY??ee.sourceEvent.touches[0].clientY])},ce=ee=>{const Me=P();if(ee.sourceEvent.type!=="mousemove"&&ee.sourceEvent.type!=="touchmove"||!E)return;const Ke=[ee.sourceEvent.clientX??ee.sourceEvent.touches[0].clientX,ee.sourceEvent.clientY??ee.sourceEvent.touches[0].clientY],Xe=[Ke[0]-U[0],Ke[1]-U[1]];U=Ke;const Ye=N()*Math.max(Me[2],Math.log(Me[2]))*(Z?-1:1),kn={x:Me[0]-Xe[0]*Ye,y:Me[1]-Xe[1]*Ye},jn=[[0,0],[te,ie]];E.setViewportConstrained({x:kn.x,y:kn.y,zoom:Me[2]},jn,q)},ge=Fhn().on("start",xe).on("zoom",oe?ce:null).on("zoom.wheel",z?ne:null);D.call(ge,{})}function v(){D.on("zoom",null)}return{update:F,destroy:v,pointer:Yg}}const HX=p=>({x:p.x,y:p.y,zoom:p.k}),gge=({x:p,y:E,zoom:P})=>Pge.translate(p,E).scale(P),_5=(p,E)=>p.target.closest(`.${E}`),lan=(p,E)=>E===2&&Array.isArray(p)&&p.includes(2),TRn=p=>((p*=2)<=1?p*p*p:(p-=2)*p*p+2)/2,pge=(p,E=0,P=TRn,N=()=>{})=>{const D=typeof E=="number"&&E>0;return D||N(),D?p.transition().duration(E).ease(P).on("end",N):p},han=p=>{const E=p.ctrlKey&&hN()?10:1;return-p.deltaY*(p.deltaMode===1?.05:p.deltaMode?1:.002)*E};function SRn({zoomPanValues:p,noWheelClassName:E,d3Selection:P,d3Zoom:N,panOnScrollMode:D,panOnScrollSpeed:F,zoomOnPinch:v,onPanZoomStart:q,onPanZoom:te,onPanZoomEnd:ie}){return pe=>{if(_5(pe,E))return pe.ctrlKey&&pe.preventDefault(),!1;pe.preventDefault(),pe.stopImmediatePropagation();const oe=P.property("__zoom").k||1;if(pe.ctrlKey&&v){const xe=Yg(pe),ce=han(pe),ge=oe*Math.pow(2,ce);N.scaleTo(P,ge,xe,pe);return}const z=pe.deltaMode===1?20:1;let Z=D===V8.Vertical?0:pe.deltaX*z,ne=D===V8.Horizontal?0:pe.deltaY*z;!hN()&&pe.shiftKey&&D!==V8.Vertical&&(Z=pe.deltaY*z,ne=0),N.translateBy(P,-(Z/oe)*F,-(ne/oe)*F,{internal:!0});const U=HX(P.property("__zoom"));clearTimeout(p.panScrollTimeout),p.isPanScrolling?te==null||te(pe,U):(p.isPanScrolling=!0,q==null||q(pe,U)),p.panScrollTimeout=setTimeout(()=>{ie==null||ie(pe,U),p.isPanScrolling=!1},150)}}function IRn({noWheelClassName:p,preventScrolling:E,d3ZoomHandler:P}){return function(N,D){const F=N.type==="wheel",v=!E&&F&&!N.ctrlKey,q=_5(N,p);if(N.ctrlKey&&F&&q&&N.preventDefault(),v||q)return null;N.preventDefault(),P.call(this,N,D)}}function PRn({zoomPanValues:p,onDraggingChange:E,onPanZoomStart:P}){return N=>{var F,v,q;if((F=N.sourceEvent)!=null&&F.internal)return;const D=HX(N.transform);p.mouseButton=((v=N.sourceEvent)==null?void 0:v.button)||0,p.isZoomingOrPanning=!0,p.prevViewport=D,((q=N.sourceEvent)==null?void 0:q.type)==="mousedown"&&E(!0),P&&(P==null||P(N.sourceEvent,D))}}function ORn({zoomPanValues:p,panOnDrag:E,onPaneContextMenu:P,onTransformChange:N,onPanZoom:D}){return F=>{var v,q;p.usedRightMouseButton=!!(P&&lan(E,p.mouseButton??0)),(v=F.sourceEvent)!=null&&v.sync||N([F.transform.x,F.transform.y,F.transform.k]),D&&!((q=F.sourceEvent)!=null&&q.internal)&&(D==null||D(F.sourceEvent,HX(F.transform)))}}function NRn({zoomPanValues:p,panOnDrag:E,panOnScroll:P,onDraggingChange:N,onPanZoomEnd:D,onPaneContextMenu:F}){return v=>{var q;if(!((q=v.sourceEvent)!=null&&q.internal)&&(p.isZoomingOrPanning=!1,F&&lan(E,p.mouseButton??0)&&!p.usedRightMouseButton&&v.sourceEvent&&F(v.sourceEvent),p.usedRightMouseButton=!1,N(!1),D)){const te=HX(v.transform);p.prevViewport=te,clearTimeout(p.timerId),p.timerId=setTimeout(()=>{D==null||D(v.sourceEvent,te)},P?150:0)}}}function DRn({panActivationKeyPressed:p,zoomActivationKeyPressed:E,zoomOnScroll:P,zoomOnPinch:N,panOnDrag:D,panOnScroll:F,zoomOnDoubleClick:v,userSelectionActive:q,noWheelClassName:te,noPanClassName:ie,lib:pe,connectionInProgress:oe}){return z=>{var ce;const Z=E||P,ne=N&&z.ctrlKey,U=z.type==="wheel";if(z.button===1&&z.type==="mousedown"&&(_5(z,`${pe}-flow__node`)||_5(z,`${pe}-flow__edge`)||_5(z,`${pe}-flow__selection`)||_5(z,`${pe}-flow__nodesselection`)))return!0;if(!D&&!Z&&!F&&!v&&!N||q||oe&&!U||_5(z,te)&&U||_5(z,ie)&&(!U||F&&U&&!E)||!N&&z.ctrlKey&&U)return!1;if(!N&&z.type==="touchstart"&&((ce=z.touches)==null?void 0:ce.length)>1)return z.preventDefault(),!1;if(!Z&&!F&&!ne&&U||!D&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(D)&&!D.includes(z.button)&&z.type==="mousedown")return!1;const xe=Array.isArray(D)&&D.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||U||p)&&xe}}function LRn({domNode:p,minZoom:E,maxZoom:P,translateExtent:N,viewport:D,onPanZoom:F,onPanZoomStart:v,onPanZoomEnd:q,onDraggingChange:te}){const ie={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},pe=p.getBoundingClientRect();let oe=[[0,0],[pe.width,pe.height]];const z=typeof ResizeObserver<"u"?new ResizeObserver(_=>{const je=_[0];je&&(oe=[[0,0],[je.contentRect.width,je.contentRect.height]])}):null;z==null||z.observe(p);const Z=Fhn().extent(()=>oe).scaleExtent([E,P]).translateExtent(N),ne=$0(p).call(Z);Me({x:D.x,y:D.y,zoom:TA(D.zoom,E,P)},[[0,0],[pe.width,pe.height]],N);const U=ne.on("wheel.zoom"),xe=ne.on("dblclick.zoom");Z.wheelDelta(han);async function ce(_,je){return ne?new Promise(on=>{Z==null||Z.interpolate((je==null?void 0:je.interpolate)==="linear"?hge:NX).transform(pge(ne,je==null?void 0:je.duration,je==null?void 0:je.ease,()=>on(!0)),_)}):!1}function ge({noWheelClassName:_,noPanClassName:je,onPaneContextMenu:on,userSelectionActive:rn,panOnScroll:Sn,panOnDrag:Bn,panOnScrollMode:dn,panOnScrollSpeed:Gn,preventScrolling:Nn,zoomOnPinch:qn,zoomOnScroll:Jt,zoomOnDoubleClick:Kt,panActivationKeyPressed:Oi=!1,zoomActivationKeyPressed:gr,lib:Ki,onTransformChange:Kn,connectionInProgress:ei,paneClickDistance:rr,selectionOnDrag:cr}){rn&&!ie.isZoomingOrPanning&&ee();const _i=Sn&&!gr&&!rn;Z.clickDistance(cr?1/0:!Zg(rr)||rr<0?0:rr);const sr=_i?SRn({zoomPanValues:ie,noWheelClassName:_,d3Selection:ne,d3Zoom:Z,panOnScrollMode:dn,panOnScrollSpeed:Gn,zoomOnPinch:qn,onPanZoomStart:v,onPanZoom:F,onPanZoomEnd:q}):IRn({noWheelClassName:_,preventScrolling:Nn,d3ZoomHandler:U});ne.on("wheel.zoom",sr,{passive:!1});const ri=PRn({zoomPanValues:ie,onDraggingChange:te,onPanZoomStart:v});Z.on("start",ri);const bi=ORn({zoomPanValues:ie,panOnDrag:Bn,onPaneContextMenu:!!on,onPanZoom:F,onTransformChange:Kn});Z.on("zoom",bi);const Mc=NRn({zoomPanValues:ie,panOnDrag:Bn,panOnScroll:Sn,onPaneContextMenu:on,onPanZoomEnd:q,onDraggingChange:te});Z.on("end",Mc);const ku=DRn({panActivationKeyPressed:Oi,zoomActivationKeyPressed:gr,panOnDrag:Bn,zoomOnScroll:Jt,panOnScroll:Sn,zoomOnDoubleClick:Kt,zoomOnPinch:qn,userSelectionActive:rn,noPanClassName:je,noWheelClassName:_,lib:Ki,connectionInProgress:ei});Z.filter(ku),Kt?ne.on("dblclick.zoom",xe):ne.on("dblclick.zoom",null)}function ee(){Z.on("zoom",null)}async function Me(_,je,on){const rn=gge(_),Sn=Z==null?void 0:Z.constrain()(rn,je,on);return Sn&&await ce(Sn),Sn}async function Ke(_,je){const on=gge(_);return await ce(on,je),on}function Xe(_){if(ne){const je=gge(_),on=ne.property("__zoom");(on.k!==_.zoom||on.x!==_.x||on.y!==_.y)&&(Z==null||Z.transform(ne,je,null,{sync:!0}))}}function Ye(){const _=ne?bBn(ne.node()):{x:0,y:0,k:1};return{x:_.x,y:_.y,zoom:_.k}}async function kn(_,je){return ne?new Promise(on=>{Z==null||Z.interpolate((je==null?void 0:je.interpolate)==="linear"?hge:NX).scaleTo(pge(ne,je==null?void 0:je.duration,je==null?void 0:je.ease,()=>on(!0)),_)}):!1}async function jn(_,je){return ne?new Promise(on=>{Z==null||Z.interpolate((je==null?void 0:je.interpolate)==="linear"?hge:NX).scaleBy(pge(ne,je==null?void 0:je.duration,je==null?void 0:je.ease,()=>on(!0)),_)}):!1}function Zn(_){Z==null||Z.scaleExtent(_)}function $n(_){Z==null||Z.translateExtent(_)}function Vn(_){const je=!Zg(_)||_<0?0:_;Z==null||Z.clickDistance(je)}return{update:ge,destroy:ee,setViewport:Ke,setViewportConstrained:Me,getViewport:Ye,scaleTo:kn,scaleBy:jn,setScaleExtent:Zn,setTranslateExtent:$n,syncViewport:Xe,setClickDistance:Vn}}var IA;(function(p){p.Line="line",p.Handle="handle"})(IA||(IA={}));function $Rn({width:p,prevWidth:E,height:P,prevHeight:N,affectsX:D,affectsY:F}){const v=p-E,q=P-N,te=[v>0?1:v<0?-1:0,q>0?1:q<0?-1:0];return v&&D&&(te[0]=te[0]*-1),q&&F&&(te[1]=te[1]*-1),te}function Yln(p){const E=p.includes("right")||p.includes("left"),P=p.includes("bottom")||p.includes("top"),N=p.includes("left"),D=p.includes("top");return{isHorizontal:E,isVertical:P,affectsX:N,affectsY:D}}function B5(p,E){return Math.max(0,E-p)}function R5(p,E){return Math.max(0,p-E)}function SX(p,E,P){return Math.max(0,E-p,p-P)}function Zln(p,E){return p?!E:E}function FRn(p,E,P,N,D,F,v,q){let{affectsX:te,affectsY:ie}=E;const{isHorizontal:pe,isVertical:oe}=E,z=pe&&oe,{xSnapped:Z,ySnapped:ne}=P,{minWidth:U,maxWidth:xe,minHeight:ce,maxHeight:ge}=N,{x:ee,y:Me,width:Ke,height:Xe,aspectRatio:Ye}=p;let kn=Math.floor(pe?Z-p.pointerX:0),jn=Math.floor(oe?ne-p.pointerY:0);const Zn=Ke+(te?-kn:kn),$n=Xe+(ie?-jn:jn),Vn=-F[0]*Ke,_=-F[1]*Xe;let je=SX(Zn,U,xe),on=SX($n,ce,ge);if(v){let Bn=0,dn=0;te&&kn<0?Bn=B5(ee+kn+Vn,v[0][0]):!te&&kn>0&&(Bn=R5(ee+Zn+Vn,v[1][0])),ie&&jn<0?dn=B5(Me+jn+_,v[0][1]):!ie&&jn>0&&(dn=R5(Me+$n+_,v[1][1])),je=Math.max(je,Bn),on=Math.max(on,dn)}if(q){let Bn=0,dn=0;te&&kn>0?Bn=R5(ee+kn,q[0][0]):!te&&kn<0&&(Bn=B5(ee+Zn,q[1][0])),ie&&jn>0?dn=R5(Me+jn,q[0][1]):!ie&&jn<0&&(dn=B5(Me+$n,q[1][1])),je=Math.max(je,Bn),on=Math.max(on,dn)}if(D){if(pe){const Bn=SX(Zn/Ye,ce,ge)*Ye;if(je=Math.max(je,Bn),v){let dn=0;!te&&!ie||te&&!ie&&z?dn=R5(Me+_+Zn/Ye,v[1][1])*Ye:dn=B5(Me+_+(te?kn:-kn)/Ye,v[0][1])*Ye,je=Math.max(je,dn)}if(q){let dn=0;!te&&!ie||te&&!ie&&z?dn=B5(Me+Zn/Ye,q[1][1])*Ye:dn=R5(Me+(te?kn:-kn)/Ye,q[0][1])*Ye,je=Math.max(je,dn)}}if(oe){const Bn=SX($n*Ye,U,xe)/Ye;if(on=Math.max(on,Bn),v){let dn=0;!te&&!ie||ie&&!te&&z?dn=R5(ee+$n*Ye+Vn,v[1][0])/Ye:dn=B5(ee+(ie?jn:-jn)*Ye+Vn,v[0][0])/Ye,on=Math.max(on,dn)}if(q){let dn=0;!te&&!ie||ie&&!te&&z?dn=B5(ee+$n*Ye,q[1][0])/Ye:dn=R5(ee+(ie?jn:-jn)*Ye,q[0][0])/Ye,on=Math.max(on,dn)}}}jn=jn+(jn<0?on:-on),kn=kn+(kn<0?je:-je),D&&(z?Zn>$n*Ye?jn=(Zln(te,ie)?-kn:kn)/Ye:kn=(Zln(te,ie)?-jn:jn)*Ye:pe?(jn=kn/Ye,ie=te):(kn=jn*Ye,te=ie));const rn=te?ee+kn:ee,Sn=ie?Me+jn:Me;return{width:Ke+(te?-kn:kn),height:Xe+(ie?-jn:jn),x:F[0]*kn*(te?-1:1)+rn,y:F[1]*jn*(ie?-1:1)+Sn}}const aan={width:0,height:0,x:0,y:0},BRn={...aan,pointerX:0,pointerY:0,aspectRatio:1};function RRn(p,E,P){const N=E.position.x+p.position.x,D=E.position.y+p.position.y,F=p.measured.width??0,v=p.measured.height??0,q=P[0]*F,te=P[1]*v;return[[N-q,D-te],[N+F-q,D+v-te]]}function _Rn({domNode:p,nodeId:E,getStoreItems:P,onChange:N,onEnd:D}){const F=$0(p);let v={controlDirection:Yln("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function q({controlPosition:ie,boundaries:pe,keepAspectRatio:oe,resizeDirection:z,onResizeStart:Z,onResize:ne,onResizeEnd:U,shouldResize:xe}){let ce={...aan},ge={...BRn};v={boundaries:pe,resizeDirection:z,keepAspectRatio:oe,controlDirection:Yln(ie)};let ee,Me=null,Ke=[],Xe,Ye,kn;const jn=$hn().on("start",Zn=>{const{nodeLookup:$n,transform:Vn,snapGrid:_,snapToGrid:je,nodeOrigin:on,paneDomNode:rn}=P();if(ee=$n.get(E),!ee)return;Me=(rn==null?void 0:rn.getBoundingClientRect())??null;const{xSnapped:Sn,ySnapped:Bn}=rN(Zn.sourceEvent,{transform:Vn,snapGrid:_,snapToGrid:je,containerBounds:Me});ce={width:ee.measured.width??0,height:ee.measured.height??0,x:ee.position.x??0,y:ee.position.y??0},ge={...ce,pointerX:Sn,pointerY:Bn,aspectRatio:ce.width/ce.height},Xe=void 0,Ye=Y8(ee.extent)?ee.extent:void 0,ee.parentId&&(ee.extent==="parent"||ee.expandParent)&&(Xe=$n.get(ee.parentId)),Xe&&ee.extent==="parent"&&(Ye=[[0,0],[Xe.measured.width,Xe.measured.height]]),Ke=[],kn=void 0;for(const[dn,Gn]of $n)if(Gn.parentId===E&&(Ke.push({id:dn,position:{...Gn.position},extent:Gn.extent}),Gn.extent==="parent"||Gn.expandParent)){const Nn=RRn(Gn,ee,Gn.origin??on);kn?kn=[[Math.min(Nn[0][0],kn[0][0]),Math.min(Nn[0][1],kn[0][1])],[Math.max(Nn[1][0],kn[1][0]),Math.max(Nn[1][1],kn[1][1])]]:kn=Nn}Z==null||Z(Zn,{...ce})}).on("drag",Zn=>{const{transform:$n,snapGrid:Vn,snapToGrid:_,nodeOrigin:je}=P(),on=rN(Zn.sourceEvent,{transform:$n,snapGrid:Vn,snapToGrid:_,containerBounds:Me}),rn=[];if(!ee)return;const{x:Sn,y:Bn,width:dn,height:Gn}=ce,Nn={},qn=ee.origin??je,{width:Jt,height:Kt,x:Oi,y:gr}=FRn(ge,v.controlDirection,on,v.boundaries,v.keepAspectRatio,qn,Ye,kn),Ki=Jt!==dn,Kn=Kt!==Gn,ei=Oi!==Sn&&Ki,rr=gr!==Bn&&Kn;if(!ei&&!rr&&!Ki&&!Kn)return;const cr={prevValues:{...ce},startX:ge.x,startY:ge.y,childNodes:Ke.map(bi=>({...bi,position:{...bi.position}}))};if((ei||rr||qn[0]===1||qn[1]===1)&&(Nn.x=ei?Oi:ce.x,Nn.y=rr?gr:ce.y,ce.x=Nn.x,ce.y=Nn.y,Ke.length>0)){const bi=Oi-Sn,Mc=gr-Bn;for(const ku of Ke)ku.position={x:ku.position.x-bi+qn[0]*(Jt-dn),y:ku.position.y-Mc+qn[1]*(Kt-Gn)},rn.push(ku)}if((Ki||Kn)&&(Nn.width=Ki&&(!v.resizeDirection||v.resizeDirection==="horizontal")?Jt:ce.width,Nn.height=Kn&&(!v.resizeDirection||v.resizeDirection==="vertical")?Kt:ce.height,ce.width=Nn.width,ce.height=Nn.height),Xe&&ee.expandParent){const bi=qn[0]*(Nn.width??0);Nn.x&&Nn.x<bi&&(ce.x=bi,ge.x=ge.x-(Nn.x-bi));const Mc=qn[1]*(Nn.height??0);Nn.y&&Nn.y<Mc&&(ce.y=Mc,ge.y=ge.y-(Nn.y-Mc))}const _i=$Rn({width:ce.width,prevWidth:dn,height:ce.height,prevHeight:Gn,affectsX:v.controlDirection.affectsX,affectsY:v.controlDirection.affectsY}),sr={...ce,direction:_i};if((xe==null?void 0:xe(Zn,sr))===!1){ce=cr.prevValues,ge.x=cr.startX,ge.y=cr.startY,Ke.forEach((bi,Mc)=>{bi.position=cr.childNodes[Mc].position});return}ne==null||ne(Zn,sr),N(Nn,rn)}).on("end",Zn=>{U==null||U(Zn,{...ce}),D==null||D({...ce})});F.call(jn)}function te(){F.on(".drag",null)}return{update:q,destroy:te}}const JRn={},ehn=p=>{let E;const P=new Set,N=(pe,oe)=>{const z=typeof pe=="function"?pe(E):pe;if(!Object.is(z,E)){const Z=E;E=oe??(typeof z!="object"||z===null)?z:Object.assign({},E,z),P.forEach(ne=>ne(E,Z))}},D=()=>E,te={setState:N,getState:D,getInitialState:()=>ie,subscribe:pe=>(P.add(pe),()=>P.delete(pe)),destroy:()=>{(JRn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),P.clear()}},ie=E=p(N,D,te);return te},GRn=p=>p?ehn(p):ehn,{useDebugValue:HRn}=GFn,{useSyncExternalStoreWithSelector:qRn}=JFn,zRn=p=>p;function dan(p,E=zRn,P){const N=qRn(p.subscribe,p.getState,p.getServerState||p.getInitialState,E,P);return HRn(N),N}const nhn=(p,E)=>{const P=GRn(p),N=(D,F=E)=>dan(P,D,F);return Object.assign(N,P),N},URn=(p,E)=>p?nhn(p,E):nhn;function Ts(p,E){if(Object.is(p,E))return!0;if(typeof p!="object"||p===null||typeof E!="object"||E===null)return!1;if(p instanceof Map&&E instanceof Map){if(p.size!==E.size)return!1;for(const[N,D]of p)if(!Object.is(D,E.get(N)))return!1;return!0}if(p instanceof Set&&E instanceof Set){if(p.size!==E.size)return!1;for(const N of p)if(!E.has(N))return!1;return!0}const P=Object.keys(p);if(P.length!==Object.keys(E).length)return!1;for(const N of P)if(!Object.prototype.hasOwnProperty.call(E,N)||!Object.is(p[N],E[N]))return!1;return!0}const qX=sn.createContext(null),XRn=qX.Provider,ban=t2.error001("react");function Sc(p,E){const P=sn.useContext(qX);if(P===null)throw new Error(ban);return dan(P,p,E)}function os(){const p=sn.useContext(qX);if(p===null)throw new Error(ban);return sn.useMemo(()=>({getState:p.getState,setState:p.setState,subscribe:p.subscribe}),[p])}const thn={display:"none"},KRn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},wan="react-flow__node-desc",gan="react-flow__edge-desc",WRn="react-flow__aria-live",VRn=p=>p.ariaLiveMessage,QRn=p=>p.ariaLabelConfig;function YRn({rfId:p}){const E=Sc(VRn);return ae.jsx("div",{id:`${WRn}-${p}`,"aria-live":"assertive","aria-atomic":"true",style:KRn,children:E})}function ZRn({rfId:p,disableKeyboardA11y:E}){const P=Sc(QRn);return ae.jsxs(ae.Fragment,{children:[ae.jsx("div",{id:`${wan}-${p}`,style:thn,children:E?P["node.a11yDescription.default"]:P["node.a11yDescription.keyboardDisabled"]}),ae.jsx("div",{id:`${gan}-${p}`,style:thn,children:P["edge.a11yDescription.default"]}),!E&&ae.jsx(YRn,{rfId:p})]})}const pN=sn.forwardRef(({position:p="top-left",children:E,className:P,style:N,...D},F)=>{const v=`${p}`.split("-");return ae.jsx("div",{className:Kf(["react-flow__panel",P,...v]),style:N,ref:F,...D,children:E})});pN.displayName="Panel";const ihn="https://reactflow.dev?utm_source=attribution";function e_n({proOptions:p,position:E="bottom-right"}){return sn.useEffect(()=>{},[]),p!=null&&p.hideAttribution?null:ae.jsx(pN,{position:E,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${ihn}`,children:ae.jsx("a",{href:ihn,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const n_n=p=>{const E=[],P=[];for(const[,N]of p.nodeLookup)N.selected&&E.push(N.internals.userNode);for(const[,N]of p.edgeLookup)N.selected&&P.push(N);return{selectedNodes:E,selectedEdges:P}},IX=p=>p.id;function t_n(p,E){return Ts(p.selectedNodes.map(IX),E.selectedNodes.map(IX))&&Ts(p.selectedEdges.map(IX),E.selectedEdges.map(IX))}function i_n({onSelectionChange:p}){const E=os(),{selectedNodes:P,selectedEdges:N}=Sc(n_n,t_n);return sn.useEffect(()=>{const D={nodes:P,edges:N};p==null||p(D),E.getState().onSelectionChangeHandlers.forEach(F=>F(D))},[P,N,p]),null}const r_n=p=>!!p.onSelectionChangeHandlers;function c_n({onSelectionChange:p}){const E=Sc(r_n);return p||E?ae.jsx(i_n,{onSelectionChange:p}):null}const pan=[0,0],u_n={x:0,y:0,zoom:1},o_n=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],rhn=[...o_n,"rfId"],s_n=p=>({setNodes:p.setNodes,setEdges:p.setEdges,setMinZoom:p.setMinZoom,setMaxZoom:p.setMaxZoom,setTranslateExtent:p.setTranslateExtent,setNodeExtent:p.setNodeExtent,reset:p.reset,setDefaultNodesAndEdges:p.setDefaultNodesAndEdges}),chn={translateExtent:oN,nodeOrigin:pan,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function f_n(p){const{setNodes:E,setEdges:P,setMinZoom:N,setMaxZoom:D,setTranslateExtent:F,setNodeExtent:v,reset:q,setDefaultNodesAndEdges:te}=Sc(s_n,Ts),ie=os();sn.useEffect(()=>(te(p.defaultNodes,p.defaultEdges),()=>{pe.current=chn,q()}),[]);const pe=sn.useRef(chn);return sn.useEffect(()=>{for(const oe of rhn){const z=p[oe],Z=pe.current[oe];z!==Z&&(typeof p[oe]>"u"||(oe==="nodes"?E(z):oe==="edges"?P(z):oe==="minZoom"?N(z):oe==="maxZoom"?D(z):oe==="translateExtent"?F(z):oe==="nodeExtent"?v(z):oe==="ariaLabelConfig"?ie.setState({ariaLabelConfig:YBn(z)}):oe==="fitView"?ie.setState({fitViewQueued:z}):oe==="fitViewOptions"?ie.setState({fitViewOptions:z}):ie.setState({[oe]:z})))}pe.current=p},rhn.map(oe=>p[oe])),null}function uhn(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function l_n(p){var N;const[E,P]=sn.useState(p==="system"?null:p);return sn.useEffect(()=>{if(p!=="system"){P(p);return}const D=uhn(),F=()=>P(D!=null&&D.matches?"dark":"light");return F(),D==null||D.addEventListener("change",F),()=>{D==null||D.removeEventListener("change",F)}},[p]),E!==null?E:(N=uhn())!=null&&N.matches?"dark":"light"}const ohn=typeof document<"u"?document:null;function aN(p=null,E={target:ohn,actInsideInputWithModifier:!0}){const[P,N]=sn.useState(!1),D=sn.useRef(!1),F=sn.useRef(new Set([])),[v,q]=sn.useMemo(()=>{if(p!==null){const ie=(Array.isArray(p)?p:[p]).filter(oe=>typeof oe=="string").map(oe=>oe.replace(/\+/g,`
1
+ import{l2 as JFn,R as GFn,r as sn,j as ae,e3 as Ihn,iI as HFn,jU as qFn,hF as zFn,l3 as UFn,ar as cN,bx as Tge,B as Phn,aj as Ohn,G as n2,aO as Sge,b7 as Ige,b6 as XFn,_ as iN,f as KFn,iB as WFn,X as VFn,en as Lln,em as QFn,ai as YFn,ap as ZFn,l4 as eBn,hL as nBn,bW as AX,fq as tBn,x as $ln,hJ as iBn,hu as rBn,g9 as cBn,ga as uBn,gb as oBn,gc as sBn,gd as fBn,ge as lBn,gf as hBn,gg as aBn,h0 as dBn}from"./index-8-iQ6PnT.js";import{s as $0,g as Nhn,j as Pge,T as fge,k as lge,t as bBn}from"./transform-BqqRT-Iy.js";import{i as hge}from"./value-wA6veExk.js";import{H as $X}from"./_shell.team-ZxGwa39m.js";import{H as wBn}from"./heart-CRkjVW7-.js";import{a as age,A as gBn}from"./AdapterIcon-DVgTrgnM.js";import"./relay-trace-schemas-fScydQ3A.js";import{d as pBn,c as mBn,a as vBn,B as yBn}from"./BindingDialog-DVyxVXZM.js";import{s as kBn}from"./session-strategy-labels-C7Wduch3.js";import{c as MX}from"./_commonjs-dynamic-modules-TDtrdbi3.js";import{u as jBn}from"./use-mesh-topology-CpIDE8lD.js";import{E as EBn}from"./empty-state-kISAAp0z.js";import{Q as ABn}from"./query-error-state--8AnWSSn.js";import{u as MBn}from"./use-bindings-BV6HA0MD.js";import{u as CBn}from"./use-delete-binding-CnziYpXo.js";import{u as xBn}from"./use-relay-config-1mAMDNbc.js";import"./use-pending-read-Do0_vZ2I.js";import"./search-x-CA-FzEqZ.js";import"./scroll-area-DYyyRqW_.js";import"./OpenMeshSwitch-BHRm328L.js";import"./table-DvU_oS4E.js";import"./use-is-hub-BmpgFnFp.js";import"./shield-check-CpUB_Ju1.js";import"./page-container-Bb-_N7lw.js";import"./profile-errors-C1qSJkiG.js";import"./CommitmentList-uK4CKaz0.js";import"./TeamComputerEntry-qx_19Htj.js";import"./ComputerViewer-D87LhxwL.js";import"./form-Bjhk9zOn.js";import"./use-adapter-catalog-BQKfRxXC.js";import"./trust-posture-2MR0ap9o.js";function Kf(p){if(typeof p=="string"||typeof p=="number")return""+p;let E="";if(Array.isArray(p))for(let P=0,N;P<p.length;P++)(N=Kf(p[P]))!==""&&(E+=(E&&" ")+N);else for(let P in p)p[P]&&(E+=(E&&" ")+P);return E}function TBn(p){let E;for(;E=p.sourceEvent;)p=E;return p}function Yg(p,E){if(p=TBn(p),E===void 0&&(E=p.currentTarget),E){var P=E.ownerSVGElement||E;if(P.createSVGPoint){var N=P.createSVGPoint();return N.x=p.clientX,N.y=p.clientY,N=N.matrixTransform(E.getScreenCTM().inverse()),[N.x,N.y]}if(E.getBoundingClientRect){var D=E.getBoundingClientRect();return[p.clientX-D.left-E.clientLeft,p.clientY-D.top-E.clientTop]}}return[p.pageX,p.pageY]}const SBn={passive:!1},uN={capture:!0,passive:!1};function dge(p){p.stopImmediatePropagation()}function CA(p){p.preventDefault(),p.stopImmediatePropagation()}function Dhn(p){var E=p.document.documentElement,P=$0(p).on("dragstart.drag",CA,uN);"onselectstart"in E?P.on("selectstart.drag",CA,uN):(E.__noselect=E.style.MozUserSelect,E.style.MozUserSelect="none")}function Lhn(p,E){var P=p.document.documentElement,N=$0(p).on("dragstart.drag",null);E&&(N.on("click.drag",CA,uN),setTimeout(function(){N.on("click.drag",null)},0)),"onselectstart"in P?N.on("selectstart.drag",null):(P.style.MozUserSelect=P.__noselect,delete P.__noselect)}const CX=p=>()=>p;function kge(p,{sourceEvent:E,subject:P,target:N,identifier:D,active:F,x:v,y:q,dx:te,dy:ie,dispatch:pe}){Object.defineProperties(this,{type:{value:p,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},subject:{value:P,enumerable:!0,configurable:!0},target:{value:N,enumerable:!0,configurable:!0},identifier:{value:D,enumerable:!0,configurable:!0},active:{value:F,enumerable:!0,configurable:!0},x:{value:v,enumerable:!0,configurable:!0},y:{value:q,enumerable:!0,configurable:!0},dx:{value:te,enumerable:!0,configurable:!0},dy:{value:ie,enumerable:!0,configurable:!0},_:{value:pe}})}kge.prototype.on=function(){var p=this._.on.apply(this._,arguments);return p===this._?this:p};function IBn(p){return!p.ctrlKey&&!p.button}function PBn(){return this.parentNode}function OBn(p,E){return E??{x:p.x,y:p.y}}function NBn(){return navigator.maxTouchPoints||"ontouchstart"in this}function $hn(){var p=IBn,E=PBn,P=OBn,N=NBn,D={},F=Nhn("start","drag","end"),v=0,q,te,ie,pe,oe=0;function z(Me){Me.on("mousedown.drag",Z).filter(N).on("touchstart.drag",xe).on("touchmove.drag",ce,SBn).on("touchend.drag touchcancel.drag",ge).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function Z(Me,Ke){if(!(pe||!p.call(this,Me,Ke))){var Xe=ee(this,E.call(this,Me,Ke),Me,Ke,"mouse");Xe&&($0(Me.view).on("mousemove.drag",ne,uN).on("mouseup.drag",U,uN),Dhn(Me.view),dge(Me),ie=!1,q=Me.clientX,te=Me.clientY,Xe("start",Me))}}function ne(Me){if(CA(Me),!ie){var Ke=Me.clientX-q,Xe=Me.clientY-te;ie=Ke*Ke+Xe*Xe>oe}D.mouse("drag",Me)}function U(Me){$0(Me.view).on("mousemove.drag mouseup.drag",null),Lhn(Me.view,ie),CA(Me),D.mouse("end",Me)}function xe(Me,Ke){if(p.call(this,Me,Ke)){var Xe=Me.changedTouches,Ye=E.call(this,Me,Ke),kn=Xe.length,jn,Zn;for(jn=0;jn<kn;++jn)(Zn=ee(this,Ye,Me,Ke,Xe[jn].identifier,Xe[jn]))&&(dge(Me),Zn("start",Me,Xe[jn]))}}function ce(Me){var Ke=Me.changedTouches,Xe=Ke.length,Ye,kn;for(Ye=0;Ye<Xe;++Ye)(kn=D[Ke[Ye].identifier])&&(CA(Me),kn("drag",Me,Ke[Ye]))}function ge(Me){var Ke=Me.changedTouches,Xe=Ke.length,Ye,kn;for(pe&&clearTimeout(pe),pe=setTimeout(function(){pe=null},500),Ye=0;Ye<Xe;++Ye)(kn=D[Ke[Ye].identifier])&&(dge(Me),kn("end",Me,Ke[Ye]))}function ee(Me,Ke,Xe,Ye,kn,jn){var Zn=F.copy(),$n=Yg(jn||Xe,Ke),Vn,_,je;if((je=P.call(Me,new kge("beforestart",{sourceEvent:Xe,target:z,identifier:kn,active:v,x:$n[0],y:$n[1],dx:0,dy:0,dispatch:Zn}),Ye))!=null)return Vn=je.x-$n[0]||0,_=je.y-$n[1]||0,function on(rn,Sn,Bn){var dn=$n,Gn;switch(rn){case"start":D[kn]=on,Gn=v++;break;case"end":delete D[kn],--v;case"drag":$n=Yg(Bn||Sn,Ke),Gn=v;break}Zn.call(rn,Me,new kge(rn,{sourceEvent:Sn,subject:je,target:z,identifier:kn,active:Gn,x:$n[0]+Vn,y:$n[1]+_,dx:$n[0]-dn[0],dy:$n[1]-dn[1],dispatch:Zn}),Ye)}}return z.filter=function(Me){return arguments.length?(p=typeof Me=="function"?Me:CX(!!Me),z):p},z.container=function(Me){return arguments.length?(E=typeof Me=="function"?Me:CX(Me),z):E},z.subject=function(Me){return arguments.length?(P=typeof Me=="function"?Me:CX(Me),z):P},z.touchable=function(Me){return arguments.length?(N=typeof Me=="function"?Me:CX(!!Me),z):N},z.on=function(){var Me=F.on.apply(F,arguments);return Me===F?z:Me},z.clickDistance=function(Me){return arguments.length?(oe=(Me=+Me)*Me,z):Math.sqrt(oe)},z}var DBn=1e-12;function Fln(p){return((p=Math.exp(p))+1/p)/2}function LBn(p){return((p=Math.exp(p))-1/p)/2}function $Bn(p){return((p=Math.exp(2*p))-1)/(p+1)}const NX=(function p(E,P,N){function D(F,v){var q=F[0],te=F[1],ie=F[2],pe=v[0],oe=v[1],z=v[2],Z=pe-q,ne=oe-te,U=Z*Z+ne*ne,xe,ce;if(U<DBn)ce=Math.log(z/ie)/E,xe=function(Ye){return[q+Ye*Z,te+Ye*ne,ie*Math.exp(E*Ye*ce)]};else{var ge=Math.sqrt(U),ee=(z*z-ie*ie+N*U)/(2*ie*P*ge),Me=(z*z-ie*ie-N*U)/(2*z*P*ge),Ke=Math.log(Math.sqrt(ee*ee+1)-ee),Xe=Math.log(Math.sqrt(Me*Me+1)-Me);ce=(Xe-Ke)/E,xe=function(Ye){var kn=Ye*ce,jn=Fln(Ke),Zn=ie/(P*ge)*(jn*$Bn(E*kn+Ke)-LBn(Ke));return[q+Zn*Z,te+Zn*ne,ie*jn/Fln(E*kn+Ke)]}}return xe.duration=ce*1e3*E/Math.SQRT2,xe}return D.rho=function(F){var v=Math.max(.001,+F),q=v*v,te=q*q;return p(v,q,te)},D})(Math.SQRT2,2,4),xX=p=>()=>p;function FBn(p,{sourceEvent:E,target:P,transform:N,dispatch:D}){Object.defineProperties(this,{type:{value:p,enumerable:!0,configurable:!0},sourceEvent:{value:E,enumerable:!0,configurable:!0},target:{value:P,enumerable:!0,configurable:!0},transform:{value:N,enumerable:!0,configurable:!0},_:{value:D}})}function bge(p){p.stopImmediatePropagation()}function tN(p){p.preventDefault(),p.stopImmediatePropagation()}function BBn(p){return(!p.ctrlKey||p.type==="wheel")&&!p.button}function RBn(){var p=this;return p instanceof SVGElement?(p=p.ownerSVGElement||p,p.hasAttribute("viewBox")?(p=p.viewBox.baseVal,[[p.x,p.y],[p.x+p.width,p.y+p.height]]):[[0,0],[p.width.baseVal.value,p.height.baseVal.value]]):[[0,0],[p.clientWidth,p.clientHeight]]}function Bln(){return this.__zoom||Pge}function _Bn(p){return-p.deltaY*(p.deltaMode===1?.05:p.deltaMode?1:.002)*(p.ctrlKey?10:1)}function JBn(){return navigator.maxTouchPoints||"ontouchstart"in this}function GBn(p,E,P){var N=p.invertX(E[0][0])-P[0][0],D=p.invertX(E[1][0])-P[1][0],F=p.invertY(E[0][1])-P[0][1],v=p.invertY(E[1][1])-P[1][1];return p.translate(D>N?(N+D)/2:Math.min(0,N)||Math.max(0,D),v>F?(F+v)/2:Math.min(0,F)||Math.max(0,v))}function Fhn(){var p=BBn,E=RBn,P=GBn,N=_Bn,D=JBn,F=[0,1/0],v=[[-1/0,-1/0],[1/0,1/0]],q=250,te=NX,ie=Nhn("start","zoom","end"),pe,oe,z,Z=500,ne=150,U=0,xe=10;function ce(je){je.property("__zoom",Bln).on("wheel.zoom",kn,{passive:!1}).on("mousedown.zoom",jn).on("dblclick.zoom",Zn).filter(D).on("touchstart.zoom",$n).on("touchmove.zoom",Vn).on("touchend.zoom touchcancel.zoom",_).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}ce.transform=function(je,on,rn,Sn){var Bn=je.selection?je.selection():je;Bn.property("__zoom",Bln),je!==Bn?Ke(je,on,rn,Sn):Bn.interrupt().each(function(){Xe(this,arguments).event(Sn).start().zoom(null,typeof on=="function"?on.apply(this,arguments):on).end()})},ce.scaleBy=function(je,on,rn,Sn){ce.scaleTo(je,function(){var Bn=this.__zoom.k,dn=typeof on=="function"?on.apply(this,arguments):on;return Bn*dn},rn,Sn)},ce.scaleTo=function(je,on,rn,Sn){ce.transform(je,function(){var Bn=E.apply(this,arguments),dn=this.__zoom,Gn=rn==null?Me(Bn):typeof rn=="function"?rn.apply(this,arguments):rn,Nn=dn.invert(Gn),qn=typeof on=="function"?on.apply(this,arguments):on;return P(ee(ge(dn,qn),Gn,Nn),Bn,v)},rn,Sn)},ce.translateBy=function(je,on,rn,Sn){ce.transform(je,function(){return P(this.__zoom.translate(typeof on=="function"?on.apply(this,arguments):on,typeof rn=="function"?rn.apply(this,arguments):rn),E.apply(this,arguments),v)},null,Sn)},ce.translateTo=function(je,on,rn,Sn,Bn){ce.transform(je,function(){var dn=E.apply(this,arguments),Gn=this.__zoom,Nn=Sn==null?Me(dn):typeof Sn=="function"?Sn.apply(this,arguments):Sn;return P(Pge.translate(Nn[0],Nn[1]).scale(Gn.k).translate(typeof on=="function"?-on.apply(this,arguments):-on,typeof rn=="function"?-rn.apply(this,arguments):-rn),dn,v)},Sn,Bn)};function ge(je,on){return on=Math.max(F[0],Math.min(F[1],on)),on===je.k?je:new fge(on,je.x,je.y)}function ee(je,on,rn){var Sn=on[0]-rn[0]*je.k,Bn=on[1]-rn[1]*je.k;return Sn===je.x&&Bn===je.y?je:new fge(je.k,Sn,Bn)}function Me(je){return[(+je[0][0]+ +je[1][0])/2,(+je[0][1]+ +je[1][1])/2]}function Ke(je,on,rn,Sn){je.on("start.zoom",function(){Xe(this,arguments).event(Sn).start()}).on("interrupt.zoom end.zoom",function(){Xe(this,arguments).event(Sn).end()}).tween("zoom",function(){var Bn=this,dn=arguments,Gn=Xe(Bn,dn).event(Sn),Nn=E.apply(Bn,dn),qn=rn==null?Me(Nn):typeof rn=="function"?rn.apply(Bn,dn):rn,Jt=Math.max(Nn[1][0]-Nn[0][0],Nn[1][1]-Nn[0][1]),Kt=Bn.__zoom,Oi=typeof on=="function"?on.apply(Bn,dn):on,gr=te(Kt.invert(qn).concat(Jt/Kt.k),Oi.invert(qn).concat(Jt/Oi.k));return function(Ki){if(Ki===1)Ki=Oi;else{var Kn=gr(Ki),ei=Jt/Kn[2];Ki=new fge(ei,qn[0]-Kn[0]*ei,qn[1]-Kn[1]*ei)}Gn.zoom(null,Ki)}})}function Xe(je,on,rn){return!rn&&je.__zooming||new Ye(je,on)}function Ye(je,on){this.that=je,this.args=on,this.active=0,this.sourceEvent=null,this.extent=E.apply(je,on),this.taps=0}Ye.prototype={event:function(je){return je&&(this.sourceEvent=je),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(je,on){return this.mouse&&je!=="mouse"&&(this.mouse[1]=on.invert(this.mouse[0])),this.touch0&&je!=="touch"&&(this.touch0[1]=on.invert(this.touch0[0])),this.touch1&&je!=="touch"&&(this.touch1[1]=on.invert(this.touch1[0])),this.that.__zoom=on,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(je){var on=$0(this.that).datum();ie.call(je,this.that,new FBn(je,{sourceEvent:this.sourceEvent,target:ce,transform:this.that.__zoom,dispatch:ie}),on)}};function kn(je,...on){if(!p.apply(this,arguments))return;var rn=Xe(this,on).event(je),Sn=this.__zoom,Bn=Math.max(F[0],Math.min(F[1],Sn.k*Math.pow(2,N.apply(this,arguments)))),dn=Yg(je);if(rn.wheel)(rn.mouse[0][0]!==dn[0]||rn.mouse[0][1]!==dn[1])&&(rn.mouse[1]=Sn.invert(rn.mouse[0]=dn)),clearTimeout(rn.wheel);else{if(Sn.k===Bn)return;rn.mouse=[dn,Sn.invert(dn)],lge(this),rn.start()}tN(je),rn.wheel=setTimeout(Gn,ne),rn.zoom("mouse",P(ee(ge(Sn,Bn),rn.mouse[0],rn.mouse[1]),rn.extent,v));function Gn(){rn.wheel=null,rn.end()}}function jn(je,...on){if(z||!p.apply(this,arguments))return;var rn=je.currentTarget,Sn=Xe(this,on,!0).event(je),Bn=$0(je.view).on("mousemove.zoom",qn,!0).on("mouseup.zoom",Jt,!0),dn=Yg(je,rn),Gn=je.clientX,Nn=je.clientY;Dhn(je.view),bge(je),Sn.mouse=[dn,this.__zoom.invert(dn)],lge(this),Sn.start();function qn(Kt){if(tN(Kt),!Sn.moved){var Oi=Kt.clientX-Gn,gr=Kt.clientY-Nn;Sn.moved=Oi*Oi+gr*gr>U}Sn.event(Kt).zoom("mouse",P(ee(Sn.that.__zoom,Sn.mouse[0]=Yg(Kt,rn),Sn.mouse[1]),Sn.extent,v))}function Jt(Kt){Bn.on("mousemove.zoom mouseup.zoom",null),Lhn(Kt.view,Sn.moved),tN(Kt),Sn.event(Kt).end()}}function Zn(je,...on){if(p.apply(this,arguments)){var rn=this.__zoom,Sn=Yg(je.changedTouches?je.changedTouches[0]:je,this),Bn=rn.invert(Sn),dn=rn.k*(je.shiftKey?.5:2),Gn=P(ee(ge(rn,dn),Sn,Bn),E.apply(this,on),v);tN(je),q>0?$0(this).transition().duration(q).call(Ke,Gn,Sn,je):$0(this).call(ce.transform,Gn,Sn,je)}}function $n(je,...on){if(p.apply(this,arguments)){var rn=je.touches,Sn=rn.length,Bn=Xe(this,on,je.changedTouches.length===Sn).event(je),dn,Gn,Nn,qn;for(bge(je),Gn=0;Gn<Sn;++Gn)Nn=rn[Gn],qn=Yg(Nn,this),qn=[qn,this.__zoom.invert(qn),Nn.identifier],Bn.touch0?!Bn.touch1&&Bn.touch0[2]!==qn[2]&&(Bn.touch1=qn,Bn.taps=0):(Bn.touch0=qn,dn=!0,Bn.taps=1+!!pe);pe&&(pe=clearTimeout(pe)),dn&&(Bn.taps<2&&(oe=qn[0],pe=setTimeout(function(){pe=null},Z)),lge(this),Bn.start())}}function Vn(je,...on){if(this.__zooming){var rn=Xe(this,on).event(je),Sn=je.changedTouches,Bn=Sn.length,dn,Gn,Nn,qn;for(tN(je),dn=0;dn<Bn;++dn)Gn=Sn[dn],Nn=Yg(Gn,this),rn.touch0&&rn.touch0[2]===Gn.identifier?rn.touch0[0]=Nn:rn.touch1&&rn.touch1[2]===Gn.identifier&&(rn.touch1[0]=Nn);if(Gn=rn.that.__zoom,rn.touch1){var Jt=rn.touch0[0],Kt=rn.touch0[1],Oi=rn.touch1[0],gr=rn.touch1[1],Ki=(Ki=Oi[0]-Jt[0])*Ki+(Ki=Oi[1]-Jt[1])*Ki,Kn=(Kn=gr[0]-Kt[0])*Kn+(Kn=gr[1]-Kt[1])*Kn;Gn=ge(Gn,Math.sqrt(Ki/Kn)),Nn=[(Jt[0]+Oi[0])/2,(Jt[1]+Oi[1])/2],qn=[(Kt[0]+gr[0])/2,(Kt[1]+gr[1])/2]}else if(rn.touch0)Nn=rn.touch0[0],qn=rn.touch0[1];else return;rn.zoom("touch",P(ee(Gn,Nn,qn),rn.extent,v))}}function _(je,...on){if(this.__zooming){var rn=Xe(this,on).event(je),Sn=je.changedTouches,Bn=Sn.length,dn,Gn;for(bge(je),z&&clearTimeout(z),z=setTimeout(function(){z=null},Z),dn=0;dn<Bn;++dn)Gn=Sn[dn],rn.touch0&&rn.touch0[2]===Gn.identifier?delete rn.touch0:rn.touch1&&rn.touch1[2]===Gn.identifier&&delete rn.touch1;if(rn.touch1&&!rn.touch0&&(rn.touch0=rn.touch1,delete rn.touch1),rn.touch0)rn.touch0[1]=this.__zoom.invert(rn.touch0[0]);else if(rn.end(),rn.taps===2&&(Gn=Yg(Gn,this),Math.hypot(oe[0]-Gn[0],oe[1]-Gn[1])<xe)){var Nn=$0(this).on("dblclick.zoom");Nn&&Nn.apply(this,arguments)}}}return ce.wheelDelta=function(je){return arguments.length?(N=typeof je=="function"?je:xX(+je),ce):N},ce.filter=function(je){return arguments.length?(p=typeof je=="function"?je:xX(!!je),ce):p},ce.touchable=function(je){return arguments.length?(D=typeof je=="function"?je:xX(!!je),ce):D},ce.extent=function(je){return arguments.length?(E=typeof je=="function"?je:xX([[+je[0][0],+je[0][1]],[+je[1][0],+je[1][1]]]),ce):E},ce.scaleExtent=function(je){return arguments.length?(F[0]=+je[0],F[1]=+je[1],ce):[F[0],F[1]]},ce.translateExtent=function(je){return arguments.length?(v[0][0]=+je[0][0],v[1][0]=+je[1][0],v[0][1]=+je[0][1],v[1][1]=+je[1][1],ce):[[v[0][0],v[0][1]],[v[1][0],v[1][1]]]},ce.constrain=function(je){return arguments.length?(P=je,ce):P},ce.duration=function(je){return arguments.length?(q=+je,ce):q},ce.interpolate=function(je){return arguments.length?(te=je,ce):te},ce.on=function(){var je=ie.on.apply(ie,arguments);return je===ie?ce:je},ce.clickDistance=function(je){return arguments.length?(U=(je=+je)*je,ce):Math.sqrt(U)},ce.tapDistance=function(je){return arguments.length?(xe=+je,ce):xe},ce}const t2={error001:(p="react")=>`Seems like you have not used ${p==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${p}flow.dev/error#001`,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.",error003:p=>`Node type "${p}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:p=>`The old edge with id=${p} does not exist.`,error009:p=>`Marker type "${p}" doesn't exist.`,error008:(p,{id:E,sourceHandle:P,targetHandle:N})=>`Couldn't create edge for ${p} handle id: "${p==="source"?P:N}", edge id: ${E}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:p=>`Edge type "${p}" not found. Using fallback type "default".`,error012:p=>`Node with id "${p}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(p="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${p}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:p=>`Edge with id "${p}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},oN=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Bhn=["Enter"," ","Escape"],Rhn={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","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.","node.a11yDescription.ariaLiveMessage":({direction:p,x:E,y:P})=>`Moved selected node ${p}. New position, x: ${E}, y: ${P}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var xA;(function(p){p.Strict="strict",p.Loose="loose"})(xA||(xA={}));var V8;(function(p){p.Free="free",p.Vertical="vertical",p.Horizontal="horizontal"})(V8||(V8={}));var sN;(function(p){p.Partial="partial",p.Full="full"})(sN||(sN={}));const _hn={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var J5;(function(p){p.Bezier="default",p.Straight="straight",p.Step="step",p.SmoothStep="smoothstep",p.SimpleBezier="simplebezier"})(J5||(J5={}));var fN;(function(p){p.Arrow="arrow",p.ArrowClosed="arrowclosed"})(fN||(fN={}));var ji;(function(p){p.Left="left",p.Top="top",p.Right="right",p.Bottom="bottom"})(ji||(ji={}));const Rln={[ji.Left]:ji.Right,[ji.Right]:ji.Left,[ji.Top]:ji.Bottom,[ji.Bottom]:ji.Top},Jhn=p=>!!p&&typeof p=="object"&&"id"in p&&"source"in p&&"target"in p,HBn=p=>!!p&&typeof p=="object"&&"id"in p&&"position"in p&&!("source"in p)&&!("target"in p),Oge=p=>!!p&&typeof p=="object"&&"id"in p&&"internals"in p&&!("source"in p)&&!("target"in p),dN=(p,E=[0,0])=>{const{width:P,height:N}=i2(p),D=p.origin??E,F=P*D[0],v=N*D[1];return{x:p.position.x-F,y:p.position.y-v}},qBn=(p,E={nodeOrigin:[0,0]})=>{if(p.length===0)return{x:0,y:0,width:0,height:0};let P=!1;const N=p.reduce((D,F)=>{const v=typeof F=="string";let q=!E.nodeLookup&&!v?F:void 0;return E.nodeLookup&&(q=v?E.nodeLookup.get(F):Oge(F)?F:E.nodeLookup.get(F.id)),q?(P=!0,JX(D,FX(q,E.nodeOrigin))):D},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return P?GX(N):{x:0,y:0,width:0,height:0}},PA=(p,E={})=>{let P={x:1/0,y:1/0,x2:-1/0,y2:-1/0},N=!1;return p.forEach(D=>{(E.filter===void 0||E.filter(D))&&(P=JX(P,FX(D)),N=!0)}),N?GX(P):{x:0,y:0,width:0,height:0}},Nge=(p,E,[P,N,D]=[0,0,1],F=!1,v=!1)=>{const q=(E.x-P)/D,te=(E.y-N)/D,ie=E.width/D,pe=E.height/D,oe=[];for(const z of p.values()){const{measured:Z,selectable:ne=!0,hidden:U=!1}=z;if(v&&!ne||U)continue;const xe=Z.width??z.width??z.initialWidth??0,ce=Z.height??z.height??z.initialHeight??0,{x:ge,y:ee}=z.internals.positionAbsolute,Me=zhn(q,te,ie,pe,ge,ee,xe,ce),Ke=xe*ce,Xe=F&&Me>0;(!z.internals.handleBounds||Xe||Me>=Ke||z.dragging)&&oe.push(z)}return oe},zBn=(p,E)=>{const P=new Set;return p.forEach(N=>{P.add(N.id)}),E.filter(N=>P.has(N.source)||P.has(N.target))};function UBn(p,E){const P=new Map,N=E!=null&&E.nodes?new Set(E.nodes.map(D=>D.id)):null;return p.forEach(D=>{let F;if(E!=null&&E.includeHiddenNodes){const{width:v,height:q}=i2(D);F=v>0&&q>0}else F=!!(D.measured.width&&D.measured.height&&!D.hidden);F&&(!N||N.has(D.id))&&P.set(D.id,D)}),P}async function XBn({nodes:p,width:E,height:P,panZoom:N,minZoom:D,maxZoom:F},v){if(p.size===0)return!0;const q=UBn(p,v),te=PA(q),ie=Lge(te,E,P,(v==null?void 0:v.minZoom)??D,(v==null?void 0:v.maxZoom)??F,(v==null?void 0:v.padding)??.1);return await N.setViewport(ie,{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),!0}function Ghn({nodeId:p,nextPosition:E,nodeLookup:P,nodeOrigin:N=[0,0],nodeExtent:D,onError:F}){const v=P.get(p),q=v.parentId?P.get(v.parentId):void 0,{x:te,y:ie}=q?q.internals.positionAbsolute:{x:0,y:0},pe=v.origin??N;let oe=v.extent||D;if(v.extent==="parent"&&!v.expandParent)if(!q)F==null||F("005",t2.error005());else{const{width:Z,height:ne}=i2(q);Z&&ne&&(oe=[[te,ie],[te+Z,ie+ne]])}else q&&Y8(v.extent)&&(oe=[[v.extent[0][0]+te,v.extent[0][1]+ie],[v.extent[1][0]+te,v.extent[1][1]+ie]]);const z=Y8(oe)?Q8(E,oe,v.measured):E;return(v.measured.width===void 0||v.measured.height===void 0)&&(F==null||F("015",t2.error015())),{position:{x:z.x-te+(v.measured.width??0)*pe[0],y:z.y-ie+(v.measured.height??0)*pe[1]},positionAbsolute:z}}async function KBn({nodesToRemove:p=[],edgesToRemove:E=[],nodes:P,edges:N,onBeforeDelete:D}){const F=new Set(p.map(z=>z.id)),v=[];for(const z of P){if(z.deletable===!1)continue;const Z=F.has(z.id),ne=!Z&&z.parentId&&v.find(U=>U.id===z.parentId);(Z||ne)&&v.push(z)}const q=new Set(E.map(z=>z.id)),te=N.filter(z=>z.deletable!==!1),pe=zBn(v,te);for(const z of te)q.has(z.id)&&!pe.find(ne=>ne.id===z.id)&&pe.push(z);if(!D)return{edges:pe,nodes:v};const oe=await D({nodes:v,edges:pe});return typeof oe=="boolean"?oe?{edges:pe,nodes:v}:{edges:[],nodes:[]}:oe}const TA=(p,E=0,P=1)=>Math.min(Math.max(p,E),P),Q8=(p={x:0,y:0},E,P)=>({x:TA(p.x,E[0][0],E[1][0]-((P==null?void 0:P.width)??0)),y:TA(p.y,E[0][1],E[1][1]-((P==null?void 0:P.height)??0))});function Hhn(p,E,P){const{width:N,height:D}=i2(P),{x:F,y:v}=P.internals.positionAbsolute;return Q8(p,[[F,v],[F+N,v+D]],E)}const _ln=(p,E,P)=>p<E?TA(Math.abs(p-E),1,E)/E:p>P?-TA(Math.abs(p-P),1,E)/E:0,Dge=(p,E,P=15,N=40)=>{const D=_ln(p.x,N,E.width-N)*P,F=_ln(p.y,N,E.height-N)*P;return[D,F]},JX=(p,E)=>({x:Math.min(p.x,E.x),y:Math.min(p.y,E.y),x2:Math.max(p.x2,E.x2),y2:Math.max(p.y2,E.y2)}),jge=({x:p,y:E,width:P,height:N})=>({x:p,y:E,x2:p+P,y2:E+N}),GX=({x:p,y:E,x2:P,y2:N})=>({x:p,y:E,width:P-p,height:N-E}),lN=(p,E=[0,0])=>{var D,F;const{x:P,y:N}=Oge(p)?p.internals.positionAbsolute:dN(p,E);return{x:P,y:N,width:((D=p.measured)==null?void 0:D.width)??p.width??p.initialWidth??0,height:((F=p.measured)==null?void 0:F.height)??p.height??p.initialHeight??0}},FX=(p,E=[0,0])=>{var D,F;const{x:P,y:N}=Oge(p)?p.internals.positionAbsolute:dN(p,E);return{x:P,y:N,x2:P+(((D=p.measured)==null?void 0:D.width)??p.width??p.initialWidth??0),y2:N+(((F=p.measured)==null?void 0:F.height)??p.height??p.initialHeight??0)}},qhn=(p,E)=>GX(JX(jge(p),jge(E))),zhn=(p,E,P,N,D,F,v,q)=>{const te=Math.max(0,Math.min(p+P,D+v)-Math.max(p,D)),ie=Math.max(0,Math.min(E+N,F+q)-Math.max(E,F));return Math.ceil(te*ie)},BX=(p,E)=>zhn(p.x,p.y,p.width,p.height,E.x,E.y,E.width,E.height),Jln=p=>Zg(p.width)&&Zg(p.height)&&Zg(p.x)&&Zg(p.y),Zg=p=>!isNaN(p)&&isFinite(p),Uhn=(p,E)=>(P,N)=>{},bN=(p,E=[1,1])=>({x:E[0]*Math.round(p.x/E[0]),y:E[1]*Math.round(p.y/E[1])}),wN=({x:p,y:E},[P,N,D],F=!1,v=[1,1])=>{const q={x:(p-P)/D,y:(E-N)/D};return F?bN(q,v):q},SA=({x:p,y:E},[P,N,D])=>({x:p*D+P,y:E*D+N});function AA(p,E){if(typeof p=="number")return Math.floor((E-E/(1+p))*.5);if(typeof p=="string"&&p.endsWith("px")){const P=parseFloat(p);if(!Number.isNaN(P))return Math.floor(P)}if(typeof p=="string"&&p.endsWith("%")){const P=parseFloat(p);if(!Number.isNaN(P))return Math.floor(E*P*.01)}return console.error(`The padding value "${p}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function WBn(p,E,P){if(typeof p=="string"||typeof p=="number"){const N=AA(p,P),D=AA(p,E);return{top:N,right:D,bottom:N,left:D,x:D*2,y:N*2}}if(typeof p=="object"){const N=AA(p.top??p.y??0,P),D=AA(p.bottom??p.y??0,P),F=AA(p.left??p.x??0,E),v=AA(p.right??p.x??0,E);return{top:N,right:v,bottom:D,left:F,x:F+v,y:N+D}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function VBn(p,E,P,N,D,F){const{x:v,y:q}=SA(p,[E,P,N]),{x:te,y:ie}=SA({x:p.x+p.width,y:p.y+p.height},[E,P,N]),pe=D-te,oe=F-ie;return{left:Math.floor(v),top:Math.floor(q),right:Math.floor(pe),bottom:Math.floor(oe)}}const Lge=(p,E,P,N,D,F)=>{const v=WBn(F,E,P),q=(E-v.x)/p.width,te=(P-v.y)/p.height,ie=Math.min(q,te),pe=TA(ie,N,D),oe=p.x+p.width/2,z=p.y+p.height/2,Z=E/2-oe*pe,ne=P/2-z*pe,U=VBn(p,Z,ne,pe,E,P),xe={left:Math.min(U.left-v.left,0),top:Math.min(U.top-v.top,0),right:Math.min(U.right-v.right,0),bottom:Math.min(U.bottom-v.bottom,0)};return{x:Z-xe.left+xe.right,y:ne-xe.top+xe.bottom,zoom:pe}},hN=()=>{var p;return typeof navigator<"u"&&((p=navigator==null?void 0:navigator.userAgent)==null?void 0:p.indexOf("Mac"))>=0};function Y8(p){return p!=null&&p!=="parent"}function i2(p){var E,P;return{width:((E=p.measured)==null?void 0:E.width)??p.width??p.initialWidth??0,height:((P=p.measured)==null?void 0:P.height)??p.height??p.initialHeight??0}}function Xhn(p){var E,P;return(((E=p.measured)==null?void 0:E.width)??p.width??p.initialWidth)!==void 0&&(((P=p.measured)==null?void 0:P.height)??p.height??p.initialHeight)!==void 0}function Khn(p,E={width:0,height:0},P,N,D){const F={...p},v=N.get(P);if(v){const q=v.origin||D;F.x+=v.internals.positionAbsolute.x-(E.width??0)*q[0],F.y+=v.internals.positionAbsolute.y-(E.height??0)*q[1]}return F}function Gln(p,E){if(p.size!==E.size)return!1;for(const P of p)if(!E.has(P))return!1;return!0}function QBn(){let p,E;return{promise:new Promise((N,D)=>{p=N,E=D}),resolve:p,reject:E}}function YBn(p){return{...Rhn,...p||{}}}function Whn(p){return p===null?null:p?"valid":"invalid"}function rN(p,{snapGrid:E=[0,0],snapToGrid:P=!1,transform:N,containerBounds:D}){const{x:F,y:v}=e2(p),q=wN({x:F-((D==null?void 0:D.left)??0),y:v-((D==null?void 0:D.top)??0)},N),{x:te,y:ie}=P?bN(q,E):q;return{xSnapped:te,ySnapped:ie,...q}}const $ge=p=>({width:p.offsetWidth,height:p.offsetHeight}),Vhn=p=>{var E;return((E=p==null?void 0:p.getRootNode)==null?void 0:E.call(p))||(window==null?void 0:window.document)},ZBn=["INPUT","SELECT","TEXTAREA"];function Qhn(p){var N,D;const E=((D=(N=p.composedPath)==null?void 0:N.call(p))==null?void 0:D[0])||p.target;return(E==null?void 0:E.nodeType)!==1?!1:ZBn.includes(E.nodeName)||E.hasAttribute("contenteditable")||!!E.closest(".nokey")}const Yhn=p=>"clientX"in p,e2=(p,E)=>{var F,v;const P=Yhn(p),N=P?p.clientX:(F=p.touches)==null?void 0:F[0].clientX,D=P?p.clientY:(v=p.touches)==null?void 0:v[0].clientY;return{x:N-((E==null?void 0:E.left)??0),y:D-((E==null?void 0:E.top)??0)}},Hln=(p,E,P,N,D)=>{const F=E.querySelectorAll(`.${p}`);return!F||!F.length?null:Array.from(F).map(v=>{const q=v.getBoundingClientRect();return{id:v.getAttribute("data-handleid"),type:p,nodeId:D,position:v.getAttribute("data-handlepos"),x:(q.left-P.left)/N,y:(q.top-P.top)/N,...$ge(v)}})};function Zhn({sourceX:p,sourceY:E,targetX:P,targetY:N,sourceControlX:D,sourceControlY:F,targetControlX:v,targetControlY:q}){const te=p*.125+D*.375+v*.375+P*.125,ie=E*.125+F*.375+q*.375+N*.125,pe=Math.abs(te-p),oe=Math.abs(ie-E);return[te,ie,pe,oe]}function TX(p,E){return p>=0?.5*p:E*25*Math.sqrt(-p)}function qln({pos:p,x1:E,y1:P,x2:N,y2:D,c:F}){switch(p){case ji.Left:return[E-TX(E-N,F),P];case ji.Right:return[E+TX(N-E,F),P];case ji.Top:return[E,P-TX(P-D,F)];case ji.Bottom:return[E,P+TX(D-P,F)]}}function gN({sourceX:p,sourceY:E,sourcePosition:P=ji.Bottom,targetX:N,targetY:D,targetPosition:F=ji.Top,curvature:v=.25}){const[q,te]=qln({pos:P,x1:p,y1:E,x2:N,y2:D,c:v}),[ie,pe]=qln({pos:F,x1:N,y1:D,x2:p,y2:E,c:v}),[oe,z,Z,ne]=Zhn({sourceX:p,sourceY:E,targetX:N,targetY:D,sourceControlX:q,sourceControlY:te,targetControlX:ie,targetControlY:pe});return[`M${p},${E} C${q},${te} ${ie},${pe} ${N},${D}`,oe,z,Z,ne]}function ean({sourceX:p,sourceY:E,targetX:P,targetY:N}){const D=Math.abs(P-p)/2,F=P<p?P+D:P-D,v=Math.abs(N-E)/2,q=N<E?N+v:N-v;return[F,q,D,v]}function eRn({sourceNode:p,targetNode:E,selected:P=!1,zIndex:N=0,elevateOnSelect:D=!1,zIndexMode:F="basic"}){if(F==="manual")return N;const v=D&&P?N+1e3:N,q=Math.max(p.parentId||D&&p.selected?p.internals.z:0,E.parentId||D&&E.selected?E.internals.z:0);return v+q}function nRn({sourceNode:p,targetNode:E,width:P,height:N,transform:D}){const F=JX(FX(p),FX(E));F.x===F.x2&&(F.x2+=1),F.y===F.y2&&(F.y2+=1);const v={x:-D[0]/D[2],y:-D[1]/D[2],width:P/D[2],height:N/D[2]};return BX(v,GX(F))>0}const tRn=({source:p,sourceHandle:E,target:P,targetHandle:N})=>`xy-edge__${p}${E||""}-${P}${N||""}`,iRn=(p,E)=>E.some(P=>P.source===p.source&&P.target===p.target&&(P.sourceHandle===p.sourceHandle||!P.sourceHandle&&!p.sourceHandle)&&(P.targetHandle===p.targetHandle||!P.targetHandle&&!p.targetHandle)),rRn=(p,E,P={})=>{var F;if(!p.source||!p.target)return(F=P.onError)==null||F.call(P,"006",t2.error006()),E;const N=P.getEdgeId||tRn;let D;return Jhn(p)?D={...p}:D={...p,id:N(p)},iRn(D,E)?E:(D.sourceHandle===null&&delete D.sourceHandle,D.targetHandle===null&&delete D.targetHandle,E.concat(D))};function nan({sourceX:p,sourceY:E,targetX:P,targetY:N}){const[D,F,v,q]=ean({sourceX:p,sourceY:E,targetX:P,targetY:N});return[`M ${p},${E}L ${P},${N}`,D,F,v,q]}const zln={[ji.Left]:{x:-1,y:0},[ji.Right]:{x:1,y:0},[ji.Top]:{x:0,y:-1},[ji.Bottom]:{x:0,y:1}},cRn=({source:p,sourcePosition:E=ji.Bottom,target:P})=>E===ji.Left||E===ji.Right?p.x<P.x?{x:1,y:0}:{x:-1,y:0}:p.y<P.y?{x:0,y:1}:{x:0,y:-1},Uln=(p,E)=>Math.sqrt(Math.pow(E.x-p.x,2)+Math.pow(E.y-p.y,2));function uRn({source:p,sourcePosition:E=ji.Bottom,target:P,targetPosition:N=ji.Top,center:D,offset:F,stepPosition:v}){const q=zln[E],te=zln[N],ie={x:p.x+q.x*F,y:p.y+q.y*F},pe={x:P.x+te.x*F,y:P.y+te.y*F},oe=cRn({source:ie,sourcePosition:E,target:pe}),z=oe.x!==0?"x":"y",Z=oe[z];let ne=[],U,xe;const ce={x:0,y:0},ge={x:0,y:0},[,,ee,Me]=ean({sourceX:p.x,sourceY:p.y,targetX:P.x,targetY:P.y});if(q[z]*te[z]===-1){z==="x"?(U=D.x??ie.x+(pe.x-ie.x)*v,xe=D.y??(ie.y+pe.y)/2):(U=D.x??(ie.x+pe.x)/2,xe=D.y??ie.y+(pe.y-ie.y)*v);const kn=[{x:U,y:ie.y},{x:U,y:pe.y}],jn=[{x:ie.x,y:xe},{x:pe.x,y:xe}];q[z]===Z?ne=z==="x"?kn:jn:ne=z==="x"?jn:kn}else{const kn=[{x:ie.x,y:pe.y}],jn=[{x:pe.x,y:ie.y}];if(z==="x"?ne=q.x===Z?jn:kn:ne=q.y===Z?kn:jn,E===N){const je=Math.abs(p[z]-P[z]);if(je<=F){const on=Math.min(F-1,F-je);q[z]===Z?ce[z]=(ie[z]>p[z]?-1:1)*on:ge[z]=(pe[z]>P[z]?-1:1)*on}}if(E!==N){const je=z==="x"?"y":"x",on=q[z]===te[je],rn=ie[je]>pe[je],Sn=ie[je]<pe[je];(q[z]===1&&(!on&&rn||on&&Sn)||q[z]!==1&&(!on&&Sn||on&&rn))&&(ne=z==="x"?kn:jn)}const Zn={x:ie.x+ce.x,y:ie.y+ce.y},$n={x:pe.x+ge.x,y:pe.y+ge.y},Vn=Math.max(Math.abs(Zn.x-ne[0].x),Math.abs($n.x-ne[0].x)),_=Math.max(Math.abs(Zn.y-ne[0].y),Math.abs($n.y-ne[0].y));Vn>=_?(U=(Zn.x+$n.x)/2,xe=ne[0].y):(U=ne[0].x,xe=(Zn.y+$n.y)/2)}const Ke={x:ie.x+ce.x,y:ie.y+ce.y},Xe={x:pe.x+ge.x,y:pe.y+ge.y};return[[p,...Ke.x!==ne[0].x||Ke.y!==ne[0].y?[Ke]:[],...ne,...Xe.x!==ne[ne.length-1].x||Xe.y!==ne[ne.length-1].y?[Xe]:[],P],U,xe,ee,Me]}function oRn(p,E,P,N){const D=Math.min(Uln(p,E)/2,Uln(E,P)/2,N),{x:F,y:v}=E;if(p.x===F&&F===P.x||p.y===v&&v===P.y)return`L${F} ${v}`;if(p.y===v){const ie=p.x<P.x?-1:1,pe=p.y<P.y?1:-1;return`L ${F+D*ie},${v}Q ${F},${v} ${F},${v+D*pe}`}const q=p.x<P.x?1:-1,te=p.y<P.y?-1:1;return`L ${F},${v+D*te}Q ${F},${v} ${F+D*q},${v}`}function Ege({sourceX:p,sourceY:E,sourcePosition:P=ji.Bottom,targetX:N,targetY:D,targetPosition:F=ji.Top,borderRadius:v=5,centerX:q,centerY:te,offset:ie=20,stepPosition:pe=.5}){const[oe,z,Z,ne,U]=uRn({source:{x:p,y:E},sourcePosition:P,target:{x:N,y:D},targetPosition:F,center:{x:q,y:te},offset:ie,stepPosition:pe});let xe=`M${oe[0].x} ${oe[0].y}`;for(let ce=1;ce<oe.length-1;ce++)xe+=oRn(oe[ce-1],oe[ce],oe[ce+1],v);return xe+=`L${oe[oe.length-1].x} ${oe[oe.length-1].y}`,[xe,z,Z,ne,U]}function Xln(p){var E;return p&&!!(p.internals.handleBounds||(E=p.handles)!=null&&E.length)&&!!(p.measured.width||p.width||p.initialWidth)}function sRn(p){var oe;const{sourceNode:E,targetNode:P}=p;if(!Xln(E)||!Xln(P))return null;const N=E.internals.handleBounds||Kln(E.handles),D=P.internals.handleBounds||Kln(P.handles),F=Wln((N==null?void 0:N.source)??[],p.sourceHandle),v=Wln(p.connectionMode===xA.Strict?(D==null?void 0:D.target)??[]:((D==null?void 0:D.target)??[]).concat((D==null?void 0:D.source)??[]),p.targetHandle);if(!F||!v)return(oe=p.onError)==null||oe.call(p,"008",t2.error008(F?"target":"source",{id:p.id,sourceHandle:p.sourceHandle,targetHandle:p.targetHandle})),null;const q=(F==null?void 0:F.position)||ji.Bottom,te=(v==null?void 0:v.position)||ji.Top,ie=Z8(E,F,q),pe=Z8(P,v,te);return{sourceX:ie.x,sourceY:ie.y,targetX:pe.x,targetY:pe.y,sourcePosition:q,targetPosition:te}}function Kln(p){if(!p)return null;const E=[],P=[];for(const N of p)N.width=N.width??1,N.height=N.height??1,N.type==="source"?E.push(N):N.type==="target"&&P.push(N);return{source:E,target:P}}function Z8(p,E,P=ji.Left,N=!1){const D=((E==null?void 0:E.x)??0)+p.internals.positionAbsolute.x,F=((E==null?void 0:E.y)??0)+p.internals.positionAbsolute.y,{width:v,height:q}=E??i2(p);if(N)return{x:D+v/2,y:F+q/2};switch((E==null?void 0:E.position)??P){case ji.Top:return{x:D+v/2,y:F};case ji.Right:return{x:D+v,y:F+q/2};case ji.Bottom:return{x:D+v/2,y:F+q};case ji.Left:return{x:D,y:F+q/2}}}function Wln(p,E){return p&&(E?p.find(P=>P.id===E):p[0])||null}function Age(p,E){return p?typeof p=="string"?p:`${E?`${E}__`:""}${Object.keys(p).sort().map(N=>`${N}=${p[N]}`).join("&")}`:""}function fRn(p,{id:E,defaultColor:P,defaultMarkerStart:N,defaultMarkerEnd:D}){const F=new Set;return p.reduce((v,q)=>([q.markerStart||N,q.markerEnd||D].forEach(te=>{if(te&&typeof te=="object"){const ie=Age(te,E);F.has(ie)||(v.push({id:ie,color:te.color||P,...te}),F.add(ie))}}),v),[]).sort((v,q)=>v.id.localeCompare(q.id))}function lRn(p,E,P,N,D){let F=.5;D==="start"?F=0:D==="end"&&(F=1);let v=[(p.x+p.width*F)*E.zoom+E.x,p.y*E.zoom+E.y-N],q=[-100*F,-100];switch(P){case ji.Right:v=[(p.x+p.width)*E.zoom+E.x+N,(p.y+p.height*F)*E.zoom+E.y],q=[0,-100*F];break;case ji.Bottom:v[1]=(p.y+p.height)*E.zoom+E.y+N,q[1]=0;break;case ji.Left:v=[p.x*E.zoom+E.x-N,(p.y+p.height*F)*E.zoom+E.y],q=[-100,-100*F];break}return`translate(${v[0]}px, ${v[1]}px) translate(${q[0]}%, ${q[1]}%)`}const tan=1e3,hRn=10,Fge={nodeOrigin:[0,0],nodeExtent:oN,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},aRn={...Fge,checkEquality:!0};function Bge(p,E){const P={...p};for(const N in E)E[N]!==void 0&&(P[N]=E[N]);return P}function dRn(p,E,P){const N=Bge(Fge,P);for(const D of p.values())if(D.parentId)_ge(D,p,E,N);else{const F=dN(D,N.nodeOrigin),v=Y8(D.extent)?D.extent:N.nodeExtent,q=Q8(F,v,i2(D));D.internals.positionAbsolute=q}}function bRn(p,E){if(!p.handles)return p.measured?E==null?void 0:E.internals.handleBounds:void 0;const P=[],N=[];for(const D of p.handles){const F={id:D.id,width:D.width??1,height:D.height??1,nodeId:p.id,x:D.x,y:D.y,position:D.position,type:D.type};D.type==="source"?P.push(F):D.type==="target"&&N.push(F)}return{source:P,target:N}}function Rge(p){return p==="manual"}function Mge(p,E,P,N={}){var pe,oe;const D=Bge(aRn,N),F={i:0},v=new Map(E),q=D!=null&&D.elevateNodesOnSelect&&!Rge(D.zIndexMode)?tan:0;let te=p.length>0,ie=!1;E.clear(),P.clear();for(const z of p){let Z=v.get(z.id);if(D.checkEquality&&z===(Z==null?void 0:Z.internals.userNode))E.set(z.id,Z);else{const ne=dN(z,D.nodeOrigin),U=Y8(z.extent)?z.extent:D.nodeExtent,xe=Q8(ne,U,i2(z));Z={...D.defaults,...z,measured:{width:(pe=z.measured)==null?void 0:pe.width,height:(oe=z.measured)==null?void 0:oe.height},internals:{positionAbsolute:xe,handleBounds:bRn(z,Z),z:ian(z,q,D.zIndexMode),userNode:z}},E.set(z.id,Z)}(Z.measured===void 0||Z.measured.width===void 0||Z.measured.height===void 0)&&!Z.hidden&&(te=!1),z.parentId&&_ge(Z,E,P,N,F),ie||(ie=z.selected??!1)}return{nodesInitialized:te,hasSelectedNodes:ie}}function wRn(p,E){if(!p.parentId)return;const P=E.get(p.parentId);P?P.set(p.id,p):E.set(p.parentId,new Map([[p.id,p]]))}function _ge(p,E,P,N,D){const{elevateNodesOnSelect:F,nodeOrigin:v,nodeExtent:q,zIndexMode:te}=Bge(Fge,N),ie=p.parentId,pe=E.get(ie);if(!pe){console.warn(`Parent node ${ie} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}wRn(p,P),D&&!pe.parentId&&pe.internals.rootParentIndex===void 0&&te==="auto"&&(pe.internals.rootParentIndex=++D.i,pe.internals.z=pe.internals.z+D.i*hRn),D&&pe.internals.rootParentIndex!==void 0&&(D.i=pe.internals.rootParentIndex);const oe=F&&!Rge(te)?tan:0,{x:z,y:Z,z:ne}=gRn(p,pe,v,q,oe,te),{positionAbsolute:U}=p.internals,xe=z!==U.x||Z!==U.y;(xe||ne!==p.internals.z)&&E.set(p.id,{...p,internals:{...p.internals,positionAbsolute:xe?{x:z,y:Z}:U,z:ne}})}function ian(p,E,P){const N=Zg(p.zIndex)?p.zIndex:0;return Rge(P)?N:N+(p.selected?E:0)}function gRn(p,E,P,N,D,F){const{x:v,y:q}=E.internals.positionAbsolute,te=i2(p),ie=dN(p,P),pe=Y8(p.extent)?Q8(ie,p.extent,te):ie;let oe=Q8({x:v+pe.x,y:q+pe.y},N,te);p.extent==="parent"&&(oe=Hhn(oe,te,E));const z=ian(p,D,F),Z=E.internals.z??0;return{x:oe.x,y:oe.y,z:Z>=z?Z+1:z}}function Jge(p,E,P,N=[0,0]){var v;const D=[],F=new Map;for(const q of p){const te=E.get(q.parentId);if(!te)continue;const ie=((v=F.get(q.parentId))==null?void 0:v.expandedRect)??lN(te),pe=qhn(ie,q.rect);F.set(q.parentId,{expandedRect:pe,parent:te})}return F.size>0&&F.forEach(({expandedRect:q,parent:te},ie)=>{var ee;const pe=te.internals.positionAbsolute,oe=i2(te),z=te.origin??N,Z=q.x<pe.x?Math.round(Math.abs(pe.x-q.x)):0,ne=q.y<pe.y?Math.round(Math.abs(pe.y-q.y)):0,U=Math.max(oe.width,Math.round(q.width)),xe=Math.max(oe.height,Math.round(q.height)),ce=(U-oe.width)*z[0],ge=(xe-oe.height)*z[1];(Z>0||ne>0||ce||ge)&&(D.push({id:ie,type:"position",position:{x:te.position.x-Z+ce,y:te.position.y-ne+ge}}),(ee=P.get(ie))==null||ee.forEach(Me=>{p.some(Ke=>Ke.id===Me.id)||D.push({id:Me.id,type:"position",position:{x:Me.position.x+Z,y:Me.position.y+ne}})})),(oe.width<q.width||oe.height<q.height||Z||ne)&&D.push({id:ie,type:"dimensions",setAttributes:!0,dimensions:{width:U+(Z?z[0]*Z-ce:0),height:xe+(ne?z[1]*ne-ge:0)}})}),D}function pRn(p,E,P,N,D,F,v){const q=N==null?void 0:N.querySelector(".xyflow__viewport");let te=!1;if(!q)return{changes:[],updatedInternals:te};const ie=[],pe=window.getComputedStyle(q),{m22:oe}=new window.DOMMatrixReadOnly(pe.transform),z=[];for(const Z of p.values()){const ne=E.get(Z.id);if(!ne)continue;if(ne.hidden){E.set(ne.id,{...ne,internals:{...ne.internals,handleBounds:void 0}}),te=!0;continue}const U=$ge(Z.nodeElement),xe=ne.measured.width!==U.width||ne.measured.height!==U.height;if(!!(U.width&&U.height&&(xe||!ne.internals.handleBounds||Z.force))){const ge=Z.nodeElement.getBoundingClientRect(),ee=Y8(ne.extent)?ne.extent:F;let{positionAbsolute:Me}=ne.internals;if(ne.parentId&&ne.extent==="parent"){const Xe=E.get(ne.parentId);Xe&&(Me=Hhn(Me,U,Xe))}else ee&&(Me=Q8(Me,ee,U));const Ke={...ne,measured:U,internals:{...ne.internals,positionAbsolute:Me,handleBounds:{source:Hln("source",Z.nodeElement,ge,oe,ne.id),target:Hln("target",Z.nodeElement,ge,oe,ne.id)}}};E.set(ne.id,Ke),ne.parentId&&_ge(Ke,E,P,{nodeOrigin:D,zIndexMode:v}),te=!0,xe&&(ie.push({id:ne.id,type:"dimensions",dimensions:U}),ne.expandParent&&ne.parentId&&z.push({id:ne.id,parentId:ne.parentId,rect:lN(Ke,D)}))}}if(z.length>0){const Z=Jge(z,E,P,D);ie.push(...Z)}return{changes:ie,updatedInternals:te}}async function mRn({delta:p,panZoom:E,transform:P,translateExtent:N,width:D,height:F}){if(!E||!p.x&&!p.y)return!1;const v=await E.setViewportConstrained({x:P[0]+p.x,y:P[1]+p.y,zoom:P[2]},[[0,0],[D,F]],N);return!!v&&(v.x!==P[0]||v.y!==P[1]||v.k!==P[2])}function Vln(p,E,P,N,D,F){let v=D;const q=N.get(v)||new Map;N.set(v,q.set(P,E)),v=`${D}-${p}`;const te=N.get(v)||new Map;if(N.set(v,te.set(P,E)),F){v=`${D}-${p}-${F}`;const ie=N.get(v)||new Map;N.set(v,ie.set(P,E))}}function ran(p,E,P){p.clear(),E.clear();for(const N of P){const{source:D,target:F,sourceHandle:v=null,targetHandle:q=null}=N,te={edgeId:N.id,source:D,target:F,sourceHandle:v,targetHandle:q},ie=`${D}-${v}--${F}-${q}`,pe=`${F}-${q}--${D}-${v}`;Vln("source",te,pe,p,D,v),Vln("target",te,ie,p,F,q),E.set(N.id,N)}}function can(p,E){if(!p.parentId)return!1;const P=E.get(p.parentId);return P?P.selected?!0:can(P,E):!1}function Qln(p,E,P){var D;let N=p;do{if((D=N==null?void 0:N.matches)!=null&&D.call(N,E))return!0;if(N===P)return!1;N=N==null?void 0:N.parentElement}while(N);return!1}function vRn(p,E,P,N){const D=new Map;for(const[F,v]of p)if((v.selected||v.id===N)&&(!v.parentId||!can(v,p))&&(v.draggable||E&&typeof v.draggable>"u")){const q=p.get(F);q&&D.set(F,{id:F,position:q.position||{x:0,y:0},distance:{x:P.x-q.internals.positionAbsolute.x,y:P.y-q.internals.positionAbsolute.y},extent:q.extent,parentId:q.parentId,origin:q.origin,expandParent:q.expandParent,internals:{positionAbsolute:q.internals.positionAbsolute||{x:0,y:0}},measured:{width:q.measured.width??0,height:q.measured.height??0}})}return D}function wge({nodeId:p,dragItems:E,nodeLookup:P,dragging:N=!0}){var v,q,te;const D=[];for(const[ie,pe]of E){const oe=(v=P.get(ie))==null?void 0:v.internals.userNode;oe&&D.push({...oe,position:pe.position,dragging:N})}if(!p)return[D[0],D];const F=(q=P.get(p))==null?void 0:q.internals.userNode;return[F?{...F,position:((te=E.get(p))==null?void 0:te.position)||F.position,dragging:N}:D[0],D]}function yRn({dragItems:p,snapGrid:E,x:P,y:N}){const D=p.values().next().value;if(!D)return null;const F={x:P-D.distance.x,y:N-D.distance.y},v=bN(F,E);return{x:v.x-F.x,y:v.y-F.y}}function kRn({onNodeMouseDown:p,getStoreItems:E,onDragStart:P,onDrag:N,onDragStop:D}){let F={x:null,y:null},v=0,q=new Map,te=!1,ie={x:0,y:0},pe=null,oe=!1,z=null,Z=!1,ne=!1,U=null;function xe({noDragClassName:ge,handleSelector:ee,domNode:Me,isSelectable:Ke,nodeId:Xe,nodeClickDistance:Ye=0}){z=$0(Me);function kn({x:Vn,y:_}){const{nodeLookup:je,nodeExtent:on,snapGrid:rn,snapToGrid:Sn,nodeOrigin:Bn,onNodeDrag:dn,onSelectionDrag:Gn,onError:Nn,updateNodePositions:qn}=E();F={x:Vn,y:_};let Jt=!1;const Kt=q.size>1,Oi=Kt&&on?jge(PA(q)):null,gr=Kt&&Sn?yRn({dragItems:q,snapGrid:rn,x:Vn,y:_}):null;for(const[Ki,Kn]of q){if(!je.has(Ki))continue;let ei={x:Vn-Kn.distance.x,y:_-Kn.distance.y};Sn&&(ei=gr?{x:Math.round(ei.x+gr.x),y:Math.round(ei.y+gr.y)}:bN(ei,rn));let rr=null;if(Kt&&on&&!Kn.extent&&Oi){const{positionAbsolute:sr}=Kn.internals,ri=sr.x-Oi.x+on[0][0],bi=sr.x+Kn.measured.width-Oi.x2+on[1][0],Mc=sr.y-Oi.y+on[0][1],ku=sr.y+Kn.measured.height-Oi.y2+on[1][1];rr=[[ri,Mc],[bi,ku]]}const{position:cr,positionAbsolute:_i}=Ghn({nodeId:Ki,nextPosition:ei,nodeLookup:je,nodeExtent:rr||on,nodeOrigin:Bn,onError:Nn});Jt=Jt||Kn.position.x!==cr.x||Kn.position.y!==cr.y,Kn.position=cr,Kn.internals.positionAbsolute=_i}if(ne=ne||Jt,!!Jt&&(qn(q,!0),U&&(N||dn||!Xe&&Gn))){const[Ki,Kn]=wge({nodeId:Xe,dragItems:q,nodeLookup:je});N==null||N(U,q,Ki,Kn),dn==null||dn(U,Ki,Kn),Xe||Gn==null||Gn(U,Kn)}}async function jn(){if(!pe)return;const{transform:Vn,panBy:_,autoPanSpeed:je,autoPanOnNodeDrag:on}=E();if(!on){te=!1,cancelAnimationFrame(v);return}const[rn,Sn]=Dge(ie,pe,je);(rn!==0||Sn!==0)&&(F.x=(F.x??0)-rn/Vn[2],F.y=(F.y??0)-Sn/Vn[2],await _({x:rn,y:Sn})&&kn(F)),v=requestAnimationFrame(jn)}function Zn(Vn){var Kt;const{nodeLookup:_,multiSelectionActive:je,nodesDraggable:on,transform:rn,snapGrid:Sn,snapToGrid:Bn,selectNodesOnDrag:dn,onNodeDragStart:Gn,onSelectionDragStart:Nn,unselectNodesAndEdges:qn}=E();oe=!0,(!dn||!Ke)&&!je&&Xe&&((Kt=_.get(Xe))!=null&&Kt.selected||qn()),Ke&&dn&&Xe&&(p==null||p(Xe));const Jt=rN(Vn.sourceEvent,{transform:rn,snapGrid:Sn,snapToGrid:Bn,containerBounds:pe});if(F=Jt,q=vRn(_,on,Jt,Xe),q.size>0&&(P||Gn||!Xe&&Nn)){const[Oi,gr]=wge({nodeId:Xe,dragItems:q,nodeLookup:_});P==null||P(Vn.sourceEvent,q,Oi,gr),Gn==null||Gn(Vn.sourceEvent,Oi,gr),Xe||Nn==null||Nn(Vn.sourceEvent,gr)}}const $n=$hn().clickDistance(Ye).on("start",Vn=>{const{domNode:_,nodeDragThreshold:je,transform:on,snapGrid:rn,snapToGrid:Sn}=E();pe=(_==null?void 0:_.getBoundingClientRect())||null,Z=!1,ne=!1,U=Vn.sourceEvent,je===0&&Zn(Vn),F=rN(Vn.sourceEvent,{transform:on,snapGrid:rn,snapToGrid:Sn,containerBounds:pe}),ie=e2(Vn.sourceEvent,pe)}).on("drag",Vn=>{const{autoPanOnNodeDrag:_,transform:je,snapGrid:on,snapToGrid:rn,nodeDragThreshold:Sn,nodeLookup:Bn}=E(),dn=rN(Vn.sourceEvent,{transform:je,snapGrid:on,snapToGrid:rn,containerBounds:pe});if(U=Vn.sourceEvent,(Vn.sourceEvent.type==="touchmove"&&Vn.sourceEvent.touches.length>1||Xe&&!Bn.has(Xe))&&(Z=!0),!Z){if(!te&&_&&oe&&(te=!0,jn()),!oe){const Gn=e2(Vn.sourceEvent,pe),Nn=Gn.x-ie.x,qn=Gn.y-ie.y;Math.sqrt(Nn*Nn+qn*qn)>Sn&&Zn(Vn)}(F.x!==dn.xSnapped||F.y!==dn.ySnapped)&&q&&oe&&(ie=e2(Vn.sourceEvent,pe),kn(dn))}}).on("end",Vn=>{if(!oe||Z){Z&&q.size>0&&E().updateNodePositions(q,!1);return}if(te=!1,oe=!1,cancelAnimationFrame(v),q.size>0){const{nodeLookup:_,updateNodePositions:je,onNodeDragStop:on,onSelectionDragStop:rn}=E();if(ne&&(je(q,!1),ne=!1),D||on||!Xe&&rn){const[Sn,Bn]=wge({nodeId:Xe,dragItems:q,nodeLookup:_,dragging:!1});D==null||D(Vn.sourceEvent,q,Sn,Bn),on==null||on(Vn.sourceEvent,Sn,Bn),Xe||rn==null||rn(Vn.sourceEvent,Bn)}}}).filter(Vn=>{const _=Vn.target;return!Vn.button&&(!ge||!Qln(_,`.${ge}`,Me))&&(!ee||Qln(_,ee,Me))});z.call($n)}function ce(){z==null||z.on(".drag",null)}return{update:xe,destroy:ce}}function jRn(p,E,P){const N=[],D={x:p.x-P,y:p.y-P,width:P*2,height:P*2};for(const F of E.values())BX(D,lN(F))>0&&N.push(F);return N}const ERn=250;function ARn(p,E,P,N){var q,te;let D=[],F=1/0;const v=jRn(p,P,E+ERn);for(const ie of v){const pe=[...((q=ie.internals.handleBounds)==null?void 0:q.source)??[],...((te=ie.internals.handleBounds)==null?void 0:te.target)??[]];for(const oe of pe){if(N.nodeId===oe.nodeId&&N.type===oe.type&&N.id===oe.id)continue;const{x:z,y:Z}=Z8(ie,oe,oe.position,!0),ne=Math.sqrt(Math.pow(z-p.x,2)+Math.pow(Z-p.y,2));ne>E||(ne<F?(D=[{...oe,x:z,y:Z}],F=ne):ne===F&&D.push({...oe,x:z,y:Z}))}}if(!D.length)return null;if(D.length>1){const ie=N.type==="source"?"target":"source";return D.find(pe=>pe.type===ie)??D[0]}return D[0]}function uan(p,E,P,N,D,F=!1){var ie,pe,oe;const v=N.get(p);if(!v)return null;const q=D==="strict"?(ie=v.internals.handleBounds)==null?void 0:ie[E]:[...((pe=v.internals.handleBounds)==null?void 0:pe.source)??[],...((oe=v.internals.handleBounds)==null?void 0:oe.target)??[]],te=(P?q==null?void 0:q.find(z=>z.id===P):q==null?void 0:q[0])??null;return te&&F?{...te,...Z8(v,te,te.position,!0)}:te}function oan(p,E){return p||(E!=null&&E.classList.contains("target")?"target":E!=null&&E.classList.contains("source")?"source":null)}function MRn(p,E){let P=null;return E?P=!0:p&&!E&&(P=!1),P}const san=()=>!0;function CRn(p,{connectionMode:E,connectionRadius:P,handleId:N,nodeId:D,edgeUpdaterType:F,isTarget:v,domNode:q,nodeLookup:te,lib:ie,autoPanOnConnect:pe,flowId:oe,panBy:z,cancelConnection:Z,onConnectStart:ne,onConnect:U,onConnectEnd:xe,isValidConnection:ce=san,onReconnectEnd:ge,updateConnection:ee,getTransform:Me,getFromHandle:Ke,autoPanSpeed:Xe,dragThreshold:Ye=1,handleDomNode:kn}){const jn=Vhn(p.target);let Zn=0,$n;const{x:Vn,y:_}=e2(p),je=oan(F,kn),on=q==null?void 0:q.getBoundingClientRect();let rn=!1;if(!on||!je)return;const Sn=uan(D,je,N,te,E);if(!Sn)return;let Bn=e2(p,on),dn=!1,Gn=null,Nn=!1,qn=null;function Jt(){if(!pe||!on)return;const[cr,_i]=Dge(Bn,on,Xe);z({x:cr,y:_i}),Zn=requestAnimationFrame(Jt)}const Kt={...Sn,nodeId:D,type:je,position:Sn.position},Oi=te.get(D);let Ki={inProgress:!0,isValid:null,from:Z8(Oi,Kt,ji.Left,!0),fromHandle:Kt,fromPosition:Kt.position,fromNode:Oi,to:Bn,toHandle:null,toPosition:Rln[Kt.position],toNode:null,pointer:Bn};function Kn(){rn=!0,ee(Ki),ne==null||ne(p,{nodeId:D,handleId:N,handleType:je})}Ye===0&&Kn();function ei(cr){if(!rn){const{x:ku,y:Pr}=e2(cr),xa=ku-Vn,zl=Pr-_;if(!(xa*xa+zl*zl>Ye*Ye))return;Kn()}if(!Ke()||!Kt){rr(cr);return}const _i=Me();Bn=e2(cr,on),$n=ARn(wN(Bn,_i,!1,[1,1]),P,te,Kt),dn||(Jt(),dn=!0);const sr=fan(cr,{handle:$n,connectionMode:E,fromNodeId:D,fromHandleId:N,fromType:v?"target":"source",isValidConnection:ce,doc:jn,lib:ie,flowId:oe,nodeLookup:te});qn=sr.handleDomNode,Gn=sr.connection,Nn=MRn(!!$n,sr.isValid);const ri=te.get(D),bi=ri?Z8(ri,Kt,ji.Left,!0):Ki.from,Mc={...Ki,from:bi,isValid:Nn,to:sr.toHandle&&Nn?SA({x:sr.toHandle.x,y:sr.toHandle.y},_i):Bn,toHandle:sr.toHandle,toPosition:Nn&&sr.toHandle?sr.toHandle.position:Rln[Kt.position],toNode:sr.toHandle?te.get(sr.toHandle.nodeId):null,pointer:Bn};ee(Mc),Ki=Mc}function rr(cr){if(!("touches"in cr&&cr.touches.length>0)){if(rn){($n||qn)&&Gn&&Nn&&(U==null||U(Gn));const{inProgress:_i,...sr}=Ki,ri={...sr,toPosition:Ki.toHandle?Ki.toPosition:null};xe==null||xe(cr,ri),F&&(ge==null||ge(cr,ri))}Z(),cancelAnimationFrame(Zn),dn=!1,Nn=!1,Gn=null,qn=null,jn.removeEventListener("mousemove",ei),jn.removeEventListener("mouseup",rr),jn.removeEventListener("touchmove",ei),jn.removeEventListener("touchend",rr)}}jn.addEventListener("mousemove",ei),jn.addEventListener("mouseup",rr),jn.addEventListener("touchmove",ei),jn.addEventListener("touchend",rr)}function fan(p,{handle:E,connectionMode:P,fromNodeId:N,fromHandleId:D,fromType:F,doc:v,lib:q,flowId:te,isValidConnection:ie=san,nodeLookup:pe}){const oe=F==="target",z=E?v.querySelector(`.${q}-flow__handle[data-id="${te}-${E==null?void 0:E.nodeId}-${E==null?void 0:E.id}-${E==null?void 0:E.type}"]`):null,{x:Z,y:ne}=e2(p),U=v.elementFromPoint(Z,ne),xe=U!=null&&U.classList.contains(`${q}-flow__handle`)?U:z,ce={handleDomNode:xe,isValid:!1,connection:null,toHandle:null};if(xe){const ge=oan(void 0,xe),ee=xe.getAttribute("data-nodeid"),Me=xe.getAttribute("data-handleid"),Ke=xe.classList.contains("connectable"),Xe=xe.classList.contains("connectableend");if(!ee||!ge)return ce;const Ye={source:oe?ee:N,sourceHandle:oe?Me:D,target:oe?N:ee,targetHandle:oe?D:Me};ce.connection=Ye;const jn=Ke&&Xe&&(P===xA.Strict?oe&&ge==="source"||!oe&&ge==="target":ee!==N||Me!==D);ce.isValid=jn&&ie(Ye),ce.toHandle=uan(ee,ge,Me,pe,P,!0)}return ce}const Cge={onPointerDown:CRn,isValid:fan};function xRn({domNode:p,panZoom:E,getTransform:P,getViewScale:N}){const D=$0(p);function F({translateExtent:q,width:te,height:ie,zoomStep:pe=1,pannable:oe=!0,zoomable:z=!0,inversePan:Z=!1}){const ne=ee=>{if(ee.sourceEvent.type!=="wheel"||!E)return;const Me=P(),Ke=ee.sourceEvent.ctrlKey&&hN()?10:1,Xe=-ee.sourceEvent.deltaY*(ee.sourceEvent.deltaMode===1?.05:ee.sourceEvent.deltaMode?1:.002)*pe,Ye=Me[2]*Math.pow(2,Xe*Ke);E.scaleTo(Ye)};let U=[0,0];const xe=ee=>{(ee.sourceEvent.type==="mousedown"||ee.sourceEvent.type==="touchstart")&&(U=[ee.sourceEvent.clientX??ee.sourceEvent.touches[0].clientX,ee.sourceEvent.clientY??ee.sourceEvent.touches[0].clientY])},ce=ee=>{const Me=P();if(ee.sourceEvent.type!=="mousemove"&&ee.sourceEvent.type!=="touchmove"||!E)return;const Ke=[ee.sourceEvent.clientX??ee.sourceEvent.touches[0].clientX,ee.sourceEvent.clientY??ee.sourceEvent.touches[0].clientY],Xe=[Ke[0]-U[0],Ke[1]-U[1]];U=Ke;const Ye=N()*Math.max(Me[2],Math.log(Me[2]))*(Z?-1:1),kn={x:Me[0]-Xe[0]*Ye,y:Me[1]-Xe[1]*Ye},jn=[[0,0],[te,ie]];E.setViewportConstrained({x:kn.x,y:kn.y,zoom:Me[2]},jn,q)},ge=Fhn().on("start",xe).on("zoom",oe?ce:null).on("zoom.wheel",z?ne:null);D.call(ge,{})}function v(){D.on("zoom",null)}return{update:F,destroy:v,pointer:Yg}}const HX=p=>({x:p.x,y:p.y,zoom:p.k}),gge=({x:p,y:E,zoom:P})=>Pge.translate(p,E).scale(P),_5=(p,E)=>p.target.closest(`.${E}`),lan=(p,E)=>E===2&&Array.isArray(p)&&p.includes(2),TRn=p=>((p*=2)<=1?p*p*p:(p-=2)*p*p+2)/2,pge=(p,E=0,P=TRn,N=()=>{})=>{const D=typeof E=="number"&&E>0;return D||N(),D?p.transition().duration(E).ease(P).on("end",N):p},han=p=>{const E=p.ctrlKey&&hN()?10:1;return-p.deltaY*(p.deltaMode===1?.05:p.deltaMode?1:.002)*E};function SRn({zoomPanValues:p,noWheelClassName:E,d3Selection:P,d3Zoom:N,panOnScrollMode:D,panOnScrollSpeed:F,zoomOnPinch:v,onPanZoomStart:q,onPanZoom:te,onPanZoomEnd:ie}){return pe=>{if(_5(pe,E))return pe.ctrlKey&&pe.preventDefault(),!1;pe.preventDefault(),pe.stopImmediatePropagation();const oe=P.property("__zoom").k||1;if(pe.ctrlKey&&v){const xe=Yg(pe),ce=han(pe),ge=oe*Math.pow(2,ce);N.scaleTo(P,ge,xe,pe);return}const z=pe.deltaMode===1?20:1;let Z=D===V8.Vertical?0:pe.deltaX*z,ne=D===V8.Horizontal?0:pe.deltaY*z;!hN()&&pe.shiftKey&&D!==V8.Vertical&&(Z=pe.deltaY*z,ne=0),N.translateBy(P,-(Z/oe)*F,-(ne/oe)*F,{internal:!0});const U=HX(P.property("__zoom"));clearTimeout(p.panScrollTimeout),p.isPanScrolling?te==null||te(pe,U):(p.isPanScrolling=!0,q==null||q(pe,U)),p.panScrollTimeout=setTimeout(()=>{ie==null||ie(pe,U),p.isPanScrolling=!1},150)}}function IRn({noWheelClassName:p,preventScrolling:E,d3ZoomHandler:P}){return function(N,D){const F=N.type==="wheel",v=!E&&F&&!N.ctrlKey,q=_5(N,p);if(N.ctrlKey&&F&&q&&N.preventDefault(),v||q)return null;N.preventDefault(),P.call(this,N,D)}}function PRn({zoomPanValues:p,onDraggingChange:E,onPanZoomStart:P}){return N=>{var F,v,q;if((F=N.sourceEvent)!=null&&F.internal)return;const D=HX(N.transform);p.mouseButton=((v=N.sourceEvent)==null?void 0:v.button)||0,p.isZoomingOrPanning=!0,p.prevViewport=D,((q=N.sourceEvent)==null?void 0:q.type)==="mousedown"&&E(!0),P&&(P==null||P(N.sourceEvent,D))}}function ORn({zoomPanValues:p,panOnDrag:E,onPaneContextMenu:P,onTransformChange:N,onPanZoom:D}){return F=>{var v,q;p.usedRightMouseButton=!!(P&&lan(E,p.mouseButton??0)),(v=F.sourceEvent)!=null&&v.sync||N([F.transform.x,F.transform.y,F.transform.k]),D&&!((q=F.sourceEvent)!=null&&q.internal)&&(D==null||D(F.sourceEvent,HX(F.transform)))}}function NRn({zoomPanValues:p,panOnDrag:E,panOnScroll:P,onDraggingChange:N,onPanZoomEnd:D,onPaneContextMenu:F}){return v=>{var q;if(!((q=v.sourceEvent)!=null&&q.internal)&&(p.isZoomingOrPanning=!1,F&&lan(E,p.mouseButton??0)&&!p.usedRightMouseButton&&v.sourceEvent&&F(v.sourceEvent),p.usedRightMouseButton=!1,N(!1),D)){const te=HX(v.transform);p.prevViewport=te,clearTimeout(p.timerId),p.timerId=setTimeout(()=>{D==null||D(v.sourceEvent,te)},P?150:0)}}}function DRn({panActivationKeyPressed:p,zoomActivationKeyPressed:E,zoomOnScroll:P,zoomOnPinch:N,panOnDrag:D,panOnScroll:F,zoomOnDoubleClick:v,userSelectionActive:q,noWheelClassName:te,noPanClassName:ie,lib:pe,connectionInProgress:oe}){return z=>{var ce;const Z=E||P,ne=N&&z.ctrlKey,U=z.type==="wheel";if(z.button===1&&z.type==="mousedown"&&(_5(z,`${pe}-flow__node`)||_5(z,`${pe}-flow__edge`)||_5(z,`${pe}-flow__selection`)||_5(z,`${pe}-flow__nodesselection`)))return!0;if(!D&&!Z&&!F&&!v&&!N||q||oe&&!U||_5(z,te)&&U||_5(z,ie)&&(!U||F&&U&&!E)||!N&&z.ctrlKey&&U)return!1;if(!N&&z.type==="touchstart"&&((ce=z.touches)==null?void 0:ce.length)>1)return z.preventDefault(),!1;if(!Z&&!F&&!ne&&U||!D&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(D)&&!D.includes(z.button)&&z.type==="mousedown")return!1;const xe=Array.isArray(D)&&D.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||U||p)&&xe}}function LRn({domNode:p,minZoom:E,maxZoom:P,translateExtent:N,viewport:D,onPanZoom:F,onPanZoomStart:v,onPanZoomEnd:q,onDraggingChange:te}){const ie={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},pe=p.getBoundingClientRect();let oe=[[0,0],[pe.width,pe.height]];const z=typeof ResizeObserver<"u"?new ResizeObserver(_=>{const je=_[0];je&&(oe=[[0,0],[je.contentRect.width,je.contentRect.height]])}):null;z==null||z.observe(p);const Z=Fhn().extent(()=>oe).scaleExtent([E,P]).translateExtent(N),ne=$0(p).call(Z);Me({x:D.x,y:D.y,zoom:TA(D.zoom,E,P)},[[0,0],[pe.width,pe.height]],N);const U=ne.on("wheel.zoom"),xe=ne.on("dblclick.zoom");Z.wheelDelta(han);async function ce(_,je){return ne?new Promise(on=>{Z==null||Z.interpolate((je==null?void 0:je.interpolate)==="linear"?hge:NX).transform(pge(ne,je==null?void 0:je.duration,je==null?void 0:je.ease,()=>on(!0)),_)}):!1}function ge({noWheelClassName:_,noPanClassName:je,onPaneContextMenu:on,userSelectionActive:rn,panOnScroll:Sn,panOnDrag:Bn,panOnScrollMode:dn,panOnScrollSpeed:Gn,preventScrolling:Nn,zoomOnPinch:qn,zoomOnScroll:Jt,zoomOnDoubleClick:Kt,panActivationKeyPressed:Oi=!1,zoomActivationKeyPressed:gr,lib:Ki,onTransformChange:Kn,connectionInProgress:ei,paneClickDistance:rr,selectionOnDrag:cr}){rn&&!ie.isZoomingOrPanning&&ee();const _i=Sn&&!gr&&!rn;Z.clickDistance(cr?1/0:!Zg(rr)||rr<0?0:rr);const sr=_i?SRn({zoomPanValues:ie,noWheelClassName:_,d3Selection:ne,d3Zoom:Z,panOnScrollMode:dn,panOnScrollSpeed:Gn,zoomOnPinch:qn,onPanZoomStart:v,onPanZoom:F,onPanZoomEnd:q}):IRn({noWheelClassName:_,preventScrolling:Nn,d3ZoomHandler:U});ne.on("wheel.zoom",sr,{passive:!1});const ri=PRn({zoomPanValues:ie,onDraggingChange:te,onPanZoomStart:v});Z.on("start",ri);const bi=ORn({zoomPanValues:ie,panOnDrag:Bn,onPaneContextMenu:!!on,onPanZoom:F,onTransformChange:Kn});Z.on("zoom",bi);const Mc=NRn({zoomPanValues:ie,panOnDrag:Bn,panOnScroll:Sn,onPaneContextMenu:on,onPanZoomEnd:q,onDraggingChange:te});Z.on("end",Mc);const ku=DRn({panActivationKeyPressed:Oi,zoomActivationKeyPressed:gr,panOnDrag:Bn,zoomOnScroll:Jt,panOnScroll:Sn,zoomOnDoubleClick:Kt,zoomOnPinch:qn,userSelectionActive:rn,noPanClassName:je,noWheelClassName:_,lib:Ki,connectionInProgress:ei});Z.filter(ku),Kt?ne.on("dblclick.zoom",xe):ne.on("dblclick.zoom",null)}function ee(){Z.on("zoom",null)}async function Me(_,je,on){const rn=gge(_),Sn=Z==null?void 0:Z.constrain()(rn,je,on);return Sn&&await ce(Sn),Sn}async function Ke(_,je){const on=gge(_);return await ce(on,je),on}function Xe(_){if(ne){const je=gge(_),on=ne.property("__zoom");(on.k!==_.zoom||on.x!==_.x||on.y!==_.y)&&(Z==null||Z.transform(ne,je,null,{sync:!0}))}}function Ye(){const _=ne?bBn(ne.node()):{x:0,y:0,k:1};return{x:_.x,y:_.y,zoom:_.k}}async function kn(_,je){return ne?new Promise(on=>{Z==null||Z.interpolate((je==null?void 0:je.interpolate)==="linear"?hge:NX).scaleTo(pge(ne,je==null?void 0:je.duration,je==null?void 0:je.ease,()=>on(!0)),_)}):!1}async function jn(_,je){return ne?new Promise(on=>{Z==null||Z.interpolate((je==null?void 0:je.interpolate)==="linear"?hge:NX).scaleBy(pge(ne,je==null?void 0:je.duration,je==null?void 0:je.ease,()=>on(!0)),_)}):!1}function Zn(_){Z==null||Z.scaleExtent(_)}function $n(_){Z==null||Z.translateExtent(_)}function Vn(_){const je=!Zg(_)||_<0?0:_;Z==null||Z.clickDistance(je)}return{update:ge,destroy:ee,setViewport:Ke,setViewportConstrained:Me,getViewport:Ye,scaleTo:kn,scaleBy:jn,setScaleExtent:Zn,setTranslateExtent:$n,syncViewport:Xe,setClickDistance:Vn}}var IA;(function(p){p.Line="line",p.Handle="handle"})(IA||(IA={}));function $Rn({width:p,prevWidth:E,height:P,prevHeight:N,affectsX:D,affectsY:F}){const v=p-E,q=P-N,te=[v>0?1:v<0?-1:0,q>0?1:q<0?-1:0];return v&&D&&(te[0]=te[0]*-1),q&&F&&(te[1]=te[1]*-1),te}function Yln(p){const E=p.includes("right")||p.includes("left"),P=p.includes("bottom")||p.includes("top"),N=p.includes("left"),D=p.includes("top");return{isHorizontal:E,isVertical:P,affectsX:N,affectsY:D}}function B5(p,E){return Math.max(0,E-p)}function R5(p,E){return Math.max(0,p-E)}function SX(p,E,P){return Math.max(0,E-p,p-P)}function Zln(p,E){return p?!E:E}function FRn(p,E,P,N,D,F,v,q){let{affectsX:te,affectsY:ie}=E;const{isHorizontal:pe,isVertical:oe}=E,z=pe&&oe,{xSnapped:Z,ySnapped:ne}=P,{minWidth:U,maxWidth:xe,minHeight:ce,maxHeight:ge}=N,{x:ee,y:Me,width:Ke,height:Xe,aspectRatio:Ye}=p;let kn=Math.floor(pe?Z-p.pointerX:0),jn=Math.floor(oe?ne-p.pointerY:0);const Zn=Ke+(te?-kn:kn),$n=Xe+(ie?-jn:jn),Vn=-F[0]*Ke,_=-F[1]*Xe;let je=SX(Zn,U,xe),on=SX($n,ce,ge);if(v){let Bn=0,dn=0;te&&kn<0?Bn=B5(ee+kn+Vn,v[0][0]):!te&&kn>0&&(Bn=R5(ee+Zn+Vn,v[1][0])),ie&&jn<0?dn=B5(Me+jn+_,v[0][1]):!ie&&jn>0&&(dn=R5(Me+$n+_,v[1][1])),je=Math.max(je,Bn),on=Math.max(on,dn)}if(q){let Bn=0,dn=0;te&&kn>0?Bn=R5(ee+kn,q[0][0]):!te&&kn<0&&(Bn=B5(ee+Zn,q[1][0])),ie&&jn>0?dn=R5(Me+jn,q[0][1]):!ie&&jn<0&&(dn=B5(Me+$n,q[1][1])),je=Math.max(je,Bn),on=Math.max(on,dn)}if(D){if(pe){const Bn=SX(Zn/Ye,ce,ge)*Ye;if(je=Math.max(je,Bn),v){let dn=0;!te&&!ie||te&&!ie&&z?dn=R5(Me+_+Zn/Ye,v[1][1])*Ye:dn=B5(Me+_+(te?kn:-kn)/Ye,v[0][1])*Ye,je=Math.max(je,dn)}if(q){let dn=0;!te&&!ie||te&&!ie&&z?dn=B5(Me+Zn/Ye,q[1][1])*Ye:dn=R5(Me+(te?kn:-kn)/Ye,q[0][1])*Ye,je=Math.max(je,dn)}}if(oe){const Bn=SX($n*Ye,U,xe)/Ye;if(on=Math.max(on,Bn),v){let dn=0;!te&&!ie||ie&&!te&&z?dn=R5(ee+$n*Ye+Vn,v[1][0])/Ye:dn=B5(ee+(ie?jn:-jn)*Ye+Vn,v[0][0])/Ye,on=Math.max(on,dn)}if(q){let dn=0;!te&&!ie||ie&&!te&&z?dn=B5(ee+$n*Ye,q[1][0])/Ye:dn=R5(ee+(ie?jn:-jn)*Ye,q[0][0])/Ye,on=Math.max(on,dn)}}}jn=jn+(jn<0?on:-on),kn=kn+(kn<0?je:-je),D&&(z?Zn>$n*Ye?jn=(Zln(te,ie)?-kn:kn)/Ye:kn=(Zln(te,ie)?-jn:jn)*Ye:pe?(jn=kn/Ye,ie=te):(kn=jn*Ye,te=ie));const rn=te?ee+kn:ee,Sn=ie?Me+jn:Me;return{width:Ke+(te?-kn:kn),height:Xe+(ie?-jn:jn),x:F[0]*kn*(te?-1:1)+rn,y:F[1]*jn*(ie?-1:1)+Sn}}const aan={width:0,height:0,x:0,y:0},BRn={...aan,pointerX:0,pointerY:0,aspectRatio:1};function RRn(p,E,P){const N=E.position.x+p.position.x,D=E.position.y+p.position.y,F=p.measured.width??0,v=p.measured.height??0,q=P[0]*F,te=P[1]*v;return[[N-q,D-te],[N+F-q,D+v-te]]}function _Rn({domNode:p,nodeId:E,getStoreItems:P,onChange:N,onEnd:D}){const F=$0(p);let v={controlDirection:Yln("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function q({controlPosition:ie,boundaries:pe,keepAspectRatio:oe,resizeDirection:z,onResizeStart:Z,onResize:ne,onResizeEnd:U,shouldResize:xe}){let ce={...aan},ge={...BRn};v={boundaries:pe,resizeDirection:z,keepAspectRatio:oe,controlDirection:Yln(ie)};let ee,Me=null,Ke=[],Xe,Ye,kn;const jn=$hn().on("start",Zn=>{const{nodeLookup:$n,transform:Vn,snapGrid:_,snapToGrid:je,nodeOrigin:on,paneDomNode:rn}=P();if(ee=$n.get(E),!ee)return;Me=(rn==null?void 0:rn.getBoundingClientRect())??null;const{xSnapped:Sn,ySnapped:Bn}=rN(Zn.sourceEvent,{transform:Vn,snapGrid:_,snapToGrid:je,containerBounds:Me});ce={width:ee.measured.width??0,height:ee.measured.height??0,x:ee.position.x??0,y:ee.position.y??0},ge={...ce,pointerX:Sn,pointerY:Bn,aspectRatio:ce.width/ce.height},Xe=void 0,Ye=Y8(ee.extent)?ee.extent:void 0,ee.parentId&&(ee.extent==="parent"||ee.expandParent)&&(Xe=$n.get(ee.parentId)),Xe&&ee.extent==="parent"&&(Ye=[[0,0],[Xe.measured.width,Xe.measured.height]]),Ke=[],kn=void 0;for(const[dn,Gn]of $n)if(Gn.parentId===E&&(Ke.push({id:dn,position:{...Gn.position},extent:Gn.extent}),Gn.extent==="parent"||Gn.expandParent)){const Nn=RRn(Gn,ee,Gn.origin??on);kn?kn=[[Math.min(Nn[0][0],kn[0][0]),Math.min(Nn[0][1],kn[0][1])],[Math.max(Nn[1][0],kn[1][0]),Math.max(Nn[1][1],kn[1][1])]]:kn=Nn}Z==null||Z(Zn,{...ce})}).on("drag",Zn=>{const{transform:$n,snapGrid:Vn,snapToGrid:_,nodeOrigin:je}=P(),on=rN(Zn.sourceEvent,{transform:$n,snapGrid:Vn,snapToGrid:_,containerBounds:Me}),rn=[];if(!ee)return;const{x:Sn,y:Bn,width:dn,height:Gn}=ce,Nn={},qn=ee.origin??je,{width:Jt,height:Kt,x:Oi,y:gr}=FRn(ge,v.controlDirection,on,v.boundaries,v.keepAspectRatio,qn,Ye,kn),Ki=Jt!==dn,Kn=Kt!==Gn,ei=Oi!==Sn&&Ki,rr=gr!==Bn&&Kn;if(!ei&&!rr&&!Ki&&!Kn)return;const cr={prevValues:{...ce},startX:ge.x,startY:ge.y,childNodes:Ke.map(bi=>({...bi,position:{...bi.position}}))};if((ei||rr||qn[0]===1||qn[1]===1)&&(Nn.x=ei?Oi:ce.x,Nn.y=rr?gr:ce.y,ce.x=Nn.x,ce.y=Nn.y,Ke.length>0)){const bi=Oi-Sn,Mc=gr-Bn;for(const ku of Ke)ku.position={x:ku.position.x-bi+qn[0]*(Jt-dn),y:ku.position.y-Mc+qn[1]*(Kt-Gn)},rn.push(ku)}if((Ki||Kn)&&(Nn.width=Ki&&(!v.resizeDirection||v.resizeDirection==="horizontal")?Jt:ce.width,Nn.height=Kn&&(!v.resizeDirection||v.resizeDirection==="vertical")?Kt:ce.height,ce.width=Nn.width,ce.height=Nn.height),Xe&&ee.expandParent){const bi=qn[0]*(Nn.width??0);Nn.x&&Nn.x<bi&&(ce.x=bi,ge.x=ge.x-(Nn.x-bi));const Mc=qn[1]*(Nn.height??0);Nn.y&&Nn.y<Mc&&(ce.y=Mc,ge.y=ge.y-(Nn.y-Mc))}const _i=$Rn({width:ce.width,prevWidth:dn,height:ce.height,prevHeight:Gn,affectsX:v.controlDirection.affectsX,affectsY:v.controlDirection.affectsY}),sr={...ce,direction:_i};if((xe==null?void 0:xe(Zn,sr))===!1){ce=cr.prevValues,ge.x=cr.startX,ge.y=cr.startY,Ke.forEach((bi,Mc)=>{bi.position=cr.childNodes[Mc].position});return}ne==null||ne(Zn,sr),N(Nn,rn)}).on("end",Zn=>{U==null||U(Zn,{...ce}),D==null||D({...ce})});F.call(jn)}function te(){F.on(".drag",null)}return{update:q,destroy:te}}const JRn={},ehn=p=>{let E;const P=new Set,N=(pe,oe)=>{const z=typeof pe=="function"?pe(E):pe;if(!Object.is(z,E)){const Z=E;E=oe??(typeof z!="object"||z===null)?z:Object.assign({},E,z),P.forEach(ne=>ne(E,Z))}},D=()=>E,te={setState:N,getState:D,getInitialState:()=>ie,subscribe:pe=>(P.add(pe),()=>P.delete(pe)),destroy:()=>{(JRn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),P.clear()}},ie=E=p(N,D,te);return te},GRn=p=>p?ehn(p):ehn,{useDebugValue:HRn}=GFn,{useSyncExternalStoreWithSelector:qRn}=JFn,zRn=p=>p;function dan(p,E=zRn,P){const N=qRn(p.subscribe,p.getState,p.getServerState||p.getInitialState,E,P);return HRn(N),N}const nhn=(p,E)=>{const P=GRn(p),N=(D,F=E)=>dan(P,D,F);return Object.assign(N,P),N},URn=(p,E)=>p?nhn(p,E):nhn;function Ts(p,E){if(Object.is(p,E))return!0;if(typeof p!="object"||p===null||typeof E!="object"||E===null)return!1;if(p instanceof Map&&E instanceof Map){if(p.size!==E.size)return!1;for(const[N,D]of p)if(!Object.is(D,E.get(N)))return!1;return!0}if(p instanceof Set&&E instanceof Set){if(p.size!==E.size)return!1;for(const N of p)if(!E.has(N))return!1;return!0}const P=Object.keys(p);if(P.length!==Object.keys(E).length)return!1;for(const N of P)if(!Object.prototype.hasOwnProperty.call(E,N)||!Object.is(p[N],E[N]))return!1;return!0}const qX=sn.createContext(null),XRn=qX.Provider,ban=t2.error001("react");function Sc(p,E){const P=sn.useContext(qX);if(P===null)throw new Error(ban);return dan(P,p,E)}function os(){const p=sn.useContext(qX);if(p===null)throw new Error(ban);return sn.useMemo(()=>({getState:p.getState,setState:p.setState,subscribe:p.subscribe}),[p])}const thn={display:"none"},KRn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},wan="react-flow__node-desc",gan="react-flow__edge-desc",WRn="react-flow__aria-live",VRn=p=>p.ariaLiveMessage,QRn=p=>p.ariaLabelConfig;function YRn({rfId:p}){const E=Sc(VRn);return ae.jsx("div",{id:`${WRn}-${p}`,"aria-live":"assertive","aria-atomic":"true",style:KRn,children:E})}function ZRn({rfId:p,disableKeyboardA11y:E}){const P=Sc(QRn);return ae.jsxs(ae.Fragment,{children:[ae.jsx("div",{id:`${wan}-${p}`,style:thn,children:E?P["node.a11yDescription.default"]:P["node.a11yDescription.keyboardDisabled"]}),ae.jsx("div",{id:`${gan}-${p}`,style:thn,children:P["edge.a11yDescription.default"]}),!E&&ae.jsx(YRn,{rfId:p})]})}const pN=sn.forwardRef(({position:p="top-left",children:E,className:P,style:N,...D},F)=>{const v=`${p}`.split("-");return ae.jsx("div",{className:Kf(["react-flow__panel",P,...v]),style:N,ref:F,...D,children:E})});pN.displayName="Panel";const ihn="https://reactflow.dev?utm_source=attribution";function e_n({proOptions:p,position:E="bottom-right"}){return sn.useEffect(()=>{},[]),p!=null&&p.hideAttribution?null:ae.jsx(pN,{position:E,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${ihn}`,children:ae.jsx("a",{href:ihn,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const n_n=p=>{const E=[],P=[];for(const[,N]of p.nodeLookup)N.selected&&E.push(N.internals.userNode);for(const[,N]of p.edgeLookup)N.selected&&P.push(N);return{selectedNodes:E,selectedEdges:P}},IX=p=>p.id;function t_n(p,E){return Ts(p.selectedNodes.map(IX),E.selectedNodes.map(IX))&&Ts(p.selectedEdges.map(IX),E.selectedEdges.map(IX))}function i_n({onSelectionChange:p}){const E=os(),{selectedNodes:P,selectedEdges:N}=Sc(n_n,t_n);return sn.useEffect(()=>{const D={nodes:P,edges:N};p==null||p(D),E.getState().onSelectionChangeHandlers.forEach(F=>F(D))},[P,N,p]),null}const r_n=p=>!!p.onSelectionChangeHandlers;function c_n({onSelectionChange:p}){const E=Sc(r_n);return p||E?ae.jsx(i_n,{onSelectionChange:p}):null}const pan=[0,0],u_n={x:0,y:0,zoom:1},o_n=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],rhn=[...o_n,"rfId"],s_n=p=>({setNodes:p.setNodes,setEdges:p.setEdges,setMinZoom:p.setMinZoom,setMaxZoom:p.setMaxZoom,setTranslateExtent:p.setTranslateExtent,setNodeExtent:p.setNodeExtent,reset:p.reset,setDefaultNodesAndEdges:p.setDefaultNodesAndEdges}),chn={translateExtent:oN,nodeOrigin:pan,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function f_n(p){const{setNodes:E,setEdges:P,setMinZoom:N,setMaxZoom:D,setTranslateExtent:F,setNodeExtent:v,reset:q,setDefaultNodesAndEdges:te}=Sc(s_n,Ts),ie=os();sn.useEffect(()=>(te(p.defaultNodes,p.defaultEdges),()=>{pe.current=chn,q()}),[]);const pe=sn.useRef(chn);return sn.useEffect(()=>{for(const oe of rhn){const z=p[oe],Z=pe.current[oe];z!==Z&&(typeof p[oe]>"u"||(oe==="nodes"?E(z):oe==="edges"?P(z):oe==="minZoom"?N(z):oe==="maxZoom"?D(z):oe==="translateExtent"?F(z):oe==="nodeExtent"?v(z):oe==="ariaLabelConfig"?ie.setState({ariaLabelConfig:YBn(z)}):oe==="fitView"?ie.setState({fitViewQueued:z}):oe==="fitViewOptions"?ie.setState({fitViewOptions:z}):ie.setState({[oe]:z})))}pe.current=p},rhn.map(oe=>p[oe])),null}function uhn(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function l_n(p){var N;const[E,P]=sn.useState(p==="system"?null:p);return sn.useEffect(()=>{if(p!=="system"){P(p);return}const D=uhn(),F=()=>P(D!=null&&D.matches?"dark":"light");return F(),D==null||D.addEventListener("change",F),()=>{D==null||D.removeEventListener("change",F)}},[p]),E!==null?E:(N=uhn())!=null&&N.matches?"dark":"light"}const ohn=typeof document<"u"?document:null;function aN(p=null,E={target:ohn,actInsideInputWithModifier:!0}){const[P,N]=sn.useState(!1),D=sn.useRef(!1),F=sn.useRef(new Set([])),[v,q]=sn.useMemo(()=>{if(p!==null){const ie=(Array.isArray(p)?p:[p]).filter(oe=>typeof oe=="string").map(oe=>oe.replace(/\+/g,`
2
2
  `).replace(`
3
3
 
4
4
  `,`
@@ -1 +1 @@
1
- import{r as d,R as b,j as L,B as ve,G as Ue,iA as Ce,ad as Ze,e3 as Xe,dH as U,l as Q,iB as Qe,a1 as Je,a3 as et,a2 as tt,au as me,a4 as nt,eg as rt,eh as ot,bd as it,aZ as st,ct as at,c4 as lt,eo as ct,aW as ge}from"./index-DcZPWi_I.js";import{D as z}from"./dorkbot-templates-8Yu9POWJ.js";import{u as ut}from"./use-relay-config-hItHtkSr.js";import{u as ft}from"./use-external-adapter-catalog-aGlZNRrp.js";var dt={attributes:!0,characterData:!0,subtree:!0,childList:!0};function ht(e,t,n=dt){d.useEffect(()=>{if(e.current){const r=new MutationObserver(t);return r.observe(e.current,n),()=>{r.disconnect()}}},[t,n])}var Le=(function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,s){return o[0]===n?(r=s,!0):!1}),r}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,s=this.__entries__;o<s.length;o++){var i=s[o];n.call(r,i[1],i[0])}},t})()})(),ue=typeof window<"u"&&typeof document<"u"&&window.document===document,te=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),pt=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(te):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),vt=2;function mt(e,t){var n=!1,r=!1,o=0;function s(){n&&(n=!1,e()),r&&a()}function i(){pt(s)}function a(){var c=Date.now();if(n){if(c-o<vt)return;r=!0}else n=!0,r=!1,setTimeout(i,t);o=c}return a}var gt=20,bt=["top","right","bottom","left","width","height","size","weight"],yt=typeof MutationObserver<"u",wt=(function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=mt(this.refresh.bind(this),gt)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!ue||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!ue||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=bt.some(function(s){return!!~r.indexOf(s)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e})(),Me=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e}),B=(function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||te}),Te=ie(0,0,0,0);function ne(e){return parseFloat(e)||0}function be(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var s=e["border-"+o+"-width"];return r+ne(s)},0)}function _t(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var s=o[r],i=e["padding-"+s];n[s]=ne(i)}return n}function Et(e){var t=e.getBBox();return ie(0,0,t.width,t.height)}function Ot(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Te;var r=B(e).getComputedStyle(e),o=_t(r),s=o.left+o.right,i=o.top+o.bottom,a=ne(r.width),c=ne(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=be(r,"left","right")+s),Math.round(c+i)!==n&&(c-=be(r,"top","bottom")+i)),!Rt(e)){var u=Math.round(a+s)-t,l=Math.round(c+i)-n;Math.abs(u)!==1&&(a-=u),Math.abs(l)!==1&&(c-=l)}return ie(o.left,o.top,a,c)}var xt=(function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof B(e).SVGGraphicsElement}:function(e){return e instanceof B(e).SVGElement&&typeof e.getBBox=="function"}})();function Rt(e){return e===B(e).document.documentElement}function St(e){return ue?xt(e)?Et(e):Ot(e):Te}function kt(e){var t=e.x,n=e.y,r=e.width,o=e.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(s.prototype);return Me(i,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),i}function ie(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Ct=(function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ie(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=St(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e})(),Lt=(function(){function e(t,n){var r=kt(n);Me(this,{target:t,contentRect:r})}return e})(),Mt=(function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Le,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof B(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Ct(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof B(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Lt(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e})(),Ae=typeof WeakMap<"u"?new WeakMap:new Le,Ie=(function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=wt.getInstance(),r=new Mt(t,n,this);Ae.set(this,r)}return e})();["observe","unobserve","disconnect"].forEach(function(e){Ie.prototype[e]=function(){var t;return(t=Ae.get(this))[e].apply(t,arguments)}});var Tt=(function(){return typeof te.ResizeObserver<"u"?te.ResizeObserver:Ie})(),At=({mutationObservables:e,resizeObservables:t,refresh:n})=>{const[r,o]=d.useState(0),s=d.useRef(document.documentElement||document.body);function i(c){const u=Array.from(c);for(const l of u)if(e){if(!l.attributes)continue;e.find(v=>l.matches(v))&&n(!0)}}function a(c){const u=Array.from(c);for(const l of u)if(t){if(!l.attributes)continue;t.find(v=>l.matches(v))&&o(r+1)}}return ht(s,c=>{for(const u of c)u.addedNodes.length!==0&&(i(u.addedNodes),a(u.addedNodes)),u.removedNodes.length!==0&&(i(u.removedNodes),a(u.removedNodes))},{childList:!0,subtree:!0}),d.useEffect(()=>{if(!t)return;const c=new Tt(()=>{n()});for(const u of t){const l=document.querySelector(u);l&&c.observe(l)}return()=>{c.disconnect()}},[t,r]),null},It=At;function ee(e){let t=Pe;return e&&(t=e.getBoundingClientRect()),t}function Pt(e,t){const[n,r]=d.useState(Pe),o=d.useCallback(()=>{e!=null&&e.current&&r(ee(e==null?void 0:e.current))},[e==null?void 0:e.current]);return d.useEffect(()=>(o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)),[e==null?void 0:e.current,t]),n}var Pe={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Dt(e,t){return new Promise(n=>{if(!(e instanceof Element))throw new TypeError("Argument 1 must be an Element");let r=0,o=null;const s=Object.assign({behavior:"smooth"},t);e.scrollIntoView(s),requestAnimationFrame(i);function i(){const a=e==null?void 0:e.getBoundingClientRect().top;if(a===o){if(r++>2)return n(null)}else r=0,o=a;requestAnimationFrame(i)}})}function J(e){return e<0?0:e}function Ht(e){return typeof e=="object"&&e!==null?{thresholdX:e.x||0,thresholdY:e.y||0}:{thresholdX:e||0,thresholdY:e||0}}function se(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return{w:e,h:t}}function Nt({top:e,right:t,bottom:n,left:r,threshold:o}){const{w:s,h:i}=se(),{thresholdX:a,thresholdY:c}=Ht(o);return e<0&&n-e>i?!0:e>=0+c&&r>=0+a&&n<=i-c&&t<=s-a}var ye=(e,t)=>e>t,we=(e,t)=>e>t;function jt(e,t=[]){const n=(r,o)=>t.includes(r)?1:t.includes(o)?-1:0;return Object.keys(e).map(r=>({position:r,value:e[r]})).sort((r,o)=>o.value-r.value).sort((r,o)=>n(r.position,o.position)).filter(r=>r.value>0).map(r=>r.position)}var ce=10;function fe(e=ce){return Array.isArray(e)?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[1],e[0],e[1],e[0]]:e.length===3?[e[0],e[1],e[2],e[1]]:e.length>3?[e[0],e[1],e[2],e[3]]:[ce,ce]:[e,e,e,e]}var $t={maskWrapper:()=>({opacity:.7,left:0,top:0,position:"fixed",zIndex:99999,pointerEvents:"none",color:"#000"}),svgWrapper:({windowWidth:e,windowHeight:t,wpt:n,wpl:r})=>({width:e,height:t,left:Number(r),top:Number(n),position:"fixed"}),maskArea:({x:e,y:t,width:n,height:r})=>({x:e,y:t,width:n,height:r,fill:"black",rx:0}),maskRect:({windowWidth:e,windowHeight:t,maskID:n})=>({x:0,y:0,width:e,height:t,fill:"currentColor",mask:`url(#${n})`}),clickArea:({windowWidth:e,windowHeight:t,clipID:n})=>({x:0,y:0,width:e,height:t,fill:"currentcolor",pointerEvents:"auto",clipPath:`url(#${n})`}),highlightedArea:({x:e,y:t,width:n,height:r})=>({x:e,y:t,width:n,height:r,pointerEvents:"auto",fill:"transparent",display:"none"})};function zt(e){return(t,n)=>{const r=$t[t](n),o=e[t];return o?o(r,n):r}}var Wt=({padding:e=10,wrapperPadding:t=0,onClick:n,onClickHighlighted:r,styles:o={},sizes:s,className:i,highlightedAreaClassName:a,maskId:c,clipId:u})=>{const l=c||_e("mask__"),f=u||_e("clip__"),v=zt(o),[g,_,O,y]=fe(e),[p,E,x,k]=fe(t),{w:h,h:T}=se(),M=J((s==null?void 0:s.width)+y+_),C=J((s==null?void 0:s.height)+g+O),w=J((s==null?void 0:s.top)-g-p),R=J((s==null?void 0:s.left)-y-k),A=h-k-E,S=T-p-x,j=v("maskArea",{x:R,y:w,width:M,height:C}),$=v("highlightedArea",{x:R,y:w,width:M,height:C});return b.createElement("div",{style:v("maskWrapper",{}),onClick:n,className:i},b.createElement("svg",{width:A,height:S,xmlns:"http://www.w3.org/2000/svg",style:v("svgWrapper",{windowWidth:A,windowHeight:S,wpt:p,wpl:k})},b.createElement("defs",null,b.createElement("mask",{id:l},b.createElement("rect",{x:0,y:0,width:A,height:S,fill:"white"}),b.createElement("rect",{style:j,rx:j.rx?1:void 0})),b.createElement("clipPath",{id:f},b.createElement("polygon",{points:`0 0, 0 ${S}, ${R} ${S}, ${R} ${w}, ${R+M} ${w}, ${R+M} ${w+C}, ${R} ${w+C}, ${R} ${S}, ${A} ${S}, ${A} 0`}))),b.createElement("rect",{style:v("maskRect",{windowWidth:A,windowHeight:S,maskID:l})}),b.createElement("rect",{style:v("clickArea",{windowWidth:A,windowHeight:S,top:w,left:R,width:M,height:C,clipID:f})}),b.createElement("rect",{style:$,className:a,onClick:r,rx:$.rx?1:void 0})))},Ft=Wt;function _e(e){return e+Math.random().toString(36).substring(2,16)}var Vt=Object.defineProperty,re=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Ee=(e,t,n)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oe=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&Ee(e,n,t[n]);if(re)for(var n of re(t))He.call(t,n)&&Ee(e,n,t[n]);return e},Bt=(e,t)=>{var n={};for(var r in e)De.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&re)for(var r of re(e))t.indexOf(r)<0&&He.call(e,r)&&(n[r]=e[r]);return n},qt={popover:()=>({position:"fixed",maxWidth:353,backgroundColor:"#fff",padding:"24px 30px",boxShadow:"0 0.5em 3em rgba(0, 0, 0, 0.3)",color:"inherit",zIndex:1e5,transition:"transform 0.3s",top:0,left:0})};function Gt(e){return(t,n)=>{const r=qt[t](n),o=e[t];return o?o(r,n):r}}var Kt=e=>{var t=e,{children:n,position:r="bottom",padding:o=10,styles:s={},sizes:i,refresher:a}=t,c=Bt(t,["children","position","padding","styles","sizes","refresher"]);const u=d.useRef(null),l=d.useRef(""),f=d.useRef(""),v=d.useRef(""),{w:g,h:_}=se(),O=Gt(s),y=Pt(u,a),{width:p,height:E}=y,[x,k,h,T]=fe(o),M=(i==null?void 0:i.left)-T,C=(i==null?void 0:i.top)-x,w=(i==null?void 0:i.right)+k,R=(i==null?void 0:i.bottom)+h,A=r&&typeof r=="function"?r({width:p,height:E,windowWidth:g,windowHeight:_,top:C,left:M,right:w,bottom:R,x:i.x,y:i.y},y):r,S={left:M,right:g-w,top:C,bottom:_-R},j=(I,D,H)=>{switch(I){case"top":return S.top>E+h;case"right":return D?!1:S.right>p+T;case"bottom":return H?!1:S.bottom>E+x;case"left":return S.left>p+k;default:return!1}},$=(I,D,H)=>{const m=jt(S,H?["right","left"]:D?["top","bottom"]:[]);for(let N=0;N<m.length;N++)if(j(m[N],D,H))return l.current=m[N],I[m[N]];return l.current="center",I.center},G=(I=>{if(Array.isArray(I)){const F=ye(I[0],g),le=we(I[1],_);return l.current="custom",[F?g/2-p/2:I[0],le?_/2-E/2:I[1]]}const D=ye(M+p,g),H=we(R+E,_),m=D?Math.min(M,g-p):Math.max(M,0),N=H?E>S.bottom?Math.max(R-E,0):Math.max(C,0):C;H&&E>S.bottom?f.current="bottom":f.current="top",D?v.current="left":v.current="right";const K={top:[m-T,C-E-h],right:[w+T,N-x],bottom:[m-T,R+x],left:[M-p-k,N-x],center:[g/2-p/2,_/2-E/2]};return I==="center"||j(I,D,H)&&!D&&!H?(l.current=I,K[I]):$(K,D,H)})(A);return b.createElement("div",Oe({className:"reactour__popover",style:Oe({transform:`translate(${Math.round(G[0])}px, ${Math.round(G[1])}px)`},O("popover",{position:l.current,verticalAlign:f.current,horizontalAlign:v.current,helperRect:y,targetRect:i})),ref:u},c),n)},Yt=Kt,Ut=Object.defineProperty,Zt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,xe=(e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))Ne.call(t,n)&&xe(e,n,t[n]);if(oe)for(var n of oe(t))je.call(t,n)&&xe(e,n,t[n]);return e},he=(e,t)=>Zt(e,Xt(t)),Z=(e,t)=>{var n={};for(var r in e)Ne.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oe)for(var r of oe(e))t.indexOf(r)<0&&je.call(e,r)&&(n[r]=e[r]);return n},Qt={bottom:0,height:0,left:0,right:0,top:0,width:0,windowWidth:0,windowHeight:0,x:0,y:0};function Jt(e,t={block:"center",behavior:"smooth",inViewThreshold:0}){const[n,r]=d.useState(!1),[o,s]=d.useState(!1),[i,a]=d.useState(!1),[c,u]=d.useState(null),[l,f]=d.useState(Qt),v=(e==null?void 0:e.selector)instanceof Element?e==null?void 0:e.selector:document.querySelector(e==null?void 0:e.selector),g=d.useCallback(()=>{const O=Re(v,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:y}=O,p=Z(O,["hasHighligtedElems"]);Object.entries(l).some(([E,x])=>p[E]!==x)&&f(p)},[v,e==null?void 0:e.highlightedSelectors,l]);d.useEffect(()=>(g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)),[v,e==null?void 0:e.highlightedSelectors,c]),d.useEffect(()=>{!Nt(he(P({},l),{threshold:t.inViewThreshold}))&&v&&(r(!0),Dt(v,t).then(()=>{o||u(Date.now())}).finally(()=>{r(!1)}))},[l]);const _=d.useCallback(()=>{s(!0);const O=Re(v,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:y}=O,p=Z(O,["hasHighligtedElems"]);a(y),f(p),s(!1)},[v,e==null?void 0:e.highlightedSelectors,l]);return{sizes:l,transition:n,target:v,observableRefresher:_,isHighlightingObserved:i}}function Re(e,t=[],n=!0){let r=!1;const{w:o,h:s}=se();if(!t)return he(P({},ee(e)),{windowWidth:o,windowHeight:s,hasHighligtedElems:!1});let i=ee(e),a={bottom:0,height:0,left:o,right:0,top:s,width:0};for(const u of t){const l=document.querySelector(u);if(!l||l.style.display==="none"||l.style.visibility==="hidden")continue;const f=ee(l);r=!0,n||!e?(f.top<a.top&&(a.top=f.top),f.right>a.right&&(a.right=f.right),f.bottom>a.bottom&&(a.bottom=f.bottom),f.left<a.left&&(a.left=f.left),a.width=a.right-a.left,a.height=a.bottom-a.top):(f.top<i.top&&(i.top=f.top),f.right>i.right&&(i.right=f.right),f.bottom>i.bottom&&(i.bottom=f.bottom),f.left<i.left&&(i.left=f.left),i.width=i.right-i.left,i.height=i.bottom-i.top)}const c=n||!e?a.width>0&&a.height>0:!1;return{left:(c?a:i).left,top:(c?a:i).top,right:(c?a:i).right,bottom:(c?a:i).bottom,width:(c?a:i).width,height:(c?a:i).height,windowWidth:o,windowHeight:s,hasHighligtedElems:r,x:i.x,y:i.y}}var en=({disableKeyboardNavigation:e,setCurrentStep:t,currentStep:n,setIsOpen:r,stepsLength:o,disable:s,rtl:i,clickProps:a,keyboardHandler:c})=>{function u(l){if(l.stopPropagation(),e===!0||s)return;let f,v,g;e&&(f=e.includes("esc"),v=e.includes("right"),g=e.includes("left"));function _(){t(Math.min(n+1,o-1))}function O(){t(Math.max(n-1,0))}c&&typeof c=="function"?c(l,a,{isEscDisabled:f,isRightDisabled:v,isLeftDisabled:g}):(l.keyCode===27&&!f&&(l.preventDefault(),r(!1)),l.keyCode===39&&!v&&(l.preventDefault(),i?O():_()),l.keyCode===37&&!g&&(l.preventDefault(),i?_():O()))}return d.useEffect(()=>(window.addEventListener("keydown",u,!1),()=>{window.removeEventListener("keydown",u)}),[s,t,n]),null},tn=en,nn={badge:()=>({position:"absolute",fontFamily:"monospace",background:"var(--reactour-accent,#007aff)",height:"1.875em",lineHeight:2,paddingLeft:"0.8125em",paddingRight:"0.8125em",fontSize:"1em",borderRadius:"1.625em",color:"white",textAlign:"center",boxShadow:"0 0.25em 0.5em rgba(0, 0, 0, 0.3)",top:"-0.8125em",left:"-0.8125em"}),controls:()=>({display:"flex",marginTop:24,alignItems:"center",justifyContent:"space-between"}),navigation:()=>({counterReset:"dot",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"}),button:({disabled:e})=>({display:"block",padding:0,border:0,background:"none",cursor:e?"not-allowed":"pointer"}),arrow:({disabled:e})=>({color:e?"#caccce":"#646464",width:16,height:12,flex:"0 0 16px"}),dot:({current:e,disabled:t,showNumber:n})=>({counterIncrement:"dot",width:8,height:8,border:e?"0":"1px solid #caccce",borderRadius:"100%",padding:0,display:"block",margin:4,transition:"opacity 0.3s, transform 0.3s",cursor:t?"not-allowed":"pointer",transform:`scale(${e?1.25:1})`,color:e?"var(--reactour-accent, #007aff)":"#caccce",background:e?"var(--reactour-accent, #007aff)":"none"}),close:({disabled:e})=>({position:"absolute",top:22,right:22,width:9,height:9,"--rt-close-btn":e?"#caccce":"#5e5e5e","--rt-close-btn-disabled":e?"#caccce":"#000"}),svg:()=>({display:"block"})};function ae(e){return(t,n)=>{const r=nn[t](n),o=e[t];return o?o(r,n):r}}var rn=({styles:e={},children:t})=>{const n=ae(e);return b.createElement("span",{style:n("badge",{})},t)},on=rn,sn=e=>{var t=e,{styles:n={},onClick:r,disabled:o}=t,s=Z(t,["styles","onClick","disabled"]);const i=ae(n);return b.createElement("button",P({className:"reactour__close-button",style:P(P({},i("button",{})),i("close",{disabled:o})),onClick:r},s),b.createElement("svg",{viewBox:"0 0 9.1 9.1","aria-hidden":!0,role:"presentation",style:P({},i("svg",{}))},b.createElement("path",{fill:"currentColor",d:"M5.9 4.5l2.8-2.8c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L4.5 3.1 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4l2.8 2.8L.3 7.4c-.4.4-.4 1 0 1.4.2.2.4.3.7.3s.5-.1.7-.3L4.5 6l2.8 2.8c.3.2.5.3.8.3s.5-.1.7-.3c.4-.4.4-1 0-1.4L5.9 4.5z"})))},an=sn,ln=({content:e,setCurrentStep:t,transition:n,isHighlightingObserved:r,currentStep:o,setIsOpen:s})=>typeof e=="function"?e({setCurrentStep:t,transition:n,isHighlightingObserved:r,currentStep:o,setIsOpen:s}):e,cn=ln,un=({styles:e={},steps:t,setCurrentStep:n,currentStep:r,setIsOpen:o,nextButton:s,prevButton:i,disableDots:a,hideDots:c,hideButtons:u,disableAll:l,rtl:f,Arrow:v=$e})=>{const g=t.length,_=ae(e),O=({onClick:y,kind:p="next",children:E,hideArrow:x})=>{function k(){l||(y&&typeof y=="function"?y():n(p==="next"?Math.min(r+1,g-1):Math.max(r-1,0)))}return b.createElement("button",{style:_("button",{kind:p,disabled:l||(p==="next"?g-1===r:r===0)}),onClick:k,"aria-label":`Go to ${p} step`},x?null:b.createElement(v,{styles:e,inverted:f?p==="prev":p==="next",disabled:l||(p==="next"?g-1===r:r===0)}),E)};return b.createElement("div",{style:_("controls",{}),dir:f?"rtl":"ltr"},u?null:i&&typeof i=="function"?i({Button:O,setCurrentStep:n,currentStep:r,stepsLength:g,setIsOpen:o,steps:t}):b.createElement(O,{kind:"prev"}),c?null:b.createElement("div",{style:_("navigation",{})},Array.from({length:g},(y,p)=>p).map(y=>{var p;return b.createElement("button",{style:_("dot",{current:y===r,disabled:a||l}),onClick:()=>{!a&&!l&&n(y)},key:`navigation_dot_${y}`,"aria-label":((p=t[y])==null?void 0:p.navDotAriaLabel)||`Go to step ${y+1}`})})),u?null:s&&typeof s=="function"?s({Button:O,setCurrentStep:n,currentStep:r,stepsLength:g,setIsOpen:o,steps:t}):b.createElement(O,null))},fn=un,$e=({styles:e={},inverted:t=!1,disabled:n})=>{const r=ae(e);return b.createElement("svg",{viewBox:"0 0 18.4 14.4",style:r("arrow",{inverted:t,disabled:n})},b.createElement("path",{d:t?"M17 7.2H1M10.8 1L17 7.2l-6.2 6.2":"M1.4 7.2h16M7.6 1L1.4 7.2l6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeMiterlimit:"10"}))},dn={Badge:on,Close:an,Content:cn,Navigation:fn,Arrow:$e},hn=e=>P(P({},dn),e),pn=({styles:e,components:t={},badgeContent:n,accessibilityOptions:r,disabledActions:o,onClickClose:s,steps:i,setCurrentStep:a,currentStep:c,transition:u,isHighlightingObserved:l,setIsOpen:f,nextButton:v,prevButton:g,disableDotsNavigation:_,rtl:O,showPrevNextButtons:y=!0,showCloseButton:p=!0,showNavigation:E=!0,showBadge:x=!0,showDots:k=!0,meta:h,setMeta:T,setSteps:M})=>{const C=i[c],{Badge:w,Close:R,Content:A,Navigation:S,Arrow:j}=hn(t),$=n&&typeof n=="function"?n({currentStep:c,totalSteps:i.length,transition:u}):c+1;function q(){o||(s&&typeof s=="function"?s({setCurrentStep:a,setIsOpen:f,currentStep:c,steps:i,meta:h,setMeta:T,setSteps:M}):f(!1))}return b.createElement(b.Fragment,null,x?b.createElement(w,{styles:e},$):null,p?b.createElement(R,{styles:e,"aria-label":r==null?void 0:r.closeButtonAriaLabel,disabled:o,onClick:q}):null,b.createElement(A,{content:C==null?void 0:C.content,setCurrentStep:a,currentStep:c,transition:u,isHighlightingObserved:l,setIsOpen:f}),E?b.createElement(S,{setCurrentStep:a,currentStep:c,setIsOpen:f,steps:i,styles:e,"aria-hidden":!(r!=null&&r.showNavigationScreenReaders),nextButton:v,prevButton:g,disableDots:_,hideButtons:!y,hideDots:!k,disableAll:o,rtl:O,Arrow:j}):null)},vn=pn,mn=e=>{var t=e,{currentStep:n,setCurrentStep:r,setIsOpen:o,steps:s=[],setSteps:i,styles:a={},scrollSmooth:c,afterOpen:u,beforeClose:l,padding:f=10,position:v,onClickMask:g,onClickHighlighted:_,keyboardHandler:O,className:y="reactour__popover",maskClassName:p="reactour__mask",highlightedMaskClassName:E,clipId:x,maskId:k,disableInteraction:h,disableKeyboardNavigation:T,inViewThreshold:M,disabledActions:C,setDisabledActions:w,disableWhenSelectorFalsy:R,rtl:A,accessibilityOptions:S={closeButtonAriaLabel:"Close Tour",showNavigationScreenReaders:!0},ContentComponent:j,Wrapper:$,meta:q,setMeta:G,onTransition:I=()=>"center"}=t,D=Z(t,["currentStep","setCurrentStep","setIsOpen","steps","setSteps","styles","scrollSmooth","afterOpen","beforeClose","padding","position","onClickMask","onClickHighlighted","keyboardHandler","className","maskClassName","highlightedMaskClassName","clipId","maskId","disableInteraction","disableKeyboardNavigation","inViewThreshold","disabledActions","setDisabledActions","disableWhenSelectorFalsy","rtl","accessibilityOptions","ContentComponent","Wrapper","meta","setMeta","onTransition"]),H;const m=s[n],N=P(P({},a),m==null?void 0:m.styles),{sizes:K,transition:F,observableRefresher:le,isHighlightingObserved:pe,target:V}=Jt(m,{block:"center",behavior:c?"smooth":"auto",inViewThreshold:M});d.useEffect(()=>(u&&typeof u=="function"&&u(V),()=>{l&&typeof l=="function"&&l(V)}),[]);const{maskPadding:Fe,popoverPadding:Ve,wrapperPadding:Be}=bn((H=m==null?void 0:m.padding)!=null?H:f),X={setCurrentStep:r,setIsOpen:o,currentStep:n,setSteps:i,steps:s,setMeta:G,meta:q};function qe(){C||(g&&typeof g=="function"?g(X):o(!1))}const Ge=typeof(m==null?void 0:m.stepInteraction)=="boolean"?!(m!=null&&m.stepInteraction):h?typeof h=="boolean"?h:h(X):!1;d.useEffect(()=>(m!=null&&m.action&&typeof(m==null?void 0:m.action)=="function"&&(m==null||m.action(V)),(m==null?void 0:m.disableActions)!==void 0&&w(m==null?void 0:m.disableActions),()=>{m!=null&&m.actionAfter&&typeof(m==null?void 0:m.actionAfter)=="function"&&(m==null||m.actionAfter(V))}),[m]);const Ke=F?I:m!=null&&m.position?m==null?void 0:m.position:v,Ye=$||b.Fragment;return m?b.createElement(Ye,null,b.createElement(It,{mutationObservables:m==null?void 0:m.mutationObservables,resizeObservables:m==null?void 0:m.resizeObservables,refresh:le}),b.createElement(tn,{setCurrentStep:r,currentStep:n,setIsOpen:o,stepsLength:s.length,disableKeyboardNavigation:T,disable:C,rtl:A,clickProps:X,keyboardHandler:O}),(!R||V)&&b.createElement(Ft,{sizes:F?yn:K,onClick:qe,styles:P({highlightedArea:Y=>he(P({},Y),{display:Ge?"block":"none"})},N),padding:F?0:Fe,highlightedAreaClassName:E,className:p,onClickHighlighted:Y=>{Y.preventDefault(),Y.stopPropagation(),_&&_(Y,X)},wrapperPadding:Be,clipId:x,maskId:k}),(!R||V)&&b.createElement(Yt,{sizes:K,styles:N,position:Ke,padding:Ve,"aria-labelledby":S==null?void 0:S.ariaLabelledBy,className:y,refresher:n},j?b.createElement(j,P({styles:N,setCurrentStep:r,currentStep:n,setIsOpen:o,steps:s,accessibilityOptions:S,disabledActions:C,transition:F,isHighlightingObserved:pe,rtl:A},D)):b.createElement(vn,P({styles:N,setCurrentStep:r,currentStep:n,setIsOpen:o,steps:s,setSteps:i,accessibilityOptions:S,disabledActions:C,transition:F,isHighlightingObserved:pe,rtl:A,meta:q,setMeta:G},D)))):null},gn=mn;function bn(e){return typeof e=="object"&&e!==null?{maskPadding:e.mask,popoverPadding:e.popover,wrapperPadding:e.wrapper}:{maskPadding:e,popoverPadding:e,wrapperPadding:0}}var yn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0},wn={isOpen:!1,setIsOpen:()=>!1,currentStep:0,setCurrentStep:()=>0,steps:[],setSteps:()=>[],setMeta:()=>"",disabledActions:!1,setDisabledActions:()=>!1,components:{}},_n=b.createContext(wn),En=e=>{var t=e,{children:n,defaultOpen:r=!1,startAt:o=0,steps:s,setCurrentStep:i,currentStep:a}=t,c=Z(t,["children","defaultOpen","startAt","steps","setCurrentStep","currentStep"]);const[u,l]=d.useState(r),[f,v]=d.useState(o),[g,_]=d.useState(s),[O,y]=d.useState(""),[p,E]=d.useState(!1),x=P({isOpen:u,setIsOpen:l,currentStep:a||f,setCurrentStep:i&&typeof i=="function"?i:v,steps:g,setSteps:_,disabledActions:p,setDisabledActions:E,meta:O,setMeta:y},c);return b.createElement(_n.Provider,{value:x},n,u?b.createElement(gn,P({},x)):null)};const On={default:"#1A1A1A",white:"#FFFFFF",orange:"#CE2021",current:"currentColor"};function Se({variant:e="default",size:t=40,className:n,style:r}){const o=On[e],s=t*(799/2325);return L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:s,viewBox:"0 0 2325 799",fill:"none",className:n,style:r,"aria-hidden":"true",children:[L.jsx("rect",{x:"50",y:"50",width:"2225",height:"699",stroke:o,strokeWidth:"100"}),L.jsx("path",{d:"M492.333 199.627L599.833 295.627L600 295.776V491.707L492.207 599.5H199.5V199.5H492.19L492.333 199.627ZM334 347.5V448.5H435V347.5H334Z",fill:o}),L.jsx("path",{d:"M1108.5 497.715L1108.34 497.862L1001.34 599.362L1001.2 599.5H699V296.283L699.158 296.135L802.158 199.635L802.303 199.5H1108.5V497.715ZM855 347.5V448.5H956V347.5H855Z",fill:o}),L.jsx("path",{d:"M1616.94 200.24L1510.07 395.005L1616.94 598.768L1617.64 600.103L1616.28 599.451L1409 500.056L1208.22 599.448L1207.5 599.806V199.5H1617.34L1616.94 200.24ZM1332 337.5V439.207L1433.71 337.5H1332Z",fill:o}),L.jsx("path",{d:"M1716.5 599V200L1841 291.5L2125 200L2017.5 400L2125 599L1841 501L1716.5 599Z",fill:o,stroke:o})]})}function xn({caption:e,chipLabel:t,isLast:n,onAdvance:r,onEnd:o}){const s=t??(n?"Got it":"Next");return L.jsxs("div",{className:Ue("flex max-w-[min(20rem,calc(100vw-2rem))] flex-col gap-3 rounded-lg border","bg-popover text-popover-foreground shadow-floating p-4"),children:[L.jsxs("div",{className:"flex items-start gap-3",children:[L.jsxs("span",{className:"mt-0.5 shrink-0",children:[L.jsx(Se,{size:28,className:"dark:hidden"}),L.jsx(Se,{variant:"white",size:28,className:"hidden dark:block"})]}),L.jsx("p",{className:"text-sm leading-relaxed",children:e})]}),L.jsxs("div",{className:"flex items-center justify-end gap-2",children:[L.jsx(ve,{variant:"ghost",size:"sm",onClick:o,children:"Done"}),L.jsx(ve,{variant:"default",size:"sm",onClick:r,children:s})]})]})}const Rn=4e3,Sn=100;function kn(e){const[t,n]=d.useState({element:null,status:"resolving",anchor:e}),[r,o]=d.useState(e);return e!==r&&(o(e),n({element:null,status:"resolving",anchor:e})),d.useEffect(()=>{if(e===null)return;const s=Ce(e);let i=null,a=!1;const c=Date.now()+Rn,u=()=>{const f=document.querySelector(s);return f?(f!==i&&(f.scrollIntoView({block:"center",inline:"center"}),i=f,a=!0,n({element:f,status:"found",anchor:e})),!1):a?!1:Date.now()>=c?(n({element:null,status:"timeout",anchor:e}),!0):!1},l=setInterval(()=>{u()&&clearInterval(l)},Sn);return()=>clearInterval(l)},[e]),t}const Cn=".reactour__popover",Ln=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function ke(e){return Array.from(e.querySelectorAll(Ln))}function Mn(e,t){d.useEffect(()=>{var o;if(!e)return;const n=document.querySelector(Cn);if(!n)return;(o=ke(n)[0])==null||o.focus();const r=s=>{if(s.key!=="Tab")return;const i=ke(n);if(i.length===0)return;const a=i[0],c=i[i.length-1],u=document.activeElement;n.contains(u)?s.shiftKey&&u===a?(s.preventDefault(),c.focus()):!s.shiftKey&&u===c&&(s.preventDefault(),a.focus()):(s.preventDefault(),a.focus())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[e,t])}const ze="(prefers-reduced-motion: reduce)";function Tn(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(ze).matches}function An(){const[e,t]=d.useState(Tn);return d.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia(ze),r=o=>t(o.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const In="dork-tour-mask--reduced-motion",Pn={mask:8,popover:10},Dn="x 280ms ease, y 280ms ease, width 280ms ease, height 280ms ease";function Hn({steps:e,activeIndex:t,onAdvance:n,onEnd:r}){const o=e[t],s=t>=e.length-1,i=Ze(),a=An(),c=kn((o==null?void 0:o.anchor)??null),[u,l]=d.useState(null);c.status==="found"&&c.element!==null&&c.anchor===(o==null?void 0:o.anchor)&&u!==t?l(t):!o&&u!==null&&l(null);const f=u!==null,v=u!==null?e[u]:void 0,g=d.useCallback(()=>{s?r():n()},[s,r,n]),_=d.useRef(g);d.useEffect(()=>{_.current=g},[g]),d.useEffect(()=>{c.status==="timeout"&&_.current()},[c.status]);const O=d.useRef(n),y=d.useRef(r);d.useEffect(()=>{O.current=n,y.current=r},[n,r]);const p=d.useRef(!1);d.useEffect(()=>{p.current=u===t},[u,t]);const[E,x]=d.useState(!1);d.useEffect(()=>{if(f&&!E){const w=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(w)}},[f,E]),d.useEffect(()=>{if(!f)return;const w=document.getElementById("root");if(w)return w.inert=!0,()=>{w.inert=!1}},[f]),Mn(f,u??-1);const k=d.useMemo(()=>w=>{const R={...w,backgroundColor:"transparent",padding:0,boxShadow:"none",maxWidth:"none",color:"inherit"};return i?{...R,position:"fixed",top:"auto",left:0,right:0,bottom:0,transform:"none",display:"flex",justifyContent:"center",padding:"0 1rem 1rem"}:R},[i]),h=d.useCallback(w=>E?{...w,transition:Dn}:w,[E]),T=d.useMemo(()=>({popover:k,maskArea:h}),[k,h]),M=d.useMemo(()=>e.map((w,R)=>{const A=R===e.length-1;return{selector:Ce(w.anchor),stepInteraction:!1,content:L.jsx(xn,{caption:w.caption,chipLabel:w.chipLabel,isLast:A,onAdvance:()=>A?y.current():O.current(),onEnd:()=>y.current()})}}),[e]),C=d.useMemo(()=>e.map(w=>w.anchor).join("|"),[e]);return o?Xe.createPortal(L.jsxs(L.Fragment,{children:[L.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:f?(v==null?void 0:v.caption)??"":""}),f&&L.jsx(En,{steps:M,currentStep:u??0,defaultOpen:!0,showNavigation:!1,showPrevNextButtons:!1,showCloseButton:!1,showBadge:!1,showDots:!1,disableInteraction:!0,padding:Pn,styles:T,maskClassName:a?In:void 0,onClickMask:()=>r(),keyboardHandler:w=>{w.key==="Escape"?(w.preventDefault(),y.current()):w.key==="ArrowRight"&&p.current&&_.current()},children:L.jsx("span",{className:"hidden","aria-hidden":!0})},C)]}),document.body):null}const de={general:{id:"general",deepLink:{kind:"route",...Q.home()},steps:[{anchor:U.homeComposer,caption:z.general.composer,chipLabel:"Next"},{anchor:U.homeTabs,caption:z.general.homeTabs,chipLabel:"Got it"}]},tasks:{id:"tasks",occasion:"tasks",offerLine:z.offers.tasks,deepLink:{kind:"route",...Q.tasks()},steps:[{anchor:U.tasksList,caption:z.tasks.tasksList,chipLabel:"Got it"}]},relay:{id:"relay",occasion:"relay",offerLine:z.offers.relay,deepLink:{kind:"route",...Q.connections()},steps:[{anchor:U.relayIntegrations,caption:z.relay.relayIntegrations,chipLabel:"Got it"}]},mesh:{id:"mesh",occasion:"mesh",offerLine:z.offers.mesh,deepLink:{kind:"route",...Q.team()},steps:[{anchor:U.teamRoster,caption:z.mesh.teamRoster,chipLabel:"Got it"}]}},W=Qe()(e=>({runningTourId:null,activeIndex:0,pendingOfferId:null,startTour:t=>e({runningTourId:t,activeIndex:0,pendingOfferId:null}),advanceStep:()=>e(t=>({activeIndex:t.activeIndex+1})),endTour:()=>e({runningTourId:null,activeIndex:0}),setPendingOffer:t=>e({pendingOfferId:t}),clearPendingOffer:()=>e({pendingOfferId:null})}));function We(){var x,k;const e=Je(),t=et(),{data:n}=tt({queryKey:me.current(),queryFn:()=>e.getConfig(),staleTime:rt}),r=((x=n==null?void 0:n.tours)==null?void 0:x.seen)??[],o=((k=n==null?void 0:n.tours)==null?void 0:k.declined)??[],s=W(h=>h.runningTourId),i=W(h=>h.activeIndex),a=W(h=>h.pendingOfferId),c=W(h=>h.startTour),u=W(h=>h.advanceStep),l=W(h=>h.endTour),f=W(h=>h.setPendingOffer),v=W(h=>h.clearPendingOffer),g=nt({mutationFn:h=>e.updateConfig({tours:h}),onSuccess:()=>t.invalidateQueries({queryKey:me.all}),meta:{errorLabel:"Couldn’t save your tour progress"}});function _(h){r.includes(h)||g.mutate({seen:[...r,h]})}function O(h){o.includes(h)||g.mutate({declined:[...o,h]})}function y(h){return r.includes(h)||o.includes(h)}function p(h){_(h),c(h)}function E(h){O(h),v()}return{seen:r,declined:o,isSuppressed:y,runningDefinition:s?de[s]:null,activeIndex:i,pendingOffer:a?de[a]:null,pendingOfferId:a,runTour:c,acceptOffer:p,declineOffer:E,setPendingOffer:f,advanceStep:u,endTour:l}}const Nn=1,jn=1,$n=2;function zn(){const{isSuppressed:e,setPendingOffer:t,pendingOfferId:n,runningDefinition:r}=We(),o=ot(y=>Object.values(y.statuses).some(p=>p.lifecycle==="streaming")),s=ut(),i=it(),{data:a}=st(i),{data:c}=ft(s),{data:u}=at(),l=a==null?void 0:a.length,f=s&&c?c.reduce((y,p)=>y+p.instances.length,0):void 0,v=u==null?void 0:u.agents.length,g=d.useRef(void 0),_=d.useRef(void 0),O=d.useRef(void 0);d.useEffect(()=>{const y=(E,x,k,h,T)=>{if(x===void 0)return T;const M=h.current;return M===void 0||!(M<k&&x>=k)?(h.current=x,T):o||T||(h.current=x,e(E))?T:(t(E),!0)};let p=n!==null||r!==null;p=y("tasks",l,Nn,g,p),p=y("relay",f,jn,_,p),y("mesh",v,$n,O,p)},[l,f,v,o,n,r,e,t])}function qn(){zn();const{runningDefinition:e,activeIndex:t,advanceStep:n,endTour:r,runTour:o}=We(),s=lt(),i=ct({select:l=>l.location.pathname}),a=ge(l=>l.requestedTour),c=ge(l=>l.clearRequestedTour),u=(e==null?void 0:e.id)??null;return d.useEffect(()=>{if(a!==null){if(!(a in de)){c();return}if(u===a){c();return}o(a)}},[a,u,o,c]),d.useEffect(()=>{if(!e)return;const{to:l}=e.deepLink;i!==l&&s({to:l})},[e,i,s]),e?L.jsx(Hn,{steps:e.steps,activeIndex:t,onAdvance:n,onEnd:r}):null}export{Se as D,de as T,qn as a,zn as b,We as u};
1
+ import{r as d,R as b,j as L,B as ve,G as Ue,iA as Ce,ad as Ze,e3 as Xe,dH as U,l as Q,iB as Qe,a1 as Je,a3 as et,a2 as tt,au as me,a4 as nt,eg as rt,eh as ot,bd as it,aZ as st,ct as at,c4 as lt,eo as ct,aW as ge}from"./index-8-iQ6PnT.js";import{D as z}from"./dorkbot-templates-8Yu9POWJ.js";import{u as ut}from"./use-relay-config-1mAMDNbc.js";import{u as ft}from"./use-external-adapter-catalog-DoGUfa2F.js";var dt={attributes:!0,characterData:!0,subtree:!0,childList:!0};function ht(e,t,n=dt){d.useEffect(()=>{if(e.current){const r=new MutationObserver(t);return r.observe(e.current,n),()=>{r.disconnect()}}},[t,n])}var Le=(function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,s){return o[0]===n?(r=s,!0):!1}),r}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,s=this.__entries__;o<s.length;o++){var i=s[o];n.call(r,i[1],i[0])}},t})()})(),ue=typeof window<"u"&&typeof document<"u"&&window.document===document,te=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),pt=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(te):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),vt=2;function mt(e,t){var n=!1,r=!1,o=0;function s(){n&&(n=!1,e()),r&&a()}function i(){pt(s)}function a(){var c=Date.now();if(n){if(c-o<vt)return;r=!0}else n=!0,r=!1,setTimeout(i,t);o=c}return a}var gt=20,bt=["top","right","bottom","left","width","height","size","weight"],yt=typeof MutationObserver<"u",wt=(function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=mt(this.refresh.bind(this),gt)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!ue||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!ue||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=bt.some(function(s){return!!~r.indexOf(s)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e})(),Me=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e}),B=(function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||te}),Te=ie(0,0,0,0);function ne(e){return parseFloat(e)||0}function be(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var s=e["border-"+o+"-width"];return r+ne(s)},0)}function _t(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var s=o[r],i=e["padding-"+s];n[s]=ne(i)}return n}function Et(e){var t=e.getBBox();return ie(0,0,t.width,t.height)}function Ot(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Te;var r=B(e).getComputedStyle(e),o=_t(r),s=o.left+o.right,i=o.top+o.bottom,a=ne(r.width),c=ne(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=be(r,"left","right")+s),Math.round(c+i)!==n&&(c-=be(r,"top","bottom")+i)),!Rt(e)){var u=Math.round(a+s)-t,l=Math.round(c+i)-n;Math.abs(u)!==1&&(a-=u),Math.abs(l)!==1&&(c-=l)}return ie(o.left,o.top,a,c)}var xt=(function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof B(e).SVGGraphicsElement}:function(e){return e instanceof B(e).SVGElement&&typeof e.getBBox=="function"}})();function Rt(e){return e===B(e).document.documentElement}function St(e){return ue?xt(e)?Et(e):Ot(e):Te}function kt(e){var t=e.x,n=e.y,r=e.width,o=e.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(s.prototype);return Me(i,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),i}function ie(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Ct=(function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ie(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=St(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e})(),Lt=(function(){function e(t,n){var r=kt(n);Me(this,{target:t,contentRect:r})}return e})(),Mt=(function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Le,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof B(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Ct(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof B(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Lt(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e})(),Ae=typeof WeakMap<"u"?new WeakMap:new Le,Ie=(function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=wt.getInstance(),r=new Mt(t,n,this);Ae.set(this,r)}return e})();["observe","unobserve","disconnect"].forEach(function(e){Ie.prototype[e]=function(){var t;return(t=Ae.get(this))[e].apply(t,arguments)}});var Tt=(function(){return typeof te.ResizeObserver<"u"?te.ResizeObserver:Ie})(),At=({mutationObservables:e,resizeObservables:t,refresh:n})=>{const[r,o]=d.useState(0),s=d.useRef(document.documentElement||document.body);function i(c){const u=Array.from(c);for(const l of u)if(e){if(!l.attributes)continue;e.find(v=>l.matches(v))&&n(!0)}}function a(c){const u=Array.from(c);for(const l of u)if(t){if(!l.attributes)continue;t.find(v=>l.matches(v))&&o(r+1)}}return ht(s,c=>{for(const u of c)u.addedNodes.length!==0&&(i(u.addedNodes),a(u.addedNodes)),u.removedNodes.length!==0&&(i(u.removedNodes),a(u.removedNodes))},{childList:!0,subtree:!0}),d.useEffect(()=>{if(!t)return;const c=new Tt(()=>{n()});for(const u of t){const l=document.querySelector(u);l&&c.observe(l)}return()=>{c.disconnect()}},[t,r]),null},It=At;function ee(e){let t=Pe;return e&&(t=e.getBoundingClientRect()),t}function Pt(e,t){const[n,r]=d.useState(Pe),o=d.useCallback(()=>{e!=null&&e.current&&r(ee(e==null?void 0:e.current))},[e==null?void 0:e.current]);return d.useEffect(()=>(o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)),[e==null?void 0:e.current,t]),n}var Pe={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Dt(e,t){return new Promise(n=>{if(!(e instanceof Element))throw new TypeError("Argument 1 must be an Element");let r=0,o=null;const s=Object.assign({behavior:"smooth"},t);e.scrollIntoView(s),requestAnimationFrame(i);function i(){const a=e==null?void 0:e.getBoundingClientRect().top;if(a===o){if(r++>2)return n(null)}else r=0,o=a;requestAnimationFrame(i)}})}function J(e){return e<0?0:e}function Ht(e){return typeof e=="object"&&e!==null?{thresholdX:e.x||0,thresholdY:e.y||0}:{thresholdX:e||0,thresholdY:e||0}}function se(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return{w:e,h:t}}function Nt({top:e,right:t,bottom:n,left:r,threshold:o}){const{w:s,h:i}=se(),{thresholdX:a,thresholdY:c}=Ht(o);return e<0&&n-e>i?!0:e>=0+c&&r>=0+a&&n<=i-c&&t<=s-a}var ye=(e,t)=>e>t,we=(e,t)=>e>t;function jt(e,t=[]){const n=(r,o)=>t.includes(r)?1:t.includes(o)?-1:0;return Object.keys(e).map(r=>({position:r,value:e[r]})).sort((r,o)=>o.value-r.value).sort((r,o)=>n(r.position,o.position)).filter(r=>r.value>0).map(r=>r.position)}var ce=10;function fe(e=ce){return Array.isArray(e)?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[1],e[0],e[1],e[0]]:e.length===3?[e[0],e[1],e[2],e[1]]:e.length>3?[e[0],e[1],e[2],e[3]]:[ce,ce]:[e,e,e,e]}var $t={maskWrapper:()=>({opacity:.7,left:0,top:0,position:"fixed",zIndex:99999,pointerEvents:"none",color:"#000"}),svgWrapper:({windowWidth:e,windowHeight:t,wpt:n,wpl:r})=>({width:e,height:t,left:Number(r),top:Number(n),position:"fixed"}),maskArea:({x:e,y:t,width:n,height:r})=>({x:e,y:t,width:n,height:r,fill:"black",rx:0}),maskRect:({windowWidth:e,windowHeight:t,maskID:n})=>({x:0,y:0,width:e,height:t,fill:"currentColor",mask:`url(#${n})`}),clickArea:({windowWidth:e,windowHeight:t,clipID:n})=>({x:0,y:0,width:e,height:t,fill:"currentcolor",pointerEvents:"auto",clipPath:`url(#${n})`}),highlightedArea:({x:e,y:t,width:n,height:r})=>({x:e,y:t,width:n,height:r,pointerEvents:"auto",fill:"transparent",display:"none"})};function zt(e){return(t,n)=>{const r=$t[t](n),o=e[t];return o?o(r,n):r}}var Wt=({padding:e=10,wrapperPadding:t=0,onClick:n,onClickHighlighted:r,styles:o={},sizes:s,className:i,highlightedAreaClassName:a,maskId:c,clipId:u})=>{const l=c||_e("mask__"),f=u||_e("clip__"),v=zt(o),[g,_,O,y]=fe(e),[p,E,x,k]=fe(t),{w:h,h:T}=se(),M=J((s==null?void 0:s.width)+y+_),C=J((s==null?void 0:s.height)+g+O),w=J((s==null?void 0:s.top)-g-p),R=J((s==null?void 0:s.left)-y-k),A=h-k-E,S=T-p-x,j=v("maskArea",{x:R,y:w,width:M,height:C}),$=v("highlightedArea",{x:R,y:w,width:M,height:C});return b.createElement("div",{style:v("maskWrapper",{}),onClick:n,className:i},b.createElement("svg",{width:A,height:S,xmlns:"http://www.w3.org/2000/svg",style:v("svgWrapper",{windowWidth:A,windowHeight:S,wpt:p,wpl:k})},b.createElement("defs",null,b.createElement("mask",{id:l},b.createElement("rect",{x:0,y:0,width:A,height:S,fill:"white"}),b.createElement("rect",{style:j,rx:j.rx?1:void 0})),b.createElement("clipPath",{id:f},b.createElement("polygon",{points:`0 0, 0 ${S}, ${R} ${S}, ${R} ${w}, ${R+M} ${w}, ${R+M} ${w+C}, ${R} ${w+C}, ${R} ${S}, ${A} ${S}, ${A} 0`}))),b.createElement("rect",{style:v("maskRect",{windowWidth:A,windowHeight:S,maskID:l})}),b.createElement("rect",{style:v("clickArea",{windowWidth:A,windowHeight:S,top:w,left:R,width:M,height:C,clipID:f})}),b.createElement("rect",{style:$,className:a,onClick:r,rx:$.rx?1:void 0})))},Ft=Wt;function _e(e){return e+Math.random().toString(36).substring(2,16)}var Vt=Object.defineProperty,re=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Ee=(e,t,n)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oe=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&Ee(e,n,t[n]);if(re)for(var n of re(t))He.call(t,n)&&Ee(e,n,t[n]);return e},Bt=(e,t)=>{var n={};for(var r in e)De.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&re)for(var r of re(e))t.indexOf(r)<0&&He.call(e,r)&&(n[r]=e[r]);return n},qt={popover:()=>({position:"fixed",maxWidth:353,backgroundColor:"#fff",padding:"24px 30px",boxShadow:"0 0.5em 3em rgba(0, 0, 0, 0.3)",color:"inherit",zIndex:1e5,transition:"transform 0.3s",top:0,left:0})};function Gt(e){return(t,n)=>{const r=qt[t](n),o=e[t];return o?o(r,n):r}}var Kt=e=>{var t=e,{children:n,position:r="bottom",padding:o=10,styles:s={},sizes:i,refresher:a}=t,c=Bt(t,["children","position","padding","styles","sizes","refresher"]);const u=d.useRef(null),l=d.useRef(""),f=d.useRef(""),v=d.useRef(""),{w:g,h:_}=se(),O=Gt(s),y=Pt(u,a),{width:p,height:E}=y,[x,k,h,T]=fe(o),M=(i==null?void 0:i.left)-T,C=(i==null?void 0:i.top)-x,w=(i==null?void 0:i.right)+k,R=(i==null?void 0:i.bottom)+h,A=r&&typeof r=="function"?r({width:p,height:E,windowWidth:g,windowHeight:_,top:C,left:M,right:w,bottom:R,x:i.x,y:i.y},y):r,S={left:M,right:g-w,top:C,bottom:_-R},j=(I,D,H)=>{switch(I){case"top":return S.top>E+h;case"right":return D?!1:S.right>p+T;case"bottom":return H?!1:S.bottom>E+x;case"left":return S.left>p+k;default:return!1}},$=(I,D,H)=>{const m=jt(S,H?["right","left"]:D?["top","bottom"]:[]);for(let N=0;N<m.length;N++)if(j(m[N],D,H))return l.current=m[N],I[m[N]];return l.current="center",I.center},G=(I=>{if(Array.isArray(I)){const F=ye(I[0],g),le=we(I[1],_);return l.current="custom",[F?g/2-p/2:I[0],le?_/2-E/2:I[1]]}const D=ye(M+p,g),H=we(R+E,_),m=D?Math.min(M,g-p):Math.max(M,0),N=H?E>S.bottom?Math.max(R-E,0):Math.max(C,0):C;H&&E>S.bottom?f.current="bottom":f.current="top",D?v.current="left":v.current="right";const K={top:[m-T,C-E-h],right:[w+T,N-x],bottom:[m-T,R+x],left:[M-p-k,N-x],center:[g/2-p/2,_/2-E/2]};return I==="center"||j(I,D,H)&&!D&&!H?(l.current=I,K[I]):$(K,D,H)})(A);return b.createElement("div",Oe({className:"reactour__popover",style:Oe({transform:`translate(${Math.round(G[0])}px, ${Math.round(G[1])}px)`},O("popover",{position:l.current,verticalAlign:f.current,horizontalAlign:v.current,helperRect:y,targetRect:i})),ref:u},c),n)},Yt=Kt,Ut=Object.defineProperty,Zt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,xe=(e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))Ne.call(t,n)&&xe(e,n,t[n]);if(oe)for(var n of oe(t))je.call(t,n)&&xe(e,n,t[n]);return e},he=(e,t)=>Zt(e,Xt(t)),Z=(e,t)=>{var n={};for(var r in e)Ne.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oe)for(var r of oe(e))t.indexOf(r)<0&&je.call(e,r)&&(n[r]=e[r]);return n},Qt={bottom:0,height:0,left:0,right:0,top:0,width:0,windowWidth:0,windowHeight:0,x:0,y:0};function Jt(e,t={block:"center",behavior:"smooth",inViewThreshold:0}){const[n,r]=d.useState(!1),[o,s]=d.useState(!1),[i,a]=d.useState(!1),[c,u]=d.useState(null),[l,f]=d.useState(Qt),v=(e==null?void 0:e.selector)instanceof Element?e==null?void 0:e.selector:document.querySelector(e==null?void 0:e.selector),g=d.useCallback(()=>{const O=Re(v,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:y}=O,p=Z(O,["hasHighligtedElems"]);Object.entries(l).some(([E,x])=>p[E]!==x)&&f(p)},[v,e==null?void 0:e.highlightedSelectors,l]);d.useEffect(()=>(g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)),[v,e==null?void 0:e.highlightedSelectors,c]),d.useEffect(()=>{!Nt(he(P({},l),{threshold:t.inViewThreshold}))&&v&&(r(!0),Dt(v,t).then(()=>{o||u(Date.now())}).finally(()=>{r(!1)}))},[l]);const _=d.useCallback(()=>{s(!0);const O=Re(v,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:y}=O,p=Z(O,["hasHighligtedElems"]);a(y),f(p),s(!1)},[v,e==null?void 0:e.highlightedSelectors,l]);return{sizes:l,transition:n,target:v,observableRefresher:_,isHighlightingObserved:i}}function Re(e,t=[],n=!0){let r=!1;const{w:o,h:s}=se();if(!t)return he(P({},ee(e)),{windowWidth:o,windowHeight:s,hasHighligtedElems:!1});let i=ee(e),a={bottom:0,height:0,left:o,right:0,top:s,width:0};for(const u of t){const l=document.querySelector(u);if(!l||l.style.display==="none"||l.style.visibility==="hidden")continue;const f=ee(l);r=!0,n||!e?(f.top<a.top&&(a.top=f.top),f.right>a.right&&(a.right=f.right),f.bottom>a.bottom&&(a.bottom=f.bottom),f.left<a.left&&(a.left=f.left),a.width=a.right-a.left,a.height=a.bottom-a.top):(f.top<i.top&&(i.top=f.top),f.right>i.right&&(i.right=f.right),f.bottom>i.bottom&&(i.bottom=f.bottom),f.left<i.left&&(i.left=f.left),i.width=i.right-i.left,i.height=i.bottom-i.top)}const c=n||!e?a.width>0&&a.height>0:!1;return{left:(c?a:i).left,top:(c?a:i).top,right:(c?a:i).right,bottom:(c?a:i).bottom,width:(c?a:i).width,height:(c?a:i).height,windowWidth:o,windowHeight:s,hasHighligtedElems:r,x:i.x,y:i.y}}var en=({disableKeyboardNavigation:e,setCurrentStep:t,currentStep:n,setIsOpen:r,stepsLength:o,disable:s,rtl:i,clickProps:a,keyboardHandler:c})=>{function u(l){if(l.stopPropagation(),e===!0||s)return;let f,v,g;e&&(f=e.includes("esc"),v=e.includes("right"),g=e.includes("left"));function _(){t(Math.min(n+1,o-1))}function O(){t(Math.max(n-1,0))}c&&typeof c=="function"?c(l,a,{isEscDisabled:f,isRightDisabled:v,isLeftDisabled:g}):(l.keyCode===27&&!f&&(l.preventDefault(),r(!1)),l.keyCode===39&&!v&&(l.preventDefault(),i?O():_()),l.keyCode===37&&!g&&(l.preventDefault(),i?_():O()))}return d.useEffect(()=>(window.addEventListener("keydown",u,!1),()=>{window.removeEventListener("keydown",u)}),[s,t,n]),null},tn=en,nn={badge:()=>({position:"absolute",fontFamily:"monospace",background:"var(--reactour-accent,#007aff)",height:"1.875em",lineHeight:2,paddingLeft:"0.8125em",paddingRight:"0.8125em",fontSize:"1em",borderRadius:"1.625em",color:"white",textAlign:"center",boxShadow:"0 0.25em 0.5em rgba(0, 0, 0, 0.3)",top:"-0.8125em",left:"-0.8125em"}),controls:()=>({display:"flex",marginTop:24,alignItems:"center",justifyContent:"space-between"}),navigation:()=>({counterReset:"dot",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"}),button:({disabled:e})=>({display:"block",padding:0,border:0,background:"none",cursor:e?"not-allowed":"pointer"}),arrow:({disabled:e})=>({color:e?"#caccce":"#646464",width:16,height:12,flex:"0 0 16px"}),dot:({current:e,disabled:t,showNumber:n})=>({counterIncrement:"dot",width:8,height:8,border:e?"0":"1px solid #caccce",borderRadius:"100%",padding:0,display:"block",margin:4,transition:"opacity 0.3s, transform 0.3s",cursor:t?"not-allowed":"pointer",transform:`scale(${e?1.25:1})`,color:e?"var(--reactour-accent, #007aff)":"#caccce",background:e?"var(--reactour-accent, #007aff)":"none"}),close:({disabled:e})=>({position:"absolute",top:22,right:22,width:9,height:9,"--rt-close-btn":e?"#caccce":"#5e5e5e","--rt-close-btn-disabled":e?"#caccce":"#000"}),svg:()=>({display:"block"})};function ae(e){return(t,n)=>{const r=nn[t](n),o=e[t];return o?o(r,n):r}}var rn=({styles:e={},children:t})=>{const n=ae(e);return b.createElement("span",{style:n("badge",{})},t)},on=rn,sn=e=>{var t=e,{styles:n={},onClick:r,disabled:o}=t,s=Z(t,["styles","onClick","disabled"]);const i=ae(n);return b.createElement("button",P({className:"reactour__close-button",style:P(P({},i("button",{})),i("close",{disabled:o})),onClick:r},s),b.createElement("svg",{viewBox:"0 0 9.1 9.1","aria-hidden":!0,role:"presentation",style:P({},i("svg",{}))},b.createElement("path",{fill:"currentColor",d:"M5.9 4.5l2.8-2.8c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L4.5 3.1 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4l2.8 2.8L.3 7.4c-.4.4-.4 1 0 1.4.2.2.4.3.7.3s.5-.1.7-.3L4.5 6l2.8 2.8c.3.2.5.3.8.3s.5-.1.7-.3c.4-.4.4-1 0-1.4L5.9 4.5z"})))},an=sn,ln=({content:e,setCurrentStep:t,transition:n,isHighlightingObserved:r,currentStep:o,setIsOpen:s})=>typeof e=="function"?e({setCurrentStep:t,transition:n,isHighlightingObserved:r,currentStep:o,setIsOpen:s}):e,cn=ln,un=({styles:e={},steps:t,setCurrentStep:n,currentStep:r,setIsOpen:o,nextButton:s,prevButton:i,disableDots:a,hideDots:c,hideButtons:u,disableAll:l,rtl:f,Arrow:v=$e})=>{const g=t.length,_=ae(e),O=({onClick:y,kind:p="next",children:E,hideArrow:x})=>{function k(){l||(y&&typeof y=="function"?y():n(p==="next"?Math.min(r+1,g-1):Math.max(r-1,0)))}return b.createElement("button",{style:_("button",{kind:p,disabled:l||(p==="next"?g-1===r:r===0)}),onClick:k,"aria-label":`Go to ${p} step`},x?null:b.createElement(v,{styles:e,inverted:f?p==="prev":p==="next",disabled:l||(p==="next"?g-1===r:r===0)}),E)};return b.createElement("div",{style:_("controls",{}),dir:f?"rtl":"ltr"},u?null:i&&typeof i=="function"?i({Button:O,setCurrentStep:n,currentStep:r,stepsLength:g,setIsOpen:o,steps:t}):b.createElement(O,{kind:"prev"}),c?null:b.createElement("div",{style:_("navigation",{})},Array.from({length:g},(y,p)=>p).map(y=>{var p;return b.createElement("button",{style:_("dot",{current:y===r,disabled:a||l}),onClick:()=>{!a&&!l&&n(y)},key:`navigation_dot_${y}`,"aria-label":((p=t[y])==null?void 0:p.navDotAriaLabel)||`Go to step ${y+1}`})})),u?null:s&&typeof s=="function"?s({Button:O,setCurrentStep:n,currentStep:r,stepsLength:g,setIsOpen:o,steps:t}):b.createElement(O,null))},fn=un,$e=({styles:e={},inverted:t=!1,disabled:n})=>{const r=ae(e);return b.createElement("svg",{viewBox:"0 0 18.4 14.4",style:r("arrow",{inverted:t,disabled:n})},b.createElement("path",{d:t?"M17 7.2H1M10.8 1L17 7.2l-6.2 6.2":"M1.4 7.2h16M7.6 1L1.4 7.2l6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeMiterlimit:"10"}))},dn={Badge:on,Close:an,Content:cn,Navigation:fn,Arrow:$e},hn=e=>P(P({},dn),e),pn=({styles:e,components:t={},badgeContent:n,accessibilityOptions:r,disabledActions:o,onClickClose:s,steps:i,setCurrentStep:a,currentStep:c,transition:u,isHighlightingObserved:l,setIsOpen:f,nextButton:v,prevButton:g,disableDotsNavigation:_,rtl:O,showPrevNextButtons:y=!0,showCloseButton:p=!0,showNavigation:E=!0,showBadge:x=!0,showDots:k=!0,meta:h,setMeta:T,setSteps:M})=>{const C=i[c],{Badge:w,Close:R,Content:A,Navigation:S,Arrow:j}=hn(t),$=n&&typeof n=="function"?n({currentStep:c,totalSteps:i.length,transition:u}):c+1;function q(){o||(s&&typeof s=="function"?s({setCurrentStep:a,setIsOpen:f,currentStep:c,steps:i,meta:h,setMeta:T,setSteps:M}):f(!1))}return b.createElement(b.Fragment,null,x?b.createElement(w,{styles:e},$):null,p?b.createElement(R,{styles:e,"aria-label":r==null?void 0:r.closeButtonAriaLabel,disabled:o,onClick:q}):null,b.createElement(A,{content:C==null?void 0:C.content,setCurrentStep:a,currentStep:c,transition:u,isHighlightingObserved:l,setIsOpen:f}),E?b.createElement(S,{setCurrentStep:a,currentStep:c,setIsOpen:f,steps:i,styles:e,"aria-hidden":!(r!=null&&r.showNavigationScreenReaders),nextButton:v,prevButton:g,disableDots:_,hideButtons:!y,hideDots:!k,disableAll:o,rtl:O,Arrow:j}):null)},vn=pn,mn=e=>{var t=e,{currentStep:n,setCurrentStep:r,setIsOpen:o,steps:s=[],setSteps:i,styles:a={},scrollSmooth:c,afterOpen:u,beforeClose:l,padding:f=10,position:v,onClickMask:g,onClickHighlighted:_,keyboardHandler:O,className:y="reactour__popover",maskClassName:p="reactour__mask",highlightedMaskClassName:E,clipId:x,maskId:k,disableInteraction:h,disableKeyboardNavigation:T,inViewThreshold:M,disabledActions:C,setDisabledActions:w,disableWhenSelectorFalsy:R,rtl:A,accessibilityOptions:S={closeButtonAriaLabel:"Close Tour",showNavigationScreenReaders:!0},ContentComponent:j,Wrapper:$,meta:q,setMeta:G,onTransition:I=()=>"center"}=t,D=Z(t,["currentStep","setCurrentStep","setIsOpen","steps","setSteps","styles","scrollSmooth","afterOpen","beforeClose","padding","position","onClickMask","onClickHighlighted","keyboardHandler","className","maskClassName","highlightedMaskClassName","clipId","maskId","disableInteraction","disableKeyboardNavigation","inViewThreshold","disabledActions","setDisabledActions","disableWhenSelectorFalsy","rtl","accessibilityOptions","ContentComponent","Wrapper","meta","setMeta","onTransition"]),H;const m=s[n],N=P(P({},a),m==null?void 0:m.styles),{sizes:K,transition:F,observableRefresher:le,isHighlightingObserved:pe,target:V}=Jt(m,{block:"center",behavior:c?"smooth":"auto",inViewThreshold:M});d.useEffect(()=>(u&&typeof u=="function"&&u(V),()=>{l&&typeof l=="function"&&l(V)}),[]);const{maskPadding:Fe,popoverPadding:Ve,wrapperPadding:Be}=bn((H=m==null?void 0:m.padding)!=null?H:f),X={setCurrentStep:r,setIsOpen:o,currentStep:n,setSteps:i,steps:s,setMeta:G,meta:q};function qe(){C||(g&&typeof g=="function"?g(X):o(!1))}const Ge=typeof(m==null?void 0:m.stepInteraction)=="boolean"?!(m!=null&&m.stepInteraction):h?typeof h=="boolean"?h:h(X):!1;d.useEffect(()=>(m!=null&&m.action&&typeof(m==null?void 0:m.action)=="function"&&(m==null||m.action(V)),(m==null?void 0:m.disableActions)!==void 0&&w(m==null?void 0:m.disableActions),()=>{m!=null&&m.actionAfter&&typeof(m==null?void 0:m.actionAfter)=="function"&&(m==null||m.actionAfter(V))}),[m]);const Ke=F?I:m!=null&&m.position?m==null?void 0:m.position:v,Ye=$||b.Fragment;return m?b.createElement(Ye,null,b.createElement(It,{mutationObservables:m==null?void 0:m.mutationObservables,resizeObservables:m==null?void 0:m.resizeObservables,refresh:le}),b.createElement(tn,{setCurrentStep:r,currentStep:n,setIsOpen:o,stepsLength:s.length,disableKeyboardNavigation:T,disable:C,rtl:A,clickProps:X,keyboardHandler:O}),(!R||V)&&b.createElement(Ft,{sizes:F?yn:K,onClick:qe,styles:P({highlightedArea:Y=>he(P({},Y),{display:Ge?"block":"none"})},N),padding:F?0:Fe,highlightedAreaClassName:E,className:p,onClickHighlighted:Y=>{Y.preventDefault(),Y.stopPropagation(),_&&_(Y,X)},wrapperPadding:Be,clipId:x,maskId:k}),(!R||V)&&b.createElement(Yt,{sizes:K,styles:N,position:Ke,padding:Ve,"aria-labelledby":S==null?void 0:S.ariaLabelledBy,className:y,refresher:n},j?b.createElement(j,P({styles:N,setCurrentStep:r,currentStep:n,setIsOpen:o,steps:s,accessibilityOptions:S,disabledActions:C,transition:F,isHighlightingObserved:pe,rtl:A},D)):b.createElement(vn,P({styles:N,setCurrentStep:r,currentStep:n,setIsOpen:o,steps:s,setSteps:i,accessibilityOptions:S,disabledActions:C,transition:F,isHighlightingObserved:pe,rtl:A,meta:q,setMeta:G},D)))):null},gn=mn;function bn(e){return typeof e=="object"&&e!==null?{maskPadding:e.mask,popoverPadding:e.popover,wrapperPadding:e.wrapper}:{maskPadding:e,popoverPadding:e,wrapperPadding:0}}var yn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0},wn={isOpen:!1,setIsOpen:()=>!1,currentStep:0,setCurrentStep:()=>0,steps:[],setSteps:()=>[],setMeta:()=>"",disabledActions:!1,setDisabledActions:()=>!1,components:{}},_n=b.createContext(wn),En=e=>{var t=e,{children:n,defaultOpen:r=!1,startAt:o=0,steps:s,setCurrentStep:i,currentStep:a}=t,c=Z(t,["children","defaultOpen","startAt","steps","setCurrentStep","currentStep"]);const[u,l]=d.useState(r),[f,v]=d.useState(o),[g,_]=d.useState(s),[O,y]=d.useState(""),[p,E]=d.useState(!1),x=P({isOpen:u,setIsOpen:l,currentStep:a||f,setCurrentStep:i&&typeof i=="function"?i:v,steps:g,setSteps:_,disabledActions:p,setDisabledActions:E,meta:O,setMeta:y},c);return b.createElement(_n.Provider,{value:x},n,u?b.createElement(gn,P({},x)):null)};const On={default:"#1A1A1A",white:"#FFFFFF",orange:"#CE2021",current:"currentColor"};function Se({variant:e="default",size:t=40,className:n,style:r}){const o=On[e],s=t*(799/2325);return L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:s,viewBox:"0 0 2325 799",fill:"none",className:n,style:r,"aria-hidden":"true",children:[L.jsx("rect",{x:"50",y:"50",width:"2225",height:"699",stroke:o,strokeWidth:"100"}),L.jsx("path",{d:"M492.333 199.627L599.833 295.627L600 295.776V491.707L492.207 599.5H199.5V199.5H492.19L492.333 199.627ZM334 347.5V448.5H435V347.5H334Z",fill:o}),L.jsx("path",{d:"M1108.5 497.715L1108.34 497.862L1001.34 599.362L1001.2 599.5H699V296.283L699.158 296.135L802.158 199.635L802.303 199.5H1108.5V497.715ZM855 347.5V448.5H956V347.5H855Z",fill:o}),L.jsx("path",{d:"M1616.94 200.24L1510.07 395.005L1616.94 598.768L1617.64 600.103L1616.28 599.451L1409 500.056L1208.22 599.448L1207.5 599.806V199.5H1617.34L1616.94 200.24ZM1332 337.5V439.207L1433.71 337.5H1332Z",fill:o}),L.jsx("path",{d:"M1716.5 599V200L1841 291.5L2125 200L2017.5 400L2125 599L1841 501L1716.5 599Z",fill:o,stroke:o})]})}function xn({caption:e,chipLabel:t,isLast:n,onAdvance:r,onEnd:o}){const s=t??(n?"Got it":"Next");return L.jsxs("div",{className:Ue("flex max-w-[min(20rem,calc(100vw-2rem))] flex-col gap-3 rounded-lg border","bg-popover text-popover-foreground shadow-floating p-4"),children:[L.jsxs("div",{className:"flex items-start gap-3",children:[L.jsxs("span",{className:"mt-0.5 shrink-0",children:[L.jsx(Se,{size:28,className:"dark:hidden"}),L.jsx(Se,{variant:"white",size:28,className:"hidden dark:block"})]}),L.jsx("p",{className:"text-sm leading-relaxed",children:e})]}),L.jsxs("div",{className:"flex items-center justify-end gap-2",children:[L.jsx(ve,{variant:"ghost",size:"sm",onClick:o,children:"Done"}),L.jsx(ve,{variant:"default",size:"sm",onClick:r,children:s})]})]})}const Rn=4e3,Sn=100;function kn(e){const[t,n]=d.useState({element:null,status:"resolving",anchor:e}),[r,o]=d.useState(e);return e!==r&&(o(e),n({element:null,status:"resolving",anchor:e})),d.useEffect(()=>{if(e===null)return;const s=Ce(e);let i=null,a=!1;const c=Date.now()+Rn,u=()=>{const f=document.querySelector(s);return f?(f!==i&&(f.scrollIntoView({block:"center",inline:"center"}),i=f,a=!0,n({element:f,status:"found",anchor:e})),!1):a?!1:Date.now()>=c?(n({element:null,status:"timeout",anchor:e}),!0):!1},l=setInterval(()=>{u()&&clearInterval(l)},Sn);return()=>clearInterval(l)},[e]),t}const Cn=".reactour__popover",Ln=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function ke(e){return Array.from(e.querySelectorAll(Ln))}function Mn(e,t){d.useEffect(()=>{var o;if(!e)return;const n=document.querySelector(Cn);if(!n)return;(o=ke(n)[0])==null||o.focus();const r=s=>{if(s.key!=="Tab")return;const i=ke(n);if(i.length===0)return;const a=i[0],c=i[i.length-1],u=document.activeElement;n.contains(u)?s.shiftKey&&u===a?(s.preventDefault(),c.focus()):!s.shiftKey&&u===c&&(s.preventDefault(),a.focus()):(s.preventDefault(),a.focus())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[e,t])}const ze="(prefers-reduced-motion: reduce)";function Tn(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(ze).matches}function An(){const[e,t]=d.useState(Tn);return d.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia(ze),r=o=>t(o.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const In="dork-tour-mask--reduced-motion",Pn={mask:8,popover:10},Dn="x 280ms ease, y 280ms ease, width 280ms ease, height 280ms ease";function Hn({steps:e,activeIndex:t,onAdvance:n,onEnd:r}){const o=e[t],s=t>=e.length-1,i=Ze(),a=An(),c=kn((o==null?void 0:o.anchor)??null),[u,l]=d.useState(null);c.status==="found"&&c.element!==null&&c.anchor===(o==null?void 0:o.anchor)&&u!==t?l(t):!o&&u!==null&&l(null);const f=u!==null,v=u!==null?e[u]:void 0,g=d.useCallback(()=>{s?r():n()},[s,r,n]),_=d.useRef(g);d.useEffect(()=>{_.current=g},[g]),d.useEffect(()=>{c.status==="timeout"&&_.current()},[c.status]);const O=d.useRef(n),y=d.useRef(r);d.useEffect(()=>{O.current=n,y.current=r},[n,r]);const p=d.useRef(!1);d.useEffect(()=>{p.current=u===t},[u,t]);const[E,x]=d.useState(!1);d.useEffect(()=>{if(f&&!E){const w=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(w)}},[f,E]),d.useEffect(()=>{if(!f)return;const w=document.getElementById("root");if(w)return w.inert=!0,()=>{w.inert=!1}},[f]),Mn(f,u??-1);const k=d.useMemo(()=>w=>{const R={...w,backgroundColor:"transparent",padding:0,boxShadow:"none",maxWidth:"none",color:"inherit"};return i?{...R,position:"fixed",top:"auto",left:0,right:0,bottom:0,transform:"none",display:"flex",justifyContent:"center",padding:"0 1rem 1rem"}:R},[i]),h=d.useCallback(w=>E?{...w,transition:Dn}:w,[E]),T=d.useMemo(()=>({popover:k,maskArea:h}),[k,h]),M=d.useMemo(()=>e.map((w,R)=>{const A=R===e.length-1;return{selector:Ce(w.anchor),stepInteraction:!1,content:L.jsx(xn,{caption:w.caption,chipLabel:w.chipLabel,isLast:A,onAdvance:()=>A?y.current():O.current(),onEnd:()=>y.current()})}}),[e]),C=d.useMemo(()=>e.map(w=>w.anchor).join("|"),[e]);return o?Xe.createPortal(L.jsxs(L.Fragment,{children:[L.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:f?(v==null?void 0:v.caption)??"":""}),f&&L.jsx(En,{steps:M,currentStep:u??0,defaultOpen:!0,showNavigation:!1,showPrevNextButtons:!1,showCloseButton:!1,showBadge:!1,showDots:!1,disableInteraction:!0,padding:Pn,styles:T,maskClassName:a?In:void 0,onClickMask:()=>r(),keyboardHandler:w=>{w.key==="Escape"?(w.preventDefault(),y.current()):w.key==="ArrowRight"&&p.current&&_.current()},children:L.jsx("span",{className:"hidden","aria-hidden":!0})},C)]}),document.body):null}const de={general:{id:"general",deepLink:{kind:"route",...Q.home()},steps:[{anchor:U.homeComposer,caption:z.general.composer,chipLabel:"Next"},{anchor:U.homeTabs,caption:z.general.homeTabs,chipLabel:"Got it"}]},tasks:{id:"tasks",occasion:"tasks",offerLine:z.offers.tasks,deepLink:{kind:"route",...Q.tasks()},steps:[{anchor:U.tasksList,caption:z.tasks.tasksList,chipLabel:"Got it"}]},relay:{id:"relay",occasion:"relay",offerLine:z.offers.relay,deepLink:{kind:"route",...Q.connections()},steps:[{anchor:U.relayIntegrations,caption:z.relay.relayIntegrations,chipLabel:"Got it"}]},mesh:{id:"mesh",occasion:"mesh",offerLine:z.offers.mesh,deepLink:{kind:"route",...Q.team()},steps:[{anchor:U.teamRoster,caption:z.mesh.teamRoster,chipLabel:"Got it"}]}},W=Qe()(e=>({runningTourId:null,activeIndex:0,pendingOfferId:null,startTour:t=>e({runningTourId:t,activeIndex:0,pendingOfferId:null}),advanceStep:()=>e(t=>({activeIndex:t.activeIndex+1})),endTour:()=>e({runningTourId:null,activeIndex:0}),setPendingOffer:t=>e({pendingOfferId:t}),clearPendingOffer:()=>e({pendingOfferId:null})}));function We(){var x,k;const e=Je(),t=et(),{data:n}=tt({queryKey:me.current(),queryFn:()=>e.getConfig(),staleTime:rt}),r=((x=n==null?void 0:n.tours)==null?void 0:x.seen)??[],o=((k=n==null?void 0:n.tours)==null?void 0:k.declined)??[],s=W(h=>h.runningTourId),i=W(h=>h.activeIndex),a=W(h=>h.pendingOfferId),c=W(h=>h.startTour),u=W(h=>h.advanceStep),l=W(h=>h.endTour),f=W(h=>h.setPendingOffer),v=W(h=>h.clearPendingOffer),g=nt({mutationFn:h=>e.updateConfig({tours:h}),onSuccess:()=>t.invalidateQueries({queryKey:me.all}),meta:{errorLabel:"Couldn’t save your tour progress"}});function _(h){r.includes(h)||g.mutate({seen:[...r,h]})}function O(h){o.includes(h)||g.mutate({declined:[...o,h]})}function y(h){return r.includes(h)||o.includes(h)}function p(h){_(h),c(h)}function E(h){O(h),v()}return{seen:r,declined:o,isSuppressed:y,runningDefinition:s?de[s]:null,activeIndex:i,pendingOffer:a?de[a]:null,pendingOfferId:a,runTour:c,acceptOffer:p,declineOffer:E,setPendingOffer:f,advanceStep:u,endTour:l}}const Nn=1,jn=1,$n=2;function zn(){const{isSuppressed:e,setPendingOffer:t,pendingOfferId:n,runningDefinition:r}=We(),o=ot(y=>Object.values(y.statuses).some(p=>p.lifecycle==="streaming")),s=ut(),i=it(),{data:a}=st(i),{data:c}=ft(s),{data:u}=at(),l=a==null?void 0:a.length,f=s&&c?c.reduce((y,p)=>y+p.instances.length,0):void 0,v=u==null?void 0:u.agents.length,g=d.useRef(void 0),_=d.useRef(void 0),O=d.useRef(void 0);d.useEffect(()=>{const y=(E,x,k,h,T)=>{if(x===void 0)return T;const M=h.current;return M===void 0||!(M<k&&x>=k)?(h.current=x,T):o||T||(h.current=x,e(E))?T:(t(E),!0)};let p=n!==null||r!==null;p=y("tasks",l,Nn,g,p),p=y("relay",f,jn,_,p),y("mesh",v,$n,O,p)},[l,f,v,o,n,r,e,t])}function qn(){zn();const{runningDefinition:e,activeIndex:t,advanceStep:n,endTour:r,runTour:o}=We(),s=lt(),i=ct({select:l=>l.location.pathname}),a=ge(l=>l.requestedTour),c=ge(l=>l.clearRequestedTour),u=(e==null?void 0:e.id)??null;return d.useEffect(()=>{if(a!==null){if(!(a in de)){c();return}if(u===a){c();return}o(a)}},[a,u,o,c]),d.useEffect(()=>{if(!e)return;const{to:l}=e.deepLink;i!==l&&s({to:l})},[e,i,s]),e?L.jsx(Hn,{steps:e.steps,activeIndex:t,onAdvance:n,onEnd:r}):null}export{Se as D,de as T,qn as a,zn as b,We as u};