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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{r as pe,cO as Bo,d as fe,c as K,b as he,o as G,w as oe,f as Te,N as rt,u as N,P as Ci,a5 as ki,bY as ds,I as tl,S as fs,cc as nl,T as ol,U as Ji,cP as il,h as q,bR as Un,aX as wt,cQ as hs,a2 as Ye,cg as Lt,V as gs,bU as ji,cR as Mi,cS as rl,cT as sl,cU as al,cV as ll,cW as ul,m as ie,G as Ie,a9 as _t,a6 as Ii,L as Ee,n as Ae,e as ps,b3 as vs,ao as Vt,cX as ms,ad as xe,cY as Ti,C as ge,F as Ne,$ as cl,an as Nn,ai as dl,b2 as Xn,cZ as fl,al as _e,J as Nt,i as He,t as Pe,b1 as hl,K as ys,c_ as gl,p as bt,c$ as pl,ap as Bt,d0 as ws,ab as be,aj as ye,d1 as dn,ak as vl,d2 as xt,d3 as ei,aI as ml,aH as yl,aK as wl,d4 as _l,bW as bl,ag as xl,j as ze,A as Ke,d5 as _s,aG as gn,d6 as er,d7 as tr,cp as $l,at as lt,au as ut,av as ct,d8 as nr,d9 as Kn,da as El,db as Sl,cs as Nl,dc as An,dd as Oo,am as Cl,cq as kl,aP as Ml,de as Il,df as Tl,dg as Al,dh as zl,di as Pl,dj as Dl}from"./BM4vnZvX.js";import{a as Bl,R as Ol}from"./C2Ziircr.js";function Rl(e,t){const n=pe(),o=(r,s)=>{if(t.multiple&&Array.isArray(e.value))if(t.selectionBehavior==="replace")e.value=[r],n.value=r;else{const a=e.value.findIndex(l=>s(l));a!==-1?e.value=e.value.filter((l,u)=>u!==a):e.value=[...e.value,r]}else t.selectionBehavior==="replace"?e.value={...r}:!Array.isArray(e.value)&&s(e.value)?e.value=void 0:e.value={...r};return e.value};function i(r,s,a,l){var f;if(!(n!=null&&n.value)||!t.multiple||!Array.isArray(e.value))return;const c=(f=a().filter(g=>g.ref.dataset.disabled!=="").find(g=>g.ref===s))==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 Hl=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(a){return n.includes(a)}const i=K(()=>o(t.orientation)?t.orientation:"horizontal"),r=K(()=>i.value==="vertical"?t.orientation:void 0),s=K(()=>t.decorative?{role:"none"}:{"aria-orientation":r.value,role:"separator"});return(a,l)=>(G(),he(N(Ci),rt({as:a.as,"as-child":a.asChild,"data-orientation":i.value},s.value),{default:oe(()=>[Te(a.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),Vl=Hl,Fl=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)=>(G(),he(Vl,ki(ds(t)),{default:oe(()=>[Te(n.$slots,"default")]),_:3},16))}}),Ll=Fl;function no(e){return e.reduce((t,n)=>(t.push(n),n.children&&t.push(...no(n.children)),t),[])}const[bs,Yl]=tl("TreeRoot");var Gl=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:s,propagateSelect:a,dir:l,bubbleSelect:u}=fs(n),{handleTypeaheadSearch:c}=nl(),d=ol(l),f=pe(),g=pe(!1),$=il(),y=Ji(n,"modelValue",o,{defaultValue:n.defaultValue??(r.value?[]:void 0),passive:!0,deep:!0}),m=Ji(n,"expanded",o,{defaultValue:n.defaultExpanded??[],passive:n.expanded===void 0,deep:!0}),{onSelectItem:p,handleMultipleReplace:b}=Rl(y,n),w=K(()=>r.value&&Array.isArray(y.value)?y.value.map(R=>n.getKey(R)):[n.getKey(y.value??{})]);function C(R,O=1,V){return R.reduce((k,U,h)=>{const M=n.getKey(U),v=n.getChildren(U),T=m.value.includes(M),I={_id:M,value:U,index:h,level:O,parentItem:V,hasChildren:!!v,bind:{value:U,level:O,"aria-setsize":R.length,"aria-posinset":h+1}};return k.push(I),v&&T&&k.push(...C(v,O+1,U)),k},[])}const P=K(()=>{const R=n.items;return m.value.map(O=>O),C(R??[])});function z(R){var O;if(g.value)$.trigger(R);else{const V=((O=f.value)==null?void 0:O.getItems())??[];c(R.key,V)}}function D(R){if(g.value)return;const O=hs[R.key];Ye(()=>{var V;b(O,Lt(),(V=f.value)==null?void 0:V.getItems,P.value.map(k=>k.value))})}function F(R){var O;if(R.parentItem!=null&&Array.isArray(y.value)&&n.multiple){const V=P.value.find(k=>R.parentItem!=null&&n.getKey(k.value)===n.getKey(R.parentItem));V!=null&&(((O=n.getChildren(V.value))==null?void 0:O.every(U=>y.value.find(h=>n.getKey(h)===n.getKey(U))))?y.value=[...y.value,V.value]:y.value=y.value.filter(U=>n.getKey(U)!==n.getKey(V.value)),F(V))}}return Yl({modelValue:y,selectedKeys:w,onSelect:R=>{var k;const O=U=>n.getKey(U??{})===n.getKey(R),V=n.multiple&&Array.isArray(y.value)?((k=y.value)==null?void 0:k.findIndex(O))!==-1:void 0;if(p(R,O),n.bubbleSelect&&n.multiple&&Array.isArray(y.value)){const U=P.value.find(h=>n.getKey(h.value)===n.getKey(R));U!=null&&F(U)}if(n.propagateSelect&&n.multiple&&Array.isArray(y.value)){const U=no(n.getChildren(R)??[]);V?y.value=[...y.value].filter(h=>!U.some(M=>n.getKey(h??{})===n.getKey(M))):y.value=[...y.value,...U]}},expanded:m,onToggle(R){if(!(R?n.getChildren(R):void 0))return;const V=n.getKey(R)??R;m.value.includes(V)?m.value=m.value.filter(k=>k!==V):m.value=[...m.value,V]},getKey:n.getKey,getChildren:n.getChildren,items:i,expandedItems:P,disabled:s,multiple:r,dir:d,propagateSelect:a,bubbleSelect:u,isVirtual:g,virtualKeydownHook:$,handleMultipleReplace:b}),(R,O)=>(G(),he(N(Bl),{ref_key:"rovingFocusGroupRef",ref:f,"as-child":"",orientation:"vertical",dir:N(d)},{default:oe(()=>[q(N(Ci),{role:"tree",as:R.as,"as-child":R.asChild,"aria-multiselectable":N(r)?!0:void 0,onKeydown:[z,Un(wt(D,["shift"]),["up","down"])]},{default:oe(()=>[Te(R.$slots,"default",{flattenItems:P.value,modelValue:N(y),expanded:N(m)})]),_:3},8,["as","as-child","aria-multiselectable","onKeydown"])]),_:3},8,["dir"]))}}),Ul=Gl;const Xl="tree.select",Kl="tree.toggle";var Wl=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=bs(),{getItems:s}=gs(),a=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&&a.value&&Array.isArray(r.modelValue.value)){const p=no(r.getChildren(o.value)||[]);return p.some(b=>r.modelValue.value.find(w=>r.getKey(w)===r.getKey(b)))&&!p.every(b=>r.modelValue.value.find(w=>r.getKey(w)===r.getKey(b)))}else return r.propagateSelect.value&&u.value&&a.value&&Array.isArray(r.modelValue.value)?!no(r.getChildren(o.value)||[]).every(b=>r.modelValue.value.find(w=>r.getKey(w)===r.getKey(b))):void 0});function d(p){if(a.value)if(l.value){const b=s().map(D=>D.ref),w=Lt(),C=b.indexOf(w),z=[...b].slice(C).find(D=>Number(D.getAttribute("data-indent"))===o.level+1);z&&z.focus()}else m(p)}function f(p){if(l.value)m(p);else{const b=s().map(D=>D.ref),w=Lt(),C=b.indexOf(w),z=[...b].slice(0,C).reverse().find(D=>Number(D.getAttribute("data-indent"))===o.level-1);z&&z.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 y(p){if(!p)return;const b={originalEvent:p,value:o.value,isExpanded:l.value,isSelected:u.value};ji(Xl,g,b)}async function m(p){if(!p)return;const b={originalEvent:p,value:o.value,isExpanded:l.value,isSelected:u.value};ji(Kl,$,b)}return t({isExpanded:l,isSelected:u,isIndeterminate:c,handleToggle:()=>r.onToggle(o.value),handleSelect:()=>r.onSelect(o.value)}),(p,b)=>(G(),he(N(Ol),{"as-child":"",value:p.value,"allow-shift-key":""},{default:oe(()=>[q(N(Ci),rt(p.$attrs,{role:"treeitem",as:p.as,"as-child":p.asChild,"aria-selected":u.value,"aria-expanded":a.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:[Un(wt(y,["self","prevent"]),["enter","space"]),b[0]||(b[0]=Un(wt(w=>N(r).dir.value==="ltr"?d(w):f(w),["prevent"]),["right"])),b[1]||(b[1]=Un(wt(w=>N(r).dir.value==="ltr"?f(w):d(w),["prevent"]),["left"]))],onClick:b[2]||(b[2]=wt(w=>{y(w),m(w)},["stop"]))}),{default:oe(()=>[Te(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"]))}}),Zl=Wl,ql=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=Mi(),o=bs(),i=rl(),{getItems:r}=gs(),s=sl("",1e3),a=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=al({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:ll(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 m;const g=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!g)return;const y=hs[f.key];if(["first","last"].includes(y)){f.preventDefault();const p=y==="first"?0:o.expandedItems.value.length-1;u.value.scrollToIndex(p),requestAnimationFrame(()=>{const b=r();(y==="first"?b[0]:b[b.length-1]).ref.focus()})}else if(y==="prev"&&f.key!=="ArrowUp"){const p=Lt(),b=Number(p.getAttribute("data-index")),w=Number(p.getAttribute("data-indent")),P=o.expandedItems.value.slice(0,b).map((z,D)=>({...z,index:D})).reverse().find(z=>z.level===w-1);P&&d(P.index)}else if(!y&&!g){s.value+=f.key;const p=Number((m=Lt())==null?void 0:m.getAttribute("data-index")),b=a.value[p].textContent,w=a.value.map(z=>z.textContent),C=ul(w,s.value,b),P=a.value.find(z=>z.textContent===C);P&&d(P.index)}Ye(()=>{f.shiftKey&&y&&o.handleMultipleReplace(y,Lt(),r,o.expandedItems.value.map(p=>p.value))})}),(f,g)=>(G(),ie("div",{"data-reka-virtualizer":"",style:Ee({position:"relative",width:"100%",height:`${N(u).getTotalSize()}px`})},[(G(!0),ie(Ie,null,_t(c.value,({is:$,item:y})=>(G(),he(Ii($),{key:y.key}))),128))],4))}}),Ql=ql;const Jl=fe({__name:"KbdGroup",props:{class:{}},setup(e){const t=e;return(n,o)=>(G(),ie("kbd",{"data-slot":"kbd-group",class:Ae(N(ps)("inline-flex items-center gap-1",t.class))},[Te(n.$slots,"default")],2))}});function bo(e){return vs()?(Xn(e),!0):!1}function tt(e){return typeof e=="function"?e():N(e)}const jl=typeof window<"u"&&typeof document<"u",eu=e=>typeof e<"u",tu=Object.prototype.toString,nu=e=>tu.call(e)==="[object Object]",ou=()=>{};function iu(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 xs=e=>e();function ru(e=xs){const t=pe(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:vl(t),pause:n,resume:o,eventFilter:i}}function or(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function su(e,t,n={}){const{eventFilter:o=xs,...i}=n;return xe(e,iu(o,t),i)}function Ft(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:s,resume:a,isActive:l}=ru(o);return{stop:su(e,t,{...i,eventFilter:r}),pause:s,resume:a,isActive:l}}function au(e,t={}){if(!bt(e))return fs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=pl(()=>({get(){return e.value[o]},set(i){var r;if((r=tt(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=i,e.value=a}else{const a={...e.value,[o]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=i}}));return n}function ti(e,t=!1){function n(d,{flush:f="sync",deep:g=!1,timeout:$,throwOnTimeout:y}={}){let m=null;const b=[new Promise(w=>{m=xe(e,C=>{d(C)!==t&&(m==null||m(),w(C))},{flush:f,deep:g,immediate:!0})})];return $!=null&&b.push(or($,y).then(()=>tt(e)).finally(()=>m==null?void 0:m())),Promise.race(b)}function o(d,f){if(!bt(d))return n(C=>C===d,f);const{flush:g="sync",deep:$=!1,timeout:y,throwOnTimeout:m}=f??{};let p=null;const w=[new Promise(C=>{p=xe([e,d],([P,z])=>{t!==(P===z)&&(p==null||p(),C(P))},{flush:g,deep:$,immediate:!0})})];return y!=null&&w.push(or(y,m).then(()=>tt(e)).finally(()=>(p==null||p(),tt(e)))),Promise.race(w)}function i(d){return n(f=>!!f,d)}function r(d){return o(null,d)}function s(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,f){return n(g=>{const $=Array.from(g);return $.includes(d)||$.includes(tt(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(tt(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return ti(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return ti(e,!t)}}}function ni(e){return ti(e)}function lu(e){var t;const n=tt(e);return(t=n==null?void 0:n.$el)!=null?t:n}const $s=jl?window:void 0;function Es(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=$s):[t,n,o,i]=e,!t)return ou;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},a=(c,d,f,g)=>(c.addEventListener(d,f,g),()=>c.removeEventListener(d,f,g)),l=xe(()=>[lu(t),tt(i)],([c,d])=>{if(s(),!c)return;const f=nu(d)?{...d}:d;r.push(...n.flatMap(g=>o.map($=>a(c,g,$,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return bo(u),u}function uu(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function ir(...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=$s,eventName:r="keydown",passive:s=!1,dedupe:a=!1}=o,l=uu(t);return Es(i,r,c=>{c.repeat&&tt(a)||l(c)&&n(c)},s)}function cu(e){return JSON.parse(JSON.stringify(e))}function Ro(e,t,n,o={}){var i,r,s;const{clone:a=!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))||((s=(r=g==null?void 0:g.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(g==null?void 0:g.proxy));let y=u;t||(t="modelValue"),y=y||`update:${t.toString()}`;const m=w=>a?typeof a=="function"?a(w):cu(w):w,p=()=>eu(e[t])?m(e[t]):d,b=w=>{f?f(w)&&$(y,w):$(y,w)};if(l){const w=p(),C=pe(w);let P=!1;return xe(()=>e[t],z=>{P||(P=!0,C.value=m(z),Ye(()=>P=!1))}),xe(C,z=>{!P&&(z!==e[t]||c)&&b(z)},{deep:c}),C}else return K({get(){return p()},set(w){b(w)}})}var du={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 fu(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=fu(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=hu(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=rr(n[i],e.name,t);else if(t==null)for(i in n)n[i]=rr(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 hu(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function rr(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=du,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var oi="http://www.w3.org/1999/xhtml";const sr={svg:"http://www.w3.org/2000/svg",xhtml:oi,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)),sr.hasOwnProperty(t)?{space:sr[t],local:e}:e}function gu(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===oi&&t.documentElement.namespaceURI===oi?t.createElement(e):t.createElementNS(n,e)}}function pu(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ss(e){var t=$o(e);return(t.local?pu:gu)(t)}function vu(){}function Ai(e){return e==null?vu:function(){return this.querySelector(e)}}function mu(e){typeof e!="function"&&(e=Ai(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Oe(o,this._parents)}function yu(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wu(){return[]}function Ns(e){return e==null?wu:function(){return this.querySelectorAll(e)}}function _u(e){return function(){return yu(e.apply(this,arguments))}}function bu(e){typeof e=="function"?e=_u(e):e=Ns(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Oe(o,i)}function Cs(e){return function(){return this.matches(e)}}function ks(e){return function(t){return t.matches(e)}}var xu=Array.prototype.find;function $u(e){return function(){return xu.call(this.children,e)}}function Eu(){return this.firstElementChild}function Su(e){return this.select(e==null?Eu:$u(typeof e=="function"?e:ks(e)))}var Nu=Array.prototype.filter;function Cu(){return Array.from(this.children)}function ku(e){return function(){return Nu.call(this.children,e)}}function Mu(e){return this.selectAll(e==null?Cu:ku(typeof e=="function"?e:ks(e)))}function Iu(e){typeof e!="function"&&(e=Cs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Oe(o,this._parents)}function Ms(e){return new Array(e.length)}function Tu(){return new Oe(this._enter||this._groups.map(Ms),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 Au(e){return function(){return e}}function zu(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new oo(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Pu(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,f=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(f[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<d;++a)g=s.call(e,r[a],a,r)+"",(l=u.get(g))?(o[a]=l,l.__data__=r[a],u.delete(g)):n[a]=new oo(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(i[a]=l)}function Du(e){return e.__data__}function Bu(e,t){if(!arguments.length)return Array.from(this,Du);var n=t?Pu:zu,o=this._parents,i=this._groups;typeof e!="function"&&(e=Au(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],f=d.length,g=Ou(e.call(c,c&&c.__data__,u,o)),$=g.length,y=a[u]=new Array($),m=s[u]=new Array($),p=l[u]=new Array(f);n(c,d,y,m,p,g,t);for(var b=0,w=0,C,P;b<$;++b)if(C=y[b]){for(b>=w&&(w=b+1);!(P=m[w])&&++w<$;);C._next=P||null}}return s=new Oe(s,o),s._enter=a,s._exit=l,s}function Ou(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ru(){return new Oe(this._exit||this._groups.map(Ms),this._parents)}function Hu(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 Vu(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,f=a[l]=new Array(d),g,$=0;$<d;++$)(g=u[$]||c[$])&&(f[$]=g);for(;l<i;++l)a[l]=n[l];return new Oe(a,this._parents)}function Fu(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function Lu(e){e||(e=Yu);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 s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Oe(i,this._parents).order()}function Yu(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Gu(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Uu(){return Array.from(this)}function Xu(){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 s=o[i];if(s)return s}return null}function Ku(){let e=0;for(const t of this)++e;return e}function Wu(){return!this.node()}function Zu(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function qu(e){return function(){this.removeAttribute(e)}}function Qu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ju(e,t){return function(){this.setAttribute(e,t)}}function ju(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ec(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tc(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 nc(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?Qu:qu:typeof t=="function"?n.local?tc:ec:n.local?ju:Ju)(n,t))}function Is(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function oc(e){return function(){this.style.removeProperty(e)}}function ic(e,t,n){return function(){this.style.setProperty(e,t,n)}}function rc(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function sc(e,t,n){return arguments.length>1?this.each((t==null?oc:typeof t=="function"?rc:ic)(e,t,n??"")):Kt(this.node(),e)}function Kt(e,t){return e.style.getPropertyValue(t)||Is(e).getComputedStyle(e,null).getPropertyValue(t)}function ac(e){return function(){delete this[e]}}function lc(e,t){return function(){this[e]=t}}function uc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function cc(e,t){return arguments.length>1?this.each((t==null?ac:typeof t=="function"?uc:lc)(e,t)):this.node()[e]}function Ts(e){return e.trim().split(/^|\s+/)}function zi(e){return e.classList||new As(e)}function As(e){this._node=e,this._names=Ts(e.getAttribute("class")||"")}As.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 zs(e,t){for(var n=zi(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Ps(e,t){for(var n=zi(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function dc(e){return function(){zs(this,e)}}function fc(e){return function(){Ps(this,e)}}function hc(e,t){return function(){(t.apply(this,arguments)?zs:Ps)(this,e)}}function gc(e,t){var n=Ts(e+"");if(arguments.length<2){for(var o=zi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?hc:t?dc:fc)(n,t))}function pc(){this.textContent=""}function vc(e){return function(){this.textContent=e}}function mc(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yc(e){return arguments.length?this.each(e==null?pc:(typeof e=="function"?mc:vc)(e)):this.node().textContent}function wc(){this.innerHTML=""}function _c(e){return function(){this.innerHTML=e}}function bc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function xc(e){return arguments.length?this.each(e==null?wc:(typeof e=="function"?bc:_c)(e)):this.node().innerHTML}function $c(){this.nextSibling&&this.parentNode.appendChild(this)}function Ec(){return this.each($c)}function Sc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nc(){return this.each(Sc)}function Cc(e){var t=typeof e=="function"?e:Ss(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function kc(){return null}function Mc(e,t){var n=typeof e=="function"?e:Ss(e),o=t==null?kc:typeof t=="function"?t:Ai(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Ic(){var e=this.parentNode;e&&e.removeChild(this)}function Tc(){return this.each(Ic)}function Ac(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function zc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pc(e){return this.select(e?zc:Ac)}function Dc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Bc(e){return function(t){e.call(this,t,this.__data__)}}function Oc(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 Rc(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 Hc(e,t,n){return function(){var o=this.__on,i,r=Bc(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).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 Vc(e,t,n){var o=Oc(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?Hc:Rc,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function Ds(e,t,n){var o=Is(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 Fc(e,t){return function(){return Ds(this,e,t)}}function Lc(e,t){return function(){return Ds(this,e,t.apply(this,arguments))}}function Yc(e,t){return this.each((typeof t=="function"?Lc:Fc)(e,t))}function*Gc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var Bs=[null];function Oe(e,t){this._groups=e,this._parents=t}function Cn(){return new Oe([[document.documentElement]],Bs)}function Uc(){return this}Oe.prototype=Cn.prototype={constructor:Oe,select:mu,selectAll:bu,selectChild:Su,selectChildren:Mu,filter:Iu,data:Bu,enter:Tu,exit:Ru,join:Hu,merge:Vu,selection:Uc,order:Fu,sort:Lu,call:Gu,nodes:Uu,node:Xu,size:Ku,empty:Wu,each:Zu,attr:nc,style:sc,property:cc,classed:gc,text:yc,html:xc,raise:Ec,lower:Nc,append:Cc,insert:Mc,remove:Tc,clone:Pc,datum:Dc,on:Vc,dispatch:Yc,[Symbol.iterator]:Gc};function Ve(e){return typeof e=="string"?new Oe([[document.querySelector(e)]],[document.documentElement]):new Oe([[e]],Bs)}function Xc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function We(e,t){if(e=Xc(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 Kc={passive:!1},pn={capture:!0,passive:!1};function Ho(e){e.stopImmediatePropagation()}function Yt(e){e.preventDefault(),e.stopImmediatePropagation()}function Os(e){var t=e.document.documentElement,n=Ve(e).on("dragstart.drag",Yt,pn);"onselectstart"in t?n.on("selectstart.drag",Yt,pn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Rs(e,t){var n=e.document.documentElement,o=Ve(e).on("dragstart.drag",null);t&&(o.on("click.drag",Yt,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 ii(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:s,y:a,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:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}ii.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Wc(e){return!e.ctrlKey&&!e.button}function Zc(){return this.parentNode}function qc(e,t){return t??{x:e.x,y:e.y}}function Qc(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jc(){var e=Wc,t=Zc,n=qc,o=Qc,i={},r=xo("start","drag","end"),s=0,a,l,u,c,d=0;function f(C){C.on("mousedown.drag",g).filter(o).on("touchstart.drag",m).on("touchmove.drag",p,Kc).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(C,P){if(!(c||!e.call(this,C,P))){var z=w(this,t.call(this,C,P),C,P,"mouse");z&&(Ve(C.view).on("mousemove.drag",$,pn).on("mouseup.drag",y,pn),Os(C.view),Ho(C),u=!1,a=C.clientX,l=C.clientY,z("start",C))}}function $(C){if(Yt(C),!u){var P=C.clientX-a,z=C.clientY-l;u=P*P+z*z>d}i.mouse("drag",C)}function y(C){Ve(C.view).on("mousemove.drag mouseup.drag",null),Rs(C.view,u),Yt(C),i.mouse("end",C)}function m(C,P){if(e.call(this,C,P)){var z=C.changedTouches,D=t.call(this,C,P),F=z.length,R,O;for(R=0;R<F;++R)(O=w(this,D,C,P,z[R].identifier,z[R]))&&(Ho(C),O("start",C,z[R]))}}function p(C){var P=C.changedTouches,z=P.length,D,F;for(D=0;D<z;++D)(F=i[P[D].identifier])&&(Yt(C),F("drag",C,P[D]))}function b(C){var P=C.changedTouches,z=P.length,D,F;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),D=0;D<z;++D)(F=i[P[D].identifier])&&(Ho(C),F("end",C,P[D]))}function w(C,P,z,D,F,R){var O=r.copy(),V=We(R||z,P),k,U,h;if((h=n.call(C,new ii("beforestart",{sourceEvent:z,target:f,identifier:F,active:s,x:V[0],y:V[1],dx:0,dy:0,dispatch:O}),D))!=null)return k=h.x-V[0]||0,U=h.y-V[1]||0,function M(v,T,I){var B=V,A;switch(v){case"start":i[F]=M,A=s++;break;case"end":delete i[F],--s;case"drag":V=We(I||T,P),A=s;break}O.call(v,C,new ii(v,{sourceEvent:T,subject:h,target:f,identifier:F,active:A,x:V[0]+k,y:V[1]+U,dx:V[0]-B[0],dy:V[1]-B[1],dispatch:O}),D)}}return f.filter=function(C){return arguments.length?(e=typeof C=="function"?C:zn(!!C),f):e},f.container=function(C){return arguments.length?(t=typeof C=="function"?C:zn(C),f):t},f.subject=function(C){return arguments.length?(n=typeof C=="function"?C:zn(C),f):n},f.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:zn(!!C),f):o},f.on=function(){var C=r.on.apply(r,arguments);return C===r?f:C},f.clickDistance=function(C){return arguments.length?(d=(C=+C)*C,f):Math.sqrt(d)},f}function Pi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Hs(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,Gt="\\s*([+-]?\\d+)\\s*",mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jc=/^#([0-9a-f]{3,8})$/,ed=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),td=new RegExp(`^rgb\\(${Ze},${Ze},${Ze}\\)$`),nd=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${mn}\\)$`),od=new RegExp(`^rgba\\(${Ze},${Ze},${Ze},${mn}\\)$`),id=new RegExp(`^hsl\\(${mn},${Ze},${Ze}\\)$`),rd=new RegExp(`^hsla\\(${mn},${Ze},${Ze},${mn}\\)$`),ar={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};Pi(kn,yn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lr,formatHex:lr,formatHex8:sd,formatHsl:ad,formatRgb:ur,toString:ur});function lr(){return this.rgb().formatHex()}function sd(){return this.rgb().formatHex8()}function ad(){return Vs(this).formatHsl()}function ur(){return this.rgb().formatRgb()}function yn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=jc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cr(t):n===3?new De(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=ed.exec(e))?new De(t[1],t[2],t[3],1):(t=td.exec(e))?new De(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nd.exec(e))?Pn(t[1],t[2],t[3],t[4]):(t=od.exec(e))?Pn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=id.exec(e))?hr(t[1],t[2]/100,t[3]/100,1):(t=rd.exec(e))?hr(t[1],t[2]/100,t[3]/100,t[4]):ar.hasOwnProperty(e)?cr(ar[e]):e==="transparent"?new De(NaN,NaN,NaN,0):null}function cr(e){return new De(e>>16&255,e>>8&255,e&255,1)}function Pn(e,t,n,o){return o<=0&&(e=t=n=NaN),new De(e,t,n,o)}function ld(e){return e instanceof kn||(e=yn(e)),e?(e=e.rgb(),new De(e.r,e.g,e.b,e.opacity)):new De}function ri(e,t,n,o){return arguments.length===1?ld(e):new De(e,t,n,o??1)}function De(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Pi(De,ri,Hs(kn,{brighter(e){return e=e==null?io:Math.pow(io,e),new De(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vn:Math.pow(vn,e),new De(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new De(zt(this.r),zt(this.g),zt(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:dr,formatHex:dr,formatHex8:ud,formatRgb:fr,toString:fr}));function dr(){return`#${Tt(this.r)}${Tt(this.g)}${Tt(this.b)}`}function ud(){return`#${Tt(this.r)}${Tt(this.g)}${Tt(this.b)}${Tt((isNaN(this.opacity)?1:this.opacity)*255)}`}function fr(){const e=ro(this.opacity);return`${e===1?"rgb(":"rgba("}${zt(this.r)}, ${zt(this.g)}, ${zt(this.b)}${e===1?")":`, ${e})`}`}function ro(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tt(e){return e=zt(e),(e<16?"0":"")+e.toString(16)}function hr(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fe(e,t,n,o)}function Vs(e){if(e instanceof Fe)return new Fe(e.h,e.s,e.l,e.opacity);if(e instanceof kn||(e=yn(e)),!e)return new Fe;if(e instanceof Fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Fe(s,a,l,e.opacity)}function cd(e,t,n,o){return arguments.length===1?Vs(e):new Fe(e,t,n,o??1)}function Fe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Pi(Fe,cd,Hs(kn,{brighter(e){return e=e==null?io:Math.pow(io,e),new Fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vn:Math.pow(vn,e),new Fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new De(Vo(e>=240?e-240:e+120,i,o),Vo(e,i,o),Vo(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Fe(gr(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("}${gr(this.h)}, ${Dn(this.s)*100}%, ${Dn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function gr(e){return e=(e||0)%360,e<0?e+360:e}function Dn(e){return Math.max(0,Math.min(1,e||0))}function Vo(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 Fs=e=>()=>e;function dd(e,t){return function(n){return e+n*t}}function fd(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 hd(e){return(e=+e)==1?Ls:function(t,n){return n-t?fd(t,n,e):Fs(isNaN(t)?n:t)}}function Ls(e,t){var n=t-e;return n?dd(e,n):Fs(isNaN(e)?t:e)}const pr=function e(t){var n=hd(t);function o(i,r){var s=n((i=ri(i)).r,(r=ri(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=Ls(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function gt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var si=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fo=new RegExp(si.source,"g");function gd(e){return function(){return e}}function pd(e){return function(t){return e(t)+""}}function vd(e,t){var n=si.lastIndex=Fo.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=si.exec(e))&&(i=Fo.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:gt(o,i)})),n=Fo.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?pd(l[0].x):gd(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var vr=180/Math.PI,ai={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ys(e,t,n,o,i,r){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*vr,skewX:Math.atan(l)*vr,scaleX:s,scaleY:a}}var Bn;function md(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ai:Ys(t.a,t.b,t.c,t.d,t.e,t.f)}function yd(e){return e==null||(Bn||(Bn=document.createElementNS("http://www.w3.org/2000/svg","g")),Bn.setAttribute("transform",e),!(e=Bn.transform.baseVal.consolidate()))?ai:(e=e.matrix,Ys(e.a,e.b,e.c,e.d,e.e,e.f))}function Gs(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 y=g.push("translate(",null,t,null,n);$.push({i:y-4,x:gt(u,d)},{i:y-2,x:gt(c,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function s(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:gt(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,o)-2,x:gt(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,f,g,$){if(u!==d||c!==f){var y=g.push(i(g)+"scale(",null,",",null,")");$.push({i:y-4,x:gt(u,d)},{i:y-2,x:gt(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),s(u.rotate,c.rotate,d,f),a(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,y=f.length,m;++$<y;)d[(m=f[$]).i]=m.x(g);return d.join("")}}}var wd=Gs(md,"px, ","px)","deg)"),_d=Gs(yd,", ",")",")"),bd=1e-12;function mr(e){return((e=Math.exp(e))+1/e)/2}function xd(e){return((e=Math.exp(e))-1/e)/2}function $d(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ed=function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],f=s[2],g=c-a,$=d-l,y=g*g+$*$,m,p;if(y<bd)p=Math.log(f/u)/t,m=function(D){return[a+D*g,l+D*$,u*Math.exp(t*D*p)]};else{var b=Math.sqrt(y),w=(f*f-u*u+o*y)/(2*u*n*b),C=(f*f-u*u-o*y)/(2*f*n*b),P=Math.log(Math.sqrt(w*w+1)-w),z=Math.log(Math.sqrt(C*C+1)-C);p=(z-P)/t,m=function(D){var F=D*p,R=mr(P),O=u/(n*b)*(R*$d(t*F+P)-xd(P));return[a+O*g,l+O*$,u*R/mr(t*F+P)]}}return m.duration=p*1e3*t/Math.SQRT2,m}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var Wt=0,sn=0,tn=0,Us=1e3,so,an,ao=0,Ot=0,Eo=0,wn=typeof performance=="object"&&performance.now?performance:Date,Xs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Di(){return Ot||(Xs(Sd),Ot=wn.now()+Eo)}function Sd(){Ot=0}function lo(){this._call=this._time=this._next=null}lo.prototype=Ks.prototype={constructor:lo,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Di():+n)+(t==null?0:+t),!this._next&&an!==this&&(an?an._next=this:so=this,an=this),this._call=e,this._time=n,li()},stop:function(){this._call&&(this._call=null,this._time=1/0,li())}};function Ks(e,t,n){var o=new lo;return o.restart(e,t,n),o}function Nd(){Di(),++Wt;for(var e=so,t;e;)(t=Ot-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wt}function yr(){Ot=(ao=wn.now())+Eo,Wt=sn=0;try{Nd()}finally{Wt=0,kd(),Ot=0}}function Cd(){var e=wn.now(),t=e-ao;t>Us&&(Eo-=t,ao=e)}function kd(){for(var e,t=so,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:so=n);an=e,li(o)}function li(e){if(!Wt){sn&&(sn=clearTimeout(sn));var t=e-Ot;t>24?(e<1/0&&(sn=setTimeout(yr,e-wn.now()-Eo)),tn&&(tn=clearInterval(tn))):(tn||(ao=wn.now(),tn=setInterval(Cd,Us)),Wt=1,Xs(yr))}}function wr(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 Md=xo("start","end","cancel","interrupt"),Id=[],Ws=0,_r=1,ui=2,Zn=3,br=4,ci=5,qn=6;function So(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Td(e,n,{name:t,index:o,group:i,on:Md,tween:Id,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ws})}function Bi(e,t){var n=Ge(e,t);if(n.state>Ws)throw new Error("too late; already scheduled");return n}function Qe(e,t){var n=Ge(e,t);if(n.state>Zn)throw new Error("too late; already running");return n}function Ge(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Td(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Ks(r,0,n.time);function r(u){n.state=_r,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(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 wr(s);g.state===br?(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(wr(function(){n.state===Zn&&(n.state=br,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=ui,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ui){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 a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ci,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===ci&&(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,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>ui&&o.state<ci,o.state=qn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Ad(e){return this.each(function(){Qn(this,e)})}function zd(e,t){var n,o;return function(){var i=Qe(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Pd(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Qe(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function Dd(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ge(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?zd:Pd)(n,e,t))}function Oi(e,t,n){var o=e._id;return e.each(function(){var i=Qe(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ge(i,o).value[t]}}function Zs(e,t){var n;return(typeof t=="number"?gt:t instanceof yn?pr:(n=yn(t))?(t=n,pr):vd)(e,t)}function Bd(e){return function(){this.removeAttribute(e)}}function Od(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rd(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function Hd(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function Vd(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Fd(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Ld(e,t){var n=$o(e),o=n==="transform"?_d:Zs;return this.attrTween(e,typeof t=="function"?(n.local?Fd:Vd)(n,o,Oi(this,"attr."+e,t)):t==null?(n.local?Od:Bd)(n):(n.local?Hd:Rd)(n,o,t))}function Yd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Gd(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ud(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Gd(e,r)),n}return i._value=t,i}function Xd(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Yd(e,r)),n}return i._value=t,i}function Kd(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?Ud:Xd)(o,t))}function Wd(e,t){return function(){Bi(this,e).delay=+t.apply(this,arguments)}}function Zd(e,t){return t=+t,function(){Bi(this,e).delay=t}}function qd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Wd:Zd)(t,e)):Ge(this.node(),t).delay}function Qd(e,t){return function(){Qe(this,e).duration=+t.apply(this,arguments)}}function Jd(e,t){return t=+t,function(){Qe(this,e).duration=t}}function jd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Qd:Jd)(t,e)):Ge(this.node(),t).duration}function ef(e,t){if(typeof t!="function")throw new Error;return function(){Qe(this,e).ease=t}}function tf(e){var t=this._id;return arguments.length?this.each(ef(t,e)):Ge(this.node(),t).ease}function nf(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qe(this,e).ease=n}}function of(e){if(typeof e!="function")throw new Error;return this.each(nf(this._id,e))}function rf(e){typeof e!="function"&&(e=Cs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new st(o,this._parents,this._name,this._id)}function sf(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),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),f,g=0;g<c;++g)(f=l[g]||u[g])&&(d[g]=f);for(;a<o;++a)s[a]=t[a];return new st(s,this._parents,this._name,this._id)}function af(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 lf(e,t,n){var o,i,r=af(t)?Bi:Qe;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function uf(e,t){var n=this._id;return arguments.length<2?Ge(this.node(),n).on.on(e):this.each(lf(n,e,t))}function cf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function df(){return this.on("end.remove",cf(this._id))}function ff(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ai(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,f=0;f<l;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,So(u[f],t,n,f,u,Ge(c,n)));return new st(r,this._parents,t,n)}function hf(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ns(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),g,$=Ge(c,n),y=0,m=f.length;y<m;++y)(g=f[y])&&So(g,t,n,y,f,$);r.push(f),s.push(c)}return new st(r,s,t,n)}var gf=Cn.prototype.constructor;function pf(){return new gf(this._groups,this._parents)}function vf(e,t){var n,o,i;return function(){var r=Kt(this,e),s=(this.style.removeProperty(e),Kt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function qs(e){return function(){this.style.removeProperty(e)}}function mf(e,t,n){var o,i=n+"",r;return function(){var s=Kt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function yf(e,t,n){var o,i,r;return function(){var s=Kt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Kt(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function wf(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=Qe(this,e),u=l.on,c=l.value[r]==null?a||(a=qs(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function _f(e,t,n){var o=(e+="")=="transform"?wd:Zs;return t==null?this.styleTween(e,vf(e,o)).on("end.style."+e,qs(e)):typeof t=="function"?this.styleTween(e,yf(e,o,Oi(this,"style."+e,t))).each(wf(this._id,e)):this.styleTween(e,mf(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 xf(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&bf(e,s,n)),o}return r._value=t,r}function $f(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,xf(e,t,n??""))}function Ef(e){return function(){this.textContent=e}}function Sf(e){return function(){var t=e(this);this.textContent=t??""}}function Nf(e){return this.tween("text",typeof e=="function"?Sf(Oi(this,"text",e)):Ef(e==null?"":e+""))}function Cf(e){return function(t){this.textContent=e.call(this,t)}}function kf(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cf(i)),t}return o._value=e,o}function Mf(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,kf(e))}function If(){for(var e=this._name,t=this._id,n=Qs(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Ge(l,t);So(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new st(o,this._parents,e,n)}function Tf(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){--i===0&&r()}};n.each(function(){var u=Qe(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var Af=0;function st(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Qs(){return++Af}var je=Cn.prototype;st.prototype={constructor:st,select:ff,selectAll:hf,selectChild:je.selectChild,selectChildren:je.selectChildren,filter:rf,merge:sf,selection:pf,transition:If,call:je.call,nodes:je.nodes,node:je.node,size:je.size,empty:je.empty,each:je.each,on:uf,attr:Ld,attrTween:Kd,style:_f,styleTween:$f,text:Nf,textTween:Mf,remove:df,tween:Dd,delay:qd,duration:jd,ease:tf,easeVarying:of,end:Tf,[Symbol.iterator]:je[Symbol.iterator]};function zf(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Pf={time:null,delay:0,duration:250,ease:zf};function Df(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 Bf(e){var t,n;e instanceof st?(t=e._id,e=e._name):(t=Qs(),(n=Pf).time=Di(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&So(l,e,t,u,s,n||Df(l,t));return new st(o,this._parents,e,t)}Cn.prototype.interrupt=Ad;Cn.prototype.transition=Bf;const On=e=>()=>e;function Of(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 nt(e,t,n){this.k=e,this.x=t,this.y=n}nt.prototype={constructor:nt,scale:function(e){return e===1?this:new nt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new nt(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 Zt=new nt(1,0,0);nt.prototype;function Lo(e){e.stopImmediatePropagation()}function nn(e){e.preventDefault(),e.stopImmediatePropagation()}function Rf(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Hf(){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 xr(){return this.__zoom||Zt}function Vf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ff(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lf(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],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Yf(){var e=Rf,t=Hf,n=Lf,o=Vf,i=Ff,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ed,u=xo("start","zoom","end"),c,d,f,g=500,$=150,y=0,m=10;function p(h){h.property("__zoom",xr).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",O).filter(i).on("touchstart.zoom",V).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(h,M,v,T){var I=h.selection?h.selection():h;I.property("__zoom",xr),h!==I?P(h,M,v,T):I.interrupt().each(function(){z(this,arguments).event(T).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},p.scaleBy=function(h,M,v,T){p.scaleTo(h,function(){var I=this.__zoom.k,B=typeof M=="function"?M.apply(this,arguments):M;return I*B},v,T)},p.scaleTo=function(h,M,v,T){p.transform(h,function(){var I=t.apply(this,arguments),B=this.__zoom,A=v==null?C(I):typeof v=="function"?v.apply(this,arguments):v,L=B.invert(A),W=typeof M=="function"?M.apply(this,arguments):M;return n(w(b(B,W),A,L),I,s)},v,T)},p.translateBy=function(h,M,v,T){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),s)},null,T)},p.translateTo=function(h,M,v,T,I){p.transform(h,function(){var B=t.apply(this,arguments),A=this.__zoom,L=T==null?C(B):typeof T=="function"?T.apply(this,arguments):T;return n(Zt.translate(L[0],L[1]).scale(A.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof v=="function"?-v.apply(this,arguments):-v),B,s)},T,I)};function b(h,M){return M=Math.max(r[0],Math.min(r[1],M)),M===h.k?h:new nt(M,h.x,h.y)}function w(h,M,v){var T=M[0]-v[0]*h.k,I=M[1]-v[1]*h.k;return T===h.x&&I===h.y?h:new nt(h.k,T,I)}function C(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function P(h,M,v,T){h.on("start.zoom",function(){z(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(T).end()}).tween("zoom",function(){var I=this,B=arguments,A=z(I,B).event(T),L=t.apply(I,B),W=v==null?C(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,X=typeof M=="function"?M.apply(I,B):M,Q=l(Y.invert(W).concat(ee/Y.k),X.invert(W).concat(ee/X.k));return function(se){if(se===1)se=X;else{var ue=Q(se),ae=ee/ue[2];se=new nt(ae,W[0]-ue[0]*ae,W[1]-ue[1]*ae)}A.zoom(null,se)}})}function z(h,M,v){return!v&&h.__zooming||new D(h,M)}function D(h,M){this.that=h,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(h,M),this.taps=0}D.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 Of(h,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),M)}};function F(h,...M){if(!e.apply(this,arguments))return;var v=z(this,M).event(h),T=this.__zoom,I=Math.max(r[0],Math.min(r[1],T.k*Math.pow(2,o.apply(this,arguments)))),B=We(h);if(v.wheel)(v.mouse[0][0]!==B[0]||v.mouse[0][1]!==B[1])&&(v.mouse[1]=T.invert(v.mouse[0]=B)),clearTimeout(v.wheel);else{if(T.k===I)return;v.mouse=[B,T.invert(B)],Qn(this),v.start()}nn(h),v.wheel=setTimeout(A,$),v.zoom("mouse",n(w(b(T,I),v.mouse[0],v.mouse[1]),v.extent,s));function A(){v.wheel=null,v.end()}}function R(h,...M){if(f||!e.apply(this,arguments))return;var v=h.currentTarget,T=z(this,M,!0).event(h),I=Ve(h.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",ee,!0),B=We(h,v),A=h.clientX,L=h.clientY;Os(h.view),Lo(h),T.mouse=[B,this.__zoom.invert(B)],Qn(this),T.start();function W(Y){if(nn(Y),!T.moved){var X=Y.clientX-A,Q=Y.clientY-L;T.moved=X*X+Q*Q>y}T.event(Y).zoom("mouse",n(w(T.that.__zoom,T.mouse[0]=We(Y,v),T.mouse[1]),T.extent,s))}function ee(Y){I.on("mousemove.zoom mouseup.zoom",null),Rs(Y.view,T.moved),nn(Y),T.event(Y).end()}}function O(h,...M){if(e.apply(this,arguments)){var v=this.__zoom,T=We(h.changedTouches?h.changedTouches[0]:h,this),I=v.invert(T),B=v.k*(h.shiftKey?.5:2),A=n(w(b(v,B),T,I),t.apply(this,M),s);nn(h),a>0?Ve(this).transition().duration(a).call(P,A,T,h):Ve(this).call(p.transform,A,T,h)}}function V(h,...M){if(e.apply(this,arguments)){var v=h.touches,T=v.length,I=z(this,M,h.changedTouches.length===T).event(h),B,A,L,W;for(Lo(h),A=0;A<T;++A)L=v[A],W=We(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=z(this,M).event(h),T=h.changedTouches,I=T.length,B,A,L,W;for(nn(h),B=0;B<I;++B)A=T[B],L=We(A,this),v.touch0&&v.touch0[2]===A.identifier?v.touch0[0]=L:v.touch1&&v.touch1[2]===A.identifier&&(v.touch1[0]=L);if(A=v.that.__zoom,v.touch1){var ee=v.touch0[0],Y=v.touch0[1],X=v.touch1[0],Q=v.touch1[1],se=(se=X[0]-ee[0])*se+(se=X[1]-ee[1])*se,ue=(ue=Q[0]-Y[0])*ue+(ue=Q[1]-Y[1])*ue;A=b(A,Math.sqrt(se/ue)),L=[(ee[0]+X[0])/2,(ee[1]+X[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(w(A,L,W),v.extent,s))}}function U(h,...M){if(this.__zooming){var v=z(this,M).event(h),T=h.changedTouches,I=T.length,B,A;for(Lo(h),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),B=0;B<I;++B)A=T[B],v.touch0&&v.touch0[2]===A.identifier?delete v.touch0:v.touch1&&v.touch1[2]===A.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&&(A=We(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<m)){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?(s[0][0]=+h[0][0],s[1][0]=+h[1][0],s[0][1]=+h[0][1],s[1][1]=+h[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(h){return arguments.length?(n=h,p):n},p.duration=function(h){return arguments.length?(a=+h,p):a},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?(y=(h=+h)*h,p):Math.sqrt(y)},p.tapDistance=function(h){return arguments.length?(m=+h,p):m},p}var te=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(te||{}),Ri=(e=>(e.Partial="partial",e.Full="full",e))(Ri||{}),kt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(kt||{}),Et=(e=>(e.Strict="strict",e.Loose="loose",e))(Et||{}),di=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(di||{}),fn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(fn||{});const Gf=["INPUT","SELECT","TEXTAREA"];function fi(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 Gf.includes(o==null?void 0:o.nodeName)||i||!!r}function Uf(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function $r(e,t,n,o){const i=t.replace("+",`
|
|
2
|
+
`).replace(`
|
|
3
|
+
|
|
4
|
+
`,`
|
|
5
|
+
+`).split(`
|
|
6
|
+
`).map(s=>s.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===i[a]);return o&&n.delete(e.toLowerCase()),r}function Xf(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Kf(n.code,e);return Array.isArray(e)?e.some(i=>$r(n[o],i,t,n.type==="keyup")):$r(n[o],e,t,n.type==="keyup")}}function Kf(e,t){return t.includes(e)?"code":"key"}function hn(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=pe(ye(e)===!0);let s=!1;const a=new Set;let l=c(ye(e));xe(()=>ye(e),(d,f)=>{typeof f=="boolean"&&typeof d!="boolean"&&u(),l=c(d)},{immediate:!0}),Es(["blur","contextmenu"],u),ir((...d)=>l(...d),d=>{var f,g;if(s=Uf(d),(!s||s&&!n.value)&&fi(d))return;const y=((g=(f=d.composedPath)==null?void 0:f.call(d))==null?void 0:g[0])||d.target,m=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";!i.value&&(s||!m)&&d.preventDefault(),r.value=!0},{eventName:"keydown",target:o}),ir((...d)=>l(...d),d=>{if(r.value){if((!s||s&&!n.value)&&fi(d))return;s=!1,r.value=!1}},{eventName:"keyup",target:o});function u(){s=!1,a.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"?Xf(d,a):d}return r}const Js="vue-flow__node-desc",js="vue-flow__edge-desc",Wf="vue-flow__aria-live",ea=["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 Rt(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function ta(e,t){return{x:Rt(e.x,t[0][0],t[1][0]),y:Rt(e.y,t[0][1],t[1][1])}}function Er(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function St(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Pt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!St(e)}function ln(e){return Pt(e)&&"computedPosition"in e}function Rn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Zf(e){return Rn(e.width)&&Rn(e.height)&&Rn(e.x)&&Rn(e.y)}function qf(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:dn({width:0,height:0}),computedPosition:dn({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:Ce(e.data)?e.data:{},events:dn(Ce(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function na(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:Ce(e.data)?e.data:{},events:dn(Ce(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 oa(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===i&&r.add(a[o]);return t.filter(a=>r.has(a.id))}function Qf(...e){if(e.length===3){const[r,s,a]=e;return oa(r,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>St(r)&&r.source===o).map(r=>n.find(s=>Pt(s)&&s.id===r.target))}function Jf(...e){if(e.length===3){const[r,s,a]=e;return oa(r,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>St(r)&&r.target===o).map(r=>n.find(s=>Pt(s)&&s.id===r.source))}function ia({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function jf(e,t){return t.some(n=>St(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 hi({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,s=[1,1]){const a={x:(e-n)/i,y:(t-o)/i};return r?Co(a,s):a}function ra(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 sa({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function eh(e,t){return sa(ra(fo(e),fo(t)))}function Hi(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=ra(t,fo({...o.computedPosition,...o.dimensions}))}return sa(t)}function aa(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},s=[];for(const a of e){const{dimensions:l,selectable:u=!0,hidden:c=!1}=a,d=l.width??a.width??null,f=l.height??a.height??null;if(i&&!u||c)continue;const g=co(r,uo(a)),$=d===null||f===null,y=o&&g>0,m=(d??0)*(f??0);($||y||g>=m||a.dragging)&&s.push(a)}return s}function Mt(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 Sr(e,t,n,o,i,r=.1,s={x:0,y:0}){const a=t/(e.width*(1+r)),l=n/(e.height*(1+r)),u=Math.min(a,l),c=Rt(u,o,i),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*c+(s.x??0),$=n/2-f*c+(s.y??0);return{x:g,y:$,zoom:c}}function th(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function la(e,t){if(!e.parentNode)return!1;const n=t(e.parentNode);return n?n.selected?!0:la(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 Nr(e,t,n){return e<t?Rt(Math.abs(e-t),1,t)/t:e>n?-Rt(Math.abs(e-n),1,t)/t:0}function ua(e,t,n=15,o=40){const i=Nr(e.x,o,t.width-o)*n,r=Nr(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 s=Number(i.width.replace("px",""));i.width=`${s+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 s=Number(i.height.replace("px",""));i.height=`${s+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 s=t.style;return{...s(r),...i}}:t.style={...t.style,...i}}}}function Cr(e,t){var n,o;const i=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of i)if(s.type==="add")t.findIndex(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const r=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(ln(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&ln(l)&&Yo(s,l)}break;case"dimensions":if(ln(s)&&(typeof a.dimensions<"u"&&(s.dimensions=a.dimensions),typeof a.updateStyle<"u"&&a.updateStyle&&(s.style={...s.style||{},width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`}),typeof a.resizing<"u"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&ln(l)&&(!!l.dimensions.width&&!!l.dimensions.height?Yo(s,l):Ye(()=>{Yo(s,l)}))}break}return t}function ft(e,t){return{id:e,type:"select",selected:t}}function kr(e){return{item:e,type:"add"}}function Mr(e){return{id:e,type:"remove"}}function Ir(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function pt(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const s=t.has(i);!(r.selected===void 0&&!s)&&r.selected!==s&&(n&&(r.selected=s),o.push(ft(r.id,s)))}return o}function Z(e){const t=new Set;let n=!1;const o=()=>t.size>0;e&&(n=!0,t.add(e));const i=a=>{t.delete(a)};return{on:a=>{e&&n&&t.delete(e),t.add(a);const l=()=>{i(a),e&&n&&t.add(e)};return bo(l),{off:l}},off:i,trigger:a=>Promise.all(Array.from(t).map(l=>l(a))),hasListeners:o,fns:t}}function Tr(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 nh(e,t,n,o,i){var r,s;const a=[];for(const l of e)(l.selected||l.id===i)&&(!l.parentNode||!la(l,o))&&(l.draggable||t&&typeof l.draggable>"u")&&a.push(dn({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-((s=l.computedPosition)==null?void 0:s.y)||0},from:l.computedPosition,extent:l.extent,parentNode:l.parentNode,dimensions:l.dimensions,expandParent:l.expandParent}));return a}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 ca(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 oh(e,t,n){const[o,i,r,s]=typeof e!="string"?ca(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+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function ih(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=oh(i,e,o);r&&(i=r)}else t(new Me(ke.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,s=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+s],[i[1][0]+r,i[1][1]+s]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,s,a,l]=ca(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-s,i.range[1][1]+c-a]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function rh({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Vi(e,t,n,o,i){const r=rh(e.dimensions,ih(e,n,o,i)),s=ta(t,r);return{position:{x:s.x-((i==null?void 0:i.computedPosition.x)||0),y:s.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:s}}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:s,height:a}=t??uh(e);if(o)return{x:i+s/2,y:r+a/2};switch((t==null?void 0:t.position)??n){case te.Top:return{x:i+s/2,y:r};case te.Right:return{x:i+s,y:r+a/2};case te.Bottom:return{x:i+s/2,y:r+a};case te.Left:return{x:i,y:r+a/2}}}function Ar(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function sh({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:s,height:a,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:s/l.zoom,height:a/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 ah(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),s=t(e.target);return!r||!s?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,s.computedPosition.z||0)),i)}var ke=(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))(ke||{});const zr={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 Me extends Error{constructor(t,...n){var o;super((o=zr[t])==null?void 0:o.call(zr,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Fi(e){return"clientX"in e}function lh(e){return"sourceEvent"in e}function $t(e,t){const n=Fi(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 uh(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 ch=()=>!0;function Uo(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function dh(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 fh=250;function hh(e,t,n,o){var i,r;let s=[],a=Number.POSITIVE_INFINITY;const l=dh(e,n,t+fh);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||($<a?(s=[{...d,x:f,y:g}],a=$):$===a&&s.push({...d,x:f,y:g}))}}if(!s.length)return null;if(s.length>1){const u=o.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function Pr(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:s,lib:a,flowId:l,isValidConnection:u=ch},c,d,f){const g=r==="target",$=t?s.querySelector(`.${a}-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:y,y:m}=$t(e),p=s.elementFromPoint(y,m),b=p!=null&&p.classList.contains(`${a}-flow__handle`)?p:$,w={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const C=da(void 0,b),P=b.getAttribute("data-nodeid"),z=b.getAttribute("data-handleid"),D=b.classList.contains("connectable"),F=b.classList.contains("connectableend");if(!P||!C)return w;const R={source:g?P:o,sourceHandle:g?z:i,target:g?o:P,targetHandle:g?i:z};w.connection=R;const V=D&&F&&(n===Et.Strict?g&&C==="source"||!g&&C==="target":P!==o||z!==i);w.isValid=V&&u(R,{nodes:d,edges:c,sourceNode:f(o),targetNode:f(P)}),w.toHandle=t}return w}function da(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function gh(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function ph(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function vh(e,t,n,o,i,r=!1){var s,a,l;const u=o.get(e);if(!u)return null;const c=i===Et.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...((a=u.handleBounds)==null?void 0:a.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 gi={[te.Left]:te.Right,[te.Right]:te.Left,[te.Top]:te.Bottom,[te.Bottom]:te.Top},mh=["production","prod"];function ko(e,...t){fa()&&console.warn(`[Vue Flow]: ${e}`,...t)}function fa(){return!mh.includes("production")}function Dr(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...No(s)}}):null}function pi(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Ye(()=>{s.blur()})):n([e])}function Ce(e){return typeof N(e)<"u"}function yh(e,t,n,o){if(!e||!e.source||!e.target)return n(new Me(ke.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let i;return St(e)?i=e:i={...e,id:ia(e)},i=na(i,void 0,o),jf(i,t)?!1:i}function wh(e,t,n,o,i){if(!t.source||!t.target)return i(new Me(ke.EDGE_INVALID,e.id)),!1;if(!n)return i(new Me(ke.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...s}=e;return{...s,id:o?ia(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Br(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const s=e[r];if(!Pt(s)){n(new Me(ke.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const a=qf(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),i[r]=a}for(const r of i){const s=t(r.parentNode)||i.find(a=>a.id===r.parentNode);r.parentNode&&!s&&n(new Me(ke.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),s&&(s.isParent=!0))}return i}function Or(e,t,n,o,i,r){let s=i;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${i}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),r){s=`${i}-${e}-${r}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Xo(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:i,target:r,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${r}-${a}`,c=`${r}-${a}--${i}-${s}`;Or("source",l,c,e,i,s),Or("target",l,u,e,r,a)}}function Rr(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,s,a){const l=[];for(const u of e){const c=St(u)?u:yh(u,a,i,r);if(!c)continue;const d=n(c.source),f=n(c.target);if(!d||!f){i(new Me(ke.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new Me(ke.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!f){i(new Me(ke.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:f})){i(new Me(ke.EDGE_INVALID,c.id));continue}const g=o(c.id);l.push({...na(c,g,r),sourceNode:d,targetNode:f})}return l}const Hr=Symbol("vueFlow"),ha=Symbol("nodeId"),ga=Symbol("nodeRef"),_h=Symbol("edgeId"),bh=Symbol("edgeRef"),Mo=Symbol("slots");function pa(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodes:r,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:f,findNode:g,multiSelectionActive:$,nodesSelectionActive:y,selectNodesOnDrag:m,removeSelectedElements:p,addSelectedNodes:b,updateNodePositions:w,emits:C}=$e(),{onStart:P,onDrag:z,onStop:D,onClick:F,el:R,disabled:O,id:V,selectable:k,dragHandle:U}=e,h=pe(!1);let M=[],v,T=null,I={x:void 0,y:void 0},B={x:0,y:0},A=null,L=!1,W=0,ee=!1;const Y=Eh(),X=({x:re,y:ce})=>{I={x:re,y:ce};let de=!1;if(M=M.map(x=>{const _={x:re-x.distance.x,y:ce-x.distance.y},{computedPosition:S}=Vi(x,n.value?Co(_,o.value):_,C.error,s.value,x.parentNode?g(x.parentNode):void 0);return de=de||x.position.x!==S.x||x.position.y!==S.y,x.position=S,x}),!!de&&(w(M,!0,!0),h.value=!0,A)){const[x,_]=Go({id:V,dragItems:M,findNode:g});z({event:A,node:x,nodes:_})}},Q=()=>{if(!T)return;const[re,ce]=ua(B,T,c.value);if(re!==0||ce!==0){const de={x:(I.x??0)-re/l.value.zoom,y:(I.y??0)-ce/l.value.zoom};f({x:re,y:ce})&&X(de)}W=requestAnimationFrame(Q)},se=(re,ce)=>{L=!0;const de=g(V);!m.value&&!$.value&&de&&(de.selected||p()),de&&ye(k)&&m.value&&pi(de,$.value,b,p,y,!1,ce);const x=Y(re.sourceEvent);if(I=x,M=nh(r.value,d.value,x,g,V),M.length){const[_,S]=Go({id:V,dragItems:M,findNode:g});P({event:re.sourceEvent,node:_,nodes:S})}},ue=(re,ce)=>{var de;re.sourceEvent.type==="touchmove"&&re.sourceEvent.touches.length>1||(a.value===0&&se(re,ce),I=Y(re.sourceEvent),T=((de=t.value)==null?void 0:de.getBoundingClientRect())||null,B=$t(re.sourceEvent,T))},ae=(re,ce)=>{const de=Y(re.sourceEvent);if(!ee&&L&&u.value&&(ee=!0,Q()),!L){const x=de.xSnapped-(I.x??0),_=de.ySnapped-(I.y??0);Math.sqrt(x*x+_*_)>a.value&&se(re,ce)}(I.x!==de.xSnapped||I.y!==de.ySnapped)&&M.length&&L&&(A=re.sourceEvent,B=$t(re.sourceEvent,T),X(de))},we=re=>{let ce=!1;if(!L&&!h.value&&!$.value){const de=re.sourceEvent,x=Y(de),_=x.xSnapped-(I.x??0),S=x.ySnapped-(I.y??0),E=Math.sqrt(_*_+S*S);E!==0&&E<=a.value&&(F==null||F(de),ce=!0)}if(M.length&&!ce){w(M,!1,!1);const[de,x]=Go({id:V,dragItems:M,findNode:g});D({event:re.sourceEvent,node:de,nodes:x})}M=[],h.value=!1,ee=!1,L=!1,I={x:void 0,y:void 0},cancelAnimationFrame(W)};return xe([()=>ye(O),R],([re,ce],de,x)=>{if(ce){const _=Ve(ce);re||(v=Jc().on("start",S=>ue(S,ce)).on("drag",S=>ae(S,ce)).on("end",S=>we(S)).filter(S=>{const E=S.target,H=ye(U);return!S.button&&(!i.value||!Tr(E,`.${i.value}`,ce)&&(!H||Tr(E,H,ce)))}),_.call(v)),x(()=>{_.on(".drag",null),v&&(v.on("start",null),v.on("drag",null),v.on("end",null))})}}),h}function xh(){return{doubleClick:Z(),click:Z(),mouseEnter:Z(),mouseMove:Z(),mouseLeave:Z(),contextMenu:Z(),updateStart:Z(),update:Z(),updateEnd:Z()}}function $h(e,t){const n=xh();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 Eh(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=$e();return i=>{var r;const s=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},a=lh(i)?i.sourceEvent:i,{x:l,y:u}=$t(a,s),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 Hn(){return!0}function va({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:f,nodesConnectable:g,autoPanOnConnect:$,autoPanSpeed:y,findNode:m,panBy:p,startConnection:b,updateConnection:w,endConnection:C,emits:P,viewport:z,edges:D,nodes:F,isValidConnection:R,nodeLookup:O}=$e();let V=null,k=!1,U=null;function h(v){var T;const I=ye(n)==="target",B=Fi(v),A=Er(v.target);if(B&&v.button===0||!B){let L=function(le){x=$t(le,re),X=hh(_n(x,z.value,!1,[1,1]),c.value,O.value,E),_||(S(),_=!0);const ve=Pr(le,{handle:X,connectionMode:u.value,fromNodeId:ye(t),fromHandleId:ye(e),fromType:I?"target":"source",isValidConnection:Y,doc:A,lib:"vue",flowId:a,nodeLookup:O.value},D.value,F.value,m);U=ve.handleDomNode,V=ve.connection,k=ph(!!X,ve.isValid);const me={...j,isValid:k,to:X&&k?hi({x:X.x,y:X.y},z.value):x,toHandle:ve.toHandle,toPosition:k&&ve.toHandle?ve.toHandle.position:gi[E.position],toNode:ve.toHandle?O.value.get(ve.toHandle.nodeId):null};if(!(k&&X&&(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(w(X&&k?hi({x:X.x,y:X.y},z.value):x,ve.toHandle,gh(!!X,k)),j=me,!X&&!k&&!U)return Uo(de);V&&V.source!==V.target&&U&&(Uo(de),de=U,U.classList.add("connecting","vue-flow__handle-connecting"),U.classList.toggle("valid",!!k),U.classList.toggle("vue-flow__handle-valid",!!k))}},W=function(le){(X||U)&&V&&k&&(r?r(le,V):P.connect(V)),P.connectEnd(le),i&&(s==null||s(le)),Uo(de),cancelAnimationFrame(Q),C(le),_=!1,k=!1,V=null,U=null,A.removeEventListener("mousemove",L),A.removeEventListener("mouseup",W),A.removeEventListener("touchmove",L),A.removeEventListener("touchend",W)};const ee=m(ye(t));let Y=ye(o)||R.value||Hn;!Y&&ee&&(Y=(I?ee.isValidSourcePos:ee.isValidTargetPos)||Hn);let X,Q=0;const{x:se,y:ue}=$t(v),ae=A==null?void 0:A.elementFromPoint(se,ue),we=da(ye(i),ae),re=(T=l.value)==null?void 0:T.getBoundingClientRect();if(!re||!we)return;const ce=vh(ye(t),we,ye(e),O.value,u.value);if(!ce)return;let de,x=$t(v,re),_=!1;const S=()=>{if(!$.value)return;const[le,ve]=ua(x,re,y.value);p({x:le,y:ve}),Q=requestAnimationFrame(S)},E={...ce,nodeId:ye(t),type:we,position:ce.position},H=O.value.get(ye(t)),J={inProgress:!0,isValid:null,from:qt(H,E,te.Left,!0),fromHandle:E,fromPosition:E.position,fromNode:H,to:x,toHandle:null,toPosition:gi[E.position],toNode:null};b({nodeId:ye(t),id:ye(e),type:we,position:(ae==null?void 0:ae.getAttribute("data-handlepos"))||te.Top},{x:se-re.left,y:ue-re.top}),P.connectStart({event:v,nodeId:ye(t),handleId:ye(e),handleType:we});let j=J;A.addEventListener("mousemove",L),A.addEventListener("mouseup",W),A.addEventListener("touchmove",L),A.addEventListener("touchend",W)}}function M(v){var T,I;if(!d.value)return;const B=ye(n)==="target";if(!f.value){P.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 A=ye(o)||R.value||Hn;const L=m(ye(t));if(!A&&L&&(A=(B?L.isValidSourcePos:L.isValidTargetPos)||Hn),L&&(typeof L.connectable>"u"?g.value:L.connectable)===!1)return;const W=Er(v.target),ee=Pr(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:A,doc:W,lib:"vue",flowId:a,nodeLookup:O.value},D.value,F.value,m),Y=((T=ee.connection)==null?void 0:T.source)===((I=ee.connection)==null?void 0:I.target);ee.isValid&&ee.connection&&!Y&&P.connect(ee.connection),P.clickConnectEnd(v),C(v,!0)}return{handlePointerDown:h,handleClick:M}}function Sh(){return Vt(ha,"")}function ma(e){const t=e??Sh()??"",n=Vt(ga,pe(null)),{findNode:o,edges:i,emits:r}=$e(),s=o(t);return s||r.error(new Me(ke.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:K(()=>o(s.parentNode)),connectedEdges:K(()=>Mt([s],i.value))}}function Nh(){return{doubleClick:Z(),click:Z(),mouseEnter:Z(),mouseMove:Z(),mouseLeave:Z(),contextMenu:Z(),dragStart:Z(),drag:Z(),dragStop:Z()}}function Ch(e,t){const n=Nh();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 ya(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:s,emits:a}=$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,y=[];for(const m of e.value)if(m.draggable||s&&typeof m.draggable>"u"){const p={x:m.computedPosition.x+g,y:m.computedPosition.y+$},{computedPosition:b}=Vi(m,p,a.error,t.value,m.parentNode?o(m.parentNode):void 0);y.push({id:m.id,position:b,from:m.position,distance:{x:l.x,y:l.y},dimensions:m.dimensions})}n(y,!0,!1)}}const Wo=.1;function dt(){return ko("Viewport not initialized yet."),Promise.resolve(!1)}const kh={zoomIn:dt,zoomOut:dt,zoomTo:dt,fitView:dt,setCenter:dt,fitBounds:dt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:dt,setTransform:dt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Mh(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,s){return new Promise(a=>{const{x:l,y:u}=ta({x:-o,y:-i},e.translateExtent),c=Zt.translate(-l,-u).scale(r);e.d3Selection&&e.d3Zoom?e.d3Zoom.transform(Zo(e.d3Selection,s,()=>{a(!0)}),c):a(!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(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleTo(Zo(e.d3Selection,r==null?void 0:r.duration,()=>{s(!0)}),i):s(!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,s;const a=[];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)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(f.id))&&a.push(f);if(!a.length)return Promise.resolve(!1);const l=Hi(a),{x:u,y:c,zoom:d}=Sr(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,s)=>{const a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-i*a,u=e.dimensions.height/2-r*a;return n(l,u,a,s==null?void 0:s.duration)},fitBounds:(i,r={padding:Wo})=>{const{x:s,y:a,zoom:l}=Sr(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding);return n(s,a,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:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x-r,y:i.y-s};return _n(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x+r,y:i.y+s};return hi(a,e.viewport)}return{x:0,y:0}}}:kh)}function Zo(e,t=0,n){return e.transition().duration(t).on("end",n)}function Ih(e,t,n){const o=ms(!0);return o.run(()=>{const i=()=>{o.run(()=>{let y,m,p=!!(n.nodes.value.length||n.edges.value.length);y=Ft([e.modelValue,()=>{var b,w;return(w=(b=e.modelValue)==null?void 0:b.value)==null?void 0:w.length}],([b])=>{b&&Array.isArray(b)&&(m==null||m.pause(),n.setElements(b),!m&&!p&&b.length?p=!0:m==null||m.resume())}),m=Ft([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([b,w])=>{var C;(C=e.modelValue)!=null&&C.value&&Array.isArray(e.modelValue.value)&&(y==null||y.pause(),e.modelValue.value=[...b,...w],Ye(()=>{y==null||y.resume()}))},{immediate:p}),Xn(()=>{y==null||y.stop(),m==null||m.stop()})})},r=()=>{o.run(()=>{let y,m,p=!!n.nodes.value.length;y=Ft([e.nodes,()=>{var b,w;return(w=(b=e.nodes)==null?void 0:b.value)==null?void 0:w.length}],([b])=>{b&&Array.isArray(b)&&(m==null||m.pause(),n.setNodes(b),!m&&!p&&b.length?p=!0:m==null||m.resume())}),m=Ft([n.nodes,()=>n.nodes.value.length],([b])=>{var w;(w=e.nodes)!=null&&w.value&&Array.isArray(e.nodes.value)&&(y==null||y.pause(),e.nodes.value=[...b],Ye(()=>{y==null||y.resume()}))},{immediate:p}),Xn(()=>{y==null||y.stop(),m==null||m.stop()})})},s=()=>{o.run(()=>{let y,m,p=!!n.edges.value.length;y=Ft([e.edges,()=>{var b,w;return(w=(b=e.edges)==null?void 0:b.value)==null?void 0:w.length}],([b])=>{b&&Array.isArray(b)&&(m==null||m.pause(),n.setEdges(b),!m&&!p&&b.length?p=!0:m==null||m.resume())}),m=Ft([n.edges,()=>n.edges.value.length],([b])=>{var w;(w=e.edges)!=null&&w.value&&Array.isArray(e.edges.value)&&(y==null||y.pause(),e.edges.value=[...b],Ye(()=>{y==null||y.resume()}))},{immediate:p}),Xn(()=>{y==null||y.stop(),m==null||m.stop()})})},a=()=>{o.run(()=>{xe(()=>t.maxZoom,()=>{t.maxZoom&&Ce(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{xe(()=>t.minZoom,()=>{t.minZoom&&Ce(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{xe(()=>t.translateExtent,()=>{t.translateExtent&&Ce(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{xe(()=>t.nodeExtent,()=>{t.nodeExtent&&Ce(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{xe(()=>t.applyDefault,()=>{Ce(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},f=()=>{o.run(()=>{const y=async m=>{let p=m;typeof t.autoConnect=="function"&&(p=await t.autoConnect(m)),p!==!1&&n.addEdges([p])};xe(()=>t.autoConnect,()=>{Ce(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),xe(n.autoConnect,(m,p,b)=>{m?n.onConnect(y):n.hooks.value.connect.off(y),b(()=>{n.hooks.value.connect.off(y)})},{immediate:!0})})},g=()=>{const y=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const m of Object.keys(t)){const p=m;if(!y.includes(p)){const b=_e(()=>t[p]),w=n[p];bt(w)&&o.run(()=>{xe(b,C=>{Ce(C)&&(w.value=C)},{immediate:!0})})}}};(()=>{i(),r(),s(),l(),a(),u(),c(),d(),f(),g()})()}),()=>o.stop()}function Th(){return{edgesChange:Z(),nodesChange:Z(),nodeDoubleClick:Z(),nodeClick:Z(),nodeMouseEnter:Z(),nodeMouseMove:Z(),nodeMouseLeave:Z(),nodeContextMenu:Z(),nodeDragStart:Z(),nodeDrag:Z(),nodeDragStop:Z(),nodesInitialized:Z(),miniMapNodeClick:Z(),miniMapNodeDoubleClick:Z(),miniMapNodeMouseEnter:Z(),miniMapNodeMouseMove:Z(),miniMapNodeMouseLeave:Z(),connect:Z(),connectStart:Z(),connectEnd:Z(),clickConnectStart:Z(),clickConnectEnd:Z(),paneReady:Z(),init:Z(),move:Z(),moveStart:Z(),moveEnd:Z(),selectionDragStart:Z(),selectionDrag:Z(),selectionDragStop:Z(),selectionContextMenu:Z(),selectionStart:Z(),selectionEnd:Z(),viewportChangeStart:Z(),viewportChange:Z(),viewportChangeEnd:Z(),paneScroll:Z(),paneClick:Z(),paneContextMenu:Z(),paneMouseEnter:Z(),paneMouseMove:Z(),paneMouseLeave:Z(),edgeContextMenu:Z(),edgeMouseEnter:Z(),edgeMouseMove:Z(),edgeMouseLeave:Z(),edgeDoubleClick:Z(),edgeClick:Z(),edgeUpdateStart:Z(),edgeUpdate:Z(),edgeUpdateEnd:Z(),updateNodeInternals:Z(),error:Z(e=>ko(e.message))}}function Ah(e,t){hl(()=>{for(const[n,o]of Object.entries(t.value)){const i=r=>{e(n,r)};o.fns.add(i),bo(()=>{o.off(i)})}})}function wa(){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:Ri.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:fn.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:kt.Bezier,style:{}},connectionMode:Et.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:Th(),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 zh=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Ph(e,t,n){const o=Mh(e),i=x=>{const _=x??[];e.hooks.updateNodeInternals.trigger(_)},r=x=>Jf(x,e.nodes,e.edges),s=x=>Qf(x,e.nodes,e.edges),a=x=>Mt(x,e.edges),l=({id:x,type:_,nodeId:S})=>{var E;return Array.from(((E=e.connectionLookup.get(`${S}-${_}-${x??null}`))==null?void 0:E.values())??[])},u=x=>{if(x)return t.value.get(x)},c=x=>{if(x)return n.value.get(x)},d=(x,_,S)=>{var E,H;const ne=[];for(const J of x){const j={id:J.id,type:"position",dragging:S,from:J.from};if(_&&(j.position=J.position,J.parentNode)){const le=u(J.parentNode);j.position={x:j.position.x-(((E=le==null?void 0:le.computedPosition)==null?void 0:E.x)??0),y:j.position.y-(((H=le==null?void 0:le.computedPosition)==null?void 0:H.y)??0)}}ne.push(j)}ne!=null&&ne.length&&e.hooks.nodesChange.trigger(ne)},f=x=>{if(!e.vueFlowRef)return;const _=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!_)return;const S=window.getComputedStyle(_),{m22:E}=new window.DOMMatrixReadOnly(S.transform),H=[];for(const ne of x){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=Dr("source",J.nodeElement,me,E,j.id),j.handleBounds.target=Dr("target",J.nodeElement,me,E,j.id),H.push({id:j.id,type:"dimensions",dimensions:le})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),H.length&&e.hooks.nodesChange.trigger(H)},g=(x,_)=>{const S=new Set,E=new Set;for(const J of x)Pt(J)?S.add(J.id):St(J)&&E.add(J.id);const H=pt(t.value,S,!0),ne=pt(n.value,E);if(e.multiSelectionActive){for(const J of S)H.push(ft(J,_));for(const J of E)ne.push(ft(J,_))}H.length&&e.hooks.nodesChange.trigger(H),ne.length&&e.hooks.edgesChange.trigger(ne)},$=x=>{if(e.multiSelectionActive){const _=x.map(S=>ft(S.id,!0));e.hooks.nodesChange.trigger(_);return}e.hooks.nodesChange.trigger(pt(t.value,new Set(x.map(_=>_.id)),!0)),e.hooks.edgesChange.trigger(pt(n.value))},y=x=>{if(e.multiSelectionActive){const _=x.map(S=>ft(S.id,!0));e.hooks.edgesChange.trigger(_);return}e.hooks.edgesChange.trigger(pt(n.value,new Set(x.map(_=>_.id)))),e.hooks.nodesChange.trigger(pt(t.value,new Set,!0))},m=x=>{g(x,!0)},p=x=>{const S=(x||e.nodes).map(E=>(E.selected=!1,ft(E.id,!1)));e.hooks.nodesChange.trigger(S)},b=x=>{const S=(x||e.edges).map(E=>(E.selected=!1,ft(E.id,!1)));e.hooks.edgesChange.trigger(S)},w=x=>{if(!x||!x.length)return g([],!1);const _=x.reduce((S,E)=>{const H=ft(E.id,!1);return Pt(E)?S.nodes.push(H):S.edges.push(H),S},{nodes:[],edges:[]});_.nodes.length&&e.hooks.nodesChange.trigger(_.nodes),_.edges.length&&e.hooks.edgesChange.trigger(_.edges)},C=x=>{var _;(_=e.d3Zoom)==null||_.scaleExtent([x,e.maxZoom]),e.minZoom=x},P=x=>{var _;(_=e.d3Zoom)==null||_.scaleExtent([e.minZoom,x]),e.maxZoom=x},z=x=>{var _;(_=e.d3Zoom)==null||_.translateExtent(x),e.translateExtent=x},D=x=>{e.nodeExtent=x,i()},F=x=>{var _;(_=e.d3Zoom)==null||_.clickDistance(x)},R=x=>{e.nodesDraggable=x,e.nodesConnectable=x,e.elementsSelectable=x},O=x=>{const _=x instanceof Function?x(e.nodes):x;!e.initialized&&!_.length||(e.nodes=Br(_,u,e.hooks.error.trigger))},V=x=>{const _=x instanceof Function?x(e.edges):x;if(!e.initialized&&!_.length)return;const S=Ko(_,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Xo(e.connectionLookup,n.value,S),e.edges=S},k=x=>{const _=x instanceof Function?x([...e.nodes,...e.edges]):x;!e.initialized&&!_.length||(O(_.filter(Pt)),V(_.filter(St)))},U=x=>{let _=x instanceof Function?x(e.nodes):x;_=Array.isArray(_)?_:[_];const S=Br(_,u,e.hooks.error.trigger),E=[];for(const H of S)E.push(kr(H));E.length&&e.hooks.nodesChange.trigger(E)},h=x=>{let _=x instanceof Function?x(e.edges):x;_=Array.isArray(_)?_:[_];const S=Ko(_,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),E=[];for(const H of S)E.push(kr(H));E.length&&e.hooks.edgesChange.trigger(E)},M=(x,_=!0,S=!1)=>{const E=x instanceof Function?x(e.nodes):x,H=Array.isArray(E)?E:[E],ne=[],J=[];function j(ve){const me=a(ve);for(const Se of me)(!Ce(Se.deletable)||Se.deletable)&&J.push(Ir(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(Mr(Se.id));_&&j(me);for(const Se of me)le(Se.id)}}for(const ve of H){const me=typeof ve=="string"?u(ve):ve;me&&(Ce(me.deletable)&&!me.deletable||(ne.push(Mr(me.id)),_&&j([me]),S&&le(me.id)))}J.length&&e.hooks.edgesChange.trigger(J),ne.length&&e.hooks.nodesChange.trigger(ne)},v=x=>{const _=x instanceof Function?x(e.edges):x,S=Array.isArray(_)?_:[_],E=[];for(const H of S){const ne=typeof H=="string"?c(H):H;ne&&(Ce(ne.deletable)&&!ne.deletable||E.push(Ir(typeof H=="string"?H:H.id,ne.source,ne.target,ne.sourceHandle,ne.targetHandle)))}e.hooks.edgesChange.trigger(E)},T=(x,_,S=!0)=>{const E=c(x.id);if(!E)return!1;const H=e.edges.indexOf(E),ne=wh(x,_,E,S,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===H?J:j),Xo(e.connectionLookup,n.value,[J]),J}return!1},I=(x,_,S={replace:!1})=>{const E=c(x);if(!E)return;const H=typeof _=="function"?_(E):_;E.data=S.replace?H:{...E.data,...H}},B=x=>Cr(x,e.nodes),A=x=>{const _=Cr(x,e.edges);return Xo(e.connectionLookup,n.value,_),_},L=(x,_,S={replace:!1})=>{const E=u(x);if(!E)return;const H=typeof _=="function"?_(E):_;S.replace?e.nodes.splice(e.nodes.indexOf(E),1,H):Object.assign(E,H)},W=(x,_,S={replace:!1})=>{const E=u(x);if(!E)return;const H=typeof _=="function"?_(E):_;E.data=S.replace?H:{...E.data,...H}},ee=(x,_,S=!1)=>{S?e.connectionClickStartHandle=x:e.connectionStartHandle=x,e.connectionEndHandle=null,e.connectionStatus=null,_&&(e.connectionPosition=_)},Y=(x,_=null,S=null)=>{e.connectionStartHandle&&(e.connectionPosition=x,e.connectionEndHandle=_,e.connectionStatus=S)},X=(x,_)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,_?e.connectionClickStartHandle=null:e.connectionStartHandle=null},Q=x=>{const _=Zf(x),S=_?null:ln(x)?x:u(x.id);return!_&&!S?[null,null,_]:[_?x:uo(S),S,_]},se=(x,_=!0,S=e.nodes)=>{const[E,H,ne]=Q(x);if(!E)return[];const J=[];for(const j of S||e.nodes){if(!ne&&(j.id===H.id||!j.computedPosition))continue;const le=uo(j),ve=co(le,E);(_&&ve>0||ve>=Number(E.width)*Number(E.height))&&J.push(j)}return J},ue=(x,_,S=!0)=>{const[E]=Q(x);if(!E)return!1;const H=co(E,_);return S&&H>0||H>=Number(E.width)*Number(E.height)},ae=x=>{const{viewport:_,dimensions:S,d3Zoom:E,d3Selection:H,translateExtent:ne}=e;if(!E||!H||!x.x&&!x.y)return!1;const J=Zt.translate(_.x+x.x,_.y+x.y).scale(_.zoom),j=[[0,0],[S.width,S.height]],le=E.constrain()(J,j,ne),ve=e.viewport.x!==le.x||e.viewport.y!==le.y||e.viewport.zoom!==le.k;return E.transform(H,le),ve},we=x=>{const _=x instanceof Function?x(e):x,S=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ce(_.defaultEdgeOptions)&&(e.defaultEdgeOptions=_.defaultEdgeOptions);const E=_.modelValue||_.nodes||_.edges?[]:void 0;E&&(_.modelValue&&E.push(..._.modelValue),_.nodes&&E.push(..._.nodes),_.edges&&E.push(..._.edges),k(E));const H=()=>{Ce(_.maxZoom)&&P(_.maxZoom),Ce(_.minZoom)&&C(_.minZoom),Ce(_.translateExtent)&&z(_.translateExtent)};for(const ne of Object.keys(_)){const J=ne,j=_[J];![...zh,...S].includes(J)&&Ce(j)&&(e[J]=j)}ni(()=>e.d3Zoom).not.toBeNull().then(H),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:f,setElements:k,setNodes:O,setEdges:V,addNodes:U,addEdges:h,removeNodes:M,removeEdges:v,findNode:u,findEdge:c,updateEdge:T,updateEdgeData:I,updateNode:L,updateNodeData:W,applyEdgeChanges:A,applyNodeChanges:B,addSelectedElements:m,addSelectedNodes:$,addSelectedEdges:y,setMinZoom:C,setMaxZoom:P,setTranslateExtent:z,setNodeExtent:D,setPaneClickDistance:F,removeSelectedElements:w,removeSelectedNodes:p,removeSelectedEdges:b,startConnection:ee,updateConnection:Y,endConnection:X,setInteractive:R,setState:we,getIntersectingNodes:se,getIncomers:r,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:ue,panBy:ae,fitView:x=>o.value.fitView(x),zoomIn:x=>o.value.zoomIn(x),zoomOut:x=>o.value.zoomOut(x),zoomTo:(x,_)=>o.value.zoomTo(x,_),setViewport:(x,_)=>o.value.setViewport(x,_),setTransform:(x,_)=>o.value.setTransform(x,_),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(x,_,S)=>o.value.setCenter(x,_,S),fitBounds:(x,_)=>o.value.fitBounds(x,_),project:x=>o.value.project(x),screenToFlowCoordinate:x=>o.value.screenToFlowCoordinate(x),flowToScreenCoordinate:x=>o.value.flowToScreenCoordinate(x),toObject:()=>{const x=[],_=[];for(const S of e.nodes){const{computedPosition:E,handleBounds:H,selected:ne,dimensions:J,isParent:j,resizing:le,dragging:ve,events:me,...Se}=S;x.push(Se)}for(const S of e.edges){const{selected:E,sourceNode:H,targetNode:ne,events:J,...j}=S;_.push(j)}return JSON.parse(JSON.stringify({nodes:x,edges:_,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:x=>new Promise(_=>{const{nodes:S,edges:E,position:H,zoom:ne,viewport:J}=x;if(S&&O(S),E&&V(E),J!=null&&J.x&&(J!=null&&J.y)||H){const j=(J==null?void 0:J.x)||H[0],le=(J==null?void 0:J.y)||H[1],ve=(J==null?void 0:J.zoom)||ne||e.viewport.zoom;return ni(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:j,y:le,zoom:ve}).then(()=>{_(!0)})})}else _(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const x=wa();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const _=Zt.translate(x.defaultViewport.x??0,x.defaultViewport.y??0).scale(Rt(x.defaultViewport.zoom??1,x.minZoom,x.maxZoom)),S=e.viewportRef.getBoundingClientRect(),E=[[0,0],[S.width,S.height]],H=e.d3Zoom.constrain()(_,E,x.translateExtent);e.d3Zoom.transform(e.d3Selection,H)}we(x)},$destroy:()=>{}}}const Dh=["data-id","data-handleid","data-nodeid","data-handlepos"],Bh={name:"Handle",compatConfig:{MODE:3}},Qt=fe({...Bh,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=fl(e,["position","connectable","connectableStart","connectableEnd","id"]),o=_e(()=>n.type??"source"),i=_e(()=>n.isValidConnection??null),{id:r,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:f}=$e(),{id:g,node:$,nodeEl:y,connectedEdges:m}=ma(),p=pe(),b=_e(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),w=_e(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),C=_e(()=>{var V,k,U,h,M,v;return((V=s.value)==null?void 0:V.nodeId)===g&&((k=s.value)==null?void 0:k.id)===e.id&&((U=s.value)==null?void 0:U.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}),P=_e(()=>{var V,k,U;return((V=a.value)==null?void 0:V.nodeId)===g&&((k=a.value)==null?void 0:k.id)===e.id&&((U=a.value)==null?void 0:U.type)===o.value}),{handlePointerDown:z,handleClick:D}=va({nodeId:g,handleId:e.id,isValidConnection:i,type:o}),F=K(()=>typeof e.connectable=="string"&&e.connectable==="single"?!m.value.some(V=>{const k=V[`${o.value}Handle`];return V[o.value]!==g?!1:k?k===e.id:!0}):typeof e.connectable=="number"?m.value.filter(V=>{const k=V[`${o.value}Handle`];return V[o.value]!==g?!1:k?k===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable($,m.value):Ce(e.connectable)?e.connectable:c.value);Nt(()=>{var V;if(!$.dimensions.width||!$.dimensions.height)return;const k=(V=$.handleBounds[o.value])==null?void 0:V.find(B=>B.id===e.id);if(!u.value||k)return;const U=u.value.querySelector(".vue-flow__transformationpane");if(!y.value||!p.value||!U||!e.id)return;const h=y.value.getBoundingClientRect(),M=p.value.getBoundingClientRect(),v=window.getComputedStyle(U),{m22:T}=new window.DOMMatrixReadOnly(v.transform),I={id:e.id,position:e.position,x:(M.left-h.left)/T,y:(M.top-h.top)/T,type:o.value,nodeId:g,...No(p.value)};$.handleBounds[o.value]=[...$.handleBounds[o.value]??[],I]});function R(V){const k=Fi(V);F.value&&b.value&&(k&&V.button===0||!k)&&z(V)}function O(V){!g||!a.value&&!b.value||F.value&&D(V)}return t({handleClick:D,handlePointerDown:z,onClick:O,onPointerDown:R}),(V,k)=>(G(),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":V.position,class:Ae(["vue-flow__handle",[`vue-flow__handle-${V.position}`,`vue-flow__handle-${e.id}`,N(d),N(f),o.value,{connectable:F.value,connecting:P.value,connectablestart:b.value,connectableend:w.value,connectionindicator:F.value&&(b.value&&!C.value||w.value&&C.value)}]]),onMousedown:R,onTouchstartPassive:R,onClick:O},[Te(V.$slots,"default",{id:V.id})],42,Dh))}}),Io=function({sourcePosition:e=te.Bottom,targetPosition:t=te.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){const a=s.label||n;return[be(Qt,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof a!="string"&&a?be(a):be(Ie,[a]),be(Qt,{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 Oh=Io,To=function({targetPosition:e=te.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label||t;return[be(Qt,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?be(r):be(Ie,[r])]};To.props=["targetPosition","label","isValidTargetPos","connectable","data"];To.inheritAttrs=!1;To.compatConfig={MODE:3};const Rh=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(Ie,[r]),be(Qt,{type:"source",position:e,connectable:n,isValidConnection:o})]};Ao.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Ao.inheritAttrs=!1;Ao.compatConfig={MODE:3};const Hh=Ao,Vh=["transform"],Fh=["width","height","x","y","rx","ry"],Lh=["y"],Yh={name:"EdgeText",compatConfig:{MODE:3}},Gh=fe({...Yh,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=pe({x:0,y:0,width:0,height:0}),n=pe(null),o=K(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);Nt(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,s)=>(G(),ie("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(G(),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,Fh)):Ne("",!0),ge("text",rt(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Te(r.$slots,"default",{},()=>[typeof r.label!="string"?(G(),he(Ii(r.label),{key:0})):(G(),ie(Ie,{key:1},[He(Pe(r.label),1)],64))])],16,Lh)],8,Vh))}}),Uh=["id","d","marker-end","marker-start"],Xh=["d","stroke-width"],Kh={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Mn=fe({...Kh,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=pe(null),o=pe(null),i=pe(null),r=Ti();return t({pathEl:n,interactionEl:o,labelEl:i}),(s,a)=>(G(),ie(Ie,null,[ge("path",rt(N(r),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,Uh),s.interactionWidth?(G(),ie("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Xh)):Ne("",!0),s.label&&s.labelX&&s.labelY?(G(),he(Gh,{key:1,ref_key:"labelEl",ref:i,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Ne("",!0)],64))}});function _a({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[r,a,i,s]}function ba({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+r*.375+a*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function Vn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Vr({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,a;switch(e){case te.Left:s=t-Vn(t-o,r),a=n;break;case te.Right:s=t+Vn(o-t,r),a=n;break;case te.Top:s=t,a=n-Vn(n-i,r);break;case te.Bottom:s=t,a=n+Vn(i-n,r);break}return[s,a]}function Li(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top,curvature:a=.25}=e,[l,u]=Vr({pos:o,x1:t,y1:n,x2:i,y2:r,c:a}),[c,d]=Vr({pos:s,x1:i,y1:r,x2:t,y2:n,c:a}),[f,g,$,y]=ba({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,$,y]}function Fr({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case te.Left:case te.Right:r=.5*(t+o),s=n;break;case te.Top:case te.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function xa(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top}=e,[a,l]=Fr({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=Fr({pos:s,x1:i,y1:r,x2:t,y2:n}),[d,f,g,$]=ba({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${i},${r}`,d,f,g,$]}const Lr={[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 Wh({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 Yr(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Zh({source:e,sourcePosition:t=te.Bottom,target:n,targetPosition:o=te.Top,center:i,offset:r}){const s=Lr[t],a=Lr[o],l={x:e.x+s.x*r,y:e.y+s.y*r},u={x:n.x+a.x*r,y:n.y+a.y*r},c=Wh({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let g,$,y;const m={x:0,y:0},p={x:0,y:0},[b,w,C,P]=_a({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){$=i.x??b,y=i.y??w;const D=[{x:$,y:l.y},{x:$,y:u.y}],F=[{x:l.x,y},{x:u.x,y}];s[d]===f?g=d==="x"?D:F:g=d==="x"?F:D}else{const D=[{x:l.x,y:u.y}],F=[{x:u.x,y:l.y}];if(d==="x"?g=s.x===f?F:D:g=s.y===f?D:F,t===o){const U=Math.abs(e[d]-n[d]);if(U<=r){const h=Math.min(r-1,r-U);s[d]===f?m[d]=(l[d]>e[d]?-1:1)*h:p[d]=(u[d]>n[d]?-1:1)*h}}if(t!==o){const U=d==="x"?"y":"x",h=s[d]===a[U],M=l[U]>u[U],v=l[U]<u[U];(s[d]===1&&(!h&&M||h&&v)||s[d]!==1&&(!h&&v||h&&M))&&(g=d==="x"?D:F)}const R={x:l.x+m.x,y:l.y+m.y},O={x:u.x+p.x,y:u.y+p.y},V=Math.max(Math.abs(R.x-g[0].x),Math.abs(O.x-g[0].x)),k=Math.max(Math.abs(R.y-g[0].y),Math.abs(O.y-g[0].y));V>=k?($=(R.x+O.x)/2,y=g[0].y):($=g[0].x,y=(R.y+O.y)/2)}return[[e,{x:l.x+m.x,y:l.y+m.y},...g,{x:u.x+p.x,y:u.y+p.y},n],$,y,C,P]}function qh(e,t,n,o){const i=Math.min(Yr(e,t)/2,Yr(t,n)/2,o),{x:r,y:s}=t;if(e.x===r&&r===n.x||e.y===s&&s===n.y)return`L${r} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${s}Q ${r},${s} ${r},${s+i*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${s+i*l}Q ${r},${s} ${r+i*a},${s}`}function vi(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,f,g,$,y]=Zh({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((p,b,w)=>{let C;return w>0&&w<d.length-1?C=qh(d[w-1],b,d[w+1],a):C=`${w===0?"M":"L"}${b.x} ${b.y}`,p+=C,p},""),f,g,$,y]}function Qh(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,a,l]=_a({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,a,l]}const Jh=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]=Qh(e);return be(Mn,{path:n,labelX:o,labelY:i,...t,...e})}}}),jh=Jh,eg=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]=vi({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return be(Mn,{path:n,labelX:o,labelY:i,...t,...e})}}}),$a=eg,tg=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($a,{...e,...t,borderRadius:0})}}),ng=tg,og=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]=Li({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return be(Mn,{path:n,labelX:o,labelY:i,...t,...e})}}}),ig=og,rg=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]=xa({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return be(Mn,{path:n,labelX:o,labelY:i,...t,...e})}}}),sg=rg,ag={input:Hh,default:Oh,output:Rh},lg={default:ig,straight:jh,step:ng,smoothstep:$a,simplebezier:sg};function ug(e,t,n){const o=K(()=>y=>t.value.get(y)),i=K(()=>y=>n.value.get(y)),r=K(()=>{const y={...lg,...e.edgeTypes},m=Object.keys(y);for(const p of e.edges)p.type&&!m.includes(p.type)&&(y[p.type]=p.type);return y}),s=K(()=>{const y={...ag,...e.nodeTypes},m=Object.keys(y);for(const p of e.nodes)p.type&&!m.includes(p.type)&&(y[p.type]=p.type);return y}),a=K(()=>e.onlyRenderVisibleElements?aa(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 y=[];for(const m of e.edges){const p=t.value.get(m.source),b=t.value.get(m.target);sh({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})&&y.push(m)}return y}return e.edges}),u=K(()=>[...a.value,...l.value]),c=K(()=>{const y=[];for(const m of e.nodes)m.selected&&y.push(m);return y}),d=K(()=>{const y=[];for(const m of e.edges)m.selected&&y.push(m);return y}),f=K(()=>[...c.value,...d.value]),g=K(()=>{const y=[];for(const m of e.nodes)m.dimensions.width&&m.dimensions.height&&m.handleBounds!==void 0&&y.push(m);return y}),$=K(()=>a.value.length>0&&g.value.length===a.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:f,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:g,areNodesInitialized:$}}class It{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)??It.instance;return It.instance=o??new It,n&&(n.config.globalProperties.$vueFlowStorage=It.instance),It.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=wa(),i=dl(o),r={};for(const[f,g]of Object.entries(i.hooks)){const $=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;r[$]=g.on}const s={};for(const[f,g]of Object.entries(i.hooks))s[f]=g.trigger;const a=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=ug(i,a,l),c=Ph(i,a,l);c.setState({...i,...n});const d={...r,...u,...c,...au(i),nodeLookup:a,edgeLookup:l,emits:s,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=It.getInstance(),n=vs(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=r??(n==null?void 0:n.vueFlowId);let a;if(n){const l=Vt(Hr,null);typeof l<"u"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=r??t.getId(),u=t.create(l,i);a=u,(n??ms(!0)).run(()=>{xe(u.applyDefault,(d,f,g)=>{const $=m=>{u.applyNodeChanges(m)},y=m=>{u.applyEdgeChanges(m)};d?(u.onNodesChange($),u.onEdgesChange(y)):(u.hooks.value.nodesChange.off($),u.hooks.value.edgesChange.off(y)),g(()=>{u.hooks.value.nodesChange.off($),u.hooks.value.edgesChange.off(y)})},{immediate:!0}),bo(()=>{if(a){const d=t.get(a.id);d?d.$destroy():ko(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(Bt(Hr,a),n.vueFlowId=a.id),o){const l=Nn();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new Me(ke.USEVUEFLOW_OPTIONS))}return a}function cg(e){const{emits:t,dimensions:n}=$e();let o;Nt(()=>{const i=e.value,r=()=>{if(!i)return;const s=No(i);(s.width===0||s.height===0)&&t.error(new Me(ke.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:s.width||500,height:s.height||500}};r(),window.addEventListener("resize",r),i&&(o=new ResizeObserver(()=>r()),o.observe(i)),ys(()=>{window.removeEventListener("resize",r),o&&i&&o.unobserve(i)})})}const dg={name:"UserSelection",compatConfig:{MODE:3}},fg=fe({...dg,props:{userSelectionRect:{}},setup(e){return(t,n)=>(G(),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))}}),hg=["tabIndex"],gg={name:"NodesSelection",compatConfig:{MODE:3}},pg=fe({...gg,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=$e(),a=ya(),l=pe(null),u=pa({el:l,onStart($){t.selectionDragStart($)},onDrag($){t.selectionDrag($)},onStop($){t.selectionDragStop($)}});Nt(()=>{var $;r.value||($=l.value)==null||$.focus({preventScroll:!0})});const c=K(()=>Hi(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(),a({x:Ut[$.key].x,y:Ut[$.key].y},$.shiftKey))}return($,y)=>!N(s)&&c.value.width&&c.value.height?(G(),ie("div",{key:0,class:Ae(["vue-flow__nodesselection vue-flow__container",N(i)]),style:Ee({transform:`translate(${N(n).x}px,${N(n).y}px) scale(${N(n).zoom})`})},[ge("div",{ref_key:"el",ref:l,class:Ae([{dragging:N(u)},"vue-flow__nodesselection-rect"]),style:Ee(d.value),tabIndex:N(r)?void 0:-1,onContextmenu:f,onKeydown:g},null,46,hg)],6)):Ne("",!0)}});function vg(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const mg={name:"Pane",compatConfig:{MODE:3}},yg=fe({...mg,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:f,removeEdges:g,selectionMode:$,deleteKeyCode:y,multiSelectionKeyCode:m,multiSelectionActive:p,edgeLookup:b,nodeLookup:w,connectionLookup:C,defaultEdgeOptions:P,connectionStartHandle:z}=$e(),D=pe(null),F=pe(new Set),R=pe(new Set),O=pe(),V=_e(()=>l.value&&(e.isSelecting||r.value)),k=_e(()=>z.value!==null);let U=!1,h=!1;const M=hn(y,{actInsideInputWithModifier:!1}),v=hn(m);xe(M,Y=>{Y&&(f(d.value),g(c.value),u.value=!1)}),xe(v,Y=>{p.value=Y});function T(Y,X){return Q=>{Q.target===X&&(Y==null||Y(Q))}}function I(Y){if(U||k.value){U=!1;return}i.paneClick(Y),s(),u.value=!1}function B(Y){Y.preventDefault(),Y.stopPropagation(),i.paneContextMenu(Y)}function A(Y){i.paneScroll(Y)}function L(Y){var X,Q,se;if(O.value=(X=t.value)==null?void 0:X.getBoundingClientRect(),!l.value||!e.isSelecting||Y.button!==0||Y.target!==D.value||!O.value)return;(se=(Q=Y.target)==null?void 0:Q.setPointerCapture)==null||se.call(Q,Y.pointerId);const{x:ue,y:ae}=vg(Y,O.value);h=!0,U=!1,s(),a.value={width:0,height:0,startX:ue,startY:ae,x:ue,y:ae},i.selectionStart(Y)}function W(Y){var X;if(!O.value||!a.value)return;U=!0;const{x:Q,y:se}=$t(Y,O.value),{startX:ue=0,startY:ae=0}=a.value,we={startX:ue,startY:ae,x:Q<ue?Q:ue,y:se<ae?se:ae,width:Math.abs(Q-ue),height:Math.abs(se-ae)},re=F.value,ce=R.value;F.value=new Set(aa(n.value,we,o.value,$.value===Ri.Partial,!0).map(x=>x.id)),R.value=new Set;const de=((X=P.value)==null?void 0:X.selectable)??!0;for(const x of F.value){const _=C.value.get(x);if(_)for(const{edgeId:S}of _.values()){const E=b.value.get(S);E&&(E.selectable??de)&&R.value.add(S)}}if(!Rr(re,F.value)){const x=pt(w.value,F.value,!0);i.nodesChange(x)}if(!Rr(ce,R.value)){const x=pt(b.value,R.value);i.edgesChange(x)}a.value=we,r.value=!0,u.value=!1}function ee(Y){var X;Y.button!==0||!h||((X=Y.target)==null||X.releasePointerCapture(Y.pointerId),!r.value&&a.value&&Y.target===D.value&&I(Y),r.value=!1,a.value=null,u.value=F.value.size>0,i.selectionEnd(Y),e.selectionKeyPressed&&(U=!1),h=!1)}return(Y,X)=>(G(),ie("div",{ref_key:"container",ref:D,class:Ae(["vue-flow__pane vue-flow__container",{selection:Y.isSelecting}]),onClick:X[0]||(X[0]=Q=>V.value?void 0:T(I,D.value)(Q)),onContextmenu:X[1]||(X[1]=Q=>T(B,D.value)(Q)),onWheelPassive:X[2]||(X[2]=Q=>T(A,D.value)(Q)),onPointerenter:X[3]||(X[3]=Q=>V.value?void 0:N(i).paneMouseEnter(Q)),onPointerdown:X[4]||(X[4]=Q=>V.value?L(Q):N(i).paneMouseMove(Q)),onPointermove:X[5]||(X[5]=Q=>V.value?W(Q):N(i).paneMouseMove(Q)),onPointerup:X[6]||(X[6]=Q=>V.value?ee(Q):void 0),onPointerleave:X[7]||(X[7]=Q=>N(i).paneMouseLeave(Q))},[Te(Y.$slots,"default"),N(r)&&N(a)?(G(),he(fg,{key:0,"user-selection-rect":N(a)},null,8,["user-selection-rect"])):Ne("",!0),N(u)&&N(d).length?(G(),he(pg,{key:1})):Ne("",!0)],34))}}),wg={name:"Transform",compatConfig:{MODE:3}},_g=fe({...wg,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(s,a)=>(G(),ie("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ee({transform:r.value,opacity:i.value?0:void 0})},[Te(s.$slots,"default")],4))}}),bg={name:"Viewport",compatConfig:{MODE:3}},xg=fe({...bg,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:f,zoomOnPinch:g,zoomOnScroll:$,preventScrolling:y,noWheelClassName:m,noPanClassName:p,emits:b,connectionStartHandle:w,userSelectionActive:C,paneDragging:P,d3Zoom:z,d3Selection:D,d3ZoomHandler:F,viewport:R,viewportRef:O,paneClickDistance:V}=$e();cg(O);const k=pe(!1),U=pe(!1);let h=null,M=!1,v=0,T={x:0,y:0,zoom:0};const I=hn(a),B=hn(s),A=hn(r),L=_e(()=>(!B.value||B.value&&s.value===!0)&&(I.value||d.value)),W=_e(()=>I.value||l.value),ee=_e(()=>B.value||s.value===!0&&L.value!==!0);Nt(()=>{if(!O.value){ko("Viewport element is missing");return}const ae=O.value,we=ae.getBoundingClientRect(),re=Yf().clickDistance(V.value).scaleExtent([t.value,n.value]).translateExtent(i.value),ce=Ve(ae).call(re),de=ce.on("wheel.zoom"),x=Zt.translate(o.value.x??0,o.value.y??0).scale(Rt(o.value.zoom??1,t.value,n.value)),_=[[0,0],[we.width,we.height]],S=re.constrain()(x,_,i.value);re.transform(ce,S),re.wheelDelta(X),z.value=re,D.value=ce,F.value=de,R.value={x:S.x,y:S.y,zoom:S.k},re.on("start",E=>{var H;if(!E.sourceEvent)return null;v=E.sourceEvent.button,k.value=!0;const ne=se(E.transform);((H=E.sourceEvent)==null?void 0:H.type)==="mousedown"&&(P.value=!0),T=ne,b.viewportChangeStart(ne),b.moveStart({event:E,flowTransform:ne})}),re.on("end",E=>{if(!E.sourceEvent)return null;if(k.value=!1,P.value=!1,Y(L.value,v??0)&&!M&&b.paneContextMenu(E.sourceEvent),M=!1,Q(T,E.transform)){const H=se(E.transform);T=H,b.viewportChangeEnd(H),b.moveEnd({event:E,flowTransform:H})}}),re.filter(E=>{var H;const ne=A.value||$.value,J=g.value&&E.ctrlKey,j=E.button;if(j===1&&E.type==="mousedown"&&(ue(E,"vue-flow__node")||ue(E,"vue-flow__edge")))return!0;if(!L.value&&!ne&&!W.value&&!f.value&&!g.value||C.value||!f.value&&E.type==="dblclick"||ue(E,m.value)&&E.type==="wheel"||ue(E,p.value)&&(E.type!=="wheel"||W.value&&E.type==="wheel"&&!A.value)||!g.value&&E.ctrlKey&&E.type==="wheel"||!ne&&!W.value&&!J&&E.type==="wheel")return!1;if(!g&&E.type==="touchstart"&&((H=E.touches)==null?void 0:H.length)>1)return E.preventDefault(),!1;if(!L.value&&(E.type==="mousedown"||E.type==="touchstart")||s.value===!0&&Array.isArray(d.value)&&d.value.includes(0)&&j===0||Array.isArray(d.value)&&!d.value.includes(j)&&(E.type==="mousedown"||E.type==="touchstart"))return!1;const le=Array.isArray(d.value)&&d.value.includes(j)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!j||j<=1;return(!E.ctrlKey||I.value||E.type==="wheel")&&le}),xe([C,L],()=>{C.value&&!k.value?re.on("zoom",null):C.value||re.on("zoom",E=>{R.value={x:E.transform.x,y:E.transform.y,zoom:E.transform.k};const H=se(E.transform);M=Y(L.value,v??0),b.viewportChange(H),b.move({event:E,flowTransform:H})})},{immediate:!0}),xe([C,W,u,A,g,y,m],()=>{W.value&&!A.value&&!C.value?ce.on("wheel.zoom",E=>{if(ue(E,m.value))return!1;const H=A.value||$.value,ne=g.value&&E.ctrlKey;if(!(!y.value||W.value||H||ne))return!1;E.preventDefault(),E.stopImmediatePropagation();const j=ce.property("__zoom").k||1,le=ho();if(!I.value&&E.ctrlKey&&g.value&&le){const en=We(E),ja=X(E),el=j*2**ja;re.scaleTo(ce,el,en,E);return}const ve=E.deltaMode===1?20:1;let me=u.value===fn.Vertical?0:E.deltaX*ve,Se=u.value===fn.Horizontal?0:E.deltaY*ve;!le&&E.shiftKey&&u.value!==fn.Vertical&&!me&&Se&&(me=Se,Se=0),re.translateBy(ce,-(me/j)*c.value,-(Se/j)*c.value);const Xe=se(ce.property("__zoom"));h&&clearTimeout(h),U.value?(b.move({event:E,flowTransform:Xe}),b.viewportChange(Xe),h=setTimeout(()=>{b.moveEnd({event:E,flowTransform:Xe}),b.viewportChangeEnd(Xe),U.value=!1},150)):(U.value=!0,b.moveStart({event:E,flowTransform:Xe}),b.viewportChangeStart(Xe))},{passive:!1}):typeof de<"u"&&ce.on("wheel.zoom",function(E,H){const ne=!y.value&&E.type==="wheel"&&!E.ctrlKey,J=A.value||$.value,j=g.value&&E.ctrlKey;if(!J&&!l.value&&!j&&E.type==="wheel"||ne||ue(E,m.value))return null;E.preventDefault(),de.call(this,E,H)},{passive:!1})},{immediate:!0})});function Y(ae,we){return we===2&&Array.isArray(ae)&&ae.includes(2)}function X(ae){const we=ae.ctrlKey&&ho()?10:1;return-ae.deltaY*(ae.deltaMode===1?.05:ae.deltaMode?1:.002)*we}function Q(ae,we){return ae.x!==we.x&&!Number.isNaN(we.x)||ae.y!==we.y&&!Number.isNaN(we.y)||ae.zoom!==we.k&&!Number.isNaN(we.k)}function se(ae){return{x:ae.x,y:ae.y,zoom:ae.k}}function ue(ae,we){return ae.target.closest(`.${we}`)}return(ae,we)=>(G(),ie("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[q(yg,{"is-selecting":ee.value,"selection-key-pressed":N(B),class:Ae({connecting:!!N(w),dragging:N(P),draggable:N(d)===!0||Array.isArray(N(d))&&N(d).includes(0)})},{default:oe(()=>[q(_g,null,{default:oe(()=>[Te(ae.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),$g=["id"],Eg=["id"],Sg=["id"],Ng={name:"A11yDescriptions",compatConfig:{MODE:3}},Cg=fe({...Ng,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=$e();return(i,r)=>(G(),ie(Ie,null,[ge("div",{id:`${N(Js)}-${N(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+Pe(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,$g),ge("div",{id:`${N(js)}-${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,Eg),N(n)?Ne("",!0):(G(),ie("div",{key:0,id:`${N(Wf)}-${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%)"}},Pe(N(o)),9,Sg))],64))}});function kg(){const e=$e();xe(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Mg(e,t,n){return n===te.Left?e-t:n===te.Right?e+t:e}function Ig(e,t,n){return n===te.Top?e-t:n===te.Bottom?e+t:e}const Yi=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:Mg(t,e,o),cy:Ig(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Yi.props=["radius","centerX","centerY","position","type"];Yi.compatConfig={MODE:3};const Gr=Yi,Tg=fe({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:f,multiSelectionActive:g,disableKeyboardA11y:$,elementsSelectable:y,edgesUpdatable:m,edgesFocusable:p,hooks:b}=$e(),w=K(()=>c(e.id)),{emit:C,on:P}=$h(w.value,r),z=Vt(Mo),D=Nn(),F=pe(!1),R=pe(!1),O=pe(""),V=pe(null),k=pe("source"),U=pe(null),h=_e(()=>typeof w.value.selectable>"u"?y.value:w.value.selectable),M=_e(()=>typeof w.value.updatable>"u"?m.value:w.value.updatable),v=_e(()=>typeof w.value.focusable>"u"?p.value:w.value.focusable);Bt(_h,e.id),Bt(bh,U);const T=K(()=>w.value.class instanceof Function?w.value.class(w.value):w.value.class),I=K(()=>w.value.style instanceof Function?w.value.style(w.value):w.value.style),B=K(()=>{const _=w.value.type||"default",S=z==null?void 0:z[`edge-${_}`];if(S)return S;let E=w.value.template??l.value[_];if(typeof E=="string"&&D){const H=Object.keys(D.appContext.components);H&&H.includes(_)&&(E=ws(_,!1))}return E&&typeof E!="string"?E:(r.error(new Me(ke.EDGE_TYPE_MISSING,E)),!1)}),{handlePointerDown:A}=va({nodeId:O,handleId:V,type:k,isValidConnection:f,edgeUpdaterType:k,onEdgeUpdate:ee,onEdgeUpdateEnd:Y});return()=>{const _=d(w.value.source),S=d(w.value.target),E="pathOptions"in w.value?w.value.pathOptions:{};if(!_&&!S)return r.error(new Me(ke.EDGE_SOURCE_TARGET_MISSING,w.value.id,w.value.source,w.value.target)),null;if(!_)return r.error(new Me(ke.EDGE_SOURCE_MISSING,w.value.id,w.value.source)),null;if(!S)return r.error(new Me(ke.EDGE_TARGET_MISSING,w.value.id,w.value.target)),null;if(!w.value||w.value.hidden||_.hidden||S.hidden)return null;let H;o.value===Et.Strict?H=_.handleBounds.source:H=[..._.handleBounds.source||[],..._.handleBounds.target||[]];const ne=Ar(H,w.value.sourceHandle);let J;o.value===Et.Strict?J=S.handleBounds.target:J=[...S.handleBounds.target||[],...S.handleBounds.source||[]];const j=Ar(J,w.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(_,ne,le),{x:Xe,y:en}=qt(S,j,ve);return w.value.sourceX=me,w.value.sourceY=Se,w.value.targetX=Xe,w.value.targetY=en,be("g",{ref:U,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${B.value===!1?"default":w.value.type||"default"}`,a.value,T.value,{updating:F.value,selected:w.value.selected,animated:w.value.animated,inactive:!h.value&&!b.value.edgeClick.hasListeners()}],onClick:Q,onContextmenu:se,onDblclick:ue,onMouseenter:ae,onMousemove:we,onMouseleave:re,onKeyDown:v.value?x:void 0,tabIndex:v.value?0:void 0,"aria-label":w.value.ariaLabel===null?void 0:w.value.ariaLabel||`Edge from ${w.value.source} to ${w.value.target}`,"aria-describedby":v.value?`${js}-${t}`:void 0,role:v.value?"button":"img"},[R.value?null:be(B.value===!1?l.value.default:B.value,{id:e.id,sourceNode:_,targetNode:S,source:w.value.source,target:w.value.target,type:w.value.type,updatable:M.value,selected:w.value.selected,animated:w.value.animated,label:w.value.label,labelStyle:w.value.labelStyle,labelShowBg:w.value.labelShowBg,labelBgStyle:w.value.labelBgStyle,labelBgPadding:w.value.labelBgPadding,labelBgBorderRadius:w.value.labelBgBorderRadius,data:w.value.data,events:{...w.value.events,...P},style:I.value,markerStart:`url('#${bn(w.value.markerStart,t)}')`,markerEnd:`url('#${bn(w.value.markerEnd,t)}')`,sourcePosition:le,targetPosition:ve,sourceX:me,sourceY:Se,targetX:Xe,targetY:en,sourceHandleId:w.value.sourceHandle,targetHandleId:w.value.targetHandle,interactionWidth:w.value.interactionWidth,...E}),[M.value==="source"||M.value===!0?[be("g",{onMousedown:ce,onMouseenter:L,onMouseout:W},be(Gr,{position:le,centerX:me,centerY:Se,radius:i.value,type:"source","data-type":"source"}))]:null,M.value==="target"||M.value===!0?[be("g",{onMousedown:de,onMouseenter:L,onMouseout:W},be(Gr,{position:ve,centerX:Xe,centerY:en,radius:i.value,type:"target","data-type":"target"}))]:null]])};function L(){F.value=!0}function W(){F.value=!1}function ee(_,S){C.update({event:_,edge:w.value,connection:S})}function Y(_){C.updateEnd({event:_,edge:w.value}),R.value=!1}function X(_,S){_.button===0&&(R.value=!0,O.value=S?w.value.target:w.value.source,V.value=(S?w.value.targetHandle:w.value.sourceHandle)??null,k.value=S?"target":"source",C.updateStart({event:_,edge:w.value}),A(_))}function Q(_){var S;const E={event:_,edge:w.value};h.value&&(s.value=!1,w.value.selected&&g.value?(u([w.value]),(S=U.value)==null||S.blur()):n([w.value])),C.click(E)}function se(_){C.contextMenu({event:_,edge:w.value})}function ue(_){C.doubleClick({event:_,edge:w.value})}function ae(_){C.mouseEnter({event:_,edge:w.value})}function we(_){C.mouseMove({event:_,edge:w.value})}function re(_){C.mouseLeave({event:_,edge:w.value})}function ce(_){X(_,!0)}function de(_){X(_,!1)}function x(_){var S;!$.value&&ea.includes(_.key)&&h.value&&(_.key==="Escape"?((S=U.value)==null||S.blur(),u([c(e.id)])):n([c(e.id)]))}}}),Ag=Tg,zg=fe({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:s,connectionLineStyle:a,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}),y=K(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),m=K(()=>l.value.markerStart?`url(#${bn(l.value.markerStart,t)})`:""),p=K(()=>l.value.markerEnd?`url(#${bn(l.value.markerEnd,t)})`:"");return()=>{var b,w,C;if(!g.value||!o.value)return null;const P=o.value.id,z=o.value.type,D=g.value.handleBounds;let F=(D==null?void 0:D[z])??[];if(n.value===Et.Loose){const I=(D==null?void 0:D[z==="source"?"target":"source"])??[];F=[...F,...I]}if(!F)return null;const R=(P?F.find(I=>I.id===P):F[0])??null,O=(R==null?void 0:R.position)??te.Top,{x:V,y:k}=qt(g.value,R,O);let U=null;$.value&&(n.value===Et.Strict?U=((b=$.value.handleBounds[z==="source"?"target":"source"])==null?void 0:b.find(I=>{var B;return I.id===((B=i.value)==null?void 0:B.id)}))||null:U=((w=[...$.value.handleBounds.source??[],...$.value.handleBounds.target??[]])==null?void 0:w.find(I=>{var B;return I.id===((B=i.value)==null?void 0:B.id)}))||null);const h=((C=i.value)==null?void 0:C.position)??(O?gi[O]:null);if(!O||!h)return null;const M=s.value??l.value.type??kt.Bezier;let v="";const T={sourceX:V,sourceY:k,sourcePosition:O,targetX:y.value.x,targetY:y.value.y,targetPosition:h};return M===kt.Bezier?[v]=Li(T):M===kt.Step?[v]=vi({...T,borderRadius:0}):M===kt.SmoothStep?[v]=vi(T):M===kt.SimpleBezier?[v]=xa(T):v=`M${V},${k} ${y.value.x},${y.value.y}`,be("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},be("g",{class:"vue-flow__connection"},f?be(f,{sourceX:V,sourceY:k,sourcePosition:O,targetX:y.value.x,targetY:y.value.y,targetPosition:h,sourceNode:g.value,sourceHandle:R,targetNode:$.value,targetHandle:U,markerEnd:p.value,markerStart:m.value,connectionStatus:u.value}):be("path",{d:v,class:[l.value.class,u,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":p.value,"marker-start":m.value})))}}}),Pg=zg,Dg=["id","markerWidth","markerHeight","markerUnits","orient"],Bg={name:"MarkerType",compatConfig:{MODE:3}},Og=fe({...Bg,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)=>(G(),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(di).ArrowClosed?(G(),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)):Ne("",!0),t.type===N(di).Arrow?(G(),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)):Ne("",!0)],8,Dg))}}),Rg={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Hg={name:"MarkerDefinitions",compatConfig:{MODE:3}},Vg=fe({...Hg,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=$e(),r=K(()=>{const s=new Set,a=[],l=u=>{if(u){const c=bn(u,t);s.has(c)||(typeof u=="object"?a.push({...u,id:c,color:u.color||i.value}):a.push({id:c,color:i.value,type:u}),s.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 a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(G(),ie("svg",Rg,[ge("defs",null,[(G(!0),ie(Ie,null,_t(r.value,l=>(G(),he(Og,{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))])]))}}),Fg={name:"Edges",compatConfig:{MODE:3}},Lg=fe({...Fg,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=$e();return(i,r)=>(G(),ie(Ie,null,[q(Vg),(G(!0),ie(Ie,null,_t(N(n),s=>(G(),ie("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ee({zIndex:N(ah)(s,N(t),N(o))})},[q(N(Ag),{id:s.id},null,8,["id"])],4))),128)),q(N(Pg))],64))}}),Yg=fe({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:f,elevateNodesOnSelect:g,disableKeyboardA11y:$,ariaLiveMessage:y,snapToGrid:m,snapGrid:p,nodeDragThreshold:b,nodesDraggable:w,elementsSelectable:C,nodesConnectable:P,nodesFocusable:z,hooks:D}=$e(),F=pe(null);Bt(ga,F),Bt(ha,e.id);const R=Vt(Mo),O=Nn(),V=ya(),{node:k,parentNode:U}=ma(e.id),{emit:h,on:M}=Ch(k,s),v=_e(()=>typeof k.draggable>"u"?w.value:k.draggable),T=_e(()=>typeof k.selectable>"u"?C.value:k.selectable),I=_e(()=>typeof k.connectable>"u"?P.value:k.connectable),B=_e(()=>typeof k.focusable>"u"?z.value:k.focusable),A=_e(()=>T.value||v.value||D.value.nodeClick.hasListeners()||D.value.nodeDoubleClick.hasListeners()||D.value.nodeMouseEnter.hasListeners()||D.value.nodeMouseMove.hasListeners()||D.value.nodeMouseLeave.hasListeners()),L=_e(()=>!!k.dimensions.width&&!!k.dimensions.height),W=K(()=>{const S=k.type||"default",E=R==null?void 0:R[`node-${S}`];if(E)return E;let H=k.template||d.value[S];if(typeof H=="string"&&O){const ne=Object.keys(O.appContext.components);ne&&ne.includes(S)&&(H=ws(S,!1))}return H&&typeof H!="string"?H:(s.error(new Me(ke.NODE_TYPE_MISSING,H)),!1)}),ee=pa({id:e.id,el:F,disabled:()=>!v.value,selectable:T,dragHandle:()=>k.dragHandle,onStart(S){h.dragStart(S)},onDrag(S){h.drag(S)},onStop(S){h.dragStop(S)},onClick(S){x(S)}}),Y=K(()=>k.class instanceof Function?k.class(k):k.class),X=K(()=>{const S=(k.style instanceof Function?k.style(k):k.style)||{},E=k.width instanceof Function?k.width(k):k.width,H=k.height instanceof Function?k.height(k):k.height;return!S.width&&E&&(S.width=typeof E=="string"?E:`${E}px`),!S.height&&H&&(S.height=typeof H=="string"?H:`${H}px`),S}),Q=_e(()=>Number(k.zIndex??X.value.zIndex??0));return c(S=>{(S.includes(e.id)||!S.length)&&ue()}),Nt(()=>{xe(()=>k.hidden,(S=!1,E,H)=>{!S&&F.value&&(e.resizeObserver.observe(F.value),H(()=>{F.value&&e.resizeObserver.unobserve(F.value)}))},{immediate:!0,flush:"post"})}),xe([()=>k.type,()=>k.sourcePosition,()=>k.targetPosition],()=>{Ye(()=>{u([{id:e.id,nodeElement:F.value,forceUpdate:!0}])})}),xe([()=>k.position.x,()=>k.position.y,()=>{var S;return(S=U.value)==null?void 0:S.computedPosition.x},()=>{var S;return(S=U.value)==null?void 0:S.computedPosition.y},()=>{var S;return(S=U.value)==null?void 0:S.computedPosition.z},Q,()=>k.selected,()=>k.dimensions.height,()=>k.dimensions.width,()=>{var S;return(S=U.value)==null?void 0:S.dimensions.height},()=>{var S;return(S=U.value)==null?void 0:S.dimensions.width}],([S,E,H,ne,J,j])=>{const le={x:S,y:E,z:j+(g.value&&k.selected?1e3:0)};typeof H<"u"&&typeof ne<"u"?k.computedPosition=th({x:H,y:ne,z:J},le):k.computedPosition=le},{flush:"post",immediate:!0}),xe([()=>k.extent,f],([S,E],[H,ne])=>{(S!==H||E!==ne)&&se()}),k.extent==="parent"||typeof k.extent=="object"&&"range"in k.extent&&k.extent.range==="parent"?ni(()=>L).toBe(!0).then(se):se(),()=>k.hidden?null:be("div",{ref:F,"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:T.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:A.value?"all":"none",...X.value},tabIndex:B.value?0:void 0,role:B.value?"button":void 0,"aria-describedby":$.value?void 0:`${Js}-${t}`,"aria-label":k.ariaLabel,onMouseenter:ae,onMousemove:we,onMouseleave:re,onContextmenu:ce,onClick:x,onDblclick:de,onKeydown:_},[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 se(){const S=k.computedPosition,{computedPosition:E,position:H}=Vi(k,m.value?Co(S,p.value):S,s.error,f.value,U.value);(k.computedPosition.x!==E.x||k.computedPosition.y!==E.y)&&(k.computedPosition={...k.computedPosition,...E}),(k.position.x!==H.x||k.position.y!==H.y)&&(k.position=H)}function ue(){F.value&&u([{id:e.id,nodeElement:F.value,forceUpdate:!0}])}function ae(S){ee!=null&&ee.value||h.mouseEnter({event:S,node:k})}function we(S){ee!=null&&ee.value||h.mouseMove({event:S,node:k})}function re(S){ee!=null&&ee.value||h.mouseLeave({event:S,node:k})}function ce(S){return h.contextMenu({event:S,node:k})}function de(S){return h.doubleClick({event:S,node:k})}function x(S){T.value&&(!o.value||!v.value||b.value>0)&&pi(k,r.value,l,a,i,!1,F.value),h.click({event:S,node:k})}function _(S){if(!(fi(S)||$.value))if(ea.includes(S.key)&&T.value){const E=S.key==="Escape";pi(k,r.value,l,a,i,E,F.value)}else v.value&&k.selected&&Ut[S.key]&&(S.preventDefault(),y.value=`Moved selected node ${S.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~k.position.x}, y: ${~~k.position.y}`,V({x:Ut[S.key].x,y:Ut[S.key].y},S.shiftKey))}}}),Gg=Yg;function Ug(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 Xg={class:"vue-flow__nodes vue-flow__container"},Kg={name:"Nodes",compatConfig:{MODE:3}},Wg=fe({...Kg,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=$e(),i=Ug(),r=pe();return xe(i,s=>{s&&Ye(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),Nt(()=>{r.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));Ye(()=>n(a))})}),ys(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,a)=>(G(),ie("div",Xg,[r.value?(G(!0),ie(Ie,{key:0},_t(N(t),(l,u,c,d)=>{const f=[l.id];if(d&&d.key===l.id&&gl(d,f))return d;const g=(G(),he(N(Gg),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return g.memo=f,g},a,0),128)):Ne("",!0)]))}});function Zg(){const{emits:e}=$e();Nt(()=>{if(fa()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Me(ke.MISSING_STYLES))}})}const qg=ge("div",{class:"vue-flow__edge-labels"},null,-1),Qg={name:"VueFlow",compatConfig:{MODE:3}},Jg=fe({...Qg,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=Mi(),r=Ro(o,"modelValue",n),s=Ro(o,"nodes",n),a=Ro(o,"edges",n),l=$e(o),u=Ih({modelValue:r,nodes:s,edges:a},o,l);return Ah(n,l.hooks),kg(),Zg(),Bt(Mo,i),cl(()=>{u()}),t(l),(c,d)=>(G(),ie("div",{ref:N(l).vueFlowRef,class:"vue-flow"},[q(xg,null,{default:oe(()=>[q(Lg),qg,q(Wg),Te(c.$slots,"zoom-pane")]),_:3}),Te(c.$slots,"default"),q(Cg)],512))}}),jg={name:"Panel",compatConfig:{MODE:3}},ep=fe({...jg,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=$e(),o=K(()=>`${t.position}`.split("-"));return(i,r)=>(G(),ie("div",{class:Ae(["vue-flow__panel",o.value]),style:Ee({pointerEvents:N(n)?"none":"all"})},[Te(i.$slots,"default")],6))}}),{HORIZONTAL_STEP:Ea,VERTICAL_STEP:go}=wl,tp=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},np=e=>{const t=Object.entries(e);return t.length===0?"":t.sort((n,o)=>o[1].degree-n[1].degree)[0][0]},op=(e,t)=>{const n={},o=[{id:t,depth:0}],i=new Set;for(;o.length>0;){const{id:r,depth:s}=o.shift();if(!i.has(r)&&(i.add(r),n[r]=s,e[r]))for(const a of e[r].connections)i.has(a)||o.push({id:a,depth:s+1})}return n},ip=(e,t,n)=>{var s;const o={},i=new Map(n.map(a=>[`${a.schema}.${a.table}`,a])),r={};for(const[a,l]of Object.entries(t))r[l]||(r[l]=[]),r[l].push(a);for(const[a,l]of Object.entries(r)){const u=Number(a);l.sort((f,g)=>e[g].degree-e[f].degree);let d=-l.reduce((f,g)=>{var m;const $=i.get(g),y=(((m=$==null?void 0:$.columns)==null?void 0:m.length)||0)*xt+ei+go;return f+y},0)/2;for(const f of l){const g=i.get(f),$=(((s=g==null?void 0:g.columns)==null?void 0:s.length)||0)*xt+ei+go;o[f]={x:u*Ea,y:d+$/2},d+=$}}return o},z0=e=>{var l;if(!e.length)return{nodes:[],edges:[],centerId:""};const t=tp(e),n=np(t),o=op(t,n),i=ip(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)*xt+ei;i[g]={x:u+Ea*1.5,y:d},d-=$+go}}const s=ml(e,i),a=yl(e);return{nodes:s,edges:a,centerId:n}},vt=(e,t)=>`${e}-${t}`,Ct=(e,t,n,o)=>{const{id:i,sourceHandle:r,targetHandle:s,sourceNode:a,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=(m,p,b)=>{if(!m||!p)return;m.label||(m.label=new Map);const w=m.label;b?w.set(p,!0):w.delete(p)},f=vt(a==null?void 0:a.id,r),g=vt(l==null?void 0:l.id,s),$=c||u||(n==null?void 0:n.relatedColumnIds.has(f))||(o==null?void 0:o.sourceId)===f||t,y=c||u||(n==null?void 0:n.relatedColumnIds.has(g))||(o==null?void 0:o.targetId)===g||t;d(a,r,!!$),d(l,s,!!y)},mi=({findNode:e,fitView:t,getViewport:n,nodeId:o})=>{if(!e(o))return;const r=n().zoom;t({nodes:[o],maxZoom:r,minZoom:r,duration:_l})},Ur=e=>(e||0)*xt-xt/2-1+2+10+xt,Xr=fe({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=bl(t,"class");return(o,i)=>(G(),he(N(Ll),rt({"data-slot":"separator-root"},N(n),{class:N(ps)("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 ot=(e=>(e.Lines="lines",e.Dots="dots",e))(ot||{});const Sa=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]}`})},Na=function({radius:e,color:t}){return be("circle",{cx:e,cy:e,r:e,fill:t})};ot.Lines+"",ot.Dots+"";const rp={[ot.Dots]:"#81818a",[ot.Lines]:"#eee"},sp=["id","x","y","width","height","patternTransform"],ap={key:2,height:"100",width:"100"},lp=["fill"],up=["x","y","fill"],cp={name:"Background",compatConfig:{MODE:3}},dp=fe({...cp,props:{id:{},variant:{default:()=>ot.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 s=n.value.zoom,[a,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[a*s||1,l*s||1],c=e.size*s,[d,f]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],g=[d*s||1+u[0]/2,f*s||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||rp[e.variant||ot.Dots]);return(s,a)=>(G(),ie("svg",{class:"vue-flow__background vue-flow__container",style:Ee({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[Te(s.$slots,"pattern-container",{id:i.value},()=>[ge("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"},[Te(s.$slots,"pattern",{},()=>[s.variant===N(ot).Lines?(G(),he(N(Sa),{key:0,size:s.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===N(ot).Dots?(G(),he(N(Na),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):Ne("",!0),s.bgColor?(G(),ie("svg",ap,[ge("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,lp)])):Ne("",!0)])],8,sp)]),ge("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,up),Te(s.$slots,"default",{id:i.value})],4))}});var fp={value:()=>{}};function Gi(){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 hp(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=Gi.prototype={constructor:Jn,on:function(e,t){var n=this._,o=hp(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=gp(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Kr(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Kr(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 gp(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Kr(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=fp,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var yi="http://www.w3.org/1999/xhtml";const Wr={svg:"http://www.w3.org/2000/svg",xhtml:yi,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)),Wr.hasOwnProperty(t)?{space:Wr[t],local:e}:e}function pp(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yi&&t.documentElement.namespaceURI===yi?t.createElement(e):t.createElementNS(n,e)}}function vp(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ca(e){var t=zo(e);return(t.local?vp:pp)(t)}function mp(){}function Ui(e){return e==null?mp:function(){return this.querySelector(e)}}function yp(e){typeof e!="function"&&(e=Ui(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Re(o,this._parents)}function wp(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function _p(){return[]}function ka(e){return e==null?_p:function(){return this.querySelectorAll(e)}}function bp(e){return function(){return wp(e.apply(this,arguments))}}function xp(e){typeof e=="function"?e=bp(e):e=ka(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Re(o,i)}function Ma(e){return function(){return this.matches(e)}}function Ia(e){return function(t){return t.matches(e)}}var $p=Array.prototype.find;function Ep(e){return function(){return $p.call(this.children,e)}}function Sp(){return this.firstElementChild}function Np(e){return this.select(e==null?Sp:Ep(typeof e=="function"?e:Ia(e)))}var Cp=Array.prototype.filter;function kp(){return Array.from(this.children)}function Mp(e){return function(){return Cp.call(this.children,e)}}function Ip(e){return this.selectAll(e==null?kp:Mp(typeof e=="function"?e:Ia(e)))}function Tp(e){typeof e!="function"&&(e=Ma(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Re(o,this._parents)}function Ta(e){return new Array(e.length)}function Ap(){return new Re(this._enter||this._groups.map(Ta),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 Pp(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new po(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Dp(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,f=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(f[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<d;++a)g=s.call(e,r[a],a,r)+"",(l=u.get(g))?(o[a]=l,l.__data__=r[a],u.delete(g)):n[a]=new po(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(i[a]=l)}function Bp(e){return e.__data__}function Op(e,t){if(!arguments.length)return Array.from(this,Bp);var n=t?Dp:Pp,o=this._parents,i=this._groups;typeof e!="function"&&(e=zp(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],f=d.length,g=Rp(e.call(c,c&&c.__data__,u,o)),$=g.length,y=a[u]=new Array($),m=s[u]=new Array($),p=l[u]=new Array(f);n(c,d,y,m,p,g,t);for(var b=0,w=0,C,P;b<$;++b)if(C=y[b]){for(b>=w&&(w=b+1);!(P=m[w])&&++w<$;);C._next=P||null}}return s=new Re(s,o),s._enter=a,s._exit=l,s}function Rp(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Hp(){return new Re(this._exit||this._groups.map(Ta),this._parents)}function Vp(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 Fp(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,f=a[l]=new Array(d),g,$=0;$<d;++$)(g=u[$]||c[$])&&(f[$]=g);for(;l<i;++l)a[l]=n[l];return new Re(a,this._parents)}function Lp(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function Yp(e){e||(e=Gp);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 s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Re(i,this._parents).order()}function Gp(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Up(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xp(){return Array.from(this)}function Kp(){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 s=o[i];if(s)return s}return null}function Wp(){let e=0;for(const t of this)++e;return e}function Zp(){return!this.node()}function qp(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function Qp(e){return function(){this.removeAttribute(e)}}function Jp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jp(e,t){return function(){this.setAttribute(e,t)}}function ev(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function tv(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function nv(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 ov(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?Jp:Qp:typeof t=="function"?n.local?nv:tv:n.local?ev:jp)(n,t))}function Aa(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function iv(e){return function(){this.style.removeProperty(e)}}function rv(e,t,n){return function(){this.style.setProperty(e,t,n)}}function sv(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function av(e,t,n){return arguments.length>1?this.each((t==null?iv:typeof t=="function"?sv:rv)(e,t,n??"")):Jt(this.node(),e)}function Jt(e,t){return e.style.getPropertyValue(t)||Aa(e).getComputedStyle(e,null).getPropertyValue(t)}function lv(e){return function(){delete this[e]}}function uv(e,t){return function(){this[e]=t}}function cv(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function dv(e,t){return arguments.length>1?this.each((t==null?lv:typeof t=="function"?cv:uv)(e,t)):this.node()[e]}function za(e){return e.trim().split(/^|\s+/)}function Xi(e){return e.classList||new Pa(e)}function Pa(e){this._node=e,this._names=za(e.getAttribute("class")||"")}Pa.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 Da(e,t){for(var n=Xi(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Ba(e,t){for(var n=Xi(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function fv(e){return function(){Da(this,e)}}function hv(e){return function(){Ba(this,e)}}function gv(e,t){return function(){(t.apply(this,arguments)?Da:Ba)(this,e)}}function pv(e,t){var n=za(e+"");if(arguments.length<2){for(var o=Xi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?gv:t?fv:hv)(n,t))}function vv(){this.textContent=""}function mv(e){return function(){this.textContent=e}}function yv(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wv(e){return arguments.length?this.each(e==null?vv:(typeof e=="function"?yv:mv)(e)):this.node().textContent}function _v(){this.innerHTML=""}function bv(e){return function(){this.innerHTML=e}}function xv(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function $v(e){return arguments.length?this.each(e==null?_v:(typeof e=="function"?xv:bv)(e)):this.node().innerHTML}function Ev(){this.nextSibling&&this.parentNode.appendChild(this)}function Sv(){return this.each(Ev)}function Nv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cv(){return this.each(Nv)}function kv(e){var t=typeof e=="function"?e:Ca(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Mv(){return null}function Iv(e,t){var n=typeof e=="function"?e:Ca(e),o=t==null?Mv:typeof t=="function"?t:Ui(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Tv(){var e=this.parentNode;e&&e.removeChild(this)}function Av(){return this.each(Tv)}function zv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Dv(e){return this.select(e?Pv:zv)}function Bv(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ov(e){return function(t){e.call(this,t,this.__data__)}}function Rv(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 Hv(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 Vv(e,t,n){return function(){var o=this.__on,i,r=Ov(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).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 Fv(e,t,n){var o=Rv(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?Vv:Hv,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function Oa(e,t,n){var o=Aa(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 Lv(e,t){return function(){return Oa(this,e,t)}}function Yv(e,t){return function(){return Oa(this,e,t.apply(this,arguments))}}function Gv(e,t){return this.each((typeof t=="function"?Yv:Lv)(e,t))}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,s;i<r;++i)(s=o[i])&&(yield s)}var Ra=[null];function Re(e,t){this._groups=e,this._parents=t}function In(){return new Re([[document.documentElement]],Ra)}function Xv(){return this}Re.prototype=In.prototype={constructor:Re,select:yp,selectAll:xp,selectChild:Np,selectChildren:Ip,filter:Tp,data:Op,enter:Ap,exit:Hp,join:Vp,merge:Fp,selection:Xv,order:Lp,sort:Yp,call:Up,nodes:Xp,node:Kp,size:Wp,empty:Zp,each:qp,attr:ov,style:av,property:dv,classed:pv,text:wv,html:$v,raise:Sv,lower:Cv,append:kv,insert:Iv,remove:Av,clone:Dv,datum:Bv,on:Fv,dispatch:Gv,[Symbol.iterator]:Uv};function yt(e){return typeof e=="string"?new Re([[document.querySelector(e)]],[document.documentElement]):new Re([[e]],Ra)}function Kv(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ht(e,t){if(e=Kv(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 wi={capture:!0,passive:!1};function _i(e){e.preventDefault(),e.stopImmediatePropagation()}function Wv(e){var t=e.document.documentElement,n=yt(e).on("dragstart.drag",_i,wi);"onselectstart"in t?n.on("selectstart.drag",_i,wi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Zv(e,t){var n=e.document.documentElement,o=yt(e).on("dragstart.drag",null);t&&(o.on("click.drag",_i,wi),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 Ki(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ha(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,Xt="\\s*([+-]?\\d+)\\s*",$n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qv=/^#([0-9a-f]{3,8})$/,Qv=new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`),Jv=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),jv=new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${$n}\\)$`),em=new RegExp(`^rgba\\(${qe},${qe},${qe},${$n}\\)$`),tm=new RegExp(`^hsl\\(${$n},${qe},${qe}\\)$`),nm=new RegExp(`^hsla\\(${$n},${qe},${qe},${$n}\\)$`),Zr={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};Ki(Tn,En,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qr,formatHex:qr,formatHex8:om,formatHsl:im,formatRgb:Qr,toString:Qr});function qr(){return this.rgb().formatHex()}function om(){return this.rgb().formatHex8()}function im(){return Va(this).formatHsl()}function Qr(){return this.rgb().formatRgb()}function En(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=qv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Jr(t):n===3?new Be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Fn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Fn(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=Qv.exec(e))?new Be(t[1],t[2],t[3],1):(t=Jv.exec(e))?new Be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=jv.exec(e))?Fn(t[1],t[2],t[3],t[4]):(t=em.exec(e))?Fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=tm.exec(e))?ts(t[1],t[2]/100,t[3]/100,1):(t=nm.exec(e))?ts(t[1],t[2]/100,t[3]/100,t[4]):Zr.hasOwnProperty(e)?Jr(Zr[e]):e==="transparent"?new Be(NaN,NaN,NaN,0):null}function Jr(e){return new Be(e>>16&255,e>>8&255,e&255,1)}function Fn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Be(e,t,n,o)}function rm(e){return e instanceof Tn||(e=En(e)),e?(e=e.rgb(),new Be(e.r,e.g,e.b,e.opacity)):new Be}function bi(e,t,n,o){return arguments.length===1?rm(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}Ki(Be,bi,Ha(Tn,{brighter(e){return e=e==null?vo:Math.pow(vo,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xn:Math.pow(xn,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Be(Dt(this.r),Dt(this.g),Dt(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:jr,formatHex:jr,formatHex8:sm,formatRgb:es,toString:es}));function jr(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function sm(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At((isNaN(this.opacity)?1:this.opacity)*255)}`}function es(){const e=mo(this.opacity);return`${e===1?"rgb(":"rgba("}${Dt(this.r)}, ${Dt(this.g)}, ${Dt(this.b)}${e===1?")":`, ${e})`}`}function mo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Dt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function At(e){return e=Dt(e),(e<16?"0":"")+e.toString(16)}function ts(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 Va(e){if(e instanceof Le)return new Le(e.h,e.s,e.l,e.opacity);if(e instanceof Tn||(e=En(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),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Le(s,a,l,e.opacity)}function am(e,t,n,o){return arguments.length===1?Va(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}Ki(Le,am,Ha(Tn,{brighter(e){return e=e==null?vo:Math.pow(vo,e),new Le(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xn:Math.pow(xn,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(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 Le(ns(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("}${ns(this.h)}, ${Ln(this.s)*100}%, ${Ln(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ns(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 Fa=e=>()=>e;function lm(e,t){return function(n){return e+n*t}}function um(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 cm(e){return(e=+e)==1?La:function(t,n){return n-t?um(t,n,e):Fa(isNaN(t)?n:t)}}function La(e,t){var n=t-e;return n?lm(e,n):Fa(isNaN(e)?t:e)}const os=function e(t){var n=cm(t);function o(i,r){var s=n((i=bi(i)).r,(r=bi(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=La(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function mt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var xi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qo=new RegExp(xi.source,"g");function dm(e){return function(){return e}}function fm(e){return function(t){return e(t)+""}}function hm(e,t){var n=xi.lastIndex=Qo.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=xi.exec(e))&&(i=Qo.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:mt(o,i)})),n=Qo.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?fm(l[0].x):dm(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var is=180/Math.PI,$i={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ya(e,t,n,o,i,r){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*is,skewX:Math.atan(l)*is,scaleX:s,scaleY:a}}var Yn;function gm(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?$i:Ya(t.a,t.b,t.c,t.d,t.e,t.f)}function pm(e){return e==null||(Yn||(Yn=document.createElementNS("http://www.w3.org/2000/svg","g")),Yn.setAttribute("transform",e),!(e=Yn.transform.baseVal.consolidate()))?$i:(e=e.matrix,Ya(e.a,e.b,e.c,e.d,e.e,e.f))}function Ga(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 y=g.push("translate(",null,t,null,n);$.push({i:y-4,x:mt(u,d)},{i:y-2,x:mt(c,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function s(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:mt(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,o)-2,x:mt(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,f,g,$){if(u!==d||c!==f){var y=g.push(i(g)+"scale(",null,",",null,")");$.push({i:y-4,x:mt(u,d)},{i:y-2,x:mt(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),s(u.rotate,c.rotate,d,f),a(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,y=f.length,m;++$<y;)d[(m=f[$]).i]=m.x(g);return d.join("")}}}var vm=Ga(gm,"px, ","px)","deg)"),mm=Ga(pm,", ",")",")"),ym=1e-12;function rs(e){return((e=Math.exp(e))+1/e)/2}function wm(e){return((e=Math.exp(e))-1/e)/2}function _m(e){return((e=Math.exp(2*e))-1)/(e+1)}const bm=function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],f=s[2],g=c-a,$=d-l,y=g*g+$*$,m,p;if(y<ym)p=Math.log(f/u)/t,m=function(D){return[a+D*g,l+D*$,u*Math.exp(t*D*p)]};else{var b=Math.sqrt(y),w=(f*f-u*u+o*y)/(2*u*n*b),C=(f*f-u*u-o*y)/(2*f*n*b),P=Math.log(Math.sqrt(w*w+1)-w),z=Math.log(Math.sqrt(C*C+1)-C);p=(z-P)/t,m=function(D){var F=D*p,R=rs(P),O=u/(n*b)*(R*_m(t*F+P)-wm(P));return[a+O*g,l+O*$,u*R/rs(t*F+P)]}}return m.duration=p*1e3*t/Math.SQRT2,m}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var jt=0,un=0,on=0,Ua=1e3,yo,cn,wo=0,Ht=0,Po=0,Sn=typeof performance=="object"&&performance.now?performance:Date,Xa=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wi(){return Ht||(Xa(xm),Ht=Sn.now()+Po)}function xm(){Ht=0}function _o(){this._call=this._time=this._next=null}_o.prototype=Ka.prototype={constructor:_o,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Wi():+n)+(t==null?0:+t),!this._next&&cn!==this&&(cn?cn._next=this:yo=this,cn=this),this._call=e,this._time=n,Ei()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ei())}};function Ka(e,t,n){var o=new _o;return o.restart(e,t,n),o}function $m(){Wi(),++jt;for(var e=yo,t;e;)(t=Ht-e._time)>=0&&e._call.call(void 0,t),e=e._next;--jt}function ss(){Ht=(wo=Sn.now())+Po,jt=un=0;try{$m()}finally{jt=0,Sm(),Ht=0}}function Em(){var e=Sn.now(),t=e-wo;t>Ua&&(Po-=t,wo=e)}function Sm(){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);cn=e,Ei(o)}function Ei(e){if(!jt){un&&(un=clearTimeout(un));var t=e-Ht;t>24?(e<1/0&&(un=setTimeout(ss,e-Sn.now()-Po)),on&&(on=clearInterval(on))):(on||(wo=Sn.now(),on=setInterval(Em,Ua)),jt=1,Xa(ss))}}function as(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 Nm=Gi("start","end","cancel","interrupt"),Cm=[],Wa=0,ls=1,Si=2,jn=3,us=4,Ni=5,eo=6;function Do(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;km(e,n,{name:t,index:o,group:i,on:Nm,tween:Cm,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Wa})}function Zi(e,t){var n=Ue(e,t);if(n.state>Wa)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 km(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Ka(r,0,n.time);function r(u){n.state=ls,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,g;if(n.state!==ls)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===jn)return as(s);g.state===us?(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(as(function(){n.state===jn&&(n.state=us,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Si,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Si){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 a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Ni,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===Ni&&(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,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>Si&&o.state<Ni,o.state=eo,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Mm(e){return this.each(function(){to(this,e)})}function Im(e,t){var n,o;return function(){var i=Je(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Tm(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Je(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function Am(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ue(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?Im:Tm)(n,e,t))}function qi(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 Za(e,t){var n;return(typeof t=="number"?mt:t instanceof En?os:(n=En(t))?(t=n,os):hm)(e,t)}function zm(e){return function(){this.removeAttribute(e)}}function Pm(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dm(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function Bm(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function Om(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Rm(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Hm(e,t){var n=zo(e),o=n==="transform"?mm:Za;return this.attrTween(e,typeof t=="function"?(n.local?Rm:Om)(n,o,qi(this,"attr."+e,t)):t==null?(n.local?Pm:zm)(n):(n.local?Bm:Dm)(n,o,t))}function Vm(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Fm(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Lm(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Fm(e,r)),n}return i._value=t,i}function Ym(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Vm(e,r)),n}return i._value=t,i}function Gm(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?Lm:Ym)(o,t))}function Um(e,t){return function(){Zi(this,e).delay=+t.apply(this,arguments)}}function Xm(e,t){return t=+t,function(){Zi(this,e).delay=t}}function Km(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Um:Xm)(t,e)):Ue(this.node(),t).delay}function Wm(e,t){return function(){Je(this,e).duration=+t.apply(this,arguments)}}function Zm(e,t){return t=+t,function(){Je(this,e).duration=t}}function qm(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Wm:Zm)(t,e)):Ue(this.node(),t).duration}function Qm(e,t){if(typeof t!="function")throw new Error;return function(){Je(this,e).ease=t}}function Jm(e){var t=this._id;return arguments.length?this.each(Qm(t,e)):Ue(this.node(),t).ease}function jm(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Je(this,e).ease=n}}function ey(e){if(typeof e!="function")throw new Error;return this.each(jm(this._id,e))}function ty(e){typeof e!="function"&&(e=Ma(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new at(o,this._parents,this._name,this._id)}function ny(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),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),f,g=0;g<c;++g)(f=l[g]||u[g])&&(d[g]=f);for(;a<o;++a)s[a]=t[a];return new at(s,this._parents,this._name,this._id)}function oy(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 iy(e,t,n){var o,i,r=oy(t)?Zi:Je;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function ry(e,t){var n=this._id;return arguments.length<2?Ue(this.node(),n).on.on(e):this.each(iy(n,e,t))}function sy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ay(){return this.on("end.remove",sy(this._id))}function ly(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ui(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,f=0;f<l;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Do(u[f],t,n,f,u,Ue(c,n)));return new at(r,this._parents,t,n)}function uy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ka(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],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),y=0,m=f.length;y<m;++y)(g=f[y])&&Do(g,t,n,y,f,$);r.push(f),s.push(c)}return new at(r,s,t,n)}var cy=In.prototype.constructor;function dy(){return new cy(this._groups,this._parents)}function fy(e,t){var n,o,i;return function(){var r=Jt(this,e),s=(this.style.removeProperty(e),Jt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function qa(e){return function(){this.style.removeProperty(e)}}function hy(e,t,n){var o,i=n+"",r;return function(){var s=Jt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function gy(e,t,n){var o,i,r;return function(){var s=Jt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Jt(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function py(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=Je(this,e),u=l.on,c=l.value[r]==null?a||(a=qa(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function vy(e,t,n){var o=(e+="")=="transform"?vm:Za;return t==null?this.styleTween(e,fy(e,o)).on("end.style."+e,qa(e)):typeof t=="function"?this.styleTween(e,gy(e,o,qi(this,"style."+e,t))).each(py(this._id,e)):this.styleTween(e,hy(e,o,t),n).on("end.style."+e,null)}function my(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function yy(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&my(e,s,n)),o}return r._value=t,r}function wy(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,yy(e,t,n??""))}function _y(e){return function(){this.textContent=e}}function by(e){return function(){var t=e(this);this.textContent=t??""}}function xy(e){return this.tween("text",typeof e=="function"?by(qi(this,"text",e)):_y(e==null?"":e+""))}function $y(e){return function(t){this.textContent=e.call(this,t)}}function Ey(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&$y(i)),t}return o._value=e,o}function Sy(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,Ey(e))}function Ny(){for(var e=this._name,t=this._id,n=Qa(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Ue(l,t);Do(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new at(o,this._parents,e,n)}function Cy(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},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(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var ky=0;function at(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Qa(){return++ky}var et=In.prototype;at.prototype={constructor:at,select:ly,selectAll:uy,selectChild:et.selectChild,selectChildren:et.selectChildren,filter:ty,merge:ny,selection:dy,transition:Ny,call:et.call,nodes:et.nodes,node:et.node,size:et.size,empty:et.empty,each:et.each,on:ry,attr:Hm,attrTween:Gm,style:vy,styleTween:wy,text:xy,textTween:Sy,remove:ay,tween:Am,delay:Km,duration:qm,ease:Jm,easeVarying:ey,end:Cy,[Symbol.iterator]:et[Symbol.iterator]};function My(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Iy={time:null,delay:0,duration:250,ease:My};function Ty(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 Ay(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=Qa(),(n=Iy).time=Wi(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Do(l,e,t,u,s,n||Ty(l,t));return new at(o,this._parents,e,t)}In.prototype.interrupt=Mm;In.prototype.transition=Ay;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 it(e,t,n){this.k=e,this.x=t,this.y=n}it.prototype={constructor:it,scale:function(e){return e===1?this:new it(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new it(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 Qi=new it(1,0,0);it.prototype;function Jo(e){e.stopImmediatePropagation()}function rn(e){e.preventDefault(),e.stopImmediatePropagation()}function Py(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Dy(){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 cs(){return this.__zoom||Qi}function By(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Oy(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ry(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],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Hy(){var e=Py,t=Dy,n=Ry,o=By,i=Oy,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=bm,u=Gi("start","zoom","end"),c,d,f,g=500,$=150,y=0,m=10;function p(h){h.property("__zoom",cs).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",O).filter(i).on("touchstart.zoom",V).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(h,M,v,T){var I=h.selection?h.selection():h;I.property("__zoom",cs),h!==I?P(h,M,v,T):I.interrupt().each(function(){z(this,arguments).event(T).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},p.scaleBy=function(h,M,v,T){p.scaleTo(h,function(){var I=this.__zoom.k,B=typeof M=="function"?M.apply(this,arguments):M;return I*B},v,T)},p.scaleTo=function(h,M,v,T){p.transform(h,function(){var I=t.apply(this,arguments),B=this.__zoom,A=v==null?C(I):typeof v=="function"?v.apply(this,arguments):v,L=B.invert(A),W=typeof M=="function"?M.apply(this,arguments):M;return n(w(b(B,W),A,L),I,s)},v,T)},p.translateBy=function(h,M,v,T){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),s)},null,T)},p.translateTo=function(h,M,v,T,I){p.transform(h,function(){var B=t.apply(this,arguments),A=this.__zoom,L=T==null?C(B):typeof T=="function"?T.apply(this,arguments):T;return n(Qi.translate(L[0],L[1]).scale(A.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof v=="function"?-v.apply(this,arguments):-v),B,s)},T,I)};function b(h,M){return M=Math.max(r[0],Math.min(r[1],M)),M===h.k?h:new it(M,h.x,h.y)}function w(h,M,v){var T=M[0]-v[0]*h.k,I=M[1]-v[1]*h.k;return T===h.x&&I===h.y?h:new it(h.k,T,I)}function C(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function P(h,M,v,T){h.on("start.zoom",function(){z(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(T).end()}).tween("zoom",function(){var I=this,B=arguments,A=z(I,B).event(T),L=t.apply(I,B),W=v==null?C(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,X=typeof M=="function"?M.apply(I,B):M,Q=l(Y.invert(W).concat(ee/Y.k),X.invert(W).concat(ee/X.k));return function(se){if(se===1)se=X;else{var ue=Q(se),ae=ee/ue[2];se=new it(ae,W[0]-ue[0]*ae,W[1]-ue[1]*ae)}A.zoom(null,se)}})}function z(h,M,v){return!v&&h.__zooming||new D(h,M)}function D(h,M){this.that=h,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(h,M),this.taps=0}D.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=yt(this.that).datum();u.call(h,this.that,new zy(h,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),M)}};function F(h,...M){if(!e.apply(this,arguments))return;var v=z(this,M).event(h),T=this.__zoom,I=Math.max(r[0],Math.min(r[1],T.k*Math.pow(2,o.apply(this,arguments)))),B=ht(h);if(v.wheel)(v.mouse[0][0]!==B[0]||v.mouse[0][1]!==B[1])&&(v.mouse[1]=T.invert(v.mouse[0]=B)),clearTimeout(v.wheel);else{if(T.k===I)return;v.mouse=[B,T.invert(B)],to(this),v.start()}rn(h),v.wheel=setTimeout(A,$),v.zoom("mouse",n(w(b(T,I),v.mouse[0],v.mouse[1]),v.extent,s));function A(){v.wheel=null,v.end()}}function R(h,...M){if(f||!e.apply(this,arguments))return;var v=h.currentTarget,T=z(this,M,!0).event(h),I=yt(h.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",ee,!0),B=ht(h,v),A=h.clientX,L=h.clientY;Wv(h.view),Jo(h),T.mouse=[B,this.__zoom.invert(B)],to(this),T.start();function W(Y){if(rn(Y),!T.moved){var X=Y.clientX-A,Q=Y.clientY-L;T.moved=X*X+Q*Q>y}T.event(Y).zoom("mouse",n(w(T.that.__zoom,T.mouse[0]=ht(Y,v),T.mouse[1]),T.extent,s))}function ee(Y){I.on("mousemove.zoom mouseup.zoom",null),Zv(Y.view,T.moved),rn(Y),T.event(Y).end()}}function O(h,...M){if(e.apply(this,arguments)){var v=this.__zoom,T=ht(h.changedTouches?h.changedTouches[0]:h,this),I=v.invert(T),B=v.k*(h.shiftKey?.5:2),A=n(w(b(v,B),T,I),t.apply(this,M),s);rn(h),a>0?yt(this).transition().duration(a).call(P,A,T,h):yt(this).call(p.transform,A,T,h)}}function V(h,...M){if(e.apply(this,arguments)){var v=h.touches,T=v.length,I=z(this,M,h.changedTouches.length===T).event(h),B,A,L,W;for(Jo(h),A=0;A<T;++A)L=v[A],W=ht(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=z(this,M).event(h),T=h.changedTouches,I=T.length,B,A,L,W;for(rn(h),B=0;B<I;++B)A=T[B],L=ht(A,this),v.touch0&&v.touch0[2]===A.identifier?v.touch0[0]=L:v.touch1&&v.touch1[2]===A.identifier&&(v.touch1[0]=L);if(A=v.that.__zoom,v.touch1){var ee=v.touch0[0],Y=v.touch0[1],X=v.touch1[0],Q=v.touch1[1],se=(se=X[0]-ee[0])*se+(se=X[1]-ee[1])*se,ue=(ue=Q[0]-Y[0])*ue+(ue=Q[1]-Y[1])*ue;A=b(A,Math.sqrt(se/ue)),L=[(ee[0]+X[0])/2,(ee[1]+X[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(w(A,L,W),v.extent,s))}}function U(h,...M){if(this.__zooming){var v=z(this,M).event(h),T=h.changedTouches,I=T.length,B,A;for(Jo(h),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),B=0;B<I;++B)A=T[B],v.touch0&&v.touch0[2]===A.identifier?delete v.touch0:v.touch1&&v.touch1[2]===A.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&&(A=ht(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<m)){var L=yt(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?(s[0][0]=+h[0][0],s[1][0]=+h[1][0],s[0][1]=+h[0][1],s[1][1]=+h[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(h){return arguments.length?(n=h,p):n},p.duration=function(h){return arguments.length?(a=+h,p):a},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?(y=(h=+h)*h,p):Math.sqrt(y)},p.tapDistance=function(h){return arguments.length?(m=+h,p):m},p}const Ja=Symbol("MiniMapSlots"),Vy=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],Fy={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},Ly=fe({...Fy,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(Ja),i=Ti(),r=_e(()=>i.style??{});function s(d){t("click",d)}function a(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?(G(),ie(Ie,{key:0},[N(o)[`node-${n.type}`]?(G(),he(Ii(N(o)[`node-${n.type}`]),ki(rt({key:0},{...n,...d.$attrs})),null,16)):(G(),ie("rect",rt({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:s,onDblclick:a,onMouseenter:l,onMousemove:u,onMouseleave:c}),null,16,Vy))],64)):Ne("",!0)}}),Yy=["width","height","viewBox","aria-labelledby"],Gy=["id"],Uy=["d","fill","stroke","stroke-width"],Xy={name:"MiniMap",compatConfig:{MODE:3}},Ky=fe({...Xy,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=Mi(),o=Ti(),i=200,r=150,{id:s,edges:a,viewport:l,translateExtent:u,dimensions:c,emits:d,d3Selection:f,d3Zoom:g,getNodesInitialized:$}=$e(),y=pe();Bt(Ja,n);const m=_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",w=K(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),C=K(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),P=K(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),z=K(()=>Hi($.value.filter(I=>!I.hidden))),D=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})),F=K(()=>$.value&&$.value.length?eh(z.value,D.value):D.value),R=K(()=>{const I=F.value.width/m.value,B=F.value.height/p.value;return Math.max(I,B)}),O=K(()=>{const I=R.value*m.value,B=R.value*p.value,A=e.offsetScale*R.value;return{offset:A,x:F.value.x-(I-F.value.width)/2-A,y:F.value.y-(B-F.value.height)/2-A,width:I+A*2,height:B+A*2}}),V=K(()=>!O.value.x||!O.value.y?"":`
|
|
27
|
+
M${O.value.x-O.value.offset},${O.value.y-O.value.offset}
|
|
28
|
+
h${O.value.width+O.value.offset*2}
|
|
29
|
+
v${O.value.height+O.value.offset*2}
|
|
30
|
+
h${-O.value.width-O.value.offset*2}z
|
|
31
|
+
M${D.value.x+e.maskBorderRadius},${D.value.y}
|
|
32
|
+
h${D.value.width-2*e.maskBorderRadius}
|
|
33
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}
|
|
34
|
+
v${D.value.height-2*e.maskBorderRadius}
|
|
35
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}
|
|
36
|
+
h${-(D.value.width-2*e.maskBorderRadius)}
|
|
37
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
|
|
38
|
+
v${-(D.value.height-2*e.maskBorderRadius)}
|
|
39
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);xl(I=>{if(y.value){const B=yt(y.value),A=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,X=l.value.zoom*2**Y;g.value.scaleTo(f.value,X)},L=ee=>{if(ee.sourceEvent.type!=="mousemove"||!f.value||!g.value)return;const Y=R.value*Math.max(1,l.value.zoom)*(e.inversePan?-1:1),X={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]],se=Qi.translate(X.x,X.y).scale(l.value.zoom),ue=g.value.constrain()(se,Q,u.value);g.value.transform(f.value,ue)},W=Hy().on("zoom",e.pannable?L:()=>{}).on("zoom.wheel",e.zoomable?A:()=>{});B.call(W),I(()=>{B.on("zoom",null)})}},{flush:"post"});function k(I){const[B,A]=ht(I);t("click",{event:I,position:{x:B,y:A}})}function U(I,B){const A={event:I,node:B,connectedEdges:Mt([B],a.value)};d.miniMapNodeClick(A),t("nodeClick",A)}function h(I,B){const A={event:I,node:B,connectedEdges:Mt([B],a.value)};d.miniMapNodeDoubleClick(A),t("nodeDblclick",A)}function M(I,B){const A={event:I,node:B,connectedEdges:Mt([B],a.value)};d.miniMapNodeMouseEnter(A),t("nodeMouseenter",A)}function v(I,B){const A={event:I,node:B,connectedEdges:Mt([B],a.value)};d.miniMapNodeMouseMove(A),t("nodeMousemove",A)}function T(I,B){const A={event:I,node:B,connectedEdges:Mt([B],a.value)};d.miniMapNodeMouseLeave(A),t("nodeMouseleave",A)}return(I,B)=>(G(),he(N(ep),{position:I.position,class:Ae(["vue-flow__minimap",{pannable:I.pannable,zoomable:I.zoomable}])},{default:oe(()=>[(G(),ie("svg",{ref_key:"el",ref:y,width:m.value,height:p.value,viewBox:[O.value.x,O.value.y,O.value.width,O.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${N(s)}`,onClick:k},[I.ariaLabel?(G(),ie("title",{key:0,id:`vue-flow__minimap-${N(s)}`},Pe(I.ariaLabel),9,Gy)):Ne("",!0),(G(!0),ie(Ie,null,_t(N($),A=>(G(),he(Ly,{id:A.id,key:A.id,position:A.computedPosition,dimensions:A.dimensions,selected:A.selected,dragging:A.dragging,style:Ee(A.style),class:Ae(P.value(A)),color:w.value(A),"border-radius":I.nodeBorderRadius,"stroke-color":C.value(A),"stroke-width":I.nodeStrokeWidth,"shape-rendering":N(b),type:A.type,hidden:A.hidden,onClick:L=>U(L,A),onDblclick:L=>h(L,A),onMouseenter:L=>M(L,A),onMousemove:L=>v(L,A),onMouseleave:L=>T(L,A)},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)),ge("path",{class:"vue-flow__minimap-mask",d:V.value,fill:I.maskColor,stroke:I.maskStrokeColor,"stroke-width":I.maskStrokeWidth,"fill-rule":"evenodd"},null,8,Uy)],8,Yy))]),_:1},8,["position","class"]))}}),Wy={class:"table-node text-foreground"},Zy={class:"flex-1 text-center px-2 box-border text-xl truncate"},qy=["onClick"],Qy={class:"col-span-2 py-2 truncate flex items-center gap-1"},Jy={class:"w-6 flex items-center justify-center"},jy={class:"truncate"},e0={class:"col-span-1 py-2 truncate text-center text-muted-foreground"},t0=fe({__name:"ErdTableNode",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:s}=$e(),a=K(()=>gn({schemaName:n.data.schema,tableName:n.data.table})),l=()=>{n.isExpanded?o("collapse",a.value):o("expand",a.value)},u=K(()=>new Set(n.data.primary_keys.map(m=>m.column))),c=K(()=>new Set(n.data.foreign_keys.map(m=>m.column))),d=K(()=>n.data.columns.map(m=>({...m,isPrimary:u.value.has(m.name),isForeign:c.value.has(m.name)}))),f=K(()=>new Map(d.value.map((m,p)=>[m.name,p+1]))),g=K(()=>n.data.foreign_keys.map(({column:m})=>{const p=f.value.get(m);return{id:m,top:Ur(p)}})),$=K(()=>n.data.primary_keys.map(({column:m})=>{const p=f.value.get(m);return{id:m,top:Ur(p)}})),y=m=>{if(!m.isForeign)return;const p=n.data.foreign_keys.find(w=>w.column===m.name);if(!p)return;const b=gn({schemaName:p.reference_schema,tableName:p.reference_table});mi({nodeId:b,findNode:i,fitView:r,getViewport:s})};return(m,p)=>{const b=ze,w=Ke;return G(),ie("div",Wy,[ge("div",{class:"flex flex-col rounded-md bg-card overflow-hidden",style:Ee({width:N(_s)+"px"})},[ge("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(xt)+10+"px"})},[ge("p",Zy,Pe(m.data.table)+" "+Pe(m.data.schema==="public"?"":`(${m.data.schema})`),1),m.hasRelations?(G(),he(w,{key:0,size:"iconMd",title:m.isExpanded?"Collapse related tables":"Expand related tables",onClick:wt(l,["stop"])},{default:oe(()=>[q(b,{name:m.isExpanded?"hugeicons:remove-circle":"hugeicons:add-circle",class:"w-5 h-5"},null,8,["name"])]),_:1},8,["title"])):Ne("",!0)],4),(G(!0),ie(Ie,null,_t(d.value,C=>{var P;return G(),ie("div",{key:C.name,class:Ae(["grid grid-cols-3 px-2 border-t border-border bg-card transition-colors",C.isForeign&&"cursor-pointer hover:bg-primary/10",((P=m.label)==null?void 0:P.get(C.name))&&"bg-primary/10"]),style:Ee({height:N(xt)+"px"}),onClick:z=>y(C)},[ge("div",Qy,[ge("div",Jy,[C.isPrimary?(G(),he(b,{key:0,name:"hugeicons:key-01",class:"w-4 text-yellow-400 dark:text-yellow-300 text-xl"})):C.isForeign?(G(),he(b,{key:1,name:"hugeicons:key-01",class:"min-w-4 text-muted-foreground text-xl"})):C.nullable?(G(),he(b,{key:2,name:"hugeicons:diamond",class:"min-w-4 text-muted-foreground/60"})):(G(),he(b,{key:3,name:"mynaui:diamond-solid",class:"min-w-4 text-muted-foreground/60"}))]),ge("p",jy,Pe(C.name),1),C.isForeign?(G(),he(b,{key:0,name:"hugeicons:link-04",class:"min-w-3 text-muted-foreground"})):Ne("",!0)]),ge("div",e0,Pe(C.type),1)],14,qy)}),128))],4),(G(!0),ie(Ie,null,_t(g.value,C=>(G(),he(N(Qt),{key:C.id,type:"source",id:C.id,position:N(te).Left,connectable:!1,style:Ee({top:C.top+"px",left:N(tr),height:N(er),opacity:0})},null,8,["id","position","style"]))),128)),(G(!0),ie(Ie,null,_t($.value,C=>(G(),he(N(Qt),{key:C.id,type:"target",id:C.id,position:N(te).Right,connectable:!1,style:Ee({top:C.top+"px",right:N(tr),height:N(er),opacity:0})},null,8,["id","position","style"]))),128))])}}}),n0=$l(t0,[["__scopeId","data-v-a80035c1"]]),o0={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"},i0={class:"w-7 h-7 text-center py-0.5 text-sm flex items-center justify-center"},r0=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:s}=$e(),a=t,l=K(()=>Math.round(s().zoom*100)),u=()=>a("update:isHand",!n.isHand),c=()=>{if(!n.isUseBgGrid){a("update:isUseBgGrid","dots");return}if(n.isUseBgGrid==="dots"){a("update:isUseBgGrid","lines");return}a("update:isUseBgGrid",!1)},d=()=>a("update:isUseMiniMap",!n.isUseMiniMap),f=()=>a("update:isShowFilter",!n.isShowFilter),g=()=>a("arrange"),$=()=>i({duration:Kn}),y=()=>o({duration:Kn}),m=()=>r({duration:Kn});return(p,b)=>(G(),ie("div",o0,[q(N(lt),null,{default:oe(()=>[q(N(ut),{"as-child":""},{default:oe(()=>[q(N(Ke),{variant:p.isUseBgGrid?"secondary":"ghost",size:"iconMd",onClick:b[0]||(b[0]=w=>c())},{default:oe(()=>[q(N(ze),{name:"hugeicons:grid",class:"size-4!"})]),_:1},8,["variant"])]),_:1}),q(N(ct),null,{default:oe(()=>[He(Pe(p.isUseBgGrid?"Hide grid":"Show grid"),1)]),_:1})]),_:1}),q(N(lt),null,{default:oe(()=>[q(N(ut),{"as-child":""},{default:oe(()=>[q(N(Ke),{variant:p.isUseMiniMap?"secondary":"ghost",size:"iconMd",onClick:b[1]||(b[1]=w=>d())},{default:oe(()=>[q(N(ze),{name:"hugeicons:dashboard-circle",class:"size-4"})]),_:1},8,["variant"])]),_:1}),q(N(ct),null,{default:oe(()=>[He(Pe(p.isUseMiniMap?"Hide minimap":"Show minimap"),1)]),_:1})]),_:1}),q(N(lt),null,{default:oe(()=>[q(N(ut),{"as-child":""},{default:oe(()=>[q(N(Ke),{variant:p.isHand?"secondary":"ghost",size:"iconMd",onClick:b[2]||(b[2]=w=>u())},{default:oe(()=>[p.isHand?(G(),he(N(ze),{key:1,name:"hugeicons:hold-04",class:"size-4!"})):(G(),he(N(ze),{key:0,name:"hugeicons:hold-03",class:"size-4!"}))]),_:1},8,["variant"])]),_:1}),q(N(ct),null,{default:oe(()=>b[4]||(b[4]=[He("Click to enable pan mode "),ge("br",null,null,-1),He(" Or hold Space/Middle mouse + drag to pan")])),_:1})]),_:1}),q(N(Xr),{orientation:"vertical",class:"mx-1.5"}),q(N(lt),null,{default:oe(()=>[q(N(ut),{"as-child":""},{default:oe(()=>[q(N(Ke),{variant:"ghost",size:"iconMd",onClick:$},{default:oe(()=>[q(N(ze),{name:"hugeicons:minus-sign",class:"size-4!"})]),_:1})]),_:1}),q(N(ct),null,{default:oe(()=>b[5]||(b[5]=[He("Zoom out")])),_:1})]),_:1}),ge("div",i0,Pe(N(l)),1),q(N(lt),null,{default:oe(()=>[q(N(ut),{"as-child":""},{default:oe(()=>[q(N(Ke),{variant:"ghost",size:"iconMd",onClick:y},{default:oe(()=>[q(N(ze),{name:"hugeicons:add-01",class:"size-4!"})]),_:1})]),_:1}),q(N(ct),null,{default:oe(()=>b[6]||(b[6]=[He("Zoom in")])),_:1})]),_:1}),q(N(Xr),{orientation:"vertical",class:"mx-1.5"}),q(N(lt),null,{default:oe(()=>[q(N(ut),{"as-child":""},{default:oe(()=>[q(N(Ke),{variant:"ghost",size:"iconMd",onClick:m},{default:oe(()=>[q(N(ze),{name:"hugeicons:center-focus",class:"size-4!"})]),_:1})]),_:1}),q(N(ct),null,{default:oe(()=>b[7]||(b[7]=[He("Fit to view")])),_:1})]),_:1}),q(N(lt),null,{default:oe(()=>[q(N(ut),{"as-child":""},{default:oe(()=>[q(N(Ke),{variant:"ghost",size:"iconMd",onClick:g},{default:oe(()=>[q(N(ze),{name:"hugeicons:coordinate-01",class:"size-4!"})]),_:1})]),_:1}),q(N(ct),null,{default:oe(()=>b[8]||(b[8]=[He("Arrange the diagram")])),_:1})]),_:1}),q(N(lt),null,{default:oe(()=>[q(N(ut),{"as-child":""},{default:oe(()=>[q(N(Ke),{variant:p.isShowFilter?"secondary":"ghost",size:"iconMd",onClick:b[3]||(b[3]=w=>f())},{default:oe(()=>[q(N(ze),{name:"hugeicons:filter",class:"size-4"})]),_:1},8,["variant"])]),_:1}),q(N(ct),null,{default:oe(()=>[He(Pe(p.isShowFilter?"Hide filter":"Show filter")+" ",1),q(N(Jl),null,{default:oe(()=>[q(N(nr),null,{default:oe(()=>b[9]||(b[9]=[He("⌘")])),_:1}),q(N(nr),null,{default:oe(()=>b[10]||(b[10]=[He("f")])),_:1})]),_:1})]),_:1})]),_:1})]))}}),s0=["id","markerWidth","markerHeight"],a0=["fill"],l0=["fill"],u0=fe({__name:"MarkerMany",props:{id:{},fill:{default:"#b1b1b7"},strokeWidth:{default:1.5},width:{default:24},height:{default:24}},setup(e){return(t,n)=>(G(),ie("marker",{id:t.id,viewBox:"0 0 24 24",refX:"2",refY:"8",markerWidth:t.width,markerHeight:t.height,orient:"0",markerUnits:"userSpaceOnUse"},[ge("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,a0),ge("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),ge("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,l0)],8,s0))}}),c0=["id","markerWidth","markerHeight"],d0=["fill"],f0=["fill"],h0=["fill"],g0=fe({__name:"MarkerZeroOrOne",props:{id:{},fill:{default:"#b1b1b7"},strokeWidth:{default:1.5},width:{default:24},height:{default:24}},setup(e){return(t,n)=>(G(),ie("marker",{id:t.id,viewBox:"0 0 24 24",refX:"2",refY:"8",markerWidth:t.width,markerHeight:t.height,orient:"180",markerUnits:"userSpaceOnUse"},[ge("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),ge("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,d0),ge("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,f0),ge("path",{style:Ee({strokeWidth:t.strokeWidth}),fill:t.fill,d:"M23.5 7.5H11V8.5H23.5V7.5Z"},null,12,h0)],8,c0))}}),p0=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(()=>Li({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 a,l;return((a=t.sourceNode)==null?void 0:a.selected)||((l=t.targetNode)==null?void 0:l.selected)||t.animated?"var(--color-primary)":"var(--color-zinc-400)"});return(s,a)=>(G(),ie(Ie,null,[q(N(Mn),{id:s.id,path:n.value[0],"marker-start":`url(#${i.value})`,"marker-end":`url(#${o.value})`,style:Ee({stroke:r.value,strokeWidth:s.animated?3:1.5})},null,8,["id","path","marker-start","marker-end","style"]),q(g0,{fill:r.value,"stroke-width":1.5,width:30,height:30,id:o.value},null,8,["fill","id"]),q(u0,{fill:r.value,"stroke-width":1.5,width:30,height:30,id:i.value},null,8,["fill","id"])],64))}}),v0=["onClick"],m0={class:"flex items-center flex-1 min-w-0"},y0=["onClick"],w0={key:1,class:"size-4"},_0={key:3,class:"pl-1 truncate font-normal"},b0={key:4,class:"pl-1 w-full"},x0={key:0,class:"flex-shrink-0"},$0="lucide:folder",jo=24,E0=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=El("treeRootRef"),{y:r}=Sl(i),s=u=>{o("update:expandedState",u)},a=u=>{o("update:selectedItems",u)};t({treeRootRef:i});const l=pe();return Nl(()=>{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)=>(G(),he(N(Ul),{"onUpdate:modelValue":c[1]||(c[1]=d=>a(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":s,ref_key:"treeRootRef",ref:i},{default:oe(()=>[q(N(Ql),{"estimate-size":jo,overscan:5},{default:oe(({item:d})=>[(G(),he(N(Zl),rt({key:d._id,style:{"padding-left":`${d.level-.5}rem`,height:`${jo}px !important`}},d.bind,{onContextmenu:wt(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:y})=>[ge("div",{class:"flex items-center justify-between w-full flex-wrap",style:Ee({height:`${jo}px`}),onClick:[wt(m=>{m.stopImmediatePropagation(),$()},["shift"]),async m=>{var p;if(l.value=[],await u.$nextTick(),$(),d.value.status===N(Oo).edit){m.stopImmediatePropagation(),m.stopPropagation(),m.preventDefault();return}(p=u.onClickTreeItem)==null||p.call(u,m,d),u.isExpandedByArrow&&m.stopImmediatePropagation()}]},[ge("div",m0,[u.isShowArrow?(G(),ie("div",{key:0,class:"pr-1 flex-shrink-0",onClick:m=>{u.isExpandedByArrow&&(m.stopImmediatePropagation(),g())}},[d.hasChildren?(G(),he(N(An),{key:0,icon:"lucide:chevron-right",class:Ae({"rotate-90":f,"size-4 min-w-4 transition-all":!0,"hover:bg-background hover:shadow hover:rounded":!0})},null,8,["class"])):(G(),ie("div",w0))],8,y0)):Ne("",!0),d.hasChildren?(G(),ie(Ie,{key:1},[f?(G(),he(N(An),{key:1,icon:d.value.icon,class:Ae(["size-4 min-w-4",d.value.iconClass])},null,8,["icon","class"])):(G(),he(N(An),{key:0,icon:d.value.closeIcon||$0,class:Ae(["size-4 min-w-4",d.value.iconClass])},null,8,["icon","class"]))],64)):(G(),he(N(An),{key:2,icon:d.value.icon,class:Ae(["size-4 min-w-4",d.value.iconClass])},null,8,["icon","class"])),d.value.status!==N(Oo).edit?(G(),ie("div",_0,Pe(d.value.title),1)):(G(),ie("div",b0,[Te(u.$slots,"edit-inline",{item:d})]))]),d.value.status!==N(Oo).edit?(G(),ie("div",x0,[Te(u.$slots,"extra-actions",{item:d})])):Ne("",!0)],12,v0)]),_:2},1040,["style","onContextmenu"]))]),_:3})]),_:3},8,["items","get-key","expanded"]))}}),S0={class:"px-2 pt-2 flex flex-col h-full w-full"},N0={class:"text-base font-normal"},C0={class:"relative w-full pt-2 mb-2"},k0={class:"h-full w-[19rem] overflow-y-auto"},M0=fe({__name:"ErdFilterPanal",props:{isShowFilter:{type:Boolean},tables:{},tableId:{}},emits:["update:isShowFilter","focusTable"],setup(e,{emit:t}){const n=e,o=t,i=Cl(""),r=kl(i,Tl),s=K(()=>Il(n.tableId||"")),a=K(()=>{const u=[];return n.tables.forEach(c=>{if(!c.table.toLowerCase().includes(r.value.toLowerCase()))return;const d=gn({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=Ml,f=Ke,g=E0;return G(),ie("div",{class:Ae(["flex flex-col h-full bg-background absolute right-0 top-0 shadow transition-all ease-in-out",[u.isShowFilter?"w-[20rem]":"w-[0rem]"]])},[ge("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?(G(),he(N(ze),{key:0,name:"hugeicons:arrow-right-01",class:"size-5!"})):(G(),he(N(ze),{key:1,name:"hugeicons:arrow-left-01",class:"size-5!"}))]),ge("div",S0,[ge("div",null,[ge("h1",N0,Pe(N(s).tableName),1),c[4]||(c[4]=ge("p",{class:"text-muted-foreground text-sm"}," This view only show this table and relations ",-1))]),ge("div",C0,[q(d,{type:"text",placeholder:"Search tables",class:"pr-6 w-full h-8",modelValue:N(i),"onUpdate:modelValue":c[1]||(c[1]=$=>bt(i)?i.value=$:null)},null,8,["modelValue"]),N(i)?(G(),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="")},[q(N(ze),{name:"lucide:x",class:"stroke-3! text-muted-foreground"})])):Ne("",!0)]),ge("div",k0,[q(g,{class:"overflow-x-hidden",explorerFiles:N(a),"onUpdate:explorerFiles":c[3]||(c[3]=$=>bt(a)?a.value=$:null),isShowArrow:!1,isExpandedByArrow:!1,onClickTreeItem:l},{"extra-actions":oe(()=>[q(f,{size:"iconSm",class:"hover:bg-background",variant:"ghost"},{default:oe(()=>[q(N(ze),{name:"hugeicons:dashed-line-circle",class:"size-4! min-w-4 text-muted-foreground"})]),_:1})]),_:1},8,["explorerFiles"])])])],2)}}});function I0(e){const t=pe(!1),n=pe(!0),o=pe("dots"),i=pe({tableId:"",relatedColumnIds:new Set,edgeIds:new Set}),r=pe({edgeId:"",sourceId:"",targetId:""}),{getEdges:s,findEdge:a,findNode:l,fitView:u,getViewport:c,getNodes:d}=$e(),f=P=>{if(!e.focusTableId)return;const z=P.findNode(e.focusTableId);if(!z)return;const D=new Set,F=new Set,R=!0;z.selected=!0,s.value.forEach(O=>{if(O.sourceNode.id===z.id||O.targetNode.id===z.id){const V=vt(O.sourceNode.id,O.sourceHandle),k=vt(O.targetNode.id,O.targetHandle);F.add(V),F.add(k),D.add(O.id),Ct(O,R,i.value,r.value)}}),i.value={tableId:z.id,edgeIds:D,relatedColumnIds:F}},g=P=>{P.sort((D,F)=>Number(D.selected)-Number(F.selected)).forEach(D=>{if(D.type!=="select")return;const F=D.selected;s.value.forEach(R=>{var U,h,M,v,T,I;if(!(R.sourceNode.id===D.id||R.targetNode.id===D.id))return;const V=vt(R.sourceNode.id,R.sourceHandle),k=vt(R.targetNode.id,R.targetHandle);F?((U=i.value)==null||U.relatedColumnIds.add(V),(h=i.value)==null||h.relatedColumnIds.add(k),(M=i.value)==null||M.edgeIds.add(R.id)):((v=i.value)==null||v.relatedColumnIds.delete(V),(T=i.value)==null||T.relatedColumnIds.delete(k),(I=i.value)==null||I.edgeIds.delete(R.id)),Ct(R,F,i.value,r.value)})})};return{isUseBgGrid:o,isUseMiniMap:n,isHand:t,activeTable:i,activeEdge:r,onInitVueFlow:f,onNodesChange:g,onEdgesChange:P=>{P.forEach(z=>{if(z.type!=="select")return;const D=a(z.id);if(!D)return;const F=z.selected,R=vt(D.sourceNode.id,D.sourceHandle),O=vt(D.targetNode.id,D.targetHandle);r.value=F?{edgeId:z.id,sourceId:R,targetId:O}:null,Ct(D,F,i.value,r.value)})},onNodeMouseEnter:({node:P})=>{P.selected||s.value.forEach(z=>{(z.sourceNode.id===P.id||z.targetNode.id===P.id)&&Ct(z,!0,i.value,r.value)})},onNodeMouseLeave:({node:P})=>{P.selected||s.value.forEach(z=>{(z.sourceNode.id===P.id||z.targetNode.id===P.id)&&Ct(z,!1,i.value,r.value)})},handleEdgeMouseEnter:({edge:P})=>{P.selected||Ct(P,!0,i.value,r.value)},handleEdgeMouseLeave:({edge:P})=>{P.selected||Ct(P,!1,i.value,r.value)},onDoubleClickEdge:({edge:P})=>{P.selected=!0,mi({nodeId:P.source,findNode:l,fitView:u,getViewport:c})},getNodes:d,fitView:u,onfocusNode:P=>{mi({nodeId:P,findNode:l,fitView:u,getViewport:c});const z=l(P);z&&(z.selected=!0,g([{id:P,type:"select",selected:!0}]))}}}const P0=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}=Pl(),i=e,r=t,{onInitVueFlow:s,onNodesChange:a,onEdgesChange:l,onNodeMouseEnter:u,onNodeMouseLeave:c,handleEdgeMouseEnter:d,handleEdgeMouseLeave:f,onDoubleClickEdge:g,isHand:$,isUseBgGrid:y,isUseMiniMap:m,getNodes:p,fitView:b,onfocusNode:w}=I0(i),C=()=>{var P;(P=p.value)==null||P.forEach(z=>{var F;const D=(F=i.matrixTablePosition)==null?void 0:F[z.id];D&&(z.position=D)}),b({duration:Kn})};return(P,z)=>(G(),ie(Ie,null,[q(N(Jg),{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(Dl),x:N(n)/2-N(_s)/2,y:N(o)/2-200},"min-zoom":N(zl),"max-zoom":N(Al),onInit:N(s),onNodeMouseEnter:N(u),onNodeMouseLeave:N(c),onEdgeMouseEnter:N(d),onEdgeMouseLeave:N(f),onNodesChange:N(a),onEdgesChange:N(l),onEdgeDoubleClick:N(g)},{"edge-custom":oe(D=>[q(p0,ki(ds(D)),null,16)]),"node-value":oe(D=>{var F,R;return[q(n0,rt(D,{isExpanded:(F=i.isExpanded)==null?void 0:F.call(i,N(gn)({schemaName:D.data.schema,tableName:D.data.table})),hasRelations:(R=i.hasRelations)==null?void 0:R.call(i,N(gn)({schemaName:D.data.schema,tableName:D.data.table})),onExpand:z[0]||(z[0]=O=>r("expand",O)),onCollapse:z[1]||(z[1]=O=>r("collapse",O))}),null,16,["isExpanded","hasRelations"])]}),default:oe(()=>[N(y)?(G(),he(N(dp),{key:0,size:2,gap:30,variant:N(y)},null,8,["variant"])):Ne("",!0),N(m)?(G(),he(N(Ky),{key:1,pannable:"",position:"top-right","node-color":"var(--primary)",nodeBorderRadius:10})):Ne("",!0),q(r0,{isShowFilter:i.isShowFilter,isHand:N($),"onUpdate:isHand":z[2]||(z[2]=D=>bt($)?$.value=D:null),isUseBgGrid:N(y),"onUpdate:isUseBgGrid":z[3]||(z[3]=D=>bt(y)?y.value=D:null),isUseMiniMap:N(m),"onUpdate:isUseMiniMap":z[4]||(z[4]=D=>bt(m)?m.value=D:null),"onUpdate:isShowFilter":z[5]||(z[5]=D=>r("update:isShowFilter",D)),onArrange:C},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"]),q(M0,{isShowFilter:i.isShowFilter,"onUpdate:isShowFilter":[z[6]||(z[6]=D=>i.isShowFilter=D),z[7]||(z[7]=D=>r("update:isShowFilter",D))],"table-id":i.tableId,tables:i.tables,onFocusTable:N(w)},null,8,["isShowFilter","table-id","tables","onFocusTable"])],64))}});export{n0 as E,P0 as _,Xr as a,z0 as b,dp as c,p0 as d,Jg as e};
|