@lunora/studio 1.0.0-alpha.7 → 1.0.0-alpha.71
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/LICENSE.md +6 -0
- package/dist/index.d.ts +762 -779
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/MigrationsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +2 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +4 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
- package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
- package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
- package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
- package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-bRPJhby-.d.ts +254 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
- package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
- package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
- package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
- package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
- package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
- package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-2F7G7IWQ.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2Y36BVVM.js +4 -0
- package/dist/standalone/chunk-34UVAASH.js +1 -0
- package/dist/standalone/chunk-35II7U25.js +11 -0
- package/dist/standalone/chunk-3FUFEZ65.js +1 -0
- package/dist/standalone/chunk-3QRTYSSX.js +1 -0
- package/dist/standalone/chunk-3RTTXLMU.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4CGALXS3.js +19 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-4WLYA3XE.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-5L2MD6F6.js +1 -0
- package/dist/standalone/chunk-5OWIOACV.js +13 -0
- package/dist/standalone/chunk-5RF4QDDA.js +6 -0
- package/dist/standalone/chunk-5U2THBI7.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-65OTWFS3.js +1 -0
- package/dist/standalone/chunk-6DWCIIHE.js +1 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-7J5N6DGQ.js +1 -0
- package/dist/standalone/chunk-7LQWFOEU.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7RXOPYR5.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-7YEFOSPH.js +1 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-B43FTQJ7.js +1 -0
- package/dist/standalone/chunk-BEH5N5ZA.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-BNUJ7QMG.js +3 -0
- package/dist/standalone/chunk-C43X4M5U.js +1 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-D7XXWV4E.js +1 -0
- package/dist/standalone/chunk-DVOBKIUX.js +1 -0
- package/dist/standalone/chunk-EKRN4ZQM.js +1 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-EVN46TVV.js +1 -0
- package/dist/standalone/chunk-EXFBIISG.js +2 -0
- package/dist/standalone/chunk-F5QWLENA.js +1 -0
- package/dist/standalone/chunk-F6GOKFMU.js +3 -0
- package/dist/standalone/chunk-FGTK44LR.js +1 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GSPTEMYN.js +1 -0
- package/dist/standalone/chunk-GXZAXNZI.js +1 -0
- package/dist/standalone/chunk-H7NIIBHH.js +1 -0
- package/dist/standalone/chunk-HP2UCWND.js +1 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IDNNI63H.js +1 -0
- package/dist/standalone/chunk-ILNELDFC.js +1 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-KDOC2DP5.js +1 -0
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/chunk-KYF2E5CJ.js +1 -0
- package/dist/standalone/chunk-L7N7F3DA.js +1 -0
- package/dist/standalone/chunk-LE56LPNH.js +13 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LFKCLLPT.js +1 -0
- package/dist/standalone/chunk-LFXFP4IF.js +1 -0
- package/dist/standalone/chunk-LJDP7NRB.js +1 -0
- package/dist/standalone/chunk-LLXFYRGQ.js +1 -0
- package/dist/standalone/chunk-M536Y2KX.js +1 -0
- package/dist/standalone/chunk-MIQTKZAR.js +1 -0
- package/dist/standalone/chunk-OHKRN65U.js +1 -0
- package/dist/standalone/chunk-P24JBHEZ.js +4 -0
- package/dist/standalone/chunk-PF7V3G2Z.js +62 -0
- package/dist/standalone/chunk-PWWHP76O.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QGKAJTQQ.js +1 -0
- package/dist/standalone/chunk-QLJJ5YYZ.js +1 -0
- package/dist/standalone/chunk-QVEHPYA5.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QWJ3NPE3.js +1 -0
- package/dist/standalone/chunk-RAA2RGG6.js +1 -0
- package/dist/standalone/chunk-RBU52M5T.js +1 -0
- package/dist/standalone/chunk-SA3MDZC3.js +1 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SKHEGARW.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-T2JIUFOD.js +4 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-TJ2WZ5OP.js +1 -0
- package/dist/standalone/chunk-TLHJRWNK.js +1 -0
- package/dist/standalone/chunk-UIS34ZPB.js +8 -0
- package/dist/standalone/chunk-UNUU7CJJ.js +1 -0
- package/dist/standalone/chunk-UZERI5YC.js +1 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-VPAXCQ2Y.js +4 -0
- package/dist/standalone/chunk-X2FQ6B5V.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XEDU5FO4.js +1 -0
- package/dist/standalone/chunk-XQBTNJUQ.js +1 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XQGANNLS.js +1 -0
- package/dist/standalone/chunk-XSD4Y6SQ.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-YD5NF6UT.js +1 -0
- package/dist/standalone/chunk-YI3WYUXK.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/chunk-ZNNAGR6N.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +17 -15
- package/dist/packem_shared/ADMIN_FUNCTIONS-DmBqMZ-z.js +0 -45
- package/dist/packem_shared/ApiDocsPanel-C5-yJ1p7.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-W3no0KOj.js +0 -251
- package/dist/packem_shared/AuditPanel-Bq4o_IqT.js +0 -212
- package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-CtBe1So9.js +0 -4542
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-dxY56TDF.js +0 -193
- package/dist/packem_shared/FileBrowser-Dhy4zES8.js +0 -2932
- package/dist/packem_shared/FunctionRunner--fQJRPAD.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-BjRUA_G3.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-PxclMWmA.js +0 -640
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/InsightsPanel-CWS_C-xW.js +0 -423
- package/dist/packem_shared/LogsPanel-CTW8CFcM.js +0 -839
- package/dist/packem_shared/MailPanel-BwkvfIHF.js +0 -447
- package/dist/packem_shared/MetricsPanel-BLuOhZQ4.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-DT3lnwHF.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-CdErL7EJ.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
- package/dist/packem_shared/SchemaViewer-LJDcmNIO.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-C_ETsPih.js +0 -79
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
- package/dist/packem_shared/StudioApp-D4azxYBu.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-ChfUOZec.js +0 -371
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-CCmwDEVs.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-BFRpzj6r.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";import{a as Ye,b as fo}from"./chunk-GMR677FL.js";import{a as Cs,b as _s,c as Ns,f as ho}from"./chunk-XQGANNLS.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import"./chunk-KYF2E5CJ.js";import"./chunk-7YEFOSPH.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import{a as lr,b as cr,c as ys,d as xs,e as uo,g as ws,h as bs,i as Ut}from"./chunk-4UOFSGUS.js";import{e as hs}from"./chunk-SMIESS7P.js";import{a as Es}from"./chunk-LFKCLLPT.js";import{b as nu}from"./chunk-T6VMSOBB.js";import{a as io,b as so,c as ao,d as lo,e as co}from"./chunk-UZERI5YC.js";import{a as Ge}from"./chunk-5Y3QLNWX.js";import{e as ps,k as ms}from"./chunk-QBWRC5YX.js";import{a as Ss}from"./chunk-LFXFP4IF.js";import{b as vs}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as Mt}from"./chunk-CFPZYHPY.js";import{a as eu}from"./chunk-7QIFDWQV.js";import{c as Ie}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as qe}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as Nn}from"./chunk-GXZAXNZI.js";import{f as fs}from"./chunk-35II7U25.js";import"./chunk-XBDKZZ67.js";import{a as gs}from"./chunk-XQCVZAGU.js";import{d as It,f as En,g as Cn,h as _n,m as De}from"./chunk-4CGALXS3.js";import{b as us}from"./chunk-LE56LPNH.js";import{a as o,e as mt,f as ar,g as tu,h as ds,j as Zt}from"./chunk-3XIESWL4.js";var Be=mt(tu(),1);var re=mt(ar(),1);var z=mt(ds()),D=mt(ar());function ge(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ge(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}o(ge,"cc");var ou={value:o(()=>{},"value")};function Ms(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new po(n)}o(Ms,"dispatch");function po(e){this._=e}o(po,"Dispatch");function ru(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o(ru,"parseTypenames");po.prototype=Ms.prototype={constructor:po,on:o(function(e,t){var n=this._,r=ru(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=iu(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Is(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Is(n[i],e.name,null);return this},"on"),copy:o(function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new po(e)},"copy"),call:o(function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},"call"),apply:o(function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)},"apply")};function iu(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}o(iu,"get");function Is(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ou,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}o(Is,"set");var kt=Ms;var mo="http://www.w3.org/1999/xhtml",ur={svg:"http://www.w3.org/2000/svg",xhtml:mo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ze(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ur.hasOwnProperty(t)?{space:ur[t],local:e}:e}o(Ze,"default");function su(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mo&&t.documentElement.namespaceURI===mo?t.createElement(e):t.createElementNS(n,e)}}o(su,"creatorInherit");function au(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}o(au,"creatorFixed");function In(e){var t=Ze(e);return(t.local?au:su)(t)}o(In,"default");function lu(){}o(lu,"none");function gt(e){return e==null?lu:function(){return this.querySelector(e)}}o(gt,"default");function dr(e){typeof e!="function"&&(e=gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=new Array(a),c,u,d=0;d<a;++d)(c=s[d])&&(u=e.call(c,c.__data__,d,s))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new ye(r,this._parents)}o(dr,"default");function fr(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}o(fr,"array");function cu(){return[]}o(cu,"empty");function qt(e){return e==null?cu:function(){return this.querySelectorAll(e)}}o(qt,"default");function uu(e){return function(){return fr(e.apply(this,arguments))}}o(uu,"arrayAll");function hr(e){typeof e=="function"?e=uu(e):e=qt(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(r.push(e.call(c,c.__data__,u,a)),i.push(c));return new ye(r,i)}o(hr,"default");function Gt(e){return function(){return this.matches(e)}}o(Gt,"default");function go(e){return function(t){return t.matches(e)}}o(go,"childMatcher");var du=Array.prototype.find;function fu(e){return function(){return du.call(this.children,e)}}o(fu,"childFind");function hu(){return this.firstElementChild}o(hu,"childFirst");function pr(e){return this.select(e==null?hu:fu(typeof e=="function"?e:go(e)))}o(pr,"default");var pu=Array.prototype.filter;function mu(){return Array.from(this.children)}o(mu,"children");function gu(e){return function(){return pu.call(this.children,e)}}o(gu,"childrenFilter");function mr(e){return this.selectAll(e==null?mu:gu(typeof e=="function"?e:go(e)))}o(mr,"default");function gr(e){typeof e!="function"&&(e=Gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],c,u=0;u<a;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new ye(r,this._parents)}o(gr,"default");function Mn(e){return new Array(e.length)}o(Mn,"default");function yr(){return new ye(this._enter||this._groups.map(Mn),this._parents)}o(yr,"default");function kn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}o(kn,"EnterNode");kn.prototype={constructor:kn,appendChild:o(function(e){return this._parent.insertBefore(e,this._next)},"appendChild"),insertBefore:o(function(e,t){return this._parent.insertBefore(e,t)},"insertBefore"),querySelector:o(function(e){return this._parent.querySelector(e)},"querySelector"),querySelectorAll:o(function(e){return this._parent.querySelectorAll(e)},"querySelectorAll")};function xr(e){return function(){return e}}o(xr,"default");function yu(e,t,n,r,i,s){for(var a=0,l,c=t.length,u=s.length;a<u;++a)(l=t[a])?(l.__data__=s[a],r[a]=l):n[a]=new kn(e,s[a]);for(;a<c;++a)(l=t[a])&&(i[a]=l)}o(yu,"bindIndex");function xu(e,t,n,r,i,s,a){var l,c,u=new Map,d=t.length,f=s.length,h=new Array(d),p;for(l=0;l<d;++l)(c=t[l])&&(h[l]=p=a.call(c,c.__data__,l,t)+"",u.has(p)?i[l]=c:u.set(p,c));for(l=0;l<f;++l)p=a.call(e,s[l],l,s)+"",(c=u.get(p))?(r[l]=c,c.__data__=s[l],u.delete(p)):n[l]=new kn(e,s[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(i[l]=c)}o(xu,"bindKey");function wu(e){return e.__data__}o(wu,"datum");function wr(e,t){if(!arguments.length)return Array.from(this,wu);var n=t?xu:yu,r=this._parents,i=this._groups;typeof e!="function"&&(e=xr(e));for(var s=i.length,a=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var d=r[u],f=i[u],h=f.length,p=bu(e.call(d,d&&d.__data__,u,r)),m=p.length,v=l[u]=new Array(m),b=a[u]=new Array(m),y=c[u]=new Array(h);n(d,f,v,b,y,p,t);for(var E=0,g=0,w,M;E<m;++E)if(w=v[E]){for(E>=g&&(g=E+1);!(M=b[g])&&++g<m;);w._next=M||null}}return a=new ye(a,r),a._enter=l,a._exit=c,a}o(wr,"default");function bu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}o(bu,"arraylike");function br(){return new ye(this._exit||this._groups.map(Mn),this._parents)}o(br,"default");function vr(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}o(vr,"default");function Sr(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),l=new Array(i),c=0;c<a;++c)for(var u=n[c],d=r[c],f=u.length,h=l[c]=new Array(f),p,m=0;m<f;++m)(p=u[m]||d[m])&&(h[m]=p);for(;c<i;++c)l[c]=n[c];return new ye(l,this._parents)}o(Sr,"default");function Er(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}o(Er,"default");function Cr(e){e||(e=vu);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}o(t,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],l=a.length,c=i[s]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(t)}return new ye(i,this._parents).order()}o(Cr,"default");function vu(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(vu,"ascending");function _r(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}o(_r,"default");function Nr(){return Array.from(this)}o(Nr,"default");function Ir(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}o(Ir,"default");function Mr(){let e=0;for(let t of this)++e;return e}o(Mr,"default");function kr(){return!this.node()}o(kr,"default");function Pr(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}o(Pr,"default");function Su(e){return function(){this.removeAttribute(e)}}o(Su,"attrRemove");function Eu(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Eu,"attrRemoveNS");function Cu(e,t){return function(){this.setAttribute(e,t)}}o(Cu,"attrConstant");function _u(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}o(_u,"attrConstantNS");function Nu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}o(Nu,"attrFunction");function Iu(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)}}o(Iu,"attrFunctionNS");function Tr(e,t){var n=Ze(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Eu:Su:typeof t=="function"?n.local?Iu:Nu:n.local?_u:Cu)(n,t))}o(Tr,"default");function Pn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}o(Pn,"default");function Mu(e){return function(){this.style.removeProperty(e)}}o(Mu,"styleRemove");function ku(e,t,n){return function(){this.style.setProperty(e,t,n)}}o(ku,"styleConstant");function Pu(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}o(Pu,"styleFunction");function Ar(e,t,n){return arguments.length>1?this.each((t==null?Mu:typeof t=="function"?Pu:ku)(e,t,n??"")):yt(this.node(),e)}o(Ar,"default");function yt(e,t){return e.style.getPropertyValue(t)||Pn(e).getComputedStyle(e,null).getPropertyValue(t)}o(yt,"styleValue");function Tu(e){return function(){delete this[e]}}o(Tu,"propertyRemove");function Au(e,t){return function(){this[e]=t}}o(Au,"propertyConstant");function Du(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}o(Du,"propertyFunction");function Dr(e,t){return arguments.length>1?this.each((t==null?Tu:typeof t=="function"?Du:Au)(e,t)):this.node()[e]}o(Dr,"default");function ks(e){return e.trim().split(/^|\s+/)}o(ks,"classArray");function zr(e){return e.classList||new Ps(e)}o(zr,"classList");function Ps(e){this._node=e,this._names=ks(e.getAttribute("class")||"")}o(Ps,"ClassList");Ps.prototype={add:o(function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(e){return this._names.indexOf(e)>=0},"contains")};function Ts(e,t){for(var n=zr(e),r=-1,i=t.length;++r<i;)n.add(t[r])}o(Ts,"classedAdd");function As(e,t){for(var n=zr(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}o(As,"classedRemove");function zu(e){return function(){Ts(this,e)}}o(zu,"classedTrue");function Ou(e){return function(){As(this,e)}}o(Ou,"classedFalse");function $u(e,t){return function(){(t.apply(this,arguments)?Ts:As)(this,e)}}o($u,"classedFunction");function Or(e,t){var n=ks(e+"");if(arguments.length<2){for(var r=zr(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?$u:t?zu:Ou)(n,t))}o(Or,"default");function Ru(){this.textContent=""}o(Ru,"textRemove");function Lu(e){return function(){this.textContent=e}}o(Lu,"textConstant");function Hu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}o(Hu,"textFunction");function $r(e){return arguments.length?this.each(e==null?Ru:(typeof e=="function"?Hu:Lu)(e)):this.node().textContent}o($r,"default");function Bu(){this.innerHTML=""}o(Bu,"htmlRemove");function Vu(e){return function(){this.innerHTML=e}}o(Vu,"htmlConstant");function Fu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}o(Fu,"htmlFunction");function Rr(e){return arguments.length?this.each(e==null?Bu:(typeof e=="function"?Fu:Vu)(e)):this.node().innerHTML}o(Rr,"default");function Wu(){this.nextSibling&&this.parentNode.appendChild(this)}o(Wu,"raise");function Lr(){return this.each(Wu)}o(Lr,"default");function Xu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}o(Xu,"lower");function Hr(){return this.each(Xu)}o(Hr,"default");function Br(e){var t=typeof e=="function"?e:In(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}o(Br,"default");function Yu(){return null}o(Yu,"constantNull");function Vr(e,t){var n=typeof e=="function"?e:In(e),r=t==null?Yu:typeof t=="function"?t:gt(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}o(Vr,"default");function Zu(){var e=this.parentNode;e&&e.removeChild(this)}o(Zu,"remove");function Fr(){return this.each(Zu)}o(Fr,"default");function Uu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(Uu,"selection_cloneShallow");function qu(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(qu,"selection_cloneDeep");function Wr(e){return this.select(e?qu:Uu)}o(Wr,"default");function Xr(e){return arguments.length?this.property("__data__",e):this.node().__data__}o(Xr,"default");function Gu(e){return function(t){e.call(this,t,this.__data__)}}o(Gu,"contextListener");function Ku(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}o(Ku,"parseTypenames");function Qu(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}o(Qu,"onRemove");function Ju(e,t,n){return function(){var r=this.__on,i,s=Gu(t);if(r){for(var a=0,l=r.length;a<l;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}o(Ju,"onAdd");function Yr(e,t,n){var r=Ku(e+""),i,s=r.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(i=0,d=l[c];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(l=t?Ju:Qu,i=0;i<s;++i)this.each(l(r[i],t,n));return this}o(Yr,"default");function Ds(e,t,n){var r=Pn(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}o(Ds,"dispatchEvent");function ju(e,t){return function(){return Ds(this,e,t)}}o(ju,"dispatchConstant");function ed(e,t){return function(){return Ds(this,e,t.apply(this,arguments))}}o(ed,"dispatchFunction");function Zr(e,t){return this.each((typeof t=="function"?ed:ju)(e,t))}o(Zr,"default");function*Ur(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}o(Ur,"default");var qr=[null];function ye(e,t){this._groups=e,this._parents=t}o(ye,"Selection");function zs(){return new ye([[document.documentElement]],qr)}o(zs,"selection");function td(){return this}o(td,"selection_selection");ye.prototype=zs.prototype={constructor:ye,select:dr,selectAll:hr,selectChild:pr,selectChildren:mr,filter:gr,data:wr,enter:yr,exit:br,join:vr,merge:Sr,selection:td,order:Er,sort:Cr,call:_r,nodes:Nr,node:Ir,size:Mr,empty:kr,each:Pr,attr:Tr,style:Ar,property:Dr,classed:Or,text:$r,html:Rr,raise:Lr,lower:Hr,append:Br,insert:Vr,remove:Fr,clone:Wr,datum:Xr,on:Yr,dispatch:Zr,[Symbol.iterator]:Ur};var Ke=zs;function Ee(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],qr)}o(Ee,"default");function Gr(e){let t;for(;t=e.sourceEvent;)e=t;return e}o(Gr,"default");function Me(e,t){if(e=Gr(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}o(Me,"default");var Os={passive:!1},Pt={capture:!0,passive:!1};function yo(e){e.stopImmediatePropagation()}o(yo,"nopropagation");function Qe(e){e.preventDefault(),e.stopImmediatePropagation()}o(Qe,"default");function Kt(e){var t=e.document.documentElement,n=Ee(e).on("dragstart.drag",Qe,Pt);"onselectstart"in t?n.on("selectstart.drag",Qe,Pt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}o(Kt,"default");function Tn(e,t){var n=e.document.documentElement,r=Ee(e).on("dragstart.drag",null);t&&(r.on("click.drag",Qe,Pt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}o(Tn,"yesdrag");var An=o(e=>()=>e,"default");function Dn(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:l,dx:c,dy:u,dispatch:d}){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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}o(Dn,"DragEvent");Dn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nd(e){return!e.ctrlKey&&!e.button}o(nd,"defaultFilter");function od(){return this.parentNode}o(od,"defaultContainer");function rd(e,t){return t??{x:e.x,y:e.y}}o(rd,"defaultSubject");function id(){return navigator.maxTouchPoints||"ontouchstart"in this}o(id,"defaultTouchable");function zn(){var e=nd,t=od,n=rd,r=id,i={},s=kt("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",y,Os).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(h,"drag");function p(w,M){if(!(d||!e.call(this,w,M))){var _=g(this,t.call(this,w,M),w,M,"mouse");_&&(Ee(w.view).on("mousemove.drag",m,Pt).on("mouseup.drag",v,Pt),Kt(w.view),yo(w),u=!1,l=w.clientX,c=w.clientY,_("start",w))}}o(p,"mousedowned");function m(w){if(Qe(w),!u){var M=w.clientX-l,_=w.clientY-c;u=M*M+_*_>f}i.mouse("drag",w)}o(m,"mousemoved");function v(w){Ee(w.view).on("mousemove.drag mouseup.drag",null),Tn(w.view,u),Qe(w),i.mouse("end",w)}o(v,"mouseupped");function b(w,M){if(e.call(this,w,M)){var _=w.changedTouches,k=t.call(this,w,M),P=_.length,T,W;for(T=0;T<P;++T)(W=g(this,k,w,M,_[T].identifier,_[T]))&&(yo(w),W("start",w,_[T]))}}o(b,"touchstarted");function y(w){var M=w.changedTouches,_=M.length,k,P;for(k=0;k<_;++k)(P=i[M[k].identifier])&&(Qe(w),P("drag",w,M[k]))}o(y,"touchmoved");function E(w){var M=w.changedTouches,_=M.length,k,P;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),k=0;k<_;++k)(P=i[M[k].identifier])&&(yo(w),P("end",w,M[k]))}o(E,"touchended");function g(w,M,_,k,P,T){var W=s.copy(),$=Me(T||_,M),V,L,x;if((x=n.call(w,new Dn("beforestart",{sourceEvent:_,target:h,identifier:P,active:a,x:$[0],y:$[1],dx:0,dy:0,dispatch:W}),k))!=null)return V=x.x-$[0]||0,L=x.y-$[1]||0,o(function S(C,I,O){var A=$,B;switch(C){case"start":i[P]=S,B=a++;break;case"end":delete i[P],--a;case"drag":$=Me(O||I,M),B=a;break}W.call(C,w,new Dn(C,{sourceEvent:I,subject:x,target:h,identifier:P,active:B,x:$[0]+V,y:$[1]+L,dx:$[0]-A[0],dy:$[1]-A[1],dispatch:W}),k)},"gesture")}return o(g,"beforestart"),h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:An(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:An(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:An(w),h):n},h.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:An(!!w),h):r},h.on=function(){var w=s.on.apply(s,arguments);return w===s?h:w},h.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,h):Math.sqrt(f)},h}o(zn,"default");var Qt=0,$n=0,On=0,Rs=1e3,xo,Rn,wo=0,Tt=0,bo=0,Ln=typeof performance=="object"&&performance.now?performance:Date,Ls=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bn(){return Tt||(Ls(sd),Tt=Ln.now()+bo)}o(Bn,"now");function sd(){Tt=0}o(sd,"clearNow");function Hn(){this._call=this._time=this._next=null}o(Hn,"Timer");Hn.prototype=vo.prototype={constructor:Hn,restart:o(function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Bn():+n)+(t==null?0:+t),!this._next&&Rn!==this&&(Rn?Rn._next=this:xo=this,Rn=this),this._call=e,this._time=n,Kr()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,Kr())},"stop")};function vo(e,t,n){var r=new Hn;return r.restart(e,t,n),r}o(vo,"timer");function Hs(){Bn(),++Qt;for(var e=xo,t;e;)(t=Tt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qt}o(Hs,"timerFlush");function $s(){Tt=(wo=Ln.now())+bo,Qt=$n=0;try{Hs()}finally{Qt=0,ld(),Tt=0}}o($s,"wake");function ad(){var e=Ln.now(),t=e-wo;t>Rs&&(bo-=t,wo=e)}o(ad,"poke");function ld(){for(var e,t=xo,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:xo=n);Rn=e,Kr(r)}o(ld,"nap");function Kr(e){if(!Qt){$n&&($n=clearTimeout($n));var t=e-Tt;t>24?(e<1/0&&($n=setTimeout($s,e-Ln.now()-bo)),On&&(On=clearInterval(On))):(On||(wo=Ln.now(),On=setInterval(ad,Rs)),Qt=1,Ls($s))}}o(Kr,"sleep");function Vn(e,t,n){var r=new Hn;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}o(Vn,"default");var cd=kt("start","end","cancel","interrupt"),ud=[],Fs=0,Bs=1,Eo=2,So=3,Vs=4,Co=5,Fn=6;function Je(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;dd(e,n,{name:t,index:r,group:i,on:cd,tween:ud,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Fs})}o(Je,"default");function Wn(e,t){var n=Ce(e,t);if(n.state>Fs)throw new Error("too late; already scheduled");return n}o(Wn,"init");function Ne(e,t){var n=Ce(e,t);if(n.state>So)throw new Error("too late; already running");return n}o(Ne,"set");function Ce(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}o(Ce,"get");function dd(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=vo(s,0,n.time);function s(u){n.state=Bs,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}o(s,"schedule");function a(u){var d,f,h,p;if(n.state!==Bs)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===So)return Vn(a);p.state===Vs?(p.state=Fn,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d<t&&(p.state=Fn,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[d])}if(Vn(function(){n.state===So&&(n.state=Vs,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Eo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Eo){for(n.state=So,i=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}o(a,"start");function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=Co,1),f=-1,h=i.length;++f<h;)i[f].call(e,d);n.state===Co&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}o(l,"tick");function c(){n.state=Fn,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}o(c,"stop")}o(dd,"create");function xt(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Eo&&r.state<Co,r.state=Fn,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}o(xt,"default");function Qr(e){return this.each(function(){xt(this,e)})}o(Qr,"default");function fd(e,t){var n,r;return function(){var i=Ne(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}o(fd,"tweenRemove");function hd(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Ne(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var l={name:t,value:n},c=0,u=i.length;c<u;++c)if(i[c].name===t){i[c]=l;break}c===u&&i.push(l)}s.tween=i}}o(hd,"tweenFunction");function Jr(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ce(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?fd:hd)(n,e,t))}o(Jr,"default");function Jt(e,t,n){var r=e._id;return e.each(function(){var i=Ne(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ce(i,r).value[t]}}o(Jt,"tweenValue");function Xn(e,t){var n;return(typeof t=="number"?ys:t instanceof lr?cr:(n=lr(t))?(t=n,cr):xs)(e,t)}o(Xn,"default");function pd(e){return function(){this.removeAttribute(e)}}o(pd,"attrRemove");function md(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(md,"attrRemoveNS");function gd(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}o(gd,"attrConstant");function yd(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}o(yd,"attrConstantNS");function xd(e,t,n){var r,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=l+"",a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l)))}}o(xd,"attrFunction");function wd(e,t,n){var r,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=l+"",a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l)))}}o(wd,"attrFunctionNS");function jr(e,t){var n=Ze(e),r=n==="transform"?bs:Xn;return this.attrTween(e,typeof t=="function"?(n.local?wd:xd)(n,r,Jt(this,"attr."+e,t)):t==null?(n.local?md:pd)(n):(n.local?yd:gd)(n,r,t))}o(jr,"default");function bd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}o(bd,"attrInterpolate");function vd(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}o(vd,"attrInterpolateNS");function Sd(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&vd(e,s)),n}return o(i,"tween"),i._value=t,i}o(Sd,"attrTweenNS");function Ed(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&bd(e,s)),n}return o(i,"tween"),i._value=t,i}o(Ed,"attrTween");function ei(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 r=Ze(e);return this.tween(n,(r.local?Sd:Ed)(r,t))}o(ei,"default");function Cd(e,t){return function(){Wn(this,e).delay=+t.apply(this,arguments)}}o(Cd,"delayFunction");function _d(e,t){return t=+t,function(){Wn(this,e).delay=t}}o(_d,"delayConstant");function ti(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cd:_d)(t,e)):Ce(this.node(),t).delay}o(ti,"default");function Nd(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}o(Nd,"durationFunction");function Id(e,t){return t=+t,function(){Ne(this,e).duration=t}}o(Id,"durationConstant");function ni(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Nd:Id)(t,e)):Ce(this.node(),t).duration}o(ni,"default");function Md(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}o(Md,"easeConstant");function oi(e){var t=this._id;return arguments.length?this.each(Md(t,e)):Ce(this.node(),t).ease}o(oi,"default");function kd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}o(kd,"easeVarying");function ri(e){if(typeof e!="function")throw new Error;return this.each(kd(this._id,e))}o(ri,"default");function ii(e){typeof e!="function"&&(e=Gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],c,u=0;u<a;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new Ae(r,this._parents,this._name,this._id)}o(ii,"default");function si(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=t[l],u=n[l],d=c.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=c[p]||u[p])&&(f[p]=h);for(;l<r;++l)a[l]=t[l];return new Ae(a,this._parents,this._name,this._id)}o(si,"default");function Pd(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}o(Pd,"start");function Td(e,t,n){var r,i,s=Pd(t)?Wn:Ne;return function(){var a=s(this,e),l=a.on;l!==r&&(i=(r=l).copy()).on(t,n),a.on=i}}o(Td,"onFunction");function ai(e,t){var n=this._id;return arguments.length<2?Ce(this.node(),n).on.on(e):this.each(Td(n,e,t))}o(ai,"default");function Ad(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}o(Ad,"removeFunction");function li(){return this.on("end.remove",Ad(this._id))}o(li,"default");function ci(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gt(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var l=r[a],c=l.length,u=s[a]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,Je(u[h],t,n,h,u,Ce(d,n)));return new Ae(s,this._parents,t,n)}o(ci,"default");function ui(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qt(e));for(var r=this._groups,i=r.length,s=[],a=[],l=0;l<i;++l)for(var c=r[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),p,m=Ce(d,n),v=0,b=h.length;v<b;++v)(p=h[v])&&Je(p,t,n,v,h,m);s.push(h),a.push(d)}return new Ae(s,a,t,n)}o(ui,"default");var Dd=Ke.prototype.constructor;function di(){return new Dd(this._groups,this._parents)}o(di,"default");function zd(e,t){var n,r,i;return function(){var s=yt(this,e),a=(this.style.removeProperty(e),yt(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}o(zd,"styleNull");function Ws(e){return function(){this.style.removeProperty(e)}}o(Ws,"styleRemove");function Od(e,t,n){var r,i=n+"",s;return function(){var a=yt(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Od,"styleConstant");function $d(e,t,n){var r,i,s;return function(){var a=yt(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),yt(this,e))),a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l))}}o($d,"styleFunction");function Rd(e,t){var n,r,i,s="style."+t,a="end."+s,l;return function(){var c=Ne(this,e),u=c.on,d=c.value[s]==null?l||(l=Ws(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),c.on=r}}o(Rd,"styleMaybeRemove");function fi(e,t,n){var r=(e+="")=="transform"?ws:Xn;return t==null?this.styleTween(e,zd(e,r)).on("end.style."+e,Ws(e)):typeof t=="function"?this.styleTween(e,$d(e,r,Jt(this,"style."+e,t))).each(Rd(this._id,e)):this.styleTween(e,Od(e,r,t),n).on("end.style."+e,null)}o(fi,"default");function Ld(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}o(Ld,"styleInterpolate");function Hd(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Ld(e,a,n)),r}return o(s,"tween"),s._value=t,s}o(Hd,"styleTween");function hi(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Hd(e,t,n??""))}o(hi,"default");function Bd(e){return function(){this.textContent=e}}o(Bd,"textConstant");function Vd(e){return function(){var t=e(this);this.textContent=t??""}}o(Vd,"textFunction");function pi(e){return this.tween("text",typeof e=="function"?Vd(Jt(this,"text",e)):Bd(e==null?"":e+""))}o(pi,"default");function Fd(e){return function(t){this.textContent=e.call(this,t)}}o(Fd,"textInterpolate");function Wd(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Fd(i)),t}return o(r,"tween"),r._value=e,r}o(Wd,"textTween");function mi(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,Wd(e))}o(mi,"default");function gi(){for(var e=this._name,t=this._id,n=_o(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=Ce(c,t);Je(c,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Ae(r,this._parents,e,n)}o(gi,"default");function yi(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},c={value:o(function(){--i===0&&s()},"value")};n.each(function(){var u=Ne(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),i===0&&s()})}o(yi,"default");var Xd=0;function Ae(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}o(Ae,"Transition");function Xs(e){return Ke().transition(e)}o(Xs,"transition");function _o(){return++Xd}o(_o,"newId");var je=Ke.prototype;Ae.prototype=Xs.prototype={constructor:Ae,select:ci,selectAll:ui,selectChild:je.selectChild,selectChildren:je.selectChildren,filter:ii,merge:si,selection:di,transition:gi,call:je.call,nodes:je.nodes,node:je.node,size:je.size,empty:je.empty,each:je.each,on:ai,attr:jr,attrTween:ei,style:fi,styleTween:hi,text:pi,textTween:mi,remove:li,tween:Jr,delay:ti,duration:ni,ease:oi,easeVarying:ri,end:yi,[Symbol.iterator]:je[Symbol.iterator]};function No(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}o(No,"cubicInOut");var Yd={time:null,delay:0,duration:250,ease:No};function Zd(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}o(Zd,"inherit");function xi(e){var t,n;e instanceof Ae?(t=e._id,e=e._name):(t=_o(),(n=Yd).time=Bn(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&Je(c,e,t,u,a,n||Zd(c,t));return new Ae(r,this._parents,e,t)}o(xi,"default");Ke.prototype.interrupt=Qr;Ke.prototype.transition=xi;var Yn=o(e=>()=>e,"default");function wi(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:r,enumerable:!0,configurable:!0},_:{value:i}})}o(wi,"ZoomEvent");function Ve(e,t,n){this.k=e,this.x=t,this.y=n}o(Ve,"Transform");Ve.prototype={constructor:Ve,scale:o(function(e){return e===1?this:new Ve(this.k*e,this.x,this.y)},"scale"),translate:o(function(e,t){return e===0&t===0?this:new Ve(this.k,this.x+this.k*e,this.y+this.k*t)},"translate"),apply:o(function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},"apply"),applyX:o(function(e){return e*this.k+this.x},"applyX"),applyY:o(function(e){return e*this.k+this.y},"applyY"),invert:o(function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},"invert"),invertX:o(function(e){return(e-this.x)/this.k},"invertX"),invertY:o(function(e){return(e-this.y)/this.k},"invertY"),rescaleX:o(function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},"rescaleX"),rescaleY:o(function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var At=new Ve(1,0,0);Zn.prototype=Ve.prototype;function Zn(e){for(;!e.__zoom;)if(!(e=e.parentNode))return At;return e.__zoom}o(Zn,"transform");function Io(e){e.stopImmediatePropagation()}o(Io,"nopropagation");function Dt(e){e.preventDefault(),e.stopImmediatePropagation()}o(Dt,"default");function Ud(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}o(Ud,"defaultFilter");function qd(){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]]}o(qd,"defaultExtent");function Ys(){return this.__zoom||At}o(Ys,"defaultTransform");function Gd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}o(Gd,"defaultWheelDelta");function Kd(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Kd,"defaultTouchable");function Qd(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}o(Qd,"defaultConstrain");function Un(){var e=Ud,t=qd,n=Qd,r=Gd,i=Kd,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Ut,u=kt("start","zoom","end"),d,f,h,p=500,m=150,v=0,b=10;function y(x){x.property("__zoom",Ys).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",W).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(y,"zoom"),y.transform=function(x,S,C,I){var O=x.selection?x.selection():x;O.property("__zoom",Ys),x!==O?M(x,S,C,I):O.interrupt().each(function(){_(this,arguments).event(I).start().zoom(null,typeof S=="function"?S.apply(this,arguments):S).end()})},y.scaleBy=function(x,S,C,I){y.scaleTo(x,function(){var O=this.__zoom.k,A=typeof S=="function"?S.apply(this,arguments):S;return O*A},C,I)},y.scaleTo=function(x,S,C,I){y.transform(x,function(){var O=t.apply(this,arguments),A=this.__zoom,B=C==null?w(O):typeof C=="function"?C.apply(this,arguments):C,F=A.invert(B),H=typeof S=="function"?S.apply(this,arguments):S;return n(g(E(A,H),B,F),O,a)},C,I)},y.translateBy=function(x,S,C,I){y.transform(x,function(){return n(this.__zoom.translate(typeof S=="function"?S.apply(this,arguments):S,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,I)},y.translateTo=function(x,S,C,I,O){y.transform(x,function(){var A=t.apply(this,arguments),B=this.__zoom,F=I==null?w(A):typeof I=="function"?I.apply(this,arguments):I;return n(At.translate(F[0],F[1]).scale(B.k).translate(typeof S=="function"?-S.apply(this,arguments):-S,typeof C=="function"?-C.apply(this,arguments):-C),A,a)},I,O)};function E(x,S){return S=Math.max(s[0],Math.min(s[1],S)),S===x.k?x:new Ve(S,x.x,x.y)}o(E,"scale");function g(x,S,C){var I=S[0]-C[0]*x.k,O=S[1]-C[1]*x.k;return I===x.x&&O===x.y?x:new Ve(x.k,I,O)}o(g,"translate");function w(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}o(w,"centroid");function M(x,S,C,I){x.on("start.zoom",function(){_(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(I).end()}).tween("zoom",function(){var O=this,A=arguments,B=_(O,A).event(I),F=t.apply(O,A),H=C==null?w(F):typeof C=="function"?C.apply(O,A):C,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),Z=O.__zoom,X=typeof S=="function"?S.apply(O,A):S,j=c(Z.invert(H).concat(U/Z.k),X.invert(H).concat(U/X.k));return function(K){if(K===1)K=X;else{var R=j(K),Y=U/R[2];K=new Ve(Y,H[0]-R[0]*Y,H[1]-R[1]*Y)}B.zoom(null,K)}})}o(M,"schedule");function _(x,S,C){return!C&&x.__zooming||new k(x,S)}o(_,"gesture");function k(x,S){this.that=x,this.args=S,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,S),this.taps=0}o(k,"Gesture"),k.prototype={event:o(function(x){return x&&(this.sourceEvent=x),this},"event"),start:o(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:o(function(x,S){return this.mouse&&x!=="mouse"&&(this.mouse[1]=S.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=S.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=S.invert(this.touch1[0])),this.that.__zoom=S,this.emit("zoom"),this},"zoom"),end:o(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:o(function(x){var S=Ee(this.that).datum();u.call(x,this.that,new wi(x,{sourceEvent:this.sourceEvent,target:y,type:x,transform:this.that.__zoom,dispatch:u}),S)},"emit")};function P(x,...S){if(!e.apply(this,arguments))return;var C=_(this,S).event(x),I=this.__zoom,O=Math.max(s[0],Math.min(s[1],I.k*Math.pow(2,r.apply(this,arguments)))),A=Me(x);if(C.wheel)(C.mouse[0][0]!==A[0]||C.mouse[0][1]!==A[1])&&(C.mouse[1]=I.invert(C.mouse[0]=A)),clearTimeout(C.wheel);else{if(I.k===O)return;C.mouse=[A,I.invert(A)],xt(this),C.start()}Dt(x),C.wheel=setTimeout(B,m),C.zoom("mouse",n(g(E(I,O),C.mouse[0],C.mouse[1]),C.extent,a));function B(){C.wheel=null,C.end()}o(B,"wheelidled")}o(P,"wheeled");function T(x,...S){if(h||!e.apply(this,arguments))return;var C=x.currentTarget,I=_(this,S,!0).event(x),O=Ee(x.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",U,!0),A=Me(x,C),B=x.clientX,F=x.clientY;Kt(x.view),Io(x),I.mouse=[A,this.__zoom.invert(A)],xt(this),I.start();function H(Z){if(Dt(Z),!I.moved){var X=Z.clientX-B,j=Z.clientY-F;I.moved=X*X+j*j>v}I.event(Z).zoom("mouse",n(g(I.that.__zoom,I.mouse[0]=Me(Z,C),I.mouse[1]),I.extent,a))}o(H,"mousemoved");function U(Z){O.on("mousemove.zoom mouseup.zoom",null),Tn(Z.view,I.moved),Dt(Z),I.event(Z).end()}o(U,"mouseupped")}o(T,"mousedowned");function W(x,...S){if(e.apply(this,arguments)){var C=this.__zoom,I=Me(x.changedTouches?x.changedTouches[0]:x,this),O=C.invert(I),A=C.k*(x.shiftKey?.5:2),B=n(g(E(C,A),I,O),t.apply(this,S),a);Dt(x),l>0?Ee(this).transition().duration(l).call(M,B,I,x):Ee(this).call(y.transform,B,I,x)}}o(W,"dblclicked");function $(x,...S){if(e.apply(this,arguments)){var C=x.touches,I=C.length,O=_(this,S,x.changedTouches.length===I).event(x),A,B,F,H;for(Io(x),B=0;B<I;++B)F=C[B],H=Me(F,this),H=[H,this.__zoom.invert(H),F.identifier],O.touch0?!O.touch1&&O.touch0[2]!==H[2]&&(O.touch1=H,O.taps=0):(O.touch0=H,A=!0,O.taps=1+!!d);d&&(d=clearTimeout(d)),A&&(O.taps<2&&(f=H[0],d=setTimeout(function(){d=null},p)),xt(this),O.start())}}o($,"touchstarted");function V(x,...S){if(this.__zooming){var C=_(this,S).event(x),I=x.changedTouches,O=I.length,A,B,F,H;for(Dt(x),A=0;A<O;++A)B=I[A],F=Me(B,this),C.touch0&&C.touch0[2]===B.identifier?C.touch0[0]=F:C.touch1&&C.touch1[2]===B.identifier&&(C.touch1[0]=F);if(B=C.that.__zoom,C.touch1){var U=C.touch0[0],Z=C.touch0[1],X=C.touch1[0],j=C.touch1[1],K=(K=X[0]-U[0])*K+(K=X[1]-U[1])*K,R=(R=j[0]-Z[0])*R+(R=j[1]-Z[1])*R;B=E(B,Math.sqrt(K/R)),F=[(U[0]+X[0])/2,(U[1]+X[1])/2],H=[(Z[0]+j[0])/2,(Z[1]+j[1])/2]}else if(C.touch0)F=C.touch0[0],H=C.touch0[1];else return;C.zoom("touch",n(g(B,F,H),C.extent,a))}}o(V,"touchmoved");function L(x,...S){if(this.__zooming){var C=_(this,S).event(x),I=x.changedTouches,O=I.length,A,B;for(Io(x),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),A=0;A<O;++A)B=I[A],C.touch0&&C.touch0[2]===B.identifier?delete C.touch0:C.touch1&&C.touch1[2]===B.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(B=Me(B,this),Math.hypot(f[0]-B[0],f[1]-B[1])<b)){var F=Ee(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return o(L,"touchended"),y.wheelDelta=function(x){return arguments.length?(r=typeof x=="function"?x:Yn(+x),y):r},y.filter=function(x){return arguments.length?(e=typeof x=="function"?x:Yn(!!x),y):e},y.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:Yn(!!x),y):i},y.extent=function(x){return arguments.length?(t=typeof x=="function"?x:Yn([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),y):t},y.scaleExtent=function(x){return arguments.length?(s[0]=+x[0],s[1]=+x[1],y):[s[0],s[1]]},y.translateExtent=function(x){return arguments.length?(a[0][0]=+x[0][0],a[1][0]=+x[1][0],a[0][1]=+x[0][1],a[1][1]=+x[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(x){return arguments.length?(n=x,y):n},y.duration=function(x){return arguments.length?(l=+x,y):l},y.interpolate=function(x){return arguments.length?(c=x,y):c},y.on=function(){var x=u.on.apply(u,arguments);return x===u?y:x},y.clickDistance=function(x){return arguments.length?(v=(x=+x)*x,y):Math.sqrt(v)},y.tapDistance=function(x){return arguments.length?(b=+x,y):b},y}o(Un,"default");var ze={error001:o((e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,"error001"),error002:o(()=>"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.","error002"),error003:o(e=>`Node type "${e}" not found. Using fallback type "default".`,"error003"),error004:o(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:o(()=>"Only child nodes can use a parent extent.","error005"),error006:o(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:o(e=>`The old edge with id=${e} does not exist.`,"error007"),error009:o(e=>`Marker type "${e}" doesn't exist.`,"error009"),error008:o((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,"error008"),error010:o(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:o(e=>`Edge type "${e}" not found. Using fallback type "default".`,"error011"),error012:o(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.`,"error012"),error013:o((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.`,"error013"),error014:o(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:o(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:o(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.`,"error016")},on=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ci=["Enter"," ","Escape"],_i={"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":o(({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"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"},vt;(function(e){e.Strict="strict",e.Loose="loose"})(vt||(vt={}));var et;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(et||(et={}));var zt;(function(e){e.Partial="partial",e.Full="full"})(zt||(zt={}));var Ni={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Ue;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ue||(Ue={}));var tn;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(tn||(tn={}));var J;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(J||(J={}));var Zs={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top};function Ii(e){return e===null?null:e?"valid":"invalid"}o(Ii,"getConnectionStatus");var Mi=o(e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,"isEdgeBase"),ia=o(e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),"isNodeBase"),ki=o(e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),"isInternalNodeBase");var Gn=o((e,t=[0,0])=>{let{width:n,height:r}=Fe(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},"getNodePositionWithOrigin"),Kn=o((e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=e.reduce((r,i)=>{let s=typeof i=="string",a=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(i):ki(i)?i:t.nodeLookup.get(i.id));let l=a?Po(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Do(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return zo(n)},"getNodesBounds"),rn=o((e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Do(n,Po(i)),r=!0)}),r?zo(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),To=o((e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{let l=(t.x-n)/i,c=(t.y-r)/i,u=t.width/i,d=t.height/i,f=[];for(let h of e.values()){let{measured:p,selectable:m=!0,hidden:v=!1}=h;if(a&&!m||v)continue;let b=p.width??h.width??h.initialWidth??0,y=p.height??h.height??h.initialHeight??0,{x:E,y:g}=h.internals.positionAbsolute,w=ua(l,c,u,d,E,g,b,y),M=b*y,_=s&&w>0;(!h.internals.handleBounds||_||w>=M||h.dragging)&&f.push(h)}return f},"getNodesInside"),sa=o((e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))},"getConnectedEdges");function Jd(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t?.includeHiddenNodes){let{width:a,height:l}=Fe(i);s=a>0&&l>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}o(Jd,"getFitViewNodes");async function aa({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;let l=Jd(e,a),c=rn(l),u=Lt(c,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}o(aa,"fitViewport");function Pi({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){let a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r,f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)s?.("005",ze.error005());else{let p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&Rt(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);let h=Rt(f)?Ot(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",ze.error015()),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}o(Pi,"calculateNodePosition");async function la({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let s=new Set(e.map(h=>h.id)),a=[];for(let h of n){if(h.deletable===!1)continue;let p=s.has(h.id),m=!p&&h.parentId&&a.find(v=>v.id===h.parentId);(p||m)&&a.push(h)}let l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=sa(a,c);for(let h of c)l.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!i)return{edges:d,nodes:a};let f=await i({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}o(la,"getElementsToRemove");var nn=o((e,t=0,n=1)=>Math.min(Math.max(e,t),n),"clamp"),Ot=o((e={x:0,y:0},t,n)=>({x:nn(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nn(e.y,t[0][1],t[1][1]-(n?.height??0))}),"clampPosition");function ca(e,t,n){let{width:r,height:i}=Fe(n),{x:s,y:a}=n.internals.positionAbsolute;return Ot(e,[[s,a],[s+r,a+i]],t)}o(ca,"clampPositionToParent");var Us=o((e,t,n)=>e<t?nn(Math.abs(e-t),1,t)/t:e>n?-nn(Math.abs(e-n),1,t)/t:0,"calcAutoPanVelocity"),Ao=o((e,t,n=15,r=40)=>{let i=Us(e.x,r,t.width-r)*n,s=Us(e.y,r,t.height-r)*n;return[i,s]},"calcAutoPan"),Do=o((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)}),"getBoundsOfBoxes"),Ei=o(({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),"rectToBox"),zo=o(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),"boxToRect"),sn=o((e,t=[0,0])=>{let{x:n,y:r}=ki(e)?e.internals.positionAbsolute:Gn(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},"nodeToRect"),Po=o((e,t=[0,0])=>{let{x:n,y:r}=ki(e)?e.internals.positionAbsolute:Gn(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},"nodeToBox"),Ti=o((e,t)=>zo(Do(Ei(e),Ei(t))),"getBoundsOfRects"),ua=o((e,t,n,r,i,s,a,l)=>{let c=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+l)-Math.max(t,s));return Math.ceil(c*u)},"getRectsOverlappingArea"),Qn=o((e,t)=>ua(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),"getOverlappingArea"),Ai=o(e=>Le(e.width)&&Le(e.height)&&Le(e.x)&&Le(e.y),"isRectObject"),Le=o(e=>!isNaN(e)&&isFinite(e),"isNumeric"),Di=o((e,t)=>(n,r)=>{},"createDevWarn"),an=o((e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),"snapPosition"),ln=o(({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{let l={x:(e-n)/i,y:(t-r)/i};return s?an(l,a):l},"pointToRendererPoint"),$t=o(({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),"rendererPointToPoint");function jt(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}o(jt,"parsePadding");function jd(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=jt(e,n),i=jt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){let r=jt(e.top??e.y??0,n),i=jt(e.bottom??e.y??0,n),s=jt(e.left??e.x??0,t),a=jt(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}o(jd,"parsePaddings");function ef(e,t,n,r,i,s){let{x:a,y:l}=$t(e,[t,n,r]),{x:c,y:u}=$t({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-c,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}o(ef,"calculateAppliedPaddings");var Lt=o((e,t,n,r,i,s)=>{let a=jd(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=nn(u,r,i),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,v=ef(e,p,m,d,t,n),b={left:Math.min(v.left-a.left,0),top:Math.min(v.top-a.top,0),right:Math.min(v.right-a.right,0),bottom:Math.min(v.bottom-a.bottom,0)};return{x:p-b.left+b.right,y:m-b.top+b.bottom,zoom:d}},"getViewportForBounds"),cn=o(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function Rt(e){return e!=null&&e!=="parent"}o(Rt,"isCoordinateExtent");function Fe(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}o(Fe,"getNodeDimensions");function zi(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}o(zi,"nodeHasDimensions");function Oi(e,t={width:0,height:0},n,r,i){let s={...e},a=r.get(n);if(a){let l=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}o(Oi,"evaluateAbsolutePosition");function $i(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}o($i,"areSetsEqual");function da(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}o(da,"withResolvers");function fa(e){return{..._i,...e||{}}}o(fa,"mergeAriaLabelConfig");function qn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:s,y:a}=He(e),l=ln({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:c,y:u}=n?an(l,t):l;return{xSnapped:c,ySnapped:u,...l}}o(qn,"getPointerPosition");var Oo=o(e=>({width:e.offsetWidth,height:e.offsetHeight}),"getDimensions"),Ri=o(e=>e?.getRootNode?.()||window?.document,"getHostForElement"),tf=["INPUT","SELECT","TEXTAREA"];function Li(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:tf.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}o(Li,"isInputDOMNode");var Hi=o(e=>"clientX"in e,"isMouseEvent"),He=o((e,t)=>{let n=Hi(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},"getEventPosition"),qs=o((e,t,n,r,i)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{let l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Oo(a)}})},"getHandleBounds");function $o({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){let c=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}o($o,"getBezierEdgeCenter");function Mo(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}o(Mo,"calculateControlOffset");function Gs({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case J.Left:return[t-Mo(t-r,s),n];case J.Right:return[t+Mo(r-t,s),n];case J.Top:return[t,n-Mo(n-i,s)];case J.Bottom:return[t,n+Mo(i-n,s)]}}o(Gs,"getControlWithCurvature");function Ro({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:i,targetPosition:s=J.Top,curvature:a=.25}){let[l,c]=Gs({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=Gs({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[f,h,p,m]=$o({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${i}`,f,h,p,m]}o(Ro,"getBezierPath");function Bi({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,l=r<t?r+a:r-a;return[s,l,i,a]}o(Bi,"getEdgeCenter");function ha({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;let a=i&&n?r+1e3:r,l=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+l}o(ha,"getElevatedEdgeZIndex");function pa({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let s=Do(Po(e),Po(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Qn(a,zo(s))>0}o(pa,"isEdgeVisible");var nf=o(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,"getEdgeId"),of=o((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)),"connectionExists"),ma=o((e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ze.error006()),t;let r=n.getEdgeId||nf,i;return Mi(e)?i={...e}:i={...e,id:r(e)},of(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))},"addEdge");function Lo({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,s,a,l]=Bi({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,l]}o(Lo,"getStraightPath");var Ks={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}},rf=o(({source:e,sourcePosition:t=J.Bottom,target:n})=>t===J.Left||t===J.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},"getDirection"),Qs=o((e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),"distance");function sf({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:r=J.Top,center:i,offset:s,stepPosition:a}){let l=Ks[t],c=Ks[r],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=rf({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h],m=[],v,b,y={x:0,y:0},E={x:0,y:0},[,,g,w]=Bi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(v=i.x??u.x+(d.x-u.x)*a,b=i.y??(u.y+d.y)/2):(v=i.x??(u.x+d.x)/2,b=i.y??u.y+(d.y-u.y)*a);let P=[{x:v,y:u.y},{x:v,y:d.y}],T=[{x:u.x,y:b},{x:d.x,y:b}];l[h]===p?m=h==="x"?P:T:m=h==="x"?T:P}else{let P=[{x:u.x,y:d.y}],T=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?T:P:m=l.y===p?P:T,t===r){let x=Math.abs(e[h]-n[h]);if(x<=s){let S=Math.min(s-1,s-x);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*S:E[h]=(d[h]>n[h]?-1:1)*S}}if(t!==r){let x=h==="x"?"y":"x",S=l[h]===c[x],C=u[x]>d[x],I=u[x]<d[x];(l[h]===1&&(!S&&C||S&&I)||l[h]!==1&&(!S&&I||S&&C))&&(m=h==="x"?P:T)}let W={x:u.x+y.x,y:u.y+y.y},$={x:d.x+E.x,y:d.y+E.y},V=Math.max(Math.abs(W.x-m[0].x),Math.abs($.x-m[0].x)),L=Math.max(Math.abs(W.y-m[0].y),Math.abs($.y-m[0].y));V>=L?(v=(W.x+$.x)/2,b=m[0].y):(v=m[0].x,b=(W.y+$.y)/2)}let M={x:u.x+y.x,y:u.y+y.y},_={x:d.x+E.x,y:d.y+E.y};return[[e,...M.x!==m[0].x||M.y!==m[0].y?[M]:[],...m,..._.x!==m[m.length-1].x||_.y!==m[m.length-1].y?[_]:[],n],v,b,g,w]}o(sf,"getPoints");function af(e,t,n,r){let i=Math.min(Qs(e,t)/2,Qs(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){let u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}let l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${s},${a+i*c}Q ${s},${a} ${s+i*l},${a}`}o(af,"getBend");function Jn({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:i,targetPosition:s=J.Top,borderRadius:a=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){let[f,h,p,m,v]=sf({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:c},offset:u,stepPosition:d}),b=`M${f[0].x} ${f[0].y}`;for(let y=1;y<f.length-1;y++)b+=af(f[y-1],f[y],f[y+1],a);return b+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[b,h,p,m,v]}o(Jn,"getSmoothStepPath");function Js(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}o(Js,"isNodeInitialized");function ga(e){let{sourceNode:t,targetNode:n}=e;if(!Js(t)||!Js(n))return null;let r=t.internals.handleBounds||js(t.handles),i=n.internals.handleBounds||js(n.handles),s=ea(r?.source??[],e.sourceHandle),a=ea(e.connectionMode===vt.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",ze.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=s?.position||J.Bottom,c=a?.position||J.Top,u=St(t,s,l),d=St(n,a,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}o(ga,"getEdgePosition");function js(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}o(js,"toHandleBounds");function St(e,t,n=J.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??Fe(e);if(r)return{x:i+a/2,y:s+l/2};switch(t?.position??n){case J.Top:return{x:i+a/2,y:s};case J.Right:return{x:i+a,y:s+l/2};case J.Bottom:return{x:i+a/2,y:s+l};case J.Left:return{x:i,y:s+l/2}}}o(St,"getHandlePosition");function ea(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}o(ea,"getHandle$1");function Ho(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}o(Ho,"getMarkerId");function ya(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let s=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){let u=Ho(c,t);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}o(ya,"createMarkerIds");var xa=1e3,lf=10,Vi={nodeOrigin:[0,0],nodeExtent:on,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},cf={...Vi,checkEquality:!0};function Fi(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}o(Fi,"mergeObjects");function wa(e,t,n){let r=Fi(Vi,n);for(let i of e.values())if(i.parentId)Xi(i,e,t,r);else{let s=Gn(i,r.nodeOrigin),a=Rt(i.extent)?i.extent:r.nodeExtent,l=Ot(s,a,Fe(i));i.internals.positionAbsolute=l}}o(wa,"updateAbsolutePositions");function uf(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let i of e.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}o(uf,"parseHandles");function Wi(e){return e==="manual"}o(Wi,"isManualZIndexMode");function Bo(e,t,n,r={}){let i=Fi(cf,r),s={i:0},a=new Map(t),l=i?.elevateNodesOnSelect&&!Wi(i.zIndexMode)?xa:0,c=e.length>0,u=!1;t.clear(),n.clear();for(let d of e){let f=a.get(d.id);if(i.checkEquality&&d===f?.internals.userNode)t.set(d.id,f);else{let h=Gn(d,i.nodeOrigin),p=Rt(d.extent)?d.extent:i.nodeExtent,m=Ot(h,p,Fe(d));f={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:m,handleBounds:uf(d,f),z:ba(d,l,i.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(c=!1),d.parentId&&Xi(f,t,n,r,s),u||=d.selected??!1}return{nodesInitialized:c,hasSelectedNodes:u}}o(Bo,"adoptUserNodes");function df(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]]))}o(df,"updateParentLookup");function Xi(e,t,n,r,i){let{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=Fi(Vi,r),u=e.parentId,d=t.get(u);if(!d){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}df(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*lf),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);let f=s&&!Wi(c)?xa:0,{x:h,y:p,z:m}=ff(e,d,a,l,f,c),{positionAbsolute:v}=e.internals,b=h!==v.x||p!==v.y;(b||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:h,y:p}:v,z:m}})}o(Xi,"updateChildNode");function ba(e,t,n){let r=Le(e.zIndex)?e.zIndex:0;return Wi(n)?r:r+(e.selected?t:0)}o(ba,"calculateZ");function ff(e,t,n,r,i,s){let{x:a,y:l}=t.internals.positionAbsolute,c=Fe(e),u=Gn(e,n),d=Rt(e.extent)?Ot(u,e.extent,c):u,f=Ot({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=ca(f,c,t));let h=ba(e,i,s),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}o(ff,"calculateChildXYZ");function Vo(e,t,n,r=[0,0]){let i=[],s=new Map;for(let a of e){let l=t.get(a.parentId);if(!l)continue;let c=s.get(a.parentId)?.expandedRect??sn(l),u=Ti(c,a.rect);s.set(a.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},c)=>{let u=l.internals.positionAbsolute,d=Fe(l),f=l.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,p=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,m=Math.max(d.width,Math.round(a.width)),v=Math.max(d.height,Math.round(a.height)),b=(m-d.width)*f[0],y=(v-d.height)*f[1];(h>0||p>0||b||y)&&(i.push({id:c,type:"position",position:{x:l.position.x-h+b,y:l.position.y-p+y}}),n.get(c)?.forEach(E=>{e.some(g=>g.id===E.id)||i.push({id:E.id,type:"position",position:{x:E.position.x+h,y:E.position.y+p}})})),(d.width<a.width||d.height<a.height||h||p)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:m+(h?f[0]*h-b:0),height:v+(p?f[1]*p-y:0)}})}),i}o(Vo,"handleExpandParent");function va(e,t,n,r,i,s,a){let l=r?.querySelector(".xyflow__viewport"),c=!1;if(!l)return{changes:[],updatedInternals:c};let u=[],d=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=[];for(let p of e.values()){let m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}let v=Oo(p.nodeElement),b=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!m.internals.handleBounds||p.force))){let E=p.nodeElement.getBoundingClientRect(),g=Rt(m.extent)?m.extent:s,{positionAbsolute:w}=m.internals;if(m.parentId&&m.extent==="parent"){let _=t.get(m.parentId);_&&(w=ca(w,v,_))}else g&&(w=Ot(w,g,v));let M={...m,measured:v,internals:{...m.internals,positionAbsolute:w,handleBounds:{source:qs("source",p.nodeElement,E,f,m.id),target:qs("target",p.nodeElement,E,f,m.id)}}};t.set(m.id,M),m.parentId&&Xi(M,t,n,{nodeOrigin:i,zIndexMode:a}),c=!0,b&&(u.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&h.push({id:m.id,parentId:m.parentId,rect:sn(M,i)}))}}if(h.length>0){let p=Vo(h,t,n,i);u.push(...p)}return{changes:u,updatedInternals:c}}o(va,"updateNodeInternals");async function Sa({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}o(Sa,"panBy");function ta(e,t,n,r,i,s){let a=i,l=r.get(a)||new Map;r.set(a,l.set(n,t)),a=`${i}-${e}`;let c=r.get(a)||new Map;if(r.set(a,c.set(n,t)),s){a=`${i}-${e}-${s}`;let u=r.get(a)||new Map;r.set(a,u.set(n,t))}}o(ta,"addConnectionToLookup");function Yi(e,t,n){e.clear(),t.clear();for(let r of n){let{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${s}-${l}`,d=`${s}-${l}--${i}-${a}`;ta("source",c,d,e,i,a),ta("target",c,u,e,s,l),t.set(r.id,r)}}o(Yi,"updateConnectionLookup");function Ea(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Ea(n,t):!1}o(Ea,"isParentSelected");function na(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}o(na,"hasSelector");function hf(e,t,n,r){let i=new Map;for(let[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!Ea(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){let l=e.get(s);l&&i.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 i}o(hf,"getDragItems");function bi({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[a,l]of t){let c=n.get(a)?.internals.userNode;c&&i.push({...c,position:l.position,dragging:r})}if(!e)return[i[0],i];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}o(bi,"getEventHandlerParams");function pf({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:r-i.distance.y},a=an(s,t);return{x:a.x-s.x,y:a.y-s.y}}o(pf,"calculateSnapOffset");function Ca({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,v=null;function b({noDragClassName:E,handleSelector:g,domNode:w,isSelectable:M,nodeId:_,nodeClickDistance:k=0}){h=Ee(w);function P({x:V,y:L}){let{nodeLookup:x,nodeExtent:S,snapGrid:C,snapToGrid:I,nodeOrigin:O,onNodeDrag:A,onSelectionDrag:B,onError:F,updateNodePositions:H}=t();s={x:V,y:L};let U=!1,Z=l.size>1,X=Z&&S?Ei(rn(l)):null,j=Z&&I?pf({dragItems:l,snapGrid:C,x:V,y:L}):null;for(let[K,R]of l){if(!x.has(K))continue;let Y={x:V-R.distance.x,y:L-R.distance.y};I&&(Y=j?{x:Math.round(Y.x+j.x),y:Math.round(Y.y+j.y)}:an(Y,C));let te=null;if(Z&&S&&!R.extent&&X){let{positionAbsolute:G}=R.internals,ne=G.x-X.x+S[0][0],oe=G.x+R.measured.width-X.x2+S[1][0],se=G.y-X.y+S[0][1],le=G.y+R.measured.height-X.y2+S[1][1];te=[[ne,se],[oe,le]]}let{position:ee,positionAbsolute:q}=Pi({nodeId:K,nextPosition:Y,nodeLookup:x,nodeExtent:te||S,nodeOrigin:O,onError:F});U=U||R.position.x!==ee.x||R.position.y!==ee.y,R.position=ee,R.internals.positionAbsolute=q}if(m=m||U,!!U&&(H(l,!0),v&&(r||A||!_&&B))){let[K,R]=bi({nodeId:_,dragItems:l,nodeLookup:x});r?.(v,l,K,R),A?.(v,K,R),_||B?.(v,R)}}o(P,"updateNodes");async function T(){if(!d)return;let{transform:V,panBy:L,autoPanSpeed:x,autoPanOnNodeDrag:S}=t();if(!S){c=!1,cancelAnimationFrame(a);return}let[C,I]=Ao(u,d,x);(C!==0||I!==0)&&(s.x=(s.x??0)-C/V[2],s.y=(s.y??0)-I/V[2],await L({x:C,y:I})&&P(s)),a=requestAnimationFrame(T)}o(T,"autoPan");function W(V){let{nodeLookup:L,multiSelectionActive:x,nodesDraggable:S,transform:C,snapGrid:I,snapToGrid:O,selectNodesOnDrag:A,onNodeDragStart:B,onSelectionDragStart:F,unselectNodesAndEdges:H}=t();f=!0,(!A||!M)&&!x&&_&&(L.get(_)?.selected||H()),M&&A&&_&&e?.(_);let U=qn(V.sourceEvent,{transform:C,snapGrid:I,snapToGrid:O,containerBounds:d});if(s=U,l=hf(L,S,U,_),l.size>0&&(n||B||!_&&F)){let[Z,X]=bi({nodeId:_,dragItems:l,nodeLookup:L});n?.(V.sourceEvent,l,Z,X),B?.(V.sourceEvent,Z,X),_||F?.(V.sourceEvent,X)}}o(W,"startDrag");let $=zn().clickDistance(k).on("start",V=>{let{domNode:L,nodeDragThreshold:x,transform:S,snapGrid:C,snapToGrid:I}=t();d=L?.getBoundingClientRect()||null,p=!1,m=!1,v=V.sourceEvent,x===0&&W(V),s=qn(V.sourceEvent,{transform:S,snapGrid:C,snapToGrid:I,containerBounds:d}),u=He(V.sourceEvent,d)}).on("drag",V=>{let{autoPanOnNodeDrag:L,transform:x,snapGrid:S,snapToGrid:C,nodeDragThreshold:I,nodeLookup:O}=t(),A=qn(V.sourceEvent,{transform:x,snapGrid:S,snapToGrid:C,containerBounds:d});if(v=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||_&&!O.has(_))&&(p=!0),!p){if(!c&&L&&f&&(c=!0,T()),!f){let B=He(V.sourceEvent,d),F=B.x-u.x,H=B.y-u.y;Math.sqrt(F*F+H*H)>I&&W(V)}(s.x!==A.xSnapped||s.y!==A.ySnapped)&&l&&f&&(u=He(V.sourceEvent,d),P(A))}}).on("end",V=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){let{nodeLookup:L,updateNodePositions:x,onNodeDragStop:S,onSelectionDragStop:C}=t();if(m&&(x(l,!1),m=!1),i||S||!_&&C){let[I,O]=bi({nodeId:_,dragItems:l,nodeLookup:L,dragging:!1});i?.(V.sourceEvent,l,I,O),S?.(V.sourceEvent,I,O),_||C?.(V.sourceEvent,O)}}}).filter(V=>{let L=V.target;return!V.button&&(!E||!na(L,`.${E}`,w))&&(!g||na(L,g,w))});h.call($)}o(b,"update");function y(){h?.on(".drag",null)}return o(y,"destroy"),{update:b,destroy:y}}o(Ca,"XYDrag");function mf(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())Qn(i,sn(s))>0&&r.push(s);return r}o(mf,"getNodesWithinDistance");var gf=250;function yf(e,t,n,r){let i=[],s=1/0,a=mf(e,n,t+gf);for(let l of a){let c=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(let u of c){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;let{x:d,y:f}=St(l,u,u.position,!0),h=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(f-e.y,2));h>t||(h<s?(i=[{...u,x:d,y:f}],s=h):h===s&&i.push({...u,x:d,y:f}))}}if(!i.length)return null;if(i.length>1){let l=r.type==="source"?"target":"source";return i.find(c=>c.type===l)??i[0]}return i[0]}o(yf,"getClosestHandle");function _a(e,t,n,r,i,s=!1){let a=r.get(e);if(!a)return null;let l=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],c=(n?l?.find(u=>u.id===n):l?.[0])??null;return c&&s?{...c,...St(a,c,c.position,!0)}:c}o(_a,"getHandle");function Na(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}o(Na,"getHandleType");function xf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}o(xf,"isConnectionValid");var Ia=o(()=>!0,"alwaysValid");function wf(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:v,onConnectEnd:b,isValidConnection:y=Ia,onReconnectEnd:E,updateConnection:g,getTransform:w,getFromHandle:M,autoPanSpeed:_,dragThreshold:k=1,handleDomNode:P}){let T=Ri(e.target),W=0,$,{x:V,y:L}=He(e),x=Na(s,P),S=l?.getBoundingClientRect(),C=!1;if(!S||!x)return;let I=_a(i,x,r,c,t);if(!I)return;let O=He(e,S),A=!1,B=null,F=!1,H=null;function U(){if(!d||!S)return;let[ee,q]=Ao(O,S,_);h({x:ee,y:q}),W=requestAnimationFrame(U)}o(U,"autoPan");let Z={...I,nodeId:i,type:x,position:I.position},X=c.get(i),K={inProgress:!0,isValid:null,from:St(X,Z,J.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:X,to:O,toHandle:null,toPosition:Zs[Z.position],toNode:null,pointer:O};function R(){C=!0,g(K),m?.(e,{nodeId:i,handleId:r,handleType:x})}o(R,"startConnection"),k===0&&R();function Y(ee){if(!C){let{x:le,y:ve}=He(ee),he=le-V,pe=ve-L;if(!(he*he+pe*pe>k*k))return;R()}if(!M()||!Z){te(ee);return}let q=w();O=He(ee,S),$=yf(ln(O,q,!1,[1,1]),n,c,Z),A||(U(),A=!0);let G=Ma(ee,{handle:$,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:T,lib:u,flowId:f,nodeLookup:c});H=G.handleDomNode,B=G.connection,F=xf(!!$,G.isValid);let ne=c.get(i),oe=ne?St(ne,Z,J.Left,!0):K.from,se={...K,from:oe,isValid:F,to:G.toHandle&&F?$t({x:G.toHandle.x,y:G.toHandle.y},q):O,toHandle:G.toHandle,toPosition:F&&G.toHandle?G.toHandle.position:Zs[Z.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:O};g(se),K=se}o(Y,"onPointerMove");function te(ee){if(!("touches"in ee&&ee.touches.length>0)){if(C){($||H)&&B&&F&&v?.(B);let{inProgress:q,...G}=K,ne={...G,toPosition:K.toHandle?K.toPosition:null};b?.(ee,ne),s&&E?.(ee,ne)}p(),cancelAnimationFrame(W),A=!1,F=!1,B=null,H=null,T.removeEventListener("mousemove",Y),T.removeEventListener("mouseup",te),T.removeEventListener("touchmove",Y),T.removeEventListener("touchend",te)}}o(te,"onPointerUp"),T.addEventListener("mousemove",Y),T.addEventListener("mouseup",te),T.addEventListener("touchmove",Y),T.addEventListener("touchend",te)}o(wf,"onPointerDown");function Ma(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=Ia,nodeLookup:d}){let f=s==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=He(e),v=a.elementFromPoint(p,m),b=v?.classList.contains(`${l}-flow__handle`)?v:h,y={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){let E=Na(void 0,b),g=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),M=b.classList.contains("connectable"),_=b.classList.contains("connectableend");if(!g||!E)return y;let k={source:f?g:r,sourceHandle:f?w:i,target:f?r:g,targetHandle:f?i:w};y.connection=k;let T=M&&_&&(n===vt.Strict?f&&E==="source"||!f&&E==="target":g!==r||w!==i);y.isValid=T&&u(k),y.toHandle=_a(g,E,w,d,n,!0)}return y}o(Ma,"isValidHandle");var Fo={onPointerDown:wf,isValid:Ma};function ka({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=Ee(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){let m=o(g=>{if(g.sourceEvent.type!=="wheel"||!t)return;let w=n(),M=g.sourceEvent.ctrlKey&&cn()?10:1,_=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*d,k=w[2]*Math.pow(2,_*M);t.scaleTo(k)},"zoomHandler"),v=[0,0],b=o(g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},"panStartHandler"),y=o(g=>{let w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;let M=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],_=[M[0]-v[0],M[1]-v[1]];v=M;let k=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),P={x:w[0]-_[0]*k,y:w[1]-_[1]*k},T=[[0,0],[c,u]];t.setViewportConstrained({x:P.x,y:P.y,zoom:w[2]},T,l)},"panHandler"),E=Un().on("start",b).on("zoom",f?y:null).on("zoom.wheel",h?m:null);i.call(E,{})}o(s,"update");function a(){i.on("zoom",null)}return o(a,"destroy"),{update:s,destroy:a,pointer:Me}}o(ka,"XYMinimap");var Wo=o(e=>({x:e.x,y:e.y,zoom:e.k}),"transformToViewport"),vi=o(({x:e,y:t,zoom:n})=>At.translate(e,t).scale(n),"viewportToTransform"),en=o((e,t)=>e.target.closest(`.${t}`),"isWrappedWithClass"),Pa=o((e,t)=>t===2&&Array.isArray(e)&&e.includes(2),"isRightClickPan"),bf=o(e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,"defaultEase"),Si=o((e,t=0,n=bf,r=()=>{})=>{let i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},"getD3Transition"),Ta=o(e=>{let t=e.ctrlKey&&cn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},"wheelDelta");function vf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(en(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let f=n.property("__zoom").k||1;if(d.ctrlKey&&a){let b=Me(d),y=Ta(d),E=f*Math.pow(2,y);r.scaleTo(n,E,b,d);return}let h=d.deltaMode===1?20:1,p=i===et.Vertical?0:d.deltaX*h,m=i===et.Horizontal?0:d.deltaY*h;!cn()&&d.shiftKey&&i!==et.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*s,-(m/f)*s,{internal:!0});let v=Wo(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(d,v):(e.isPanScrolling=!0,l?.(d,v)),e.panScrollTimeout=setTimeout(()=>{u?.(d,v),e.isPanScrolling=!1},150)}}o(vf,"createPanOnScrollHandler");function Sf({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,l=en(r,e);if(r.ctrlKey&&s&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,i)}}o(Sf,"createZoomOnScrollHandler");function Ef({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Wo(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}o(Ef,"createPanZoomStartHandler");function Cf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&Pa(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Wo(s.transform))}}o(Cf,"createPanZoomHandler");function _f({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Pa(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let l=Wo(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,l)},n?150:0)}}}o(_f,"createPanZoomEndHandler");function Nf({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{let h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(en(f,`${u}-flow__node`)||en(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!i&&!s&&!n||a||d&&!m||en(f,l)&&m||en(f,c)&&(!m||i&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!h&&!i&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;let v=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&v}}o(Nf,"createFilter");function Aa({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=[[0,0],[d.width,d.height]];(typeof ResizeObserver<"u"?new ResizeObserver(L=>{let x=L[0];x&&(f=[[0,0],[x.contentRect.width,x.contentRect.height]])}):null)?.observe(e);let p=Un().extent(()=>f).scaleExtent([t,n]).translateExtent(r),m=Ee(e).call(p);w({x:i.x,y:i.y,zoom:nn(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let v=m.on("wheel.zoom"),b=m.on("dblclick.zoom");p.wheelDelta(Ta);async function y(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).transform(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(y,"setTransform");function E({noWheelClassName:L,noPanClassName:x,onPaneContextMenu:S,userSelectionActive:C,panOnScroll:I,panOnDrag:O,panOnScrollMode:A,panOnScrollSpeed:B,preventScrolling:F,zoomOnPinch:H,zoomOnScroll:U,zoomOnDoubleClick:Z,zoomActivationKeyPressed:X,lib:j,onTransformChange:K,connectionInProgress:R,paneClickDistance:Y,selectionOnDrag:te}){C&&!u.isZoomingOrPanning&&g();let ee=I&&!X&&!C;p.clickDistance(te?1/0:!Le(Y)||Y<0?0:Y);let q=ee?vf({zoomPanValues:u,noWheelClassName:L,d3Selection:m,d3Zoom:p,panOnScrollMode:A,panOnScrollSpeed:B,zoomOnPinch:H,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):Sf({noWheelClassName:L,preventScrolling:F,d3ZoomHandler:v});m.on("wheel.zoom",q,{passive:!1});let G=Ef({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});p.on("start",G);let ne=Cf({zoomPanValues:u,panOnDrag:O,onPaneContextMenu:!!S,onPanZoom:s,onTransformChange:K});p.on("zoom",ne);let oe=_f({zoomPanValues:u,panOnDrag:O,panOnScroll:I,onPaneContextMenu:S,onPanZoomEnd:l,onDraggingChange:c});p.on("end",oe);let se=Nf({zoomActivationKeyPressed:X,panOnDrag:O,zoomOnScroll:U,panOnScroll:I,zoomOnDoubleClick:Z,zoomOnPinch:H,userSelectionActive:C,noPanClassName:x,noWheelClassName:L,lib:j,connectionInProgress:R});p.filter(se),Z?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}o(E,"update");function g(){p.on("zoom",null)}o(g,"destroy");async function w(L,x,S){let C=vi(L),I=p?.constrain()(C,x,S);return I&&await y(I),I}o(w,"setViewportConstrained");async function M(L,x){let S=vi(L);return await y(S,x),S}o(M,"setViewport");function _(L){if(m){let x=vi(L),S=m.property("__zoom");(S.k!==L.zoom||S.x!==L.x||S.y!==L.y)&&p?.transform(m,x,null,{sync:!0})}}o(_,"syncViewport");function k(){let L=m?Zn(m.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}o(k,"getViewport");async function P(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).scaleTo(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(P,"scaleTo");async function T(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).scaleBy(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(T,"scaleBy");function W(L){p?.scaleExtent(L)}o(W,"setScaleExtent");function $(L){p?.translateExtent(L)}o($,"setTranslateExtent");function V(L){let x=!Le(L)||L<0?0:L;p?.clickDistance(x)}return o(V,"setClickDistance"),{update:E,destroy:g,setViewport:M,setViewportConstrained:w,getViewport:k,scaleTo:P,scaleBy:T,setScaleExtent:W,setTranslateExtent:$,syncViewport:_,setClickDistance:V}}o(Aa,"XYPanZoom");var Et;(function(e){e.Line="line",e.Handle="handle"})(Et||(Et={}));function If({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){let a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}o(If,"getResizeDirection");function oa(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}o(oa,"getControlDirection");function wt(e,t){return Math.max(0,t-e)}o(wt,"getLowerExtentClamp");function bt(e,t){return Math.max(0,e-t)}o(bt,"getUpperExtentClamp");function ko(e,t,n){return Math.max(0,t-e,e-n)}o(ko,"getSizeClamp");function ra(e,t){return e?!t:t}o(ra,"xor");function Mf(e,t,n,r,i,s,a,l){let{affectsX:c,affectsY:u}=t,{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:v,maxWidth:b,minHeight:y,maxHeight:E}=r,{x:g,y:w,width:M,height:_,aspectRatio:k}=e,P=Math.floor(d?p-e.pointerX:0),T=Math.floor(f?m-e.pointerY:0),W=M+(c?-P:P),$=_+(u?-T:T),V=-s[0]*M,L=-s[1]*_,x=ko(W,v,b),S=ko($,y,E);if(a){let O=0,A=0;c&&P<0?O=wt(g+P+V,a[0][0]):!c&&P>0&&(O=bt(g+W+V,a[1][0])),u&&T<0?A=wt(w+T+L,a[0][1]):!u&&T>0&&(A=bt(w+$+L,a[1][1])),x=Math.max(x,O),S=Math.max(S,A)}if(l){let O=0,A=0;c&&P>0?O=bt(g+P,l[0][0]):!c&&P<0&&(O=wt(g+W,l[1][0])),u&&T>0?A=bt(w+T,l[0][1]):!u&&T<0&&(A=wt(w+$,l[1][1])),x=Math.max(x,O),S=Math.max(S,A)}if(i){if(d){let O=ko(W/k,y,E)*k;if(x=Math.max(x,O),a){let A=0;!c&&!u||c&&!u&&h?A=bt(w+L+W/k,a[1][1])*k:A=wt(w+L+(c?P:-P)/k,a[0][1])*k,x=Math.max(x,A)}if(l){let A=0;!c&&!u||c&&!u&&h?A=wt(w+W/k,l[1][1])*k:A=bt(w+(c?P:-P)/k,l[0][1])*k,x=Math.max(x,A)}}if(f){let O=ko($*k,v,b)/k;if(S=Math.max(S,O),a){let A=0;!c&&!u||u&&!c&&h?A=bt(g+$*k+V,a[1][0])/k:A=wt(g+(u?T:-T)*k+V,a[0][0])/k,S=Math.max(S,A)}if(l){let A=0;!c&&!u||u&&!c&&h?A=wt(g+$*k,l[1][0])/k:A=bt(g+(u?T:-T)*k,l[0][0])/k,S=Math.max(S,A)}}}T=T+(T<0?S:-S),P=P+(P<0?x:-x),i&&(h?W>$*k?T=(ra(c,u)?-P:P)/k:P=(ra(c,u)?-T:T)*k:d?(T=P/k,u=c):(P=T*k,c=u));let C=c?g+P:g,I=u?w+T:w;return{width:M+(c?-P:P),height:_+(u?-T:T),x:s[0]*P*(c?-1:1)+C,y:s[1]*T*(u?-1:1)+I}}o(Mf,"getDimensionsAfterResize");var Da={width:0,height:0,x:0,y:0},kf={...Da,pointerX:0,pointerY:0,aspectRatio:1};function Pf(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,c=n[1]*a;return[[r-l,i-c],[r+s-l,i+a-c]]}o(Pf,"nodeToChildExtent");function za({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let s=Ee(e),a={controlDirection:oa("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:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:v,shouldResize:b}){let y={...Da},E={...kf};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:oa(u)};let g,w=null,M=[],_,k,P,T=!1,W=zn().on("start",$=>{let{nodeLookup:V,transform:L,snapGrid:x,snapToGrid:S,nodeOrigin:C,paneDomNode:I}=n();if(g=V.get(t),!g)return;w=I?.getBoundingClientRect()??null;let{xSnapped:O,ySnapped:A}=qn($.sourceEvent,{transform:L,snapGrid:x,snapToGrid:S,containerBounds:w});y={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},E={...y,pointerX:O,pointerY:A,aspectRatio:y.width/y.height},_=void 0,k=Rt(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(_=V.get(g.parentId)),_&&g.extent==="parent"&&(k=[[0,0],[_.measured.width,_.measured.height]]),M=[],P=void 0;for(let[B,F]of V)if(F.parentId===t&&(M.push({id:B,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){let H=Pf(F,g,F.origin??C);P?P=[[Math.min(H[0][0],P[0][0]),Math.min(H[0][1],P[0][1])],[Math.max(H[1][0],P[1][0]),Math.max(H[1][1],P[1][1])]]:P=H}p?.($,{...y})}).on("drag",$=>{let{transform:V,snapGrid:L,snapToGrid:x,nodeOrigin:S}=n(),C=qn($.sourceEvent,{transform:V,snapGrid:L,snapToGrid:x,containerBounds:w}),I=[];if(!g)return;let{x:O,y:A,width:B,height:F}=y,H={},U=g.origin??S,{width:Z,height:X,x:j,y:K}=Mf(E,a.controlDirection,C,a.boundaries,a.keepAspectRatio,U,k,P),R=Z!==B,Y=X!==F,te=j!==O&&R,ee=K!==A&&Y;if(!te&&!ee&&!R&&!Y)return;if((te||ee||U[0]===1||U[1]===1)&&(H.x=te?j:y.x,H.y=ee?K:y.y,y.x=H.x,y.y=H.y,M.length>0)){let oe=j-O,se=K-A;for(let le of M)le.position={x:le.position.x-oe+U[0]*(Z-B),y:le.position.y-se+U[1]*(X-F)},I.push(le)}if((R||Y)&&(H.width=R&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Z:y.width,H.height=Y&&(!a.resizeDirection||a.resizeDirection==="vertical")?X:y.height,y.width=H.width,y.height=H.height),_&&g.expandParent){let oe=U[0]*(H.width??0);H.x&&H.x<oe&&(y.x=oe,E.x=E.x-(H.x-oe));let se=U[1]*(H.height??0);H.y&&H.y<se&&(y.y=se,E.y=E.y-(H.y-se))}let q=If({width:y.width,prevWidth:B,height:y.height,prevHeight:F,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),G={...y,direction:q};b?.($,G)!==!1&&(T=!0,m?.($,G),r(H,I))}).on("end",$=>{T&&(v?.($,{...y}),i?.({...y}),T=!1)});s.call(W)}o(l,"update");function c(){s.on(".drag",null)}return o(c,"destroy"),{update:l,destroy:c}}o(za,"XYResizer");var La=mt(ar(),1),Ha=mt(nu(),1);var Oa=o(e=>{let t,n=new Set,r=o((d,f)=>{let h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){let p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},"setState"),i=o(()=>t,"getState"),c={setState:r,getState:i,getInitialState:o(()=>u,"getInitialState"),subscribe:o(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:o(()=>{(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()},"destroy")},u=t=e(r,i,c);return c},"createStoreImpl"),$a=o(e=>e?Oa(e):Oa,"createStore");var{useDebugValue:Tf}=La.default,{useSyncExternalStoreWithSelector:Af}=Ha.default,Df=o(e=>e,"identity");function Zi(e,t=Df,n){let r=Af(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Tf(r),r}o(Zi,"useStoreWithEqualityFn");var Ra=o((e,t)=>{let n=$a(e),r=o((i,s=t)=>Zi(n,i,s),"useBoundStoreWithEqualityFn");return Object.assign(r,n),r},"createWithEqualityFnImpl"),Ba=o((e,t)=>e?Ra(e,t):Ra,"createWithEqualityFn");function ue(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[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}o(ue,"shallow$1");var zf=mt(eu());var Uo=(0,D.createContext)(null),Of=Uo.Provider,hl=ze.error001("react");function ie(e,t){let n=(0,D.useContext)(Uo);if(n===null)throw new Error(hl);return Zi(n,e,t)}o(ie,"useStore");function de(){let e=(0,D.useContext)(Uo);if(e===null)throw new Error(hl);return(0,D.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}o(de,"useStoreApi");var Va={display:"none"},$f={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pl="react-flow__node-desc",ml="react-flow__edge-desc",Rf="react-flow__aria-live",Lf=o(e=>e.ariaLiveMessage,"ariaLiveSelector"),Hf=o(e=>e.ariaLabelConfig,"ariaLabelConfigSelector");function Bf({rfId:e}){let t=ie(Lf);return(0,z.jsx)("div",{id:`${Rf}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:$f,children:t})}o(Bf,"AriaLiveMessage");function Vf({rfId:e,disableKeyboardA11y:t}){let n=ie(Hf);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{id:`${pl}-${e}`,style:Va,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,z.jsx)("div",{id:`${ml}-${e}`,style:Va,children:n["edge.a11yDescription.default"]}),!t&&(0,z.jsx)(Bf,{rfId:e})]})}o(Vf,"A11yDescriptions");var _t=(0,D.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{let a=`${e}`.split("-");return(0,z.jsx)("div",{className:ge(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});_t.displayName="Panel";var Fa="https://reactflow.dev?utm_source=attribution";function Ff({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,z.jsx)(_t,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Fa}`,children:(0,z.jsx)("a",{href:Fa,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o(Ff,"Attribution");var Wf=o(e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},"selector$l"),Xo=o(e=>e.id,"selectId");function Xf(e,t){return ue(e.selectedNodes.map(Xo),t.selectedNodes.map(Xo))&&ue(e.selectedEdges.map(Xo),t.selectedEdges.map(Xo))}o(Xf,"areEqual$1");function Yf({onSelectionChange:e}){let t=de(),{selectedNodes:n,selectedEdges:r}=ie(Wf,Xf);return(0,D.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}o(Yf,"SelectionListenerInner");var Zf=o(e=>!!e.onSelectionChangeHandlers,"changeSelector");function Uf({onSelectionChange:e}){let t=ie(Zf);return e||t?(0,z.jsx)(Yf,{onSelectionChange:e}):null}o(Uf,"SelectionListener");var gl=[0,0],qf={x:0,y:0,zoom:1},Gf=["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"],Wa=[...Gf,"rfId"],Kf=o(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}),"selector$k"),Xa={translateExtent:on,nodeOrigin:gl,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Qf(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=ie(Kf,ue),u=de();(0,D.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Xa,l()}),[]);let d=(0,D.useRef)(Xa);return(0,D.useEffect)(()=>{for(let f of Wa){let h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:fa(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Wa.map(f=>e[f])),null}o(Qf,"StoreUpdater");function Ya(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}o(Ya,"getMediaQuery");function Jf(e){let[t,n]=(0,D.useState)(e==="system"?null:e);return(0,D.useEffect)(()=>{if(e!=="system"){n(e);return}let r=Ya(),i=o(()=>n(r?.matches?"dark":"light"),"updateColorModeClass");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:Ya()?.matches?"dark":"light"}o(Jf,"useColorModeClass");var Za=typeof document<"u"?document:null;function jn(e=null,t={target:Za,actInsideInputWithModifier:!0}){let[n,r]=(0,D.useState)(!1),i=(0,D.useRef)(!1),s=(0,D.useRef)(new Set([])),[a,l]=(0,D.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
|
|
2
|
+
`).replace(`
|
|
3
|
+
|
|
4
|
+
`,`
|
|
5
|
+
+`).split(`
|
|
6
|
+
`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return(0,D.useEffect)(()=>{let c=t?.target??Za,u=t?.actInsideInputWithModifier??!0;if(e!==null){let d=o(p=>{if(i.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!i.current||i.current&&!u)&&Li(p))return!1;let v=qa(p.code,l);if(s.current.add(p[v]),Ua(a,s.current,!1)){let b=p.composedPath?.()?.[0]||p.target,y=b?.nodeName==="BUTTON"||b?.nodeName==="A";t.preventDefault!==!1&&(i.current||!y)&&p.preventDefault(),r(!0)}},"downHandler"),f=o(p=>{let m=qa(p.code,l);Ua(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(p[m]),p.key==="Meta"&&s.current.clear(),i.current=!1},"upHandler"),h=o(()=>{s.current.clear(),r(!1)},"resetHandler");return c?.addEventListener("keydown",d),c?.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c?.removeEventListener("keydown",d),c?.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}o(jn,"useKeyPress");function Ua(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}o(Ua,"isMatchingKey");function qa(e,t){return t.includes(e)?"code":"key"}o(qa,"useKeyOrCode");var jf=o(()=>{let e=de();return(0,D.useMemo)(()=>({zoomIn:o(async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},"zoomIn"),zoomOut:o(async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},"zoomOut"),zoomTo:o(async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},"zoomTo"),getZoom:o(()=>e.getState().transform[2],"getZoom"),setViewport:o(async(t,n)=>{let{transform:[r,i,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},n),!0):!1},"setViewport"),getViewport:o(()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},"getViewport"),setCenter:o(async(t,n,r)=>e.getState().setCenter(t,n,r),"setCenter"),fitBounds:o(async(t,n)=>{let{width:r,height:i,minZoom:s,maxZoom:a,panZoom:l}=e.getState(),c=Lt(t,r,i,s,a,n?.padding??.1);return l?(await l.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},"fitBounds"),screenToFlowPosition:o((t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:s,domNode:a}=e.getState();if(!a)return t;let{x:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??i,f=n.snapToGrid??s;return ln(u,r,f,d)},"screenToFlowPosition"),flowToScreenPosition:o(t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:s}=r.getBoundingClientRect(),a=$t(t,n);return{x:a.x+i,y:a.y+s}},"flowToScreenPosition")}),[])},"useViewportHelper");function yl(e,t){let n=[],r=new Map,i=[];for(let s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{let a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(let s of t){let a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}let l={...s};for(let c of a)eh(c,l);n.push(l)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}o(yl,"applyChanges");function eh(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}o(eh,"applyChange");function xl(e,t){return yl(e,t)}o(xl,"applyNodeChanges");function wl(e,t){return yl(e,t)}o(wl,"applyEdgeChanges");function Ht(e,t){return{id:e,type:"select",selected:t}}o(Ht,"createSelectionChange");function un(e,t=new Set,n=!1){let r=[];for(let[i,s]of e){let a=t.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push(Ht(s.id,a)))}return r}o(un,"getSelectionChanges");function Ga({items:e=[],lookup:t}){let n=[],r=new Map(e.map(i=>[i.id,i]));for(let[i,s]of e.entries()){let a=t.get(s.id),l=a?.internals?.userNode??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:i})}for(let[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}o(Ga,"getElementsDiffChanges");function Ka(e){return{id:e.id,type:"remove"}}o(Ka,"elementToRemoveChange");var th=Di("React Flow","https://reactflow.dev/");function nh(e,t,n={}){return ma(e,t,{...n,onError:n.onError??th})}o(nh,"addEdge");var Qa=o(e=>ia(e),"isNode"),oh=o(e=>Mi(e),"isEdge");function bl(e){return(0,D.forwardRef)(e)}o(bl,"fixedForwardRef");var vl=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Ja(e){let[t,n]=(0,D.useState)(BigInt(0)),[r]=(0,D.useState)(()=>rh(()=>n(i=>i+BigInt(1))));return vl(()=>{let i=r.get();i.length&&(e(i),r.reset())},[t]),r}o(Ja,"useQueue");function rh(e){let t=[];return{get:o(()=>t,"get"),reset:o(()=>{t=[]},"reset"),push:o(n=>{t.push(n),e()},"push")}}o(rh,"createQueue");var Sl=(0,D.createContext)(null);function ih({children:e}){let t=de(),n=(0,D.useCallback)(l=>{let{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState(),v=c;for(let y of l)v=typeof y=="function"?y(v):y;let b=Ga({items:v,lookup:h});for(let y of m.values())b=y(b);d&&u(v),b.length>0?f?.(b):p&&window.requestAnimationFrame(()=>{let{fitViewQueued:y,nodes:E,setNodes:g}=t.getState();y&&g(E)})},[]),r=Ja(n),i=(0,D.useCallback)(l=>{let{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState(),p=c;for(let m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(Ga({items:p,lookup:h}))},[]),s=Ja(i),a=(0,D.useMemo)(()=>({nodeQueue:r,edgeQueue:s}),[]);return(0,z.jsx)(Sl.Provider,{value:a,children:e})}o(ih,"BatchProvider");function sh(){let e=(0,D.useContext)(Sl);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}o(sh,"useBatchContext");var ah=o(e=>!!e.panZoom,"selector$j");function eo(){let e=jf(),t=de(),n=sh(),r=ie(ah),i=(0,D.useMemo)(()=>{let s=o(f=>t.getState().nodeLookup.get(f),"getInternalNode"),a=o(f=>{n.nodeQueue.push(f)},"setNodes"),l=o(f=>{n.edgeQueue.push(f)},"setEdges"),c=o(f=>{let{nodeLookup:h,nodeOrigin:p}=t.getState(),m=Qa(f)?f:h.get(f.id),v=m.parentId?Oi(m.position,m.measured,m.parentId,h,p):m.position,b={...m,position:v,width:m.measured?.width??m.width,height:m.measured?.height??m.height};return sn(b)},"getNodeRect"),u=o((f,h,p={replace:!1})=>{a(m=>m.map(v=>{if(v.id===f){let b=typeof h=="function"?h(v):h;return p.replace&&Qa(b)?b:{...v,...b}}return v}))},"updateNode"),d=o((f,h,p={replace:!1})=>{l(m=>m.map(v=>{if(v.id===f){let b=typeof h=="function"?h(v):h;return p.replace&&oh(b)?b:{...v,...b}}return v}))},"updateEdge");return{getNodes:o(()=>t.getState().nodes.map(f=>({...f})),"getNodes"),getNode:o(f=>s(f)?.internals.userNode,"getNode"),getInternalNode:s,getEdges:o(()=>{let{edges:f=[]}=t.getState();return f.map(h=>({...h}))},"getEdges"),getEdge:o(f=>t.getState().edgeLookup.get(f),"getEdge"),setNodes:a,setEdges:l,addNodes:o(f=>{let h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},"addNodes"),addEdges:o(f=>{let h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},"addEdges"),toObject:o(()=>{let{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,v,b]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:m,y:v,zoom:b}}},"toObject"),deleteElements:o(async({nodes:f=[],edges:h=[]})=>{let{nodes:p,edges:m,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:y,triggerEdgeChanges:E,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:M,edges:_}=await la({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:w}),k=_.length>0,P=M.length>0;if(k){let T=_.map(Ka);b?.(_),E(T)}if(P){let T=M.map(Ka);v?.(M),y(T)}return(P||k)&&g?.({nodes:M,edges:_}),{deletedNodes:M,deletedEdges:_}},"deleteElements"),getIntersectingNodes:o((f,h=!0,p)=>{let m=Ai(f),v=m?f:c(f),b=p!==void 0;return v?(p||t.getState().nodes).filter(y=>{let E=t.getState().nodeLookup.get(y.id);if(E&&!m&&(y.id===f.id||!E.internals.positionAbsolute))return!1;let g=sn(b?y:E),w=Qn(g,v);return h&&w>0||w>=g.width*g.height||w>=v.width*v.height}):[]},"getIntersectingNodes"),isNodeIntersecting:o((f,h,p=!0)=>{let v=Ai(f)?f:c(f);if(!v)return!1;let b=Qn(v,h);return p&&b>0||b>=h.width*h.height||b>=v.width*v.height},"isNodeIntersecting"),updateNode:u,updateNodeData:o((f,h,p={replace:!1})=>{u(f,m=>{let v=typeof h=="function"?h(m):h;return p.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},p)},"updateNodeData"),updateEdge:d,updateEdgeData:o((f,h,p={replace:!1})=>{d(f,m=>{let v=typeof h=="function"?h(m):h;return p.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},p)},"updateEdgeData"),getNodesBounds:o(f=>{let{nodeLookup:h,nodeOrigin:p}=t.getState();return Kn(f,{nodeLookup:h,nodeOrigin:p})},"getNodesBounds"),getHandleConnections:o(({type:f,id:h,nodeId:p})=>Array.from(t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`)?.values()??[]),"getHandleConnections"),getNodeConnections:o(({type:f,handleId:h,nodeId:p})=>Array.from(t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`)?.values()??[]),"getNodeConnections"),fitView:o(async f=>{let h=t.getState().fitViewResolver??da();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise},"fitView")}},[]);return(0,D.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}o(eo,"useReactFlow");var ja=o(e=>e.selected,"selected"),lh=typeof window<"u"?window:void 0;function ch({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=de(),{deleteElements:r}=eo(),i=jn(e,{actInsideInputWithModifier:!1}),s=jn(t,{target:lh});(0,D.useEffect)(()=>{if(i){let{edges:a,nodes:l}=n.getState();r({nodes:l.filter(ja),edges:a.filter(ja)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,D.useEffect)(()=>{n.setState({multiSelectionActive:s})},[s])}o(ch,"useGlobalKeyHandler");function uh(e){let t=de();(0,D.useEffect)(()=>{let n=o(()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let r=Oo(e.current);(r.height===0||r.width===0)&&t.getState().onError?.("004",ze.error004()),t.setState({width:r.width||500,height:r.height||500})},"updateDimensions");if(e.current){n(),window.addEventListener("resize",n);let r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}o(uh,"useResizeHandler");var qo={position:"absolute",width:"100%",height:"100%",top:0,left:0},dh=o(e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress}),"selector$i");function fh({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=et.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:v,noPanClassName:b,onViewportChange:y,isControlledViewport:E,paneClickDistance:g,selectionOnDrag:w}){let M=de(),_=(0,D.useRef)(null),{userSelectionActive:k,lib:P,connectionInProgress:T}=ie(dh,ue),W=jn(h),$=(0,D.useRef)();uh(_);let V=(0,D.useCallback)(L=>{y?.({x:L[0],y:L[1],zoom:L[2]}),E||M.setState({transform:L})},[y,E]);return(0,D.useEffect)(()=>{if(_.current){$.current=Aa({domNode:_.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:o(C=>M.setState(I=>I.paneDragging===C?I:{paneDragging:C}),"onDraggingChange"),onPanZoomStart:o((C,I)=>{let{onViewportChangeStart:O,onMoveStart:A}=M.getState();A?.(C,I),O?.(I)},"onPanZoomStart"),onPanZoom:o((C,I)=>{let{onViewportChange:O,onMove:A}=M.getState();A?.(C,I),O?.(I)},"onPanZoom"),onPanZoomEnd:o((C,I)=>{let{onViewportChangeEnd:O,onMoveEnd:A}=M.getState();A?.(C,I),O?.(I)},"onPanZoomEnd")});let{x:L,y:x,zoom:S}=$.current.getViewport();return M.setState({panZoom:$.current,transform:[L,x,S],domNode:_.current.closest(".react-flow")}),()=>{$.current?.destroy()}}},[]),(0,D.useEffect)(()=>{$.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:W,preventScrolling:p,noPanClassName:b,userSelectionActive:k,noWheelClassName:v,lib:P,onTransformChange:V,connectionInProgress:T,selectionOnDrag:w,paneClickDistance:g})},[e,t,n,r,i,s,a,l,W,p,b,k,v,P,V,T,w,g]),(0,z.jsx)("div",{className:"react-flow__renderer",ref:_,style:qo,children:m})}o(fh,"ZoomPane");var hh=o(e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect}),"selector$h");function ph(){let{userSelectionActive:e,userSelectionRect:t}=ie(hh,ue);return e&&t?(0,z.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}o(ph,"UserSelection");var Ui=o((e,t)=>n=>{n.target===t.current&&e?.(n)},"wrapHandler"),mh=o(e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed}),"selector$g");function gh({isSelecting:e,selectionKeyPressed:t,selectionMode:n=zt.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:v}){let b=(0,D.useRef)(0),y=de(),{userSelectionActive:E,elementsSelectable:g,dragging:w,panBy:M,autoPanSpeed:_}=ie(mh,ue),k=g&&(e||E),P=(0,D.useRef)(null),T=(0,D.useRef)(),W=(0,D.useRef)(new Set),$=(0,D.useRef)(new Set),V=(0,D.useRef)(!1),L=(0,D.useRef)(!1),x=(0,D.useRef)({x:0,y:0}),S=(0,D.useRef)(!1),C=o(R=>{if(L.current||V.current||y.getState().connection.inProgress){L.current=!1,V.current=!1;return}u?.(R),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},"onClick"),I=o(R=>{if(Array.isArray(r)&&r?.includes(2)){R.preventDefault();return}d?.(R)},"onContextMenu"),O=f?R=>f(R):void 0,A=o(R=>{L.current&&(R.stopPropagation(),L.current=!1)},"onClickCapture"),B=o(R=>{let{domNode:Y,transform:te}=y.getState();if(T.current=Y?.getBoundingClientRect(),!T.current)return;let ee=R.target===P.current;if(!ee&&!!R.target.closest(".nokey")||!e||!(a&&ee||t)||R.button!==0||!R.isPrimary)return;R.target?.setPointerCapture?.(R.pointerId),L.current=!1;let{x:ne,y:oe}=He(R.nativeEvent,T.current),se=ln({x:ne,y:oe},te);y.setState({userSelectionRect:{width:0,height:0,startX:se.x,startY:se.y,x:ne,y:oe}}),ee||(R.stopPropagation(),R.preventDefault())},"onPointerDownCapture");function F(R,Y){let{userSelectionRect:te}=y.getState();if(!te)return;let{transform:ee,nodeLookup:q,edgeLookup:G,connectionLookup:ne,triggerNodeChanges:oe,triggerEdgeChanges:se,defaultEdgeOptions:le}=y.getState(),ve={x:te.startX,y:te.startY},{x:he,y:pe}=$t(ve,ee),xe={startX:ve.x,startY:ve.y,x:R<he?R:he,y:Y<pe?Y:pe,width:Math.abs(R-he),height:Math.abs(Y-pe)},Pe=W.current,fe=$.current;W.current=new Set(To(q,xe,ee,n===zt.Partial,!0).map(me=>me.id)),$.current=new Set;let Se=le?.selectable??!0;for(let me of W.current){let we=ne.get(me);if(we)for(let{edgeId:be}of we.values()){let $e=G.get(be);$e&&($e.selectable??Se)&&$.current.add(be)}}if(!$i(Pe,W.current)){let me=un(q,W.current,!0);oe(me)}if(!$i(fe,$.current)){let me=un(G,$.current);se(me)}y.setState({userSelectionRect:xe,userSelectionActive:!0,nodesSelectionActive:!1})}o(F,"commitUserSelectionRect");function H(){if(!i||!T.current)return;let[R,Y]=Ao(x.current,T.current,_);M({x:R,y:Y}).then(te=>{if(!L.current||!te){b.current=requestAnimationFrame(H);return}let{x:ee,y:q}=x.current;F(ee,q),b.current=requestAnimationFrame(H)})}o(H,"autoPan");let U=o(()=>{cancelAnimationFrame(b.current),b.current=0,S.current=!1},"cleanupAutoPan");(0,D.useEffect)(()=>()=>U(),[]);let Z=o(R=>{let{userSelectionRect:Y,transform:te,resetSelectedElements:ee}=y.getState();if(!T.current||!Y)return;let{x:q,y:G}=He(R.nativeEvent,T.current);x.current={x:q,y:G};let ne=$t({x:Y.startX,y:Y.startY},te);if(!L.current){let oe=t?0:s;if(Math.hypot(q-ne.x,G-ne.y)<=oe)return;ee(),l?.(R)}L.current=!0,S.current||(H(),S.current=!0),F(q,G)},"onPointerMove"),X=o(R=>{if(!k){R.target===P.current&&y.getState().connection.inProgress&&(V.current=!0);return}R.button===0&&(R.target?.releasePointerCapture?.(R.pointerId),!E&&R.target===P.current&&y.getState().userSelectionRect&&C?.(R),y.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(c?.(R),y.setState({nodesSelectionActive:W.current.size>0})),U())},"onPointerUp"),j=o(R=>{R.target?.releasePointerCapture?.(R.pointerId),U()},"onPointerCancel"),K=r===!0||Array.isArray(r)&&r.includes(0);return(0,z.jsxs)("div",{className:ge(["react-flow__pane",{draggable:K,dragging:w,selection:e}]),onClick:k?void 0:Ui(C,P),onContextMenu:Ui(I,P),onWheel:Ui(O,P),onPointerEnter:k?void 0:h,onPointerMove:k?Z:p,onPointerUp:X,onPointerCancel:k?j:void 0,onPointerDownCapture:k?B:void 0,onClickCapture:k?A:void 0,onPointerLeave:m,ref:P,style:qo,children:[v,(0,z.jsx)(ph,{})]})}o(gh,"Pane");function Gi({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c?.("012",ze.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}o(Gi,"handleNodeClick");function El({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:a}){let l=de(),[c,u]=(0,D.useState)(!1),d=(0,D.useRef)();return(0,D.useEffect)(()=>{if(!t)return d.current=Ca({getStoreItems:o(()=>l.getState(),"getStoreItems"),onNodeMouseDown:o(f=>{Gi({id:f,store:l,nodeRef:e})},"onNodeMouseDown"),onDragStart:o(()=>{u(!0)},"onDragStart"),onDragStop:o(()=>{u(!1)},"onDragStop")}),()=>{d.current?.destroy(),d.current=void 0}},[t,l,e]),(0,D.useEffect)(()=>{t||!e.current||!d.current||d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:a})},[n,r,t,s,e,i,a]),c}o(El,"useDrag");var yh=o(e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u"),"selectedAndDraggable");function Cl(){let e=de();return(0,D.useCallback)(n=>{let{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=yh(a),p=i?s[0]:5,m=i?s[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*m*n.factor;for(let[,y]of u){if(!h(y))continue;let E={x:y.internals.positionAbsolute.x+v,y:y.internals.positionAbsolute.y+b};i&&(E=an(E,s));let{position:g,positionAbsolute:w}=Pi({nodeId:y.id,nextPosition:E,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});y.position=g,y.internals.positionAbsolute=w,f.set(y.id,y)}c(f)},[])}o(Cl,"useMoveSelectedNodes");var Ki=(0,D.createContext)(null),xh=Ki.Provider;Ki.Consumer;var _l=o(()=>(0,D.useContext)(Ki),"useNodeId"),wh=o(e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),"selector$f"),Nl=(0,D.createContext)(null);function bh({children:e}){let t=ie(wh,ue);return(0,z.jsx)(Nl.Provider,{value:t,children:e})}o(bh,"HandleConfigProvider");function vh(){let e=(0,D.useContext)(Nl);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}o(vh,"useHandleConfig");var Sh={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Eh=o((e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:s,connection:a}=r,{fromHandle:l,toHandle:c,isValid:u}=a;if(!l&&!i)return Sh;let d=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:l?.nodeId===e&&l?.id===t&&l?.type===n,connectingTo:d,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:s===vt.Strict?l?.type!==n:e!==l?.nodeId||t!==l?.id,connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:d&&u}},"connectingSelector");function Ch({type:e="source",position:t=J.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){let m=a||null,v=e==="target",b=de(),y=_l(),{connectOnClick:E,noPanClassName:g,rfId:w}=vh(),{connectingFrom:M,connectingTo:_,clickConnecting:k,isPossibleEndHandle:P,connectionInProcess:T,clickConnectionInProcess:W,valid:$}=ie(Eh(y,m,e),ue);y||b.getState().onError?.("010",ze.error010());let V=o(S=>{let{defaultEdgeOptions:C,onConnect:I,hasDefaultEdges:O}=b.getState(),A={...C,...S};if(O){let{edges:B,setEdges:F,onError:H}=b.getState();F(nh(A,B,{onError:H}))}I?.(A),l?.(A)},"onConnectExtended"),L=o(S=>{if(!y)return;let C=Hi(S.nativeEvent);if(i&&(C&&S.button===0||!C)){let I=b.getState();Fo.onPointerDown(S.nativeEvent,{handleDomNode:S.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:v,handleId:m,nodeId:y,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:o((...O)=>b.getState().onConnectEnd?.(...O),"onConnectEnd"),updateConnection:I.updateConnection,onConnect:V,isValidConnection:n||((...O)=>b.getState().isValidConnection?.(...O)??!0),getTransform:o(()=>b.getState().transform,"getTransform"),getFromHandle:o(()=>b.getState().connection.fromHandle,"getFromHandle"),autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}C?d?.(S):f?.(S)},"onPointerDown"),x=o(S=>{let{onClickConnectStart:C,onClickConnectEnd:I,connectionClickStartHandle:O,connectionMode:A,isValidConnection:B,lib:F,rfId:H,nodeLookup:U,connection:Z}=b.getState();if(!y||!O&&!i)return;if(!O){C?.(S.nativeEvent,{nodeId:y,handleId:m,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:y,type:e,id:m}});return}let X=Ri(S.target),j=n||B,{connection:K,isValid:R}=Fo.isValid(S.nativeEvent,{handle:{nodeId:y,id:m,type:e},connectionMode:A,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:j,flowId:H,doc:X,lib:F,nodeLookup:U});R&&K&&V(K);let Y=structuredClone(Z);delete Y.inProgress,Y.toPosition=Y.toHandle?Y.toHandle.position:null,I?.(S,Y),b.setState({connectionClickStartHandle:null})},"onClick");return(0,z.jsx)("div",{"data-handleid":m,"data-nodeid":y,"data-handlepos":t,"data-id":`${w}-${y}-${m}-${e}`,className:ge(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:s,clickconnecting:k,connectingfrom:M,connectingto:_,valid:$,connectionindicator:r&&(!T||P)&&(T||W?s:i)}]),onMouseDown:L,onTouchStart:L,onClick:E?x:void 0,ref:p,...h,children:c})}o(Ch,"HandleComponent");var Bt=(0,D.memo)(bl(Ch));function _h({data:e,isConnectable:t,sourcePosition:n=J.Bottom}){return(0,z.jsxs)(z.Fragment,{children:[e?.label,(0,z.jsx)(Bt,{type:"source",position:n,isConnectable:t})]})}o(_h,"InputNode");function Nh({data:e,isConnectable:t,targetPosition:n=J.Top,sourcePosition:r=J.Bottom}){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Bt,{type:"target",position:n,isConnectable:t}),e?.label,(0,z.jsx)(Bt,{type:"source",position:r,isConnectable:t})]})}o(Nh,"DefaultNode");function Ih(){return null}o(Ih,"GroupNode");function Mh({data:e,isConnectable:t,targetPosition:n=J.Top}){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Bt,{type:"target",position:n,isConnectable:t}),e?.label]})}o(Mh,"OutputNode");var Zo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},el={input:_h,default:Nh,output:Mh,group:Ih};function kh(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}o(kh,"getNodeInlineStyleDimensions");var Ph=o(e=>{let{width:t,height:n,x:r,y:i}=rn(e.nodeLookup,{filter:o(s=>!!s.selected,"filter")});return{width:Le(t)?t:null,height:Le(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}},"selector$e");function Th({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=de(),{width:i,height:s,transformString:a,userSelectionActive:l}=ie(Ph,ue),c=Cl(),u=(0,D.useRef)(null);(0,D.useEffect)(()=>{n||u.current?.focus({preventScroll:!0})},[n]);let d=!l&&i!==null&&s!==null;if(El({nodeRef:u,disabled:!d}),!d)return null;let f=e?p=>{let m=r.getState().nodes.filter(v=>v.selected);e(p,m)}:void 0,h=o(p=>{Object.prototype.hasOwnProperty.call(Zo,p.key)&&(p.preventDefault(),c({direction:Zo[p.key],factor:p.shiftKey?4:1}))},"onKeyDown");return(0,z.jsx)("div",{className:ge(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:(0,z.jsx)("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:s}})})}o(Th,"NodesSelection");var tl=typeof window<"u"?window:void 0,Ah=o(e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive}),"selector$d");function Il({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:y,zoomOnScroll:E,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:M,panOnScrollMode:_,zoomOnDoubleClick:k,panOnDrag:P,autoPanOnSelection:T,defaultViewport:W,translateExtent:$,minZoom:V,maxZoom:L,preventScrolling:x,onSelectionContextMenu:S,noWheelClassName:C,noPanClassName:I,disableKeyboardA11y:O,onViewportChange:A,isControlledViewport:B}){let{nodesSelectionActive:F,userSelectionActive:H}=ie(Ah,ue),U=jn(u,{target:tl}),Z=jn(v,{target:tl}),X=Z||P,j=Z||w,K=d&&X!==!0,R=U||H||K;return ch({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,z.jsx)(fh,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:E,zoomOnPinch:g,panOnScroll:j,panOnScrollSpeed:M,panOnScrollMode:_,zoomOnDoubleClick:k,panOnDrag:!U&&X,defaultViewport:W,translateExtent:$,minZoom:V,maxZoom:L,zoomActivationKeyCode:b,preventScrolling:x,noWheelClassName:C,noPanClassName:I,onViewportChange:A,isControlledViewport:B,paneClickDistance:l,selectionOnDrag:K,children:(0,z.jsxs)(gh,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:X,autoPanOnSelection:T,isSelecting:!!R,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:K,children:[e,F&&(0,z.jsx)(Th,{onSelectionContextMenu:S,noPanClassName:I,disableKeyboardA11y:O})]})})}o(Il,"FlowRendererComponent");Il.displayName="FlowRenderer";var Dh=(0,D.memo)(Il),zh=o(e=>t=>e?To(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys()),"selector$c");function Oh(e){return ie((0,D.useCallback)(zh(e),[e]),ue)}o(Oh,"useVisibleNodeIds");var $h=o(e=>e.updateNodeInternals,"selector$b");function Rh(){let e=ie($h),[t]=(0,D.useState)(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{let r=new Map;n.forEach(i=>{let s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return(0,D.useEffect)(()=>()=>{t?.disconnect()},[t]),t}o(Rh,"useResizeObserver");function Lh({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=de(),s=(0,D.useRef)(null),a=(0,D.useRef)(null),l=(0,D.useRef)(e.sourcePosition),c=(0,D.useRef)(e.targetPosition),u=(0,D.useRef)(t),d=n&&!!e.internals.handleBounds;return(0,D.useEffect)(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&r?.unobserve(a.current),r?.observe(s.current),a.current=s.current)},[d,e.hidden]),(0,D.useEffect)(()=>()=>{a.current&&(r?.unobserve(a.current),a.current=null)},[]),(0,D.useEffect)(()=>{if(s.current){let f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}o(Lh,"useNodeObserver");function Hh({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:v,nodeTypes:b,nodeClickDistance:y,onError:E}){let{node:g,internals:w,isParent:M}=ie(R=>{let Y=R.nodeLookup.get(e),te=R.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:te}},ue),_=g.type||"default",k=b?.[_]||el[_];k===void 0&&(E?.("003",ze.error003(_)),_="default",k=b?.default||el.default);let P=!!(g.draggable||l&&typeof g.draggable>"u"),T=!!(g.selectable||c&&typeof g.selectable>"u"),W=!!(g.connectable||u&&typeof g.connectable>"u"),$=!!(g.focusable||d&&typeof g.focusable>"u"),V=de(),L=zi(g),x=Lh({node:g,nodeType:_,hasDimensions:L,resizeObserver:f}),S=El({nodeRef:x,disabled:g.hidden||!P,noDragClassName:h,handleSelector:g.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:y}),C=Cl();if(g.hidden)return null;let I=Fe(g),O=kh(g),A=T||P||t||n||r||i,B=n?R=>n(R,{...w.userNode}):void 0,F=r?R=>r(R,{...w.userNode}):void 0,H=i?R=>i(R,{...w.userNode}):void 0,U=s?R=>s(R,{...w.userNode}):void 0,Z=a?R=>a(R,{...w.userNode}):void 0,X=o(R=>{let{selectNodesOnDrag:Y,nodeDragThreshold:te}=V.getState();T&&(!Y||!P||te>0)&&Gi({id:e,store:V,nodeRef:x}),t&&t(R,{...w.userNode})},"onSelectNodeHandler"),j=o(R=>{if(!(Li(R.nativeEvent)||m)){if(Ci.includes(R.key)&&T){let Y=R.key==="Escape";Gi({id:e,store:V,unselect:Y,nodeRef:x})}else if(P&&g.selected&&Object.prototype.hasOwnProperty.call(Zo,R.key)){R.preventDefault();let{ariaLabelConfig:Y}=V.getState();V.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:R.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),C({direction:Zo[R.key],factor:R.shiftKey?4:1})}}},"onKeyDown"),K=o(()=>{if(m||!x.current?.matches(":focus-visible"))return;let{transform:R,width:Y,height:te,autoPanOnNodeFocus:ee,setCenter:q}=V.getState();if(!ee)return;To(new Map([[e,g]]),{x:0,y:0,width:Y,height:te},R,!0).length>0||q(g.position.x+I.width/2,g.position.y+I.height/2,{zoom:R[2]})},"onFocus");return(0,z.jsx)("div",{className:ge(["react-flow__node",`react-flow__node-${_}`,{[p]:P},g.className,{selected:g.selected,selectable:T,parent:M,draggable:P,dragging:S}]),ref:x,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:L?"visible":"hidden",...g.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:F,onMouseLeave:H,onContextMenu:U,onClick:X,onDoubleClick:Z,onKeyDown:$?j:void 0,tabIndex:$?0:void 0,onFocus:$?K:void 0,role:g.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${pl}-${v}`,"aria-label":g.ariaLabel,...g.domAttributes,children:(0,z.jsx)(xh,{value:e,children:(0,z.jsx)(k,{id:e,data:g.data,type:_,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:g.selected??!1,selectable:T,draggable:P,deletable:g.deletable??!0,isConnectable:W,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:S,dragHandle:g.dragHandle,zIndex:w.z,parentId:g.parentId,...I})})})}o(Hh,"NodeWrapper");var Bh=(0,D.memo)(Hh),Vh=o(e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError}),"selector$a");function Ml(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=ie(Vh,ue),s=Oh(e.onlyRenderVisibleElements),a=Rh();return(0,z.jsx)("div",{className:"react-flow__nodes",style:qo,children:s.map(l=>(0,z.jsx)(Bh,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}o(Ml,"NodeRendererComponent");Ml.displayName="NodeRenderer";var Fh=(0,D.memo)(Ml);function Wh(e){return ie((0,D.useCallback)(n=>{if(!e)return n.edges.map(i=>i.id);let r=[];if(n.width&&n.height)for(let i of n.edges){let s=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);s&&a&&pa({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),ue)}o(Wh,"useVisibleEdgeIds");var Xh=o(({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,z.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},"ArrowSymbol"),Yh=o(({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,z.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},"ArrowClosedSymbol"),nl={[tn.Arrow]:Xh,[tn.ArrowClosed]:Yh};function Zh(e){let t=de();return(0,D.useMemo)(()=>Object.prototype.hasOwnProperty.call(nl,e)?nl[e]:(t.getState().onError?.("009",ze.error009(e)),null),[e])}o(Zh,"useMarkerSymbol");var Uh=o(({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{let c=Zh(t);return c?(0,z.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:(0,z.jsx)(c,{color:n,strokeWidth:a})}):null},"Marker"),kl=o(({defaultColor:e,rfId:t})=>{let n=ie(s=>s.edges),r=ie(s=>s.defaultEdgeOptions),i=(0,D.useMemo)(()=>ya(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,z.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,z.jsx)("defs",{children:i.map(s=>(0,z.jsx)(Uh,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null},"MarkerDefinitions");kl.displayName="MarkerDefinitions";var qh=(0,D.memo)(kl);function Pl({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){let[f,h]=(0,D.useState)({x:1,y:0,width:0,height:0}),p=ge(["react-flow__edge-textwrapper",u]),m=(0,D.useRef)(null);return(0,D.useEffect)(()=>{if(m.current){let v=m.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?(0,z.jsxs)("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[i&&(0,z.jsx)("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),(0,z.jsx)("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}o(Pl,"EdgeTextComponent");Pl.displayName="EdgeText";var Gh=(0,D.memo)(Pl);function Go({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("path",{...d,d:e,fill:"none",className:ge(["react-flow__edge-path",d.className])}),u?(0,z.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Le(t)&&Le(n)?(0,z.jsx)(Gh,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}o(Go,"BaseEdge");function ol({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===J.Left||e===J.Right?[.5*(t+r),n]:[t,.5*(n+i)]}o(ol,"getControl");function Tl({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:i,targetPosition:s=J.Top}){let[a,l]=ol({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,u]=ol({pos:s,x1:r,y1:i,x2:e,y2:t}),[d,f,h,p]=$o({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${i}`,d,f,h,p]}o(Tl,"getSimpleBezierPath");function Al(e){return(0,D.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:b,interactionWidth:y})=>{let[E,g,w]=Tl({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:l}),M=e.isInternal?void 0:t;return(0,z.jsx)(Go,{id:M,path:E,labelX:g,labelY:w,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:b,interactionWidth:y})})}o(Al,"createSimpleBezierEdge");var Kh=Al({isInternal:!1}),Dl=Al({isInternal:!0});Kh.displayName="SimpleBezierEdge";Dl.displayName="SimpleBezierEdgeInternal";function zl(e){return(0,D.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=J.Bottom,targetPosition:m=J.Top,markerEnd:v,markerStart:b,pathOptions:y,interactionWidth:E})=>{let[g,w,M]=Jn({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:s,targetPosition:m,borderRadius:y?.borderRadius,offset:y?.offset,stepPosition:y?.stepPosition}),_=e.isInternal?void 0:t;return(0,z.jsx)(Go,{id:_,path:g,labelX:w,labelY:M,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:v,markerStart:b,interactionWidth:E})})}o(zl,"createSmoothStepEdge");var Ol=zl({isInternal:!1}),$l=zl({isInternal:!0});Ol.displayName="SmoothStepEdge";$l.displayName="SmoothStepEdgeInternal";function Rl(e){return(0,D.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,z.jsx)(Ol,{...n,id:r,pathOptions:(0,D.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}o(Rl,"createStepEdge");var Qh=Rl({isInternal:!1}),Ll=Rl({isInternal:!0});Qh.displayName="StepEdge";Ll.displayName="StepEdgeInternal";function Hl(e){return(0,D.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:v})=>{let[b,y,E]=Lo({sourceX:n,sourceY:r,targetX:i,targetY:s}),g=e.isInternal?void 0:t;return(0,z.jsx)(Go,{id:g,path:b,labelX:y,labelY:E,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:v})})}o(Hl,"createStraightEdge");var Jh=Hl({isInternal:!1}),Bl=Hl({isInternal:!0});Jh.displayName="StraightEdge";Bl.displayName="StraightEdgeInternal";function Vl(e){return(0,D.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a=J.Bottom,targetPosition:l=J.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:b,pathOptions:y,interactionWidth:E})=>{let[g,w,M]=Ro({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:l,curvature:y?.curvature}),_=e.isInternal?void 0:t;return(0,z.jsx)(Go,{id:_,path:g,labelX:w,labelY:M,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:b,interactionWidth:E})})}o(Vl,"createBezierEdge");var jh=Vl({isInternal:!1}),Fl=Vl({isInternal:!0});jh.displayName="BezierEdge";Fl.displayName="BezierEdgeInternal";var rl={default:Fl,straight:Bl,step:Ll,smoothstep:$l,simplebezier:Dl},il={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},ep=o((e,t,n)=>n===J.Left?e-t:n===J.Right?e+t:e,"shiftX"),tp=o((e,t,n)=>n===J.Top?e-t:n===J.Bottom?e+t:e,"shiftY"),sl="react-flow__edgeupdater";function al({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:a,type:l}){return(0,z.jsx)("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:a,className:ge([sl,`${sl}-${l}`]),cx:ep(t,r,e),cy:tp(n,r,e),r,stroke:"transparent",fill:"transparent"})}o(al,"EdgeAnchor");function np({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){let m=de(),v=o((w,M)=>{if(w.button!==0)return;let{autoPanOnConnect:_,domNode:k,connectionMode:P,connectionRadius:T,lib:W,onConnectStart:$,cancelConnection:V,nodeLookup:L,rfId:x,panBy:S,updateConnection:C}=m.getState(),I=M.type==="target",O=o((F,H)=>{h(!1),f?.(F,n,M.type,H)},"_onReconnectEnd"),A=o(F=>u?.(n,F),"onConnectEdge"),B=o((F,H)=>{h(!0),d?.(w,n,M.type),$?.(F,H)},"_onConnectStart");Fo.onPointerDown(w.nativeEvent,{autoPanOnConnect:_,connectionMode:P,connectionRadius:T,domNode:k,handleId:M.id,nodeId:M.nodeId,nodeLookup:L,isTarget:I,edgeUpdaterType:M.type,lib:W,flowId:x,cancelConnection:V,panBy:S,isValidConnection:o((...F)=>m.getState().isValidConnection?.(...F)??!0,"isValidConnection"),onConnect:A,onConnectStart:B,onConnectEnd:o((...F)=>m.getState().onConnectEnd?.(...F),"onConnectEnd"),onReconnectEnd:O,updateConnection:C,getTransform:o(()=>m.getState().transform,"getTransform"),getFromHandle:o(()=>m.getState().connection.fromHandle,"getFromHandle"),dragThreshold:m.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},"handleEdgeUpdater"),b=o(w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),"onReconnectSourceMouseDown"),y=o(w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),"onReconnectTargetMouseDown"),E=o(()=>p(!0),"onReconnectMouseEnter"),g=o(()=>p(!1),"onReconnectMouseOut");return(0,z.jsxs)(z.Fragment,{children:[(e===!0||e==="source")&&(0,z.jsx)(al,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:b,onMouseEnter:E,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&(0,z.jsx)(al,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:y,onMouseEnter:E,onMouseOut:g,type:"target"})]})}o(np,"EdgeUpdateAnchors");function op({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:v,noPanClassName:b,onError:y,disableKeyboardA11y:E}){let g=ie(q=>q.edgeLookup.get(e)),w=ie(q=>q.defaultEdgeOptions);g=w?{...w,...g}:g;let M=g.type||"default",_=v?.[M]||rl[M];_===void 0&&(y?.("011",ze.error011(M)),M="default",_=v?.default||rl.default);let k=!!(g.focusable||t&&typeof g.focusable>"u"),P=typeof f<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),T=!!(g.selectable||r&&typeof g.selectable>"u"),W=(0,D.useRef)(null),[$,V]=(0,D.useState)(!1),[L,x]=(0,D.useState)(!1),S=de(),{zIndex:C=g.zIndex,sourceX:I,sourceY:O,targetX:A,targetY:B,sourcePosition:F,targetPosition:H}=ie((0,D.useCallback)(q=>{let G=q.nodeLookup.get(g.source),ne=q.nodeLookup.get(g.target);if(!G||!ne)return il;let oe=ga({id:e,sourceNode:G,targetNode:ne,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:q.connectionMode,onError:y}),se=ha({selected:g.selected,zIndex:g.zIndex,sourceNode:G,targetNode:ne,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode});return{...oe||il,zIndex:se}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),ue),U=(0,D.useMemo)(()=>g.markerStart?`url('#${Ho(g.markerStart,m)}')`:void 0,[g.markerStart,m]),Z=(0,D.useMemo)(()=>g.markerEnd?`url('#${Ho(g.markerEnd,m)}')`:void 0,[g.markerEnd,m]);if(g.hidden||I===null||O===null||A===null||B===null)return null;let X=o(q=>{let{addSelectedEdges:G,unselectNodesAndEdges:ne,multiSelectionActive:oe}=S.getState();T&&(S.setState({nodesSelectionActive:!1}),g.selected&&oe?(ne({nodes:[],edges:[g]}),W.current?.blur()):G([e])),i&&i(q,g)},"onEdgeClick"),j=s?q=>{s(q,{...g})}:void 0,K=a?q=>{a(q,{...g})}:void 0,R=l?q=>{l(q,{...g})}:void 0,Y=c?q=>{c(q,{...g})}:void 0,te=u?q=>{u(q,{...g})}:void 0,ee=o(q=>{if(!E&&Ci.includes(q.key)&&T){let{unselectNodesAndEdges:G,addSelectedEdges:ne}=S.getState();q.key==="Escape"?(W.current?.blur(),G({edges:[g]})):ne([e])}},"onKeyDown");return(0,z.jsx)("svg",{style:{zIndex:C},children:(0,z.jsxs)("g",{className:ge(["react-flow__edge",`react-flow__edge-${M}`,g.className,b,{selected:g.selected,animated:g.animated,inactive:!T&&!i,updating:$,selectable:T}]),onClick:X,onDoubleClick:j,onContextMenu:K,onMouseEnter:R,onMouseMove:Y,onMouseLeave:te,onKeyDown:k?ee:void 0,tabIndex:k?0:void 0,role:g.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":k?`${ml}-${m}`:void 0,ref:W,...g.domAttributes,children:[!L&&(0,z.jsx)(_,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:T,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:I,sourceY:O,targetX:A,targetY:B,sourcePosition:F,targetPosition:H,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),P&&(0,z.jsx)(np,{edge:g,isReconnectable:P,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:I,sourceY:O,targetX:A,targetY:B,sourcePosition:F,targetPosition:H,setUpdateHover:V,setReconnecting:x})]})})}o(op,"EdgeWrapper");var rp=(0,D.memo)(op),ip=o(e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError}),"selector$9");function Wl({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:v}){let{edgesFocusable:b,edgesReconnectable:y,elementsSelectable:E,onError:g}=ie(ip,ue),w=Wh(t);return(0,z.jsxs)("div",{className:"react-flow__edges",children:[(0,z.jsx)(qh,{defaultColor:e,rfId:n}),w.map(M=>(0,z.jsx)(rp,{id:M,edgesFocusable:b,edgesReconnectable:y,elementsSelectable:E,noPanClassName:i,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:v},M))]})}o(Wl,"EdgeRendererComponent");Wl.displayName="EdgeRenderer";var sp=(0,D.memo)(Wl),ll=o(e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`,"toTransformString");function ap({children:e}){let t=de(),n=(0,D.useRef)(null),[r]=(0,D.useState)(()=>t.getState().transform);return vl(()=>{let i=null,s=o(()=>{let a=t.getState().transform;i&&a[0]===i[0]&&a[1]===i[1]&&a[2]===i[2]||(i=a,n.current&&(n.current.style.transform=ll(a)))},"applyTransform");return s(),t.subscribe(s)},[t]),(0,z.jsx)("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:ll(r)},children:e})}o(ap,"Viewport");function lp(e){let t=eo(),n=(0,D.useRef)(!1);(0,D.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}o(lp,"useOnInitHandler");var cp=o(e=>e.panZoom?.syncViewport,"selector$8");function up(e){let t=ie(cp),n=de();return(0,D.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}o(up,"useViewportSync");function cl(e){return e.connection.inProgress?{...e.connection,to:ln(e.connection.to,e.transform)}:{...e.connection}}o(cl,"storeSelector$1");function dp(e){return e?o(n=>{let r=cl(n);return e(r)},"combinedSelector"):cl}o(dp,"getSelector");function fp(e){let t=dp(e);return ie(t,ue)}o(fp,"useConnection");var hp=o(e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height}),"selector$7");function pp({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:s,height:a,isValid:l,inProgress:c}=ie(hp,ue);return!(s&&i&&c)?null:(0,z.jsx)("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:(0,z.jsx)("g",{className:ge(["react-flow__connection",Ii(l)]),children:(0,z.jsx)(Xl,{style:t,type:n,CustomComponent:r,isValid:l})})})}o(pp,"ConnectionLineWrapper");var Xl=o(({style:e,type:t=Ue.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:s,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=fp();if(!i)return;if(n)return(0,z.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:Ii(r),toNode:d,toHandle:f,pointer:p});let m="",v={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ue.Bezier:[m]=Ro(v);break;case Ue.SimpleBezier:[m]=Tl(v);break;case Ue.Step:[m]=Jn({...v,borderRadius:0});break;case Ue.SmoothStep:[m]=Jn(v);break;default:[m]=Lo(v)}return(0,z.jsx)("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})},"ConnectionLine");Xl.displayName="ConnectionLine";var mp={};function ul(e=mp){let t=(0,D.useRef)(e),n=de();(0,D.useEffect)(()=>{},[e])}o(ul,"useNodeOrEdgeTypesWarning");function gp(){let e=de(),t=(0,D.useRef)(!1);(0,D.useEffect)(()=>{},[])}o(gp,"useStylesLoadedWarning");function Yl({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:y,selectionKeyCode:E,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:M,panActivationKeyCode:_,zoomActivationKeyCode:k,deleteKeyCode:P,onlyRenderVisibleElements:T,elementsSelectable:W,defaultViewport:$,translateExtent:V,minZoom:L,maxZoom:x,preventScrolling:S,defaultMarkerColor:C,zoomOnScroll:I,zoomOnPinch:O,panOnScroll:A,panOnScrollSpeed:B,panOnScrollMode:F,zoomOnDoubleClick:H,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:X,onPaneMouseEnter:j,onPaneMouseMove:K,onPaneMouseLeave:R,onPaneScroll:Y,onPaneContextMenu:te,paneClickDistance:ee,nodeClickDistance:q,onEdgeContextMenu:G,onEdgeMouseEnter:ne,onEdgeMouseMove:oe,onEdgeMouseLeave:se,reconnectRadius:le,onReconnect:ve,onReconnectStart:he,onReconnectEnd:pe,noDragClassName:xe,noWheelClassName:Pe,noPanClassName:fe,disableKeyboardA11y:Se,nodeExtent:me,rfId:we,viewport:be,onViewportChange:$e,nodesDraggable:Xe}){return ul(e),ul(t),gp(),lp(n),up(be),(0,z.jsx)(Dh,{onPaneClick:X,onPaneMouseEnter:j,onPaneMouseMove:K,onPaneMouseLeave:R,onPaneContextMenu:te,onPaneScroll:Y,paneClickDistance:ee,deleteKeyCode:P,selectionKeyCode:E,selectionOnDrag:g,selectionMode:w,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:M,panActivationKeyCode:_,zoomActivationKeyCode:k,elementsSelectable:W,zoomOnScroll:I,zoomOnPinch:O,zoomOnDoubleClick:H,panOnScroll:A,panOnScrollSpeed:B,panOnScrollMode:F,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:$,translateExtent:V,minZoom:L,maxZoom:x,onSelectionContextMenu:f,preventScrolling:S,noDragClassName:xe,noWheelClassName:Pe,noPanClassName:fe,disableKeyboardA11y:Se,onViewportChange:$e,isControlledViewport:!!be,children:(0,z.jsxs)(ap,{children:[(0,z.jsx)(sp,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:ve,onReconnectStart:he,onReconnectEnd:pe,onlyRenderVisibleElements:T,onEdgeContextMenu:G,onEdgeMouseEnter:ne,onEdgeMouseMove:oe,onEdgeMouseLeave:se,reconnectRadius:le,defaultMarkerColor:C,noPanClassName:fe,disableKeyboardA11y:Se,rfId:we}),(0,z.jsx)(pp,{style:v,type:m,component:b,containerStyle:y}),(0,z.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,z.jsx)(Fh,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:q,onlyRenderVisibleElements:T,noPanClassName:fe,noDragClassName:xe,disableKeyboardA11y:Se,nodeExtent:me,rfId:we,nodesDraggable:Xe}),(0,z.jsx)("div",{className:"react-flow__viewport-portal"})]})})}o(Yl,"GraphViewComponent");Yl.displayName="GraphView";var yp=(0,D.memo)(Yl),xp=Di("React Flow","https://reactflow.dev/"),dl=o(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{let p=new Map,m=new Map,v=new Map,b=new Map,y=r??t??[],E=n??e??[],g=d??[0,0],w=f??on;Yi(v,b,y);let{nodesInitialized:M}=Bo(E,p,m,{nodeOrigin:g,nodeExtent:w,zIndexMode:h}),_=[0,0,1];if(a&&i&&s){let k=rn(p,{filter:o($=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight)),"filter")}),{x:P,y:T,zoom:W}=Lt(k,i,s,c,u,l?.padding??.1);_=[P,T,W]}return{rfId:"1",width:i??0,height:s??0,transform:_,nodes:E,nodesInitialized:M,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:b,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:on,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:vt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Ni},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:xp,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:_i,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},"getInitialState"),wp=o(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Ba((p,m)=>{async function v(){let{nodeLookup:b,panZoom:y,fitViewOptions:E,fitViewResolver:g,width:w,height:M,minZoom:_,maxZoom:k}=m();y&&(await aa({nodes:b,width:w,height:M,panZoom:y,minZoom:_,maxZoom:k},E),g?.resolve(!0),p({fitViewResolver:null}))}return o(v,"resolveFitView"),{...dl({nodes:e,edges:t,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:o(b=>{let{nodeLookup:y,parentLookup:E,nodeOrigin:g,elevateNodesOnSelect:w,fitViewQueued:M,zIndexMode:_,nodesSelectionActive:k}=m(),{nodesInitialized:P,hasSelectedNodes:T}=Bo(b,y,E,{nodeOrigin:g,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:_}),W=k&&T;M&&P?(v(),p({nodes:b,nodesInitialized:P,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:W})):p({nodes:b,nodesInitialized:P,nodesSelectionActive:W})},"setNodes"),setEdges:o(b=>{let{connectionLookup:y,edgeLookup:E}=m();Yi(y,E,b),p({edges:b})},"setEdges"),setDefaultNodesAndEdges:o((b,y)=>{if(b){let{setNodes:E}=m();E(b),p({hasDefaultNodes:!0})}if(y){let{setEdges:E}=m();E(y),p({hasDefaultEdges:!0})}},"setDefaultNodesAndEdges"),updateNodeInternals:o(b=>{let{triggerNodeChanges:y,nodeLookup:E,parentLookup:g,domNode:w,nodeOrigin:M,nodeExtent:_,debug:k,fitViewQueued:P,zIndexMode:T}=m(),{changes:W,updatedInternals:$}=va(b,E,g,w,M,_,T);$&&(wa(E,g,{nodeOrigin:M,nodeExtent:_,zIndexMode:T}),P?(v(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),W?.length>0&&(k&&console.log("React Flow: trigger node changes",W),y?.(W)))},"updateNodeInternals"),updateNodePositions:o((b,y=!1)=>{let E=[],g=[],{nodeLookup:w,triggerNodeChanges:M,connection:_,updateConnection:k,onNodesChangeMiddlewareMap:P}=m();for(let[T,W]of b){let $=w.get(T),V=!!($?.expandParent&&$?.parentId&&W?.position),L={id:T,type:"position",position:V?{x:Math.max(0,W.position.x),y:Math.max(0,W.position.y)}:W.position,dragging:y};if($&&_.inProgress&&_.fromNode.id===$.id){let x=St($,_.fromHandle,J.Left,!0);k({..._,from:x})}V&&$.parentId&&E.push({id:T,parentId:$.parentId,rect:{...W.internals.positionAbsolute,width:W.measured.width??0,height:W.measured.height??0}}),g.push(L)}if(E.length>0){let{parentLookup:T,nodeOrigin:W}=m(),$=Vo(E,w,T,W);g.push(...$)}for(let T of P.values())g=T(g);M(g)},"updateNodePositions"),triggerNodeChanges:o(b=>{let{onNodesChange:y,setNodes:E,nodes:g,hasDefaultNodes:w,debug:M}=m();if(b?.length){if(w){let _=xl(b,g);E(_)}M&&console.log("React Flow: trigger node changes",b),y?.(b)}},"triggerNodeChanges"),triggerEdgeChanges:o(b=>{let{onEdgesChange:y,setEdges:E,edges:g,hasDefaultEdges:w,debug:M}=m();if(b?.length){if(w){let _=wl(b,g);E(_)}M&&console.log("React Flow: trigger edge changes",b),y?.(b)}},"triggerEdgeChanges"),addSelectedNodes:o(b=>{let{multiSelectionActive:y,edgeLookup:E,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:M}=m();if(y){let _=b.map(k=>Ht(k,!0));w(_);return}w(un(g,new Set([...b]),!0)),M(un(E))},"addSelectedNodes"),addSelectedEdges:o(b=>{let{multiSelectionActive:y,edgeLookup:E,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:M}=m();if(y){let _=b.map(k=>Ht(k,!0));M(_);return}M(un(E,new Set([...b]))),w(un(g,new Set,!0))},"addSelectedEdges"),unselectNodesAndEdges:o(({nodes:b,edges:y}={})=>{let{edges:E,nodes:g,nodeLookup:w,triggerNodeChanges:M,triggerEdgeChanges:_}=m(),k=b||g,P=y||E,T=[];for(let $ of k){if(!$.selected)continue;let V=w.get($.id);V&&(V.selected=!1),T.push(Ht($.id,!1))}let W=[];for(let $ of P)$.selected&&W.push(Ht($.id,!1));M(T),_(W)},"unselectNodesAndEdges"),setMinZoom:o(b=>{let{panZoom:y,maxZoom:E}=m();y?.setScaleExtent([b,E]),p({minZoom:b})},"setMinZoom"),setMaxZoom:o(b=>{let{panZoom:y,minZoom:E}=m();y?.setScaleExtent([E,b]),p({maxZoom:b})},"setMaxZoom"),setTranslateExtent:o(b=>{m().panZoom?.setTranslateExtent(b),p({translateExtent:b})},"setTranslateExtent"),resetSelectedElements:o(()=>{let{edges:b,nodes:y,triggerNodeChanges:E,triggerEdgeChanges:g,elementsSelectable:w}=m();if(!w)return;let M=y.reduce((k,P)=>P.selected?[...k,Ht(P.id,!1)]:k,[]),_=b.reduce((k,P)=>P.selected?[...k,Ht(P.id,!1)]:k,[]);E(M),g(_)},"resetSelectedElements"),setNodeExtent:o(b=>{let{nodes:y,nodeLookup:E,parentLookup:g,nodeOrigin:w,elevateNodesOnSelect:M,nodeExtent:_,zIndexMode:k}=m();b[0][0]===_[0][0]&&b[0][1]===_[0][1]&&b[1][0]===_[1][0]&&b[1][1]===_[1][1]||(Bo(y,E,g,{nodeOrigin:w,nodeExtent:b,elevateNodesOnSelect:M,checkEquality:!1,zIndexMode:k}),p({nodeExtent:b}))},"setNodeExtent"),panBy:o(b=>{let{transform:y,width:E,height:g,panZoom:w,translateExtent:M}=m();return Sa({delta:b,panZoom:w,transform:y,translateExtent:M,width:E,height:g})},"panBy"),setCenter:o(async(b,y,E)=>{let{width:g,height:w,maxZoom:M,panZoom:_}=m();if(!_)return!1;let k=typeof E?.zoom<"u"?E.zoom:M;return await _.setViewport({x:g/2-b*k,y:w/2-y*k,zoom:k},{duration:E?.duration,ease:E?.ease,interpolate:E?.interpolate}),!0},"setCenter"),cancelConnection:o(()=>{p({connection:{...Ni}})},"cancelConnection"),updateConnection:o(b=>{p({connection:b})},"updateConnection"),reset:o(()=>p({...dl()}),"reset")}},Object.is),"createStore");function bp({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){let[m]=(0,D.useState)(()=>wp({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return(0,z.jsx)(Of,{value:m,children:(0,z.jsx)(ih,{children:(0,z.jsx)(bh,{children:p})})})}o(bp,"ReactFlowProvider");function vp({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return(0,D.useContext)(Uo)?(0,z.jsx)(z.Fragment,{children:e}):(0,z.jsx)(bp,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}o(vp,"Wrapper");var Sp={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Ep({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:y,onNodeMouseEnter:E,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:M,onNodeDoubleClick:_,onNodeDragStart:k,onNodeDrag:P,onNodeDragStop:T,onNodesDelete:W,onEdgesDelete:$,onDelete:V,onSelectionChange:L,onSelectionDragStart:x,onSelectionDrag:S,onSelectionDragStop:C,onSelectionContextMenu:I,onSelectionStart:O,onSelectionEnd:A,onBeforeDelete:B,connectionMode:F,connectionLineType:H=Ue.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:X,deleteKeyCode:j="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:R=!1,selectionMode:Y=zt.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:ee=cn()?"Meta":"Control",zoomActivationKeyCode:q=cn()?"Meta":"Control",snapToGrid:G,snapGrid:ne,onlyRenderVisibleElements:oe=!1,selectNodesOnDrag:se,nodesDraggable:le,autoPanOnNodeFocus:ve,nodesConnectable:he,nodesFocusable:pe,nodeOrigin:xe=gl,edgesFocusable:Pe,edgesReconnectable:fe,elementsSelectable:Se=!0,defaultViewport:me=qf,minZoom:we=.5,maxZoom:be=2,translateExtent:$e=on,preventScrolling:Xe=!0,nodeExtent:tt,defaultMarkerColor:er="#b1b1b7",zoomOnScroll:Vt=!0,zoomOnPinch:tr=!0,panOnScroll:Ft=!1,panOnScrollSpeed:nr=.5,panOnScrollMode:Wt=et.Free,zoomOnDoubleClick:yn=!0,panOnDrag:nt=!0,onPaneClick:Xt,onPaneMouseEnter:xn,onPaneMouseMove:ot,onPaneMouseLeave:rt,onPaneScroll:wn,onPaneContextMenu:bn,paneClickDistance:it=1,nodeClickDistance:st=0,children:vn,onReconnect:Sn,onReconnectStart:at,onReconnectEnd:lt,onEdgeContextMenu:ct,onEdgeDoubleClick:ut,onEdgeMouseEnter:dt,onEdgeMouseMove:ft,onEdgeMouseLeave:ht,reconnectRadius:pt=10,onNodesChange:Yt,onEdgesChange:Q,noDragClassName:ae="nodrag",noWheelClassName:ce="nowheel",noPanClassName:Te="nopan",fitView:_e,fitViewOptions:oo,connectOnClick:or,attributionPosition:rr,proOptions:ir,defaultEdgeOptions:Re,elevateNodesOnSelect:Nt=!0,elevateEdgesOnSelect:ro=!1,disableKeyboardA11y:is=!1,autoPanOnConnect:Dc,autoPanOnNodeDrag:zc,autoPanOnSelection:Oc=!0,autoPanSpeed:$c,connectionRadius:Rc,isValidConnection:Lc,onError:Hc,style:Bc,id:ss,nodeDragThreshold:Vc,connectionDragThreshold:Fc,viewport:Wc,onViewportChange:Xc,width:Yc,height:Zc,colorMode:Uc="light",debug:qc,onScroll:as,ariaLabelConfig:Gc,zIndexMode:ls="basic",...Kc},Qc){let sr=ss||"1",Jc=Jf(Uc),jc=(0,D.useCallback)(cs=>{cs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),as?.(cs)},[as]);return(0,z.jsx)("div",{"data-testid":"rf__wrapper",...Kc,onScroll:jc,style:{...Bc,...Sp},ref:Qc,className:ge(["react-flow",i,Jc]),id:ss,role:"application",children:(0,z.jsxs)(vp,{nodes:e,edges:t,width:Yc,height:Zc,fitView:_e,fitViewOptions:oo,minZoom:we,maxZoom:be,nodeOrigin:xe,nodeExtent:tt,zIndexMode:ls,children:[(0,z.jsx)(Qf,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:y,nodesDraggable:le,autoPanOnNodeFocus:ve,nodesConnectable:he,nodesFocusable:pe,edgesFocusable:Pe,edgesReconnectable:fe,elementsSelectable:Se,elevateNodesOnSelect:Nt,elevateEdgesOnSelect:ro,minZoom:we,maxZoom:be,nodeExtent:tt,onNodesChange:Yt,onEdgesChange:Q,snapToGrid:G,snapGrid:ne,connectionMode:F,translateExtent:$e,connectOnClick:or,defaultEdgeOptions:Re,fitView:_e,fitViewOptions:oo,onNodesDelete:W,onEdgesDelete:$,onDelete:V,onNodeDragStart:k,onNodeDrag:P,onNodeDragStop:T,onSelectionDrag:S,onSelectionDragStart:x,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:Te,nodeOrigin:xe,rfId:sr,autoPanOnConnect:Dc,autoPanOnNodeDrag:zc,autoPanSpeed:$c,onError:Hc,connectionRadius:Rc,isValidConnection:Lc,selectNodesOnDrag:se,nodeDragThreshold:Vc,connectionDragThreshold:Fc,onBeforeDelete:B,debug:qc,ariaLabelConfig:Gc,zIndexMode:ls}),(0,z.jsx)(yp,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:E,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:M,onNodeDoubleClick:_,nodeTypes:s,edgeTypes:a,connectionLineType:H,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:X,selectionKeyCode:K,selectionOnDrag:R,selectionMode:Y,deleteKeyCode:j,multiSelectionKeyCode:ee,panActivationKeyCode:te,zoomActivationKeyCode:q,onlyRenderVisibleElements:oe,defaultViewport:me,translateExtent:$e,minZoom:we,maxZoom:be,preventScrolling:Xe,zoomOnScroll:Vt,zoomOnPinch:tr,zoomOnDoubleClick:yn,panOnScroll:Ft,panOnScrollSpeed:nr,panOnScrollMode:Wt,panOnDrag:nt,autoPanOnSelection:Oc,onPaneClick:Xt,onPaneMouseEnter:xn,onPaneMouseMove:ot,onPaneMouseLeave:rt,onPaneScroll:wn,onPaneContextMenu:bn,paneClickDistance:it,nodeClickDistance:st,onSelectionContextMenu:I,onSelectionStart:O,onSelectionEnd:A,onReconnect:Sn,onReconnectStart:at,onReconnectEnd:lt,onEdgeContextMenu:ct,onEdgeDoubleClick:ut,onEdgeMouseEnter:dt,onEdgeMouseMove:ft,onEdgeMouseLeave:ht,reconnectRadius:pt,defaultMarkerColor:er,noDragClassName:ae,noWheelClassName:ce,noPanClassName:Te,rfId:sr,disableKeyboardA11y:is,nodeExtent:tt,viewport:Wc,onViewportChange:Xc,nodesDraggable:le}),(0,z.jsx)(Uf,{onSelectionChange:L}),vn,(0,z.jsx)(Ff,{proOptions:ir,position:rr}),(0,z.jsx)(Vf,{rfId:sr,disableKeyboardA11y:is})]})})}o(Ep,"ReactFlow");var Zl=bl(Ep);var Cp=o(e=>e.nodes,"nodesSelector");function Ul(){return ie(Cp,ue)}o(Ul,"useNodes");function ql(e){let[t,n]=(0,D.useState)(e),r=(0,D.useCallback)(i=>n(s=>xl(i,s)),[]);return[t,n,r]}o(ql,"useNodesState");function Gl(e){let[t,n]=(0,D.useState)(e),r=(0,D.useCallback)(i=>n(s=>wl(i,s)),[]);return[t,n,r]}o(Gl,"useEdgesState");var mv=ze.error014();function _p({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,z.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ge(["react-flow__background-pattern",n,r])})}o(_p,"LinePattern");function Np({radius:e,className:t}){return(0,z.jsx)("circle",{cx:e,cy:e,r:e,className:ge(["react-flow__background-pattern","dots",t])})}o(Np,"DotPattern");var Ct;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ct||(Ct={}));var Ip={[Ct.Dots]:1,[Ct.Lines]:1,[Ct.Cross]:6},Mp=o(e=>({transform:e.transform,patternId:`pattern-${e.rfId}`}),"selector$3");function Kl({id:e,variant:t=Ct.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){let f=(0,D.useRef)(null),{transform:h,patternId:p}=ie(Mp,ue),m=r||Ip[t],v=t===Ct.Dots,b=t===Ct.Cross,y=Array.isArray(n)?n:[n,n],E=[y[0]*h[2]||1,y[1]*h[2]||1],g=m*h[2],w=Array.isArray(s)?s:[s,s],M=b?[g,g]:E,_=[w[0]*h[2]||1+M[0]/2,w[1]*h[2]||1+M[1]/2],k=`${p}${e||""}`;return(0,z.jsxs)("svg",{className:ge(["react-flow__background",u]),style:{...c,...qo,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[(0,z.jsx)("pattern",{id:k,x:h[0]%E[0],y:h[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:v?(0,z.jsx)(Np,{radius:g/2,className:d}):(0,z.jsx)(_p,{dimensions:M,lineWidth:i,variant:t,className:d})}),(0,z.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}o(Kl,"BackgroundComponent");Kl.displayName="Background";var Ql=(0,D.memo)(Kl);function kp(){return(0,z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,z.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}o(kp,"PlusIcon");function Pp(){return(0,z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,z.jsx)("path",{d:"M0 0h32v4.2H0z"})})}o(Pp,"MinusIcon");function Tp(){return(0,z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,z.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}o(Tp,"FitViewIcon");function Ap(){return(0,z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,z.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}o(Ap,"LockIcon");function Dp(){return(0,z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,z.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}o(Dp,"UnlockIcon");function Yo({children:e,className:t,...n}){return(0,z.jsx)("button",{type:"button",className:ge(["react-flow__controls-button",t]),...n,children:e})}o(Yo,"ControlButton");var zp=o(e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig}),"selector$2");function Jl({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){let m=de(),{isInteractive:v,minZoomReached:b,maxZoomReached:y,ariaLabelConfig:E}=ie(zp,ue),{zoomIn:g,zoomOut:w,fitView:M}=eo(),_=o(()=>{g(),s?.()},"onZoomInHandler"),k=o(()=>{w(),a?.()},"onZoomOutHandler"),P=o(()=>{M(i),l?.()},"onFitViewHandler"),T=o(()=>{m.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c?.(!v)},"onToggleInteractivity");return(0,z.jsxs)(_t,{className:ge(["react-flow__controls",h==="horizontal"?"horizontal":"vertical",u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??E["controls.ariaLabel"],children:[t&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Yo,{onClick:_,className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:y,children:(0,z.jsx)(kp,{})}),(0,z.jsx)(Yo,{onClick:k,className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:b,children:(0,z.jsx)(Pp,{})})]}),n&&(0,z.jsx)(Yo,{className:"react-flow__controls-fitview",onClick:P,title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:(0,z.jsx)(Tp,{})}),r&&(0,z.jsx)(Yo,{className:"react-flow__controls-interactive",onClick:T,title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:v?(0,z.jsx)(Dp,{}):(0,z.jsx)(Ap,{})}),d]})}o(Jl,"ControlsComponent");Jl.displayName="Controls";var jl=(0,D.memo)(Jl);function Op({id:e,x:t,y:n,width:r,height:i,style:s,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){let{background:m,backgroundColor:v}=s||{},b=a||m||v;return(0,z.jsx)("rect",{className:ge(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:b,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}o(Op,"MiniMapNodeComponent");var $p=(0,D.memo)(Op),Rp=o(e=>e.nodes.map(t=>t.id),"selectorNodeIds"),qi=o(e=>e instanceof Function?e:()=>e,"getAttrFunction");function Lp({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=$p,onClick:a}){let l=ie(Rp,ue),c=qi(t),u=qi(e),d=qi(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return(0,z.jsx)(z.Fragment,{children:l.map(h=>(0,z.jsx)(Bp,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:a,shapeRendering:f},h))})}o(Lp,"MiniMapNodes");function Hp({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:l,onClick:c}){let{node:u,x:d,y:f,width:h,height:p}=ie(m=>{let v=m.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};let b=v.internals.userNode,{x:y,y:E}=v.internals.positionAbsolute,{width:g,height:w}=Fe(b);return{node:b,x:y,y:E,width:g,height:w}},ue);return!u||u.hidden||!zi(u)?null:(0,z.jsx)(l,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:s,shapeRendering:a,onClick:c,id:u.id})}o(Hp,"NodeComponentWrapperInner");var Bp=(0,D.memo)(Hp),Vp=(0,D.memo)(Lp),Fp=200,Wp=150,Xp=o(e=>!e.hidden,"filterHidden"),Yp=o(e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Ti(rn(e.nodeLookup,{filter:Xp}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},"selector$1"),fl=o((e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,"rectEqual"),Zp=o((e,t)=>fl(e.viewBB,t.viewBB)&&fl(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,"areEqual"),Up="react-flow__minimap-desc";function ec({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:v=!1,zoomable:b=!1,ariaLabel:y,inversePan:E,zoomStep:g=1,offsetScale:w=5}){let M=de(),_=(0,D.useRef)(null),{boundingRect:k,viewBB:P,rfId:T,panZoom:W,translateExtent:$,flowWidth:V,flowHeight:L,ariaLabelConfig:x}=ie(Yp,Zp),S=e?.width??Fp,C=e?.height??Wp,I=k.width/S,O=k.height/C,A=Math.max(I,O),B=A*S,F=A*C,H=w*A,U=k.x-(B-k.width)/2-H,Z=k.y-(F-k.height)/2-H,X=B+H*2,j=F+H*2,K=`${Up}-${T}`,R=(0,D.useRef)(0),Y=(0,D.useRef)();R.current=A,(0,D.useEffect)(()=>{if(_.current&&W)return Y.current=ka({domNode:_.current,panZoom:W,getTransform:o(()=>M.getState().transform,"getTransform"),getViewScale:o(()=>R.current,"getViewScale")}),()=>{Y.current?.destroy()}},[W]),(0,D.useEffect)(()=>{Y.current?.update({translateExtent:$,width:V,height:L,inversePan:E,pannable:v,zoomStep:g,zoomable:b})},[v,b,E,g,$,V,L]);let te=p?G=>{let[ne,oe]=Y.current?.pointer(G)||[0,0];p(G,{x:ne,y:oe})}:void 0,ee=m?(0,D.useCallback)((G,ne)=>{let oe=M.getState().nodeLookup.get(ne).internals.userNode;m(G,oe)},[]):void 0,q=y??x["minimap.ariaLabel"];return(0,z.jsx)(_t,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*A:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ge(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,z.jsxs)("svg",{width:S,height:C,viewBox:`${U} ${Z} ${X} ${j}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:_,onClick:te,children:[q&&(0,z.jsx)("title",{id:K,children:q}),(0,z.jsx)(Vp,{onClick:ee,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:l}),(0,z.jsx)("path",{className:"react-flow__minimap-mask",d:`M${U-H},${Z-H}h${X+H*2}v${j+H*2}h${-X-H*2}z
|
|
7
|
+
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}o(ec,"MiniMapComponent");ec.displayName="MiniMap";var tc=(0,D.memo)(ec),qp=o(e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,"scaleSelector"),Gp={[Et.Line]:"right",[Et.Handle]:"bottom-right"};function Kp({nodeId:e,position:t,variant:n=Et.Handle,className:r,style:i=void 0,children:s,color:a,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:v,onResize:b,onResizeEnd:y}){let E=_l(),g=typeof e=="string"?e:E,w=de(),M=(0,D.useRef)(null),_=n===Et.Handle,k=ie((0,D.useCallback)(qp(_&&p),[_,p]),ue),P=(0,D.useRef)(null),T=t??Gp[n];(0,D.useEffect)(()=>{if(!(!M.current||!g))return P.current||(P.current=za({domNode:M.current,nodeId:g,getStoreItems:o(()=>{let{nodeLookup:$,transform:V,snapGrid:L,snapToGrid:x,nodeOrigin:S,domNode:C}=w.getState();return{nodeLookup:$,transform:V,snapGrid:L,snapToGrid:x,nodeOrigin:S,paneDomNode:C}},"getStoreItems"),onChange:o(($,V)=>{let{triggerNodeChanges:L,nodeLookup:x,parentLookup:S,nodeOrigin:C}=w.getState(),I=[],O={x:$.x,y:$.y},A=x.get(g);if(A&&A.expandParent&&A.parentId){let B=A.origin??C,F=$.width??A.measured.width??0,H=$.height??A.measured.height??0,U={id:A.id,parentId:A.parentId,rect:{width:F,height:H,...Oi({x:$.x??A.position.x,y:$.y??A.position.y},{width:F,height:H},A.parentId,x,B)}},Z=Vo([U],x,S,C);I.push(...Z),O.x=$.x?Math.max(B[0]*F,$.x):void 0,O.y=$.y?Math.max(B[1]*H,$.y):void 0}if(O.x!==void 0&&O.y!==void 0){let B={id:g,type:"position",position:{...O}};I.push(B)}if($.width!==void 0&&$.height!==void 0){let F={id:g,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};I.push(F)}for(let B of V){let F={...B,type:"position"};I.push(F)}L(I)},"onChange"),onEnd:o(({width:$,height:V})=>{let L={id:g,type:"dimensions",resizing:!1,dimensions:{width:$,height:V}};w.getState().triggerNodeChanges([L])},"onEnd")})),P.current.update({controlPosition:T,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:v,onResize:b,onResizeEnd:y,shouldResize:m}),()=>{P.current?.destroy()}},[T,l,c,u,d,f,v,b,y,m]);let W=T.split("-");return(0,z.jsx)("div",{className:ge(["react-flow__resize-control","nodrag",...W,n,r]),ref:M,style:{...i,scale:k,...a&&{[_?"backgroundColor":"borderColor"]:a}},children:s})}o(Kp,"ResizeControl");var gv=(0,D.memo)(Kp);var N=mt(ds(),1);function nc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}o(nc,"resolveUrl");var oc=(()=>{let e=0,t=o(()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4),"random");return()=>(e+=1,`u${t()}${e}`)})();function We(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}o(We,"toArray");var dn=null;function Qo(e={}){return dn||(e.includeStyleProperties?(dn=e.includeStyleProperties,dn):(dn=We(window.getComputedStyle(document.documentElement)),dn))}o(Qo,"getStyleProperties");function Ko(e,t){let r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}o(Ko,"px");function Qp(e){let t=Ko(e,"border-left-width"),n=Ko(e,"border-right-width");return e.clientWidth+t+n}o(Qp,"getNodeWidth");function Jp(e){let t=Ko(e,"border-top-width"),n=Ko(e,"border-bottom-width");return e.clientHeight+t+n}o(Jp,"getNodeHeight");function Qi(e,t={}){let n=t.width||Qp(e),r=t.height||Jp(e);return{width:n,height:r}}o(Qi,"getImageSize");function rc(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}o(rc,"getPixelRatio");var Oe=16384;function ic(e){(e.width>Oe||e.height>Oe)&&(e.width>Oe&&e.height>Oe?e.width>e.height?(e.height*=Oe/e.width,e.width=Oe):(e.width*=Oe/e.height,e.height=Oe):e.width>Oe?(e.height*=Oe/e.width,e.width=Oe):(e.width*=Oe/e.height,e.height=Oe))}o(ic,"checkCanvasDimensions");function sc(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(n=>{let r=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),i=r.length,s=new Uint8Array(i);for(let a=0;a<i;a+=1)s[a]=r.charCodeAt(a);n(new Blob([s],{type:t.type?t.type:"image/png"}))})}o(sc,"canvasToBlob");function fn(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}o(fn,"createImage");async function jp(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}o(jp,"svgToDataURL");async function ac(e,t,n){let r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),jp(i)}o(ac,"nodeToDataURL");var ke=o((e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ke(n,t)},"isInstanceOfElement");function em(e){let t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}o(em,"formatCSSText");function tm(e,t){return Qo(t).map(n=>{let r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}o(tm,"formatCSSProperties");function nm(e,t,n,r){let i=`.${e}:${t}`,s=n.cssText?em(n):tm(n,r);return document.createTextNode(`${i}{${s}}`)}o(nm,"getPseudoElementStyle");function lc(e,t,n,r){let i=window.getComputedStyle(e,n),s=i.getPropertyValue("content");if(s===""||s==="none")return;let a=oc();try{t.className=`${t.className} ${a}`}catch{return}let l=document.createElement("style");l.appendChild(nm(a,n,i,r)),t.appendChild(l)}o(lc,"clonePseudoElement");function cc(e,t,n){lc(e,t,":before",n),lc(e,t,":after",n)}o(cc,"clonePseudoElements");var uc="application/font-woff",dc="image/jpeg",om={woff:uc,woff2:uc,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:dc,jpeg:dc,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function rm(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}o(rm,"getExtension");function hn(e){let t=rm(e).toLowerCase();return om[t]||""}o(hn,"getMimeType");function im(e){return e.split(/,/)[1]}o(im,"getContentFromDataUrl");function to(e){return e.search(/^(data:)/)!==-1}o(to,"isDataUrl");function ji(e,t){return`data:${t};base64,${e}`}o(ji,"makeDataUrl");async function es(e,t,n){let r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((s,a)=>{let l=new FileReader;l.onerror=a,l.onloadend=()=>{try{s(n({res:r,result:l.result}))}catch(c){a(c)}},l.readAsDataURL(i)})}o(es,"fetchAsDataURL");var Ji={};function sm(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}o(sm,"getCacheKey");async function pn(e,t,n){let r=sm(e,t,n.includeQueryParams);if(Ji[r]!=null)return Ji[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{let s=await es(e,n.fetchRequestInit,({res:a,result:l})=>(t||(t=a.headers.get("Content-Type")||""),im(l)));i=ji(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return Ji[r]=i,i}o(pn,"resourceToDataURL");async function am(e){let t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):fn(t)}o(am,"cloneCanvasElement");async function lm(e,t){if(e.currentSrc){let s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a?.drawImage(e,0,0,s.width,s.height);let l=s.toDataURL();return fn(l)}let n=e.poster,r=hn(n),i=await pn(n,r,t);return fn(i)}o(lm,"cloneVideoElement");async function cm(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await no(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}o(cm,"cloneIFrameElement");async function um(e,t){return ke(e,HTMLCanvasElement)?am(e):ke(e,HTMLVideoElement)?lm(e,t):ke(e,HTMLIFrameElement)?cm(e,t):e.cloneNode(fc(e))}o(um,"cloneSingleNode");var dm=o(e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT","isSlotElement"),fc=o(e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG","isSVGElement");async function fm(e,t,n){var r,i;if(fc(t))return t;let s=[];return dm(e)&&e.assignedNodes?s=We(e.assignedNodes()):ke(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=We(e.contentDocument.body.childNodes):s=We(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||ke(e,HTMLVideoElement)||await s.reduce((a,l)=>a.then(()=>no(l,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}o(fm,"cloneChildren");function hm(e,t,n){let r=t.style;if(!r)return;let i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Qo(n).forEach(s=>{let a=i.getPropertyValue(s);s==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),ke(e,HTMLIFrameElement)&&s==="display"&&a==="inline"&&(a="block"),s==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),r.setProperty(s,a,i.getPropertyPriority(s))})}o(hm,"cloneCSSStyle");function pm(e,t){ke(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ke(e,HTMLInputElement)&&t.setAttribute("value",e.value)}o(pm,"cloneInputValue");function mm(e,t){if(ke(e,HTMLSelectElement)){let r=Array.from(t.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}o(mm,"cloneSelectValue");function gm(e,t,n){return ke(t,Element)&&(hm(e,t,n),cc(e,t,n),pm(e,t),mm(e,t)),t}o(gm,"decorate");async function ym(e,t){let n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;let r={};for(let s=0;s<n.length;s++){let l=n[s].getAttribute("xlink:href");if(l){let c=e.querySelector(l),u=document.querySelector(l);!c&&u&&!r[l]&&(r[l]=await no(u,t,!0))}}let i=Object.values(r);if(i.length){let s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";let l=document.createElementNS(s,"defs");a.appendChild(l);for(let c=0;c<i.length;c++)l.appendChild(i[c]);e.appendChild(a)}return e}o(ym,"ensureSVGSymbols");async function no(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>um(r,t)).then(r=>fm(e,r,t)).then(r=>gm(e,r,t)).then(r=>ym(r,t))}o(no,"cloneNode");var hc=/url\((['"]?)([^'"]+?)\1\)/g,xm=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,wm=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function bm(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}o(bm,"toRegex");function vm(e){let t=[];return e.replace(hc,(n,r,i)=>(t.push(i),n)),t.filter(n=>!to(n))}o(vm,"parseURLs");async function Sm(e,t,n,r,i){try{let s=n?nc(t,n):t,a=hn(t),l;if(i){let c=await i(s);l=ji(c,a)}else l=await pn(s,a,r);return e.replace(bm(t),`$1${l}$3`)}catch{}return e}o(Sm,"embed");function Em(e,{preferredFontFormat:t}){return t?e.replace(wm,n=>{for(;;){let[r,,i]=xm.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}o(Em,"filterPreferredFontFormat");function ts(e){return e.search(hc)!==-1}o(ts,"shouldEmbed");async function Jo(e,t,n){if(!ts(e))return e;let r=Em(e,n);return vm(r).reduce((s,a)=>s.then(l=>Sm(l,a,t,n)),Promise.resolve(r))}o(Jo,"embedResources");async function mn(e,t,n){var r;let i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){let s=await Jo(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}o(mn,"embedProp");async function Cm(e,t){await mn("background",e,t)||await mn("background-image",e,t),await mn("mask",e,t)||await mn("-webkit-mask",e,t)||await mn("mask-image",e,t)||await mn("-webkit-mask-image",e,t)}o(Cm,"embedBackground");async function _m(e,t){let n=ke(e,HTMLImageElement);if(!(n&&!to(e.src))&&!(ke(e,SVGImageElement)&&!to(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await pn(r,hn(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...c)=>{try{s(t.onImageErrorHandler(...c))}catch(u){a(u)}}:a;let l=e;l.decode&&(l.decode=s),l.loading==="lazy"&&(l.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}o(_m,"embedImageNode");async function Nm(e,t){let r=We(e.childNodes).map(i=>ns(i,t));await Promise.all(r).then(()=>e)}o(Nm,"embedChildren");async function ns(e,t){ke(e,Element)&&(await Cm(e,t),await _m(e,t),await Nm(e,t))}o(ns,"embedImages");function pc(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}o(pc,"applyStyle");var mc={};async function gc(e){let t=mc[e];if(t!=null)return t;let r=await(await fetch(e)).text();return t={url:e,cssText:r},mc[e]=t,t}o(gc,"fetchCSS");async function yc(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let l=a.replace(r,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),es(l,t.fetchRequestInit,({result:c})=>(n=n.replace(a,`url(${c})`),[a,c]))});return Promise.all(s).then(()=>n)}o(yc,"embedFonts");function xc(e){if(e==null)return[];let t=[],n=/(\/\*[\s\S]*?\*\/)/gi,r=e.replace(n,""),i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let c=i.exec(r);if(c===null)break;t.push(c[0])}r=r.replace(i,"");let s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(a,"gi");for(;;){let c=s.exec(r);if(c===null){if(c=l.exec(r),c===null)break;s.lastIndex=l.lastIndex}else l.lastIndex=s.lastIndex;t.push(c[0])}return t}o(xc,"parseCSS");async function Im(e,t){let n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{We(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let l=a+1,c=s.href,u=gc(c).then(d=>yc(d,t)).then(d=>xc(d).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?l+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:f,error:h})}})).catch(d=>{console.error("Error loading remote css",d.toString())});r.push(u)}})}catch(s){let a=e.find(l=>l.href==null)||document.styleSheets[0];i.href!=null&&r.push(gc(i.href).then(l=>yc(l,t)).then(l=>xc(l).forEach(c=>{a.insertRule(c,a.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{We(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}o(Im,"getCSSRules");function Mm(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>ts(t.style.getPropertyValue("src")))}o(Mm,"getWebFontRules");async function km(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");let n=We(e.ownerDocument.styleSheets),r=await Im(n,t);return Mm(r)}o(km,"parseWebFontRules");function wc(e){return e.trim().replace(/["']/g,"")}o(wc,"normalizeFontFamily");function Pm(e){let t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(s=>{t.add(wc(s))}),Array.from(r.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return o(n,"traverse"),n(e),t}o(Pm,"getUsedFonts");async function bc(e,t){let n=await km(e,t),r=Pm(e);return(await Promise.all(n.filter(s=>r.has(wc(s.style.fontFamily))).map(s=>{let a=s.parentStyleSheet?s.parentStyleSheet.href:null;return Jo(s.cssText,a,t)}))).join(`
|
|
8
|
+
`)}o(bc,"getWebFontCSS");async function vc(e,t){let n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await bc(e,t);if(n){let r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}o(vc,"embedWebFonts");async function os(e,t={}){let{width:n,height:r}=Qi(e,t),i=await no(e,t,!0);return await vc(i,t),await ns(i,t),pc(i,t),await ac(i,n,r)}o(os,"toSvg");async function Tm(e,t={}){let{width:n,height:r}=Qi(e,t),i=await os(e,t),s=await fn(i),a=document.createElement("canvas"),l=a.getContext("2d"),c=t.pixelRatio||rc(),u=t.canvasWidth||n,d=t.canvasHeight||r;return a.width=u*c,a.height=d*c,t.skipAutoScale||ic(a),a.style.width=`${u}`,a.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,a.width,a.height)),l.drawImage(s,0,0,a.width,a.height),a}o(Tm,"toCanvas");async function Sc(e,t={}){let n=await Tm(e,t);return await sc(n)}o(Sc,"toBlob");function Am(e){let t=(0,Be.c)(10),n,r,i;t[0]!==e?({className:n,selected:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i):(n=t[1],r=t[2],i=t[3]);let s=i===!0?"":void 0,a;t[4]!==n?(a=Zt("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",n),t[4]=n,t[5]=a):a=t[5];let l;return t[6]!==r||t[7]!==s||t[8]!==a?(l=(0,N.jsx)("div",{"data-slot":"base-node","data-selected":s,className:a,...r}),t[6]=r,t[7]=s,t[8]=a,t[9]=l):l=t[9],l}o(Am,"da");function Dm(e){let t=(0,Be.c)(8),n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=Zt("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",n),t[3]=n,t[4]=i):i=t[4];let s;return t[5]!==r||t[6]!==i?(s=(0,N.jsx)("div",{"data-slot":"base-node-header",className:i,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}o(Dm,"ca");function zm(e){let t=(0,Be.c)(8),n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=Zt("flex flex-col",n),t[3]=n,t[4]=i):i=t[4];let s;return t[5]!==r||t[6]!==i?(s=(0,N.jsx)("div",{"data-slot":"base-node-content",className:i,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}o(zm,"ma");var Ec=o(e=>{let t=e.ref===void 0?e.type:`${e.type} \u2192 ${e.ref}`;return e.optional===!0?`${t}?`:t},"Nt"),Om=o(e=>{let t=(0,Be.c)(22),{data:n,selected:r}=e,i=It(),s;t[0]!==n.label||t[1]!==n.loadError||t[2]!==i?(s=n.loadError===!0?(0,N.jsx)("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${n.label}-error`,children:i("Columns unavailable")}):(0,N.jsx)("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"\u2014"}),t[0]=n.label,t[1]=n.loadError,t[2]=i,t[3]=s):s=t[3];let a=s,l=`sd-node-${n.label}`,c;t[4]!==n.label?(c=(0,N.jsx)("span",{className:"truncate font-mono text-xs font-semibold",title:n.label,children:n.label}),t[4]=n.label,t[5]=c):c=t[5];let u;t[6]!==n.tier?(u=(0,N.jsx)("span",{className:"ms-auto",children:(0,N.jsx)(fo,{tier:n.tier})}),t[6]=n.tier,t[7]=u):u=t[7];let d;t[8]!==c||t[9]!==u?(d=(0,N.jsxs)(Dm,{children:[c,u]}),t[8]=c,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==n.columns||t[12]!==n.label||t[13]!==a?(f=n.columns.length===0?a:n.columns.map(m=>(0,N.jsxs)("div",{className:Zt("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",m.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${n.label}-${m.name}`,children:[(0,N.jsx)(Bt,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:m.name,isConnectable:!1,position:J.Left,type:"target"}),(0,N.jsx)("span",{className:"truncate font-mono",title:m.name,children:m.name}),m.pk===!0&&(0,N.jsx)(qe,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),m.ref!==void 0&&(0,N.jsx)(qe,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),(0,N.jsx)("span",{className:"ms-auto truncate text-muted-foreground",title:Ec(m),children:Ec(m)}),(0,N.jsx)(Bt,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:m.name,isConnectable:!1,position:J.Right,type:"source"})]},m.name)),t[11]=n.columns,t[12]=n.label,t[13]=a,t[14]=f):f=t[14];let h;t[15]!==f?(h=(0,N.jsx)(zm,{children:f}),t[15]=f,t[16]=h):h=t[16];let p;return t[17]!==r||t[18]!==l||t[19]!==d||t[20]!==h?(p=(0,N.jsxs)(Am,{className:"w-64 overflow-hidden","data-testid":l,selected:r,children:[d,h]}),t[17]=r,t[18]=l,t[19]=d,t[20]=h,t[21]=p):p=t[21],p},"ua"),gn=1920,jo=1080,Mc=32,rs=o((e,t)=>{let n=globalThis.document.createElement("a");n.href=e,n.download=t,globalThis.document.body.append(n),n.click(),n.remove()},"bt"),$m=o((e,t,n="schema-diagram.json")=>{let r={edges:t,exportedAt:new Date().toISOString(),nodes:e},i=JSON.stringify(r,void 0,2),s=globalThis.URL.createObjectURL(new globalThis.Blob([i],{type:"application/json"}));rs(s,n),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(s)},0)},"pa"),kc=o((e,t,n,r)=>{let i=Kn(e),{x:s,y:a,zoom:l}=Lt(i,t,n,.1,2,r);return{transform:[s,a,l],zoom:l}},"_t"),Rm=o(async(e,t,n="schema-diagram.png")=>{let{transform:r}=kc(t,gn,jo,Mc),[i,s,a]=r,l=await Sc(e,{backgroundColor:"#ffffff",height:jo,style:{transform:`translate(${i.toString()}px, ${s.toString()}px) scale(${a.toString()})`,transformOrigin:"top left",width:`${gn.toString()}px`},width:gn});if(l===null)throw new us("INTERNAL","html-to-image produced no blob");let c=globalThis.URL.createObjectURL(l);rs(c,n),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(c)},0)},"ha"),Lm=o(async(e,t,n="schema-diagram.svg")=>{let{transform:r}=kc(t,gn,jo,Mc),[i,s,a]=r,l=await os(e,{backgroundColor:"#ffffff",height:jo,style:{transform:`translate(${i.toString()}px, ${s.toString()}px) scale(${a.toString()})`,transformOrigin:"top left",width:`${gn.toString()}px`},width:gn});rs(l,n)},"ga"),Hm=o(e=>38+Math.max(1,e)*28,"fa"),Bm=o((e,t)=>{let n=new Map;for(let a of e)n.set(a,[]);for(let a of t)a.to!==a.from&&n.has(a.from)&&n.has(a.to)&&n.get(a.from)?.push(a.to);let r=new Map,i=new Set,s=o(a=>{let l=r.get(a);if(l!==void 0)return l;if(i.has(a))return 0;i.add(a);let c=0;for(let u of n.get(a)??[])c=Math.max(c,s(u)+1);return i.delete(a),r.set(a,c),c},"s");for(let a of e)s(a);return r},"ba"),Vm=o((e,t,n)=>{let r=Bm(e,t),i=new Map,s=[];for(let a of e){let l=r.get(a)??0,c=i.get(l)??24;s.push({name:a,x:24+l*368,y:c}),i.set(l,c+Hm(n.get(a)??0)+36)}return s},"xa"),Fm={databaseSchema:Om},Pc={backgroundColor:Ye.shard.color},Tc={backgroundColor:Ye.global.color},Wm={global:!0,shard:!0},Xm=o(e=>{let t=e.find(n=>n.pk===!0)?.name;return t!==void 0?t:e.some(n=>n.name==="_id")?"_id":e.some(n=>n.name==="id")?"id":e[0]?.name??"_id"},"Na"),Ac=o(e=>e.flatMap(t=>t.columns.filter(n=>n.ref!==void 0).map(n=>({column:n.name,from:t.name,to:n.ref}))),"Et"),Ym=o((e,t)=>{let n=e.map(a=>a.name),r=new Map(e.map(a=>[a.name,a.columns.length])),i=Vm(n,Ac(e),r),s=new Map(e.map(a=>[a.name,a]));return i.flatMap(({name:a,x:l,y:c})=>{let u=s.get(a);return u===void 0?[]:[{data:{columns:u.columns,label:a,loadError:t,tier:u.tier},id:a,position:{x:l,y:c},type:"databaseSchema"}]})},"wa"),Zm=o(e=>{let t=new Map(e.map(n=>[n.name,n.columns]));return Ac(e).flatMap(n=>{let r=t.get(n.to)??[],i=t.get(n.from)??[],s=Xm(r);return!r.some(a=>a.name===s)||!i.some(a=>a.name===n.column)?[]:[{id:`${n.from}.${n.column}->${n.to}`,source:n.to,sourceHandle:s,target:n.from,targetHandle:n.column}]})},"Sa"),Um=o(()=>{let e=(0,Be.c)(15),t=It(),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,N.jsxs)("span",{className:"flex items-center gap-1",children:[(0,N.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:Pc}),Ye.shard.label]}),e[0]=n):n=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,N.jsxs)("span",{className:"flex items-center gap-1",children:[(0,N.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:Tc}),Ye.global.label]}),e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,N.jsx)(qe,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),e[2]=i):i=e[2];let s;e[3]!==t?(s=t("Primary key"),e[3]=t,e[4]=s):s=e[4];let a;e[5]!==s?(a=(0,N.jsxs)("span",{className:"flex items-center gap-1",children:[i,s]}),e[5]=s,e[6]=a):a=e[6];let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=(0,N.jsx)(qe,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),e[7]=l):l=e[7];let c;e[8]!==t?(c=t("Foreign key"),e[8]=t,e[9]=c):c=e[9];let u;e[10]!==c?(u=(0,N.jsxs)("span",{className:"flex items-center gap-1",children:[l,c]}),e[10]=c,e[11]=u):u=e[11];let d;return e[12]!==a||e[13]!==u?(d=(0,N.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[n,r,a,u]}),e[12]=a,e[13]=u,e[14]=d):d=e[14],d},"$a"),qm=o(({containerRef:e,testIdPrefix:t})=>{let n=It(),r=Ul(),{getEdges:i}=eo(),[s,a]=(0,re.useState)(null),l=o(async()=>{let h=e.current?.querySelector(".react-flow__viewport");if(h){a("png");try{await Rm(h,r,`${t}-schema-diagram.png`)}finally{a(null)}}},"i"),c=o(async()=>{let h=e.current?.querySelector(".react-flow__viewport");if(h){a("svg");try{await Lm(h,r,`${t}-schema-diagram.svg`)}finally{a(null)}}},"m"),u=o(()=>{a("json");try{$m(r,i(),`${t}-schema-diagram.json`)}finally{a(null)}},"d"),d=o(()=>{De(l())},"f"),f=o(()=>{De(c())},"g");return(0,N.jsx)(_t,{position:"top-right",children:(0,N.jsxs)(Cs,{children:[(0,N.jsxs)(_s,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${t}-export-trigger`,disabled:s!==null,children:[(0,N.jsx)(ms,{className:"size-3.5",icon:ps,strokeWidth:2}),n("Export")]}),(0,N.jsxs)(Ns,{align:"end",children:[(0,N.jsx)(ho,{"data-testid":`${t}-export-png`,disabled:s!==null,onClick:d,children:n("PNG")}),(0,N.jsx)(ho,{"data-testid":`${t}-export-svg`,disabled:s!==null,onClick:f,children:n("SVG")}),(0,N.jsx)(ho,{"data-testid":`${t}-export-json`,disabled:s!==null,onClick:u,children:n("JSON")})]})]})})},"ka"),Gm=o(e=>{let t=(0,Be.c)(75),{columnsError:n,tables:r,testIdPrefix:i}=e,s=It(),[a,l]=(0,re.useState)(Wm),[c,u]=(0,re.useState)(""),d;if(t[0]!==c||t[1]!==r||t[2]!==a){let fe=c.trim().toLowerCase();d=r.filter(Se=>a[Se.tier]&&Se.name.toLowerCase().includes(fe)),t[0]=c,t[1]=r,t[2]=a,t[3]=d}else d=t[3];let f=d,h=n??!1,p;t[4]!==h||t[5]!==f?(p=Ym(f,h),t[4]=h,t[5]=f,t[6]=p):p=t[6];let m=p,v;t[7]!==f?(v=Zm(f),t[7]=f,t[8]=v):v=t[8];let b=v,[y,E,g]=ql(m),[w,M,_]=Gl(b),k=(0,re.useRef)(null),P,T;t[9]!==m||t[10]!==E?(P=o(()=>{E(m)},"O"),T=[m,E],t[9]=m,t[10]=E,t[11]=P,t[12]=T):(P=t[11],T=t[12]),(0,re.useEffect)(P,T);let W,$;t[13]!==b||t[14]!==M?(W=o(()=>{M(b)},"A"),$=[b,M],t[13]=b,t[14]=M,t[15]=W,t[16]=$):(W=t[15],$=t[16]),(0,re.useEffect)(W,$);let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=o(fe=>{u(fe.target.value)},"G"),t[17]=V):V=t[17];let L=V,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=o(()=>{l(Km)},"de"),t[18]=x):x=t[18];let S=x,C;t[19]===Symbol.for("react.memo_cache_sentinel")?(C=o(()=>{l(Qm)},"ce"),t[19]=C):C=t[19];let I=C;if(r.length===0){let fe=`${i}-section`,Se=`${i}-empty`,me;t[20]!==s?(me=s("No tables to graph."),t[20]=s,t[21]=me):me=t[21];let we;t[22]!==Se||t[23]!==me?(we=(0,N.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":Se,children:me}),t[22]=Se,t[23]=me,t[24]=we):we=t[24];let be;return t[25]!==fe||t[26]!==we?(be=(0,N.jsx)("section",{className:"flex flex-col gap-2","data-testid":fe,children:we}),t[25]=fe,t[26]=we,t[27]=be):be=t[27],be}let O=`${i}-section`,A=`${i}-canvas`,B;t[28]===Symbol.for("react.memo_cache_sentinel")?(B=(0,N.jsx)(Ql,{}),t[28]=B):B=t[28];let F;t[29]!==s?(F=s("Find table\u2026"),t[29]=s,t[30]=F):F=t[30];let H=`${i}-find`,U;t[31]!==s?(U=s("Find table\u2026"),t[31]=s,t[32]=U):U=t[32];let Z;t[33]!==c||t[34]!==F||t[35]!==H||t[36]!==U?(Z=(0,N.jsx)(Mt,{"aria-label":F,className:"h-7 w-44 text-xs","data-testid":H,onChange:L,placeholder:U,value:c}),t[33]=c,t[34]=F,t[35]=H,t[36]=U,t[37]=Z):Z=t[37];let X;t[38]!==s?(X=s("Storage tiers"),t[38]=s,t[39]=X):X=t[39];let j=`${i}-tier-shard`,K=a.shard?"default":"outline",R;t[40]===Symbol.for("react.memo_cache_sentinel")?(R=(0,N.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:Pc}),t[40]=R):R=t[40];let Y;t[41]!==j||t[42]!==K||t[43]!==a.shard?(Y=(0,N.jsxs)(Ie,{"aria-pressed":a.shard,className:"gap-1.5","data-testid":j,onClick:S,size:"xs",type:"button",variant:K,children:[R,Ye.shard.label]}),t[41]=j,t[42]=K,t[43]=a.shard,t[44]=Y):Y=t[44];let te=`${i}-tier-global`,ee=a.global?"default":"outline",q;t[45]===Symbol.for("react.memo_cache_sentinel")?(q=(0,N.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:Tc}),t[45]=q):q=t[45];let G;t[46]!==te||t[47]!==ee||t[48]!==a.global?(G=(0,N.jsxs)(Ie,{"aria-pressed":a.global,className:"gap-1.5","data-testid":te,onClick:I,size:"xs",type:"button",variant:ee,children:[q,Ye.global.label]}),t[46]=te,t[47]=ee,t[48]=a.global,t[49]=G):G=t[49];let ne;t[50]!==X||t[51]!==Y||t[52]!==G?(ne=(0,N.jsxs)("div",{"aria-label":X,className:"flex items-center gap-1.5",role:"group",children:[Y,G]}),t[50]=X,t[51]=Y,t[52]=G,t[53]=ne):ne=t[53];let oe;t[54]!==Z||t[55]!==ne?(oe=(0,N.jsx)(_t,{position:"top-left",children:(0,N.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[Z,ne]})}),t[54]=Z,t[55]=ne,t[56]=oe):oe=t[56];let se,le,ve;t[57]===Symbol.for("react.memo_cache_sentinel")?(se=(0,N.jsx)(_t,{position:"bottom-left",children:(0,N.jsx)(Um,{})}),le=(0,N.jsx)(jl,{showInteractive:!1}),ve=(0,N.jsx)(tc,{pannable:!0,zoomable:!0}),t[57]=se,t[58]=le,t[59]=ve):(se=t[57],le=t[58],ve=t[59]);let he;t[60]!==i?(he=(0,N.jsx)(qm,{containerRef:k,testIdPrefix:i}),t[60]=i,t[61]=he):he=t[61];let pe;t[62]!==w||t[63]!==y||t[64]!==_||t[65]!==g||t[66]!==oe||t[67]!==he?(pe=(0,N.jsxs)(Zl,{edges:w,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:y,nodesConnectable:!1,nodeTypes:Fm,onEdgesChange:_,onNodesChange:g,children:[B,oe,se,le,ve,he]}),t[62]=w,t[63]=y,t[64]=_,t[65]=g,t[66]=oe,t[67]=he,t[68]=pe):pe=t[68];let xe;t[69]!==A||t[70]!==pe?(xe=(0,N.jsx)("div",{className:"h-[560px] w-full overflow-hidden rounded-xl border border-border bg-muted/20 shadow-xs","data-testid":A,ref:k,children:pe}),t[69]=A,t[70]=pe,t[71]=xe):xe=t[71];let Pe;return t[72]!==O||t[73]!==xe?(Pe=(0,N.jsx)("section",{className:"flex flex-col gap-2","data-testid":O,children:xe}),t[72]=O,t[73]=xe,t[74]=Pe):Pe=t[74],Pe},"Ca");function Km(e){return{...e,shard:!e.shard}}o(Km,"Ta");function Qm(e){return{...e,global:!e.global}}o(Qm,"_a");var Jm="/__lunora/schema-edit",jm=o(async e=>{let t=await fetch(Jm,{body:JSON.stringify(e),headers:{"Content-Type":"application/json","X-Lunora-Studio":"1"},method:"POST"}),n=await t.json();return n.needsMigration===!0?{kind:"needs-migration",message:n.message??"This edit needs a migration."}:t.ok&&n.tables!==void 0?{diagnostics:n.diagnostics??[],kind:"ok",tables:n.tables}:{kind:"error",message:n.error??`schema edit failed (${String(t.status)})`}},"za"),eg=[{label:"string",validator:"v.string()"},{label:"number",validator:"v.number()"},{label:"boolean",validator:"v.boolean()"},{label:"bigint",validator:"v.int64()"},{label:"bytes",validator:"v.bytes()"},{label:"any",validator:"v.any()"}],tg="v.string()",ng=o(e=>e.split(",").map(t=>t.trim()).filter(t=>t!==""),"Oa"),og=o(({onApplied:e,tableNames:t})=>{let n=It(),r=hs(),[i,s]=(0,re.useState)(null),[a,l]=(0,re.useState)(!1),[c,u]=(0,re.useState)(null),[d,f]=(0,re.useState)(""),[h,p]=(0,re.useState)(""),[m,v]=(0,re.useState)(tg),[b,y]=(0,re.useState)(t[0]??""),[E,g]=(0,re.useState)(""),[w,M]=(0,re.useState)(""),[_,k]=(0,re.useState)(!1),P=o(()=>{s(null),f(""),p(""),g(""),M(""),k(!1)},"O"),T=o(async X=>{l(!0),u(null);try{let j=await jm(X);u(j),j.kind==="ok"&&(e(j.tables),P())}catch(j){u({kind:"error",message:j instanceof Error?j.message:String(j)})}finally{l(!1)}},"F"),W=o(()=>{De(T({kind:"addTable",table:d.trim()}))},"A"),$=o(()=>{De(T({column:h.trim(),kind:"addOptionalColumn",table:b,validator:m}))},"ie"),V=o(()=>{De(T({fields:ng(w),kind:"addIndex",name:E.trim(),table:b,unique:_}))},"G"),L=o(()=>{u(null),s("addTable")},"Se"),x=o(()=>{u(null),s("addColumn")},"de"),S=o(()=>{u(null),s("addIndex")},"w"),C=o(()=>{s("destructive"),u({kind:"needs-migration",message:n("This edit changes stored data and must go through a migration. Review the migration before applying.")})},"ce"),I=o(X=>{f(X.target.value)},"S"),O=o(X=>{p(X.target.value)},"me"),A=o(X=>{v(X.target.value)},"te"),B=o(X=>{y(X.target.value)},"E"),F=o(X=>{g(X.target.value)},"ae"),H=o(X=>{M(X.target.value)},"q"),U=o(X=>{k(X.target.checked)},"K"),Z=o(()=>{De(r({to:"/migrations"}))},"L");return(0,N.jsxs)(io,{"data-testid":"sc-editor",size:"sm",children:[(0,N.jsxs)(so,{children:[(0,N.jsx)(ao,{children:n("Edit schema")}),(0,N.jsx)(lo,{children:n("Adds a table, column, or index to lunora/schema.ts and reruns codegen.")})]}),(0,N.jsxs)(co,{children:[(0,N.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,N.jsx)(Ie,{"data-testid":"sc-editor-add-table",onClick:L,size:"xs",type:"button",variant:i==="addTable"?"default":"outline",children:n("Add table")}),(0,N.jsx)(Ie,{"data-testid":"sc-editor-add-column",disabled:t.length===0,onClick:x,size:"xs",type:"button",variant:i==="addColumn"?"default":"outline",children:n("Add column")}),(0,N.jsx)(Ie,{"data-testid":"sc-editor-add-index",disabled:t.length===0,onClick:S,size:"xs",type:"button",variant:i==="addIndex"?"default":"outline",children:n("Add index")}),(0,N.jsx)(Ie,{"data-testid":"sc-editor-destructive",disabled:t.length===0,onClick:C,size:"xs",type:"button",variant:i==="destructive"?"default":"ghost",children:n("Rename / drop / change type\u2026")})]}),i==="addTable"&&(0,N.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-table-form",children:[(0,N.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,N.jsx)(Ge,{htmlFor:"sc-editor-table-name",children:n("Table name")}),(0,N.jsx)(Mt,{"data-testid":"sc-editor-table-name",id:"sc-editor-table-name",onChange:I,value:d})]}),(0,N.jsx)(Ie,{"data-testid":"sc-editor-table-apply",disabled:a||d.trim()==="",onClick:W,size:"xs",type:"button",children:n(a?"Applying\u2026":"Apply")}),(0,N.jsx)(Ie,{onClick:P,size:"xs",type:"button",variant:"ghost",children:n("Cancel")})]}),i==="addColumn"&&(0,N.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-column-form",children:[(0,N.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,N.jsx)(Ge,{htmlFor:"sc-editor-column-table",children:n("Table name")}),(0,N.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-table",id:"sc-editor-column-table",onChange:B,value:b,children:t.map(X=>(0,N.jsx)("option",{value:X,children:X},X))})]}),(0,N.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,N.jsx)(Ge,{htmlFor:"sc-editor-column-name",children:n("Column name")}),(0,N.jsx)(Mt,{"data-testid":"sc-editor-column-name",id:"sc-editor-column-name",onChange:O,value:h})]}),(0,N.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,N.jsx)(Ge,{htmlFor:"sc-editor-column-type",children:n("Column type")}),(0,N.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-type",id:"sc-editor-column-type",onChange:A,value:m,children:eg.map(X=>(0,N.jsx)("option",{value:X.validator,children:X.label},X.validator))})]}),(0,N.jsx)("span",{className:"text-[11px] text-muted-foreground",children:n("Optional")}),(0,N.jsx)(Ie,{"data-testid":"sc-editor-column-apply",disabled:a||h.trim()===""||b==="",onClick:$,size:"xs",type:"button",children:n(a?"Applying\u2026":"Apply")}),(0,N.jsx)(Ie,{onClick:P,size:"xs",type:"button",variant:"ghost",children:n("Cancel")})]}),i==="addIndex"&&(0,N.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-index-form",children:[(0,N.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,N.jsx)(Ge,{htmlFor:"sc-editor-index-table",children:n("Table name")}),(0,N.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-index-table",id:"sc-editor-index-table",onChange:B,value:b,children:t.map(X=>(0,N.jsx)("option",{value:X,children:X},X))})]}),(0,N.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,N.jsx)(Ge,{htmlFor:"sc-editor-index-name",children:n("Index name")}),(0,N.jsx)(Mt,{"data-testid":"sc-editor-index-name",id:"sc-editor-index-name",onChange:F,value:E})]}),(0,N.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,N.jsx)(Ge,{htmlFor:"sc-editor-index-fields",children:n("Index fields (comma-separated)")}),(0,N.jsx)(Mt,{"data-testid":"sc-editor-index-fields",id:"sc-editor-index-fields",onChange:H,value:w})]}),(0,N.jsxs)(Ge,{className:"flex items-center gap-1 text-xs",htmlFor:"sc-editor-index-unique",children:[(0,N.jsx)("input",{checked:_,"data-testid":"sc-editor-index-unique",id:"sc-editor-index-unique",onChange:U,type:"checkbox"}),(0,N.jsx)("span",{className:"text-muted-foreground",children:n("Unique")})]}),(0,N.jsx)(Ie,{"data-testid":"sc-editor-index-apply",disabled:a||E.trim()===""||w.trim()==="",onClick:V,size:"xs",type:"button",children:n(a?"Applying\u2026":"Apply")}),(0,N.jsx)(Ie,{onClick:P,size:"xs",type:"button",variant:"ghost",children:n("Cancel")})]}),c?.kind==="error"&&(0,N.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"sc-editor-error",role:"alert",children:c.message}),c?.kind==="needs-migration"&&(0,N.jsxs)("div",{className:"mt-3 flex flex-col gap-2","data-testid":"sc-editor-needs-migration",children:[(0,N.jsx)("p",{className:"text-sm text-warning",role:"alert",children:n("This edit changes stored data and must go through a migration. Review the migration before applying.")}),(0,N.jsx)(Ie,{className:"self-start","data-testid":"sc-editor-open-migrations",onClick:Z,size:"xs",type:"button",variant:"outline",children:n("Open Migrations")})]}),c?.kind==="ok"&&c.diagnostics.length>0&&(0,N.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"sc-editor-diagnostics",children:[(0,N.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:n("Codegen reported diagnostics:")}),(0,N.jsx)("ul",{className:"flex flex-col gap-0.5",children:c.diagnostics.map(X=>(0,N.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:X},X))})]})]})]})},"Fa"),rg=En(Nn.listTables),ig=En(Nn.listTableIndexes),sg=En(Nn.readTablePage),ag=En(Nn.describeTables),lg={},Cc=[],_c=[],cg=o(e=>{let t=(0,Be.c)(5),{open:n}=e,r=n&&"rotate-90",i;t[0]!==r?(i=Zt("size-3.5 shrink-0 text-muted-foreground transition-transform duration-150",r),t[0]=r,t[1]=i):i=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,N.jsx)("path",{d:"m9 6 6 6-6 6"}),t[2]=s):s=t[2];let a;return t[3]!==i?(a=(0,N.jsx)("svg",{"aria-hidden":"true",className:i,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:s}),t[3]=i,t[4]=a):a=t[4],a},"qa"),Nc=o(e=>{let t=(0,Be.c)(20),{children:n,expanded:r,name:i,onToggle:s,rowCount:a,rowTestId:l,toggleTestId:c}=e,u;t[0]!==r?(u=(0,N.jsx)(cg,{open:r}),t[0]=r,t[1]=u):u=t[1];let d;t[2]!==i?(d=(0,N.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:i,children:i}),t[2]=i,t[3]=d):d=t[3];let f;t[4]!==a?(f=(0,N.jsxs)("span",{className:"ms-auto shrink-0 text-xs text-muted-foreground tabular-nums",children:["(",a,")"]}),t[4]=a,t[5]=f):f=t[5];let h;t[6]!==r||t[7]!==s||t[8]!==u||t[9]!==d||t[10]!==f||t[11]!==c?(h=(0,N.jsxs)("button",{"aria-expanded":r,className:"flex w-full items-center gap-2 px-3 py-2 text-start transition-colors hover:bg-muted/50 aria-expanded:bg-muted/40","data-testid":c,onClick:s,type:"button",children:[u,d," ",f]}),t[6]=r,t[7]=s,t[8]=u,t[9]=d,t[10]=f,t[11]=c,t[12]=h):h=t[12];let p;t[13]!==n||t[14]!==r?(p=r&&(0,N.jsx)("div",{className:"px-3 pb-3 ps-8",children:n}),t[13]=n,t[14]=r,t[15]=p):p=t[15];let m;return t[16]!==l||t[17]!==h||t[18]!==p?(m=(0,N.jsxs)("li",{className:"border-t border-border/60 first:border-t-0","data-testid":l,children:[h,p]}),t[16]=l,t[17]=h,t[18]=p,t[19]=m):m=t[19],m},"$t"),Ic=o(e=>{let t=(0,Be.c)(5),{columns:n,testId:r}=e,i;t[0]!==n?(i=n.map(dg),t[0]=n,t[1]=i):i=t[1];let s;return t[2]!==i||t[3]!==r?(s=(0,N.jsx)("ul",{className:"flex flex-wrap gap-1.5 pt-1","data-testid":r,children:i}),t[2]=i,t[3]=r,t[4]=s):s=t[4],s},"kt"),ug=o(e=>{let t=(0,Be.c)(10),{heading:n,indexes:r,testId:i}=e,s;t[0]!==n?(s=(0,N.jsx)("p",{className:"mb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:n}),t[0]=n,t[1]=s):s=t[1];let a;t[2]!==r?(a=r.map(fg),t[2]=r,t[3]=a):a=t[3];let l;t[4]!==a||t[5]!==i?(l=(0,N.jsx)("ul",{className:"flex flex-col gap-1","data-testid":i,children:a}),t[4]=a,t[5]=i,t[6]=l):l=t[6];let c;return t[7]!==s||t[8]!==l?(c=(0,N.jsxs)("div",{className:"pt-3",children:[s,l]}),t[7]=s,t[8]=l,t[9]=c):c=t[9],c},"Ua"),MS=o(e=>{let t=(0,Be.c)(126),{initialShardKey:n,initialTable:r,schemaEditable:i}=e,s=fs(),a=It(),[l,c]=(0,re.useState)("list"),[u,d]=(0,re.useState)(n??""),[f,h]=(0,re.useState)(""),[p,m]=(0,re.useState)(null),[v,b]=(0,re.useState)(null),y;t[0]===Symbol.for("react.memo_cache_sentinel")?(y={},t[0]=y):y=t[0];let[E,g]=(0,re.useState)(y),w;t[1]===Symbol.for("react.memo_cache_sentinel")?(w={},t[1]=w):w=t[1];let[M,_]=(0,re.useState)(w),[k,P]=(0,re.useState)(null),T;t[2]===Symbol.for("react.memo_cache_sentinel")?(T={},t[2]=T):T=t[2];let[W,$]=(0,re.useState)(T),V;t[3]===Symbol.for("react.memo_cache_sentinel")?(V={},t[3]=V):V=t[3];let[L,x]=(0,re.useState)(V),[S,C]=(0,re.useState)(null),[I,O]=(0,re.useState)(null),A;t[4]===Symbol.for("react.memo_cache_sentinel")?(A={},t[4]=A):A=t[4];let[B,F]=(0,re.useState)(A),[H,U]=(0,re.useState)(null),Z;t[5]!==s?(Z=o(async Q=>{b(null);try{let ae=await s.query(rg,{},Cn(Q));vs(Q),m(ae),g({}),_({}),P(null),$(ce=>Object.fromEntries(Object.entries(ce).filter(Te=>{let[_e]=Te;return _e!==Q}))),x(ce=>Object.fromEntries(Object.entries(ce).filter(Te=>{let[_e]=Te;return _e!==Q})))}catch(ae){let ce=ae;m(null),b(_n(ce))}},"L"),t[5]=s,t[6]=Z):Z=t[6];let X=Z,j;t[7]!==s?(j=o(async()=>{O(null);try{C(await s.listGlobalTables())}catch(Q){let ae=Q;C(null),O(_n(ae))}},"$"),t[7]=s,t[8]=j):j=t[8];let K=j,R;t[9]!==u?(R=u.trim(),t[9]=u,t[10]=R):R=t[10];let Y=Es(R,400),te,ee;t[11]!==Y||t[12]!==X||t[13]!==K?(ee=o(()=>{De(X(Y)),De(K())},"ye"),te=[X,K,Y],t[11]=Y,t[12]=X,t[13]=K,t[14]=te,t[15]=ee):(te=t[14],ee=t[15]),(0,re.useEffect)(ee,te);let q;t[16]!==s||t[17]!==E||t[18]!==k||t[19]!==u?(q=o(async Q=>{if(k===Q){P(null);return}P(Q);let ae=`${u}:${Q}`;if(E[ae]!==void 0)return;let[ce,Te]=await Promise.allSettled([s.query(sg,{limit:1,offset:0,table:Q},Cn(u)),s.query(ig,{table:Q},Cn(u))]);ce.status==="fulfilled"?g(_e=>({..._e,[ae]:ce.value.columns})):b(_n(ce.reason)),Te.status==="fulfilled"&&_(_e=>({..._e,[ae]:Te.value.indexes}))},"pe"),t[16]=s,t[17]=E,t[18]=k,t[19]=u,t[20]=q):q=t[20];let G=q,ne;t[21]!==s||t[22]!==B||t[23]!==H?(ne=o(async Q=>{if(H===Q){U(null);return}if(U(Q),B[Q]===void 0)try{let ae=await s.readGlobalTablePage({limit:1,offset:0,table:Q});F(ce=>({...ce,[Q]:ae.columns}))}catch(ae){O(_n(ae))}},"H"),t[21]=s,t[22]=B,t[23]=H,t[24]=ne):ne=t[24];let oe=ne,se=(0,re.useRef)(void 0),le,ve;t[25]!==r||t[26]!==p||t[27]!==G?(le=o(()=>{r===void 0||p===null||se.current===r||p.some(Q=>Q.name===r)&&(se.current=r,De(G(r)))},"he"),ve=[r,p,G],t[25]=r,t[26]=p,t[27]=G,t[28]=le,t[29]=ve):(le=t[28],ve=t[29]),(0,re.useEffect)(le,ve);let he;t[30]!==s?(he=o(async(Q,ae,ce)=>{let[Te,_e]=await Promise.all([Promise.allSettled([s.query(ag,{tables:[...ae,...ce]},Cn(Q))]),Promise.all(ce.map(async Re=>{let Nt=await Promise.allSettled([s.readGlobalTablePage({limit:1,offset:0,table:Re})]),ro=Nt[0].status==="fulfilled"?Nt[0].value:void 0;return{columns:ro?.columns??[],refs:ro?.refs??{},table:Re}}))]),oo=Te[0].status==="fulfilled"?Te[0].value?.columnsByTable??{}:{},or=Te[0].status==="rejected",rr=new Map(_e.map(hg)),ir=[...ae,...ce].map(Re=>{let Nt=oo[Re]??[];return[Re,Nt.length>0?Nt:rr.get(Re)??[]]});$(Re=>({...Re,[Q]:Object.fromEntries(ir)})),x(Re=>({...Re,[Q]:or}))},"J"),t[30]=s,t[31]=he):he=t[31];let pe=he,xe,Pe;t[32]!==I||t[33]!==S||t[34]!==pe||t[35]!==W||t[36]!==u||t[37]!==p||t[38]!==l?(xe=o(()=>{l!=="graph"||p===null||S===null&&I===null||W[u]!==void 0||De(pe(u,p.map(pg),(S??[]).map(mg)))},"W"),Pe=[l,p,S,I,u,W,pe],t[32]=I,t[33]=S,t[34]=pe,t[35]=W,t[36]=u,t[37]=p,t[38]=l,t[39]=xe,t[40]=Pe):(xe=t[39],Pe=t[40]),(0,re.useEffect)(xe,Pe);let fe=W[u]??lg,Se;if(t[41]!==fe||t[42]!==S||t[43]!==p){let Q;t[45]!==fe?(Q=o(_e=>({columns:fe[_e.name]??_c,name:_e.name,tier:"shard"}),"c"),t[45]=fe,t[46]=Q):Q=t[46];let ae=(p??[]).map(Q),ce;t[47]!==fe?(ce=o(_e=>({columns:fe[_e.name]??_c,name:_e.name,tier:"global"}),"N"),t[47]=fe,t[48]=ce):ce=t[48];let Te=(S??[]).map(ce);Se=[...ae,...Te],t[41]=fe,t[42]=S,t[43]=p,t[44]=Se}else Se=t[44];let me=Se,we;if(t[49]!==f||t[50]!==p){let Q=f.trim().toLowerCase();we=(p??[]).filter(ae=>ae.name.toLowerCase().includes(Q)),t[49]=f,t[50]=p,t[51]=we}else we=t[51];let be=we,$e;if(t[52]!==S||t[53]!==f){let Q=f.trim().toLowerCase();$e=(S??[]).filter(ae=>ae.name.toLowerCase().includes(Q)),t[52]=S,t[53]=f,t[54]=$e}else $e=t[54];let Xe=$e,tt;t[55]===Symbol.for("react.memo_cache_sentinel")?(tt=o(()=>{c("list")},"He"),t[55]=tt):tt=t[55];let er=tt,Vt;t[56]===Symbol.for("react.memo_cache_sentinel")?(Vt=o(()=>{c("graph")},"Je"),t[56]=Vt):Vt=t[56];let tr=Vt,Ft;t[57]===Symbol.for("react.memo_cache_sentinel")?(Ft=o(Q=>{h(Q.target.value)},"Ve"),t[57]=Ft):Ft=t[57];let nr=Ft,Wt;t[58]!==X||t[59]!==u?(Wt=o(Q=>{De(X(u))},"We"),t[58]=X,t[59]=u,t[60]=Wt):Wt=t[60];let yn=Wt,nt;t[61]!==p?(nt=p??[],t[61]=p,t[62]=nt):nt=t[62];let Xt;t[63]!==nt?(Xt=nt.map(gg),t[63]=nt,t[64]=Xt):Xt=t[64];let xn=Xt,ot;t[65]!==u?(ot=(0,N.jsx)(Ss,{onChange:d,testId:"sc-shard-input",value:u}),t[65]=u,t[66]=ot):ot=t[66];let rt;t[67]!==a?(rt=a("Schema view"),t[67]=a,t[68]=rt):rt=t[68];let wn=l==="list",bn=l==="list"?"default":"outline",it;t[69]!==a?(it=a("Table list"),t[69]=a,t[70]=it):it=t[70];let st;t[71]!==wn||t[72]!==bn||t[73]!==it?(st=(0,N.jsx)(Ie,{"aria-pressed":wn,"data-testid":"sc-view-list",onClick:er,size:"xs",type:"button",variant:bn,children:it}),t[71]=wn,t[72]=bn,t[73]=it,t[74]=st):st=t[74];let vn=l==="graph",Sn=l==="graph"?"default":"outline",at;t[75]!==a?(at=a("Graph"),t[75]=a,t[76]=at):at=t[76];let lt;t[77]!==vn||t[78]!==Sn||t[79]!==at?(lt=(0,N.jsx)(Ie,{"aria-pressed":vn,"data-testid":"sc-view-graph",onClick:tr,size:"xs",type:"button",variant:Sn,children:at}),t[77]=vn,t[78]=Sn,t[79]=at,t[80]=lt):lt=t[80];let ct;t[81]!==rt||t[82]!==st||t[83]!==lt?(ct=(0,N.jsxs)("div",{"aria-label":rt,className:"flex gap-1.5","data-testid":"sc-view-toggle",role:"group",children:[st,lt]}),t[81]=rt,t[82]=st,t[83]=lt,t[84]=ct):ct=t[84];let ut;t[85]!==ot||t[86]!==ct?(ut=(0,N.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[ot,ct]}),t[85]=ot,t[86]=ct,t[87]=ut):ut=t[87];let dt;t[88]!==yn||t[89]!==i||t[90]!==xn?(dt=i===!0&&(0,N.jsx)(og,{onApplied:yn,tableNames:xn}),t[88]=yn,t[89]=i,t[90]=xn,t[91]=dt):dt=t[91];let ft;t[92]!==a||t[93]!==f||t[94]!==l?(ft=l==="list"&&(0,N.jsx)(Mt,{"aria-label":a("Filter tables"),className:"h-8 max-w-xs","data-testid":"sc-filter",onChange:nr,placeholder:a("Filter tables"),value:f}),t[92]=a,t[93]=f,t[94]=l,t[95]=ft):ft=t[95];let ht;t[96]!==me||t[97]!==v||t[98]!==I||t[99]!==L||t[100]!==u||t[101]!==l?(ht=l==="graph"&&(0,N.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"sc-graph-view",children:[v!==null&&(0,N.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:v}),I!==null&&(0,N.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:I}),(0,N.jsx)(Gm,{columnsError:L[u]===!0,tables:me,testIdPrefix:"sc-graph"})]}),t[96]=me,t[97]=v,t[98]=I,t[99]=L,t[100]=u,t[101]=l,t[102]=ht):ht=t[102];let pt;t[103]!==E||t[104]!==v||t[105]!==k||t[106]!==Xe||t[107]!==be||t[108]!==B||t[109]!==I||t[110]!==H||t[111]!==S||t[112]!==M||t[113]!==u||t[114]!==a||t[115]!==p||t[116]!==G||t[117]!==oe||t[118]!==l?(pt=l==="list"&&(0,N.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,N.jsxs)(io,{"data-testid":"sc-shard-section",size:"sm",children:[(0,N.jsxs)(so,{children:[(0,N.jsxs)("div",{className:"flex items-center gap-2",children:[(0,N.jsx)(fo,{tier:"shard"}),(0,N.jsx)(ao,{children:a("Shard tables")}),p!==null&&(0,N.jsx)(qe,{className:"ms-auto tabular-nums",variant:"outline",children:be.length})]}),(0,N.jsx)(lo,{children:Ye.shard.hint})]}),(0,N.jsxs)(co,{children:[v!==null&&(0,N.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:v}),p!==null&&p.length===0&&(0,N.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-empty",children:a("No tables in this shard.")}),p!==null&&p.length>0&&be.length===0&&(0,N.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-no-match",children:a("No tables match your filter.")}),be.length>0&&(0,N.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-table-list",children:be.map(Q=>{let ae=`${u}:${Q.name}`,ce=M[ae]??[];return(0,N.jsxs)(Nc,{expanded:k===Q.name,name:Q.name,onToggle:o(()=>{De(G(Q.name))},"onToggle"),rowCount:Q.rowCount,rowTestId:`sc-table-${Q.name}`,toggleTestId:`sc-toggle-${Q.name}`,children:[(0,N.jsx)(Ic,{columns:E[ae]??Cc,testId:`sc-columns-${Q.name}`}),ce.length>0&&(0,N.jsx)(ug,{heading:a("Indexes"),indexes:ce,testId:`sc-indexes-${Q.name}`})]},Q.name)})})]})]}),(0,N.jsxs)(io,{"data-testid":"sc-global-section",size:"sm",children:[(0,N.jsxs)(so,{children:[(0,N.jsxs)("div",{className:"flex items-center gap-2",children:[(0,N.jsx)(fo,{tier:"global"}),(0,N.jsx)(ao,{children:a("Global tables (D1)")}),S!==null&&(0,N.jsx)(qe,{className:"ms-auto tabular-nums",variant:"outline",children:Xe.length})]}),(0,N.jsx)(lo,{children:Ye.global.hint})]}),(0,N.jsxs)(co,{children:[I!==null&&(0,N.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:I}),S!==null&&S.length===0&&(0,N.jsx)(gs,{description:Ye.global.hint,testId:"sc-global-empty",title:a("No global tables.")}),S!==null&&S.length>0&&Xe.length===0&&(0,N.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-global-no-match",children:a("No tables match your filter.")}),Xe.length>0&&(0,N.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-global-table-list",children:Xe.map(Q=>(0,N.jsx)(Nc,{expanded:H===Q.name,name:Q.name,onToggle:o(()=>{De(oe(Q.name))},"onToggle"),rowCount:Q.rowCount,rowTestId:`sc-global-table-${Q.name}`,toggleTestId:`sc-global-toggle-${Q.name}`,children:(0,N.jsx)(Ic,{columns:B[Q.name]??Cc,testId:`sc-global-columns-${Q.name}`})},Q.name))})]})]})]}),t[103]=E,t[104]=v,t[105]=k,t[106]=Xe,t[107]=be,t[108]=B,t[109]=I,t[110]=H,t[111]=S,t[112]=M,t[113]=u,t[114]=a,t[115]=p,t[116]=G,t[117]=oe,t[118]=l,t[119]=pt):pt=t[119];let Yt;return t[120]!==ut||t[121]!==dt||t[122]!==ft||t[123]!==ht||t[124]!==pt?(Yt=(0,N.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schema",children:[ut,dt,ft,ht,pt]}),t[120]=ut,t[121]=dt,t[122]=ft,t[123]=ht,t[124]=pt,t[125]=Yt):Yt=t[125],Yt},"vl");function dg(e){return(0,N.jsx)("li",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:e},e)}o(dg,"Ba");function fg(e){return(0,N.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,N.jsx)("span",{className:"font-mono",children:e.name}),(0,N.jsx)(qe,{variant:"outline",children:e.type}),e.unique===!0&&(0,N.jsx)(qe,{variant:"secondary",children:"unique"}),(0,N.jsx)("span",{className:"text-muted-foreground",children:e.fields.join(", ")})]},`${e.type}:${e.name}`)}o(fg,"Ga");function hg(e){let{columns:t,refs:n,table:r}=e;return[r,t.map(i=>{let s=n[i];return s===void 0?{name:i,optional:!1,type:""}:{name:i,optional:!1,ref:s,type:"id"}})]}o(hg,"Ka");function pg(e){return e.name}o(pg,"Da");function mg(e){return e.name}o(mg,"Ha");function gg(e){return e.name}o(gg,"Ja");export{MS as SchemaViewer};
|