@intent-hq/web 2.310.1 → 2.310.2
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/package.json +1 -1
- package/web/app/immutable/assets/{DiagramPresentation.fimBl1wP.css → DiagramPresentation.Bfi3xHm0.css} +1 -1
- package/web/app/immutable/chunks/-xK_vQQs.js +1 -0
- package/web/app/immutable/chunks/{CQe4IdgR.js → 189zCzpy.js} +1 -1
- package/web/app/immutable/chunks/6XLvYn_R.js +4 -0
- package/web/app/immutable/chunks/{BIxkRFIj.js → 7LPFBi2V.js} +2 -2
- package/web/app/immutable/chunks/{D81gRUjY.js → 9Al7uANH.js} +1 -1
- package/web/app/immutable/chunks/{xMirTl3q.js → 9Ax53qRD.js} +2 -2
- package/web/app/immutable/chunks/{DQEBW0YT.js → 9U2m-KE4.js} +1 -1
- package/web/app/immutable/chunks/{t9id1Dgw.js → B08PB3d6.js} +1 -1
- package/web/app/immutable/chunks/B1wLVJWc.js +7 -0
- package/web/app/immutable/chunks/B1zCpBoo.js +217 -0
- package/web/app/immutable/chunks/{CsYRAdgB.js → B2-LFLJm.js} +1 -1
- package/web/app/immutable/chunks/{B4dTn6xv.js → B3NZDdp-.js} +1 -1
- package/web/app/immutable/chunks/{r1_PrlQL.js → B3u9yhMd.js} +1 -1
- package/web/app/immutable/chunks/{DzvQOT8_.js → B6ACa1PM.js} +1 -1
- package/web/app/immutable/chunks/{DXOCO_oS.js → B7VxeONz.js} +1 -1
- package/web/app/immutable/chunks/{CEdLQlJ6.js → BGOzArFr.js} +6 -6
- package/web/app/immutable/chunks/{Bfkn2BGM.js → BGSgFd0R.js} +1 -1
- package/web/app/immutable/chunks/{C7oH1dbI.js → BHMk19Fd.js} +1 -1
- package/web/app/immutable/chunks/{DUkegami.js → BRp0P9cF.js} +1 -1
- package/web/app/immutable/chunks/{BtHVXttl.js → BS3KKa6i.js} +5 -5
- package/web/app/immutable/chunks/{Bhcwd2SW.js → BSN7-Qxa.js} +4 -4
- package/web/app/immutable/chunks/{CnmCWFKQ.js → BU1SD4F5.js} +2 -2
- package/web/app/immutable/chunks/BUvLOETw.js +8 -0
- package/web/app/immutable/chunks/{CwH3s3Sg.js → B_CxKeY9.js} +1 -1
- package/web/app/immutable/chunks/{CsASRGy9.js → B_F8B07u.js} +5 -5
- package/web/app/immutable/chunks/{D-9LH0ah.js → B_u6ph9g.js} +1 -1
- package/web/app/immutable/chunks/{CHH2PtZ7.js → BbajLcMi.js} +1 -1
- package/web/app/immutable/chunks/{TQIai6Ne.js → BcGA_XKM.js} +79 -79
- package/web/app/immutable/chunks/Bdj20t_M.js +200 -0
- package/web/app/immutable/chunks/{Si43_nYW.js → BfVF2I5Q.js} +3 -3
- package/web/app/immutable/chunks/{B20hJMKp.js → BgjzIHmr.js} +2 -2
- package/web/app/immutable/chunks/BhFdeIZl.js +1 -0
- package/web/app/immutable/chunks/{CeEeQIAV.js → BjS3bCVA.js} +1 -1
- package/web/app/immutable/chunks/Bl1SUWQK.js +1 -0
- package/web/app/immutable/chunks/BtFywNMt.js +40 -0
- package/web/app/immutable/chunks/{B_D0NLtg.js → BwThkZnv.js} +1 -1
- package/web/app/immutable/chunks/ByGoYv9M.js +1 -0
- package/web/app/immutable/chunks/Bz2AaX7v.js +38 -0
- package/web/app/immutable/chunks/{j0ThtFJc.js → BzqKIdEP.js} +1 -1
- package/web/app/immutable/chunks/{BV9p4X5I.js → C-27EQSK.js} +6 -6
- package/web/app/immutable/chunks/C2FKcF8a.js +99 -0
- package/web/app/immutable/chunks/{D04E4MVv.js → C2ypXh8V.js} +4 -4
- package/web/app/immutable/chunks/{DaEQgqyy.js → C5bjHjx4.js} +1 -1
- package/web/app/immutable/chunks/{C-Mmob1s.js → C64YVcCh.js} +1 -1
- package/web/app/immutable/chunks/{BV7dztYI.js → C7-VQsLR.js} +1 -1
- package/web/app/immutable/chunks/C7ldC6zu.js +41 -0
- package/web/app/immutable/chunks/{CgAIOmc3.js → C7xfOFNZ.js} +4 -4
- package/web/app/immutable/chunks/{phowbgF-.js → CAt8c0ls.js} +1 -1
- package/web/app/immutable/chunks/CC-vc0Sh.js +2 -0
- package/web/app/immutable/chunks/{DjEB6QMF.js → CDmxeAFz.js} +1 -1
- package/web/app/immutable/chunks/{DevHtnbn.js → CLUug_7o.js} +1 -1
- package/web/app/immutable/chunks/{CPvhRhlk.js → CLyqqizl.js} +11 -11
- package/web/app/immutable/chunks/{DQulsXJ7.js → CO5Qz17e.js} +1 -1
- package/web/app/immutable/chunks/{B9r0JXjW.js → COBtdbv4.js} +1 -1
- package/web/app/immutable/chunks/COZ8XMYr.js +2 -0
- package/web/app/immutable/chunks/{qMHHnffV.js → CQK97B3l.js} +1 -1
- package/web/app/immutable/chunks/{CQf-fH5v.js → CYTBw0CY.js} +1 -1
- package/web/app/immutable/chunks/{CUvX4uDB.js → CZLMJ41d.js} +3 -3
- package/web/app/immutable/chunks/{Cuozo7M1.js → CZqaUHhn.js} +1 -1
- package/web/app/immutable/chunks/CeVWos-t.js +1 -0
- package/web/app/immutable/chunks/CepoDpYW.js +1 -0
- package/web/app/immutable/chunks/{DdAxykhC.js → CiBABzvX.js} +1 -1
- package/web/app/immutable/chunks/{D8SVxzqF.js → CjcP6chv.js} +1 -1
- package/web/app/immutable/chunks/{EZw3rvya.js → CkactGV1.js} +30 -30
- package/web/app/immutable/chunks/ClebXGIM.js +141 -0
- package/web/app/immutable/chunks/{BCm8Gasf.js → CnfDI0G9.js} +1 -1
- package/web/app/immutable/chunks/{BEhoKnQT.js → CoiqgZqV.js} +1 -1
- package/web/app/immutable/chunks/{DRMT9vvq.js → CpQksukT.js} +1 -1
- package/web/app/immutable/chunks/CrX2GQl1.js +1 -0
- package/web/app/immutable/chunks/{DCeW9_0X.js → CtDXgUYh.js} +2 -2
- package/web/app/immutable/chunks/CvEzUeZj.js +39 -0
- package/web/app/immutable/chunks/{CCIGQjYf.js → CxP8jrn2.js} +1 -1
- package/web/app/immutable/chunks/{D411lQkp.js → D2XAsGw-.js} +1 -1
- package/web/app/immutable/chunks/D3in5AGo.js +34 -0
- package/web/app/immutable/chunks/D3ma4MWK.js +84 -0
- package/web/app/immutable/chunks/{_F3xl3RI.js → D3p4HGPq.js} +1 -1
- package/web/app/immutable/chunks/D57k4GEE.js +344 -0
- package/web/app/immutable/chunks/{BUSwtV99.js → D5mZ2XGM.js} +1 -1
- package/web/app/immutable/chunks/{D_9AVJm5.js → DE1vhlzN.js} +1 -1
- package/web/app/immutable/chunks/{CWyh7Yhz.js → DI-WSiIl.js} +1 -1
- package/web/app/immutable/chunks/DMfS3QUv.js +213 -0
- package/web/app/immutable/chunks/DMmGJ3th.js +140 -0
- package/web/app/immutable/chunks/DPADHNob.js +3 -0
- package/web/app/immutable/chunks/DPcySxOl.js +24 -0
- package/web/app/immutable/chunks/{ejL3HmTG.js → DQNwUygY.js} +3 -3
- package/web/app/immutable/chunks/{BGLkcG6I.js → DR3ukAe9.js} +2 -2
- package/web/app/immutable/chunks/{BmDskjjc.js → DRKyy5zo.js} +1 -1
- package/web/app/immutable/chunks/DTpCNXVX.js +62 -0
- package/web/app/immutable/chunks/DW02E8JU.js +291 -0
- package/web/app/immutable/chunks/{BKY64haD.js → DbnaPZDp.js} +6 -6
- package/web/app/immutable/chunks/Dhhgf7-r.js +36 -0
- package/web/app/immutable/chunks/{C8CCN24q.js → DjaKy3j_.js} +1 -1
- package/web/app/immutable/chunks/{C0DDaBnV.js → Dk4znOdW.js} +1 -1
- package/web/app/immutable/chunks/{R7gFhaG_.js → Dl1xcl6N.js} +1 -1
- package/web/app/immutable/chunks/Dmv_LV6R.js +106 -0
- package/web/app/immutable/chunks/{BNg3GOxL.js → Dr28se2A.js} +2 -2
- package/web/app/immutable/chunks/Dr_BXnmT.js +169 -0
- package/web/app/immutable/chunks/{ByGsJxdn.js → Dvt2xumc.js} +1 -1
- package/web/app/immutable/chunks/DxHqMweQ.js +27 -0
- package/web/app/immutable/chunks/Dyv7eW7r.js +1 -0
- package/web/app/immutable/chunks/{CBHPIqXg.js → DzDnAGVP.js} +1 -1
- package/web/app/immutable/chunks/{C0Yks_oS.js → IIWxUL8F.js} +1 -1
- package/web/app/immutable/chunks/IjQ_akx8.js +24 -0
- package/web/app/immutable/chunks/{DeopB2f-.js → JFNcUgqI.js} +3 -3
- package/web/app/immutable/chunks/{dtB9lR1B.js → JvGvDA7z.js} +1 -1
- package/web/app/immutable/chunks/{BsP5G0Fo.js → LXPDKlyI.js} +1 -1
- package/web/app/immutable/chunks/{zXW6V5sa.js → M5rEGvXZ.js} +1 -1
- package/web/app/immutable/chunks/{DOVnLHFz.js → O55LMojB.js} +1 -1
- package/web/app/immutable/chunks/{t3bi-ExW.js → O86272iX.js} +2 -2
- package/web/app/immutable/chunks/{D-o9b0Cd.js → PW60rHG1.js} +2 -2
- package/web/app/immutable/chunks/{fULl8IO9.js → UzQ5fjmd.js} +7 -7
- package/web/app/immutable/chunks/VmPClZ6P.js +98 -0
- package/web/app/immutable/chunks/WKN7DEK1.js +292 -0
- package/web/app/immutable/chunks/{7KTbkf4W.js → YuniekLU.js} +2 -2
- package/web/app/immutable/chunks/{DxlwMmI8.js → _Q4NEhG2.js} +1 -1
- package/web/app/immutable/chunks/{DMGAuSgb.js → _sFm91KN.js} +4 -4
- package/web/app/immutable/chunks/{Drg52kVf.js → cF0DaKkd.js} +1 -1
- package/web/app/immutable/chunks/{DOHtPCK9.js → d9OF_ecy.js} +1 -1
- package/web/app/immutable/chunks/eHLf0w_s.js +1 -0
- package/web/app/immutable/chunks/ey5Fwige.js +1 -0
- package/web/app/immutable/chunks/gq2RHuUM.js +120 -0
- package/web/app/immutable/chunks/{BKGPkCRs.js → hJG5qV93.js} +1 -1
- package/web/app/immutable/chunks/jfltPaLX.js +370 -0
- package/web/app/immutable/chunks/{BBTS8ZOM.js → l0v05b1J.js} +3 -3
- package/web/app/immutable/chunks/{CnszEr0a.js → le8iLKoG.js} +1 -1
- package/web/app/immutable/chunks/{CoeuT-m3.js → mCGfnSaU.js} +1 -1
- package/web/app/immutable/chunks/{B0X6Qy4e.js → mNrkfPcL.js} +1 -1
- package/web/app/immutable/chunks/{DLm51UIm.js → tzNFwvLY.js} +1 -1
- package/web/app/immutable/chunks/{Coy9jSf1.js → xL2Hl8pt.js} +1 -1
- package/web/app/immutable/chunks/{qOCErwrn.js → yEkT96At.js} +1 -1
- package/web/app/immutable/chunks/{DhdMM_zt.js → yGxUPrAb.js} +14 -14
- package/web/app/immutable/entry/{app.DlF41taB.js → app.CWgSMPHo.js} +2 -2
- package/web/app/immutable/entry/start.DRM4Ek1S.js +1 -0
- package/web/app/immutable/nodes/{0.BLjNhnkb.js → 0.DsHcmAxw.js} +1 -1
- package/web/app/immutable/nodes/{1.DaghOy3j.js → 1.CkY-7ake.js} +1 -1
- package/web/app/immutable/nodes/{10.CbV_flkh.js → 10.CdTsXOpX.js} +1 -1
- package/web/app/immutable/nodes/{14.N_oC1pv5.js → 14.juvATfIp.js} +1 -1
- package/web/app/immutable/nodes/{16.Cn0uYbJe.js → 16.DuXLhJX1.js} +2 -2
- package/web/app/immutable/nodes/{2.CMERPJYK.js → 2.DL0H4Ehj.js} +8 -8
- package/web/app/immutable/nodes/{3.Dk5w9XeG.js → 3.CsarMzm8.js} +1 -1
- package/web/app/immutable/nodes/{4.CvLiKH0B.js → 4.DOKXGcKD.js} +1 -1
- package/web/app/immutable/nodes/{5.BL5oLCOi.js → 5.5nmYhZgy.js} +1 -1
- package/web/app/immutable/nodes/{6.DiKzgiKt.js → 6.BMO8vjvw.js} +1 -1
- package/web/app/immutable/nodes/{7.CM-hNW3A.js → 7.Rmoc-ypk.js} +1 -1
- package/web/app/immutable/nodes/{8.BThIGSQR.js → 8.Dy5AT1iw.js} +2 -2
- package/web/app/immutable/nodes/{9.D70tN3NX.js → 9.Dtv2dSUT.js} +18 -18
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/-SL67XKV.js +0 -1
- package/web/app/immutable/chunks/351KaJp_.js +0 -24
- package/web/app/immutable/chunks/7Iuyw4Ow.js +0 -106
- package/web/app/immutable/chunks/9ySBq1wF.js +0 -36
- package/web/app/immutable/chunks/B2safKX4.js +0 -1
- package/web/app/immutable/chunks/B8QrskMI.js +0 -139
- package/web/app/immutable/chunks/BCO4VeSA.js +0 -1
- package/web/app/immutable/chunks/BCaDoF8Y.js +0 -1
- package/web/app/immutable/chunks/BEdJCn-8.js +0 -1
- package/web/app/immutable/chunks/BGBb6fI-.js +0 -120
- package/web/app/immutable/chunks/BGQ3htf5.js +0 -1
- package/web/app/immutable/chunks/BKLEAopb.js +0 -7
- package/web/app/immutable/chunks/BKSgn5w-.js +0 -1
- package/web/app/immutable/chunks/BOXqfDS_.js +0 -40
- package/web/app/immutable/chunks/BP_ooGOd.js +0 -24
- package/web/app/immutable/chunks/BQApP15C.js +0 -99
- package/web/app/immutable/chunks/BS6cE8e9.js +0 -231
- package/web/app/immutable/chunks/BTXk2yGf.js +0 -96
- package/web/app/immutable/chunks/BVrOGXf1.js +0 -78
- package/web/app/immutable/chunks/BZoKWA-r.js +0 -96
- package/web/app/immutable/chunks/BbiXTFqz.js +0 -1
- package/web/app/immutable/chunks/BgmKjqUX.js +0 -1
- package/web/app/immutable/chunks/Bk7xBWHf.js +0 -34
- package/web/app/immutable/chunks/BoiNnj2h.js +0 -1
- package/web/app/immutable/chunks/BrVvVCxw.js +0 -1
- package/web/app/immutable/chunks/ByM2DIOs.js +0 -1
- package/web/app/immutable/chunks/ByzYvvQp.js +0 -70
- package/web/app/immutable/chunks/Bz0SnIMO.js +0 -1
- package/web/app/immutable/chunks/C1IwSyrV.js +0 -99
- package/web/app/immutable/chunks/C9gL5x04.js +0 -39
- package/web/app/immutable/chunks/C9nyJoiB.js +0 -41
- package/web/app/immutable/chunks/CBV2Z_QZ.js +0 -89
- package/web/app/immutable/chunks/CDHds8o_.js +0 -3
- package/web/app/immutable/chunks/CHIHAnR-.js +0 -1
- package/web/app/immutable/chunks/CHj2oCmD.js +0 -39
- package/web/app/immutable/chunks/CIXNMjfT.js +0 -206
- package/web/app/immutable/chunks/CKFDW9cI.js +0 -24
- package/web/app/immutable/chunks/CKQlE_M1.js +0 -88
- package/web/app/immutable/chunks/CSBhPNbN.js +0 -206
- package/web/app/immutable/chunks/CSLTsum9.js +0 -38
- package/web/app/immutable/chunks/CSbiiZpm.js +0 -354
- package/web/app/immutable/chunks/CToDhNW4.js +0 -1
- package/web/app/immutable/chunks/CYFK9YEX.js +0 -168
- package/web/app/immutable/chunks/CcGF51wP.js +0 -1
- package/web/app/immutable/chunks/Cd5vVJw4.js +0 -292
- package/web/app/immutable/chunks/CgjSMAIJ.js +0 -120
- package/web/app/immutable/chunks/Ck7B90Kr.js +0 -38
- package/web/app/immutable/chunks/CkAILno9.js +0 -62
- package/web/app/immutable/chunks/CkawHIFZ.js +0 -1
- package/web/app/immutable/chunks/ClXr1b-t.js +0 -8
- package/web/app/immutable/chunks/CmWBRPmR.js +0 -24
- package/web/app/immutable/chunks/Cmo-9vFV.js +0 -1
- package/web/app/immutable/chunks/CoFCa7Mb.js +0 -231
- package/web/app/immutable/chunks/CrcLvVto.js +0 -84
- package/web/app/immutable/chunks/Cs_Q6mos.js +0 -1
- package/web/app/immutable/chunks/CsnLwu9F.js +0 -2
- package/web/app/immutable/chunks/CuYeKLE8.js +0 -8
- package/web/app/immutable/chunks/CvOaoHrI.js +0 -1
- package/web/app/immutable/chunks/CvYzv8kf.js +0 -1
- package/web/app/immutable/chunks/CxRm1vYn.js +0 -342
- package/web/app/immutable/chunks/CyfBUrNA.js +0 -1
- package/web/app/immutable/chunks/D1QKDDLH.js +0 -1
- package/web/app/immutable/chunks/D61DwhDw.js +0 -3
- package/web/app/immutable/chunks/DBAJPVI_.js +0 -1
- package/web/app/immutable/chunks/DBt8jmEX.js +0 -40
- package/web/app/immutable/chunks/DD-T_Om0.js +0 -178
- package/web/app/immutable/chunks/DEOiJZFa.js +0 -168
- package/web/app/immutable/chunks/DHW4IXFj.js +0 -36
- package/web/app/immutable/chunks/DJ0w8Oax.js +0 -129
- package/web/app/immutable/chunks/DJ52BT20.js +0 -1
- package/web/app/immutable/chunks/DK1048Bw.js +0 -129
- package/web/app/immutable/chunks/DZ0nrC9W.js +0 -162
- package/web/app/immutable/chunks/DeRneTJF.js +0 -106
- package/web/app/immutable/chunks/Df6EnPla.js +0 -4
- package/web/app/immutable/chunks/DfMKUxMU.js +0 -30
- package/web/app/immutable/chunks/DkH3yb1j.js +0 -34
- package/web/app/immutable/chunks/Doxgswr3.js +0 -4
- package/web/app/immutable/chunks/Dt53cexP.js +0 -1
- package/web/app/immutable/chunks/Dx6eBL0x.js +0 -1
- package/web/app/immutable/chunks/HP7Asd0t.js +0 -2
- package/web/app/immutable/chunks/HP8lGamR.js +0 -257
- package/web/app/immutable/chunks/HzpfURmp.js +0 -84
- package/web/app/immutable/chunks/PJfe_iA1.js +0 -1
- package/web/app/immutable/chunks/PXMyYXQv.js +0 -1
- package/web/app/immutable/chunks/Qi3HrsAm.js +0 -1
- package/web/app/immutable/chunks/S1FanOB0.js +0 -162
- package/web/app/immutable/chunks/SuMU9B9i.js +0 -1
- package/web/app/immutable/chunks/UaGv-ChR.js +0 -257
- package/web/app/immutable/chunks/YqyEOqRv.js +0 -178
- package/web/app/immutable/chunks/_MGNV7ZN.js +0 -338
- package/web/app/immutable/chunks/_lZu5Dth.js +0 -292
- package/web/app/immutable/chunks/gzjZWAx8.js +0 -62
- package/web/app/immutable/chunks/hqSEunOk.js +0 -15
- package/web/app/immutable/chunks/nGCCQCpO.js +0 -1
- package/web/app/immutable/chunks/o-kBqlaj.js +0 -7
- package/web/app/immutable/chunks/opO2fBQB.js +0 -1
- package/web/app/immutable/chunks/pdFamTTi.js +0 -7
- package/web/app/immutable/chunks/rEI8JpP3.js +0 -1
- package/web/app/immutable/chunks/s5P9UVzf.js +0 -1
- package/web/app/immutable/chunks/sIHUXgeh.js +0 -41
- package/web/app/immutable/entry/start.CCtO40vu.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as vr,ad as So,a as f,ag as ir}from"./CSbiiZpm.js";import{g as A}from"./CxRm1vYn.js";var cr=5,nn=1e-5,on=1e-6;function _e(t){const e=[];for(let n=0;n<t.length-1;n++)e.push({a:t[n],b:t[n+1]});return e}A(_e,"buildSegmentList");f(_e,"buildSegmentList");function Co(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=o.x-n.x,l=o.y-n.y,d=s*l-r*a;if(d===0)return null;const i=n.x-t.x,g=n.y-t.y,x=(i*l-g*a)/d,C=(i*r-g*s)/d;return x<=on||x>=1-on||C<=on||C>=1-on?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:C}}A(Co,"segmentIntersection");f(Co,"segmentIntersection");function an(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}A(an,"isHorizontalSeg");f(an,"isHorizontalSeg");function vo(t){const e=[];for(let n=0;n<t.length;n++){const o=t[n],s=_e(o.points);for(let r=n+1;r<t.length;r++){const a=t[r],l=_e(a.points);for(const[d,i]of s.entries())for(const[g,x]of l.entries()){const C=Co(i.a,i.b,x.a,x.b);if(!C)continue;const h=an(i),p=an(x);(h!==p?h:!1)?e.push({jumpEdgeId:o.id,otherEdgeId:a.id,segIndex:d,t:C.tA,point:C.point}):e.push({jumpEdgeId:a.id,otherEdgeId:o.id,segIndex:g,t:C.tB,point:C.point})}}}return e}A(vo,"findEdgeIntersections");f(vo,"findEdgeIntersections");function re(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}A(re,"fmt");f(re,"fmt");function Ce(t){return`${re(t.x)},${re(t.y)}`}A(Ce,"pointToString");f(Ce,"pointToString");function Lo(t){const e=t.b.x-t.a.x,n=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(n)?e>=0?1:0:n>=0?1:0}A(Lo,"getArcSweepFlag");f(Lo,"getArcSweepFlag");var Lr=.001;function To(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&ir[e.arrowTypeStart];if(o){const r=t[0],a=t[1],l=Math.atan2(a.y-r.y,a.x-r.x);n[0].x=r.x+o*Math.cos(l),n[0].y=r.y+o*Math.sin(l)}const s=e.arrowTypeEnd&&ir[e.arrowTypeEnd];if(s){const r=t.length,a=t[r-2],l=t[r-1],d=Math.atan2(l.y-a.y,l.x-a.x);n[r-1].x=l.x-s*Math.cos(d),n[r-1].y=l.y-s*Math.sin(d)}return n}A(To,"applyMarkerOffsets");f(To,"applyMarkerOffsets");function Eo(t,e,n,o,s){const r=t.point.x,a=t.point.y,l={x:r-e*t.r,y:a-n*t.r},d={x:r+e*t.r,y:a+n*t.r},i=[`L${Ce(l)}`];return s==="arc"?i.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${Ce(d)}`):i.push(`M${Ce(d)}`),i}A(Eo,"emitJump");f(Eo,"emitJump");function ln(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=n.x-e.x,l=n.y-e.y,d=Math.hypot(s,r),i=Math.hypot(a,l);if(d<nn||i<nn)return null;const g=s/d,x=r/d,C=a/i,h=l/i,p=g*C+x*h,c=Math.max(-1,Math.min(1,p)),y=Math.acos(c);if(y<nn||Math.abs(Math.PI-y)<nn)return null;const v=Math.min(o/Math.sin(y/2),d/2,i/2);return{startX:e.x-g*v,startY:e.y-x*v,endX:e.x+C*v,endY:e.y+h*v,ctrlX:e.x,ctrlY:e.y,cutLen:v}}A(ln,"computeRoundedCorner");f(ln,"computeRoundedCorner");function wo(t,e,n){const o=t.points;if(o.length<2)return"";const s=To(o,t),r=t.curve==="rounded",a=_e(s),l=new Map;for(const i of e){const g=a[i.segIndex];if(!g)continue;const x=Math.hypot(g.b.x-g.a.x,g.b.y-g.a.y),C=l.get(i.segIndex)??[];C.push({t:i.t,point:i.point,d:i.t*x,r:n.jumpRadius}),l.set(i.segIndex,C)}const d=[`M${Ce(s[0])}`];for(let i=0;i<a.length;i++){const g=a[i],x=Math.hypot(g.b.x-g.a.x,g.b.y-g.a.y),C=x===0?0:(g.b.x-g.a.x)/x,h=x===0?0:(g.b.y-g.a.y)/x,p=Lo(g);let c=0;if(r&&i>0){const T=ln(s[i-1],s[i],s[i+1]??s[i],cr);T&&(c=T.cutLen)}let y=x,v=null;r&&i<a.length-1&&(v=ln(s[i],s[i+1],s[i+2]??s[i+1],cr),v&&(y=x-v.cutLen));const M=[...l.get(i)??[]].sort((T,E)=>T.t-E.t);for(const T of M)T.r=Math.min(T.r,T.d-c,y-T.d);for(let T=0;T<M.length-1;T++){const E=M[T+1].d-M[T].d;if(M[T].r+M[T+1].r>E){const m=E/2;M[T].r=Math.min(M[T].r,m),M[T+1].r=Math.min(M[T+1].r,m)}}for(const T of M)T.r<Lr||d.push(...Eo(T,C,h,p,n.jumpStyle));r&&v?(d.push(`L${re(v.startX)},${re(v.startY)}`),d.push(`Q${re(v.ctrlX)},${re(v.ctrlY)} ${re(v.endX)},${re(v.endY)}`)):d.push(`L${Ce(g.b)}`)}return d.join(" ")}A(wo,"rewriteEdgePath");f(wo,"rewriteEdgePath");function Ro(t){return/^[\d\s+,.LMelm-]*$/.test(t)}A(Ro,"isStraightPath");f(Ro,"isStraightPath");function Ao(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}A(Ao,"curveSupportsLineHops");f(Ao,"curveSupportsLineHops");function Oo(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),n=JSON.parse(e);if(!Array.isArray(n))return null;const o=[];for(const s of n)s&&typeof s.x=="number"&&typeof s.y=="number"&&o.push({x:s.x,y:s.y});return o.length>=2?o:null}catch{return null}}A(Oo,"decodeDataPoints");f(Oo,"decodeDataPoints");function No(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const i of e)s.set(i.id,i);const r=[],a=new Map;for(const i of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(i.id):i.id,x=o.querySelector(`path[data-id="${g}"]`);if(!x)continue;a.set(i.id,x);const h=Oo(x.getAttribute("data-points"))??i.points;r.push({...i,points:h})}const l=vo(r);if(l.length===0)return;const d=new Map;for(const i of l){const g=d.get(i.jumpEdgeId)??[];g.push(i),d.set(i.jumpEdgeId,g)}for(const i of r){const g=d.get(i.id);if(!g||g.length===0)continue;const C=s.get(i.id)?.curve;if(C!==void 0&&!Ao(C))continue;const h=a.get(i.id);if(!h)continue;if(C===void 0){const T=h.getAttribute("d")??"";if(!Ro(T))continue}const p=h.getAttribute("style")??"",c=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(p),y=c?Number.parseFloat(c[1]):null,v=c?Number.parseFloat(c[2]):null,M=wo(i,g,n);if(h.setAttribute("d",M),y!==null&&v!==null&&typeof h.getTotalLength=="function"){const T=h.getTotalLength(),E=Math.max(0,T-y-v),m=`0 ${y} ${E} ${v}`,I=p.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${m};`).replace(/;\s*;+/g,";");h.setAttribute("style",I)}}}A(No,"applyLineJumpsToSvg");f(No,"applyLineJumpsToSvg");function Bo(t,{measure:e}){const n=t.config?.swimlane?.lineHops;if(n===!1)return;const o=n==="gap"?"gap":"arc",s=t.edges.filter(r=>Array.isArray(r.points)&&r.points.length>=2).map(r=>({id:r.id,points:r.points,curve:r.curve,arrowTypeStart:r.arrowTypeStart,arrowTypeEnd:r.arrowTypeEnd}));No(e.groups.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}A(Bo,"applySwimlaneLineJumps");f(Bo,"applySwimlaneLineJumps");var xo="__swimlane_default__",Tr=21,ar=20;function dn(t){return Math.max(t.padding??ar,ar)}A(dn,"topLaneHorizontalPadding");f(dn,"topLaneHorizontalPadding");function Po(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const a=n-s/2,l=Math.min(r,n+s/2),d=Math.min(Tr,Math.max(0,l-a)),i=a+d;if(i<=a){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:a,bottom:i}}A(Po,"assignTopLaneTitleRect");f(Po,"assignTopLaneTitleRect");function ko(t){const e=t.direction,n=t.nodes??=[];for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===xo);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:xo,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=xo}A(ko,"prepareLayoutForSwimlanes");f(ko,"prepareLayoutForSwimlanes");function Fo(t){const e=new Map;for(const d of t.nodes??[])e.set(d.id,d);const n=[];for(const d of t.edges??[]){const i=typeof d.start=="string"?d.start:void 0,g=typeof d.end=="string"?d.end:void 0;!i||!g||d.labelNodeId||n.push({id:d.id,src:i,dst:g,ref:d})}const o=t.nodes??[],s=o.filter(d=>d.isGroup),r=o.filter(d=>!d.isGroup);return{nodes:[...[...s].reverse(),...r].map(d=>d.id),edges:n,layout:t,nodeById:e}}A(Fo,"toGraphView");f(Fo,"toGraphView");function _o(t,e,n,o){const{layout:s}=t,r=t.nodeById,a=o?.layerGap??100,l=o?.nodeGap??40;let d=0;for(const C of e.layers){let h=0;for(const p of C){const c=r.get(p);if(!c){h++;continue}c.layer=d,c.order=h;const y=n.x[p]??h*l,v=n.y[p]??d*a;c.x=y,c.y=v,h++}d++}const i=s.nodes??[],g=new Map,x=[];for(const C of i){if(!C?.isGroup)continue;C.parentId||x.push(C);const h=i.filter(M=>M.parentId===C.id);let p=1/0,c=-1/0,y=1/0,v=-1/0;for(const M of h){const T=M.x??n.x[M.id],E=M.y??n.y[M.id],m=M.width??0,I=M.height??0;T!=null&&E!=null&&(p=Math.min(p,T-m/2),c=Math.max(c,T+m/2),y=Math.min(y,E-I/2),v=Math.max(v,E+I/2))}if(p===1/0||y===1/0)C.x=C.x??0,C.y=C.y??0,C.width=C.width??0,C.height=C.height??0;else{const M=C.padding??20,T=C.parentId?M:2*dn(C),E=M,m=Math.max(0,c-p)+T,I=Math.max(0,v-y)+E,R=(p+c)/2,O=(y+v)/2;C.x=R,C.y=O,C.width=m,C.height=I,g.set(C.id,{minX:p,maxX:c,minY:y,maxY:v})}}if(x.length>0&&g.size>0){let C=1/0,h=-1/0,p=0;for(const c of x){const y=c.padding??20;y>p&&(p=y);const v=g.get(c.id);v&&(C=Math.min(C,v.minY),h=Math.max(h,v.maxY))}if(C!==1/0&&h!==-1/0){const c=Math.max(0,h-C),v=Math.max(p,36),M=c+2*v,T=(C+h)/2;for(const F of x)F.y=T,F.height=M,F.swimlaneContentTop=C;const E=[...x].sort((F,B)=>{const _=F.x??0,X=B.x??0;return _-X}),m=[],I=[],R=[];for(const F of E){const B=g.get(F.id);if(!B)continue;const _=Math.max(0,B.maxX-B.minX)+2*dn(F),X=(B.minX+B.maxX)/2;m.push(F.id),I.push(X),R.push(_)}const O=m.length;if(O>0){const F=new Map;if(O===1)F.set(m[0],R[0]);else{const B=[];for(let U=0;U<O-1;U++)B.push(I[U+1]-I[U]);const _=new Array(O);_[0]=0;for(let U=0;U<O-1;U++)_[U+1]=2*B[U]-_[U];let X=0,P=Number.POSITIVE_INFINITY;for(let U=0;U<O;U++){const Z=R[U];U%2===0?X=Math.max(X,Z-_[U]):P=Math.min(P,_[U]-Z)}let z=X;X<=P?z=(X+P)/2:z=X;for(let U=0;U<O;U++){const Z=_[U]+(U%2===0?z:-z),ht=Math.max(R[U],Z);F.set(m[U],ht)}}for(const B of x){const _=F.get(B.id);_!=null&&(B.width=_),Po(B)}}}}}A(_o,"writeBackToLayoutData");f(_o,"writeBackToLayoutData");var Er="[EdgeLabelNodes]";function Do(t){const e=[],n=[],o=new Map;for(const a of t.nodes)o.set(a.id,a);for(const a of t.edges){if(!a.label||a.label.length===0||a.isLayoutOnly||a.labelNodeId)continue;const l=a.start?o.get(a.start):void 0,d=a.end?o.get(a.end):void 0;if(!l||!d){So.warn(Er,`Edge ${a.id} has missing source or target node`);continue}const i=`edge-label-${a.start}-${a.end}-${a.id}`,x=l.parentId!==d.parentId?d.parentId:l.parentId,C={id:i,label:a.label,edgeStart:a.start??"",edgeEnd:a.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:x,isGroup:!1,labelStyle:Array.isArray(a.labelStyle)?a.labelStyle[0]:a.labelStyle??"",...l.dir?{dir:l.dir}:{}};e.push(C),a.labelNodeId=i,a.label=void 0,a.text=void 0;const h={id:`${a.id}-to-label`,start:a.start,end:i,type:"normal",isLayoutOnly:!0},p={id:`${a.id}-from-label`,start:i,end:a.end,type:"normal",isLayoutOnly:!0};n.push(h,p)}const s=[...t.nodes,...e],r=[...t.edges,...n];return{...t,nodes:s,edges:r}}A(Do,"createEdgeLabelNodes");f(Do,"createEdgeLabelNodes");var Dt=.001;function Gn(t){const e=t.x??0,n=t.y??0,o=t.width??0,s=t.height??0;return o>0&&s>0?{cx:e,cy:n,rect:ve(e,n,o,s)}:void 0}A(Gn,"measuredNodeRect");f(Gn,"measuredNodeRect");function zn(t){if(t.isGroup)return;const e=Gn(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}A(zn,"nodeBoundsInfoFor");f(zn,"nodeBoundsInfoFor");function ee(t,e,n=Dt){return Math.abs(t.x-e.x)<n&&Math.abs(t.y-e.y)<n}A(ee,"samePoint");f(ee,"samePoint");function dt(t,e,n=Dt){return Math.abs(t.x-e.x)<n}A(dt,"sameX");f(dt,"sameX");function ut(t,e,n=Dt){return Math.abs(t.y-e.y)<n}A(ut,"sameY");f(ut,"sameY");function Tt(t,e,n=Dt){return ut(t,e,n)&&Math.abs(t.x-e.x)>n}A(Tt,"isHorizontalSegment");f(Tt,"isHorizontalSegment");function Et(t,e,n=Dt){return dt(t,e,n)&&Math.abs(t.y-e.y)>n}A(Et,"isVerticalSegment");f(Et,"isVerticalSegment");function zt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}A(zt,"overlapLength");f(zt,"overlapLength");function ce(t,e,n=Dt){return t.horizontal&&e.horizontal&&ut(t.a,e.a,n)?zt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&dt(t.a,e.a,n)?zt(t.a.y,t.b.y,e.a.y,e.b.y):0}A(ce,"sameAxisSegmentOverlapLength");f(ce,"sameAxisSegmentOverlapLength");function Le(t,e=Dt){const n=[];for(let o=0;o<t.length-1;o++){const s=t[o],r=t[o+1],a=Tt(s,r,e),l=Et(s,r,e);(a||l)&&n.push({index:o,a:s,b:r,horizontal:a,vertical:l})}return n}A(Le,"orthogonalSegmentsForPoints");f(Le,"orthogonalSegmentsForPoints");function Zt(t,e=Dt){const n=Le(t,e);let o=0;for(let s=1;s<n.length;s++)n[s-1].horizontal!==n[s].horizontal&&o++;return o}A(Zt,"countOrthogonalBends");f(Zt,"countOrthogonalBends");function mt(t,e=Dt){const n=[];for(const o of t){const s=n.length>0?n[n.length-1]:void 0;(!s||!ee(s,o,e))&&n.push({x:o.x,y:o.y})}return n}A(mt,"dedupeConsecutivePoints");f(mt,"dedupeConsecutivePoints");function $n(t,e=Dt){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Tt(n,o,e)&&Et(o,s,e)&&Tt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:Et(n,o,e)&&Tt(o,s,e)&&Et(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}A($n,"classifyThreeSegmentRoute");f($n,"classifyThreeSegmentRoute");function je(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),a=Math.min(t.y,e.y),l=Math.max(t.y,e.y);return r>n.left-o&&s<n.right+o&&l>n.top-o&&a<n.bottom+o}A(je,"segmentBoundsOverlapRect");f(je,"segmentBoundsOverlapRect");function Vn(t,e,n=0){return t.x>e.left+n&&t.x<e.right-n&&t.y>e.top+n&&t.y<e.bottom-n}A(Vn,"pointInsideRect");f(Vn,"pointInsideRect");function Ho(t,e){return t.left<=e.left&&t.right>=e.right&&t.top<=e.top&&t.bottom>=e.bottom}A(Ho,"rectContainsRect");f(Ho,"rectContainsRect");function De(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}A(De,"rectsOverlap");f(De,"rectsOverlap");function fn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}A(fn,"inflateRect");f(fn,"inflateRect");function ve(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}A(ve,"rectFromCenterSize");f(ve,"rectFromCenterSize");function jt(t){return Gn(t)?.rect}A(jt,"rectOfNodeBounds");f(jt,"rectOfNodeBounds");function Me(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}A(Me,"portForRectSide");f(Me,"portForRectSide");function jn(t,e,n,o,s,r=Dt){const a=e==="left"||e==="right",l=o==="left"||o==="right";if(a&&l){if(e==="right"&&o==="left"&&t.x<n.x||e==="left"&&o==="right"&&t.x>n.x){if(ut(t,n,r))return[t,n];const x=(t.x+n.x)/2;return[t,{x,y:t.y},{x,y:n.y},n]}if(e===o){if(ut(t,n,r))return;const x=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x,y:t.y},{x,y:n.y},n]}return}if(!a&&!l){if(e===o){if(dt(t,n,r))return;const C=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:C},{x:n.x,y:C},n]}if(!(e==="bottom"&&o==="top"&&t.y<n.y||e==="top"&&o==="bottom"&&t.y>n.y))return;if(dt(t,n,r))return[t,n];const x=(t.y+n.y)/2;return[t,{x:t.x,y:x},{x:n.x,y:x},n]}if(a&&!l){const g=e==="right"&&n.x>t.x||e==="left"&&n.x<t.x,x=o==="top"&&t.y<n.y||o==="bottom"&&t.y>n.y;return g&&x?[t,{x:n.x,y:t.y},n]:void 0}const d=e==="bottom"&&n.y>t.y||e==="top"&&n.y<t.y,i=o==="left"&&t.x<n.x||o==="right"&&t.x>n.x;return d&&i?[t,{x:t.x,y:n.y},n]:void 0}A(jn,"buildOrthogonalPortPath");f(jn,"buildOrthogonalPortPath");function Un(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}A(Un,"buildSameSideTrackPath");f(Un,"buildSameSideTrackPath");function Ue(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=zn(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}A(Ue,"collectRealNodeBounds");f(Ue,"collectRealNodeBounds");function ue(t){const e=[],n=[];for(const o of t){const s=zn(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}A(ue,"collectNodeRectEntries");f(ue,"collectNodeRectEntries");function Xo(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,a=o.width??0,l=o.height??0;n.push({nodeId:o.id,...ve(s,r,a,l)})}return n}A(Xo,"collectLayoutNodeRects");f(Xo,"collectLayoutNodeRects");function Wn(t,e,n=Dt){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),a=e.get(s);if(!(!r||!a))return{srcId:o,dstId:s,srcInfo:r,dstInfo:a,collinearX:Math.abs(r.cx-a.cx)<n,collinearY:Math.abs(r.cy-a.cy)<n}}A(Wn,"getNodePairGeometry");f(Wn,"getNodePairGeometry");function At(t,e,n,o=[],s=0){for(const r of n)if(!o.includes(r.id)&&je(t,e,r.rect,-s))return!0;return!1}A(At,"segmentHitsAnyRect");f(At,"segmentHitsAnyRect");function Kn(t,e,n,o,s=Dt,r=1e-6){const a=ut(t,e,s),l=dt(t,e,s),d=ut(n,o,s),i=dt(n,o,s);if(a&&d||l&&i||!(a||l)||!(d||i))return!1;const g=a?{a:t,b:e}:{a:n,b:o},x=l?{a:t,b:e}:{a:n,b:o},C=g.a.y,h=Math.min(g.a.x,g.b.x),p=Math.max(g.a.x,g.b.x),c=x.a.x,y=Math.min(x.a.y,x.b.y),v=Math.max(x.a.y,x.b.y);if(c<h||c>p||C<y||C>v)return!1;const M=Math.abs(c-g.a.x)<r&&Math.abs(C-g.a.y)<r||Math.abs(c-g.b.x)<r&&Math.abs(C-g.b.y)<r,T=Math.abs(c-x.a.x)<r&&Math.abs(C-x.a.y)<r||Math.abs(c-x.b.x)<r&&Math.abs(C-x.b.y)<r;return!(M&&T)}A(Kn,"orthogonalSegmentsCross");f(Kn,"orthogonalSegmentsCross");function Yo(t,e,n,o,s=Dt){const r=ut(t,e,s),a=dt(t,e,s),l=ut(n,o,s),d=dt(n,o,s);return a&&d&&dt(t,n,s)?zt(t.y,e.y,n.y,o.y)>s:r&&l&&ut(t,n,s)?zt(t.x,e.x,n.x,o.x)>s:!1}A(Yo,"sameAxisSegmentsOverlap");f(Yo,"sameAxisSegmentsOverlap");function He(t,e,n,o,{epsilon:s=Dt,skipDegenerateOther:r=!1}={}){for(const a of n){if(a===o||a.isLayoutOnly)continue;const l=a.points;if(!(!l||l.length<2))for(let d=0;d<l.length-1;d++){const i=l[d],g=l[d+1];if(!(r&&ee(i,g,s))&&(Kn(t,e,i,g,s)||Yo(t,e,i,g,s)))return!0}}return!1}A(He,"segmentConflictsWithAnyEdge");f(He,"segmentConflictsWithAnyEdge");function de(t,e,n,o,s=Dt){const r=ut(t,e,s),a=dt(t,e,s),l=ut(n,o,s),d=dt(n,o,s);if(!(r&&d||a&&l))return!1;const i=r?{a:t,b:e}:{a:n,b:o},g=r?{a:n,b:o}:{a:t,b:e},x=i.a.y,C=Math.min(i.a.x,i.b.x),h=Math.max(i.a.x,i.b.x),p=g.a.x,c=Math.min(g.a.y,g.b.y),y=Math.max(g.a.y,g.b.y);return p>C+s&&p<h-s&&x>c+s&&x<y-s}A(de,"orthogonalSegmentsStrictlyCross");f(de,"orthogonalSegmentsStrictlyCross");function un(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>o+Dt&&t<s-Dt}A(un,"strictlyBetween");f(un,"strictlyBetween");function Go(t,e,n){return dt(t,e)&&dt(e,n)?un(e.y,t.y,n.y):ut(t,e)&&ut(e,n)?un(e.x,t.x,n.x):!1}A(Go,"isCollinearIntermediate");f(Go,"isCollinearIntermediate");function zo(t){let e=!1;const n=[];for(let o=0;o<t.length;o++){const s=n[n.length-1],r=t[o],a=o+1<t.length?t[o+1]:void 0;if(s&&a){if(ee(s,a)){o++,e=!0;continue}if(Go(s,r,a)){e=!0;continue}}n.push(r)}return{points:n,changed:e}}A(zo,"simplifyPolylineOnce");f(zo,"simplifyPolylineOnce");function Xe(t){const e=[t[0]];for(let o=1;o<t.length;o++){const s=e[e.length-1],r=t[o];if(!dt(s,r)&&!ut(s,r)){const a=e.length>=2?e[e.length-2]:void 0,d=(a?dt(a,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(d)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!ee(s,o))&&n.push(o)}return n}A(Xe,"orthogonalizePolyline");f(Xe,"orthogonalizePolyline");function ae(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=zo(e);if(e=o.points,!o.changed)break}return e}A(ae,"simplifyPolyline");f(ae,"simplifyPolyline");var ot=.001,wr=.5,lr=4;function Jn(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length<n)return;const s=o.start?e.get(o.start):void 0,r=o.end?e.get(o.end):void 0;return{edge:o,points:o.points,srcRect:s?jt(s):void 0,dstRect:r?jt(r):void 0}}A(Jn,"endpointContextFor");f(Jn,"endpointContextFor");function $o(t,e,n){if(ut(t,e,ot))return{x:t.x<n.left?n.left:n.right,y:t.y};if(dt(t,e,ot)){const o=t.y<n.top?n.top:n.bottom;return{x:t.x,y:o}}return{x:Math.min(n.right,Math.max(n.left,t.x)),y:Math.min(n.bottom,Math.max(n.top,t.y))}}A($o,"segmentEnterPoint");f($o,"segmentEnterPoint");function hn(t,e,n){const o=n?1:-1;let s=n?0:t.length-1;for(;s>=0&&s<t.length&&Vn(t[s],e,wr);)s+=o;if(s<0||s>=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const a=$o(t[s],t[r],e);return n?[a,...t.slice(s)]:[...t.slice(0,s+1),a]}A(hn,"clipEndpoint");f(hn,"clipEndpoint");function Vo(t,e){for(const n of t){const o=Jn(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=hn(s,o.srcRect,!0)),o.dstRect&&(s=hn(s,o.dstRect,!1)),s=ae(Xe(s)),s=qn(s,o.srcRect,o.dstRect),o.edge.points=ae(Xe(s))}}A(Vo,"clipEdgeEndpointsToNodeBoundaries");f(Vo,"clipEdgeEndpointsToNodeBoundaries");function gn(t,e,n,o=!1){if(ut(t,e,ot)){if(e.y<n.top-ot||e.y>n.bottom+ot)return e;if(o){if(t.x<n.left-ot)return{x:n.left,y:t.y};if(t.x>n.right+ot)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(dt(t,e,ot)){if(e.x<n.left-ot||e.x>n.right+ot)return e;if(o){if(t.y<n.top-ot)return{x:t.x,y:n.top};if(t.y>n.bottom+ot)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}A(gn,"snapEndpointToBoundary");f(gn,"snapEndpointToBoundary");function Ye(t,e,n){const o=t[e];for(let s=e+n;s>=0&&s<t.length;s+=n){const r=t[s];if(!ee(r,o,ot))return r}return t[e+n]}A(Ye,"firstDistinctAdjacent");f(Ye,"firstDistinctAdjacent");function Ge(t,e){const n=t+lr,o=e-lr;return n<=o?{lo:n,hi:o}:{lo:(t+e)/2,hi:(t+e)/2}}A(Ge,"cornerClearanceRange");f(Ge,"cornerClearanceRange");function pn(t,e,n){const{lo:o,hi:s}=Ge(e,n);return Math.min(s,Math.max(o,t))}A(pn,"clampToCornerClearance");f(pn,"clampToCornerClearance");function jo(t){const e=Math.max(...t.map(o=>o.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}A(jo,"intersectRanges");f(jo,"intersectRanges");function mn(t,e){return e==="left"||e==="right"?Ge(t.top,t.bottom):Ge(t.left,t.right)}A(mn,"clearanceRangeForSide");f(mn,"clearanceRangeForSide");function ze(t,e,n){const o=t.y>=n.top-ot&&t.y<=n.bottom+ot,s=t.x>=n.left-ot&&t.x<=n.right+ot;if(ut(t,e,ot)&&o){if(Math.abs(t.x-n.left)<ot)return"left";if(Math.abs(t.x-n.right)<ot)return"right"}if(dt(t,e,ot)&&s){if(Math.abs(t.y-n.top)<ot)return"top";if(Math.abs(t.y-n.bottom)<ot)return"bottom"}}A(ze,"terminalSideForSegment");f(ze,"terminalSideForSegment");function Be(t){return t==="left"||t==="right"}A(Be,"isHorizontalSide");f(Be,"isHorizontalSide");function Uo(t,e,n,o,s){const r=[],a=n?ze(t,e,n):void 0,l=o?ze(e,t,o):void 0;return n&&a&&Be(a)===s&&r.push(mn(n,a)),o&&l&&Be(l)===s&&r.push(mn(o,l)),r.length>0?jo(r):void 0}A(Uo,"straightClearanceRange");f(Uo,"straightClearanceRange");function yn(t,e,n,o,s){const r=Uo(t,e,n,o,s);if(!r)return;const a=s?t.y:t.x,l=Math.min(r.hi,Math.max(r.lo,a));if(!(Math.abs(l-a)<ot))return s?[{x:t.x,y:l},{x:e.x,y:l}]:[{x:l,y:t.y},{x:l,y:e.y}]}A(yn,"clearStraightEndpointCornerAxis");f(yn,"clearStraightEndpointCornerAxis");function qn(t,e,n){if(t.length!==2)return t;const[o,s]=t;return ut(o,s,ot)?yn(o,s,e,n,!0)??t:dt(o,s,ot)?yn(o,s,e,n,!1)??t:t}A(qn,"clearStraightEndpointCornerConnections");f(qn,"clearStraightEndpointCornerConnections");function Wo(t,e,n){return Be(n)?{x:t.x,y:pn(t.y,e.top,e.bottom)}:{x:pn(t.x,e.left,e.right),y:t.y}}A(Wo,"cornerClearedEndpoint");f(Wo,"cornerClearedEndpoint");function Ko(t,e,n,o,s,r){const a=t.map(l=>({...l}));for(let l=e;l>=0&&l<t.length;l+=n){const d=t[l];if(r&&!ut(d,o,ot)||!r&&!dt(d,o,ot))break;r?a[l].y=s.y:a[l].x=s.x}return a}A(Ko,"moveCollinearEndpointRun");f(Ko,"moveCollinearEndpointRun");function xn(t,e,n){if(t.length<2)return t;const o=n?0:t.length-1,s=n?1:-1,r=t[o],a=Ye(t,o,s);if(!a)return t;const l=ze(r,a,e);if(!l)return t;const d=Be(l),i=Wo(r,e,l);return ee(r,i,ot)?t:Ko(t,o,s,r,i,d)}A(xn,"clearEndpointCornerConnection");f(xn,"clearEndpointCornerConnection");function bn(t,e,n){const o=Math.min(t.x,e.x)>=n.left-ot&&Math.max(t.x,e.x)<=n.right+ot,s=Math.min(t.y,e.y)>=n.top-ot&&Math.max(t.y,e.y)<=n.bottom+ot;if(Math.abs(t.y-n.top)<ot&&Math.abs(e.y-n.top)<ot&&o)return"top";if(Math.abs(t.y-n.bottom)<ot&&Math.abs(e.y-n.bottom)<ot&&o)return"bottom";if(Math.abs(t.x-n.left)<ot&&Math.abs(e.x-n.left)<ot&&s)return"left";if(Math.abs(t.x-n.right)<ot&&Math.abs(e.x-n.right)<ot&&s)return"right"}A(bn,"borderSideForSegment");f(bn,"borderSideForSegment");function Mn(t,e,n,o){switch(t){case"top":return dt(e,n,ot)&&n.y<o.top-ot;case"bottom":return dt(e,n,ot)&&n.y>o.bottom+ot;case"left":return ut(e,n,ot)&&n.x<o.left-ot;case"right":return ut(e,n,ot)&&n.x>o.right+ot}}A(Mn,"leavesOutward");f(Mn,"leavesOutward");function In(t,e,n){if(t.length<3)return t;if(n){const r=bn(t[0],t[1],e);return r&&Mn(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=bn(t[o-1],t[o],e);return s&&Mn(s,t[o-1],t[o-2],e)?t.slice(0,o):t}A(In,"collapseOwnBorderStub");f(In,"collapseOwnBorderStub");function Jo(t,e,n){let o=t;if(e){const r=Ye(o,0,1);if(r){const a=gn(r,o[0],e);a!==o[0]&&(o=[a,...o.slice(1)])}o=In(o,e,!0)}if(n){const r=o.length-1,a=Ye(o,r,-1);if(a){const l=gn(a,o[r],n,!0);l!==o[r]&&(o=[...o.slice(0,r),l])}o=In(o,n,!1)}const s=qn(o,e,n);return s!==o||o.length===2?s:(e&&(o=xn(o,e,!0)),n&&(o=xn(o,n,!1)),o)}A(Jo,"snapAndCollapseEndpoints");f(Jo,"snapAndCollapseEndpoints");function Sn(t,e){for(const n of t){const o=Jn(n,e,2);if(!o)continue;const s=mt(o.points,ot),r=Jo(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const a=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=a}}A(Sn,"prepareEdgeEndpointsForRenderer");f(Sn,"prepareEdgeEndpointsForRenderer");function Zn(t){return new Map(t.map(e=>[e.id,e]))}A(Zn,"buildNodeMap");f(Zn,"buildNodeMap");function qo(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!s?.isGroup)break;o=s.id,n=s.parentId}return o}A(qo,"resolveTopLevelGroupId");f(qo,"resolveTopLevelGroupId");function Cn(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!s?.isGroup)break;n++,o=s.parentId}return n}A(Cn,"groupDepth");f(Cn,"groupDepth");function Qn(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const a=r.x,l=r.y;if(typeof a!="number"||typeof l!="number")continue;const d=r.width??0,i=r.height??0;e=Math.min(e,a-d/2),n=Math.max(n,a+d/2),o=Math.min(o,l-i/2),s=Math.max(s,l+i/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}A(Qn,"boundsForChildren");f(Qn,"boundsForChildren");function Zo(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}A(Zo,"applyGroupBounds");f(Zo,"applyGroupBounds");function Qo(t){const e=Zn(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>Cn(s,e)-Cn(o,e));for(const o of n){const s=t.filter(a=>a.parentId===o.id),r=Qn(s);r&&Zo(o,r)}}A(Qo,"recomputeNestedGroupBounds");f(Qo,"recomputeNestedGroupBounds");function $e(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(d=>!d.isGroup);let r=1/0,a=-1/0;for(const d of s){const i=d[e];typeof i=="number"&&(r=Math.min(r,i),a=Math.max(a,i))}if(!Number.isFinite(r)||!Number.isFinite(a))return!1;const l=f(d=>r+a-d,"mirror");for(const d of n){const i=d[e];typeof i=="number"&&(d[e]=l(i));const g=d.groupTitleRect;g&&(d.groupTitleRect=e==="x"?{...g,left:l(g.right),right:l(g.left)}:{...g,top:l(g.bottom),bottom:l(g.top)})}for(const d of o)for(const i of d.points??[])i[e]=l(i[e]);return!0}A($e,"mirrorAxis");f($e,"mirrorAxis");function ts(t){return(t.nodes??[]).some(n=>!n.isGroup)?$e(t,"y"):!0}A(ts,"applyBtDirectionTransform");f(ts,"applyBtDirectionTransform");function es(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,a=1/0;for(const P of s){const z=P.x??0,U=P.y??0;z<r&&(r=z),U<a&&(a=U)}if(!Number.isFinite(r)||!Number.isFinite(a))return!1;const l=36;let d=0,i=0;for(const P of s)d+=P.width??0,i+=P.height??0;const g=d/s.length,x=i/s.length,C=x>0?Math.max(1,g/x):1;for(const P of s){const z=P.x??0,Z=((P.y??0)-a)*C+l,ht=z-r;P.x=Z,P.y=ht}for(const P of o)if(P.points)for(const z of P.points){const U=z.x,ht=(z.y-a)*C+l,yt=U-r;z.x=ht,z.y=yt}Qo(n);const h=n.filter(P=>P.isGroup&&!P.parentId);if(h.length===0)return e==="RL"&&$e(t,"x"),!0;const p=Zn(n),c=new Map;for(const P of n){if(P.isGroup)continue;const z=qo(P,p);if(!z)continue;const U=c.get(z)??[];U.push(P),c.set(z,U)}let y=0;for(const P of h){const z=P.padding??0;z>y&&(y=z)}const v=[];let M=1/0,T=-1/0;for(const P of h){const z=c.get(P.id)??[],U=Qn(z);U&&(M=Math.min(M,U.minX),T=Math.max(T,U.maxX),v.push({lane:P,contentTop:U.minY,contentBottom:U.maxY,centerY:(U.minY+U.maxY)/2}))}if(M===1/0||T===-1/0)return!0;const E=Math.max(0,T-M),m=Math.max(y,10),I=E+2*m,R=l+I,B=(M+T)/2-I/2-l,_=B+R/2,X=Math.max(y,l);v.sort((P,z)=>P.centerY-z.centerY);for(let P=0;P<v.length;P++){const z=v[P];let U,Z;if(P===0?U=z.contentTop-X:U=(v[P-1].contentBottom+z.contentTop)/2,P===v.length-1)Z=z.contentBottom+X;else{const Ft=v[P+1];Z=(z.contentBottom+Ft.contentTop)/2}const ht=Math.max(0,Z-U),yt=(U+Z)/2;z.lane.x=_,z.lane.y=yt,z.lane.width=R,z.lane.height=ht,z.lane.swimlaneContentTop=z.contentTop,z.lane.groupTitleRect={left:B,right:B+l,top:U,bottom:Z}}return e==="RL"&&$e(t,"x"),!0}A(es,"applyLrDirectionTransform");f(es,"applyLrDirectionTransform");var ie=1e-6,Rr=8,sn=Rr,Ar=[0,sn,-sn,2*sn,-2*sn];function ns(t,e){const{nodeInfoById:n,realNodeRects:o}=Ue(e);for(const s of t){if(s.isLayoutOnly)continue;const r=s.points;if(!r||r.length<4)continue;const a=$n(mt(r,ie),ie);if(!a)continue;const{p3:l}=a,d=a.kind==="HVH",i=Wn(s,n,ie);if(!i)continue;const{srcId:g,dstId:x,srcInfo:C,dstInfo:h,collinearX:p,collinearY:c}=i;if(p||c)continue;let y;const v=C.rect;for(const M of Ar){let T,E,m;if(d){const _=h.cy>C.cy?v.bottom:v.top,X=C.cx+M;if(X<=v.left+ie||X>=v.right-ie)continue;T={x:X,y:_},E={x:X,y:l.y},m={x:l.x,y:l.y}}else{const _=h.cx>C.cx?v.right:v.left,X=C.cy+M;if(X<=v.top+ie||X>=v.bottom-ie)continue;T={x:_,y:X},E={x:l.x,y:X},m={x:l.x,y:l.y}}const I=ee(T,E,ie),R=ee(E,m,ie);if(I&&R||!I&&At(T,E,o,[g],1)||!R&&At(E,m,o,[x],1))continue;const O=!I&&He(T,E,t,s,{epsilon:ie,skipDegenerateOther:!0}),F=!R&&He(E,m,t,s,{epsilon:ie,skipDegenerateOther:!0});if(!(O||F)){I?y=[E,m]:R?y=[T,E]:y=[T,E,m];break}}y&&(s.points=y)}}A(ns,"portSwapToLShape");f(ns,"portSwapToLShape");function os(t,e){const{realNodeRects:r,labelNodeRects:a}=ue(e.values());for(const l of t){if(l.isLayoutOnly)continue;const d=l.points;if(!d||d.length<4)continue;const i=mt(d,.001);if(i.length<4)continue;const g=i.length-1,x=i[g],C=i[g-1],h=i[g-2],p=x.x-C.x,c=x.y-C.y,y=Math.hypot(p,c);if(y>=10||y<.001)continue;const v=C.x-h.x,M=C.y-h.y;if(Math.hypot(v,M)<.001)continue;const E=Tt(C,x,.001),m=Et(C,x,.001),I=Tt(h,C,.001),R=Et(h,C,.001);if(!(E&&R||m&&I))continue;const O=l.end,F=l.start,B=O?e.get(O):void 0;if(!B)continue;const _=B.x??0,X=B.y??0,P=jt(B);if(!P)continue;let z,U;if(R){const K=M<0;z={x:_,y:h.y},U={x:_,y:K?P.bottom:P.top}}else{const K=v>0;z={x:h.x,y:X},U={x:K?P.right:P.left,y:X}}if(At(z,U,r,O?[O]:[],-2)||At(z,U,a,[],-2))continue;if(F){const K=e.get(F),nt=K?jt(K):void 0;if(nt&&Vn(z,nt,2))continue}const Z=f((K,nt)=>`${K.x.toFixed(3)},${K.y.toFixed(3)}|${nt.x.toFixed(3)},${nt.y.toFixed(3)}`,"ownSegmentKey"),ht=new Set;for(let K=0;K<i.length-1;K++)ht.add(Z(i[K],i[K+1]));const yt=f((K,nt)=>{for(const lt of t){if(lt===l||lt.isLayoutOnly)continue;const pt=lt.points;if(!(!pt||pt.length<2))for(let bt=0;bt<pt.length-1;bt++){const Lt=pt[bt],Ut=pt[bt+1];if(!ht.has(Z(Lt,Ut))&&de(K,nt,Lt,Ut,.001))return!0}}return!1},"segmentCrossesOtherEdge");if(yt(z,U))continue;if(g-3>=0){const K=i[g-3],nt=[F,O].filter(lt=>!!lt);if(At(K,z,r,nt,-2)||yt(K,z))continue}const Pt=[...i.slice(0,g-2),z,U];l.points=Pt;const tt=l.labelNodeId;if(tt){const K=e.get(tt);if(K){const nt=K.width??0,lt=K.height??0;if(nt>0&<>0){let pt,bt,Lt=-1;for(let Ut=0;Ut<Pt.length-1;Ut++){const Wt=Pt[Ut],Kt=Pt[Ut+1],ne=Math.hypot(Kt.x-Wt.x,Kt.y-Wt.y),Ee=ut(Wt,Kt,.001),ge=dt(Wt,Kt,.001);(Ee&&ne>=nt+2||ge&&ne>=lt+2)&&ne>Lt&&(Lt=ne,pt=(Wt.x+Kt.x)/2,bt=(Wt.y+Kt.y)/2)}pt!==void 0&&bt!==void 0&&(K.x=pt,K.y=bt)}}}}}A(os,"collapseShortTerminalStub");f(os,"collapseShortTerminalStub");var Q=.001,_t=8,ct=Le,bo=f((t,e)=>dt(t,e,Q)||ut(t,e,Q),"orthogonallyAligned");function ss(t,e){const s=f((h,p)=>{const c=h.x??0,y=h.y??0,v=p.x-c,M=p.y-y;let T=(h.width??0)/2,E=(h.height??0)/2;return Math.abs(M)*T>Math.abs(v)*E?(M<0&&(E=-E),{x:c+(M===0?0:E*v/M),y:y+E}):(v<0&&(T=-T),{x:c+T,y:y+(v===0?0:T*M/v)})},"rectIntersect"),r=f((h,p)=>{const c=mt(h.points??[]);if(c.length<2)return;const y=p?h.start:h.end,v=y?e.get(y):void 0,M=v?jt(v):void 0;if(!v||!y||!M)return;const T=p?c[0]:c[c.length-1],E=p?c[1]:c[c.length-2],m=s(v,T);let I=T;if(bo(E,m)&&(I=E),dt(m,I,Q))return{edge:h,edgeId:String(h.id??""),nodeId:y,atStart:p,orientation:"V",coord:m.x,min:Math.min(m.y,I.y),max:Math.max(m.y,I.y),boundary:m,railEnd:I,rect:M};if(ut(m,I,Q))return{edge:h,edgeId:String(h.id??""),nodeId:y,atStart:p,orientation:"H",coord:m.y,min:Math.min(m.x,I.x),max:Math.max(m.x,I.x),boundary:m,railEnd:I,rect:M}},"terminalLaneFor"),a=f((h,p)=>Math.max(0,Math.min(h.max,p.max)-Math.max(h.min,p.min)),"projectedOverlapLength"),l=f((h,p)=>h.nodeId!==p.nodeId||h.orientation!==p.orientation?!1:h.orientation==="H"?(Math.abs(h.boundary.x-h.rect.left)<1||Math.abs(h.boundary.x-h.rect.right)<1)&&dt(h.boundary,p.boundary,1):(Math.abs(h.boundary.y-h.rect.top)<1||Math.abs(h.boundary.y-h.rect.bottom)<1)&&ut(h.boundary,p.boundary,1),"sameTerminalFace"),d=f((h,p)=>h.nodeId!==p.nodeId||h.orientation!==p.orientation?!1:a(h,p)>=_t&&Math.abs(h.coord-p.coord)<.5,"exactTerminalLaneConflict"),i=f((h,p)=>{if(h.nodeId!==p.nodeId||h.orientation!==p.orientation||h.orientation!=="H"||h.atStart===p.atStart)return!1;const c=a(h,p);if(c<_t)return!1;const y=h.rect.bottom-h.rect.top;return c<y||c>2*y?!1:l(h,p)&&Math.abs(h.coord-p.coord)<16},"nearTerminalLaneConflict"),g=f((h,p)=>{const c=mt(h.edge.points??[]);if(c.length<2)return;const y=h.orientation==="V"?{x:h.boundary.x+p,y:h.boundary.y}:{x:h.boundary.x,y:h.boundary.y+p},v=h.orientation==="V"?{x:h.railEnd.x+p,y:h.railEnd.y}:{x:h.railEnd.x,y:h.railEnd.y+p};if(!f(()=>Math.abs(h.boundary.y-h.rect.top)<1||Math.abs(h.boundary.y-h.rect.bottom)<1?ut(y,h.boundary,Q)&&y.x>=h.rect.left+1&&y.x<=h.rect.right-1:Math.abs(h.boundary.x-h.rect.left)<1||Math.abs(h.boundary.x-h.rect.right)<1?dt(y,h.boundary,Q)&&y.y>=h.rect.top+1&&y.y<=h.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(h.atStart){const I=c.length>1&&ee(c[1],h.railEnd,Q),R=c.slice(I?2:1),O=R[0];return O&&!bo(O,v)?void 0:[y,v,...R]}const T=c.length>1&&ee(c[c.length-2],h.railEnd,Q),E=c.slice(0,T?-2:-1),m=E[E.length-1];if(!(m&&!bo(m,v)))return[...E,v,y]},"shiftedCandidate"),x=f(h=>{const p=h.edge,c=mt(p.points??[]);if(c.length!==2)return!1;const y=p.start,v=p.end,M=y?e.get(y):void 0,T=v?e.get(v):void 0;if(!M||!T)return!1;const E=M.x??0,m=M.y??0,I=T.x??0,R=T.y??0,[O,F]=c;return ut(O,F,Q)&&Math.abs(m-R)<1&&Math.abs(E-I)>1||dt(O,F,Q)&&Math.abs(E-I)<1&&Math.abs(m-R)>1},"laneIsStraightCollinearConnector"),C=[-7,7,-14,14,-21,21];for(let h=0;h<8;h++){const p=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[r(y,!0),r(y,!1)]).filter(y=>!!y);let c=!1;for(let y=0;y<p.length&&!c;y++)for(let v=y+1;v<p.length&&!c;v++){const M=p[y],T=p[v];if(M.edge===T.edge||!(d(M,T)||i(M,T)))continue;const E=!d(M,T),m=[M,T].sort((I,R)=>{const O=x(I),F=x(R);return O!==F?Number(O)-Number(F):+!R.atStart-+!I.atStart});for(const I of m){for(const R of C){const O=g(I,R);if(!O)continue;const F=r({...I.edge,points:O},I.atStart);if(!(!F||p.some(B=>B.edge!==I.edge&&(d(F,B)||E&&i(F,B))))){I.edge.points=O,c=!0;break}}if(c)break}}if(!c)return}}A(ss,"separateSharedRenderedTerminalLanes");f(ss,"separateSharedRenderedTerminalLanes");function rs(t,e){const{realNodeRects:o,labelNodeRects:s}=ue(e.values()),r=f((l,d)=>{const i=l.start,g=l.end,x=ct(d);if(x.length!==d.length-1)return!1;const C=[i,g].filter(h=>!!h);for(const h of x)if(At(h.a,h.b,o,C,-2)||At(h.a,h.b,s,[],-2))return!1;for(const h of t){if(h===l||h.isLayoutOnly)continue;const p=h.points;if(!(!p||p.length<2)){for(const c of x)for(const y of ct(mt(p)))if(ce(c,y,.5)>=_t||de(c.a,c.b,y.a,y.b,Q))return!1}}return!0},"candidateIsSafe"),a=f((l,d)=>{if(d+4>=l.length)return;const i=l[d],g=l[d+1],x=l[d+2],C=l[d+3],h=l[d+4],p=Tt(i,g)&&Et(g,x)&&Tt(x,C)&&Et(C,h)&&dt(i,C,Q)&&dt(i,h,Q)&&dt(g,x,Q)&&(g.x-i.x)*(C.x-x.x)<0,c=Et(i,g)&&Tt(g,x)&&Et(x,C)&&Tt(C,h)&&ut(i,C,Q)&&ut(i,h,Q)&&ut(g,x,Q)&&(g.y-i.y)*(C.y-x.y)<0;if(p||c)return mt([...l.slice(0,d+1),h,...l.slice(d+5)]);if(d+5>=l.length)return;const y=l[d+5],v=Et(i,g)&&Tt(g,x)&&Et(x,C)&&Tt(C,h)&&Et(h,y)&&dt(i,h,Q)&&dt(i,y,Q)&&dt(x,C,Q)&&(x.x-g.x)*(h.x-C.x)<0,M=Tt(i,g)&&Et(g,x)&&Tt(x,C)&&Et(C,h)&&Tt(h,y)&&ut(i,h,Q)&&ut(i,y,Q)&&ut(x,C,Q)&&(x.y-g.y)*(h.y-C.y)<0;if(!(!v&&!M))return mt([...l.slice(0,d+1),y,...l.slice(d+6)])},"withoutDogleg");for(let l=0;l<8;l++){let d=!1;for(const i of t){if(i.isLayoutOnly)continue;const g=mt(i.points??[]);for(let x=0;x<=g.length-5;x++){const C=a(g,x);if(!(!C||!r(i,C))){i.points=C,d=!0;break}}if(d)break}if(!d)return}}A(rs,"collapseRedundantRectangularDoglegs");f(rs,"collapseRedundantRectangularDoglegs");function vn(t,e){const{realNodeRects:r,labelNodeRects:a}=ue(e.values()),l=t.filter(p=>!p.isLayoutOnly),d=f((p,c,y)=>mt(p===c?y??[]:p.points??[]),"pointsFor"),i=f((p,c)=>{let y=0;for(let v=0;v<l.length;v++){const M=ct(d(l[v],p,c));for(let T=v+1;T<l.length;T++){const E=ct(d(l[T],p,c));for(const m of M)for(const I of E)de(m.a,m.b,I.a,I.b,Q)&&y++}}return y},"strictCrossingCount"),g=f(p=>{const c=ct(p);if(c.length!==3)return;const y=c[1];if(!(c[0].horizontal===y.horizontal||c[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),x=f((p,c)=>{const y=[p.start,p.end].filter(v=>!!v);return r.filter(v=>{if(y.includes(v.id))return!1;const M=v.rect;return c.horizontal?zt(c.a.x,c.b.x,M.left,M.right)>=_t&&c.a.y>=M.top-2&&c.a.y<=M.bottom+2:zt(c.a.y,c.b.y,M.top,M.bottom)>=_t&&c.a.x>=M.left-2&&c.a.x<=M.right+2})},"blockingRectsFor"),C=f((p,c,y)=>{const v=p.map(T=>({...T}));if(c.horizontal)v[c.index].y=y,v[c.index+1].y=y;else if(c.vertical)v[c.index].x=y,v[c.index+1].x=y;else return;const M=ae(mt(v));return ct(M).length===M.length-1?M:void 0},"candidateByMovingRail"),h=f((p,c,y)=>{const v=[p.start,p.end].filter(T=>!!T),M=ct(c);if(M.length!==c.length-1)return!1;for(const T of M)if(At(T.a,T.b,r,v,-2)||At(T.a,T.b,a,[],-2))return!1;for(const T of l)if(T!==p){for(const E of M)for(const m of ct(d(T)))if(ce(E,m,.5)>=_t)return!1}return i(p,c)<=y},"candidateIsSafe");for(let p=0;p<8;p++){const c=i();let y=!1;for(const v of l){const M=d(v),T=g(M);if(!T)continue;const E=x(v,T.segment);if(E.length===0)continue;const m=T.horizontal?[Math.min(...E.map(I=>I.rect.top))-20,Math.max(...E.map(I=>I.rect.bottom))+20]:[Math.min(...E.map(I=>I.rect.left))-20,Math.max(...E.map(I=>I.rect.right))+20];for(const I of m){const R=C(M,T.segment,I);if(!(!R||!h(v,R,c))){v.points=R,y=!0;break}}if(y)break}if(!y)return}}A(vn,"liftObstacleHuggingSameSideRails");f(vn,"liftObstacleHuggingSameSideRails");function Ln(t,e){const o=f(d=>{const i=d.groupTitleRect;if(!(!i||typeof i.left!="number"||typeof i.right!="number"||typeof i.top!="number"||typeof i.bottom!="number"||!Number.isFinite(i.left)||!Number.isFinite(i.right)||!Number.isFinite(i.top)||!Number.isFinite(i.bottom)||i.right<=i.left||i.bottom<=i.top))return{left:i.left,right:i.right,top:i.top,bottom:i.bottom}},"validTitleRect"),s=f(d=>{if(!d.isGroup||d.parentId)return;const i=d.direction,g=typeof i=="string"?i.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const x=o(d),C=d.y,h=d.height;if(!x||typeof C!="number"||typeof h!="number"||!Number.isFinite(C)||!Number.isFinite(h)||h<=0)return;const p=x.right-x.left,c=x.bottom-x.top;if(!(c<=0||p<c))return{node:d,rect:x}},"topLaneTitleFor"),r=f((d,i)=>{if(!d.horizontal)return!1;const g=d.a.y;return g<=i.top+Q||g>=i.bottom-Q?!1:zt(d.a.x,d.b.x,i.left,i.right)>=_t},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(s).filter(d=>!!d);if(a.length===0)return;let l=0;for(const d of t){if(d.isLayoutOnly)continue;const i=mt(d.points??[]);for(const g of ct(i))for(const x of a)r(g,x.rect)&&(l=Math.max(l,x.rect.bottom-g.a.y+4))}if(!(l<=Q))for(const d of a){const i=d.node.y,g=d.node.height;typeof i!="number"||typeof g!="number"||!Number.isFinite(i)||!Number.isFinite(g)||g<=0||(d.node.y=i-l/2,d.node.height=g+l,d.node.groupTitleRect={...d.rect,top:d.rect.top-l,bottom:d.rect.bottom-l})}}A(Ln,"liftTopLaneTitleBandsAboveRails");f(Ln,"liftTopLaneTitleBandsAboveRails");function Tn(t,e){const o=f(i=>{const g=i.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=f(i=>{if(!i.isGroup||i.parentId||i.direction!=="LR")return;const x=o(i),C=i.x,h=i.width;if(!x||typeof C!="number"||typeof h!="number"||!Number.isFinite(C)||!Number.isFinite(h)||h<=0)return;const p=x.right-x.left,c=x.bottom-x.top;if(!(p<=0||c<p))return{node:i,rect:x}},"leftLaneTitleFor"),r=f((i,g)=>{if(!i.vertical)return!1;const x=i.a.x;return x<=g.left+Q||x>=g.right-Q?!1:zt(i.a.y,i.b.y,g.top,g.bottom)>=_t},"verticalSegmentIntersectsTitle"),a=f((i,g)=>{if(!i.horizontal)return!1;const x=i.a.y;return x<=g.top+Q||x>=g.bottom-Q?!1:zt(i.a.x,i.b.x,g.left,g.right)>=_t},"horizontalSegmentIntersectsTitle"),l=[...e.values()].map(s).filter(i=>!!i);if(l.length===0)return;let d=0;for(const i of t){if(i.isLayoutOnly)continue;const g=mt(i.points??[]);for(const x of ct(g))for(const C of l)if(r(x,C.rect))d=Math.max(d,C.rect.right-x.a.x+4);else if(a(x,C.rect)){const h=Math.min(x.a.x,x.b.x);d=Math.max(d,C.rect.right-h+4)}}if(!(d<=Q))for(const i of l){const g=i.node.x,x=i.node.width;typeof g!="number"||typeof x!="number"||!Number.isFinite(g)||!Number.isFinite(x)||x<=0||(i.node.x=g-d/2,i.node.width=x+d,i.node.groupTitleRect={...i.rect,left:i.rect.left-d,right:i.rect.right-d})}}A(Tn,"shiftLeftLaneTitleBandsLeftOfRails");f(Tn,"shiftLeftLaneTitleBandsLeftOfRails");function is(t,e){const{realNodeRects:o}=ue(e.values()),s=t.filter(p=>!p.isLayoutOnly),r=f((p,c=new Map)=>mt(c.get(p)??p.points??[]),"replacementPointsFor"),a=f((p=new Map)=>{let c=0;for(let y=0;y<s.length;y++){const v=ct(r(s[y],p));for(let M=y+1;M<s.length;M++){const T=ct(r(s[M],p));for(const E of v)for(const m of T)de(E.a,E.b,m.a,m.b,Q)&&c++}}return c},"crossingCount"),l=f((p=new Map)=>s.reduce((c,y)=>c+Zt(r(y,p)),0),"totalBends"),d=f(p=>{const c=r(p);if(c.length<4)return;const y=c[c.length-2],v=c[c.length-1];if(!(!Tt(y,v,Q)&&!Et(y,v,Q)))return{tailStart:y,terminal:v}},"terminalTailFor"),i=f((p,c)=>{const y=r(p);if(y.length<3)return;const v=y[0],M=y[1];let T;if(Tt(v,M,Q))T={x:M.x,y:c.tailStart.y};else if(Et(v,M,Q))T={x:c.tailStart.x,y:M.y};else return;const E=ae(mt([v,M,T,c.tailStart,c.terminal]));return ct(E).length===E.length-1?E:void 0},"candidateWithDestinationTail"),g=f((p,c)=>{const y=[p.start,p.end].filter(v=>!!v);for(const v of ct(c))if(At(v.a,v.b,o,y,-2))return!0;return!1},"pathHasNodeHit"),x=f((p,c,y)=>{for(const v of s)if(v!==p){for(const M of ct(c))for(const T of ct(r(v,y)))if(ce(M,T,.5)>=_t)return!0}return!1},"pathHasSharedTrack"),C=f((p,c,y)=>!g(p,c)&&!x(p,c,y),"candidateIsSafe"),h=f(()=>{const p=new Map;for(const c of s){const y=c.end;if(!y||!e.has(y)||r(c).length<4)continue;const M=p.get(y)??[];M.push(c),p.set(y,M)}return p},"edgesByDestination");for(let p=0;p<4;p++){const c=a();if(c===0)return;const y=l();let v,M=c,T=y;for(const E of h().values())for(let m=0;m<E.length;m++)for(let I=m+1;I<E.length;I++){const R=E[m],O=E[I],F=d(R),B=d(O);if(!F||!B)continue;const _=i(R,B),X=i(O,F);if(!_||!X)continue;const P=new Map([[R,_],[O,X]]);if(!C(R,_,P)||!C(O,X,P))continue;const z=a(P),U=l(P);z>=c||z>M||z===M&&U>=T||(v=P,M=z,T=U)}if(!v)return;for(const[E,m]of v)E.points=m}}A(is,"swapDestinationTerminalTailsToReduceCrossings");f(is,"swapDestinationTerminalTailsToReduceCrossings");function cs(t,e){const{realNodeRects:r,labelNodeRects:a}=ue(e.values()),l=t.filter(E=>!E.isLayoutOnly),d=f((E,m=new Map)=>mt(m.get(E)??E.points??[]),"replacementPointsFor"),i=f((E=new Map)=>{let m=0;for(let I=0;I<l.length;I++){const R=ct(d(l[I],E));for(let O=I+1;O<l.length;O++){const F=ct(d(l[O],E));for(const B of R)for(const _ of F)de(B.a,B.b,_.a,_.b,Q)&&m++}}return m},"strictCrossingCount"),g=f((E=new Map)=>l.reduce((m,I)=>m+Zt(d(I,E)),0),"totalBends"),x=f(E=>{const m=E.start,I=E.end,R=m?e.get(m):void 0,O=I?e.get(I):void 0,F=R?jt(R):void 0,B=O?jt(O):void 0;return F&&B?{src:F,dst:B}:void 0},"endpointRectsFor"),C=f((E,m,I)=>{if(I.index<=0||I.index+1>=m.length-1)return;const R=x(E);if(R){if(I.vertical){const O=I.a.x,F=Math.min(R.src.left,R.dst.left),B=Math.max(R.src.right,R.dst.right),_=O<F-Q?"left":O>B+Q?"right":void 0;return _?{edge:E,points:m,segmentIndex:I.index,axis:"vertical",side:_,coord:O,min:Math.min(I.a.y,I.b.y),max:Math.max(I.a.y,I.b.y)}:void 0}if(I.horizontal){const O=I.a.y,F=Math.min(R.src.top,R.dst.top),B=Math.max(R.src.bottom,R.dst.bottom),_=O<F-Q?"top":O>B+Q?"bottom":void 0;return _?{edge:E,points:m,segmentIndex:I.index,axis:"horizontal",side:_,coord:O,min:Math.min(I.a.x,I.b.x),max:Math.max(I.a.x,I.b.x)}:void 0}}},"externalRailForSegment"),h=f(()=>{const E=[];for(const m of l){const I=d(m);for(const R of ct(I)){const O=C(m,I,R);O&&E.push(O)}}return E},"collectExternalRails"),p=f((E,m)=>E.edge!==m.edge&&E.axis===m.axis&&E.side===m.side&&zt(E.min,E.max,m.min,m.max)>=_t,"railsInteract"),c=f(E=>{const m=[],I=new Set;for(const R of E){if(I.has(R))continue;const O=[R],F=[];for(I.add(R);O.length>0;){const B=O.pop();F.push(B);for(const _ of E)!I.has(_)&&p(B,_)&&(I.add(_),O.push(_))}F.length>1&&m.push(F)}return m},"connectedComponents"),y=f(E=>{const m=[];for(const I of E)m.some(R=>Math.abs(R-I.coord)<Q)||m.push(I.coord);for(;m.length<E.length;){const I=Math.min(...m),R=Math.max(...m),O=E[0].side;m.push(O==="left"||O==="top"?I-12*(E.length-m.length):R+12*(E.length-m.length))}return m},"uniqueCoordsFor"),v=f(E=>{const m=E.map(O=>O.coord),I=y(E),R=[];if(E.length<=6){const O=new Array(I.length).fill(!1),F=[],B=f(()=>{if(F.length===E.length){F.some((_,X)=>Math.abs(_-m[X])>=Q)&&R.push([...F]);return}for(const[_,X]of I.entries())O[_]||(O[_]=!0,F.push(X),B(),F.pop(),O[_]=!1)},"visit");return B(),R}for(let O=0;O<m.length;O++)for(let F=O+1;F<m.length;F++){const B=[...m];[B[O],B[F]]=[B[F],B[O]],R.push(B)}return R},"coordinateAssignmentsFor"),M=f((E,m)=>{const I=new Map;for(const[O,F]of E.entries()){const B=m[O],_=I.get(F.edge)??F.points.map(X=>({x:X.x,y:X.y}));F.axis==="vertical"?(_[F.segmentIndex].x=B,_[F.segmentIndex+1].x=B):(_[F.segmentIndex].y=B,_[F.segmentIndex+1].y=B),I.set(F.edge,_)}const R=new Map;for(const[O,F]of I){const B=ae(mt(F));if(ct(B).length!==B.length-1)return;R.set(O,B)}return R},"replacementsForAssignment"),T=f(E=>{for(const[m,I]of E){const R=[m.start,m.end].filter(O=>!!O);for(const O of ct(I))if(At(O.a,O.b,r,R,-2)||At(O.a,O.b,a,[],-2))return!1}for(let m=0;m<l.length;m++){const I=l[m],R=E.has(I),O=ct(d(I,E));for(let F=m+1;F<l.length;F++){const B=l[F];if(!R&&!E.has(B))continue;const _=ct(d(B,E));for(const X of O)for(const P of _)if(ce(X,P,.5)>=_t)return!1}}return!0},"candidateIsSafe");for(let E=0;E<4;E++){const m=i();if(m===0)return;let I,R=m,O=g(),F=Number.POSITIVE_INFINITY;for(const B of c(h()))for(const _ of v(B)){const X=M(B,_);if(!X||!T(X))continue;const P=i(X);if(P>=m)continue;const z=g(X),U=B.reduce((Z,ht,yt)=>Z+Math.abs(_[yt]-ht.coord),0);P>R||P===R&&(z>O||z===O&&U>=F)||(I=X,R=P,O=z,F=U)}if(!I)return;for(const[B,_]of I)B.points=_}}A(cs,"reassignCrossingExternalRailChannels");f(cs,"reassignCrossingExternalRailChannels");function as(t,e){const{realNodeRects:o,labelNodeRects:s}=ue(e.values()),r=t.filter(h=>!h.isLayoutOnly),a=f((h,p,c)=>mt(h===p?c??[]:h.points??[]),"pointsFor"),l=f(h=>ct(h).reduce((p,c)=>{const y=c.a.x-c.b.x,v=c.a.y-c.b.y;return p+Math.hypot(y,v)},0),"pathLength"),d=f((h,p)=>{let c=0;for(let y=0;y<r.length;y++){const v=ct(a(r[y],h,p));for(let M=y+1;M<r.length;M++){const T=ct(a(r[M],h,p));for(const E of v)for(const m of T)de(E.a,E.b,m.a,m.b,Q)&&c++}}return c},"strictCrossingCount"),i=f((h,p)=>{if(h.horizontal){const c=h.a.y;return(Math.abs(c-p.top)<1||Math.abs(c-p.bottom)<1)&&zt(h.a.x,h.b.x,p.left,p.right)>=_t}if(h.vertical){const c=h.a.x;return(Math.abs(c-p.left)<1||Math.abs(c-p.right)<1)&&zt(h.a.y,h.b.y,p.top,p.bottom)>=_t}return!1},"segmentRunsAlongRectBorder"),g=f(h=>{const p=[h.start,h.end].filter(y=>!!y),c=[];for(const y of p){const v=e.get(y),M=v?jt(v):void 0;M&&c.push(M)}return c},"endpointRectsFor"),x=f((h,p)=>{if(p+3>=h.length)return[];const c=h[p],y=h[p+1],v=h[p+2],M=h[p+3],T=Tt(c,y,Q)&&Et(y,v,Q)&&Tt(v,M,Q),E=Et(c,y,Q)&&Tt(y,v,Q)&&Et(v,M,Q);if(!T&&!E)return[];if(!(T?Math.sign(y.x-c.x)!==Math.sign(M.x-v.x):Math.sign(y.y-c.y)!==Math.sign(M.y-v.y)))return[];const I=dt(c,M,Q)||ut(c,M,Q)?[]:[{x:c.x,y:M.y},{x:M.x,y:c.y}],R=I.length===0?[[...h.slice(0,p+1),...h.slice(p+3)]]:I.map(F=>[...h.slice(0,p+1),F,...h.slice(p+3)]),O=new Set;return R.map(F=>ae(mt(F))).filter(F=>{if(ct(F).length!==F.length-1||!F.some(_=>ee(_,M,Q)))return!1;const B=F.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return O.has(B)?!1:(O.add(B),!0)})},"shortcutCandidatesAt"),C=f((h,p,c)=>{const y=[h.start,h.end].filter(M=>!!M),v=g(h);for(const M of ct(p))if(At(M.a,M.b,o,y,-2)||At(M.a,M.b,s,[],-2)||v.some(T=>i(M,T)))return!1;for(const M of r)if(M!==h){for(const T of ct(p))for(const E of ct(a(M)))if(ce(T,E,.5)>=_t)return!1}return d(h,p)<=c},"candidateIsSafe");for(let h=0;h<8;h++){const p=d();let c,y,v=p,M=Number.POSITIVE_INFINITY,T=Number.POSITIVE_INFINITY;for(const E of r){const m=a(E),I=Zt(m,Q),R=l(m);for(let O=0;O<=m.length-4;O++)for(const F of x(m,O)){const B=Zt(F,Q),_=l(F);if(!(B<I||B===I&&_<R-Q)||!C(E,F,p))continue;const P=d(E,F);P>v||P===v&&(B>M||B===M&&_>=T)||(c=E,y=F,v=P,M=B,T=_)}}if(!c||!y)return;c.points=y}}A(as,"shortcutRedundantOrthogonalJogs");f(as,"shortcutRedundantOrthogonalJogs");function ls(t,e){const a=[];for(const N of e.values()){if(N.isGroup||N.isEdgeLabel)continue;const D=N.x??0,H=N.y??0,j=jt(N);j&&a.push({id:String(N.id??""),cx:D,cy:H,rect:j})}if(a.length===0)return;const l=new Map(a.map(N=>[N.id,N])),d=a.map(N=>({id:N.id,rect:N.rect})),i=["top","bottom","left","right"],g={top:Math.min(...a.map(N=>N.rect.top))-20,bottom:Math.max(...a.map(N=>N.rect.bottom))+20,left:Math.min(...a.map(N=>N.rect.left))-20,right:Math.max(...a.map(N=>N.rect.right))+20},x=t.filter(N=>!N.isLayoutOnly),C=new Map(x.map((N,D)=>[N,D])),h=f(N=>{const D=N==="left"||N==="top"?-1:1,H=[];for(let j=0;j<=2;j++)H.push(g[N]+D*20*j);return H},"outwardTracksForSide"),p=f((N,D=new Map)=>mt(D.get(N)??N.points??[]),"replacementPointsFor"),c=f((N,D)=>{let H=0;for(const j of N)for(const u of D)de(j.a,j.b,u.a,u.b,Q)&&H++;return H},"crossingCountBetweenSegments"),y=f((N,D)=>c(ct(N),ct(D)),"crossingCountBetweenPaths"),v=f((N=new Map)=>{let D=0;const H=[],j=new Set,u=[],b=f(S=>{j.has(S)||(j.add(S),u.push(S))},"addEdge");for(let S=0;S<x.length;S++){const L=x[S],w=p(L,N);for(let k=S+1;k<x.length;k++){const W=x[k],q=y(w,p(W,N));q>0&&(D+=q,H.push({first:L,second:W,count:q}),b(L),b(W))}}return u.sort((S,L)=>(C.get(S)??0)-(C.get(L)??0)),{count:D,pairs:H,edgeSet:j,edges:u}},"crossingSnapshot"),M=f((N,D)=>{const H=new Set(D.keys());if(H.size===0)return N.count;let j=0;for(const b of N.pairs)(H.has(b.first)||H.has(b.second))&&(j+=b.count);let u=0;for(let b=0;b<x.length;b++){const S=x[b],L=H.has(S),w=p(S,D);for(let k=b+1;k<x.length;k++){const W=x[k];!L&&!H.has(W)||(u+=y(w,p(W,D)))}}return N.count-j+u},"crossingCountWithReplacements"),T=f(N=>{const D=new Map;for(const u of N.pairs){const b=D.get(u.first)??new Set;b.add(u.second),D.set(u.first,b);const S=D.get(u.second)??new Set;S.add(u.first),D.set(u.second,S)}const H=[],j=new Set;for(const u of N.edges){if(j.has(u))continue;const b=[u],S=[];for(j.add(u);b.length>0;){const L=b.pop();S.push(L);for(const w of D.get(L)??[])j.has(w)||(j.add(w),b.push(w))}S.sort((L,w)=>(C.get(L)??0)-(C.get(w)??0)),S.length>1&&H.push(S)}return H},"crossingComponents"),E=f(N=>[N.start,N.end].filter(D=>!!D),"endpointIdsFor"),m=f(N=>{const D=[];for(const H of T(N)){const j=new Set(H),u=new Set(H.flatMap(S=>E(S))),b=[...H];for(const S of x)j.has(S)||E(S).some(L=>u.has(L))&&b.push(S);b.sort((S,L)=>(C.get(S)??0)-(C.get(L)??0)),D.push(b)}return D},"pairSearchGroups"),I=f((N,D,H)=>M(N,new Map([[D,H]])),"crossingCountWithSingleReplacement"),R=f(N=>{const D=new Map;for(const H of N.pairs)D.set(H.first,(D.get(H.first)??0)+H.count),D.set(H.second,(D.get(H.second)??0)+H.count);return D},"currentCrossingsByEdge"),O=f(N=>N.slice(1).reduce((D,H,j)=>{const u=N[j];return D+Math.abs(H.x-u.x)+Math.abs(H.y-u.y)},0),"pathLength"),F=f((N=new Map)=>x.reduce((D,H)=>D+Zt(p(H,N)),0),"totalBends"),B=f((N=new Map)=>x.reduce((D,H)=>D+O(p(H,N)),0),"totalLength"),_=f((N,D,H=new Map)=>{const j=ct(D);for(const u of x)if(u!==N){for(const b of j)for(const S of ct(p(u,H)))if(ce(b,S,.5)>=_t)return!0}return!1},"pathHasSegmentConflict"),X=f((N,D)=>{const H=[N.start,N.end].filter(j=>!!j);for(const j of ct(D))if(At(j.a,j.b,d,H,-2))return!0;return!1},"pathHitsNode"),P=f((N,D)=>{const H=ae(mt(D));ct(H).length===H.length-1&&N.push(H)},"pushOrthogonalCandidate"),z=f(N=>N==="left"||N==="right","sideIsHorizontal"),U=f((N,D,H)=>{switch(D){case"left":return Math.min(N.x,H.x)-20;case"right":return Math.max(N.x,H.x)+20;case"top":return Math.min(N.y,H.y)-20;case"bottom":return Math.max(N.y,H.y)+20}},"localTrackForSameSide"),Z=f((N,D,H,j)=>{const u=H==="left"||H==="top"?-1:1,b=[U(D,H,j),g[H]];for(const S of b)for(let L=0;L<=2;L++)P(N,Un(D,H,j,S+u*20*L))},"addSameSideCandidates"),ht=f((N,D,H,j,u)=>{for(const b of h(H))for(const S of h(u))P(N,[D,{x:b,y:D.y},{x:b,y:S},{x:j.x,y:S},j])},"addHorizontalToVerticalCandidates"),yt=f((N,D,H,j,u)=>{for(const b of h(H))for(const S of h(u))P(N,[D,{x:D.x,y:b},{x:S,y:b},{x:S,y:j.y},j])},"addVerticalToHorizontalCandidates"),Ft=f((N,D,H,j,u)=>{const b=[...h("top"),...h("bottom")];for(const S of h(H))for(const L of h(u))for(const w of b)P(N,[D,{x:S,y:D.y},{x:S,y:w},{x:L,y:w},{x:L,y:j.y},j])},"addHorizontalPairCandidates"),Pt=f((N,D,H,j,u)=>{const b=[...h("left"),...h("right")];for(const S of h(H))for(const L of h(u))for(const w of b)P(N,[D,{x:D.x,y:S},{x:w,y:S},{x:w,y:L},{x:j.x,y:L},j])},"addVerticalPairCandidates"),tt=f(N=>{const D=new Set;return N.map(H=>mt(H)).filter(H=>{const j=H.map(u=>`${u.x.toFixed(3)},${u.y.toFixed(3)}`).join("|");return D.has(j)||H.length<2?!1:(D.add(j),!0)})},"dedupeCandidatePaths"),K=f((N,D,H,j)=>{const u=[],b=jn(N,D,H,j,20,Q);b&&P(u,b),D===j&&Z(u,N,D,H);const S=z(D),L=z(j);return S&&!L?ht(u,N,D,H,j):!S&&L?yt(u,N,D,H,j):S?Ft(u,N,D,H,j):Pt(u,N,D,H,j),tt(u)},"buildCandidatesForSides"),nt=f((N,D,H,j)=>{const u=[...h("left"),...h("right")],b=[...h("top"),...h("bottom")];for(const S of i){const L=Me(j,S),w=S==="top"||S==="bottom"?h(S):b;for(const k of u){P(N,[D,H,{x:k,y:H.y},{x:k,y:L.y},L]);for(const W of w)P(N,[D,H,{x:k,y:H.y},{x:k,y:W},{x:L.x,y:W},L])}}},"addVerticalDepartureOuterTrackCandidates"),lt=f((N,D,H,j)=>{const u=[...h("left"),...h("right")],b=[...h("top"),...h("bottom")];for(const S of i){const L=Me(j,S),w=S==="left"||S==="right"?h(S):u;for(const k of b){P(N,[D,H,{x:H.x,y:k},{x:L.x,y:k},L]);for(const W of w)P(N,[D,H,{x:H.x,y:k},{x:W,y:k},{x:W,y:L.y},L])}}},"addHorizontalDepartureOuterTrackCandidates"),pt=f(N=>{const D=N.start,H=N.end,j=H?l.get(H):void 0;if(!D||!j)return[];const u=mt(N.points??[]);if(u.length<4)return[];const b=u[0],S=u[1],L=[];return Et(b,S,Q)?nt(L,b,S,j):Tt(b,S,Q)&<(L,b,S,j),L},"terminalPreservingOuterTrackCandidates"),bt=f(N=>{const D=N.start,H=N.end,j=D?l.get(D):void 0,u=H?l.get(H):void 0;if(!j||!u)return[];const b=[];for(const S of i){const L=Me(j,S);for(const w of i)b.push(...K(L,S,Me(u,w),w))}return b.push(...pt(N)),b},"candidatePathsFor"),Lt=f(()=>new Map(x.map(N=>[N,ct(p(N))])),"currentSegmentsByEdge"),Ut=f((N,D,H)=>{const j=new Set;for(const u of x){if(u===N)continue;const b=H.get(u)??ct(p(u));D.some(S=>b.some(L=>ce(S,L,.5)>=_t))&&j.add(u)}return j},"sharedTrackConflictsFor"),Wt=f((N,D,H,j)=>{const u=new Set;return bt(N).map(S=>ae(mt(S))).filter(S=>{if(X(N,S))return!1;const L=S.map(w=>`${w.x.toFixed(3)},${w.y.toFixed(3)}`).join("|");return u.has(L)||S.length<2?!1:(u.add(L),!0)}).map(S=>{const L=ct(S);let w=0;for(const k of x)k!==N&&(w+=c(L,H.get(k)??ct(p(k))));return{candidate:S,candidateSegments:L,crossings:D.count-(j.get(N)??0)+w,bends:Zt(S,Q),totalBends:Zt(S),length:O(S)}}).filter(({crossings:S})=>S<=D.count).sort((S,L)=>S.crossings-L.crossings||S.bends-L.bends||S.length-L.length).slice(0,48).map(S=>({path:S.candidate,segments:S.candidateSegments,sharedTrackConflicts:Ut(N,S.candidateSegments,H),totalBends:S.totalBends,length:S.length}))},"pairCandidatesFor"),Kt=f((N,D,H,j,u,b)=>{let S=0;for(const w of N.pairs)(w.first===D||w.second===D||w.first===j||w.second===j)&&(S+=w.count);let L=c(H.segments,u.segments);for(const w of x){if(w===D||w===j)continue;const k=b.get(w)??ct(p(w));L+=c(H.segments,k)+c(u.segments,k)}return N.count-S+L},"pairCrossingCount"),ne=f((N,D)=>{for(const H of N.sharedTrackConflicts)if(H!==D)return!1;return!0},"conflictsOnlyWith"),Ee=f((N,D)=>N.segments.some(H=>D.segments.some(j=>ce(H,j,.5)>=_t)),"candidatesShareTrack"),ge=f((N,D,H,j)=>ne(D,H.edge)&&ne(j,N.edge)&&!Ee(D,j),"pairCandidatesAreCompatible"),we=f((N,D,H,j,u)=>{const b=Kt(N.current,D.edge,H,j.edge,u,N.baseSegments);if(!(b>=N.current.count))return{replacements:new Map([[D.edge,H.path],[j.edge,u.path]]),crossings:b,bends:N.currentBends-(N.baseBendsByEdge.get(D.edge)??0)-(N.baseBendsByEdge.get(j.edge)??0)+H.totalBends+u.totalBends,length:N.currentLength-(N.baseLengthByEdge.get(D.edge)??0)-(N.baseLengthByEdge.get(j.edge)??0)+H.length+u.length}},"scorePairReplacement"),ao=f((N,D)=>N.crossings<D.crossings||N.crossings===D.crossings&&(N.bends<D.bends||N.bends===D.bends&&N.length<D.length),"pairScoreIsBetter"),lo=f((N,D,H,j)=>{let u=j;for(const b of D.candidates)for(const S of H.candidates){if(!ge(D,b,H,S))continue;const L=we(N,D,b,H,S);L&&ao(L,u)&&(u=L)}return u},"bestScoreForOptionPair"),fo=f(N=>{const D=F(),H=B(),j=Lt(),u=R(N),b=new Map(x.map(q=>[q,Zt(p(q))])),S=new Map(x.map(q=>[q,O(p(q))])),L=new Map,w=m(N);for(const q of w)for(const V of q){if(L.has(V))continue;const G=Wt(V,N,j,u);G.length>0&&L.set(V,{edge:V,candidates:G})}let k={replacements:new Map,crossings:N.count,bends:D,length:H};const W={current:N,currentBends:D,currentLength:H,baseBendsByEdge:b,baseLengthByEdge:S,baseSegments:j};for(const q of w){const V=new Set(q.filter(st=>N.edgeSet.has(st))),G=q.map(st=>L.get(st)).filter(st=>!!st);for(let st=0;st<G.length;st++){const it=G[st];for(let rt=st+1;rt<G.length;rt++){const et=G[rt];!V.has(it.edge)&&!V.has(et.edge)||(k=lo(W,it,et,k))}}}return k.replacements.size>0?k.replacements:void 0},"bestPairedReplacement");for(let N=0;N<4;N++){const D=v(),H=D.count;if(H===0)return;let j,u,b=H,S=Number.POSITIVE_INFINITY;for(const w of D.edges){const k=Zt(p(w),Q);for(const W of bt(w)){const q=X(w,W),V=!q&&_(w,W),G=I(D,w,W),st=Zt(W,Q);q||V||!(G<H||G===H&&st<k)||G>b||G===b&&st>=S||(j=w,u=W,b=G,S=st)}}if(j&&u){j.points=u;continue}const L=fo(D);if(!L)return;for(const[w,k]of L)w.points=k}}A(ls,"resolveRenderedOrthogonalCrossings");f(ls,"resolveRenderedOrthogonalCrossings");var xe=.001,Or=8;function ds(t,e){const{nodeInfoById:n,realNodeRects:o}=Ue(e),s=["top","bottom","left","right"],r=20,a={top:Math.min(...o.map(c=>c.rect.top))-r,bottom:Math.max(...o.map(c=>c.rect.bottom))+r,left:Math.min(...o.map(c=>c.rect.left))-r,right:Math.max(...o.map(c=>c.rect.right))+r},l=f((c,y,v,M)=>{const T=[],E=jn(c,y,v,M,r,xe);return E&&T.push(E),y===M&&T.push(Un(c,y,v,a[y])),T},"buildOrthogonalPathCandidates"),d=f((c,y)=>{for(let v=0;v<c.length-1;v++){const M=c[v],T=c[v+1];if(At(M,T,o,y,1))return!0}return!1},"pathHitsNode"),i=f((c,y,v=!1)=>{let M=0;const T=Le(c,xe),E=y.start,m=y.end;for(const I of t){if(I===y||I.isLayoutOnly)continue;const R=I.start,O=I.end;if(!v&&E&&m&&(R===E||R===m||O===E||O===m))continue;const F=I.points;if(!(!F||F.length<2))for(const B of T)for(const _ of Le(F,xe)){if(Kn(B.a,B.b,_.a,_.b,xe,xe)){M++;continue}ce(B,_,xe)>=Or&&M++}}return M},"pathConflictCount"),g=4,x=f((c,y)=>{const v=Math.abs(c.y-y.rect.top),M=Math.abs(c.y-y.rect.bottom),T=Math.abs(c.x-y.rect.left),E=Math.abs(c.x-y.rect.right);let m="top",I=v;return M<I&&(m="bottom",I=M),T<I&&(m="left",I=T),E<I&&(m="right",I=E),m},"nearestSideOfRect"),C=new Map,h=f((c,y,v)=>{const M=C.get(c)??[];M.push({side:y,edgeId:v}),C.set(c,M)},"addFaceClaim");for(const c of t){if(c.isLayoutOnly)continue;const y=c.points??[];if(y.length<1)continue;const v=c.id??"",M=c.start,T=c.end;if(M){const E=n.get(M);E&&h(M,x(y[0],E),v)}if(T){const E=n.get(T);E&&h(T,x(y[y.length-1],E),v)}}const p=f((c,y,v)=>C.get(c)?.some(M=>M.edgeId!==v&&M.side===y)??!1,"faceIsClaimed");for(const c of t){if(c.isLayoutOnly)continue;const y=c.points;if(!y||y.length<2)continue;const v=Zt(y,xe);if(v<g)continue;const M=c.start,T=c.end;if(!M||!T)continue;const E=n.get(M),m=n.get(T);if(!E||!m)continue;const I=c.id??"",R=i(y,c,!0),O=i(y,c);let F,B=R,_=v;for(const X of s){if(p(M,X,I))continue;const P=Me(E,X);for(const z of s){if(p(T,z,I))continue;const U=Me(m,z);for(const Z of l(P,X,U,z)){if(d(Z,[M,T]))continue;const ht=Zt(Z,xe);if(R>0){const yt=i(Z,c,!0);if(yt>B||yt===B&&ht>=_)continue;B=yt,_=ht,F=Z;continue}i(Z,c)>O||ht<_&&(_=ht,F=Z)}}}if(F){c.points=F;const X=C.get(M);X&&C.set(M,X.filter(z=>z.edgeId!==I));const P=C.get(T);P&&C.set(T,P.filter(z=>z.edgeId!==I)),h(M,x(F[0],E),I),h(T,x(F[F.length-1],m),I)}}}A(ds,"simplifyDetouredEdges");f(ds,"simplifyDetouredEdges");var qt=.001,dr=10,rn=7;function En(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const a=r.x-s.x,l=r.y-s.y;if(!(Math.abs(a)+Math.abs(l)<qt)){if(Math.abs(l)<=qt){const i=s.x+Math.sign(a)*dr;return{left:Math.min(s.x,i),right:Math.max(s.x,i),top:s.y-rn,bottom:s.y+rn}}if(Math.abs(a)<=qt){const i=s.y+Math.sign(l)*dr;return{left:s.x-rn,right:s.x+rn,top:Math.min(s.y,i),bottom:Math.max(s.y,i)}}return{left:Math.min(s.x,r.x),right:Math.max(s.x,r.x),top:Math.min(s.y,r.y),bottom:Math.max(s.y,r.y)}}}A(En,"markerClearanceRectFor");f(En,"markerClearanceRectFor");function fs(t){return{left:Math.min(t.left,t.right),right:Math.max(t.left,t.right),top:Math.min(t.top,t.bottom),bottom:Math.max(t.top,t.bottom)}}A(fs,"normalizeRect");f(fs,"normalizeRect");function wn(t,e){const n=mt(e),o=En(n,!0),s=En(n,!1);return[o,s].some(r=>r&&De(t,fs(r)))}A(wn,"labelOverlapsOwnMarker");f(wn,"labelOverlapsOwnMarker");function ke(t,e){const n=[];for(const p of t){if(p.isLayoutOnly)continue;const c=p.points;if(!(!c||c.length<2))for(let y=0;y<c.length-1;y++)n.push({edgeId:p.id,p1:c[y],p2:c[y+1]})}const o=[],s=[];for(const p of e.values()){const c=p.isGroup,y=p.parentId;if(c&&!y){const M=jt(p);M&&s.push({id:p.id,rect:M});continue}if(c||p.isEdgeLabel)continue;const v=jt(p);v&&o.push({nodeId:p.id,rect:v})}const r=3,a=1,l=12,d=f((p,c)=>{const y=fn(c,r);for(const{nodeId:v,rect:M}of o)if(v!==p&&De(y,M))return!0;return!1},"labelOverlapsForeignNode"),i=f((p,c)=>{const y=fn(c,r);for(const v of n)if(v.edgeId!==p&&je(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),g=f((p,c,y)=>d(p,y)||i(c,y),"labelOverlapsAnything"),x=[],C=f(p=>{for(const{id:c,rect:y}of s)if(Ho(y,p))return c},"findContainingLane"),h=f((p,c)=>x.some(y=>y.labelId!==p&&De(c,y.rect)),"overlapsPlacedLabel");for(const p of t){if(p.isLayoutOnly)continue;const c=p.labelNodeId;if(!c)continue;const y=e.get(c);if(!y)continue;const v=p.points;if(!v||v.length<2)continue;const M=y.width??0,T=y.height??0;if(M<=0||T<=0)continue;const E=[];for(let tt=0;tt<v.length-1;tt++){const K=v[tt],nt=v[tt+1],lt=Math.abs(K.x-nt.x),pt=Math.abs(K.y-nt.y);lt<qt&&pt<qt||lt>=qt&&pt>=qt||E.push({idx:tt,length:lt+pt,orientation:lt>=qt?"horizontal":"vertical",midX:(K.x+nt.x)/2,midY:(K.y+nt.y)/2})}if(E.length===0)continue;const m=E.length>=3?E.filter(tt=>tt.idx>0&&tt.idx<E.length-1):E,I=m.length>0?m:E,R=M>=T?"horizontal":"vertical",O=f(tt=>[...tt].sort((K,nt)=>{const lt=K.orientation===R,pt=nt.orientation===R;if(lt!==pt)return lt?-1:1;const bt=K.length>=(K.orientation==="horizontal"?M:T)+2,Lt=nt.length>=(nt.orientation==="horizontal"?M:T)+2;return bt!==Lt?bt?-1:1:nt.length-K.length}),"rankSegments"),F=E[0],B=E[E.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],X=f((tt,K)=>{const nt=v[tt.idx],lt=v[tt.idx+1];return{midX:nt.x+(lt.x-nt.x)*K,midY:nt.y+(lt.y-nt.y)*K}},"anchorAtT"),P=f((tt,K,nt)=>Math.min(nt,Math.max(K,tt)),"clamp"),z=f((tt,K)=>tt.midX>=K.left-qt&&tt.midX<=K.right+qt&&tt.midY>=K.top-qt&&tt.midY<=K.bottom+qt,"pointInsideRectInclusive"),U=f(tt=>{const K=ve(tt.midX,tt.midY,M,T),nt=C(K);if(nt)return{laneId:nt,anchor:tt,rect:K};const lt=s.find(({rect:ne})=>z(tt,ne));if(!lt)return;const pt=lt.rect.left+M/2+a,bt=lt.rect.right-M/2-a,Lt=lt.rect.top+T/2+a,Ut=lt.rect.bottom-T/2-a;if(pt>bt||Lt>Ut)return;const Wt={midX:P(tt.midX,pt,bt),midY:P(tt.midY,Lt,Ut)},Kt=ve(Wt.midX,Wt.midY,M,T);return z(tt,Kt)?{laneId:lt.id,anchor:Wt,rect:Kt}:void 0},"placementForAnchor"),Z=f((tt,K,nt)=>tt.orientation==="horizontal"?Math.abs(K.midX-nt.x):Math.abs(K.midY-nt.y),"distanceAlongSegment"),ht=f((tt,K)=>{const lt=(tt.orientation==="horizontal"?M/2:T/2)+l;if(tt===F){const pt=v[tt.idx];if(Z(tt,K,pt)+qt<lt)return!1}if(tt===B){const pt=v[tt.idx+1];if(Z(tt,K,pt)+qt<lt)return!1}return!0},"labelClearsTerminalEndpoints"),yt=f(tt=>{const K=O(tt);for(const nt of K)for(const lt of _){const pt=X(nt,lt);if(!ht(nt,pt))continue;const bt=U(pt);if(bt&&!wn(bt.rect,v)&&!h(c,bt.rect)&&!g(c,p.id,bt.rect))return{laneId:bt.laneId,anchor:bt.anchor}}},"tryPool"),Ft=f((tt,K,nt=!1)=>{const lt=O(tt);for(const pt of lt){const bt={midX:pt.midX,midY:pt.midY};if(K&&!ht(pt,bt))continue;const Lt=U(bt);if(Lt&&!wn(Lt.rect,v)&&!h(c,Lt.rect)&&!d(c,Lt.rect)&&(nt||!i(p.id,Lt.rect)))return{laneId:Lt.laneId,anchor:Lt.anchor}}},"findLaneContainingFallback"),Pt=yt(I)??(I.length<E.length?yt(E):void 0)??Ft(E,!0)??Ft(E,!1)??Ft(E,!1,!0);if(Pt){y.x=Pt.anchor.midX,y.y=Pt.anchor.midY,y.parentId=Pt.laneId;const tt=ve(Pt.anchor.midX,Pt.anchor.midY,M,T),K=x.findIndex(nt=>nt.labelId===c);K>=0?x[K]={labelId:c,rect:tt}:x.push({labelId:c,rect:tt})}}}A(ke,"anchorLabelsToPolyline");f(ke,"anchorLabelsToPolyline");var Mo=1e-6,Nr=8,fr=Nr/2,Br=3;function Rn(t,e){return t<e?`${t}::${e}`:`${e}::${t}`}A(Rn,"pairKey");f(Rn,"pairKey");function us(t,e){const{nodeInfoById:n,realNodeRects:o}=Ue(e),s=new Map;for(const a of e){const l=a.id;if(!a.isGroup&&a.isEdgeLabel){s.set(l,{w:a.width??0,h:a.height??0});continue}}const r=f((a,l,d,i)=>{const g=Rn(l,d);let x=0;const C=f(h=>{if(!h)return;const p=s.get(h);if(!p)return;const c=i==="x"?p.w/2:p.h/2;c>x&&(x=c)},"consider");C(a.labelNodeId);for(const h of t){if(h===a||h.isLayoutOnly)continue;const p=h.start,c=h.end;!p||!c||Rn(p,c)===g&&C(h.labelNodeId)}return x>0?x+Br:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const l=a.points;if(!$n(l,Mo))continue;const d=Wn(a,n,Mo);if(!d)continue;const{srcId:i,dstId:g,srcInfo:x,dstInfo:C,collinearX:h,collinearY:p}=d;if(h===p)continue;let c,y;if(h){const m=C.cy>x.cy;c={x:x.cx,y:m?x.rect.bottom:x.rect.top},y={x:C.cx,y:m?C.rect.top:C.rect.bottom}}else{const m=C.cx>x.cx;c={x:m?x.rect.right:x.rect.left,y:x.cy},y={x:m?C.rect.left:C.rect.right,y:C.cy}}if(At(c,y,o,[i,g],1))continue;const M=r(a,i,g,h?"x":"y"),T=M>fr?M:fr,E=[0,T,-T];for(const m of E){const I={...c},R={...y};if(h){if(I.x+=m,R.x+=m,I.x<=x.rect.left||I.x>=x.rect.right||R.x<=C.rect.left||R.x>=C.rect.right)continue}else if(I.y+=m,R.y+=m,I.y<=x.rect.top||I.y>=x.rect.bottom||R.y<=C.rect.top||R.y>=C.rect.bottom)continue;if(!At(I,R,o,[i,g],1)&&!He(I,R,t,a,{epsilon:Mo})){a.points=[I,R];break}}}}A(us,"straightenCollinearSiblingDetours");f(us,"straightenCollinearSiblingDetours");function An(t,e){const{realNodeRects:d,labelNodeRects:i}=ue(e.values()),g=f((m,I)=>Le(I,.001).map(R=>({...R,edge:m,interior:R.index>=1&&R.index<=I.length-3})),"segmentsFor"),x=f(()=>{const m=[];for(const I of t){if(I.isLayoutOnly)continue;const R=I.points;!R||R.length<2||m.push(...g(I,mt(R)))}return m},"allSegments"),C=f((m,I)=>m.horizontal&&I.horizontal?zt(m.a.x,m.b.x,I.a.x,I.b.x)>=8&&Math.abs(m.a.y-I.a.y)<7:m.vertical&&I.vertical?zt(m.a.y,m.b.y,I.a.y,I.b.y)>=8&&Math.abs(m.a.x-I.a.x)<7:!1,"hasCrowdedParallelTrack"),h=f((m,I)=>{const R=m.start,O=m.end,F=g(m,I);if(F.length!==I.length-1)return!1;const B=[R,O].filter(X=>!!X),_=m.labelNodeId?[m.labelNodeId]:[];for(const X of F)if(At(X.a,X.b,d,B,-2)||At(X.a,X.b,i,_,-2))return!1;for(const X of t){if(X===m||X.isLayoutOnly)continue;const P=X.points;if(!(!P||P.length<2)){for(const z of F)for(const U of g(X,mt(P)))if(C(z,U)||de(z.a,z.b,U.a,U.b,.001))return!1}}return!0},"candidateIsSafe"),p=f((m,I)=>{const R=mt(m.edge.points??[]);if(R.length<4||m.index>=R.length-1)return;const O=R.map(F=>({...F}));if(m.horizontal)O[m.index].y+=I,O[m.index+1].y+=I;else if(m.vertical)O[m.index].x+=I,O[m.index+1].x+=I;else return;return g(m.edge,O).length===O.length-1?O:void 0},"shiftedCandidate"),c=f((m,I)=>({x:m.x??(I.left+I.right)/2,y:m.y??(I.top+I.bottom)/2}),"nodeCenter"),y=f(m=>{const I=m.edge,R=mt(I.points??[]);if(R.length!==4||m.index!==1)return;const O=I.start?e.get(I.start):void 0,F=I.end?e.get(I.end):void 0,B=O?jt(O):void 0,_=F?jt(F):void 0,X=R.slice(m.index+2);if(!(!O||!F||!B||!_||X.length===0))return{sourceCenter:c(O,B),targetCenter:c(F,_),sourceRect:B,tail:X}},"sourceDetourContextFor"),v=f((m,I,R,O,F,B)=>{const _=O.y>=R.y,X=_?F.bottom:F.top,P=X+(_?20:-20);if(_&&m.b.y<=P+.001||!_&&m.b.y>=P-.001)return;const z=m.a.x+I;return mt([{x:R.x,y:X},{x:R.x,y:P},{x:z,y:P},{x:z,y:m.b.y},...B],.001)},"verticalSourceDetour"),M=f((m,I,R,O,F,B)=>{const _=O.x>=R.x,X=_?F.right:F.left,P=X+(_?20:-20);if(_&&m.b.x<=P+.001||!_&&m.b.x>=P-.001)return;const z=m.a.y+I;return mt([{x:X,y:R.y},{x:P,y:R.y},{x:P,y:z},{x:m.b.x,y:z},...B],.001)},"horizontalSourceDetour"),T=f((m,I)=>{const R=y(m);if(R){if(m.vertical)return v(m,I,R.sourceCenter,R.targetCenter,R.sourceRect,R.tail);if(m.horizontal)return M(m,I,R.sourceCenter,R.targetCenter,R.sourceRect,R.tail)}},"sourceDetourCandidate"),E=[-7,7,-14,14,-21,21];for(let m=0;m<12;m++){const I=x();let R=!1;for(let O=0;O<I.length&&!R;O++)for(let F=O+1;F<I.length&&!R;F++){const B=I[O],_=I[F];if(B.edge===_.edge||!C(B,_))continue;const X=[B,_].filter(P=>P.interior);for(const P of X){for(const z of E){const U=p(P,z);if(U&&h(P.edge,U)){P.edge.points=U,R=!0;break}const Z=T(P,z);if(Z&&h(P.edge,Z)){P.edge.points=Z,R=!0;break}}if(R)break}}if(!R)return}}A(An,"nudgeSharedInteriorSubpaths");f(An,"nudgeSharedInteriorSubpaths");function hs(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=o.x-n.x,l=o.y-n.y,d=s*l-r*a;if(Math.abs(d)<1e-10)return!1;const i=n.x-t.x,g=n.y-t.y,x=(i*l-g*a)/d,C=(i*r-g*s)/d,h=.01;return x>h&&x<1-h&&C>h&&C<1-h}A(hs,"segmentsIntersect");f(hs,"segmentsIntersect");function gs(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=Xo(e),r=[];for(const l of n){if(l.isLayoutOnly)continue;const d=l.points;if(!d||d.length<2)continue;const i=l.start,g=l.end,x=l.labelNodeId,C=l.id??`${i}->${g}`;for(const h of s)if(!(h.nodeId===i||h.nodeId===g)&&!(x&&h.nodeId===x)){for(let p=0;p<d.length-1;p++)if(je(d[p],d[p+1],h,-1)){o.push({type:"edge-node-overlap",edgeId:C,targetId:h.nodeId,detail:`segment ${p} passes through node "${h.nodeId}"`});break}}for(let h=0;h<d.length-1;h++)r.push({edgeId:C,start:i,end:g,p1:d[h],p2:d[h+1]})}const a=new Set;for(let l=0;l<r.length;l++)for(let d=l+1;d<r.length;d++){const i=r[l],g=r[d];if(i.edgeId!==g.edgeId&&!(i.start===g.start||i.start===g.end||i.end===g.start||i.end===g.end)&&hs(i.p1,i.p2,g.p1,g.p2)){const x=i.edgeId<g.edgeId?`${i.edgeId}|${g.edgeId}`:`${g.edgeId}|${i.edgeId}`;a.has(x)||(a.add(x),o.push({type:"edge-edge-crossing",edgeId:i.edgeId,targetId:g.edgeId,detail:`edges "${i.edgeId}" and "${g.edgeId}" cross`}))}}if(o.length>0){const l=o.filter(i=>i.type==="edge-node-overlap").length,d=o.filter(i=>i.type==="edge-edge-crossing").length;So.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${l} edge-node overlap(s), ${d} edge crossing(s)`);for(const i of o)So.warn(`[SWIMLANE_VALIDATE] ${i.type}: ${i.detail}`)}return o}A(gs,"validateSwimlanesLayout");f(gs,"validateSwimlanesLayout");function ps(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(l=>!l.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!es(t,e)||e==="BT"&&s.length>0&&!ts(t))return;for(const l of o){if(l.isLayoutOnly)continue;const d=l.points;!d||d.length<2||(l.points=ae(Xe(d)))}ds(o,n),us(o,n),ns(o,n);const r=new Map;for(const l of n)r.set(String(l.id),l);ke(o,r),Vo(o,r),os(o,r),An(o,r),ss(o,r),rs(o,r),vn(o,r),is(o,r);const a=f(()=>{ls(o,r),cs(o,r),as(o,r),ke(o,r),Sn(o,r),vn(o,r),ke(o,r),Sn(o,r)},"finalizeRenderedEdges");a(),An(o,r),a(),Ln(o,r),Tn(o,r),Ln(o,r),Tn(o,r)}A(ps,"postProcessSwimlaneLayout");f(ps,"postProcessSwimlaneLayout");function he(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const a=`${r.id}:${r.src}->${r.dst}`;n.has(a)||(n.add(a),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}A(he,"normalizeGraph");f(he,"normalizeGraph");function to(t,e){return t.edges.filter(n=>n.dst===e)}A(to,"incoming");f(to,"incoming");function ms(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}A(ms,"buildSuccessorMap");f(ms,"buildSuccessorMap");function eo(t){const e=ms(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}A(eo,"buildSortedSuccessorMap");f(eo,"buildSortedSuccessorMap");function no(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}A(no,"buildInDegreeMap");f(no,"buildInDegreeMap");function oo(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}A(oo,"sortedZeroInDegreeNodes");f(oo,"sortedZeroInDegreeNodes");function We(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}A(We,"buildPredecessorSuccessorMaps");f(We,"buildPredecessorSuccessorMaps");function so(t,e,n,o){let s=0;for(const a of t.nodes)o?.skipGroups&&t.nodeById.get(a)?.isGroup||(s=Math.max(s,n[a]??0));const r=Array.from({length:s+1},()=>[]);for(const a of e)o?.skipGroups&&t.nodeById.get(a)?.isGroup||r[Math.max(0,n[a]??0)].push(a);return r}A(so,"buildLayersFromRanks");f(so,"buildLayersFromRanks");function Pe(t){const e=no(t),n=oo(e),o=[],s=eo(t);for(;n.length;){const r=n.shift();o.push(r);for(const a of s.get(r)??[])if(e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0){let l=0;for(;l<n.length&&n[l]<a;)l++;n.splice(l,0,a)}}return o.length===t.nodes.length?o:null}A(Pe,"topoSortIfAcyclic");f(Pe,"topoSortIfAcyclic");function Te(t){const e=new Map;let n=0;for(const o of t)e.set(o,n),n++;return e}A(Te,"buildLayerIndex");f(Te,"buildLayerIndex");function ro(t){const e=new Array(t.length),n=f((o,s)=>{if(s-o<=1)return 0;const r=o+s>>1;let a=n(o,r)+n(r,s),l=o,d=r,i=o;for(;l<r||d<s;)d>=s||l<r&&t[l]<=t[d]?e[i++]=t[l++]:(e[i++]=t[d++],a+=r-l);for(let g=o;g<s;g++)t[g]=e[g];return a},"count");return n(0,t.length)}A(ro,"countInversions");f(ro,"countInversions");function ys(t){const e=he(t),n=new Map;for(const g of e.nodes)n.set(g,[]);for(const g of e.edges)n.get(g.src).push(g);for(const g of n.values())g.sort((x,C)=>x.dst===C.dst?x.id.localeCompare(C.id):x.dst.localeCompare(C.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=f(g=>{o[g]=1;for(const x of n.get(g)??[]){const C=x.dst;o[C]===0?r(C):o[C]===1&&s.push(x)}o[g]=2},"dfs"),a=[...e.nodes].sort((g,x)=>g.localeCompare(x));for(const g of a)o[g]===0&&r(g);const l=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),d=e.edges.map(g=>l.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:d,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}A(ys,"removeCycles_DFS");f(ys,"removeCycles_DFS");function xs(t){const e=new Map,n=f(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const l=n(r)??r;return e.set(o,l),l},"resolve");for(const o of t.nodes)n(o);return e}A(xs,"buildTopLaneMap");f(xs,"buildTopLaneMap");function fe(t){const e=xs(t);return n=>e.get(n)??null}A(fe,"createTopLaneResolver");f(fe,"createTopLaneResolver");function Ke(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}A(Ke,"buildTopLaneOrder");f(Ke,"buildTopLaneOrder");function io(t,e){const n=Ke(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const a of e)!o.has(a)||s.has(a)||(s.add(a),r.push(a));for(const a of n)s.has(a)||r.push(a);return r}A(io,"resolveTopLaneOrder");f(io,"resolveTopLaneOrder");var Pr={EPSILON:1e-6},On={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},ur={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function bs(t,e){const n=he(t),o=e?.laneOf??(()=>null),s=e?.rankHint,{preds:r}=We(n);for(const m of r.values())m.sort((I,R)=>I.localeCompare(R));const a=Pe(n)??[...n.nodes].sort((m,I)=>m.localeCompare(I)),l=new Map;for(const[m,I]of a.entries())l.set(I,m);const d=new Map,i=new Map;for(const m of n.nodes)i.set(m,[]);for(const m of a){const I=(r.get(m)??[]).filter(R=>d.has(R));if(I.length>0){const R=Ms(m,I,{laneOf:o,rankHint:s,topoIndex:l});d.set(m,R),i.get(R).push(m)}else d.has(m)||d.set(m,null)}for(const m of n.nodes)d.has(m)||d.set(m,null);const g=new Set;for(const m of n.nodes)(d.get(m)??null)===null&&g.add(m);const x=[...g].sort((m,I)=>{const R=l.get(m)??0,O=l.get(I)??0;return R===O?m.localeCompare(I):R-O}),C=Is(n),h=new Map;for(const[m,I]of C.entries())h.set(m,[...I].sort((R,O)=>R.localeCompare(O)));const p=Ss(h),c=Cs(h),y=new Map;for(const m of n.nodes)y.set(m,[]);for(const m of c)for(const I of m.nodes){const R=y.get(I);R?R.push(m.id):y.set(I,[m.id])}const v=[],M=[],T=new Set,E=f(m=>{if(!T.has(m)){T.add(m),v.push(m);for(const I of i.get(m)??[])E(I);M.push(m)}},"walk");for(const m of x)E(m);for(const m of a)E(m);return{parent:d,children:i,roots:x,componentOf:p,blocks:c,nodeBlocks:y,adjacency:h,preorder:v,postorder:M,topologicalOrder:a}}A(bs,"buildDrivingTree");f(bs,"buildDrivingTree");function Ms(t,e,n){const o=n.laneOf(t);return[...e].sort((r,a)=>{const l=n.laneOf(r),d=n.laneOf(a),i=l!=null&&l===o,g=d!=null&&d===o;if(i!==g)return i?-1:1;const x=n.rankHint?.[r],C=n.rankHint?.[a];if(x!=null&&C!=null&&x!==C)return C-x;const h=n.topoIndex.get(r)??0,p=n.topoIndex.get(a)??0;return h!==p?h-p:r.localeCompare(a)})[0]}A(Ms,"chooseParent");f(Ms,"chooseParent");function Is(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}A(Is,"buildAdjacency");f(Is,"buildAdjacency");function Ss(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const a of t.get(r)??[])e.has(a)||s.push(a)}}n++}return e}A(Ss,"assignComponents");f(Ss,"assignComponents");function Cs(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const a=f((l,d)=>{e.set(l,++r),n.set(l,r);for(const i of t.get(l)??[])i!==d&&(e.has(i)?(e.get(i)??0)<(e.get(l)??0)&&(o.push([l,i]),n.set(l,Math.min(n.get(l)??r,e.get(i)??r))):(o.push([l,i]),a(i,l),n.set(l,Math.min(n.get(l)??r,n.get(i)??r)),(n.get(i)??0)>=(e.get(l)??0)&&s.push(vs(l,i,o,s.length))))},"visit");for(const l of t.keys())e.has(l)||a(l,null);return s}A(Cs,"computeBlocks");f(Cs,"computeBlocks");function vs(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const a=n.pop();if(s.push(a),r.add(a[0]),r.add(a[1]),a[0]===t&&a[1]===e||a[0]===e&&a[1]===t)break}return{id:o,edges:s,nodes:[...r]}}A(vs,"popBlock");f(vs,"popBlock");function Ls(t,e,n){const o=[...t.nodes],s=new Map;for(const[M,T]of o.entries())s.set(T,M);const r=o.length,a=new Array(r).fill(-1),l=new Array(r).fill(0),d=[],i=new Set;for(const M of o){const T=n.parent.get(M)??null,E=s.get(M);E!=null&&T==null&&(a[E]=-1,l[E]=0,i.has(M)||(i.add(M),d.push(M)))}for(;d.length>0;){const M=d.shift(),T=s.get(M);if(T==null)continue;const E=n.children.get(M)??[];for(const m of E){if(i.has(m))continue;const I=s.get(m);I!=null&&(a[I]=T,l[I]=l[T]+1,i.add(m),d.push(m))}}for(const M of o){if(i.has(M))continue;const T=s.get(M);T!=null&&(a[T]=-1,l[T]=0,i.add(M))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),x=Array.from({length:g},()=>new Array(r).fill(-1));for(let M=0;M<r;M++)x[0][M]=a[M];for(let M=1;M<g;M++)for(let T=0;T<r;T++){const E=x[M-1][T];x[M][T]=E===-1?-1:x[M-1][E]}const C=f((M,T)=>{if(M===-1||T===-1)return-1;l[M]<l[T]&&([M,T]=[T,M]);const E=l[M]-l[T];for(let m=0;m<g;m++)if(E>>m&1&&(M=x[m][M],M===-1))return-1;if(M===T)return M;for(let m=g-1;m>=0;m--){const I=x[m][M],R=x[m][T];I===-1||R===-1||I!==R&&(M=I,T=R)}return x[0][M]},"lcaIndex"),h=Array.from({length:r},()=>new Map);for(const M of t.edges){let T=M.src,E=M.dst,m=e[T],I=e[E];if(m==null||I==null||(m>I&&([T,E]=[E,T],[m,I]=[I,m]),m==null||I==null||m===I))continue;const R=s.get(T),O=s.get(E);if(R==null||O==null)continue;const F=C(R,O);if(F===-1)continue;const B=h[F];for(let _=m;_<I;_++)B.set(_,(B.get(_)??0)+1)}const p=new Map,c=f((M,T)=>{if(T.size!==0)for(const[E,m]of T)M.set(E,(M.get(E)??0)+m)},"mergeInto"),y=new Set,v=f(M=>{const T=s.get(M);y.add(M);const E=T==null?void 0:h[T],m=E?new Map(E):new Map,I=n.children.get(M)??[];for(const R of I){const O=v(R),F=e[M];if(F!=null){let B=p.get(M);B||(B=new Map,p.set(M,B));let _=O.get(F)??0;const X=e[R];X!=null&&X>F&&(_+=1),B.set(R,_)}c(m,O)}return m},"dfs");for(const M of n.roots)y.has(M)||v(M);for(const M of o)y.has(M)||v(M);return p}A(Ls,"computeSubtreeCrossCounts");f(Ls,"computeSubtreeCrossCounts");function Ts(t,e,n){const o=new Map,s=f(r=>{let a=n[r]??0;const l=[...e.get(r)??[]];l.sort(co(n));for(const d of l){s(d);const i=o.get(d);i!=null&&(a=Math.min(a,i))}o.set(r,a)},"annotate");for(const r of t)s(r);return o}A(Ts,"annotateMinimumLayers");f(Ts,"annotateMinimumLayers");function co(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}A(co,"compareByRankThenId");f(co,"compareByRankThenId");function Es(t,e,n,o){let s=0;for(const d of e){const i=n[d]??0;i>s&&(s=i)}const r=Array.from({length:s+1},()=>[]),a=new Set,l=f(d=>{if(a.has(d))return;a.add(d);const i=n[d]??0;r[i]||(r[i]=[]),r[i].push(d);for(const g of o(d))l(g)},"emit");for(const d of t)l(d);for(const d of e)if(!a.has(d)){const i=n[d]??0;r[i]||(r[i]=[]),r[i].push(d),a.add(d)}return r}A(Es,"emitNodesInTreeOrder");f(Es,"emitNodesInTreeOrder");function ws(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}A(ws,"deduplicateLayers");f(ws,"deduplicateLayers");function Rs(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const a=e[s]??0,l=[],d=[],i=n.get(s);for(const g of r){const x=o.get(g)??a;x>a?l.push({child:g,min:x}):d.push(g)}return l.sort((g,x)=>g.min===x.min?g.child.localeCompare(x.child):g.min-x.min),d.sort((g,x)=>{const C=i?.get(g)??0,h=i?.get(x)??0;if(C!==h)return C-h;const p=o.get(g)??a,c=o.get(x)??a;return p!==c?p-c:g.localeCompare(x)}),[...l.map(g=>g.child),...d]}}A(Rs,"createChildOrderer");f(Rs,"createChildOrderer");function Ve(t,e,n){const o=bs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const x of t.nodes)s.has(x)||s.set(x,[]);const a=Ls(t,e,o),l=[...r].sort(co(e)),d=Ts(l,s,e),i=Rs(s,e,a,d);let g=Es(l,t.nodes,e,i);return g=ws(g),g}A(Ve,"buildMultitreeLayerOrder");f(Ve,"buildMultitreeLayerOrder");function As(t,e,n){const o=new Set(t),s=new Set(e),r=Te(e),a=[];for(const l of n)o.has(l.src)&&s.has(l.dst)&&a.push(r.get(l.dst));return ro(a)}A(As,"countCrossingsBetweenAdjacent");f(As,"countCrossingsBetweenAdjacent");function Nn(t,e,n){const o=[];for(const r of e){const a=n[r.src],l=n[r.dst];if(a==null||l==null||a===l)continue;let d=r.src,i=r.dst,g=a,x=l;a>l&&(d=r.dst,i=r.src,g=l,x=a);for(let C=g;C<x;C++)o.push({id:`${r.id}@${C}`,src:d,dst:i,ref:r.ref})}let s=0;for(let r=0;r+1<t.length;r++)s+=As(t[r],t[r+1],o);return s}A(Nn,"totalCrossings");f(Nn,"totalCrossings");function Os(t,e){const n={...e},{preds:o}=We(t),s=fe(t),r=Ve(t,n,s);let a=Nn(r,t.edges,n);const l=On.MAX_CROSSING_OPTIMIZATION_PASSES;for(let d=0;d<l;d++){let i=!1;const g=[...t.nodes].sort((x,C)=>(n[C]??0)-(n[x]??0));for(const x of g){const C=n[x]??0;if(C===0)continue;let h=0;for(const v of o.get(x)??[])h=Math.max(h,(n[v]??0)+1);if(h>=C)continue;const p=C;n[x]=h;const c=Ve(t,n,s),y=Nn(c,t.edges,n);y<a?(a=y,i=!0):n[x]=p}if(!i)break}return n}A(Os,"optimizeRanksByCrossings");f(Os,"optimizeRanksByCrossings");function Ns(t,e){const n=fe(t),o=[...t.nodes].sort((s,r)=>(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const a=t.edges.filter(c=>c.src===s);if(a.length===0)continue;let l=!1,d=0;for(const c of a){const y=n(c.dst);y==null||y===r?l=!0:d++}if(d===0||l)continue;let i=0,g=!1;for(const c of t.edges){if(c.dst!==s)continue;const y=n(c.src);y&&(y===r?g=!0:i++)}if(i>0||!g)continue;const x=e[s]??0,C=x+d;let h=0;for(const c of t.edges)c.dst===s&&(h=Math.max(h,(e[c.src]??0)+1));const p=Math.max(x,h,C);p!==x&&(e[s]=p)}}A(Ns,"adjustCrossLaneSources");f(Ns,"adjustCrossLaneSources");function Bs(t,e){const n=he(t),o=Pe(n)??[...n.nodes].sort(),s=e?.compactSingleInput??!1,r=fe(n);let a=Object.create(null);for(const d of o){const i=to(n,d),g=e?.ignoreCrossLaneEdges?i.filter(x=>{const C=r(x.src),h=r(d);return!C||!h?!0:C===h}):i;if(g.length===0)a[d]=0;else if(s&&g.length===1){const x=g[0].src,C=r(x),h=r(d);C!==h?a[d]=a[x]??0:a[d]=(a[x]??0)+1}else{let x=-1/0;for(const C of g)x=Math.max(x,(a[C.src]??0)+1);a[d]=x===-1/0?0:x}}return(e?.optimizeRanksByCrossings??!1)&&(a=Os(n,a)),e?.ignoreCrossLaneEdges&&Ns(n,a),{layers:Ve(n,a,r),rankOf:a,dummy:new Set}}A(Bs,"assignLayers_LongestPath");f(Bs,"assignLayers_LongestPath");function Ps(t,e){const n=he(t),s={...Bs(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=fe(n),{preds:a,succs:l}=We(n,p=>{if(e?.ignoreCrossLaneEdges){const c=r(p.src),y=r(p.dst);if(c&&y&&c!==y)return!1}return!0}),d=Pe(n)??[...n.nodes],i=[...d].reverse(),g=f((p,c)=>{let y=0;for(const T of a.get(p)??[])y=Math.max(y,(s[T]??0)+1);let v=Number.POSITIVE_INFINITY;const M=l.get(p)??[];return M.length>0&&(v=Math.min(...M.map(T=>(s[T]??0)-1))),Number.isFinite(v)||(v=Math.max(y,c)),Math.min(Math.max(c,y),v)},"clampFeasible"),x=On.GRAVITY_ITERATIONS,C=f(p=>{let c=!1;for(const y of p){const v=a.get(y)??[],M=l.get(y)??[];if(v.length===0&&M.length===0)continue;const T=v.length>0?v.reduce((R,O)=>R+(s[O]??0)+1,0)/v.length:s[y]??0,E=M.length>0?M.reduce((R,O)=>R+(s[O]??0)-1,0)/M.length:s[y]??0,m=Math.round((T+E)/2),I=g(y,m);I!==s[y]&&(s[y]=I,c=!0)}return c},"relaxOrder");for(let p=0;p<x;p++){const c=C(d),y=C(i);if(!c&&!y)break}for(const p of d){let c=0;for(const y of a.get(p)??[])c=Math.max(c,(s[y]??0)+1);(s[p]??0)<c&&(s[p]=c)}for(const p of i){const c=l.get(p)??[];if(c.length>0){const y=Math.min(...c.map(v=>(s[v]??0)-1));(s[p]??0)>y&&(s[p]=y)}}return{layers:so(n,d,s),rankOf:s,dummy:new Set}}A(Ps,"assignLayers_Gravity");f(Ps,"assignLayers_Gravity");function ks(t){const e=no(t),n=eo(t);let o=oo(e);const s=[];for(;o.length>0;){const r=[];for(const a of o){s.push(a);for(const l of n.get(a)??[])e.set(l,(e.get(l)??0)-1),(e.get(l)??0)===0&&r.push(l)}o=r.sort((a,l)=>a.localeCompare(l))}return s.length===t.nodes.length?s:null}A(ks,"topoSortByGenerationIfAcyclic");f(ks,"topoSortByGenerationIfAcyclic");function Fs(t,e){const n=he(t),o=e?.direction==="LR"?ks(n)??[...n.nodes].sort():Pe(n)??[...n.nodes].sort(),s=fe(n),r=f(g=>s(g)??g,"laneOf"),a=Object.create(null),l=new Map,d=f((g,x)=>e?.ignoreCrossLaneEdges??!0?r(g)===r(x)?1:0:1,"edgeWeight");for(const g of o){if(n.nodeById.get(g)?.isGroup)continue;const C=to(n,g);let h=0;if(C.length>0)for(const v of C){const M=v.src,T=a[M]??0;h=Math.max(h,T+d(M,g))}const p=r(g),c=l.get(p)??0,y=Math.max(h,c);a[g]=y,l.set(p,y+1)}return{layers:so(n,o,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}A(Fs,"assignLayers_LaneAwareCompact");f(Fs,"assignLayers_LaneAwareCompact");function _s(t,e){const n=he(e),{rankOf:o}=t,s=t.layers.map(h=>[...h]),r=new Set(t.dummy?[...t.dummy]:[]);let a=0;const l=new Map(n.nodeById),d=f(h=>{const p=`placeholder-${a++}`,c={id:p,isGroup:!1,isDummy:!0,width:0,height:0};for(l.set(p,c),r.add(p);s.length<=h;)s.push([]);return s[h].push(p),o[p]=h,p},"addDummyAt"),i=[...n.edges].sort((h,p)=>h.id===p.id?h.src===p.src?h.dst.localeCompare(p.dst):h.src.localeCompare(p.src):h.id.localeCompare(p.id)),g=[];for(const h of i){const p=o[h.src]??0,c=o[h.dst]??0;if(c-p<=1){g.push(h);continue}let y=h.src;for(let M=p+1,T=0;M<c;M++,T++){const E=d(M);g.push({id:`${h.id}#${T}`,src:y,dst:E,weight:h.weight,ref:h.ref}),y=E}const v=c-p-2;g.push({id:`${h.id}#${Math.max(v+1,0)}`,src:y,dst:h.dst,weight:h.weight,ref:h.ref})}const C={nodes:[...n.nodes,...[...r].filter(h=>!n.nodes.includes(h))],edges:g,layout:n.layout,nodeById:l};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:C}}A(_s,"makeProperLayering");f(_s,"makeProperLayering");function Bn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}A(Bn,"median");f(Bn,"median");function Pn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}A(Pn,"barycenter");f(Pn,"barycenter");function Ds(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}A(Ds,"neighborPositionsFor");f(Ds,"neighborPositionsFor");function Hs(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}A(Hs,"currentOrderTieBreak");f(Hs,"currentOrderTieBreak");function kn(t,e,n){const o=new Set(t),s=new Set(e),r=Te(t),a=Te(e),l=[];for(const i of n)o.has(i.src)&&s.has(i.dst)&&l.push({u:r.get(i.src),v:a.get(i.dst)});l.sort((i,g)=>i.u===g.u?i.v-g.v:i.u-g.u);const d=l.map(i=>i.v);return ro(d)}A(kn,"countCrossingsBetweenAdjacent2");f(kn,"countCrossingsBetweenAdjacent");function Fe(t,e,n){return[...t].sort((o,s)=>{const r=Bn(e.get(o)??[]),a=Bn(e.get(s)??[]);return r===a?Hs(o,s,n):isFinite(r)?isFinite(a)?r-a:-1:1})}A(Fe,"sortByHeuristic");f(Fe,"sortByHeuristic");function Fn(t,e,n,o,s,r){const a=Te(t),l=Te(e),d=Ds(e,a,n,o);if(!s||!r||r.length===0)return Fe(e,d,l);const i=new Map;for(const C of e){const h=s(C),p=i.get(h)??[];p.push(C),i.set(h,p)}const g=[];for(const C of r){const h=i.get(C);if(!h||h.length===0)continue;const p=Fe(h,d,l);g.push(...p)}const x=i.get(null);if(x&&x.length>0){const C=Fe(x,d,l);for(const h of C){const p=Pn(d.get(h)??[]);let c=g.length;if(isFinite(p))for(const[y,v]of g.entries()){const M=Pn(d.get(v)??[]);if(p<M){c=y;break}}g.splice(c,0,h)}}return g}A(Fn,"reorderLayer");f(Fn,"reorderLayer");function _n(t,e,n,o,s){const r=[...e],a=new Set(t),l=new Set(e),d=o?new Set(o):null,i=n.filter(c=>a.has(c.src)&&l.has(c.dst)),g=d?n.filter(c=>l.has(c.src)&&d.has(c.dst)):void 0,x=f(c=>{let y=kn(t,c,i);return g&&o&&(y+=kn(c,o,g)),y},"crossingScore"),C=s?new Map:null;if(s&&C)for(const c of e)C.set(c,s(c));let h=!0,p=x(r);for(;h;){h=!1;for(let c=0;c+1<r.length;c++){if(C){const M=C.get(r[c]),T=C.get(r[c+1]);if(M!==T)continue}const y=p;[r[c],r[c+1]]=[r[c+1],r[c]];const v=x(r);v<y?(p=v,h=!0):[r[c],r[c+1]]=[r[c+1],r[c]]}}return r}A(_n,"transposeImprove");f(_n,"transposeImprove");function Xs(t,e,n){const o=t.layers.map(l=>[...l]),s=e.edges,r=fe(e),a=io(e,n?.laneOrder);for(let l=0;l<3;l++){for(let d=1;d<o.length;d++)o[d]=Fn(o[d-1],o[d],s,"down",r,a),o[d]=_n(o[d-1],o[d],s,o[d+1],r);for(let d=o.length-2;d>=0;d--)o[d]=Fn(o[d+1],o[d],s,"up",r,a),o[d]=_n(o[d+1],o[d],s,o[d-1],r)}return{layers:o}}A(Xs,"orderLayers");f(Xs,"orderLayers");function Ys(t,e,n){const o=n?.layerGap??ur.DEFAULT_LAYER_GAP,s=n?.nodeGap??ur.DEFAULT_NODE_GAP,r=n?.laneGap??s*2,a=n?.direction??"TB",l=a==="LR"||a==="RL",d=t.layers,i=Object.create(null),g=Object.create(null),x=f(B=>e.nodeById.get(B),"getNode"),C=f(B=>x(B)?.width??0,"getWidth"),h=f(B=>x(B)?.height??0,"getHeight"),p=fe(e),c=io(e,n?.laneOrder),y=d.map(B=>B.reduce((_,X)=>Math.max(_,h(X)),0)),v=[];if(l)for(let B=0;B+1<d.length;B++){const _=d[B].reduce((yt,Ft)=>Math.max(yt,C(Ft)),0),X=d[B+1].reduce((yt,Ft)=>Math.max(yt,C(Ft)),0),P=y[B],z=y[B+1],U=P/2+z/2,Z=(_+X)/2,ht=Math.max(0,Z-U-o);v.push(ht)}const M=new Set;for(const B of d)for(const _ of B)M.add(p(_));const T=M.has(null),E=c.filter(B=>M.has(B)),m=[...T?[null]:[],...E],I=Object.create(null);for(const B of E)I[B]=0;T&&(I.null=0);for(const B of d){const _=Object.create(null),X=[];for(const P of B){const z=p(P);z===null?X.push(P):(_[z]||=[]).push(P)}for(const[P,z]of Object.entries(_)){const U=z.reduce((Z,ht)=>Z+C(ht),0)+s*Math.max(0,z.length-1);I[P]=Math.max(I[P]??0,U)}if(T&&X.length){const P=X.reduce((z,U)=>z+C(U),0)+s*Math.max(0,X.length-1);I.null=Math.max(I.null??0,P)}}const R=new Map;{const B=m.map(P=>(P===null?I.null:I[P])??0);let X=-(B.reduce((P,z)=>P+z,0)+r*Math.max(0,m.length-1))/2;for(let P=0;P<m.length;P++){const z=m[P],U=B[P]??0,Z=X+U/2;R.set(z,Z),X+=U,P<m.length-1&&(X+=r)}}let O=0;for(const[B,_]of d.entries()){const X=y[B]??0,P=new Map;for(const U of _){const Z=p(U),ht=P.get(Z)??[];ht.push(U),P.set(Z,ht)}for(const U of m){const Z=P.get(U)??[];if(Z.length===0)continue;const ht=R.get(U);if(Z.length===1){const yt=Z[0];i[yt]=ht,g[yt]=O+X/2}else{const yt=Z.map(tt=>C(tt)),Ft=yt.reduce((tt,K)=>tt+K,0)+s*(Z.length-1);let Pt=ht-Ft/2;for(const[tt,K]of Z.entries()){const nt=yt[tt];i[K]=Pt+nt/2,g[K]=O+X/2,Pt+=nt+s}}}const z=v[B]??0;O+=X+o+z}const F=new Map;for(const B of e.edges){const _=B.ref.id;F.has(_)||F.set(_,[]),F.get(_).push(B)}for(const[,B]of F){if(B.length===0)continue;const _=B[0].ref,X=_.start,P=_.end;if(X==null||P==null)continue;const z=Math.round(((i[X]??0)+(i[P]??0))/2),U=new Set;for(const Z of B)U.add(Z.src),U.add(Z.dst);for(const Z of U){if(Z===X||Z===P)continue;e.nodeById.get(Z)?.isDummy&&(i[Z]=z)}}return{x:i,y:g}}A(Ys,"assignCoordinates");f(Ys,"assignCoordinates");var hr=8;function Gs(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}A(Gs,"hashString");f(Gs,"hashString");function zs(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}A(zs,"mulberry32");f(zs,"mulberry32");function $s(t,e){const n=[...t],o=zs(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}A($s,"deterministicShuffle");f($s,"deterministicShuffle");function Vs(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}A(Vs,"sourceDistance");f(Vs,"sourceDistance");function Dn(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:a}of e){const l=n.get(s),d=n.get(r);l==null||d==null||(o+=a*Math.abs(l-d))}return o}A(Dn,"laneArrangementCost");f(Dn,"laneArrangementCost");function js(t){const e=Ke(t);if(e.length<2)return[];const n=new Map(e.map((r,a)=>[r,a])),o=fe(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const a=typeof r.start=="string"?r.start:void 0,l=typeof r.end=="string"?r.end:void 0;if(!a||!l||!t.nodeById.has(a)||!t.nodeById.has(l))continue;const d=o(a),i=o(l);if(!d||!i||d===i)continue;const g=n.get(d),x=n.get(i);if(g==null||x==null)continue;const[C,h]=g<=x?[d,i]:[i,d],p=`${C}\0${h}`,c=s.get(p);c?c.weight++:s.set(p,{a:C,b:h,weight:1})}return[...s.values()]}A(js,"buildWeightedLaneEdges");f(js,"buildWeightedLaneEdges");function Hn(t,e,n){const o=[...t];let s=Dn(o,e),r=!0,a=0;const l=Math.max(1,o.length);for(;r&&a<l;){r=!1,a++;for(let d=0;d+1<o.length;d++){[o[d],o[d+1]]=[o[d+1],o[d]];const i=Dn(o,e);i<s?(s=i,r=!0):[o[d],o[d+1]]=[o[d+1],o[d]]}}return{order:o,cost:s,sourceDistance:Vs(o,n)}}A(Hn,"greedySwitch");f(Hn,"greedySwitch");function Us(t,e){return t.cost!==e.cost?t.cost<e.cost:t.sourceDistance<e.sourceDistance}A(Us,"isBetterCandidate");f(Us,"isBetterCandidate");function Ws(t,e,n){const o=[...e].sort((s,r)=>s.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:a})=>`${s}:${r}:${a}`).join("|");return Gs(`${t.join("|")}#${o}#${n}`)}A(Ws,"seedForRestart");f(Ws,"seedForRestart");function Ks(t,e={}){const n=Ke(t);if(n.length<2)return n;const o=js(t);if(o.length===0)return n;const s=new Map(n.map((l,d)=>[l,d]));let r=Hn(n,o,s);const a=Math.max(0,e.restarts??hr);for(let l=0;l<a;l++){const d=Ws(n,o,l),i=$s(n,d),g=Hn(i,o,s);Us(g,r)&&(r=g)}return r.order}A(Ks,"optimizeTopLaneOrder");f(Ks,"optimizeTopLaneOrder");function Js(t,e){const n=e?.ignoreCrossLaneEdges??!0,o=e?.optimizeRanksByCrossings??!0,s=he(t),r=e?.automaticLaneOrdering?Ks(s,{restarts:hr}):void 0,a=ys(s),l=a.acyclic,d=n?Fs(l,{compactSingleInput:e?.compactSingleInput??On.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:e?.direction}):Ps(l,{compactSingleInput:e?.compactSingleInput??On.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:o}),{layering:i,graphWithDummies:g}=_s(d,l),x=Xs(i,g,{laneOrder:r}),C=Ys(x,g,{layerGap:e?.layerGap,nodeGap:e?.nodeGap,direction:e?.direction,laneOrder:r});return{acyclic:l,reversed:a.reversed,layering:i,ordered:x,coordinates:C}}A(Js,"sugiyamaLayout");f(Js,"sugiyamaLayout");var at=Pr.EPSILON,kr=8,Se=15,Ne=15,cn=25,se=20,Io=10;function Xn(t,e,n){const o=t.x??0,s=t.y??0,r=e.x-o,a=e.y-s,l=Math.abs(r),d=Math.abs(a);return l<at&&d<at?n:d>at&&d*3>=l?a>0?"bottom":"top":l>at?r>0?"right":"left":n}A(Xn,"chooseOrthogonalSide");f(Xn,"chooseOrthogonalSide");function Yn(t,e){return Math.abs(t.to-e.from)<at||Math.abs(t.to-e.to)<at?t.to:t.from}A(Yn,"sharedLineEndpointCoord");f(Yn,"sharedLineEndpointCoord");function be(t,e){return t.orient==="vertical"?{x:t.coord,y:e}:{x:e,y:t.coord}}A(be,"pointOnLine");f(be,"pointOnLine");function qs(t,e){const n=t.nodes??[],o=t.edges??[],s=[];for(const u of o)u.isLayoutOnly||s.push({...u,__originalEdge:u});const r=new Map,a=new Map,l=[],d=e==="LR";for(const u of n)r.set(u.id,u);const i=n.filter(u=>u.isGroup&&!u.parentId);for(const u of i){const b={id:u.id},S=f(L=>{a.set(L.id,b),n.filter(w=>w.parentId===L.id).forEach(S)},"assignLane");S(u)}const g=n.filter(u=>!u.isGroup&&!u.isEdgeLabel).map(u=>{const b=u.width??10,S=u.height??10,L=u.x??0,w=u.y??0,k=kr;return{nodeId:u.id,minX:L-b/2-k,maxX:L+b/2+k,minY:w-S/2-k,maxY:w+S/2+k,visualXHalfExtent:d?S/2+k:b/2+k}}),x=f((u,b,S,L)=>{let w=l.find(k=>k.orientation===u&&Math.abs(k.coord-b)<1);return w||(w={id:`pipe-${u}-${b.toFixed(0)}`,orientation:u,coord:b,spanMin:S,spanMax:L,tracks:[]},l.push(w)),w.spanMin=Math.min(w.spanMin,S),w.spanMax=Math.max(w.spanMax,L),w},"getOrAddPipe"),C=f((u,b)=>{const S=u.width??10,L=u.height??10,w=u.x??0,k=u.y??0;switch(b){case"top":return{x:w,y:k-L/2};case"bottom":return{x:w,y:k+L/2};case"left":return{x:w-S/2,y:k};case"right":return{x:w+S/2,y:k}}},"portForSide"),h=f((u,b,S)=>C(u,Xn(u,b,S?"bottom":"top")),"getOrthogonalPort"),p=[],c=[],y=new Set,v=1e3,M=f((u,b,S)=>{if(p.length===0)return 0;const L=Math.abs(b.y-S.y)<at,w=Math.abs(b.x-S.x)<at;if(!L&&!w)return 0;let k=0;if(L){const W=b.y,q=Math.min(b.x,S.x)-at,V=Math.max(b.x,S.x)+at;if(V<=q)return 0;for(const G of p)G.edgeIndex===u||G.orientation!=="vertical"||G.pipe.coord<q||G.pipe.coord>V||G.from-at<=W&&G.to+at>=W&&(k+=v)}else if(w){const W=b.x,q=Math.min(b.y,S.y)-at,V=Math.max(b.y,S.y)+at;if(V<=q)return 0;for(const G of p)G.edgeIndex===u||G.orientation!=="horizontal"||G.pipe.coord<q||G.pipe.coord>V||G.from-at<=W&&G.to+at>=W&&(k+=v)}return k},"crossingPenalty"),T=s.map((u,b)=>{if(!u.start||!u.end)return{idx:b,crossLane:0,dx:0,dy:0};const S=r.get(u.start),L=r.get(u.end),w=a.get(u.start),k=a.get(u.end),W=w&&k&&w.id!==k.id?1:0,q=S&&L?Math.abs((L.x??0)-(S.x??0)):0,V=S&&L?Math.abs((L.y??0)-(S.y??0)):0;return{idx:b,crossLane:W,dx:q,dy:V}}).sort((u,b)=>{if(u.crossLane!==b.crossLane)return b.crossLane-u.crossLane;const S=u.dx+u.dy,L=b.dx+b.dy;return Math.abs(S-L)>1?S-L:u.idx-b.idx}).map(u=>u.idx),E=f((u,b,S,L)=>{const w=Math.min(u.x,b.x),k=Math.max(u.x,b.x),W=Math.min(u.y,b.y),q=Math.max(u.y,b.y);return!!g.find(G=>S&&G.nodeId===S||L&&G.nodeId===L?!1:Math.abs(u.x-b.x)>at?G.minY<u.y&&G.maxY>u.y&&G.maxX>w&&G.minX<k:G.minX<u.x&&G.maxX>u.x&&G.maxY>W&&G.minY<q)},"isSegmentBlocked"),m=new Map,I=new Map;for(const u of s)!u.start||!u.end||u.start===u.end||(I.set(u.start,(I.get(u.start)??0)+1),I.set(u.end,(I.get(u.end)??0)+1));const R=f((u,b)=>Xn(u,b,"bottom"),"determineSide"),O=new Map;for(const[u,b]of s.entries()){if(!b.start||!b.end||b.start===b.end||b.points&&b.points.length>0)continue;const S=r.get(b.start),L=r.get(b.end);if(!S||!L)continue;const w=(L.x??0)-(S.x??0),k=(L.y??0)-(S.y??0);O.set(u,{edgeIdx:u,srcId:b.start,dstId:b.end,srcSide:R(S,{x:L.x??0,y:L.y??0}),dstSide:R(L,{x:S.x??0,y:S.y??0}),absDx:Math.abs(w),absDy:Math.abs(k),dxSign:Math.sign(w),dySign:Math.sign(k)})}const F=f(u=>u.srcSide==="top"||u.srcSide==="bottom"?u.absDx===0?1/0:u.absDy/u.absDx:u.absDy===0?1/0:u.absDx/u.absDy,"preferenceStrength"),B=f(u=>u.srcSide==="top"||u.srcSide==="bottom"?u.dxSign>=0?"right":"left":u.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const u of O.values()){const b=`${u.srcId}:${u.srcSide}`;_.has(b)||_.set(b,[]),_.get(b).push(u)}const X=new Map,P=f((u,b)=>`${u}:${b}`,"loadKey");for(const u of O.values())X.set(P(u.srcId,u.srcSide),(X.get(P(u.srcId,u.srcSide))??0)+1),X.set(P(u.dstId,u.dstSide),(X.get(P(u.dstId,u.dstSide))??0)+1);for(const u of _.values())if(!(u.length<2)){u.sort((b,S)=>{const L=F(b),w=F(S);return Math.abs(L-w)>1e-9?w-L:b.edgeIdx-S.edgeIdx});for(let b=1;b<u.length;b++){const S=u[b],L=B(S),w=X.get(P(S.srcId,S.srcSide))??0,k=X.get(P(S.srcId,L))??0;k>=w||(X.set(P(S.srcId,S.srcSide),w-1),X.set(P(S.srcId,L),k+1),S.srcSide=L)}}const z=f(u=>{const b=u?.shape;return b==="question"||b==="diamond"},"isDiamondNode"),U=new Map;for(const u of O.values())U.has(u.dstId)||U.set(u.dstId,new Set),U.get(u.dstId).add(u.dstSide);for(const u of O.values()){if(!z(r.get(u.srcId)))continue;const b=U.get(u.srcId);if(!b?.has(u.srcSide))continue;const S=B(u);if(b.has(S)||(X.get(P(u.srcId,S))??0)>0)continue;const L=X.get(P(u.srcId,u.srcSide))??0;X.set(P(u.srcId,u.srcSide),Math.max(0,L-1)),X.set(P(u.srcId,S),1),u.srcSide=S}for(const u of O.values()){const{edgeIdx:b,srcId:S,dstId:L,srcSide:w,dstSide:k}=u,W=r.get(S),q=r.get(L),V=`${S}:${w}:src`,G=w==="top"||w==="bottom"?q.x??0:q.y??0;m.has(V)||m.set(V,[]),m.get(V).push({edgeIdx:b,oppositeCoord:G});const st=`${L}:${k}:dst`,it=k==="top"||k==="bottom"?W.x??0:W.y??0;m.has(st)||m.set(st,[]),m.get(st).push({edgeIdx:b,oppositeCoord:it})}const Z=new Map,ht=8;for(const[u,b]of m){if(b.length<2)continue;b.sort((wt,Ht)=>wt.oppositeCoord-Ht.oppositeCoord);const S=u.split(":"),L=S.slice(0,-2).join(":"),w=S[S.length-2],k=S[S.length-1],W=r.get(L);if(!W)continue;const V=w==="left"||w==="right"?W.height??10:W.width??10,G=W.shape,it=G==="question"||G==="diamond"?V*.3:V,et=Math.min(20,Math.max(ht,it/(b.length+1))),Ot=-(et*(b.length-1))/2;for(const[wt,Ht]of b.entries()){const Qt=Ot+wt*et,uo=`${Ht.edgeIdx}:${k}`;Z.set(uo,Qt)}}const yt=f(u=>!!s[u]?.labelNodeId,"edgeHasLabelNode"),Ft=f((u,b)=>u?(m.get(`${u}:${b}:src`)??[]).some(({edgeIdx:S})=>yt(S))||(m.get(`${u}:${b}:dst`)??[]).some(({edgeIdx:S})=>yt(S)):!1,"faceHasLabelNode"),Pt=f((u,b,S)=>b==="top"||b==="bottom"?{x:u.x+S,y:u.y}:{x:u.x,y:u.y+S},"applyPortOffset"),tt=f((u,b,S)=>{const L=O.get(u),w={x:S.x??0,y:S.y??0},k={x:b.x??0,y:b.y??0},W=L?.srcSide??R(b,w),q=L?.dstSide??R(S,k);let V=L?C(b,L.srcSide):h(b,w,!0),G=L?C(S,L.dstSide):h(S,k,!1);const st=Z.get(`${u}:src`),it=Z.get(`${u}:dst`);return st!==void 0&&(V=Pt(V,W,st)),it!==void 0&&(G=Pt(G,q,it)),{pSrcPort:V,pDstPort:G,srcSide:W,dstSide:q}},"portsForEdge");for(const u of T){const b=s[u];if(c[u]=[],!b.start||!b.end||b.points&&b.points.length>0||b.start===b.end)continue;const S=r.get(b.start),L=r.get(b.end);if(!S||!L)continue;const{pSrcPort:w,pDstPort:k,srcSide:W,dstSide:q}=tt(u,S,L),V={...w},G={...k},st=W==="top"||W==="bottom",it=q==="top"||q==="bottom";if(st){const Y=w.y>(S.y??0);V.y=Y?w.y+se:w.y-se}else{const Y=w.x>(S.x??0);V.x=Y?w.x+se:w.x-se}if(it){const Y=k.y>(L.y??0);G.y=Y?k.y+se:k.y-se}else{const Y=k.x>(L.x??0);G.x=Y?k.x+se:k.x-se}const rt=f((Y,$)=>{for(const J of g)if(!$.includes(J.nodeId)&&Y.x>J.minX&&Y.x<J.maxX&&Y.y>J.minY&&Y.y<J.maxY)return{inside:!0,obstacle:J};return{inside:!1}},"isPointInObstacle"),et=f((Y,$,J,ft,vt)=>{if(vt){const Nt=Y.y>($.y??0);return{x:(J.x??0)>=Y.x?ft.maxX+Se:ft.minX-Se,y:Nt?ft.maxY+Ne:ft.minY-Ne,leavesPositiveSide:Nt}}const Mt=Y.x>($.x??0),Rt=(J.y??0)>=Y.y;return{x:Mt?ft.maxX+Se:ft.minX-Se,y:Rt?ft.maxY+Ne:ft.minY-Ne,leavesPositiveSide:Mt}},"obstacleDetour");let xt=[];const Ot=[b.start,b.end],wt=rt(V,Ot);if(wt.inside&&wt.obstacle){const Y=wt.obstacle;if(st){const $=et(w,S,L,Y,!0);V.x=$.x,V.y=$.y;const J=$.leavesPositiveSide?Math.min(Y.minY-2,w.y+se):Math.max(Y.maxY+2,w.y-se);xt=[{x:w.x,y:J},{x:$.x,y:J},{x:$.x,y:$.y}]}else{const $=et(w,S,L,Y,!1),J=$.leavesPositiveSide?Math.min(Y.minX-2,w.x+se):Math.max(Y.maxX+2,w.x-se);V.x=$.x,V.y=$.y,xt=[{x:J,y:w.y},{x:J,y:$.y},{x:$.x,y:$.y}]}}let Ht=[];const Qt=rt(G,Ot);if(Qt.inside&&Qt.obstacle){const Y=Qt.obstacle;if(it){const $=et(k,L,S,Y,!0);G.x=$.x,G.y=$.y,Ht=[{x:$.x,y:$.y},{x:k.x,y:$.y}]}else{const $=et(k,L,S,Y,!1);G.x=$.x,G.y=$.y,Ht=[{x:$.x,y:$.y},{x:$.x,y:k.y}]}}if(xt.length===0&&Ht.length===0){const Y=Se,$=Math.abs(V.x-G.x)<Y,J=Math.abs(V.y-G.y)<Y,ft=Z.get(`${u}:src`)!==void 0||Z.get(`${u}:dst`)!==void 0,vt=(m.get(`${b.start??""}:${W}:src`)?.length??0)+(m.get(`${b.start??""}:${W}:dst`)?.length??0),Mt=(m.get(`${b.end??""}:${q}:src`)?.length??0)+(m.get(`${b.end??""}:${q}:dst`)?.length??0),Rt=vt>1||Mt>1,Nt=I.get(b.start??"")??0,gt=I.get(b.end??"")??0,Gt=vt>1&&Ft(b.start,W)||Mt>1&&Ft(b.end,q),oe=vt<=1||Nt<=2,kt=Mt<=1||gt<=2;if(($||J)&&!ft&&(!Rt||Rt&&!Gt&&oe&&kt)&&!E(w,k,b.start,b.end)){b.points=[{...w},{...V},{...G},{...k}],y.add(u);const It=J?"horizontal":"vertical",Vt=J?w.y:w.x,St=J?Math.min(w.x,k.x):Math.min(w.y,k.y),Ct=J?Math.max(w.x,k.x):Math.max(w.y,k.y),Jt={id:`fast-path-${It}-${Vt.toFixed(0)}-${u}`,orientation:It,coord:Vt,spanMin:St,spanMax:Ct,tracks:[]};p.push({edgeIndex:u,segmentIndex:0,orientation:It,pipe:Jt,trackIndex:0,from:St,to:Ct});continue}}const uo=x("vertical",V.x,V.y,V.y);V.x=uo.coord;const gr=x("vertical",G.x,G.y,G.y);G.x=gr.coord;let pe=Math.min(V.x,G.x)-50,me=Math.max(V.x,G.x)+50,Re=Math.min(V.y,G.y)-50,Ae=Math.max(V.y,G.y)+50;for(const Y of g){const $=Math.min(V.x,G.x),J=Math.max(V.x,G.x),ft=Math.min(V.y,G.y),vt=Math.max(V.y,G.y);Y.minX<J&&Y.maxX>$&&Y.minY<vt&&Y.maxY>ft&&(pe=Math.min(pe,Y.minX-cn),me=Math.max(me,Y.maxX+cn),Re=Math.min(Re,Y.minY-cn),Ae=Math.max(Ae,Y.maxY+cn))}for(const Y of g){if(Y.maxX<pe||Y.minX>me||Y.maxY<Re||Y.minY>Ae)continue;const $=Se;x("horizontal",Y.minY-$,pe,me),x("horizontal",Y.maxY+$,pe,me);const J=Ne;x("vertical",Y.minX-J,Re,Ae),x("vertical",Y.maxX+J,Re,Ae)}x("horizontal",V.y,pe,me),x("horizontal",G.y,pe,me);const pr=l.filter(Y=>Y.orientation==="horizontal"&&Y.coord>=Re&&Y.coord<=Ae),mr=l.filter(Y=>Y.orientation==="vertical"&&Y.coord>=pe&&Y.coord<=me),Je=f((Y,$)=>`${Y.toFixed(1)},${$.toFixed(1)}`,"getKey"),qe=Je(V.x,V.y),er=Je(G.x,G.y),Ze=new Map,ho=new Map,go=new Map,Qe=new Set,Ie=[];Ze.set(qe,0),go.set(qe,"n"),Ie.push({key:qe,f:Math.hypot(G.x-V.x,G.y-V.y),pt:V}),Qe.add(qe);let Xt=[];const ye=f((Y,$)=>E(Y,$,b.start,b.end),"checkSegmentBlocked"),po={x:G.x,y:V.y},yr=ye(V,po),xr=ye(po,G),br=yr||xr,mo={x:V.x,y:G.y},Mr=ye(V,mo),Ir=ye(mo,G);if(br?Mr||Ir||(Math.abs(V.x-G.x)<at?Xt=[V,G]:Xt=[V,mo,G]):Math.abs(V.y-G.y)<at||Math.abs(V.x-G.x)<at?Xt=[V,G]:Xt=[V,po,G],Xt.length===0)for(;Ie.length>0;){Ie.sort((gt,Gt)=>gt.f-Gt.f);const Y=Ie.shift();if(Qe.delete(Y.key),Y.key===er){let gt=er,Gt=G;for(Xt=[Gt];ho.has(gt);){const oe=ho.get(gt);Xt.unshift(oe),Gt=oe,gt=Je(oe.x,oe.y)}break}const $=Y.pt.x,J=Y.pt.y,ft=mr.sort((gt,Gt)=>gt.coord-Gt.coord),vt=ft.findIndex(gt=>Math.abs(gt.coord-$)<1),Mt=pr.sort((gt,Gt)=>gt.coord-Gt.coord),Rt=Mt.findIndex(gt=>Math.abs(gt.coord-J)<1),Nt=[];vt>0&&Nt.push({x:ft[vt-1].coord,y:J}),vt>=0&&vt<ft.length-1&&Nt.push({x:ft[vt+1].coord,y:J}),Rt>0&&Nt.push({x:$,y:Mt[Rt-1].coord}),Rt>=0&&Rt<Mt.length-1&&Nt.push({x:$,y:Mt[Rt+1].coord});for(const gt of Nt){const Gt=Math.min($,gt.x),oe=Math.max($,gt.x),kt=Math.min(J,gt.y),$t=Math.max(J,gt.y);if(g.some(te=>te.nodeId===b.start||te.nodeId===b.end?!1:Gt!==oe?te.minY<J&&te.maxY>J&&te.maxX>Gt&&te.minX<oe:te.minX<$&&te.maxX>$&&te.maxY>kt&&te.minY<$t))continue;const It=Je(gt.x,gt.y),Vt=Math.abs(gt.x-$)+Math.abs(gt.y-J),St=M(u,Y.pt,gt);let Ct=0;const Jt=G.x-V.x,Oe=G.y-V.y,tn=gt.x-$,yo=gt.y-J;(Oe>10&&yo<-5||Oe<-10&&yo>5)&&(Ct=Math.abs(yo)*100),(Jt>10&&tn<-5||Jt<-10&&tn>5)&&(Ct+=Math.abs(tn)*50);let nr=0;const or=go.get(Y.key)??"n",sr=Math.abs(tn)>at?"h":"v";or!=="n"&&or!==sr&&(nr=50);const Sr=Vt+St+Ct+nr,en=(Ze.get(Y.key)??1/0)+Sr,rr=Math.abs(G.x-gt.x)+Math.abs(G.y-gt.y);if(en<(Ze.get(It)??1/0))if(ho.set(It,Y.pt),Ze.set(It,en),go.set(It,sr),!Qe.has(It))Ie.push({key:It,f:en+rr,pt:gt}),Qe.add(It);else{const te=Ie.findIndex(Cr=>Cr.key===It);te!==-1&&(Ie[te].f=en+rr)}}}if(Xt.length===0&&(Xt=[V,{x:V.x,y:G.y},G]),Xt.length>4){const Y=Xt[0],$=Xt[Xt.length-1];let J=Math.min(Y.x,$.x),ft=Math.max(Y.x,$.x),vt=Math.min(Y.y,$.y),Mt=Math.max(Y.y,$.y);for(const kt of Xt)J=Math.min(J,kt.x),ft=Math.max(ft,kt.x),vt=Math.min(vt,kt.y),Mt=Math.max(Mt,kt.y);const Rt=ft>Math.max(Y.x,$.x),Nt=J<Math.min(Y.x,$.x);if(d){const kt=Ne;if(Rt){const $t=Math.max(Y.x,$.x),Bt=Math.min(Y.y,$.y),It=Math.max(Y.y,$.y),Vt=g.filter(St=>St.minX<$t&&St.maxX>$t&&St.minY<It&&St.maxY>Bt);if(Vt.length>0){let St=Math.max(Y.x,$.x);for(const Ct of Vt){const Jt=(Ct.minX+Ct.maxX)/2;if(Ct.visualXHalfExtent===void 0||isNaN(Ct.visualXHalfExtent))continue;const Oe=Jt+Ct.visualXHalfExtent+kt;St=Math.max(St,Oe)}isNaN(St)||(ft=St)}}if(Nt){const $t=g.filter(Bt=>Bt.minX<Math.min(Y.x,$.x)+kt&&Bt.minY<Math.max(Y.y,$.y)&&Bt.maxY>Math.min(Y.y,$.y));if($t.length>0){let Bt=Math.min(Y.x,$.x);for(const It of $t){const St=(It.minX+It.maxX)/2-It.visualXHalfExtent-kt;Bt=Math.min(Bt,St)}J=Bt}}}const gt=f(kt=>{const $t=$.y>Y.y,Bt=g.filter(St=>{const Ct=Math.min(Y.x,$.x)<St.maxX&&Math.max(Y.x,$.x)>St.minX,Jt=Math.min(Y.y,$.y)<St.maxY&&Math.max(Y.y,$.y)>St.minY;return Ct&&Jt});let It=Bt;if(d&&Bt.length>0){const St=Bt.filter(Ct=>Ct.minX<kt&&Ct.maxX>kt);St.length>0&&(It=St)}if(It.length===0)return $.y;const Vt=Se;if($t){const Ct=Math.max(...It.map(Jt=>Jt.maxY))+Vt;if(Ct<$.y-at)return Ct}else{const Ct=Math.min(...It.map(Jt=>Jt.minY))-Vt;if(Ct>$.y+at)return Ct}return $.y},"findBestReturnY"),Gt=f(kt=>{const $t=gt(kt),Bt={x:kt,y:Y.y},It={x:kt,y:$t},Vt={x:$.x,y:$t},St=ye(Y,Bt),Ct=ye(Bt,It),Jt=ye(It,Vt),Oe=$t!==$.y?ye(Vt,$):!1;return!St&&!Ct&&!Jt&&!Oe?Math.abs($t-$.y)<at?[Y,Bt,It,$]:[Y,Bt,It,Vt,$]:null},"trySimplifyWithDetourX"),oe=Rt&&!Nt?Gt(ft):Nt&&!Rt?Gt(J):null;oe&&(Xt=oe)}const Yt=[w,...xt,...Xt,...Ht.reverse(),k];if(Yt.length>=3){const Y=Yt[Yt.length-1],$=Yt[Yt.length-2],J=Yt[Yt.length-3],ft=Math.abs(J.y-$.y)<at&&Math.abs($.y-Y.y)<at,vt=Math.abs(J.x-$.x)<at&&Math.abs($.x-Y.x)<at;if(ft){const Mt=Math.sign($.x-J.x),Rt=Math.sign(Y.x-J.x);Mt!==0&&Mt===Rt&&Math.abs($.x-J.x)>Math.abs(Y.x-J.x)&&Yt.splice(-2,1)}else if(vt){const Mt=Math.sign($.y-J.y),Rt=Math.sign(Y.y-J.y);Mt!==0&&Mt===Rt&&Math.abs($.y-J.y)>Math.abs(Y.y-J.y)&&Yt.splice(-2,1)}}const le=[Yt[0]];for(let Y=1;Y<Yt.length-1;Y++){if(Y===1){le.push(Yt[Y]);continue}const $=le[le.length-1],J=Yt[Y],ft=Yt[Y+1];if(Math.abs($.y-J.y)<at&&Math.abs(J.y-ft.y)<at){const vt=J.x>$.x,Mt=ft.x>J.x;if(vt!==Mt){le.push(J);continue}continue}if(Math.abs($.x-J.x)<at&&Math.abs(J.x-ft.x)<at){const vt=J.y>$.y,Mt=ft.y>J.y;if(vt!==Mt){le.push(J);continue}continue}le.push(J)}le.push(Yt[Yt.length-1]);for(let Y=0;Y<le.length-1;Y++){const $=le[Y],J=le[Y+1],ft=Math.abs($.x-J.x)<at?"vertical":"horizontal",vt=ft==="vertical"?$.x:$.y,Mt=ft==="vertical"?Math.min($.y,J.y):Math.min($.x,J.x),Rt=ft==="vertical"?Math.max($.y,J.y):Math.max($.x,J.x),Nt=x(ft,vt,Mt,Rt),gt={edgeIndex:u,segmentIndex:Y,orientation:ft,pipe:Nt,trackIndex:0,from:Mt,to:Rt};p.push(gt),c[u].push(p.length-1),Nt.tracks[0]||(Nt.tracks[0]={index:0,coord:Nt.coord,segments:[]}),Nt.tracks[0].segments.push({edgeIndex:u,segmentIndex:Y,from:Mt,to:Rt})}}const K=f((u,b)=>u.from<b.to&&b.from<u.to,"segmentsOverlap"),nt=f((u,b,S,L)=>{const w=!L.segments.some(W=>(W.edgeIndex!==b.edgeIndex||W.segmentIndex!==b.segmentIndex)&&K(W,u)),k=!S.segments.some(W=>(W.edgeIndex!==u.edgeIndex||W.segmentIndex!==u.segmentIndex)&&K(W,b));return w&&k?(u.trackIndex=L.index,b.trackIndex=S.index,S.segments=[...S.segments.filter(W=>W.edgeIndex!==u.edgeIndex||W.segmentIndex!==u.segmentIndex),{edgeIndex:b.edgeIndex,segmentIndex:b.segmentIndex,from:b.from,to:b.to}],L.segments=[...L.segments.filter(W=>W.edgeIndex!==b.edgeIndex||W.segmentIndex!==b.segmentIndex),{edgeIndex:u.edgeIndex,segmentIndex:u.segmentIndex,from:u.from,to:u.to}],!0):!1},"trySwapSegmentsAcrossTracks"),lt=f(u=>{const b=u.tracks.length;return u.tracks[b]={index:b,coord:u.coord,segments:[]},b},"createNewTrack"),pt=f((u,b)=>{const S=u.pipe.tracks[u.trackIndex];S.segments=S.segments.filter(w=>w.edgeIndex!==u.edgeIndex||w.segmentIndex!==u.segmentIndex),u.trackIndex=b,u.pipe.tracks[b].segments.push({edgeIndex:u.edgeIndex,segmentIndex:u.segmentIndex,from:u.from,to:u.to})},"moveSegmentToTrack"),bt=f((u,b)=>{const S=c[u.edgeIndex];for(const L of S){const w=p[L];w.pipe===u.pipe&&pt(w,b)}},"moveSegmentChainToTrack"),Lt=f(u=>{const b=c[u.edgeIndex],S=b.indexOf(p.indexOf(u)),L=[];return S>0&&L.push(p[b[S-1]]),S<b.length-1&&L.push(p[b[S+1]]),L},"getAdjacentSegmentsAlongEdge"),Ut=f((u,b)=>{if(u.orientation===b.orientation)return!1;const S=u.orientation==="horizontal"?u:b,L=u.orientation==="horizontal"?b:u;return L.pipe.coord>S.from&&L.pipe.coord<S.to&&S.pipe.coord>L.from&&S.pipe.coord<L.to},"haveAnyCrossing"),Wt=f((u,b)=>{for(const S of u.tracks)if(!S.segments.some(w=>(w.edgeIndex!==b.edgeIndex||w.segmentIndex!==b.segmentIndex)&&K(w,b)))return S.index;return-1},"findAvailableTrack"),Kt=f((u,b)=>{if(u.trackIndex===b.trackIndex)return K(u,b);const S=Lt(u),L=Lt(b);return S.some(w=>L.some(k=>Ut(w,k)))},"segmentsConflict"),ne=f((u,b,S)=>{if(nt(u,b,u.pipe.tracks[u.trackIndex],b.pipe.tracks[b.trackIndex]))return;const L=Wt(u.pipe,b);S(b,L!==-1?L:lt(u.pipe))},"resolveTrackConflict"),Ee=f(u=>{let b=0;for(let S=0;S<u.length;S++)for(let L=S+1;L<u.length;L++){const w=u[S],k=u[L];w.pipe===k.pipe&&Kt(w,k)&&(b++,ne(w,k,bt))}return b},"resolveHandleConflicts"),ge=new Map,we=f(u=>{if(ge.has(u))return ge.get(u);const b=c[u];if(b.length===0){const q={dest:0,deviation:0,base:0,delta:0};return ge.set(u,q),q}const L=p[b[0]].pipe.coord;let w=L;for(let q=1;q<b.length;q++){const V=p[b[q]];if(V.orientation==="horizontal"){const G=V.from,st=V.to;w=Math.abs(G-L)>Math.abs(st-L)?G:st;break}}const k=Math.abs(w-L),W={dest:w,deviation:k,base:L,delta:w-L};return ge.set(u,W),W},"getDestInfo"),ao=f(()=>{let u=0;const b=new Map;for(const[L,w]of s.entries())c[L].length!==0&&w.start&&(b.has(w.start)||b.set(w.start,[]),b.get(w.start).push(L));const S=f(L=>{const w=s[L];if(!w.start||!w.end)return 0;const k=r.get(w.start),W=r.get(w.end);if(!k||!W)return 0;const q=(W.x??0)-(k.x??0),V=(W.y??0)-(k.y??0);return Math.abs(q)+Math.abs(V)},"getEdgeDistance");for(const L of b.values()){L.sort((k,W)=>{const q=we(k),V=we(W);if(Math.abs(q.deviation-V.deviation)>1)return q.deviation-V.deviation;if(Math.abs(q.dest-V.dest)>1)return q.dest-V.dest;const G=S(k),st=S(W);if(Math.abs(G-st)>1)return st-G;const it=c[k].length,rt=c[W].length;if(it!==rt)return it-rt;if(it===1){const et=c[k][0],xt=c[W][0];if(p[et]&&p[xt]){const Ot=p[et],wt=p[xt],Ht=Math.abs(Ot.to-Ot.from),Qt=Math.abs(wt.to-wt.from);if(Math.abs(Ht-Qt)>1)return Ht-Qt}}return 0});const w=L.map(k=>p[c[k][0]]);u+=Ee(w)}return u},"fixSourceHandleCrossings"),lo=f(()=>{let u=0;const b=new Map;for(const[S,L]of s.entries())c[S].length!==0&&L.end&&(b.has(L.end)||b.set(L.end,[]),b.get(L.end).push(S));for(const S of b.values()){S.sort((w,k)=>{const W=f(G=>{const st=c[G];if(st.length<2)return 0;const it=p[st[st.length-2]];return Math.abs(it.to-it.from)},"getDist"),q=W(w),V=W(k);return Math.abs(q-V)>.1?q-V:w-k});const L=S.map(w=>p[c[w][c[w].length-1]]);u+=Ee(L)}return u},"fixTargetHandleCrossings"),fo=f(()=>{let u=0;for(const b of l){const S=[];for(const L of b.tracks)for(const w of L.segments){const k=c[w.edgeIndex].find(W=>p[W].segmentIndex===w.segmentIndex);k!==void 0&&S.push(p[k])}S.sort((L,w)=>L.edgeIndex-w.edgeIndex||L.segmentIndex-w.segmentIndex);for(let L=0;L<S.length;L++)for(let w=L+1;w<S.length;w++){const k=S[L],W=S[w];Kt(k,W)&&(u++,ne(k,W,pt))}}return u},"fixPipeCrossings");let N=0;const D=10;for(;N<D;){let u=0;if(u+=ao(),u+=lo(),u+=fo(),u===0)break;N++}const H=new Map;for(const u of l){const b=[];u.tracks.forEach(L=>{L.segments.forEach(w=>{b.push({edgeIndex:w.edgeIndex,segmentIndex:w.segmentIndex,trackIndex:L.index,from:w.from,to:w.to})})}),b.sort((L,w)=>L.from-w.from);const S=[];if(b.length>0){let L=[b[0]],w=b[0].to;for(let k=1;k<b.length;k++){const W=b[k];W.from<w?(L.push(W),w=Math.max(w,W.to)):(S.push(L),L=[W],w=W.to)}S.push(L)}for(const L of S){const w=new Set;L.forEach(et=>w.add(et.trackIndex));const k=new Map;L.forEach(et=>{const xt=we(et.edgeIndex);k.set(et.trackIndex,(k.get(et.trackIndex)??0)+xt.delta)});const W=[...w].filter(et=>(k.get(et)??0)<-1),q=[...w].filter(et=>(k.get(et)??0)>1),V=[...w].filter(et=>Math.abs(k.get(et)??0)<=1);W.sort((et,xt)=>(k.get(xt)??0)-(k.get(et)??0)),q.sort((et,xt)=>(k.get(et)??0)-(k.get(xt)??0));const G=f((et,xt)=>{L.filter(Ot=>Ot.trackIndex===et).forEach(Ot=>{const wt=y.has(Ot.edgeIndex)?u.coord:xt;H.set(`${Ot.edgeIndex}-${Ot.segmentIndex}`,wt)})},"assignCoord");let st=0;for(const et of W)st++,G(et,u.coord-st*Io);if(V.length===0&&w.size>0){const et=[...w].sort((wt,Ht)=>Math.abs(k.get(wt)??0)-Math.abs(k.get(Ht)??0))[0],xt=W.indexOf(et);xt!==-1&&W.splice(xt,1);const Ot=q.indexOf(et);Ot!==-1&&q.splice(Ot,1),V.push(et)}let it=0;for(const et of V){if(it===0)G(et,u.coord);else{const xt=it%2===1?1:-1,Ot=Math.ceil(it/2);G(et,u.coord+xt*Ot*Io*.5)}it++}let rt=0;for(const et of q)rt++,G(et,u.coord+rt*Io)}}for(const[u,b]of s.entries()){const S=c[u]??[];if(S.length===0)continue;const L=[],w=r.get(b.start),k=r.get(b.end),{pSrcPort:W,pDstPort:q}=tt(u,w,k),V=S.map(it=>{const rt=p[it],et=H.get(`${rt.edgeIndex}-${rt.segmentIndex}`)??rt.pipe.coord;return{orient:rt.orientation,coord:et,from:rt.from,to:rt.to}});L.push(W);for(let it=0;it<V.length;it++){const rt=V[it],et=L[L.length-1],xt=rt.orient==="vertical"?et.y:et.x,Ot=rt.orient==="vertical"?et.x:et.y,wt=V[it+1],Ht=it<V.length-1;if(Math.abs(Ot-rt.coord)>at&&L.push(be(rt,xt)),Ht&&wt.orient===rt.orient)if(Math.abs(rt.coord-wt.coord)>at){const Qt=rt.orient==="vertical"?(xt+wt.from)/2:Yn(rt,wt);L.push(be(rt,Qt),be(wt,Qt))}else(it===0||it===V.length-2)&&L.push(be(rt,Yn(rt,wt)));else if(Ht)L.push(be(rt,wt.coord));else{const Qt=Math.abs(rt.from-xt)<Math.abs(rt.to-xt)?rt.to:rt.from;L.push(be(rt,Qt))}}const G=L[L.length-1];(Math.abs(G.x-q.x)>at||Math.abs(G.y-q.y)>at)&&L.push(q);const st=[];L.length>0&&st.push(L[0]);for(let it=1;it<L.length;it++){const rt=L[it],et=st[st.length-1];(Math.abs(rt.x-et.x)>at||Math.abs(rt.y-et.y)>at)&&st.push(rt)}b.points=st}for(const u of s){const b=u.__originalEdge;b&&u.points&&(b.points=u.points)}t.edges=(t.edges??[]).filter(u=>!u.isLayoutOnly);const j=f((u,b)=>{const S=b.x??0,L=b.y??0,w=b.width??0,k=b.height??0;if(w<=0||k<=0)return u;const W=S-w/2,q=S+w/2,V=L-k/2,G=L+k/2;if(u.x<W||u.x>q||u.y<V||u.y>G)return u;const st=u.x-W,it=q-u.x,rt=u.y-V,et=G-u.y,xt=Math.min(st,it,rt,et);return xt===st?{x:W,y:u.y}:xt===it?{x:q,y:u.y}:xt===rt?{x:u.x,y:V}:{x:u.x,y:G}},"nodeBoundaryClamp");for(const u of t.edges){const b=u.points;if(!b||b.length<2)continue;const S=u.start,L=u.end,w=S?r.get(S):void 0,k=L?r.get(L):void 0;w&&(b[0]=j(b[0],w)),k&&(b[b.length-1]=j(b[b.length-1],k))}return t}A(qs,"routeEdgesOrthogonal");f(qs,"routeEdgesOrthogonal");function Zs(t){return t.direction??"TB"}A(Zs,"getSwimlaneDirection");f(Zs,"getSwimlaneDirection");function Qs(t){const e=Fo(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,s=t.config.swimlane?.ignoreCrossLaneEdges??!0,r=t.config.swimlane?.optimizeRanksByCrossings??!0,a=t.config.swimlane?.automaticLaneOrdering??!1,l=Zs(t),{ordered:d,coordinates:i}=Js(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:a,direction:l});_o(e,d,i,{nodeGap:n,layerGap:o});for(const g of t.edges??[])delete g.points;qs(t,l);for(const g of t.edges??[])(!g.curve||g.curve==="basis")&&(g.curve="rounded");return ps(t,l),gs(t),l}A(Qs,"runSwimlaneLayoutCore");f(Qs,"runSwimlaneLayoutCore");function tr(t){ko(t);const e=Do(t);t.nodes=e.nodes,t.edges=e.edges}A(tr,"prepareSwimlaneLayout");f(tr,"prepareSwimlaneLayout");var Hr=vr({prepareLayout:tr,runLayoutCore:Qs,afterPaint:Bo});export{Hr as render};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{aF as me,K as ye,O as le,aI as be,L as Ae,aG as Ce,a as n,ad as ce,aE as we,r as Se,k as Re,M as Bt,aD as _e,j as ge,y as ke,U as Te,q as De}from"./CSbiiZpm.js";import{g as r,bz as ae}from"./CxRm1vYn.js";import{b as ne}from"./CyfBUrNA.js";import{l as oe}from"./DJ52BT20.js";var It=(function(){var i=n(function(F,l,u,x){for(u=u||{},x=F.length;x--;u[F[x]]=l);return u},"o"),t=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],h=[1,6],c=[1,7],b=[1,5,10,12,14,16,18,19,21,23,36,37,38],f=[1,25],m=[1,26],k=[1,28],T=[1,29],L=[1,30],W=[1,31],X=[1,32],E=[1,33],M=[1,34],A=[1,35],D=[1,36],g=[1,37],B=[1,43],V=[1,42],Y=[1,47],N=[1,50],R=[1,10,12,14,16,18,19,21,23,36,37,38],U=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],C=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],z=[26,28],_={trace:n(r(function(){},"trace"),"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(r(function(l,u,x,d,S,o,ct){var p=o.length-1;switch(S){case 5:d.setOrientation(o[p]);break;case 9:d.setDiagramTitle(o[p].text.trim());break;case 12:d.setLineData({text:"",type:"text"},o[p]);break;case 13:d.setLineData(o[p-1],o[p]);break;case 14:d.setBarData({text:"",type:"text"},o[p]);break;case 15:d.setBarData(o[p-1],o[p]);break;case 16:this.$=o[p].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=o[p].trim(),d.setAccDescription(this.$);break;case 19:this.$=o[p-1];break;case 20:case 30:this.$=[o[p-2],...o[p]];break;case 21:case 31:this.$=[o[p]];break;case 22:this.$={value:Number(o[p-1]),label:o[p]};break;case 23:this.$={value:Number(o[p]),label:""};break;case 24:d.setXAxisTitle(o[p]);break;case 25:d.setXAxisTitle(o[p-1]);break;case 26:d.setXAxisTitle({type:"text",text:""});break;case 27:d.setXAxisBand(o[p]);break;case 28:d.setXAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 29:this.$=o[p-1];break;case 32:d.setYAxisTitle(o[p]);break;case 33:d.setYAxisTitle(o[p-1]);break;case 34:d.setYAxisTitle({type:"text",text:""});break;case 35:d.setYAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 39:this.$={text:o[p],type:"text"};break;case 40:this.$={text:o[p],type:"text"};break;case 41:this.$={text:o[p],type:"markdown"};break;case 42:this.$=o[p];break;case 43:this.$=o[p-1]+""+o[p];break}},"anonymous"),"anonymous"),table:[i(t,e,{3:1,4:2,7:4,5:s,36:a,37:h,38:c}),{1:[3]},i(t,e,{4:2,7:4,3:8,5:s,36:a,37:h,38:c}),i(t,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:h,38:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},i(b,[2,36]),i(b,[2,37]),i(b,[2,38]),{1:[2,1]},i(t,e,{4:2,7:4,3:21,5:s,36:a,37:h,38:c}),{1:[2,3]},i(b,[2,5]),i(t,[2,7],{4:22,36:a,37:h,38:c}),{11:23,30:f,39:24,40:m,41:27,42:k,43:T,44:L,45:W,46:X,47:E,48:M,49:A,50:D,51:g},{11:39,13:38,24:B,29:V,30:f,31:40,32:41,39:24,40:m,41:27,42:k,43:T,44:L,45:W,46:X,47:E,48:M,49:A,50:D,51:g},{11:45,15:44,29:Y,30:f,35:46,39:24,40:m,41:27,42:k,43:T,44:L,45:W,46:X,47:E,48:M,49:A,50:D,51:g},{11:49,17:48,24:N,30:f,39:24,40:m,41:27,42:k,43:T,44:L,45:W,46:X,47:E,48:M,49:A,50:D,51:g},{11:52,17:51,24:N,30:f,39:24,40:m,41:27,42:k,43:T,44:L,45:W,46:X,47:E,48:M,49:A,50:D,51:g},{20:[1,53]},{22:[1,54]},i(R,[2,18]),{1:[2,2]},i(R,[2,8]),i(R,[2,9]),i(U,[2,39],{41:55,42:k,43:T,44:L,45:W,46:X,47:E,48:M,49:A,50:D,51:g}),i(U,[2,40]),i(U,[2,41]),i(C,[2,42]),i(C,[2,44]),i(C,[2,45]),i(C,[2,46]),i(C,[2,47]),i(C,[2,48]),i(C,[2,49]),i(C,[2,50]),i(C,[2,51]),i(C,[2,52]),i(C,[2,53]),i(R,[2,10]),i(R,[2,24],{32:41,31:56,24:B,29:V}),i(R,[2,26]),i(R,[2,27]),{33:[1,57]},{11:59,30:f,34:58,39:24,40:m,41:27,42:k,43:T,44:L,45:W,46:X,47:E,48:M,49:A,50:D,51:g},i(R,[2,11]),i(R,[2,32],{35:60,29:Y}),i(R,[2,34]),{33:[1,61]},i(R,[2,12]),{17:62,24:N},{25:63,27:64,29:w},i(R,[2,14]),{17:66,24:N},i(R,[2,16]),i(R,[2,17]),i(C,[2,43]),i(R,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},i(R,[2,33]),{29:[1,70]},i(R,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},i(z,[2,23],{30:[1,73]}),i(R,[2,15]),i(R,[2,28]),i(R,[2,29]),{11:59,30:f,34:74,39:24,40:m,41:27,42:k,43:T,44:L,45:W,46:X,47:E,48:M,49:A,50:D,51:g},i(R,[2,35]),i(R,[2,19]),{25:75,27:64,29:w},i(z,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(r(function(l,u){if(u.recoverable)this.trace(l);else{var x=new Error(l);throw x.hash=u,x}},"parseError"),"parseError"),parse:n(r(function(l){var u=this,x=[0],d=[],S=[null],o=[],ct=this.table,p="",pt=0,te=0,de=2,ee=1,fe=o.slice.call(arguments,1),P=Object.create(this.lexer),q={yy:{}};for(var Dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Dt)&&(q.yy[Dt]=this.yy[Dt]);P.setInput(l,q.yy),q.yy.lexer=P,q.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var Pt=P.yylloc;o.push(Pt);var pe=P.options&&P.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(I){x.length=x.length-2*I,S.length=S.length-I,o.length=o.length-I}r(ie,"popStack"),n(ie,"popStack");function Lt(){var I;return I=d.pop()||P.lex()||ee,typeof I!="number"&&(I instanceof Array&&(d=I,I=d.pop()),I=u.symbols_[I]||I),I}r(Lt,"lex"),n(Lt,"lex");for(var v,j,O,vt,rt={},mt,H,se,yt;;){if(j=x[x.length-1],this.defaultActions[j]?O=this.defaultActions[j]:((v===null||typeof v>"u")&&(v=Lt()),O=ct[j]&&ct[j][v]),typeof O>"u"||!O.length||!O[0]){var Et="";yt=[];for(mt in ct[j])this.terminals_[mt]&&mt>de&&yt.push("'"+this.terminals_[mt]+"'");P.showPosition?Et="Parse error on line "+(pt+1)+`:
|
|
2
|
-
`+P.showPosition()+`
|
|
3
|
-
Expecting `+yt.join(", ")+", got '"+(this.terminals_[v]||v)+"'":Et="Parse error on line "+(pt+1)+": Unexpected "+(v==ee?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(Et,{text:P.match,token:this.terminals_[v]||v,line:P.yylineno,loc:Pt,expected:yt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+j+", token: "+v);switch(O[0]){case 1:x.push(v),S.push(P.yytext),o.push(P.yylloc),x.push(O[1]),v=null,te=P.yyleng,p=P.yytext,pt=P.yylineno,Pt=P.yylloc;break;case 2:if(H=this.productions_[O[1]][1],rt.$=S[S.length-H],rt._$={first_line:o[o.length-(H||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(H||1)].first_column,last_column:o[o.length-1].last_column},pe&&(rt._$.range=[o[o.length-(H||1)].range[0],o[o.length-1].range[1]]),vt=this.performAction.apply(rt,[p,te,pt,q.yy,O[1],S,o].concat(fe)),typeof vt<"u")return vt;H&&(x=x.slice(0,-1*H*2),S=S.slice(0,-1*H),o=o.slice(0,-1*H)),x.push(this.productions_[O[1]][0]),S.push(rt.$),o.push(rt._$),se=ct[x[x.length-2]][x[x.length-1]],x.push(se);break;case 3:return!0}}return!0},"parse"),"parse")},lt=(function(){var F={EOF:1,parseError:n(r(function(u,x){if(this.yy.parser)this.yy.parser.parseError(u,x);else throw new Error(u)},"parseError"),"parseError"),setInput:n(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:n(function(l){var u=l.length,x=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===d.length?this.yylloc.first_column:0)+d[d.length-x.length].length-x[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(l){this.unput(this.match.slice(l))},"less"),pastInput:n(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
|
|
5
|
-
`+u+"^"},"showPosition"),test_match:n(function(l,u){var x,d,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],x=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var o in S)this[o]=S[o];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,x,d;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),o=0;o<S.length;o++)if(x=this._input.match(this.rules[S[o]]),x&&(!u||x[0].length>u[0].length)){if(u=x,d=o,this.options.backtrack_lexer){if(l=this.test_match(x,S[o]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,S[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(r(function(){var u=this.next();return u||this.lex()},"lex"),"lex"),begin:n(r(function(u){this.conditionStack.push(u)},"begin"),"begin"),popState:n(r(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),"popState"),_currentRules:n(r(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),"_currentRules"),topState:n(r(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),"topState"),pushState:n(r(function(u){this.begin(u)},"pushState"),"pushState"),stateStackSize:n(r(function(){return this.conditionStack.length},"stateStackSize"),"stateStackSize"),options:{"case-insensitive":!0},performAction:n(r(function(u,x,d,S){switch(d){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return F})();_.lexer=lt;function G(){this.yy={}}return r(G,"Parser"),n(G,"Parser"),G.prototype=_,_.Parser=G,new G})();It.parser=It;var Pe=It;function gt(i){return i.type==="bar"}r(gt,"isBarPlot");n(gt,"isBarPlot");function ut(i){return i.type==="band"}r(ut,"isBandAxisData");n(ut,"isBandAxisData");function K(i){return i.type==="linear"}r(K,"isLinearAxisData");n(K,"isLinearAxisData");var Q,zt=(Q=class{constructor(t){this.parentGroup=t}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce((h,c)=>Math.max(c.length,h),0)*e,height:e};const s={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const h of t){const c=De(a,1,h),b=c?c.width:h.length*e,f=c?c.height:e;s.width=Math.max(s.width,b),s.height=Math.max(s.height,f)}return a.remove(),s}},r(Q,"TextDimensionCalculatorWithFont"),n(Q,"TextDimensionCalculatorWithFont"),Q),he=.7,re=.2,Z,ue=(Z=class{constructor(t,e,s,a){this.axisConfig=t,this.title=e,this.textDimensionCalculator=s,this.axisThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){he*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(he*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let e=t.height;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=re*t.width;this.outerPadding=Math.min(s.width/2,a);let h=s.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(h=Math.max(h,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height))),h+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,h<=e&&(e-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=e&&(e-=a,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-e}calculateSpaceIfDrawnVertical(t){let e=t.width;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=re*t.height;this.outerPadding=Math.min(s.height/2,a);const h=s.width+this.axisConfig.labelPadding*2;h<=e&&(e-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=e&&(e-=a,this.showTitle=!0)}this.boundingRect.width=t.width-e,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const e=this.normalizedLabelRotationInRad;return e===0?0:Math.sin(e)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${e},${this.boundingRect.y} L ${e},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const e=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${e},${this.getScaleValue(s)} L ${e-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const e=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${e} L ${this.getScaleValue(s)},${e+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const e=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${e+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},r(Z,"BaseAxis"),n(Z,"BaseAxis"),Z),J,Le=(J=class extends ue{constructor(t,e,s,a,h){super(t,a,h,e),this.categories=s,this.scale=ne().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=ne().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ce.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},r(J,"BandAxis"),n(J,"BandAxis"),J),tt,ve=(tt=class extends ue{constructor(t,e,s,a,h){super(t,a,h,e),this.domain=s,this.scale=oe().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=oe().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},r(tt,"LinearAxis"),n(tt,"LinearAxis"),tt);function bt(i,t,e,s){const a=new zt(s);return ut(i)?new Le(t,e,i.categories,i.title,a):new ve(t,e,[i.min,i.max],i.title,a)}r(bt,"getAxis");n(bt,"getAxis");var et,Ee=(et=class{constructor(t,e,s,a){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=s,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const e=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(e.width,t.width),a=e.height+2*this.chartConfig.titlePadding;return e.width<=s&&e.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=a,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},r(et,"ChartTitle"),n(et,"ChartTitle"),et);function Ot(i,t,e,s){const a=new zt(s);return new Ee(a,i,t,e)}r(Ot,"getChartTitleComponent");n(Ot,"getChartTitleComponent");var Ie=.75,Me=.5,Be=.35;function At(i){return{fontSize:i,markerSize:i*Ie,markerSpacing:i*Be,itemSpacing:i*Me}}r(At,"getLegendLayout");n(At,"getLegendLayout");var it,ze=(it=class{constructor(t,e,s,a){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=s,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(m=>m.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};const{fontSize:e,markerSize:s,markerSpacing:a,itemSpacing:h}=At(this.chartConfig.legendFontSize),c=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(m=>m.title),e),b=this.chartConfig.legendPadding*2+s+a+c.width,f=this.chartConfig.legendPadding*2+this.visiblePlots.length*e+(this.visiblePlots.length-1)*h;return b<=t.width&&f<=t.height?(this.boundingRect.width=b,this.boundingRect.height=f):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];const{fontSize:t,markerSize:e,markerSpacing:s,itemSpacing:a}=At(this.chartConfig.legendFontSize),h=t+a,c=this.boundingRect.x+this.chartConfig.legendPadding,b=this.boundingRect.y+this.chartConfig.legendPadding,f=[],m=[];for(const[k,T]of this.visiblePlots.entries())if(gt(T))f.push({x:c,y:b+k*h,width:e,height:e,fill:T.fill,strokeFill:T.fill,strokeWidth:0});else{const L=b+k*h+e/2;m.push({path:`M ${c},${L} L ${c+e},${L}`,strokeFill:T.strokeFill,strokeWidth:T.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:f},{groupTexts:["legend","markers"],type:"path",data:m},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((k,T)=>({text:k.title,x:c+e+s,y:b+T*h+e/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}},r(it,"ChartLegend"),n(it,"ChartLegend"),it);function Vt(i,t,e,s){const a=new zt(s);return new ze(a,i,t,e)}r(Vt,"getChartLegendComponent");n(Vt,"getChartLegendComponent");var st,Oe=(st=class{constructor(t,e,s,a,h){this.plotData=t,this.xAxis=e,this.yAxis=s,this.orientation=a,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]);let e;if(this.orientation==="horizontal"?e=ae().y(a=>a[0]).x(a=>a[1])(t):e=ae().x(a=>a[0]).y(a=>a[1])(t),!e)return[];const s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const c=[];for(const[b,[f,m]]of t.entries()){const k=this.plotData.pointLabels[b];k&&(this.orientation==="horizontal"?c.push({x:m+10,y:f,text:k,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):c.push({x:f,y:m-10,text:k,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}c.length>0&&s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:c})}return s}},r(st,"LinePlot"),n(st,"LinePlot"),st),at,Ve=(at=class{constructor(t,e,s,a,h,c){this.barData=t,this.boundingRect=e,this.xAxis=s,this.yAxis=a,this.orientation=h,this.plotIndex=c}getDrawableElement(){const t=this.barData.data.map(h=>[this.xAxis.getScaleValue(h[0]),this.yAxis.getScaleValue(h[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(h=>({x:this.boundingRect.x,y:h[0]-a,height:s,width:h[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(h=>({x:h[0]-a,y:h[1],width:s,height:this.boundingRect.y+this.boundingRect.height-h[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},r(at,"BarPlot"),n(at,"BarPlot"),at),nt,Fe=(nt=class{constructor(t,e,s){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,e){this.xAxis=t,this.yAxis=e}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[e,s]of this.chartData.plots.entries())switch(s.type){case"line":{const a=new Oe(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...a.getDrawableElement())}break;case"bar":{const a=new Ve(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...a.getDrawableElement())}break}return t}},r(nt,"BasePlot"),n(nt,"BasePlot"),nt);function Ft(i,t,e){return new Fe(i,t,e)}r(Ft,"getPlotComponent");n(Ft,"getPlotComponent");var ot,We=(ot=class{constructor(t,e,s,a){this.chartConfig=t,this.chartData=e,this.componentStore={title:Ot(t,e,s,a),plot:Ft(t,e,s),legend:Vt(t,e,s,a),xAxis:bt(e.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},a),yAxis:bt(e.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,s=0,a=0,h={width:0,height:0},c=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),b=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:b});t-=f.width,e-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),a=f.height,e-=f.height,this.componentStore.xAxis.setAxisPosition("bottom"),f=this.componentStore.xAxis.calculateSpace({width:t,height:e}),e-=f.height,this.componentStore.yAxis.setAxisPosition("left"),f=this.componentStore.yAxis.calculateSpace({width:t,height:e}),s=f.width,t-=f.width,h=this.componentStore.legend.calculateSpace({width:t,height:b}),t-=h.width,t>0&&(c+=t,t=0),e>0&&(b+=e,e=0),this.componentStore.plot.calculateSpace({width:c,height:b}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.legend.setBoundingBoxXY({x:s+c,y:a+Math.max((b-h.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:a+b}),this.componentStore.yAxis.setRange([a,a+b]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(m=>gt(m))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,s=0,a=0,h=0,c={width:0,height:0},b=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),f=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),m=this.componentStore.plot.calculateSpace({width:b,height:f});t-=m.width,e-=m.height,m=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),s=m.height,e-=m.height,this.componentStore.xAxis.setAxisPosition("left"),m=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=m.width,a=m.width,this.componentStore.yAxis.setAxisPosition("top"),m=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=m.height,h=s+m.height,c=this.componentStore.legend.calculateSpace({width:t,height:f}),t-=c.width,t>0&&(b+=t,t=0),e>0&&(f+=e,e=0),this.componentStore.plot.calculateSpace({width:b,height:f}),this.componentStore.plot.setBoundingBoxXY({x:a,y:h}),this.componentStore.legend.setBoundingBoxXY({x:a+b,y:h+Math.max((f-c.height)/2,0)}),this.componentStore.yAxis.setRange([a,a+b]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:s}),this.componentStore.xAxis.setRange([h,h+f]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(k=>gt(k))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const e of Object.values(this.componentStore))t.push(...e.getDrawableElements());return t}},r(ot,"Orchestrator"),n(ot,"Orchestrator"),ot),ht,Xe=(ht=class{static build(t,e,s,a){return new We(t,e,s,a).getDrawableElement()}},r(ht,"XYChartBuilder"),n(ht,"XYChartBuilder"),ht),xt=0,xe,dt=St(),ft=wt(),y=Rt(),Mt=ft.plotColorPalette.split(",").map(i=>i.trim()),Ct=!1,Wt=!1;function wt(){const i=Te(),t=Bt();return ge(i.xyChart,t.themeVariables.xyChart)}r(wt,"getChartDefaultThemeConfig");n(wt,"getChartDefaultThemeConfig");function St(){const i=Bt();return ge(ke.xyChart,i.xyChart)}r(St,"getChartDefaultConfig");n(St,"getChartDefaultConfig");function Rt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}r(Rt,"getChartDefaultData");n(Rt,"getChartDefaultData");function $(i){const t=Bt();return _e(i.trim(),t)}r($,"textSanitizer");n($,"textSanitizer");function Xt(i){xe=i}r(Xt,"setTmpSVGG");n(Xt,"setTmpSVGG");function Yt(i){i==="horizontal"?dt.chartOrientation="horizontal":dt.chartOrientation="vertical"}r(Yt,"setOrientation");n(Yt,"setOrientation");function Nt(i){y.xAxis.title=$(i.text)}r(Nt,"setXAxisTitle");n(Nt,"setXAxisTitle");function _t(i,t){y.xAxis={type:"linear",title:y.xAxis.title,min:i,max:t},Ct=!0}r(_t,"setXAxisRangeData");n(_t,"setXAxisRangeData");function Ht(i){y.xAxis={type:"band",title:y.xAxis.title,categories:i.map(t=>$(t.text))},Ct=!0}r(Ht,"setXAxisBand");n(Ht,"setXAxisBand");function $t(i){y.yAxis.title=$(i.text)}r($t,"setYAxisTitle");n($t,"setYAxisTitle");function Ut(i,t){y.yAxis={type:"linear",title:y.yAxis.title,min:i,max:t},Wt=!0}r(Ut,"setYAxisRangeData");n(Ut,"setYAxisRangeData");function Gt(i){const t=Math.min(...i),e=Math.max(...i),s=K(y.yAxis)?y.yAxis.min:1/0,a=K(y.yAxis)?y.yAxis.max:-1/0;y.yAxis={type:"linear",title:y.yAxis.title,min:Math.min(s,t),max:Math.max(a,e)}}r(Gt,"setYAxisRangeFromPlotData");n(Gt,"setYAxisRangeFromPlotData");function kt(i){let t=[];if(i.length===0)return t;if(!Ct){const e=K(y.xAxis)?y.xAxis.min:1/0,s=K(y.xAxis)?y.xAxis.max:-1/0;_t(Math.min(e,1),Math.max(s,i.length))}if(ut(y.xAxis)&&i.length>y.xAxis.categories.length&&(i=i.slice(0,y.xAxis.categories.length)),Wt||Gt(i),ut(y.xAxis)&&(t=y.xAxis.categories.map((e,s)=>[e,i[s]])),K(y.xAxis)){const e=y.xAxis.min,s=y.xAxis.max;if(i.length===1)t=[[`${e}`,i[0]]];else{const a=(s-e)/(i.length-1);t=i.map((h,c)=>[`${e+c*a}`,h])}}return t}r(kt,"transformDataWithoutCategory");n(kt,"transformDataWithoutCategory");function Tt(i){return Mt[i===0?0:i%Mt.length]}r(Tt,"getPlotColorFromPalette");n(Tt,"getPlotColorFromPalette");function qt(i,t){const e=t.map(c=>c.value),s=t.map(c=>c.label?$(c.label):""),a=kt(e),h=s.some(c=>c!=="");y.plots.push({type:"line",title:$(i.text),strokeFill:Tt(xt),strokeWidth:2,data:a,...h?{pointLabels:s}:{}}),xt++}r(qt,"setLineData");n(qt,"setLineData");function jt(i,t){const e=t.map(a=>a.value),s=kt(e);y.plots.push({type:"bar",title:$(i.text),fill:Tt(xt),data:s}),xt++}r(jt,"setBarData");n(jt,"setBarData");function Kt(){if(y.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return y.title=le(),Xe.build(dt,y,ft,xe)}r(Kt,"getDrawableElem");n(Kt,"getDrawableElem");function Qt(){return ft}r(Qt,"getChartThemeConfig");n(Qt,"getChartThemeConfig");function Zt(){return dt}r(Zt,"getChartConfig");n(Zt,"getChartConfig");function Jt(){return y}r(Jt,"getXYChartData");n(Jt,"getXYChartData");var Ye=n(function(){Re(),xt=0,dt=St(),y=Rt(),ft=wt(),Mt=ft.plotColorPalette.split(",").map(i=>i.trim()),Ct=!1,Wt=!1},"clear"),Ne={getDrawableElem:Kt,clear:Ye,setAccTitle:Ce,getAccTitle:Ae,setDiagramTitle:be,getDiagramTitle:le,getAccDescription:ye,setAccDescription:me,setOrientation:Yt,setXAxisTitle:Nt,setXAxisRangeData:_t,setXAxisBand:Ht,setYAxisTitle:$t,setYAxisRangeData:Ut,setLineData:qt,setBarData:jt,setTmpSVGG:Xt,getChartThemeConfig:Qt,getChartConfig:Zt,getXYChartData:Jt},He=n((i,t,e,s)=>{const a=s.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),b=a.getXYChartData().plots[0].data.map(A=>A[1]);function f(A){return A==="top"?"text-before-edge":"middle"}r(f,"getDominantBaseLine"),n(f,"getDominantBaseLine");function m(A){return A==="left"?"start":A==="right"?"end":"middle"}r(m,"getTextAnchor"),n(m,"getTextAnchor");function k(A){return`translate(${A.x}, ${A.y}) rotate(${A.rotation||0})`}r(k,"getTextTransformation"),n(k,"getTextTransformation"),ce.debug(`Rendering xychart chart
|
|
7
|
-
`+i);const T=we(t),L=T.append("g").attr("class","main"),W=L.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");Se(T,c.height,c.width,!0),T.attr("viewBox",`0 0 ${c.width} ${c.height}`),W.attr("fill",h.backgroundColor),a.setTmpSVGG(T.append("g").attr("class","mermaid-tmp-group"));const X=a.getDrawableElem(),E={};function M(A){let D=L,g="";for(const[B]of A.entries()){let V=L;B>0&&E[g]&&(V=E[g]),g+=A[B],D=E[g],D||(D=E[g]=V.append("g").attr("class",A[B]))}return D}r(M,"getGroup"),n(M,"getGroup");for(const A of X){if(A.data.length===0)continue;const D=M(A.groupTexts);switch(A.type){case"rect":if(D.selectAll("rect").data(A.data).enter().append("rect").attr("x",g=>g.x).attr("y",g=>g.y).attr("width",g=>g.width).attr("height",g=>g.height).attr("fill",g=>g.fill).attr("stroke",g=>g.strokeFill).attr("stroke-width",g=>g.strokeWidth),c.showDataLabel){const g=c.showDataLabelOutsideBar;if(c.chartOrientation==="horizontal"){let B=r(function(w,z){const{data:_,label:lt}=w;return z*lt.length*V<=_.width-Y},"fitsHorizontally2");n(B,"fitsHorizontally");const V=.7,Y=10,N=A.data.map((w,z)=>({data:w,label:b[z].toString()})).filter(w=>w.data.width>0&&w.data.height>0),R=N.map(w=>{const{data:z}=w;let _=z.height*.7;for(;!B(w,_)&&_>0;)_-=1;return _}),U=Math.floor(Math.min(...R)),C=n(w=>g?w.data.x+w.data.width+Y:w.data.x+w.data.width-Y,"determineLabelXPosition");D.selectAll("text").data(N).enter().append("text").attr("x",C).attr("y",w=>w.data.y+w.data.height/2).attr("text-anchor",g?"start":"end").attr("dominant-baseline","middle").attr("fill",h.dataLabelColor).attr("font-size",`${U}px`).text(w=>w.label)}else{let B=r(function(C,w,z){const{data:_,label:lt}=C,F=w*lt.length*.7,l=_.x+_.width/2,u=l-F/2,x=l+F/2,d=u>=_.x&&x<=_.x+_.width,S=_.y+z+w<=_.y+_.height;return d&&S},"fitsInBar2");n(B,"fitsInBar");const V=10,Y=A.data.map((C,w)=>({data:C,label:b[w].toString()})).filter(C=>C.data.width>0&&C.data.height>0),N=Y.map(C=>{const{data:w,label:z}=C;let _=w.width/(z.length*.7);for(;!B(C,_,V)&&_>0;)_-=1;return _}),R=Math.floor(Math.min(...N)),U=n(C=>g?C.data.y-V:C.data.y+V,"determineLabelYPosition");D.selectAll("text").data(Y).enter().append("text").attr("x",C=>C.data.x+C.data.width/2).attr("y",U).attr("text-anchor","middle").attr("dominant-baseline",g?"auto":"hanging").attr("fill",h.dataLabelColor).attr("font-size",`${R}px`).text(C=>C.label)}}break;case"text":D.selectAll("text").data(A.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",g=>g.fill).attr("font-size",g=>g.fontSize).attr("dominant-baseline",g=>f(g.verticalPos)).attr("text-anchor",g=>m(g.horizontalPos)).attr("transform",g=>k(g)).text(g=>g.text);break;case"path":D.selectAll("path").data(A.data).enter().append("path").attr("d",g=>g.path).attr("fill",g=>g.fill?g.fill:"none").attr("stroke",g=>g.strokeFill).attr("stroke-width",g=>g.strokeWidth);break}}},"draw"),$e={draw:He},Ke={parser:Pe,db:Ne,renderer:$e};export{Ke as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as $n,b$ as Ye,ay as Jn,aD as Bn,a as jn,bL as yn,b2 as xe}from"./CxRm1vYn.js";import{b as ke,t as Nn,c as He,a as de}from"./DJ52BT20.js";import{i as We}from"./Gi6I4Gst.js";function mr(n,e){let t;if(e===void 0)for(const r of n)r!=null&&(t<r||t===void 0&&r>=r)&&(t=r);else{let r=-1;for(let o of n)(o=e(o,++r,n))!=null&&(t<o||t===void 0&&o>=o)&&(t=o)}return t}function hr(n,e){let t;if(e===void 0)for(const r of n)r!=null&&(t>r||t===void 0&&r>=r)&&(t=r);else{let r=-1;for(let o of n)(o=e(o,++r,n))!=null&&(t>o||t===void 0&&o>=o)&&(t=o)}return t}function Le(n){return n}var sn=1,Tn=2,Fn=3,cn=4,An=1e-6;function Ne(n){return"translate("+n+",0)"}function Ae(n){return"translate(0,"+n+")"}function Oe(n){return e=>+n(e)}function Ie(n,e){return e=Math.max(0,n.bandwidth()-e*2)/2,n.round()&&(e=Math.round(e)),t=>+n(t)+e}function ze(){return!this.__axis}function En(n,e){var t=[],r=null,o=null,a=6,i=6,T=3,C=typeof window<"u"&&window.devicePixelRatio>1?0:.5,m=n===sn||n===cn?-1:1,M=n===cn||n===Tn?"x":"y",v=n===sn||n===Fn?Ne:Ae;function f(l){var H=r??(e.ticks?e.ticks.apply(e,t):e.domain()),R=o??(e.tickFormat?e.tickFormat.apply(e,t):Le),Z=Math.max(a,0)+T,_=e.range(),V=+_[0]+C,b=+_[_.length-1]+C,S=(e.bandwidth?Ie:Oe)(e.copy(),C),L=l.selection?l.selection():l,s=L.selectAll(".domain").data([null]),p=L.selectAll(".tick").data(H,e).order(),P=p.exit(),j=p.enter().append("g").attr("class","tick"),q=p.select("line"),Q=p.select("text");s=s.merge(s.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),p=p.merge(j),q=q.merge(j.append("line").attr("stroke","currentColor").attr(M+"2",m*a)),Q=Q.merge(j.append("text").attr("fill","currentColor").attr(M,m*Z).attr("dy",n===sn?"0em":n===Fn?"0.71em":"0.32em")),l!==L&&(s=s.transition(l),p=p.transition(l),q=q.transition(l),Q=Q.transition(l),P=P.transition(l).attr("opacity",An).attr("transform",function(d){return isFinite(d=S(d))?v(d+C):this.getAttribute("transform")}),j.attr("opacity",An).attr("transform",function(d){var E=this.parentNode.__axis;return v((E&&isFinite(E=E(d))?E:S(d))+C)})),P.remove(),s.attr("d",n===cn||n===Tn?i?"M"+m*i+","+V+"H"+C+"V"+b+"H"+m*i:"M"+C+","+V+"V"+b:i?"M"+V+","+m*i+"V"+C+"H"+b+"V"+m*i:"M"+V+","+C+"H"+b),p.attr("opacity",1).attr("transform",function(d){return v(S(d)+C)}),q.attr(M+"2",m*a),Q.attr(M,m*Z).text(R),L.filter(ze).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",n===Tn?"start":n===cn?"end":"middle"),L.each(function(){this.__axis=S})}return f.scale=function(l){return arguments.length?(e=l,f):e},f.ticks=function(){return t=Array.from(arguments),f},f.tickArguments=function(l){return arguments.length?(t=l==null?[]:Array.from(l),f):t.slice()},f.tickValues=function(l){return arguments.length?(r=l==null?null:Array.from(l),f):r&&r.slice()},f.tickFormat=function(l){return arguments.length?(o=l,f):o},f.tickSize=function(l){return arguments.length?(a=i=+l,f):a},f.tickSizeInner=function(l){return arguments.length?(a=+l,f):a},f.tickSizeOuter=function(l){return arguments.length?(i=+l,f):i},f.tickPadding=function(l){return arguments.length?(T=+l,f):T},f.offset=function(l){return arguments.length?(C=+l,f):C},f}function yr(n){return En(sn,n)}function Tr(n){return En(Fn,n)}const Ze=Math.PI/180,Ve=180/Math.PI,ln=18,Gn=.96422,Kn=1,ne=.82521,ee=4/29,nn=6/29,te=3*nn*nn,Pe=nn*nn*nn;function re(n){if(n instanceof W)return new W(n.l,n.a,n.b,n.opacity);if(n instanceof N)return ue(n);n instanceof $n||(n=Ye(n));var e=pn(n.r),t=pn(n.g),r=pn(n.b),o=Mn((.2225045*e+.7168786*t+.0606169*r)/Kn),a,i;return e===t&&t===r?a=i=o:(a=Mn((.4360747*e+.3850649*t+.1430804*r)/Gn),i=Mn((.0139322*e+.0971045*t+.7141733*r)/ne)),new W(116*o-16,500*(a-o),200*(o-i),n.opacity)}function Re(n,e,t,r){return arguments.length===1?re(n):new W(n,e,t,r??1)}function W(n,e,t,r){this.l=+n,this.a=+e,this.b=+t,this.opacity=+r}Jn(W,Re,Bn(jn,{brighter(n){return new W(this.l+ln*(n??1),this.a,this.b,this.opacity)},darker(n){return new W(this.l-ln*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,e=isNaN(this.a)?n:n+this.a/500,t=isNaN(this.b)?n:n-this.b/200;return e=Gn*Cn(e),n=Kn*Cn(n),t=ne*Cn(t),new $n(Un(3.1338561*e-1.6168667*n-.4906146*t),Un(-.9787684*e+1.9161415*n+.033454*t),Un(.0719453*e-.2289914*n+1.4052427*t),this.opacity)}}));function Mn(n){return n>Pe?Math.pow(n,1/3):n/te+ee}function Cn(n){return n>nn?n*n*n:te*(n-ee)}function Un(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function pn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function _e(n){if(n instanceof N)return new N(n.h,n.c,n.l,n.opacity);if(n instanceof W||(n=re(n)),n.a===0&&n.b===0)return new N(NaN,0<n.l&&n.l<100?0:NaN,n.l,n.opacity);var e=Math.atan2(n.b,n.a)*Ve;return new N(e<0?e+360:e,Math.sqrt(n.a*n.a+n.b*n.b),n.l,n.opacity)}function Yn(n,e,t,r){return arguments.length===1?_e(n):new N(n,e,t,r??1)}function N(n,e,t,r){this.h=+n,this.c=+e,this.l=+t,this.opacity=+r}function ue(n){if(isNaN(n.h))return new W(n.l,0,0,n.opacity);var e=n.h*Ze;return new W(n.l,Math.cos(e)*n.c,Math.sin(e)*n.c,n.opacity)}Jn(N,Yn,Bn(jn,{brighter(n){return new N(this.h,this.c,this.l+ln*(n??1),this.opacity)},darker(n){return new N(this.h,this.c,this.l-ln*(n??1),this.opacity)},rgb(){return ue(this).rgb()}}));function qe(n){return function(e,t){var r=n((e=Yn(e)).h,(t=Yn(t)).h),o=yn(e.c,t.c),a=yn(e.l,t.l),i=yn(e.opacity,t.opacity);return function(T){return e.h=r(T),e.c=o(T),e.l=a(T),e.opacity=i(T),e+""}}}const Mr=qe(xe);function Qe(n,e){n=n.slice();var t=0,r=n.length-1,o=n[t],a=n[r],i;return a<o&&(i=t,t=r,r=i,i=o,o=a,a=i),n[t]=e.floor(o),n[r]=e.ceil(a),n}const Dn=new Date,wn=new Date;function D(n,e,t,r){function o(a){return n(a=arguments.length===0?new Date:new Date(+a)),a}return o.floor=a=>(n(a=new Date(+a)),a),o.ceil=a=>(n(a=new Date(a-1)),e(a,1),n(a),a),o.round=a=>{const i=o(a),T=o.ceil(a);return a-i<T-a?i:T},o.offset=(a,i)=>(e(a=new Date(+a),i==null?1:Math.floor(i)),a),o.range=(a,i,T)=>{const C=[];if(a=o.ceil(a),T=T==null?1:Math.floor(T),!(a<i)||!(T>0))return C;let m;do C.push(m=new Date(+a)),e(a,T),n(a);while(m<a&&a<i);return C},o.filter=a=>D(i=>{if(i>=i)for(;n(i),!a(i);)i.setTime(i-1)},(i,T)=>{if(i>=i)if(T<0)for(;++T<=0;)for(;e(i,-1),!a(i););else for(;--T>=0;)for(;e(i,1),!a(i););}),t&&(o.count=(a,i)=>(Dn.setTime(+a),wn.setTime(+i),n(Dn),n(wn),Math.floor(t(Dn,wn))),o.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?o.filter(r?i=>r(i)%a===0:i=>o.count(0,i)%a===0):o)),o}const fn=D(()=>{},(n,e)=>{n.setTime(+n+e)},(n,e)=>e-n);fn.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?D(e=>{e.setTime(Math.floor(e/n)*n)},(e,t)=>{e.setTime(+e+t*n)},(e,t)=>(t-e)/n):fn);fn.range;const A=1e3,k=A*60,O=k*60,I=O*24,xn=I*7,On=I*30,vn=I*365,K=D(n=>{n.setTime(n-n.getMilliseconds())},(n,e)=>{n.setTime(+n+e*A)},(n,e)=>(e-n)/A,n=>n.getUTCSeconds());K.range;const kn=D(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*A)},(n,e)=>{n.setTime(+n+e*k)},(n,e)=>(e-n)/k,n=>n.getMinutes());kn.range;const Xe=D(n=>{n.setUTCSeconds(0,0)},(n,e)=>{n.setTime(+n+e*k)},(n,e)=>(e-n)/k,n=>n.getUTCMinutes());Xe.range;const Hn=D(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*A-n.getMinutes()*k)},(n,e)=>{n.setTime(+n+e*O)},(n,e)=>(e-n)/O,n=>n.getHours());Hn.range;const $e=D(n=>{n.setUTCMinutes(0,0,0)},(n,e)=>{n.setTime(+n+e*O)},(n,e)=>(e-n)/O,n=>n.getUTCHours());$e.range;const on=D(n=>n.setHours(0,0,0,0),(n,e)=>n.setDate(n.getDate()+e),(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*k)/I,n=>n.getDate()-1);on.range;const dn=D(n=>{n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e)},(n,e)=>(e-n)/I,n=>n.getUTCDate()-1);dn.range;const Je=D(n=>{n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e)},(n,e)=>(e-n)/I,n=>Math.floor(n/I));Je.range;function J(n){return D(e=>{e.setDate(e.getDate()-(e.getDay()+7-n)%7),e.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*k)/xn)}const hn=J(0),gn=J(1),Be=J(2),je=J(3),en=J(4),Ee=J(5),Ge=J(6);hn.range;gn.range;Be.range;je.range;en.range;Ee.range;Ge.range;function B(n){return D(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-n)%7),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/xn)}const ae=B(0),mn=B(1),Ke=B(2),nt=B(3),tn=B(4),et=B(5),tt=B(6);ae.range;mn.range;Ke.range;nt.range;tn.range;et.range;tt.range;const Wn=D(n=>{n.setDate(1),n.setHours(0,0,0,0)},(n,e)=>{n.setMonth(n.getMonth()+e)},(n,e)=>e.getMonth()-n.getMonth()+(e.getFullYear()-n.getFullYear())*12,n=>n.getMonth());Wn.range;const rt=D(n=>{n.setUTCDate(1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCMonth(n.getUTCMonth()+e)},(n,e)=>e.getUTCMonth()-n.getUTCMonth()+(e.getUTCFullYear()-n.getUTCFullYear())*12,n=>n.getUTCMonth());rt.range;const z=D(n=>{n.setMonth(0,1),n.setHours(0,0,0,0)},(n,e)=>{n.setFullYear(n.getFullYear()+e)},(n,e)=>e.getFullYear()-n.getFullYear(),n=>n.getFullYear());z.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:D(e=>{e.setFullYear(Math.floor(e.getFullYear()/n)*n),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t*n)});z.range;const $=D(n=>{n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e)},(n,e)=>e.getUTCFullYear()-n.getUTCFullYear(),n=>n.getUTCFullYear());$.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:D(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/n)*n),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t*n)});$.range;function ut(n,e,t,r,o,a){const i=[[K,1,A],[K,5,5*A],[K,15,15*A],[K,30,30*A],[a,1,k],[a,5,5*k],[a,15,15*k],[a,30,30*k],[o,1,O],[o,3,3*O],[o,6,6*O],[o,12,12*O],[r,1,I],[r,2,2*I],[t,1,xn],[e,1,On],[e,3,3*On],[n,1,vn]];function T(m,M,v){const f=M<m;f&&([m,M]=[M,m]);const l=v&&typeof v.range=="function"?v:C(m,M,v),H=l?l.range(m,+M+1):[];return f?H.reverse():H}function C(m,M,v){const f=Math.abs(M-m)/v,l=ke(([,,Z])=>Z).right(i,f);if(l===i.length)return n.every(Nn(m/vn,M/vn,v));if(l===0)return fn.every(Math.max(Nn(m,M,v),1));const[H,R]=i[f/i[l-1][2]<i[l][2]/f?l-1:l];return H.every(R)}return[T,C]}const[at,ot]=ut(z,Wn,hn,on,Hn,kn);function bn(n){if(0<=n.y&&n.y<100){var e=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return e.setFullYear(n.y),e}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function Sn(n){if(0<=n.y&&n.y<100){var e=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function rn(n,e,t){return{y:n,m:e,d:t,H:0,M:0,S:0,L:0}}function it(n){var e=n.dateTime,t=n.date,r=n.time,o=n.periods,a=n.days,i=n.shortDays,T=n.months,C=n.shortMonths,m=un(o),M=an(o),v=un(a),f=an(a),l=un(i),H=an(i),R=un(T),Z=an(T),_=un(C),V=an(C),b={a:ye,A:Te,b:Me,B:Ce,c:null,d:Rn,e:Rn,f:Ht,g:Vt,G:Rt,H:Yt,I:xt,j:kt,L:oe,m:dt,M:Wt,p:Ue,q:pe,Q:Qn,s:Xn,S:Lt,u:Nt,U:At,V:Ot,w:It,W:zt,x:null,X:null,y:Zt,Y:Pt,Z:_t,"%":qn},S={a:De,A:we,b:ve,B:be,c:null,d:_n,e:_n,f:$t,g:rr,G:ar,H:qt,I:Qt,j:Xt,L:ce,m:Jt,M:Bt,p:Se,q:Fe,Q:Qn,s:Xn,S:jt,u:Et,U:Gt,V:Kt,w:nr,W:er,x:null,X:null,y:tr,Y:ur,Z:or,"%":qn},L={a:q,A:Q,b:d,B:E,c:ge,d:Vn,e:Vn,f:vt,g:Zn,G:zn,H:Pn,I:Pn,j:Ut,L:wt,m:Ct,M:pt,p:j,q:Mt,Q:St,s:Ft,S:Dt,u:gt,U:mt,V:ht,w:ft,W:yt,x:me,X:he,y:Zn,Y:zn,Z:Tt,"%":bt};b.x=s(t,b),b.X=s(r,b),b.c=s(e,b),S.x=s(t,S),S.X=s(r,S),S.c=s(e,S);function s(c,g){return function(h){var u=[],F=-1,U=0,Y=c.length,x,X,Ln;for(h instanceof Date||(h=new Date(+h));++F<Y;)c.charCodeAt(F)===37&&(u.push(c.slice(U,F)),(X=In[x=c.charAt(++F)])!=null?x=c.charAt(++F):X=x==="e"?" ":"0",(Ln=g[x])&&(x=Ln(h,X)),u.push(x),U=F+1);return u.push(c.slice(U,F)),u.join("")}}function p(c,g){return function(h){var u=rn(1900,void 0,1),F=P(u,c,h+="",0),U,Y;if(F!=h.length)return null;if("Q"in u)return new Date(u.Q);if("s"in u)return new Date(u.s*1e3+("L"in u?u.L:0));if(g&&!("Z"in u)&&(u.Z=0),"p"in u&&(u.H=u.H%12+u.p*12),u.m===void 0&&(u.m="q"in u?u.q:0),"V"in u){if(u.V<1||u.V>53)return null;"w"in u||(u.w=1),"Z"in u?(U=Sn(rn(u.y,0,1)),Y=U.getUTCDay(),U=Y>4||Y===0?mn.ceil(U):mn(U),U=dn.offset(U,(u.V-1)*7),u.y=U.getUTCFullYear(),u.m=U.getUTCMonth(),u.d=U.getUTCDate()+(u.w+6)%7):(U=bn(rn(u.y,0,1)),Y=U.getDay(),U=Y>4||Y===0?gn.ceil(U):gn(U),U=on.offset(U,(u.V-1)*7),u.y=U.getFullYear(),u.m=U.getMonth(),u.d=U.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),Y="Z"in u?Sn(rn(u.y,0,1)).getUTCDay():bn(rn(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+u.W*7-(Y+5)%7:u.w+u.U*7-(Y+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,Sn(u)):bn(u)}}function P(c,g,h,u){for(var F=0,U=g.length,Y=h.length,x,X;F<U;){if(u>=Y)return-1;if(x=g.charCodeAt(F++),x===37){if(x=g.charAt(F++),X=L[x in In?g.charAt(F++):x],!X||(u=X(c,h,u))<0)return-1}else if(x!=h.charCodeAt(u++))return-1}return u}function j(c,g,h){var u=m.exec(g.slice(h));return u?(c.p=M.get(u[0].toLowerCase()),h+u[0].length):-1}function q(c,g,h){var u=l.exec(g.slice(h));return u?(c.w=H.get(u[0].toLowerCase()),h+u[0].length):-1}function Q(c,g,h){var u=v.exec(g.slice(h));return u?(c.w=f.get(u[0].toLowerCase()),h+u[0].length):-1}function d(c,g,h){var u=_.exec(g.slice(h));return u?(c.m=V.get(u[0].toLowerCase()),h+u[0].length):-1}function E(c,g,h){var u=R.exec(g.slice(h));return u?(c.m=Z.get(u[0].toLowerCase()),h+u[0].length):-1}function ge(c,g,h){return P(c,e,g,h)}function me(c,g,h){return P(c,t,g,h)}function he(c,g,h){return P(c,r,g,h)}function ye(c){return i[c.getDay()]}function Te(c){return a[c.getDay()]}function Me(c){return C[c.getMonth()]}function Ce(c){return T[c.getMonth()]}function Ue(c){return o[+(c.getHours()>=12)]}function pe(c){return 1+~~(c.getMonth()/3)}function De(c){return i[c.getUTCDay()]}function we(c){return a[c.getUTCDay()]}function ve(c){return C[c.getUTCMonth()]}function be(c){return T[c.getUTCMonth()]}function Se(c){return o[+(c.getUTCHours()>=12)]}function Fe(c){return 1+~~(c.getUTCMonth()/3)}return{format:function(c){var g=s(c+="",b);return g.toString=function(){return c},g},parse:function(c){var g=p(c+="",!1);return g.toString=function(){return c},g},utcFormat:function(c){var g=s(c+="",S);return g.toString=function(){return c},g},utcParse:function(c){var g=p(c+="",!0);return g.toString=function(){return c},g}}}var In={"-":"",_:" ",0:"0"},w=/^\s*\d+/,ct=/^%/,st=/[\\^$*+?|[\]().{}]/g;function y(n,e,t){var r=n<0?"-":"",o=(r?-n:n)+"",a=o.length;return r+(a<t?new Array(t-a+1).join(e)+o:o)}function lt(n){return n.replace(st,"\\$&")}function un(n){return new RegExp("^(?:"+n.map(lt).join("|")+")","i")}function an(n){return new Map(n.map((e,t)=>[e.toLowerCase(),t]))}function ft(n,e,t){var r=w.exec(e.slice(t,t+1));return r?(n.w=+r[0],t+r[0].length):-1}function gt(n,e,t){var r=w.exec(e.slice(t,t+1));return r?(n.u=+r[0],t+r[0].length):-1}function mt(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.U=+r[0],t+r[0].length):-1}function ht(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.V=+r[0],t+r[0].length):-1}function yt(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.W=+r[0],t+r[0].length):-1}function zn(n,e,t){var r=w.exec(e.slice(t,t+4));return r?(n.y=+r[0],t+r[0].length):-1}function Zn(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.y=+r[0]+(+r[0]>68?1900:2e3),t+r[0].length):-1}function Tt(n,e,t){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return r?(n.Z=r[1]?0:-(r[2]+(r[3]||"00")),t+r[0].length):-1}function Mt(n,e,t){var r=w.exec(e.slice(t,t+1));return r?(n.q=r[0]*3-3,t+r[0].length):-1}function Ct(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.m=r[0]-1,t+r[0].length):-1}function Vn(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.d=+r[0],t+r[0].length):-1}function Ut(n,e,t){var r=w.exec(e.slice(t,t+3));return r?(n.m=0,n.d=+r[0],t+r[0].length):-1}function Pn(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.H=+r[0],t+r[0].length):-1}function pt(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.M=+r[0],t+r[0].length):-1}function Dt(n,e,t){var r=w.exec(e.slice(t,t+2));return r?(n.S=+r[0],t+r[0].length):-1}function wt(n,e,t){var r=w.exec(e.slice(t,t+3));return r?(n.L=+r[0],t+r[0].length):-1}function vt(n,e,t){var r=w.exec(e.slice(t,t+6));return r?(n.L=Math.floor(r[0]/1e3),t+r[0].length):-1}function bt(n,e,t){var r=ct.exec(e.slice(t,t+1));return r?t+r[0].length:-1}function St(n,e,t){var r=w.exec(e.slice(t));return r?(n.Q=+r[0],t+r[0].length):-1}function Ft(n,e,t){var r=w.exec(e.slice(t));return r?(n.s=+r[0],t+r[0].length):-1}function Rn(n,e){return y(n.getDate(),e,2)}function Yt(n,e){return y(n.getHours(),e,2)}function xt(n,e){return y(n.getHours()%12||12,e,2)}function kt(n,e){return y(1+on.count(z(n),n),e,3)}function oe(n,e){return y(n.getMilliseconds(),e,3)}function Ht(n,e){return oe(n,e)+"000"}function dt(n,e){return y(n.getMonth()+1,e,2)}function Wt(n,e){return y(n.getMinutes(),e,2)}function Lt(n,e){return y(n.getSeconds(),e,2)}function Nt(n){var e=n.getDay();return e===0?7:e}function At(n,e){return y(hn.count(z(n)-1,n),e,2)}function ie(n){var e=n.getDay();return e>=4||e===0?en(n):en.ceil(n)}function Ot(n,e){return n=ie(n),y(en.count(z(n),n)+(z(n).getDay()===4),e,2)}function It(n){return n.getDay()}function zt(n,e){return y(gn.count(z(n)-1,n),e,2)}function Zt(n,e){return y(n.getFullYear()%100,e,2)}function Vt(n,e){return n=ie(n),y(n.getFullYear()%100,e,2)}function Pt(n,e){return y(n.getFullYear()%1e4,e,4)}function Rt(n,e){var t=n.getDay();return n=t>=4||t===0?en(n):en.ceil(n),y(n.getFullYear()%1e4,e,4)}function _t(n){var e=n.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+y(e/60|0,"0",2)+y(e%60,"0",2)}function _n(n,e){return y(n.getUTCDate(),e,2)}function qt(n,e){return y(n.getUTCHours(),e,2)}function Qt(n,e){return y(n.getUTCHours()%12||12,e,2)}function Xt(n,e){return y(1+dn.count($(n),n),e,3)}function ce(n,e){return y(n.getUTCMilliseconds(),e,3)}function $t(n,e){return ce(n,e)+"000"}function Jt(n,e){return y(n.getUTCMonth()+1,e,2)}function Bt(n,e){return y(n.getUTCMinutes(),e,2)}function jt(n,e){return y(n.getUTCSeconds(),e,2)}function Et(n){var e=n.getUTCDay();return e===0?7:e}function Gt(n,e){return y(ae.count($(n)-1,n),e,2)}function se(n){var e=n.getUTCDay();return e>=4||e===0?tn(n):tn.ceil(n)}function Kt(n,e){return n=se(n),y(tn.count($(n),n)+($(n).getUTCDay()===4),e,2)}function nr(n){return n.getUTCDay()}function er(n,e){return y(mn.count($(n)-1,n),e,2)}function tr(n,e){return y(n.getUTCFullYear()%100,e,2)}function rr(n,e){return n=se(n),y(n.getUTCFullYear()%100,e,2)}function ur(n,e){return y(n.getUTCFullYear()%1e4,e,4)}function ar(n,e){var t=n.getUTCDay();return n=t>=4||t===0?tn(n):tn.ceil(n),y(n.getUTCFullYear()%1e4,e,4)}function or(){return"+0000"}function qn(){return"%"}function Qn(n){return+n}function Xn(n){return Math.floor(+n/1e3)}var G,le;ir({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ir(n){return G=it(n),le=G.format,G.parse,G.utcFormat,G.utcParse,G}function cr(n){return new Date(n)}function sr(n){return n instanceof Date?+n:+new Date(+n)}function fe(n,e,t,r,o,a,i,T,C,m){var M=He(),v=M.invert,f=M.domain,l=m(".%L"),H=m(":%S"),R=m("%I:%M"),Z=m("%I %p"),_=m("%a %d"),V=m("%b %d"),b=m("%B"),S=m("%Y");function L(s){return(C(s)<s?l:T(s)<s?H:i(s)<s?R:a(s)<s?Z:r(s)<s?o(s)<s?_:V:t(s)<s?b:S)(s)}return M.invert=function(s){return new Date(v(s))},M.domain=function(s){return arguments.length?f(Array.from(s,sr)):f().map(cr)},M.ticks=function(s){var p=f();return n(p[0],p[p.length-1],s??10)},M.tickFormat=function(s,p){return p==null?L:m(p)},M.nice=function(s){var p=f();return(!s||typeof s.range!="function")&&(s=e(p[0],p[p.length-1],s??10)),s?f(Qe(p,s)):M},M.copy=function(){return de(M,fe(n,e,t,r,o,a,i,T,C,m))},M}function Cr(){return We.apply(fe(at,ot,z,Wn,hn,on,Hn,kn,K,le).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{Tr as a,yr as b,fn as c,hr as d,on as e,le as f,Ee as g,Hn as h,Mr as i,kn as j,gn as k,Wn as l,mr as m,Ge as n,hn as o,en as p,Be as q,je as r,K as s,Cr as t};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{c9 as xt,aP as _t,c6 as vt,aK as bt,c7 as St,aL as wt,f as y,aO as lt,aw as Lt,c3 as X,cd as Et,a0 as At,a4 as Tt}from"./CxRm1vYn.js";import{o as Mt}from"./CmKTTxBW.js";import{d as Nt}from"./CvOaoHrI.js";function ct(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s<l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s<u||s===void 0&&u>=u)&&(s=u)}return s}function pt(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s>l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,i){let s=0;if(i===void 0)for(let l of t)(l=+l)&&(s+=l);else{let l=-1;for(let u of t)(u=+i(u,++l,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function It(t,i){return i-1-t.height}function kt(t,i){return t.sourceLinks.length?t.depth:i-1}function Ot(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function q(t){return function(){return t}}function ut(t,i){return K(t.source,i.source)||t.index-i.index}function ht(t,i){return K(t.target,i.target)||t.index-i.index}function K(t,i){return t.y0-i.y0}function it(t){return t.value}function $t(t){return t.index}function Dt(t){return t.nodes}function jt(t){return t.links}function ft(t,i){const s=t.get(i);if(!s)throw new Error("missing: "+i);return s}function yt({nodes:t}){for(const i of t){let s=i.y0,l=s;for(const u of i.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of i.targetLinks)u.y1=l+u.width/2,l+=u.width}}function zt(){let t=0,i=0,s=1,l=1,u=24,x=8,g,k=$t,o=kt,a,h,m=Dt,_=jt,d=6;function v(){const n={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(n),A(n),M(n),I(n),S(n),yt(n),n}v.update=function(n){return yt(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:q(n),v):k},v.nodeAlign=function(n){return arguments.length?(o=typeof n=="function"?n:q(n),v):o},v.nodeSort=function(n){return arguments.length?(a=n,v):a},v.nodeWidth=function(n){return arguments.length?(u=+n,v):u},v.nodePadding=function(n){return arguments.length?(x=g=+n,v):x},v.nodes=function(n){return arguments.length?(m=typeof n=="function"?n:q(n),v):m},v.links=function(n){return arguments.length?(_=typeof n=="function"?n:q(n),v):_},v.linkSort=function(n){return arguments.length?(h=n,v):h},v.size=function(n){return arguments.length?(t=i=0,s=+n[0],l=+n[1],v):[s-t,l-i]},v.extent=function(n){return arguments.length?(t=+n[0][0],s=+n[1][0],i=+n[0][1],l=+n[1][1],v):[[t,i],[s,l]]},v.iterations=function(n){return arguments.length?(d=+n,v):d};function T({nodes:n,links:f}){for(const[e,r]of n.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(n.map((e,r)=>[k(e,r,n),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ft(c,p)),typeof b!="object"&&(b=r.target=ft(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of n)e.sort(h),r.sort(h)}function A({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:n}){const f=ct(n,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of n){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(a)for(const r of e)r.sort(a);return e}function D(n){const f=pt(n,c=>(l-i-(c.length-1)*g)/nt(c,it));for(const c of n){let e=i;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(l-e+g)/(c.length+1);for(let r=0;r<c.length;++r){const p=c[r];p.y0+=e*(r+1),p.y1+=e*(r+1)}w(c)}}function S(n){const f=N(n);g=Math.min(x,(l-i)/(ct(f,c=>c.length)-1)),D(f);for(let c=0;c<d;++c){const e=Math.pow(.99,c),r=Math.max(1-e,(c+1)/d);R(f,e,r),P(f,e,r)}}function P(n,f,c){for(let e=1,r=n.length;e<r;++e){const p=n[e];for(const b of p){let L=0,B=0;for(const{source:Y,value:et}of b.targetLinks){let H=et*(b.layer-Y.layer);L+=C(Y,b)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}a===void 0&&p.sort(K),j(p,c)}}function R(n,f,c){for(let e=n.length,r=e-2;r>=0;--r){const p=n[r];for(const b of p){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}a===void 0&&p.sort(K),j(p,c)}}function j(n,f){const c=n.length>>1,e=n[c];O(n,e.y0-g,c-1,f),V(n,e.y1+g,c+1,f),O(n,l,n.length-1,f),V(n,i,0,f)}function V(n,f,c,e){for(;c<n.length;++c){const r=n[c],p=(f-r.y0)*e;p>1e-6&&(r.y0+=p,r.y1+=p),f=r.y1+g}}function O(n,f,c,e){for(;c>=0;--c){const r=n[c],p=(r.y1-f)*e;p>1e-6&&(r.y0-=p,r.y1-=p),f=r.y0-g}}function z({sourceLinks:n,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ht);for(const{target:{targetLinks:c}}of n)c.sort(ut)}}function w(n){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of n)f.sort(ht),c.sort(ut)}function C(n,f){let c=n.y0-(n.sourceLinks.length-1)*g/2;for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c+=r+g}for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c-=r}return c}function E(n,f){let c=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c+=r+g}for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c-=r}return c}return v}var rt=Math.PI,st=2*rt,F=1e-6,Bt=st-F;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+l)},bezierCurveTo:function(t,i,s,l,u,x){this._+="C"+ +t+","+ +i+","+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+x)},arcTo:function(t,i,s,l,u){t=+t,i=+i,s=+s,l=+l,u=+u;var x=this._x1,g=this._y1,k=s-t,o=l-i,a=x-t,h=g-i,m=a*a+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(m>F)if(!(Math.abs(h*k-o*a)>F)||!u)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var _=s-x,d=l-g,v=k*k+o*o,T=_*_+d*d,A=Math.sqrt(v),M=Math.sqrt(m),I=u*Math.tan((rt-Math.acos((v+m-T)/(2*A*M)))/2),N=I/M,D=I/A;Math.abs(N-1)>F&&(this._+="L"+(t+N*a)+","+(i+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>a*d)+","+(this._x1=t+D*k)+","+(this._y1=i+D*o)}},arc:function(t,i,s,l,u,x){t=+t,i=+i,s=+s,x=!!x;var g=s*Math.cos(l),k=s*Math.sin(l),o=t+g,a=i+k,h=1^x,m=x?l-u:u-l;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+a:(Math.abs(this._x1-o)>F||Math.abs(this._y1-a)>F)&&(this._+="L"+o+","+a),s&&(m<0&&(m=m%st+st),m>Bt?this._+="A"+s+","+s+",0,1,"+h+","+(t-g)+","+(i-k)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=a):m>F&&(this._+="A"+s+","+s+",0,"+ +(m>=rt)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=i+s*Math.sin(u))))},rect:function(t,i,s,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +l+"h"+-s+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Ft(t){return t[0]}function Rt(t){return t[1]}var Vt=Array.prototype.slice;function Wt(t){return t.source}function Gt(t){return t.target}function Ut(t){var i=Wt,s=Gt,l=Ft,u=Rt,x=null;function g(){var k,o=Vt.call(arguments),a=i.apply(this,o),h=s.apply(this,o);if(x||(x=k=mt()),t(x,+l.apply(this,(o[0]=a,o)),+u.apply(this,o),+l.apply(this,(o[0]=h,o)),+u.apply(this,o)),k)return x=null,k+""||null}return g.source=function(k){return arguments.length?(i=k,g):i},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(l=typeof k=="function"?k:dt(+k),g):l},g.y=function(k){return arguments.length?(u=typeof k=="function"?k:dt(+k),g):u},g.context=function(k){return arguments.length?(x=k??null,g):x},g}function Yt(t,i,s,l,u){t.moveTo(i,s),t.bezierCurveTo(i=(i+l)/2,s,i,u,l,u)}function Ht(){return Ut(Yt)}function Xt(t){return[t.source.x1,t.y0]}function qt(t){return[t.target.x0,t.y1]}function Kt(){return Ht().source(Xt).target(qt)}var at=(function(){var t=y(function(k,o,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=o);return a},"o"),i=[1,9],s=[1,10],l=[1,5,10,12],u={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:y(function(o,a,h,m,_,d,v){var T=d.length-1;switch(_){case 7:const A=m.findOrCreateNode(d[T-4].trim().replaceAll('""','"')),M=m.findOrCreateNode(d[T-2].trim().replaceAll('""','"')),I=parseFloat(d[T].trim());m.addLink(A,M,I);break;case 8:case 9:case 11:this.$=d[T];break;case 10:this.$=d[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:i,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:s},{15:18,16:7,17:8,18:i,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:y(function(o,a){if(a.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=a,h}},"parseError"),parse:y(function(o){var a=this,h=[0],m=[],_=[null],d=[],v=this.table,T="",A=0,M=0,I=2,N=1,D=d.slice.call(arguments,1),S=Object.create(this.lexer),P={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(P.yy[R]=this.yy[R]);S.setInput(o,P.yy),P.yy.lexer=S,P.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;d.push(j);var V=S.options&&S.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,d.length=d.length-L}y(O,"popStack");function z(){var L;return L=m.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(m=L,L=m.pop()),L=a.symbols_[L]||L),L}y(z,"lex");for(var w,C,E,n,f={},c,e,r,p;;){if(C=h[h.length-1],this.defaultActions[C]?E=this.defaultActions[C]:((w===null||typeof w>"u")&&(w=z()),E=v[C]&&v[C][w]),typeof E>"u"||!E.length||!E[0]){var b="";p=[];for(c in v[C])this.terminals_[c]&&c>I&&p.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`:
|
|
2
|
-
`+S.showPosition()+`
|
|
3
|
-
Expecting `+p.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:j,expected:p})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),d.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,j=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:d[d.length-(e||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(e||1)].first_column,last_column:d[d.length-1].last_column},V&&(f._$.range=[d[d.length-(e||1)].range[0],d[d.length-1].range[1]]),n=this.performAction.apply(f,[T,M,A,P.yy,E[1],_,d].concat(D)),typeof n<"u")return n;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),d=d.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),d.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:y(function(a,h){if(this.yy.parser)this.yy.parser.parseError(a,h);else throw new Error(a)},"parseError"),setInput:y(function(o,a){return this.yy=a||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var a=o.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:y(function(o){var a=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(o){this.unput(this.match.slice(o))},"less"),pastInput:y(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var o=this.pastInput(),a=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
|
5
|
-
`+a+"^"},"showPosition"),test_match:y(function(o,a){var h,m,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),m=o[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],h=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,a,h,m;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(h=this._input.match(this.rules[_[d]]),h&&(!a||h[0].length>a[0].length)){if(a=h,m=d,this.options.backtrack_lexer){if(o=this.test_match(h,_[d]),o!==!1)return o;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(o=this.test_match(a,_[m]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var a=this.next();return a||this.lex()},"lex"),begin:y(function(a){this.conditionStack.push(a)},"begin"),popState:y(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:y(function(a){this.begin(a)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(a,h,m,_){switch(m){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return k})();u.lexer=x;function g(){this.yy={}}return y(g,"Parser"),g.prototype=u,u.Parser=g,new g})();at.parser=at;var Q=at,J=[],tt=[],Z=new Map,Qt=y(()=>{J=[],tt=[],Z=new Map,At()},"clear"),W,Zt=(W=class{constructor(i,s,l=0){this.source=i,this.target=s,this.value=l}},y(W,"SankeyLink"),W),Jt=y((t,i,s)=>{J.push(new Zt(t,i,s))},"addLink"),G,te=(G=class{constructor(i){this.ID=i}},y(G,"SankeyNode"),G),ee=y(t=>{t=Tt.sanitizeText(t,lt());let i=Z.get(t);return i===void 0&&(i=new te(t),Z.set(t,i),tt.push(i)),i},"findOrCreateNode"),ne=y(()=>tt,"getNodes"),ie=y(()=>J,"getLinks"),re=y(()=>({nodes:tt.map(t=>({id:t.ID})),links:J.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),se={nodesMap:Z,getConfig:y(()=>lt().sankey,"getConfig"),getNodes:ne,getLinks:ie,getGraph:re,addLink:Jt,findOrCreateNode:ee,getAccTitle:wt,setAccTitle:St,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:_t,setDiagramTitle:xt,clear:Qt},$,gt=($=class{static next(i){return new $(i+ ++$.count)}constructor(i){this.id=i,this.href=`#${i}`}toString(){return"url("+this.href+")"}},y($,"Uid"),$.count=0,$),oe={left:Ct,right:It,center:Ot,justify:kt},ae=y(t=>{let i=0,s=0;for(const l of t){const u=l.value??0;u>i&&(i=u,s=l.layer??0)}return s},"findCentralNodeLayer"),le=y(function(t,i,s,l){const{securityLevel:u,sankey:x}=lt(),g=Lt.sankey;let k;u==="sandbox"&&(k=X("#i"+i));const o=u==="sandbox"?X(k.nodes()[0].contentDocument.body):X("body"),a=u==="sandbox"?o.select(`[id="${i}"]`):X(`[id="${i}"]`),h=x?.width??g.width,m=x?.height??g.width,_=x?.useMaxWidth??g.useMaxWidth,d=x?.nodeAlignment??g.nodeAlignment,v=x?.prefix??g.prefix,T=x?.suffix??g.suffix,A=x?.showValues??g.showValues,M=x?.nodeWidth??g.nodeWidth??10,I=x?.nodePadding??g.nodePadding??12,N=x?.labelStyle??g.labelStyle??"legacy",D=x?.nodeColors??{},S=l.db.getGraph(),P=oe[d];zt().nodeId(e=>e.id).nodeWidth(M).nodePadding(I+(A?15:0)).nodeAlign(P).extent([[0,0],[h,m]])(S);const j=ae(S.nodes),V=Mt(Nt),O=y(e=>D[e]??V(e),"getNodeColor");a.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=gt.next("node-")).id).attr("transform",function(e){return"translate("+e.x0+","+e.y0+")"}).attr("x",e=>e.x0).attr("y",e=>e.y0).append("rect").attr("height",e=>e.y1-e.y0).attr("width",e=>e.x1-e.x0).attr("fill",e=>O(e.id));const z=y(({id:e,value:r})=>A?`${e}
|
|
7
|
-
${v}${Math.round(r*100)/100}${T}`:e,"getText"),w=y(e=>N==="outlined"?(e.layer??0)<j?{x:e.x0-6,anchor:"end"}:{x:e.x1+6,anchor:"start"}:e.x0<h/2?{x:e.x1+6,anchor:"start"}:{x:e.x0-6,anchor:"end"},"getLabelPosition"),C=a.append("g").attr("class","node-labels").attr("font-size",14),E=y(e=>C.selectAll(e?`.${e}`:"text").data(S.nodes).join("text").attr("class",e??null).attr("x",r=>w(r).x).attr("y",r=>(r.y1+r.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",r=>w(r).anchor).text(z),"appendLabel");N==="outlined"?(E("sankey-label-bg"),E("sankey-label-fg")):E();const n=a.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),f=x?.linkColor??"gradient";if(f==="gradient"){const e=n.append("linearGradient").attr("id",r=>(r.uid=gt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",r=>r.source.x1).attr("x2",r=>r.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",r=>O(r.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",r=>O(r.target.id))}let c;switch(f){case"gradient":c=y(e=>e.uid,"coloring");break;case"source":c=y(e=>O(e.source.id),"coloring");break;case"target":c=y(e=>O(e.target.id),"coloring");break;default:c=f}n.append("path").attr("d",Kt()).attr("stroke",c).attr("stroke-width",e=>Math.max(1,e.width)),Et(void 0,a,0,_)},"draw"),ce={draw:le},ue=y(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
|
|
8
|
-
`).trim(),"prepareTextForParsing"),he=y(t=>`.label {
|
|
9
|
-
font-family: ${t.fontFamily};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.node-labels {
|
|
13
|
-
font-family: ${t.fontFamily};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* Outlined label style - background stroke for better readability */
|
|
17
|
-
.sankey-label-bg {
|
|
18
|
-
stroke: ${t.mainBkg||t.background||"#fff"};
|
|
19
|
-
stroke-width: 4px;
|
|
20
|
-
stroke-linejoin: round;
|
|
21
|
-
paint-order: stroke;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* Foreground label text */
|
|
25
|
-
.sankey-label-fg {
|
|
26
|
-
fill: ${t.textColor};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* Node styling */
|
|
30
|
-
.node rect {
|
|
31
|
-
shape-rendering: crispEdges;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Link styling */
|
|
35
|
-
.link {
|
|
36
|
-
fill: none;
|
|
37
|
-
stroke-opacity: 0.5;
|
|
38
|
-
mix-blend-mode: multiply;
|
|
39
|
-
}
|
|
40
|
-
`,"getStyles"),fe=he,ye=Q.parse.bind(Q);Q.parse=t=>ye(ue(t));var ke={styles:fe,parser:Q,db:se,renderer:ce};export{ke as diagram};
|