orcaq 1.0.30 → 1.0.32
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DzJD_fir.js → -p9JbKy8.js} +3 -3
- package/.output/public/_nuxt/019vQzZn.js +1 -0
- package/.output/public/_nuxt/0lRW_xjL.js +1 -0
- package/.output/public/_nuxt/{BV6TSzbC.js → 3UJtAGbG.js} +3 -2
- package/.output/public/_nuxt/ACOLmAuq.js +15 -0
- package/.output/public/_nuxt/B1X10hvy.js +261 -0
- package/.output/public/_nuxt/B27ECqWz.js +220 -0
- package/.output/public/_nuxt/B6EI6PpE.js +1 -0
- package/.output/public/_nuxt/B8JnYxjr.js +2 -0
- package/.output/public/_nuxt/B9Mt45db.js +1 -0
- package/.output/public/_nuxt/B9zSkyFO.js +1 -0
- package/.output/public/_nuxt/BCcTASq_.js +139 -0
- package/.output/public/_nuxt/BJxYuvXF.js +7 -0
- package/.output/public/_nuxt/{FyrDS92w.js → BM4vnZvX.js} +101 -101
- package/.output/public/_nuxt/BNYR501z.js +1 -0
- package/.output/public/_nuxt/BQOaPJzs.js +145 -0
- package/.output/public/_nuxt/BUDtG__q.js +1 -0
- package/.output/public/_nuxt/BVLVn__t.js +9 -0
- package/.output/public/_nuxt/{KlH93fIm.js → BY1l0S_M.js} +1 -1
- package/.output/public/_nuxt/{ClnidwGv.js → B_PBOfFN.js} +2 -2
- package/.output/public/_nuxt/{y68LmDX2.js → BcvJQkv0.js} +1 -1
- package/.output/public/_nuxt/{llxtZpFD.js → BdN9B2_l.js} +2 -2
- package/.output/public/_nuxt/BflvengI.js +1 -0
- package/.output/public/_nuxt/BgolbRTO.js +1 -0
- package/.output/public/_nuxt/BhUkpIlA.js +1 -0
- package/.output/public/_nuxt/BsoQBloB.js +24 -0
- package/.output/public/_nuxt/BwISH3M4.js +1 -0
- package/.output/public/_nuxt/C-M4q4KX.js +1 -0
- package/.output/public/_nuxt/C07rlnlv.js +1 -0
- package/.output/public/_nuxt/C27bL9Es.js +1 -0
- package/.output/public/_nuxt/C2Ziircr.js +1 -0
- package/.output/public/_nuxt/C3NWXcpd.js +39 -0
- package/.output/public/_nuxt/C5p44jKD.js +1 -0
- package/.output/public/_nuxt/C617vhDd.js +1 -0
- package/.output/public/_nuxt/C6Vqzp-9.js +7 -0
- package/.output/public/_nuxt/C7C8tPlA.js +65 -0
- package/.output/public/_nuxt/C8S0o4Gy.js +1 -0
- package/.output/public/_nuxt/CHOD7i6O.js +4 -0
- package/.output/public/_nuxt/CNlsVoWh.js +1 -0
- package/.output/public/_nuxt/CQb_mUBo.js +1 -0
- package/.output/public/_nuxt/{MLO1tLKS.js → CSTzT9hP.js} +1 -1
- package/.output/public/_nuxt/CVliJ52o.js +162 -0
- package/.output/public/_nuxt/CWGdTiOD.js +1 -0
- package/.output/public/_nuxt/{CzF1NEwP.js → CWkPMmwS.js} +2 -2
- package/.output/public/_nuxt/CffFK_qY.js +189 -0
- package/.output/public/_nuxt/Cgy4ijjN.js +67 -0
- package/.output/public/_nuxt/ChkFTcxr.js +43 -0
- package/.output/public/_nuxt/Cjgqfl1g.js +10 -0
- package/.output/public/_nuxt/ClBBUcFW.js +1 -0
- package/.output/public/_nuxt/{DFd73eNR.js → ClYziJpO.js} +1 -1
- package/.output/public/_nuxt/CmKTTxBW.js +1 -0
- package/.output/public/_nuxt/CuRyxljq.js +1 -0
- package/.output/public/_nuxt/CvTHaPAO.js +1 -0
- package/.output/public/_nuxt/{HQyqkOpZ.js → CwdIiq6J.js} +1 -1
- package/.output/public/_nuxt/Cx4Bnfq1.js +2 -0
- package/.output/public/_nuxt/CyJtwmzi.js +331 -0
- package/.output/public/_nuxt/{ubO-cWd-.js → D-H6_V16.js} +1 -1
- package/.output/public/_nuxt/D-SDqguC.js +1 -0
- package/.output/public/_nuxt/{6I72R6kW.js → D-XwprNU.js} +1 -1
- package/.output/public/_nuxt/D3G5Xy_-.js +1 -0
- package/.output/public/_nuxt/D4jn2f-6.js +255 -0
- package/.output/public/_nuxt/D9o5Pdvp.js +1 -0
- package/.output/public/_nuxt/DDYV6jDr.js +1 -0
- package/.output/public/_nuxt/DFArp87o.js +1 -0
- package/.output/public/_nuxt/{C_CjS9Yt.js → DFZIXzfU.js} +1 -1
- package/.output/public/_nuxt/DHRNt0p9.js +1 -0
- package/.output/public/_nuxt/DLHYqHwF.js +24 -0
- package/.output/public/_nuxt/{D8pqASdN.js → DLKku6fV.js} +1 -1
- package/.output/public/_nuxt/DNZpxuwM.js +1 -0
- package/.output/public/_nuxt/DRKnK1N_.js +132 -0
- package/.output/public/_nuxt/DVxTxYP4.js +34 -0
- package/.output/public/_nuxt/{DQiMjOqm.js → DWgjNKGq.js} +1 -1
- package/.output/public/_nuxt/DX6XiGOO.js +1 -0
- package/.output/public/_nuxt/DYm57BZk.js +2 -0
- package/.output/public/_nuxt/DaQw8gVp.js +1 -0
- package/.output/public/_nuxt/DcfsxCxL.js +36 -0
- package/.output/public/_nuxt/DgnsV5Qb.js +1 -0
- package/.output/public/_nuxt/DkY69STm.js +292 -0
- package/.output/public/_nuxt/DkggUtNN.js +30 -0
- package/.output/public/_nuxt/Dnx67EG9.js +68 -0
- package/.output/public/_nuxt/{DVe5MHjS.js → DnxDSFih.js} +1 -1
- package/.output/public/_nuxt/Do5Fyo7J.js +1 -0
- package/.output/public/_nuxt/{h2fvG4Xe.js → Dqirx7MF.js} +1 -1
- package/.output/public/_nuxt/{WrapperErdDiagram.DsE2QNGr.css → ErdDiagram.Cnqgwj9d.css} +1 -1
- package/.output/public/_nuxt/FIJP2AmN.js +73 -0
- package/.output/public/_nuxt/Gi6I4Gst.js +1 -0
- package/.output/public/_nuxt/{C26aAkUg.js → GoTwJjoS.js} +1 -1
- package/.output/public/_nuxt/Hs25HoUO.js +22 -0
- package/.output/public/_nuxt/IitECNfD.js +89 -0
- package/.output/public/_nuxt/J2CvNR3L.js +1 -0
- package/.output/public/_nuxt/LFK46Fls.js +61 -0
- package/.output/public/_nuxt/LK6Q8l0D.js +1 -0
- package/.output/public/_nuxt/Oh9SO2qg.js +1 -0
- package/.output/public/_nuxt/{CtRc_P0d.js → P_8UoGnr.js} +2 -2
- package/.output/public/_nuxt/UqWhjgOc.js +10 -0
- package/.output/public/_nuxt/V5yaR3hv.js +2 -0
- package/.output/public/_nuxt/XWTuAj6n.js +1 -0
- package/.output/public/_nuxt/XqwbcqcW.js +1 -0
- package/.output/public/_nuxt/ZdjmUBoX.js +70 -0
- package/.output/public/_nuxt/_8UrUcVF.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/27a307c3-bfc5-4ccd-94b8-387eb94981bb.json +1 -0
- package/.output/public/_nuxt/cKBf5-av.js +1 -0
- package/.output/public/_nuxt/c_huf6xz.js +162 -0
- package/.output/public/_nuxt/entry.DeK5kcSi.css +1 -0
- package/.output/public/_nuxt/gO22NLpn.js +1 -0
- package/.output/public/_nuxt/index.xxedlMJo.css +1 -0
- package/.output/public/_nuxt/kc-op4gz.js +12 -0
- package/.output/public/_nuxt/lSaGvORn.js +10 -0
- package/.output/public/_nuxt/lY3EyFEK.js +1 -0
- package/.output/public/_nuxt/qsFoMdT2.js +1 -0
- package/.output/public/_nuxt/sE-55p4e.js +1 -0
- package/.output/public/_nuxt/tMhdAKU2.js +3 -0
- package/.output/public/_nuxt/trZyeId5.js +70 -0
- package/.output/public/_nuxt/uyCIL8xw.js +1 -0
- package/.output/server/chunks/_/db-connection.mjs +17 -3
- package/.output/server/chunks/_/db-connection.mjs.map +1 -1
- package/.output/server/chunks/_/instance-insights.factory.mjs.map +1 -1
- package/.output/server/chunks/_/metadata.factory.mjs +4 -5
- package/.output/server/chunks/_/metadata.factory.mjs.map +1 -1
- package/.output/server/chunks/_/query.factory.mjs +31 -2
- package/.output/server/chunks/_/query.factory.mjs.map +1 -1
- package/.output/server/chunks/build/client.manifest.mjs +1302 -546
- package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +712 -364
- package/.output/server/chunks/routes/api/ai/agent.mjs +258 -89
- package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -1
- package/.output/server/chunks/routes/api/ai/chat.mjs +1 -2
- package/.output/server/chunks/routes/api/ai/chat.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-export/export-database.mjs +1 -2
- package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-import/import-database.mjs +1 -2
- package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/create-role.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-role.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +1 -2
- package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/definition.post.mjs +5 -3
- package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/delete.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/overview.post.mjs +12 -10
- package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/rename.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/signature.post.mjs +5 -3
- package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/update.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +1 -2
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/erd.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +14 -12
- package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/execute.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/ddl.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/export.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/indexes.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/meta.post.mjs +12 -10
- package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/overview.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/rls.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/rules.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/size.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/structure.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/triggers.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/definition.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/dependencies.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/explain.post.mjs +1 -2
- package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/indexes.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/meta.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/overview.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -2
- package/.output/server/index.mjs +1 -2
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/README.md +8 -2
- package/package.json +1 -1
- package/.output/public/_nuxt/8_EuFD3X.js +0 -1
- package/.output/public/_nuxt/B6H7odCi.js +0 -1
- package/.output/public/_nuxt/B7nSJBpY.js +0 -1
- package/.output/public/_nuxt/BBNxNerU.js +0 -1
- package/.output/public/_nuxt/BDKd-SA5.js +0 -1
- package/.output/public/_nuxt/BDRdbLz0.js +0 -1
- package/.output/public/_nuxt/BKWWO5HE.js +0 -1
- package/.output/public/_nuxt/BVKG-F8j.js +0 -1
- package/.output/public/_nuxt/BoGW82nK.js +0 -1
- package/.output/public/_nuxt/Bs_ItSbk.js +0 -1
- package/.output/public/_nuxt/Btu7FO8S.js +0 -1
- package/.output/public/_nuxt/C04Tz2vC.js +0 -67
- package/.output/public/_nuxt/C4JPKbJK.js +0 -1
- package/.output/public/_nuxt/C5KSeJUi.js +0 -8
- package/.output/public/_nuxt/CDnZBTSk.js +0 -1
- package/.output/public/_nuxt/CKq06U7u.js +0 -19
- package/.output/public/_nuxt/CQpD-JHn.js +0 -1
- package/.output/public/_nuxt/Chcc8yNZ.js +0 -1
- package/.output/public/_nuxt/CpzDNDcD.js +0 -1
- package/.output/public/_nuxt/Cs1HkKH7.js +0 -1
- package/.output/public/_nuxt/CsYOf3m-.js +0 -39
- package/.output/public/_nuxt/Ctr2mpV9.js +0 -2
- package/.output/public/_nuxt/D2j2esR5.js +0 -3
- package/.output/public/_nuxt/D4ZGn1tW.js +0 -1
- package/.output/public/_nuxt/D6YseYA6.js +0 -1
- package/.output/public/_nuxt/D7EPcL9i.js +0 -1
- package/.output/public/_nuxt/DCMJS6Fh.js +0 -1
- package/.output/public/_nuxt/D_G1mAJ8.js +0 -3
- package/.output/public/_nuxt/De1hkrJC.js +0 -1
- package/.output/public/_nuxt/DnCs9xpG.js +0 -1
- package/.output/public/_nuxt/DvJ2MjiW.js +0 -2
- package/.output/public/_nuxt/Dzr_z_mY.js +0 -9
- package/.output/public/_nuxt/OEVyCyyD.js +0 -1
- package/.output/public/_nuxt/builds/meta/0ab6db39-d52b-46b9-a687-0df3b4c65db5.json +0 -1
- package/.output/public/_nuxt/builds/meta/dev.json +0 -1
- package/.output/public/_nuxt/e_Ir8LP9.js +0 -1
- package/.output/public/_nuxt/entry.XV7TCKso.css +0 -1
- package/.output/public/_nuxt/fRxmPZZB.js +0 -8
- package/.output/public/_nuxt/logo.BsJ2Dfin.png +0 -0
- package/.output/public/_nuxt/q4KcRwD-.js +0 -1
- package/.output/public/_nuxt/qIKg23Pc.js +0 -1
- package/.output/public/_nuxt/txD20ixW.js +0 -1
- package/.output/public/_nuxt/x2HBvptj.js +0 -1
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{r as ce,d8 as Bo,d as fe,E as K,c as ge,o as X,e as oe,f as Ae,G as st,b as N,P as Mi,ab as Ii,ak as pa,ad as ul,al as va,d9 as cl,bb as dl,aj as er,da as fl,l as Z,bc as Xn,Y as bt,db as ma,aI as Ge,dc as Yt,dd as ya,c4 as tr,aB as Ti,de as hl,df as gl,bt as pl,b_ as vl,dg as ml,g as ie,F as Te,s as xt,t as Ai,aG as Ee,n as ze,j as wa,dh as _a,H as Vt,di as ba,aC as xe,bW as zi,h as pe,a as Ce,aQ as yl,aF as Nn,aS as wl,dj as Un,dk as _l,bB as _e,aD as Ct,p as He,x as De,cY as bl,aE as xa,dl as xl,W as at,dm as $l,J as Ot,dn as $a,aH as be,L as ye,dp as fn,d7 as El,dq as $t,dr as ni,ds as Ea,dt as Sa,du as Na,dv as Sl,aq as Nl,w as Cl,q as Pe,m as We,dw as Ca,bx as Ne,dx as nr,dy as or,as as kl,y as ct,z as dt,B as ft,dz as ir,dA as Kn,bs as Ml,dB as Il,ba as Tl,dC as An,dD as Oo,a2 as Al,a3 as zl,R as Pl,dE as Dl,a4 as Bl,dF as Ol,dG as Rl,dH as Fl,dI as Hl,bm as Vl,k as Ll,bf as Yl,M as Gl,dJ as rr,dK as Xl,dL as Ul,b9 as Kl,aR as Wl}from"./FyrDS92w.js";import{R as Zl,a as ql}from"./Btu7FO8S.js";import{u as Ql}from"./kehy-5uo.js";import{u as Jl}from"./y68LmDX2.js";function jl(e,t){const n=ce(),o=(r,a)=>{if(t.multiple&&Array.isArray(e.value))if(t.selectionBehavior==="replace")e.value=[r],n.value=r;else{const s=e.value.findIndex(l=>a(l));s!==-1?e.value=e.value.filter((l,u)=>u!==s):e.value=[...e.value,r]}else t.selectionBehavior==="replace"?e.value={...r}:!Array.isArray(e.value)&&a(e.value)?e.value=void 0:e.value={...r};return e.value};function i(r,a,s,l){var f;if(!(n!=null&&n.value)||!t.multiple||!Array.isArray(e.value))return;const c=(f=s().filter(g=>g.ref.dataset.disabled!=="").find(g=>g.ref===a))==null?void 0:f.value;if(!c)return;let d=null;switch(r){case"prev":case"next":{d=Bo(l,n.value,c);break}case"first":{d=Bo(l,n.value,l==null?void 0:l[0]);break}case"last":{d=Bo(l,n.value,l==null?void 0:l[l.length-1]);break}}e.value=d}return{firstValue:n,onSelectItem:o,handleMultipleReplace:i}}var eu=fe({__name:"BaseSeparator",props:{orientation:{type:String,required:!1,default:"horizontal"},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=["horizontal","vertical"];function o(s){return n.includes(s)}const i=K(()=>o(t.orientation)?t.orientation:"horizontal"),r=K(()=>i.value==="vertical"?t.orientation:void 0),a=K(()=>t.decorative?{role:"none"}:{"aria-orientation":r.value,role:"separator"});return(s,l)=>(X(),ge(N(Mi),st({as:s.as,"as-child":s.asChild,"data-orientation":i.value},a.value),{default:oe(()=>[Ae(s.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),tu=eu,nu=fe({__name:"Separator",props:{orientation:{type:String,required:!1,default:"horizontal"},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,o)=>(X(),ge(tu,Ii(pa(t)),{default:oe(()=>[Ae(n.$slots,"default")]),_:3},16))}}),ou=nu;function no(e){return e.reduce((t,n)=>(t.push(n),n.children&&t.push(...no(n.children)),t),[])}const[ka,iu]=ul("TreeRoot");var ru=fe({__name:"TreeRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},items:{type:Array,required:!1},expanded:{type:Array,required:!1},defaultExpanded:{type:Array,required:!1},getKey:{type:Function,required:!0},getChildren:{type:Function,required:!1,default:e=>e.children},selectionBehavior:{type:String,required:!1,default:"toggle"},multiple:{type:Boolean,required:!1,skipCheck:!0},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},propagateSelect:{type:Boolean,required:!1},bubbleSelect:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"ul"}},emits:["update:modelValue","update:expanded"],setup(e,{emit:t}){const n=e,o=t,{items:i,multiple:r,disabled:a,propagateSelect:s,dir:l,bubbleSelect:u}=va(n),{handleTypeaheadSearch:c}=cl(),d=dl(l),f=ce(),g=ce(!1),$=fl(),w=er(n,"modelValue",o,{defaultValue:n.defaultValue??(r.value?[]:void 0),passive:!0,deep:!0}),y=er(n,"expanded",o,{defaultValue:n.defaultExpanded??[],passive:n.expanded===void 0,deep:!0}),{onSelectItem:p,handleMultipleReplace:b}=jl(w,n),m=K(()=>r.value&&Array.isArray(w.value)?w.value.map(O=>n.getKey(O)):[n.getKey(w.value??{})]);function _(O,F=1,H){return O.reduce((k,G,h)=>{const M=n.getKey(G),v=n.getChildren(G),z=y.value.includes(M),I={_id:M,value:G,index:h,level:F,parentItem:H,hasChildren:!!v,bind:{value:G,level:F,"aria-setsize":O.length,"aria-posinset":h+1}};return k.push(I),v&&z&&k.push(..._(v,F+1,G)),k},[])}const T=K(()=>{const O=n.items;return y.value.map(F=>F),_(O??[])});function P(O){var F;if(g.value)$.trigger(O);else{const H=((F=f.value)==null?void 0:F.getItems())??[];c(O.key,H)}}function A(O){if(g.value)return;const F=ma[O.key];Ge(()=>{var H;b(F,Yt(),(H=f.value)==null?void 0:H.getItems,T.value.map(k=>k.value))})}function R(O){var F;if(O.parentItem!=null&&Array.isArray(w.value)&&n.multiple){const H=T.value.find(k=>O.parentItem!=null&&n.getKey(k.value)===n.getKey(O.parentItem));H!=null&&(((F=n.getChildren(H.value))==null?void 0:F.every(G=>w.value.find(h=>n.getKey(h)===n.getKey(G))))?w.value=[...w.value,H.value]:w.value=w.value.filter(G=>n.getKey(G)!==n.getKey(H.value)),R(H))}}return iu({modelValue:w,selectedKeys:m,onSelect:O=>{var k;const F=G=>n.getKey(G??{})===n.getKey(O),H=n.multiple&&Array.isArray(w.value)?((k=w.value)==null?void 0:k.findIndex(F))!==-1:void 0;if(p(O,F),n.bubbleSelect&&n.multiple&&Array.isArray(w.value)){const G=T.value.find(h=>n.getKey(h.value)===n.getKey(O));G!=null&&R(G)}if(n.propagateSelect&&n.multiple&&Array.isArray(w.value)){const G=no(n.getChildren(O)??[]);H?w.value=[...w.value].filter(h=>!G.some(M=>n.getKey(h??{})===n.getKey(M))):w.value=[...w.value,...G]}},expanded:y,onToggle(O){if(!(O?n.getChildren(O):void 0))return;const H=n.getKey(O)??O;y.value.includes(H)?y.value=y.value.filter(k=>k!==H):y.value=[...y.value,H]},getKey:n.getKey,getChildren:n.getChildren,items:i,expandedItems:T,disabled:a,multiple:r,dir:d,propagateSelect:s,bubbleSelect:u,isVirtual:g,virtualKeydownHook:$,handleMultipleReplace:b}),(O,F)=>(X(),ge(N(Zl),{ref_key:"rovingFocusGroupRef",ref:f,"as-child":"",orientation:"vertical",dir:N(d)},{default:oe(()=>[Z(N(Mi),{role:"tree",as:O.as,"as-child":O.asChild,"aria-multiselectable":N(r)?!0:void 0,onKeydown:[P,Xn(bt(A,["shift"]),["up","down"])]},{default:oe(()=>[Ae(O.$slots,"default",{flattenItems:T.value,modelValue:N(w),expanded:N(y)})]),_:3},8,["as","as-child","aria-multiselectable","onKeydown"])]),_:3},8,["dir"]))}}),au=ru;const su="tree.select",lu="tree.toggle";var uu=fe({inheritAttrs:!1,__name:"TreeItem",props:{value:{type:null,required:!0},level:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"li"}},emits:["select","toggle"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=ka(),{getItems:a}=ya(),s=K(()=>!!r.getChildren(o.value)),l=K(()=>{const p=r.getKey(o.value);return r.expanded.value.includes(p)}),u=K(()=>{const p=r.getKey(o.value);return r.selectedKeys.value.includes(p)}),c=K(()=>{if(r.bubbleSelect.value&&s.value&&Array.isArray(r.modelValue.value)){const p=no(r.getChildren(o.value)||[]);return p.some(b=>r.modelValue.value.find(m=>r.getKey(m)===r.getKey(b)))&&!p.every(b=>r.modelValue.value.find(m=>r.getKey(m)===r.getKey(b)))}else return r.propagateSelect.value&&u.value&&s.value&&Array.isArray(r.modelValue.value)?!no(r.getChildren(o.value)||[]).every(b=>r.modelValue.value.find(m=>r.getKey(m)===r.getKey(b))):void 0});function d(p){if(s.value)if(l.value){const b=a().map(A=>A.ref),m=Yt(),_=b.indexOf(m),P=[...b].slice(_).find(A=>Number(A.getAttribute("data-indent"))===o.level+1);P&&P.focus()}else y(p)}function f(p){if(l.value)y(p);else{const b=a().map(A=>A.ref),m=Yt(),_=b.indexOf(m),P=[...b].slice(0,_).reverse().find(A=>Number(A.getAttribute("data-indent"))===o.level-1);P&&P.focus()}}async function g(p){i("select",p),!(p!=null&&p.defaultPrevented)&&r.onSelect(o.value)}async function $(p){i("toggle",p),!(p!=null&&p.defaultPrevented)&&r.onToggle(o.value)}async function w(p){if(!p)return;const b={originalEvent:p,value:o.value,isExpanded:l.value,isSelected:u.value};tr(su,g,b)}async function y(p){if(!p)return;const b={originalEvent:p,value:o.value,isExpanded:l.value,isSelected:u.value};tr(lu,$,b)}return t({isExpanded:l,isSelected:u,isIndeterminate:c,handleToggle:()=>r.onToggle(o.value),handleSelect:()=>r.onSelect(o.value)}),(p,b)=>(X(),ge(N(ql),{"as-child":"",value:p.value,"allow-shift-key":""},{default:oe(()=>[Z(N(Mi),st(p.$attrs,{role:"treeitem",as:p.as,"as-child":p.asChild,"aria-selected":u.value,"aria-expanded":s.value?l.value:void 0,"aria-level":p.level,"data-indent":p.level,"data-selected":u.value?"":void 0,"data-expanded":l.value?"":void 0,onKeydown:[Xn(bt(w,["self","prevent"]),["enter","space"]),b[0]||(b[0]=Xn(bt(m=>N(r).dir.value==="ltr"?d(m):f(m),["prevent"]),["right"])),b[1]||(b[1]=Xn(bt(m=>N(r).dir.value==="ltr"?f(m):d(m),["prevent"]),["left"]))],onClick:b[2]||(b[2]=bt(m=>{w(m),y(m)},["stop"]))}),{default:oe(()=>[Ae(p.$slots,"default",{isExpanded:l.value,isSelected:u.value,isIndeterminate:c.value,handleSelect:()=>N(r).onSelect(p.value),handleToggle:()=>N(r).onToggle(p.value)})]),_:3},16,["as","as-child","aria-selected","aria-expanded","aria-level","data-indent","data-selected","data-expanded","onKeydown"])]),_:3},8,["value"]))}}),cu=uu,du=fe({__name:"TreeVirtualizer",props:{overscan:{type:Number,required:!1},estimateSize:{type:[Number,Function],required:!1},textContent:{type:Function,required:!1}},setup(e){const t=e,n=Ti(),o=ka(),i=hl(),{getItems:r}=ya(),a=gl("",1e3),s=K(()=>{const f=g=>t.textContent?t.textContent(g):g.toString().toLowerCase();return o.expandedItems.value.map((g,$)=>({index:$,textContent:f(g.value)}))});o.isVirtual.value=!0;const l=K(()=>{const f=i.value;if(f){const g=window.getComputedStyle(f);return{start:Number.parseFloat(g.paddingBlockStart||g.paddingTop),end:Number.parseFloat(g.paddingBlockEnd||g.paddingBottom)}}else return{start:0,end:0}}),u=pl({get scrollPaddingStart(){return l.value.start},get scrollPaddingEnd(){return l.value.end},get count(){return o.expandedItems.value.length??0},get horizontal(){return!1},getItemKey(f){return f+o.getKey(o.expandedItems.value[f].value)},estimateSize(f){return typeof t.estimateSize=="function"?t.estimateSize(f):t.estimateSize??28},getScrollElement(){return i.value},overscan:t.overscan??12}),c=K(()=>u.value.getVirtualItems().map(f=>({item:f,is:vl(n.default({item:o.expandedItems.value[f.index],virtualizer:u.value,virtualItem:f})[0],{"data-index":f.index,style:{position:"absolute",top:0,left:0,transform:`translateY(${f.start}px)`,overflowAnchor:"none"}})})));function d(f){u.value.scrollToIndex(f,{align:"start"}),requestAnimationFrame(()=>{const g=i.value.querySelector(`[data-index="${f}"]`);g instanceof HTMLElement&&g.focus()})}return o.virtualKeydownHook.on(f=>{var y;const g=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!g)return;const w=ma[f.key];if(["first","last"].includes(w)){f.preventDefault();const p=w==="first"?0:o.expandedItems.value.length-1;u.value.scrollToIndex(p),requestAnimationFrame(()=>{const b=r();(w==="first"?b[0]:b[b.length-1]).ref.focus()})}else if(w==="prev"&&f.key!=="ArrowUp"){const p=Yt(),b=Number(p.getAttribute("data-index")),m=Number(p.getAttribute("data-indent")),T=o.expandedItems.value.slice(0,b).map((P,A)=>({...P,index:A})).reverse().find(P=>P.level===m-1);T&&d(T.index)}else if(!w&&!g){a.value+=f.key;const p=Number((y=Yt())==null?void 0:y.getAttribute("data-index")),b=s.value[p].textContent,m=s.value.map(P=>P.textContent),_=ml(m,a.value,b),T=s.value.find(P=>P.textContent===_);T&&d(T.index)}Ge(()=>{f.shiftKey&&w&&o.handleMultipleReplace(w,Yt(),r,o.expandedItems.value.map(p=>p.value))})}),(f,g)=>(X(),ie("div",{"data-reka-virtualizer":"",style:Ee({position:"relative",width:"100%",height:`${N(u).getTotalSize()}px`})},[(X(!0),ie(Te,null,xt(c.value,({is:$,item:w})=>(X(),ge(Ai($),{key:w.key}))),128))],4))}}),fu=du;const hu=fe({__name:"KbdGroup",props:{class:{}},setup(e){const t=e;return(n,o)=>(X(),ie("kbd",{"data-slot":"kbd-group",class:ze(N(wa)("inline-flex items-center gap-1",t.class))},[Ae(n.$slots,"default")],2))}});function bo(e){return _a()?(Un(e),!0):!1}function nt(e){return typeof e=="function"?e():N(e)}const gu=typeof window<"u"&&typeof document<"u",pu=e=>typeof e<"u",vu=Object.prototype.toString,mu=e=>vu.call(e)==="[object Object]",yu=()=>{};function wu(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const Ma=e=>e();function _u(e=Ma){const t=ce(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:El(t),pause:n,resume:o,eventFilter:i}}function ar(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function bu(e,t,n={}){const{eventFilter:o=Ma,...i}=n;return xe(e,wu(o,t),i)}function Lt(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:a,resume:s,isActive:l}=_u(o);return{stop:bu(e,t,{...i,eventFilter:r}),pause:a,resume:s,isActive:l}}function xu(e,t={}){if(!at(e))return va(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=$l(()=>({get(){return e.value[o]},set(i){var r;if((r=nt(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const s=[...e.value];s[o]=i,e.value=s}else{const s={...e.value,[o]:i};Object.setPrototypeOf(s,Object.getPrototypeOf(e.value)),e.value=s}else e.value[o]=i}}));return n}function oi(e,t=!1){function n(d,{flush:f="sync",deep:g=!1,timeout:$,throwOnTimeout:w}={}){let y=null;const b=[new Promise(m=>{y=xe(e,_=>{d(_)!==t&&(y==null||y(),m(_))},{flush:f,deep:g,immediate:!0})})];return $!=null&&b.push(ar($,w).then(()=>nt(e)).finally(()=>y==null?void 0:y())),Promise.race(b)}function o(d,f){if(!at(d))return n(_=>_===d,f);const{flush:g="sync",deep:$=!1,timeout:w,throwOnTimeout:y}=f??{};let p=null;const m=[new Promise(_=>{p=xe([e,d],([T,P])=>{t!==(T===P)&&(p==null||p(),_(T))},{flush:g,deep:$,immediate:!0})})];return w!=null&&m.push(ar(w,y).then(()=>nt(e)).finally(()=>(p==null||p(),nt(e)))),Promise.race(m)}function i(d){return n(f=>!!f,d)}function r(d){return o(null,d)}function a(d){return o(void 0,d)}function s(d){return n(Number.isNaN,d)}function l(d,f){return n(g=>{const $=Array.from(g);return $.includes(d)||$.includes(nt(d))},f)}function u(d){return c(1,d)}function c(d=1,f){let g=-1;return n(()=>(g+=1,g>=d),f)}return Array.isArray(nt(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return oi(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:s,toBeUndefined:a,changed:u,changedTimes:c,get not(){return oi(e,!t)}}}function ii(e){return oi(e)}function $u(e){var t;const n=nt(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Ia=gu?window:void 0;function Ta(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=Ia):[t,n,o,i]=e,!t)return yu;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],a=()=>{r.forEach(c=>c()),r.length=0},s=(c,d,f,g)=>(c.addEventListener(d,f,g),()=>c.removeEventListener(d,f,g)),l=xe(()=>[$u(t),nt(i)],([c,d])=>{if(a(),!c)return;const f=mu(d)?{...d}:d;r.push(...n.flatMap(g=>o.map($=>s(c,g,$,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return bo(u),u}function Eu(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function sr(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=Ia,eventName:r="keydown",passive:a=!1,dedupe:s=!1}=o,l=Eu(t);return Ta(i,r,c=>{c.repeat&&nt(s)||l(c)&&n(c)},a)}function Su(e){return JSON.parse(JSON.stringify(e))}function Ro(e,t,n,o={}){var i,r,a;const{clone:s=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:f}=o,g=Nn(),$=n||(g==null?void 0:g.emit)||((i=g==null?void 0:g.$emit)==null?void 0:i.bind(g))||((a=(r=g==null?void 0:g.proxy)==null?void 0:r.$emit)==null?void 0:a.bind(g==null?void 0:g.proxy));let w=u;t||(t="modelValue"),w=w||`update:${t.toString()}`;const y=m=>s?typeof s=="function"?s(m):Su(m):m,p=()=>pu(e[t])?y(e[t]):d,b=m=>{f?f(m)&&$(w,m):$(w,m)};if(l){const m=p(),_=ce(m);let T=!1;return xe(()=>e[t],P=>{T||(T=!0,_.value=y(P),Ge(()=>T=!1))}),xe(_,P=>{!T&&(P!==e[t]||c)&&b(P)},{deep:c}),_}else return K({get(){return p()},set(m){b(m)}})}var Nu={value:()=>{}};function xo(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Wn(n)}function Wn(e){this._=e}function Cu(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Wn.prototype=xo.prototype={constructor:Wn,on:function(e,t){var n=this._,o=Cu(e+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(e=o[r]).type)&&(i=ku(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<a;)if(i=(e=o[r]).type)n[i]=lr(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lr(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Wn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function ku(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function lr(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=Nu,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var ri="http://www.w3.org/1999/xhtml";const ur={svg:"http://www.w3.org/2000/svg",xhtml:ri,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $o(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}function Mu(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ri&&t.documentElement.namespaceURI===ri?t.createElement(e):t.createElementNS(n,e)}}function Iu(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Aa(e){var t=$o(e);return(t.local?Iu:Mu)(t)}function Tu(){}function Pi(e){return e==null?Tu:function(){return this.querySelector(e)}}function Au(e){typeof e!="function"&&(e=Pi(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=new Array(a),l,u,c=0;c<a;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Re(o,this._parents)}function zu(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Pu(){return[]}function za(e){return e==null?Pu:function(){return this.querySelectorAll(e)}}function Du(e){return function(){return zu(e.apply(this,arguments))}}function Bu(e){typeof e=="function"?e=Du(e):e=za(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var a=t[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(o.push(e.call(l,l.__data__,u,a)),i.push(l));return new Re(o,i)}function Pa(e){return function(){return this.matches(e)}}function Da(e){return function(t){return t.matches(e)}}var Ou=Array.prototype.find;function Ru(e){return function(){return Ou.call(this.children,e)}}function Fu(){return this.firstElementChild}function Hu(e){return this.select(e==null?Fu:Ru(typeof e=="function"?e:Da(e)))}var Vu=Array.prototype.filter;function Lu(){return Array.from(this.children)}function Yu(e){return function(){return Vu.call(this.children,e)}}function Gu(e){return this.selectAll(e==null?Lu:Yu(typeof e=="function"?e:Da(e)))}function Xu(e){typeof e!="function"&&(e=Pa(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new Re(o,this._parents)}function Ba(e){return new Array(e.length)}function Uu(){return new Re(this._enter||this._groups.map(Ba),this._parents)}function oo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}oo.prototype={constructor:oo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ku(e){return function(){return e}}function Wu(e,t,n,o,i,r){for(var a=0,s,l=t.length,u=r.length;a<u;++a)(s=t[a])?(s.__data__=r[a],o[a]=s):n[a]=new oo(e,r[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function Zu(e,t,n,o,i,r,a){var s,l,u=new Map,c=t.length,d=r.length,f=new Array(c),g;for(s=0;s<c;++s)(l=t[s])&&(f[s]=g=a.call(l,l.__data__,s,t)+"",u.has(g)?i[s]=l:u.set(g,l));for(s=0;s<d;++s)g=a.call(e,r[s],s,r)+"",(l=u.get(g))?(o[s]=l,l.__data__=r[s],u.delete(g)):n[s]=new oo(e,r[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function qu(e){return e.__data__}function Qu(e,t){if(!arguments.length)return Array.from(this,qu);var n=t?Zu:Wu,o=this._parents,i=this._groups;typeof e!="function"&&(e=Ku(e));for(var r=i.length,a=new Array(r),s=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],f=d.length,g=Ju(e.call(c,c&&c.__data__,u,o)),$=g.length,w=s[u]=new Array($),y=a[u]=new Array($),p=l[u]=new Array(f);n(c,d,w,y,p,g,t);for(var b=0,m=0,_,T;b<$;++b)if(_=w[b]){for(b>=m&&(m=b+1);!(T=y[m])&&++m<$;);_._next=T||null}}return a=new Re(a,o),a._enter=s,a._exit=l,a}function Ju(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ju(){return new Re(this._exit||this._groups.map(Ba),this._parents)}function ec(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function tc(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,a=Math.min(i,r),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=o[l],d=u.length,f=s[l]=new Array(d),g,$=0;$<d;++$)(g=u[$]||c[$])&&(f[$]=g);for(;l<i;++l)s[l]=n[l];return new Re(s,this._parents)}function nc(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function oc(e){e||(e=ic);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],s=a.length,l=i[r]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Re(i,this._parents).order()}function ic(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function rc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ac(){return Array.from(this)}function sc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var a=o[i];if(a)return a}return null}function lc(){let e=0;for(const t of this)++e;return e}function uc(){return!this.node()}function cc(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,a=i.length,s;r<a;++r)(s=i[r])&&e.call(s,s.__data__,r,i);return this}function dc(e){return function(){this.removeAttribute(e)}}function fc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function hc(e,t){return function(){this.setAttribute(e,t)}}function gc(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function pc(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function vc(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function mc(e,t){var n=$o(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?fc:dc:typeof t=="function"?n.local?vc:pc:n.local?gc:hc)(n,t))}function Oa(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yc(e){return function(){this.style.removeProperty(e)}}function wc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _c(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function bc(e,t,n){return arguments.length>1?this.each((t==null?yc:typeof t=="function"?_c:wc)(e,t,n??"")):Wt(this.node(),e)}function Wt(e,t){return e.style.getPropertyValue(t)||Oa(e).getComputedStyle(e,null).getPropertyValue(t)}function xc(e){return function(){delete this[e]}}function $c(e,t){return function(){this[e]=t}}function Ec(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Sc(e,t){return arguments.length>1?this.each((t==null?xc:typeof t=="function"?Ec:$c)(e,t)):this.node()[e]}function Ra(e){return e.trim().split(/^|\s+/)}function Di(e){return e.classList||new Fa(e)}function Fa(e){this._node=e,this._names=Ra(e.getAttribute("class")||"")}Fa.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ha(e,t){for(var n=Di(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Va(e,t){for(var n=Di(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Nc(e){return function(){Ha(this,e)}}function Cc(e){return function(){Va(this,e)}}function kc(e,t){return function(){(t.apply(this,arguments)?Ha:Va)(this,e)}}function Mc(e,t){var n=Ra(e+"");if(arguments.length<2){for(var o=Di(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?kc:t?Nc:Cc)(n,t))}function Ic(){this.textContent=""}function Tc(e){return function(){this.textContent=e}}function Ac(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function zc(e){return arguments.length?this.each(e==null?Ic:(typeof e=="function"?Ac:Tc)(e)):this.node().textContent}function Pc(){this.innerHTML=""}function Dc(e){return function(){this.innerHTML=e}}function Bc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Oc(e){return arguments.length?this.each(e==null?Pc:(typeof e=="function"?Bc:Dc)(e)):this.node().innerHTML}function Rc(){this.nextSibling&&this.parentNode.appendChild(this)}function Fc(){return this.each(Rc)}function Hc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Vc(){return this.each(Hc)}function Lc(e){var t=typeof e=="function"?e:Aa(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Yc(){return null}function Gc(e,t){var n=typeof e=="function"?e:Aa(e),o=t==null?Yc:typeof t=="function"?t:Pi(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Xc(){var e=this.parentNode;e&&e.removeChild(this)}function Uc(){return this.each(Xc)}function Kc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Wc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Zc(e){return this.select(e?Wc:Kc)}function qc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Qc(e){return function(t){e.call(this,t,this.__data__)}}function Jc(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function jc(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function ed(e,t,n){return function(){var o=this.__on,i,r=Qc(t);if(o){for(var a=0,s=o.length;a<s;++a)if((i=o[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function td(e,t,n){var o=Jc(e+""),i,r=o.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<r;++i)if((a=o[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?ed:jc,i=0;i<r;++i)this.each(s(o[i],t,n));return this}function La(e,t,n){var o=Oa(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function nd(e,t){return function(){return La(this,e,t)}}function od(e,t){return function(){return La(this,e,t.apply(this,arguments))}}function id(e,t){return this.each((typeof t=="function"?od:nd)(e,t))}function*rd(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var Ya=[null];function Re(e,t){this._groups=e,this._parents=t}function Cn(){return new Re([[document.documentElement]],Ya)}function ad(){return this}Re.prototype=Cn.prototype={constructor:Re,select:Au,selectAll:Bu,selectChild:Hu,selectChildren:Gu,filter:Xu,data:Qu,enter:Uu,exit:ju,join:ec,merge:tc,selection:ad,order:nc,sort:oc,call:rc,nodes:ac,node:sc,size:lc,empty:uc,each:cc,attr:mc,style:bc,property:Sc,classed:Mc,text:zc,html:Oc,raise:Fc,lower:Vc,append:Lc,insert:Gc,remove:Uc,clone:Zc,datum:qc,on:td,dispatch:id,[Symbol.iterator]:rd};function Ve(e){return typeof e=="string"?new Re([[document.querySelector(e)]],[document.documentElement]):new Re([[e]],Ya)}function sd(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ze(e,t){if(e=sd(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const ld={passive:!1},pn={capture:!0,passive:!1};function Fo(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ga(e){var t=e.document.documentElement,n=Ve(e).on("dragstart.drag",Gt,pn);"onselectstart"in t?n.on("selectstart.drag",Gt,pn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Xa(e,t){var n=e.document.documentElement,o=Ve(e).on("dragstart.drag",null);t&&(o.on("click.drag",Gt,pn),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const zn=e=>()=>e;function ai(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}ai.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ud(e){return!e.ctrlKey&&!e.button}function cd(){return this.parentNode}function dd(e,t){return t??{x:e.x,y:e.y}}function fd(){return navigator.maxTouchPoints||"ontouchstart"in this}function hd(){var e=ud,t=cd,n=dd,o=fd,i={},r=xo("start","drag","end"),a=0,s,l,u,c,d=0;function f(_){_.on("mousedown.drag",g).filter(o).on("touchstart.drag",y).on("touchmove.drag",p,ld).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(_,T){if(!(c||!e.call(this,_,T))){var P=m(this,t.call(this,_,T),_,T,"mouse");P&&(Ve(_.view).on("mousemove.drag",$,pn).on("mouseup.drag",w,pn),Ga(_.view),Fo(_),u=!1,s=_.clientX,l=_.clientY,P("start",_))}}function $(_){if(Gt(_),!u){var T=_.clientX-s,P=_.clientY-l;u=T*T+P*P>d}i.mouse("drag",_)}function w(_){Ve(_.view).on("mousemove.drag mouseup.drag",null),Xa(_.view,u),Gt(_),i.mouse("end",_)}function y(_,T){if(e.call(this,_,T)){var P=_.changedTouches,A=t.call(this,_,T),R=P.length,O,F;for(O=0;O<R;++O)(F=m(this,A,_,T,P[O].identifier,P[O]))&&(Fo(_),F("start",_,P[O]))}}function p(_){var T=_.changedTouches,P=T.length,A,R;for(A=0;A<P;++A)(R=i[T[A].identifier])&&(Gt(_),R("drag",_,T[A]))}function b(_){var T=_.changedTouches,P=T.length,A,R;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),A=0;A<P;++A)(R=i[T[A].identifier])&&(Fo(_),R("end",_,T[A]))}function m(_,T,P,A,R,O){var F=r.copy(),H=Ze(O||P,T),k,G,h;if((h=n.call(_,new ai("beforestart",{sourceEvent:P,target:f,identifier:R,active:a,x:H[0],y:H[1],dx:0,dy:0,dispatch:F}),A))!=null)return k=h.x-H[0]||0,G=h.y-H[1]||0,function M(v,z,I){var B=H,D;switch(v){case"start":i[R]=M,D=a++;break;case"end":delete i[R],--a;case"drag":H=Ze(I||z,T),D=a;break}F.call(v,_,new ai(v,{sourceEvent:z,subject:h,target:f,identifier:R,active:D,x:H[0]+k,y:H[1]+G,dx:H[0]-B[0],dy:H[1]-B[1],dispatch:F}),A)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:zn(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:zn(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:zn(_),f):n},f.touchable=function(_){return arguments.length?(o=typeof _=="function"?_:zn(!!_),f):o},f.on=function(){var _=r.on.apply(r,arguments);return _===r?f:_},f.clickDistance=function(_){return arguments.length?(d=(_=+_)*_,f):Math.sqrt(d)},f}function Bi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ua(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function kn(){}var vn=.7,io=1/vn,Xt="\\s*([+-]?\\d+)\\s*",mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gd=/^#([0-9a-f]{3,8})$/,pd=new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`),vd=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),md=new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${mn}\\)$`),yd=new RegExp(`^rgba\\(${qe},${qe},${qe},${mn}\\)$`),wd=new RegExp(`^hsl\\(${mn},${qe},${qe}\\)$`),_d=new RegExp(`^hsla\\(${mn},${qe},${qe},${mn}\\)$`),cr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Bi(kn,yn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dr,formatHex:dr,formatHex8:bd,formatHsl:xd,formatRgb:fr,toString:fr});function dr(){return this.rgb().formatHex()}function bd(){return this.rgb().formatHex8()}function xd(){return Ka(this).formatHsl()}function fr(){return this.rgb().formatRgb()}function yn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gd.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?hr(t):n===3?new Be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=pd.exec(e))?new Be(t[1],t[2],t[3],1):(t=vd.exec(e))?new Be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=md.exec(e))?Pn(t[1],t[2],t[3],t[4]):(t=yd.exec(e))?Pn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wd.exec(e))?vr(t[1],t[2]/100,t[3]/100,1):(t=_d.exec(e))?vr(t[1],t[2]/100,t[3]/100,t[4]):cr.hasOwnProperty(e)?hr(cr[e]):e==="transparent"?new Be(NaN,NaN,NaN,0):null}function hr(e){return new Be(e>>16&255,e>>8&255,e&255,1)}function Pn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Be(e,t,n,o)}function $d(e){return e instanceof kn||(e=yn(e)),e?(e=e.rgb(),new Be(e.r,e.g,e.b,e.opacity)):new Be}function si(e,t,n,o){return arguments.length===1?$d(e):new Be(e,t,n,o??1)}function Be(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Bi(Be,si,Ua(kn,{brighter(e){return e=e==null?io:Math.pow(io,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vn:Math.pow(vn,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Be(Pt(this.r),Pt(this.g),Pt(this.b),ro(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gr,formatHex:gr,formatHex8:Ed,formatRgb:pr,toString:pr}));function gr(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Ed(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At((isNaN(this.opacity)?1:this.opacity)*255)}`}function pr(){const e=ro(this.opacity);return`${e===1?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${e===1?")":`, ${e})`}`}function ro(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function At(e){return e=Pt(e),(e<16?"0":"")+e.toString(16)}function vr(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Le(e,t,n,o)}function Ka(e){if(e instanceof Le)return new Le(e.h,e.s,e.l,e.opacity);if(e instanceof kn||(e=yn(e)),!e)return new Le;if(e instanceof Le)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),a=NaN,s=r-i,l=(r+i)/2;return s?(t===r?a=(n-o)/s+(n<o)*6:n===r?a=(o-t)/s+2:a=(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new Le(a,s,l,e.opacity)}function Sd(e,t,n,o){return arguments.length===1?Ka(e):new Le(e,t,n,o??1)}function Le(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Bi(Le,Sd,Ua(kn,{brighter(e){return e=e==null?io:Math.pow(io,e),new Le(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vn:Math.pow(vn,e),new Le(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Be(Ho(e>=240?e-240:e+120,i,o),Ho(e,i,o),Ho(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Le(mr(this.h),Dn(this.s),Dn(this.l),ro(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ro(this.opacity);return`${e===1?"hsl(":"hsla("}${mr(this.h)}, ${Dn(this.s)*100}%, ${Dn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mr(e){return e=(e||0)%360,e<0?e+360:e}function Dn(e){return Math.max(0,Math.min(1,e||0))}function Ho(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Wa=e=>()=>e;function Nd(e,t){return function(n){return e+n*t}}function Cd(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function kd(e){return(e=+e)==1?Za:function(t,n){return n-t?Cd(t,n,e):Wa(isNaN(t)?n:t)}}function Za(e,t){var n=t-e;return n?Nd(e,n):Wa(isNaN(e)?t:e)}const yr=function e(t){var n=kd(t);function o(i,r){var a=n((i=si(i)).r,(r=si(r)).r),s=n(i.g,r.g),l=n(i.b,r.b),u=Za(i.opacity,r.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var li=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vo=new RegExp(li.source,"g");function Md(e){return function(){return e}}function Id(e){return function(t){return e(t)+""}}function Td(e,t){var n=li.lastIndex=Vo.lastIndex=0,o,i,r,a=-1,s=[],l=[];for(e=e+"",t=t+"";(o=li.exec(e))&&(i=Vo.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),s[a]?s[a]+=r:s[++a]=r),(o=o[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:vt(o,i)})),n=Vo.lastIndex;return n<t.length&&(r=t.slice(n),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?Id(l[0].x):Md(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)s[(d=l[c]).i]=d.x(u);return s.join("")})}var wr=180/Math.PI,ui={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qa(e,t,n,o,i,r){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*wr,skewX:Math.atan(l)*wr,scaleX:a,scaleY:s}}var Bn;function Ad(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ui:qa(t.a,t.b,t.c,t.d,t.e,t.f)}function zd(e){return e==null||(Bn||(Bn=document.createElementNS("http://www.w3.org/2000/svg","g")),Bn.setAttribute("transform",e),!(e=Bn.transform.baseVal.consolidate()))?ui:(e=e.matrix,qa(e.a,e.b,e.c,e.d,e.e,e.f))}function Qa(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,f,g,$){if(u!==d||c!==f){var w=g.push("translate(",null,t,null,n);$.push({i:w-4,x:vt(u,d)},{i:w-2,x:vt(c,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function a(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,o)-2,x:vt(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function s(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,o)-2,x:vt(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,f,g,$){if(u!==d||c!==f){var w=g.push(i(g)+"scale(",null,",",null,")");$.push({i:w-4,x:vt(u,d)},{i:w-2,x:vt(c,f)})}else(d!==1||f!==1)&&g.push(i(g)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,f),a(u.rotate,c.rotate,d,f),s(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(g){for(var $=-1,w=f.length,y;++$<w;)d[(y=f[$]).i]=y.x(g);return d.join("")}}}var Pd=Qa(Ad,"px, ","px)","deg)"),Dd=Qa(zd,", ",")",")"),Bd=1e-12;function _r(e){return((e=Math.exp(e))+1/e)/2}function Od(e){return((e=Math.exp(e))-1/e)/2}function Rd(e){return((e=Math.exp(2*e))-1)/(e+1)}const Fd=function e(t,n,o){function i(r,a){var s=r[0],l=r[1],u=r[2],c=a[0],d=a[1],f=a[2],g=c-s,$=d-l,w=g*g+$*$,y,p;if(w<Bd)p=Math.log(f/u)/t,y=function(A){return[s+A*g,l+A*$,u*Math.exp(t*A*p)]};else{var b=Math.sqrt(w),m=(f*f-u*u+o*w)/(2*u*n*b),_=(f*f-u*u-o*w)/(2*f*n*b),T=Math.log(Math.sqrt(m*m+1)-m),P=Math.log(Math.sqrt(_*_+1)-_);p=(P-T)/t,y=function(A){var R=A*p,O=_r(T),F=u/(n*b)*(O*Rd(t*R+T)-Od(T));return[s+F*g,l+F*$,u*O/_r(t*R+T)]}}return y.duration=p*1e3*t/Math.SQRT2,y}return i.rho=function(r){var a=Math.max(.001,+r),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var Zt=0,sn=0,nn=0,Ja=1e3,ao,ln,so=0,Rt=0,Eo=0,wn=typeof performance=="object"&&performance.now?performance:Date,ja=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Oi(){return Rt||(ja(Hd),Rt=wn.now()+Eo)}function Hd(){Rt=0}function lo(){this._call=this._time=this._next=null}lo.prototype=es.prototype={constructor:lo,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Oi():+n)+(t==null?0:+t),!this._next&&ln!==this&&(ln?ln._next=this:ao=this,ln=this),this._call=e,this._time=n,ci()},stop:function(){this._call&&(this._call=null,this._time=1/0,ci())}};function es(e,t,n){var o=new lo;return o.restart(e,t,n),o}function Vd(){Oi(),++Zt;for(var e=ao,t;e;)(t=Rt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zt}function br(){Rt=(so=wn.now())+Eo,Zt=sn=0;try{Vd()}finally{Zt=0,Yd(),Rt=0}}function Ld(){var e=wn.now(),t=e-so;t>Ja&&(Eo-=t,so=e)}function Yd(){for(var e,t=ao,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ao=n);ln=e,ci(o)}function ci(e){if(!Zt){sn&&(sn=clearTimeout(sn));var t=e-Rt;t>24?(e<1/0&&(sn=setTimeout(br,e-wn.now()-Eo)),nn&&(nn=clearInterval(nn))):(nn||(so=wn.now(),nn=setInterval(Ld,Ja)),Zt=1,ja(br))}}function xr(e,t,n){var o=new lo;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Gd=xo("start","end","cancel","interrupt"),Xd=[],ts=0,$r=1,di=2,Zn=3,Er=4,fi=5,qn=6;function So(e,t,n,o,i,r){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Ud(e,n,{name:t,index:o,group:i,on:Gd,tween:Xd,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ts})}function Ri(e,t){var n=Xe(e,t);if(n.state>ts)throw new Error("too late; already scheduled");return n}function Je(e,t){var n=Xe(e,t);if(n.state>Zn)throw new Error("too late; already running");return n}function Xe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ud(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=es(r,0,n.time);function r(u){n.state=$r,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,d,f,g;if(n.state!==$r)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===Zn)return xr(a);g.state===Er?(g.state=qn,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+c<t&&(g.state=qn,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[c])}if(xr(function(){n.state===Zn&&(n.state=Er,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=di,n.on.call("start",e,e.__data__,n.index,n.group),n.state===di){for(n.state=Zn,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=fi,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===fi&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=qn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Qn(e,t){var n=e.__transition,o,i,r=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((o=n[a]).name!==t){r=!1;continue}i=o.state>di&&o.state<fi,o.state=qn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[a]}r&&delete e.__transition}}function Kd(e){return this.each(function(){Qn(this,e)})}function Wd(e,t){var n,o;return function(){var i=Je(this,e),r=i.tween;if(r!==n){o=n=r;for(var a=0,s=o.length;a<s;++a)if(o[a].name===t){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function Zd(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Je(this,e),a=r.tween;if(a!==o){i=(o=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}r.tween=i}}function qd(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Xe(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===e)return a.value;return null}return this.each((t==null?Wd:Zd)(n,e,t))}function Fi(e,t,n){var o=e._id;return e.each(function(){var i=Je(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Xe(i,o).value[t]}}function ns(e,t){var n;return(typeof t=="number"?vt:t instanceof yn?yr:(n=yn(t))?(t=n,yr):Td)(e,t)}function Qd(e){return function(){this.removeAttribute(e)}}function Jd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jd(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}}function ef(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}function tf(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function nf(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function of(e,t){var n=$o(e),o=n==="transform"?Dd:ns;return this.attrTween(e,typeof t=="function"?(n.local?nf:tf)(n,o,Fi(this,"attr."+e,t)):t==null?(n.local?Jd:Qd)(n):(n.local?ef:jd)(n,o,t))}function rf(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function af(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function sf(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&af(e,r)),n}return i._value=t,i}function lf(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&rf(e,r)),n}return i._value=t,i}function uf(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=$o(e);return this.tween(n,(o.local?sf:lf)(o,t))}function cf(e,t){return function(){Ri(this,e).delay=+t.apply(this,arguments)}}function df(e,t){return t=+t,function(){Ri(this,e).delay=t}}function ff(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cf:df)(t,e)):Xe(this.node(),t).delay}function hf(e,t){return function(){Je(this,e).duration=+t.apply(this,arguments)}}function gf(e,t){return t=+t,function(){Je(this,e).duration=t}}function pf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hf:gf)(t,e)):Xe(this.node(),t).duration}function vf(e,t){if(typeof t!="function")throw new Error;return function(){Je(this,e).ease=t}}function mf(e){var t=this._id;return arguments.length?this.each(vf(t,e)):Xe(this.node(),t).ease}function yf(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Je(this,e).ease=n}}function wf(e){if(typeof e!="function")throw new Error;return this.each(yf(this._id,e))}function _f(e){typeof e!="function"&&(e=Pa(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new lt(o,this._parents,this._name,this._id)}function bf(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),a=new Array(o),s=0;s<r;++s)for(var l=t[s],u=n[s],c=l.length,d=a[s]=new Array(c),f,g=0;g<c;++g)(f=l[g]||u[g])&&(d[g]=f);for(;s<o;++s)a[s]=t[s];return new lt(a,this._parents,this._name,this._id)}function xf(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function $f(e,t,n){var o,i,r=xf(t)?Ri:Je;return function(){var a=r(this,e),s=a.on;s!==o&&(i=(o=s).copy()).on(t,n),a.on=i}}function Ef(e,t){var n=this._id;return arguments.length<2?Xe(this.node(),n).on.on(e):this.each($f(n,e,t))}function Sf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Nf(){return this.on("end.remove",Sf(this._id))}function Cf(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Pi(e));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var s=o[a],l=s.length,u=r[a]=new Array(l),c,d,f=0;f<l;++f)(c=s[f])&&(d=e.call(c,c.__data__,f,s))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,So(u[f],t,n,f,u,Xe(c,n)));return new lt(r,this._parents,t,n)}function kf(e){var t=this._name,n=this._id;typeof e!="function"&&(e=za(e));for(var o=this._groups,i=o.length,r=[],a=[],s=0;s<i;++s)for(var l=o[s],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),g,$=Xe(c,n),w=0,y=f.length;w<y;++w)(g=f[w])&&So(g,t,n,w,f,$);r.push(f),a.push(c)}return new lt(r,a,t,n)}var Mf=Cn.prototype.constructor;function If(){return new Mf(this._groups,this._parents)}function Tf(e,t){var n,o,i;return function(){var r=Wt(this,e),a=(this.style.removeProperty(e),Wt(this,e));return r===a?null:r===n&&a===o?i:i=t(n=r,o=a)}}function os(e){return function(){this.style.removeProperty(e)}}function Af(e,t,n){var o,i=n+"",r;return function(){var a=Wt(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}function zf(e,t,n){var o,i,r;return function(){var a=Wt(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),Wt(this,e))),a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s))}}function Pf(e,t){var n,o,i,r="style."+t,a="end."+r,s;return function(){var l=Je(this,e),u=l.on,c=l.value[r]==null?s||(s=os(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(a,i=c),l.on=o}}function Df(e,t,n){var o=(e+="")=="transform"?Pd:ns;return t==null?this.styleTween(e,Tf(e,o)).on("end.style."+e,os(e)):typeof t=="function"?this.styleTween(e,zf(e,o,Fi(this,"style."+e,t))).each(Pf(this._id,e)):this.styleTween(e,Af(e,o,t),n).on("end.style."+e,null)}function Bf(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Of(e,t,n){var o,i;function r(){var a=t.apply(this,arguments);return a!==i&&(o=(i=a)&&Bf(e,a,n)),o}return r._value=t,r}function Rf(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Of(e,t,n??""))}function Ff(e){return function(){this.textContent=e}}function Hf(e){return function(){var t=e(this);this.textContent=t??""}}function Vf(e){return this.tween("text",typeof e=="function"?Hf(Fi(this,"text",e)):Ff(e==null?"":e+""))}function Lf(e){return function(t){this.textContent=e.call(this,t)}}function Yf(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Lf(i)),t}return o._value=e,o}function Gf(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,Yf(e))}function Xf(){for(var e=this._name,t=this._id,n=is(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=Xe(l,t);So(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new lt(o,this._parents,e,n)}function Uf(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var s={value:a},l={value:function(){--i===0&&r()}};n.each(function(){var u=Je(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&r()})}var Kf=0;function lt(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function is(){return++Kf}var et=Cn.prototype;lt.prototype={constructor:lt,select:Cf,selectAll:kf,selectChild:et.selectChild,selectChildren:et.selectChildren,filter:_f,merge:bf,selection:If,transition:Xf,call:et.call,nodes:et.nodes,node:et.node,size:et.size,empty:et.empty,each:et.each,on:Ef,attr:of,attrTween:uf,style:Df,styleTween:Rf,text:Vf,textTween:Gf,remove:Nf,tween:qd,delay:ff,duration:pf,ease:mf,easeVarying:wf,end:Uf,[Symbol.iterator]:et[Symbol.iterator]};function Wf(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Zf={time:null,delay:0,duration:250,ease:Wf};function qf(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Qf(e){var t,n;e instanceof lt?(t=e._id,e=e._name):(t=is(),(n=Zf).time=Oi(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&So(l,e,t,u,a,n||qf(l,t));return new lt(o,this._parents,e,t)}Cn.prototype.interrupt=Kd;Cn.prototype.transition=Qf;const On=e=>()=>e;function Jf(e,{sourceEvent:t,target:n,transform:o,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:o,enumerable:!0,configurable:!0},_:{value:i}})}function ot(e,t,n){this.k=e,this.x=t,this.y=n}ot.prototype={constructor:ot,scale:function(e){return e===1?this:new ot(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ot(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var qt=new ot(1,0,0);ot.prototype;function Lo(e){e.stopImmediatePropagation()}function on(e){e.preventDefault(),e.stopImmediatePropagation()}function jf(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function eh(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Sr(){return this.__zoom||qt}function th(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nh(){return navigator.maxTouchPoints||"ontouchstart"in this}function oh(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function ih(){var e=jf,t=eh,n=oh,o=th,i=nh,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Fd,u=xo("start","zoom","end"),c,d,f,g=500,$=150,w=0,y=10;function p(h){h.property("__zoom",Sr).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(h,M,v,z){var I=h.selection?h.selection():h;I.property("__zoom",Sr),h!==I?T(h,M,v,z):I.interrupt().each(function(){P(this,arguments).event(z).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},p.scaleBy=function(h,M,v,z){p.scaleTo(h,function(){var I=this.__zoom.k,B=typeof M=="function"?M.apply(this,arguments):M;return I*B},v,z)},p.scaleTo=function(h,M,v,z){p.transform(h,function(){var I=t.apply(this,arguments),B=this.__zoom,D=v==null?_(I):typeof v=="function"?v.apply(this,arguments):v,L=B.invert(D),W=typeof M=="function"?M.apply(this,arguments):M;return n(m(b(B,W),D,L),I,a)},v,z)},p.translateBy=function(h,M,v,z){p.transform(h,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof v=="function"?v.apply(this,arguments):v),t.apply(this,arguments),a)},null,z)},p.translateTo=function(h,M,v,z,I){p.transform(h,function(){var B=t.apply(this,arguments),D=this.__zoom,L=z==null?_(B):typeof z=="function"?z.apply(this,arguments):z;return n(qt.translate(L[0],L[1]).scale(D.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof v=="function"?-v.apply(this,arguments):-v),B,a)},z,I)};function b(h,M){return M=Math.max(r[0],Math.min(r[1],M)),M===h.k?h:new ot(M,h.x,h.y)}function m(h,M,v){var z=M[0]-v[0]*h.k,I=M[1]-v[1]*h.k;return z===h.x&&I===h.y?h:new ot(h.k,z,I)}function _(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function T(h,M,v,z){h.on("start.zoom",function(){P(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(z).end()}).tween("zoom",function(){var I=this,B=arguments,D=P(I,B).event(z),L=t.apply(I,B),W=v==null?_(L):typeof v=="function"?v.apply(I,B):v,ee=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),Y=I.__zoom,U=typeof M=="function"?M.apply(I,B):M,Q=l(Y.invert(W).concat(ee/Y.k),U.invert(W).concat(ee/U.k));return function(ae){if(ae===1)ae=U;else{var ue=Q(ae),se=ee/ue[2];ae=new ot(se,W[0]-ue[0]*se,W[1]-ue[1]*se)}D.zoom(null,ae)}})}function P(h,M,v){return!v&&h.__zooming||new A(h,M)}function A(h,M){this.that=h,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(h,M),this.taps=0}A.prototype={event:function(h){return h&&(this.sourceEvent=h),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(h,M){return this.mouse&&h!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&h!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&h!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(h){var M=Ve(this.that).datum();u.call(h,this.that,new Jf(h,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),M)}};function R(h,...M){if(!e.apply(this,arguments))return;var v=P(this,M).event(h),z=this.__zoom,I=Math.max(r[0],Math.min(r[1],z.k*Math.pow(2,o.apply(this,arguments)))),B=Ze(h);if(v.wheel)(v.mouse[0][0]!==B[0]||v.mouse[0][1]!==B[1])&&(v.mouse[1]=z.invert(v.mouse[0]=B)),clearTimeout(v.wheel);else{if(z.k===I)return;v.mouse=[B,z.invert(B)],Qn(this),v.start()}on(h),v.wheel=setTimeout(D,$),v.zoom("mouse",n(m(b(z,I),v.mouse[0],v.mouse[1]),v.extent,a));function D(){v.wheel=null,v.end()}}function O(h,...M){if(f||!e.apply(this,arguments))return;var v=h.currentTarget,z=P(this,M,!0).event(h),I=Ve(h.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",ee,!0),B=Ze(h,v),D=h.clientX,L=h.clientY;Ga(h.view),Lo(h),z.mouse=[B,this.__zoom.invert(B)],Qn(this),z.start();function W(Y){if(on(Y),!z.moved){var U=Y.clientX-D,Q=Y.clientY-L;z.moved=U*U+Q*Q>w}z.event(Y).zoom("mouse",n(m(z.that.__zoom,z.mouse[0]=Ze(Y,v),z.mouse[1]),z.extent,a))}function ee(Y){I.on("mousemove.zoom mouseup.zoom",null),Xa(Y.view,z.moved),on(Y),z.event(Y).end()}}function F(h,...M){if(e.apply(this,arguments)){var v=this.__zoom,z=Ze(h.changedTouches?h.changedTouches[0]:h,this),I=v.invert(z),B=v.k*(h.shiftKey?.5:2),D=n(m(b(v,B),z,I),t.apply(this,M),a);on(h),s>0?Ve(this).transition().duration(s).call(T,D,z,h):Ve(this).call(p.transform,D,z,h)}}function H(h,...M){if(e.apply(this,arguments)){var v=h.touches,z=v.length,I=P(this,M,h.changedTouches.length===z).event(h),B,D,L,W;for(Lo(h),D=0;D<z;++D)L=v[D],W=Ze(L,this),W=[W,this.__zoom.invert(W),L.identifier],I.touch0?!I.touch1&&I.touch0[2]!==W[2]&&(I.touch1=W,I.taps=0):(I.touch0=W,B=!0,I.taps=1+!!c);c&&(c=clearTimeout(c)),B&&(I.taps<2&&(d=W[0],c=setTimeout(function(){c=null},g)),Qn(this),I.start())}}function k(h,...M){if(this.__zooming){var v=P(this,M).event(h),z=h.changedTouches,I=z.length,B,D,L,W;for(on(h),B=0;B<I;++B)D=z[B],L=Ze(D,this),v.touch0&&v.touch0[2]===D.identifier?v.touch0[0]=L:v.touch1&&v.touch1[2]===D.identifier&&(v.touch1[0]=L);if(D=v.that.__zoom,v.touch1){var ee=v.touch0[0],Y=v.touch0[1],U=v.touch1[0],Q=v.touch1[1],ae=(ae=U[0]-ee[0])*ae+(ae=U[1]-ee[1])*ae,ue=(ue=Q[0]-Y[0])*ue+(ue=Q[1]-Y[1])*ue;D=b(D,Math.sqrt(ae/ue)),L=[(ee[0]+U[0])/2,(ee[1]+U[1])/2],W=[(Y[0]+Q[0])/2,(Y[1]+Q[1])/2]}else if(v.touch0)L=v.touch0[0],W=v.touch0[1];else return;v.zoom("touch",n(m(D,L,W),v.extent,a))}}function G(h,...M){if(this.__zooming){var v=P(this,M).event(h),z=h.changedTouches,I=z.length,B,D;for(Lo(h),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),B=0;B<I;++B)D=z[B],v.touch0&&v.touch0[2]===D.identifier?delete v.touch0:v.touch1&&v.touch1[2]===D.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(D=Ze(D,this),Math.hypot(d[0]-D[0],d[1]-D[1])<y)){var L=Ve(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return p.wheelDelta=function(h){return arguments.length?(o=typeof h=="function"?h:On(+h),p):o},p.filter=function(h){return arguments.length?(e=typeof h=="function"?h:On(!!h),p):e},p.touchable=function(h){return arguments.length?(i=typeof h=="function"?h:On(!!h),p):i},p.extent=function(h){return arguments.length?(t=typeof h=="function"?h:On([[+h[0][0],+h[0][1]],[+h[1][0],+h[1][1]]]),p):t},p.scaleExtent=function(h){return arguments.length?(r[0]=+h[0],r[1]=+h[1],p):[r[0],r[1]]},p.translateExtent=function(h){return arguments.length?(a[0][0]=+h[0][0],a[1][0]=+h[1][0],a[0][1]=+h[0][1],a[1][1]=+h[1][1],p):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},p.constrain=function(h){return arguments.length?(n=h,p):n},p.duration=function(h){return arguments.length?(s=+h,p):s},p.interpolate=function(h){return arguments.length?(l=h,p):l},p.on=function(){var h=u.on.apply(u,arguments);return h===u?p:h},p.clickDistance=function(h){return arguments.length?(w=(h=+h)*h,p):Math.sqrt(w)},p.tapDistance=function(h){return arguments.length?(y=+h,p):y},p}var te=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(te||{}),Hi=(e=>(e.Partial="partial",e.Full="full",e))(Hi||{}),Mt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(Mt||{}),St=(e=>(e.Strict="strict",e.Loose="loose",e))(St||{}),hi=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(hi||{}),hn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(hn||{});const rh=["INPUT","SELECT","TEXTAREA"];function gi(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof(o==null?void 0:o.hasAttribute)=="function"?o.hasAttribute("contenteditable"):!1,r=typeof(o==null?void 0:o.closest)=="function"?o.closest(".nokey"):null;return rh.includes(o==null?void 0:o.nodeName)||i||!!r}function ah(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Nr(e,t,n,o){const i=t.replace("+",`
|
|
2
|
-
`).replace(`
|
|
3
|
-
|
|
4
|
-
`,`
|
|
5
|
-
+`).split(`
|
|
6
|
-
`).map(a=>a.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((a,s)=>n.has(a)&&Array.from(n.values())[s]===i[s]);return o&&n.delete(e.toLowerCase()),r}function sh(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=lh(n.code,e);return Array.isArray(e)?e.some(i=>Nr(n[o],i,t,n.type==="keyup")):Nr(n[o],e,t,n.type==="keyup")}}function lh(e,t){return t.includes(e)?"code":"key"}function gn(e,t){const n=_e(()=>ye(t==null?void 0:t.actInsideInputWithModifier)??!1),o=_e(()=>ye(t==null?void 0:t.target)??window),i=_e(()=>ye(t==null?void 0:t.preventDefault)??!0),r=ce(ye(e)===!0);let a=!1;const s=new Set;let l=c(ye(e));xe(()=>ye(e),(d,f)=>{typeof f=="boolean"&&typeof d!="boolean"&&u(),l=c(d)},{immediate:!0}),Ta(["blur","contextmenu"],u),sr((...d)=>l(...d),d=>{var f,g;if(a=ah(d),(!a||a&&!n.value)&&gi(d))return;const w=((g=(f=d.composedPath)==null?void 0:f.call(d))==null?void 0:g[0])||d.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";!i.value&&(a||!y)&&d.preventDefault(),r.value=!0},{eventName:"keydown",target:o}),sr((...d)=>l(...d),d=>{if(r.value){if((!a||a&&!n.value)&&gi(d))return;a=!1,r.value=!1}},{eventName:"keyup",target:o});function u(){a=!1,s.clear(),r.value=ye(e)===!0}function c(d){return d===null?(u(),()=>!1):typeof d=="boolean"?(u(),r.value=d,()=>!1):Array.isArray(d)||typeof d=="string"?sh(d,s):d}return r}const rs="vue-flow__node-desc",as="vue-flow__edge-desc",uh="vue-flow__aria-live",ss=["Enter"," ","Escape"],Ut={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function uo(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function co(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function No(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Ft(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function ls(e,t){return{x:Ft(e.x,t[0][0],t[1][0]),y:Ft(e.y,t[0][1],t[1][1])}}function Cr(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Nt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Dt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Nt(e)}function un(e){return Dt(e)&&"computedPosition"in e}function Rn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function ch(e){return Rn(e.width)&&Rn(e.height)&&Rn(e.x)&&Rn(e.y)}function dh(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:fn({width:0,height:0}),computedPosition:fn({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:ke(e.data)?e.data:{},events:fn(ke(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function us(e,t,n){var o,i;const r={id:e.id.toString(),type:e.type??(t==null?void 0:t.type)??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:e.updatable??(n==null?void 0:n.updatable),selectable:e.selectable??(n==null?void 0:n.selectable),focusable:e.focusable??(n==null?void 0:n.focusable),data:ke(e.data)?e.data:{},events:fn(ke(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(n==null?void 0:n.interactionWidth),...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function cs(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,a=o==="source"?"target":"source";for(const s of n)s[a]===i&&r.add(s[o]);return t.filter(s=>r.has(s.id))}function fh(...e){if(e.length===3){const[r,a,s]=e;return cs(r,a,s,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>Nt(r)&&r.source===o).map(r=>n.find(a=>Dt(a)&&a.id===r.target))}function hh(...e){if(e.length===3){const[r,a,s]=e;return cs(r,a,s,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>Nt(r)&&r.target===o).map(r=>n.find(a=>Dt(a)&&a.id===r.source))}function ds({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function gh(e,t){return t.some(n=>Nt(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))}function pi({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function _n({x:e,y:t},{x:n,y:o,zoom:i},r=!1,a=[1,1]){const s={x:(e-n)/i,y:(t-o)/i};return r?Co(s,a):s}function fs(e,t){return{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)}}function fo({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function hs({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function ph(e,t){return hs(fs(fo(e),fo(t)))}function Vi(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=fs(t,fo({...o.computedPosition,...o.dimensions}))}return hs(t)}function gs(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={..._n(t,n),width:t.width/n.zoom,height:t.height/n.zoom},a=[];for(const s of e){const{dimensions:l,selectable:u=!0,hidden:c=!1}=s,d=l.width??s.width??null,f=l.height??s.height??null;if(i&&!u||c)continue;const g=co(r,uo(s)),$=d===null||f===null,w=o&&g>0,y=(d??0)*(f??0);($||w||g>=y||s.dragging)&&a.push(s)}return a}function It(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function kr(e,t,n,o,i,r=.1,a={x:0,y:0}){const s=t/(e.width*(1+r)),l=n/(e.height*(1+r)),u=Math.min(s,l),c=Ft(u,o,i),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*c+(a.x??0),$=n/2-f*c+(a.y??0);return{x:g,y:$,zoom:c}}function vh(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function ps(e,t){if(!e.parentNode)return!1;const n=t(e.parentNode);return n?n.selected?!0:ps(n,t):!1}function bn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function Mr(e,t,n){return e<t?Ft(Math.abs(e-t),1,t)/t:e>n?-Ft(Math.abs(e-n),1,t)/t:0}function vs(e,t,n=15,o=40){const i=Mr(e.x,o,t.width-o)*n,r=Mr(e.y,o,t.height-o)*n;return[i,r]}function Yo(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style=="function"?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(e.position.x<0){const r=Math.abs(e.position.x);if(t.position.x=t.position.x-r,typeof i.width=="string"){const a=Number(i.width.replace("px",""));i.width=`${a+r}px`}else i.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(t.position.y=t.position.y-r,typeof i.height=="string"){const a=Number(i.height.replace("px",""));i.height=`${a+r}px`}else i.height+=r;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace("px","")),t.dimensions.height=Number(i.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const a=t.style;return{...a(r),...i}}:t.style={...t.style,...i}}}}function Ir(e,t){var n,o;const i=e.filter(a=>a.type==="add"||a.type==="remove");for(const a of i)if(a.type==="add")t.findIndex(l=>l.id===a.item.id)===-1&&t.push(a.item);else if(a.type==="remove"){const s=t.findIndex(l=>l.id===a.id);s!==-1&&t.splice(s,1)}const r=t.map(a=>a.id);for(const a of t)for(const s of e)if(s.id===a.id)switch(s.type){case"select":a.selected=s.selected;break;case"position":if(un(a)&&(typeof s.position<"u"&&(a.position=s.position),typeof s.dragging<"u"&&(a.dragging=s.dragging),a.expandParent&&a.parentNode)){const l=t[r.indexOf(a.parentNode)];l&&un(l)&&Yo(a,l)}break;case"dimensions":if(un(a)&&(typeof s.dimensions<"u"&&(a.dimensions=s.dimensions),typeof s.updateStyle<"u"&&s.updateStyle&&(a.style={...a.style||{},width:`${(n=s.dimensions)==null?void 0:n.width}px`,height:`${(o=s.dimensions)==null?void 0:o.height}px`}),typeof s.resizing<"u"&&(a.resizing=s.resizing),a.expandParent&&a.parentNode)){const l=t[r.indexOf(a.parentNode)];l&&un(l)&&(!!l.dimensions.width&&!!l.dimensions.height?Yo(a,l):Ge(()=>{Yo(a,l)}))}break}return t}function gt(e,t){return{id:e,type:"select",selected:t}}function Tr(e){return{item:e,type:"add"}}function Ar(e){return{id:e,type:"remove"}}function zr(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function mt(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const a=t.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),o.push(gt(r.id,a)))}return o}function q(e){const t=new Set;let n=!1;const o=()=>t.size>0;e&&(n=!0,t.add(e));const i=s=>{t.delete(s)};return{on:s=>{e&&n&&t.delete(e),t.add(s);const l=()=>{i(s),e&&n&&t.add(e)};return bo(l),{off:l}},off:i,trigger:s=>Promise.all(Array.from(t).map(l=>l(s))),hasListeners:o,fns:t}}function Pr(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function mh(e,t,n,o,i){var r,a;const s=[];for(const l of e)(l.selected||l.id===i)&&(!l.parentNode||!ps(l,o))&&(l.draggable||t&&typeof l.draggable>"u")&&s.push(fn({id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((r=l.computedPosition)==null?void 0:r.x)||0,y:n.y-((a=l.computedPosition)==null?void 0:a.y)||0},from:l.computedPosition,extent:l.extent,parentNode:l.parentNode,dimensions:l.dimensions,expandParent:l.expandParent}));return s}function Go({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function ms(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function yh(e,t,n){const[o,i,r,a]=typeof e!="string"?ms(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+a,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function wh(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&(i==null?void 0:i.range)==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const r=yh(i,e,o);r&&(i=r)}else t(new Ie(Me.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,a=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+a],[i[1][0]+r,i[1][1]+a]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,a,s,l]=ms(i.padding),u=(o==null?void 0:o.computedPosition.x)||0,c=(o==null?void 0:o.computedPosition.y)||0;i=[[i.range[0][0]+u+l,i.range[0][1]+c+r],[i.range[1][0]+u-a,i.range[1][1]+c-s]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function _h({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Li(e,t,n,o,i){const r=_h(e.dimensions,wh(e,n,o,i)),a=ls(t,r);return{position:{x:a.x-((i==null?void 0:i.computedPosition.x)||0),y:a.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:a}}function Qt(e,t,n=te.Left,o=!1){const i=((t==null?void 0:t.x)??0)+e.computedPosition.x,r=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:a,height:s}=t??Eh(e);if(o)return{x:i+a/2,y:r+s/2};switch((t==null?void 0:t.position)??n){case te.Top:return{x:i+a/2,y:r};case te.Right:return{x:i+a,y:r+s/2};case te.Bottom:return{x:i+a/2,y:r+s};case te.Left:return{x:i,y:r+s/2}}}function Dr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function bh({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:a,height:s,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=fo({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:a/l.zoom,height:s/l.zoom}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function xh(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),a=t(e.target);return!r||!a?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,a.computedPosition.z||0)),i)}var Me=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Me||{});const Br={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
|
|
7
|
-
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
8
|
-
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
9
|
-
Node: ${e}
|
|
10
|
-
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
|
|
11
|
-
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
|
|
12
|
-
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
|
|
13
|
-
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
|
|
14
|
-
Edge: ${e}
|
|
15
|
-
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
|
|
16
|
-
Edge: ${e}
|
|
17
|
-
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
|
|
18
|
-
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
|
|
19
|
-
Edge: ${e}
|
|
20
|
-
Source: ${t}
|
|
21
|
-
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
|
|
22
|
-
Edge: ${e}
|
|
23
|
-
Source: ${t}
|
|
24
|
-
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
25
|
-
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
26
|
-
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ie extends Error{constructor(t,...n){var o;super((o=Br[t])==null?void 0:o.call(Br,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Yi(e){return"clientX"in e}function $h(e){return"sourceEvent"in e}function Et(e,t){const n=Yi(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}}const ho=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Eh(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function Co(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const Sh=()=>!0;function Xo(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Nh(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())co(i,uo(r))>0&&o.push(r);return o}const Ch=250;function kh(e,t,n,o){var i,r;let a=[],s=Number.POSITIVE_INFINITY;const l=Nh(e,n,t+Ch);for(const u of l){const c=[...((i=u.handleBounds)==null?void 0:i.source)??[],...((r=u.handleBounds)==null?void 0:r.target)??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:f,y:g}=Qt(u,d,d.position,!0),$=Math.sqrt((f-e.x)**2+(g-e.y)**2);$>t||($<s?(a=[{...d,x:f,y:g}],s=$):$===s&&a.push({...d,x:f,y:g}))}}if(!a.length)return null;if(a.length>1){const u=o.type==="source"?"target":"source";return a.find(c=>c.type===u)??a[0]}return a[0]}function Or(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:a,lib:s,flowId:l,isValidConnection:u=Sh},c,d,f){const g=r==="target",$=t?a.querySelector(`.${s}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:w,y}=Et(e),p=a.elementFromPoint(w,y),b=p!=null&&p.classList.contains(`${s}-flow__handle`)?p:$,m={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const _=ys(void 0,b),T=b.getAttribute("data-nodeid"),P=b.getAttribute("data-handleid"),A=b.classList.contains("connectable"),R=b.classList.contains("connectableend");if(!T||!_)return m;const O={source:g?T:o,sourceHandle:g?P:i,target:g?o:T,targetHandle:g?i:P};m.connection=O;const H=A&&R&&(n===St.Strict?g&&_==="source"||!g&&_==="target":T!==o||P!==i);m.isValid=H&&u(O,{nodes:d,edges:c,sourceNode:f(o),targetNode:f(T)}),m.toHandle=t}return m}function ys(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Mh(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Ih(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Th(e,t,n,o,i,r=!1){var a,s,l;const u=o.get(e);if(!u)return null;const c=i===St.Strict?(a=u.handleBounds)==null?void 0:a[t]:[...((s=u.handleBounds)==null?void 0:s.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c==null?void 0:c.find(f=>f.id===n):c==null?void 0:c[0])??null;return d&&r?{...d,...Qt(u,d,d.position,!0)}:d}const vi={[te.Left]:te.Right,[te.Right]:te.Left,[te.Top]:te.Bottom,[te.Bottom]:te.Top},Ah=["production","prod"];function ko(e,...t){ws()&&console.warn(`[Vue Flow]: ${e}`,...t)}function ws(){return!Ah.includes("production")}function Rr(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(a=>{const s=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(s.left-n.left)/o,y:(s.top-n.top)/o,...No(a)}}):null}function mi(e,t,n,o,i,r=!1,a){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Ge(()=>{a.blur()})):n([e])}function ke(e){return typeof N(e)<"u"}function zh(e,t,n,o){if(!e||!e.source||!e.target)return n(new Ie(Me.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let i;return Nt(e)?i=e:i={...e,id:ds(e)},i=us(i,void 0,o),gh(i,t)?!1:i}function Ph(e,t,n,o,i){if(!t.source||!t.target)return i(new Ie(Me.EDGE_INVALID,e.id)),!1;if(!n)return i(new Ie(Me.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...a}=e;return{...a,id:o?ds(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Fr(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const a=e[r];if(!Dt(a)){n(new Ie(Me.NODE_INVALID,a==null?void 0:a.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=dh(a,t(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[r]=s}for(const r of i){const a=t(r.parentNode)||i.find(s=>s.id===r.parentNode);r.parentNode&&!a&&n(new Ie(Me.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),a&&(a.isParent=!0))}return i}function Hr(e,t,n,o,i,r){let a=i;const s=o.get(a)||new Map;o.set(a,s.set(n,t)),a=`${i}-${e}`;const l=o.get(a)||new Map;if(o.set(a,l.set(n,t)),r){a=`${i}-${e}-${r}`;const u=o.get(a)||new Map;o.set(a,u.set(n,t))}}function Uo(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:a=null,targetHandle:s=null}=o,l={edgeId:o.id,source:i,target:r,sourceHandle:a,targetHandle:s},u=`${i}-${a}--${r}-${s}`,c=`${r}-${s}--${i}-${a}`;Hr("source",l,c,e,i,a),Hr("target",l,u,e,r,s)}}function Vr(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ko(e,t,n,o,i,r,a,s){const l=[];for(const u of e){const c=Nt(u)?u:zh(u,s,i,r);if(!c)continue;const d=n(c.source),f=n(c.target);if(!d||!f){i(new Ie(Me.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new Ie(Me.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!f){i(new Ie(Me.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:s,nodes:a,sourceNode:d,targetNode:f})){i(new Ie(Me.EDGE_INVALID,c.id));continue}const g=o(c.id);l.push({...us(c,g,r),sourceNode:d,targetNode:f})}return l}const Lr=Symbol("vueFlow"),_s=Symbol("nodeId"),bs=Symbol("nodeRef"),Dh=Symbol("edgeId"),Bh=Symbol("edgeRef"),Mo=Symbol("slots");function xs(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodes:r,nodeExtent:a,nodeDragThreshold:s,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:f,findNode:g,multiSelectionActive:$,nodesSelectionActive:w,selectNodesOnDrag:y,removeSelectedElements:p,addSelectedNodes:b,updateNodePositions:m,emits:_}=$e(),{onStart:T,onDrag:P,onStop:A,onClick:R,el:O,disabled:F,id:H,selectable:k,dragHandle:G}=e,h=ce(!1);let M=[],v,z=null,I={x:void 0,y:void 0},B={x:0,y:0},D=null,L=!1,W=0,ee=!1;const Y=Fh(),U=({x:re,y:de})=>{I={x:re,y:de};let he=!1;if(M=M.map(E=>{const x={x:re-E.distance.x,y:de-E.distance.y},{computedPosition:C}=Li(E,n.value?Co(x,o.value):x,_.error,a.value,E.parentNode?g(E.parentNode):void 0);return he=he||E.position.x!==C.x||E.position.y!==C.y,E.position=C,E}),!!he&&(m(M,!0,!0),h.value=!0,D)){const[E,x]=Go({id:H,dragItems:M,findNode:g});P({event:D,node:E,nodes:x})}},Q=()=>{if(!z)return;const[re,de]=vs(B,z,c.value);if(re!==0||de!==0){const he={x:(I.x??0)-re/l.value.zoom,y:(I.y??0)-de/l.value.zoom};f({x:re,y:de})&&U(he)}W=requestAnimationFrame(Q)},ae=(re,de)=>{L=!0;const he=g(H);!y.value&&!$.value&&he&&(he.selected||p()),he&&ye(k)&&y.value&&mi(he,$.value,b,p,w,!1,de);const E=Y(re.sourceEvent);if(I=E,M=mh(r.value,d.value,E,g,H),M.length){const[x,C]=Go({id:H,dragItems:M,findNode:g});T({event:re.sourceEvent,node:x,nodes:C})}},ue=(re,de)=>{var he;re.sourceEvent.type==="touchmove"&&re.sourceEvent.touches.length>1||(s.value===0&&ae(re,de),I=Y(re.sourceEvent),z=((he=t.value)==null?void 0:he.getBoundingClientRect())||null,B=Et(re.sourceEvent,z))},se=(re,de)=>{const he=Y(re.sourceEvent);if(!ee&&L&&u.value&&(ee=!0,Q()),!L){const E=he.xSnapped-(I.x??0),x=he.ySnapped-(I.y??0);Math.sqrt(E*E+x*x)>s.value&&ae(re,de)}(I.x!==he.xSnapped||I.y!==he.ySnapped)&&M.length&&L&&(D=re.sourceEvent,B=Et(re.sourceEvent,z),U(he))},we=re=>{let de=!1;if(!L&&!h.value&&!$.value){const he=re.sourceEvent,E=Y(he),x=E.xSnapped-(I.x??0),C=E.ySnapped-(I.y??0),S=Math.sqrt(x*x+C*C);S!==0&&S<=s.value&&(R==null||R(he),de=!0)}if(M.length&&!de){m(M,!1,!1);const[he,E]=Go({id:H,dragItems:M,findNode:g});A({event:re.sourceEvent,node:he,nodes:E})}M=[],h.value=!1,ee=!1,L=!1,I={x:void 0,y:void 0},cancelAnimationFrame(W)};return xe([()=>ye(F),O],([re,de],he,E)=>{if(de){const x=Ve(de);re||(v=hd().on("start",C=>ue(C,de)).on("drag",C=>se(C,de)).on("end",C=>we(C)).filter(C=>{const S=C.target,V=ye(G);return!C.button&&(!i.value||!Pr(S,`.${i.value}`,de)&&(!V||Pr(S,V,de)))}),x.call(v)),E(()=>{x.on(".drag",null),v&&(v.on("start",null),v.on("drag",null),v.on("end",null))})}}),h}function Oh(){return{doubleClick:q(),click:q(),mouseEnter:q(),mouseMove:q(),mouseLeave:q(),contextMenu:q(),updateStart:q(),update:q(),updateEnd:q()}}function Rh(e,t){const n=Oh();return n.doubleClick.on(o=>{var i,r;t.edgeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.edgeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.edgeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.edgeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.edgeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.edgeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;t.edgeUpdateStart(o),(r=(i=e.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;t.edgeUpdate(o),(r=(i=e.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;t.edgeUpdateEnd(o),(r=(i=e.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Fh(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=$e();return i=>{var r;const a=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},s=$h(i)?i.sourceEvent:i,{x:l,y:u}=Et(s,a),c=_n({x:l,y:u},e.value),{x:d,y:f}=n.value?Co(c,t.value):c;return{xSnapped:d,ySnapped:f,...c}}}function Fn(){return!0}function $s({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:a}){const{id:s,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:f,nodesConnectable:g,autoPanOnConnect:$,autoPanSpeed:w,findNode:y,panBy:p,startConnection:b,updateConnection:m,endConnection:_,emits:T,viewport:P,edges:A,nodes:R,isValidConnection:O,nodeLookup:F}=$e();let H=null,k=!1,G=null;function h(v){var z;const I=ye(n)==="target",B=Yi(v),D=Cr(v.target);if(B&&v.button===0||!B){let L=function(le){E=Et(le,re),U=kh(_n(E,P.value,!1,[1,1]),c.value,F.value,S),x||(C(),x=!0);const ve=Or(le,{handle:U,connectionMode:u.value,fromNodeId:ye(t),fromHandleId:ye(e),fromType:I?"target":"source",isValidConnection:Y,doc:D,lib:"vue",flowId:s,nodeLookup:F.value},A.value,R.value,y);G=ve.handleDomNode,H=ve.connection,k=Ih(!!U,ve.isValid);const me={...j,isValid:k,to:U&&k?pi({x:U.x,y:U.y},P.value):E,toHandle:ve.toHandle,toPosition:k&&ve.toHandle?ve.toHandle.position:vi[S.position],toNode:ve.toHandle?F.value.get(ve.toHandle.nodeId):null};if(!(k&&U&&(j!=null&&j.toHandle)&&me.toHandle&&j.toHandle.type===me.toHandle.type&&j.toHandle.nodeId===me.toHandle.nodeId&&j.toHandle.id===me.toHandle.id&&j.to.x===me.to.x&&j.to.y===me.to.y)){if(m(U&&k?pi({x:U.x,y:U.y},P.value):E,ve.toHandle,Mh(!!U,k)),j=me,!U&&!k&&!G)return Xo(he);H&&H.source!==H.target&&G&&(Xo(he),he=G,G.classList.add("connecting","vue-flow__handle-connecting"),G.classList.toggle("valid",!!k),G.classList.toggle("vue-flow__handle-valid",!!k))}},W=function(le){(U||G)&&H&&k&&(r?r(le,H):T.connect(H)),T.connectEnd(le),i&&(a==null||a(le)),Xo(he),cancelAnimationFrame(Q),_(le),x=!1,k=!1,H=null,G=null,D.removeEventListener("mousemove",L),D.removeEventListener("mouseup",W),D.removeEventListener("touchmove",L),D.removeEventListener("touchend",W)};const ee=y(ye(t));let Y=ye(o)||O.value||Fn;!Y&&ee&&(Y=(I?ee.isValidSourcePos:ee.isValidTargetPos)||Fn);let U,Q=0;const{x:ae,y:ue}=Et(v),se=D==null?void 0:D.elementFromPoint(ae,ue),we=ys(ye(i),se),re=(z=l.value)==null?void 0:z.getBoundingClientRect();if(!re||!we)return;const de=Th(ye(t),we,ye(e),F.value,u.value);if(!de)return;let he,E=Et(v,re),x=!1;const C=()=>{if(!$.value)return;const[le,ve]=vs(E,re,w.value);p({x:le,y:ve}),Q=requestAnimationFrame(C)},S={...de,nodeId:ye(t),type:we,position:de.position},V=F.value.get(ye(t)),J={inProgress:!0,isValid:null,from:Qt(V,S,te.Left,!0),fromHandle:S,fromPosition:S.position,fromNode:V,to:E,toHandle:null,toPosition:vi[S.position],toNode:null};b({nodeId:ye(t),id:ye(e),type:we,position:(se==null?void 0:se.getAttribute("data-handlepos"))||te.Top},{x:ae-re.left,y:ue-re.top}),T.connectStart({event:v,nodeId:ye(t),handleId:ye(e),handleType:we});let j=J;D.addEventListener("mousemove",L),D.addEventListener("mouseup",W),D.addEventListener("touchmove",L),D.addEventListener("touchend",W)}}function M(v){var z,I;if(!d.value)return;const B=ye(n)==="target";if(!f.value){T.clickConnectStart({event:v,nodeId:ye(t),handleId:ye(e)}),b({nodeId:ye(t),type:ye(n),id:ye(e),position:te.Top},void 0,!0);return}let D=ye(o)||O.value||Fn;const L=y(ye(t));if(!D&&L&&(D=(B?L.isValidSourcePos:L.isValidTargetPos)||Fn),L&&(typeof L.connectable>"u"?g.value:L.connectable)===!1)return;const W=Cr(v.target),ee=Or(v,{handle:{nodeId:ye(t),id:ye(e),type:ye(n),position:te.Top},connectionMode:u.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id||null,fromType:f.value.type,isValidConnection:D,doc:W,lib:"vue",flowId:s,nodeLookup:F.value},A.value,R.value,y),Y=((z=ee.connection)==null?void 0:z.source)===((I=ee.connection)==null?void 0:I.target);ee.isValid&&ee.connection&&!Y&&T.connect(ee.connection),T.clickConnectEnd(v),_(v,!0)}return{handlePointerDown:h,handleClick:M}}function Hh(){return Vt(_s,"")}function Es(e){const t=e??Hh()??"",n=Vt(bs,ce(null)),{findNode:o,edges:i,emits:r}=$e(),a=o(t);return a||r.error(new Ie(Me.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:a,parentNode:K(()=>o(a.parentNode)),connectedEdges:K(()=>It([a],i.value))}}function Vh(){return{doubleClick:q(),click:q(),mouseEnter:q(),mouseMove:q(),mouseLeave:q(),contextMenu:q(),dragStart:q(),drag:q(),dragStop:q()}}function Lh(e,t){const n=Vh();return n.doubleClick.on(o=>{var i,r;t.nodeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.nodeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.nodeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.nodeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.nodeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.nodeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;t.nodeDragStart(o),(r=(i=e.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;t.nodeDrag(o),(r=(i=e.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;t.nodeDragStop(o),(r=(i=e.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Ss(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:a,emits:s}=$e();return(l,u=!1)=>{const c=r.value?i.value[0]:5,d=r.value?i.value[1]:5,f=u?4:1,g=l.x*c*f,$=l.y*d*f,w=[];for(const y of e.value)if(y.draggable||a&&typeof y.draggable>"u"){const p={x:y.computedPosition.x+g,y:y.computedPosition.y+$},{computedPosition:b}=Li(y,p,s.error,t.value,y.parentNode?o(y.parentNode):void 0);w.push({id:y.id,position:b,from:y.position,distance:{x:l.x,y:l.y},dimensions:y.dimensions})}n(w,!0,!1)}}const Wo=.1;function ht(){return ko("Viewport not initialized yet."),Promise.resolve(!1)}const Yh={zoomIn:ht,zoomOut:ht,zoomTo:ht,fitView:ht,setCenter:ht,fitBounds:ht,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:ht,setTransform:ht,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Gh(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleBy(Zo(e.d3Selection,i,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,a){return new Promise(s=>{const{x:l,y:u}=ls({x:-o,y:-i},e.translateExtent),c=qt.translate(-l,-u).scale(r);e.d3Selection&&e.d3Zoom?e.d3Zoom.transform(Zo(e.d3Selection,a,()=>{s(!0)}),c):s(!1)})}return K(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i==null?void 0:i.duration),zoomOut:i=>t(1/1.2,i==null?void 0:i.duration),zoomTo:(i,r)=>new Promise(a=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleTo(Zo(e.d3Selection,r==null?void 0:r.duration,()=>{a(!0)}),i):a(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r==null?void 0:r.duration),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r==null?void 0:r.duration),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(i={padding:Wo,includeHiddenNodes:!1,duration:0})=>{var r,a;const s=[];for(const f of e.nodes)f.dimensions.width&&f.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!f.hidden)&&(!((r=i.nodes)!=null&&r.length)||(a=i.nodes)!=null&&a.length&&i.nodes.includes(f.id))&&s.push(f);if(!s.length)return Promise.resolve(!1);const l=Vi(s),{x:u,y:c,zoom:d}=kr(l,e.dimensions.width,e.dimensions.height,i.minZoom??e.minZoom,i.maxZoom??e.maxZoom,i.padding??Wo,i.offset);return n(u,c,d,i==null?void 0:i.duration)},setCenter:(i,r,a)=>{const s=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:e.maxZoom,l=e.dimensions.width/2-i*s,u=e.dimensions.height/2-r*s;return n(l,u,s,a==null?void 0:a.duration)},fitBounds:(i,r={padding:Wo})=>{const{x:a,y:s,zoom:l}=kr(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding);return n(a,s,l,r==null?void 0:r.duration)},project:i=>_n(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:a}=e.vueFlowRef.getBoundingClientRect(),s={x:i.x-r,y:i.y-a};return _n(s,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:a}=e.vueFlowRef.getBoundingClientRect(),s={x:i.x+r,y:i.y+a};return pi(s,e.viewport)}return{x:0,y:0}}}:Yh)}function Zo(e,t=0,n){return e.transition().duration(t).on("end",n)}function Xh(e,t,n){const o=ba(!0);return o.run(()=>{const i=()=>{o.run(()=>{let w,y,p=!!(n.nodes.value.length||n.edges.value.length);w=Lt([e.modelValue,()=>{var b,m;return(m=(b=e.modelValue)==null?void 0:b.value)==null?void 0:m.length}],([b])=>{b&&Array.isArray(b)&&(y==null||y.pause(),n.setElements(b),!y&&!p&&b.length?p=!0:y==null||y.resume())}),y=Lt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([b,m])=>{var _;(_=e.modelValue)!=null&&_.value&&Array.isArray(e.modelValue.value)&&(w==null||w.pause(),e.modelValue.value=[...b,...m],Ge(()=>{w==null||w.resume()}))},{immediate:p}),Un(()=>{w==null||w.stop(),y==null||y.stop()})})},r=()=>{o.run(()=>{let w,y,p=!!n.nodes.value.length;w=Lt([e.nodes,()=>{var b,m;return(m=(b=e.nodes)==null?void 0:b.value)==null?void 0:m.length}],([b])=>{b&&Array.isArray(b)&&(y==null||y.pause(),n.setNodes(b),!y&&!p&&b.length?p=!0:y==null||y.resume())}),y=Lt([n.nodes,()=>n.nodes.value.length],([b])=>{var m;(m=e.nodes)!=null&&m.value&&Array.isArray(e.nodes.value)&&(w==null||w.pause(),e.nodes.value=[...b],Ge(()=>{w==null||w.resume()}))},{immediate:p}),Un(()=>{w==null||w.stop(),y==null||y.stop()})})},a=()=>{o.run(()=>{let w,y,p=!!n.edges.value.length;w=Lt([e.edges,()=>{var b,m;return(m=(b=e.edges)==null?void 0:b.value)==null?void 0:m.length}],([b])=>{b&&Array.isArray(b)&&(y==null||y.pause(),n.setEdges(b),!y&&!p&&b.length?p=!0:y==null||y.resume())}),y=Lt([n.edges,()=>n.edges.value.length],([b])=>{var m;(m=e.edges)!=null&&m.value&&Array.isArray(e.edges.value)&&(w==null||w.pause(),e.edges.value=[...b],Ge(()=>{w==null||w.resume()}))},{immediate:p}),Un(()=>{w==null||w.stop(),y==null||y.stop()})})},s=()=>{o.run(()=>{xe(()=>t.maxZoom,()=>{t.maxZoom&&ke(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{xe(()=>t.minZoom,()=>{t.minZoom&&ke(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{xe(()=>t.translateExtent,()=>{t.translateExtent&&ke(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{xe(()=>t.nodeExtent,()=>{t.nodeExtent&&ke(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{xe(()=>t.applyDefault,()=>{ke(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},f=()=>{o.run(()=>{const w=async y=>{let p=y;typeof t.autoConnect=="function"&&(p=await t.autoConnect(y)),p!==!1&&n.addEdges([p])};xe(()=>t.autoConnect,()=>{ke(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),xe(n.autoConnect,(y,p,b)=>{y?n.onConnect(w):n.hooks.value.connect.off(w),b(()=>{n.hooks.value.connect.off(w)})},{immediate:!0})})},g=()=>{const w=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const y of Object.keys(t)){const p=y;if(!w.includes(p)){const b=_e(()=>t[p]),m=n[p];at(m)&&o.run(()=>{xe(b,_=>{ke(_)&&(m.value=_)},{immediate:!0})})}}};(()=>{i(),r(),a(),l(),s(),u(),c(),d(),f(),g()})()}),()=>o.stop()}function Uh(){return{edgesChange:q(),nodesChange:q(),nodeDoubleClick:q(),nodeClick:q(),nodeMouseEnter:q(),nodeMouseMove:q(),nodeMouseLeave:q(),nodeContextMenu:q(),nodeDragStart:q(),nodeDrag:q(),nodeDragStop:q(),nodesInitialized:q(),miniMapNodeClick:q(),miniMapNodeDoubleClick:q(),miniMapNodeMouseEnter:q(),miniMapNodeMouseMove:q(),miniMapNodeMouseLeave:q(),connect:q(),connectStart:q(),connectEnd:q(),clickConnectStart:q(),clickConnectEnd:q(),paneReady:q(),init:q(),move:q(),moveStart:q(),moveEnd:q(),selectionDragStart:q(),selectionDrag:q(),selectionDragStop:q(),selectionContextMenu:q(),selectionStart:q(),selectionEnd:q(),viewportChangeStart:q(),viewportChange:q(),viewportChangeEnd:q(),paneScroll:q(),paneClick:q(),paneContextMenu:q(),paneMouseEnter:q(),paneMouseMove:q(),paneMouseLeave:q(),edgeContextMenu:q(),edgeMouseEnter:q(),edgeMouseMove:q(),edgeMouseLeave:q(),edgeDoubleClick:q(),edgeClick:q(),edgeUpdateStart:q(),edgeUpdate:q(),edgeUpdateEnd:q(),updateNodeInternals:q(),error:q(e=>ko(e.message))}}function Kh(e,t){bl(()=>{for(const[n,o]of Object.entries(t.value)){const i=r=>{e(n,r)};o.fns.add(i),bo(()=>{o.off(i)})}})}function Ns(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Hi.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:hn.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:Mt.Bezier,style:{}},connectionMode:St.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:ho()?"Meta":"Control",zoomActivationKeyCode:ho()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Uh(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const Wh=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Zh(e,t,n){const o=Gh(e),i=E=>{const x=E??[];e.hooks.updateNodeInternals.trigger(x)},r=E=>hh(E,e.nodes,e.edges),a=E=>fh(E,e.nodes,e.edges),s=E=>It(E,e.edges),l=({id:E,type:x,nodeId:C})=>{var S;return Array.from(((S=e.connectionLookup.get(`${C}-${x}-${E??null}`))==null?void 0:S.values())??[])},u=E=>{if(E)return t.value.get(E)},c=E=>{if(E)return n.value.get(E)},d=(E,x,C)=>{var S,V;const ne=[];for(const J of E){const j={id:J.id,type:"position",dragging:C,from:J.from};if(x&&(j.position=J.position,J.parentNode)){const le=u(J.parentNode);j.position={x:j.position.x-(((S=le==null?void 0:le.computedPosition)==null?void 0:S.x)??0),y:j.position.y-(((V=le==null?void 0:le.computedPosition)==null?void 0:V.y)??0)}}ne.push(j)}ne!=null&&ne.length&&e.hooks.nodesChange.trigger(ne)},f=E=>{if(!e.vueFlowRef)return;const x=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!x)return;const C=window.getComputedStyle(x),{m22:S}=new window.DOMMatrixReadOnly(C.transform),V=[];for(const ne of E){const J=ne,j=u(J.id);if(j){const le=No(J.nodeElement);if(!!(le.width&&le.height&&(j.dimensions.width!==le.width||j.dimensions.height!==le.height||J.forceUpdate))){const me=J.nodeElement.getBoundingClientRect();j.dimensions=le,j.handleBounds.source=Rr("source",J.nodeElement,me,S,j.id),j.handleBounds.target=Rr("target",J.nodeElement,me,S,j.id),V.push({id:j.id,type:"dimensions",dimensions:le})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),V.length&&e.hooks.nodesChange.trigger(V)},g=(E,x)=>{const C=new Set,S=new Set;for(const J of E)Dt(J)?C.add(J.id):Nt(J)&&S.add(J.id);const V=mt(t.value,C,!0),ne=mt(n.value,S);if(e.multiSelectionActive){for(const J of C)V.push(gt(J,x));for(const J of S)ne.push(gt(J,x))}V.length&&e.hooks.nodesChange.trigger(V),ne.length&&e.hooks.edgesChange.trigger(ne)},$=E=>{if(e.multiSelectionActive){const x=E.map(C=>gt(C.id,!0));e.hooks.nodesChange.trigger(x);return}e.hooks.nodesChange.trigger(mt(t.value,new Set(E.map(x=>x.id)),!0)),e.hooks.edgesChange.trigger(mt(n.value))},w=E=>{if(e.multiSelectionActive){const x=E.map(C=>gt(C.id,!0));e.hooks.edgesChange.trigger(x);return}e.hooks.edgesChange.trigger(mt(n.value,new Set(E.map(x=>x.id)))),e.hooks.nodesChange.trigger(mt(t.value,new Set,!0))},y=E=>{g(E,!0)},p=E=>{const C=(E||e.nodes).map(S=>(S.selected=!1,gt(S.id,!1)));e.hooks.nodesChange.trigger(C)},b=E=>{const C=(E||e.edges).map(S=>(S.selected=!1,gt(S.id,!1)));e.hooks.edgesChange.trigger(C)},m=E=>{if(!E||!E.length)return g([],!1);const x=E.reduce((C,S)=>{const V=gt(S.id,!1);return Dt(S)?C.nodes.push(V):C.edges.push(V),C},{nodes:[],edges:[]});x.nodes.length&&e.hooks.nodesChange.trigger(x.nodes),x.edges.length&&e.hooks.edgesChange.trigger(x.edges)},_=E=>{var x;(x=e.d3Zoom)==null||x.scaleExtent([E,e.maxZoom]),e.minZoom=E},T=E=>{var x;(x=e.d3Zoom)==null||x.scaleExtent([e.minZoom,E]),e.maxZoom=E},P=E=>{var x;(x=e.d3Zoom)==null||x.translateExtent(E),e.translateExtent=E},A=E=>{e.nodeExtent=E,i()},R=E=>{var x;(x=e.d3Zoom)==null||x.clickDistance(E)},O=E=>{e.nodesDraggable=E,e.nodesConnectable=E,e.elementsSelectable=E},F=E=>{const x=E instanceof Function?E(e.nodes):E;!e.initialized&&!x.length||(e.nodes=Fr(x,u,e.hooks.error.trigger))},H=E=>{const x=E instanceof Function?E(e.edges):E;if(!e.initialized&&!x.length)return;const C=Ko(x,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Uo(e.connectionLookup,n.value,C),e.edges=C},k=E=>{const x=E instanceof Function?E([...e.nodes,...e.edges]):E;!e.initialized&&!x.length||(F(x.filter(Dt)),H(x.filter(Nt)))},G=E=>{let x=E instanceof Function?E(e.nodes):E;x=Array.isArray(x)?x:[x];const C=Fr(x,u,e.hooks.error.trigger),S=[];for(const V of C)S.push(Tr(V));S.length&&e.hooks.nodesChange.trigger(S)},h=E=>{let x=E instanceof Function?E(e.edges):E;x=Array.isArray(x)?x:[x];const C=Ko(x,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),S=[];for(const V of C)S.push(Tr(V));S.length&&e.hooks.edgesChange.trigger(S)},M=(E,x=!0,C=!1)=>{const S=E instanceof Function?E(e.nodes):E,V=Array.isArray(S)?S:[S],ne=[],J=[];function j(ve){const me=s(ve);for(const Se of me)(!ke(Se.deletable)||Se.deletable)&&J.push(zr(Se.id,Se.source,Se.target,Se.sourceHandle,Se.targetHandle))}function le(ve){const me=[];for(const Se of e.nodes)Se.parentNode===ve&&me.push(Se);if(me.length){for(const Se of me)ne.push(Ar(Se.id));x&&j(me);for(const Se of me)le(Se.id)}}for(const ve of V){const me=typeof ve=="string"?u(ve):ve;me&&(ke(me.deletable)&&!me.deletable||(ne.push(Ar(me.id)),x&&j([me]),C&&le(me.id)))}J.length&&e.hooks.edgesChange.trigger(J),ne.length&&e.hooks.nodesChange.trigger(ne)},v=E=>{const x=E instanceof Function?E(e.edges):E,C=Array.isArray(x)?x:[x],S=[];for(const V of C){const ne=typeof V=="string"?c(V):V;ne&&(ke(ne.deletable)&&!ne.deletable||S.push(zr(typeof V=="string"?V:V.id,ne.source,ne.target,ne.sourceHandle,ne.targetHandle)))}e.hooks.edgesChange.trigger(S)},z=(E,x,C=!0)=>{const S=c(E.id);if(!S)return!1;const V=e.edges.indexOf(S),ne=Ph(E,x,S,C,e.hooks.error.trigger);if(ne){const[J]=Ko([ne],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((j,le)=>le===V?J:j),Uo(e.connectionLookup,n.value,[J]),J}return!1},I=(E,x,C={replace:!1})=>{const S=c(E);if(!S)return;const V=typeof x=="function"?x(S):x;S.data=C.replace?V:{...S.data,...V}},B=E=>Ir(E,e.nodes),D=E=>{const x=Ir(E,e.edges);return Uo(e.connectionLookup,n.value,x),x},L=(E,x,C={replace:!1})=>{const S=u(E);if(!S)return;const V=typeof x=="function"?x(S):x;C.replace?e.nodes.splice(e.nodes.indexOf(S),1,V):Object.assign(S,V)},W=(E,x,C={replace:!1})=>{const S=u(E);if(!S)return;const V=typeof x=="function"?x(S):x;S.data=C.replace?V:{...S.data,...V}},ee=(E,x,C=!1)=>{C?e.connectionClickStartHandle=E:e.connectionStartHandle=E,e.connectionEndHandle=null,e.connectionStatus=null,x&&(e.connectionPosition=x)},Y=(E,x=null,C=null)=>{e.connectionStartHandle&&(e.connectionPosition=E,e.connectionEndHandle=x,e.connectionStatus=C)},U=(E,x)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,x?e.connectionClickStartHandle=null:e.connectionStartHandle=null},Q=E=>{const x=ch(E),C=x?null:un(E)?E:u(E.id);return!x&&!C?[null,null,x]:[x?E:uo(C),C,x]},ae=(E,x=!0,C=e.nodes)=>{const[S,V,ne]=Q(E);if(!S)return[];const J=[];for(const j of C||e.nodes){if(!ne&&(j.id===V.id||!j.computedPosition))continue;const le=uo(j),ve=co(le,S);(x&&ve>0||ve>=Number(S.width)*Number(S.height))&&J.push(j)}return J},ue=(E,x,C=!0)=>{const[S]=Q(E);if(!S)return!1;const V=co(S,x);return C&&V>0||V>=Number(S.width)*Number(S.height)},se=E=>{const{viewport:x,dimensions:C,d3Zoom:S,d3Selection:V,translateExtent:ne}=e;if(!S||!V||!E.x&&!E.y)return!1;const J=qt.translate(x.x+E.x,x.y+E.y).scale(x.zoom),j=[[0,0],[C.width,C.height]],le=S.constrain()(J,j,ne),ve=e.viewport.x!==le.x||e.viewport.y!==le.y||e.viewport.zoom!==le.k;return S.transform(V,le),ve},we=E=>{const x=E instanceof Function?E(e):E,C=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];ke(x.defaultEdgeOptions)&&(e.defaultEdgeOptions=x.defaultEdgeOptions);const S=x.modelValue||x.nodes||x.edges?[]:void 0;S&&(x.modelValue&&S.push(...x.modelValue),x.nodes&&S.push(...x.nodes),x.edges&&S.push(...x.edges),k(S));const V=()=>{ke(x.maxZoom)&&T(x.maxZoom),ke(x.minZoom)&&_(x.minZoom),ke(x.translateExtent)&&P(x.translateExtent)};for(const ne of Object.keys(x)){const J=ne,j=x[J];![...Wh,...C].includes(J)&&ke(j)&&(e[J]=j)}ii(()=>e.d3Zoom).not.toBeNull().then(V),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:f,setElements:k,setNodes:F,setEdges:H,addNodes:G,addEdges:h,removeNodes:M,removeEdges:v,findNode:u,findEdge:c,updateEdge:z,updateEdgeData:I,updateNode:L,updateNodeData:W,applyEdgeChanges:D,applyNodeChanges:B,addSelectedElements:y,addSelectedNodes:$,addSelectedEdges:w,setMinZoom:_,setMaxZoom:T,setTranslateExtent:P,setNodeExtent:A,setPaneClickDistance:R,removeSelectedElements:m,removeSelectedNodes:p,removeSelectedEdges:b,startConnection:ee,updateConnection:Y,endConnection:U,setInteractive:O,setState:we,getIntersectingNodes:ae,getIncomers:r,getOutgoers:a,getConnectedEdges:s,getHandleConnections:l,isNodeIntersecting:ue,panBy:se,fitView:E=>o.value.fitView(E),zoomIn:E=>o.value.zoomIn(E),zoomOut:E=>o.value.zoomOut(E),zoomTo:(E,x)=>o.value.zoomTo(E,x),setViewport:(E,x)=>o.value.setViewport(E,x),setTransform:(E,x)=>o.value.setTransform(E,x),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(E,x,C)=>o.value.setCenter(E,x,C),fitBounds:(E,x)=>o.value.fitBounds(E,x),project:E=>o.value.project(E),screenToFlowCoordinate:E=>o.value.screenToFlowCoordinate(E),flowToScreenCoordinate:E=>o.value.flowToScreenCoordinate(E),toObject:()=>{const E=[],x=[];for(const C of e.nodes){const{computedPosition:S,handleBounds:V,selected:ne,dimensions:J,isParent:j,resizing:le,dragging:ve,events:me,...Se}=C;E.push(Se)}for(const C of e.edges){const{selected:S,sourceNode:V,targetNode:ne,events:J,...j}=C;x.push(j)}return JSON.parse(JSON.stringify({nodes:E,edges:x,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:E=>new Promise(x=>{const{nodes:C,edges:S,position:V,zoom:ne,viewport:J}=E;if(C&&F(C),S&&H(S),J!=null&&J.x&&(J!=null&&J.y)||V){const j=(J==null?void 0:J.x)||V[0],le=(J==null?void 0:J.y)||V[1],ve=(J==null?void 0:J.zoom)||ne||e.viewport.zoom;return ii(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:j,y:le,zoom:ve}).then(()=>{x(!0)})})}else x(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const E=Ns();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const x=qt.translate(E.defaultViewport.x??0,E.defaultViewport.y??0).scale(Ft(E.defaultViewport.zoom??1,E.minZoom,E.maxZoom)),C=e.viewportRef.getBoundingClientRect(),S=[[0,0],[C.width,C.height]],V=e.d3Zoom.constrain()(x,S,E.translateExtent);e.d3Zoom.transform(e.d3Selection,V)}we(E)},$destroy:()=>{}}}const qh=["data-id","data-handleid","data-nodeid","data-handlepos"],Qh={name:"Handle",compatConfig:{MODE:3}},Jt=fe({...Qh,props:{id:{default:null},type:{},position:{default:()=>te.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=_l(e,["position","connectable","connectableStart","connectableEnd","id"]),o=_e(()=>n.type??"source"),i=_e(()=>n.isValidConnection??null),{id:r,connectionStartHandle:a,connectionClickStartHandle:s,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:f}=$e(),{id:g,node:$,nodeEl:w,connectedEdges:y}=Es(),p=ce(),b=_e(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),m=_e(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),_=_e(()=>{var H,k,G,h,M,v;return((H=a.value)==null?void 0:H.nodeId)===g&&((k=a.value)==null?void 0:k.id)===e.id&&((G=a.value)==null?void 0:G.type)===o.value||((h=l.value)==null?void 0:h.nodeId)===g&&((M=l.value)==null?void 0:M.id)===e.id&&((v=l.value)==null?void 0:v.type)===o.value}),T=_e(()=>{var H,k,G;return((H=s.value)==null?void 0:H.nodeId)===g&&((k=s.value)==null?void 0:k.id)===e.id&&((G=s.value)==null?void 0:G.type)===o.value}),{handlePointerDown:P,handleClick:A}=$s({nodeId:g,handleId:e.id,isValidConnection:i,type:o}),R=K(()=>typeof e.connectable=="string"&&e.connectable==="single"?!y.value.some(H=>{const k=H[`${o.value}Handle`];return H[o.value]!==g?!1:k?k===e.id:!0}):typeof e.connectable=="number"?y.value.filter(H=>{const k=H[`${o.value}Handle`];return H[o.value]!==g?!1:k?k===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable($,y.value):ke(e.connectable)?e.connectable:c.value);Ct(()=>{var H;if(!$.dimensions.width||!$.dimensions.height)return;const k=(H=$.handleBounds[o.value])==null?void 0:H.find(B=>B.id===e.id);if(!u.value||k)return;const G=u.value.querySelector(".vue-flow__transformationpane");if(!w.value||!p.value||!G||!e.id)return;const h=w.value.getBoundingClientRect(),M=p.value.getBoundingClientRect(),v=window.getComputedStyle(G),{m22:z}=new window.DOMMatrixReadOnly(v.transform),I={id:e.id,position:e.position,x:(M.left-h.left)/z,y:(M.top-h.top)/z,type:o.value,nodeId:g,...No(p.value)};$.handleBounds[o.value]=[...$.handleBounds[o.value]??[],I]});function O(H){const k=Yi(H);R.value&&b.value&&(k&&H.button===0||!k)&&P(H)}function F(H){!g||!s.value&&!b.value||R.value&&A(H)}return t({handleClick:A,handlePointerDown:P,onClick:F,onPointerDown:O}),(H,k)=>(X(),ie("div",{ref_key:"handle",ref:p,"data-id":`${N(r)}-${N(g)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":N(g),"data-handlepos":H.position,class:ze(["vue-flow__handle",[`vue-flow__handle-${H.position}`,`vue-flow__handle-${e.id}`,N(d),N(f),o.value,{connectable:R.value,connecting:T.value,connectablestart:b.value,connectableend:m.value,connectionindicator:R.value&&(b.value&&!_.value||m.value&&_.value)}]]),onMousedown:O,onTouchstartPassive:O,onClick:F},[Ae(H.$slots,"default",{id:H.id})],42,qh))}}),Io=function({sourcePosition:e=te.Bottom,targetPosition:t=te.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:a}){const s=a.label||n;return[be(Jt,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof s!="string"&&s?be(s):be(Te,[s]),be(Jt,{type:"source",position:e,connectable:o,isValidConnection:r})]};Io.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Io.inheritAttrs=!1;Io.compatConfig={MODE:3};const Jh=Io,To=function({targetPosition:e=te.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label||t;return[be(Jt,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?be(r):be(Te,[r])]};To.props=["targetPosition","label","isValidTargetPos","connectable","data"];To.inheritAttrs=!1;To.compatConfig={MODE:3};const jh=To,Ao=function({sourcePosition:e=te.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label||t;return[typeof r!="string"&&r?be(r):be(Te,[r]),be(Jt,{type:"source",position:e,connectable:n,isValidConnection:o})]};Ao.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Ao.inheritAttrs=!1;Ao.compatConfig={MODE:3};const eg=Ao,tg=["transform"],ng=["width","height","x","y","rx","ry"],og=["y"],ig={name:"EdgeText",compatConfig:{MODE:3}},rg=fe({...ig,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=ce({x:0,y:0,width:0,height:0}),n=ce(null),o=K(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);Ct(i),xe([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,a)=>(X(),ie("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(X(),ie("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:Ee(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,ng)):Ce("",!0),pe("text",st(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Ae(r.$slots,"default",{},()=>[typeof r.label!="string"?(X(),ge(Ai(r.label),{key:0})):(X(),ie(Te,{key:1},[He(De(r.label),1)],64))])],16,og)],8,tg))}}),ag=["id","d","marker-end","marker-start"],sg=["d","stroke-width"],lg={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Mn=fe({...lg,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=ce(null),o=ce(null),i=ce(null),r=zi();return t({pathEl:n,interactionEl:o,labelEl:i}),(a,s)=>(X(),ie(Te,null,[pe("path",st(N(r),{id:a.id,ref_key:"pathEl",ref:n,d:a.path,class:"vue-flow__edge-path","marker-end":a.markerEnd,"marker-start":a.markerStart}),null,16,ag),a.interactionWidth?(X(),ie("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,sg)):Ce("",!0),a.label&&a.labelX&&a.labelY?(X(),ge(rg,{key:1,ref_key:"labelEl",ref:i,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Ce("",!0)],64))}});function Cs({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,a=Math.abs(o-t)/2,s=o<t?o+a:o-a;return[r,s,i,a]}function ks({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:s}){const l=e*.125+i*.375+a*.375+n*.125,u=t*.125+r*.375+s*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function Hn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Yr({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let a,s;switch(e){case te.Left:a=t-Hn(t-o,r),s=n;break;case te.Right:a=t+Hn(o-t,r),s=n;break;case te.Top:a=t,s=n-Hn(n-i,r);break;case te.Bottom:a=t,s=n+Hn(i-n,r);break}return[a,s]}function Gi(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:a=te.Top,curvature:s=.25}=e,[l,u]=Yr({pos:o,x1:t,y1:n,x2:i,y2:r,c:s}),[c,d]=Yr({pos:a,x1:i,y1:r,x2:t,y2:n,c:s}),[f,g,$,w]=ks({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${i},${r}`,f,g,$,w]}function Gr({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,a;switch(e){case te.Left:case te.Right:r=.5*(t+o),a=n;break;case te.Top:case te.Bottom:r=t,a=.5*(n+i);break}return[r,a]}function Ms(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:a=te.Top}=e,[s,l]=Gr({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=Gr({pos:a,x1:i,y1:r,x2:t,y2:n}),[d,f,g,$]=ks({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${s},${l} ${u},${c} ${i},${r}`,d,f,g,$]}const Xr={[te.Left]:{x:-1,y:0},[te.Right]:{x:1,y:0},[te.Top]:{x:0,y:-1},[te.Bottom]:{x:0,y:1}};function ug({source:e,sourcePosition:t=te.Bottom,target:n}){return t===te.Left||t===te.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}}function Ur(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function cg({source:e,sourcePosition:t=te.Bottom,target:n,targetPosition:o=te.Top,center:i,offset:r}){const a=Xr[t],s=Xr[o],l={x:e.x+a.x*r,y:e.y+a.y*r},u={x:n.x+s.x*r,y:n.y+s.y*r},c=ug({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let g,$,w;const y={x:0,y:0},p={x:0,y:0},[b,m,_,T]=Cs({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]===-1){$=i.x??b,w=i.y??m;const A=[{x:$,y:l.y},{x:$,y:u.y}],R=[{x:l.x,y:w},{x:u.x,y:w}];a[d]===f?g=d==="x"?A:R:g=d==="x"?R:A}else{const A=[{x:l.x,y:u.y}],R=[{x:u.x,y:l.y}];if(d==="x"?g=a.x===f?R:A:g=a.y===f?A:R,t===o){const G=Math.abs(e[d]-n[d]);if(G<=r){const h=Math.min(r-1,r-G);a[d]===f?y[d]=(l[d]>e[d]?-1:1)*h:p[d]=(u[d]>n[d]?-1:1)*h}}if(t!==o){const G=d==="x"?"y":"x",h=a[d]===s[G],M=l[G]>u[G],v=l[G]<u[G];(a[d]===1&&(!h&&M||h&&v)||a[d]!==1&&(!h&&v||h&&M))&&(g=d==="x"?A:R)}const O={x:l.x+y.x,y:l.y+y.y},F={x:u.x+p.x,y:u.y+p.y},H=Math.max(Math.abs(O.x-g[0].x),Math.abs(F.x-g[0].x)),k=Math.max(Math.abs(O.y-g[0].y),Math.abs(F.y-g[0].y));H>=k?($=(O.x+F.x)/2,w=g[0].y):($=g[0].x,w=(O.y+F.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...g,{x:u.x+p.x,y:u.y+p.y},n],$,w,_,T]}function dg(e,t,n,o){const i=Math.min(Ur(e,t)/2,Ur(t,n)/2,o),{x:r,y:a}=t;if(e.x===r&&r===n.x||e.y===a&&a===n.y)return`L${r} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${a}Q ${r},${a} ${r},${a+i*c}`}const s=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${a+i*l}Q ${r},${a} ${r+i*s},${a}`}function yi(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:a=te.Top,borderRadius:s=5,centerX:l,centerY:u,offset:c=20}=e,[d,f,g,$,w]=cg({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:a,center:{x:l,y:u},offset:c});return[d.reduce((p,b,m)=>{let _;return m>0&&m<d.length-1?_=dg(d[m-1],b,d[m+1],s):_=`${m===0?"M":"L"}${b.x} ${b.y}`,p+=_,p},""),f,g,$,w]}function fg(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,a,s,l]=Cs({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,a,s,l]}const hg=fe({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=fg(e);return be(Mn,{path:n,labelX:o,labelY:i,...t,...e})}}}),gg=hg,pg=fe({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=yi({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return be(Mn,{path:n,labelX:o,labelY:i,...t,...e})}}}),Is=pg,vg=fe({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>be(Is,{...e,...t,borderRadius:0})}}),mg=vg,yg=fe({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Gi({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return be(Mn,{path:n,labelX:o,labelY:i,...t,...e})}}}),wg=yg,_g=fe({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Ms({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return be(Mn,{path:n,labelX:o,labelY:i,...t,...e})}}}),bg=_g,xg={input:eg,default:Jh,output:jh},$g={default:wg,straight:gg,step:mg,smoothstep:Is,simplebezier:bg};function Eg(e,t,n){const o=K(()=>w=>t.value.get(w)),i=K(()=>w=>n.value.get(w)),r=K(()=>{const w={...$g,...e.edgeTypes},y=Object.keys(w);for(const p of e.edges)p.type&&!y.includes(p.type)&&(w[p.type]=p.type);return w}),a=K(()=>{const w={...xg,...e.nodeTypes},y=Object.keys(w);for(const p of e.nodes)p.type&&!y.includes(p.type)&&(w[p.type]=p.type);return w}),s=K(()=>e.onlyRenderVisibleElements?gs(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=K(()=>{if(e.onlyRenderVisibleElements){const w=[];for(const y of e.edges){const p=t.value.get(y.source),b=t.value.get(y.target);bh({sourcePos:p.computedPosition||{x:0,y:0},targetPos:b.computedPosition||{x:0,y:0},sourceWidth:p.dimensions.width,sourceHeight:p.dimensions.height,targetWidth:b.dimensions.width,targetHeight:b.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&w.push(y)}return w}return e.edges}),u=K(()=>[...s.value,...l.value]),c=K(()=>{const w=[];for(const y of e.nodes)y.selected&&w.push(y);return w}),d=K(()=>{const w=[];for(const y of e.edges)y.selected&&w.push(y);return w}),f=K(()=>[...c.value,...d.value]),g=K(()=>{const w=[];for(const y of e.nodes)y.dimensions.width&&y.dimensions.height&&y.handleBounds!==void 0&&w.push(y);return w}),$=K(()=>s.value.length>0&&g.value.length===s.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:a,getEdges:l,getNodes:s,getSelectedElements:f,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:g,areNodesInitialized:$}}class Tt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=Nn())==null?void 0:t.appContext.app,o=(n==null?void 0:n.config.globalProperties.$vueFlowStorage)??Tt.instance;return Tt.instance=o??new Tt,n&&(n.config.globalProperties.$vueFlowStorage=Tt.instance),Tt.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=Ns(),i=wl(o),r={};for(const[f,g]of Object.entries(i.hooks)){const $=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;r[$]=g.on}const a={};for(const[f,g]of Object.entries(i.hooks))a[f]=g.trigger;const s=K(()=>{const f=new Map;for(const g of i.nodes)f.set(g.id,g);return f}),l=K(()=>{const f=new Map;for(const g of i.edges)f.set(g.id,g);return f}),u=Eg(i,s,l),c=Zh(i,s,l);c.setState({...i,...n});const d={...r,...u,...c,...xu(i),nodeLookup:s,edgeLookup:l,emits:a,id:t,vueFlowVersion:"1.43.1",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function $e(e){const t=Tt.getInstance(),n=_a(),o=typeof e=="object",i=o?e:{id:e},r=i.id,a=r??(n==null?void 0:n.vueFlowId);let s;if(n){const l=Vt(Lr,null);typeof l<"u"&&l!==null&&(!a||l.id===a)&&(s=l)}if(s||a&&(s=t.get(a)),!s||a&&s.id!==a){const l=r??t.getId(),u=t.create(l,i);s=u,(n??ba(!0)).run(()=>{xe(u.applyDefault,(d,f,g)=>{const $=y=>{u.applyNodeChanges(y)},w=y=>{u.applyEdgeChanges(y)};d?(u.onNodesChange($),u.onEdgesChange(w)):(u.hooks.value.nodesChange.off($),u.hooks.value.edgesChange.off(w)),g(()=>{u.hooks.value.nodesChange.off($),u.hooks.value.edgesChange.off(w)})},{immediate:!0}),bo(()=>{if(s){const d=t.get(s.id);d?d.$destroy():ko(`No store instance found for id ${s.id} in storage.`)}})})}else o&&s.setState(i);if(n&&(Ot(Lr,s),n.vueFlowId=s.id),o){const l=Nn();(l==null?void 0:l.type.name)!=="VueFlow"&&s.emits.error(new Ie(Me.USEVUEFLOW_OPTIONS))}return s}function Sg(e){const{emits:t,dimensions:n}=$e();let o;Ct(()=>{const i=e.value,r=()=>{if(!i)return;const a=No(i);(a.width===0||a.height===0)&&t.error(new Ie(Me.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};r(),window.addEventListener("resize",r),i&&(o=new ResizeObserver(()=>r()),o.observe(i)),xa(()=>{window.removeEventListener("resize",r),o&&i&&o.unobserve(i)})})}const Ng={name:"UserSelection",compatConfig:{MODE:3}},Cg=fe({...Ng,props:{userSelectionRect:{}},setup(e){return(t,n)=>(X(),ie("div",{class:"vue-flow__selection vue-flow__container",style:Ee({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),kg=["tabIndex"],Mg={name:"NodesSelection",compatConfig:{MODE:3}},Ig=fe({...Mg,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:a}=$e(),s=Ss(),l=ce(null),u=xs({el:l,onStart($){t.selectionDragStart($)},onDrag($){t.selectionDrag($)},onStop($){t.selectionDragStop($)}});Ct(()=>{var $;r.value||($=l.value)==null||$.focus({preventScroll:!0})});const c=K(()=>Vi(o.value)),d=K(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function f($){t.selectionContextMenu({event:$,nodes:o.value})}function g($){r||Ut[$.key]&&($.preventDefault(),s({x:Ut[$.key].x,y:Ut[$.key].y},$.shiftKey))}return($,w)=>!N(a)&&c.value.width&&c.value.height?(X(),ie("div",{key:0,class:ze(["vue-flow__nodesselection vue-flow__container",N(i)]),style:Ee({transform:`translate(${N(n).x}px,${N(n).y}px) scale(${N(n).zoom})`})},[pe("div",{ref_key:"el",ref:l,class:ze([{dragging:N(u)},"vue-flow__nodesselection-rect"]),style:Ee(d.value),tabIndex:N(r)?void 0:-1,onContextmenu:f,onKeydown:g},null,46,kg)],6)):Ce("",!0)}});function Tg(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Ag={name:"Pane",compatConfig:{MODE:3}},zg=fe({...Ag,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:a,userSelectionRect:s,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:f,removeEdges:g,selectionMode:$,deleteKeyCode:w,multiSelectionKeyCode:y,multiSelectionActive:p,edgeLookup:b,nodeLookup:m,connectionLookup:_,defaultEdgeOptions:T,connectionStartHandle:P}=$e(),A=ce(null),R=ce(new Set),O=ce(new Set),F=ce(),H=_e(()=>l.value&&(e.isSelecting||r.value)),k=_e(()=>P.value!==null);let G=!1,h=!1;const M=gn(w,{actInsideInputWithModifier:!1}),v=gn(y);xe(M,Y=>{Y&&(f(d.value),g(c.value),u.value=!1)}),xe(v,Y=>{p.value=Y});function z(Y,U){return Q=>{Q.target===U&&(Y==null||Y(Q))}}function I(Y){if(G||k.value){G=!1;return}i.paneClick(Y),a(),u.value=!1}function B(Y){Y.preventDefault(),Y.stopPropagation(),i.paneContextMenu(Y)}function D(Y){i.paneScroll(Y)}function L(Y){var U,Q,ae;if(F.value=(U=t.value)==null?void 0:U.getBoundingClientRect(),!l.value||!e.isSelecting||Y.button!==0||Y.target!==A.value||!F.value)return;(ae=(Q=Y.target)==null?void 0:Q.setPointerCapture)==null||ae.call(Q,Y.pointerId);const{x:ue,y:se}=Tg(Y,F.value);h=!0,G=!1,a(),s.value={width:0,height:0,startX:ue,startY:se,x:ue,y:se},i.selectionStart(Y)}function W(Y){var U;if(!F.value||!s.value)return;G=!0;const{x:Q,y:ae}=Et(Y,F.value),{startX:ue=0,startY:se=0}=s.value,we={startX:ue,startY:se,x:Q<ue?Q:ue,y:ae<se?ae:se,width:Math.abs(Q-ue),height:Math.abs(ae-se)},re=R.value,de=O.value;R.value=new Set(gs(n.value,we,o.value,$.value===Hi.Partial,!0).map(E=>E.id)),O.value=new Set;const he=((U=T.value)==null?void 0:U.selectable)??!0;for(const E of R.value){const x=_.value.get(E);if(x)for(const{edgeId:C}of x.values()){const S=b.value.get(C);S&&(S.selectable??he)&&O.value.add(C)}}if(!Vr(re,R.value)){const E=mt(m.value,R.value,!0);i.nodesChange(E)}if(!Vr(de,O.value)){const E=mt(b.value,O.value);i.edgesChange(E)}s.value=we,r.value=!0,u.value=!1}function ee(Y){var U;Y.button!==0||!h||((U=Y.target)==null||U.releasePointerCapture(Y.pointerId),!r.value&&s.value&&Y.target===A.value&&I(Y),r.value=!1,s.value=null,u.value=R.value.size>0,i.selectionEnd(Y),e.selectionKeyPressed&&(G=!1),h=!1)}return(Y,U)=>(X(),ie("div",{ref_key:"container",ref:A,class:ze(["vue-flow__pane vue-flow__container",{selection:Y.isSelecting}]),onClick:U[0]||(U[0]=Q=>H.value?void 0:z(I,A.value)(Q)),onContextmenu:U[1]||(U[1]=Q=>z(B,A.value)(Q)),onWheelPassive:U[2]||(U[2]=Q=>z(D,A.value)(Q)),onPointerenter:U[3]||(U[3]=Q=>H.value?void 0:N(i).paneMouseEnter(Q)),onPointerdown:U[4]||(U[4]=Q=>H.value?L(Q):N(i).paneMouseMove(Q)),onPointermove:U[5]||(U[5]=Q=>H.value?W(Q):N(i).paneMouseMove(Q)),onPointerup:U[6]||(U[6]=Q=>H.value?ee(Q):void 0),onPointerleave:U[7]||(U[7]=Q=>N(i).paneMouseLeave(Q))},[Ae(Y.$slots,"default"),N(r)&&N(s)?(X(),ge(Cg,{key:0,"user-selection-rect":N(s)},null,8,["user-selection-rect"])):Ce("",!0),N(u)&&N(d).length?(X(),ge(Ig,{key:1})):Ce("",!0)],34))}}),Pg={name:"Transform",compatConfig:{MODE:3}},Dg=fe({...Pg,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=$e(),i=K(()=>n.value?!o.value:!1),r=K(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(a,s)=>(X(),ie("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ee({transform:r.value,opacity:i.value?0:void 0})},[Ae(a.$slots,"default")],4))}}),Bg={name:"Viewport",compatConfig:{MODE:3}},Og=fe({...Bg,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:a,panActivationKeyCode:s,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:f,zoomOnPinch:g,zoomOnScroll:$,preventScrolling:w,noWheelClassName:y,noPanClassName:p,emits:b,connectionStartHandle:m,userSelectionActive:_,paneDragging:T,d3Zoom:P,d3Selection:A,d3ZoomHandler:R,viewport:O,viewportRef:F,paneClickDistance:H}=$e();Sg(F);const k=ce(!1),G=ce(!1);let h=null,M=!1,v=0,z={x:0,y:0,zoom:0};const I=gn(s),B=gn(a),D=gn(r),L=_e(()=>(!B.value||B.value&&a.value===!0)&&(I.value||d.value)),W=_e(()=>I.value||l.value),ee=_e(()=>B.value||a.value===!0&&L.value!==!0);Ct(()=>{if(!F.value){ko("Viewport element is missing");return}const se=F.value,we=se.getBoundingClientRect(),re=ih().clickDistance(H.value).scaleExtent([t.value,n.value]).translateExtent(i.value),de=Ve(se).call(re),he=de.on("wheel.zoom"),E=qt.translate(o.value.x??0,o.value.y??0).scale(Ft(o.value.zoom??1,t.value,n.value)),x=[[0,0],[we.width,we.height]],C=re.constrain()(E,x,i.value);re.transform(de,C),re.wheelDelta(U),P.value=re,A.value=de,R.value=he,O.value={x:C.x,y:C.y,zoom:C.k},re.on("start",S=>{var V;if(!S.sourceEvent)return null;v=S.sourceEvent.button,k.value=!0;const ne=ae(S.transform);((V=S.sourceEvent)==null?void 0:V.type)==="mousedown"&&(T.value=!0),z=ne,b.viewportChangeStart(ne),b.moveStart({event:S,flowTransform:ne})}),re.on("end",S=>{if(!S.sourceEvent)return null;if(k.value=!1,T.value=!1,Y(L.value,v??0)&&!M&&b.paneContextMenu(S.sourceEvent),M=!1,Q(z,S.transform)){const V=ae(S.transform);z=V,b.viewportChangeEnd(V),b.moveEnd({event:S,flowTransform:V})}}),re.filter(S=>{var V;const ne=D.value||$.value,J=g.value&&S.ctrlKey,j=S.button;if(j===1&&S.type==="mousedown"&&(ue(S,"vue-flow__node")||ue(S,"vue-flow__edge")))return!0;if(!L.value&&!ne&&!W.value&&!f.value&&!g.value||_.value||!f.value&&S.type==="dblclick"||ue(S,y.value)&&S.type==="wheel"||ue(S,p.value)&&(S.type!=="wheel"||W.value&&S.type==="wheel"&&!D.value)||!g.value&&S.ctrlKey&&S.type==="wheel"||!ne&&!W.value&&!J&&S.type==="wheel")return!1;if(!g&&S.type==="touchstart"&&((V=S.touches)==null?void 0:V.length)>1)return S.preventDefault(),!1;if(!L.value&&(S.type==="mousedown"||S.type==="touchstart")||a.value===!0&&Array.isArray(d.value)&&d.value.includes(0)&&j===0||Array.isArray(d.value)&&!d.value.includes(j)&&(S.type==="mousedown"||S.type==="touchstart"))return!1;const le=Array.isArray(d.value)&&d.value.includes(j)||a.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!j||j<=1;return(!S.ctrlKey||I.value||S.type==="wheel")&&le}),xe([_,L],()=>{_.value&&!k.value?re.on("zoom",null):_.value||re.on("zoom",S=>{O.value={x:S.transform.x,y:S.transform.y,zoom:S.transform.k};const V=ae(S.transform);M=Y(L.value,v??0),b.viewportChange(V),b.move({event:S,flowTransform:V})})},{immediate:!0}),xe([_,W,u,D,g,w,y],()=>{W.value&&!D.value&&!_.value?de.on("wheel.zoom",S=>{if(ue(S,y.value))return!1;const V=D.value||$.value,ne=g.value&&S.ctrlKey;if(!(!w.value||W.value||V||ne))return!1;S.preventDefault(),S.stopImmediatePropagation();const j=de.property("__zoom").k||1,le=ho();if(!I.value&&S.ctrlKey&&g.value&&le){const tn=Ze(S),sl=U(S),ll=j*2**sl;re.scaleTo(de,ll,tn,S);return}const ve=S.deltaMode===1?20:1;let me=u.value===hn.Vertical?0:S.deltaX*ve,Se=u.value===hn.Horizontal?0:S.deltaY*ve;!le&&S.shiftKey&&u.value!==hn.Vertical&&!me&&Se&&(me=Se,Se=0),re.translateBy(de,-(me/j)*c.value,-(Se/j)*c.value);const Ke=ae(de.property("__zoom"));h&&clearTimeout(h),G.value?(b.move({event:S,flowTransform:Ke}),b.viewportChange(Ke),h=setTimeout(()=>{b.moveEnd({event:S,flowTransform:Ke}),b.viewportChangeEnd(Ke),G.value=!1},150)):(G.value=!0,b.moveStart({event:S,flowTransform:Ke}),b.viewportChangeStart(Ke))},{passive:!1}):typeof he<"u"&&de.on("wheel.zoom",function(S,V){const ne=!w.value&&S.type==="wheel"&&!S.ctrlKey,J=D.value||$.value,j=g.value&&S.ctrlKey;if(!J&&!l.value&&!j&&S.type==="wheel"||ne||ue(S,y.value))return null;S.preventDefault(),he.call(this,S,V)},{passive:!1})},{immediate:!0})});function Y(se,we){return we===2&&Array.isArray(se)&&se.includes(2)}function U(se){const we=se.ctrlKey&&ho()?10:1;return-se.deltaY*(se.deltaMode===1?.05:se.deltaMode?1:.002)*we}function Q(se,we){return se.x!==we.x&&!Number.isNaN(we.x)||se.y!==we.y&&!Number.isNaN(we.y)||se.zoom!==we.k&&!Number.isNaN(we.k)}function ae(se){return{x:se.x,y:se.y,zoom:se.k}}function ue(se,we){return se.target.closest(`.${we}`)}return(se,we)=>(X(),ie("div",{ref_key:"viewportRef",ref:F,class:"vue-flow__viewport vue-flow__container"},[Z(zg,{"is-selecting":ee.value,"selection-key-pressed":N(B),class:ze({connecting:!!N(m),dragging:N(T),draggable:N(d)===!0||Array.isArray(N(d))&&N(d).includes(0)})},{default:oe(()=>[Z(Dg,null,{default:oe(()=>[Ae(se.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Rg=["id"],Fg=["id"],Hg=["id"],Vg={name:"A11yDescriptions",compatConfig:{MODE:3}},Lg=fe({...Vg,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=$e();return(i,r)=>(X(),ie(Te,null,[pe("div",{id:`${N(rs)}-${N(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+De(N(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Rg),pe("div",{id:`${N(as)}-${N(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Fg),N(n)?Ce("",!0):(X(),ie("div",{key:0,id:`${N(uh)}-${N(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},De(N(o)),9,Hg))],64))}});function Yg(){const e=$e();xe(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Gg(e,t,n){return n===te.Left?e-t:n===te.Right?e+t:e}function Xg(e,t,n){return n===te.Top?e-t:n===te.Bottom?e+t:e}const Xi=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=te.Top,type:i}){return be("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Gg(t,e,o),cy:Xg(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Xi.props=["radius","centerX","centerY","position","type"];Xi.compatConfig={MODE:3};const Kr=Xi,Ug=fe({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:a,noPanClassName:s,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:f,multiSelectionActive:g,disableKeyboardA11y:$,elementsSelectable:w,edgesUpdatable:y,edgesFocusable:p,hooks:b}=$e(),m=K(()=>c(e.id)),{emit:_,on:T}=Rh(m.value,r),P=Vt(Mo),A=Nn(),R=ce(!1),O=ce(!1),F=ce(""),H=ce(null),k=ce("source"),G=ce(null),h=_e(()=>typeof m.value.selectable>"u"?w.value:m.value.selectable),M=_e(()=>typeof m.value.updatable>"u"?y.value:m.value.updatable),v=_e(()=>typeof m.value.focusable>"u"?p.value:m.value.focusable);Ot(Dh,e.id),Ot(Bh,G);const z=K(()=>m.value.class instanceof Function?m.value.class(m.value):m.value.class),I=K(()=>m.value.style instanceof Function?m.value.style(m.value):m.value.style),B=K(()=>{const x=m.value.type||"default",C=P==null?void 0:P[`edge-${x}`];if(C)return C;let S=m.value.template??l.value[x];if(typeof S=="string"&&A){const V=Object.keys(A.appContext.components);V&&V.includes(x)&&(S=$a(x,!1))}return S&&typeof S!="string"?S:(r.error(new Ie(Me.EDGE_TYPE_MISSING,S)),!1)}),{handlePointerDown:D}=$s({nodeId:F,handleId:H,type:k,isValidConnection:f,edgeUpdaterType:k,onEdgeUpdate:ee,onEdgeUpdateEnd:Y});return()=>{const x=d(m.value.source),C=d(m.value.target),S="pathOptions"in m.value?m.value.pathOptions:{};if(!x&&!C)return r.error(new Ie(Me.EDGE_SOURCE_TARGET_MISSING,m.value.id,m.value.source,m.value.target)),null;if(!x)return r.error(new Ie(Me.EDGE_SOURCE_MISSING,m.value.id,m.value.source)),null;if(!C)return r.error(new Ie(Me.EDGE_TARGET_MISSING,m.value.id,m.value.target)),null;if(!m.value||m.value.hidden||x.hidden||C.hidden)return null;let V;o.value===St.Strict?V=x.handleBounds.source:V=[...x.handleBounds.source||[],...x.handleBounds.target||[]];const ne=Dr(V,m.value.sourceHandle);let J;o.value===St.Strict?J=C.handleBounds.target:J=[...C.handleBounds.target||[],...C.handleBounds.source||[]];const j=Dr(J,m.value.targetHandle),le=(ne==null?void 0:ne.position)||te.Bottom,ve=(j==null?void 0:j.position)||te.Top,{x:me,y:Se}=Qt(x,ne,le),{x:Ke,y:tn}=Qt(C,j,ve);return m.value.sourceX=me,m.value.sourceY=Se,m.value.targetX=Ke,m.value.targetY=tn,be("g",{ref:G,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${B.value===!1?"default":m.value.type||"default"}`,s.value,z.value,{updating:R.value,selected:m.value.selected,animated:m.value.animated,inactive:!h.value&&!b.value.edgeClick.hasListeners()}],onClick:Q,onContextmenu:ae,onDblclick:ue,onMouseenter:se,onMousemove:we,onMouseleave:re,onKeyDown:v.value?E:void 0,tabIndex:v.value?0:void 0,"aria-label":m.value.ariaLabel===null?void 0:m.value.ariaLabel||`Edge from ${m.value.source} to ${m.value.target}`,"aria-describedby":v.value?`${as}-${t}`:void 0,role:v.value?"button":"img"},[O.value?null:be(B.value===!1?l.value.default:B.value,{id:e.id,sourceNode:x,targetNode:C,source:m.value.source,target:m.value.target,type:m.value.type,updatable:M.value,selected:m.value.selected,animated:m.value.animated,label:m.value.label,labelStyle:m.value.labelStyle,labelShowBg:m.value.labelShowBg,labelBgStyle:m.value.labelBgStyle,labelBgPadding:m.value.labelBgPadding,labelBgBorderRadius:m.value.labelBgBorderRadius,data:m.value.data,events:{...m.value.events,...T},style:I.value,markerStart:`url('#${bn(m.value.markerStart,t)}')`,markerEnd:`url('#${bn(m.value.markerEnd,t)}')`,sourcePosition:le,targetPosition:ve,sourceX:me,sourceY:Se,targetX:Ke,targetY:tn,sourceHandleId:m.value.sourceHandle,targetHandleId:m.value.targetHandle,interactionWidth:m.value.interactionWidth,...S}),[M.value==="source"||M.value===!0?[be("g",{onMousedown:de,onMouseenter:L,onMouseout:W},be(Kr,{position:le,centerX:me,centerY:Se,radius:i.value,type:"source","data-type":"source"}))]:null,M.value==="target"||M.value===!0?[be("g",{onMousedown:he,onMouseenter:L,onMouseout:W},be(Kr,{position:ve,centerX:Ke,centerY:tn,radius:i.value,type:"target","data-type":"target"}))]:null]])};function L(){R.value=!0}function W(){R.value=!1}function ee(x,C){_.update({event:x,edge:m.value,connection:C})}function Y(x){_.updateEnd({event:x,edge:m.value}),O.value=!1}function U(x,C){x.button===0&&(O.value=!0,F.value=C?m.value.target:m.value.source,H.value=(C?m.value.targetHandle:m.value.sourceHandle)??null,k.value=C?"target":"source",_.updateStart({event:x,edge:m.value}),D(x))}function Q(x){var C;const S={event:x,edge:m.value};h.value&&(a.value=!1,m.value.selected&&g.value?(u([m.value]),(C=G.value)==null||C.blur()):n([m.value])),_.click(S)}function ae(x){_.contextMenu({event:x,edge:m.value})}function ue(x){_.doubleClick({event:x,edge:m.value})}function se(x){_.mouseEnter({event:x,edge:m.value})}function we(x){_.mouseMove({event:x,edge:m.value})}function re(x){_.mouseLeave({event:x,edge:m.value})}function de(x){U(x,!0)}function he(x){U(x,!1)}function E(x){var C;!$.value&&ss.includes(x.key)&&h.value&&(x.key==="Escape"?((C=G.value)==null||C.blur(),u([c(e.id)])):n([c(e.id)]))}}}),Kg=Ug,Wg=fe({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:a,connectionLineStyle:s,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=$e(),f=(e=Vt(Mo))==null?void 0:e["connection-line"],g=K(()=>{var b;return d((b=o.value)==null?void 0:b.nodeId)}),$=K(()=>{var b;return d((b=i.value)==null?void 0:b.nodeId)??null}),w=K(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),y=K(()=>l.value.markerStart?`url(#${bn(l.value.markerStart,t)})`:""),p=K(()=>l.value.markerEnd?`url(#${bn(l.value.markerEnd,t)})`:"");return()=>{var b,m,_;if(!g.value||!o.value)return null;const T=o.value.id,P=o.value.type,A=g.value.handleBounds;let R=(A==null?void 0:A[P])??[];if(n.value===St.Loose){const I=(A==null?void 0:A[P==="source"?"target":"source"])??[];R=[...R,...I]}if(!R)return null;const O=(T?R.find(I=>I.id===T):R[0])??null,F=(O==null?void 0:O.position)??te.Top,{x:H,y:k}=Qt(g.value,O,F);let G=null;$.value&&(n.value===St.Strict?G=((b=$.value.handleBounds[P==="source"?"target":"source"])==null?void 0:b.find(I=>{var B;return I.id===((B=i.value)==null?void 0:B.id)}))||null:G=((m=[...$.value.handleBounds.source??[],...$.value.handleBounds.target??[]])==null?void 0:m.find(I=>{var B;return I.id===((B=i.value)==null?void 0:B.id)}))||null);const h=((_=i.value)==null?void 0:_.position)??(F?vi[F]:null);if(!F||!h)return null;const M=a.value??l.value.type??Mt.Bezier;let v="";const z={sourceX:H,sourceY:k,sourcePosition:F,targetX:w.value.x,targetY:w.value.y,targetPosition:h};return M===Mt.Bezier?[v]=Gi(z):M===Mt.Step?[v]=yi({...z,borderRadius:0}):M===Mt.SmoothStep?[v]=yi(z):M===Mt.SimpleBezier?[v]=Ms(z):v=`M${H},${k} ${w.value.x},${w.value.y}`,be("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},be("g",{class:"vue-flow__connection"},f?be(f,{sourceX:H,sourceY:k,sourcePosition:F,targetX:w.value.x,targetY:w.value.y,targetPosition:h,sourceNode:g.value,sourceHandle:O,targetNode:$.value,targetHandle:G,markerEnd:p.value,markerStart:y.value,connectionStatus:u.value}):be("path",{d:v,class:[l.value.class,u,"vue-flow__connection-path"],style:{...s.value,...l.value.style},"marker-end":p.value,"marker-start":y.value})))}}}),Zg=Wg,qg=["id","markerWidth","markerHeight","markerUnits","orient"],Qg={name:"MarkerType",compatConfig:{MODE:3}},Jg=fe({...Qg,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(X(),ie("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===N(hi).ArrowClosed?(X(),ie("polyline",{key:0,style:Ee({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Ce("",!0),t.type===N(hi).Arrow?(X(),ie("polyline",{key:1,style:Ee({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Ce("",!0)],8,qg))}}),jg={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},ep={name:"MarkerDefinitions",compatConfig:{MODE:3}},tp=fe({...ep,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=$e(),r=K(()=>{const a=new Set,s=[],l=u=>{if(u){const c=bn(u,t);a.has(c)||(typeof u=="object"?s.push({...u,id:c,color:u.color||i.value}):s.push({id:c,color:i.value,type:u}),a.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return s.sort((u,c)=>u.id.localeCompare(c.id))});return(a,s)=>(X(),ie("svg",jg,[pe("defs",null,[(X(!0),ie(Te,null,xt(r.value,l=>(X(),ge(Jg,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),np={name:"Edges",compatConfig:{MODE:3}},op=fe({...np,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=$e();return(i,r)=>(X(),ie(Te,null,[Z(tp),(X(!0),ie(Te,null,xt(N(n),a=>(X(),ie("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:Ee({zIndex:N(xh)(a,N(t),N(o))})},[Z(N(Kg),{id:a.id},null,8,["id"])],4))),128)),Z(N(Zg))],64))}}),ip=fe({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:a,removeSelectedNodes:s,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:f,elevateNodesOnSelect:g,disableKeyboardA11y:$,ariaLiveMessage:w,snapToGrid:y,snapGrid:p,nodeDragThreshold:b,nodesDraggable:m,elementsSelectable:_,nodesConnectable:T,nodesFocusable:P,hooks:A}=$e(),R=ce(null);Ot(bs,R),Ot(_s,e.id);const O=Vt(Mo),F=Nn(),H=Ss(),{node:k,parentNode:G}=Es(e.id),{emit:h,on:M}=Lh(k,a),v=_e(()=>typeof k.draggable>"u"?m.value:k.draggable),z=_e(()=>typeof k.selectable>"u"?_.value:k.selectable),I=_e(()=>typeof k.connectable>"u"?T.value:k.connectable),B=_e(()=>typeof k.focusable>"u"?P.value:k.focusable),D=_e(()=>z.value||v.value||A.value.nodeClick.hasListeners()||A.value.nodeDoubleClick.hasListeners()||A.value.nodeMouseEnter.hasListeners()||A.value.nodeMouseMove.hasListeners()||A.value.nodeMouseLeave.hasListeners()),L=_e(()=>!!k.dimensions.width&&!!k.dimensions.height),W=K(()=>{const C=k.type||"default",S=O==null?void 0:O[`node-${C}`];if(S)return S;let V=k.template||d.value[C];if(typeof V=="string"&&F){const ne=Object.keys(F.appContext.components);ne&&ne.includes(C)&&(V=$a(C,!1))}return V&&typeof V!="string"?V:(a.error(new Ie(Me.NODE_TYPE_MISSING,V)),!1)}),ee=xs({id:e.id,el:R,disabled:()=>!v.value,selectable:z,dragHandle:()=>k.dragHandle,onStart(C){h.dragStart(C)},onDrag(C){h.drag(C)},onStop(C){h.dragStop(C)},onClick(C){E(C)}}),Y=K(()=>k.class instanceof Function?k.class(k):k.class),U=K(()=>{const C=(k.style instanceof Function?k.style(k):k.style)||{},S=k.width instanceof Function?k.width(k):k.width,V=k.height instanceof Function?k.height(k):k.height;return!C.width&&S&&(C.width=typeof S=="string"?S:`${S}px`),!C.height&&V&&(C.height=typeof V=="string"?V:`${V}px`),C}),Q=_e(()=>Number(k.zIndex??U.value.zIndex??0));return c(C=>{(C.includes(e.id)||!C.length)&&ue()}),Ct(()=>{xe(()=>k.hidden,(C=!1,S,V)=>{!C&&R.value&&(e.resizeObserver.observe(R.value),V(()=>{R.value&&e.resizeObserver.unobserve(R.value)}))},{immediate:!0,flush:"post"})}),xe([()=>k.type,()=>k.sourcePosition,()=>k.targetPosition],()=>{Ge(()=>{u([{id:e.id,nodeElement:R.value,forceUpdate:!0}])})}),xe([()=>k.position.x,()=>k.position.y,()=>{var C;return(C=G.value)==null?void 0:C.computedPosition.x},()=>{var C;return(C=G.value)==null?void 0:C.computedPosition.y},()=>{var C;return(C=G.value)==null?void 0:C.computedPosition.z},Q,()=>k.selected,()=>k.dimensions.height,()=>k.dimensions.width,()=>{var C;return(C=G.value)==null?void 0:C.dimensions.height},()=>{var C;return(C=G.value)==null?void 0:C.dimensions.width}],([C,S,V,ne,J,j])=>{const le={x:C,y:S,z:j+(g.value&&k.selected?1e3:0)};typeof V<"u"&&typeof ne<"u"?k.computedPosition=vh({x:V,y:ne,z:J},le):k.computedPosition=le},{flush:"post",immediate:!0}),xe([()=>k.extent,f],([C,S],[V,ne])=>{(C!==V||S!==ne)&&ae()}),k.extent==="parent"||typeof k.extent=="object"&&"range"in k.extent&&k.extent.range==="parent"?ii(()=>L).toBe(!0).then(ae):ae(),()=>k.hidden?null:be("div",{ref:R,"data-id":k.id,class:["vue-flow__node",`vue-flow__node-${W.value===!1?"default":k.type||"default"}`,{[n.value]:v.value,dragging:ee==null?void 0:ee.value,draggable:v.value,selected:k.selected,selectable:z.value,parent:k.isParent},Y.value],style:{visibility:L.value?"visible":"hidden",zIndex:k.computedPosition.z??Q.value,transform:`translate(${k.computedPosition.x}px,${k.computedPosition.y}px)`,pointerEvents:D.value?"all":"none",...U.value},tabIndex:B.value?0:void 0,role:B.value?"button":void 0,"aria-describedby":$.value?void 0:`${rs}-${t}`,"aria-label":k.ariaLabel,onMouseenter:se,onMousemove:we,onMouseleave:re,onContextmenu:de,onClick:E,onDblclick:he,onKeydown:x},[be(W.value===!1?d.value.default:W.value,{id:k.id,type:k.type,data:k.data,events:{...k.events,...M},selected:k.selected,resizing:k.resizing,dragging:ee.value,connectable:I.value,position:k.computedPosition,dimensions:k.dimensions,isValidTargetPos:k.isValidTargetPos,isValidSourcePos:k.isValidSourcePos,parent:k.parentNode,parentNodeId:k.parentNode,zIndex:k.computedPosition.z??Q.value,targetPosition:k.targetPosition,sourcePosition:k.sourcePosition,label:k.label,dragHandle:k.dragHandle,onUpdateNodeInternals:ue})]);function ae(){const C=k.computedPosition,{computedPosition:S,position:V}=Li(k,y.value?Co(C,p.value):C,a.error,f.value,G.value);(k.computedPosition.x!==S.x||k.computedPosition.y!==S.y)&&(k.computedPosition={...k.computedPosition,...S}),(k.position.x!==V.x||k.position.y!==V.y)&&(k.position=V)}function ue(){R.value&&u([{id:e.id,nodeElement:R.value,forceUpdate:!0}])}function se(C){ee!=null&&ee.value||h.mouseEnter({event:C,node:k})}function we(C){ee!=null&&ee.value||h.mouseMove({event:C,node:k})}function re(C){ee!=null&&ee.value||h.mouseLeave({event:C,node:k})}function de(C){return h.contextMenu({event:C,node:k})}function he(C){return h.doubleClick({event:C,node:k})}function E(C){z.value&&(!o.value||!v.value||b.value>0)&&mi(k,r.value,l,s,i,!1,R.value),h.click({event:C,node:k})}function x(C){if(!(gi(C)||$.value))if(ss.includes(C.key)&&z.value){const S=C.key==="Escape";mi(k,r.value,l,s,i,S,R.value)}else v.value&&k.selected&&Ut[C.key]&&(C.preventDefault(),w.value=`Moved selected node ${C.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~k.position.x}, y: ${~~k.position.y}`,H({x:Ut[C.key].x,y:Ut[C.key].y},C.shiftKey))}}}),rp=ip;function ap(e={includeHiddenNodes:!1}){const{nodes:t}=$e();return K(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const sp={class:"vue-flow__nodes vue-flow__container"},lp={name:"Nodes",compatConfig:{MODE:3}},up=fe({...lp,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=$e(),i=ap(),r=ce();return xe(i,a=>{a&&Ge(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),Ct(()=>{r.value=new ResizeObserver(a=>{const s=a.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));Ge(()=>n(s))})}),xa(()=>{var a;return(a=r.value)==null?void 0:a.disconnect()}),(a,s)=>(X(),ie("div",sp,[r.value?(X(!0),ie(Te,{key:0},xt(N(t),(l,u,c,d)=>{const f=[l.id];if(d&&d.key===l.id&&xl(d,f))return d;const g=(X(),ge(N(rp),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return g.memo=f,g},s,0),128)):Ce("",!0)]))}});function cp(){const{emits:e}=$e();Ct(()=>{if(ws()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ie(Me.MISSING_STYLES))}})}const dp=pe("div",{class:"vue-flow__edge-labels"},null,-1),fp={name:"VueFlow",compatConfig:{MODE:3}},hp=fe({...fp,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=Ti(),r=Ro(o,"modelValue",n),a=Ro(o,"nodes",n),s=Ro(o,"edges",n),l=$e(o),u=Xh({modelValue:r,nodes:a,edges:s},o,l);return Kh(n,l.hooks),Yg(),cp(),Ot(Mo,i),yl(()=>{u()}),t(l),(c,d)=>(X(),ie("div",{ref:N(l).vueFlowRef,class:"vue-flow"},[Z(Og,null,{default:oe(()=>[Z(op),dp,Z(up),Ae(c.$slots,"zoom-pane")]),_:3}),Ae(c.$slots,"default"),Z(Lg)],512))}}),gp={name:"Panel",compatConfig:{MODE:3}},pp=fe({...gp,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=$e(),o=K(()=>`${t.position}`.split("-"));return(i,r)=>(X(),ie("div",{class:ze(["vue-flow__panel",o.value]),style:Ee({pointerEvents:N(n)?"none":"all"})},[Ae(i.$slots,"default")],6))}}),{HORIZONTAL_STEP:Ts,VERTICAL_STEP:go}=Na,vp=e=>{const t={};for(const n of e){const o=`${n.schema}.${n.table}`;t[o]||(t[o]={connections:new Set,degree:0});for(const i of n.foreign_keys){const r=`${i.reference_schema}.${i.reference_table}`;t[r]||(t[r]={connections:new Set,degree:0}),t[o].connections.add(r),t[r].connections.add(o)}}for(const[n,o]of Object.entries(t))o.degree=o.connections.size;return t},mp=e=>{const t=Object.entries(e);return t.length===0?"":t.sort((n,o)=>o[1].degree-n[1].degree)[0][0]},yp=(e,t)=>{const n={},o=[{id:t,depth:0}],i=new Set;for(;o.length>0;){const{id:r,depth:a}=o.shift();if(!i.has(r)&&(i.add(r),n[r]=a,e[r]))for(const s of e[r].connections)i.has(s)||o.push({id:s,depth:a+1})}return n},wp=(e,t,n)=>{var a;const o={},i=new Map(n.map(s=>[`${s.schema}.${s.table}`,s])),r={};for(const[s,l]of Object.entries(t))r[l]||(r[l]=[]),r[l].push(s);for(const[s,l]of Object.entries(r)){const u=Number(s);l.sort((f,g)=>e[g].degree-e[f].degree);let d=-l.reduce((f,g)=>{var y;const $=i.get(g),w=(((y=$==null?void 0:$.columns)==null?void 0:y.length)||0)*$t+ni+go;return f+w},0)/2;for(const f of l){const g=i.get(f),$=(((a=g==null?void 0:g.columns)==null?void 0:a.length)||0)*$t+ni+go;o[f]={x:u*Ts,y:d+$/2},d+=$}}return o},_p=e=>{var l;if(!e.length)return{nodes:[],edges:[],centerId:""};const t=vp(e),n=mp(t),o=yp(t,n),i=wp(t,o,e),r=e.filter(u=>{const c=`${u.schema}.${u.table}`,d=t[c];return!d||d.connections.size===0});if(r.length>0){const u=Math.max(...Object.values(i).map(f=>f.x));let d=Math.min(...Object.values(i).map(f=>f.y))-go;for(const f of r){const g=`${f.schema}.${f.table}`,$=(((l=f.columns)==null?void 0:l.length)||0)*$t+ni;i[g]={x:u+Ts*1.5,y:d},d-=$+go}}const a=Ea(e,i),s=Sa(e);return{nodes:a,edges:s,centerId:n}},yt=(e,t)=>`${e}-${t}`,kt=(e,t,n,o)=>{const{id:i,sourceHandle:r,targetHandle:a,sourceNode:s,targetNode:l,selectable:u}=e,c=t||(o==null?void 0:o.edgeId)===i||(n==null?void 0:n.edgeIds.has(i))||!1;e.animated=c;const d=(y,p,b)=>{if(!y||!p)return;y.label||(y.label=new Map);const m=y.label;b?m.set(p,!0):m.delete(p)},f=yt(s==null?void 0:s.id,r),g=yt(l==null?void 0:l.id,a),$=c||u||(n==null?void 0:n.relatedColumnIds.has(f))||(o==null?void 0:o.sourceId)===f||t,w=c||u||(n==null?void 0:n.relatedColumnIds.has(g))||(o==null?void 0:o.targetId)===g||t;d(s,r,!!$),d(l,a,!!w)},wi=({findNode:e,fitView:t,getViewport:n,nodeId:o})=>{if(!e(o))return;const r=n().zoom;t({nodes:[o],maxZoom:r,minZoom:r,duration:Sl})},Wr=e=>(e||0)*$t-$t/2-1+2+10+$t,Zr=fe({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=Nl(t,"class");return(o,i)=>(X(),ge(N(ou),st({"data-slot":"separator-root"},N(n),{class:N(wa)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t.class)}),null,16,["class"]))}});var it=(e=>(e.Lines="lines",e.Dots="dots",e))(it||{});const As=function({dimensions:e,size:t,color:n}){return be("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},zs=function({radius:e,color:t}){return be("circle",{cx:e,cy:e,r:e,fill:t})};it.Lines+"",it.Dots+"";const bp={[it.Dots]:"#81818a",[it.Lines]:"#eee"},xp=["id","x","y","width","height","patternTransform"],$p={key:2,height:"100",width:"100"},Ep=["fill"],Sp=["x","y","fill"],Np={name:"Background",compatConfig:{MODE:3}},Cp=fe({...Np,props:{id:{},variant:{default:()=>it.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=$e(),o=K(()=>{const a=n.value.zoom,[s,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[s*a||1,l*a||1],c=e.size*a,[d,f]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],g=[d*a||1+u[0]/2,f*a||1+u[1]/2];return{scaledGap:u,offset:g,size:c}}),i=_e(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=_e(()=>e.color||e.patternColor||bp[e.variant||it.Dots]);return(a,s)=>(X(),ie("svg",{class:"vue-flow__background vue-flow__container",style:Ee({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[Ae(a.$slots,"pattern-container",{id:i.value},()=>[pe("pattern",{id:i.value,x:N(n).x%o.value.scaledGap[0],y:N(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Ae(a.$slots,"pattern",{},()=>[a.variant===N(it).Lines?(X(),ge(N(As),{key:0,size:a.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===N(it).Dots?(X(),ge(N(zs),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):Ce("",!0),a.bgColor?(X(),ie("svg",$p,[pe("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,Ep)])):Ce("",!0)])],8,xp)]),pe("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,Sp),Ae(a.$slots,"default",{id:i.value})],4))}});var kp={value:()=>{}};function Ui(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Jn(n)}function Jn(e){this._=e}function Mp(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Jn.prototype=Ui.prototype={constructor:Jn,on:function(e,t){var n=this._,o=Mp(e+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(e=o[r]).type)&&(i=Ip(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<a;)if(i=(e=o[r]).type)n[i]=qr(n[i],e.name,t);else if(t==null)for(i in n)n[i]=qr(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Jn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function Ip(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function qr(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=kp,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var _i="http://www.w3.org/1999/xhtml";const Qr={svg:"http://www.w3.org/2000/svg",xhtml:_i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zo(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Qr.hasOwnProperty(t)?{space:Qr[t],local:e}:e}function Tp(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_i&&t.documentElement.namespaceURI===_i?t.createElement(e):t.createElementNS(n,e)}}function Ap(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ps(e){var t=zo(e);return(t.local?Ap:Tp)(t)}function zp(){}function Ki(e){return e==null?zp:function(){return this.querySelector(e)}}function Pp(e){typeof e!="function"&&(e=Ki(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=new Array(a),l,u,c=0;c<a;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Fe(o,this._parents)}function Dp(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Bp(){return[]}function Ds(e){return e==null?Bp:function(){return this.querySelectorAll(e)}}function Op(e){return function(){return Dp(e.apply(this,arguments))}}function Rp(e){typeof e=="function"?e=Op(e):e=Ds(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var a=t[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(o.push(e.call(l,l.__data__,u,a)),i.push(l));return new Fe(o,i)}function Bs(e){return function(){return this.matches(e)}}function Os(e){return function(t){return t.matches(e)}}var Fp=Array.prototype.find;function Hp(e){return function(){return Fp.call(this.children,e)}}function Vp(){return this.firstElementChild}function Lp(e){return this.select(e==null?Vp:Hp(typeof e=="function"?e:Os(e)))}var Yp=Array.prototype.filter;function Gp(){return Array.from(this.children)}function Xp(e){return function(){return Yp.call(this.children,e)}}function Up(e){return this.selectAll(e==null?Gp:Xp(typeof e=="function"?e:Os(e)))}function Kp(e){typeof e!="function"&&(e=Bs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new Fe(o,this._parents)}function Rs(e){return new Array(e.length)}function Wp(){return new Fe(this._enter||this._groups.map(Rs),this._parents)}function po(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}po.prototype={constructor:po,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Zp(e){return function(){return e}}function qp(e,t,n,o,i,r){for(var a=0,s,l=t.length,u=r.length;a<u;++a)(s=t[a])?(s.__data__=r[a],o[a]=s):n[a]=new po(e,r[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function Qp(e,t,n,o,i,r,a){var s,l,u=new Map,c=t.length,d=r.length,f=new Array(c),g;for(s=0;s<c;++s)(l=t[s])&&(f[s]=g=a.call(l,l.__data__,s,t)+"",u.has(g)?i[s]=l:u.set(g,l));for(s=0;s<d;++s)g=a.call(e,r[s],s,r)+"",(l=u.get(g))?(o[s]=l,l.__data__=r[s],u.delete(g)):n[s]=new po(e,r[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function Jp(e){return e.__data__}function jp(e,t){if(!arguments.length)return Array.from(this,Jp);var n=t?Qp:qp,o=this._parents,i=this._groups;typeof e!="function"&&(e=Zp(e));for(var r=i.length,a=new Array(r),s=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],f=d.length,g=ev(e.call(c,c&&c.__data__,u,o)),$=g.length,w=s[u]=new Array($),y=a[u]=new Array($),p=l[u]=new Array(f);n(c,d,w,y,p,g,t);for(var b=0,m=0,_,T;b<$;++b)if(_=w[b]){for(b>=m&&(m=b+1);!(T=y[m])&&++m<$;);_._next=T||null}}return a=new Fe(a,o),a._enter=s,a._exit=l,a}function ev(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function tv(){return new Fe(this._exit||this._groups.map(Rs),this._parents)}function nv(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function ov(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,a=Math.min(i,r),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=o[l],d=u.length,f=s[l]=new Array(d),g,$=0;$<d;++$)(g=u[$]||c[$])&&(f[$]=g);for(;l<i;++l)s[l]=n[l];return new Fe(s,this._parents)}function iv(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function rv(e){e||(e=av);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],s=a.length,l=i[r]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Fe(i,this._parents).order()}function av(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function sv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function lv(){return Array.from(this)}function uv(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var a=o[i];if(a)return a}return null}function cv(){let e=0;for(const t of this)++e;return e}function dv(){return!this.node()}function fv(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,a=i.length,s;r<a;++r)(s=i[r])&&e.call(s,s.__data__,r,i);return this}function hv(e){return function(){this.removeAttribute(e)}}function gv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pv(e,t){return function(){this.setAttribute(e,t)}}function vv(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mv(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function yv(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function wv(e,t){var n=zo(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?gv:hv:typeof t=="function"?n.local?yv:mv:n.local?vv:pv)(n,t))}function Fs(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function _v(e){return function(){this.style.removeProperty(e)}}function bv(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xv(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function $v(e,t,n){return arguments.length>1?this.each((t==null?_v:typeof t=="function"?xv:bv)(e,t,n??"")):jt(this.node(),e)}function jt(e,t){return e.style.getPropertyValue(t)||Fs(e).getComputedStyle(e,null).getPropertyValue(t)}function Ev(e){return function(){delete this[e]}}function Sv(e,t){return function(){this[e]=t}}function Nv(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Cv(e,t){return arguments.length>1?this.each((t==null?Ev:typeof t=="function"?Nv:Sv)(e,t)):this.node()[e]}function Hs(e){return e.trim().split(/^|\s+/)}function Wi(e){return e.classList||new Vs(e)}function Vs(e){this._node=e,this._names=Hs(e.getAttribute("class")||"")}Vs.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ls(e,t){for(var n=Wi(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Ys(e,t){for(var n=Wi(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function kv(e){return function(){Ls(this,e)}}function Mv(e){return function(){Ys(this,e)}}function Iv(e,t){return function(){(t.apply(this,arguments)?Ls:Ys)(this,e)}}function Tv(e,t){var n=Hs(e+"");if(arguments.length<2){for(var o=Wi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Iv:t?kv:Mv)(n,t))}function Av(){this.textContent=""}function zv(e){return function(){this.textContent=e}}function Pv(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Dv(e){return arguments.length?this.each(e==null?Av:(typeof e=="function"?Pv:zv)(e)):this.node().textContent}function Bv(){this.innerHTML=""}function Ov(e){return function(){this.innerHTML=e}}function Rv(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Fv(e){return arguments.length?this.each(e==null?Bv:(typeof e=="function"?Rv:Ov)(e)):this.node().innerHTML}function Hv(){this.nextSibling&&this.parentNode.appendChild(this)}function Vv(){return this.each(Hv)}function Lv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yv(){return this.each(Lv)}function Gv(e){var t=typeof e=="function"?e:Ps(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Xv(){return null}function Uv(e,t){var n=typeof e=="function"?e:Ps(e),o=t==null?Xv:typeof t=="function"?t:Ki(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Kv(){var e=this.parentNode;e&&e.removeChild(this)}function Wv(){return this.each(Kv)}function Zv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qv(e){return this.select(e?qv:Zv)}function Jv(e){return arguments.length?this.property("__data__",e):this.node().__data__}function jv(e){return function(t){e.call(this,t,this.__data__)}}function em(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function tm(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function nm(e,t,n){return function(){var o=this.__on,i,r=jv(t);if(o){for(var a=0,s=o.length;a<s;++a)if((i=o[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function om(e,t,n){var o=em(e+""),i,r=o.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<r;++i)if((a=o[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?nm:tm,i=0;i<r;++i)this.each(s(o[i],t,n));return this}function Gs(e,t,n){var o=Fs(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function im(e,t){return function(){return Gs(this,e,t)}}function rm(e,t){return function(){return Gs(this,e,t.apply(this,arguments))}}function am(e,t){return this.each((typeof t=="function"?rm:im)(e,t))}function*sm(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var Xs=[null];function Fe(e,t){this._groups=e,this._parents=t}function In(){return new Fe([[document.documentElement]],Xs)}function lm(){return this}Fe.prototype=In.prototype={constructor:Fe,select:Pp,selectAll:Rp,selectChild:Lp,selectChildren:Up,filter:Kp,data:jp,enter:Wp,exit:tv,join:nv,merge:ov,selection:lm,order:iv,sort:rv,call:sv,nodes:lv,node:uv,size:cv,empty:dv,each:fv,attr:wv,style:$v,property:Cv,classed:Tv,text:Dv,html:Fv,raise:Vv,lower:Yv,append:Gv,insert:Uv,remove:Wv,clone:Qv,datum:Jv,on:om,dispatch:am,[Symbol.iterator]:sm};function _t(e){return typeof e=="string"?new Fe([[document.querySelector(e)]],[document.documentElement]):new Fe([[e]],Xs)}function um(e){let t;for(;t=e.sourceEvent;)e=t;return e}function pt(e,t){if(e=um(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const bi={capture:!0,passive:!1};function xi(e){e.preventDefault(),e.stopImmediatePropagation()}function cm(e){var t=e.document.documentElement,n=_t(e).on("dragstart.drag",xi,bi);"onselectstart"in t?n.on("selectstart.drag",xi,bi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function dm(e,t){var n=e.document.documentElement,o=_t(e).on("dragstart.drag",null);t&&(o.on("click.drag",xi,bi),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Zi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Us(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Tn(){}var xn=.7,vo=1/xn,Kt="\\s*([+-]?\\d+)\\s*",$n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fm=/^#([0-9a-f]{3,8})$/,hm=new RegExp(`^rgb\\(${Kt},${Kt},${Kt}\\)$`),gm=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),pm=new RegExp(`^rgba\\(${Kt},${Kt},${Kt},${$n}\\)$`),vm=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${$n}\\)$`),mm=new RegExp(`^hsl\\(${$n},${Qe},${Qe}\\)$`),ym=new RegExp(`^hsla\\(${$n},${Qe},${Qe},${$n}\\)$`),Jr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Zi(Tn,En,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jr,formatHex:jr,formatHex8:wm,formatHsl:_m,formatRgb:ea,toString:ea});function jr(){return this.rgb().formatHex()}function wm(){return this.rgb().formatHex8()}function _m(){return Ks(this).formatHsl()}function ea(){return this.rgb().formatRgb()}function En(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fm.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ta(t):n===3?new Oe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Vn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Vn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hm.exec(e))?new Oe(t[1],t[2],t[3],1):(t=gm.exec(e))?new Oe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pm.exec(e))?Vn(t[1],t[2],t[3],t[4]):(t=vm.exec(e))?Vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mm.exec(e))?ia(t[1],t[2]/100,t[3]/100,1):(t=ym.exec(e))?ia(t[1],t[2]/100,t[3]/100,t[4]):Jr.hasOwnProperty(e)?ta(Jr[e]):e==="transparent"?new Oe(NaN,NaN,NaN,0):null}function ta(e){return new Oe(e>>16&255,e>>8&255,e&255,1)}function Vn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Oe(e,t,n,o)}function bm(e){return e instanceof Tn||(e=En(e)),e?(e=e.rgb(),new Oe(e.r,e.g,e.b,e.opacity)):new Oe}function $i(e,t,n,o){return arguments.length===1?bm(e):new Oe(e,t,n,o??1)}function Oe(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Zi(Oe,$i,Us(Tn,{brighter(e){return e=e==null?vo:Math.pow(vo,e),new Oe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xn:Math.pow(xn,e),new Oe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Oe(Bt(this.r),Bt(this.g),Bt(this.b),mo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:na,formatHex:na,formatHex8:xm,formatRgb:oa,toString:oa}));function na(){return`#${zt(this.r)}${zt(this.g)}${zt(this.b)}`}function xm(){return`#${zt(this.r)}${zt(this.g)}${zt(this.b)}${zt((isNaN(this.opacity)?1:this.opacity)*255)}`}function oa(){const e=mo(this.opacity);return`${e===1?"rgb(":"rgba("}${Bt(this.r)}, ${Bt(this.g)}, ${Bt(this.b)}${e===1?")":`, ${e})`}`}function mo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zt(e){return e=Bt(e),(e<16?"0":"")+e.toString(16)}function ia(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ye(e,t,n,o)}function Ks(e){if(e instanceof Ye)return new Ye(e.h,e.s,e.l,e.opacity);if(e instanceof Tn||(e=En(e)),!e)return new Ye;if(e instanceof Ye)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),a=NaN,s=r-i,l=(r+i)/2;return s?(t===r?a=(n-o)/s+(n<o)*6:n===r?a=(o-t)/s+2:a=(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new Ye(a,s,l,e.opacity)}function $m(e,t,n,o){return arguments.length===1?Ks(e):new Ye(e,t,n,o??1)}function Ye(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Zi(Ye,$m,Us(Tn,{brighter(e){return e=e==null?vo:Math.pow(vo,e),new Ye(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xn:Math.pow(xn,e),new Ye(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Oe(qo(e>=240?e-240:e+120,i,o),qo(e,i,o),qo(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ye(ra(this.h),Ln(this.s),Ln(this.l),mo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=mo(this.opacity);return`${e===1?"hsl(":"hsla("}${ra(this.h)}, ${Ln(this.s)*100}%, ${Ln(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ra(e){return e=(e||0)%360,e<0?e+360:e}function Ln(e){return Math.max(0,Math.min(1,e||0))}function qo(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ws=e=>()=>e;function Em(e,t){return function(n){return e+n*t}}function Sm(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Nm(e){return(e=+e)==1?Zs:function(t,n){return n-t?Sm(t,n,e):Ws(isNaN(t)?n:t)}}function Zs(e,t){var n=t-e;return n?Em(e,n):Ws(isNaN(e)?t:e)}const aa=function e(t){var n=Nm(t);function o(i,r){var a=n((i=$i(i)).r,(r=$i(r)).r),s=n(i.g,r.g),l=n(i.b,r.b),u=Zs(i.opacity,r.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function wt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Ei=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qo=new RegExp(Ei.source,"g");function Cm(e){return function(){return e}}function km(e){return function(t){return e(t)+""}}function Mm(e,t){var n=Ei.lastIndex=Qo.lastIndex=0,o,i,r,a=-1,s=[],l=[];for(e=e+"",t=t+"";(o=Ei.exec(e))&&(i=Qo.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),s[a]?s[a]+=r:s[++a]=r),(o=o[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:wt(o,i)})),n=Qo.lastIndex;return n<t.length&&(r=t.slice(n),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?km(l[0].x):Cm(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)s[(d=l[c]).i]=d.x(u);return s.join("")})}var sa=180/Math.PI,Si={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qs(e,t,n,o,i,r){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*sa,skewX:Math.atan(l)*sa,scaleX:a,scaleY:s}}var Yn;function Im(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Si:qs(t.a,t.b,t.c,t.d,t.e,t.f)}function Tm(e){return e==null||(Yn||(Yn=document.createElementNS("http://www.w3.org/2000/svg","g")),Yn.setAttribute("transform",e),!(e=Yn.transform.baseVal.consolidate()))?Si:(e=e.matrix,qs(e.a,e.b,e.c,e.d,e.e,e.f))}function Qs(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,f,g,$){if(u!==d||c!==f){var w=g.push("translate(",null,t,null,n);$.push({i:w-4,x:wt(u,d)},{i:w-2,x:wt(c,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function a(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,o)-2,x:wt(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function s(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,o)-2,x:wt(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,f,g,$){if(u!==d||c!==f){var w=g.push(i(g)+"scale(",null,",",null,")");$.push({i:w-4,x:wt(u,d)},{i:w-2,x:wt(c,f)})}else(d!==1||f!==1)&&g.push(i(g)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,f),a(u.rotate,c.rotate,d,f),s(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(g){for(var $=-1,w=f.length,y;++$<w;)d[(y=f[$]).i]=y.x(g);return d.join("")}}}var Am=Qs(Im,"px, ","px)","deg)"),zm=Qs(Tm,", ",")",")"),Pm=1e-12;function la(e){return((e=Math.exp(e))+1/e)/2}function Dm(e){return((e=Math.exp(e))-1/e)/2}function Bm(e){return((e=Math.exp(2*e))-1)/(e+1)}const Om=function e(t,n,o){function i(r,a){var s=r[0],l=r[1],u=r[2],c=a[0],d=a[1],f=a[2],g=c-s,$=d-l,w=g*g+$*$,y,p;if(w<Pm)p=Math.log(f/u)/t,y=function(A){return[s+A*g,l+A*$,u*Math.exp(t*A*p)]};else{var b=Math.sqrt(w),m=(f*f-u*u+o*w)/(2*u*n*b),_=(f*f-u*u-o*w)/(2*f*n*b),T=Math.log(Math.sqrt(m*m+1)-m),P=Math.log(Math.sqrt(_*_+1)-_);p=(P-T)/t,y=function(A){var R=A*p,O=la(T),F=u/(n*b)*(O*Bm(t*R+T)-Dm(T));return[s+F*g,l+F*$,u*O/la(t*R+T)]}}return y.duration=p*1e3*t/Math.SQRT2,y}return i.rho=function(r){var a=Math.max(.001,+r),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var en=0,cn=0,rn=0,Js=1e3,yo,dn,wo=0,Ht=0,Po=0,Sn=typeof performance=="object"&&performance.now?performance:Date,js=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qi(){return Ht||(js(Rm),Ht=Sn.now()+Po)}function Rm(){Ht=0}function _o(){this._call=this._time=this._next=null}_o.prototype=el.prototype={constructor:_o,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qi():+n)+(t==null?0:+t),!this._next&&dn!==this&&(dn?dn._next=this:yo=this,dn=this),this._call=e,this._time=n,Ni()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ni())}};function el(e,t,n){var o=new _o;return o.restart(e,t,n),o}function Fm(){qi(),++en;for(var e=yo,t;e;)(t=Ht-e._time)>=0&&e._call.call(void 0,t),e=e._next;--en}function ua(){Ht=(wo=Sn.now())+Po,en=cn=0;try{Fm()}finally{en=0,Vm(),Ht=0}}function Hm(){var e=Sn.now(),t=e-wo;t>Js&&(Po-=t,wo=e)}function Vm(){for(var e,t=yo,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:yo=n);dn=e,Ni(o)}function Ni(e){if(!en){cn&&(cn=clearTimeout(cn));var t=e-Ht;t>24?(e<1/0&&(cn=setTimeout(ua,e-Sn.now()-Po)),rn&&(rn=clearInterval(rn))):(rn||(wo=Sn.now(),rn=setInterval(Hm,Js)),en=1,js(ua))}}function ca(e,t,n){var o=new _o;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Lm=Ui("start","end","cancel","interrupt"),Ym=[],tl=0,da=1,Ci=2,jn=3,fa=4,ki=5,eo=6;function Do(e,t,n,o,i,r){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Gm(e,n,{name:t,index:o,group:i,on:Lm,tween:Ym,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:tl})}function Qi(e,t){var n=Ue(e,t);if(n.state>tl)throw new Error("too late; already scheduled");return n}function je(e,t){var n=Ue(e,t);if(n.state>jn)throw new Error("too late; already running");return n}function Ue(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Gm(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=el(r,0,n.time);function r(u){n.state=da,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,d,f,g;if(n.state!==da)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===jn)return ca(a);g.state===fa?(g.state=eo,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+c<t&&(g.state=eo,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[c])}if(ca(function(){n.state===jn&&(n.state=fa,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=Ci,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ci){for(n.state=jn,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ki,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===ki&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=eo,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function to(e,t){var n=e.__transition,o,i,r=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((o=n[a]).name!==t){r=!1;continue}i=o.state>Ci&&o.state<ki,o.state=eo,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[a]}r&&delete e.__transition}}function Xm(e){return this.each(function(){to(this,e)})}function Um(e,t){var n,o;return function(){var i=je(this,e),r=i.tween;if(r!==n){o=n=r;for(var a=0,s=o.length;a<s;++a)if(o[a].name===t){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function Km(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=je(this,e),a=r.tween;if(a!==o){i=(o=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}r.tween=i}}function Wm(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ue(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===e)return a.value;return null}return this.each((t==null?Um:Km)(n,e,t))}function Ji(e,t,n){var o=e._id;return e.each(function(){var i=je(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ue(i,o).value[t]}}function nl(e,t){var n;return(typeof t=="number"?wt:t instanceof En?aa:(n=En(t))?(t=n,aa):Mm)(e,t)}function Zm(e){return function(){this.removeAttribute(e)}}function qm(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qm(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}}function Jm(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}function jm(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function ey(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function ty(e,t){var n=zo(e),o=n==="transform"?zm:nl;return this.attrTween(e,typeof t=="function"?(n.local?ey:jm)(n,o,Ji(this,"attr."+e,t)):t==null?(n.local?qm:Zm)(n):(n.local?Jm:Qm)(n,o,t))}function ny(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function oy(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function iy(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&oy(e,r)),n}return i._value=t,i}function ry(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&ny(e,r)),n}return i._value=t,i}function ay(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=zo(e);return this.tween(n,(o.local?iy:ry)(o,t))}function sy(e,t){return function(){Qi(this,e).delay=+t.apply(this,arguments)}}function ly(e,t){return t=+t,function(){Qi(this,e).delay=t}}function uy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sy:ly)(t,e)):Ue(this.node(),t).delay}function cy(e,t){return function(){je(this,e).duration=+t.apply(this,arguments)}}function dy(e,t){return t=+t,function(){je(this,e).duration=t}}function fy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cy:dy)(t,e)):Ue(this.node(),t).duration}function hy(e,t){if(typeof t!="function")throw new Error;return function(){je(this,e).ease=t}}function gy(e){var t=this._id;return arguments.length?this.each(hy(t,e)):Ue(this.node(),t).ease}function py(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;je(this,e).ease=n}}function vy(e){if(typeof e!="function")throw new Error;return this.each(py(this._id,e))}function my(e){typeof e!="function"&&(e=Bs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new ut(o,this._parents,this._name,this._id)}function yy(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),a=new Array(o),s=0;s<r;++s)for(var l=t[s],u=n[s],c=l.length,d=a[s]=new Array(c),f,g=0;g<c;++g)(f=l[g]||u[g])&&(d[g]=f);for(;s<o;++s)a[s]=t[s];return new ut(a,this._parents,this._name,this._id)}function wy(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function _y(e,t,n){var o,i,r=wy(t)?Qi:je;return function(){var a=r(this,e),s=a.on;s!==o&&(i=(o=s).copy()).on(t,n),a.on=i}}function by(e,t){var n=this._id;return arguments.length<2?Ue(this.node(),n).on.on(e):this.each(_y(n,e,t))}function xy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $y(){return this.on("end.remove",xy(this._id))}function Ey(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ki(e));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var s=o[a],l=s.length,u=r[a]=new Array(l),c,d,f=0;f<l;++f)(c=s[f])&&(d=e.call(c,c.__data__,f,s))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Do(u[f],t,n,f,u,Ue(c,n)));return new ut(r,this._parents,t,n)}function Sy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ds(e));for(var o=this._groups,i=o.length,r=[],a=[],s=0;s<i;++s)for(var l=o[s],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),g,$=Ue(c,n),w=0,y=f.length;w<y;++w)(g=f[w])&&Do(g,t,n,w,f,$);r.push(f),a.push(c)}return new ut(r,a,t,n)}var Ny=In.prototype.constructor;function Cy(){return new Ny(this._groups,this._parents)}function ky(e,t){var n,o,i;return function(){var r=jt(this,e),a=(this.style.removeProperty(e),jt(this,e));return r===a?null:r===n&&a===o?i:i=t(n=r,o=a)}}function ol(e){return function(){this.style.removeProperty(e)}}function My(e,t,n){var o,i=n+"",r;return function(){var a=jt(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}function Iy(e,t,n){var o,i,r;return function(){var a=jt(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),jt(this,e))),a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s))}}function Ty(e,t){var n,o,i,r="style."+t,a="end."+r,s;return function(){var l=je(this,e),u=l.on,c=l.value[r]==null?s||(s=ol(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(a,i=c),l.on=o}}function Ay(e,t,n){var o=(e+="")=="transform"?Am:nl;return t==null?this.styleTween(e,ky(e,o)).on("end.style."+e,ol(e)):typeof t=="function"?this.styleTween(e,Iy(e,o,Ji(this,"style."+e,t))).each(Ty(this._id,e)):this.styleTween(e,My(e,o,t),n).on("end.style."+e,null)}function zy(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Py(e,t,n){var o,i;function r(){var a=t.apply(this,arguments);return a!==i&&(o=(i=a)&&zy(e,a,n)),o}return r._value=t,r}function Dy(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Py(e,t,n??""))}function By(e){return function(){this.textContent=e}}function Oy(e){return function(){var t=e(this);this.textContent=t??""}}function Ry(e){return this.tween("text",typeof e=="function"?Oy(Ji(this,"text",e)):By(e==null?"":e+""))}function Fy(e){return function(t){this.textContent=e.call(this,t)}}function Hy(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Fy(i)),t}return o._value=e,o}function Vy(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,Hy(e))}function Ly(){for(var e=this._name,t=this._id,n=il(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=Ue(l,t);Do(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ut(o,this._parents,e,n)}function Yy(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var s={value:a},l={value:function(){--i===0&&r()}};n.each(function(){var u=je(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&r()})}var Gy=0;function ut(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function il(){return++Gy}var tt=In.prototype;ut.prototype={constructor:ut,select:Ey,selectAll:Sy,selectChild:tt.selectChild,selectChildren:tt.selectChildren,filter:my,merge:yy,selection:Cy,transition:Ly,call:tt.call,nodes:tt.nodes,node:tt.node,size:tt.size,empty:tt.empty,each:tt.each,on:by,attr:ty,attrTween:ay,style:Ay,styleTween:Dy,text:Ry,textTween:Vy,remove:$y,tween:Wm,delay:uy,duration:fy,ease:gy,easeVarying:vy,end:Yy,[Symbol.iterator]:tt[Symbol.iterator]};function Xy(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Uy={time:null,delay:0,duration:250,ease:Xy};function Ky(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Wy(e){var t,n;e instanceof ut?(t=e._id,e=e._name):(t=il(),(n=Uy).time=qi(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&Do(l,e,t,u,a,n||Ky(l,t));return new ut(o,this._parents,e,t)}In.prototype.interrupt=Xm;In.prototype.transition=Wy;const Gn=e=>()=>e;function Zy(e,{sourceEvent:t,target:n,transform:o,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:o,enumerable:!0,configurable:!0},_:{value:i}})}function rt(e,t,n){this.k=e,this.x=t,this.y=n}rt.prototype={constructor:rt,scale:function(e){return e===1?this:new rt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new rt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ji=new rt(1,0,0);rt.prototype;function Jo(e){e.stopImmediatePropagation()}function an(e){e.preventDefault(),e.stopImmediatePropagation()}function qy(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Qy(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ha(){return this.__zoom||ji}function Jy(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function jy(){return navigator.maxTouchPoints||"ontouchstart"in this}function e0(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function t0(){var e=qy,t=Qy,n=e0,o=Jy,i=jy,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Om,u=Ui("start","zoom","end"),c,d,f,g=500,$=150,w=0,y=10;function p(h){h.property("__zoom",ha).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(h,M,v,z){var I=h.selection?h.selection():h;I.property("__zoom",ha),h!==I?T(h,M,v,z):I.interrupt().each(function(){P(this,arguments).event(z).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},p.scaleBy=function(h,M,v,z){p.scaleTo(h,function(){var I=this.__zoom.k,B=typeof M=="function"?M.apply(this,arguments):M;return I*B},v,z)},p.scaleTo=function(h,M,v,z){p.transform(h,function(){var I=t.apply(this,arguments),B=this.__zoom,D=v==null?_(I):typeof v=="function"?v.apply(this,arguments):v,L=B.invert(D),W=typeof M=="function"?M.apply(this,arguments):M;return n(m(b(B,W),D,L),I,a)},v,z)},p.translateBy=function(h,M,v,z){p.transform(h,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof v=="function"?v.apply(this,arguments):v),t.apply(this,arguments),a)},null,z)},p.translateTo=function(h,M,v,z,I){p.transform(h,function(){var B=t.apply(this,arguments),D=this.__zoom,L=z==null?_(B):typeof z=="function"?z.apply(this,arguments):z;return n(ji.translate(L[0],L[1]).scale(D.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof v=="function"?-v.apply(this,arguments):-v),B,a)},z,I)};function b(h,M){return M=Math.max(r[0],Math.min(r[1],M)),M===h.k?h:new rt(M,h.x,h.y)}function m(h,M,v){var z=M[0]-v[0]*h.k,I=M[1]-v[1]*h.k;return z===h.x&&I===h.y?h:new rt(h.k,z,I)}function _(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function T(h,M,v,z){h.on("start.zoom",function(){P(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(z).end()}).tween("zoom",function(){var I=this,B=arguments,D=P(I,B).event(z),L=t.apply(I,B),W=v==null?_(L):typeof v=="function"?v.apply(I,B):v,ee=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),Y=I.__zoom,U=typeof M=="function"?M.apply(I,B):M,Q=l(Y.invert(W).concat(ee/Y.k),U.invert(W).concat(ee/U.k));return function(ae){if(ae===1)ae=U;else{var ue=Q(ae),se=ee/ue[2];ae=new rt(se,W[0]-ue[0]*se,W[1]-ue[1]*se)}D.zoom(null,ae)}})}function P(h,M,v){return!v&&h.__zooming||new A(h,M)}function A(h,M){this.that=h,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(h,M),this.taps=0}A.prototype={event:function(h){return h&&(this.sourceEvent=h),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(h,M){return this.mouse&&h!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&h!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&h!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(h){var M=_t(this.that).datum();u.call(h,this.that,new Zy(h,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),M)}};function R(h,...M){if(!e.apply(this,arguments))return;var v=P(this,M).event(h),z=this.__zoom,I=Math.max(r[0],Math.min(r[1],z.k*Math.pow(2,o.apply(this,arguments)))),B=pt(h);if(v.wheel)(v.mouse[0][0]!==B[0]||v.mouse[0][1]!==B[1])&&(v.mouse[1]=z.invert(v.mouse[0]=B)),clearTimeout(v.wheel);else{if(z.k===I)return;v.mouse=[B,z.invert(B)],to(this),v.start()}an(h),v.wheel=setTimeout(D,$),v.zoom("mouse",n(m(b(z,I),v.mouse[0],v.mouse[1]),v.extent,a));function D(){v.wheel=null,v.end()}}function O(h,...M){if(f||!e.apply(this,arguments))return;var v=h.currentTarget,z=P(this,M,!0).event(h),I=_t(h.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",ee,!0),B=pt(h,v),D=h.clientX,L=h.clientY;cm(h.view),Jo(h),z.mouse=[B,this.__zoom.invert(B)],to(this),z.start();function W(Y){if(an(Y),!z.moved){var U=Y.clientX-D,Q=Y.clientY-L;z.moved=U*U+Q*Q>w}z.event(Y).zoom("mouse",n(m(z.that.__zoom,z.mouse[0]=pt(Y,v),z.mouse[1]),z.extent,a))}function ee(Y){I.on("mousemove.zoom mouseup.zoom",null),dm(Y.view,z.moved),an(Y),z.event(Y).end()}}function F(h,...M){if(e.apply(this,arguments)){var v=this.__zoom,z=pt(h.changedTouches?h.changedTouches[0]:h,this),I=v.invert(z),B=v.k*(h.shiftKey?.5:2),D=n(m(b(v,B),z,I),t.apply(this,M),a);an(h),s>0?_t(this).transition().duration(s).call(T,D,z,h):_t(this).call(p.transform,D,z,h)}}function H(h,...M){if(e.apply(this,arguments)){var v=h.touches,z=v.length,I=P(this,M,h.changedTouches.length===z).event(h),B,D,L,W;for(Jo(h),D=0;D<z;++D)L=v[D],W=pt(L,this),W=[W,this.__zoom.invert(W),L.identifier],I.touch0?!I.touch1&&I.touch0[2]!==W[2]&&(I.touch1=W,I.taps=0):(I.touch0=W,B=!0,I.taps=1+!!c);c&&(c=clearTimeout(c)),B&&(I.taps<2&&(d=W[0],c=setTimeout(function(){c=null},g)),to(this),I.start())}}function k(h,...M){if(this.__zooming){var v=P(this,M).event(h),z=h.changedTouches,I=z.length,B,D,L,W;for(an(h),B=0;B<I;++B)D=z[B],L=pt(D,this),v.touch0&&v.touch0[2]===D.identifier?v.touch0[0]=L:v.touch1&&v.touch1[2]===D.identifier&&(v.touch1[0]=L);if(D=v.that.__zoom,v.touch1){var ee=v.touch0[0],Y=v.touch0[1],U=v.touch1[0],Q=v.touch1[1],ae=(ae=U[0]-ee[0])*ae+(ae=U[1]-ee[1])*ae,ue=(ue=Q[0]-Y[0])*ue+(ue=Q[1]-Y[1])*ue;D=b(D,Math.sqrt(ae/ue)),L=[(ee[0]+U[0])/2,(ee[1]+U[1])/2],W=[(Y[0]+Q[0])/2,(Y[1]+Q[1])/2]}else if(v.touch0)L=v.touch0[0],W=v.touch0[1];else return;v.zoom("touch",n(m(D,L,W),v.extent,a))}}function G(h,...M){if(this.__zooming){var v=P(this,M).event(h),z=h.changedTouches,I=z.length,B,D;for(Jo(h),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),B=0;B<I;++B)D=z[B],v.touch0&&v.touch0[2]===D.identifier?delete v.touch0:v.touch1&&v.touch1[2]===D.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(D=pt(D,this),Math.hypot(d[0]-D[0],d[1]-D[1])<y)){var L=_t(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return p.wheelDelta=function(h){return arguments.length?(o=typeof h=="function"?h:Gn(+h),p):o},p.filter=function(h){return arguments.length?(e=typeof h=="function"?h:Gn(!!h),p):e},p.touchable=function(h){return arguments.length?(i=typeof h=="function"?h:Gn(!!h),p):i},p.extent=function(h){return arguments.length?(t=typeof h=="function"?h:Gn([[+h[0][0],+h[0][1]],[+h[1][0],+h[1][1]]]),p):t},p.scaleExtent=function(h){return arguments.length?(r[0]=+h[0],r[1]=+h[1],p):[r[0],r[1]]},p.translateExtent=function(h){return arguments.length?(a[0][0]=+h[0][0],a[1][0]=+h[1][0],a[0][1]=+h[0][1],a[1][1]=+h[1][1],p):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},p.constrain=function(h){return arguments.length?(n=h,p):n},p.duration=function(h){return arguments.length?(s=+h,p):s},p.interpolate=function(h){return arguments.length?(l=h,p):l},p.on=function(){var h=u.on.apply(u,arguments);return h===u?p:h},p.clickDistance=function(h){return arguments.length?(w=(h=+h)*h,p):Math.sqrt(w)},p.tapDistance=function(h){return arguments.length?(y=+h,p):y},p}const rl=Symbol("MiniMapSlots"),n0=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],o0={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},i0=fe({...o0,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:t}){const n=e,o=Vt(rl),i=zi(),r=_e(()=>i.style??{});function a(d){t("click",d)}function s(d){t("dblclick",d)}function l(d){t("mouseenter",d)}function u(d){t("mousemove",d)}function c(d){t("mouseleave",d)}return(d,f)=>!d.hidden&&d.dimensions.width!==0&&d.dimensions.height!==0?(X(),ie(Te,{key:0},[N(o)[`node-${n.type}`]?(X(),ge(Ai(N(o)[`node-${n.type}`]),Ii(st({key:0},{...n,...d.$attrs})),null,16)):(X(),ie("rect",st({key:1,id:d.id},d.$attrs,{class:["vue-flow__minimap-node",{selected:d.selected,dragging:d.dragging}],x:d.position.x,y:d.position.y,rx:d.borderRadius,ry:d.borderRadius,width:d.dimensions.width,height:d.dimensions.height,fill:d.color||r.value.background||r.value.backgroundColor,stroke:d.strokeColor,"stroke-width":d.strokeWidth,"shape-rendering":d.shapeRendering,onClick:a,onDblclick:s,onMouseenter:l,onMousemove:u,onMouseleave:c}),null,16,n0))],64)):Ce("",!0)}}),r0=["width","height","viewBox","aria-labelledby"],a0=["id"],s0=["d","fill","stroke","stroke-width"],l0={name:"MiniMap",compatConfig:{MODE:3}},u0=fe({...l0,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:10},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:t}){const n=Ti(),o=zi(),i=200,r=150,{id:a,edges:s,viewport:l,translateExtent:u,dimensions:c,emits:d,d3Selection:f,d3Zoom:g,getNodesInitialized:$}=$e(),w=ce();Ot(rl,n);const y=_e(()=>{var I;return e.width??((I=o.style)==null?void 0:I.width)??i}),p=_e(()=>{var I;return e.height??((I=o.style)==null?void 0:I.height)??r}),b=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",m=K(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),_=K(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),T=K(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),P=K(()=>Vi($.value.filter(I=>!I.hidden))),A=K(()=>({x:-l.value.x/l.value.zoom,y:-l.value.y/l.value.zoom,width:c.value.width/l.value.zoom,height:c.value.height/l.value.zoom})),R=K(()=>$.value&&$.value.length?ph(P.value,A.value):A.value),O=K(()=>{const I=R.value.width/y.value,B=R.value.height/p.value;return Math.max(I,B)}),F=K(()=>{const I=O.value*y.value,B=O.value*p.value,D=e.offsetScale*O.value;return{offset:D,x:R.value.x-(I-R.value.width)/2-D,y:R.value.y-(B-R.value.height)/2-D,width:I+D*2,height:B+D*2}}),H=K(()=>!F.value.x||!F.value.y?"":`
|
|
27
|
-
M${F.value.x-F.value.offset},${F.value.y-F.value.offset}
|
|
28
|
-
h${F.value.width+F.value.offset*2}
|
|
29
|
-
v${F.value.height+F.value.offset*2}
|
|
30
|
-
h${-F.value.width-F.value.offset*2}z
|
|
31
|
-
M${A.value.x+e.maskBorderRadius},${A.value.y}
|
|
32
|
-
h${A.value.width-2*e.maskBorderRadius}
|
|
33
|
-
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}
|
|
34
|
-
v${A.value.height-2*e.maskBorderRadius}
|
|
35
|
-
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}
|
|
36
|
-
h${-(A.value.width-2*e.maskBorderRadius)}
|
|
37
|
-
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
|
|
38
|
-
v${-(A.value.height-2*e.maskBorderRadius)}
|
|
39
|
-
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);Cl(I=>{if(w.value){const B=_t(w.value),D=ee=>{if(ee.sourceEvent.type!=="wheel"||!f.value||!g.value)return;const Y=-ee.sourceEvent.deltaY*(ee.sourceEvent.deltaMode===1?.05:ee.sourceEvent.deltaMode?1:.002)*e.zoomStep,U=l.value.zoom*2**Y;g.value.scaleTo(f.value,U)},L=ee=>{if(ee.sourceEvent.type!=="mousemove"||!f.value||!g.value)return;const Y=O.value*Math.max(1,l.value.zoom)*(e.inversePan?-1:1),U={x:l.value.x-ee.sourceEvent.movementX*Y,y:l.value.y-ee.sourceEvent.movementY*Y},Q=[[0,0],[c.value.width,c.value.height]],ae=ji.translate(U.x,U.y).scale(l.value.zoom),ue=g.value.constrain()(ae,Q,u.value);g.value.transform(f.value,ue)},W=t0().on("zoom",e.pannable?L:()=>{}).on("zoom.wheel",e.zoomable?D:()=>{});B.call(W),I(()=>{B.on("zoom",null)})}},{flush:"post"});function k(I){const[B,D]=pt(I);t("click",{event:I,position:{x:B,y:D}})}function G(I,B){const D={event:I,node:B,connectedEdges:It([B],s.value)};d.miniMapNodeClick(D),t("nodeClick",D)}function h(I,B){const D={event:I,node:B,connectedEdges:It([B],s.value)};d.miniMapNodeDoubleClick(D),t("nodeDblclick",D)}function M(I,B){const D={event:I,node:B,connectedEdges:It([B],s.value)};d.miniMapNodeMouseEnter(D),t("nodeMouseenter",D)}function v(I,B){const D={event:I,node:B,connectedEdges:It([B],s.value)};d.miniMapNodeMouseMove(D),t("nodeMousemove",D)}function z(I,B){const D={event:I,node:B,connectedEdges:It([B],s.value)};d.miniMapNodeMouseLeave(D),t("nodeMouseleave",D)}return(I,B)=>(X(),ge(N(pp),{position:I.position,class:ze(["vue-flow__minimap",{pannable:I.pannable,zoomable:I.zoomable}])},{default:oe(()=>[(X(),ie("svg",{ref_key:"el",ref:w,width:y.value,height:p.value,viewBox:[F.value.x,F.value.y,F.value.width,F.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${N(a)}`,onClick:k},[I.ariaLabel?(X(),ie("title",{key:0,id:`vue-flow__minimap-${N(a)}`},De(I.ariaLabel),9,a0)):Ce("",!0),(X(!0),ie(Te,null,xt(N($),D=>(X(),ge(i0,{id:D.id,key:D.id,position:D.computedPosition,dimensions:D.dimensions,selected:D.selected,dragging:D.dragging,style:Ee(D.style),class:ze(T.value(D)),color:m.value(D),"border-radius":I.nodeBorderRadius,"stroke-color":_.value(D),"stroke-width":I.nodeStrokeWidth,"shape-rendering":N(b),type:D.type,hidden:D.hidden,onClick:L=>G(L,D),onDblclick:L=>h(L,D),onMouseenter:L=>M(L,D),onMousemove:L=>v(L,D),onMouseleave:L=>z(L,D)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),pe("path",{class:"vue-flow__minimap-mask",d:H.value,fill:I.maskColor,stroke:I.maskStrokeColor,"stroke-width":I.maskStrokeWidth,"fill-rule":"evenodd"},null,8,s0)],8,r0))]),_:1},8,["position","class"]))}}),c0={class:"table-node text-foreground"},d0={class:"flex-1 text-center px-2 box-border text-xl truncate"},f0=["onClick"],h0={class:"col-span-2 py-2 truncate flex items-center gap-1"},g0={class:"w-6 flex items-center justify-center"},p0={class:"truncate"},v0={class:"col-span-1 py-2 truncate text-center text-muted-foreground"},m0=fe({__name:"ValueNode",props:{isExpanded:{type:Boolean},hasRelations:{type:Boolean},id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},emits:["expand","collapse"],setup(e,{emit:t}){const n=e,o=t,{findNode:i,fitView:r,getViewport:a}=$e(),s=K(()=>Ne({schemaName:n.data.schema,tableName:n.data.table})),l=()=>{n.isExpanded?o("collapse",s.value):o("expand",s.value)},u=K(()=>new Set(n.data.primary_keys.map(y=>y.column))),c=K(()=>new Set(n.data.foreign_keys.map(y=>y.column))),d=K(()=>n.data.columns.map(y=>({...y,isPrimary:u.value.has(y.name),isForeign:c.value.has(y.name)}))),f=K(()=>new Map(d.value.map((y,p)=>[y.name,p+1]))),g=K(()=>n.data.foreign_keys.map(({column:y})=>{const p=f.value.get(y);return{id:y,top:Wr(p)}})),$=K(()=>n.data.primary_keys.map(({column:y})=>{const p=f.value.get(y);return{id:y,top:Wr(p)}})),w=y=>{if(!y.isForeign)return;const p=n.data.foreign_keys.find(m=>m.column===y.name);if(!p)return;const b=Ne({schemaName:p.reference_schema,tableName:p.reference_table});wi({nodeId:b,findNode:i,fitView:r,getViewport:a})};return(y,p)=>{const b=Pe,m=We;return X(),ie("div",c0,[pe("div",{class:"flex flex-col rounded-md bg-card",style:Ee({width:N(Ca)+"px"})},[pe("div",{class:"rounded-t-md box-border p-2 bg-primary dark:bg-accent text-primary-foreground dark:text-foreground flex items-center justify-between gap-2",style:Ee({height:N($t)+10+"px"})},[pe("p",d0,De(y.data.table)+" "+De(y.data.schema==="public"?"":`(${y.data.schema})`),1),y.hasRelations?(X(),ge(m,{key:0,size:"iconMd",title:y.isExpanded?"Collapse related tables":"Expand related tables",onClick:bt(l,["stop"])},{default:oe(()=>[Z(b,{name:y.isExpanded?"hugeicons:remove-circle":"hugeicons:add-circle",class:"w-5 h-5"},null,8,["name"])]),_:1},8,["title"])):Ce("",!0)],4),(X(!0),ie(Te,null,xt(d.value,_=>{var T;return X(),ie("div",{key:_.name,class:ze(["grid grid-cols-3 px-2 border-t border-border bg-card transition-colors",_.isForeign&&"cursor-pointer hover:bg-primary/10",((T=y.label)==null?void 0:T.get(_.name))&&"bg-primary/10"]),style:Ee({height:N($t)+"px"}),onClick:P=>w(_)},[pe("div",h0,[pe("div",g0,[_.isPrimary?(X(),ge(b,{key:0,name:"hugeicons:key-01",class:"w-4 text-yellow-400 dark:text-yellow-300 text-xl"})):_.isForeign?(X(),ge(b,{key:1,name:"hugeicons:key-01",class:"min-w-4 text-muted-foreground text-xl"})):_.nullable?(X(),ge(b,{key:2,name:"hugeicons:diamond",class:"min-w-4 text-muted-foreground/60"})):(X(),ge(b,{key:3,name:"mynaui:diamond-solid",class:"min-w-4 text-muted-foreground/60"}))]),pe("p",p0,De(_.name),1),_.isForeign?(X(),ge(b,{key:0,name:"hugeicons:link-04",class:"min-w-3 text-muted-foreground"})):Ce("",!0)]),pe("div",v0,De(_.type),1)],14,f0)}),128))],4),(X(!0),ie(Te,null,xt(g.value,_=>(X(),ge(N(Jt),{key:_.id,type:"source",id:_.id,position:N(te).Left,connectable:!1,style:Ee({top:_.top+"px",left:N(or),height:N(nr),opacity:0})},null,8,["id","position","style"]))),128)),(X(!0),ie(Te,null,xt($.value,_=>(X(),ge(N(Jt),{key:_.id,type:"target",id:_.id,position:N(te).Right,connectable:!1,style:Ee({top:_.top+"px",right:N(or),height:N(nr),opacity:0})},null,8,["id","position","style"]))),128))])}}}),y0=kl(m0,[["__scopeId","data-v-5e32844c"]]),w0={class:"absolute bottom-1 z-10 left-1/2 -translate-x-1/2 w-fit h-10 bg-background box-border border-2 border-border rounded-lg p-1 flex flex-row gap-0.5"},_0={class:"w-7 h-7 text-center py-0.5 text-sm flex items-center justify-center"},b0=fe({__name:"ErdControls",props:{isHand:{type:Boolean},isUseBgGrid:{type:[String,Boolean]},isUseMiniMap:{type:Boolean},isShowFilter:{type:Boolean}},emits:["update:isHand","update:isUseBgGrid","update:isUseMiniMap","update:isShowFilter","arrange"],setup(e,{emit:t}){const n=e,{zoomIn:o,zoomOut:i,fitView:r,getViewport:a}=$e(),s=t,l=K(()=>Math.round(a().zoom*100)),u=()=>s("update:isHand",!n.isHand),c=()=>{if(!n.isUseBgGrid){s("update:isUseBgGrid","dots");return}if(n.isUseBgGrid==="dots"){s("update:isUseBgGrid","lines");return}s("update:isUseBgGrid",!1)},d=()=>s("update:isUseMiniMap",!n.isUseMiniMap),f=()=>s("update:isShowFilter",!n.isShowFilter),g=()=>s("arrange"),$=()=>i({duration:Kn}),w=()=>o({duration:Kn}),y=()=>r({duration:Kn});return(p,b)=>(X(),ie("div",w0,[Z(N(ct),null,{default:oe(()=>[Z(N(dt),{"as-child":""},{default:oe(()=>[Z(N(We),{variant:p.isUseBgGrid?"secondary":"ghost",size:"iconMd",onClick:b[0]||(b[0]=m=>c())},{default:oe(()=>[Z(N(Pe),{name:"hugeicons:grid",class:"size-4!"})]),_:1},8,["variant"])]),_:1}),Z(N(ft),null,{default:oe(()=>[He(De(p.isUseBgGrid?"Hide grid":"Show grid"),1)]),_:1})]),_:1}),Z(N(ct),null,{default:oe(()=>[Z(N(dt),{"as-child":""},{default:oe(()=>[Z(N(We),{variant:p.isUseMiniMap?"secondary":"ghost",size:"iconMd",onClick:b[1]||(b[1]=m=>d())},{default:oe(()=>[Z(N(Pe),{name:"hugeicons:dashboard-circle",class:"size-4"})]),_:1},8,["variant"])]),_:1}),Z(N(ft),null,{default:oe(()=>[He(De(p.isUseMiniMap?"Hide minimap":"Show minimap"),1)]),_:1})]),_:1}),Z(N(ct),null,{default:oe(()=>[Z(N(dt),{"as-child":""},{default:oe(()=>[Z(N(We),{variant:p.isHand?"secondary":"ghost",size:"iconMd",onClick:b[2]||(b[2]=m=>u())},{default:oe(()=>[p.isHand?(X(),ge(N(Pe),{key:1,name:"hugeicons:hold-04",class:"size-4!"})):(X(),ge(N(Pe),{key:0,name:"hugeicons:hold-03",class:"size-4!"}))]),_:1},8,["variant"])]),_:1}),Z(N(ft),null,{default:oe(()=>b[4]||(b[4]=[He("Click to enable pan mode "),pe("br",null,null,-1),He(" Or hold Space/Middle mouse + drag to pan")])),_:1})]),_:1}),Z(N(Zr),{orientation:"vertical",class:"mx-1.5"}),Z(N(ct),null,{default:oe(()=>[Z(N(dt),{"as-child":""},{default:oe(()=>[Z(N(We),{variant:"ghost",size:"iconMd",onClick:$},{default:oe(()=>[Z(N(Pe),{name:"hugeicons:minus-sign",class:"size-4!"})]),_:1})]),_:1}),Z(N(ft),null,{default:oe(()=>b[5]||(b[5]=[He("Zoom out")])),_:1})]),_:1}),pe("div",_0,De(N(l)),1),Z(N(ct),null,{default:oe(()=>[Z(N(dt),{"as-child":""},{default:oe(()=>[Z(N(We),{variant:"ghost",size:"iconMd",onClick:w},{default:oe(()=>[Z(N(Pe),{name:"hugeicons:add-01",class:"size-4!"})]),_:1})]),_:1}),Z(N(ft),null,{default:oe(()=>b[6]||(b[6]=[He("Zoom in")])),_:1})]),_:1}),Z(N(Zr),{orientation:"vertical",class:"mx-1.5"}),Z(N(ct),null,{default:oe(()=>[Z(N(dt),{"as-child":""},{default:oe(()=>[Z(N(We),{variant:"ghost",size:"iconMd",onClick:y},{default:oe(()=>[Z(N(Pe),{name:"hugeicons:center-focus",class:"size-4!"})]),_:1})]),_:1}),Z(N(ft),null,{default:oe(()=>b[7]||(b[7]=[He("Fit to view")])),_:1})]),_:1}),Z(N(ct),null,{default:oe(()=>[Z(N(dt),{"as-child":""},{default:oe(()=>[Z(N(We),{variant:"ghost",size:"iconMd",onClick:g},{default:oe(()=>[Z(N(Pe),{name:"hugeicons:coordinate-01",class:"size-4!"})]),_:1})]),_:1}),Z(N(ft),null,{default:oe(()=>b[8]||(b[8]=[He("Arrange the diagram")])),_:1})]),_:1}),Z(N(ct),null,{default:oe(()=>[Z(N(dt),{"as-child":""},{default:oe(()=>[Z(N(We),{variant:p.isShowFilter?"secondary":"ghost",size:"iconMd",onClick:b[3]||(b[3]=m=>f())},{default:oe(()=>[Z(N(Pe),{name:"hugeicons:filter",class:"size-4"})]),_:1},8,["variant"])]),_:1}),Z(N(ft),null,{default:oe(()=>[He(De(p.isShowFilter?"Hide filter":"Show filter")+" ",1),Z(N(hu),null,{default:oe(()=>[Z(N(ir),null,{default:oe(()=>b[9]||(b[9]=[He("⌘")])),_:1}),Z(N(ir),null,{default:oe(()=>b[10]||(b[10]=[He("f")])),_:1})]),_:1})]),_:1})]),_:1})]))}}),x0=["id","markerWidth","markerHeight"],$0=["fill"],E0=["fill"],S0=fe({__name:"MarkerMany",props:{id:{},fill:{default:"#b1b1b7"},strokeWidth:{default:1.5},width:{default:24},height:{default:24}},setup(e){return(t,n)=>(X(),ie("marker",{id:t.id,viewBox:"0 0 24 24",refX:"2",refY:"8",markerWidth:t.width,markerHeight:t.height,orient:"0",markerUnits:"userSpaceOnUse"},[pe("path",{style:Ee({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M23.2381 1.93974C23.481 1.80822 23.5712 1.50476 23.4396 1.26195C23.3081 1.01914 23.0047 0.928928 22.7619 1.06045L10.7619 7.56045C10.6063 7.64471 10.5068 7.80491 10.5003 7.98171C10.4938 8.15851 10.5817 8.32587 10.7306 8.42134L10.7532 8.43574L10.8193 8.47786C10.8773 8.51474 10.9627 8.5689 11.0728 8.63831C11.293 8.77712 11.6121 8.97693 12.0083 9.22151C12.8004 9.71055 13.9017 10.379 15.1381 11.0967C17.6 12.5258 20.6347 14.172 22.8291 14.97C23.0886 15.0644 23.3755 14.9305 23.4699 14.671C23.5643 14.4115 23.4304 14.1246 23.1709 14.0302C21.0695 13.2661 18.1042 11.6623 15.6401 10.2319C14.5191 9.58119 13.5096 8.97094 12.7436 8.5H23.3333C23.6095 8.5 23.8333 8.27614 23.8333 8C23.8333 7.72386 23.6095 7.5 23.3333 7.5H12.973L23.2381 1.93974ZM11 8.0001L10.7306 8.42134C10.7306 8.42134 10.7302 8.42105 11 8.0001Z"},null,12,$0),pe("path",{style:Ee({strokeWidth:t.strokeWidth}),d:"M6.665 13.16C9.24141 13.16 11.33 11.0714 11.33 8.495C11.33 5.91859 9.24141 3.83 6.665 3.83C4.08859 3.83 2 5.91859 2 8.495C2 11.0714 4.08859 13.16 6.665 13.16Z",fill:"transparent"},null,4),pe("path",{style:Ee({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M6.665 4.33C4.36473 4.33 2.5 6.19473 2.5 8.495C2.5 10.7953 4.36473 12.66 6.665 12.66C8.96527 12.66 10.83 10.7953 10.83 8.495C10.83 6.19473 8.96527 4.33 6.665 4.33ZM1.5 8.495C1.5 5.64245 3.81245 3.33 6.665 3.33C9.51755 3.33 11.83 5.64245 11.83 8.495C11.83 11.3476 9.51755 13.66 6.665 13.66C3.81245 13.66 1.5 11.3476 1.5 8.495Z"},null,12,E0)],8,x0))}}),N0=["id","markerWidth","markerHeight"],C0=["fill"],k0=["fill"],M0=["fill"],I0=fe({__name:"MarkerZeroOrOne",props:{id:{},fill:{default:"#b1b1b7"},strokeWidth:{default:1.5},width:{default:24},height:{default:24}},setup(e){return(t,n)=>(X(),ie("marker",{id:t.id,viewBox:"0 0 24 24",refX:"2",refY:"8",markerWidth:t.width,markerHeight:t.height,orient:"180",markerUnits:"userSpaceOnUse"},[pe("path",{style:Ee({strokeWidth:t.strokeWidth}),d:"M6.665 12.6601C9.24141 12.6601 11.33 10.5715 11.33 7.99508C11.33 5.41867 9.24141 3.33008 6.665 3.33008C4.08859 3.33008 2 5.41867 2 7.99508C2 10.5715 4.08859 12.6601 6.665 12.6601Z",fill:"transparent"},null,4),pe("path",{style:Ee({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M6.665 3.83008C4.36473 3.83008 2.5 5.69481 2.5 7.99508C2.5 10.2953 4.36473 12.1601 6.665 12.1601C8.96527 12.1601 10.83 10.2953 10.83 7.99508C10.83 5.69481 8.96527 3.83008 6.665 3.83008ZM1.5 7.99508C1.5 5.14253 3.81245 2.83008 6.665 2.83008C9.51755 2.83008 11.83 5.14253 11.83 7.99508C11.83 10.8476 9.51755 13.1601 6.665 13.1601C3.81245 13.1601 1.5 10.8476 1.5 7.99508Z"},null,12,C0),pe("path",{style:Ee({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M16 2.83008C16.2761 2.83008 16.5 3.05394 16.5 3.33008V12.6634C16.5 12.9396 16.2761 13.1634 16 13.1634C15.7239 13.1634 15.5 12.9396 15.5 12.6634V3.33008C15.5 3.05394 15.7239 2.83008 16 2.83008Z"},null,12,k0),pe("path",{style:Ee({strokeWidth:t.strokeWidth}),fill:t.fill,d:"M23.5 7.5H11V8.5H23.5V7.5Z"},null,12,M0)],8,N0))}}),T0=fe({__name:"CustomEdge",props:{id:{},sourceNode:{},targetNode:{},source:{},target:{},type:{},label:{},style:{},selected:{type:Boolean},sourcePosition:{},targetPosition:{},sourceHandleId:{},targetHandleId:{},animated:{type:Boolean},updatable:{type:Boolean},markerStart:{},markerEnd:{},curvature:{},interactionWidth:{},data:{},events:{},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{},sourceX:{},sourceY:{},targetX:{},targetY:{}},setup(e){const t=e,n=K(()=>Gi({sourceX:t.sourceX,sourceY:t.sourceY,sourcePosition:t.sourcePosition,targetX:t.targetX,targetY:t.targetY,targetPosition:t.targetPosition,curvature:.6})),o=K(()=>`${t.id}-marker-zero-or-one`),i=K(()=>`${t.id}-marker-many`),r=K(()=>{var s,l;return((s=t.sourceNode)==null?void 0:s.selected)||((l=t.targetNode)==null?void 0:l.selected)||t.animated?"var(--color-primary)":"var(--color-zinc-400)"});return(a,s)=>(X(),ie(Te,null,[Z(N(Mn),{id:a.id,path:n.value[0],"marker-start":`url(#${i.value})`,"marker-end":`url(#${o.value})`,style:Ee({stroke:r.value,strokeWidth:a.animated?3:1.5})},null,8,["id","path","marker-start","marker-end","style"]),Z(I0,{fill:r.value,"stroke-width":1.5,width:30,height:30,id:o.value},null,8,["fill","id"]),Z(S0,{fill:r.value,"stroke-width":1.5,width:30,height:30,id:i.value},null,8,["fill","id"])],64))}}),A0=["onClick"],z0={class:"flex items-center flex-1 min-w-0"},P0=["onClick"],D0={key:1,class:"size-4"},B0={key:3,class:"pl-1 truncate font-normal"},O0={key:4,class:"pl-1 w-full"},R0={key:0,class:"flex-shrink-0"},F0="lucide:folder",jo=24,H0=fe({__name:"TreeFolder",props:{explorerFiles:{},expandedState:{},selectedItems:{},isShowArrow:{type:Boolean},isExpandedByArrow:{type:Boolean},onRightClickItem:{type:Function},onClickTreeItem:{type:Function}},emits:["update:expandedState","update:selectedItems"],setup(e,{expose:t,emit:n}){const o=n,i=Ml("treeRootRef"),{y:r}=Il(i),a=u=>{o("update:expandedState",u)},s=u=>{o("update:selectedItems",u)};t({treeRootRef:i});const l=ce();return Tl(()=>{var u,c,d;(d=(c=(u=i.value)==null?void 0:u.$el)==null?void 0:c.scrollTo)==null||d.call(c,0,r.value)}),(u,c)=>(X(),ge(N(au),{"onUpdate:modelValue":c[1]||(c[1]=d=>s(d)),class:"list-none h-full overflow-y-auto select-none px-1 text-sm font-medium custom-scrollbar mr-1",items:u.explorerFiles,"get-key":d=>d.path,expanded:u.expandedState,"onUpdate:expanded":a,ref_key:"treeRootRef",ref:i},{default:oe(()=>[Z(N(fu),{"estimate-size":jo,overscan:5},{default:oe(({item:d})=>[(X(),ge(N(cu),st({key:d._id,style:{"padding-left":`${d.level-.5}rem`,height:`${jo}px !important`}},d.bind,{onContextmenu:bt(f=>{var g;(g=u.onRightClickItem)==null||g.call(u,f,d)},["right"]),onSelect:c[0]||(c[0]=f=>{f.detail.originalEvent.type==="click"&&f.preventDefault()}),class:"w-full data-[selected]:bg-accent cursor-pointer rounded outline-none hover:bg-accent/60"}),{default:oe(({isExpanded:f,handleToggle:g,handleSelect:$,isSelected:w})=>[pe("div",{class:"flex items-center justify-between w-full flex-wrap",style:Ee({height:`${jo}px`}),onClick:[bt(y=>{y.stopImmediatePropagation(),$()},["shift"]),async y=>{var p;if(l.value=[],await u.$nextTick(),$(),d.value.status===N(Oo).edit){y.stopImmediatePropagation(),y.stopPropagation(),y.preventDefault();return}(p=u.onClickTreeItem)==null||p.call(u,y,d),u.isExpandedByArrow&&y.stopImmediatePropagation()}]},[pe("div",z0,[u.isShowArrow?(X(),ie("div",{key:0,class:"pr-1 flex-shrink-0",onClick:y=>{u.isExpandedByArrow&&(y.stopImmediatePropagation(),g())}},[d.hasChildren?(X(),ge(N(An),{key:0,icon:"lucide:chevron-right",class:ze({"rotate-90":f,"size-4 min-w-4 transition-all":!0,"hover:bg-background hover:shadow hover:rounded":!0})},null,8,["class"])):(X(),ie("div",D0))],8,P0)):Ce("",!0),d.hasChildren?(X(),ie(Te,{key:1},[f?(X(),ge(N(An),{key:1,icon:d.value.icon,class:ze(["size-4 min-w-4",d.value.iconClass])},null,8,["icon","class"])):(X(),ge(N(An),{key:0,icon:d.value.closeIcon||F0,class:ze(["size-4 min-w-4",d.value.iconClass])},null,8,["icon","class"]))],64)):(X(),ge(N(An),{key:2,icon:d.value.icon,class:ze(["size-4 min-w-4",d.value.iconClass])},null,8,["icon","class"])),d.value.status!==N(Oo).edit?(X(),ie("div",B0,De(d.value.title),1)):(X(),ie("div",O0,[Ae(u.$slots,"edit-inline",{item:d})]))]),d.value.status!==N(Oo).edit?(X(),ie("div",R0,[Ae(u.$slots,"extra-actions",{item:d})])):Ce("",!0)],12,A0)]),_:2},1040,["style","onContextmenu"]))]),_:3})]),_:3},8,["items","get-key","expanded"]))}}),V0={class:"px-2 pt-2 flex flex-col h-full w-full"},L0={class:"text-base font-normal"},Y0={class:"relative w-full pt-2 mb-2"},G0={class:"h-full w-[19rem] overflow-y-auto"},X0=fe({__name:"ErdFilterPanal",props:{isShowFilter:{type:Boolean},tables:{},tableId:{}},emits:["update:isShowFilter","focusTable"],setup(e,{emit:t}){const n=e,o=t,i=Al(""),r=zl(i,Bl),a=K(()=>Dl(n.tableId||"")),s=K(()=>{const u=[];return n.tables.forEach(c=>{if(!c.table.toLowerCase().includes(r.value.toLowerCase()))return;const d=Ne({schemaName:c.schema,tableName:c.table}),f={title:c.table,id:d,icon:"vscode-icons:file-type-sql",closeIcon:"vscode-icons:file-type-sql",path:d,isFolder:!1};u.push(f)}),u}),l=(u,c)=>{const{value:d}=c;o("focusTable",d.id)};return(u,c)=>{const d=Pl,f=We,g=H0;return X(),ie("div",{class:ze(["flex flex-col h-full bg-background absolute right-0 top-0 shadow transition-all ease-in-out",[u.isShowFilter?"w-[20rem]":"w-[0rem]"]])},[pe("div",{class:"w-5 h-8 absolute -left-5 top-2 cursor-pointer bg-background border border-r-0 rounded-l-md flex-col justify-center flex items-center",onClick:c[0]||(c[0]=$=>o("update:isShowFilter",!u.isShowFilter))},[u.isShowFilter?(X(),ge(N(Pe),{key:0,name:"hugeicons:arrow-right-01",class:"size-5!"})):(X(),ge(N(Pe),{key:1,name:"hugeicons:arrow-left-01",class:"size-5!"}))]),pe("div",V0,[pe("div",null,[pe("h1",L0,De(N(a).tableName),1),c[4]||(c[4]=pe("p",{class:"text-muted-foreground text-sm"}," This view only show this table and relations ",-1))]),pe("div",Y0,[Z(d,{type:"text",placeholder:"Search tables",class:"pr-6 w-full h-8",modelValue:N(i),"onUpdate:modelValue":c[1]||(c[1]=$=>at(i)?i.value=$:null)},null,8,["modelValue"]),N(i)?(X(),ie("div",{key:0,class:"absolute right-2 top-3.5 w-4 cursor-pointer hover:bg-accent",onClick:c[2]||(c[2]=$=>i.value="")},[Z(N(Pe),{name:"lucide:x",class:"stroke-3! text-muted-foreground"})])):Ce("",!0)]),pe("div",G0,[Z(g,{class:"overflow-x-hidden",explorerFiles:N(s),"onUpdate:explorerFiles":c[3]||(c[3]=$=>at(s)?s.value=$:null),isShowArrow:!1,isExpandedByArrow:!1,onClickTreeItem:l},{"extra-actions":oe(()=>[Z(f,{size:"iconSm",class:"hover:bg-background",variant:"ghost"},{default:oe(()=>[Z(N(Pe),{name:"hugeicons:dashed-line-circle",class:"size-4! min-w-4 text-muted-foreground"})]),_:1})]),_:1},8,["explorerFiles"])])])],2)}}});function U0(e){const t=ce(!1),n=ce(!0),o=ce("dots"),i=ce({tableId:"",relatedColumnIds:new Set,edgeIds:new Set}),r=ce({edgeId:"",sourceId:"",targetId:""}),{getEdges:a,findEdge:s,findNode:l,fitView:u,getViewport:c,getNodes:d}=$e(),f=T=>{if(!e.focusTableId)return;const P=T.findNode(e.focusTableId);if(!P)return;const A=new Set,R=new Set,O=!0;P.selected=!0,a.value.forEach(F=>{if(F.sourceNode.id===P.id||F.targetNode.id===P.id){const H=yt(F.sourceNode.id,F.sourceHandle),k=yt(F.targetNode.id,F.targetHandle);R.add(H),R.add(k),A.add(F.id),kt(F,O,i.value,r.value)}}),i.value={tableId:P.id,edgeIds:A,relatedColumnIds:R}},g=T=>{T.sort((A,R)=>Number(A.selected)-Number(R.selected)).forEach(A=>{if(A.type!=="select")return;const R=A.selected;a.value.forEach(O=>{var G,h,M,v,z,I;if(!(O.sourceNode.id===A.id||O.targetNode.id===A.id))return;const H=yt(O.sourceNode.id,O.sourceHandle),k=yt(O.targetNode.id,O.targetHandle);R?((G=i.value)==null||G.relatedColumnIds.add(H),(h=i.value)==null||h.relatedColumnIds.add(k),(M=i.value)==null||M.edgeIds.add(O.id)):((v=i.value)==null||v.relatedColumnIds.delete(H),(z=i.value)==null||z.relatedColumnIds.delete(k),(I=i.value)==null||I.edgeIds.delete(O.id)),kt(O,R,i.value,r.value)})})};return{isUseBgGrid:o,isUseMiniMap:n,isHand:t,activeTable:i,activeEdge:r,onInitVueFlow:f,onNodesChange:g,onEdgesChange:T=>{T.forEach(P=>{if(P.type!=="select")return;const A=s(P.id);if(!A)return;const R=P.selected,O=yt(A.sourceNode.id,A.sourceHandle),F=yt(A.targetNode.id,A.targetHandle);r.value=R?{edgeId:P.id,sourceId:O,targetId:F}:null,kt(A,R,i.value,r.value)})},onNodeMouseEnter:({node:T})=>{T.selected||a.value.forEach(P=>{(P.sourceNode.id===T.id||P.targetNode.id===T.id)&&kt(P,!0,i.value,r.value)})},onNodeMouseLeave:({node:T})=>{T.selected||a.value.forEach(P=>{(P.sourceNode.id===T.id||P.targetNode.id===T.id)&&kt(P,!1,i.value,r.value)})},handleEdgeMouseEnter:({edge:T})=>{T.selected||kt(T,!0,i.value,r.value)},handleEdgeMouseLeave:({edge:T})=>{T.selected||kt(T,!1,i.value,r.value)},onDoubleClickEdge:({edge:T})=>{T.selected=!0,wi({nodeId:T.source,findNode:l,fitView:u,getViewport:c})},getNodes:d,fitView:u,onfocusNode:T=>{wi({nodeId:T,findNode:l,fitView:u,getViewport:c});const P=l(T);P&&(P.selected=!0,g([{id:T,type:"select",selected:!0}]))}}}const K0=fe({__name:"ErdDiagram",props:{nodes:{},edges:{},focusTableId:{},isShowFilter:{type:Boolean},matrixTablePosition:{},tables:{},tableId:{},isExpanded:{type:Function},hasRelations:{type:Function}},emits:["update:isShowFilter","expand","collapse"],setup(e,{emit:t}){const{width:n,height:o}=Fl(),i=e,r=t,{onInitVueFlow:a,onNodesChange:s,onEdgesChange:l,onNodeMouseEnter:u,onNodeMouseLeave:c,handleEdgeMouseEnter:d,handleEdgeMouseLeave:f,onDoubleClickEdge:g,isHand:$,isUseBgGrid:w,isUseMiniMap:y,getNodes:p,fitView:b,onfocusNode:m}=U0(i),_=()=>{var T;(T=p.value)==null||T.forEach(P=>{var R;const A=(R=i.matrixTablePosition)==null?void 0:R[P.id];A&&(P.position=A)}),b({duration:Kn})};return(T,P)=>(X(),ie(Te,null,[Z(N(hp),{class:"erd-flow w-full","pan-on-drag":N($),"pan-on-scroll":!0,"pan-on-scroll-speed":1.2,nodes:i.nodes,edges:i.edges,"default-viewport":{zoom:N(Hl),x:N(n)/2-N(Ca)/2,y:N(o)/2-200},"min-zoom":N(Rl),"max-zoom":N(Ol),onInit:N(a),onNodeMouseEnter:N(u),onNodeMouseLeave:N(c),onEdgeMouseEnter:N(d),onEdgeMouseLeave:N(f),onNodesChange:N(s),onEdgesChange:N(l),onEdgeDoubleClick:N(g)},{"edge-custom":oe(A=>[Z(T0,Ii(pa(A)),null,16)]),"node-value":oe(A=>{var R,O;return[Z(y0,st(A,{isExpanded:(R=i.isExpanded)==null?void 0:R.call(i,N(Ne)({schemaName:A.data.schema,tableName:A.data.table})),hasRelations:(O=i.hasRelations)==null?void 0:O.call(i,N(Ne)({schemaName:A.data.schema,tableName:A.data.table})),onExpand:P[0]||(P[0]=F=>r("expand",F)),onCollapse:P[1]||(P[1]=F=>r("collapse",F))}),null,16,["isExpanded","hasRelations"])]}),default:oe(()=>[N(w)?(X(),ge(N(Cp),{key:0,size:2,gap:30,variant:N(w)},null,8,["variant"])):Ce("",!0),N(y)?(X(),ge(N(u0),{key:1,pannable:"",position:"top-right","node-color":"var(--primary)",nodeBorderRadius:10})):Ce("",!0),Z(b0,{isShowFilter:i.isShowFilter,isHand:N($),"onUpdate:isHand":P[2]||(P[2]=A=>at($)?$.value=A:null),isUseBgGrid:N(w),"onUpdate:isUseBgGrid":P[3]||(P[3]=A=>at(w)?w.value=A:null),isUseMiniMap:N(y),"onUpdate:isUseMiniMap":P[4]||(P[4]=A=>at(y)?y.value=A:null),"onUpdate:isShowFilter":P[5]||(P[5]=A=>r("update:isShowFilter",A)),onArrange:_},null,8,["isShowFilter","isHand","isUseBgGrid","isUseMiniMap"])]),_:1},8,["pan-on-drag","nodes","edges","default-viewport","min-zoom","max-zoom","onInit","onNodeMouseEnter","onNodeMouseLeave","onEdgeMouseEnter","onEdgeMouseLeave","onNodesChange","onEdgesChange","onEdgeDoubleClick"]),Z(X0,{isShowFilter:i.isShowFilter,"onUpdate:isShowFilter":[P[6]||(P[6]=A=>i.isShowFilter=A),P[7]||(P[7]=A=>r("update:isShowFilter",A))],"table-id":i.tableId,tables:i.tables,onFocusTable:N(m)},null,8,["isShowFilter","table-id","tables","onFocusTable"])],64))}}),W0=Vl("erdStore",()=>{const e=ce(""),t=ce([]);function n(i){t.value=i}function o(i){e.value=i}return{currentConnectionId:e,tables:t,setTables:n,setCurrentConnectionId:o}},{persist:!1}),Z0=()=>{var a;const{connectionStore:e}=Ll(),t=W0();if(t.tables.length>0&&((a=e.selectedConnection)==null?void 0:a.id)===t.currentConnectionId)return{isFetching:!1,tableSchema:_e(t.tables||[])};const{data:n,status:o}=Jl("/api/metadata/erd",{method:"POST",body:{...Yl(e.selectedConnection)},onResponseError({response:s}){Gl(s==null?void 0:s.statusText)},onResponse:({response:s})=>{var u;const l=s._data.tables||[];t.setTables(l),t.setCurrentConnectionId(((u=e.selectedConnection)==null?void 0:u.id)||"")}},"$13ug5ALprk"),i=K(()=>o.value==="pending"),r=K(()=>{var s;return((s=n.value)==null?void 0:s.tables)||[]});return{isFetching:i,tableSchema:r}},{HORIZONTAL_STEP:ei,VERTICAL_STEP:ga}=Na,ti=(e,t)=>{const n=new Map(t.map(a=>[Ne({schemaName:a.schema,tableName:a.table}),a])),o=n.get(e);if(!o)return{leftTables:[],rightTables:[]};const i=[];for(const a of o.foreign_keys){const s=Ne({schemaName:a.reference_schema,tableName:a.reference_table}),l=n.get(s);l&&s!==e&&i.push(l)}const r=[];for(const a of t)if(Ne({schemaName:a.schema,tableName:a.table})!==e){for(const l of a.foreign_keys)if(Ne({schemaName:l.reference_schema,tableName:l.reference_table})===e){r.push(a);break}}return{leftTables:i,rightTables:r}},q0=({mapTablesData:e,startId:t})=>{const n={},o=[{id:t,depth:0}],i=new Set;for(;o.length>0;){const{id:r,depth:a}=o.shift();if(i.has(r))continue;i.add(r),n[r]=a;const s=e.get(r);if(s)for(const l of s.foreign_keys){const u=Ne({schemaName:l.reference_schema,tableName:l.reference_table});e.has(u)&&!i.has(u)&&o.push({id:u,depth:a+1})}}return n},al=({mapTablesData:e,currentWeight:t,currentLeafId:n,currentMatrix:o,visited:i=new Set})=>{if(i.has(n)||(i.add(n),!e.get(n)))return o;o[n]=t+1;for(const[a,s]of e.entries())for(const l of s.foreign_keys)Ne({schemaName:l.reference_schema,tableName:l.reference_table})===n&&!i.has(a)&&al({mapTablesData:e,currentWeight:o[n],currentLeafId:a,currentMatrix:o,visited:i});return o};function Q0(e){const{allTables:t,initialTableId:n,autoExpandInitial:o=!0}=e,i=ce(new Set),r=ce(new Set),a=ce(new Map),s=ce({}),l=ce(new Map),u=_=>{if(r.value.clear(),i.value.clear(),a.value.clear(),s.value={},l.value.clear(),!o){r.value.add(_),s.value[_]={x:0,y:0};return}const T=Xl(_,t.value);if(!T)return;const{nodes:P}=Ul(T);for(const A of P)r.value.add(A.id),s.value[A.id]=A.position,a.value.set(A.id,new Set(["__initial__"]));i.value.add(_),d()},c=()=>{if(r.value.clear(),i.value.clear(),a.value.clear(),s.value={},l.value.clear(),t.value.length===0)return;const{nodes:_,edges:T,centerId:P}=_p(t.value);for(const A of _)r.value.add(A.id),s.value[A.id]=A.position,a.value.set(A.id,new Set(["__initial__"]));P&&i.value.add(P),d()},d=()=>{var T;l.value.clear();const _=new Map;for(const[P,A]of Object.entries(s.value)){const R=t.value.find(O=>Ne({schemaName:O.schema,tableName:O.table})===P);if(R){const O=rr((T=R.columns)==null?void 0:T.length)+ga,F=Math.round(A.x/ei);_.has(F)||_.set(F,[]),_.get(F).push({y:A.y,height:O})}}for(const[P,A]of _.entries()){const R=Math.max(...A.map(O=>O.y+O.height));l.value.set(P,R)}},f=(_,T,P)=>{var v;const A=rr((v=_.columns)==null?void 0:v.length)+ga,R=new Map(t.value.map(z=>[Ne({schemaName:z.schema,tableName:z.table}),z])),O=Ne({schemaName:_.schema,tableName:_.table});let F=1;if(P==="left")F=(q0({mapTablesData:R,startId:O})[O]??0)+1;else{const z={};al({mapTablesData:R,currentWeight:0,currentLeafId:O,currentMatrix:z}),F=z[O]??1}const H=s.value[T]||{x:0},k=Math.round(H.x/ei),G=P==="left"?k-F:k+F,h=G*ei,M=l.value.get(G)??0;return l.value.set(G,M+A),{x:h,y:M}};xe([n,t],([_,T])=>{T.length!==0&&(_?u(_):c())},{immediate:!0});const g=K(()=>t.value.filter(_=>{const T=Ne({schemaName:_.schema,tableName:_.table});return r.value.has(T)})),$=K(()=>Ea(g.value,s.value)),w=K(()=>Sa(g.value).filter(T=>r.value.has(T.source)&&r.value.has(T.target))),y=_=>{const{leftTables:T,rightTables:P}=ti(_,t.value);return T.length>0||P.length>0},p=_=>i.value.has(_),b=_=>{if(i.value.has(_))return;const{leftTables:T,rightTables:P}=ti(_,t.value);T.forEach(A=>{const R=Ne({schemaName:A.schema,tableName:A.table});a.value.has(R)||a.value.set(R,new Set),a.value.get(R).add(_),!r.value.has(R)&&(r.value.add(R),s.value[R]=f(A,_,"left"))}),P.forEach(A=>{const R=Ne({schemaName:A.schema,tableName:A.table});a.value.has(R)||a.value.set(R,new Set),a.value.get(R).add(_),!r.value.has(R)&&(r.value.add(R),s.value[R]=f(A,_,"right"))}),i.value.add(_)},m=_=>{if(!i.value.has(_))return;const{leftTables:T,rightTables:P}=ti(_,t.value),A=[...T,...P];for(const R of A){const O=Ne({schemaName:R.schema,tableName:R.table}),F=a.value.get(O);F&&(F.delete(_),F.size===0&&O!==n.value&&(r.value.delete(O),delete s.value[O],a.value.delete(O),i.value.has(O)&&m(O)))}i.value.delete(_)};return{expandedTables:i,visibleNodes:$,visibleEdges:w,expandTable:b,collapseTable:m,isExpanded:p,hasRelations:y,matrixPosition:s}}const J0=["id"],o1=fe({__name:"WrapperErdDiagram",props:{tableId:{}},setup(e){const t=e,n=ce(),{tableSchema:o,isFetching:i}=Z0(),r=K(()=>o.value||[]),a=K(()=>{if(!t.tableId)return;const m=r.value.find(_=>Ne({schemaName:_.schema,tableName:_.table})===t.tableId||_.table===t.tableId);return m?Ne({schemaName:m.schema,tableName:m.table}):t.tableId}),{visibleNodes:s,visibleEdges:l,expandTable:u,collapseTable:c,isExpanded:d,hasRelations:f,matrixPosition:g}=Q0({allTables:r,initialTableId:a,autoExpandInitial:!0}),$=K(()=>r.value.filter(m=>{const _=Ne({schemaName:m.schema,tableName:m.table});return s.value.some(T=>T.id===_)})),w=ce(!1),y=()=>{w.value=!w.value},p=m=>{u(m)},b=m=>{c(m)};return Kl([{key:"meta+f",callback:()=>{y()},isPreventDefault:!0}],{target:n}),(m,_)=>{const T=Wl;return X(),ie("div",{class:"w-full h-full relative",ref_key:"wrapperRef",ref:n,id:N(Ql)()},[Z(T,{visible:N(i)},null,8,["visible"]),Z(K0,{nodes:N(s),edges:N(l),matrixTablePosition:N(g),focusTableId:a.value,tables:$.value,tableId:t.tableId,isExpanded:N(d),hasRelations:N(f),isShowFilter:N(w),"onUpdate:isShowFilter":_[0]||(_[0]=P=>at(w)?w.value=P:null),onExpand:p,onCollapse:b},null,8,["nodes","edges","matrixTablePosition","focusTableId","tables","tableId","isExpanded","hasRelations","isShowFilter"])],8,J0)}}});export{o1 as _,Zr as a};
|