toolroll 0.9.141 → 0.9.142
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/CHANGELOG.md +18 -0
- package/dist/attest.js +1 -1
- package/dist/browser/{chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js → chunk-agents-live-view.1b1c797cec2734229d36186796ae378527a7b5f7aa936897671a6c1f3a8cb19a.js} +5 -5
- package/dist/browser/chunk-agents-live-view.1b1c797cec2734229d36186796ae378527a7b5f7aa936897671a6c1f3a8cb19a.js.br +0 -0
- package/dist/browser/chunk-agents-live-view.1b1c797cec2734229d36186796ae378527a7b5f7aa936897671a6c1f3a8cb19a.js.gz +0 -0
- package/dist/browser/chunk-bundle.089b2471028b3dcf578cb4363ea4757738b28eda5459e6194f92707364033cd7.js +2 -0
- package/dist/browser/chunk-bundle.089b2471028b3dcf578cb4363ea4757738b28eda5459e6194f92707364033cd7.js.br +0 -0
- package/dist/browser/chunk-bundle.089b2471028b3dcf578cb4363ea4757738b28eda5459e6194f92707364033cd7.js.gz +0 -0
- package/dist/browser/chunk-chat-parts.51c73684050c98bc25724e417e4180981c14590934bb37fd9a1617942a7d32d3.js +4 -0
- package/dist/browser/chunk-chat-parts.51c73684050c98bc25724e417e4180981c14590934bb37fd9a1617942a7d32d3.js.br +0 -0
- package/dist/browser/chunk-chat-parts.51c73684050c98bc25724e417e4180981c14590934bb37fd9a1617942a7d32d3.js.gz +0 -0
- package/dist/browser/{chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js → chunk-core.6128decfe528d89de1445dc1ec36e9f13dabd76eba61d13310fc1302db2252eb.js} +11 -11
- package/dist/browser/chunk-core.6128decfe528d89de1445dc1ec36e9f13dabd76eba61d13310fc1302db2252eb.js.br +0 -0
- package/dist/browser/chunk-core.6128decfe528d89de1445dc1ec36e9f13dabd76eba61d13310fc1302db2252eb.js.gz +0 -0
- package/dist/browser/{chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js → chunk-flow-view.f9a4db9db350a9311ce5b11e9358c6e7de4ad9b3cd7a1f058e6c78eedee6dec6.js} +1 -1
- package/dist/browser/chunk-flow-view.f9a4db9db350a9311ce5b11e9358c6e7de4ad9b3cd7a1f058e6c78eedee6dec6.js.br +0 -0
- package/dist/browser/chunk-flow-view.f9a4db9db350a9311ce5b11e9358c6e7de4ad9b3cd7a1f058e6c78eedee6dec6.js.gz +0 -0
- package/dist/browser/{chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js → chunk-flows-extra-view.3151cd05656fd35f80588863c323b4799b6b1f0060243ec8bc9b5da94d8d6052.js} +1 -1
- package/dist/browser/chunk-flows-extra-view.3151cd05656fd35f80588863c323b4799b6b1f0060243ec8bc9b5da94d8d6052.js.br +0 -0
- package/dist/browser/chunk-flows-extra-view.3151cd05656fd35f80588863c323b4799b6b1f0060243ec8bc9b5da94d8d6052.js.gz +0 -0
- package/dist/browser/chunk-more-views.70ab484b8f1f1ebc31c3c27061a88c86607d86bb9bc34d277b57f3f4fa0ce291.js +2 -0
- package/dist/browser/chunk-more-views.70ab484b8f1f1ebc31c3c27061a88c86607d86bb9bc34d277b57f3f4fa0ce291.js.br +0 -0
- package/dist/browser/chunk-more-views.70ab484b8f1f1ebc31c3c27061a88c86607d86bb9bc34d277b57f3f4fa0ce291.js.gz +0 -0
- package/dist/browser/{chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js → chunk-pages-bundle.3b596e7529dfb499a536353c9095d0b9a8255e5b7f782211c22aced869905bb0.js} +1 -1
- package/dist/browser/chunk-pages-bundle.3b596e7529dfb499a536353c9095d0b9a8255e5b7f782211c22aced869905bb0.js.br +0 -0
- package/dist/browser/chunk-pages-bundle.3b596e7529dfb499a536353c9095d0b9a8255e5b7f782211c22aced869905bb0.js.gz +0 -0
- package/dist/browser/chunk-result-view.f319cf5973ad4c9e7e495e00e77070ec242da669f87f848d52878e223ba87343.js +2 -0
- package/dist/browser/chunk-result-view.f319cf5973ad4c9e7e495e00e77070ec242da669f87f848d52878e223ba87343.js.br +0 -0
- package/dist/browser/chunk-result-view.f319cf5973ad4c9e7e495e00e77070ec242da669f87f848d52878e223ba87343.js.gz +0 -0
- package/dist/browser/chunk-settings-view.653e09ec0c7cce54c68ae7e968cc015c774fb6fa6e1493fd9f5423281d1e24fe.js +20 -0
- package/dist/browser/chunk-settings-view.653e09ec0c7cce54c68ae7e968cc015c774fb6fa6e1493fd9f5423281d1e24fe.js.br +0 -0
- package/dist/browser/chunk-settings-view.653e09ec0c7cce54c68ae7e968cc015c774fb6fa6e1493fd9f5423281d1e24fe.js.gz +0 -0
- package/dist/browser/chunk-shared.0c0231ce259937612ec120a251373e6b63f68c37fa031567570a9cfd6d6b2eef.js +2 -0
- package/dist/browser/chunk-shared.0c0231ce259937612ec120a251373e6b63f68c37fa031567570a9cfd6d6b2eef.js.br +0 -0
- package/dist/browser/chunk-shared.0c0231ce259937612ec120a251373e6b63f68c37fa031567570a9cfd6d6b2eef.js.gz +0 -0
- package/dist/browser/{chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js → chunk-shared.1bdbb9b057d17e95221becb4ed515b546d671390e4a817a6e72a799480fe14ad.js} +1 -1
- package/dist/browser/chunk-shared.1bdbb9b057d17e95221becb4ed515b546d671390e4a817a6e72a799480fe14ad.js.br +0 -0
- package/dist/browser/chunk-shared.1bdbb9b057d17e95221becb4ed515b546d671390e4a817a6e72a799480fe14ad.js.gz +0 -0
- package/dist/browser/{chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js → chunk-shared.2d678087d03dcf2430b5bf48656220dbff5fb622188004aae7a76e0e5e5d18f8.js} +1 -1
- package/dist/browser/chunk-shared.2d678087d03dcf2430b5bf48656220dbff5fb622188004aae7a76e0e5e5d18f8.js.br +0 -0
- package/dist/browser/chunk-shared.2d678087d03dcf2430b5bf48656220dbff5fb622188004aae7a76e0e5e5d18f8.js.gz +0 -0
- package/dist/browser/{chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js → chunk-shared.66f18526381931b1ff69c090bad48c408a035a0d256bcff19b19b51ea988612a.js} +1 -1
- package/dist/browser/chunk-shared.66f18526381931b1ff69c090bad48c408a035a0d256bcff19b19b51ea988612a.js.br +0 -0
- package/dist/browser/chunk-shared.66f18526381931b1ff69c090bad48c408a035a0d256bcff19b19b51ea988612a.js.gz +0 -0
- package/dist/browser/{chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js → chunk-shared.782659379fb982a9c2606c051bb711fd0fe38a547b8b4f4620cf2d14a832df25.js} +1 -1
- package/dist/browser/chunk-shared.782659379fb982a9c2606c051bb711fd0fe38a547b8b4f4620cf2d14a832df25.js.br +0 -0
- package/dist/browser/chunk-shared.782659379fb982a9c2606c051bb711fd0fe38a547b8b4f4620cf2d14a832df25.js.gz +0 -0
- package/dist/browser/{chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js → chunk-shared.8940b7334ec79bcd25cb8e2d41958eecfe71d31340cf8de3c3d99f813cd126af.js} +1 -1
- package/dist/browser/chunk-shared.8940b7334ec79bcd25cb8e2d41958eecfe71d31340cf8de3c3d99f813cd126af.js.br +0 -0
- package/dist/browser/chunk-shared.8940b7334ec79bcd25cb8e2d41958eecfe71d31340cf8de3c3d99f813cd126af.js.gz +0 -0
- package/dist/browser/{chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js → chunk-shared.a7e4c6f386cee4623300b0d1b471260a09e05f6e236d56c7814dffc06088fb5c.js} +1 -1
- package/dist/browser/chunk-shared.a7e4c6f386cee4623300b0d1b471260a09e05f6e236d56c7814dffc06088fb5c.js.br +0 -0
- package/dist/browser/chunk-shared.a7e4c6f386cee4623300b0d1b471260a09e05f6e236d56c7814dffc06088fb5c.js.gz +0 -0
- package/dist/browser/{chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js → chunk-shared.c9025f6af91453ae8672099cb32126c5967384f769d10c662908e35c31b62478.js} +3 -3
- package/dist/browser/chunk-shared.c9025f6af91453ae8672099cb32126c5967384f769d10c662908e35c31b62478.js.br +0 -0
- package/dist/browser/chunk-shared.c9025f6af91453ae8672099cb32126c5967384f769d10c662908e35c31b62478.js.gz +0 -0
- package/dist/browser/{chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js → chunk-sonner.76904479204cc1375093ccf9b2d60309bf4fb25e41bd0f0523b254404d9a4a11.js} +1 -1
- package/dist/browser/chunk-sonner.76904479204cc1375093ccf9b2d60309bf4fb25e41bd0f0523b254404d9a4a11.js.br +0 -0
- package/dist/browser/chunk-sonner.76904479204cc1375093ccf9b2d60309bf4fb25e41bd0f0523b254404d9a4a11.js.gz +0 -0
- package/dist/browser/chunk-task-view.6fcf84b20eddbbedc54103ca36c5c245ce6e7ccbb161ae0bef4b27027064b771.js +2 -0
- package/dist/browser/chunk-task-view.6fcf84b20eddbbedc54103ca36c5c245ce6e7ccbb161ae0bef4b27027064b771.js.br +0 -0
- package/dist/browser/chunk-task-view.6fcf84b20eddbbedc54103ca36c5c245ce6e7ccbb161ae0bef4b27027064b771.js.gz +0 -0
- package/dist/browser/chunk-team-chat.4cea27fe351f9ce5344da7c4b87240da49394496c12dc95f9e0de0590bb0d720.js +2 -0
- package/dist/browser/chunk-team-chat.4cea27fe351f9ce5344da7c4b87240da49394496c12dc95f9e0de0590bb0d720.js.br +0 -0
- package/dist/browser/chunk-team-chat.4cea27fe351f9ce5344da7c4b87240da49394496c12dc95f9e0de0590bb0d720.js.gz +0 -0
- package/dist/browser/manifest.json +204 -189
- package/dist/browser/{workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js → workspace.1bd4819cccc49c2c8208df3c1d31e13d3df426ecea80e734ac284cea47b49459.js} +2 -2
- package/dist/browser/workspace.1bd4819cccc49c2c8208df3c1d31e13d3df426ecea80e734ac284cea47b49459.js.br +0 -0
- package/dist/browser/workspace.1bd4819cccc49c2c8208df3c1d31e13d3df426ecea80e734ac284cea47b49459.js.gz +0 -0
- package/dist/browser-lazy-parts.js +1 -1
- package/dist/build-review.js +3 -2
- package/dist/builder.js +4 -3
- package/dist/chat-actions.js +2 -2
- package/dist/code-map-acts.js +1 -1
- package/dist/code-map-admission.js +2 -2
- package/dist/code-map-cli.js +2 -2
- package/dist/companion/push.js +3 -3
- package/dist/contracts/chat-actions.js +1 -1
- package/dist/contracts/console-api.js +1 -1
- package/dist/dispose.js +1 -1
- package/dist/lead-contract.js +1 -1
- package/dist/lead-doors.js +2 -2
- package/dist/local-owner.js +1 -1
- package/dist/operate.js +22 -13
- package/dist/planner.js +1 -1
- package/dist/project-knowledge.js +1 -1
- package/dist/push-line.js +1 -0
- package/dist/push.js +1 -1
- package/dist/review-switch.js +1 -1
- package/dist/runner.js +2 -2
- package/dist/server/pages-assets.js +2 -2
- package/dist/server/route-table.js +1 -1
- package/dist/server/settings.js +2 -2
- package/dist/server/task-view-data.js +2 -2
- package/dist/server/task-views.js +1 -1
- package/dist/ssr-workspace.js +86 -86
- package/dist/surface.js +1 -1
- package/dist/toolroll-update.js +2 -2
- package/package.json +1 -1
- package/dist/browser/chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js.br +0 -0
- package/dist/browser/chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js.gz +0 -0
- package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js +0 -2
- package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js.br +0 -0
- package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js.gz +0 -0
- package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js +0 -4
- package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js.br +0 -0
- package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js.gz +0 -0
- package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js.br +0 -0
- package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js.gz +0 -0
- package/dist/browser/chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js.br +0 -0
- package/dist/browser/chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js.gz +0 -0
- package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js.br +0 -0
- package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js.gz +0 -0
- package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js.br +0 -0
- package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js.gz +0 -0
- package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js +0 -2
- package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js.br +0 -0
- package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js.gz +0 -0
- package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js +0 -20
- package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js.br +0 -0
- package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js.gz +0 -0
- package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js.br +0 -0
- package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js.gz +0 -0
- package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js.br +0 -0
- package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js.gz +0 -0
- package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js +0 -2
- package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js.br +0 -0
- package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js.gz +0 -0
- package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js.br +0 -0
- package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js.gz +0 -0
- package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js.br +0 -0
- package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js.gz +0 -0
- package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js.br +0 -0
- package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js.gz +0 -0
- package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js.br +0 -0
- package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js.gz +0 -0
- package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js.br +0 -0
- package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js.gz +0 -0
- package/dist/browser/chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js.br +0 -0
- package/dist/browser/chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js.gz +0 -0
- package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js +0 -2
- package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js.br +0 -0
- package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js.gz +0 -0
- package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js +0 -2
- package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js.br +0 -0
- package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js.gz +0 -0
- package/dist/browser/workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js.br +0 -0
- package/dist/browser/workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! Third-party notices: /assets/THIRD_PARTY_NOTICES.txt */
|
|
2
|
-
import{d as jd,e as Nd}from"./chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js";import{p10$A as Pa,p10$B as yo,p10$C as Aa,p10$D as Q0,p10$E as Ia,p10$F as Da,p10$G as Ra,p10$H as Oa,p10$I as rt,p10$J as bo,p10$a as La,p10$b as Ta,p10$c as Ba,p10$d as Va,p10$e as ex,p10$f as tx,p10$g as nx,p10$h as ox,p10$i as ax,p10$j as Ha,p10$k as Fa,p10$l as wo,p10$m as Wa,p10$n as Za,p10$o as Ya,p10$p as Xa,p10$q as jo,p10$r as No,p10$s as qa,p10$t as Ka,p10$u as ko,p10$v as Ua,p10$w as Ga,p10$x as Qe,p10$y as Ja,p10$z as Qa}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p11$a as So,p11$b as ix}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p1$$ as cx,p1$$a as ux,p1$$b as hx,p1$A as px,p1$Aa as er,p1$Ab as mx,p1$B as fx,p1$Ba as gx,p1$Bb as xx,p1$C as vx,p1$Ca as yx,p1$Cb as bx,p1$D as wx,p1$Da as jx,p1$Db as tr,p1$E as Nx,p1$Ea as kx,p1$Eb as Sx,p1$F as Cx,p1$Fa as $x,p1$Fb as Ex,p1$G as Mx,p1$Ga as zx,p1$Gb as _x,p1$H as Px,p1$Ha as Ax,p1$Hb as nr,p1$I as Ix,p1$Ia as Dx,p1$Ib as or,p1$J as Co,p1$Ja as Rx,p1$Jb as ar,p1$K as Ox,p1$Ka as Lx,p1$Kb as rr,p1$L as Tx,p1$La as Bx,p1$Lb as Vx,p1$M as Hx,p1$Ma as Fx,p1$Mb as Wx,p1$N as Zx,p1$Na as sr,p1$Nb as Yx,p1$O as Xx,p1$Oa as qx,p1$Ob as Kx,p1$P as Ux,p1$Pa as ir,p1$Pb as Gx,p1$Q as Jx,p1$Qa as Qx,p1$Qb as ev,p1$R as tv,p1$Ra as nv,p1$Rb as ov,p1$S as av,p1$Sa as rv,p1$Sb as sv,p1$T as iv,p1$Ta as lv,p1$Tb as dv,p1$U as cv,p1$Ua as uv,p1$Ub as hv,p1$V as pv,p1$Va as mv,p1$Vb as $o,p1$W as fv,p1$Wa as gv,p1$Wb as xv,p1$X as xn,p1$Xa as vv,p1$Xb as lr,p1$Y as yv,p1$Ya as bv,p1$Yb as wv,p1$Z as jv,p1$Za as Nv,p1$Zb as kv,p1$_ as Sv,p1$_a as Cv,p1$_b as $v,p1$a as xe,p1$aa as Ev,p1$ab as Mv,p1$ac as zv,p1$b as _v,p1$ba as dr,p1$bb as cr,p1$bc as Pv,p1$c as Av,p1$ca as vn,p1$cb as he,p1$cc as Iv,p1$d as Dv,p1$da as Rv,p1$db as ur,p1$dc as Ov,p1$e as te,p1$ea as Lv,p1$eb as Tt,p1$ec as Tv,p1$f as Eo,p1$fa as Bv,p1$fb as Mo,p1$fc as Vv,p1$g as Hv,p1$ga as Fv,p1$gb as Wv,p1$gc as Zv,p1$h as Yv,p1$ha as Xv,p1$hb as bt,p1$hc as qv,p1$i as Kv,p1$ia as Uv,p1$ib as Gv,p1$ic as Jv,p1$j as yn,p1$ja as Qv,p1$jb as bn,p1$jc as ey,p1$k as wn,p1$ka as ty,p1$kb as ny,p1$kc as oy,p1$l as ay,p1$la as ry,p1$lb as jn,p1$lc as sy,p1$m as Nn,p1$ma as Bt,p1$mb as iy,p1$mc as ly,p1$n as ne,p1$na as hr,p1$nb as dy,p1$nc as cy,p1$o as ye,p1$oa as wt,p1$ob as uy,p1$p as hy,p1$pa as py,p1$pb as kn,p1$q as my,p1$qa as fy,p1$qb as gy,p1$r as xy,p1$ra as vy,p1$rb as Sn,p1$s as yy,p1$sa as pr,p1$sb as by,p1$t as wy,p1$ta as jy,p1$tb as Ny,p1$u as ky,p1$ua as Sy,p1$ub as mr,p1$v as Cy,p1$va as $y,p1$vb as fr,p1$w as Ey,p1$wa as My,p1$wb as zo,p1$x as zy,p1$xa as _y,p1$xb as gr,p1$y as Py,p1$ya as Ay,p1$yb as Iy,p1$z as jt,p1$za as Dy,p1$zb as xr}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p2$a as Vt,p2$b as et,p2$c as Nt,p2$d as vr,p2$e as _o}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";var kd=Vt(e=>{"use strict";var t=Nt();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var o=typeof Object.is=="function"?Object.is:n,r=t.useState,s=t.useEffect,i=t.useLayoutEffect,l=t.useDebugValue;function h(d,m){var f=m(),w=r({inst:{value:f,getSnapshot:m}}),y=w[0].inst,x=w[1];return i(function(){y.value=f,y.getSnapshot=m,u(y)&&x({inst:y})},[d,f,m]),s(function(){return u(y)&&x({inst:y}),d(function(){u(y)&&x({inst:y})})},[d]),l(f),f}function u(d){var m=d.getSnapshot;d=d.value;try{var f=m();return!o(d,f)}catch{return!0}}function c(d,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:h;e.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p}),Sd=Vt((e,t)=>{"use strict";t.exports=kd()}),Cd=Vt(e=>{"use strict";var t=Nt(),n=Sd();function o(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var r=typeof Object.is=="function"?Object.is:o,s=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,h=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(c,p,d,m,f){var w=i(null);if(w.current===null){var y={hasValue:!1,value:null};w.current=y}else y=w.current;w=h(function(){function E(M){if(!v){if(v=!0,b=M,M=m(M),f!==void 0&&y.hasValue){var C=y.value;if(f(C,M))return j=C}return j=M}if(C=j,r(b,M))return C;var _=m(M);return f!==void 0&&f(C,_)?(b=M,C):(b=M,j=_)}var v=!1,b,j,S=d===void 0?null:d;return[function(){return E(p())},S===null?void 0:function(){return E(S())}]},[p,d,m,f]);var x=s(c,w[0],w[1]);return l(function(){y.hasValue=!0,y.value=x},[x]),u(x),x}}),$d=Vt((e,t)=>{"use strict";t.exports=Cd()}),I=et(_o()),L=et(Nt());function ve(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=ve(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Ed={value:()=>{}};function As(){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 Dn(n)}function Dn(e){this._=e}function Md(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}})}Dn.prototype=As.prototype={constructor:Dn,on:function(e,t){var n=this._,o=Md(e+"",n),r,s=-1,i=o.length;if(arguments.length<2){for(;++s<i;)if((r=(e=o[s]).type)&&(r=zd(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<i;)if(r=(e=o[s]).type)n[r]=yr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=yr(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 Dn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,s;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],o=0,r=s.length;o<r;++o)s[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,s=o.length;r<s;++r)o[r].value.apply(t,n)}};function zd(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function yr(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=Ed,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var na=As,Ho="http://www.w3.org/1999/xhtml",br={svg:"http://www.w3.org/2000/svg",xhtml:Ho,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),br.hasOwnProperty(t)?{space:br[t],local:e}:e}function _d(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ho&&t.documentElement.namespaceURI===Ho?t.createElement(e):t.createElementNS(n,e)}}function Pd(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Is(e){var t=Jn(e);return(t.local?Pd:_d)(t)}function Ad(){}function oa(e){return e==null?Ad:function(){return this.querySelector(e)}}function Id(e){typeof e!="function"&&(e=oa(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var s=t[r],i=s.length,l=o[r]=new Array(i),h,u,c=0;c<i;++c)(h=s[c])&&(u=e.call(h,h.__data__,c,s))&&("__data__"in h&&(u.__data__=h.__data__),l[c]=u);return new $e(o,this._parents)}function Dd(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Rd(){return[]}function Ds(e){return e==null?Rd:function(){return this.querySelectorAll(e)}}function Od(e){return function(){return Dd(e.apply(this,arguments))}}function Ld(e){typeof e=="function"?e=Od(e):e=Ds(e);for(var t=this._groups,n=t.length,o=[],r=[],s=0;s<n;++s)for(var i=t[s],l=i.length,h,u=0;u<l;++u)(h=i[u])&&(o.push(e.call(h,h.__data__,u,i)),r.push(h));return new $e(o,r)}function Rs(e){return function(){return this.matches(e)}}function Os(e){return function(t){return t.matches(e)}}var Td=Array.prototype.find;function Bd(e){return function(){return Td.call(this.children,e)}}function Vd(){return this.firstElementChild}function Hd(e){return this.select(e==null?Vd:Bd(typeof e=="function"?e:Os(e)))}var Fd=Array.prototype.filter;function Wd(){return Array.from(this.children)}function Zd(e){return function(){return Fd.call(this.children,e)}}function Yd(e){return this.selectAll(e==null?Wd:Zd(typeof e=="function"?e:Os(e)))}function Xd(e){typeof e!="function"&&(e=Rs(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var s=t[r],i=s.length,l=o[r]=[],h,u=0;u<i;++u)(h=s[u])&&e.call(h,h.__data__,u,s)&&l.push(h);return new $e(o,this._parents)}function Ls(e){return new Array(e.length)}function qd(){return new $e(this._enter||this._groups.map(Ls),this._parents)}function Bn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bn.prototype={constructor:Bn,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 Kd(e){return function(){return e}}function Ud(e,t,n,o,r,s){for(var i=0,l,h=t.length,u=s.length;i<u;++i)(l=t[i])?(l.__data__=s[i],o[i]=l):n[i]=new Bn(e,s[i]);for(;i<h;++i)(l=t[i])&&(r[i]=l)}function Gd(e,t,n,o,r,s,i){var l,h,u=new Map,c=t.length,p=s.length,d=new Array(c),m;for(l=0;l<c;++l)(h=t[l])&&(d[l]=m=i.call(h,h.__data__,l,t)+"",u.has(m)?r[l]=h:u.set(m,h));for(l=0;l<p;++l)m=i.call(e,s[l],l,s)+"",(h=u.get(m))?(o[l]=h,h.__data__=s[l],u.delete(m)):n[l]=new Bn(e,s[l]);for(l=0;l<c;++l)(h=t[l])&&u.get(d[l])===h&&(r[l]=h)}function Jd(e){return e.__data__}function Qd(e,t){if(!arguments.length)return Array.from(this,Jd);var n=t?Gd:Ud,o=this._parents,r=this._groups;typeof e!="function"&&(e=Kd(e));for(var s=r.length,i=new Array(s),l=new Array(s),h=new Array(s),u=0;u<s;++u){var c=o[u],p=r[u],d=p.length,m=ec(e.call(c,c&&c.__data__,u,o)),f=m.length,w=l[u]=new Array(f),y=i[u]=new Array(f),x=h[u]=new Array(d);n(c,p,w,y,x,m,t);for(var E=0,v=0,b,j;E<f;++E)if(b=w[E]){for(E>=v&&(v=E+1);!(j=y[v])&&++v<f;);b._next=j||null}}return i=new $e(i,o),i._enter=l,i._exit=h,i}function ec(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function tc(){return new $e(this._exit||this._groups.map(Ls),this._parents)}function nc(e,t,n){var o=this.enter(),r=this,s=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?s.remove():n(s),o&&r?o.merge(r).order():r}function oc(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,s=o.length,i=Math.min(r,s),l=new Array(r),h=0;h<i;++h)for(var u=n[h],c=o[h],p=u.length,d=l[h]=new Array(p),m,f=0;f<p;++f)(m=u[f]||c[f])&&(d[f]=m);for(;h<r;++h)l[h]=n[h];return new $e(l,this._parents)}function ac(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,s=o[r],i;--r>=0;)(i=o[r])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function rc(e){e||(e=sc);function t(p,d){return p&&d?e(p.__data__,d.__data__):!p-!d}for(var n=this._groups,o=n.length,r=new Array(o),s=0;s<o;++s){for(var i=n[s],l=i.length,h=r[s]=new Array(l),u,c=0;c<l;++c)(u=i[c])&&(h[c]=u);h.sort(t)}return new $e(r,this._parents).order()}function sc(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ic(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function lc(){return Array.from(this)}function dc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,s=o.length;r<s;++r){var i=o[r];if(i)return i}return null}function cc(){let e=0;for(let t of this)++e;return e}function uc(){return!this.node()}function hc(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],s=0,i=r.length,l;s<i;++s)(l=r[s])&&e.call(l,l.__data__,s,r);return this}function pc(e){return function(){this.removeAttribute(e)}}function mc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fc(e,t){return function(){this.setAttribute(e,t)}}function gc(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xc(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function vc(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 yc(e,t){var n=Jn(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?mc:pc:typeof t=="function"?n.local?vc:xc:n.local?gc:fc)(n,t))}function Ts(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bc(e){return function(){this.style.removeProperty(e)}}function wc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function jc(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Nc(e,t,n){return arguments.length>1?this.each((t==null?bc:typeof t=="function"?jc:wc)(e,t,n??"")):Et(this.node(),e)}function Et(e,t){return e.style.getPropertyValue(t)||Ts(e).getComputedStyle(e,null).getPropertyValue(t)}function kc(e){return function(){delete this[e]}}function Sc(e,t){return function(){this[e]=t}}function Cc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function $c(e,t){return arguments.length>1?this.each((t==null?kc:typeof t=="function"?Cc:Sc)(e,t)):this.node()[e]}function Bs(e){return e.trim().split(/^|\s+/)}function aa(e){return e.classList||new Vs(e)}function Vs(e){this._node=e,this._names=Bs(e.getAttribute("class")||"")}Vs.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 Hs(e,t){for(var n=aa(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Fs(e,t){for(var n=aa(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Ec(e){return function(){Hs(this,e)}}function Mc(e){return function(){Fs(this,e)}}function zc(e,t){return function(){(t.apply(this,arguments)?Hs:Fs)(this,e)}}function _c(e,t){var n=Bs(e+"");if(arguments.length<2){for(var o=aa(this.node()),r=-1,s=n.length;++r<s;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?zc:t?Ec:Mc)(n,t))}function Pc(){this.textContent=""}function Ac(e){return function(){this.textContent=e}}function Ic(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Dc(e){return arguments.length?this.each(e==null?Pc:(typeof e=="function"?Ic:Ac)(e)):this.node().textContent}function Rc(){this.innerHTML=""}function Oc(e){return function(){this.innerHTML=e}}function Lc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Tc(e){return arguments.length?this.each(e==null?Rc:(typeof e=="function"?Lc:Oc)(e)):this.node().innerHTML}function Bc(){this.nextSibling&&this.parentNode.appendChild(this)}function Vc(){return this.each(Bc)}function Hc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fc(){return this.each(Hc)}function Wc(e){var t=typeof e=="function"?e:Is(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Zc(){return null}function Yc(e,t){var n=typeof e=="function"?e:Is(e),o=t==null?Zc:typeof t=="function"?t:oa(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Xc(){var e=this.parentNode;e&&e.removeChild(this)}function qc(){return this.each(Xc)}function Kc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Uc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gc(e){return this.select(e?Uc:Kc)}function Jc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Qc(e){return function(t){e.call(this,t,this.__data__)}}function eu(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 tu(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,s;n<r;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++o]=s;++o?t.length=o:delete this.__on}}}function nu(e,t,n){return function(){var o=this.__on,r,s=Qc(t);if(o){for(var i=0,l=o.length;i<l;++i)if((r=o[i]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=t;return}}this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},o?o.push(r):this.__on=[r]}}function ou(e,t,n){var o=eu(e+""),r,s=o.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var h=0,u=l.length,c;h<u;++h)for(r=0,c=l[h];r<s;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value}return}for(l=t?nu:tu,r=0;r<s;++r)this.each(l(o[r],t,n));return this}function Ws(e,t,n){var o=Ts(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 au(e,t){return function(){return Ws(this,e,t)}}function ru(e,t){return function(){return Ws(this,e,t.apply(this,arguments))}}function su(e,t){return this.each((typeof t=="function"?ru:au)(e,t))}function*iu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,s=o.length,i;r<s;++r)(i=o[r])&&(yield i)}var Zs=[null];function $e(e,t){this._groups=e,this._parents=t}function Ys(){return new $e([[document.documentElement]],Zs)}function lu(){return this}$e.prototype=Ys.prototype={constructor:$e,select:Id,selectAll:Ld,selectChild:Hd,selectChildren:Yd,filter:Xd,data:Qd,enter:qd,exit:tc,join:nc,merge:oc,selection:lu,order:ac,sort:rc,call:ic,nodes:lc,node:dc,size:cc,empty:uc,each:hc,attr:yc,style:Nc,property:$c,classed:_c,text:Dc,html:Tc,raise:Vc,lower:Fc,append:Wc,insert:Yc,remove:qc,clone:Gc,datum:Jc,on:ou,dispatch:su,[Symbol.iterator]:iu};var rn=Ys;function Ce(e){return typeof e=="string"?new $e([[document.querySelector(e)]],[document.documentElement]):new $e([[e]],Zs)}function du(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ie(e,t){if(e=du(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]}var cu={passive:!1},qt={capture:!0,passive:!1};function Po(e){e.stopImmediatePropagation()}function Ct(e){e.preventDefault(),e.stopImmediatePropagation()}function Xs(e){var t=e.document.documentElement,n=Ce(e).on("dragstart.drag",Ct,qt);"onselectstart"in t?n.on("selectstart.drag",Ct,qt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function qs(e,t){var n=e.document.documentElement,o=Ce(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ct,qt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Cn=e=>()=>e;function Fo(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:s,x:i,y:l,dx:h,dy:u,dispatch:c}){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:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Fo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uu(e){return!e.ctrlKey&&!e.button}function hu(){return this.parentNode}function pu(e,t){return t??{x:e.x,y:e.y}}function mu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ks(){var e=uu,t=hu,n=pu,o=mu,r={},s=na("start","drag","end"),i=0,l,h,u,c,p=0;function d(b){b.on("mousedown.drag",m).filter(o).on("touchstart.drag",y).on("touchmove.drag",x,cu).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(b,j){if(!(c||!e.call(this,b,j))){var S=v(this,t.call(this,b,j),b,j,"mouse");S&&(Ce(b.view).on("mousemove.drag",f,qt).on("mouseup.drag",w,qt),Xs(b.view),Po(b),u=!1,l=b.clientX,h=b.clientY,S("start",b))}}function f(b){if(Ct(b),!u){var j=b.clientX-l,S=b.clientY-h;u=j*j+S*S>p}r.mouse("drag",b)}function w(b){Ce(b.view).on("mousemove.drag mouseup.drag",null),qs(b.view,u),Ct(b),r.mouse("end",b)}function y(b,j){if(e.call(this,b,j)){var S=b.changedTouches,M=t.call(this,b,j),C=S.length,_,F;for(_=0;_<C;++_)(F=v(this,M,b,j,S[_].identifier,S[_]))&&(Po(b),F("start",b,S[_]))}}function x(b){var j=b.changedTouches,S=j.length,M,C;for(M=0;M<S;++M)(C=r[j[M].identifier])&&(Ct(b),C("drag",b,j[M]))}function E(b){var j=b.changedTouches,S=j.length,M,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),M=0;M<S;++M)(C=r[j[M].identifier])&&(Po(b),C("end",b,j[M]))}function v(b,j,S,M,C,_){var F=s.copy(),O=Ie(_||S,j),R,H,g;if((g=n.call(b,new Fo("beforestart",{sourceEvent:S,target:d,identifier:C,active:i,x:O[0],y:O[1],dx:0,dy:0,dispatch:F}),M))!=null)return R=g.x-O[0]||0,H=g.y-O[1]||0,function N(k,z,A){var $=O,B;switch(k){case"start":r[C]=N,B=i++;break;case"end":delete r[C],--i;case"drag":O=Ie(A||z,j),B=i;break}F.call(k,b,new Fo(k,{sourceEvent:z,subject:g,target:d,identifier:C,active:B,x:O[0]+R,y:O[1]+H,dx:O[0]-$[0],dy:O[1]-$[1],dispatch:F}),M)}}return d.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Cn(!!b),d):e},d.container=function(b){return arguments.length?(t=typeof b=="function"?b:Cn(b),d):t},d.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Cn(b),d):n},d.touchable=function(b){return arguments.length?(o=typeof b=="function"?b:Cn(!!b),d):o},d.on=function(){var b=s.on.apply(s,arguments);return b===s?d:b},d.clickDistance=function(b){return arguments.length?(p=(b=+b)*b,d):Math.sqrt(p)},d}function ra(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Us(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function sn(){}var Kt=.7,Vn=1/Kt,$t="\\s*([+-]?\\d+)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fu=/^#([0-9a-f]{3,8})$/,gu=new RegExp(`^rgb\\(${$t},${$t},${$t}\\)$`),xu=new RegExp(`^rgb\\(${Fe},${Fe},${Fe}\\)$`),vu=new RegExp(`^rgba\\(${$t},${$t},${$t},${Ut}\\)$`),yu=new RegExp(`^rgba\\(${Fe},${Fe},${Fe},${Ut}\\)$`),bu=new RegExp(`^hsl\\(${Ut},${Fe},${Fe}\\)$`),wu=new RegExp(`^hsla\\(${Ut},${Fe},${Fe},${Ut}\\)$`),wr={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};ra(sn,ct,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jr,formatHex:jr,formatHex8:ju,formatHsl:Nu,formatRgb:Nr,toString:Nr});function jr(){return this.rgb().formatHex()}function ju(){return this.rgb().formatHex8()}function Nu(){return Gs(this).formatHsl()}function Nr(){return this.rgb().formatRgb()}function ct(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fu.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kr(t):n===3?new ke(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$n(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$n(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=gu.exec(e))?new ke(t[1],t[2],t[3],1):(t=xu.exec(e))?new ke(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=vu.exec(e))?$n(t[1],t[2],t[3],t[4]):(t=yu.exec(e))?$n(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bu.exec(e))?$r(t[1],t[2]/100,t[3]/100,1):(t=wu.exec(e))?$r(t[1],t[2]/100,t[3]/100,t[4]):wr.hasOwnProperty(e)?kr(wr[e]):e==="transparent"?new ke(NaN,NaN,NaN,0):null}function kr(e){return new ke(e>>16&255,e>>8&255,e&255,1)}function $n(e,t,n,o){return o<=0&&(e=t=n=NaN),new ke(e,t,n,o)}function ku(e){return e instanceof sn||(e=ct(e)),e?(e=e.rgb(),new ke(e.r,e.g,e.b,e.opacity)):new ke}function Hn(e,t,n,o){return arguments.length===1?ku(e):new ke(e,t,n,o??1)}function ke(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}ra(ke,Hn,Us(sn,{brighter(e){return e=e==null?Vn:Math.pow(Vn,e),new ke(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Kt:Math.pow(Kt,e),new ke(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ke(lt(this.r),lt(this.g),lt(this.b),Fn(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:Sr,formatHex:Sr,formatHex8:Su,formatRgb:Cr,toString:Cr}));function Sr(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function Su(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cr(){let e=Fn(this.opacity);return`${e===1?"rgb(":"rgba("}${lt(this.r)}, ${lt(this.g)}, ${lt(this.b)}${e===1?")":`, ${e})`}`}function Fn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function lt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function it(e){return e=lt(e),(e<16?"0":"")+e.toString(16)}function $r(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new De(e,t,n,o)}function Gs(e){if(e instanceof De)return new De(e.h,e.s,e.l,e.opacity);if(e instanceof sn||(e=ct(e)),!e)return new De;if(e instanceof De)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),s=Math.max(t,n,o),i=NaN,l=s-r,h=(s+r)/2;return l?(t===s?i=(n-o)/l+(n<o)*6:n===s?i=(o-t)/l+2:i=(t-n)/l+4,l/=h<.5?s+r:2-s-r,i*=60):l=h>0&&h<1?0:i,new De(i,l,h,e.opacity)}function Cu(e,t,n,o){return arguments.length===1?Gs(e):new De(e,t,n,o??1)}function De(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}ra(De,Cu,Us(sn,{brighter(e){return e=e==null?Vn:Math.pow(Vn,e),new De(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Kt:Math.pow(Kt,e),new De(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 ke(Ao(e>=240?e-240:e+120,r,o),Ao(e,r,o),Ao(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new De(Er(this.h),En(this.s),En(this.l),Fn(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(){let e=Fn(this.opacity);return`${e===1?"hsl(":"hsla("}${Er(this.h)}, ${En(this.s)*100}%, ${En(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Er(e){return e=(e||0)%360,e<0?e+360:e}function En(e){return Math.max(0,Math.min(1,e||0))}function Ao(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function Js(e,t,n,o,r){var s=e*e,i=s*e;return((1-3*e+3*s-i)*t+(4-6*s+3*i)*n+(1+3*e+3*s-3*i)*o+i*r)/6}function $u(e){var t=e.length-1;return function(n){var o=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[o],s=e[o+1],i=o>0?e[o-1]:2*r-s,l=o<t-1?e[o+2]:2*s-r;return Js((n-o/t)*t,i,r,s,l)}}function Eu(e){var t=e.length;return function(n){var o=Math.floor(((n%=1)<0?++n:n)*t),r=e[(o+t-1)%t],s=e[o%t],i=e[(o+1)%t],l=e[(o+2)%t];return Js((n-o/t)*t,r,s,i,l)}}var sa=e=>()=>e;function Mu(e,t){return function(n){return e+n*t}}function zu(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 _u(e){return(e=+e)==1?Qs:function(t,n){return n-t?zu(t,n,e):sa(isNaN(t)?n:t)}}function Qs(e,t){var n=t-e;return n?Mu(e,n):sa(isNaN(e)?t:e)}var Wn=(function e(t){var n=_u(t);function o(r,s){var i=n((r=Hn(r)).r,(s=Hn(s)).r),l=n(r.g,s.g),h=n(r.b,s.b),u=Qs(r.opacity,s.opacity);return function(c){return r.r=i(c),r.g=l(c),r.b=h(c),r.opacity=u(c),r+""}}return o.gamma=e,o})(1);function ei(e){return function(t){var n=t.length,o=new Array(n),r=new Array(n),s=new Array(n),i,l;for(i=0;i<n;++i)l=Hn(t[i]),o[i]=l.r||0,r[i]=l.g||0,s[i]=l.b||0;return o=e(o),r=e(r),s=e(s),l.opacity=1,function(h){return l.r=o(h),l.g=r(h),l.b=s(h),l+""}}}var Fy=ei($u),Wy=ei(Eu);function Pu(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(s){for(r=0;r<n;++r)o[r]=e[r]*(1-s)+t[r]*s;return o}}function Au(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),s=new Array(n),i;for(i=0;i<o;++i)r[i]=Yt(e[i],t[i]);for(;i<n;++i)s[i]=t[i];return function(l){for(i=0;i<o;++i)s[i]=r[i](l);return s}}function Du(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function He(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ru(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]=Yt(e[r],t[r]):o[r]=t[r];return function(s){for(r in n)o[r]=n[r](s);return o}}var Wo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Io=new RegExp(Wo.source,"g");function Ou(e){return function(){return e}}function Lu(e){return function(t){return e(t)+""}}function ti(e,t){var n=Wo.lastIndex=Io.lastIndex=0,o,r,s,i=-1,l=[],h=[];for(e=e+"",t=t+"";(o=Wo.exec(e))&&(r=Io.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),l[i]?l[i]+=s:l[++i]=s),(o=o[0])===(r=r[0])?l[i]?l[i]+=r:l[++i]=r:(l[++i]=null,h.push({i,x:He(o,r)})),n=Io.lastIndex;return n<t.length&&(s=t.slice(n),l[i]?l[i]+=s:l[++i]=s),l.length<2?h[0]?Lu(h[0].x):Ou(t):(t=h.length,function(u){for(var c=0,p;c<t;++c)l[(p=h[c]).i]=p.x(u);return l.join("")})}function Yt(e,t){var n=typeof t,o;return t==null||n==="boolean"?sa(t):(n==="number"?He:n==="string"?(o=ct(t))?(t=o,Wn):ti:t instanceof ct?Wn:t instanceof Date?Du:Au(t)?Pu:Array.isArray(t)?Iu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ru:He)(e,t)}var Mr=180/Math.PI,Zo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ni(e,t,n,o,r,s){var i,l,h;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(h=e*n+t*o)&&(n-=e*h,o-=t*h),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,h/=l),e*o<t*n&&(e=-e,t=-t,h=-h,i=-i),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*Mr,skewX:Math.atan(h)*Mr,scaleX:i,scaleY:l}}var Mn;function Tu(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Zo:ni(t.a,t.b,t.c,t.d,t.e,t.f)}function Bu(e){return e==null?Zo:(Mn||(Mn=document.createElementNS("http://www.w3.org/2000/svg","g")),Mn.setAttribute("transform",e),(e=Mn.transform.baseVal.consolidate())?(e=e.matrix,ni(e.a,e.b,e.c,e.d,e.e,e.f)):Zo)}function oi(e,t,n,o){function r(u){return u.length?u.pop()+" ":""}function s(u,c,p,d,m,f){if(u!==p||c!==d){var w=m.push("translate(",null,t,null,n);f.push({i:w-4,x:He(u,p)},{i:w-2,x:He(c,d)})}else(p||d)&&m.push("translate("+p+t+d+n)}function i(u,c,p,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:p.push(r(p)+"rotate(",null,o)-2,x:He(u,c)})):c&&p.push(r(p)+"rotate("+c+o)}function l(u,c,p,d){u!==c?d.push({i:p.push(r(p)+"skewX(",null,o)-2,x:He(u,c)}):c&&p.push(r(p)+"skewX("+c+o)}function h(u,c,p,d,m,f){if(u!==p||c!==d){var w=m.push(r(m)+"scale(",null,",",null,")");f.push({i:w-4,x:He(u,p)},{i:w-2,x:He(c,d)})}else(p!==1||d!==1)&&m.push(r(m)+"scale("+p+","+d+")")}return function(u,c){var p=[],d=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,p,d),i(u.rotate,c.rotate,p,d),l(u.skewX,c.skewX,p,d),h(u.scaleX,u.scaleY,c.scaleX,c.scaleY,p,d),u=c=null,function(m){for(var f=-1,w=d.length,y;++f<w;)p[(y=d[f]).i]=y.x(m);return p.join("")}}}var Vu=oi(Tu,"px, ","px)","deg)"),Hu=oi(Bu,", ",")",")"),Fu=1e-12;function zr(e){return((e=Math.exp(e))+1/e)/2}function Wu(e){return((e=Math.exp(e))-1/e)/2}function Zu(e){return((e=Math.exp(2*e))-1)/(e+1)}var Rn=(function e(t,n,o){function r(s,i){var l=s[0],h=s[1],u=s[2],c=i[0],p=i[1],d=i[2],m=c-l,f=p-h,w=m*m+f*f,y,x;if(w<Fu)x=Math.log(d/u)/t,y=function(M){return[l+M*m,h+M*f,u*Math.exp(t*M*x)]};else{var E=Math.sqrt(w),v=(d*d-u*u+o*w)/(2*u*n*E),b=(d*d-u*u-o*w)/(2*d*n*E),j=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(b*b+1)-b);x=(S-j)/t,y=function(M){var C=M*x,_=zr(j),F=u/(n*E)*(_*Zu(t*C+j)-Wu(j));return[l+F*m,h+F*f,u*_/zr(t*C+j)]}}return y.duration=x*1e3*t/Math.SQRT2,y}return r.rho=function(s){var i=Math.max(.001,+s),l=i*i,h=l*l;return e(i,l,h)},r})(Math.SQRT2,2,4),Mt=0,Wt=0,Ht=0,ai=1e3,Zn,Zt,Yn=0,ut=0,Qn=0,Gt=typeof performance=="object"&&performance.now?performance:Date,ri=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ia(){return ut||(ri(Yu),ut=Gt.now()+Qn)}function Yu(){ut=0}function Xn(){this._call=this._time=this._next=null}Xn.prototype=si.prototype={constructor:Xn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ia():+n)+(t==null?0:+t),!this._next&&Zt!==this&&(Zt?Zt._next=this:Zn=this,Zt=this),this._call=e,this._time=n,Yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yo())}};function si(e,t,n){var o=new Xn;return o.restart(e,t,n),o}function Xu(){ia(),++Mt;for(var e=Zn,t;e;)(t=ut-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Mt}function _r(){ut=(Yn=Gt.now())+Qn,Mt=Wt=0;try{Xu()}finally{Mt=0,Ku(),ut=0}}function qu(){var e=Gt.now(),t=e-Yn;t>ai&&(Qn-=t,Yn=e)}function Ku(){for(var e,t=Zn,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:Zn=n);Zt=e,Yo(o)}function Yo(e){if(!Mt){Wt&&(Wt=clearTimeout(Wt));var t=e-ut;t>24?(e<1/0&&(Wt=setTimeout(_r,e-Gt.now()-Qn)),Ht&&(Ht=clearInterval(Ht))):(Ht||(Yn=Gt.now(),Ht=setInterval(qu,ai)),Mt=1,ri(_r))}}function Pr(e,t,n){var o=new Xn;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Uu=na("start","end","cancel","interrupt"),Gu=[],ii=0,Ar=1,Xo=2,On=3,Ir=4,qo=5,Ln=6;function eo(e,t,n,o,r,s){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;Ju(e,n,{name:t,index:o,group:r,on:Uu,tween:Gu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:ii})}function la(e,t){var n=Le(e,t);if(n.state>ii)throw new Error("too late; already scheduled");return n}function We(e,t){var n=Le(e,t);if(n.state>On)throw new Error("too late; already running");return n}function Le(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ju(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=si(s,0,n.time);function s(u){n.state=Ar,n.timer.restart(i,n.delay,n.time),n.delay<=u&&i(u-n.delay)}function i(u){var c,p,d,m;if(n.state!==Ar)return h();for(c in o)if(m=o[c],m.name===n.name){if(m.state===On)return Pr(i);m.state===Ir?(m.state=Ln,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete o[c]):+c<t&&(m.state=Ln,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete o[c])}if(Pr(function(){n.state===On&&(n.state=Ir,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Xo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xo){for(n.state=On,r=new Array(d=n.tween.length),c=0,p=-1;c<d;++c)(m=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=m);r.length=p+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(h),n.state=qo,1),p=-1,d=r.length;++p<d;)r[p].call(e,c);n.state===qo&&(n.on.call("end",e,e.__data__,n.index,n.group),h())}function h(){n.state=Ln,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Tn(e,t){var n=e.__transition,o,r,s=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((o=n[i]).name!==t){s=!1;continue}r=o.state>Xo&&o.state<qo,o.state=Ln,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[i]}s&&delete e.__transition}}function Qu(e){return this.each(function(){Tn(this,e)})}function eh(e,t){var n,o;return function(){var r=We(this,e),s=r.tween;if(s!==n){o=n=s;for(var i=0,l=o.length;i<l;++i)if(o[i].name===t){o=o.slice(),o.splice(i,1);break}}r.tween=o}}function th(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var s=We(this,e),i=s.tween;if(i!==o){r=(o=i).slice();for(var l={name:t,value:n},h=0,u=r.length;h<u;++h)if(r[h].name===t){r[h]=l;break}h===u&&r.push(l)}s.tween=r}}function nh(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Le(this.node(),n).tween,r=0,s=o.length,i;r<s;++r)if((i=o[r]).name===e)return i.value;return null}return this.each((t==null?eh:th)(n,e,t))}function da(e,t,n){var o=e._id;return e.each(function(){var r=We(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Le(r,o).value[t]}}function li(e,t){var n;return(typeof t=="number"?He:t instanceof ct?Wn:(n=ct(t))?(t=n,Wn):ti)(e,t)}function oh(e){return function(){this.removeAttribute(e)}}function ah(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rh(e,t,n){var o,r=n+"",s;return function(){var i=this.getAttribute(e);return i===r?null:i===o?s:s=t(o=i,n)}}function sh(e,t,n){var o,r=n+"",s;return function(){var i=this.getAttributeNS(e.space,e.local);return i===r?null:i===o?s:s=t(o=i,n)}}function ih(e,t,n){var o,r,s;return function(){var i,l=n(this),h;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),h=l+"",i===h?null:i===o&&h===r?s:(r=h,s=t(o=i,l)))}}function lh(e,t,n){var o,r,s;return function(){var i,l=n(this),h;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),h=l+"",i===h?null:i===o&&h===r?s:(r=h,s=t(o=i,l)))}}function dh(e,t){var n=Jn(e),o=n==="transform"?Hu:li;return this.attrTween(e,typeof t=="function"?(n.local?lh:ih)(n,o,da(this,"attr."+e,t)):t==null?(n.local?ah:oh)(n):(n.local?sh:rh)(n,o,t))}function ch(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function uh(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function hh(e,t){var n,o;function r(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&uh(e,s)),n}return r._value=t,r}function ph(e,t){var n,o;function r(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&ch(e,s)),n}return r._value=t,r}function mh(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=Jn(e);return this.tween(n,(o.local?hh:ph)(o,t))}function fh(e,t){return function(){la(this,e).delay=+t.apply(this,arguments)}}function gh(e,t){return t=+t,function(){la(this,e).delay=t}}function xh(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fh:gh)(t,e)):Le(this.node(),t).delay}function vh(e,t){return function(){We(this,e).duration=+t.apply(this,arguments)}}function yh(e,t){return t=+t,function(){We(this,e).duration=t}}function bh(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vh:yh)(t,e)):Le(this.node(),t).duration}function wh(e,t){if(typeof t!="function")throw new Error;return function(){We(this,e).ease=t}}function jh(e){var t=this._id;return arguments.length?this.each(wh(t,e)):Le(this.node(),t).ease}function Nh(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;We(this,e).ease=n}}function kh(e){if(typeof e!="function")throw new Error;return this.each(Nh(this._id,e))}function Sh(e){typeof e!="function"&&(e=Rs(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var s=t[r],i=s.length,l=o[r]=[],h,u=0;u<i;++u)(h=s[u])&&e.call(h,h.__data__,u,s)&&l.push(h);return new Ge(o,this._parents,this._name,this._id)}function Ch(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,s=Math.min(o,r),i=new Array(o),l=0;l<s;++l)for(var h=t[l],u=n[l],c=h.length,p=i[l]=new Array(c),d,m=0;m<c;++m)(d=h[m]||u[m])&&(p[m]=d);for(;l<o;++l)i[l]=t[l];return new Ge(i,this._parents,this._name,this._id)}function $h(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 Eh(e,t,n){var o,r,s=$h(t)?la:We;return function(){var i=s(this,e),l=i.on;l!==o&&(r=(o=l).copy()).on(t,n),i.on=r}}function Mh(e,t){var n=this._id;return arguments.length<2?Le(this.node(),n).on.on(e):this.each(Eh(n,e,t))}function zh(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _h(){return this.on("end.remove",zh(this._id))}function Ph(e){var t=this._name,n=this._id;typeof e!="function"&&(e=oa(e));for(var o=this._groups,r=o.length,s=new Array(r),i=0;i<r;++i)for(var l=o[i],h=l.length,u=s[i]=new Array(h),c,p,d=0;d<h;++d)(c=l[d])&&(p=e.call(c,c.__data__,d,l))&&("__data__"in c&&(p.__data__=c.__data__),u[d]=p,eo(u[d],t,n,d,u,Le(c,n)));return new Ge(s,this._parents,t,n)}function Ah(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ds(e));for(var o=this._groups,r=o.length,s=[],i=[],l=0;l<r;++l)for(var h=o[l],u=h.length,c,p=0;p<u;++p)if(c=h[p]){for(var d=e.call(c,c.__data__,p,h),m,f=Le(c,n),w=0,y=d.length;w<y;++w)(m=d[w])&&eo(m,t,n,w,d,f);s.push(d),i.push(c)}return new Ge(s,i,t,n)}var Ih=rn.prototype.constructor;function Dh(){return new Ih(this._groups,this._parents)}function Rh(e,t){var n,o,r;return function(){var s=Et(this,e),i=(this.style.removeProperty(e),Et(this,e));return s===i?null:s===n&&i===o?r:r=t(n=s,o=i)}}function di(e){return function(){this.style.removeProperty(e)}}function Oh(e,t,n){var o,r=n+"",s;return function(){var i=Et(this,e);return i===r?null:i===o?s:s=t(o=i,n)}}function Lh(e,t,n){var o,r,s;return function(){var i=Et(this,e),l=n(this),h=l+"";return l==null&&(h=l=(this.style.removeProperty(e),Et(this,e))),i===h?null:i===o&&h===r?s:(r=h,s=t(o=i,l))}}function Th(e,t){var n,o,r,s="style."+t,i="end."+s,l;return function(){var h=We(this,e),u=h.on,c=h.value[s]==null?l||(l=di(t)):void 0;(u!==n||r!==c)&&(o=(n=u).copy()).on(i,r=c),h.on=o}}function Bh(e,t,n){var o=(e+="")=="transform"?Vu:li;return t==null?this.styleTween(e,Rh(e,o)).on("end.style."+e,di(e)):typeof t=="function"?this.styleTween(e,Lh(e,o,da(this,"style."+e,t))).each(Th(this._id,e)):this.styleTween(e,Oh(e,o,t),n).on("end.style."+e,null)}function Vh(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Hh(e,t,n){var o,r;function s(){var i=t.apply(this,arguments);return i!==r&&(o=(r=i)&&Vh(e,i,n)),o}return s._value=t,s}function Fh(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,Hh(e,t,n??""))}function Wh(e){return function(){this.textContent=e}}function Zh(e){return function(){var t=e(this);this.textContent=t??""}}function Yh(e){return this.tween("text",typeof e=="function"?Zh(da(this,"text",e)):Wh(e==null?"":e+""))}function Xh(e){return function(t){this.textContent=e.call(this,t)}}function qh(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Xh(r)),t}return o._value=e,o}function Kh(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,qh(e))}function Uh(){for(var e=this._name,t=this._id,n=ci(),o=this._groups,r=o.length,s=0;s<r;++s)for(var i=o[s],l=i.length,h,u=0;u<l;++u)if(h=i[u]){var c=Le(h,t);eo(h,e,n,u,i,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ge(o,this._parents,e,n)}function Gh(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(s,i){var l={value:i},h={value:function(){--r===0&&s()}};n.each(function(){var u=We(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(h)),u.on=t}),r===0&&s()})}var Jh=0;function Ge(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Qh(e){return rn().transition(e)}function ci(){return++Jh}var Ze=rn.prototype;Ge.prototype=Qh.prototype={constructor:Ge,select:Ph,selectAll:Ah,selectChild:Ze.selectChild,selectChildren:Ze.selectChildren,filter:Sh,merge:Ch,selection:Dh,transition:Uh,call:Ze.call,nodes:Ze.nodes,node:Ze.node,size:Ze.size,empty:Ze.empty,each:Ze.each,on:Mh,attr:dh,attrTween:mh,style:Bh,styleTween:Fh,text:Yh,textTween:Kh,remove:_h,tween:nh,delay:xh,duration:bh,ease:jh,easeVarying:kh,end:Gh,[Symbol.iterator]:Ze[Symbol.iterator]};function ep(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tp={time:null,delay:0,duration:250,ease:ep};function np(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 op(e){var t,n;e instanceof Ge?(t=e._id,e=e._name):(t=ci(),(n=tp).time=ia(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,s=0;s<r;++s)for(var i=o[s],l=i.length,h,u=0;u<l;++u)(h=i[u])&&eo(h,e,t,u,i,n||np(h,t));return new Ge(o,this._parents,e,t)}rn.prototype.interrupt=Qu;rn.prototype.transition=op;var zn=e=>()=>e;function ap(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 qe(e,t,n){this.k=e,this.x=t,this.y=n}qe.prototype={constructor:qe,scale:function(e){return e===1?this:new qe(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qe(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 to=new qe(1,0,0);ui.prototype=qe.prototype;function ui(e){for(;!e.__zoom;)if(!(e=e.parentNode))return to;return e.__zoom}function Do(e){e.stopImmediatePropagation()}function Ft(e){e.preventDefault(),e.stopImmediatePropagation()}function rp(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function sp(){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 Dr(){return this.__zoom||to}function ip(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lp(){return navigator.maxTouchPoints||"ontouchstart"in this}function dp(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function hi(){var e=rp,t=sp,n=dp,o=ip,r=lp,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,h=Rn,u=na("start","zoom","end"),c,p,d,m=500,f=150,w=0,y=10;function x(g){g.property("__zoom",Dr).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",_).on("dblclick.zoom",F).filter(r).on("touchstart.zoom",O).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(g,N,k,z){var A=g.selection?g.selection():g;A.property("__zoom",Dr),g!==A?j(g,N,k,z):A.interrupt().each(function(){S(this,arguments).event(z).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},x.scaleBy=function(g,N,k,z){x.scaleTo(g,function(){var A=this.__zoom.k,$=typeof N=="function"?N.apply(this,arguments):N;return A*$},k,z)},x.scaleTo=function(g,N,k,z){x.transform(g,function(){var A=t.apply(this,arguments),$=this.__zoom,B=k==null?b(A):typeof k=="function"?k.apply(this,arguments):k,V=$.invert(B),W=typeof N=="function"?N.apply(this,arguments):N;return n(v(E($,W),B,V),A,i)},k,z)},x.translateBy=function(g,N,k,z){x.transform(g,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),i)},null,z)},x.translateTo=function(g,N,k,z,A){x.transform(g,function(){var $=t.apply(this,arguments),B=this.__zoom,V=z==null?b($):typeof z=="function"?z.apply(this,arguments):z;return n(to.translate(V[0],V[1]).scale(B.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof k=="function"?-k.apply(this,arguments):-k),$,i)},z,A)};function E(g,N){return N=Math.max(s[0],Math.min(s[1],N)),N===g.k?g:new qe(N,g.x,g.y)}function v(g,N,k){var z=N[0]-k[0]*g.k,A=N[1]-k[1]*g.k;return z===g.x&&A===g.y?g:new qe(g.k,z,A)}function b(g){return[(+g[0][0]+ +g[1][0])/2,(+g[0][1]+ +g[1][1])/2]}function j(g,N,k,z){g.on("start.zoom",function(){S(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(z).end()}).tween("zoom",function(){var A=this,$=arguments,B=S(A,$).event(z),V=t.apply(A,$),W=k==null?b(V):typeof k=="function"?k.apply(A,$):k,J=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),X=A.__zoom,Z=typeof N=="function"?N.apply(A,$):N,ee=h(X.invert(W).concat(J/X.k),Z.invert(W).concat(J/Z.k));return function(Q){if(Q===1)Q=Z;else{var T=ee(Q),K=J/T[2];Q=new qe(K,W[0]-T[0]*K,W[1]-T[1]*K)}B.zoom(null,Q)}})}function S(g,N,k){return!k&&g.__zooming||new M(g,N)}function M(g,N){this.that=g,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(g,N),this.taps=0}M.prototype={event:function(g){return g&&(this.sourceEvent=g),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(g,N){return this.mouse&&g!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&g!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&g!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(g){var N=Ce(this.that).datum();u.call(g,this.that,new ap(g,{sourceEvent:this.sourceEvent,target:x,type:g,transform:this.that.__zoom,dispatch:u}),N)}};function C(g,...N){if(!e.apply(this,arguments))return;var k=S(this,N).event(g),z=this.__zoom,A=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,o.apply(this,arguments)))),$=Ie(g);if(k.wheel)(k.mouse[0][0]!==$[0]||k.mouse[0][1]!==$[1])&&(k.mouse[1]=z.invert(k.mouse[0]=$)),clearTimeout(k.wheel);else{if(z.k===A)return;k.mouse=[$,z.invert($)],Tn(this),k.start()}Ft(g),k.wheel=setTimeout(B,f),k.zoom("mouse",n(v(E(z,A),k.mouse[0],k.mouse[1]),k.extent,i));function B(){k.wheel=null,k.end()}}function _(g,...N){if(d||!e.apply(this,arguments))return;var k=g.currentTarget,z=S(this,N,!0).event(g),A=Ce(g.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",J,!0),$=Ie(g,k),B=g.clientX,V=g.clientY;Xs(g.view),Do(g),z.mouse=[$,this.__zoom.invert($)],Tn(this),z.start();function W(X){if(Ft(X),!z.moved){var Z=X.clientX-B,ee=X.clientY-V;z.moved=Z*Z+ee*ee>w}z.event(X).zoom("mouse",n(v(z.that.__zoom,z.mouse[0]=Ie(X,k),z.mouse[1]),z.extent,i))}function J(X){A.on("mousemove.zoom mouseup.zoom",null),qs(X.view,z.moved),Ft(X),z.event(X).end()}}function F(g,...N){if(e.apply(this,arguments)){var k=this.__zoom,z=Ie(g.changedTouches?g.changedTouches[0]:g,this),A=k.invert(z),$=k.k*(g.shiftKey?.5:2),B=n(v(E(k,$),z,A),t.apply(this,N),i);Ft(g),l>0?Ce(this).transition().duration(l).call(j,B,z,g):Ce(this).call(x.transform,B,z,g)}}function O(g,...N){if(e.apply(this,arguments)){var k=g.touches,z=k.length,A=S(this,N,g.changedTouches.length===z).event(g),$,B,V,W;for(Do(g),B=0;B<z;++B)V=k[B],W=Ie(V,this),W=[W,this.__zoom.invert(W),V.identifier],A.touch0?!A.touch1&&A.touch0[2]!==W[2]&&(A.touch1=W,A.taps=0):(A.touch0=W,$=!0,A.taps=1+!!c);c&&(c=clearTimeout(c)),$&&(A.taps<2&&(p=W[0],c=setTimeout(function(){c=null},m)),Tn(this),A.start())}}function R(g,...N){if(this.__zooming){var k=S(this,N).event(g),z=g.changedTouches,A=z.length,$,B,V,W;for(Ft(g),$=0;$<A;++$)B=z[$],V=Ie(B,this),k.touch0&&k.touch0[2]===B.identifier?k.touch0[0]=V:k.touch1&&k.touch1[2]===B.identifier&&(k.touch1[0]=V);if(B=k.that.__zoom,k.touch1){var J=k.touch0[0],X=k.touch0[1],Z=k.touch1[0],ee=k.touch1[1],Q=(Q=Z[0]-J[0])*Q+(Q=Z[1]-J[1])*Q,T=(T=ee[0]-X[0])*T+(T=ee[1]-X[1])*T;B=E(B,Math.sqrt(Q/T)),V=[(J[0]+Z[0])/2,(J[1]+Z[1])/2],W=[(X[0]+ee[0])/2,(X[1]+ee[1])/2]}else if(k.touch0)V=k.touch0[0],W=k.touch0[1];else return;k.zoom("touch",n(v(B,V,W),k.extent,i))}}function H(g,...N){if(this.__zooming){var k=S(this,N).event(g),z=g.changedTouches,A=z.length,$,B;for(Do(g),d&&clearTimeout(d),d=setTimeout(function(){d=null},m),$=0;$<A;++$)B=z[$],k.touch0&&k.touch0[2]===B.identifier?delete k.touch0:k.touch1&&k.touch1[2]===B.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(B=Ie(B,this),Math.hypot(p[0]-B[0],p[1]-B[1])<y)){var V=Ce(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return x.wheelDelta=function(g){return arguments.length?(o=typeof g=="function"?g:zn(+g),x):o},x.filter=function(g){return arguments.length?(e=typeof g=="function"?g:zn(!!g),x):e},x.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:zn(!!g),x):r},x.extent=function(g){return arguments.length?(t=typeof g=="function"?g:zn([[+g[0][0],+g[0][1]],[+g[1][0],+g[1][1]]]),x):t},x.scaleExtent=function(g){return arguments.length?(s[0]=+g[0],s[1]=+g[1],x):[s[0],s[1]]},x.translateExtent=function(g){return arguments.length?(i[0][0]=+g[0][0],i[1][0]=+g[1][0],i[0][1]=+g[0][1],i[1][1]=+g[1][1],x):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},x.constrain=function(g){return arguments.length?(n=g,x):n},x.duration=function(g){return arguments.length?(l=+g,x):l},x.interpolate=function(g){return arguments.length?(h=g,x):h},x.on=function(){var g=u.on.apply(u,arguments);return g===u?x:g},x.clickDistance=function(g){return arguments.length?(w=(g=+g)*g,x):Math.sqrt(w)},x.tapDistance=function(g){return arguments.length?(y=+g,x):y},x}var _e={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.`},Jt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],pi=["Enter"," ","Escape"],mi={"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"},zt;(function(e){e.Strict="strict",e.Loose="loose"})(zt||(zt={}));var dt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(dt||(dt={}));var Qt;(function(e){e.Partial="partial",e.Full="full"})(Qt||(Qt={}));var fi={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},at;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(at||(at={}));var Xe;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Xe||(Xe={}));var U;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(U||(U={}));var Rr={[U.Left]:U.Right,[U.Right]:U.Left,[U.Top]:U.Bottom,[U.Bottom]:U.Top},gi=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,cp=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ca=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ln=(e,t=[0,0])=>{let{width:n,height:o}=Te(e),r=e.origin??t,s=n*r[0],i=o*r[1];return{x:e.position.x-s,y:e.position.y-i}},up=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,o=e.reduce((r,s)=>{let i=typeof s=="string",l=!t.nodeLookup&&!i?s:void 0;return t.nodeLookup&&(l=i?t.nodeLookup.get(s):ca(s)?s:t.nodeLookup.get(s.id)),l?(n=!0,no(r,qn(l,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?oo(o):{x:0,y:0,width:0,height:0}},dn=(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=no(n,qn(r)),o=!0)}),o?oo(n):{x:0,y:0,width:0,height:0}},ua=(e,t,[n,o,r]=[0,0,1],s=!1,i=!1)=>{let l=(t.x-n)/r,h=(t.y-o)/r,u=t.width/r,c=t.height/r,p=[];for(let d of e.values()){let{measured:m,selectable:f=!0,hidden:w=!1}=d;if(i&&!f||w)continue;let y=m.width??d.width??d.initialWidth??0,x=m.height??d.height??d.initialHeight??0,{x:E,y:v}=d.internals.positionAbsolute,b=bi(l,h,u,c,E,v,y,x),j=y*x,S=s&&b>0;(!d.internals.handleBounds||S||b>=j||d.dragging)&&p.push(d)}return p},hp=(e,t)=>{let n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function pp(e,t){let n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let s;if(t?.includeHiddenNodes){let{width:i,height:l}=Te(r);s=i>0&&l>0}else s=!!(r.measured.width&&r.measured.height&&!r.hidden);s&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function mp({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:s},i){if(e.size===0)return!0;let l=pp(e,i),h=dn(l),u=pa(h,t,n,i?.minZoom??r,i?.maxZoom??s,i?.padding??.1);return await o.setViewport(u,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),!0}function xi({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:s}){let i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:h,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=i.origin??o,p=i.extent||r;if(i.extent==="parent"&&!i.expandParent)if(!l)s?.("005",_e.error005());else{let{width:m,height:f}=Te(l);m&&f&&(p=[[h,u],[h+m,u+f]])}else l&&pt(i.extent)&&(p=[[i.extent[0][0]+h,i.extent[0][1]+u],[i.extent[1][0]+h,i.extent[1][1]+u]]);let d=pt(p)?ht(t,p,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&s?.("015",_e.error015()),{position:{x:d.x-h+(i.measured.width??0)*c[0],y:d.y-u+(i.measured.height??0)*c[1]},positionAbsolute:d}}async function fp({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){let s=new Set(e.map(p=>p.id)),i=[];for(let p of n){if(p.deletable===!1)continue;let d=s.has(p.id),m=!d&&p.parentId&&i.find(f=>f.id===p.parentId);(d||m)&&i.push(p)}let l=new Set(t.map(p=>p.id)),h=o.filter(p=>p.deletable!==!1),u=hp(i,h);for(let p of h)l.has(p.id)&&!u.find(d=>d.id===p.id)&&u.push(p);if(!r)return{edges:u,nodes:i};let c=await r({nodes:i,edges:u});return typeof c=="boolean"?c?{edges:u,nodes:i}:{edges:[],nodes:[]}:c}var _t=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ht=(e={x:0,y:0},t,n)=>({x:_t(e.x,t[0][0],t[1][0]-(n?.width??0)),y:_t(e.y,t[0][1],t[1][1]-(n?.height??0))});function vi(e,t,n){let{width:o,height:r}=Te(n),{x:s,y:i}=n.internals.positionAbsolute;return ht(e,[[s,i],[s+o,i+r]],t)}var Or=(e,t,n)=>e<t?_t(Math.abs(e-t),1,t)/t:e>n?-_t(Math.abs(e-n),1,t)/t:0,ha=(e,t,n=15,o=40)=>{let r=Or(e.x,o,t.width-o)*n,s=Or(e.y,o,t.height-o)*n;return[r,s]},no=(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)}),Ko=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),oo=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),en=(e,t=[0,0])=>{let{x:n,y:o}=ca(e)?e.internals.positionAbsolute:ln(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}},qn=(e,t=[0,0])=>{let{x:n,y:o}=ca(e)?e.internals.positionAbsolute:ln(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)}},yi=(e,t)=>oo(no(Ko(e),Ko(t))),bi=(e,t,n,o,r,s,i,l)=>{let h=Math.max(0,Math.min(e+n,r+i)-Math.max(e,r)),u=Math.max(0,Math.min(t+o,s+l)-Math.max(t,s));return Math.ceil(h*u)},Kn=(e,t)=>bi(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Lr=e=>Re(e.width)&&Re(e.height)&&Re(e.x)&&Re(e.y),Re=e=>!isNaN(e)&&isFinite(e),wi=(e,t)=>(n,o)=>{},cn=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),un=({x:e,y:t},[n,o,r],s=!1,i=[1,1])=>{let l={x:(e-n)/r,y:(t-o)/r};return s?cn(l,i):l},Pt=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function kt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let 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 gp(e,t,n){if(typeof e=="string"||typeof e=="number"){let o=kt(e,n),r=kt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){let o=kt(e.top??e.y??0,n),r=kt(e.bottom??e.y??0,n),s=kt(e.left??e.x??0,t),i=kt(e.right??e.x??0,t);return{top:o,right:i,bottom:r,left:s,x:s+i,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function xp(e,t,n,o,r,s){let{x:i,y:l}=Pt(e,[t,n,o]),{x:h,y:u}=Pt({x:e.x+e.width,y:e.y+e.height},[t,n,o]),c=r-h,p=s-u;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(p)}}var pa=(e,t,n,o,r,s)=>{let i=gp(s,t,n),l=(t-i.x)/e.width,h=(n-i.y)/e.height,u=Math.min(l,h),c=_t(u,o,r),p=e.x+e.width/2,d=e.y+e.height/2,m=t/2-p*c,f=n/2-d*c,w=xp(e,m,f,c,t,n),y={left:Math.min(w.left-i.left,0),top:Math.min(w.top-i.top,0),right:Math.min(w.right-i.right,0),bottom:Math.min(w.bottom-i.bottom,0)};return{x:m-y.left+y.right,y:f-y.top+y.bottom,zoom:c}},tn=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function pt(e){return e!=null&&e!=="parent"}function Te(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ji(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ni(e,t={width:0,height:0},n,o,r){let s={...e},i=o.get(n);if(i){let l=i.origin||r;s.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Tr(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function vp(){let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}function yp(e){return{...mi,...e||{}}}function ki(e){return e===null?null:e?"valid":"invalid"}function Xt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){let{x:s,y:i}=Oe(e),l=un({x:s-(r?.left??0),y:i-(r?.top??0)},o),{x:h,y:u}=n?cn(l,t):l;return{xSnapped:h,ySnapped:u,...l}}var ma=e=>({width:e.offsetWidth,height:e.offsetHeight}),Si=e=>e?.getRootNode?.()||window?.document,bp=["INPUT","SELECT","TEXTAREA"];function Ci(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:bp.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}var $i=e=>"clientX"in e,Oe=(e,t)=>{let n=$i(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)}},Br=(e,t,n,o,r)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(i=>{let l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:r,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...ma(i)}})};function Ei({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:s,targetControlX:i,targetControlY:l}){let h=e*.125+r*.375+i*.375+n*.125,u=t*.125+s*.375+l*.375+o*.125,c=Math.abs(h-e),p=Math.abs(u-t);return[h,u,c,p]}function _n(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Vr({pos:e,x1:t,y1:n,x2:o,y2:r,c:s}){switch(e){case U.Left:return[t-_n(t-o,s),n];case U.Right:return[t+_n(o-t,s),n];case U.Top:return[t,n-_n(n-r,s)];case U.Bottom:return[t,n+_n(r-n,s)]}}function Mi({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:o,targetY:r,targetPosition:s=U.Top,curvature:i=.25}){let[l,h]=Vr({pos:n,x1:e,y1:t,x2:o,y2:r,c:i}),[u,c]=Vr({pos:s,x1:o,y1:r,x2:e,y2:t,c:i}),[p,d,m,f]=Ei({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:l,sourceControlY:h,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${h} ${u},${c} ${o},${r}`,p,d,m,f]}function zi({sourceX:e,sourceY:t,targetX:n,targetY:o}){let r=Math.abs(n-e)/2,s=n<e?n+r:n-r,i=Math.abs(o-t)/2,l=o<t?o+i:o-i;return[s,l,r,i]}function wp({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:s="basic"}){if(s==="manual")return o;let i=r&&n?o+1e3:o,l=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return i+l}function jp({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){let s=no(qn(e),qn(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let i={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return Kn(i,oo(s))>0}var Np=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,kp=(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)),Sp=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",_e.error006()),t;let o=n.getEdgeId||Np,r;return gi(e)?r={...e}:r={...e,id:o(e)},kp(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function _i({sourceX:e,sourceY:t,targetX:n,targetY:o}){let[r,s,i,l]=zi({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,s,i,l]}var Hr={[U.Left]:{x:-1,y:0},[U.Right]:{x:1,y:0},[U.Top]:{x:0,y:-1},[U.Bottom]:{x:0,y:1}},Cp=({source:e,sourcePosition:t=U.Bottom,target:n})=>t===U.Left||t===U.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},Fr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function $p({source:e,sourcePosition:t=U.Bottom,target:n,targetPosition:o=U.Top,center:r,offset:s,stepPosition:i}){let l=Hr[t],h=Hr[o],u={x:e.x+l.x*s,y:e.y+l.y*s},c={x:n.x+h.x*s,y:n.y+h.y*s},p=Cp({source:u,sourcePosition:t,target:c}),d=p.x!==0?"x":"y",m=p[d],f=[],w,y,x={x:0,y:0},E={x:0,y:0},[,,v,b]=zi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*h[d]===-1){d==="x"?(w=r.x??u.x+(c.x-u.x)*i,y=r.y??(u.y+c.y)/2):(w=r.x??(u.x+c.x)/2,y=r.y??u.y+(c.y-u.y)*i);let M=[{x:w,y:u.y},{x:w,y:c.y}],C=[{x:u.x,y},{x:c.x,y}];l[d]===m?f=d==="x"?M:C:f=d==="x"?C:M}else{let M=[{x:u.x,y:c.y}],C=[{x:c.x,y:u.y}];if(d==="x"?f=l.x===m?C:M:f=l.y===m?M:C,t===o){let H=Math.abs(e[d]-n[d]);if(H<=s){let g=Math.min(s-1,s-H);l[d]===m?x[d]=(u[d]>e[d]?-1:1)*g:E[d]=(c[d]>n[d]?-1:1)*g}}if(t!==o){let H=d==="x"?"y":"x",g=l[d]===h[H],N=u[H]>c[H],k=u[H]<c[H];(l[d]===1&&(!g&&N||g&&k)||l[d]!==1&&(!g&&k||g&&N))&&(f=d==="x"?M:C)}let _={x:u.x+x.x,y:u.y+x.y},F={x:c.x+E.x,y:c.y+E.y},O=Math.max(Math.abs(_.x-f[0].x),Math.abs(F.x-f[0].x)),R=Math.max(Math.abs(_.y-f[0].y),Math.abs(F.y-f[0].y));O>=R?(w=(_.x+F.x)/2,y=f[0].y):(w=f[0].x,y=(_.y+F.y)/2)}let j={x:u.x+x.x,y:u.y+x.y},S={x:c.x+E.x,y:c.y+E.y};return[[e,...j.x!==f[0].x||j.y!==f[0].y?[j]:[],...f,...S.x!==f[f.length-1].x||S.y!==f[f.length-1].y?[S]:[],n],w,y,v,b]}function Ep(e,t,n,o){let r=Math.min(Fr(e,t)/2,Fr(t,n)/2,o),{x:s,y:i}=t;if(e.x===s&&s===n.x||e.y===i&&i===n.y)return`L${s} ${i}`;if(e.y===i){let u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${s+r*u},${i}Q ${s},${i} ${s},${i+r*c}`}let l=e.x<n.x?1:-1,h=e.y<n.y?-1:1;return`L ${s},${i+r*h}Q ${s},${i} ${s+r*l},${i}`}function nn({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:o,targetY:r,targetPosition:s=U.Top,borderRadius:i=5,centerX:l,centerY:h,offset:u=20,stepPosition:c=.5}){let[p,d,m,f,w]=$p({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:l,y:h},offset:u,stepPosition:c}),y=`M${p[0].x} ${p[0].y}`;for(let x=1;x<p.length-1;x++)y+=Ep(p[x-1],p[x],p[x+1],i);return y+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[y,d,m,f,w]}function Wr(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Mp(e){let{sourceNode:t,targetNode:n}=e;if(!Wr(t)||!Wr(n))return null;let o=t.internals.handleBounds||Zr(t.handles),r=n.internals.handleBounds||Zr(n.handles),s=Yr(o?.source??[],e.sourceHandle),i=Yr(e.connectionMode===zt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!s||!i)return e.onError?.("008",_e.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=s?.position||U.Bottom,h=i?.position||U.Top,u=mt(t,s,l),c=mt(n,i,h);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:h}}function Zr(e){if(!e)return null;let t=[],n=[];for(let 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 mt(e,t,n=U.Left,o=!1){let r=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??Te(e);if(o)return{x:r+i/2,y:s+l/2};switch(t?.position??n){case U.Top:return{x:r+i/2,y:s};case U.Right:return{x:r+i,y:s+l/2};case U.Bottom:return{x:r+i/2,y:s+l};case U.Left:return{x:r,y:s+l/2}}}function Yr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Uo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function zp(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){let s=new Set;return e.reduce((i,l)=>([l.markerStart||o,l.markerEnd||r].forEach(h=>{if(h&&typeof h=="object"){let u=Uo(h,t);s.has(u)||(i.push({id:u,color:h.color||n,...h}),s.add(u))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}var Pi=1e3,_p=10,fa={nodeOrigin:[0,0],nodeExtent:Jt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Pp={...fa,checkEquality:!0};function ga(e,t){let n={...e};for(let o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function Ap(e,t,n){let o=ga(fa,n);for(let r of e.values())if(r.parentId)va(r,e,t,o);else{let s=ln(r,o.nodeOrigin),i=pt(r.extent)?r.extent:o.nodeExtent,l=ht(s,i,Te(r));r.internals.positionAbsolute=l}}function Ip(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],o=[];for(let r of e.handles){let s={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(s):r.type==="target"&&o.push(s)}return{source:n,target:o}}function xa(e){return e==="manual"}function Go(e,t,n,o={}){let r=ga(Pp,o),s={i:0},i=new Map(t),l=r?.elevateNodesOnSelect&&!xa(r.zIndexMode)?Pi:0,h=e.length>0,u=!1;t.clear(),n.clear();for(let c of e){let p=i.get(c.id);if(r.checkEquality&&c===p?.internals.userNode)t.set(c.id,p);else{let d=ln(c,r.nodeOrigin),m=pt(c.extent)?c.extent:r.nodeExtent,f=ht(d,m,Te(c));p={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:f,handleBounds:Ip(c,p),z:Ai(c,l,r.zIndexMode),userNode:c}},t.set(c.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(h=!1),c.parentId&&va(p,t,n,o,s),u||=c.selected??!1}return{nodesInitialized:h,hasSelectedNodes:u}}function Dp(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function va(e,t,n,o,r){let{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:l,zIndexMode:h}=ga(fa,o),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Dp(e,n),r&&!c.parentId&&c.internals.rootParentIndex===void 0&&h==="auto"&&(c.internals.rootParentIndex=++r.i,c.internals.z=c.internals.z+r.i*_p),r&&c.internals.rootParentIndex!==void 0&&(r.i=c.internals.rootParentIndex);let p=s&&!xa(h)?Pi:0,{x:d,y:m,z:f}=Rp(e,c,i,l,p,h),{positionAbsolute:w}=e.internals,y=d!==w.x||m!==w.y;(y||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:y?{x:d,y:m}:w,z:f}})}function Ai(e,t,n){let o=Re(e.zIndex)?e.zIndex:0;return xa(n)?o:o+(e.selected?t:0)}function Rp(e,t,n,o,r,s){let{x:i,y:l}=t.internals.positionAbsolute,h=Te(e),u=ln(e,n),c=pt(e.extent)?ht(u,e.extent,h):u,p=ht({x:i+c.x,y:l+c.y},o,h);e.extent==="parent"&&(p=vi(p,h,t));let d=Ai(e,r,s),m=t.internals.z??0;return{x:p.x,y:p.y,z:m>=d?m+1:d}}function ya(e,t,n,o=[0,0]){let r=[],s=new Map;for(let i of e){let l=t.get(i.parentId);if(!l)continue;let h=s.get(i.parentId)?.expandedRect??en(l),u=yi(h,i.rect);s.set(i.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:i,parent:l},h)=>{let u=l.internals.positionAbsolute,c=Te(l),p=l.origin??o,d=i.x<u.x?Math.round(Math.abs(u.x-i.x)):0,m=i.y<u.y?Math.round(Math.abs(u.y-i.y)):0,f=Math.max(c.width,Math.round(i.width)),w=Math.max(c.height,Math.round(i.height)),y=(f-c.width)*p[0],x=(w-c.height)*p[1];(d>0||m>0||y||x)&&(r.push({id:h,type:"position",position:{x:l.position.x-d+y,y:l.position.y-m+x}}),n.get(h)?.forEach(E=>{e.some(v=>v.id===E.id)||r.push({id:E.id,type:"position",position:{x:E.position.x+d,y:E.position.y+m}})})),(c.width<i.width||c.height<i.height||d||m)&&r.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:f+(d?p[0]*d-y:0),height:w+(m?p[1]*m-x:0)}})}),r}function Op(e,t,n,o,r,s,i){let l=o?.querySelector(".xyflow__viewport"),h=!1;if(!l)return{changes:[],updatedInternals:h};let u=[],c=window.getComputedStyle(l),{m22:p}=new window.DOMMatrixReadOnly(c.transform),d=[];for(let m of e.values()){let f=t.get(m.id);if(!f)continue;if(f.hidden){t.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),h=!0;continue}let w=ma(m.nodeElement),y=f.measured.width!==w.width||f.measured.height!==w.height;if(w.width&&w.height&&(y||!f.internals.handleBounds||m.force)){let x=m.nodeElement.getBoundingClientRect(),E=pt(f.extent)?f.extent:s,{positionAbsolute:v}=f.internals;if(f.parentId&&f.extent==="parent"){let j=t.get(f.parentId);j&&(v=vi(v,w,j))}else E&&(v=ht(v,E,w));let b={...f,measured:w,internals:{...f.internals,positionAbsolute:v,handleBounds:{source:Br("source",m.nodeElement,x,p,f.id),target:Br("target",m.nodeElement,x,p,f.id)}}};t.set(f.id,b),f.parentId&&va(b,t,n,{nodeOrigin:r,zIndexMode:i}),h=!0,y&&(u.push({id:f.id,type:"dimensions",dimensions:w}),f.expandParent&&f.parentId&&d.push({id:f.id,parentId:f.parentId,rect:en(b,r)}))}}if(d.length>0){let m=ya(d,t,n,r);u.push(...m)}return{changes:u,updatedInternals:h}}async function Lp({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;let i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],o);return!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2])}function Xr(e,t,n,o,r,s){let i=r,l=o.get(i)||new Map;o.set(i,l.set(n,t)),i=`${r}-${e}`;let h=o.get(i)||new Map;if(o.set(i,h.set(n,t)),s){i=`${r}-${e}-${s}`;let u=o.get(i)||new Map;o.set(i,u.set(n,t))}}function Ii(e,t,n){e.clear(),t.clear();for(let o of n){let{source:r,target:s,sourceHandle:i=null,targetHandle:l=null}=o,h={edgeId:o.id,source:r,target:s,sourceHandle:i,targetHandle:l},u=`${r}-${i}--${s}-${l}`,c=`${s}-${l}--${r}-${i}`;Xr("source",h,c,e,r,i),Xr("target",h,u,e,s,l),t.set(o.id,o)}}function Di(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Di(n,t):!1}function qr(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 Tp(e,t,n,o){let r=new Map;for(let[s,i]of e)if((i.selected||i.id===o)&&(!i.parentId||!Di(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){let l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Ro({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){let r=[];for(let[i,l]of t){let h=n.get(i)?.internals.userNode;h&&r.push({...h,position:l.position,dragging:o})}if(!e)return[r[0],r];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:o}:r[0],r]}function Bp({dragItems:e,snapGrid:t,x:n,y:o}){let r=e.values().next().value;if(!r)return null;let s={x:n-r.distance.x,y:o-r.distance.y},i=cn(s,t);return{x:i.x-s.x,y:i.y-s.y}}function Vp({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let s={x:null,y:null},i=0,l=new Map,h=!1,u={x:0,y:0},c=null,p=!1,d=null,m=!1,f=!1,w=null;function y({noDragClassName:E,handleSelector:v,domNode:b,isSelectable:j,nodeId:S,nodeClickDistance:M=0}){d=Ce(b);function C({x:R,y:H}){let{nodeLookup:g,nodeExtent:N,snapGrid:k,snapToGrid:z,nodeOrigin:A,onNodeDrag:$,onSelectionDrag:B,onError:V,updateNodePositions:W}=t();s={x:R,y:H};let J=!1,X=l.size>1,Z=X&&N?Ko(dn(l)):null,ee=X&&z?Bp({dragItems:l,snapGrid:k,x:R,y:H}):null;for(let[Q,T]of l){if(!g.has(Q))continue;let K={x:R-T.distance.x,y:H-T.distance.y};z&&(K=ee?{x:Math.round(K.x+ee.x),y:Math.round(K.y+ee.y)}:cn(K,k));let oe=null;if(X&&N&&!T.extent&&Z){let{positionAbsolute:se}=T.internals,re=se.x-Z.x+N[0][0],le=se.x+T.measured.width-Z.x2+N[1][0],ce=se.y-Z.y+N[0][1],ge=se.y+T.measured.height-Z.y2+N[1][1];oe=[[re,ce],[le,ge]]}let{position:ie,positionAbsolute:q}=xi({nodeId:Q,nextPosition:K,nodeLookup:g,nodeExtent:oe||N,nodeOrigin:A,onError:V});J=J||T.position.x!==ie.x||T.position.y!==ie.y,T.position=ie,T.internals.positionAbsolute=q}if(f=f||J,!!J&&(W(l,!0),w&&(o||$||!S&&B))){let[Q,T]=Ro({nodeId:S,dragItems:l,nodeLookup:g});o?.(w,l,Q,T),$?.(w,Q,T),S||B?.(w,T)}}async function _(){if(!c)return;let{transform:R,panBy:H,autoPanSpeed:g,autoPanOnNodeDrag:N}=t();if(!N){h=!1,cancelAnimationFrame(i);return}let[k,z]=ha(u,c,g);(k!==0||z!==0)&&(s.x=(s.x??0)-k/R[2],s.y=(s.y??0)-z/R[2],await H({x:k,y:z})&&C(s)),i=requestAnimationFrame(_)}function F(R){let{nodeLookup:H,multiSelectionActive:g,nodesDraggable:N,transform:k,snapGrid:z,snapToGrid:A,selectNodesOnDrag:$,onNodeDragStart:B,onSelectionDragStart:V,unselectNodesAndEdges:W}=t();p=!0,(!$||!j)&&!g&&S&&(H.get(S)?.selected||W()),j&&$&&S&&e?.(S);let J=Xt(R.sourceEvent,{transform:k,snapGrid:z,snapToGrid:A,containerBounds:c});if(s=J,l=Tp(H,N,J,S),l.size>0&&(n||B||!S&&V)){let[X,Z]=Ro({nodeId:S,dragItems:l,nodeLookup:H});n?.(R.sourceEvent,l,X,Z),B?.(R.sourceEvent,X,Z),S||V?.(R.sourceEvent,Z)}}let O=Ks().clickDistance(M).on("start",R=>{let{domNode:H,nodeDragThreshold:g,transform:N,snapGrid:k,snapToGrid:z}=t();c=H?.getBoundingClientRect()||null,m=!1,f=!1,w=R.sourceEvent,g===0&&F(R),s=Xt(R.sourceEvent,{transform:N,snapGrid:k,snapToGrid:z,containerBounds:c}),u=Oe(R.sourceEvent,c)}).on("drag",R=>{let{autoPanOnNodeDrag:H,transform:g,snapGrid:N,snapToGrid:k,nodeDragThreshold:z,nodeLookup:A}=t(),$=Xt(R.sourceEvent,{transform:g,snapGrid:N,snapToGrid:k,containerBounds:c});if(w=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||S&&!A.has(S))&&(m=!0),!m){if(!h&&H&&p&&(h=!0,_()),!p){let B=Oe(R.sourceEvent,c),V=B.x-u.x,W=B.y-u.y;Math.sqrt(V*V+W*W)>z&&F(R)}(s.x!==$.xSnapped||s.y!==$.ySnapped)&&l&&p&&(u=Oe(R.sourceEvent,c),C($))}}).on("end",R=>{if(!p||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(h=!1,p=!1,cancelAnimationFrame(i),l.size>0){let{nodeLookup:H,updateNodePositions:g,onNodeDragStop:N,onSelectionDragStop:k}=t();if(f&&(g(l,!1),f=!1),r||N||!S&&k){let[z,A]=Ro({nodeId:S,dragItems:l,nodeLookup:H,dragging:!1});r?.(R.sourceEvent,l,z,A),N?.(R.sourceEvent,z,A),S||k?.(R.sourceEvent,A)}}}).filter(R=>{let H=R.target;return!R.button&&(!E||!qr(H,`.${E}`,b))&&(!v||qr(H,v,b))});d.call(O)}function x(){d?.on(".drag",null)}return{update:y,destroy:x}}function Hp(e,t,n){let o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())Kn(r,en(s))>0&&o.push(s);return o}var Fp=250;function Wp(e,t,n,o){let r=[],s=1/0,i=Hp(e,n,t+Fp);for(let l of i){let h=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(let u of h){if(o.nodeId===u.nodeId&&o.type===u.type&&o.id===u.id)continue;let{x:c,y:p}=mt(l,u,u.position,!0),d=Math.sqrt(Math.pow(c-e.x,2)+Math.pow(p-e.y,2));d>t||(d<s?(r=[{...u,x:c,y:p}],s=d):d===s&&r.push({...u,x:c,y:p}))}}if(!r.length)return null;if(r.length>1){let l=o.type==="source"?"target":"source";return r.find(h=>h.type===l)??r[0]}return r[0]}function Ri(e,t,n,o,r,s=!1){let i=o.get(e);if(!i)return null;let l=r==="strict"?i.internals.handleBounds?.[t]:[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]],h=(n?l?.find(u=>u.id===n):l?.[0])??null;return h&&s?{...h,...mt(i,h,h.position,!0)}:h}function Oi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Zp(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Li=()=>!0;function Yp(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:s,isTarget:i,domNode:l,nodeLookup:h,lib:u,autoPanOnConnect:c,flowId:p,panBy:d,cancelConnection:m,onConnectStart:f,onConnect:w,onConnectEnd:y,isValidConnection:x=Li,onReconnectEnd:E,updateConnection:v,getTransform:b,getFromHandle:j,autoPanSpeed:S,dragThreshold:M=1,handleDomNode:C}){let _=Si(e.target),F=0,O,{x:R,y:H}=Oe(e),g=Oi(s,C),N=l?.getBoundingClientRect(),k=!1;if(!N||!g)return;let z=Ri(r,g,o,h,t);if(!z)return;let A=Oe(e,N),$=!1,B=null,V=!1,W=null;function J(){if(!c||!N)return;let[oe,ie]=ha(A,N,S);d({x:oe,y:ie}),F=requestAnimationFrame(J)}let X={...z,nodeId:r,type:g,position:z.position},Z=h.get(r),ee={inProgress:!0,isValid:null,from:mt(Z,X,U.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:Z,to:A,toHandle:null,toPosition:Rr[X.position],toNode:null,pointer:A};function Q(){k=!0,v(ee),f?.(e,{nodeId:r,handleId:o,handleType:g})}M===0&&Q();function T(oe){if(!k){let{x:ce,y:ge}=Oe(oe),je=ce-R,Ee=ge-H;if(!(je*je+Ee*Ee>M*M))return;Q()}if(!j()||!X){K(oe);return}let ie=b();A=Oe(oe,N),O=Wp(un(A,ie,!1,[1,1]),n,h,X),$||(J(),$=!0);let q=Ti(oe,{handle:O,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:i?"target":"source",isValidConnection:x,doc:_,lib:u,flowId:p,nodeLookup:h});W=q.handleDomNode,B=q.connection,V=Zp(!!O,q.isValid);let se=h.get(r),re=se?mt(se,X,U.Left,!0):ee.from,le={...ee,from:re,isValid:V,to:q.toHandle&&V?Pt({x:q.toHandle.x,y:q.toHandle.y},ie):A,toHandle:q.toHandle,toPosition:V&&q.toHandle?q.toHandle.position:Rr[X.position],toNode:q.toHandle?h.get(q.toHandle.nodeId):null,pointer:A};v(le),ee=le}function K(oe){if(!("touches"in oe&&oe.touches.length>0)){if(k){(O||W)&&B&&V&&w?.(B);let{inProgress:ie,...q}=ee,se={...q,toPosition:ee.toHandle?ee.toPosition:null};y?.(oe,se),s&&E?.(oe,se)}m(),cancelAnimationFrame(F),$=!1,V=!1,B=null,W=null,_.removeEventListener("mousemove",T),_.removeEventListener("mouseup",K),_.removeEventListener("touchmove",T),_.removeEventListener("touchend",K)}}_.addEventListener("mousemove",T),_.addEventListener("mouseup",K),_.addEventListener("touchmove",T),_.addEventListener("touchend",K)}function Ti(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:s,doc:i,lib:l,flowId:h,isValidConnection:u=Li,nodeLookup:c}){let p=s==="target",d=t?i.querySelector(`.${l}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:m,y:f}=Oe(e),w=i.elementFromPoint(m,f),y=w?.classList.contains(`${l}-flow__handle`)?w:d,x={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let E=Oi(void 0,y),v=y.getAttribute("data-nodeid"),b=y.getAttribute("data-handleid"),j=y.classList.contains("connectable"),S=y.classList.contains("connectableend");if(!v||!E)return x;let M={source:p?v:o,sourceHandle:p?b:r,target:p?o:v,targetHandle:p?r:b};x.connection=M;let C=j&&S&&(n===zt.Strict?p&&E==="source"||!p&&E==="target":v!==o||b!==r);x.isValid=C&&u(M),x.toHandle=Ri(v,E,b,c,n,!0)}return x}var Jo={onPointerDown:Yp,isValid:Ti};function Xp({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){let r=Ce(e);function s({translateExtent:l,width:h,height:u,zoomStep:c=1,pannable:p=!0,zoomable:d=!0,inversePan:m=!1}){let f=v=>{if(v.sourceEvent.type!=="wheel"||!t)return;let b=n(),j=v.sourceEvent.ctrlKey&&tn()?10:1,S=-v.sourceEvent.deltaY*(v.sourceEvent.deltaMode===1?.05:v.sourceEvent.deltaMode?1:.002)*c,M=b[2]*Math.pow(2,S*j);t.scaleTo(M)},w=[0,0],y=v=>{(v.sourceEvent.type==="mousedown"||v.sourceEvent.type==="touchstart")&&(w=[v.sourceEvent.clientX??v.sourceEvent.touches[0].clientX,v.sourceEvent.clientY??v.sourceEvent.touches[0].clientY])},x=v=>{let b=n();if(v.sourceEvent.type!=="mousemove"&&v.sourceEvent.type!=="touchmove"||!t)return;let j=[v.sourceEvent.clientX??v.sourceEvent.touches[0].clientX,v.sourceEvent.clientY??v.sourceEvent.touches[0].clientY],S=[j[0]-w[0],j[1]-w[1]];w=j;let M=o()*Math.max(b[2],Math.log(b[2]))*(m?-1:1),C={x:b[0]-S[0]*M,y:b[1]-S[1]*M},_=[[0,0],[h,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:b[2]},_,l)},E=hi().on("start",y).on("zoom",p?x:null).on("zoom.wheel",d?f:null);r.call(E,{})}function i(){r.on("zoom",null)}return{update:s,destroy:i,pointer:Ie}}var ao=e=>({x:e.x,y:e.y,zoom:e.k}),Oo=({x:e,y:t,zoom:n})=>to.translate(e,t).scale(n),ot=(e,t)=>e.target.closest(`.${t}`),Bi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),qp=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Lo=(e,t=0,n=qp,o=()=>{})=>{let r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Vi=e=>{let t=e.ctrlKey&&tn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Kp({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:h,onPanZoomEnd:u}){return c=>{if(ot(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();let p=n.property("__zoom").k||1;if(c.ctrlKey&&i){let y=Ie(c),x=Vi(c),E=p*Math.pow(2,x);o.scaleTo(n,E,y,c);return}let d=c.deltaMode===1?20:1,m=r===dt.Vertical?0:c.deltaX*d,f=r===dt.Horizontal?0:c.deltaY*d;!tn()&&c.shiftKey&&r!==dt.Vertical&&(m=c.deltaY*d,f=0),o.translateBy(n,-(m/p)*s,-(f/p)*s,{internal:!0});let w=ao(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?h?.(c,w):(e.isPanScrolling=!0,l?.(c,w)),e.panScrollTimeout=setTimeout(()=>{u?.(c,w),e.isPanScrolling=!1},150)}}function Up({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){let s=o.type==="wheel",i=!t&&s&&!o.ctrlKey,l=ot(o,e);if(o.ctrlKey&&s&&l&&o.preventDefault(),i||l)return null;o.preventDefault(),n.call(this,o,r)}}function Gp({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;let r=ao(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 Jp({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return s=>{e.usedRightMouseButton=!!(n&&Bi(t,e.mouseButton??0)),s.sourceEvent?.sync||o([s.transform.x,s.transform.y,s.transform.k]),r&&!s.sourceEvent?.internal&&r?.(s.sourceEvent,ao(s.transform))}}function Qp({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:s}){return i=>{if(!i.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Bi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&s(i.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){let l=ao(i.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(i.sourceEvent,l)},n?150:0)}}}function em({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:h,noPanClassName:u,lib:c,connectionInProgress:p}){return d=>{let m=t||n,f=o&&d.ctrlKey,w=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ot(d,`${c}-flow__node`)||ot(d,`${c}-flow__edge`)||ot(d,`${c}-flow__selection`)||ot(d,`${c}-flow__nodesselection`)))return!0;if(!r&&!m&&!s&&!i&&!o||l||p&&!w||ot(d,h)&&w||ot(d,u)&&(!w||s&&w&&!t)||!o&&d.ctrlKey&&w)return!1;if(!o&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!m&&!s&&!f&&w||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;let y=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||w||e)&&y}}function tm({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:s,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:h}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect(),p=[[0,0],[c.width,c.height]];(typeof ResizeObserver<"u"?new ResizeObserver(R=>{let H=R[0];H&&(p=[[0,0],[H.contentRect.width,H.contentRect.height]])}):null)?.observe(e);let d=hi().extent(()=>p).scaleExtent([t,n]).translateExtent(o),m=Ce(e).call(d);v({x:r.x,y:r.y,zoom:_t(r.zoom,t,n)},[[0,0],[c.width,c.height]],o);let f=m.on("wheel.zoom"),w=m.on("dblclick.zoom");d.wheelDelta(Vi);async function y(R,H){return m?new Promise(g=>{d?.interpolate(H?.interpolate==="linear"?Yt:Rn).transform(Lo(m,H?.duration,H?.ease,()=>g(!0)),R)}):!1}function x({noWheelClassName:R,noPanClassName:H,onPaneContextMenu:g,userSelectionActive:N,panOnScroll:k,panOnDrag:z,panOnScrollMode:A,panOnScrollSpeed:$,preventScrolling:B,zoomOnPinch:V,zoomOnScroll:W,zoomOnDoubleClick:J,panActivationKeyPressed:X=!1,zoomActivationKeyPressed:Z,lib:ee,onTransformChange:Q,connectionInProgress:T,paneClickDistance:K,selectionOnDrag:oe}){N&&!u.isZoomingOrPanning&&E();let ie=k&&!Z&&!N;d.clickDistance(oe?1/0:!Re(K)||K<0?0:K);let q=ie?Kp({zoomPanValues:u,noWheelClassName:R,d3Selection:m,d3Zoom:d,panOnScrollMode:A,panOnScrollSpeed:$,zoomOnPinch:V,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:l}):Up({noWheelClassName:R,preventScrolling:B,d3ZoomHandler:f});m.on("wheel.zoom",q,{passive:!1});let se=Gp({zoomPanValues:u,onDraggingChange:h,onPanZoomStart:i});d.on("start",se);let re=Jp({zoomPanValues:u,panOnDrag:z,onPaneContextMenu:!!g,onPanZoom:s,onTransformChange:Q});d.on("zoom",re);let le=Qp({zoomPanValues:u,panOnDrag:z,panOnScroll:k,onPaneContextMenu:g,onPanZoomEnd:l,onDraggingChange:h});d.on("end",le);let ce=em({panActivationKeyPressed:X,zoomActivationKeyPressed:Z,panOnDrag:z,zoomOnScroll:W,panOnScroll:k,zoomOnDoubleClick:J,zoomOnPinch:V,userSelectionActive:N,noPanClassName:H,noWheelClassName:R,lib:ee,connectionInProgress:T});d.filter(ce),J?m.on("dblclick.zoom",w):m.on("dblclick.zoom",null)}function E(){d.on("zoom",null)}async function v(R,H,g){let N=Oo(R),k=d?.constrain()(N,H,g);return k&&await y(k),k}async function b(R,H){let g=Oo(R);return await y(g,H),g}function j(R){if(m){let H=Oo(R),g=m.property("__zoom");(g.k!==R.zoom||g.x!==R.x||g.y!==R.y)&&d?.transform(m,H,null,{sync:!0})}}function S(){let R=m?ui(m.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function M(R,H){return m?new Promise(g=>{d?.interpolate(H?.interpolate==="linear"?Yt:Rn).scaleTo(Lo(m,H?.duration,H?.ease,()=>g(!0)),R)}):!1}async function C(R,H){return m?new Promise(g=>{d?.interpolate(H?.interpolate==="linear"?Yt:Rn).scaleBy(Lo(m,H?.duration,H?.ease,()=>g(!0)),R)}):!1}function _(R){d?.scaleExtent(R)}function F(R){d?.translateExtent(R)}function O(R){let H=!Re(R)||R<0?0:R;d?.clickDistance(H)}return{update:x,destroy:E,setViewport:b,setViewportConstrained:v,getViewport:S,scaleTo:M,scaleBy:C,setScaleExtent:_,setTranslateExtent:F,syncViewport:j,setClickDistance:O}}var ft;(function(e){e.Line="line",e.Handle="handle"})(ft||(ft={}));var nm=["top-left","top-right","bottom-left","bottom-right"],om=["top","right","bottom","left"];function am({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:s}){let i=e-t,l=n-o,h=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&r&&(h[0]=h[0]*-1),l&&s&&(h[1]=h[1]*-1),h}function Kr(e){let 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 tt(e,t){return Math.max(0,t-e)}function nt(e,t){return Math.max(0,e-t)}function Pn(e,t,n){return Math.max(0,t-e,e-n)}function Ur(e,t){return e?!t:t}function rm(e,t,n,o,r,s,i,l){let{affectsX:h,affectsY:u}=t,{isHorizontal:c,isVertical:p}=t,d=c&&p,{xSnapped:m,ySnapped:f}=n,{minWidth:w,maxWidth:y,minHeight:x,maxHeight:E}=o,{x:v,y:b,width:j,height:S,aspectRatio:M}=e,C=Math.floor(c?m-e.pointerX:0),_=Math.floor(p?f-e.pointerY:0),F=j+(h?-C:C),O=S+(u?-_:_),R=-s[0]*j,H=-s[1]*S,g=Pn(F,w,y),N=Pn(O,x,E);if(i){let A=0,$=0;h&&C<0?A=tt(v+C+R,i[0][0]):!h&&C>0&&(A=nt(v+F+R,i[1][0])),u&&_<0?$=tt(b+_+H,i[0][1]):!u&&_>0&&($=nt(b+O+H,i[1][1])),g=Math.max(g,A),N=Math.max(N,$)}if(l){let A=0,$=0;h&&C>0?A=nt(v+C,l[0][0]):!h&&C<0&&(A=tt(v+F,l[1][0])),u&&_>0?$=nt(b+_,l[0][1]):!u&&_<0&&($=tt(b+O,l[1][1])),g=Math.max(g,A),N=Math.max(N,$)}if(r){if(c){let A=Pn(F/M,x,E)*M;if(g=Math.max(g,A),i){let $=0;!h&&!u||h&&!u&&d?$=nt(b+H+F/M,i[1][1])*M:$=tt(b+H+(h?C:-C)/M,i[0][1])*M,g=Math.max(g,$)}if(l){let $=0;!h&&!u||h&&!u&&d?$=tt(b+F/M,l[1][1])*M:$=nt(b+(h?C:-C)/M,l[0][1])*M,g=Math.max(g,$)}}if(p){let A=Pn(O*M,w,y)/M;if(N=Math.max(N,A),i){let $=0;!h&&!u||u&&!h&&d?$=nt(v+O*M+R,i[1][0])/M:$=tt(v+(u?_:-_)*M+R,i[0][0])/M,N=Math.max(N,$)}if(l){let $=0;!h&&!u||u&&!h&&d?$=tt(v+O*M,l[1][0])/M:$=nt(v+(u?_:-_)*M,l[0][0])/M,N=Math.max(N,$)}}}_=_+(_<0?N:-N),C=C+(C<0?g:-g),r&&(d?F>O*M?_=(Ur(h,u)?-C:C)/M:C=(Ur(h,u)?-_:_)*M:c?(_=C/M,u=h):(C=_*M,h=u));let k=h?v+C:v,z=u?b+_:b;return{width:j+(h?-C:C),height:S+(u?-_:_),x:s[0]*C*(h?-1:1)+k,y:s[1]*_*(u?-1:1)+z}}var Hi={width:0,height:0,x:0,y:0},sm={...Hi,pointerX:0,pointerY:0,aspectRatio:1};function im(e,t,n){let o=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,i=e.measured.height??0,l=n[0]*s,h=n[1]*i;return[[o-l,r-h],[o+s-l,r+i-h]]}function lm({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){let s=Ce(e),i={controlDirection:Kr("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:p,resizeDirection:d,onResizeStart:m,onResize:f,onResizeEnd:w,shouldResize:y}){let x={...Hi},E={...sm};i={boundaries:c,resizeDirection:d,keepAspectRatio:p,controlDirection:Kr(u)};let v,b=null,j=[],S,M,C,_=Ks().on("start",F=>{let{nodeLookup:O,transform:R,snapGrid:H,snapToGrid:g,nodeOrigin:N,paneDomNode:k}=n();if(v=O.get(t),!v)return;b=k?.getBoundingClientRect()??null;let{xSnapped:z,ySnapped:A}=Xt(F.sourceEvent,{transform:R,snapGrid:H,snapToGrid:g,containerBounds:b});x={width:v.measured.width??0,height:v.measured.height??0,x:v.position.x??0,y:v.position.y??0},E={...x,pointerX:z,pointerY:A,aspectRatio:x.width/x.height},S=void 0,M=pt(v.extent)?v.extent:void 0,v.parentId&&(v.extent==="parent"||v.expandParent)&&(S=O.get(v.parentId)),S&&v.extent==="parent"&&(M=[[0,0],[S.measured.width,S.measured.height]]),j=[],C=void 0;for(let[$,B]of O)if(B.parentId===t&&(j.push({id:$,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){let V=im(B,v,B.origin??N);C?C=[[Math.min(V[0][0],C[0][0]),Math.min(V[0][1],C[0][1])],[Math.max(V[1][0],C[1][0]),Math.max(V[1][1],C[1][1])]]:C=V}m?.(F,{...x})}).on("drag",F=>{let{transform:O,snapGrid:R,snapToGrid:H,nodeOrigin:g}=n(),N=Xt(F.sourceEvent,{transform:O,snapGrid:R,snapToGrid:H,containerBounds:b}),k=[];if(!v)return;let{x:z,y:A,width:$,height:B}=x,V={},W=v.origin??g,{width:J,height:X,x:Z,y:ee}=rm(E,i.controlDirection,N,i.boundaries,i.keepAspectRatio,W,M,C),Q=J!==$,T=X!==B,K=Z!==z&&Q,oe=ee!==A&&T;if(!K&&!oe&&!Q&&!T)return;let ie={prevValues:{...x},startX:E.x,startY:E.y,childNodes:j.map(re=>({...re,position:{...re.position}}))};if((K||oe||W[0]===1||W[1]===1)&&(V.x=K?Z:x.x,V.y=oe?ee:x.y,x.x=V.x,x.y=V.y,j.length>0)){let re=Z-z,le=ee-A;for(let ce of j)ce.position={x:ce.position.x-re+W[0]*(J-$),y:ce.position.y-le+W[1]*(X-B)},k.push(ce)}if((Q||T)&&(V.width=Q&&(!i.resizeDirection||i.resizeDirection==="horizontal")?J:x.width,V.height=T&&(!i.resizeDirection||i.resizeDirection==="vertical")?X:x.height,x.width=V.width,x.height=V.height),S&&v.expandParent){let re=W[0]*(V.width??0);V.x&&V.x<re&&(x.x=re,E.x=E.x-(V.x-re));let le=W[1]*(V.height??0);V.y&&V.y<le&&(x.y=le,E.y=E.y-(V.y-le))}let q=am({width:x.width,prevWidth:$,height:x.height,prevHeight:B,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),se={...x,direction:q};if(y?.(F,se)===!1){x=ie.prevValues,E.x=ie.startX,E.y=ie.startY,j.forEach((re,le)=>{re.position=ie.childNodes[le].position});return}f?.(F,se),o(V,k)}).on("end",F=>{w?.(F,{...x}),r?.({...x})});s.call(_)}function h(){s.on(".drag",null)}return{update:l,destroy:h}}var dm=et(Nt(),1),cm=et($d(),1),Gr=e=>{let t,n=new Set,o=(l,h)=>{let u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){let c=t;t=h??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,c))}},r=()=>t,s={setState:o,getState:r,getInitialState:()=>i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(import.meta.env?import.meta.env.MODE: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()}},i=t=e(o,r,s);return s},um=e=>e?Gr(e):Gr,{useDebugValue:hm}=dm.default,{useSyncExternalStoreWithSelector:pm}=cm.default,mm=e=>e;function Fi(e,t=mm,n){let o=pm(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return hm(o),o}var Jr=(e,t)=>{let n=um(e),o=(r,s=t)=>Fi(n,r,s);return Object.assign(o,n),o},fm=(e,t)=>e?Jr(e,t):Jr;function fe(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(let[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(let o of e)if(!t.has(o))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var gm=et(vr()),ro=(0,L.createContext)(null),xm=ro.Provider,Wi=_e.error001("react");function de(e,t){let n=(0,L.useContext)(ro);if(n===null)throw new Error(Wi);return Fi(n,e,t)}function pe(){let e=(0,L.useContext)(ro);if(e===null)throw new Error(Wi);return(0,L.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Qr={display:"none"},vm={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Zi="react-flow__node-desc",Yi="react-flow__edge-desc",ym="react-flow__aria-live",bm=e=>e.ariaLiveMessage,wm=e=>e.ariaLabelConfig;function jm({rfId:e}){let t=de(bm);return(0,I.jsx)("div",{id:`${ym}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vm,children:t})}function Nm({rfId:e,disableKeyboardA11y:t}){let n=de(wm);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{id:`${Zi}-${e}`,style:Qr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,I.jsx)("div",{id:`${Yi}-${e}`,style:Qr,children:n["edge.a11yDescription.default"]}),!t&&(0,I.jsx)(jm,{rfId:e})]})}var so=(0,L.forwardRef)(({position:e="top-left",children:t,className:n,style:o,...r},s)=>{let i=`${e}`.split("-");return(0,I.jsx)("div",{className:ve(["react-flow__panel",n,...i]),style:o,ref:s,...r,children:t})});so.displayName="Panel";var es="https://reactflow.dev?utm_source=attribution";function km({proOptions:e,position:t="bottom-right"}){return(0,L.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,I.jsx)(so,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${es}`,children:(0,I.jsx)("a",{href:es,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var Sm=e=>{let t=[],n=[];for(let[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(let[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},An=e=>e.id;function Cm(e,t){return fe(e.selectedNodes.map(An),t.selectedNodes.map(An))&&fe(e.selectedEdges.map(An),t.selectedEdges.map(An))}function $m({onSelectionChange:e}){let t=pe(),{selectedNodes:n,selectedEdges:o}=de(Sm,Cm);return(0,L.useEffect)(()=>{let r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,o,e]),null}var Em=e=>!!e.onSelectionChangeHandlers;function Mm({onSelectionChange:e}){let t=de(Em);return e||t?(0,I.jsx)($m,{onSelectionChange:e}):null}var Xi=[0,0],zm={x:0,y:0,zoom:1},_m=["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"],ts=[..._m,"rfId"],Pm=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}),ns={translateExtent:Jt,nodeOrigin:Xi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Am(e){let{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:h}=de(Pm,fe),u=pe();(0,L.useEffect)(()=>(h(e.defaultNodes,e.defaultEdges),()=>{c.current=ns,l()}),[]);let c=(0,L.useRef)(ns);return(0,L.useEffect)(()=>{for(let p of ts){let d=e[p],m=c.current[p];d!==m&&(typeof e[p]>"u"||(p==="nodes"?t(d):p==="edges"?n(d):p==="minZoom"?o(d):p==="maxZoom"?r(d):p==="translateExtent"?s(d):p==="nodeExtent"?i(d):p==="ariaLabelConfig"?u.setState({ariaLabelConfig:yp(d)}):p==="fitView"?u.setState({fitViewQueued:d}):p==="fitViewOptions"?u.setState({fitViewOptions:d}):u.setState({[p]:d})))}c.current=e},ts.map(p=>e[p])),null}function os(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Im(e){let[t,n]=(0,L.useState)(e==="system"?null:e);return(0,L.useEffect)(()=>{if(e!=="system"){n(e);return}let o=os(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:os()?.matches?"dark":"light"}var as=typeof document<"u"?document:null;function on(e=null,t={target:as,actInsideInputWithModifier:!0}){let[n,o]=(0,L.useState)(!1),r=(0,L.useRef)(!1),s=(0,L.useRef)(new Set([])),[i,l]=(0,L.useMemo)(()=>{if(e!==null){let h=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace(/\+/g,`
|
|
2
|
+
import{d as jd,e as Nd}from"./chunk-shared.8940b7334ec79bcd25cb8e2d41958eecfe71d31340cf8de3c3d99f813cd126af.js";import{p9$A as Pa,p9$B as yo,p9$C as Aa,p9$D as Q0,p9$E as Ia,p9$F as Da,p9$G as Ra,p9$H as Oa,p9$I as rt,p9$J as bo,p9$a as La,p9$b as Ta,p9$c as Ba,p9$d as Va,p9$e as ex,p9$f as tx,p9$g as nx,p9$h as ox,p9$i as ax,p9$j as Ha,p9$k as Fa,p9$l as wo,p9$m as Wa,p9$n as Za,p9$o as Ya,p9$p as Xa,p9$q as jo,p9$r as No,p9$s as qa,p9$t as Ka,p9$u as ko,p9$v as Ua,p9$w as Ga,p9$x as Qe,p9$y as Ja,p9$z as Qa}from"./chunk-core.6128decfe528d89de1445dc1ec36e9f13dabd76eba61d13310fc1302db2252eb.js";import{p13$a as So,p13$b as ix}from"./chunk-core.6128decfe528d89de1445dc1ec36e9f13dabd76eba61d13310fc1302db2252eb.js";import{p3$$ as cx,p3$$a as ux,p3$$b as hx,p3$A as px,p3$Aa as er,p3$Ab as mx,p3$B as fx,p3$Ba as gx,p3$Bb as xx,p3$C as vx,p3$Ca as yx,p3$Cb as bx,p3$D as wx,p3$Da as jx,p3$Db as tr,p3$E as Nx,p3$Ea as kx,p3$Eb as Sx,p3$F as Cx,p3$Fa as $x,p3$Fb as Ex,p3$G as Mx,p3$Ga as zx,p3$Gb as _x,p3$H as Px,p3$Ha as Ax,p3$Hb as nr,p3$I as Ix,p3$Ia as Dx,p3$Ib as or,p3$J as Co,p3$Ja as Rx,p3$Jb as ar,p3$K as Ox,p3$Ka as Lx,p3$Kb as rr,p3$L as Tx,p3$La as Bx,p3$Lb as Vx,p3$M as Hx,p3$Ma as Fx,p3$Mb as Wx,p3$N as Zx,p3$Na as sr,p3$Nb as Yx,p3$O as Xx,p3$Oa as qx,p3$Ob as Kx,p3$P as Ux,p3$Pa as ir,p3$Pb as Gx,p3$Q as Jx,p3$Qa as Qx,p3$Qb as ev,p3$R as tv,p3$Ra as nv,p3$Rb as ov,p3$S as av,p3$Sa as rv,p3$Sb as sv,p3$T as iv,p3$Ta as lv,p3$Tb as dv,p3$U as cv,p3$Ua as uv,p3$Ub as hv,p3$V as pv,p3$Va as mv,p3$Vb as $o,p3$W as fv,p3$Wa as gv,p3$Wb as xv,p3$X as xn,p3$Xa as vv,p3$Xb as lr,p3$Y as yv,p3$Ya as bv,p3$Yb as wv,p3$Z as jv,p3$Za as Nv,p3$Zb as kv,p3$_ as Sv,p3$_a as Cv,p3$_b as $v,p3$a as xe,p3$aa as Ev,p3$ab as Mv,p3$ac as zv,p3$b as _v,p3$ba as dr,p3$bb as cr,p3$bc as Pv,p3$c as Av,p3$ca as vn,p3$cb as he,p3$cc as Iv,p3$d as Dv,p3$da as Rv,p3$db as ur,p3$dc as Ov,p3$e as te,p3$ea as Lv,p3$eb as Tt,p3$ec as Tv,p3$f as Eo,p3$fa as Bv,p3$fb as Mo,p3$fc as Vv,p3$g as Hv,p3$ga as Fv,p3$gb as Wv,p3$gc as Zv,p3$h as Yv,p3$ha as Xv,p3$hb as bt,p3$hc as qv,p3$i as Kv,p3$ia as Uv,p3$ib as Gv,p3$ic as Jv,p3$j as yn,p3$ja as Qv,p3$jb as bn,p3$jc as ey,p3$k as wn,p3$ka as ty,p3$kb as ny,p3$kc as oy,p3$l as ay,p3$la as ry,p3$lb as jn,p3$lc as sy,p3$m as Nn,p3$ma as Bt,p3$mb as iy,p3$mc as ly,p3$n as ne,p3$na as hr,p3$nb as dy,p3$nc as cy,p3$o as ye,p3$oa as wt,p3$ob as uy,p3$p as hy,p3$pa as py,p3$pb as kn,p3$q as my,p3$qa as fy,p3$qb as gy,p3$r as xy,p3$ra as vy,p3$rb as Sn,p3$s as yy,p3$sa as pr,p3$sb as by,p3$t as wy,p3$ta as jy,p3$tb as Ny,p3$u as ky,p3$ua as Sy,p3$ub as mr,p3$v as Cy,p3$va as $y,p3$vb as fr,p3$w as Ey,p3$wa as My,p3$wb as zo,p3$x as zy,p3$xa as _y,p3$xb as gr,p3$y as Py,p3$ya as Ay,p3$yb as Iy,p3$z as jt,p3$za as Dy,p3$zb as xr}from"./chunk-core.6128decfe528d89de1445dc1ec36e9f13dabd76eba61d13310fc1302db2252eb.js";import{p4$a as Vt,p4$b as et,p4$c as Nt,p4$d as vr,p4$e as _o}from"./chunk-core.6128decfe528d89de1445dc1ec36e9f13dabd76eba61d13310fc1302db2252eb.js";var kd=Vt(e=>{"use strict";var t=Nt();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var o=typeof Object.is=="function"?Object.is:n,r=t.useState,s=t.useEffect,i=t.useLayoutEffect,l=t.useDebugValue;function h(d,m){var f=m(),w=r({inst:{value:f,getSnapshot:m}}),y=w[0].inst,x=w[1];return i(function(){y.value=f,y.getSnapshot=m,u(y)&&x({inst:y})},[d,f,m]),s(function(){return u(y)&&x({inst:y}),d(function(){u(y)&&x({inst:y})})},[d]),l(f),f}function u(d){var m=d.getSnapshot;d=d.value;try{var f=m();return!o(d,f)}catch{return!0}}function c(d,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:h;e.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p}),Sd=Vt((e,t)=>{"use strict";t.exports=kd()}),Cd=Vt(e=>{"use strict";var t=Nt(),n=Sd();function o(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var r=typeof Object.is=="function"?Object.is:o,s=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,h=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(c,p,d,m,f){var w=i(null);if(w.current===null){var y={hasValue:!1,value:null};w.current=y}else y=w.current;w=h(function(){function E(M){if(!v){if(v=!0,b=M,M=m(M),f!==void 0&&y.hasValue){var C=y.value;if(f(C,M))return j=C}return j=M}if(C=j,r(b,M))return C;var _=m(M);return f!==void 0&&f(C,_)?(b=M,C):(b=M,j=_)}var v=!1,b,j,S=d===void 0?null:d;return[function(){return E(p())},S===null?void 0:function(){return E(S())}]},[p,d,m,f]);var x=s(c,w[0],w[1]);return l(function(){y.hasValue=!0,y.value=x},[x]),u(x),x}}),$d=Vt((e,t)=>{"use strict";t.exports=Cd()}),I=et(_o()),L=et(Nt());function ve(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=ve(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Ed={value:()=>{}};function As(){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 Dn(n)}function Dn(e){this._=e}function Md(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}})}Dn.prototype=As.prototype={constructor:Dn,on:function(e,t){var n=this._,o=Md(e+"",n),r,s=-1,i=o.length;if(arguments.length<2){for(;++s<i;)if((r=(e=o[s]).type)&&(r=zd(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<i;)if(r=(e=o[s]).type)n[r]=yr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=yr(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 Dn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,s;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],o=0,r=s.length;o<r;++o)s[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,s=o.length;r<s;++r)o[r].value.apply(t,n)}};function zd(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function yr(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=Ed,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var na=As,Ho="http://www.w3.org/1999/xhtml",br={svg:"http://www.w3.org/2000/svg",xhtml:Ho,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),br.hasOwnProperty(t)?{space:br[t],local:e}:e}function _d(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ho&&t.documentElement.namespaceURI===Ho?t.createElement(e):t.createElementNS(n,e)}}function Pd(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Is(e){var t=Jn(e);return(t.local?Pd:_d)(t)}function Ad(){}function oa(e){return e==null?Ad:function(){return this.querySelector(e)}}function Id(e){typeof e!="function"&&(e=oa(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var s=t[r],i=s.length,l=o[r]=new Array(i),h,u,c=0;c<i;++c)(h=s[c])&&(u=e.call(h,h.__data__,c,s))&&("__data__"in h&&(u.__data__=h.__data__),l[c]=u);return new $e(o,this._parents)}function Dd(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Rd(){return[]}function Ds(e){return e==null?Rd:function(){return this.querySelectorAll(e)}}function Od(e){return function(){return Dd(e.apply(this,arguments))}}function Ld(e){typeof e=="function"?e=Od(e):e=Ds(e);for(var t=this._groups,n=t.length,o=[],r=[],s=0;s<n;++s)for(var i=t[s],l=i.length,h,u=0;u<l;++u)(h=i[u])&&(o.push(e.call(h,h.__data__,u,i)),r.push(h));return new $e(o,r)}function Rs(e){return function(){return this.matches(e)}}function Os(e){return function(t){return t.matches(e)}}var Td=Array.prototype.find;function Bd(e){return function(){return Td.call(this.children,e)}}function Vd(){return this.firstElementChild}function Hd(e){return this.select(e==null?Vd:Bd(typeof e=="function"?e:Os(e)))}var Fd=Array.prototype.filter;function Wd(){return Array.from(this.children)}function Zd(e){return function(){return Fd.call(this.children,e)}}function Yd(e){return this.selectAll(e==null?Wd:Zd(typeof e=="function"?e:Os(e)))}function Xd(e){typeof e!="function"&&(e=Rs(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var s=t[r],i=s.length,l=o[r]=[],h,u=0;u<i;++u)(h=s[u])&&e.call(h,h.__data__,u,s)&&l.push(h);return new $e(o,this._parents)}function Ls(e){return new Array(e.length)}function qd(){return new $e(this._enter||this._groups.map(Ls),this._parents)}function Bn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bn.prototype={constructor:Bn,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 Kd(e){return function(){return e}}function Ud(e,t,n,o,r,s){for(var i=0,l,h=t.length,u=s.length;i<u;++i)(l=t[i])?(l.__data__=s[i],o[i]=l):n[i]=new Bn(e,s[i]);for(;i<h;++i)(l=t[i])&&(r[i]=l)}function Gd(e,t,n,o,r,s,i){var l,h,u=new Map,c=t.length,p=s.length,d=new Array(c),m;for(l=0;l<c;++l)(h=t[l])&&(d[l]=m=i.call(h,h.__data__,l,t)+"",u.has(m)?r[l]=h:u.set(m,h));for(l=0;l<p;++l)m=i.call(e,s[l],l,s)+"",(h=u.get(m))?(o[l]=h,h.__data__=s[l],u.delete(m)):n[l]=new Bn(e,s[l]);for(l=0;l<c;++l)(h=t[l])&&u.get(d[l])===h&&(r[l]=h)}function Jd(e){return e.__data__}function Qd(e,t){if(!arguments.length)return Array.from(this,Jd);var n=t?Gd:Ud,o=this._parents,r=this._groups;typeof e!="function"&&(e=Kd(e));for(var s=r.length,i=new Array(s),l=new Array(s),h=new Array(s),u=0;u<s;++u){var c=o[u],p=r[u],d=p.length,m=ec(e.call(c,c&&c.__data__,u,o)),f=m.length,w=l[u]=new Array(f),y=i[u]=new Array(f),x=h[u]=new Array(d);n(c,p,w,y,x,m,t);for(var E=0,v=0,b,j;E<f;++E)if(b=w[E]){for(E>=v&&(v=E+1);!(j=y[v])&&++v<f;);b._next=j||null}}return i=new $e(i,o),i._enter=l,i._exit=h,i}function ec(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function tc(){return new $e(this._exit||this._groups.map(Ls),this._parents)}function nc(e,t,n){var o=this.enter(),r=this,s=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?s.remove():n(s),o&&r?o.merge(r).order():r}function oc(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,s=o.length,i=Math.min(r,s),l=new Array(r),h=0;h<i;++h)for(var u=n[h],c=o[h],p=u.length,d=l[h]=new Array(p),m,f=0;f<p;++f)(m=u[f]||c[f])&&(d[f]=m);for(;h<r;++h)l[h]=n[h];return new $e(l,this._parents)}function ac(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,s=o[r],i;--r>=0;)(i=o[r])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function rc(e){e||(e=sc);function t(p,d){return p&&d?e(p.__data__,d.__data__):!p-!d}for(var n=this._groups,o=n.length,r=new Array(o),s=0;s<o;++s){for(var i=n[s],l=i.length,h=r[s]=new Array(l),u,c=0;c<l;++c)(u=i[c])&&(h[c]=u);h.sort(t)}return new $e(r,this._parents).order()}function sc(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ic(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function lc(){return Array.from(this)}function dc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,s=o.length;r<s;++r){var i=o[r];if(i)return i}return null}function cc(){let e=0;for(let t of this)++e;return e}function uc(){return!this.node()}function hc(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],s=0,i=r.length,l;s<i;++s)(l=r[s])&&e.call(l,l.__data__,s,r);return this}function pc(e){return function(){this.removeAttribute(e)}}function mc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fc(e,t){return function(){this.setAttribute(e,t)}}function gc(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xc(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function vc(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 yc(e,t){var n=Jn(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?mc:pc:typeof t=="function"?n.local?vc:xc:n.local?gc:fc)(n,t))}function Ts(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bc(e){return function(){this.style.removeProperty(e)}}function wc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function jc(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Nc(e,t,n){return arguments.length>1?this.each((t==null?bc:typeof t=="function"?jc:wc)(e,t,n??"")):Et(this.node(),e)}function Et(e,t){return e.style.getPropertyValue(t)||Ts(e).getComputedStyle(e,null).getPropertyValue(t)}function kc(e){return function(){delete this[e]}}function Sc(e,t){return function(){this[e]=t}}function Cc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function $c(e,t){return arguments.length>1?this.each((t==null?kc:typeof t=="function"?Cc:Sc)(e,t)):this.node()[e]}function Bs(e){return e.trim().split(/^|\s+/)}function aa(e){return e.classList||new Vs(e)}function Vs(e){this._node=e,this._names=Bs(e.getAttribute("class")||"")}Vs.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 Hs(e,t){for(var n=aa(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Fs(e,t){for(var n=aa(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Ec(e){return function(){Hs(this,e)}}function Mc(e){return function(){Fs(this,e)}}function zc(e,t){return function(){(t.apply(this,arguments)?Hs:Fs)(this,e)}}function _c(e,t){var n=Bs(e+"");if(arguments.length<2){for(var o=aa(this.node()),r=-1,s=n.length;++r<s;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?zc:t?Ec:Mc)(n,t))}function Pc(){this.textContent=""}function Ac(e){return function(){this.textContent=e}}function Ic(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Dc(e){return arguments.length?this.each(e==null?Pc:(typeof e=="function"?Ic:Ac)(e)):this.node().textContent}function Rc(){this.innerHTML=""}function Oc(e){return function(){this.innerHTML=e}}function Lc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Tc(e){return arguments.length?this.each(e==null?Rc:(typeof e=="function"?Lc:Oc)(e)):this.node().innerHTML}function Bc(){this.nextSibling&&this.parentNode.appendChild(this)}function Vc(){return this.each(Bc)}function Hc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fc(){return this.each(Hc)}function Wc(e){var t=typeof e=="function"?e:Is(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Zc(){return null}function Yc(e,t){var n=typeof e=="function"?e:Is(e),o=t==null?Zc:typeof t=="function"?t:oa(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Xc(){var e=this.parentNode;e&&e.removeChild(this)}function qc(){return this.each(Xc)}function Kc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Uc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gc(e){return this.select(e?Uc:Kc)}function Jc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Qc(e){return function(t){e.call(this,t,this.__data__)}}function eu(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 tu(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,s;n<r;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++o]=s;++o?t.length=o:delete this.__on}}}function nu(e,t,n){return function(){var o=this.__on,r,s=Qc(t);if(o){for(var i=0,l=o.length;i<l;++i)if((r=o[i]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=t;return}}this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},o?o.push(r):this.__on=[r]}}function ou(e,t,n){var o=eu(e+""),r,s=o.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var h=0,u=l.length,c;h<u;++h)for(r=0,c=l[h];r<s;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value}return}for(l=t?nu:tu,r=0;r<s;++r)this.each(l(o[r],t,n));return this}function Ws(e,t,n){var o=Ts(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 au(e,t){return function(){return Ws(this,e,t)}}function ru(e,t){return function(){return Ws(this,e,t.apply(this,arguments))}}function su(e,t){return this.each((typeof t=="function"?ru:au)(e,t))}function*iu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,s=o.length,i;r<s;++r)(i=o[r])&&(yield i)}var Zs=[null];function $e(e,t){this._groups=e,this._parents=t}function Ys(){return new $e([[document.documentElement]],Zs)}function lu(){return this}$e.prototype=Ys.prototype={constructor:$e,select:Id,selectAll:Ld,selectChild:Hd,selectChildren:Yd,filter:Xd,data:Qd,enter:qd,exit:tc,join:nc,merge:oc,selection:lu,order:ac,sort:rc,call:ic,nodes:lc,node:dc,size:cc,empty:uc,each:hc,attr:yc,style:Nc,property:$c,classed:_c,text:Dc,html:Tc,raise:Vc,lower:Fc,append:Wc,insert:Yc,remove:qc,clone:Gc,datum:Jc,on:ou,dispatch:su,[Symbol.iterator]:iu};var rn=Ys;function Ce(e){return typeof e=="string"?new $e([[document.querySelector(e)]],[document.documentElement]):new $e([[e]],Zs)}function du(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ie(e,t){if(e=du(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]}var cu={passive:!1},qt={capture:!0,passive:!1};function Po(e){e.stopImmediatePropagation()}function Ct(e){e.preventDefault(),e.stopImmediatePropagation()}function Xs(e){var t=e.document.documentElement,n=Ce(e).on("dragstart.drag",Ct,qt);"onselectstart"in t?n.on("selectstart.drag",Ct,qt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function qs(e,t){var n=e.document.documentElement,o=Ce(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ct,qt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Cn=e=>()=>e;function Fo(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:s,x:i,y:l,dx:h,dy:u,dispatch:c}){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:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Fo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uu(e){return!e.ctrlKey&&!e.button}function hu(){return this.parentNode}function pu(e,t){return t??{x:e.x,y:e.y}}function mu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ks(){var e=uu,t=hu,n=pu,o=mu,r={},s=na("start","drag","end"),i=0,l,h,u,c,p=0;function d(b){b.on("mousedown.drag",m).filter(o).on("touchstart.drag",y).on("touchmove.drag",x,cu).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(b,j){if(!(c||!e.call(this,b,j))){var S=v(this,t.call(this,b,j),b,j,"mouse");S&&(Ce(b.view).on("mousemove.drag",f,qt).on("mouseup.drag",w,qt),Xs(b.view),Po(b),u=!1,l=b.clientX,h=b.clientY,S("start",b))}}function f(b){if(Ct(b),!u){var j=b.clientX-l,S=b.clientY-h;u=j*j+S*S>p}r.mouse("drag",b)}function w(b){Ce(b.view).on("mousemove.drag mouseup.drag",null),qs(b.view,u),Ct(b),r.mouse("end",b)}function y(b,j){if(e.call(this,b,j)){var S=b.changedTouches,M=t.call(this,b,j),C=S.length,_,F;for(_=0;_<C;++_)(F=v(this,M,b,j,S[_].identifier,S[_]))&&(Po(b),F("start",b,S[_]))}}function x(b){var j=b.changedTouches,S=j.length,M,C;for(M=0;M<S;++M)(C=r[j[M].identifier])&&(Ct(b),C("drag",b,j[M]))}function E(b){var j=b.changedTouches,S=j.length,M,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),M=0;M<S;++M)(C=r[j[M].identifier])&&(Po(b),C("end",b,j[M]))}function v(b,j,S,M,C,_){var F=s.copy(),O=Ie(_||S,j),R,H,g;if((g=n.call(b,new Fo("beforestart",{sourceEvent:S,target:d,identifier:C,active:i,x:O[0],y:O[1],dx:0,dy:0,dispatch:F}),M))!=null)return R=g.x-O[0]||0,H=g.y-O[1]||0,function N(k,z,A){var $=O,B;switch(k){case"start":r[C]=N,B=i++;break;case"end":delete r[C],--i;case"drag":O=Ie(A||z,j),B=i;break}F.call(k,b,new Fo(k,{sourceEvent:z,subject:g,target:d,identifier:C,active:B,x:O[0]+R,y:O[1]+H,dx:O[0]-$[0],dy:O[1]-$[1],dispatch:F}),M)}}return d.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Cn(!!b),d):e},d.container=function(b){return arguments.length?(t=typeof b=="function"?b:Cn(b),d):t},d.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Cn(b),d):n},d.touchable=function(b){return arguments.length?(o=typeof b=="function"?b:Cn(!!b),d):o},d.on=function(){var b=s.on.apply(s,arguments);return b===s?d:b},d.clickDistance=function(b){return arguments.length?(p=(b=+b)*b,d):Math.sqrt(p)},d}function ra(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Us(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function sn(){}var Kt=.7,Vn=1/Kt,$t="\\s*([+-]?\\d+)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fu=/^#([0-9a-f]{3,8})$/,gu=new RegExp(`^rgb\\(${$t},${$t},${$t}\\)$`),xu=new RegExp(`^rgb\\(${Fe},${Fe},${Fe}\\)$`),vu=new RegExp(`^rgba\\(${$t},${$t},${$t},${Ut}\\)$`),yu=new RegExp(`^rgba\\(${Fe},${Fe},${Fe},${Ut}\\)$`),bu=new RegExp(`^hsl\\(${Ut},${Fe},${Fe}\\)$`),wu=new RegExp(`^hsla\\(${Ut},${Fe},${Fe},${Ut}\\)$`),wr={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};ra(sn,ct,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jr,formatHex:jr,formatHex8:ju,formatHsl:Nu,formatRgb:Nr,toString:Nr});function jr(){return this.rgb().formatHex()}function ju(){return this.rgb().formatHex8()}function Nu(){return Gs(this).formatHsl()}function Nr(){return this.rgb().formatRgb()}function ct(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fu.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kr(t):n===3?new ke(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$n(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$n(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=gu.exec(e))?new ke(t[1],t[2],t[3],1):(t=xu.exec(e))?new ke(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=vu.exec(e))?$n(t[1],t[2],t[3],t[4]):(t=yu.exec(e))?$n(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bu.exec(e))?$r(t[1],t[2]/100,t[3]/100,1):(t=wu.exec(e))?$r(t[1],t[2]/100,t[3]/100,t[4]):wr.hasOwnProperty(e)?kr(wr[e]):e==="transparent"?new ke(NaN,NaN,NaN,0):null}function kr(e){return new ke(e>>16&255,e>>8&255,e&255,1)}function $n(e,t,n,o){return o<=0&&(e=t=n=NaN),new ke(e,t,n,o)}function ku(e){return e instanceof sn||(e=ct(e)),e?(e=e.rgb(),new ke(e.r,e.g,e.b,e.opacity)):new ke}function Hn(e,t,n,o){return arguments.length===1?ku(e):new ke(e,t,n,o??1)}function ke(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}ra(ke,Hn,Us(sn,{brighter(e){return e=e==null?Vn:Math.pow(Vn,e),new ke(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Kt:Math.pow(Kt,e),new ke(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ke(lt(this.r),lt(this.g),lt(this.b),Fn(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:Sr,formatHex:Sr,formatHex8:Su,formatRgb:Cr,toString:Cr}));function Sr(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function Su(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cr(){let e=Fn(this.opacity);return`${e===1?"rgb(":"rgba("}${lt(this.r)}, ${lt(this.g)}, ${lt(this.b)}${e===1?")":`, ${e})`}`}function Fn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function lt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function it(e){return e=lt(e),(e<16?"0":"")+e.toString(16)}function $r(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new De(e,t,n,o)}function Gs(e){if(e instanceof De)return new De(e.h,e.s,e.l,e.opacity);if(e instanceof sn||(e=ct(e)),!e)return new De;if(e instanceof De)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),s=Math.max(t,n,o),i=NaN,l=s-r,h=(s+r)/2;return l?(t===s?i=(n-o)/l+(n<o)*6:n===s?i=(o-t)/l+2:i=(t-n)/l+4,l/=h<.5?s+r:2-s-r,i*=60):l=h>0&&h<1?0:i,new De(i,l,h,e.opacity)}function Cu(e,t,n,o){return arguments.length===1?Gs(e):new De(e,t,n,o??1)}function De(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}ra(De,Cu,Us(sn,{brighter(e){return e=e==null?Vn:Math.pow(Vn,e),new De(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Kt:Math.pow(Kt,e),new De(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 ke(Ao(e>=240?e-240:e+120,r,o),Ao(e,r,o),Ao(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new De(Er(this.h),En(this.s),En(this.l),Fn(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(){let e=Fn(this.opacity);return`${e===1?"hsl(":"hsla("}${Er(this.h)}, ${En(this.s)*100}%, ${En(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Er(e){return e=(e||0)%360,e<0?e+360:e}function En(e){return Math.max(0,Math.min(1,e||0))}function Ao(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function Js(e,t,n,o,r){var s=e*e,i=s*e;return((1-3*e+3*s-i)*t+(4-6*s+3*i)*n+(1+3*e+3*s-3*i)*o+i*r)/6}function $u(e){var t=e.length-1;return function(n){var o=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[o],s=e[o+1],i=o>0?e[o-1]:2*r-s,l=o<t-1?e[o+2]:2*s-r;return Js((n-o/t)*t,i,r,s,l)}}function Eu(e){var t=e.length;return function(n){var o=Math.floor(((n%=1)<0?++n:n)*t),r=e[(o+t-1)%t],s=e[o%t],i=e[(o+1)%t],l=e[(o+2)%t];return Js((n-o/t)*t,r,s,i,l)}}var sa=e=>()=>e;function Mu(e,t){return function(n){return e+n*t}}function zu(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 _u(e){return(e=+e)==1?Qs:function(t,n){return n-t?zu(t,n,e):sa(isNaN(t)?n:t)}}function Qs(e,t){var n=t-e;return n?Mu(e,n):sa(isNaN(e)?t:e)}var Wn=(function e(t){var n=_u(t);function o(r,s){var i=n((r=Hn(r)).r,(s=Hn(s)).r),l=n(r.g,s.g),h=n(r.b,s.b),u=Qs(r.opacity,s.opacity);return function(c){return r.r=i(c),r.g=l(c),r.b=h(c),r.opacity=u(c),r+""}}return o.gamma=e,o})(1);function ei(e){return function(t){var n=t.length,o=new Array(n),r=new Array(n),s=new Array(n),i,l;for(i=0;i<n;++i)l=Hn(t[i]),o[i]=l.r||0,r[i]=l.g||0,s[i]=l.b||0;return o=e(o),r=e(r),s=e(s),l.opacity=1,function(h){return l.r=o(h),l.g=r(h),l.b=s(h),l+""}}}var Fy=ei($u),Wy=ei(Eu);function Pu(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(s){for(r=0;r<n;++r)o[r]=e[r]*(1-s)+t[r]*s;return o}}function Au(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),s=new Array(n),i;for(i=0;i<o;++i)r[i]=Yt(e[i],t[i]);for(;i<n;++i)s[i]=t[i];return function(l){for(i=0;i<o;++i)s[i]=r[i](l);return s}}function Du(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function He(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ru(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]=Yt(e[r],t[r]):o[r]=t[r];return function(s){for(r in n)o[r]=n[r](s);return o}}var Wo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Io=new RegExp(Wo.source,"g");function Ou(e){return function(){return e}}function Lu(e){return function(t){return e(t)+""}}function ti(e,t){var n=Wo.lastIndex=Io.lastIndex=0,o,r,s,i=-1,l=[],h=[];for(e=e+"",t=t+"";(o=Wo.exec(e))&&(r=Io.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),l[i]?l[i]+=s:l[++i]=s),(o=o[0])===(r=r[0])?l[i]?l[i]+=r:l[++i]=r:(l[++i]=null,h.push({i,x:He(o,r)})),n=Io.lastIndex;return n<t.length&&(s=t.slice(n),l[i]?l[i]+=s:l[++i]=s),l.length<2?h[0]?Lu(h[0].x):Ou(t):(t=h.length,function(u){for(var c=0,p;c<t;++c)l[(p=h[c]).i]=p.x(u);return l.join("")})}function Yt(e,t){var n=typeof t,o;return t==null||n==="boolean"?sa(t):(n==="number"?He:n==="string"?(o=ct(t))?(t=o,Wn):ti:t instanceof ct?Wn:t instanceof Date?Du:Au(t)?Pu:Array.isArray(t)?Iu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ru:He)(e,t)}var Mr=180/Math.PI,Zo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ni(e,t,n,o,r,s){var i,l,h;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(h=e*n+t*o)&&(n-=e*h,o-=t*h),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,h/=l),e*o<t*n&&(e=-e,t=-t,h=-h,i=-i),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*Mr,skewX:Math.atan(h)*Mr,scaleX:i,scaleY:l}}var Mn;function Tu(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Zo:ni(t.a,t.b,t.c,t.d,t.e,t.f)}function Bu(e){return e==null?Zo:(Mn||(Mn=document.createElementNS("http://www.w3.org/2000/svg","g")),Mn.setAttribute("transform",e),(e=Mn.transform.baseVal.consolidate())?(e=e.matrix,ni(e.a,e.b,e.c,e.d,e.e,e.f)):Zo)}function oi(e,t,n,o){function r(u){return u.length?u.pop()+" ":""}function s(u,c,p,d,m,f){if(u!==p||c!==d){var w=m.push("translate(",null,t,null,n);f.push({i:w-4,x:He(u,p)},{i:w-2,x:He(c,d)})}else(p||d)&&m.push("translate("+p+t+d+n)}function i(u,c,p,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:p.push(r(p)+"rotate(",null,o)-2,x:He(u,c)})):c&&p.push(r(p)+"rotate("+c+o)}function l(u,c,p,d){u!==c?d.push({i:p.push(r(p)+"skewX(",null,o)-2,x:He(u,c)}):c&&p.push(r(p)+"skewX("+c+o)}function h(u,c,p,d,m,f){if(u!==p||c!==d){var w=m.push(r(m)+"scale(",null,",",null,")");f.push({i:w-4,x:He(u,p)},{i:w-2,x:He(c,d)})}else(p!==1||d!==1)&&m.push(r(m)+"scale("+p+","+d+")")}return function(u,c){var p=[],d=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,p,d),i(u.rotate,c.rotate,p,d),l(u.skewX,c.skewX,p,d),h(u.scaleX,u.scaleY,c.scaleX,c.scaleY,p,d),u=c=null,function(m){for(var f=-1,w=d.length,y;++f<w;)p[(y=d[f]).i]=y.x(m);return p.join("")}}}var Vu=oi(Tu,"px, ","px)","deg)"),Hu=oi(Bu,", ",")",")"),Fu=1e-12;function zr(e){return((e=Math.exp(e))+1/e)/2}function Wu(e){return((e=Math.exp(e))-1/e)/2}function Zu(e){return((e=Math.exp(2*e))-1)/(e+1)}var Rn=(function e(t,n,o){function r(s,i){var l=s[0],h=s[1],u=s[2],c=i[0],p=i[1],d=i[2],m=c-l,f=p-h,w=m*m+f*f,y,x;if(w<Fu)x=Math.log(d/u)/t,y=function(M){return[l+M*m,h+M*f,u*Math.exp(t*M*x)]};else{var E=Math.sqrt(w),v=(d*d-u*u+o*w)/(2*u*n*E),b=(d*d-u*u-o*w)/(2*d*n*E),j=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(b*b+1)-b);x=(S-j)/t,y=function(M){var C=M*x,_=zr(j),F=u/(n*E)*(_*Zu(t*C+j)-Wu(j));return[l+F*m,h+F*f,u*_/zr(t*C+j)]}}return y.duration=x*1e3*t/Math.SQRT2,y}return r.rho=function(s){var i=Math.max(.001,+s),l=i*i,h=l*l;return e(i,l,h)},r})(Math.SQRT2,2,4),Mt=0,Wt=0,Ht=0,ai=1e3,Zn,Zt,Yn=0,ut=0,Qn=0,Gt=typeof performance=="object"&&performance.now?performance:Date,ri=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ia(){return ut||(ri(Yu),ut=Gt.now()+Qn)}function Yu(){ut=0}function Xn(){this._call=this._time=this._next=null}Xn.prototype=si.prototype={constructor:Xn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ia():+n)+(t==null?0:+t),!this._next&&Zt!==this&&(Zt?Zt._next=this:Zn=this,Zt=this),this._call=e,this._time=n,Yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yo())}};function si(e,t,n){var o=new Xn;return o.restart(e,t,n),o}function Xu(){ia(),++Mt;for(var e=Zn,t;e;)(t=ut-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Mt}function _r(){ut=(Yn=Gt.now())+Qn,Mt=Wt=0;try{Xu()}finally{Mt=0,Ku(),ut=0}}function qu(){var e=Gt.now(),t=e-Yn;t>ai&&(Qn-=t,Yn=e)}function Ku(){for(var e,t=Zn,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:Zn=n);Zt=e,Yo(o)}function Yo(e){if(!Mt){Wt&&(Wt=clearTimeout(Wt));var t=e-ut;t>24?(e<1/0&&(Wt=setTimeout(_r,e-Gt.now()-Qn)),Ht&&(Ht=clearInterval(Ht))):(Ht||(Yn=Gt.now(),Ht=setInterval(qu,ai)),Mt=1,ri(_r))}}function Pr(e,t,n){var o=new Xn;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Uu=na("start","end","cancel","interrupt"),Gu=[],ii=0,Ar=1,Xo=2,On=3,Ir=4,qo=5,Ln=6;function eo(e,t,n,o,r,s){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;Ju(e,n,{name:t,index:o,group:r,on:Uu,tween:Gu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:ii})}function la(e,t){var n=Le(e,t);if(n.state>ii)throw new Error("too late; already scheduled");return n}function We(e,t){var n=Le(e,t);if(n.state>On)throw new Error("too late; already running");return n}function Le(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ju(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=si(s,0,n.time);function s(u){n.state=Ar,n.timer.restart(i,n.delay,n.time),n.delay<=u&&i(u-n.delay)}function i(u){var c,p,d,m;if(n.state!==Ar)return h();for(c in o)if(m=o[c],m.name===n.name){if(m.state===On)return Pr(i);m.state===Ir?(m.state=Ln,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete o[c]):+c<t&&(m.state=Ln,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete o[c])}if(Pr(function(){n.state===On&&(n.state=Ir,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Xo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xo){for(n.state=On,r=new Array(d=n.tween.length),c=0,p=-1;c<d;++c)(m=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=m);r.length=p+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(h),n.state=qo,1),p=-1,d=r.length;++p<d;)r[p].call(e,c);n.state===qo&&(n.on.call("end",e,e.__data__,n.index,n.group),h())}function h(){n.state=Ln,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Tn(e,t){var n=e.__transition,o,r,s=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((o=n[i]).name!==t){s=!1;continue}r=o.state>Xo&&o.state<qo,o.state=Ln,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[i]}s&&delete e.__transition}}function Qu(e){return this.each(function(){Tn(this,e)})}function eh(e,t){var n,o;return function(){var r=We(this,e),s=r.tween;if(s!==n){o=n=s;for(var i=0,l=o.length;i<l;++i)if(o[i].name===t){o=o.slice(),o.splice(i,1);break}}r.tween=o}}function th(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var s=We(this,e),i=s.tween;if(i!==o){r=(o=i).slice();for(var l={name:t,value:n},h=0,u=r.length;h<u;++h)if(r[h].name===t){r[h]=l;break}h===u&&r.push(l)}s.tween=r}}function nh(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Le(this.node(),n).tween,r=0,s=o.length,i;r<s;++r)if((i=o[r]).name===e)return i.value;return null}return this.each((t==null?eh:th)(n,e,t))}function da(e,t,n){var o=e._id;return e.each(function(){var r=We(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Le(r,o).value[t]}}function li(e,t){var n;return(typeof t=="number"?He:t instanceof ct?Wn:(n=ct(t))?(t=n,Wn):ti)(e,t)}function oh(e){return function(){this.removeAttribute(e)}}function ah(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rh(e,t,n){var o,r=n+"",s;return function(){var i=this.getAttribute(e);return i===r?null:i===o?s:s=t(o=i,n)}}function sh(e,t,n){var o,r=n+"",s;return function(){var i=this.getAttributeNS(e.space,e.local);return i===r?null:i===o?s:s=t(o=i,n)}}function ih(e,t,n){var o,r,s;return function(){var i,l=n(this),h;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),h=l+"",i===h?null:i===o&&h===r?s:(r=h,s=t(o=i,l)))}}function lh(e,t,n){var o,r,s;return function(){var i,l=n(this),h;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),h=l+"",i===h?null:i===o&&h===r?s:(r=h,s=t(o=i,l)))}}function dh(e,t){var n=Jn(e),o=n==="transform"?Hu:li;return this.attrTween(e,typeof t=="function"?(n.local?lh:ih)(n,o,da(this,"attr."+e,t)):t==null?(n.local?ah:oh)(n):(n.local?sh:rh)(n,o,t))}function ch(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function uh(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function hh(e,t){var n,o;function r(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&uh(e,s)),n}return r._value=t,r}function ph(e,t){var n,o;function r(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&ch(e,s)),n}return r._value=t,r}function mh(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=Jn(e);return this.tween(n,(o.local?hh:ph)(o,t))}function fh(e,t){return function(){la(this,e).delay=+t.apply(this,arguments)}}function gh(e,t){return t=+t,function(){la(this,e).delay=t}}function xh(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fh:gh)(t,e)):Le(this.node(),t).delay}function vh(e,t){return function(){We(this,e).duration=+t.apply(this,arguments)}}function yh(e,t){return t=+t,function(){We(this,e).duration=t}}function bh(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vh:yh)(t,e)):Le(this.node(),t).duration}function wh(e,t){if(typeof t!="function")throw new Error;return function(){We(this,e).ease=t}}function jh(e){var t=this._id;return arguments.length?this.each(wh(t,e)):Le(this.node(),t).ease}function Nh(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;We(this,e).ease=n}}function kh(e){if(typeof e!="function")throw new Error;return this.each(Nh(this._id,e))}function Sh(e){typeof e!="function"&&(e=Rs(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var s=t[r],i=s.length,l=o[r]=[],h,u=0;u<i;++u)(h=s[u])&&e.call(h,h.__data__,u,s)&&l.push(h);return new Ge(o,this._parents,this._name,this._id)}function Ch(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,s=Math.min(o,r),i=new Array(o),l=0;l<s;++l)for(var h=t[l],u=n[l],c=h.length,p=i[l]=new Array(c),d,m=0;m<c;++m)(d=h[m]||u[m])&&(p[m]=d);for(;l<o;++l)i[l]=t[l];return new Ge(i,this._parents,this._name,this._id)}function $h(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 Eh(e,t,n){var o,r,s=$h(t)?la:We;return function(){var i=s(this,e),l=i.on;l!==o&&(r=(o=l).copy()).on(t,n),i.on=r}}function Mh(e,t){var n=this._id;return arguments.length<2?Le(this.node(),n).on.on(e):this.each(Eh(n,e,t))}function zh(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _h(){return this.on("end.remove",zh(this._id))}function Ph(e){var t=this._name,n=this._id;typeof e!="function"&&(e=oa(e));for(var o=this._groups,r=o.length,s=new Array(r),i=0;i<r;++i)for(var l=o[i],h=l.length,u=s[i]=new Array(h),c,p,d=0;d<h;++d)(c=l[d])&&(p=e.call(c,c.__data__,d,l))&&("__data__"in c&&(p.__data__=c.__data__),u[d]=p,eo(u[d],t,n,d,u,Le(c,n)));return new Ge(s,this._parents,t,n)}function Ah(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ds(e));for(var o=this._groups,r=o.length,s=[],i=[],l=0;l<r;++l)for(var h=o[l],u=h.length,c,p=0;p<u;++p)if(c=h[p]){for(var d=e.call(c,c.__data__,p,h),m,f=Le(c,n),w=0,y=d.length;w<y;++w)(m=d[w])&&eo(m,t,n,w,d,f);s.push(d),i.push(c)}return new Ge(s,i,t,n)}var Ih=rn.prototype.constructor;function Dh(){return new Ih(this._groups,this._parents)}function Rh(e,t){var n,o,r;return function(){var s=Et(this,e),i=(this.style.removeProperty(e),Et(this,e));return s===i?null:s===n&&i===o?r:r=t(n=s,o=i)}}function di(e){return function(){this.style.removeProperty(e)}}function Oh(e,t,n){var o,r=n+"",s;return function(){var i=Et(this,e);return i===r?null:i===o?s:s=t(o=i,n)}}function Lh(e,t,n){var o,r,s;return function(){var i=Et(this,e),l=n(this),h=l+"";return l==null&&(h=l=(this.style.removeProperty(e),Et(this,e))),i===h?null:i===o&&h===r?s:(r=h,s=t(o=i,l))}}function Th(e,t){var n,o,r,s="style."+t,i="end."+s,l;return function(){var h=We(this,e),u=h.on,c=h.value[s]==null?l||(l=di(t)):void 0;(u!==n||r!==c)&&(o=(n=u).copy()).on(i,r=c),h.on=o}}function Bh(e,t,n){var o=(e+="")=="transform"?Vu:li;return t==null?this.styleTween(e,Rh(e,o)).on("end.style."+e,di(e)):typeof t=="function"?this.styleTween(e,Lh(e,o,da(this,"style."+e,t))).each(Th(this._id,e)):this.styleTween(e,Oh(e,o,t),n).on("end.style."+e,null)}function Vh(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Hh(e,t,n){var o,r;function s(){var i=t.apply(this,arguments);return i!==r&&(o=(r=i)&&Vh(e,i,n)),o}return s._value=t,s}function Fh(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,Hh(e,t,n??""))}function Wh(e){return function(){this.textContent=e}}function Zh(e){return function(){var t=e(this);this.textContent=t??""}}function Yh(e){return this.tween("text",typeof e=="function"?Zh(da(this,"text",e)):Wh(e==null?"":e+""))}function Xh(e){return function(t){this.textContent=e.call(this,t)}}function qh(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Xh(r)),t}return o._value=e,o}function Kh(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,qh(e))}function Uh(){for(var e=this._name,t=this._id,n=ci(),o=this._groups,r=o.length,s=0;s<r;++s)for(var i=o[s],l=i.length,h,u=0;u<l;++u)if(h=i[u]){var c=Le(h,t);eo(h,e,n,u,i,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ge(o,this._parents,e,n)}function Gh(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(s,i){var l={value:i},h={value:function(){--r===0&&s()}};n.each(function(){var u=We(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(h)),u.on=t}),r===0&&s()})}var Jh=0;function Ge(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Qh(e){return rn().transition(e)}function ci(){return++Jh}var Ze=rn.prototype;Ge.prototype=Qh.prototype={constructor:Ge,select:Ph,selectAll:Ah,selectChild:Ze.selectChild,selectChildren:Ze.selectChildren,filter:Sh,merge:Ch,selection:Dh,transition:Uh,call:Ze.call,nodes:Ze.nodes,node:Ze.node,size:Ze.size,empty:Ze.empty,each:Ze.each,on:Mh,attr:dh,attrTween:mh,style:Bh,styleTween:Fh,text:Yh,textTween:Kh,remove:_h,tween:nh,delay:xh,duration:bh,ease:jh,easeVarying:kh,end:Gh,[Symbol.iterator]:Ze[Symbol.iterator]};function ep(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tp={time:null,delay:0,duration:250,ease:ep};function np(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 op(e){var t,n;e instanceof Ge?(t=e._id,e=e._name):(t=ci(),(n=tp).time=ia(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,s=0;s<r;++s)for(var i=o[s],l=i.length,h,u=0;u<l;++u)(h=i[u])&&eo(h,e,t,u,i,n||np(h,t));return new Ge(o,this._parents,e,t)}rn.prototype.interrupt=Qu;rn.prototype.transition=op;var zn=e=>()=>e;function ap(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 qe(e,t,n){this.k=e,this.x=t,this.y=n}qe.prototype={constructor:qe,scale:function(e){return e===1?this:new qe(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qe(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 to=new qe(1,0,0);ui.prototype=qe.prototype;function ui(e){for(;!e.__zoom;)if(!(e=e.parentNode))return to;return e.__zoom}function Do(e){e.stopImmediatePropagation()}function Ft(e){e.preventDefault(),e.stopImmediatePropagation()}function rp(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function sp(){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 Dr(){return this.__zoom||to}function ip(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lp(){return navigator.maxTouchPoints||"ontouchstart"in this}function dp(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function hi(){var e=rp,t=sp,n=dp,o=ip,r=lp,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,h=Rn,u=na("start","zoom","end"),c,p,d,m=500,f=150,w=0,y=10;function x(g){g.property("__zoom",Dr).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",_).on("dblclick.zoom",F).filter(r).on("touchstart.zoom",O).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(g,N,k,z){var A=g.selection?g.selection():g;A.property("__zoom",Dr),g!==A?j(g,N,k,z):A.interrupt().each(function(){S(this,arguments).event(z).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},x.scaleBy=function(g,N,k,z){x.scaleTo(g,function(){var A=this.__zoom.k,$=typeof N=="function"?N.apply(this,arguments):N;return A*$},k,z)},x.scaleTo=function(g,N,k,z){x.transform(g,function(){var A=t.apply(this,arguments),$=this.__zoom,B=k==null?b(A):typeof k=="function"?k.apply(this,arguments):k,V=$.invert(B),W=typeof N=="function"?N.apply(this,arguments):N;return n(v(E($,W),B,V),A,i)},k,z)},x.translateBy=function(g,N,k,z){x.transform(g,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),i)},null,z)},x.translateTo=function(g,N,k,z,A){x.transform(g,function(){var $=t.apply(this,arguments),B=this.__zoom,V=z==null?b($):typeof z=="function"?z.apply(this,arguments):z;return n(to.translate(V[0],V[1]).scale(B.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof k=="function"?-k.apply(this,arguments):-k),$,i)},z,A)};function E(g,N){return N=Math.max(s[0],Math.min(s[1],N)),N===g.k?g:new qe(N,g.x,g.y)}function v(g,N,k){var z=N[0]-k[0]*g.k,A=N[1]-k[1]*g.k;return z===g.x&&A===g.y?g:new qe(g.k,z,A)}function b(g){return[(+g[0][0]+ +g[1][0])/2,(+g[0][1]+ +g[1][1])/2]}function j(g,N,k,z){g.on("start.zoom",function(){S(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(z).end()}).tween("zoom",function(){var A=this,$=arguments,B=S(A,$).event(z),V=t.apply(A,$),W=k==null?b(V):typeof k=="function"?k.apply(A,$):k,J=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),X=A.__zoom,Z=typeof N=="function"?N.apply(A,$):N,ee=h(X.invert(W).concat(J/X.k),Z.invert(W).concat(J/Z.k));return function(Q){if(Q===1)Q=Z;else{var T=ee(Q),K=J/T[2];Q=new qe(K,W[0]-T[0]*K,W[1]-T[1]*K)}B.zoom(null,Q)}})}function S(g,N,k){return!k&&g.__zooming||new M(g,N)}function M(g,N){this.that=g,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(g,N),this.taps=0}M.prototype={event:function(g){return g&&(this.sourceEvent=g),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(g,N){return this.mouse&&g!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&g!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&g!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(g){var N=Ce(this.that).datum();u.call(g,this.that,new ap(g,{sourceEvent:this.sourceEvent,target:x,type:g,transform:this.that.__zoom,dispatch:u}),N)}};function C(g,...N){if(!e.apply(this,arguments))return;var k=S(this,N).event(g),z=this.__zoom,A=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,o.apply(this,arguments)))),$=Ie(g);if(k.wheel)(k.mouse[0][0]!==$[0]||k.mouse[0][1]!==$[1])&&(k.mouse[1]=z.invert(k.mouse[0]=$)),clearTimeout(k.wheel);else{if(z.k===A)return;k.mouse=[$,z.invert($)],Tn(this),k.start()}Ft(g),k.wheel=setTimeout(B,f),k.zoom("mouse",n(v(E(z,A),k.mouse[0],k.mouse[1]),k.extent,i));function B(){k.wheel=null,k.end()}}function _(g,...N){if(d||!e.apply(this,arguments))return;var k=g.currentTarget,z=S(this,N,!0).event(g),A=Ce(g.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",J,!0),$=Ie(g,k),B=g.clientX,V=g.clientY;Xs(g.view),Do(g),z.mouse=[$,this.__zoom.invert($)],Tn(this),z.start();function W(X){if(Ft(X),!z.moved){var Z=X.clientX-B,ee=X.clientY-V;z.moved=Z*Z+ee*ee>w}z.event(X).zoom("mouse",n(v(z.that.__zoom,z.mouse[0]=Ie(X,k),z.mouse[1]),z.extent,i))}function J(X){A.on("mousemove.zoom mouseup.zoom",null),qs(X.view,z.moved),Ft(X),z.event(X).end()}}function F(g,...N){if(e.apply(this,arguments)){var k=this.__zoom,z=Ie(g.changedTouches?g.changedTouches[0]:g,this),A=k.invert(z),$=k.k*(g.shiftKey?.5:2),B=n(v(E(k,$),z,A),t.apply(this,N),i);Ft(g),l>0?Ce(this).transition().duration(l).call(j,B,z,g):Ce(this).call(x.transform,B,z,g)}}function O(g,...N){if(e.apply(this,arguments)){var k=g.touches,z=k.length,A=S(this,N,g.changedTouches.length===z).event(g),$,B,V,W;for(Do(g),B=0;B<z;++B)V=k[B],W=Ie(V,this),W=[W,this.__zoom.invert(W),V.identifier],A.touch0?!A.touch1&&A.touch0[2]!==W[2]&&(A.touch1=W,A.taps=0):(A.touch0=W,$=!0,A.taps=1+!!c);c&&(c=clearTimeout(c)),$&&(A.taps<2&&(p=W[0],c=setTimeout(function(){c=null},m)),Tn(this),A.start())}}function R(g,...N){if(this.__zooming){var k=S(this,N).event(g),z=g.changedTouches,A=z.length,$,B,V,W;for(Ft(g),$=0;$<A;++$)B=z[$],V=Ie(B,this),k.touch0&&k.touch0[2]===B.identifier?k.touch0[0]=V:k.touch1&&k.touch1[2]===B.identifier&&(k.touch1[0]=V);if(B=k.that.__zoom,k.touch1){var J=k.touch0[0],X=k.touch0[1],Z=k.touch1[0],ee=k.touch1[1],Q=(Q=Z[0]-J[0])*Q+(Q=Z[1]-J[1])*Q,T=(T=ee[0]-X[0])*T+(T=ee[1]-X[1])*T;B=E(B,Math.sqrt(Q/T)),V=[(J[0]+Z[0])/2,(J[1]+Z[1])/2],W=[(X[0]+ee[0])/2,(X[1]+ee[1])/2]}else if(k.touch0)V=k.touch0[0],W=k.touch0[1];else return;k.zoom("touch",n(v(B,V,W),k.extent,i))}}function H(g,...N){if(this.__zooming){var k=S(this,N).event(g),z=g.changedTouches,A=z.length,$,B;for(Do(g),d&&clearTimeout(d),d=setTimeout(function(){d=null},m),$=0;$<A;++$)B=z[$],k.touch0&&k.touch0[2]===B.identifier?delete k.touch0:k.touch1&&k.touch1[2]===B.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(B=Ie(B,this),Math.hypot(p[0]-B[0],p[1]-B[1])<y)){var V=Ce(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return x.wheelDelta=function(g){return arguments.length?(o=typeof g=="function"?g:zn(+g),x):o},x.filter=function(g){return arguments.length?(e=typeof g=="function"?g:zn(!!g),x):e},x.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:zn(!!g),x):r},x.extent=function(g){return arguments.length?(t=typeof g=="function"?g:zn([[+g[0][0],+g[0][1]],[+g[1][0],+g[1][1]]]),x):t},x.scaleExtent=function(g){return arguments.length?(s[0]=+g[0],s[1]=+g[1],x):[s[0],s[1]]},x.translateExtent=function(g){return arguments.length?(i[0][0]=+g[0][0],i[1][0]=+g[1][0],i[0][1]=+g[0][1],i[1][1]=+g[1][1],x):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},x.constrain=function(g){return arguments.length?(n=g,x):n},x.duration=function(g){return arguments.length?(l=+g,x):l},x.interpolate=function(g){return arguments.length?(h=g,x):h},x.on=function(){var g=u.on.apply(u,arguments);return g===u?x:g},x.clickDistance=function(g){return arguments.length?(w=(g=+g)*g,x):Math.sqrt(w)},x.tapDistance=function(g){return arguments.length?(y=+g,x):y},x}var _e={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.`},Jt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],pi=["Enter"," ","Escape"],mi={"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"},zt;(function(e){e.Strict="strict",e.Loose="loose"})(zt||(zt={}));var dt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(dt||(dt={}));var Qt;(function(e){e.Partial="partial",e.Full="full"})(Qt||(Qt={}));var fi={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},at;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(at||(at={}));var Xe;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Xe||(Xe={}));var U;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(U||(U={}));var Rr={[U.Left]:U.Right,[U.Right]:U.Left,[U.Top]:U.Bottom,[U.Bottom]:U.Top},gi=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,cp=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ca=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ln=(e,t=[0,0])=>{let{width:n,height:o}=Te(e),r=e.origin??t,s=n*r[0],i=o*r[1];return{x:e.position.x-s,y:e.position.y-i}},up=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,o=e.reduce((r,s)=>{let i=typeof s=="string",l=!t.nodeLookup&&!i?s:void 0;return t.nodeLookup&&(l=i?t.nodeLookup.get(s):ca(s)?s:t.nodeLookup.get(s.id)),l?(n=!0,no(r,qn(l,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?oo(o):{x:0,y:0,width:0,height:0}},dn=(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=no(n,qn(r)),o=!0)}),o?oo(n):{x:0,y:0,width:0,height:0}},ua=(e,t,[n,o,r]=[0,0,1],s=!1,i=!1)=>{let l=(t.x-n)/r,h=(t.y-o)/r,u=t.width/r,c=t.height/r,p=[];for(let d of e.values()){let{measured:m,selectable:f=!0,hidden:w=!1}=d;if(i&&!f||w)continue;let y=m.width??d.width??d.initialWidth??0,x=m.height??d.height??d.initialHeight??0,{x:E,y:v}=d.internals.positionAbsolute,b=bi(l,h,u,c,E,v,y,x),j=y*x,S=s&&b>0;(!d.internals.handleBounds||S||b>=j||d.dragging)&&p.push(d)}return p},hp=(e,t)=>{let n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function pp(e,t){let n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let s;if(t?.includeHiddenNodes){let{width:i,height:l}=Te(r);s=i>0&&l>0}else s=!!(r.measured.width&&r.measured.height&&!r.hidden);s&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function mp({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:s},i){if(e.size===0)return!0;let l=pp(e,i),h=dn(l),u=pa(h,t,n,i?.minZoom??r,i?.maxZoom??s,i?.padding??.1);return await o.setViewport(u,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),!0}function xi({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:s}){let i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:h,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=i.origin??o,p=i.extent||r;if(i.extent==="parent"&&!i.expandParent)if(!l)s?.("005",_e.error005());else{let{width:m,height:f}=Te(l);m&&f&&(p=[[h,u],[h+m,u+f]])}else l&&pt(i.extent)&&(p=[[i.extent[0][0]+h,i.extent[0][1]+u],[i.extent[1][0]+h,i.extent[1][1]+u]]);let d=pt(p)?ht(t,p,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&s?.("015",_e.error015()),{position:{x:d.x-h+(i.measured.width??0)*c[0],y:d.y-u+(i.measured.height??0)*c[1]},positionAbsolute:d}}async function fp({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){let s=new Set(e.map(p=>p.id)),i=[];for(let p of n){if(p.deletable===!1)continue;let d=s.has(p.id),m=!d&&p.parentId&&i.find(f=>f.id===p.parentId);(d||m)&&i.push(p)}let l=new Set(t.map(p=>p.id)),h=o.filter(p=>p.deletable!==!1),u=hp(i,h);for(let p of h)l.has(p.id)&&!u.find(d=>d.id===p.id)&&u.push(p);if(!r)return{edges:u,nodes:i};let c=await r({nodes:i,edges:u});return typeof c=="boolean"?c?{edges:u,nodes:i}:{edges:[],nodes:[]}:c}var _t=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ht=(e={x:0,y:0},t,n)=>({x:_t(e.x,t[0][0],t[1][0]-(n?.width??0)),y:_t(e.y,t[0][1],t[1][1]-(n?.height??0))});function vi(e,t,n){let{width:o,height:r}=Te(n),{x:s,y:i}=n.internals.positionAbsolute;return ht(e,[[s,i],[s+o,i+r]],t)}var Or=(e,t,n)=>e<t?_t(Math.abs(e-t),1,t)/t:e>n?-_t(Math.abs(e-n),1,t)/t:0,ha=(e,t,n=15,o=40)=>{let r=Or(e.x,o,t.width-o)*n,s=Or(e.y,o,t.height-o)*n;return[r,s]},no=(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)}),Ko=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),oo=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),en=(e,t=[0,0])=>{let{x:n,y:o}=ca(e)?e.internals.positionAbsolute:ln(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}},qn=(e,t=[0,0])=>{let{x:n,y:o}=ca(e)?e.internals.positionAbsolute:ln(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)}},yi=(e,t)=>oo(no(Ko(e),Ko(t))),bi=(e,t,n,o,r,s,i,l)=>{let h=Math.max(0,Math.min(e+n,r+i)-Math.max(e,r)),u=Math.max(0,Math.min(t+o,s+l)-Math.max(t,s));return Math.ceil(h*u)},Kn=(e,t)=>bi(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Lr=e=>Re(e.width)&&Re(e.height)&&Re(e.x)&&Re(e.y),Re=e=>!isNaN(e)&&isFinite(e),wi=(e,t)=>(n,o)=>{},cn=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),un=({x:e,y:t},[n,o,r],s=!1,i=[1,1])=>{let l={x:(e-n)/r,y:(t-o)/r};return s?cn(l,i):l},Pt=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function kt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let 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 gp(e,t,n){if(typeof e=="string"||typeof e=="number"){let o=kt(e,n),r=kt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){let o=kt(e.top??e.y??0,n),r=kt(e.bottom??e.y??0,n),s=kt(e.left??e.x??0,t),i=kt(e.right??e.x??0,t);return{top:o,right:i,bottom:r,left:s,x:s+i,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function xp(e,t,n,o,r,s){let{x:i,y:l}=Pt(e,[t,n,o]),{x:h,y:u}=Pt({x:e.x+e.width,y:e.y+e.height},[t,n,o]),c=r-h,p=s-u;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(p)}}var pa=(e,t,n,o,r,s)=>{let i=gp(s,t,n),l=(t-i.x)/e.width,h=(n-i.y)/e.height,u=Math.min(l,h),c=_t(u,o,r),p=e.x+e.width/2,d=e.y+e.height/2,m=t/2-p*c,f=n/2-d*c,w=xp(e,m,f,c,t,n),y={left:Math.min(w.left-i.left,0),top:Math.min(w.top-i.top,0),right:Math.min(w.right-i.right,0),bottom:Math.min(w.bottom-i.bottom,0)};return{x:m-y.left+y.right,y:f-y.top+y.bottom,zoom:c}},tn=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function pt(e){return e!=null&&e!=="parent"}function Te(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ji(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ni(e,t={width:0,height:0},n,o,r){let s={...e},i=o.get(n);if(i){let l=i.origin||r;s.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Tr(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function vp(){let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}function yp(e){return{...mi,...e||{}}}function ki(e){return e===null?null:e?"valid":"invalid"}function Xt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){let{x:s,y:i}=Oe(e),l=un({x:s-(r?.left??0),y:i-(r?.top??0)},o),{x:h,y:u}=n?cn(l,t):l;return{xSnapped:h,ySnapped:u,...l}}var ma=e=>({width:e.offsetWidth,height:e.offsetHeight}),Si=e=>e?.getRootNode?.()||window?.document,bp=["INPUT","SELECT","TEXTAREA"];function Ci(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:bp.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}var $i=e=>"clientX"in e,Oe=(e,t)=>{let n=$i(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)}},Br=(e,t,n,o,r)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(i=>{let l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:r,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...ma(i)}})};function Ei({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:s,targetControlX:i,targetControlY:l}){let h=e*.125+r*.375+i*.375+n*.125,u=t*.125+s*.375+l*.375+o*.125,c=Math.abs(h-e),p=Math.abs(u-t);return[h,u,c,p]}function _n(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Vr({pos:e,x1:t,y1:n,x2:o,y2:r,c:s}){switch(e){case U.Left:return[t-_n(t-o,s),n];case U.Right:return[t+_n(o-t,s),n];case U.Top:return[t,n-_n(n-r,s)];case U.Bottom:return[t,n+_n(r-n,s)]}}function Mi({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:o,targetY:r,targetPosition:s=U.Top,curvature:i=.25}){let[l,h]=Vr({pos:n,x1:e,y1:t,x2:o,y2:r,c:i}),[u,c]=Vr({pos:s,x1:o,y1:r,x2:e,y2:t,c:i}),[p,d,m,f]=Ei({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:l,sourceControlY:h,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${h} ${u},${c} ${o},${r}`,p,d,m,f]}function zi({sourceX:e,sourceY:t,targetX:n,targetY:o}){let r=Math.abs(n-e)/2,s=n<e?n+r:n-r,i=Math.abs(o-t)/2,l=o<t?o+i:o-i;return[s,l,r,i]}function wp({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:s="basic"}){if(s==="manual")return o;let i=r&&n?o+1e3:o,l=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return i+l}function jp({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){let s=no(qn(e),qn(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let i={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return Kn(i,oo(s))>0}var Np=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,kp=(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)),Sp=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",_e.error006()),t;let o=n.getEdgeId||Np,r;return gi(e)?r={...e}:r={...e,id:o(e)},kp(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function _i({sourceX:e,sourceY:t,targetX:n,targetY:o}){let[r,s,i,l]=zi({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,s,i,l]}var Hr={[U.Left]:{x:-1,y:0},[U.Right]:{x:1,y:0},[U.Top]:{x:0,y:-1},[U.Bottom]:{x:0,y:1}},Cp=({source:e,sourcePosition:t=U.Bottom,target:n})=>t===U.Left||t===U.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},Fr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function $p({source:e,sourcePosition:t=U.Bottom,target:n,targetPosition:o=U.Top,center:r,offset:s,stepPosition:i}){let l=Hr[t],h=Hr[o],u={x:e.x+l.x*s,y:e.y+l.y*s},c={x:n.x+h.x*s,y:n.y+h.y*s},p=Cp({source:u,sourcePosition:t,target:c}),d=p.x!==0?"x":"y",m=p[d],f=[],w,y,x={x:0,y:0},E={x:0,y:0},[,,v,b]=zi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*h[d]===-1){d==="x"?(w=r.x??u.x+(c.x-u.x)*i,y=r.y??(u.y+c.y)/2):(w=r.x??(u.x+c.x)/2,y=r.y??u.y+(c.y-u.y)*i);let M=[{x:w,y:u.y},{x:w,y:c.y}],C=[{x:u.x,y},{x:c.x,y}];l[d]===m?f=d==="x"?M:C:f=d==="x"?C:M}else{let M=[{x:u.x,y:c.y}],C=[{x:c.x,y:u.y}];if(d==="x"?f=l.x===m?C:M:f=l.y===m?M:C,t===o){let H=Math.abs(e[d]-n[d]);if(H<=s){let g=Math.min(s-1,s-H);l[d]===m?x[d]=(u[d]>e[d]?-1:1)*g:E[d]=(c[d]>n[d]?-1:1)*g}}if(t!==o){let H=d==="x"?"y":"x",g=l[d]===h[H],N=u[H]>c[H],k=u[H]<c[H];(l[d]===1&&(!g&&N||g&&k)||l[d]!==1&&(!g&&k||g&&N))&&(f=d==="x"?M:C)}let _={x:u.x+x.x,y:u.y+x.y},F={x:c.x+E.x,y:c.y+E.y},O=Math.max(Math.abs(_.x-f[0].x),Math.abs(F.x-f[0].x)),R=Math.max(Math.abs(_.y-f[0].y),Math.abs(F.y-f[0].y));O>=R?(w=(_.x+F.x)/2,y=f[0].y):(w=f[0].x,y=(_.y+F.y)/2)}let j={x:u.x+x.x,y:u.y+x.y},S={x:c.x+E.x,y:c.y+E.y};return[[e,...j.x!==f[0].x||j.y!==f[0].y?[j]:[],...f,...S.x!==f[f.length-1].x||S.y!==f[f.length-1].y?[S]:[],n],w,y,v,b]}function Ep(e,t,n,o){let r=Math.min(Fr(e,t)/2,Fr(t,n)/2,o),{x:s,y:i}=t;if(e.x===s&&s===n.x||e.y===i&&i===n.y)return`L${s} ${i}`;if(e.y===i){let u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${s+r*u},${i}Q ${s},${i} ${s},${i+r*c}`}let l=e.x<n.x?1:-1,h=e.y<n.y?-1:1;return`L ${s},${i+r*h}Q ${s},${i} ${s+r*l},${i}`}function nn({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:o,targetY:r,targetPosition:s=U.Top,borderRadius:i=5,centerX:l,centerY:h,offset:u=20,stepPosition:c=.5}){let[p,d,m,f,w]=$p({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:l,y:h},offset:u,stepPosition:c}),y=`M${p[0].x} ${p[0].y}`;for(let x=1;x<p.length-1;x++)y+=Ep(p[x-1],p[x],p[x+1],i);return y+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[y,d,m,f,w]}function Wr(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Mp(e){let{sourceNode:t,targetNode:n}=e;if(!Wr(t)||!Wr(n))return null;let o=t.internals.handleBounds||Zr(t.handles),r=n.internals.handleBounds||Zr(n.handles),s=Yr(o?.source??[],e.sourceHandle),i=Yr(e.connectionMode===zt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!s||!i)return e.onError?.("008",_e.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=s?.position||U.Bottom,h=i?.position||U.Top,u=mt(t,s,l),c=mt(n,i,h);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:h}}function Zr(e){if(!e)return null;let t=[],n=[];for(let 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 mt(e,t,n=U.Left,o=!1){let r=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??Te(e);if(o)return{x:r+i/2,y:s+l/2};switch(t?.position??n){case U.Top:return{x:r+i/2,y:s};case U.Right:return{x:r+i,y:s+l/2};case U.Bottom:return{x:r+i/2,y:s+l};case U.Left:return{x:r,y:s+l/2}}}function Yr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Uo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function zp(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){let s=new Set;return e.reduce((i,l)=>([l.markerStart||o,l.markerEnd||r].forEach(h=>{if(h&&typeof h=="object"){let u=Uo(h,t);s.has(u)||(i.push({id:u,color:h.color||n,...h}),s.add(u))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}var Pi=1e3,_p=10,fa={nodeOrigin:[0,0],nodeExtent:Jt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Pp={...fa,checkEquality:!0};function ga(e,t){let n={...e};for(let o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function Ap(e,t,n){let o=ga(fa,n);for(let r of e.values())if(r.parentId)va(r,e,t,o);else{let s=ln(r,o.nodeOrigin),i=pt(r.extent)?r.extent:o.nodeExtent,l=ht(s,i,Te(r));r.internals.positionAbsolute=l}}function Ip(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],o=[];for(let r of e.handles){let s={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(s):r.type==="target"&&o.push(s)}return{source:n,target:o}}function xa(e){return e==="manual"}function Go(e,t,n,o={}){let r=ga(Pp,o),s={i:0},i=new Map(t),l=r?.elevateNodesOnSelect&&!xa(r.zIndexMode)?Pi:0,h=e.length>0,u=!1;t.clear(),n.clear();for(let c of e){let p=i.get(c.id);if(r.checkEquality&&c===p?.internals.userNode)t.set(c.id,p);else{let d=ln(c,r.nodeOrigin),m=pt(c.extent)?c.extent:r.nodeExtent,f=ht(d,m,Te(c));p={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:f,handleBounds:Ip(c,p),z:Ai(c,l,r.zIndexMode),userNode:c}},t.set(c.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(h=!1),c.parentId&&va(p,t,n,o,s),u||=c.selected??!1}return{nodesInitialized:h,hasSelectedNodes:u}}function Dp(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function va(e,t,n,o,r){let{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:l,zIndexMode:h}=ga(fa,o),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Dp(e,n),r&&!c.parentId&&c.internals.rootParentIndex===void 0&&h==="auto"&&(c.internals.rootParentIndex=++r.i,c.internals.z=c.internals.z+r.i*_p),r&&c.internals.rootParentIndex!==void 0&&(r.i=c.internals.rootParentIndex);let p=s&&!xa(h)?Pi:0,{x:d,y:m,z:f}=Rp(e,c,i,l,p,h),{positionAbsolute:w}=e.internals,y=d!==w.x||m!==w.y;(y||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:y?{x:d,y:m}:w,z:f}})}function Ai(e,t,n){let o=Re(e.zIndex)?e.zIndex:0;return xa(n)?o:o+(e.selected?t:0)}function Rp(e,t,n,o,r,s){let{x:i,y:l}=t.internals.positionAbsolute,h=Te(e),u=ln(e,n),c=pt(e.extent)?ht(u,e.extent,h):u,p=ht({x:i+c.x,y:l+c.y},o,h);e.extent==="parent"&&(p=vi(p,h,t));let d=Ai(e,r,s),m=t.internals.z??0;return{x:p.x,y:p.y,z:m>=d?m+1:d}}function ya(e,t,n,o=[0,0]){let r=[],s=new Map;for(let i of e){let l=t.get(i.parentId);if(!l)continue;let h=s.get(i.parentId)?.expandedRect??en(l),u=yi(h,i.rect);s.set(i.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:i,parent:l},h)=>{let u=l.internals.positionAbsolute,c=Te(l),p=l.origin??o,d=i.x<u.x?Math.round(Math.abs(u.x-i.x)):0,m=i.y<u.y?Math.round(Math.abs(u.y-i.y)):0,f=Math.max(c.width,Math.round(i.width)),w=Math.max(c.height,Math.round(i.height)),y=(f-c.width)*p[0],x=(w-c.height)*p[1];(d>0||m>0||y||x)&&(r.push({id:h,type:"position",position:{x:l.position.x-d+y,y:l.position.y-m+x}}),n.get(h)?.forEach(E=>{e.some(v=>v.id===E.id)||r.push({id:E.id,type:"position",position:{x:E.position.x+d,y:E.position.y+m}})})),(c.width<i.width||c.height<i.height||d||m)&&r.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:f+(d?p[0]*d-y:0),height:w+(m?p[1]*m-x:0)}})}),r}function Op(e,t,n,o,r,s,i){let l=o?.querySelector(".xyflow__viewport"),h=!1;if(!l)return{changes:[],updatedInternals:h};let u=[],c=window.getComputedStyle(l),{m22:p}=new window.DOMMatrixReadOnly(c.transform),d=[];for(let m of e.values()){let f=t.get(m.id);if(!f)continue;if(f.hidden){t.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),h=!0;continue}let w=ma(m.nodeElement),y=f.measured.width!==w.width||f.measured.height!==w.height;if(w.width&&w.height&&(y||!f.internals.handleBounds||m.force)){let x=m.nodeElement.getBoundingClientRect(),E=pt(f.extent)?f.extent:s,{positionAbsolute:v}=f.internals;if(f.parentId&&f.extent==="parent"){let j=t.get(f.parentId);j&&(v=vi(v,w,j))}else E&&(v=ht(v,E,w));let b={...f,measured:w,internals:{...f.internals,positionAbsolute:v,handleBounds:{source:Br("source",m.nodeElement,x,p,f.id),target:Br("target",m.nodeElement,x,p,f.id)}}};t.set(f.id,b),f.parentId&&va(b,t,n,{nodeOrigin:r,zIndexMode:i}),h=!0,y&&(u.push({id:f.id,type:"dimensions",dimensions:w}),f.expandParent&&f.parentId&&d.push({id:f.id,parentId:f.parentId,rect:en(b,r)}))}}if(d.length>0){let m=ya(d,t,n,r);u.push(...m)}return{changes:u,updatedInternals:h}}async function Lp({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;let i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],o);return!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2])}function Xr(e,t,n,o,r,s){let i=r,l=o.get(i)||new Map;o.set(i,l.set(n,t)),i=`${r}-${e}`;let h=o.get(i)||new Map;if(o.set(i,h.set(n,t)),s){i=`${r}-${e}-${s}`;let u=o.get(i)||new Map;o.set(i,u.set(n,t))}}function Ii(e,t,n){e.clear(),t.clear();for(let o of n){let{source:r,target:s,sourceHandle:i=null,targetHandle:l=null}=o,h={edgeId:o.id,source:r,target:s,sourceHandle:i,targetHandle:l},u=`${r}-${i}--${s}-${l}`,c=`${s}-${l}--${r}-${i}`;Xr("source",h,c,e,r,i),Xr("target",h,u,e,s,l),t.set(o.id,o)}}function Di(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Di(n,t):!1}function qr(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 Tp(e,t,n,o){let r=new Map;for(let[s,i]of e)if((i.selected||i.id===o)&&(!i.parentId||!Di(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){let l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Ro({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){let r=[];for(let[i,l]of t){let h=n.get(i)?.internals.userNode;h&&r.push({...h,position:l.position,dragging:o})}if(!e)return[r[0],r];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:o}:r[0],r]}function Bp({dragItems:e,snapGrid:t,x:n,y:o}){let r=e.values().next().value;if(!r)return null;let s={x:n-r.distance.x,y:o-r.distance.y},i=cn(s,t);return{x:i.x-s.x,y:i.y-s.y}}function Vp({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let s={x:null,y:null},i=0,l=new Map,h=!1,u={x:0,y:0},c=null,p=!1,d=null,m=!1,f=!1,w=null;function y({noDragClassName:E,handleSelector:v,domNode:b,isSelectable:j,nodeId:S,nodeClickDistance:M=0}){d=Ce(b);function C({x:R,y:H}){let{nodeLookup:g,nodeExtent:N,snapGrid:k,snapToGrid:z,nodeOrigin:A,onNodeDrag:$,onSelectionDrag:B,onError:V,updateNodePositions:W}=t();s={x:R,y:H};let J=!1,X=l.size>1,Z=X&&N?Ko(dn(l)):null,ee=X&&z?Bp({dragItems:l,snapGrid:k,x:R,y:H}):null;for(let[Q,T]of l){if(!g.has(Q))continue;let K={x:R-T.distance.x,y:H-T.distance.y};z&&(K=ee?{x:Math.round(K.x+ee.x),y:Math.round(K.y+ee.y)}:cn(K,k));let oe=null;if(X&&N&&!T.extent&&Z){let{positionAbsolute:se}=T.internals,re=se.x-Z.x+N[0][0],le=se.x+T.measured.width-Z.x2+N[1][0],ce=se.y-Z.y+N[0][1],ge=se.y+T.measured.height-Z.y2+N[1][1];oe=[[re,ce],[le,ge]]}let{position:ie,positionAbsolute:q}=xi({nodeId:Q,nextPosition:K,nodeLookup:g,nodeExtent:oe||N,nodeOrigin:A,onError:V});J=J||T.position.x!==ie.x||T.position.y!==ie.y,T.position=ie,T.internals.positionAbsolute=q}if(f=f||J,!!J&&(W(l,!0),w&&(o||$||!S&&B))){let[Q,T]=Ro({nodeId:S,dragItems:l,nodeLookup:g});o?.(w,l,Q,T),$?.(w,Q,T),S||B?.(w,T)}}async function _(){if(!c)return;let{transform:R,panBy:H,autoPanSpeed:g,autoPanOnNodeDrag:N}=t();if(!N){h=!1,cancelAnimationFrame(i);return}let[k,z]=ha(u,c,g);(k!==0||z!==0)&&(s.x=(s.x??0)-k/R[2],s.y=(s.y??0)-z/R[2],await H({x:k,y:z})&&C(s)),i=requestAnimationFrame(_)}function F(R){let{nodeLookup:H,multiSelectionActive:g,nodesDraggable:N,transform:k,snapGrid:z,snapToGrid:A,selectNodesOnDrag:$,onNodeDragStart:B,onSelectionDragStart:V,unselectNodesAndEdges:W}=t();p=!0,(!$||!j)&&!g&&S&&(H.get(S)?.selected||W()),j&&$&&S&&e?.(S);let J=Xt(R.sourceEvent,{transform:k,snapGrid:z,snapToGrid:A,containerBounds:c});if(s=J,l=Tp(H,N,J,S),l.size>0&&(n||B||!S&&V)){let[X,Z]=Ro({nodeId:S,dragItems:l,nodeLookup:H});n?.(R.sourceEvent,l,X,Z),B?.(R.sourceEvent,X,Z),S||V?.(R.sourceEvent,Z)}}let O=Ks().clickDistance(M).on("start",R=>{let{domNode:H,nodeDragThreshold:g,transform:N,snapGrid:k,snapToGrid:z}=t();c=H?.getBoundingClientRect()||null,m=!1,f=!1,w=R.sourceEvent,g===0&&F(R),s=Xt(R.sourceEvent,{transform:N,snapGrid:k,snapToGrid:z,containerBounds:c}),u=Oe(R.sourceEvent,c)}).on("drag",R=>{let{autoPanOnNodeDrag:H,transform:g,snapGrid:N,snapToGrid:k,nodeDragThreshold:z,nodeLookup:A}=t(),$=Xt(R.sourceEvent,{transform:g,snapGrid:N,snapToGrid:k,containerBounds:c});if(w=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||S&&!A.has(S))&&(m=!0),!m){if(!h&&H&&p&&(h=!0,_()),!p){let B=Oe(R.sourceEvent,c),V=B.x-u.x,W=B.y-u.y;Math.sqrt(V*V+W*W)>z&&F(R)}(s.x!==$.xSnapped||s.y!==$.ySnapped)&&l&&p&&(u=Oe(R.sourceEvent,c),C($))}}).on("end",R=>{if(!p||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(h=!1,p=!1,cancelAnimationFrame(i),l.size>0){let{nodeLookup:H,updateNodePositions:g,onNodeDragStop:N,onSelectionDragStop:k}=t();if(f&&(g(l,!1),f=!1),r||N||!S&&k){let[z,A]=Ro({nodeId:S,dragItems:l,nodeLookup:H,dragging:!1});r?.(R.sourceEvent,l,z,A),N?.(R.sourceEvent,z,A),S||k?.(R.sourceEvent,A)}}}).filter(R=>{let H=R.target;return!R.button&&(!E||!qr(H,`.${E}`,b))&&(!v||qr(H,v,b))});d.call(O)}function x(){d?.on(".drag",null)}return{update:y,destroy:x}}function Hp(e,t,n){let o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())Kn(r,en(s))>0&&o.push(s);return o}var Fp=250;function Wp(e,t,n,o){let r=[],s=1/0,i=Hp(e,n,t+Fp);for(let l of i){let h=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(let u of h){if(o.nodeId===u.nodeId&&o.type===u.type&&o.id===u.id)continue;let{x:c,y:p}=mt(l,u,u.position,!0),d=Math.sqrt(Math.pow(c-e.x,2)+Math.pow(p-e.y,2));d>t||(d<s?(r=[{...u,x:c,y:p}],s=d):d===s&&r.push({...u,x:c,y:p}))}}if(!r.length)return null;if(r.length>1){let l=o.type==="source"?"target":"source";return r.find(h=>h.type===l)??r[0]}return r[0]}function Ri(e,t,n,o,r,s=!1){let i=o.get(e);if(!i)return null;let l=r==="strict"?i.internals.handleBounds?.[t]:[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]],h=(n?l?.find(u=>u.id===n):l?.[0])??null;return h&&s?{...h,...mt(i,h,h.position,!0)}:h}function Oi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Zp(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Li=()=>!0;function Yp(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:s,isTarget:i,domNode:l,nodeLookup:h,lib:u,autoPanOnConnect:c,flowId:p,panBy:d,cancelConnection:m,onConnectStart:f,onConnect:w,onConnectEnd:y,isValidConnection:x=Li,onReconnectEnd:E,updateConnection:v,getTransform:b,getFromHandle:j,autoPanSpeed:S,dragThreshold:M=1,handleDomNode:C}){let _=Si(e.target),F=0,O,{x:R,y:H}=Oe(e),g=Oi(s,C),N=l?.getBoundingClientRect(),k=!1;if(!N||!g)return;let z=Ri(r,g,o,h,t);if(!z)return;let A=Oe(e,N),$=!1,B=null,V=!1,W=null;function J(){if(!c||!N)return;let[oe,ie]=ha(A,N,S);d({x:oe,y:ie}),F=requestAnimationFrame(J)}let X={...z,nodeId:r,type:g,position:z.position},Z=h.get(r),ee={inProgress:!0,isValid:null,from:mt(Z,X,U.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:Z,to:A,toHandle:null,toPosition:Rr[X.position],toNode:null,pointer:A};function Q(){k=!0,v(ee),f?.(e,{nodeId:r,handleId:o,handleType:g})}M===0&&Q();function T(oe){if(!k){let{x:ce,y:ge}=Oe(oe),je=ce-R,Ee=ge-H;if(!(je*je+Ee*Ee>M*M))return;Q()}if(!j()||!X){K(oe);return}let ie=b();A=Oe(oe,N),O=Wp(un(A,ie,!1,[1,1]),n,h,X),$||(J(),$=!0);let q=Ti(oe,{handle:O,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:i?"target":"source",isValidConnection:x,doc:_,lib:u,flowId:p,nodeLookup:h});W=q.handleDomNode,B=q.connection,V=Zp(!!O,q.isValid);let se=h.get(r),re=se?mt(se,X,U.Left,!0):ee.from,le={...ee,from:re,isValid:V,to:q.toHandle&&V?Pt({x:q.toHandle.x,y:q.toHandle.y},ie):A,toHandle:q.toHandle,toPosition:V&&q.toHandle?q.toHandle.position:Rr[X.position],toNode:q.toHandle?h.get(q.toHandle.nodeId):null,pointer:A};v(le),ee=le}function K(oe){if(!("touches"in oe&&oe.touches.length>0)){if(k){(O||W)&&B&&V&&w?.(B);let{inProgress:ie,...q}=ee,se={...q,toPosition:ee.toHandle?ee.toPosition:null};y?.(oe,se),s&&E?.(oe,se)}m(),cancelAnimationFrame(F),$=!1,V=!1,B=null,W=null,_.removeEventListener("mousemove",T),_.removeEventListener("mouseup",K),_.removeEventListener("touchmove",T),_.removeEventListener("touchend",K)}}_.addEventListener("mousemove",T),_.addEventListener("mouseup",K),_.addEventListener("touchmove",T),_.addEventListener("touchend",K)}function Ti(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:s,doc:i,lib:l,flowId:h,isValidConnection:u=Li,nodeLookup:c}){let p=s==="target",d=t?i.querySelector(`.${l}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:m,y:f}=Oe(e),w=i.elementFromPoint(m,f),y=w?.classList.contains(`${l}-flow__handle`)?w:d,x={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let E=Oi(void 0,y),v=y.getAttribute("data-nodeid"),b=y.getAttribute("data-handleid"),j=y.classList.contains("connectable"),S=y.classList.contains("connectableend");if(!v||!E)return x;let M={source:p?v:o,sourceHandle:p?b:r,target:p?o:v,targetHandle:p?r:b};x.connection=M;let C=j&&S&&(n===zt.Strict?p&&E==="source"||!p&&E==="target":v!==o||b!==r);x.isValid=C&&u(M),x.toHandle=Ri(v,E,b,c,n,!0)}return x}var Jo={onPointerDown:Yp,isValid:Ti};function Xp({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){let r=Ce(e);function s({translateExtent:l,width:h,height:u,zoomStep:c=1,pannable:p=!0,zoomable:d=!0,inversePan:m=!1}){let f=v=>{if(v.sourceEvent.type!=="wheel"||!t)return;let b=n(),j=v.sourceEvent.ctrlKey&&tn()?10:1,S=-v.sourceEvent.deltaY*(v.sourceEvent.deltaMode===1?.05:v.sourceEvent.deltaMode?1:.002)*c,M=b[2]*Math.pow(2,S*j);t.scaleTo(M)},w=[0,0],y=v=>{(v.sourceEvent.type==="mousedown"||v.sourceEvent.type==="touchstart")&&(w=[v.sourceEvent.clientX??v.sourceEvent.touches[0].clientX,v.sourceEvent.clientY??v.sourceEvent.touches[0].clientY])},x=v=>{let b=n();if(v.sourceEvent.type!=="mousemove"&&v.sourceEvent.type!=="touchmove"||!t)return;let j=[v.sourceEvent.clientX??v.sourceEvent.touches[0].clientX,v.sourceEvent.clientY??v.sourceEvent.touches[0].clientY],S=[j[0]-w[0],j[1]-w[1]];w=j;let M=o()*Math.max(b[2],Math.log(b[2]))*(m?-1:1),C={x:b[0]-S[0]*M,y:b[1]-S[1]*M},_=[[0,0],[h,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:b[2]},_,l)},E=hi().on("start",y).on("zoom",p?x:null).on("zoom.wheel",d?f:null);r.call(E,{})}function i(){r.on("zoom",null)}return{update:s,destroy:i,pointer:Ie}}var ao=e=>({x:e.x,y:e.y,zoom:e.k}),Oo=({x:e,y:t,zoom:n})=>to.translate(e,t).scale(n),ot=(e,t)=>e.target.closest(`.${t}`),Bi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),qp=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Lo=(e,t=0,n=qp,o=()=>{})=>{let r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Vi=e=>{let t=e.ctrlKey&&tn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Kp({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:h,onPanZoomEnd:u}){return c=>{if(ot(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();let p=n.property("__zoom").k||1;if(c.ctrlKey&&i){let y=Ie(c),x=Vi(c),E=p*Math.pow(2,x);o.scaleTo(n,E,y,c);return}let d=c.deltaMode===1?20:1,m=r===dt.Vertical?0:c.deltaX*d,f=r===dt.Horizontal?0:c.deltaY*d;!tn()&&c.shiftKey&&r!==dt.Vertical&&(m=c.deltaY*d,f=0),o.translateBy(n,-(m/p)*s,-(f/p)*s,{internal:!0});let w=ao(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?h?.(c,w):(e.isPanScrolling=!0,l?.(c,w)),e.panScrollTimeout=setTimeout(()=>{u?.(c,w),e.isPanScrolling=!1},150)}}function Up({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){let s=o.type==="wheel",i=!t&&s&&!o.ctrlKey,l=ot(o,e);if(o.ctrlKey&&s&&l&&o.preventDefault(),i||l)return null;o.preventDefault(),n.call(this,o,r)}}function Gp({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;let r=ao(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 Jp({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return s=>{e.usedRightMouseButton=!!(n&&Bi(t,e.mouseButton??0)),s.sourceEvent?.sync||o([s.transform.x,s.transform.y,s.transform.k]),r&&!s.sourceEvent?.internal&&r?.(s.sourceEvent,ao(s.transform))}}function Qp({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:s}){return i=>{if(!i.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Bi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&s(i.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){let l=ao(i.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(i.sourceEvent,l)},n?150:0)}}}function em({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:h,noPanClassName:u,lib:c,connectionInProgress:p}){return d=>{let m=t||n,f=o&&d.ctrlKey,w=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ot(d,`${c}-flow__node`)||ot(d,`${c}-flow__edge`)||ot(d,`${c}-flow__selection`)||ot(d,`${c}-flow__nodesselection`)))return!0;if(!r&&!m&&!s&&!i&&!o||l||p&&!w||ot(d,h)&&w||ot(d,u)&&(!w||s&&w&&!t)||!o&&d.ctrlKey&&w)return!1;if(!o&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!m&&!s&&!f&&w||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;let y=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||w||e)&&y}}function tm({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:s,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:h}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect(),p=[[0,0],[c.width,c.height]];(typeof ResizeObserver<"u"?new ResizeObserver(R=>{let H=R[0];H&&(p=[[0,0],[H.contentRect.width,H.contentRect.height]])}):null)?.observe(e);let d=hi().extent(()=>p).scaleExtent([t,n]).translateExtent(o),m=Ce(e).call(d);v({x:r.x,y:r.y,zoom:_t(r.zoom,t,n)},[[0,0],[c.width,c.height]],o);let f=m.on("wheel.zoom"),w=m.on("dblclick.zoom");d.wheelDelta(Vi);async function y(R,H){return m?new Promise(g=>{d?.interpolate(H?.interpolate==="linear"?Yt:Rn).transform(Lo(m,H?.duration,H?.ease,()=>g(!0)),R)}):!1}function x({noWheelClassName:R,noPanClassName:H,onPaneContextMenu:g,userSelectionActive:N,panOnScroll:k,panOnDrag:z,panOnScrollMode:A,panOnScrollSpeed:$,preventScrolling:B,zoomOnPinch:V,zoomOnScroll:W,zoomOnDoubleClick:J,panActivationKeyPressed:X=!1,zoomActivationKeyPressed:Z,lib:ee,onTransformChange:Q,connectionInProgress:T,paneClickDistance:K,selectionOnDrag:oe}){N&&!u.isZoomingOrPanning&&E();let ie=k&&!Z&&!N;d.clickDistance(oe?1/0:!Re(K)||K<0?0:K);let q=ie?Kp({zoomPanValues:u,noWheelClassName:R,d3Selection:m,d3Zoom:d,panOnScrollMode:A,panOnScrollSpeed:$,zoomOnPinch:V,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:l}):Up({noWheelClassName:R,preventScrolling:B,d3ZoomHandler:f});m.on("wheel.zoom",q,{passive:!1});let se=Gp({zoomPanValues:u,onDraggingChange:h,onPanZoomStart:i});d.on("start",se);let re=Jp({zoomPanValues:u,panOnDrag:z,onPaneContextMenu:!!g,onPanZoom:s,onTransformChange:Q});d.on("zoom",re);let le=Qp({zoomPanValues:u,panOnDrag:z,panOnScroll:k,onPaneContextMenu:g,onPanZoomEnd:l,onDraggingChange:h});d.on("end",le);let ce=em({panActivationKeyPressed:X,zoomActivationKeyPressed:Z,panOnDrag:z,zoomOnScroll:W,panOnScroll:k,zoomOnDoubleClick:J,zoomOnPinch:V,userSelectionActive:N,noPanClassName:H,noWheelClassName:R,lib:ee,connectionInProgress:T});d.filter(ce),J?m.on("dblclick.zoom",w):m.on("dblclick.zoom",null)}function E(){d.on("zoom",null)}async function v(R,H,g){let N=Oo(R),k=d?.constrain()(N,H,g);return k&&await y(k),k}async function b(R,H){let g=Oo(R);return await y(g,H),g}function j(R){if(m){let H=Oo(R),g=m.property("__zoom");(g.k!==R.zoom||g.x!==R.x||g.y!==R.y)&&d?.transform(m,H,null,{sync:!0})}}function S(){let R=m?ui(m.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function M(R,H){return m?new Promise(g=>{d?.interpolate(H?.interpolate==="linear"?Yt:Rn).scaleTo(Lo(m,H?.duration,H?.ease,()=>g(!0)),R)}):!1}async function C(R,H){return m?new Promise(g=>{d?.interpolate(H?.interpolate==="linear"?Yt:Rn).scaleBy(Lo(m,H?.duration,H?.ease,()=>g(!0)),R)}):!1}function _(R){d?.scaleExtent(R)}function F(R){d?.translateExtent(R)}function O(R){let H=!Re(R)||R<0?0:R;d?.clickDistance(H)}return{update:x,destroy:E,setViewport:b,setViewportConstrained:v,getViewport:S,scaleTo:M,scaleBy:C,setScaleExtent:_,setTranslateExtent:F,syncViewport:j,setClickDistance:O}}var ft;(function(e){e.Line="line",e.Handle="handle"})(ft||(ft={}));var nm=["top-left","top-right","bottom-left","bottom-right"],om=["top","right","bottom","left"];function am({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:s}){let i=e-t,l=n-o,h=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&r&&(h[0]=h[0]*-1),l&&s&&(h[1]=h[1]*-1),h}function Kr(e){let 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 tt(e,t){return Math.max(0,t-e)}function nt(e,t){return Math.max(0,e-t)}function Pn(e,t,n){return Math.max(0,t-e,e-n)}function Ur(e,t){return e?!t:t}function rm(e,t,n,o,r,s,i,l){let{affectsX:h,affectsY:u}=t,{isHorizontal:c,isVertical:p}=t,d=c&&p,{xSnapped:m,ySnapped:f}=n,{minWidth:w,maxWidth:y,minHeight:x,maxHeight:E}=o,{x:v,y:b,width:j,height:S,aspectRatio:M}=e,C=Math.floor(c?m-e.pointerX:0),_=Math.floor(p?f-e.pointerY:0),F=j+(h?-C:C),O=S+(u?-_:_),R=-s[0]*j,H=-s[1]*S,g=Pn(F,w,y),N=Pn(O,x,E);if(i){let A=0,$=0;h&&C<0?A=tt(v+C+R,i[0][0]):!h&&C>0&&(A=nt(v+F+R,i[1][0])),u&&_<0?$=tt(b+_+H,i[0][1]):!u&&_>0&&($=nt(b+O+H,i[1][1])),g=Math.max(g,A),N=Math.max(N,$)}if(l){let A=0,$=0;h&&C>0?A=nt(v+C,l[0][0]):!h&&C<0&&(A=tt(v+F,l[1][0])),u&&_>0?$=nt(b+_,l[0][1]):!u&&_<0&&($=tt(b+O,l[1][1])),g=Math.max(g,A),N=Math.max(N,$)}if(r){if(c){let A=Pn(F/M,x,E)*M;if(g=Math.max(g,A),i){let $=0;!h&&!u||h&&!u&&d?$=nt(b+H+F/M,i[1][1])*M:$=tt(b+H+(h?C:-C)/M,i[0][1])*M,g=Math.max(g,$)}if(l){let $=0;!h&&!u||h&&!u&&d?$=tt(b+F/M,l[1][1])*M:$=nt(b+(h?C:-C)/M,l[0][1])*M,g=Math.max(g,$)}}if(p){let A=Pn(O*M,w,y)/M;if(N=Math.max(N,A),i){let $=0;!h&&!u||u&&!h&&d?$=nt(v+O*M+R,i[1][0])/M:$=tt(v+(u?_:-_)*M+R,i[0][0])/M,N=Math.max(N,$)}if(l){let $=0;!h&&!u||u&&!h&&d?$=tt(v+O*M,l[1][0])/M:$=nt(v+(u?_:-_)*M,l[0][0])/M,N=Math.max(N,$)}}}_=_+(_<0?N:-N),C=C+(C<0?g:-g),r&&(d?F>O*M?_=(Ur(h,u)?-C:C)/M:C=(Ur(h,u)?-_:_)*M:c?(_=C/M,u=h):(C=_*M,h=u));let k=h?v+C:v,z=u?b+_:b;return{width:j+(h?-C:C),height:S+(u?-_:_),x:s[0]*C*(h?-1:1)+k,y:s[1]*_*(u?-1:1)+z}}var Hi={width:0,height:0,x:0,y:0},sm={...Hi,pointerX:0,pointerY:0,aspectRatio:1};function im(e,t,n){let o=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,i=e.measured.height??0,l=n[0]*s,h=n[1]*i;return[[o-l,r-h],[o+s-l,r+i-h]]}function lm({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){let s=Ce(e),i={controlDirection:Kr("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:p,resizeDirection:d,onResizeStart:m,onResize:f,onResizeEnd:w,shouldResize:y}){let x={...Hi},E={...sm};i={boundaries:c,resizeDirection:d,keepAspectRatio:p,controlDirection:Kr(u)};let v,b=null,j=[],S,M,C,_=Ks().on("start",F=>{let{nodeLookup:O,transform:R,snapGrid:H,snapToGrid:g,nodeOrigin:N,paneDomNode:k}=n();if(v=O.get(t),!v)return;b=k?.getBoundingClientRect()??null;let{xSnapped:z,ySnapped:A}=Xt(F.sourceEvent,{transform:R,snapGrid:H,snapToGrid:g,containerBounds:b});x={width:v.measured.width??0,height:v.measured.height??0,x:v.position.x??0,y:v.position.y??0},E={...x,pointerX:z,pointerY:A,aspectRatio:x.width/x.height},S=void 0,M=pt(v.extent)?v.extent:void 0,v.parentId&&(v.extent==="parent"||v.expandParent)&&(S=O.get(v.parentId)),S&&v.extent==="parent"&&(M=[[0,0],[S.measured.width,S.measured.height]]),j=[],C=void 0;for(let[$,B]of O)if(B.parentId===t&&(j.push({id:$,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){let V=im(B,v,B.origin??N);C?C=[[Math.min(V[0][0],C[0][0]),Math.min(V[0][1],C[0][1])],[Math.max(V[1][0],C[1][0]),Math.max(V[1][1],C[1][1])]]:C=V}m?.(F,{...x})}).on("drag",F=>{let{transform:O,snapGrid:R,snapToGrid:H,nodeOrigin:g}=n(),N=Xt(F.sourceEvent,{transform:O,snapGrid:R,snapToGrid:H,containerBounds:b}),k=[];if(!v)return;let{x:z,y:A,width:$,height:B}=x,V={},W=v.origin??g,{width:J,height:X,x:Z,y:ee}=rm(E,i.controlDirection,N,i.boundaries,i.keepAspectRatio,W,M,C),Q=J!==$,T=X!==B,K=Z!==z&&Q,oe=ee!==A&&T;if(!K&&!oe&&!Q&&!T)return;let ie={prevValues:{...x},startX:E.x,startY:E.y,childNodes:j.map(re=>({...re,position:{...re.position}}))};if((K||oe||W[0]===1||W[1]===1)&&(V.x=K?Z:x.x,V.y=oe?ee:x.y,x.x=V.x,x.y=V.y,j.length>0)){let re=Z-z,le=ee-A;for(let ce of j)ce.position={x:ce.position.x-re+W[0]*(J-$),y:ce.position.y-le+W[1]*(X-B)},k.push(ce)}if((Q||T)&&(V.width=Q&&(!i.resizeDirection||i.resizeDirection==="horizontal")?J:x.width,V.height=T&&(!i.resizeDirection||i.resizeDirection==="vertical")?X:x.height,x.width=V.width,x.height=V.height),S&&v.expandParent){let re=W[0]*(V.width??0);V.x&&V.x<re&&(x.x=re,E.x=E.x-(V.x-re));let le=W[1]*(V.height??0);V.y&&V.y<le&&(x.y=le,E.y=E.y-(V.y-le))}let q=am({width:x.width,prevWidth:$,height:x.height,prevHeight:B,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),se={...x,direction:q};if(y?.(F,se)===!1){x=ie.prevValues,E.x=ie.startX,E.y=ie.startY,j.forEach((re,le)=>{re.position=ie.childNodes[le].position});return}f?.(F,se),o(V,k)}).on("end",F=>{w?.(F,{...x}),r?.({...x})});s.call(_)}function h(){s.on(".drag",null)}return{update:l,destroy:h}}var dm=et(Nt(),1),cm=et($d(),1),Gr=e=>{let t,n=new Set,o=(l,h)=>{let u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){let c=t;t=h??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,c))}},r=()=>t,s={setState:o,getState:r,getInitialState:()=>i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(import.meta.env?import.meta.env.MODE: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()}},i=t=e(o,r,s);return s},um=e=>e?Gr(e):Gr,{useDebugValue:hm}=dm.default,{useSyncExternalStoreWithSelector:pm}=cm.default,mm=e=>e;function Fi(e,t=mm,n){let o=pm(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return hm(o),o}var Jr=(e,t)=>{let n=um(e),o=(r,s=t)=>Fi(n,r,s);return Object.assign(o,n),o},fm=(e,t)=>e?Jr(e,t):Jr;function fe(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(let[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(let o of e)if(!t.has(o))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var gm=et(vr()),ro=(0,L.createContext)(null),xm=ro.Provider,Wi=_e.error001("react");function de(e,t){let n=(0,L.useContext)(ro);if(n===null)throw new Error(Wi);return Fi(n,e,t)}function pe(){let e=(0,L.useContext)(ro);if(e===null)throw new Error(Wi);return(0,L.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Qr={display:"none"},vm={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Zi="react-flow__node-desc",Yi="react-flow__edge-desc",ym="react-flow__aria-live",bm=e=>e.ariaLiveMessage,wm=e=>e.ariaLabelConfig;function jm({rfId:e}){let t=de(bm);return(0,I.jsx)("div",{id:`${ym}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vm,children:t})}function Nm({rfId:e,disableKeyboardA11y:t}){let n=de(wm);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{id:`${Zi}-${e}`,style:Qr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,I.jsx)("div",{id:`${Yi}-${e}`,style:Qr,children:n["edge.a11yDescription.default"]}),!t&&(0,I.jsx)(jm,{rfId:e})]})}var so=(0,L.forwardRef)(({position:e="top-left",children:t,className:n,style:o,...r},s)=>{let i=`${e}`.split("-");return(0,I.jsx)("div",{className:ve(["react-flow__panel",n,...i]),style:o,ref:s,...r,children:t})});so.displayName="Panel";var es="https://reactflow.dev?utm_source=attribution";function km({proOptions:e,position:t="bottom-right"}){return(0,L.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,I.jsx)(so,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${es}`,children:(0,I.jsx)("a",{href:es,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var Sm=e=>{let t=[],n=[];for(let[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(let[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},An=e=>e.id;function Cm(e,t){return fe(e.selectedNodes.map(An),t.selectedNodes.map(An))&&fe(e.selectedEdges.map(An),t.selectedEdges.map(An))}function $m({onSelectionChange:e}){let t=pe(),{selectedNodes:n,selectedEdges:o}=de(Sm,Cm);return(0,L.useEffect)(()=>{let r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,o,e]),null}var Em=e=>!!e.onSelectionChangeHandlers;function Mm({onSelectionChange:e}){let t=de(Em);return e||t?(0,I.jsx)($m,{onSelectionChange:e}):null}var Xi=[0,0],zm={x:0,y:0,zoom:1},_m=["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"],ts=[..._m,"rfId"],Pm=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}),ns={translateExtent:Jt,nodeOrigin:Xi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Am(e){let{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:h}=de(Pm,fe),u=pe();(0,L.useEffect)(()=>(h(e.defaultNodes,e.defaultEdges),()=>{c.current=ns,l()}),[]);let c=(0,L.useRef)(ns);return(0,L.useEffect)(()=>{for(let p of ts){let d=e[p],m=c.current[p];d!==m&&(typeof e[p]>"u"||(p==="nodes"?t(d):p==="edges"?n(d):p==="minZoom"?o(d):p==="maxZoom"?r(d):p==="translateExtent"?s(d):p==="nodeExtent"?i(d):p==="ariaLabelConfig"?u.setState({ariaLabelConfig:yp(d)}):p==="fitView"?u.setState({fitViewQueued:d}):p==="fitViewOptions"?u.setState({fitViewOptions:d}):u.setState({[p]:d})))}c.current=e},ts.map(p=>e[p])),null}function os(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Im(e){let[t,n]=(0,L.useState)(e==="system"?null:e);return(0,L.useEffect)(()=>{if(e!=="system"){n(e);return}let o=os(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:os()?.matches?"dark":"light"}var as=typeof document<"u"?document:null;function on(e=null,t={target:as,actInsideInputWithModifier:!0}){let[n,o]=(0,L.useState)(!1),r=(0,L.useRef)(!1),s=(0,L.useRef)(new Set([])),[i,l]=(0,L.useMemo)(()=>{if(e!==null){let h=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace(/\+/g,`
|
|
3
3
|
`).replace(`
|
|
4
4
|
|
|
5
5
|
`,`
|
|
Binary file
|