sparkforensics-server 0.2.0 → 0.2.3
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.
- package/index.js +1 -1
- package/lib/static-files.js +5 -4
- package/package.json +4 -3
- package/public/assets/AutoscalingChurn-Bf5TN-s_.js +1 -0
- package/public/assets/CacheUtilization-DRf_FNrK.js +1 -0
- package/public/assets/CachingOpportunity-BTJzIhtI.js +1 -0
- package/public/assets/ColdStart-DnFgnD3n.js +1 -0
- package/public/assets/ConfigAudit-B5FsOdmu.js +1 -0
- package/public/assets/CoreUsageArea-CTksBPuq.js +1 -0
- package/public/assets/Dashboard-BFMsMuc_.js +1 -0
- package/public/assets/DuplicatePlanSubtree-BCt-Guuh.js +1 -0
- package/public/assets/DurationHistogram-xRcnND4k.js +1 -0
- package/public/assets/EmptyState-CnTrSjtU.js +1 -0
- package/public/assets/ExecutorUtilization-CP21XlUq.js +1 -0
- package/public/assets/GcPressure-BoEJsLjb.js +1 -0
- package/public/assets/ImpactEstimate-BHcqJkcZ.js +1 -0
- package/public/assets/IncompleteRun-b9FWrOHn.js +1 -0
- package/public/assets/JobFailures-C5FkTq3O.js +1 -0
- package/public/assets/MemoryUtilization-D2W4AB_f.js +1 -0
- package/public/assets/OverBroadcast-Btu3xorf.js +1 -0
- package/public/assets/PartitionSizing-yZWhLN0e.js +1 -0
- package/public/assets/PlanExplorer-DSk1ivS4.js +1 -0
- package/public/assets/PlanGraphRoute-C3iOzUdB.js +1 -0
- package/public/assets/RetryWaste-B4436kr1.js +1 -0
- package/public/assets/RowPagination-oeWB8gBm.js +1 -0
- package/public/assets/ShuffleIO-DUiv8EJe.js +1 -0
- package/public/assets/Skew-D2lB1oQc.js +1 -0
- package/public/assets/SlowHost-Qb_8aa-W.js +1 -0
- package/public/assets/SmallFiles-u6suTgfj.js +1 -0
- package/public/assets/SpeculationWaste-vUCniiFP.js +1 -0
- package/public/assets/Spill-BskXFX2e.js +1 -0
- package/public/assets/StageFailed-D9b83Jvy.js +1 -0
- package/public/assets/StageFindingGroup-DagqHOUz.js +1 -0
- package/public/assets/StageHeader-DibMSunO.js +1 -0
- package/public/assets/StagePill-Dt6V9yVw.js +1 -0
- package/public/assets/StageShape-CfdrDUZa.js +1 -0
- package/public/assets/StageSlowness-BoGLIYKR.js +1 -0
- package/public/assets/Straggler-DU1WSU-m.js +1 -0
- package/public/assets/TaskFailures-DkY6zBNJ.js +1 -0
- package/public/assets/TinyTask-Lsnt5mJF.js +1 -0
- package/public/assets/UnderBroadcast-DxHc0lwy.js +1 -0
- package/public/assets/WidgetLeadSummary-BdUUi7L5.js +1 -0
- package/public/assets/charts-vendor-0VMaLVLN.js +59 -0
- package/public/assets/downsample-WmNM1qc9.js +1 -0
- package/public/assets/finding-anchor-Bl1hRK5E.js +1 -0
- package/public/assets/impact-sort-DxaUheWV.js +1 -0
- package/public/assets/inbox-DHIFHqcn.js +1 -0
- package/public/assets/index-CjVklAdW.css +2 -0
- package/public/assets/index-U654cmB8.js +9 -0
- package/public/assets/parser-worker-5a9aUx3o.js +115 -0
- package/public/assets/plan-graph-vendor-B0sEms9Z.js +7 -0
- package/public/assets/plan-graph-vendor-DLioOiRN.css +1 -0
- package/public/assets/react-vendor-D2TLlSzI.js +9 -0
- package/public/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/public/assets/select-CtKaJ5Hx.js +1 -0
- package/public/assets/toggle-group-DB2VfFIx.js +1 -0
- package/public/assets/usePagedRows-jNUWgVTD.js +1 -0
- package/public/assets/useRecentFiles-BiYdWs8J.js +11 -0
- package/public/assets/useSortMode-BhPky1lW.js +1 -0
- package/public/docs/404.html +3 -3
- package/public/docs/assets/{app.BgzsaTS3.js → app.BczRxXPr.js} +1 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.c2HfrwDg.js +1 -0
- package/public/docs/assets/chunks/{VPLocalSearchBox.DOq3t-On.js → VPLocalSearchBox.DXvkTVnC.js} +1 -1
- package/public/docs/assets/chunks/theme.ByUdwrLG.js +2 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.9ToZXcTk.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.9ToZXcTk.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.B1vUqtry.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.BOeH4d1J.lean.js → contributor-guide_architecture_detector-contract.md.B1vUqtry.lean.js} +1 -1
- package/public/docs/assets/{contributor-guide_architecture_drill-down.md.BtPdlM7r.js → contributor-guide_architecture_drill-down.md.Bawx6NgP.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DHVq1UPt.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DHVq1UPt.lean.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_overview.md.CehiRmGn.js → contributor-guide_architecture_overview.md.DkXdJ9jE.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.DkXdJ9jE.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.C-xxn0q7.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.C-xxn0q7.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.DYwFeyjV.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.C0SovZX8.js +6 -0
- package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.B93qJ_tT.lean.js → contributor-guide_architecture_worker-protocol.md.C0SovZX8.lean.js} +1 -1
- package/public/docs/assets/{contributor-guide_development-setup.md.DvAN_9mK.js → contributor-guide_development-setup.md.DvMV1xhQ.js} +3 -3
- package/public/docs/assets/contributor-guide_development-setup.md.DvMV1xhQ.lean.js +1 -0
- package/public/docs/assets/{contributor-guide_testing.md.6rIKqSyY.js → contributor-guide_testing.md.BohuQWvl.js} +1 -1
- package/public/docs/assets/{contributor-guide_testing.md.6rIKqSyY.lean.js → contributor-guide_testing.md.BohuQWvl.lean.js} +1 -1
- package/public/docs/assets/{style.DXOMCXxn.css → style.DSixAiZE.css} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-failures.md.4z5BXGJ2.js → tuning-reference_bottleneck-failures.md.CAsFf3RR.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-gc.md.DSxzZRK7.js → tuning-reference_bottleneck-gc.md.B4T3kJYV.js} +2 -2
- package/public/docs/assets/{tuning-reference_bottleneck-gc.md.DSxzZRK7.lean.js → tuning-reference_bottleneck-gc.md.B4T3kJYV.lean.js} +1 -1
- package/public/docs/assets/tuning-reference_bottleneck-shuffle.md.DDMQVOW6.js +12 -0
- package/public/docs/assets/{tuning-reference_bottleneck-shuffle.md.CM-nTmIH.lean.js → tuning-reference_bottleneck-shuffle.md.DDMQVOW6.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-skew.md.BdUwiDhn.js → tuning-reference_bottleneck-skew.md.B0MzhWcX.js} +4 -4
- package/public/docs/assets/{tuning-reference_bottleneck-skew.md.BdUwiDhn.lean.js → tuning-reference_bottleneck-skew.md.B0MzhWcX.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-small-files.md.B8kloyx8.js → tuning-reference_bottleneck-small-files.md.DHGMTmPs.js} +2 -2
- package/public/docs/assets/{tuning-reference_bottleneck-small-files.md.B8kloyx8.lean.js → tuning-reference_bottleneck-small-files.md.DHGMTmPs.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-straggler.md.DY36fHN5.js → tuning-reference_bottleneck-straggler.md.DIbXdAcQ.js} +2 -2
- package/public/docs/assets/{tuning-reference_bottleneck-straggler.md.DY36fHN5.lean.js → tuning-reference_bottleneck-straggler.md.DIbXdAcQ.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-tiny-tasks.md.QTV7O8kU.js → tuning-reference_bottleneck-tiny-tasks.md.CB05v3zh.js} +1 -1
- package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DqC_iGkw.js +5 -0
- package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DqC_iGkw.lean.js +1 -0
- package/public/docs/assets/{tuning-reference_cluster-config.md.ZVmDGsQ3.js → tuning-reference_cluster-config.md.CD6vzYtD.js} +1 -1
- package/public/docs/assets/{tuning-reference_cluster-config.md.ZVmDGsQ3.lean.js → tuning-reference_cluster-config.md.CD6vzYtD.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_memory-model.md.DhT-n4y3.js → tuning-reference_memory-model.md.CWhvgevP.js} +1 -1
- package/public/docs/assets/{tuning-reference_memory-model.md.DhT-n4y3.lean.js → tuning-reference_memory-model.md.CWhvgevP.lean.js} +1 -1
- package/public/docs/assets/{user-guide_alternative-log-retrieval.md.sU3KGarf.js → user-guide_alternative-log-retrieval.md.B4tPGIal.js} +1 -1
- package/public/docs/assets/{user-guide_alternative-log-retrieval.md.sU3KGarf.lean.js → user-guide_alternative-log-retrieval.md.B4tPGIal.lean.js} +1 -1
- package/public/docs/assets/user-guide_getting-started.md.BJvwLEIM.js +3 -0
- package/public/docs/assets/user-guide_getting-started.md.BJvwLEIM.lean.js +1 -0
- package/public/docs/assets/{user-guide_mcp-tools.md.C8MiIu7F.js → user-guide_mcp-tools.md.DGvolGzt.js} +4 -4
- package/public/docs/assets/{user-guide_mcp-tools.md.C8MiIu7F.lean.js → user-guide_mcp-tools.md.DGvolGzt.lean.js} +1 -1
- package/public/docs/assets/user-guide_run-comparison.md.CQc1aoU8.js +1 -0
- package/public/docs/assets/user-guide_run-comparison.md.CQc1aoU8.lean.js +1 -0
- package/public/docs/assets/user-guide_understanding-findings.md.B29f0ucS.js +1 -0
- package/public/docs/assets/user-guide_understanding-findings.md.B29f0ucS.lean.js +1 -0
- package/public/docs/contributor-guide/architecture/board-widgets.html +6 -6
- package/public/docs/contributor-guide/architecture/detector-contract.html +6 -6
- package/public/docs/contributor-guide/architecture/drill-down.html +6 -6
- package/public/docs/contributor-guide/architecture/impact-estimation.html +6 -6
- package/public/docs/contributor-guide/architecture/index.html +4 -4
- package/public/docs/contributor-guide/architecture/overview.html +6 -6
- package/public/docs/contributor-guide/architecture/state-and-history.html +6 -6
- package/public/docs/contributor-guide/architecture/widget-rendering.html +6 -6
- package/public/docs/contributor-guide/architecture/worker-protocol.html +7 -7
- package/public/docs/contributor-guide/contributing.html +4 -4
- package/public/docs/contributor-guide/development-setup.html +6 -6
- package/public/docs/contributor-guide/testing.html +6 -6
- package/public/docs/hashmap.json +1 -1
- package/public/docs/index.html +4 -4
- package/public/docs/tuning-reference/anti-patterns.html +4 -4
- package/public/docs/tuning-reference/aqe.html +4 -4
- package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +4 -4
- package/public/docs/tuning-reference/bottleneck-cold-start.html +4 -4
- package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +4 -4
- package/public/docs/tuning-reference/bottleneck-failures.html +6 -6
- package/public/docs/tuning-reference/bottleneck-gc.html +6 -6
- package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +4 -4
- package/public/docs/tuning-reference/bottleneck-memory-utilization.html +4 -4
- package/public/docs/tuning-reference/bottleneck-retry-waste.html +4 -4
- package/public/docs/tuning-reference/bottleneck-shuffle.html +7 -7
- package/public/docs/tuning-reference/bottleneck-skew.html +8 -8
- package/public/docs/tuning-reference/bottleneck-slow-host.html +4 -4
- package/public/docs/tuning-reference/bottleneck-small-files.html +7 -7
- package/public/docs/tuning-reference/bottleneck-spill.html +4 -4
- package/public/docs/tuning-reference/bottleneck-straggler.html +6 -6
- package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +6 -6
- package/public/docs/tuning-reference/bottleneck-utilization.html +7 -7
- package/public/docs/tuning-reference/caching.html +4 -4
- package/public/docs/tuning-reference/cluster-config.html +6 -6
- package/public/docs/tuning-reference/config.html +4 -4
- package/public/docs/tuning-reference/data-formats.html +4 -4
- package/public/docs/tuning-reference/index.html +4 -4
- package/public/docs/tuning-reference/intro.html +4 -4
- package/public/docs/tuning-reference/joins.html +4 -4
- package/public/docs/tuning-reference/memory-model.html +6 -6
- package/public/docs/tuning-reference/metrics.html +4 -4
- package/public/docs/tuning-reference/partitioning.html +4 -4
- package/public/docs/tuning-reference/pyspark.html +4 -4
- package/public/docs/tuning-reference/shuffle.html +4 -4
- package/public/docs/tuning-reference/spark-architecture.html +4 -4
- package/public/docs/tuning-reference/table-formats.html +4 -4
- package/public/docs/user-guide/alternative-log-retrieval.html +6 -6
- package/public/docs/user-guide/getting-started.html +7 -7
- package/public/docs/user-guide/mcp-tools.html +9 -9
- package/public/docs/user-guide/run-comparison.html +6 -6
- package/public/docs/user-guide/understanding-findings.html +6 -6
- package/public/index.html +7 -6
- package/public/sample-runs/sample-run.ndjson.gz +0 -0
- package/vendor-core/cli/collect-run.js +3 -2
- package/vendor-core/cli/native-zstd.js +351 -0
- package/vendor-core/detectors.js +390 -75
- package/vendor-core/docs-config.js +34 -8
- package/vendor-core/docs-content/chapters/03-memory-model.md +39 -0
- package/vendor-core/docs-content/chapters/11-cluster-config.md +40 -0
- package/vendor-core/docs-content/detection/cache.md +4 -3
- package/vendor-core/docs-content/detection/chrn.md +4 -2
- package/vendor-core/docs-content/detection/gc.md +2 -0
- package/vendor-core/docs-content/detection/host.md +2 -1
- package/vendor-core/docs-content/detection/local.md +2 -3
- package/vendor-core/docs-content/detection/mem.md +3 -3
- package/vendor-core/docs-content/detection/plan.md +3 -1
- package/vendor-core/docs-content/detection/shape.md +2 -1
- package/vendor-core/docs-content/detection/shfl.md +2 -1
- package/vendor-core/docs-content/detection/spec.md +4 -3
- package/vendor-core/docs-content/detection/spill.md +1 -1
- package/vendor-core/docs-content/detection/strag.md +2 -1
- package/vendor-core/docs-content/detection/tiny.md +2 -1
- package/vendor-core/docs-content/tuning/failures.md +1 -1
- package/vendor-core/docs-content/tuning/gc.md +11 -4
- package/vendor-core/docs-content/tuning/shuffle.md +25 -5
- package/vendor-core/docs-content/tuning/skew.md +14 -6
- package/vendor-core/docs-content/tuning/small-files.md +12 -7
- package/vendor-core/docs-content/tuning/straggler.md +34 -0
- package/vendor-core/docs-content/tuning/tiny-tasks.md +1 -1
- package/vendor-core/docs-content/tuning/utilization.md +57 -7
- package/vendor-core/docs-content/upstream.json +4 -0
- package/vendor-core/event-handlers.js +321 -69
- package/vendor-core/event-schemas.js +8 -6
- package/vendor-core/evidence-report.js +4 -2
- package/vendor-core/impact-estimator.js +150 -34
- package/vendor-core/mcp-tools.js +20 -7
- package/vendor-core/occupancy.js +70 -2
- package/vendor-core/parser-worker.js +30 -14
- package/vendor-core/plan-summary.js +4 -0
- package/vendor-core/run-comparison.js +22 -17
- package/vendor-core/shs-fetch.js +18 -7
- package/vendor-core/shs-load.js +2 -1
- package/vendor-core/stage-quantiles.js +59 -3
- package/vendor-core/string-hash.js +15 -0
- package/vendor-core/types.js +9 -1
- package/vendor-core/vendor/fzstd.js +94 -18
- package/public/assets/AutoscalingChurn-CFJkiqxW.js +0 -1
- package/public/assets/CacheUtilization-kTKZBzDA.js +0 -1
- package/public/assets/CachingOpportunity-CU70EWcF.js +0 -1
- package/public/assets/ColdStart-hOI-WOvm.js +0 -1
- package/public/assets/ConfigAudit-B4oAksZY.js +0 -1
- package/public/assets/CoreUsageArea-D-dR3SQk.js +0 -1
- package/public/assets/Dashboard-MDhohsq4.js +0 -4
- package/public/assets/DuplicatePlanSubtree-54RKsfI7.js +0 -1
- package/public/assets/DurationHistogram-CviQyPNM.js +0 -1
- package/public/assets/EmptyState-v2ehFncc.js +0 -1
- package/public/assets/ExecutorUtilization-vHyFHgL6.js +0 -1
- package/public/assets/GcPressure-DINuhcno.js +0 -1
- package/public/assets/ImpactEstimate-C6GzFOY9.js +0 -1
- package/public/assets/IncompleteRun-a1kuCnU6.js +0 -1
- package/public/assets/JobFailures-CYwPfUhR.js +0 -1
- package/public/assets/MemoryUtilization-Dlfj0e_f.js +0 -1
- package/public/assets/OverBroadcast-BMu7Y8l9.js +0 -1
- package/public/assets/PartitionSizing-CvMGfSVB.js +0 -1
- package/public/assets/PlanExplorer-xYFme_Rx.js +0 -1
- package/public/assets/PlanGraphRoute-a3OGg6ET.js +0 -1
- package/public/assets/RetryWaste-JKRjOZ-J.js +0 -1
- package/public/assets/RowPagination-DypWbnic.js +0 -1
- package/public/assets/ShuffleIO-Mi8HiVu-.js +0 -1
- package/public/assets/Skew-C3iOScTC.js +0 -1
- package/public/assets/SlowHost-DKBg18v-.js +0 -1
- package/public/assets/SmallFiles-CCCB6AIu.js +0 -1
- package/public/assets/SpeculationWaste-DUNupw0_.js +0 -1
- package/public/assets/Spill-BlLdatik.js +0 -1
- package/public/assets/StageFailed-qtY7C7Yo.js +0 -1
- package/public/assets/StageFindingGroup-CoVdEZYs.js +0 -1
- package/public/assets/StageHeader-uDBLHgdg.js +0 -1
- package/public/assets/StagePill-CYCMdlIx.js +0 -1
- package/public/assets/StageShape-zs0mAjQJ.js +0 -1
- package/public/assets/StageSlowness-C7vg0u5Q.js +0 -1
- package/public/assets/Straggler-4BRGAQP4.js +0 -1
- package/public/assets/TaskFailures-CSjO23Kg.js +0 -1
- package/public/assets/TinyTask-6Zuovcn5.js +0 -1
- package/public/assets/UnderBroadcast-CePjo0ZV.js +0 -1
- package/public/assets/WidgetLeadSummary-DRNRVvn7.js +0 -1
- package/public/assets/charts-vendor-Cf1-wzeH.js +0 -59
- package/public/assets/downsample-D8XmJk6i.js +0 -1
- package/public/assets/finding-anchor-4TmpXd7j.js +0 -1
- package/public/assets/impact-sort-Cq6KOLqh.js +0 -1
- package/public/assets/inbox-DBFovbUX.js +0 -1
- package/public/assets/index-CHjV2-jB.js +0 -9
- package/public/assets/index-DMEtaP4u.css +0 -1
- package/public/assets/parser-worker-BMPPE37w.js +0 -64
- package/public/assets/plan-graph-vendor-B96a-e4N.js +0 -7
- package/public/assets/plan-graph-vendor-BnuhLJ6X.css +0 -1
- package/public/assets/react-vendor-DA6opS-q.js +0 -9
- package/public/assets/select-D5fK-za0.js +0 -1
- package/public/assets/toggle-group-lbIXRG0W.js +0 -1
- package/public/assets/usePagedRows-CFoZrPr4.js +0 -1
- package/public/assets/useRecentFiles-BPGQ6XII.js +0 -13
- package/public/assets/useSortMode-BOPpfLhJ.js +0 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.PQ5JepCp.js +0 -1
- package/public/docs/assets/chunks/theme.BP14rGBx.js +0 -2
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.B-OsL91z.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.B-OsL91z.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.BOeH4d1J.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DYCDPgkh.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DYCDPgkh.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.CehiRmGn.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.m3S3UdMk.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.m3S3UdMk.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.DbqPf2OT.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.B93qJ_tT.js +0 -6
- package/public/docs/assets/contributor-guide_development-setup.md.DvAN_9mK.lean.js +0 -1
- package/public/docs/assets/tuning-reference_bottleneck-shuffle.md.CM-nTmIH.js +0 -12
- package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DTiueZC3.js +0 -5
- package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DTiueZC3.lean.js +0 -1
- package/public/docs/assets/user-guide_getting-started.md.DtEM37MK.js +0 -3
- package/public/docs/assets/user-guide_getting-started.md.DtEM37MK.lean.js +0 -1
- package/public/docs/assets/user-guide_run-comparison.md.S0TWWmLY.js +0 -1
- package/public/docs/assets/user-guide_run-comparison.md.S0TWWmLY.lean.js +0 -1
- package/public/docs/assets/user-guide_understanding-findings.md.D0R_Y-R2.js +0 -1
- package/public/docs/assets/user-guide_understanding-findings.md.D0R_Y-R2.lean.js +0 -1
- /package/public/docs/assets/{contributor-guide_architecture_drill-down.md.BtPdlM7r.lean.js → contributor-guide_architecture_drill-down.md.Bawx6NgP.lean.js} +0 -0
- /package/public/docs/assets/{contributor-guide_architecture_widget-rendering.md.DbqPf2OT.lean.js → contributor-guide_architecture_widget-rendering.md.DYwFeyjV.lean.js} +0 -0
- /package/public/docs/assets/{tuning-reference_bottleneck-failures.md.4z5BXGJ2.lean.js → tuning-reference_bottleneck-failures.md.CAsFf3RR.lean.js} +0 -0
- /package/public/docs/assets/{tuning-reference_bottleneck-tiny-tasks.md.QTV7O8kU.lean.js → tuning-reference_bottleneck-tiny-tasks.md.CB05v3zh.lean.js} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{u as Ec,R as _c,r as R,j as P,a as Nc}from"./react-vendor-DA6opS-q.js";function ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=ie(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Sc={value:()=>{}};function ln(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Bt(n)}function Bt(e){this._=e}function Cc(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Bt.prototype=ln.prototype={constructor:Bt,on:function(e,t){var n=this._,o=Cc(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=kc(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=Ro(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Ro(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Bt(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function kc(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Ro(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=Sc,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Vn="http://www.w3.org/1999/xhtml";const Lo={svg:"http://www.w3.org/2000/svg",xhtml:Vn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function un(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Lo.hasOwnProperty(t)?{space:Lo[t],local:e}:e}function Mc(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Vn&&t.documentElement.namespaceURI===Vn?t.createElement(e):t.createElementNS(n,e)}}function Ic(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function si(e){var t=un(e);return(t.local?Ic:Mc)(t)}function Oc(){}function no(e){return e==null?Oc:function(){return this.querySelector(e)}}function Pc(e){typeof e!="function"&&(e=no(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new le(o,this._parents)}function Ac(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Tc(){return[]}function ai(e){return e==null?Tc:function(){return this.querySelectorAll(e)}}function $c(e){return function(){return Ac(e.apply(this,arguments))}}function Dc(e){typeof e=="function"?e=$c(e):e=ai(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new le(o,r)}function ci(e){return function(){return this.matches(e)}}function li(e){return function(t){return t.matches(e)}}var Rc=Array.prototype.find;function Lc(e){return function(){return Rc.call(this.children,e)}}function zc(){return this.firstElementChild}function Hc(e){return this.select(e==null?zc:Lc(typeof e=="function"?e:li(e)))}var jc=Array.prototype.filter;function Vc(){return Array.from(this.children)}function Bc(e){return function(){return jc.call(this.children,e)}}function Fc(e){return this.selectAll(e==null?Vc:Bc(typeof e=="function"?e:li(e)))}function Yc(e){typeof e!="function"&&(e=ci(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new le(o,this._parents)}function ui(e){return new Array(e.length)}function Xc(){return new le(this._enter||this._groups.map(ui),this._parents)}function Wt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Wt.prototype={constructor:Wt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Zc(e){return function(){return e}}function Wc(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Wt(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function qc(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,d=i.length,f=new Array(u),h;for(a=0;a<u;++a)(l=t[a])&&(f[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?r[a]=l:c.set(h,l));for(a=0;a<d;++a)h=s.call(e,i[a],a,i)+"",(l=c.get(h))?(o[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new Wt(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(r[a]=l)}function Gc(e){return e.__data__}function Uc(e,t){if(!arguments.length)return Array.from(this,Gc);var n=t?qc:Wc,o=this._parents,r=this._groups;typeof e!="function"&&(e=Zc(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],f=d.length,h=Kc(e.call(u,u&&u.__data__,c,o)),g=h.length,v=a[c]=new Array(g),x=s[c]=new Array(g),m=l[c]=new Array(f);n(u,d,v,x,m,h,t);for(var b=0,p=0,y,_;b<g;++b)if(y=v[b]){for(b>=p&&(p=b+1);!(_=x[p])&&++p<g;);y._next=_||null}}return s=new le(s,o),s._enter=a,s._exit=l,s}function Kc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Qc(){return new le(this._exit||this._groups.map(ui),this._parents)}function Jc(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function el(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],d=c.length,f=a[l]=new Array(d),h,g=0;g<d;++g)(h=c[g]||u[g])&&(f[g]=h);for(;l<r;++l)a[l]=n[l];return new le(a,this._parents)}function tl(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function nl(e){e||(e=ol);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new le(r,this._parents).order()}function ol(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function rl(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function il(){return Array.from(this)}function sl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function al(){let e=0;for(const t of this)++e;return e}function cl(){return!this.node()}function ll(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function ul(e){return function(){this.removeAttribute(e)}}function dl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fl(e,t){return function(){this.setAttribute(e,t)}}function hl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function gl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function pl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ml(e,t){var n=un(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?dl:ul:typeof t=="function"?n.local?pl:gl:n.local?hl:fl)(n,t))}function di(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yl(e){return function(){this.style.removeProperty(e)}}function wl(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xl(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function vl(e,t,n){return arguments.length>1?this.each((t==null?yl:typeof t=="function"?xl:wl)(e,t,n??"")):tt(this.node(),e)}function tt(e,t){return e.style.getPropertyValue(t)||di(e).getComputedStyle(e,null).getPropertyValue(t)}function bl(e){return function(){delete this[e]}}function El(e,t){return function(){this[e]=t}}function _l(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Nl(e,t){return arguments.length>1?this.each((t==null?bl:typeof t=="function"?_l:El)(e,t)):this.node()[e]}function fi(e){return e.trim().split(/^|\s+/)}function oo(e){return e.classList||new hi(e)}function hi(e){this._node=e,this._names=fi(e.getAttribute("class")||"")}hi.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function gi(e,t){for(var n=oo(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function pi(e,t){for(var n=oo(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Sl(e){return function(){gi(this,e)}}function Cl(e){return function(){pi(this,e)}}function kl(e,t){return function(){(t.apply(this,arguments)?gi:pi)(this,e)}}function Ml(e,t){var n=fi(e+"");if(arguments.length<2){for(var o=oo(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?kl:t?Sl:Cl)(n,t))}function Il(){this.textContent=""}function Ol(e){return function(){this.textContent=e}}function Pl(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Al(e){return arguments.length?this.each(e==null?Il:(typeof e=="function"?Pl:Ol)(e)):this.node().textContent}function Tl(){this.innerHTML=""}function $l(e){return function(){this.innerHTML=e}}function Dl(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Rl(e){return arguments.length?this.each(e==null?Tl:(typeof e=="function"?Dl:$l)(e)):this.node().innerHTML}function Ll(){this.nextSibling&&this.parentNode.appendChild(this)}function zl(){return this.each(Ll)}function Hl(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jl(){return this.each(Hl)}function Vl(e){var t=typeof e=="function"?e:si(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Bl(){return null}function Fl(e,t){var n=typeof e=="function"?e:si(e),o=t==null?Bl:typeof t=="function"?t:no(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Yl(){var e=this.parentNode;e&&e.removeChild(this)}function Xl(){return this.each(Yl)}function Zl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Wl(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ql(e){return this.select(e?Wl:Zl)}function Gl(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ul(e){return function(t){e.call(this,t,this.__data__)}}function Kl(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ql(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function Jl(e,t,n){return function(){var o=this.__on,r,i=Ul(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function eu(e,t,n){var o=Kl(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?Jl:Ql,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function mi(e,t,n){var o=di(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function tu(e,t){return function(){return mi(this,e,t)}}function nu(e,t){return function(){return mi(this,e,t.apply(this,arguments))}}function ou(e,t){return this.each((typeof t=="function"?nu:tu)(e,t))}function*ru(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var yi=[null];function le(e,t){this._groups=e,this._parents=t}function Ct(){return new le([[document.documentElement]],yi)}function iu(){return this}le.prototype=Ct.prototype={constructor:le,select:Pc,selectAll:Dc,selectChild:Hc,selectChildren:Fc,filter:Yc,data:Uc,enter:Xc,exit:Qc,join:Jc,merge:el,selection:iu,order:tl,sort:nl,call:rl,nodes:il,node:sl,size:al,empty:cl,each:ll,attr:ml,style:vl,property:Nl,classed:Ml,text:Al,html:Rl,raise:zl,lower:jl,append:Vl,insert:Fl,remove:Xl,clone:ql,datum:Gl,on:eu,dispatch:ou,[Symbol.iterator]:ru};function ce(e){return typeof e=="string"?new le([[document.querySelector(e)]],[document.documentElement]):new le([[e]],yi)}function su(e){let t;for(;t=e.sourceEvent;)e=t;return e}function de(e,t){if(e=su(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const au={passive:!1},mt={capture:!0,passive:!1};function Cn(e){e.stopImmediatePropagation()}function Qe(e){e.preventDefault(),e.stopImmediatePropagation()}function wi(e){var t=e.document.documentElement,n=ce(e).on("dragstart.drag",Qe,mt);"onselectstart"in t?n.on("selectstart.drag",Qe,mt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function xi(e,t){var n=e.document.documentElement,o=ce(e).on("dragstart.drag",null);t&&(o.on("click.drag",Qe,mt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Tt=e=>()=>e;function Bn(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Bn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function cu(e){return!e.ctrlKey&&!e.button}function lu(){return this.parentNode}function uu(e,t){return t??{x:e.x,y:e.y}}function du(){return navigator.maxTouchPoints||"ontouchstart"in this}function vi(){var e=cu,t=lu,n=uu,o=du,r={},i=ln("start","drag","end"),s=0,a,l,c,u,d=0;function f(y){y.on("mousedown.drag",h).filter(o).on("touchstart.drag",x).on("touchmove.drag",m,au).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(y,_){if(!(u||!e.call(this,y,_))){var N=p(this,t.call(this,y,_),y,_,"mouse");N&&(ce(y.view).on("mousemove.drag",g,mt).on("mouseup.drag",v,mt),wi(y.view),Cn(y),c=!1,a=y.clientX,l=y.clientY,N("start",y))}}function g(y){if(Qe(y),!c){var _=y.clientX-a,N=y.clientY-l;c=_*_+N*N>d}r.mouse("drag",y)}function v(y){ce(y.view).on("mousemove.drag mouseup.drag",null),xi(y.view,c),Qe(y),r.mouse("end",y)}function x(y,_){if(e.call(this,y,_)){var N=y.changedTouches,k=t.call(this,y,_),C=N.length,M,z;for(M=0;M<C;++M)(z=p(this,k,y,_,N[M].identifier,N[M]))&&(Cn(y),z("start",y,N[M]))}}function m(y){var _=y.changedTouches,N=_.length,k,C;for(k=0;k<N;++k)(C=r[_[k].identifier])&&(Qe(y),C("drag",y,_[k]))}function b(y){var _=y.changedTouches,N=_.length,k,C;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),k=0;k<N;++k)(C=r[_[k].identifier])&&(Cn(y),C("end",y,_[k]))}function p(y,_,N,k,C,M){var z=i.copy(),O=de(M||N,_),D,A,w;if((w=n.call(y,new Bn("beforestart",{sourceEvent:N,target:f,identifier:C,active:s,x:O[0],y:O[1],dx:0,dy:0,dispatch:z}),k))!=null)return D=w.x-O[0]||0,A=w.y-O[1]||0,function E(S,I,T){var $=O,H;switch(S){case"start":r[C]=E,H=s++;break;case"end":delete r[C],--s;case"drag":O=de(T||I,_),H=s;break}z.call(S,y,new Bn(S,{sourceEvent:I,subject:w,target:f,identifier:C,active:H,x:O[0]+D,y:O[1]+A,dx:O[0]-$[0],dy:O[1]-$[1],dispatch:z}),k)}}return f.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Tt(!!y),f):e},f.container=function(y){return arguments.length?(t=typeof y=="function"?y:Tt(y),f):t},f.subject=function(y){return arguments.length?(n=typeof y=="function"?y:Tt(y),f):n},f.touchable=function(y){return arguments.length?(o=typeof y=="function"?y:Tt(!!y),f):o},f.on=function(){var y=i.on.apply(i,arguments);return y===i?f:y},f.clickDistance=function(y){return arguments.length?(d=(y=+y)*y,f):Math.sqrt(d)},f}function ro(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bi(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function kt(){}var yt=.7,qt=1/yt,Je="\\s*([+-]?\\d+)\\s*",wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_e="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fu=/^#([0-9a-f]{3,8})$/,hu=new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`),gu=new RegExp(`^rgb\\(${_e},${_e},${_e}\\)$`),pu=new RegExp(`^rgba\\(${Je},${Je},${Je},${wt}\\)$`),mu=new RegExp(`^rgba\\(${_e},${_e},${_e},${wt}\\)$`),yu=new RegExp(`^hsl\\(${wt},${_e},${_e}\\)$`),wu=new RegExp(`^hsla\\(${wt},${_e},${_e},${wt}\\)$`),zo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ro(kt,Ye,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ho,formatHex:Ho,formatHex8:xu,formatHsl:vu,formatRgb:jo,toString:jo});function Ho(){return this.rgb().formatHex()}function xu(){return this.rgb().formatHex8()}function vu(){return Ei(this).formatHsl()}function jo(){return this.rgb().formatRgb()}function Ye(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fu.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Vo(t):n===3?new ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$t(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$t(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hu.exec(e))?new ae(t[1],t[2],t[3],1):(t=gu.exec(e))?new ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pu.exec(e))?$t(t[1],t[2],t[3],t[4]):(t=mu.exec(e))?$t(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yu.exec(e))?Yo(t[1],t[2]/100,t[3]/100,1):(t=wu.exec(e))?Yo(t[1],t[2]/100,t[3]/100,t[4]):zo.hasOwnProperty(e)?Vo(zo[e]):e==="transparent"?new ae(NaN,NaN,NaN,0):null}function Vo(e){return new ae(e>>16&255,e>>8&255,e&255,1)}function $t(e,t,n,o){return o<=0&&(e=t=n=NaN),new ae(e,t,n,o)}function bu(e){return e instanceof kt||(e=Ye(e)),e?(e=e.rgb(),new ae(e.r,e.g,e.b,e.opacity)):new ae}function Fn(e,t,n,o){return arguments.length===1?bu(e):new ae(e,t,n,o??1)}function ae(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}ro(ae,Fn,bi(kt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?yt:Math.pow(yt,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ae(Be(this.r),Be(this.g),Be(this.b),Gt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bo,formatHex:Bo,formatHex8:Eu,formatRgb:Fo,toString:Fo}));function Bo(){return`#${Ve(this.r)}${Ve(this.g)}${Ve(this.b)}`}function Eu(){return`#${Ve(this.r)}${Ve(this.g)}${Ve(this.b)}${Ve((isNaN(this.opacity)?1:this.opacity)*255)}`}function Fo(){const e=Gt(this.opacity);return`${e===1?"rgb(":"rgba("}${Be(this.r)}, ${Be(this.g)}, ${Be(this.b)}${e===1?")":`, ${e})`}`}function Gt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Be(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ve(e){return e=Be(e),(e<16?"0":"")+e.toString(16)}function Yo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,n,o)}function Ei(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof kt||(e=Ye(e)),!e)return new fe;if(e instanceof fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new fe(s,a,l,e.opacity)}function _u(e,t,n,o){return arguments.length===1?Ei(e):new fe(e,t,n,o??1)}function fe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}ro(fe,_u,bi(kt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?yt:Math.pow(yt,e),new fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new ae(kn(e>=240?e-240:e+120,r,o),kn(e,r,o),kn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new fe(Xo(this.h),Dt(this.s),Dt(this.l),Gt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Gt(this.opacity);return`${e===1?"hsl(":"hsla("}${Xo(this.h)}, ${Dt(this.s)*100}%, ${Dt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xo(e){return e=(e||0)%360,e<0?e+360:e}function Dt(e){return Math.max(0,Math.min(1,e||0))}function kn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const io=e=>()=>e;function Nu(e,t){return function(n){return e+n*t}}function Su(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Cu(e){return(e=+e)==1?_i:function(t,n){return n-t?Su(t,n,e):io(isNaN(t)?n:t)}}function _i(e,t){var n=t-e;return n?Nu(e,n):io(isNaN(e)?t:e)}const Ut=(function e(t){var n=Cu(t);function o(r,i){var s=n((r=Fn(r)).r,(i=Fn(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=_i(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=e,o})(1);function ku(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function Mu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Iu(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=et(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function Ou(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function be(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pu(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=et(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Yn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mn=new RegExp(Yn.source,"g");function Au(e){return function(){return e}}function Tu(e){return function(t){return e(t)+""}}function Ni(e,t){var n=Yn.lastIndex=Mn.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Yn.exec(e))&&(r=Mn.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:be(o,r)})),n=Mn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Tu(l[0].x):Au(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function et(e,t){var n=typeof t,o;return t==null||n==="boolean"?io(t):(n==="number"?be:n==="string"?(o=Ye(t))?(t=o,Ut):Ni:t instanceof Ye?Ut:t instanceof Date?Ou:Mu(t)?ku:Array.isArray(t)?Iu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Pu:be)(e,t)}function Km(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Zo=180/Math.PI,Xn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Si(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Zo,skewX:Math.atan(l)*Zo,scaleX:s,scaleY:a}}var Rt;function $u(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Xn:Si(t.a,t.b,t.c,t.d,t.e,t.f)}function Du(e){return e==null||(Rt||(Rt=document.createElementNS("http://www.w3.org/2000/svg","g")),Rt.setAttribute("transform",e),!(e=Rt.transform.baseVal.consolidate()))?Xn:(e=e.matrix,Si(e.a,e.b,e.c,e.d,e.e,e.f))}function Ci(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,h,g){if(c!==d||u!==f){var v=h.push("translate(",null,t,null,n);g.push({i:v-4,x:be(c,d)},{i:v-2,x:be(u,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:be(c,u)})):u&&d.push(r(d)+"rotate("+u+o)}function a(c,u,d,f){c!==u?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:be(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,h,g){if(c!==d||u!==f){var v=h.push(r(h)+"scale(",null,",",null,")");g.push({i:v-4,x:be(c,d)},{i:v-2,x:be(u,f)})}else(d!==1||f!==1)&&h.push(r(h)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,f),s(c.rotate,u.rotate,d,f),a(c.skewX,u.skewX,d,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(h){for(var g=-1,v=f.length,x;++g<v;)d[(x=f[g]).i]=x.x(h);return d.join("")}}}var Ru=Ci($u,"px, ","px)","deg)"),Lu=Ci(Du,", ",")",")"),zu=1e-12;function Wo(e){return((e=Math.exp(e))+1/e)/2}function Hu(e){return((e=Math.exp(e))-1/e)/2}function ju(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ft=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],d=s[1],f=s[2],h=u-a,g=d-l,v=h*h+g*g,x,m;if(v<zu)m=Math.log(f/c)/t,x=function(k){return[a+k*h,l+k*g,c*Math.exp(t*k*m)]};else{var b=Math.sqrt(v),p=(f*f-c*c+o*v)/(2*c*n*b),y=(f*f-c*c-o*v)/(2*f*n*b),_=Math.log(Math.sqrt(p*p+1)-p),N=Math.log(Math.sqrt(y*y+1)-y);m=(N-_)/t,x=function(k){var C=k*m,M=Wo(_),z=c/(n*b)*(M*ju(t*C+_)-Hu(_));return[a+z*h,l+z*g,c*M/Wo(t*C+_)]}}return x.duration=m*1e3*t/Math.SQRT2,x}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);function Qm(e,t){t===void 0&&(t=e,e=et);for(var n=0,o=t.length-1,r=t[0],i=new Array(o<0?0:o);n<o;)i[n]=e(r,r=t[++n]);return function(s){var a=Math.max(0,Math.min(o-1,Math.floor(s*=o)));return i[a](s-a)}}var nt=0,ft=0,ut=0,ki=1e3,Kt,ht,Qt=0,Xe=0,dn=0,xt=typeof performance=="object"&&performance.now?performance:Date,Mi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function so(){return Xe||(Mi(Vu),Xe=xt.now()+dn)}function Vu(){Xe=0}function Jt(){this._call=this._time=this._next=null}Jt.prototype=Ii.prototype={constructor:Jt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?so():+n)+(t==null?0:+t),!this._next&&ht!==this&&(ht?ht._next=this:Kt=this,ht=this),this._call=e,this._time=n,Zn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zn())}};function Ii(e,t,n){var o=new Jt;return o.restart(e,t,n),o}function Bu(){so(),++nt;for(var e=Kt,t;e;)(t=Xe-e._time)>=0&&e._call.call(void 0,t),e=e._next;--nt}function qo(){Xe=(Qt=xt.now())+dn,nt=ft=0;try{Bu()}finally{nt=0,Yu(),Xe=0}}function Fu(){var e=xt.now(),t=e-Qt;t>ki&&(dn-=t,Qt=e)}function Yu(){for(var e,t=Kt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Kt=n);ht=e,Zn(o)}function Zn(e){if(!nt){ft&&(ft=clearTimeout(ft));var t=e-Xe;t>24?(e<1/0&&(ft=setTimeout(qo,e-xt.now()-dn)),ut&&(ut=clearInterval(ut))):(ut||(Qt=xt.now(),ut=setInterval(Fu,ki)),nt=1,Mi(qo))}}function Go(e,t,n){var o=new Jt;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Xu=ln("start","end","cancel","interrupt"),Zu=[],Oi=0,Uo=1,Wn=2,Yt=3,Ko=4,qn=5,Xt=6;function fn(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Wu(e,n,{name:t,index:o,group:r,on:Xu,tween:Zu,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Oi})}function ao(e,t){var n=me(e,t);if(n.state>Oi)throw new Error("too late; already scheduled");return n}function Ne(e,t){var n=me(e,t);if(n.state>Yt)throw new Error("too late; already running");return n}function me(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Wu(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Ii(i,0,n.time);function i(c){n.state=Uo,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,h;if(n.state!==Uo)return l();for(u in o)if(h=o[u],h.name===n.name){if(h.state===Yt)return Go(s);h.state===Ko?(h.state=Xt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[u]):+u<t&&(h.state=Xt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[u])}if(Go(function(){n.state===Yt&&(n.state=Ko,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Wn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Wn){for(n.state=Yt,r=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=h);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=qn,1),d=-1,f=r.length;++d<f;)r[d].call(e,u);n.state===qn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Xt,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function Zt(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>Wn&&o.state<qn,o.state=Xt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function qu(e){return this.each(function(){Zt(this,e)})}function Gu(e,t){var n,o;return function(){var r=Ne(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Uu(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Ne(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function Ku(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=me(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?Gu:Uu)(n,e,t))}function co(e,t,n){var o=e._id;return e.each(function(){var r=Ne(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return me(r,o).value[t]}}function Pi(e,t){var n;return(typeof t=="number"?be:t instanceof Ye?Ut:(n=Ye(t))?(t=n,Ut):Ni)(e,t)}function Qu(e){return function(){this.removeAttribute(e)}}function Ju(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ed(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function td(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function nd(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function od(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function rd(e,t){var n=un(e),o=n==="transform"?Lu:Pi;return this.attrTween(e,typeof t=="function"?(n.local?od:nd)(n,o,co(this,"attr."+e,t)):t==null?(n.local?Ju:Qu)(n):(n.local?td:ed)(n,o,t))}function id(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function sd(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ad(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&sd(e,i)),n}return r._value=t,r}function cd(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&id(e,i)),n}return r._value=t,r}function ld(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=un(e);return this.tween(n,(o.local?ad:cd)(o,t))}function ud(e,t){return function(){ao(this,e).delay=+t.apply(this,arguments)}}function dd(e,t){return t=+t,function(){ao(this,e).delay=t}}function fd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ud:dd)(t,e)):me(this.node(),t).delay}function hd(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}function gd(e,t){return t=+t,function(){Ne(this,e).duration=t}}function pd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hd:gd)(t,e)):me(this.node(),t).duration}function md(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}function yd(e){var t=this._id;return arguments.length?this.each(md(t,e)):me(this.node(),t).ease}function wd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}function xd(e){if(typeof e!="function")throw new Error;return this.each(wd(this._id,e))}function vd(e){typeof e!="function"&&(e=ci(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Pe(o,this._parents,this._name,this._id)}function bd(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,d=s[a]=new Array(u),f,h=0;h<u;++h)(f=l[h]||c[h])&&(d[h]=f);for(;a<o;++a)s[a]=t[a];return new Pe(s,this._parents,this._name,this._id)}function Ed(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function _d(e,t,n){var o,r,i=Ed(t)?ao:Ne;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function Nd(e,t){var n=this._id;return arguments.length<2?me(this.node(),n).on.on(e):this.each(_d(n,e,t))}function Sd(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Cd(){return this.on("end.remove",Sd(this._id))}function kd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=no(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,d,f=0;f<l;++f)(u=a[f])&&(d=e.call(u,u.__data__,f,a))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,fn(c[f],t,n,f,c,me(u,n)));return new Pe(i,this._parents,t,n)}function Md(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ai(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var f=e.call(u,u.__data__,d,l),h,g=me(u,n),v=0,x=f.length;v<x;++v)(h=f[v])&&fn(h,t,n,v,f,g);i.push(f),s.push(u)}return new Pe(i,s,t,n)}var Id=Ct.prototype.constructor;function Od(){return new Id(this._groups,this._parents)}function Pd(e,t){var n,o,r;return function(){var i=tt(this,e),s=(this.style.removeProperty(e),tt(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Ai(e){return function(){this.style.removeProperty(e)}}function Ad(e,t,n){var o,r=n+"",i;return function(){var s=tt(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function Td(e,t,n){var o,r,i;return function(){var s=tt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),tt(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function $d(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=Ne(this,e),c=l.on,u=l.value[i]==null?a||(a=Ai(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function Dd(e,t,n){var o=(e+="")=="transform"?Ru:Pi;return t==null?this.styleTween(e,Pd(e,o)).on("end.style."+e,Ai(e)):typeof t=="function"?this.styleTween(e,Td(e,o,co(this,"style."+e,t))).each($d(this._id,e)):this.styleTween(e,Ad(e,o,t),n).on("end.style."+e,null)}function Rd(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Ld(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Rd(e,s,n)),o}return i._value=t,i}function zd(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Ld(e,t,n??""))}function Hd(e){return function(){this.textContent=e}}function jd(e){return function(){var t=e(this);this.textContent=t??""}}function Vd(e){return this.tween("text",typeof e=="function"?jd(co(this,"text",e)):Hd(e==null?"":e+""))}function Bd(e){return function(t){this.textContent=e.call(this,t)}}function Fd(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Bd(r)),t}return o._value=e,o}function Yd(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Fd(e))}function Xd(){for(var e=this._name,t=this._id,n=Ti(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=me(l,t);fn(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Pe(o,this._parents,e,n)}function Zd(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=Ne(this,o),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var Wd=0;function Pe(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Ti(){return++Wd}var Ie=Ct.prototype;Pe.prototype={constructor:Pe,select:kd,selectAll:Md,selectChild:Ie.selectChild,selectChildren:Ie.selectChildren,filter:vd,merge:bd,selection:Od,transition:Xd,call:Ie.call,nodes:Ie.nodes,node:Ie.node,size:Ie.size,empty:Ie.empty,each:Ie.each,on:Nd,attr:rd,attrTween:ld,style:Dd,styleTween:zd,text:Vd,textTween:Yd,remove:Cd,tween:Ku,delay:fd,duration:pd,ease:yd,easeVarying:xd,end:Zd,[Symbol.iterator]:Ie[Symbol.iterator]};function qd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Gd={time:null,delay:0,duration:250,ease:qd};function Ud(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Kd(e){var t,n;e instanceof Pe?(t=e._id,e=e._name):(t=Ti(),(n=Gd).time=so(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&fn(l,e,t,c,s,n||Ud(l,t));return new Pe(o,this._parents,e,t)}Ct.prototype.interrupt=qu;Ct.prototype.transition=Kd;const Lt=e=>()=>e;function Qd(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Oe(e,t,n){this.k=e,this.x=t,this.y=n}Oe.prototype={constructor:Oe,scale:function(e){return e===1?this:new Oe(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Oe(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hn=new Oe(1,0,0);$i.prototype=Oe.prototype;function $i(e){for(;!e.__zoom;)if(!(e=e.parentNode))return hn;return e.__zoom}function In(e){e.stopImmediatePropagation()}function dt(e){e.preventDefault(),e.stopImmediatePropagation()}function Jd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ef(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Qo(){return this.__zoom||hn}function tf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nf(){return navigator.maxTouchPoints||"ontouchstart"in this}function of(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Di(){var e=Jd,t=ef,n=of,o=tf,r=nf,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ft,c=ln("start","zoom","end"),u,d,f,h=500,g=150,v=0,x=10;function m(w){w.property("__zoom",Qo).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",z).filter(r).on("touchstart.zoom",O).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(w,E,S,I){var T=w.selection?w.selection():w;T.property("__zoom",Qo),w!==T?_(w,E,S,I):T.interrupt().each(function(){N(this,arguments).event(I).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},m.scaleBy=function(w,E,S,I){m.scaleTo(w,function(){var T=this.__zoom.k,$=typeof E=="function"?E.apply(this,arguments):E;return T*$},S,I)},m.scaleTo=function(w,E,S,I){m.transform(w,function(){var T=t.apply(this,arguments),$=this.__zoom,H=S==null?y(T):typeof S=="function"?S.apply(this,arguments):S,V=$.invert(H),j=typeof E=="function"?E.apply(this,arguments):E;return n(p(b($,j),H,V),T,s)},S,I)},m.translateBy=function(w,E,S,I){m.transform(w,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof S=="function"?S.apply(this,arguments):S),t.apply(this,arguments),s)},null,I)},m.translateTo=function(w,E,S,I,T){m.transform(w,function(){var $=t.apply(this,arguments),H=this.__zoom,V=I==null?y($):typeof I=="function"?I.apply(this,arguments):I;return n(hn.translate(V[0],V[1]).scale(H.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof S=="function"?-S.apply(this,arguments):-S),$,s)},I,T)};function b(w,E){return E=Math.max(i[0],Math.min(i[1],E)),E===w.k?w:new Oe(E,w.x,w.y)}function p(w,E,S){var I=E[0]-S[0]*w.k,T=E[1]-S[1]*w.k;return I===w.x&&T===w.y?w:new Oe(w.k,I,T)}function y(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function _(w,E,S,I){w.on("start.zoom",function(){N(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(I).end()}).tween("zoom",function(){var T=this,$=arguments,H=N(T,$).event(I),V=t.apply(T,$),j=S==null?y(V):typeof S=="function"?S.apply(T,$):S,Y=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),B=T.__zoom,q=typeof E=="function"?E.apply(T,$):E,Q=l(B.invert(j).concat(Y/B.k),q.invert(j).concat(Y/q.k));return function(W){if(W===1)W=q;else{var L=Q(W),F=Y/L[2];W=new Oe(F,j[0]-L[0]*F,j[1]-L[1]*F)}H.zoom(null,W)}})}function N(w,E,S){return!S&&w.__zooming||new k(w,E)}function k(w,E){this.that=w,this.args=E,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,E),this.taps=0}k.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,E){return this.mouse&&w!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var E=ce(this.that).datum();c.call(w,this.that,new Qd(w,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),E)}};function C(w,...E){if(!e.apply(this,arguments))return;var S=N(this,E).event(w),I=this.__zoom,T=Math.max(i[0],Math.min(i[1],I.k*Math.pow(2,o.apply(this,arguments)))),$=de(w);if(S.wheel)(S.mouse[0][0]!==$[0]||S.mouse[0][1]!==$[1])&&(S.mouse[1]=I.invert(S.mouse[0]=$)),clearTimeout(S.wheel);else{if(I.k===T)return;S.mouse=[$,I.invert($)],Zt(this),S.start()}dt(w),S.wheel=setTimeout(H,g),S.zoom("mouse",n(p(b(I,T),S.mouse[0],S.mouse[1]),S.extent,s));function H(){S.wheel=null,S.end()}}function M(w,...E){if(f||!e.apply(this,arguments))return;var S=w.currentTarget,I=N(this,E,!0).event(w),T=ce(w.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",Y,!0),$=de(w,S),H=w.clientX,V=w.clientY;wi(w.view),In(w),I.mouse=[$,this.__zoom.invert($)],Zt(this),I.start();function j(B){if(dt(B),!I.moved){var q=B.clientX-H,Q=B.clientY-V;I.moved=q*q+Q*Q>v}I.event(B).zoom("mouse",n(p(I.that.__zoom,I.mouse[0]=de(B,S),I.mouse[1]),I.extent,s))}function Y(B){T.on("mousemove.zoom mouseup.zoom",null),xi(B.view,I.moved),dt(B),I.event(B).end()}}function z(w,...E){if(e.apply(this,arguments)){var S=this.__zoom,I=de(w.changedTouches?w.changedTouches[0]:w,this),T=S.invert(I),$=S.k*(w.shiftKey?.5:2),H=n(p(b(S,$),I,T),t.apply(this,E),s);dt(w),a>0?ce(this).transition().duration(a).call(_,H,I,w):ce(this).call(m.transform,H,I,w)}}function O(w,...E){if(e.apply(this,arguments)){var S=w.touches,I=S.length,T=N(this,E,w.changedTouches.length===I).event(w),$,H,V,j;for(In(w),H=0;H<I;++H)V=S[H],j=de(V,this),j=[j,this.__zoom.invert(j),V.identifier],T.touch0?!T.touch1&&T.touch0[2]!==j[2]&&(T.touch1=j,T.taps=0):(T.touch0=j,$=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),$&&(T.taps<2&&(d=j[0],u=setTimeout(function(){u=null},h)),Zt(this),T.start())}}function D(w,...E){if(this.__zooming){var S=N(this,E).event(w),I=w.changedTouches,T=I.length,$,H,V,j;for(dt(w),$=0;$<T;++$)H=I[$],V=de(H,this),S.touch0&&S.touch0[2]===H.identifier?S.touch0[0]=V:S.touch1&&S.touch1[2]===H.identifier&&(S.touch1[0]=V);if(H=S.that.__zoom,S.touch1){var Y=S.touch0[0],B=S.touch0[1],q=S.touch1[0],Q=S.touch1[1],W=(W=q[0]-Y[0])*W+(W=q[1]-Y[1])*W,L=(L=Q[0]-B[0])*L+(L=Q[1]-B[1])*L;H=b(H,Math.sqrt(W/L)),V=[(Y[0]+q[0])/2,(Y[1]+q[1])/2],j=[(B[0]+Q[0])/2,(B[1]+Q[1])/2]}else if(S.touch0)V=S.touch0[0],j=S.touch0[1];else return;S.zoom("touch",n(p(H,V,j),S.extent,s))}}function A(w,...E){if(this.__zooming){var S=N(this,E).event(w),I=w.changedTouches,T=I.length,$,H;for(In(w),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),$=0;$<T;++$)H=I[$],S.touch0&&S.touch0[2]===H.identifier?delete S.touch0:S.touch1&&S.touch1[2]===H.identifier&&delete S.touch1;if(S.touch1&&!S.touch0&&(S.touch0=S.touch1,delete S.touch1),S.touch0)S.touch0[1]=this.__zoom.invert(S.touch0[0]);else if(S.end(),S.taps===2&&(H=de(H,this),Math.hypot(d[0]-H[0],d[1]-H[1])<x)){var V=ce(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return m.wheelDelta=function(w){return arguments.length?(o=typeof w=="function"?w:Lt(+w),m):o},m.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Lt(!!w),m):e},m.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Lt(!!w),m):r},m.extent=function(w){return arguments.length?(t=typeof w=="function"?w:Lt([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),m):t},m.scaleExtent=function(w){return arguments.length?(i[0]=+w[0],i[1]=+w[1],m):[i[0],i[1]]},m.translateExtent=function(w){return arguments.length?(s[0][0]=+w[0][0],s[1][0]=+w[1][0],s[0][1]=+w[0][1],s[1][1]=+w[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(w){return arguments.length?(n=w,m):n},m.duration=function(w){return arguments.length?(a=+w,m):a},m.interpolate=function(w){return arguments.length?(l=w,m):l},m.on=function(){var w=c.on.apply(c,arguments);return w===c?m:w},m.clickDistance=function(w){return arguments.length?(v=(w=+w)*w,m):Math.sqrt(v)},m.tapDistance=function(w){return arguments.length?(x=+w,m):x},m}const pe={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/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:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},vt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ri=["Enter"," ","Escape"],Li={"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:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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 ot;(function(e){e.Strict="strict",e.Loose="loose"})(ot||(ot={}));var Fe;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Fe||(Fe={}));var bt;(function(e){e.Partial="partial",e.Full="full"})(bt||(bt={}));const zi={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var De;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(De||(De={}));var en;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(en||(en={}));var Z;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Z||(Z={}));const Jo={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top};function Hi(e){return e===null?null:e?"valid":"invalid"}const ji=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,rf=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),lo=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Mt=(e,t=[0,0])=>{const{width:n,height:o}=ye(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},sf=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const o=e.reduce((r,i)=>{const s=typeof i=="string";let a=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(a=s?t.nodeLookup.get(i):lo(i)?i:t.nodeLookup.get(i.id)),a?(n=!0,gn(r,tn(a,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?pn(o):{x:0,y:0,width:0,height:0}},It=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=gn(n,tn(r)),o=!0)}),o?pn(n):{x:0,y:0,width:0,height:0}},uo=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a=(t.x-n)/r,l=(t.y-o)/r,c=t.width/r,u=t.height/r,d=[];for(const f of e.values()){const{measured:h,selectable:g=!0,hidden:v=!1}=f;if(s&&!g||v)continue;const x=h.width??f.width??f.initialWidth??0,m=h.height??f.height??f.initialHeight??0,{x:b,y:p}=f.internals.positionAbsolute,y=Yi(a,l,c,u,b,p,x,m),_=x*m,N=i&&y>0;(!f.internals.handleBounds||N||y>=_||f.dragging)&&d.push(f)}return d},af=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function cf(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let i;if(t?.includeHiddenNodes){const{width:s,height:a}=ye(r);i=s>0&&a>0}else i=!!(r.measured.width&&r.measured.height&&!r.hidden);i&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function lf({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return!0;const a=cf(e,s),l=It(a),c=ho(l,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function Vi({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let d=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",pe.error005());else{const{width:h,height:g}=ye(a);h&&g&&(d=[[l,c],[l+h,c+g]])}else a&&We(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const f=We(d)?Ze(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",pe.error015()),{position:{x:f.x-l+(s.measured.width??0)*u[0],y:f.y-c+(s.measured.height??0)*u[1]},positionAbsolute:f}}async function uf({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=i.has(f.id),g=!h&&f.parentId&&s.find(v=>v.id===f.parentId);(h||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=o.filter(f=>f.deletable!==!1),u=af(s,l);for(const f of l)a.has(f.id)&&!u.find(g=>g.id===f.id)&&u.push(f);if(!r)return{edges:u,nodes:s};const d=await r({nodes:s,edges:u});return typeof d=="boolean"?d?{edges:u,nodes:s}:{edges:[],nodes:[]}:d}const rt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ze=(e={x:0,y:0},t,n)=>({x:rt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:rt(e.y,t[0][1],t[1][1]-(n?.height??0))});function Bi(e,t,n){const{width:o,height:r}=ye(n),{x:i,y:s}=n.internals.positionAbsolute;return Ze(e,[[i,s],[i+o,s+r]],t)}const er=(e,t,n)=>e<t?rt(Math.abs(e-t),1,t)/t:e>n?-rt(Math.abs(e-n),1,t)/t:0,fo=(e,t,n=15,o=40)=>{const r=er(e.x,o,t.width-o)*n,i=er(e.y,o,t.height-o)*n;return[r,i]},gn=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Gn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),pn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),Et=(e,t=[0,0])=>{const{x:n,y:o}=lo(e)?e.internals.positionAbsolute:Mt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},tn=(e,t=[0,0])=>{const{x:n,y:o}=lo(e)?e.internals.positionAbsolute:Mt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Fi=(e,t)=>pn(gn(Gn(e),Gn(t))),Yi=(e,t,n,o,r,i,s,a)=>{const l=Math.max(0,Math.min(e+n,r+s)-Math.max(e,r)),c=Math.max(0,Math.min(t+o,i+a)-Math.max(t,i));return Math.ceil(l*c)},nn=(e,t)=>Yi(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),tr=e=>he(e.width)&&he(e.height)&&he(e.x)&&he(e.y),he=e=>!isNaN(e)&&isFinite(e),Xi=(e,t)=>(n,o)=>{},Ot=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Pt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?Ot(a,s):a},it=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Ue(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function df(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Ue(e,n),r=Ue(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Ue(e.top??e.y??0,n),r=Ue(e.bottom??e.y??0,n),i=Ue(e.left??e.x??0,t),s=Ue(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ff(e,t,n,o,r,i){const{x:s,y:a}=it(e,[t,n,o]),{x:l,y:c}=it({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,d=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(d)}}const ho=(e,t,n,o,r,i)=>{const s=df(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=rt(c,o,r),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*u,g=n/2-f*u,v=ff(e,h,g,u,t,n),x={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:h-x.left+x.right,y:g-x.top+x.bottom,zoom:u}},_t=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function We(e){return e!=null&&e!=="parent"}function ye(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Zi(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Wi(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function nr(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function hf(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function gf(e){return{...Li,...e||{}}}function pt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=ge(e),a=Pt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?Ot(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const go=e=>({width:e.offsetWidth,height:e.offsetHeight}),qi=e=>e?.getRootNode?.()||window?.document,pf=["INPUT","SELECT","TEXTAREA"];function Gi(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:pf.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ui=e=>"clientX"in e,ge=(e,t)=>{const n=Ui(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},or=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...go(s)}})};function Ki({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,u=Math.abs(l-e),d=Math.abs(c-t);return[l,c,u,d]}function zt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function rr({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case Z.Left:return[t-zt(t-o,i),n];case Z.Right:return[t+zt(o-t,i),n];case Z.Top:return[t,n-zt(n-r,i)];case Z.Bottom:return[t,n+zt(r-n,i)]}}function Qi({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:o,targetY:r,targetPosition:i=Z.Top,curvature:s=.25}){const[a,l]=rr({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,u]=rr({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[d,f,h,g]=Ki({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${o},${r}`,d,f,h,g]}function Ji({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function mf({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function yf({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=gn(tn(e),tn(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return nn(s,pn(i))>0}const wf=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,xf=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),vf=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",pe.error006()),t;const o=n.getEdgeId||wf;let r;return ji(e)?r={...e}:r={...e,id:o(e)},xf(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function es({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Ji({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const ir={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},bf=({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},sr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Ef({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:o=Z.Top,center:r,offset:i,stepPosition:s}){const a=ir[t],l=ir[o],c={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},d=bf({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",h=d[f];let g=[],v,x;const m={x:0,y:0},b={x:0,y:0},[,,p,y]=Ji({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(v=r.x??c.x+(u.x-c.x)*s,x=r.y??(c.y+u.y)/2):(v=r.x??(c.x+u.x)/2,x=r.y??c.y+(u.y-c.y)*s);const C=[{x:v,y:c.y},{x:v,y:u.y}],M=[{x:c.x,y:x},{x:u.x,y:x}];a[f]===h?g=f==="x"?C:M:g=f==="x"?M:C}else{const C=[{x:c.x,y:u.y}],M=[{x:u.x,y:c.y}];if(f==="x"?g=a.x===h?M:C:g=a.y===h?C:M,t===o){const w=Math.abs(e[f]-n[f]);if(w<=i){const E=Math.min(i-1,i-w);a[f]===h?m[f]=(c[f]>e[f]?-1:1)*E:b[f]=(u[f]>n[f]?-1:1)*E}}if(t!==o){const w=f==="x"?"y":"x",E=a[f]===l[w],S=c[w]>u[w],I=c[w]<u[w];(a[f]===1&&(!E&&S||E&&I)||a[f]!==1&&(!E&&I||E&&S))&&(g=f==="x"?C:M)}const z={x:c.x+m.x,y:c.y+m.y},O={x:u.x+b.x,y:u.y+b.y},D=Math.max(Math.abs(z.x-g[0].x),Math.abs(O.x-g[0].x)),A=Math.max(Math.abs(z.y-g[0].y),Math.abs(O.y-g[0].y));D>=A?(v=(z.x+O.x)/2,x=g[0].y):(v=g[0].x,x=(z.y+O.y)/2)}const _={x:c.x+m.x,y:c.y+m.y},N={x:u.x+b.x,y:u.y+b.y};return[[e,..._.x!==g[0].x||_.y!==g[0].y?[_]:[],...g,...N.x!==g[g.length-1].x||N.y!==g[g.length-1].y?[N]:[],n],v,x,p,y]}function _f(e,t,n,o){const r=Math.min(sr(e,t)/2,sr(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function Un({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:o,targetY:r,targetPosition:i=Z.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,h,g,v]=Ef({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:u});let x=`M${d[0].x} ${d[0].y}`;for(let m=1;m<d.length-1;m++)x+=_f(d[m-1],d[m],d[m+1],s);return x+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[x,f,h,g,v]}function ar(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Nf(e){const{sourceNode:t,targetNode:n}=e;if(!ar(t)||!ar(n))return null;const o=t.internals.handleBounds||cr(t.handles),r=n.internals.handleBounds||cr(n.handles),i=lr(o?.source??[],e.sourceHandle),s=lr(e.connectionMode===ot.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",pe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Z.Bottom,l=s?.position||Z.Top,c=qe(t,i,a),u=qe(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function cr(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function qe(e,t,n=Z.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??ye(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case Z.Top:return{x:r+s/2,y:i};case Z.Right:return{x:r+s,y:i+a/2};case Z.Bottom:return{x:r+s/2,y:i+a};case Z.Left:return{x:r,y:i+a/2}}}function lr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Kn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function Sf(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const c=Kn(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const ts=1e3,Cf=10,po={nodeOrigin:[0,0],nodeExtent:vt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},kf={...po,checkEquality:!0};function mo(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function Mf(e,t,n){const o=mo(po,n);for(const r of e.values())if(r.parentId)wo(r,e,t,o);else{const i=Mt(r,o.nodeOrigin),s=We(r.extent)?r.extent:o.nodeExtent,a=Ze(i,s,ye(r));r.internals.positionAbsolute=a}}function If(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function yo(e){return e==="manual"}function Qn(e,t,n,o={}){const r=mo(kf,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!yo(r.zIndexMode)?ts:0;let l=e.length>0,c=!1;t.clear(),n.clear();for(const u of e){let d=s.get(u.id);if(r.checkEquality&&u===d?.internals.userNode)t.set(u.id,d);else{const f=Mt(u,r.nodeOrigin),h=We(u.extent)?u.extent:r.nodeExtent,g=Ze(f,h,ye(u));d={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:g,handleBounds:If(u,d),z:ns(u,a,r.zIndexMode),userNode:u}},t.set(u.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(l=!1),u.parentId&&wo(d,t,n,o,i),c||=u.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function Of(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function wo(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=mo(po,o),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Of(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*Cf),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const d=i&&!yo(l)?ts:0,{x:f,y:h,z:g}=Pf(e,u,s,a,d,l),{positionAbsolute:v}=e.internals,x=f!==v.x||h!==v.y;(x||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:h}:v,z:g}})}function ns(e,t,n){const o=he(e.zIndex)?e.zIndex:0;return yo(n)?o:o+(e.selected?t:0)}function Pf(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=ye(e),c=Mt(e,n),u=We(e.extent)?Ze(c,e.extent,l):c;let d=Ze({x:s+u.x,y:a+u.y},o,l);e.extent==="parent"&&(d=Bi(d,l,t));const f=ns(e,r,i),h=t.internals.z??0;return{x:d.x,y:d.y,z:h>=f?h+1:f}}function xo(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const l=i.get(s.parentId)?.expandedRect??Et(a),c=Fi(l,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},l)=>{const c=a.internals.positionAbsolute,u=ye(a),d=a.origin??o,f=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,h=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,g=Math.max(u.width,Math.round(s.width)),v=Math.max(u.height,Math.round(s.height)),x=(g-u.width)*d[0],m=(v-u.height)*d[1];(f>0||h>0||x||m)&&(r.push({id:l,type:"position",position:{x:a.position.x-f+x,y:a.position.y-h+m}}),n.get(l)?.forEach(b=>{e.some(p=>p.id===b.id)||r.push({id:b.id,type:"position",position:{x:b.position.x+f,y:b.position.y+h}})})),(u.width<s.width||u.height<s.height||f||h)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:g+(f?d[0]*f-x:0),height:v+(h?d[1]*h-m:0)}})}),r}function Af(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const h of e.values()){const g=t.get(h.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}const v=go(h.nodeElement),x=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!g.internals.handleBounds||h.force))){const b=h.nodeElement.getBoundingClientRect(),p=We(g.extent)?g.extent:i;let{positionAbsolute:y}=g.internals;if(g.parentId&&g.extent==="parent"){const N=t.get(g.parentId);N&&(y=Bi(y,v,N))}else p&&(y=Ze(y,p,v));const _={...g,measured:v,internals:{...g.internals,positionAbsolute:y,handleBounds:{source:or("source",h.nodeElement,b,d,g.id),target:or("target",h.nodeElement,b,d,g.id)}}};t.set(g.id,_),g.parentId&&wo(_,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,x&&(c.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:Et(_,r)}))}}if(f.length>0){const h=xo(f,t,n,r);c.push(...h)}return{changes:c,updatedInternals:l}}async function Tf({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function ur(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function os(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;ur("source",l,u,e,r,s),ur("target",l,c,e,i,a),t.set(o.id,o)}}function rs(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:rs(n,t):!1}function dr(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function $f(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!rs(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function On({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const l=n.get(s)?.internals.userNode;l&&r.push({...l,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function Df({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=Ot(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Rf({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,h=!1,g=!1,v=null;function x({noDragClassName:b,handleSelector:p,domNode:y,isSelectable:_,nodeId:N,nodeClickDistance:k=0}){f=ce(y);function C({x:D,y:A}){const{nodeLookup:w,nodeExtent:E,snapGrid:S,snapToGrid:I,nodeOrigin:T,onNodeDrag:$,onSelectionDrag:H,onError:V,updateNodePositions:j}=t();i={x:D,y:A};let Y=!1;const B=a.size>1,q=B&&E?Gn(It(a)):null,Q=B&&I?Df({dragItems:a,snapGrid:S,x:D,y:A}):null;for(const[W,L]of a){if(!w.has(W))continue;let F={x:D-L.distance.x,y:A-L.distance.y};I&&(F=Q?{x:Math.round(F.x+Q.x),y:Math.round(F.y+Q.y)}:Ot(F,S));let K=null;if(B&&E&&!L.extent&&q){const{positionAbsolute:G}=L.internals,J=G.x-q.x+E[0][0],te=G.x+L.measured.width-q.x2+E[1][0],oe=G.y-q.y+E[0][1],se=G.y+L.measured.height-q.y2+E[1][1];K=[[J,oe],[te,se]]}const{position:U,positionAbsolute:X}=Vi({nodeId:W,nextPosition:F,nodeLookup:w,nodeExtent:K||E,nodeOrigin:T,onError:V});Y=Y||L.position.x!==U.x||L.position.y!==U.y,L.position=U,L.internals.positionAbsolute=X}if(g=g||Y,!!Y&&(j(a,!0),v&&(o||$||!N&&H))){const[W,L]=On({nodeId:N,dragItems:a,nodeLookup:w});o?.(v,a,W,L),$?.(v,W,L),N||H?.(v,L)}}async function M(){if(!u)return;const{transform:D,panBy:A,autoPanSpeed:w,autoPanOnNodeDrag:E}=t();if(!E){l=!1,cancelAnimationFrame(s);return}const[S,I]=fo(c,u,w);(S!==0||I!==0)&&(i.x=(i.x??0)-S/D[2],i.y=(i.y??0)-I/D[2],await A({x:S,y:I})&&C(i)),s=requestAnimationFrame(M)}function z(D){const{nodeLookup:A,multiSelectionActive:w,nodesDraggable:E,transform:S,snapGrid:I,snapToGrid:T,selectNodesOnDrag:$,onNodeDragStart:H,onSelectionDragStart:V,unselectNodesAndEdges:j}=t();d=!0,(!$||!_)&&!w&&N&&(A.get(N)?.selected||j()),_&&$&&N&&e?.(N);const Y=pt(D.sourceEvent,{transform:S,snapGrid:I,snapToGrid:T,containerBounds:u});if(i=Y,a=$f(A,E,Y,N),a.size>0&&(n||H||!N&&V)){const[B,q]=On({nodeId:N,dragItems:a,nodeLookup:A});n?.(D.sourceEvent,a,B,q),H?.(D.sourceEvent,B,q),N||V?.(D.sourceEvent,q)}}const O=vi().clickDistance(k).on("start",D=>{const{domNode:A,nodeDragThreshold:w,transform:E,snapGrid:S,snapToGrid:I}=t();u=A?.getBoundingClientRect()||null,h=!1,g=!1,v=D.sourceEvent,w===0&&z(D),i=pt(D.sourceEvent,{transform:E,snapGrid:S,snapToGrid:I,containerBounds:u}),c=ge(D.sourceEvent,u)}).on("drag",D=>{const{autoPanOnNodeDrag:A,transform:w,snapGrid:E,snapToGrid:S,nodeDragThreshold:I,nodeLookup:T}=t(),$=pt(D.sourceEvent,{transform:w,snapGrid:E,snapToGrid:S,containerBounds:u});if(v=D.sourceEvent,(D.sourceEvent.type==="touchmove"&&D.sourceEvent.touches.length>1||N&&!T.has(N))&&(h=!0),!h){if(!l&&A&&d&&(l=!0,M()),!d){const H=ge(D.sourceEvent,u),V=H.x-c.x,j=H.y-c.y;Math.sqrt(V*V+j*j)>I&&z(D)}(i.x!==$.xSnapped||i.y!==$.ySnapped)&&a&&d&&(c=ge(D.sourceEvent,u),C($))}}).on("end",D=>{if(!d||h){h&&a.size>0&&t().updateNodePositions(a,!1);return}if(l=!1,d=!1,cancelAnimationFrame(s),a.size>0){const{nodeLookup:A,updateNodePositions:w,onNodeDragStop:E,onSelectionDragStop:S}=t();if(g&&(w(a,!1),g=!1),r||E||!N&&S){const[I,T]=On({nodeId:N,dragItems:a,nodeLookup:A,dragging:!1});r?.(D.sourceEvent,a,I,T),E?.(D.sourceEvent,I,T),N||S?.(D.sourceEvent,T)}}}).filter(D=>{const A=D.target;return!D.button&&(!b||!dr(A,`.${b}`,y))&&(!p||dr(A,p,y))});f.call(O)}function m(){f?.on(".drag",null)}return{update:x,destroy:m}}function Lf(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())nn(r,Et(i))>0&&o.push(i);return o}const zf=250;function Hf(e,t,n,o){let r=[],i=1/0;const s=Lf(e,n,t+zf);for(const a of s){const l=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of l){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:u,y:d}=qe(a,c,c.position,!0),f=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(d-e.y,2));f>t||(f<i?(r=[{...c,x:u,y:d}],i=f):f===i&&r.push({...c,x:u,y:d}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(l=>l.type===a)??r[0]}return r[0]}function is(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(c=>c.id===n):a?.[0])??null;return l&&i?{...l,...qe(s,l,l.position,!0)}:l}function ss(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function jf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const as=()=>!0;function Vf(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:h,onConnectStart:g,onConnect:v,onConnectEnd:x,isValidConnection:m=as,onReconnectEnd:b,updateConnection:p,getTransform:y,getFromHandle:_,autoPanSpeed:N,dragThreshold:k=1,handleDomNode:C}){const M=qi(e.target);let z=0,O;const{x:D,y:A}=ge(e),w=ss(i,C),E=a?.getBoundingClientRect();let S=!1;if(!E||!w)return;const I=is(r,w,o,l,t);if(!I)return;let T=ge(e,E),$=!1,H=null,V=!1,j=null;function Y(){if(!u||!E)return;const[U,X]=fo(T,E,N);f({x:U,y:X}),z=requestAnimationFrame(Y)}const B={...I,nodeId:r,type:w,position:I.position},q=l.get(r);let W={inProgress:!0,isValid:null,from:qe(q,B,Z.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:q,to:T,toHandle:null,toPosition:Jo[B.position],toNode:null,pointer:T};function L(){S=!0,p(W),g?.(e,{nodeId:r,handleId:o,handleType:w})}k===0&&L();function F(U){if(!S){const{x:se,y:Se}=ge(U),xe=se-D,ve=Se-A;if(!(xe*xe+ve*ve>k*k))return;L()}if(!_()||!B){K(U);return}const X=y();T=ge(U,E),O=Hf(Pt(T,X,!1,[1,1]),n,l,B),$||(Y(),$=!0);const G=cs(U,{handle:O,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:m,doc:M,lib:c,flowId:d,nodeLookup:l});j=G.handleDomNode,H=G.connection,V=jf(!!O,G.isValid);const J=l.get(r),te=J?qe(J,B,Z.Left,!0):W.from,oe={...W,from:te,isValid:V,to:G.toHandle&&V?it({x:G.toHandle.x,y:G.toHandle.y},X):T,toHandle:G.toHandle,toPosition:V&&G.toHandle?G.toHandle.position:Jo[B.position],toNode:G.toHandle?l.get(G.toHandle.nodeId):null,pointer:T};p(oe),W=oe}function K(U){if(!("touches"in U&&U.touches.length>0)){if(S){(O||j)&&H&&V&&v?.(H);const{inProgress:X,...G}=W,J={...G,toPosition:W.toHandle?W.toPosition:null};x?.(U,J),i&&b?.(U,J)}h(),cancelAnimationFrame(z),$=!1,V=!1,H=null,j=null,M.removeEventListener("mousemove",F),M.removeEventListener("mouseup",K),M.removeEventListener("touchmove",F),M.removeEventListener("touchend",K)}}M.addEventListener("mousemove",F),M.addEventListener("mouseup",K),M.addEventListener("touchmove",F),M.addEventListener("touchend",K)}function cs(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=as,nodeLookup:u}){const d=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:g}=ge(e),v=s.elementFromPoint(h,g),x=v?.classList.contains(`${a}-flow__handle`)?v:f,m={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const b=ss(void 0,x),p=x.getAttribute("data-nodeid"),y=x.getAttribute("data-handleid"),_=x.classList.contains("connectable"),N=x.classList.contains("connectableend");if(!p||!b)return m;const k={source:d?p:o,sourceHandle:d?y:r,target:d?o:p,targetHandle:d?r:y};m.connection=k;const M=_&&N&&(n===ot.Strict?d&&b==="source"||!d&&b==="target":p!==o||y!==r);m.isValid=M&&c(k),m.toHandle=is(p,b,y,u,n,!0)}return m}const Jn={onPointerDown:Vf,isValid:cs};function Bf({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ce(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:d=!0,zoomable:f=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const y=n(),_=p.sourceEvent.ctrlKey&&_t()?10:1,N=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*u,k=y[2]*Math.pow(2,N*_);t.scaleTo(k)};let v=[0,0];const x=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(v=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},m=p=>{const y=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const _=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],N=[_[0]-v[0],_[1]-v[1]];v=_;const k=o()*Math.max(y[2],Math.log(y[2]))*(h?-1:1),C={x:y[0]-N[0]*k,y:y[1]-N[1]*k},M=[[0,0],[l,c]];t.setViewportConstrained({x:C.x,y:C.y,zoom:y[2]},M,a)},b=Di().on("start",x).on("zoom",d?m:null).on("zoom.wheel",f?g:null);r.call(b,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:de}}const mn=e=>({x:e.x,y:e.y,zoom:e.k}),Pn=({x:e,y:t,zoom:n})=>hn.translate(e,t).scale(n),$e=(e,t)=>e.target.closest(`.${t}`),ls=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ff=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,An=(e,t=0,n=Ff,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},us=e=>{const t=e.ctrlKey&&_t()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Yf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if($e(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=de(u),m=us(u),b=d*Math.pow(2,m);o.scaleTo(n,b,x,u);return}const f=u.deltaMode===1?20:1;let h=r===Fe.Vertical?0:u.deltaX*f,g=r===Fe.Horizontal?0:u.deltaY*f;!_t()&&u.shiftKey&&r!==Fe.Vertical&&(h=u.deltaY*f,g=0),o.translateBy(n,-(h/d)*i,-(g/d)*i,{internal:!0});const v=mn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(u,v):(e.isPanScrolling=!0,a?.(u,v)),e.panScrollTimeout=setTimeout(()=>{c?.(u,v),e.isPanScrolling=!1},150)}}function Xf({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=$e(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Zf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=mn(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function Wf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&ls(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,mn(i.transform))}}function qf({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&ls(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=mn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function Gf({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{const h=t||n,g=o&&f.ctrlKey,v=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&($e(f,`${u}-flow__node`)||$e(f,`${u}-flow__edge`)||$e(f,`${u}-flow__selection`)||$e(f,`${u}-flow__nodesselection`)))return!0;if(!r&&!h&&!i&&!s&&!o||a||d&&!v||$e(f,l)&&v||$e(f,c)&&(!v||i&&v&&!t)||!o&&f.ctrlKey&&v)return!1;if(!o&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!h&&!i&&!g&&v||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||v||e)&&x}}function Uf({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect();let d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<"u"?new ResizeObserver(A=>{const w=A[0];w&&(d=[[0,0],[w.contentRect.width,w.contentRect.height]])}):null)?.observe(e);const h=Di().extent(()=>d).scaleExtent([t,n]).translateExtent(o),g=ce(e).call(h);y({x:r.x,y:r.y,zoom:rt(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const v=g.on("wheel.zoom"),x=g.on("dblclick.zoom");h.wheelDelta(us);async function m(A,w){return g?new Promise(E=>{h?.interpolate(w?.interpolate==="linear"?et:Ft).transform(An(g,w?.duration,w?.ease,()=>E(!0)),A)}):!1}function b({noWheelClassName:A,noPanClassName:w,onPaneContextMenu:E,userSelectionActive:S,panOnScroll:I,panOnDrag:T,panOnScrollMode:$,panOnScrollSpeed:H,preventScrolling:V,zoomOnPinch:j,zoomOnScroll:Y,zoomOnDoubleClick:B,panActivationKeyPressed:q=!1,zoomActivationKeyPressed:Q,lib:W,onTransformChange:L,connectionInProgress:F,paneClickDistance:K,selectionOnDrag:U}){S&&!c.isZoomingOrPanning&&p();const X=I&&!Q&&!S;h.clickDistance(U?1/0:!he(K)||K<0?0:K);const G=X?Yf({zoomPanValues:c,noWheelClassName:A,d3Selection:g,d3Zoom:h,panOnScrollMode:$,panOnScrollSpeed:H,zoomOnPinch:j,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Xf({noWheelClassName:A,preventScrolling:V,d3ZoomHandler:v});g.on("wheel.zoom",G,{passive:!1});const J=Zf({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});h.on("start",J);const te=Wf({zoomPanValues:c,panOnDrag:T,onPaneContextMenu:!!E,onPanZoom:i,onTransformChange:L});h.on("zoom",te);const oe=qf({zoomPanValues:c,panOnDrag:T,panOnScroll:I,onPaneContextMenu:E,onPanZoomEnd:a,onDraggingChange:l});h.on("end",oe);const se=Gf({panActivationKeyPressed:q,zoomActivationKeyPressed:Q,panOnDrag:T,zoomOnScroll:Y,panOnScroll:I,zoomOnDoubleClick:B,zoomOnPinch:j,userSelectionActive:S,noPanClassName:w,noWheelClassName:A,lib:W,connectionInProgress:F});h.filter(se),B?g.on("dblclick.zoom",x):g.on("dblclick.zoom",null)}function p(){h.on("zoom",null)}async function y(A,w,E){const S=Pn(A),I=h?.constrain()(S,w,E);return I&&await m(I),I}async function _(A,w){const E=Pn(A);return await m(E,w),E}function N(A){if(g){const w=Pn(A),E=g.property("__zoom");(E.k!==A.zoom||E.x!==A.x||E.y!==A.y)&&h?.transform(g,w,null,{sync:!0})}}function k(){const A=g?$i(g.node()):{x:0,y:0,k:1};return{x:A.x,y:A.y,zoom:A.k}}async function C(A,w){return g?new Promise(E=>{h?.interpolate(w?.interpolate==="linear"?et:Ft).scaleTo(An(g,w?.duration,w?.ease,()=>E(!0)),A)}):!1}async function M(A,w){return g?new Promise(E=>{h?.interpolate(w?.interpolate==="linear"?et:Ft).scaleBy(An(g,w?.duration,w?.ease,()=>E(!0)),A)}):!1}function z(A){h?.scaleExtent(A)}function O(A){h?.translateExtent(A)}function D(A){const w=!he(A)||A<0?0:A;h?.clickDistance(w)}return{update:b,destroy:p,setViewport:_,setViewportConstrained:y,getViewport:k,scaleTo:C,scaleBy:M,setScaleExtent:z,setTranslateExtent:O,syncViewport:N,setClickDistance:D}}var st;(function(e){e.Line="line",e.Handle="handle"})(st||(st={}));function Kf({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function fr(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Ae(e,t){return Math.max(0,t-e)}function Te(e,t){return Math.max(0,e-t)}function Ht(e,t,n){return Math.max(0,t-e,e-n)}function hr(e,t){return e?!t:t}function Qf(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:h,ySnapped:g}=n,{minWidth:v,maxWidth:x,minHeight:m,maxHeight:b}=o,{x:p,y,width:_,height:N,aspectRatio:k}=e;let C=Math.floor(u?h-e.pointerX:0),M=Math.floor(d?g-e.pointerY:0);const z=_+(l?-C:C),O=N+(c?-M:M),D=-i[0]*_,A=-i[1]*N;let w=Ht(z,v,x),E=Ht(O,m,b);if(s){let T=0,$=0;l&&C<0?T=Ae(p+C+D,s[0][0]):!l&&C>0&&(T=Te(p+z+D,s[1][0])),c&&M<0?$=Ae(y+M+A,s[0][1]):!c&&M>0&&($=Te(y+O+A,s[1][1])),w=Math.max(w,T),E=Math.max(E,$)}if(a){let T=0,$=0;l&&C>0?T=Te(p+C,a[0][0]):!l&&C<0&&(T=Ae(p+z,a[1][0])),c&&M>0?$=Te(y+M,a[0][1]):!c&&M<0&&($=Ae(y+O,a[1][1])),w=Math.max(w,T),E=Math.max(E,$)}if(r){if(u){const T=Ht(z/k,m,b)*k;if(w=Math.max(w,T),s){let $=0;!l&&!c||l&&!c&&f?$=Te(y+A+z/k,s[1][1])*k:$=Ae(y+A+(l?C:-C)/k,s[0][1])*k,w=Math.max(w,$)}if(a){let $=0;!l&&!c||l&&!c&&f?$=Ae(y+z/k,a[1][1])*k:$=Te(y+(l?C:-C)/k,a[0][1])*k,w=Math.max(w,$)}}if(d){const T=Ht(O*k,v,x)/k;if(E=Math.max(E,T),s){let $=0;!l&&!c||c&&!l&&f?$=Te(p+O*k+D,s[1][0])/k:$=Ae(p+(c?M:-M)*k+D,s[0][0])/k,E=Math.max(E,$)}if(a){let $=0;!l&&!c||c&&!l&&f?$=Ae(p+O*k,a[1][0])/k:$=Te(p+(c?M:-M)*k,a[0][0])/k,E=Math.max(E,$)}}}M=M+(M<0?E:-E),C=C+(C<0?w:-w),r&&(f?z>O*k?M=(hr(l,c)?-C:C)/k:C=(hr(l,c)?-M:M)*k:u?(M=C/k,c=l):(C=M*k,l=c));const S=l?p+C:p,I=c?y+M:y;return{width:_+(l?-C:C),height:N+(c?-M:M),x:i[0]*C*(l?-1:1)+S,y:i[1]*M*(c?-1:1)+I}}const ds={width:0,height:0,x:0,y:0},Jf={...ds,pointerX:0,pointerY:0,aspectRatio:1};function eh(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[o-a,r-l],[o+i-a,r+s-l]]}function th({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ce(e);let s={controlDirection:fr("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:u,keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:v,shouldResize:x}){let m={...ds},b={...Jf};s={boundaries:u,resizeDirection:f,keepAspectRatio:d,controlDirection:fr(c)};let p,y=null,_=[],N,k,C,M=!1;const z=vi().on("start",O=>{const{nodeLookup:D,transform:A,snapGrid:w,snapToGrid:E,nodeOrigin:S,paneDomNode:I}=n();if(p=D.get(t),!p)return;y=I?.getBoundingClientRect()??null;const{xSnapped:T,ySnapped:$}=pt(O.sourceEvent,{transform:A,snapGrid:w,snapToGrid:E,containerBounds:y});m={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},b={...m,pointerX:T,pointerY:$,aspectRatio:m.width/m.height},N=void 0,k=We(p.extent)?p.extent:void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(N=D.get(p.parentId)),N&&p.extent==="parent"&&(k=[[0,0],[N.measured.width,N.measured.height]]),_=[],C=void 0;for(const[H,V]of D)if(V.parentId===t&&(_.push({id:H,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const j=eh(V,p,V.origin??S);C?C=[[Math.min(j[0][0],C[0][0]),Math.min(j[0][1],C[0][1])],[Math.max(j[1][0],C[1][0]),Math.max(j[1][1],C[1][1])]]:C=j}h?.(O,{...m})}).on("drag",O=>{const{transform:D,snapGrid:A,snapToGrid:w,nodeOrigin:E}=n(),S=pt(O.sourceEvent,{transform:D,snapGrid:A,snapToGrid:w,containerBounds:y}),I=[];if(!p)return;const{x:T,y:$,width:H,height:V}=m,j={},Y=p.origin??E,{width:B,height:q,x:Q,y:W}=Qf(b,s.controlDirection,S,s.boundaries,s.keepAspectRatio,Y,k,C),L=B!==H,F=q!==V,K=Q!==T&&L,U=W!==$&&F;if(!K&&!U&&!L&&!F)return;if((K||U||Y[0]===1||Y[1]===1)&&(j.x=K?Q:m.x,j.y=U?W:m.y,m.x=j.x,m.y=j.y,_.length>0)){const te=Q-T,oe=W-$;for(const se of _)se.position={x:se.position.x-te+Y[0]*(B-H),y:se.position.y-oe+Y[1]*(q-V)},I.push(se)}if((L||F)&&(j.width=L&&(!s.resizeDirection||s.resizeDirection==="horizontal")?B:m.width,j.height=F&&(!s.resizeDirection||s.resizeDirection==="vertical")?q:m.height,m.width=j.width,m.height=j.height),N&&p.expandParent){const te=Y[0]*(j.width??0);j.x&&j.x<te&&(m.x=te,b.x=b.x-(j.x-te));const oe=Y[1]*(j.height??0);j.y&&j.y<oe&&(m.y=oe,b.y=b.y-(j.y-oe))}const X=Kf({width:m.width,prevWidth:H,height:m.height,prevHeight:V,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...m,direction:X};x?.(O,G)!==!1&&(M=!0,g?.(O,G),o(j,I))}).on("end",O=>{M&&(v?.(O,{...m}),r?.({...m}),M=!1)});i.call(z)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}const nh={},gr=e=>{let t;const n=new Set,o=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,h))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(nh?"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."),n.clear()}},c=t=e(o,r,l);return l},oh=e=>e?gr(e):gr,{useDebugValue:rh}=_c,{useSyncExternalStoreWithSelector:ih}=Ec,sh=e=>e;function fs(e,t=sh,n){const o=ih(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return rh(o),o}const pr=(e,t)=>{const n=oh(e),o=(r,i=t)=>fs(n,r,i);return Object.assign(o,n),o},ah=(e,t)=>e?pr(e,t):pr;function re(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const yn=R.createContext(null),ch=yn.Provider,hs=pe.error001("react");function ee(e,t){const n=R.useContext(yn);if(n===null)throw new Error(hs);return fs(n,e,t)}function ne(){const e=R.useContext(yn);if(e===null)throw new Error(hs);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const mr={display:"none"},lh={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},gs="react-flow__node-desc",ps="react-flow__edge-desc",uh="react-flow__aria-live",dh=e=>e.ariaLiveMessage,fh=e=>e.ariaLabelConfig;function hh({rfId:e}){const t=ee(dh);return P.jsx("div",{id:`${uh}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:lh,children:t})}function gh({rfId:e,disableKeyboardA11y:t}){const n=ee(fh);return P.jsxs(P.Fragment,{children:[P.jsx("div",{id:`${gs}-${e}`,style:mr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),P.jsx("div",{id:`${ps}-${e}`,style:mr,children:n["edge.a11yDescription.default"]}),!t&&P.jsx(hh,{rfId:e})]})}const wn=R.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return P.jsx("div",{className:ie(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});wn.displayName="Panel";const yr="https://reactflow.dev?utm_source=attribution";function ph({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:P.jsx(wn,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${yr}`,children:P.jsx("a",{href:yr,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const mh=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},jt=e=>e.id;function yh(e,t){return re(e.selectedNodes.map(jt),t.selectedNodes.map(jt))&&re(e.selectedEdges.map(jt),t.selectedEdges.map(jt))}function wh({onSelectionChange:e}){const t=ne(),{selectedNodes:n,selectedEdges:o}=ee(mh,yh);return R.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const xh=e=>!!e.onSelectionChangeHandlers;function vh({onSelectionChange:e}){const t=ee(xh);return e||t?P.jsx(wh,{onSelectionChange:e}):null}const ms=[0,0],bh={x:0,y:0,zoom:1},Eh=["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"],wr=[...Eh,"rfId"],_h=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),xr={translateExtent:vt,nodeOrigin:ms,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Nh(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=ee(_h,re),c=ne();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{u.current=xr,a()}),[]);const u=R.useRef(xr);return R.useEffect(()=>{for(const d of wr){const f=e[d],h=u.current[d];f!==h&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?o(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?c.setState({ariaLabelConfig:gf(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}u.current=e},wr.map(d=>e[d])),null}function vr(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Sh(e){const[t,n]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){n(e);return}const o=vr(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:vr()?.matches?"dark":"light"}const br=typeof document<"u"?document:null;function Nt(e=null,t={target:br,actInsideInputWithModifier:!0}){const[n,o]=R.useState(!1),r=R.useRef(!1),i=R.useRef(new Set([])),[s,a]=R.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace(/\+/g,`
|
|
2
|
-
`).replace(`
|
|
3
|
-
|
|
4
|
-
`,`
|
|
5
|
-
+`).split(`
|
|
6
|
-
`)),u=c.reduce((d,f)=>d.concat(...f),[]);return[c,u]}return[[],[]]},[e]);return R.useEffect(()=>{const l=t?.target??br,c=t?.actInsideInputWithModifier??!0;if(e!==null){const u=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!c)&&Gi(h))return!1;const v=_r(h.code,a);if(i.current.add(h[v]),Er(s,i.current,!1)){const x=h.composedPath?.()?.[0]||h.target,m=x?.nodeName==="BUTTON"||x?.nodeName==="A";t.preventDefault!==!1&&(r.current||!m)&&h.preventDefault(),o(!0)}},d=h=>{const g=_r(h.code,a);Er(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},f=()=>{i.current.clear(),o(!1)};return l?.addEventListener("keydown",u),l?.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{l?.removeEventListener("keydown",u),l?.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,o]),n}function Er(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function _r(e,t){return t.includes(e)?"code":"key"}const Ch=()=>{const e=ne();return R.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),l=ho(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),c={x:t.x-a,y:t.y-l},u=n.snapGrid??r,d=n.snapToGrid??i;return Pt(c,o,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=it(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function ys(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const l of s)kh(l,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function kh(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Mh(e,t){return ys(e,t)}function Ih(e,t){return ys(e,t)}function je(e,t){return{id:e,type:"select",selected:t}}function Ke(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(je(i.id,s)))}return o}function Nr({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function Sr(e){return{id:e.id,type:"remove"}}const Oh=Xi();function Ph(e,t,n={}){return vf(e,t,{...n,onError:n.onError??Oh})}const Cr=e=>rf(e),Ah=e=>ji(e);function ws(e){return R.forwardRef(e)}const xs=typeof window<"u"?R.useLayoutEffect:R.useEffect;function kr(e){const[t,n]=R.useState(BigInt(0)),[o]=R.useState(()=>Th(()=>n(r=>r+BigInt(1))));return xs(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function Th(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const vs=R.createContext(null);function $h({children:e}){const t=ne(),n=R.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:u,onNodesChange:d,nodeLookup:f,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let v=l;for(const m of a)v=typeof m=="function"?m(v):m;let x=Nr({items:v,lookup:f});for(const m of g.values())x=m(x);u&&c(v),x.length>0?d?.(x):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:b,setNodes:p}=t.getState();m&&p(b)})},[]),o=kr(n),r=R.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:d,edgeLookup:f}=t.getState();let h=l;for(const g of a)h=typeof g=="function"?g(h):g;u?c(h):d&&d(Nr({items:h,lookup:f}))},[]),i=kr(r),s=R.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return P.jsx(vs.Provider,{value:s,children:e})}function Dh(){const e=R.useContext(vs);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Rh=e=>!!e.panZoom;function vo(){const e=Ch(),t=ne(),n=Dh(),o=ee(Rh),r=R.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},a=d=>{n.edgeQueue.push(d)},l=d=>{const{nodeLookup:f,nodeOrigin:h}=t.getState(),g=Cr(d)?d:f.get(d.id),v=g.parentId?Wi(g.position,g.measured,g.parentId,f,h):g.position,x={...g,position:v,width:g.measured?.width??g.width,height:g.measured?.height??g.height};return Et(x)},c=(d,f,h={replace:!1})=>{s(g=>g.map(v=>{if(v.id===d){const x=typeof f=="function"?f(v):f;return h.replace&&Cr(x)?x:{...v,...x}}return v}))},u=(d,f,h={replace:!1})=>{a(g=>g.map(v=>{if(v.id===d){const x=typeof f=="function"?f(v):f;return h.replace&&Ah(x)?x:{...v,...x}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>i(d)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:a,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(h=>[...h,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:h}=t.getState(),[g,v,x]=h;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x:g,y:v,zoom:x}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:h,edges:g,onNodesDelete:v,onEdgesDelete:x,triggerNodeChanges:m,triggerEdgeChanges:b,onDelete:p,onBeforeDelete:y}=t.getState(),{nodes:_,edges:N}=await uf({nodesToRemove:d,edgesToRemove:f,nodes:h,edges:g,onBeforeDelete:y}),k=N.length>0,C=_.length>0;if(k){const M=N.map(Sr);x?.(N),b(M)}if(C){const M=_.map(Sr);v?.(_),m(M)}return(C||k)&&p?.({nodes:_,edges:N}),{deletedNodes:_,deletedEdges:N}},getIntersectingNodes:(d,f=!0,h)=>{const g=tr(d),v=g?d:l(d),x=h!==void 0;return v?(h||t.getState().nodes).filter(m=>{const b=t.getState().nodeLookup.get(m.id);if(b&&!g&&(m.id===d.id||!b.internals.positionAbsolute))return!1;const p=Et(x?m:b),y=nn(p,v);return f&&y>0||y>=p.width*p.height||y>=v.width*v.height}):[]},isNodeIntersecting:(d,f,h=!0)=>{const v=tr(d)?d:l(d);if(!v)return!1;const x=nn(v,f);return h&&x>0||x>=f.width*f.height||x>=v.width*v.height},updateNode:c,updateNodeData:(d,f,h={replace:!1})=>{c(d,g=>{const v=typeof f=="function"?f(g):f;return h.replace?{...g,data:v}:{...g,data:{...g.data,...v}}},h)},updateEdge:u,updateEdgeData:(d,f,h={replace:!1})=>{u(d,g=>{const v=typeof f=="function"?f(g):f;return h.replace?{...g,data:v}:{...g,data:{...g.data,...v}}},h)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return sf(d,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:d,id:f,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${d}${f?`-${f}`:""}`)?.values()??[]),getNodeConnections:({type:d,handleId:f,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${d?f?`-${d}-${f}`:`-${d}`:""}`)?.values()??[]),fitView:async d=>{const f=t.getState().fitViewResolver??hf();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(h=>[...h]),f.promise}}},[]);return R.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const Mr=e=>e.selected,Lh=typeof window<"u"?window:void 0;function zh({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ne(),{deleteElements:o}=vo(),r=Nt(e,{actInsideInputWithModifier:!1}),i=Nt(t,{target:Lh});R.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(Mr),edges:s.filter(Mr)}),n.setState({nodesSelectionActive:!1})}},[r]),R.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Hh(e){const t=ne();R.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=go(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",pe.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const xn={position:"absolute",width:"100%",height:"100%",top:0,left:0},jh=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Vh({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panActivationKeyPressed:r,panOnScrollSpeed:i=.5,panOnScrollMode:s=Fe.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:g=!0,children:v,noWheelClassName:x,noPanClassName:m,onViewportChange:b,isControlledViewport:p,paneClickDistance:y,selectionOnDrag:_}){const N=ne(),k=R.useRef(null),{userSelectionActive:C,lib:M,connectionInProgress:z}=ee(jh,re),O=Nt(h),D=R.useRef();Hh(k);const A=R.useCallback(w=>{b?.({x:w[0],y:w[1],zoom:w[2]}),p||N.setState({transform:w})},[b,p]);return R.useEffect(()=>{if(k.current){D.current=Uf({domNode:k.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:I=>N.setState(T=>T.paneDragging===I?T:{paneDragging:I}),onPanZoomStart:(I,T)=>{const{onViewportChangeStart:$,onMoveStart:H}=N.getState();H?.(I,T),$?.(T)},onPanZoom:(I,T)=>{const{onViewportChange:$,onMove:H}=N.getState();H?.(I,T),$?.(T)},onPanZoomEnd:(I,T)=>{const{onViewportChangeEnd:$,onMoveEnd:H}=N.getState();H?.(I,T),$?.(T)}});const{x:w,y:E,zoom:S}=D.current.getViewport();return N.setState({panZoom:D.current,transform:[w,E,S],domNode:k.current.closest(".react-flow")}),()=>{D.current?.destroy()}}},[]),R.useEffect(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panActivationKeyPressed:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:O,preventScrolling:g,noPanClassName:m,userSelectionActive:C,noWheelClassName:x,lib:M,onTransformChange:A,connectionInProgress:z,selectionOnDrag:_,paneClickDistance:y})},[e,t,n,o,r,i,s,a,l,O,g,m,C,x,M,A,z,_,y]),P.jsx("div",{className:"react-flow__renderer",ref:k,style:xn,children:v})}const Bh=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Fh(){const{userSelectionActive:e,userSelectionRect:t}=ee(Bh,re);return e&&t?P.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Tn=(e,t)=>n=>{n.target===t.current&&e?.(n)},Yh=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Xh({isSelecting:e,selectionKeyPressed:t,selectionMode:n=bt.Full,panOnDrag:o,autoPanOnSelection:r,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:g,children:v}){const x=R.useRef(0),m=ne(),{userSelectionActive:b,elementsSelectable:p,dragging:y,panBy:_,autoPanSpeed:N}=ee(Yh,re),k=p&&(e||b),C=R.useRef(null),M=R.useRef(),z=R.useRef(new Set),O=R.useRef(new Set),D=R.useRef(!1),A=R.useRef(!1),w=R.useRef({x:0,y:0}),E=R.useRef(!1),S=L=>{if(A.current||D.current||m.getState().connection.inProgress){A.current=!1,D.current=!1;return}c?.(L),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},I=L=>{if(Array.isArray(o)&&o?.includes(2)){L.preventDefault();return}u?.(L)},T=d?L=>d(L):void 0,$=L=>{A.current&&(L.stopPropagation(),A.current=!1)},H=L=>{if(L.pointerType==="touch"&&o!==!1&&!t)return;const{domNode:F,transform:K}=m.getState();if(M.current=F?.getBoundingClientRect(),!M.current)return;const U=L.target===C.current;if(!U&&!!L.target.closest(".nokey")||!e||!(s&&U||t)||L.button!==0||!L.isPrimary)return;L.target?.setPointerCapture?.(L.pointerId),A.current=!1;const{x:J,y:te}=ge(L.nativeEvent,M.current),oe=Pt({x:J,y:te},K);m.setState({userSelectionRect:{width:0,height:0,startX:oe.x,startY:oe.y,x:J,y:te}}),U||(L.stopPropagation(),L.preventDefault())};function V(L,F){const{userSelectionRect:K}=m.getState();if(!K)return;const{transform:U,nodeLookup:X,edgeLookup:G,connectionLookup:J,triggerNodeChanges:te,triggerEdgeChanges:oe,defaultEdgeOptions:se}=m.getState(),Se={x:K.startX,y:K.startY},{x:xe,y:ve}=it(Se,U),Ce={startX:Se.x,startY:Se.y,x:L<xe?L:xe,y:F<ve?F:ve,width:Math.abs(L-xe),height:Math.abs(F-ve)},lt=z.current,Le=O.current;z.current=new Set(uo(X,Ce,U,n===bt.Partial,!0).map(ue=>ue.id)),O.current=new Set;const ze=se?.selectable??!0;for(const ue of z.current){const ke=J.get(ue);if(ke)for(const{edgeId:Me}of ke.values()){const He=G.get(Me);He&&(He.selectable??ze)&&O.current.add(Me)}}if(!nr(lt,z.current)){const ue=Ke(X,z.current,!0);te(ue)}if(!nr(Le,O.current)){const ue=Ke(G,O.current);oe(ue)}m.setState({userSelectionRect:Ce,userSelectionActive:!0,nodesSelectionActive:!1})}function j(){if(!r||!M.current)return;const[L,F]=fo(w.current,M.current,N);_({x:L,y:F}).then(K=>{if(!A.current||!K){x.current=requestAnimationFrame(j);return}const{x:U,y:X}=w.current;V(U,X),x.current=requestAnimationFrame(j)})}const Y=()=>{cancelAnimationFrame(x.current),x.current=0,E.current=!1};R.useEffect(()=>()=>Y(),[]);const B=L=>{const{userSelectionRect:F,transform:K,resetSelectedElements:U}=m.getState();if(!M.current||!F)return;const{x:X,y:G}=ge(L.nativeEvent,M.current);w.current={x:X,y:G};const J=it({x:F.startX,y:F.startY},K);if(!A.current){const te=t?0:i;if(Math.hypot(X-J.x,G-J.y)<=te)return;U(),a?.(L)}A.current=!0,E.current||(j(),E.current=!0),V(X,G)},q=L=>{if(!k){L.target===C.current&&m.getState().connection.inProgress&&(D.current=!0);return}L.button===0&&(L.target?.releasePointerCapture?.(L.pointerId),!b&&L.target===C.current&&m.getState().userSelectionRect&&S?.(L),m.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(l?.(L),m.setState({nodesSelectionActive:z.current.size>0})),Y())},Q=L=>{L.target?.releasePointerCapture?.(L.pointerId),Y()},W=o===!0||Array.isArray(o)&&o.includes(0);return P.jsxs("div",{className:ie(["react-flow__pane",{draggable:W,dragging:y,selection:e}]),onClick:k?void 0:Tn(S,C),onContextMenu:Tn(I,C),onWheel:Tn(T,C),onPointerEnter:k?void 0:f,onPointerMove:k?B:h,onPointerUp:q,onPointerCancel:k?Q:void 0,onPointerDownCapture:k?H:void 0,onClickCapture:k?$:void 0,onPointerLeave:g,ref:C,style:xn,children:[v,P.jsx(Fh,{})]})}function eo({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),c=a.get(e);if(!c){l?.("012",pe.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function bs({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=ne(),[l,c]=R.useState(!1),u=R.useRef();return R.useEffect(()=>{if(!t)return u.current=Rf({getStoreItems:()=>a.getState(),onNodeMouseDown:d=>{eo({id:d,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,a,e]),R.useEffect(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s})},[n,o,t,i,e,r,s]),l}const Zh=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Es(){const e=ne();return R.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:u}=e.getState(),d=new Map,f=Zh(s),h=r?i[0]:5,g=r?i[1]:5,v=n.direction.x*h*n.factor,x=n.direction.y*g*n.factor;for(const[,m]of c){if(!f(m))continue;let b={x:m.internals.positionAbsolute.x+v,y:m.internals.positionAbsolute.y+x};r&&(b=Ot(b,i));const{position:p,positionAbsolute:y}=Vi({nodeId:m.id,nextPosition:b,nodeLookup:c,nodeExtent:o,nodeOrigin:u,onError:a});m.position=p,m.internals.positionAbsolute=y,d.set(m.id,m)}l(d)},[])}const bo=R.createContext(null),Wh=bo.Provider;bo.Consumer;const _s=()=>R.useContext(bo),qh=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Ns=R.createContext(null);function Gh({children:e}){const t=ee(qh,re);return P.jsx(Ns.Provider,{value:t,children:e})}function Uh(){const e=R.useContext(Ns);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Kh={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Qh=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:l,isValid:c}=s;if(!a&&!r)return Kh;const u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===ot.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:u&&c}};function Jh({type:e="source",position:t=Z.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:d,...f},h){const g=s||null,v=e==="target",x=ne(),m=_s(),{connectOnClick:b,noPanClassName:p,rfId:y}=Uh(),{connectingFrom:_,connectingTo:N,clickConnecting:k,isPossibleEndHandle:C,connectionInProcess:M,clickConnectionInProcess:z,valid:O}=ee(Qh(m,g,e),re);m||x.getState().onError?.("010",pe.error010());const D=E=>{const{defaultEdgeOptions:S,onConnect:I,hasDefaultEdges:T}=x.getState(),$={...S,...E};if(T){const{edges:H,setEdges:V,onError:j}=x.getState();V(Ph($,H,{onError:j}))}I?.($),a?.($)},A=E=>{if(!m)return;const S=Ui(E.nativeEvent);if(r&&(S&&E.button===0||!S)){const I=x.getState();Jn.onPointerDown(E.nativeEvent,{handleDomNode:E.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:v,handleId:g,nodeId:m,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...T)=>x.getState().onConnectEnd?.(...T),updateConnection:I.updateConnection,onConnect:D,isValidConnection:n||((...T)=>x.getState().isValidConnection?.(...T)??!0),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}S?u?.(E):d?.(E)},w=E=>{const{onClickConnectStart:S,onClickConnectEnd:I,connectionClickStartHandle:T,connectionMode:$,isValidConnection:H,lib:V,rfId:j,nodeLookup:Y,connection:B}=x.getState();if(!m||!T&&!r)return;if(!T){S?.(E.nativeEvent,{nodeId:m,handleId:g,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:m,type:e,id:g}});return}const q=qi(E.target),Q=n||H,{connection:W,isValid:L}=Jn.isValid(E.nativeEvent,{handle:{nodeId:m,id:g,type:e},connectionMode:$,fromNodeId:T.nodeId,fromHandleId:T.id||null,fromType:T.type,isValidConnection:Q,flowId:j,doc:q,lib:V,nodeLookup:Y});L&&W&&D(W);const F=structuredClone(B);delete F.inProgress,F.toPosition=F.toHandle?F.toHandle.position:null,I?.(E,F),x.setState({connectionClickStartHandle:null})};return P.jsx("div",{"data-handleid":g,"data-nodeid":m,"data-handlepos":t,"data-id":`${y}-${m}-${g}-${e}`,className:ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,c,{source:!v,target:v,connectable:o,connectablestart:r,connectableend:i,clickconnecting:k,connectingfrom:_,connectingto:N,valid:O,connectionindicator:o&&(!M||C)&&(M||z?i:r)}]),onMouseDown:A,onTouchStart:A,onClick:b?w:void 0,ref:h,...f,children:l})}const on=R.memo(ws(Jh));function eg({data:e,isConnectable:t,sourcePosition:n=Z.Bottom}){return P.jsxs(P.Fragment,{children:[e?.label,P.jsx(on,{type:"source",position:n,isConnectable:t})]})}function tg({data:e,isConnectable:t,targetPosition:n=Z.Top,sourcePosition:o=Z.Bottom}){return P.jsxs(P.Fragment,{children:[P.jsx(on,{type:"target",position:n,isConnectable:t}),e?.label,P.jsx(on,{type:"source",position:o,isConnectable:t})]})}function ng(){return null}function og({data:e,isConnectable:t,targetPosition:n=Z.Top}){return P.jsxs(P.Fragment,{children:[P.jsx(on,{type:"target",position:n,isConnectable:t}),e?.label]})}const rn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ir={input:eg,default:tg,output:og,group:ng};function rg(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const ig=e=>{const{width:t,height:n,x:o,y:r}=It(e.nodeLookup,{filter:i=>!!i.selected});return{width:he(t)?t:null,height:he(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function sg({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=ne(),{width:r,height:i,transformString:s,userSelectionActive:a}=ee(ig,re),l=Es(),c=R.useRef(null);R.useEffect(()=>{n||c.current?.focus({preventScroll:!0})},[n]);const u=!a&&r!==null&&i!==null;if(bs({nodeRef:c,disabled:!u}),!u)return null;const d=e?h=>{const g=o.getState().nodes.filter(v=>v.selected);e(h,g)}:void 0,f=h=>{Object.prototype.hasOwnProperty.call(rn,h.key)&&(h.preventDefault(),l({direction:rn[h.key],factor:h.shiftKey?4:1}))};return P.jsx("div",{className:ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:P.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:r,height:i}})})}const Or=typeof window<"u"?window:void 0,ag=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Ss({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:v,zoomActivationKeyCode:x,elementsSelectable:m,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:y,panOnScrollSpeed:_,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:C,autoPanOnSelection:M,defaultViewport:z,translateExtent:O,minZoom:D,maxZoom:A,preventScrolling:w,onSelectionContextMenu:E,noWheelClassName:S,noPanClassName:I,disableKeyboardA11y:T,onViewportChange:$,isControlledViewport:H}){const{nodesSelectionActive:V,userSelectionActive:j}=ee(ag,re),Y=Nt(c,{target:Or}),B=Nt(v,{target:Or}),q=B||C,Q=B||y,W=u&&q!==!0,L=Y||j||W;return zh({deleteKeyCode:l,multiSelectionKeyCode:g}),P.jsx(Vh,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:Q,panActivationKeyPressed:B,panOnScrollSpeed:_,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:!Y&&q,defaultViewport:z,translateExtent:O,minZoom:D,maxZoom:A,zoomActivationKeyCode:x,preventScrolling:w,noWheelClassName:S,noPanClassName:I,onViewportChange:$,isControlledViewport:H,paneClickDistance:a,selectionOnDrag:W,children:P.jsxs(Xh,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:q,autoPanOnSelection:M,isSelecting:!!L,selectionMode:d,selectionKeyPressed:Y,paneClickDistance:a,selectionOnDrag:W,children:[e,V&&P.jsx(sg,{onSelectionContextMenu:E,noPanClassName:I,disableKeyboardA11y:T})]})})}Ss.displayName="FlowRenderer";const cg=R.memo(Ss),lg=e=>t=>e?uo(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function ug(e){return ee(R.useCallback(lg(e),[e]),re)}const dg=e=>e.updateNodeInternals;function fg(){const e=ee(dg),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return R.useEffect(()=>()=>{t?.disconnect()},[t]),t}function hg({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=ne(),i=R.useRef(null),s=R.useRef(null),a=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),c=R.useRef(t),u=n&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!u||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[u,e.hidden]),R.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),R.useEffect(()=>{if(i.current){const d=c.current!==t,f=a.current!==e.sourcePosition,h=l.current!==e.targetPosition;(d||f||h)&&(c.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function gg({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:g,rfId:v,nodeTypes:x,nodeClickDistance:m,onError:b}){const{node:p,internals:y,isParent:_}=ee(L=>{const F=L.nodeLookup.get(e),K=L.parentLookup.has(e);return{node:F,internals:F.internals,isParent:K}},re);let N=p.type||"default",k=x?.[N]||Ir[N];k===void 0&&(b?.("003",pe.error003(N)),N="default",k=x?.default||Ir.default);const C=!!(p.draggable||a&&typeof p.draggable>"u"),M=!!(p.selectable||l&&typeof p.selectable>"u"),z=!!(p.connectable||c&&typeof p.connectable>"u"),O=!!(p.focusable||u&&typeof p.focusable>"u"),D=ne(),A=Zi(p),w=hg({node:p,nodeType:N,hasDimensions:A,resizeObserver:d}),E=bs({nodeRef:w,disabled:p.hidden||!C,noDragClassName:f,handleSelector:p.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:m}),S=Es();if(p.hidden)return null;const I=ye(p),T=rg(p),$=M||C||t||n||o||r,H=n?L=>n(L,{...y.userNode}):void 0,V=o?L=>o(L,{...y.userNode}):void 0,j=r?L=>r(L,{...y.userNode}):void 0,Y=i?L=>i(L,{...y.userNode}):void 0,B=s?L=>s(L,{...y.userNode}):void 0,q=L=>{const{selectNodesOnDrag:F,nodeDragThreshold:K}=D.getState();M&&(!F||!C||K>0)&&eo({id:e,store:D,nodeRef:w}),t&&t(L,{...y.userNode})},Q=L=>{if(!(Gi(L.nativeEvent)||g)){if(Ri.includes(L.key)&&M){const F=L.key==="Escape";eo({id:e,store:D,unselect:F,nodeRef:w})}else if(C&&p.selected&&Object.prototype.hasOwnProperty.call(rn,L.key)){L.preventDefault();const{ariaLabelConfig:F}=D.getState();D.setState({ariaLiveMessage:F["node.a11yDescription.ariaLiveMessage"]({direction:L.key.replace("Arrow","").toLowerCase(),x:~~y.positionAbsolute.x,y:~~y.positionAbsolute.y})}),S({direction:rn[L.key],factor:L.shiftKey?4:1})}}},W=()=>{if(g||!w.current?.matches(":focus-visible"))return;const{transform:L,width:F,height:K,autoPanOnNodeFocus:U,setCenter:X}=D.getState();if(!U)return;uo(new Map([[e,p]]),{x:0,y:0,width:F,height:K},L,!0).length>0||X(p.position.x+I.width/2,p.position.y+I.height/2,{zoom:L[2]})};return P.jsx("div",{className:ie(["react-flow__node",`react-flow__node-${N}`,{[h]:C},p.className,{selected:p.selected,selectable:M,parent:_,draggable:C,dragging:E}]),ref:w,style:{zIndex:y.z,transform:`translate(${y.positionAbsolute.x}px,${y.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:A?"visible":"hidden",...p.style,...T},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:H,onMouseMove:V,onMouseLeave:j,onContextMenu:Y,onClick:q,onDoubleClick:B,onKeyDown:O?Q:void 0,tabIndex:O?0:void 0,onFocus:O?W:void 0,role:p.ariaRole??(O?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${gs}-${v}`,"aria-label":p.ariaLabel,...p.domAttributes,children:P.jsx(Wh,{value:e,children:P.jsx(k,{id:e,data:p.data,type:N,positionAbsoluteX:y.positionAbsolute.x,positionAbsoluteY:y.positionAbsolute.y,selected:p.selected??!1,selectable:M,draggable:C,deletable:p.deletable??!0,isConnectable:z,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:E,dragHandle:p.dragHandle,zIndex:y.z,parentId:p.parentId,...I})})})}var pg=R.memo(gg);const mg=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Cs(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,onError:r}=ee(mg,re),i=ug(e.onlyRenderVisibleElements),s=fg();return P.jsx("div",{className:"react-flow__nodes",style:xn,children:i.map(a=>P.jsx(pg,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:r},a))})}Cs.displayName="NodeRenderer";const yg=R.memo(Cs);function wg(e){return ee(R.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&yf({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),re)}const xg=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return P.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},vg=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return P.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Pr={[en.Arrow]:xg,[en.ArrowClosed]:vg};function bg(e){const t=ne();return R.useMemo(()=>Object.prototype.hasOwnProperty.call(Pr,e)?Pr[e]:(t.getState().onError?.("009",pe.error009(e)),null),[e])}const Eg=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=bg(t);return l?P.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:P.jsx(l,{color:n,strokeWidth:s})}):null},ks=({defaultColor:e,rfId:t})=>{const n=ee(i=>i.edges),o=ee(i=>i.defaultEdgeOptions),r=R.useMemo(()=>Sf(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?P.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:P.jsx("defs",{children:r.map(i=>P.jsx(Eg,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};ks.displayName="MarkerDefinitions";var _g=R.memo(ks);function Ms({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u}){const[d,f]=R.useState({x:1,y:0,width:0,height:0}),h=ie(["react-flow__edge-textwrapper",c]),g=R.useRef(null);return R.useEffect(()=>{if(g.current){const v=g.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?P.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...u,children:[r&&P.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),P.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:g,style:o,children:n}),l]}):null}Ms.displayName="EdgeText";const Ng=R.memo(Ms);function vn({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return P.jsxs(P.Fragment,{children:[P.jsx("path",{...u,d:e,fill:"none",className:ie(["react-flow__edge-path",u.className])}),c?P.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,o&&he(t)&&he(n)?P.jsx(Ng,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Ar({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===Z.Left||e===Z.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function Is({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:o,targetY:r,targetPosition:i=Z.Top}){const[s,a]=Ar({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=Ar({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,d,f,h]=Ki({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${o},${r}`,u,d,f,h]}function Os(e){return R.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:x,interactionWidth:m})=>{const[b,p,y]=Is({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),_=e.isInternal?void 0:t;return P.jsx(vn,{id:_,path:b,labelX:p,labelY:y,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:x,interactionWidth:m})})}const Sg=Os({isInternal:!1}),Ps=Os({isInternal:!0});Sg.displayName="SimpleBezierEdge";Ps.displayName="SimpleBezierEdgeInternal";function As(e){return R.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:h=Z.Bottom,targetPosition:g=Z.Top,markerEnd:v,markerStart:x,pathOptions:m,interactionWidth:b})=>{const[p,y,_]=Un({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:g,borderRadius:m?.borderRadius,offset:m?.offset,stepPosition:m?.stepPosition}),N=e.isInternal?void 0:t;return P.jsx(vn,{id:N,path:p,labelX:y,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:x,interactionWidth:b})})}const Ts=As({isInternal:!1}),$s=As({isInternal:!0});Ts.displayName="SmoothStepEdge";$s.displayName="SmoothStepEdgeInternal";function Ds(e){return R.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return P.jsx(Ts,{...n,id:o,pathOptions:R.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const Cg=Ds({isInternal:!1}),Rs=Ds({isInternal:!0});Cg.displayName="StepEdge";Rs.displayName="StepEdgeInternal";function Ls(e){return R.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})=>{const[x,m,b]=es({sourceX:n,sourceY:o,targetX:r,targetY:i}),p=e.isInternal?void 0:t;return P.jsx(vn,{id:p,path:x,labelX:m,labelY:b,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}const kg=Ls({isInternal:!1}),zs=Ls({isInternal:!0});kg.displayName="StraightEdge";zs.displayName="StraightEdgeInternal";function Hs(e){return R.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=Z.Bottom,targetPosition:a=Z.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:x,pathOptions:m,interactionWidth:b})=>{const[p,y,_]=Qi({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:m?.curvature}),N=e.isInternal?void 0:t;return P.jsx(vn,{id:N,path:p,labelX:y,labelY:_,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:x,interactionWidth:b})})}const Mg=Hs({isInternal:!1}),js=Hs({isInternal:!0});Mg.displayName="BezierEdge";js.displayName="BezierEdgeInternal";const Tr={default:js,straight:zs,step:Rs,smoothstep:$s,simplebezier:Ps},$r={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Ig=(e,t,n)=>n===Z.Left?e-t:n===Z.Right?e+t:e,Og=(e,t,n)=>n===Z.Top?e-t:n===Z.Bottom?e+t:e,Dr="react-flow__edgeupdater";function Rr({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return P.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:ie([Dr,`${Dr}-${a}`]),cx:Ig(t,o,e),cy:Og(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function Pg({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:h}){const g=ne(),v=(y,_)=>{if(y.button!==0)return;const{autoPanOnConnect:N,domNode:k,connectionMode:C,connectionRadius:M,lib:z,onConnectStart:O,cancelConnection:D,nodeLookup:A,rfId:w,panBy:E,updateConnection:S}=g.getState(),I=_.type==="target",T=(V,j)=>{f(!1),d?.(V,n,_.type,j)},$=V=>c?.(n,V),H=(V,j)=>{f(!0),u?.(y,n,_.type),O?.(V,j)};Jn.onPointerDown(y.nativeEvent,{autoPanOnConnect:N,connectionMode:C,connectionRadius:M,domNode:k,handleId:_.id,nodeId:_.nodeId,nodeLookup:A,isTarget:I,edgeUpdaterType:_.type,lib:z,flowId:w,cancelConnection:D,panBy:E,isValidConnection:(...V)=>g.getState().isValidConnection?.(...V)??!0,onConnect:$,onConnectStart:H,onConnectEnd:(...V)=>g.getState().onConnectEnd?.(...V),onReconnectEnd:T,updateConnection:S,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:y.currentTarget})},x=y=>v(y,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=y=>v(y,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>h(!0),p=()=>h(!1);return P.jsxs(P.Fragment,{children:[(e===!0||e==="source")&&P.jsx(Rr,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:x,onMouseEnter:b,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&P.jsx(Rr,{position:l,centerX:i,centerY:s,radius:t,onMouseDown:m,onMouseEnter:b,onMouseOut:p,type:"target"})]})}function Ag({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,rfId:g,edgeTypes:v,noPanClassName:x,onError:m,disableKeyboardA11y:b}){let p=ee(X=>X.edgeLookup.get(e));const y=ee(X=>X.defaultEdgeOptions);p=y?{...y,...p}:p;let _=p.type||"default",N=v?.[_]||Tr[_];N===void 0&&(m?.("011",pe.error011(_)),_="default",N=v?.default||Tr.default);const k=!!(p.focusable||t&&typeof p.focusable>"u"),C=typeof d<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),M=!!(p.selectable||o&&typeof p.selectable>"u"),z=R.useRef(null),[O,D]=R.useState(!1),[A,w]=R.useState(!1),E=ne(),{zIndex:S=p.zIndex,sourceX:I,sourceY:T,targetX:$,targetY:H,sourcePosition:V,targetPosition:j}=ee(R.useCallback(X=>{const G=X.nodeLookup.get(p.source),J=X.nodeLookup.get(p.target);if(!G||!J)return $r;const te=Nf({id:e,sourceNode:G,targetNode:J,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:X.connectionMode,onError:m}),oe=mf({selected:p.selected,zIndex:p.zIndex,sourceNode:G,targetNode:J,elevateOnSelect:X.elevateEdgesOnSelect,zIndexMode:X.zIndexMode});return{...te||$r,zIndex:oe}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex,m]),re),Y=R.useMemo(()=>p.markerStart?`url('#${Kn(p.markerStart,g)}')`:void 0,[p.markerStart,g]),B=R.useMemo(()=>p.markerEnd?`url('#${Kn(p.markerEnd,g)}')`:void 0,[p.markerEnd,g]);if(p.hidden||I===null||T===null||$===null||H===null)return null;const q=X=>{const{addSelectedEdges:G,unselectNodesAndEdges:J,multiSelectionActive:te}=E.getState();M&&(E.setState({nodesSelectionActive:!1}),p.selected&&te?(J({nodes:[],edges:[p]}),z.current?.blur()):G([e])),r&&r(X,p)},Q=i?X=>{i(X,{...p})}:void 0,W=s?X=>{s(X,{...p})}:void 0,L=a?X=>{a(X,{...p})}:void 0,F=l?X=>{l(X,{...p})}:void 0,K=c?X=>{c(X,{...p})}:void 0,U=X=>{if(!b&&Ri.includes(X.key)&&M){const{unselectNodesAndEdges:G,addSelectedEdges:J}=E.getState();X.key==="Escape"?(z.current?.blur(),G({edges:[p]})):J([e])}};return P.jsx("svg",{style:{zIndex:S},children:P.jsxs("g",{className:ie(["react-flow__edge",`react-flow__edge-${_}`,p.className,x,{selected:p.selected,animated:p.animated,inactive:!M&&!r,updating:O,selectable:M}]),onClick:q,onDoubleClick:Q,onContextMenu:W,onMouseEnter:L,onMouseMove:F,onMouseLeave:K,onKeyDown:k?U:void 0,tabIndex:k?0:void 0,role:p.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":k?`${ps}-${g}`:void 0,ref:z,...p.domAttributes,children:[!A&&P.jsx(N,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:M,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:I,sourceY:T,targetX:$,targetY:H,sourcePosition:V,targetPosition:j,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:Y,markerEnd:B,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),C&&P.jsx(Pg,{edge:p,isReconnectable:C,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,sourceX:I,sourceY:T,targetX:$,targetY:H,sourcePosition:V,targetPosition:j,setUpdateHover:D,setReconnecting:w})]})})}var Tg=R.memo(Ag);const $g=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Vs({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:v}){const{edgesFocusable:x,edgesReconnectable:m,elementsSelectable:b,onError:p}=ee($g,re),y=wg(t);return P.jsxs("div",{className:"react-flow__edges",children:[P.jsx(_g,{defaultColor:e,rfId:n}),y.map(_=>P.jsx(Tg,{id:_,edgesFocusable:x,edgesReconnectable:m,elementsSelectable:b,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:p,edgeTypes:o,disableKeyboardA11y:v},_))]})}Vs.displayName="EdgeRenderer";const Dg=R.memo(Vs),Lr=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function Rg({children:e}){const t=ne(),n=R.useRef(null),[o]=R.useState(()=>t.getState().transform);return xs(()=>{let r=null;const i=()=>{const s=t.getState().transform;r&&s[0]===r[0]&&s[1]===r[1]&&s[2]===r[2]||(r=s,n.current&&(n.current.style.transform=Lr(s)))};return i(),t.subscribe(i)},[t]),P.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Lr(o)},children:e})}function Lg(e){const t=vo(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const zg=e=>e.panZoom?.syncViewport;function Hg(e){const t=ee(zg),n=ne();return R.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function jg(e){return e.connection.inProgress?{...e.connection,to:Pt(e.connection.to,e.transform)}:{...e.connection}}function Vg(e){return jg}function Bg(e){const t=Vg();return ee(t,re)}const Fg=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Yg({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:l}=ee(Fg,re);return!(i&&r&&l)?null:P.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:P.jsx("g",{className:ie(["react-flow__connection",Hi(a)]),children:P.jsx(Bs,{style:t,type:n,CustomComponent:o,isValid:a})})})}const Bs=({style:e,type:t=De.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:l,to:c,toNode:u,toHandle:d,toPosition:f,pointer:h}=Bg();if(!r)return;if(n)return P.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:f,connectionStatus:Hi(o),toNode:u,toHandle:d,pointer:h});let g="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case De.Bezier:[g]=Qi(v);break;case De.SimpleBezier:[g]=Is(v);break;case De.Step:[g]=Un({...v,borderRadius:0});break;case De.SmoothStep:[g]=Un(v);break;default:[g]=es(v)}return P.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};Bs.displayName="ConnectionLine";const Xg={};function zr(e=Xg){R.useRef(e),ne(),R.useEffect(()=>{},[e])}function Zg(){ne(),R.useRef(!1),R.useEffect(()=>{},[])}function Fs({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:v,connectionLineComponent:x,connectionLineContainerStyle:m,selectionKeyCode:b,selectionOnDrag:p,selectionMode:y,multiSelectionKeyCode:_,panActivationKeyCode:N,zoomActivationKeyCode:k,deleteKeyCode:C,onlyRenderVisibleElements:M,elementsSelectable:z,defaultViewport:O,translateExtent:D,minZoom:A,maxZoom:w,preventScrolling:E,defaultMarkerColor:S,zoomOnScroll:I,zoomOnPinch:T,panOnScroll:$,panOnScrollSpeed:H,panOnScrollMode:V,zoomOnDoubleClick:j,panOnDrag:Y,autoPanOnSelection:B,onPaneClick:q,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:L,onPaneScroll:F,onPaneContextMenu:K,paneClickDistance:U,nodeClickDistance:X,onEdgeContextMenu:G,onEdgeMouseEnter:J,onEdgeMouseMove:te,onEdgeMouseLeave:oe,reconnectRadius:se,onReconnect:Se,onReconnectStart:xe,onReconnectEnd:ve,noDragClassName:Ce,noWheelClassName:lt,noPanClassName:Le,disableKeyboardA11y:ze,nodeExtent:ue,rfId:ke,viewport:Me,onViewportChange:He,nodesDraggable:_n}){return zr(e),zr(t),Zg(),Lg(n),Hg(Me),P.jsx(cg,{onPaneClick:q,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:L,onPaneContextMenu:K,onPaneScroll:F,paneClickDistance:U,deleteKeyCode:C,selectionKeyCode:b,selectionOnDrag:p,selectionMode:y,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:_,panActivationKeyCode:N,zoomActivationKeyCode:k,elementsSelectable:z,zoomOnScroll:I,zoomOnPinch:T,zoomOnDoubleClick:j,panOnScroll:$,panOnScrollSpeed:H,panOnScrollMode:V,panOnDrag:Y,autoPanOnSelection:B,defaultViewport:O,translateExtent:D,minZoom:A,maxZoom:w,onSelectionContextMenu:d,preventScrolling:E,noDragClassName:Ce,noWheelClassName:lt,noPanClassName:Le,disableKeyboardA11y:ze,onViewportChange:He,isControlledViewport:!!Me,children:P.jsxs(Rg,{children:[P.jsx(Dg,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Se,onReconnectStart:xe,onReconnectEnd:ve,onlyRenderVisibleElements:M,onEdgeContextMenu:G,onEdgeMouseEnter:J,onEdgeMouseMove:te,onEdgeMouseLeave:oe,reconnectRadius:se,defaultMarkerColor:S,noPanClassName:Le,disableKeyboardA11y:ze,rfId:ke}),P.jsx(Yg,{style:v,type:g,component:x,containerStyle:m}),P.jsx("div",{className:"react-flow__edgelabel-renderer"}),P.jsx(yg,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:X,onlyRenderVisibleElements:M,noPanClassName:Le,noDragClassName:Ce,disableKeyboardA11y:ze,nodeExtent:ue,rfId:ke,nodesDraggable:_n}),P.jsx("div",{className:"react-flow__viewport-portal"})]})})}Fs.displayName="GraphView";const Wg=R.memo(Fs),qg=Xi(),Hr=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f="basic"}={})=>{const h=new Map,g=new Map,v=new Map,x=new Map,m=o??t??[],b=n??e??[],p=u??[0,0],y=d??vt;os(v,x,m);const{nodesInitialized:_}=Qn(b,h,g,{nodeOrigin:p,nodeExtent:y,zIndexMode:f});let N=[0,0,1];if(s&&r&&i){const k=It(h,{filter:O=>!!((O.width||O.initialWidth)&&(O.height||O.initialHeight))}),{x:C,y:M,zoom:z}=ho(k,r,i,l,c,a?.padding??.1);N=[C,M,z]}return{rfId:"1",width:r??0,height:i??0,transform:N,nodes:b,nodesInitialized:_,nodeLookup:h,parentLookup:g,edges:m,edgeLookup:x,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:vt,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ot.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...zi},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:qg,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Li,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Gg=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>ah((h,g)=>{async function v(){const{nodeLookup:x,panZoom:m,fitViewOptions:b,fitViewResolver:p,width:y,height:_,minZoom:N,maxZoom:k}=g();m&&(await lf({nodes:x,width:y,height:_,panZoom:m,minZoom:N,maxZoom:k},b),p?.resolve(!0),h({fitViewResolver:null}))}return{...Hr({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:o,zIndexMode:f}),setNodes:x=>{const{nodeLookup:m,parentLookup:b,nodeOrigin:p,nodeExtent:y,elevateNodesOnSelect:_,fitViewQueued:N,zIndexMode:k,nodesSelectionActive:C}=g(),{nodesInitialized:M,hasSelectedNodes:z}=Qn(x,m,b,{nodeOrigin:p,nodeExtent:y,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:k}),O=C&&z;N&&M?(v(),h({nodes:x,nodesInitialized:M,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):h({nodes:x,nodesInitialized:M,nodesSelectionActive:O})},setEdges:x=>{const{connectionLookup:m,edgeLookup:b}=g();os(m,b,x),h({edges:x})},setDefaultNodesAndEdges:(x,m)=>{if(x){const{setNodes:b}=g();b(x),h({hasDefaultNodes:!0})}if(m){const{setEdges:b}=g();b(m),h({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:m,nodeLookup:b,parentLookup:p,domNode:y,nodeOrigin:_,nodeExtent:N,debug:k,fitViewQueued:C,zIndexMode:M}=g(),{changes:z,updatedInternals:O}=Af(x,b,p,y,_,N,M);O&&(Mf(b,p,{nodeOrigin:_,nodeExtent:N,zIndexMode:M}),C?(v(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),z?.length>0&&(k&&console.log("React Flow: trigger node changes",z),m?.(z)))},updateNodePositions:(x,m=!1)=>{const b=[];let p=[];const{nodeLookup:y,triggerNodeChanges:_,connection:N,updateConnection:k,onNodesChangeMiddlewareMap:C}=g();for(const[M,z]of x){const O=y.get(M),D=!!(O?.expandParent&&O?.parentId&&z?.position),A={id:M,type:"position",position:D?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:m};if(O&&N.inProgress&&N.fromNode.id===O.id){const w=qe(O,N.fromHandle,Z.Left,!0);k({...N,from:w})}D&&O.parentId&&b.push({id:M,parentId:O.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),p.push(A)}if(b.length>0){const{parentLookup:M,nodeOrigin:z}=g(),O=xo(b,y,M,z);p.push(...O)}for(const M of C.values())p=M(p);_(p)},triggerNodeChanges:x=>{const{onNodesChange:m,setNodes:b,nodes:p,hasDefaultNodes:y,debug:_}=g();if(x?.length){if(y){const N=Mh(x,p);b(N)}_&&console.log("React Flow: trigger node changes",x),m?.(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:m,setEdges:b,edges:p,hasDefaultEdges:y,debug:_}=g();if(x?.length){if(y){const N=Ih(x,p);b(N)}_&&console.log("React Flow: trigger edge changes",x),m?.(x)}},addSelectedNodes:x=>{const{multiSelectionActive:m,edgeLookup:b,nodeLookup:p,triggerNodeChanges:y,triggerEdgeChanges:_}=g();if(m){const N=x.map(k=>je(k,!0));y(N);return}y(Ke(p,new Set([...x]),!0)),_(Ke(b))},addSelectedEdges:x=>{const{multiSelectionActive:m,edgeLookup:b,nodeLookup:p,triggerNodeChanges:y,triggerEdgeChanges:_}=g();if(m){const N=x.map(k=>je(k,!0));_(N);return}_(Ke(b,new Set([...x]))),y(Ke(p,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:m}={})=>{const{edges:b,nodes:p,nodeLookup:y,triggerNodeChanges:_,triggerEdgeChanges:N}=g(),k=x||p,C=m||b,M=[];for(const O of k){if(!O.selected)continue;const D=y.get(O.id);D&&(D.selected=!1),M.push(je(O.id,!1))}const z=[];for(const O of C)O.selected&&z.push(je(O.id,!1));_(M),N(z)},setMinZoom:x=>{const{panZoom:m,maxZoom:b}=g();m?.setScaleExtent([x,b]),h({minZoom:x})},setMaxZoom:x=>{const{panZoom:m,minZoom:b}=g();m?.setScaleExtent([b,x]),h({maxZoom:x})},setTranslateExtent:x=>{g().panZoom?.setTranslateExtent(x),h({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:m,triggerNodeChanges:b,triggerEdgeChanges:p,elementsSelectable:y}=g();if(!y)return;const _=m.reduce((k,C)=>C.selected?[...k,je(C.id,!1)]:k,[]),N=x.reduce((k,C)=>C.selected?[...k,je(C.id,!1)]:k,[]);b(_),p(N)},setNodeExtent:x=>{const{nodes:m,nodeLookup:b,parentLookup:p,nodeOrigin:y,elevateNodesOnSelect:_,nodeExtent:N,zIndexMode:k}=g();x[0][0]===N[0][0]&&x[0][1]===N[0][1]&&x[1][0]===N[1][0]&&x[1][1]===N[1][1]||(Qn(m,b,p,{nodeOrigin:y,nodeExtent:x,elevateNodesOnSelect:_,checkEquality:!1,zIndexMode:k}),h({nodeExtent:x}))},panBy:x=>{const{transform:m,width:b,height:p,panZoom:y,translateExtent:_}=g();return Tf({delta:x,panZoom:y,transform:m,translateExtent:_,width:b,height:p})},setCenter:async(x,m,b)=>{const{width:p,height:y,maxZoom:_,panZoom:N}=g();if(!N)return!1;const k=typeof b?.zoom<"u"?b.zoom:_;return await N.setViewport({x:p/2-x*k,y:y/2-m*k,zoom:k},{duration:b?.duration,ease:b?.ease,interpolate:b?.interpolate}),!0},cancelConnection:()=>{h({connection:{...zi}})},updateConnection:x=>{h({connection:x})},reset:()=>h({...Hr()})}},Object.is);function Ug({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:h}){const[g]=R.useState(()=>Gg({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:c,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return P.jsx(ch,{value:g,children:P.jsx($h,{children:P.jsx(Gh,{children:h})})})}function Kg({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h}){return R.useContext(yn)?P.jsx(P.Fragment,{children:e}):P.jsx(Ug,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:e})}const Qg={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Jg({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:g,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:m,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:y,onNodeContextMenu:_,onNodeDoubleClick:N,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:M,onNodesDelete:z,onEdgesDelete:O,onDelete:D,onSelectionChange:A,onSelectionDragStart:w,onSelectionDrag:E,onSelectionDragStop:S,onSelectionContextMenu:I,onSelectionStart:T,onSelectionEnd:$,onBeforeDelete:H,connectionMode:V,connectionLineType:j=De.Bezier,connectionLineStyle:Y,connectionLineComponent:B,connectionLineContainerStyle:q,deleteKeyCode:Q="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:L=!1,selectionMode:F=bt.Full,panActivationKeyCode:K="Space",multiSelectionKeyCode:U=_t()?"Meta":"Control",zoomActivationKeyCode:X=_t()?"Meta":"Control",snapToGrid:G,snapGrid:J,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:oe,nodesDraggable:se,autoPanOnNodeFocus:Se,nodesConnectable:xe,nodesFocusable:ve,nodeOrigin:Ce=ms,edgesFocusable:lt,edgesReconnectable:Le,elementsSelectable:ze=!0,defaultViewport:ue=bh,minZoom:ke=.5,maxZoom:Me=2,translateExtent:He=vt,preventScrolling:_n=!0,nodeExtent:Nn,defaultMarkerColor:xa="#b1b1b7",zoomOnScroll:va=!0,zoomOnPinch:ba=!0,panOnScroll:Ea=!1,panOnScrollSpeed:_a=.5,panOnScrollMode:Na=Fe.Free,zoomOnDoubleClick:Sa=!0,panOnDrag:Ca=!0,onPaneClick:ka,onPaneMouseEnter:Ma,onPaneMouseMove:Ia,onPaneMouseLeave:Oa,onPaneScroll:Pa,onPaneContextMenu:Aa,paneClickDistance:Ta=1,nodeClickDistance:$a=0,children:Da,onReconnect:Ra,onReconnectStart:La,onReconnectEnd:za,onEdgeContextMenu:Ha,onEdgeDoubleClick:ja,onEdgeMouseEnter:Va,onEdgeMouseMove:Ba,onEdgeMouseLeave:Fa,reconnectRadius:Ya=10,onNodesChange:Xa,onEdgesChange:Za,noDragClassName:Wa="nodrag",noWheelClassName:qa="nowheel",noPanClassName:Mo="nopan",fitView:Io,fitViewOptions:Oo,connectOnClick:Ga,attributionPosition:Ua,proOptions:Ka,defaultEdgeOptions:Qa,elevateNodesOnSelect:Ja=!0,elevateEdgesOnSelect:ec=!1,disableKeyboardA11y:Po=!1,autoPanOnConnect:tc,autoPanOnNodeDrag:nc,autoPanOnSelection:oc=!0,autoPanSpeed:rc,connectionRadius:ic,isValidConnection:sc,onError:ac,style:cc,id:Ao,nodeDragThreshold:lc,connectionDragThreshold:uc,viewport:dc,onViewportChange:fc,width:hc,height:gc,colorMode:pc="light",debug:mc,onScroll:To,ariaLabelConfig:yc,zIndexMode:$o="basic",...wc},xc){const Sn=Ao||"1",vc=Sh(pc),bc=R.useCallback(Do=>{Do.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),To?.(Do)},[To]);return P.jsx("div",{"data-testid":"rf__wrapper",...wc,onScroll:bc,style:{...cc,...Qg},ref:xc,className:ie(["react-flow",r,vc]),id:Ao,role:"application",children:P.jsxs(Kg,{nodes:e,edges:t,width:hc,height:gc,fitView:Io,fitViewOptions:Oo,minZoom:ke,maxZoom:Me,nodeOrigin:Ce,nodeExtent:Nn,zIndexMode:$o,children:[P.jsx(Nh,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:g,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:m,nodesDraggable:se,autoPanOnNodeFocus:Se,nodesConnectable:xe,nodesFocusable:ve,edgesFocusable:lt,edgesReconnectable:Le,elementsSelectable:ze,elevateNodesOnSelect:Ja,elevateEdgesOnSelect:ec,minZoom:ke,maxZoom:Me,nodeExtent:Nn,onNodesChange:Xa,onEdgesChange:Za,snapToGrid:G,snapGrid:J,connectionMode:V,translateExtent:He,connectOnClick:Ga,defaultEdgeOptions:Qa,fitView:Io,fitViewOptions:Oo,onNodesDelete:z,onEdgesDelete:O,onDelete:D,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:M,onSelectionDrag:E,onSelectionDragStart:w,onSelectionDragStop:S,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Mo,nodeOrigin:Ce,rfId:Sn,autoPanOnConnect:tc,autoPanOnNodeDrag:nc,autoPanSpeed:rc,onError:ac,connectionRadius:ic,isValidConnection:sc,selectNodesOnDrag:oe,nodeDragThreshold:lc,connectionDragThreshold:uc,onBeforeDelete:H,debug:mc,ariaLabelConfig:yc,zIndexMode:$o}),P.jsx(Wg,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:y,onNodeContextMenu:_,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:s,connectionLineType:j,connectionLineStyle:Y,connectionLineComponent:B,connectionLineContainerStyle:q,selectionKeyCode:W,selectionOnDrag:L,selectionMode:F,deleteKeyCode:Q,multiSelectionKeyCode:U,panActivationKeyCode:K,zoomActivationKeyCode:X,onlyRenderVisibleElements:te,defaultViewport:ue,translateExtent:He,minZoom:ke,maxZoom:Me,preventScrolling:_n,zoomOnScroll:va,zoomOnPinch:ba,zoomOnDoubleClick:Sa,panOnScroll:Ea,panOnScrollSpeed:_a,panOnScrollMode:Na,panOnDrag:Ca,autoPanOnSelection:oc,onPaneClick:ka,onPaneMouseEnter:Ma,onPaneMouseMove:Ia,onPaneMouseLeave:Oa,onPaneScroll:Pa,onPaneContextMenu:Aa,paneClickDistance:Ta,nodeClickDistance:$a,onSelectionContextMenu:I,onSelectionStart:T,onSelectionEnd:$,onReconnect:Ra,onReconnectStart:La,onReconnectEnd:za,onEdgeContextMenu:Ha,onEdgeDoubleClick:ja,onEdgeMouseEnter:Va,onEdgeMouseMove:Ba,onEdgeMouseLeave:Fa,reconnectRadius:Ya,defaultMarkerColor:xa,noDragClassName:Wa,noWheelClassName:qa,noPanClassName:Mo,rfId:Sn,disableKeyboardA11y:Po,nodeExtent:Nn,viewport:dc,onViewportChange:fc,nodesDraggable:se}),P.jsx(vh,{onSelectionChange:A}),Da,P.jsx(ph,{proOptions:Ka,position:Ua}),P.jsx(gh,{rfId:Sn,disableKeyboardA11y:Po})]})})}var Jm=ws(Jg);const ep=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function ey({children:e}){const t=ee(ep);return t?Nc.createPortal(e,t):null}function tp({dimensions:e,lineWidth:t,variant:n,className:o}){return P.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ie(["react-flow__background-pattern",n,o])})}function np({radius:e,className:t}){return P.jsx("circle",{cx:e,cy:e,r:e,className:ie(["react-flow__background-pattern","dots",t])})}var Re;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Re||(Re={}));const op={[Re.Dots]:1,[Re.Lines]:1,[Re.Cross]:6},rp=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ys({id:e,variant:t=Re.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:l,className:c,patternClassName:u}){const d=R.useRef(null),{transform:f,patternId:h}=ee(rp,re),g=o||op[t],v=t===Re.Dots,x=t===Re.Cross,m=Array.isArray(n)?n:[n,n],b=[m[0]*f[2]||1,m[1]*f[2]||1],p=g*f[2],y=Array.isArray(i)?i:[i,i],_=x?[p,p]:b,N=[y[0]*f[2]+_[0]/2,y[1]*f[2]+_[1]/2],k=`${h}${e||""}`;return P.jsxs("svg",{className:ie(["react-flow__background",c]),style:{...l,...xn,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[P.jsx("pattern",{id:k,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:v?P.jsx(np,{radius:p/2,className:u}):P.jsx(tp,{dimensions:_,lineWidth:r,variant:t,className:u})}),P.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}Ys.displayName="Background";const ty=R.memo(Ys);function ip(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:P.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function sp(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:P.jsx("path",{d:"M0 0h32v4.2H0z"})})}function ap(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:P.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function cp(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function lp(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Vt({children:e,className:t,...n}){return P.jsx("button",{type:"button",className:ie(["react-flow__controls-button",t]),...n,children:e})}const up=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Xs({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":h}){const g=ne(),{isInteractive:v,minZoomReached:x,maxZoomReached:m,ariaLabelConfig:b}=ee(up,re),{zoomIn:p,zoomOut:y,fitView:_}=vo(),N=()=>{p(),i?.()},k=()=>{y(),s?.()},C=()=>{_(r),a?.()},M=()=>{g.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l?.(!v)},z=f==="horizontal"?"horizontal":"vertical";return P.jsxs(wn,{className:ie(["react-flow__controls",z,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":h??b["controls.ariaLabel"],children:[t&&P.jsxs(P.Fragment,{children:[P.jsx(Vt,{onClick:N,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:m,children:P.jsx(ip,{})}),P.jsx(Vt,{onClick:k,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:x,children:P.jsx(sp,{})})]}),n&&P.jsx(Vt,{className:"react-flow__controls-fitview",onClick:C,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:P.jsx(ap,{})}),o&&P.jsx(Vt,{className:"react-flow__controls-interactive",onClick:M,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:v?P.jsx(lp,{}):P.jsx(cp,{})}),u]})}Xs.displayName="Controls";R.memo(Xs);function dp({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:h}){const{background:g,backgroundColor:v}=i||{},x=s||g||v;return P.jsx("rect",{className:ie(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:o,height:r,style:{fill:x,stroke:a,strokeWidth:l},shapeRendering:d,onClick:h?m=>h(m,e):void 0})}const fp=R.memo(dp),hp=e=>e.nodes.map(t=>t.id),$n=e=>e instanceof Function?e:()=>e;function gp({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=fp,onClick:s}){const a=ee(hp,re),l=$n(t),c=$n(e),u=$n(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.jsx(P.Fragment,{children:a.map(f=>P.jsx(mp,{id:f,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:d},f))})}function pp({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:c,x:u,y:d,width:f,height:h}=ee(g=>{const v=g.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const x=v.internals.userNode,{x:m,y:b}=v.internals.positionAbsolute,{width:p,height:y}=ye(x);return{node:x,x:m,y:b,width:p,height:y}},re);return!c||c.hidden||!Zi(c)?null:P.jsx(a,{x:u,y:d,width:f,height:h,style:c.style,selected:!!c.selected,className:o(c),color:t(c),borderRadius:r,strokeColor:n(c),strokeWidth:i,shapeRendering:s,onClick:l,id:c.id})}const mp=R.memo(pp);var yp=R.memo(gp);const wp=200,xp=150,vp=e=>!e.hidden,bp=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Fi(It(e.nodeLookup,{filter:vp}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},jr=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Ep=(e,t)=>jr(e.viewBB,t.viewBB)&&jr(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,_p="react-flow__minimap-desc";function Zs({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:h,onNodeClick:g,pannable:v=!1,zoomable:x=!1,ariaLabel:m,inversePan:b,zoomStep:p=1,offsetScale:y=5}){const _=ne(),N=R.useRef(null),{boundingRect:k,viewBB:C,rfId:M,panZoom:z,translateExtent:O,flowWidth:D,flowHeight:A,ariaLabelConfig:w}=ee(bp,Ep),E=e?.width??wp,S=e?.height??xp,I=k.width/E,T=k.height/S,$=Math.max(I,T),H=$*E,V=$*S,j=y*$,Y=k.x-(H-k.width)/2-j,B=k.y-(V-k.height)/2-j,q=H+j*2,Q=V+j*2,W=`${_p}-${M}`,L=R.useRef(0),F=R.useRef();L.current=$,R.useEffect(()=>{if(N.current&&z)return F.current=Bf({domNode:N.current,panZoom:z,getTransform:()=>_.getState().transform,getViewScale:()=>L.current}),()=>{F.current?.destroy()}},[z]),R.useEffect(()=>{F.current?.update({translateExtent:O,width:D,height:A,inversePan:b,pannable:v,zoomStep:p,zoomable:x})},[v,x,b,p,O,D,A]);const K=h?G=>{const[J,te]=F.current?.pointer(G)||[0,0];h(G,{x:J,y:te})}:void 0,U=g?R.useCallback((G,J)=>{const te=_.getState().nodeLookup.get(J).internals.userNode;g(G,te)},[]):void 0,X=m??w["minimap.ariaLabel"];return P.jsx(wn,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*$:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:P.jsxs("svg",{width:E,height:S,viewBox:`${Y} ${B} ${q} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:N,onClick:K,children:[X&&P.jsx("title",{id:W,children:X}),P.jsx(yp,{onClick:U,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),P.jsx("path",{className:"react-flow__minimap-mask",d:`M${Y-j},${B-j}h${q+j*2}v${Q+j*2}h${-q-j*2}z
|
|
7
|
-
M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Zs.displayName="MiniMap";const ny=R.memo(Zs),Np=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Sp={[st.Line]:"right",[st.Handle]:"bottom-right"};function Cp({nodeId:e,position:t,variant:n=st.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:h=!0,shouldResize:g,onResizeStart:v,onResize:x,onResizeEnd:m}){const b=_s(),p=typeof e=="string"?e:b,y=ne(),_=R.useRef(null),N=n===st.Handle,k=ee(R.useCallback(Np(N&&h),[N,h]),re),C=R.useRef(null),M=t??Sp[n];R.useEffect(()=>{if(!(!_.current||!p))return C.current||(C.current=th({domNode:_.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:O,transform:D,snapGrid:A,snapToGrid:w,nodeOrigin:E,domNode:S}=y.getState();return{nodeLookup:O,transform:D,snapGrid:A,snapToGrid:w,nodeOrigin:E,paneDomNode:S}},onChange:(O,D)=>{const{triggerNodeChanges:A,nodeLookup:w,parentLookup:E,nodeOrigin:S}=y.getState(),I=[],T={x:O.x,y:O.y},$=w.get(p);if($&&$.expandParent&&$.parentId){const H=$.origin??S,V=O.width??$.measured.width??0,j=O.height??$.measured.height??0,Y={id:$.id,parentId:$.parentId,rect:{width:V,height:j,...Wi({x:O.x??$.position.x,y:O.y??$.position.y},{width:V,height:j},$.parentId,w,H)}},B=xo([Y],w,E,S);I.push(...B),T.x=O.x?Math.max(H[0]*V,O.x):void 0,T.y=O.y?Math.max(H[1]*j,O.y):void 0}if(T.x!==void 0&&T.y!==void 0){const H={id:p,type:"position",position:{...T}};I.push(H)}if(O.width!==void 0&&O.height!==void 0){const V={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:O.width,height:O.height}};I.push(V)}for(const H of D){const V={...H,type:"position"};I.push(V)}A(I)},onEnd:({width:O,height:D})=>{const A={id:p,type:"dimensions",resizing:!1,dimensions:{width:O,height:D}};y.getState().triggerNodeChanges([A])}})),C.current.update({controlPosition:M,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:v,onResize:x,onResizeEnd:m,shouldResize:g}),()=>{C.current?.destroy()}},[M,a,l,c,u,d,v,x,m,g]);const z=M.split("-");return P.jsx("div",{className:ie(["react-flow__resize-control","nodrag",...z,n,o]),ref:_,style:{...r,scale:k,...s&&{[N?"backgroundColor":"borderColor"]:s}},children:i})}R.memo(Cp);var Ws=Object.defineProperty,kp=(e,t,n)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mp=(e,t)=>{for(var n in t)Ws(e,n,{get:t[n],enumerable:!0})},Ip=(e,t,n)=>kp(e,t+"",n),qs={};Mp(qs,{Graph:()=>we,alg:()=>_o});var Op=Object.defineProperty,Gs=(e,t)=>{for(var n in t)Op(e,n,{get:t[n],enumerable:!0})},Eo=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),o=this.successors(e);if(o)for(let r of o)n.add(r);return Array.from(n.values())}}isLeaf(e){var t;let n;return this.isDirected()?n=this.successors(e):n=this.neighbors(e),((t=n?.length)!=null?t:0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,i])=>{e(r)&&t.setNode(r,i)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},o=r=>{let i=this.parent(r);return!i||t.hasNode(i)?(n[r]=i,i):i in n?n[i]:o(i)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,o(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,o)=>(t!==void 0?this.setEdge(n,o,t):this.setEdge(n,o),o)),this}setEdge(e,t,n,o){let r,i,s,a,l=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,i=e.w,s=e.name,arguments.length===2&&(a=t,l=!0)):(r=e,i=t,s=o,arguments.length>2&&(a=n,l=!0)),r=""+r,i=""+i,s!==void 0&&(s=""+s);let c=gt(this._isDirected,r,i,s);if(c in this._edgeLabels)return l&&(this._edgeLabels[c]=a),this;if(s!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(i),this._edgeLabels[c]=l?a:this._defaultEdgeLabelFn(r,i,s);let u=Pp(this._isDirected,r,i,s);return r=u.v,i=u.w,Object.freeze(u),this._edgeObjs[c]=u,Vr(this._preds[i],r),Vr(this._sucs[r],i),this._in[i][c]=u,this._out[r][c]=u,this._edgeCount++,this}edge(e,t,n){let o=arguments.length===1?Dn(this._isDirected,e):gt(this._isDirected,e,t,n);return this._edgeLabels[o]}edgeAsObj(e,t,n){let o=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof o!="object"||o===null?{label:o}:o}hasEdge(e,t,n){return(arguments.length===1?Dn(this._isDirected,e):gt(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let o=arguments.length===1?Dn(this._isDirected,e):gt(this._isDirected,e,t,n),r=this._edgeObjs[o];if(r){let i=r.v,s=r.w;delete this._edgeLabels[o],delete this._edgeObjs[o],Br(this._preds[s],i),Br(this._sucs[i],s),delete this._in[s][o],delete this._out[i][o],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let o=Object.values(e);return n?o.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):o}};function Vr(e,t){e[t]?e[t]++:e[t]=1}function Br(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function gt(e,t,n,o){let r=""+t,i=""+n;if(!e&&r>i){let s=r;r=i,i=s}return r+""+i+""+(o===void 0?"\0":o)}function Pp(e,t,n,o){let r=""+t,i=""+n;if(!e&&r>i){let a=r;r=i,i=a}let s={v:r,w:i};return o&&(s.name=o),s}function Dn(e,t){return gt(e,t.v,t.w,t.name)}var Ap={};Gs(Ap,{read:()=>Rp,write:()=>Tp});function Tp(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:$p(e),edges:Dp(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function $p(e){return e.nodes().map(t=>{let n=e.node(t),o=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),o!==void 0&&(r.parent=o),r})}function Dp(e){return e.edges().map(t=>{let n=e.edge(t),o={v:t.v,w:t.w};return t.name!==void 0&&(o.name=t.name),n!==void 0&&(o.value=n),o})}function Rp(e){let t=new Eo(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var _o={};Gs(_o,{CycleException:()=>an,bellmanFord:()=>Us,components:()=>Hp,dijkstra:()=>sn,dijkstraAll:()=>Bp,findCycles:()=>Fp,floydWarshall:()=>Xp,isAcyclic:()=>Wp,postorder:()=>Gp,preorder:()=>Up,prim:()=>Kp,shortestPaths:()=>Qp,tarjan:()=>Qs,topsort:()=>Js});var Lp=()=>1;function Us(e,t,n,o){return zp(e,String(t),n||Lp,o||function(r){var i;return(i=e.outEdges(r))!=null?i:[]})}function zp(e,t,n,o){let r={},i,s=0,a=e.nodes(),l=function(d){let f=r[d.v],h=r[d.w];if(!f||!h)return;let g=n(d);f.distance+g<h.distance&&(r[d.w]={distance:f.distance+g,predecessor:d.v},i=!0)},c=function(){a.forEach(function(d){o(d).forEach(function(f){let h=f.v===d?f.v:f.w,g=h===f.v?f.w:f.v;l({v:h,w:g})})})};a.forEach(function(d){let f=d===t?0:Number.POSITIVE_INFINITY;r[d]={distance:f,predecessor:""}});let u=a.length;for(let d=1;d<u&&(i=!1,s++,c(),!!i);d++);if(s===u-1&&(i=!1,c(),i))throw new Error("The graph contains a negative weight cycle");return r}function Hp(e){let t={},n=[],o;function r(i){var s,a;i in t||(t[i]=!0,o.push(i),(s=e.successors(i))==null||s.forEach(r),(a=e.predecessors(i))==null||a.forEach(r))}return e.nodes().forEach(function(i){o=[],r(i),o.length&&n.push(o)}),n}var Ks=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,o=String(e);if(!(o in n)){let r=this._arr,i=r.length;return n[o]=i,r.push({key:o,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw new Error("Queue underflow");this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let o=this._arr[n].priority;if(t>o)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${o} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,o=n+1,r=e;n<t.length&&(r=t[n].priority<t[r].priority?n:r,o<t.length&&(r=t[o].priority<t[r].priority?o:r),r!==e&&(this._swap(e,r),this._heapify(r)))}_decrease(e){let t=this._arr,n=t[e].priority,o;for(;e!==0&&(o=e>>1,!(t[o].priority<n));)this._swap(e,o),e=o}_swap(e,t){let n=this._arr,o=this._keyIndices,r=n[e],i=n[t];n[e]=i,n[t]=r,o[i.key]=e,o[r.key]=t}},jp=()=>1;function sn(e,t,n,o){let r=function(i){var s;return(s=e.outEdges(i))!=null?s:[]};return Vp(e,String(t),n||jp,o||r)}function Vp(e,t,n,o){let r={},i=new Ks,s,a,l=function(c){let u=c.v!==s?c.v:c.w,d=r[u];if(!d)return;let f=n(c),h=a.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=s,i.decrease(u,h))};for(e.nodes().forEach(function(c){let u=c===t?0:Number.POSITIVE_INFINITY;r[c]={distance:u,predecessor:""},i.add(c,u)});i.size()>0;){s=i.removeMin();let c=r[s];if(!c||c.distance===Number.POSITIVE_INFINITY)break;a=c,o(s).forEach(l)}return r}function Bp(e,t,n){return e.nodes().reduce(function(o,r){return o[r]=sn(e,r,t,n),o},{})}function Qs(e){let t=0,n=[],o={},r=[];function i(s){var a;let l=o[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),(a=e.successors(s))==null||a.forEach(function(c){if(c in o){let u=o[c];u!=null&&u.onStack&&(l.lowlink=Math.min(l.lowlink,u.index))}else{i(c);let u=o[c];u&&(l.lowlink=Math.min(l.lowlink,u.lowlink))}}),l.lowlink===l.index){let c=[],u;do{u=n.pop();let d=o[u];d&&(d.onStack=!1),c.push(u)}while(s!==u);r.push(c)}}return e.nodes().forEach(function(s){s in o||i(s)}),r}function Fp(e){return Qs(e).filter(function(t){var n;let o=t[0];return o?t.length>1||t.length===1&&((n=e.outEdges(o,o))!=null?n:[]).length>0:!1})}var Yp=()=>1;function Xp(e,t,n){return Zp(e,t||Yp,n||function(o){var r;return(r=e.outEdges(o))!=null?r:[]})}function Zp(e,t,n){let o={},r=e.nodes();return r.forEach(function(i){let s={};o[i]=s,s[i]={distance:0,predecessor:""},r.forEach(function(a){i!==a&&(s[a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(i).forEach(function(a){let l=a.v===i?a.w:a.v,c=t(a);s[l]={distance:c,predecessor:i}})}),r.forEach(function(i){let s=o[i];s&&r.forEach(function(a){let l=o[a];l&&r.forEach(function(c){let u=l[i],d=s[c],f=l[c];if(u&&d&&f){let h=u.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)}})})}),o}var an=class extends Error{constructor(e){super(e),this.name="CycleException"}};function Js(e){let t={},n={},o=[];function r(i){var s;if(i in n)throw new an;i in t||(n[i]=!0,t[i]=!0,(s=e.predecessors(i))==null||s.forEach(r),delete n[i],o.push(i))}if(e.sinks().forEach(r),Object.keys(t).length!==e.nodeCount())throw new an;return o}function Wp(e){try{Js(e)}catch(t){if(t instanceof an)return!1;throw t}return!0}function qp(e,t,n,o,r){Array.isArray(t)||(t=[t]);let i=(a=>{var l;return(l=e.isDirected()?e.successors(a):e.neighbors(a))!=null?l:[]}),s={};return t.forEach(function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);r=ea(e,a,n==="post",s,i,o,r)}),r}function ea(e,t,n,o,r,i,s){return t in o||(o[t]=!0,n||(s=i(s,t)),r(t).forEach(function(a){s=ea(e,a,n,o,r,i,s)}),n&&(s=i(s,t))),s}function ta(e,t,n){return qp(e,t,n,function(o,r){return o.push(r),o},[])}function Gp(e,t){return ta(e,t,"post")}function Up(e,t){return ta(e,t,"pre")}function Kp(e,t){var n;let o=new Eo,r={},i=new Ks,s;function a(u){let d=u.v===s?u.w:u.v,f=i.priority(d);if(f!==void 0){let h=t(u);h<f&&(r[d]=s,i.decrease(d,h))}}if(e.nodeCount()===0)return o;e.nodes().forEach(function(u){i.add(u,Number.POSITIVE_INFINITY),o.setNode(u)});let l=e.nodes()[0];l!==void 0&&i.decrease(l,0);let c=!1;for(;i.size()>0;){if(s=i.removeMin(),s in r)o.setEdge(s,r[s]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}(n=e.nodeEdges(s))==null||n.forEach(a)}return o}function Qp(e,t,n,o){return Jp(e,t,n,o??(r=>{var i;return(i=e.outEdges(r))!=null?i:[]}))}function Jp(e,t,n,o){if(n===void 0)return sn(e,t,n,o);let r=!1,i=e.nodes();for(let s=0;s<i.length;s++){let a=i[s];if(a===void 0)continue;let l=o(a);for(let c=0;c<l.length;c++){let u=l[c];if(!u)continue;let d=u.v===a?u.v:u.w,f=d===u.v?u.w:u.v;n({v:d,w:f})<0&&(r=!0)}if(r)return Us(e,t,n,o)}return sn(e,t,n,o)}var we=Eo;function ct(e,t,n,o){let r=o;for(;e.hasNode(r);)r=No(o);return n.dummy=t,e.setNode(r,n),r}function e0(e){let t=new we().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let o=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:o.weight+r.weight,minlen:Math.max(o.minlen,r.minlen)})}),t}function na(e){let t=new we({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Fr(e,t){let n=e.x,o=e.y,r=t.x-n,i=t.y-o,s=e.width/2,a=e.height/2;if(!r&&!i)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(i)*s>Math.abs(r)*a?(i<0&&(a=-a),l=a*r/i,c=a):(r<0&&(s=-s),l=s,c=s*i/r),{x:n+l,y:o+c}}function At(e){let t=St(ra(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let o=e.node(n),r=o.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][o.order]=n)}),t}function t0(e){let t=e.nodes().map(o=>{let r=e.node(o).rank;return r===void 0?Number.MAX_VALUE:r}),n=Ee(Math.min,t);e.nodes().forEach(o=>{let r=e.node(o);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function n0(e){let t=e.nodes().map(s=>e.node(s).rank).filter(s=>s!==void 0),n=Ee(Math.min,t),o=[];e.nodes().forEach(s=>{let a=e.node(s).rank-n;o[a]||(o[a]=[]),o[a].push(s)});let r=0,i=e.graph().nodeRankFactor;Array.from(o).forEach((s,a)=>{s===void 0&&a%i!==0?--r:s!==void 0&&r&&s.forEach(l=>e.node(l).rank+=r)})}function Yr(e,t,n,o){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=o),ct(e,"border",r,t)}function o0(e,t=oa){let n=[];for(let o=0;o<e.length;o+=t){let r=e.slice(o,o+t);n.push(r)}return n}var oa=65535;function Ee(e,t){if(t.length>oa){let n=o0(t);return e(...n.map(o=>e(...o)))}else return e(...t)}function ra(e){let t=e.nodes().map(n=>{let o=e.node(n).rank;return o===void 0?Number.MIN_VALUE:o});return Ee(Math.max,t)}function r0(e,t){let n={lhs:[],rhs:[]};return e.forEach(o=>{t(o)?n.lhs.push(o):n.rhs.push(o)}),n}function i0(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function ia(e,t){return t()}var s0=0;function No(e){let t=++s0;return e+(""+t)}function St(e,t,n=1){t==null&&(t=e,e=0);let o=i=>i<t;n<0&&(o=i=>t<i);let r=[];for(let i=e;o(i);i+=n)r.push(i);return r}function cn(e,t){let n={};for(let o of t)e[o]!==void 0&&(n[o]=e[o]);return n}function bn(e,t){let n;return typeof t=="string"?n=o=>o[t]:n=t,Object.entries(e).reduce((o,[r,i])=>(o[r]=n(i,r),o),{})}function a0(e,t){return e.reduce((n,o,r)=>(n[o]=t[r],n),{})}var En="\0";function sa(e,t,n){var o,r,i,s,a,l;if(!(e&&t&&n&&t.dummy==="edge"&&n.dummy==="edge"&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let c=!0;t.edgeObj.w===n.edgeObj.w&&(c=!1);let u=c?(r=(o=e[t.edgeObj.v])==null?void 0:o.rank)!=null?r:NaN+1:(s=(i=e[t.edgeObj.w])==null?void 0:i.rank)!=null?s:NaN-1,d=Object.entries(e).find(v=>{var x,m;return((x=v[1].edgeObj)==null?void 0:x.v)===t.edgeObj.v&&((m=v[1].edgeObj)==null?void 0:m.w)===t.edgeObj.w&&v[1].rank===u}),f=Object.entries(e).find(v=>{var x,m;return((x=v[1].edgeObj)==null?void 0:x.v)===n.edgeObj.v&&((m=v[1].edgeObj)==null?void 0:m.w)===n.edgeObj.w&&v[1].rank===u});if(!d||!f)return 0;let h=(a=d[1].order)!=null?a:NaN,g=(l=f[1].order)!=null?l:NaN;return isNaN(h-g)?0:h-g}var c0="3.1.1",l0=class{constructor(){Ip(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Xr(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Xr(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,u0)),n=n._prev;return"["+e.join(", ")+"]"}};function Xr(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function u0(e,t){if(e!=="_next"&&e!=="_prev")return t}var d0=l0,f0=()=>1;function h0(e,t){if(e.nodeCount()<=1)return[];let n=p0(e,t||f0);return g0(n.graph,n.buckets,n.zeroIdx).flatMap(o=>e.outEdges(o.v,o.w)||[])}function g0(e,t,n){var o;let r=[],i=t[t.length-1],s=t[0],a;for(;e.nodeCount();){for(;a=s.dequeue();)Rn(e,t,n,a);for(;a=i.dequeue();)Rn(e,t,n,a);if(e.nodeCount()){for(let l=t.length-2;l>0;--l)if(a=(o=t[l])==null?void 0:o.dequeue(),a){r=r.concat(Rn(e,t,n,a,!0)||[]);break}}}return r}function Rn(e,t,n,o,r){let i=[],s=r?i:void 0;return(e.inEdges(o.v)||[]).forEach(a=>{let l=e.edge(a),c=e.node(a.v);r&&i.push({v:a.v,w:a.w}),c.out-=l,to(t,n,c)}),(e.outEdges(o.v)||[]).forEach(a=>{let l=e.edge(a),c=a.w,u=e.node(c);u.in-=l,to(t,n,u)}),e.removeNode(o.v),s}function p0(e,t){let n=new we,o=0,r=0;e.nodes().forEach(a=>{n.setNode(a,{v:a,in:0,out:0})}),e.edges().forEach(a=>{let l=n.edge(a.v,a.w)||0,c=t(a),u=l+c;n.setEdge(a.v,a.w,u);let d=n.node(a.v),f=n.node(a.w);r=Math.max(r,d.out+=c),o=Math.max(o,f.in+=c)});let i=m0(r+o+3).map(()=>new d0),s=o+1;return n.nodes().forEach(a=>{to(i,s,n.node(a))}),{graph:n,buckets:i,zeroIdx:s}}function to(e,t,n){var o,r,i;n.out?n.in?(i=e[n.out-n.in+t])==null||i.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(o=e[0])==null||o.enqueue(n)}function m0(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function y0(e,t){(e.graph().acyclicer==="greedy"?h0(e,n(e)):w0(e,t??null)).forEach(o=>{let r=e.edge(o);e.removeEdge(o),r.forwardName=o.name,r.reversed=!0,e.setEdge(o.w,o.v,r,No("rev"))});function n(o){return r=>o.edge(r).weight}}function w0(e,t){let n=[],o={},r={};function i(l){Object.hasOwn(r,l)||(r[l]=!0,o[l]=!0,e.outEdges(l).forEach(c=>{Object.hasOwn(o,c.w)?n.push(c):i(c.w)}),delete o[l])}function s(l){var c;Object.hasOwn(r,l)||(r[l]=!0,o[l]=!0,(c=e.outEdges(l))==null||c.forEach(u=>{var d,f;Object.hasOwn(o,u.w)||((d=t.node(l))==null?void 0:d.rank)>((f=t.node(u.w))==null?void 0:f.rank)&&v0(e,u.w,u)?n.push(u):s(u.w)}),delete o[l])}let a=i;return t&&typeof t.node=="function"&&(a=s),e.sources().forEach(a),e.nodes().forEach(a),n}function x0(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let o=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,o)}})}function v0(e,t,n){let o=new Set;function r(i){var s;if(e.sources().includes(i))return!0;o.add(i);for(let a of(s=e.inEdges(i))!=null?s:[])if(!(a.v===n.v&&a.w===n.w)&&!o.has(a.v)&&r(a.v))return!0;return!1}return r(t)}function b0(e){e.graph().dummyChains=[],e.edges().forEach(t=>E0(e,t))}function E0(e,t){let n=t.v,o=e.node(n).rank,r=t.w,i=e.node(r).rank,s=t.name,a=e.edge(t),l=a.labelRank;if(i===o+1)return;e.removeEdge(t);let c,u,d;for(d=0,++o;o<i;++d,++o)a.points=[],u={width:0,height:0,edgeLabel:a,edgeObj:t,rank:o},c=ct(e,"edge",u,"_d"),o===l&&(u.width=a.width,u.height=a.height,u.dummy="edge-label",u.labelpos=a.labelpos),e.setEdge(n,c,{weight:a.weight},s),d===0&&e.graph().dummyChains.push(c),n=c;e.setEdge(n,r,{weight:a.weight},s)}function _0(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),o=n.edgeLabel,r;for(e.setEdge(n.edgeObj,o);n.dummy;)r=e.successors(t)[0],e.removeNode(t),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height),t=r,n=e.node(t)})}function So(e){let t={};function n(o){let r=e.node(o);if(Object.hasOwn(t,o))return r.rank;t[o]=!0;let i=e.outEdges(o),s=i?i.map(l=>l==null?Number.POSITIVE_INFINITY:n(l.w)-e.edge(l).minlen):[],a=Ee(Math.min,s);return a===Number.POSITIVE_INFINITY&&(a=0),r.rank=a}e.sources().forEach(n)}function at(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var aa=N0;function N0(e){let t=new we({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let o=n[0],r=e.nodeCount();t.setNode(o,{});let i,s;for(;S0(t,e)<r&&(i=C0(t,e),!!i);)s=t.hasNode(i.v)?at(e,i):-at(e,i),k0(t,e,s);return t}function S0(e,t){function n(o){let r=t.nodeEdges(o);r&&r.forEach(i=>{let s=i.v,a=o===s?i.w:s;!e.hasNode(a)&&!at(t,i)&&(e.setNode(a,{}),e.setEdge(o,a,{}),n(a))})}return e.nodes().forEach(n),e.nodeCount()}function C0(e,t){return t.edges().reduce((n,o)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(o.v)!==e.hasNode(o.w)&&(r=at(t,o)),r<n[0]?[r,o]:n},[Number.POSITIVE_INFINITY,null])[1]}function k0(e,t,n){e.nodes().forEach(o=>t.node(o).rank+=n)}var{preorder:M0,postorder:I0}=_o,O0=Ge;Ge.initLowLimValues=ko;Ge.initCutValues=Co;Ge.calcCutValue=ca;Ge.leaveEdge=ua;Ge.enterEdge=da;Ge.exchangeEdges=fa;function Ge(e){e=e0(e),So(e);let t=aa(e);ko(t),Co(t,e);let n,o;for(;n=ua(t);)o=da(t,e,n),fa(t,e,n,o)}function Co(e,t){let n=I0(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(o=>P0(e,t,o))}function P0(e,t,n){let o=e.node(n).parent,r=e.edge(n,o);r.cutvalue=ca(e,t,n)}function ca(e,t,n){let o=e.node(n).parent,r=!0,i=t.edge(n,o),s=0;i||(r=!1,i=t.edge(o,n)),s=i.weight;let a=t.nodeEdges(n);return a&&a.forEach(l=>{let c=l.v===n,u=c?l.w:l.v;if(u!==o){let d=c===r,f=t.edge(l).weight;if(s+=d?f:-f,T0(e,n,u)){let h=e.edge(n,u).cutvalue;s+=d?-h:h}}}),s}function ko(e,t){arguments.length<2&&(t=e.nodes()[0]),la(e,{},1,t)}function la(e,t,n,o,r){let i=n,s=e.node(o);t[o]=!0;let a=e.neighbors(o);return a&&a.forEach(l=>{Object.hasOwn(t,l)||(n=la(e,t,n,l,o))}),s.low=i,s.lim=n++,r?s.parent=r:delete s.parent,n}function ua(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function da(e,t,n){let o=n.v,r=n.w;t.hasEdge(o,r)||(o=n.w,r=n.v);let i=e.node(o),s=e.node(r),a=i,l=!1;return i.lim>s.lim&&(a=s,l=!0),t.edges().filter(c=>l===Zr(e,e.node(c.v),a)&&l!==Zr(e,e.node(c.w),a)).reduce((c,u)=>at(t,u)<at(t,c)?u:c)}function fa(e,t,n,o){let r=n.v,i=n.w;e.removeEdge(r,i),e.setEdge(o.v,o.w,{}),ko(e),Co(e,t),A0(e,t)}function A0(e,t){let n=e.nodes().find(r=>!e.node(r).parent);if(!n)return;let o=M0(e,[n]);o=o.slice(1),o.forEach(r=>{let i=e.node(r).parent,s=t.edge(r,i),a=!1;s||(s=t.edge(i,r),a=!0),t.node(r).rank=t.node(i).rank+(a?s.minlen:-s.minlen)})}function T0(e,t,n){return e.hasEdge(t,n)}function Zr(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var $0=D0;function D0(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Wr(e);break;case"tight-tree":L0(e);break;case"longest-path":R0(e);break;case"none":break;default:Wr(e)}}var R0=So;function L0(e){So(e),aa(e)}function Wr(e){O0(e)}var z0=H0;function H0(e){let t=V0(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(o=>{let r=e.node(o),i=r.edgeObj,s=j0(e,t,i.v,i.w),a=s.path,l=s.lca,c=0,u=a[c],d=!0;for(;o!==i.w;){if(r=e.node(o),d){for(;(u=a[c])!==l&&e.node(u).maxRank<r.rank;)c++;u===l&&(d=!1)}if(!d){for(;c<a.length-1&&e.node(a[c+1]).minRank<=r.rank;)c++;u=a[c]}u!==void 0&&e.setParent(o,u),o=e.successors(o)[0]}})}function j0(e,t,n,o){let r=[],i=[],s=Math.min(t[n].low,t[o].low),a=Math.max(t[n].lim,t[o].lim),l;l=n;do l=e.parent(l),r.push(l);while(l&&(t[l].low>s||a>t[l].lim));let c=l,u=o;for(;(u=e.parent(u))!==c;)i.push(u);return{path:r.concat(i.reverse()),lca:c}}function V0(e){let t={},n=0;function o(r){let i=n;e.children(r).forEach(o),t[r]={low:i,lim:n++}}return e.children(En).forEach(o),t}function B0(e){let t=ct(e,"root",{},"_root"),n=F0(e),o=Object.values(n),r=Ee(Math.max,o)-1,i=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(a=>e.edge(a).minlen*=i);let s=Y0(e)+1;e.children(En).forEach(a=>{ha(e,t,i,s,r,n,a)}),e.graph().nodeRankFactor=i}function ha(e,t,n,o,r,i,s){var a;let l=e.children(s);if(!l.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:n});return}let c=Yr(e,"_bt"),u=Yr(e,"_bb"),d=e.node(s);e.setParent(c,s),d.borderTop=c,e.setParent(u,s),d.borderBottom=u,l.forEach(f=>{var h;ha(e,t,n,o,r,i,f);let g=e.node(f),v=g.borderTop?g.borderTop:f,x=g.borderBottom?g.borderBottom:f,m=g.borderTop?o:2*o,b=v!==x?1:r-((h=i[s])!=null?h:0)+1;e.setEdge(c,v,{weight:m,minlen:b,nestingEdge:!0}),e.setEdge(x,u,{weight:m,minlen:b,nestingEdge:!0})}),e.parent(s)||e.setEdge(t,c,{weight:0,minlen:r+((a=i[s])!=null?a:0)})}function F0(e){let t={};function n(o,r){let i=e.children(o);i&&i.length&&i.forEach(s=>n(s,r+1)),t[o]=r}return e.children(En).forEach(o=>n(o,1)),t}function Y0(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function X0(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var Z0=W0;function W0(e){function t(n){let o=e.children(n),r=e.node(n);if(o.length&&o.forEach(t),r&&Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let i=r.minRank,s=r.maxRank+1;i<s;++i)qr(e,"borderLeft","_bl",n,r,i),qr(e,"borderRight","_br",n,r,i)}}e.children(En).forEach(t)}function qr(e,t,n,o,r,i){let s={width:0,height:0,rank:i,borderType:t},a=r[t][i-1],l=ct(e,"border",s,n);r[t][i]=l,e.setParent(l,o),a&&e.setEdge(a,l,{weight:1})}function q0(e){var t;let n=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(n==="lr"||n==="rl")&&ga(e)}function G0(e){var t;let n=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(n==="bt"||n==="rl")&&U0(e),(n==="lr"||n==="rl")&&(K0(e),ga(e))}function ga(e){e.nodes().forEach(t=>Gr(e.node(t))),e.edges().forEach(t=>Gr(e.edge(t)))}function Gr(e){let t=e.width;e.width=e.height,e.height=t}function U0(e){e.nodes().forEach(t=>Ln(e.node(t))),e.edges().forEach(t=>{var n;let o=e.edge(t);(n=o.points)==null||n.forEach(Ln),Object.hasOwn(o,"y")&&Ln(o)})}function Ln(e){e.y=-e.y}function K0(e){e.nodes().forEach(t=>zn(e.node(t))),e.edges().forEach(t=>{var n;let o=e.edge(t);(n=o.points)==null||n.forEach(zn),Object.hasOwn(o,"x")&&zn(o)})}function zn(e){let t=e.x;e.x=e.y,e.y=t}function Q0(e,t=null){let n={},o=e.nodes().filter(c=>!e.children(c).length),r=o.map(c=>e.node(c).rank),i=Ee(Math.max,r),s=St(i+1).map(()=>[]);function a(c){if(n[c])return;n[c]=!0;let u=e.node(c);s[u.rank].push(c);let d=e.successors(c);d&&[...d].sort((f,h)=>l(f,h)).forEach(a)}o.sort((c,u)=>e.node(c).rank-e.node(u).rank).forEach(a);function l(c,u){let d=e.node(c),f=e.node(u);return sa(t,d,f)}return s}function J0(e,t){let n=0;for(let o=1;o<t.length;++o)n+=em(e,t[o-1],t[o]);return n}function em(e,t,n){let o=a0(n,n.map((c,u)=>u)),r=t.flatMap(c=>{let u=e.outEdges(c);return u?u.map(d=>({pos:o[d.w],weight:e.edge(d).weight})).sort((d,f)=>d.pos-f.pos):[]}),i=1;for(;i<n.length;)i<<=1;let s=2*i-1;i-=1;let a=new Array(s).fill(0),l=0;return r.forEach(c=>{let u=c.pos+i;a[u]+=c.weight;let d=0;for(;u>0;)u%2&&(d+=a[u+1]),u=u-1>>1,a[u]+=c.weight;l+=c.weight*d}),l}function tm(e,t=[]){return t.map(n=>{let o=e.inEdges(n);if(!o||!o.length)return{v:n};{let r=o.reduce((i,s)=>{let a=e.edge(s),l=e.node(s.v);return{sum:i.sum+a.weight*l.order,weight:i.weight+a.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function nm(e,t){let n={};e.forEach((r,i)=>{let s={indegree:0,in:[],out:[],vs:[r.v],i};r.barycenter!==void 0&&(s.barycenter=r.barycenter,s.weight=r.weight),n[r.v]=s}),t.edges().forEach(r=>{let i=n[r.v],s=n[r.w];i!==void 0&&s!==void 0&&(s.indegree++,i.out.push(s))});let o=Object.values(n).filter(r=>!r.indegree);return om(o)}function om(e){let t=[];function n(r){return i=>{i.merged||(i.barycenter===void 0||r.barycenter===void 0||i.barycenter>=r.barycenter)&&rm(r,i)}}function o(r){return i=>{i.in.push(r),--i.indegree===0&&e.push(i)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(o(r))}return t.filter(r=>!r.merged).map(r=>cn(r,["vs","i","barycenter","weight"]))}function rm(e,t){let n=0,o=0;e.weight&&(n+=e.barycenter*e.weight,o+=e.weight),t.weight&&(n+=t.barycenter*t.weight,o+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/o,e.weight=o,e.i=Math.min(t.i,e.i),t.merged=!0}function im(e,t,n,o,r){let i={},s=null,a=null,l=r;typeof t=="boolean"?(l=t,i={}):t&&(i=t,s=n??null,a=o??null);let c=r0(e,m=>Object.hasOwn(m,"barycenter")),u=c.lhs,d=c.rhs.sort((m,b)=>b.i-m.i),f=[],h=0,g=0,v=0;u.sort(sm(a,s,!!l));for(let[m,b]of Object.entries(i)){let p=u.findIndex(y=>y.vs[0]===m);u.splice(p+1,0,b)}v=Ur(f,d,v),u.forEach(m=>{v+=m.vs.length,f.push(m.vs),h+=m.barycenter*m.weight,g+=m.weight,v=Ur(f,d,v)});let x={vs:f.flat(1)};return g&&(x.barycenter=h/g,x.weight=g),x}function Ur(e,t,n){let o;for(;t.length&&(o=t[t.length-1]).i<=n;)t.pop(),e.push(o.vs),n++;return n}function sm(e,t,n){return(o,r)=>{if(o.barycenter<r.barycenter)return-1;if(o.barycenter>r.barycenter)return 1;if(e&&(typeof o.vs[0]=="string"||typeof r.vs[0]=="string")){let i=e.node(o.vs[0]),s=e.node(r.vs[0]),a=sa(t,i,s);if(a!==0)return a}return n?r.i-o.i:o.i-r.i}}function pa(e,t,n,o,r){var i,s,a,l,c,u,d,f,h,g,v;let x=null,m=r;typeof o=="boolean"?(m=o,x=null):o!==void 0&&(x=o);let b=e.children(t),p=e.node(t),y=p?p.borderLeft:void 0,_=p?p.borderRight:void 0,N={};y&&(b=b.filter(D=>D!==y&&D!==_));let k=tm(e,b);k.forEach(D=>{if(e.children(D.v).length){let{result:A}=pa(e,D.v,n,x,m);N[D.v]=A,Object.hasOwn(A,"barycenter")&&cm(D,A)}});let C=nm(k,n);am(C,N);let M={},z=!1;for(let D=0;D<C.length;D++)for(let A=D+1;A<C.length;A++)if(!(!C[D]||!C[A]||!((i=C[D])!=null&&i.barycenter)||!((s=C[A])!=null&&s.barycenter))&&((a=C[D])==null?void 0:a.barycenter)===C[A].barycenter){let w=(c=(l=C[D])==null?void 0:l.vs[0])!=null?c:"",E=(d=(u=C[A])==null?void 0:u.vs[0])!=null?d:"",S=e.node(w),I=e.node(E);if(S.dummy==="edge"&&I.dummy==="edge"&&((f=S.edgeObj)==null?void 0:f.v)===((h=I.edgeObj)==null?void 0:h.v)&&((g=S.edgeObj)==null?void 0:g.w)===((v=I.edgeObj)==null?void 0:v.w))if(S.edgeLabel.reversed){M[E]=C[D],C.splice(D,1),D--;break}else M[w]=C[A],C.splice(A,1),A--;else z=!0}let O=im(C,M,x,e,m);if(y&&_){O.vs=[y,O.vs,_].flat(1);let D=e.predecessors(y);if(D&&D.length){let A=e.node(D[0]),w=e.predecessors(_),E=e.node(w[0]);Object.hasOwn(O,"barycenter")||(O.barycenter=0,O.weight=0),O.barycenter=(O.barycenter*O.weight+A.order+E.order)/(O.weight+2),O.weight+=2}}return Object.defineProperty(O,"result",{value:O,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(O,"usedBias",{value:z,enumerable:!1,configurable:!0,writable:!0}),O}function am(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(o=>t[o]?t[o].vs:o)})}function cm(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function lm(e,t,n,o){o||(o=e.nodes());let r=um(e),i=new we({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(s=>e.node(s));return o.forEach(s=>{let a=e.node(s),l=e.parent(s);if(a.rank===t||a.minRank<=t&&t<=a.maxRank){i.setNode(s),i.setParent(s,l||r);let c=e[n](s);c&&c.forEach(u=>{let d=u.v===s?u.w:u.v,f=i.edge(d,s),h=f!==void 0?f.weight:0;i.setEdge(d,s,{weight:e.edge(u).weight+h})}),Object.hasOwn(a,"minRank")&&i.setNode(s,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]})}}),i}function um(e){let t;for(;e.hasNode(t=No("_root")););return t}function dm(e,t,n){let o={},r;n.forEach(i=>{let s=e.parent(i),a,l;for(;s;){if(a=e.parent(s),a?(l=o[a],o[a]=s):(l=r,r=s),l&&l!==s){t.setEdge(l,s);return}s=a}})}function ma(e,t={},n=null){if(typeof t.customOrder=="function"){t.customOrder(e,ma);return}let o=ra(e),r=Kr(e,St(1,o+1),"inEdges"),i=Kr(e,St(o-1,-1,-1),"outEdges"),s=Q0(e,n);if(Qr(e,s),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){fm(u%2?r:i,u%4>=2,c,n),s=At(e);let f=J0(e,s);f<a?(d=0,l=Object.assign({},s),a=f):f===a&&(l=structuredClone(s))}Qr(e,l)}function Kr(e,t,n){let o=new Map,r=(i,s)=>{o.has(i)||o.set(i,[]),o.get(i).push(s)};for(let i of e.nodes()){let s=e.node(i);if(typeof s.rank=="number"&&r(s.rank,i),typeof s.minRank=="number"&&typeof s.maxRank=="number")for(let a=s.minRank;a<=s.maxRank;a++)a!==s.rank&&r(a,i)}return t.map(function(i){return lm(e,i,n,o.get(i)||[])})}function fm(e,t,n,o){let r=!0,i=new we;e.forEach(function(s){n.forEach(u=>i.setEdge(u.left,u.right));let a=s.graph().root,{result:l,usedBias:c}=pa(s,a,i,o,r);t&&c&&(r=!r),l.vs.forEach((u,d)=>s.node(u).order=d),dm(s,i,l.vs)})}function Qr(e,t){Object.values(t).forEach(n=>n.forEach((o,r)=>e.node(o).order=r))}function hm(e,t){let n={};function o(r,i){let s=0,a=0,l=r.length,c=i[i.length-1];return i.forEach((u,d)=>{let f=pm(e,u),h=f?e.node(f).order:l;(f||u===c)&&(i.slice(a,d+1).forEach(g=>{let v=e.predecessors(g);v&&v.forEach(x=>{let m=e.node(x),b=m.order;(b<s||h<b)&&!(m.dummy&&e.node(g).dummy)&&ya(n,x,g)})}),a=d+1,s=h)}),i}return t.length&&t.reduce(o),n}function gm(e,t){let n={};function o(i,s,a,l,c){St(s,a).forEach(u=>{let d=i[u];if(d!==void 0&&e.node(d).dummy){let f=e.predecessors(d);f&&f.forEach(h=>{if(h===void 0)return;let g=e.node(h);g.dummy&&(g.order<l||g.order>c)&&ya(n,h,d)})}})}function r(i,s){let a=-1,l=-1,c=0;return s.forEach((u,d)=>{if(e.node(u).dummy==="border"){let f=e.predecessors(u);if(f&&f.length){let h=f[0];if(h===void 0)return;l=e.node(h).order,o(s,c,d,a,l),c=d,a=l}}o(s,c,s.length,l,i.length)}),s}return t.length&&t.reduce(r),n}function pm(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(o=>e.node(o).dummy)}}function ya(e,t,n){if(t>n){let r=t;t=n,n=r}let o=e[t];o||(e[t]=o={}),o[n]=!0}function mm(e,t,n){if(t>n){let r=t;t=n,n=r}let o=e[t];return o!==void 0&&Object.hasOwn(o,n)}function ym(e,t,n,o,r){let i={},s={},a={};return t.forEach(l=>{l.forEach((c,u)=>{i[c]=c,s[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1,u=-1,d=!1,f=l,h=l.findIndex(g=>r?.includes(g)||Jr(g,e,r));h>0&&(f=[l[h],...l.slice(0,h),...l.slice(h+1)],d=!0),f.forEach(g=>{var v;let x=o(g);if(x&&x.length){r!=null&&r.includes(g)&&(x=x.filter(p=>Jr(p,e,r)));let m=x.sort((p,y)=>{let _=a[p],N=a[y];return(_!==void 0?_:0)-(N!==void 0?N:0)}),b=(m.length-1)/2;for(let p=Math.floor(b),y=Math.ceil(b);p<=y;++p){let _=m[p];if(_===void 0)continue;let N=a[_];if(N!==void 0&&s[g]===g&&c<N&&a[_]!==u&&!mm(n,g,_)){let k=i[_];k!==void 0&&(s[_]=g,s[g]=i[g]=k,c=N,d&&(c=-1,u=(v=a[_])!=null?v:-1,d=!1))}}}})}),{root:i,align:s}}function wm(e,t,n,o,r=!1){let i={},s=xm(e,t,n,r),a=r?"borderLeft":"borderRight";function l(h,g){let v=s.nodes().slice(),x={},m=v.pop();for(;m;){if(x[m])h(m);else{x[m]=!0,v.push(m);for(let b of g(m))v.push(b)}m=v.pop()}}function c(h){let g=s.inEdges(h);g?i[h]=g.reduce((v,x)=>{var m;let b=(m=i[x.v])!=null?m:0,p=s.edge(x);return Math.max(v,b+(p!==void 0?p:0))},0):i[h]=0}function u(h){let g=s.outEdges(h),v=Number.POSITIVE_INFINITY;g&&(v=g.reduce((m,b)=>{let p=i[b.w],y=s.edge(b);return Math.min(m,(p!==void 0?p:0)-(y!==void 0?y:0))},Number.POSITIVE_INFINITY));let x=e.node(h);v!==Number.POSITIVE_INFINITY&&x.borderType!==a&&(i[h]=Math.max(i[h]!==void 0?i[h]:0,v))}function d(h){return s.predecessors(h)||[]}function f(h){return s.successors(h)||[]}return l(c,d),l(u,f),Object.keys(o).forEach(h=>{var g;let v=n[h];v!==void 0&&(i[h]=(g=i[v])!=null?g:0)}),i}function xm(e,t,n,o){let r=new we,i=e.graph(),s=Nm(i.nodesep,i.edgesep,o);return t.forEach(a=>{let l;a.forEach(c=>{let u=n[c];if(u!==void 0){if(r.setNode(u),l!==void 0){let d=n[l];if(d!==void 0){let f=r.edge(d,u);r.setEdge(d,u,Math.max(s(e,c,l),f||0))}}l=c}})}),r}function vm(e,t){return Object.values(t).reduce((n,o)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(o).forEach(([a,l])=>{let c=Sm(e,a)/2;r=Math.max(l+c,r),i=Math.min(l-c,i)});let s=r-i;return s<n[0]&&(n=[s,o]),n},[Number.POSITIVE_INFINITY,null])[1]}function bm(e,t){let n=Object.values(t),o=Ee(Math.min,n),r=Ee(Math.max,n);["u","d"].forEach(i=>{["l","r"].forEach(s=>{let a=i+s,l=e[a];if(!l||l===t)return;let c=Object.values(l),u=o-Ee(Math.min,c);s!=="l"&&(u=r-Ee(Math.max,c)),u&&(e[a]=bn(l,d=>d+u))})})}function Em(e,t=void 0){let n=e.ul;return n?bn(n,(o,r)=>{var i,s;if(t){let l=t.toLowerCase(),c=e[l];if(c&&c[r]!==void 0)return c[r]}let a=Object.values(e).map(l=>{let c=l[r];return c!==void 0?c:0}).sort((l,c)=>l-c);return(((i=a[1])!=null?i:0)+((s=a[2])!=null?s:0))/2}):{}}function _m(e,t){let n=At(e),o=Object.assign(hm(e,n),gm(e,n)),r={},i;["u","d"].forEach(a=>{i=a==="u"?n:Object.values(n).reverse(),["l","r"].forEach(l=>{l==="r"&&(i=i.map(d=>Object.values(d).reverse()));let c=ym(e,i,o,d=>(a==="u"?e.predecessors(d):e.successors(d))||[],t),u=wm(e,i,c.root,c.align,l==="r");l==="r"&&(u=bn(u,d=>-d)),r[a+l]=u})});let s=vm(e,r);return bm(r,s),Em(r,e.graph().align)}function Nm(e,t,n){return(o,r,i)=>{let s=o.node(r),a=o.node(i),l=0,c;if(l+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=-s.width/2;break;case"r":c=s.width/2;break}if(c&&(l+=n?c:-c),c=void 0,l+=(s.dummy?t:e)/2,l+=(a.dummy?t:e)/2,l+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=a.width/2;break;case"r":c=-a.width/2;break}return c&&(l+=n?c:-c),l}}function Sm(e,t){return e.node(t).width}function Jr(e,t,n){var o;if(!n)return!1;let r=(o=t.node(e))==null?void 0:o.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),s=n.indexOf(r?.w);return i!==-1&&s!==-1&&i===(s+1)%n.length||i===(s-1)%n.length}function Cm(e,t){e=na(e),km(e),Object.entries(_m(e,t)).forEach(([n,o])=>e.node(n).x=o)}function km(e){let t=At(e),n=e.graph(),o=n.ranksep,r=n.rankalign,i=0;t.forEach(s=>{let a=s.reduce((l,c)=>{var u;let d=(u=e.node(c).height)!=null?u:0;return l>d?l:d},0);s.forEach(l=>{let c=e.node(l);r==="top"?c.y=i+c.height/2:r==="bottom"?c.y=i+a-c.height/2:c.y=i+a/2}),i+=a+o})}var ei=new WeakMap;function Mm(e,t={}){return wa(e,ia,t),e}function ti(e,t,n){let o=t;for(;o!==void 0;){let r=e.parent(o);if(r===n)return o;o=r}}function wa(e,t,n){var o;let r=e.nodes().filter(b=>e.children(b).length),i={};r.forEach(b=>{let p=e.node(b);if(p&&p.rankdir){let y=new we({multigraph:!0,compound:!0});y.setGraph({rankdir:p.rankdir});let _=e.children(b);_.forEach(w=>{let E={...e.node(w)};y.setNode(w,E);let S=e.parent(w);S&&S!==b&&_.includes(S)&&y.setParent(w,S)});let N=new Set;e.edges().forEach(w=>{let E=ti(e,w.v,b),S=ti(e,w.w,b);if(E&&S&&E!==S){let I=`${E}\0${S}`;N.has(I)||(N.add(I),y.setEdge(E,S,{...e.edge(w)}))}}),wa(y,t,n);let k=ii(y);ni(k,t,n,null),oi(y,k);let C=1/0,M=1/0,z=-1/0,O=-1/0;y.nodes().forEach(w=>{if(w===b)return;let E=y.node(w);E&&typeof E.x=="number"&&typeof E.y=="number"&&typeof E.width=="number"&&typeof E.height=="number"&&(C=Math.min(C,E.x-E.width/2),z=Math.max(z,E.x+E.width/2),M=Math.min(M,E.y-E.height/2),O=Math.max(O,E.y+E.height/2))}),(!isFinite(C)||!isFinite(M)||!isFinite(z)||!isFinite(O))&&(C=M=0,z=O=0);let D=z-C,A=O-M;i[b]={minX:C,minY:M,maxX:z,maxY:O,width:D,height:A,offsetX:C,offsetY:M},p._dagreClusterSubgraph=y}});let s=[],a=b=>{let p=[],y=(e.children(b)||[]).filter(_=>_!==b);for(;y.length>0;){let _=y.shift();p.push(_),(e.children(_)||[]).filter(N=>N!==_).forEach(N=>y.push(N))}return p},l=new Map;r.forEach(b=>{let p=e.node(b);p&&p.rankdir&&i[b]&&l.set(b,(e.children(b)||[]).filter(y=>y!==b))});let c=new Set([...l.values()].flat()),u=new Map;l.forEach((b,p)=>{c.has(p)||u.set(p,a(p))});let d=new Set([...u.values()].flat()),f=b=>{for(let[p,y]of u)if(y.includes(b))return p;return b},h=[];e.edges().forEach(b=>{(d.has(b.v)||d.has(b.w))&&h.push({edge:b,label:e.edge(b)})});let g=new Map;d.forEach(b=>{let p=e.parent(b);g.set(b,typeof p=="string"?p:void 0)}),u.forEach((b,p)=>{let y=e.node(p),_=[];b.forEach(C=>{let M=e.node(C);M&&(_.push({id:C,node:M,parent:g.get(C)}),e.removeNode(C))});let N=h.filter(({edge:C})=>b.includes(C.v)||b.includes(C.w)),k=i[p];y&&(s.push({clusterId:p,subgraph:y._dagreClusterSubgraph,bounds:k,children:b,removedNodes:_,removedEdges:N}),y.width=k.width,y.height=k.height)});let v=new Set;h.forEach(({edge:b,label:p})=>{let y=f(b.v),_=f(b.w);if(y!==_&&e.hasNode(y)&&e.hasNode(_)){let N=`${y}\0${_}`;v.has(N)||(v.add(N),e.setEdge(y,_,{...p,width:0,height:0}))}});let x=ii(e),m=ni(x,t,n,(o=ei.get(e))!=null?o:null);ei.set(e,m),oi(e,x),v.forEach(b=>{let p=b.indexOf("\0"),y=b.slice(0,p),_=b.slice(p+1);e.hasEdge(y,_)&&e.removeEdge(y,_)}),s.forEach(({clusterId:b,subgraph:p,bounds:y,removedNodes:_,removedEdges:N})=>{var k,C;let M=e.node(b),z=(k=M?.x)!=null?k:0,O=(C=M?.y)!=null?C:0,D=(y.minX+y.maxX)/2,A=(y.minY+y.maxY)/2;_.forEach(({id:w,node:E,parent:S})=>{e.setNode(w,E),S!==void 0&&e.setParent(w,S)}),N.forEach(({edge:w,label:E})=>{e.setEdge(w,E)}),p.nodes().forEach(w=>{if(w===b)return;let E=p.node(w),S=e.node(w);S&&E&&typeof E.x=="number"&&typeof E.y=="number"&&(S.x=z+(E.x-D),S.y=O+(E.y-A))}),delete M._dagreClusterSubgraph}),r.forEach(b=>{var p,y;let _=e.node(b),N=i[b];if(_&&_.rankdir&&_._dagreClusterSubgraph&&N){let k=_._dagreClusterSubgraph,C=(p=_.x)!=null?p:0,M=(y=_.y)!=null?y:0,z=(N.minX+N.maxX)/2,O=(N.minY+N.maxY)/2;k.nodes().forEach(D=>{if(D===b)return;let A=k.node(D),w=e.node(D);if(w&&A&&typeof A.x=="number"&&typeof A.y=="number"){let E=A.x-z,S=A.y-O;w.x=C+E,w.y=M+S}}),delete _._dagreClusterSubgraph}})}function ni(e,t,n,o=null){var r,i;let s=n?.useDynamic!==!1,a=s&&(r=o?.graph)!=null?r:null,l=s&&(i=o?.rawNodes)!=null?i:null;t(" makeSpaceForEdgeLabels",()=>Rm(e)),t(" removeSelfEdges",()=>Xm(e)),t(" acyclic",()=>y0(e,a)),t(" nestingGraph.run",()=>B0(e)),t(" rank",()=>$0(na(e))),t(" injectEdgeLabelProxies",()=>Lm(e)),t(" removeEmptyRanks",()=>n0(e)),t(" nestingGraph.cleanup",()=>X0(e)),t(" normalizeRanks",()=>t0(e)),t(" assignRankMinMax",()=>zm(e)),t(" removeEdgeLabelProxies",()=>Hm(e)),t(" normalize.run",()=>b0(e)),t(" parentDummyChains",()=>z0(e)),t(" addBorderSegments",()=>Z0(e)),t(" order",()=>ma(e,n,l)),t(" insertSelfEdges",()=>Zm(e)),t(" adjustCoordinateSystem",()=>q0(e)),t(" position",()=>Cm(e,n.corePath)),t(" positionSelfEdges",()=>Wm(e));let c=JSON.parse(JSON.stringify(e._nodes));return t(" removeBorderNodes",()=>Ym(e)),t(" normalize.undo",()=>_0(e)),t(" fixupEdgeLabelCoords",()=>Bm(e)),t(" undoCoordinateSystem",()=>G0(e)),t(" translateGraph",()=>jm(e)),t(" assignNodeIntersects",()=>Vm(e)),t(" reversePoints",()=>Fm(e)),t(" acyclic.undo",()=>x0(e)),{graph:e,rawNodes:c}}function oi(e,t){e.nodes().forEach(n=>{let o=e.node(n),r=t.node(n);o&&(o.x=r.x,o.y=r.y,o.order=r.order,o.rank=r.rank,t.children(n).length&&(o.width=r.width,o.height=r.height))}),e.edges().forEach(n=>{let o=e.edge(n),r=t.edge(n);o.points=r.points,Object.hasOwn(r,"x")&&(o.x=r.x,o.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Im=["nodesep","edgesep","ranksep","marginx","marginy"],Om={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Pm=["acyclicer","ranker","rankdir","align","rankalign"],Am=["width","height","rank"],ri={width:0,height:0},Tm=["minlen","weight","width","height","labeloffset"],$m={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Dm=["labelpos"];function ii(e){let t=new we({multigraph:!0,compound:!0}),n=jn(e.graph());return t.setGraph(Object.assign({},Om,Hn(n,Im),cn(n,Pm))),e.nodes().forEach(o=>{let r=jn(e.node(o)),i=Hn(r,Am);Object.keys(ri).forEach(a=>{i[a]===void 0&&(i[a]=ri[a])}),t.setNode(o,i);let s=e.parent(o);s!==void 0&&t.setParent(o,s)}),e.edges().forEach(o=>{let r=jn(e.edge(o));t.setEdge(o,Object.assign({},$m,Hn(r,Tm),cn(r,Dm)))}),t}function Rm(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{var o;let r=e.edge(n);r.minlen*=2,((o=r.labelpos)!=null?o:"r").toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Lm(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let o=e.node(t.v),r={rank:(e.node(t.w).rank-o.rank)/2+o.rank,e:t};ct(e,"edge-proxy",r,"_ep")}})}function zm(e){let t=0;e.nodes().forEach(n=>{let o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=Math.max(t,o.maxRank))}),e.graph().maxRank=t}function Hm(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let o=n;e.edge(o.e).labelRank=n.rank,e.removeNode(t)}})}function jm(e){let t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,r=0,i=e.graph(),s=i.marginx||0,a=i.marginy||0;function l(c){let u=c.x,d=c.y,f=c.width,h=c.height;t=Math.min(t,u-f/2),n=Math.max(n,u+f/2),o=Math.min(o,d-h/2),r=Math.max(r,d+h/2)}e.nodes().forEach(c=>l(e.node(c))),e.edges().forEach(c=>{let u=e.edge(c);Object.hasOwn(u,"x")&&l(u)}),t-=s,o-=a,e.nodes().forEach(c=>{let u=e.node(c);u.x-=t,u.y-=o}),e.edges().forEach(c=>{let u=e.edge(c);u.points.forEach(d=>{d.x-=t,d.y-=o}),Object.hasOwn(u,"x")&&(u.x-=t),Object.hasOwn(u,"y")&&(u.y-=o)}),i.width=n-t+s,i.height=r-o+a}function Vm(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),o=e.node(t.v),r=e.node(t.w),i,s;n.points?(i=n.points[0],s=n.points[n.points.length-1]):(n.points=[],i=r,s=o),n.points.unshift(Fr(o,i)),n.points.push(Fr(r,s))})}function Bm(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function Fm(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Ym(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),o=e.node(n.borderTop),r=e.node(n.borderBottom),i=e.node(n.borderLeft[n.borderLeft.length-1]),s=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(s.x-i.x),n.height=Math.abs(r.y-o.y),n.x=i.x+n.width/2,n.y=o.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function Xm(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Zm(e){At(e).forEach(t=>{let n=0;t.forEach((o,r)=>{let i=e.node(o);typeof i.rank!="number"&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(s=>{ct(e,"selfedge",{width:s.label.width,height:s.label.height,rank:i.rank,order:r+ ++n,e:s.e,edgeLabel:s.label},"_se"),(!Array.isArray(s.label.points)||s.label.points.length!==7)&&(s.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function Wm(e){e.nodes().forEach(t=>{let n=e.node(t),o=r=>typeof r=="number"&&isFinite(r);if(n.dummy==="selfedge"){let r=n,i=e.node(r.e.v),s=o(i?.x)?i.x:0,a=o(i?.y)?i.y:0,l=o(i?.width)?i.width:0,c=o(i?.height)?i.height:0,u=o(n.x)?n.x:s,d=o(n.y)?n.y:a,f=l/2,h=c/2;r.edgeLabel.points=[{x:u+f,y:d-h},{x:u+f,y:d-h},{x:u,y:d},{x:u-f,y:d+h},{x:u-f,y:d+h},{x:u,y:d},{x:u,y:d}],r.edgeLabel.x=u,r.edgeLabel.y=d,e.setEdge(r.e,r.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(r=>{if(!Array.isArray(r.label.points)||r.label.points.length!==7){let i=o(n.x)?n.x:0,s=o(n.y)?n.y:0,a=o(n.width)?n.width:0,l=o(n.height)?n.height:0,c=a/2,u=l/2;r.label.points=[{x:i+c,y:s-u},{x:i+c,y:s-u},{x:i,y:s},{x:i-c,y:s+u},{x:i-c,y:s+u},{x:i,y:s},{x:i,y:s}]}})})}function Hn(e,t){return bn(cn(e,t),Number)}function jn(e){let t={};return e&&Object.entries(e).forEach(([n,o])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=o}),t}function qm(e){let t=At(e),n=new we({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(o=>{n.setNode(o,{label:o}),n.setParent(o,"layer"+e.node(o).rank)}),e.edges().forEach(o=>n.setEdge(o.v,o.w,{},o.name)),t.forEach((o,r)=>{let i="layer"+r;n.setNode(i,{rank:"same"}),o.reduce((s,a)=>(n.setEdge(s,a,{style:"invis"}),a))}),n}var Gm={graphlib:qs,version:c0,layout:Mm,debug:qm,util:{time:i0,notime:ia}},oy=Gm;export{oy as $,vn as B,ey as E,on as H,ny as M,Z as P,Ug as R,et as a,Km as b,Jm as c,ty as d,wn as e,Qi as g,be as i,Qm as p,vo as u};
|