@intent-hq/web 2.301.0 → 2.301.1
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/chunks/{B7zUuO00.js → -8mBz6EW.js} +1 -1
- package/web/app/immutable/chunks/{BbJJ4Uie.js → 2Iga5834.js} +1 -1
- package/web/app/immutable/chunks/{BcmjbiBm.js → 3-bIA0_b.js} +2 -2
- package/web/app/immutable/chunks/{DrNVHvhK.js → 3cwLWYk-.js} +1 -1
- package/web/app/immutable/chunks/{9k5bnL8-.js → 6WuGSm1v.js} +2 -2
- package/web/app/immutable/chunks/{DKolS8Ht.js → 8FC2Ymrs.js} +1 -1
- package/web/app/immutable/chunks/{Ce-KYi-n.js → 90FT2TPG.js} +2 -2
- package/web/app/immutable/chunks/{B52XysAQ.js → 9Bp-qw-c.js} +1 -1
- package/web/app/immutable/chunks/{BPzYYRAs.js → 9pcH5qab.js} +4 -4
- package/web/app/immutable/chunks/{DhGPSsBf.js → Alw6Bgam.js} +1 -1
- package/web/app/immutable/chunks/{DtagNJGy.js → B-pxGJ33.js} +1 -1
- package/web/app/immutable/chunks/{BcpdiGRR.js → B1f-Dpa6.js} +1 -1
- package/web/app/immutable/chunks/{Citu-dNT.js → B1ySs1Ps.js} +1 -1
- package/web/app/immutable/chunks/{DmJbtm9p.js → B3pWDt4A.js} +2 -2
- package/web/app/immutable/chunks/{CQMDPYtj.js → B5FPkuba.js} +1 -1
- package/web/app/immutable/chunks/{D5_2GYC0.js → B5gRIzZb.js} +1 -1
- package/web/app/immutable/chunks/{DMnHL_j_.js → B9e_lQGd.js} +1 -1
- package/web/app/immutable/chunks/{DE5Vt-mk.js → BAJdDJmt.js} +1 -1
- package/web/app/immutable/chunks/{ggRICgWE.js → BBfmiZwR.js} +1 -1
- package/web/app/immutable/chunks/{KG68UpwU.js → BCFfKX9W.js} +1 -1
- package/web/app/immutable/chunks/{C9k7mgs4.js → BDUAehdP.js} +4 -4
- package/web/app/immutable/chunks/{COMfKjnL.js → BFnbk-Kf.js} +1 -1
- package/web/app/immutable/chunks/{CG9-31He.js → BGGzsVfR.js} +1 -1
- package/web/app/immutable/chunks/{mkPaye9m.js → BIDHEGct.js} +1 -1
- package/web/app/immutable/chunks/{DnCf3QiL.js → BIOk6wuV.js} +1 -1
- package/web/app/immutable/chunks/{CnWtv34Y.js → BJ_6izfA.js} +7 -7
- package/web/app/immutable/chunks/{D54_bMKf.js → BMPb03sg.js} +1 -1
- package/web/app/immutable/chunks/{Bloa0suE.js → BNVzhw1y.js} +1 -1
- package/web/app/immutable/chunks/{hOR9B4V4.js → BO9EbiHx.js} +1 -1
- package/web/app/immutable/chunks/{CXtOOnh0.js → BPC4nNQe.js} +1 -1
- package/web/app/immutable/chunks/{CoJOpuAN.js → BRKe81M1.js} +1 -1
- package/web/app/immutable/chunks/{Ce8PMxuE.js → BSuE_PI2.js} +1 -1
- package/web/app/immutable/chunks/{8Q_Was_5.js → BTIw3yd0.js} +1 -1
- package/web/app/immutable/chunks/{DaqPl4Tz.js → BTeM7_LX.js} +1 -1
- package/web/app/immutable/chunks/{ClOUpVZZ.js → BVTor63R.js} +1 -1
- package/web/app/immutable/chunks/{BhkBe7Jc.js → BW_04noU.js} +1 -1
- package/web/app/immutable/chunks/{bDcdMMyl.js → BWerHQW_.js} +1 -1
- package/web/app/immutable/chunks/{CItSvrO_.js → BX8IWbyz.js} +2 -2
- package/web/app/immutable/chunks/{Cu4QpKDr.js → BYZmS9Dk.js} +1 -1
- package/web/app/immutable/chunks/{DGW6wXEq.js → B_vcNRuc.js} +1 -1
- package/web/app/immutable/chunks/{DuInbvT4.js → BapFUUqZ.js} +1 -1
- package/web/app/immutable/chunks/{BAbzdNi8.js → BdCx7DnP.js} +1 -1
- package/web/app/immutable/chunks/{CUMro1vx.js → BghpE59-.js} +1 -1
- package/web/app/immutable/chunks/{B-JIdXlm.js → BhYLt5th.js} +1 -1
- package/web/app/immutable/chunks/{Drgj5uDM.js → Bk5SMnS3.js} +43 -43
- package/web/app/immutable/chunks/{C4-u_VtZ.js → BlDfHMda.js} +1 -1
- package/web/app/immutable/chunks/{DmUU4JxK.js → BlPj7Bqh.js} +1 -1
- package/web/app/immutable/chunks/{B220ai_K.js → Bo2QS6PZ.js} +1 -1
- package/web/app/immutable/chunks/{CJzvjWBQ.js → Bo7YWMXl.js} +1 -1
- package/web/app/immutable/chunks/{knnjLtf9.js → BuXA0uuF.js} +1 -1
- package/web/app/immutable/chunks/{C5MJ7BeC.js → BvgUrOVR.js} +1 -1
- package/web/app/immutable/chunks/{DIceyoUA.js → BxC2yVbF.js} +1 -1
- package/web/app/immutable/chunks/{CtcF6bbr.js → BxgeL5Cn.js} +2 -2
- package/web/app/immutable/chunks/{EzIyeu9q.js → BzDjODLF.js} +1 -1
- package/web/app/immutable/chunks/{BVJeg9VF.js → BzwTpGAs.js} +3 -3
- package/web/app/immutable/chunks/{DYywvoax.js → C-yDVBGV.js} +1 -1
- package/web/app/immutable/chunks/{qwx0AE4b.js → C0DySWij.js} +1 -1
- package/web/app/immutable/chunks/{CXqGB8i2.js → C4Zy0P7R.js} +1 -1
- package/web/app/immutable/chunks/{DsHbB0Gk.js → C4wwbPuR.js} +1 -1
- package/web/app/immutable/chunks/{DediWp9-.js → C6PYFU8v.js} +1 -1
- package/web/app/immutable/chunks/{DeI8FMuz.js → C9dil5-t.js} +1 -1
- package/web/app/immutable/chunks/{BXU_OYLJ.js → CB1wD_PC.js} +1 -1
- package/web/app/immutable/chunks/CDxER840.js +1 -0
- package/web/app/immutable/chunks/{tkZmaR4M.js → CEOoXkJa.js} +4 -4
- package/web/app/immutable/chunks/{CiBStNAr.js → CEs-7mch.js} +3 -3
- package/web/app/immutable/chunks/{Q-IbWJI_.js → CFgK9GfH.js} +1 -1
- package/web/app/immutable/chunks/{DZKVhZfO.js → CGwmPMQc.js} +1 -1
- package/web/app/immutable/chunks/{Cr5KYQBW.js → CHDy3QTf.js} +1 -1
- package/web/app/immutable/chunks/{DoOAeI0m.js → CK1vqkSE.js} +1 -1
- package/web/app/immutable/chunks/{BQY3g8uE.js → CKI5DKl7.js} +6 -6
- package/web/app/immutable/chunks/{0_FDVEla.js → CKj5bwOX.js} +1 -1
- package/web/app/immutable/chunks/{DELLe_1a.js → CMAl4tQM.js} +1 -1
- package/web/app/immutable/chunks/{k6s8dGrA.js → CMQqNZFP.js} +1 -1
- package/web/app/immutable/chunks/{BJn7bayT.js → CMS0Mt7v.js} +1 -1
- package/web/app/immutable/chunks/{B2jj_YAX.js → CORu-AyV.js} +1 -1
- package/web/app/immutable/chunks/{CMBaQAuw.js → COuOkYRg.js} +1 -1
- package/web/app/immutable/chunks/{Jf6CJclx.js → CPBiF1gr.js} +1 -1
- package/web/app/immutable/chunks/{B7VWEjxq.js → CS1PgLFW.js} +1 -1
- package/web/app/immutable/chunks/{DsrgAjSN.js → CSiZwu1h.js} +1 -1
- package/web/app/immutable/chunks/{6Ql_vn7X.js → CT_wb7-d.js} +1 -1
- package/web/app/immutable/chunks/{BRwNKwD7.js → CTt3kMm1.js} +1 -1
- package/web/app/immutable/chunks/{Dma9ms7u.js → CUl5WBR5.js} +1 -1
- package/web/app/immutable/chunks/{Bzu3FrPq.js → CUt6iXkF.js} +1 -1
- package/web/app/immutable/chunks/{BGv3Ttev.js → CYfBmNaT.js} +1 -1
- package/web/app/immutable/chunks/{B-OGKYEx.js → C_-tA5vs.js} +1 -1
- package/web/app/immutable/chunks/{Mjh5v3L0.js → C_VMQN67.js} +1 -1
- package/web/app/immutable/chunks/{DCv8NaxM.js → C_uqctJM.js} +1 -1
- package/web/app/immutable/chunks/{BEgosT1d.js → CaibRh-G.js} +1 -1
- package/web/app/immutable/chunks/{CeX5z_vs.js → Cavwt8Mn.js} +1 -1
- package/web/app/immutable/chunks/{Pq3i4zFA.js → Cdz-CHGd.js} +1 -1
- package/web/app/immutable/chunks/{B8S_XDvA.js → CfM2ZJef.js} +1 -1
- package/web/app/immutable/chunks/{DdV_6_CH.js → Cg_QSby7.js} +1 -1
- package/web/app/immutable/chunks/{DVnNWj1L.js → Cl5KdYjm.js} +1 -1
- package/web/app/immutable/chunks/{CS5VoVeF.js → Cn23SDXY.js} +1 -1
- package/web/app/immutable/chunks/{CixlkwsU.js → Cnlend6s.js} +1 -1
- package/web/app/immutable/chunks/{CZE4HQ01.js → CqnucWm4.js} +1 -1
- package/web/app/immutable/chunks/{DNyxd11M.js → Crq2Gvaa.js} +1 -1
- package/web/app/immutable/chunks/{BBNnH_sw.js → CsqCa0Sd.js} +2 -2
- package/web/app/immutable/chunks/{BspPTfLp.js → CuG6uIIP.js} +1 -1
- package/web/app/immutable/chunks/{BwlxTP6m.js → Cvg7bd3W.js} +1 -1
- package/web/app/immutable/chunks/{CHeQtCyR.js → CwnyA6hc.js} +1 -1
- package/web/app/immutable/chunks/{BWljXDfF.js → Cx089QrC.js} +1 -1
- package/web/app/immutable/chunks/{Denyu19x.js → D-s4Q5GN.js} +1 -1
- package/web/app/immutable/chunks/{CEFx_w_J.js → D2gIe4Fc.js} +1 -1
- package/web/app/immutable/chunks/{DZwXyTtM.js → D6IXX0lv.js} +1 -1
- package/web/app/immutable/chunks/{Dcbdz0Jw.js → D6Id8WlN.js} +1 -1
- package/web/app/immutable/chunks/{Dl3AQcJn.js → D9hi6Z3O.js} +1 -1
- package/web/app/immutable/chunks/{BLn5rsUE.js → D9iN-aHM.js} +1 -1
- package/web/app/immutable/chunks/{DvqgRsDd.js → DD1-zRxp.js} +1 -1
- package/web/app/immutable/chunks/{NDnZ2f46.js → DE5Smm9m.js} +1 -1
- package/web/app/immutable/chunks/{BEj-d9Cx.js → DFoGBie-.js} +1 -1
- package/web/app/immutable/chunks/{CzeYC5kK.js → DG__gHhd.js} +1 -1
- package/web/app/immutable/chunks/{Vx0IIPew.js → DIlG6FTS.js} +1 -1
- package/web/app/immutable/chunks/{BrAaVsFz.js → DK1vbm9l.js} +1 -1
- package/web/app/immutable/chunks/{8EDHNAa0.js → DKs2ftKN.js} +1 -1
- package/web/app/immutable/chunks/{B4Ys_Zqk.js → DLoJFSfZ.js} +1 -1
- package/web/app/immutable/chunks/{Ciihhv86.js → DMC7qMUv.js} +1 -1
- package/web/app/immutable/chunks/{T995SloE.js → DMcsIxoO.js} +1 -1
- package/web/app/immutable/chunks/{BeAhMSSb.js → DNmVxfYt.js} +8 -8
- package/web/app/immutable/chunks/{B_iqW4nZ.js → DOGdTp2m.js} +1 -1
- package/web/app/immutable/chunks/{UMA3RT0s.js → DR58OcKC.js} +1 -1
- package/web/app/immutable/chunks/{BggwWRGf.js → DR9205pL.js} +1 -1
- package/web/app/immutable/chunks/{p8msS16l.js → DTSOJB0e.js} +1 -1
- package/web/app/immutable/chunks/{CSdV5_bj.js → DXwDIYHN.js} +1 -1
- package/web/app/immutable/chunks/{DJ00LNUR.js → DYd7w17e.js} +1 -1
- package/web/app/immutable/chunks/{yQ0Z1VHW.js → DYrK-s5W.js} +1 -1
- package/web/app/immutable/chunks/{C-VIKqni.js → DYztlXyW.js} +1 -1
- package/web/app/immutable/chunks/{Dj_FVUHS.js → DZ5koqO7.js} +1 -1
- package/web/app/immutable/chunks/{D_Ou_6lS.js → D_m0iYjs.js} +1 -1
- package/web/app/immutable/chunks/{DvrTNX0e.js → DadwIC0R.js} +1 -1
- package/web/app/immutable/chunks/{B9G1J12P.js → DbKrZJmS.js} +6 -6
- package/web/app/immutable/chunks/{DU4GH855.js → DbY-sUwj.js} +1 -1
- package/web/app/immutable/chunks/{DZCBh97_.js → DcE_Ld1a.js} +1 -1
- package/web/app/immutable/chunks/{42GHkgj6.js → DdKmPHVm.js} +1 -1
- package/web/app/immutable/chunks/{SNezQIpP.js → DffgEGrv.js} +1 -1
- package/web/app/immutable/chunks/{eEZIbdzf.js → DfiXlh8D.js} +1 -1
- package/web/app/immutable/chunks/{DNKZQCox.js → DiDcqoCZ.js} +1 -1
- package/web/app/immutable/chunks/{Cu8J93FR.js → Dj5vfD48.js} +3 -3
- package/web/app/immutable/chunks/{i9DVPIlR.js → DjVfE_Ds.js} +1 -1
- package/web/app/immutable/chunks/{DBdfwYFa.js → Dkg7fAiD.js} +1 -1
- package/web/app/immutable/chunks/{DrHxWi1S.js → DkraFhXS.js} +1 -1
- package/web/app/immutable/chunks/{BWjmxT5D.js → DmtmsOtX.js} +1 -1
- package/web/app/immutable/chunks/{4I8WRxn6.js → Dovmtid-.js} +1 -1
- package/web/app/immutable/chunks/{BeLl-r8h.js → DpN6Ybfd.js} +1 -1
- package/web/app/immutable/chunks/{CVC-R1OI.js → DrWcQsKJ.js} +1 -1
- package/web/app/immutable/chunks/{CXdTWTzB.js → DvCCocml.js} +1 -1
- package/web/app/immutable/chunks/{DyVKK3zU.js → DwuPw74E.js} +1 -1
- package/web/app/immutable/chunks/{CzVv3uRF.js → Dz6pz6rM.js} +1 -1
- package/web/app/immutable/chunks/{DeBsmEqU.js → HcVsBsAl.js} +1 -1
- package/web/app/immutable/chunks/{DAjW_Z-R.js → Iu8s0xrk.js} +1 -1
- package/web/app/immutable/chunks/{Dzu7FPMr.js → LzWIYiXc.js} +1 -1
- package/web/app/immutable/chunks/{BlFUy1M_.js → McMSPwXq.js} +1 -1
- package/web/app/immutable/chunks/{CunMRDJl.js → NlCjCVxn.js} +1 -1
- package/web/app/immutable/chunks/{CjhAOkhP.js → NzxBab7c.js} +1 -1
- package/web/app/immutable/chunks/{7O3nfCeH.js → PeSBy6Q3.js} +1 -1
- package/web/app/immutable/chunks/{T1WqHZLZ.js → PnTDvXOe.js} +1 -1
- package/web/app/immutable/chunks/{BoaSTXep.js → SiYLjuDS.js} +1 -1
- package/web/app/immutable/chunks/{BXDl97pl.js → Syl_OSjA.js} +1 -1
- package/web/app/immutable/chunks/{w7xvX9oI.js → TV2_MWXe.js} +1 -1
- package/web/app/immutable/chunks/{BNrl_yXC.js → TWVlaXcj.js} +1 -1
- package/web/app/immutable/chunks/{BF75AbUh.js → U_cmHtqi.js} +1 -1
- package/web/app/immutable/chunks/{ClJKqwKB.js → UlQNHb3m.js} +1 -1
- package/web/app/immutable/chunks/{ymVYL-2H.js → Vwfej_EC.js} +1 -1
- package/web/app/immutable/chunks/{y8su61xq.js → WL4wAA6m.js} +2 -2
- package/web/app/immutable/chunks/{nz1YTpIq.js → XO84v1Z5.js} +1 -1
- package/web/app/immutable/chunks/{zl8SSmZq.js → b33seoH7.js} +1 -1
- package/web/app/immutable/chunks/{BL-4c5eP.js → dvgX5pbn.js} +1 -1
- package/web/app/immutable/chunks/{C9PGJX9n.js → fX819Pv6.js} +1 -1
- package/web/app/immutable/chunks/{CC4WmnL6.js → gMye6h60.js} +2 -2
- package/web/app/immutable/chunks/{BRMj8a4h.js → h6ZeyBNW.js} +1 -1
- package/web/app/immutable/chunks/{CXkYtIUm.js → ljZI5d7y.js} +1 -1
- package/web/app/immutable/chunks/{w0VuoJIl.js → mFLgyCOK.js} +1 -1
- package/web/app/immutable/chunks/{DBGO1w9a.js → pDn0_bm8.js} +1 -1
- package/web/app/immutable/chunks/{CvgQ9EkY.js → rgnRekX3.js} +1 -1
- package/web/app/immutable/chunks/{CM8AwG-k.js → sgMaD9-D.js} +1 -1
- package/web/app/immutable/chunks/{DWUInPKR.js → uR5KZKbl.js} +1 -1
- package/web/app/immutable/chunks/{CTmT5I7Z.js → udwHGMln.js} +1 -1
- package/web/app/immutable/chunks/{CUMzsmcb.js → ulG7NA7z.js} +1 -1
- package/web/app/immutable/chunks/{Cw1gOOP4.js → wD4fx_9g.js} +1 -1
- package/web/app/immutable/chunks/{Dmf4WObG.js → x0rjHUHa.js} +1 -1
- package/web/app/immutable/chunks/{C9jifMvI.js → yCx04g4X.js} +1 -1
- package/web/app/immutable/chunks/{BAXlZEur.js → yW4W7htU.js} +1 -1
- package/web/app/immutable/entry/{app.BgfLNpAH.js → app.CIVLA2a9.js} +2 -2
- package/web/app/immutable/entry/start.Cn76ZGVI.js +1 -0
- package/web/app/immutable/nodes/{0.B3w9utn7.js → 0.ACp4Nz4v.js} +1 -1
- package/web/app/immutable/nodes/{1.DaxXfawW.js → 1.DRnQyS6A.js} +1 -1
- package/web/app/immutable/nodes/{10.Ut2WO8-5.js → 10.CLkVRFBV.js} +1 -1
- package/web/app/immutable/nodes/{14.BS_itk_o.js → 14.9_BXzcxR.js} +1 -1
- package/web/app/immutable/nodes/{16.DXjz2v3H.js → 16.BMYUgPNR.js} +2 -2
- package/web/app/immutable/nodes/2.d5BGPrjO.js +9 -0
- package/web/app/immutable/nodes/{3.63ZtoTSA.js → 3.0E-ZGvKe.js} +1 -1
- package/web/app/immutable/nodes/{4.DDS6oK5o.js → 4.DSO5-jdr.js} +1 -1
- package/web/app/immutable/nodes/{5.DsTfq2mA.js → 5.BexFD7jH.js} +1 -1
- package/web/app/immutable/nodes/{6.BH8FJ3Wf.js → 6.CqlyGMy5.js} +1 -1
- package/web/app/immutable/nodes/{7.DW27zT40.js → 7.C2XKzJeK.js} +1 -1
- package/web/app/immutable/nodes/{8.B4CNA7De.js → 8.CMFpn5kb.js} +2 -2
- package/web/app/immutable/nodes/{9.Nt9iZ731.js → 9.BolTThFG.js} +1 -1
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/DJ_9F2bm.js +0 -1
- package/web/app/immutable/entry/start.DFg06W-g.js +0 -1
- package/web/app/immutable/nodes/2.CYzMuwKR.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Nt}from"./
|
|
1
|
+
import{p as Nt}from"./BPC4nNQe.js";import{p as Lt}from"./udwHGMln.js";import{aF as zt,K as At,O as Tt,aI as Xt,L as Et,aG as Yt,a as u,U as It,M as Bt,j as gt,ad as ut,aE as Ft,r as Ot,k as Rt,N as V}from"./BJ_6izfA.js";import{g as k}from"./CKI5DKl7.js";var q=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),X=u((o,r,e)=>({x:q(r,`${e} evolution`),y:q(o,`${e} visibility`)}),"toCoordinates"),yt=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Wt=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Dt=u((o,r)=>{if(Nt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=X(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=X(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=X(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,S=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=q(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",S,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=yt(e.fromPort)??yt(e.toPort);const{flow:d,label:w}=Wt(e.arrow);!a&&d&&(a=d);const S=e.linkLabel,g=w??S;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=q(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=X(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=X(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=X(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=X(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),wt={parser:{yy:void 0},parse:u(async o=>{const r=await Lt("wardley",o);ut.debug(r);const e=wt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dt(r,e)},"parse")},E,Gt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},k(E,"WardleyBuilder"),u(E,"WardleyBuilder"),E),b=new Gt;function U(){return V()["wardley-beta"]}k(U,"getConfig3");u(U,"getConfig");function Z(o,r,e,h,a,d,w,S,g){b.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:S,sourceStrategy:g})}k(Z,"addNode");u(Z,"addNode");function K(o,r,e=!1,h,a){b.addLink({source:o,target:r,dashed:e,label:h,flow:a})}k(K,"addLink");u(K,"addLink");function J(o,r,e){b.addTrend({nodeId:o,targetX:r,targetY:e})}k(J,"addTrend");u(J,"addTrend");function Q(o,r,e){b.addAnnotation({number:o,coordinates:r,text:e})}k(Q,"addAnnotation");u(Q,"addAnnotation");function tt(o,r,e){b.addNote({text:o,x:r,y:e})}k(tt,"addNote");u(tt,"addNote");function et(o,r,e){b.addAccelerator({name:o,x:r,y:e})}k(et,"addAccelerator");u(et,"addAccelerator");function at(o,r,e){b.addDeaccelerator({name:o,x:r,y:e})}k(at,"addDeaccelerator");u(at,"addDeaccelerator");function rt(o,r){b.setAnnotationsBox(o,r)}k(rt,"setAnnotationsBox");u(rt,"setAnnotationsBox");function ot(o,r){b.setSize(o,r)}k(ot,"setSize");u(ot,"setSize");function nt(o){b.startPipeline(o)}k(nt,"startPipeline");u(nt,"startPipeline");function st(o,r){b.addPipelineComponent(o,r)}k(st,"addPipelineComponent");u(st,"addPipelineComponent");function it(o){b.setAxes(o)}k(it,"updateAxes");u(it,"updateAxes");function dt(o){return b.getNode(o)}k(dt,"getNode");u(dt,"getNode");function lt(o){return b.resolveNodeId(o)}k(lt,"resolveNodeId");u(lt,"resolveNodeId");function ct(){return b.build()}k(ct,"getWardleyData");u(ct,"getWardleyData");function pt(){b.clear(),Rt()}k(pt,"clear2");u(pt,"clear");var qt={getConfig:U,addNode:Z,addLink:K,addTrend:J,addAnnotation:Q,addNote:tt,addAccelerator:et,addDeaccelerator:at,setAnnotationsBox:rt,setSize:ot,startPipeline:nt,addPipelineComponent:st,updateAxes:it,getNode:dt,resolveNodeId:lt,getWardleyData:ct,clear:pt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:Xt,getDiagramTitle:Tt,getAccDescription:At,setAccDescription:zt},Ht=["Genesis","Custom Built","Product","Commodity"],jt=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),_t=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{ut.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=_t(),d=jt(),w=a.nodeRadius*1.6,S=h.db,g=S.getWardleyData(),R=S.getDiagramTitle(),M=g.size?.width??a.width,$=g.size?.height??a.height,I=Ft(r);I.selectAll("*").remove(),Ot(I,$,M,a.useMaxWidth),I.attr("viewBox",`0 0 ${M} ${$}`);const P=I.append("g").attr("class","wardley-map"),H=I.append("defs");H.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",$).attr("fill",d.backgroundColor);const B=M-a.padding*2,F=$-a.padding*2;R&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*B,"projectX"),A=u(t=>$-a.padding-t/100*F,"projectY"),W=P.append("g").attr("class","wardley-axes");W.append("line").attr("x1",a.padding).attr("x2",M-a.padding).attr("y1",$-a.padding).attr("y2",$-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),W.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",$-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const mt=g.axes.xLabel??"Evolution",kt=g.axes.yLabel??"Visibility";W.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+B/2).attr("y",$-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(mt),W.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+F/2})`).text(kt);const O=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Ht;if(O.length>0){const t=P.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===O.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/O.length;O.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}O.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*B,x=a.padding+l.end*B,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",$-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",$-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+B*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",$-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",M-a.padding).attr("y1",$-a.padding-F*n).attr("y2",$-a.padding-F*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:A(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),s=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,C=c.get(n.nodeId);if(C){const L=(p+l)/2;C.x=L,C.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const ft=P.append("g").attr("class","wardley-links"),ht=new Map;g.pipelines.forEach(t=>{ht.set(t.nodeId,new Set(t.componentIds))});const xt=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||ht.get(t.target)?.has(t.source)));ft.selectAll("line").data(xt).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),ft.selectAll("text").data(xt.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,C=-l/x,L=i+m*y,D=p+C*y;let Y=Math.atan2(f,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${L} ${D})`}).text(t=>t.label);const bt=P.append("g").attr("class","wardley-trends"),$t=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=A(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);bt.selectAll("line").data($t).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const N=P.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));N.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),N.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),N.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=N.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),N.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const j=a.nodeRadius*.7,v=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-v).attr("x2",t=>c.get(t.id).x-v*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-v*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+v*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+v*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-v).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-v).attr("r",j).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-v*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("r",j).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+v*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("r",j).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),N.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),N.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),N.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:A(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=A(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,C)=>m.number-C.number),y=[];if(x.forEach((m,C)=>{const L=f.append("text").attr("x",s+i).attr("y",n+i+(C+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(L)}),y.length>0){let m=0,C=0;y.forEach(_=>{const G=_.node(),St=G.getComputedTextLength();m=Math.max(m,St);const Mt=G.getBBox();C=Math.max(C,Mt.height)});const L=m+i*2+105,D=x.length*p+i*2+C/2,Y=a.padding,vt=M-a.padding-L,Pt=a.padding,Ct=$-a.padding-D;s=Math.max(Y,Math.min(s,vt)),n=Math.max(Pt,Math.min(n,Ct)),y.forEach((_,G)=>{_.attr("x",s+i).attr("y",n+i+(G+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",L).attr("height",D).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=P.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=A(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=A(s.y),p=60,l=30,f=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-f} ${i-l/2}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as r,a as s,c as e,C as t}from"./
|
|
1
|
+
import{s as r,a as s,c as e,C as t}from"./BlDfHMda.js";import{f as l}from"./CKI5DKl7.js";var d={parser:e,get db(){return new t},renderer:s,styles:r,init:l(a=>{a.class||(a.class={}),a.class.arrowMarkerAbsolute=a.arrowMarkerAbsolute},"init")};export{d as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as ue,K as fe,O as he,aI as de,L as ge,aG as ye,a as _,M as Kt,aE as xe,d as pe,a8 as me,aR as Gt,aa as be,w as ve,r as Se,k as Ie,j as Me,y as ke}from"./CnWtv34Y.js";import{c3 as yt,g as v}from"./BQY3g8uE.js";var qt=1e-10;function it(t,n){const s=Wt(t),e=s.filter(l=>Ut(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=vt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const x={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],k=Math.atan2(a.x-p.x,a.y-p.y),z=Math.atan2(f.x-p.x,f.y-p.y);let T=z-k;T<0&&(T+=2*Math.PI);const w=z-T/2;let g=K(x,{x:p.x+p.radius*Math.sin(w),y:p.y+p.radius*Math.cos(w)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=at(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-qt,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}v(it,"intersectionArea");function Ut(t,n){return n.every(s=>K(t,s)<s.radius+qt)}v(Ut,"containedInCircles");function Wt(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=bt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}v(Wt,"getIntersectionPoints");function at(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}v(at,"circleArea");function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}v(K,"distance");function dt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return at(t,e)+at(n,i)}v(dt,"circleOverlap");function bt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}v(bt,"circleCircleIntersection");function vt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}v(vt,"getCenter");function Ht(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,x=t(a);if(x*r>=0&&(n=a),Math.abs(f)<o||x===0)return a}return n+f}v(Ht,"bisect");function lt(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}v(lt,"zeros");function xt(t,n){return lt(t).map(()=>lt(n))}v(xt,"zerosM");function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}v(tt,"dot");function ct(t){return Math.sqrt(tt(t,t))}v(ct,"norm2");function ut(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}v(ut,"scale");function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}v(Z,"weightedSum");function St(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,x=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let S=0;S<b;++S){const c=n.slice();c[S]=c[S]?c[S]*i:o,p[S+1]=c,p[S+1].fx=t(c),p[S+1].id=S+1}function k(S){for(let c=0;c<S.length;c++)p[b][c]=S[c];p[b].fx=S.fx}v(k,"updateSimplex");const z=v((S,c)=>S.fx-c.fx,"sortOrder"),T=n.slice(),w=n.slice(),g=n.slice(),m=n.slice();for(let S=0;S<e;++S){if(p.sort(z),s.history){const y=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});y.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:y})}h=0;for(let y=0;y<b;++y)h=Math.max(h,Math.abs(p[0][y]-p[1][y]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let y=0;y<b;++y){T[y]=0;for(let d=0;d<b;++d)T[y]+=p[d][y];T[y]/=b}const c=p[b];if(Z(w,1+f,T,-f,c),w.fx=t(w),w.fx<p[0].fx)Z(m,1+u,T,-u,c),m.fx=t(m),m.fx<w.fx?k(m):k(w);else if(w.fx>=p[b-1].fx){let y=!1;if(w.fx>c.fx?(Z(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?k(g):y=!0):(Z(g,1-a*f,T,a*f,c),g.fx=t(g),g.fx<w.fx?k(g):y=!0),y){if(x>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-x,p[0],x,p[d]),p[d].fx=t(p[d])}}else k(w)}return p.sort(z),{fx:p[0].fx,x:p[0]}}v(St,"nelderMead");function Yt(t,n,s,e,i,o,r){const l=s.fx,f=tt(s.fxprime,n);let u=l,a=l,x=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,k,z){for(let T=0;T<16;++T)if(i=(p+k)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),x=tt(e.fxprime,n),u>l+o*i*f||u>=z)k=i;else{if(Math.abs(x)<=-r*f)return i;x*(k-p)>=0&&(k=p),p=i,z=u}return 0}v(b,"zoom");for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),x=tt(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(x)<=-r*f)return i;if(x>=0)return b(i,h,u);a=u,h=i,i*=2}return i}v(Yt,"wolfeLineSearch");function Xt(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ut(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=Yt(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ut(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const x=tt(e.fxprime,e.fxprime),h=Math.max(0,tt(o,i.fxprime)/x);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ct(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}v(Xt,"conjugateGradient");function It(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||te,e=n.lossFunction||et,i=Jt(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=St(a=>{const x={};for(let h=0;h<r.length;++h){const b=r[h];x[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(x,i)},l,n).x;for(let a=0;a<r.length;++a){const x=r[a];o[x].x=u[2*a],o[x].y=u[2*a+1]}return o}v(It,"venn");var Zt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Zt?Math.abs(t-n):Ht(e=>dt(t,n,e)-s,0,t+n)}v(ft,"distanceFromIntersectArea");function Jt(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(v(i,"toKey"),s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let x=u+1;x<f.sets.length;x++){const h=String(f.sets[x]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}v(Jt,"addMissingAreas");function Qt(t,n,s){const e=xt(n.length,n.length),i=xt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(f,u,o.size);e[r][l]=e[l][r]=a;let x=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?x=1:o.size<=1e-10&&(x=-1),i[r][l]=i[l][r]=x}),{distances:e,constraints:i}}v(Qt,"getDistanceMatrices");function $t(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],x=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),k=b-x*x;h>0&&p<=x||h<0&&p>=x||(i+=2*k*k,n[2*o]+=4*k*(r-u),n[2*o+1]+=4*k*(l-a),n[2*f]+=4*k*(u-r),n[2*f+1]+=4*k*(a-l))}}return i}v($t,"constrainedMDSGradient");function te(t,n={}){let s=ne(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ee(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}v(te,"bestInitialLayout");function ee(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=Qt(t,e,i);const l=ct(o.map(ct))/o.length;o=o.map(h=>h.map(b=>b/l));const f=v((h,b)=>$t(h,b,o,r),"obj");let u=null;for(let h=0;h<s;++h){const b=lt(o.length*2).map(Math.random),p=Xt(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,x={};for(let h=0;h<e.length;++h){const b=e[h];x[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ut(h.x,l);return x}v(ee,"constrainedMDSLayout");function ne(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const x of t)if(x.sets.length===1){const h=x.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:x.size,radius:Math.sqrt(x.size/Math.PI)},i[h]=[]}t=t.filter(x=>x.sets.length===2);for(const x of t){let h=x.weight!=null?x.weight:1;const b=x.sets[0],p=x.sets[1];x.size+Zt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:x.size,weight:h}),i[p].push({set:b,size:x.size,weight:h})}const o=[];Object.keys(i).forEach(x=>{let h=0;for(let b=0;b<i[x].length;++b)h+=i[x][b].size*i[x][b].weight;o.push({set:x,size:h})});function r(x,h){return h.size-x.size}v(r,"sortOrder"),o.sort(r);const l={};function f(x){return x.set in l}v(f,"isPositioned");function u(x,h){e[h].x=x.x,e[h].y=x.y,l[h]=!0}v(u,"positionSet"),u({x:0,y:0},o[0].set);for(let x=1;x<o.length;++x){const h=o[x].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const k=[];for(var a=0;a<b.length;++a){const w=e[b[a].set],g=ft(p.radius,w.radius,b[a].size);k.push({x:w.x+g,y:w.y}),k.push({x:w.x-g,y:w.y}),k.push({y:w.y+g,x:w.x}),k.push({y:w.y-g,x:w.x});for(let m=a+1;m<b.length;++m){const S=e[b[m].set],c=ft(p.radius,S.radius,b[m].size),y=bt({x:w.x,y:w.y,radius:g},{x:S.x,y:S.y,radius:c});k.push(...y)}}let z=1e50,T=k[0];for(const w of k){e[h].x=w.x,e[h].y=w.y;const g=s(e,t);g<z&&(z=g,T=w)}u(T,h)}return e}v(ne,"greedyLayout");function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=dt(r.radius,l.radius,K(r,l))}else i=it(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}v(et,"lossFunction");function Mt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=dt(l.radius,f.radius,K(l,f))}else i=it(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}v(Mt,"logRatioLossFunction");function se(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}v(se,"orientateCircles");function ie(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}v(n,"find");function s(i,o){const r=n(i),l=n(o);r.parent=l}v(s,"union");for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;K(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}v(ie,"disjointCluster");function ht(t){const n=v(s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}},"minMax");return{xRange:n("x"),yRange:n("y")}}v(ht,"getBoundingBox");function kt(t,n,s){n==null&&(n=Math.PI/2);let e=Tt(t).map(u=>Object.assign({},u));const i=ie(e);for(const u of i){se(u,n,s);const a=ht(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,x){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const k=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;k<0&&(b+=k)}if(x)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const k=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;k<0&&(p+=k)}for(const k of u)k.x+=b,k.y+=p,e.push(k)}v(l,"addCluster");let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=ht(e);return _t(e)}v(kt,"normalizeSolution");function wt(t,n,s,e,i){const o=Tt(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=ht(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),x=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return _t(o.map(b=>({radius:a*b.radius,x:e+x+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}v(wt,"scaleSolution");function _t(t){const n={};for(const s of t)n[s.setid]=s;return n}v(_t,"toObjectNotation");function Tt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}v(Tt,"fromObjectNotation");function oe(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,x=null,h=null,b=!1,p=null,k=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,z={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=v(function(y){if(y in z)return z[y];var d=z[y]=T[w];return w+=1,w>=T.length&&(w=0),d},"colours"),m=It,S=et;function c(y){let d=y.datum();const D=new Set;d.forEach(M=>{M.size==0&&M.sets.length==1&&D.add(M.sets[0])}),d=d.filter(M=>!M.sets.some(F=>D.has(F)));let I={},O={};if(d.length>0){let M=m(d,{lossFunction:S,distinct:b});l&&(M=kt(M,r,h)),I=wt(M,s,e,i,f),O=zt(I,d,k)}const U={};d.forEach(M=>{M.label&&(U[M.sets]=M.label)});function B(M){if(M.sets in U)return U[M.sets];if(M.sets.length==1)return""+M.sets[0]}v(B,"label"),y.selectAll("svg").data([I]).enter().append("svg");const P=y.select("svg");n?P.attr("viewBox",`0 0 ${s} ${e}`):P.attr("width",s).attr("height",e);const R={};let E=!1;P.selectAll(".venn-area path").each(function(M){const F=this.getAttribute("d");M.sets.length==1&&F&&!b&&(E=!0,R[M.sets[0]]=le(F))});function C(M){return F=>{const Y=M.sets.map(nt=>{let X=R[nt],Q=I[nt];return X||(X={x:s/2,y:e/2,radius:1}),Q||(Q={x:s/2,y:e/2,radius:1}),{x:X.x*(1-F)+Q.x*F,y:X.y*(1-F)+Q.y*F,radius:X.radius*(1-F)+Q.radius*F}});return pt(Y,p)}}v(C,"pathTween");const W=P.selectAll(".venn-area").data(d,M=>M.sets),V=W.enter().append("g").attr("class",M=>`venn-area venn-${M.sets.length==1?"circle":"intersection"}${M.colour||M.color?" venn-coloured":""}`).attr("data-venn-sets",M=>M.sets.join("_")),G=V.append("path"),j=V.append("text").attr("class","label").text(M=>B(M)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(G.style("fill-opacity","0").filter(M=>M.sets.length==1).style("fill",M=>M.colour?M.colour:M.color?M.color:g(M.sets)).style("fill-opacity",".25"),j.style("fill",M=>M.colour||M.color?"#FFF":t.textFill?t.textFill:M.sets.length==1?g(M.sets):"#444"));function q(M){return typeof M.transition=="function"?M.transition("venn").duration(o):M}v(q,"asTransition");let A=y;E&&typeof A.transition=="function"?(A=q(y),A.selectAll("path").attrTween("d",C)):A.selectAll("path").attr("d",M=>pt(M.sets.map(F=>I[F])),p);const N=A.selectAll("text").filter(M=>M.sets in O).text(M=>B(M)).attr("x",M=>Math.floor(O[M.sets].x)).attr("y",M=>Math.floor(O[M.sets].y));u&&(E?"on"in N?N.on("end",ot(I,B)):N.each("end",ot(I,B)):N.each(ot(I,B)));const L=q(W.exit()).remove();typeof W.transition=="function"&&L.selectAll("path").attrTween("d",C);const J=L.selectAll("text").attr("x",s/2).attr("y",e/2);return x!==null&&(j.style("font-size","0px"),N.style("font-size",x),J.style("font-size","0px")),{circles:I,textCentres:O,nodes:W,enter:V,update:A,exit:L}}return v(c,"chart"),c.wrap=function(y){return arguments.length?(u=y,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(y){return arguments.length?(s=y,c):s},c.height=function(y){return arguments.length?(e=y,c):e},c.padding=function(y){return arguments.length?(i=y,c):i},c.distinct=function(y){return arguments.length?(b=y,c):b},c.colours=function(y){return arguments.length?(g=y,c):g},c.colors=function(y){return arguments.length?(g=y,c):g},c.fontSize=function(y){return arguments.length?(x=y,c):x},c.round=function(y){return arguments.length?(p=y,c):p},c.duration=function(y){return arguments.length?(o=y,c):o},c.layoutFunction=function(y){return arguments.length?(m=y,c):m},c.normalize=function(y){return arguments.length?(l=y,c):l},c.scaleToFit=function(y){return arguments.length?(f=y,c):f},c.styled=function(y){return arguments.length?(a=y,c):a},c.orientation=function(y){return arguments.length?(r=y,c):r},c.orientationOrder=function(y){return arguments.length?(h=y,c):h},c.lossFunction=function(y){return arguments.length?(S=y==="default"?et:y==="logRatio"?Mt:y,c):S},c}v(oe,"VennDiagram");function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],x=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}v(p,"append");let k=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");k.textContent=g,g.length>f&&k.getComputedTextLength()>i&&(a.pop(),k.textContent=a.join(" "),a=[u],k=p(u),x++)}const z=.35-x*h/2,T=e.getAttribute("x"),w=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${z+m*h}em`)})}}v(ot,"wrapText");function rt(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-K(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=K(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}v(rt,"circleMargin");function Et(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=rt(e[0],t,n);for(let a=1;a<e.length;++a){const x=rt(e[a],t,n);x>=o&&(i=e[a],o=x)}const r=St(a=>-1*rt({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(K(l,a)>a.radius){f=!1;break}for(const a of n)if(K(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return it(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Et(t,[]):vt(u.arcs.map(a=>a.p1))}v(Et,"computeTextCentre");function re(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=K(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}v(re,"getOverlappingCircles");function zt(t,n,s){const e={},i=re(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const x=Et(u,a,s);e[r]=x,x.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}v(zt,"computeTextCentres");function ae(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{aF as ue,K as fe,O as he,aI as de,L as ge,aG as ye,a as _,M as Kt,aE as xe,d as pe,a8 as me,aR as Gt,aa as be,w as ve,r as Se,k as Ie,j as Me,y as ke}from"./BJ_6izfA.js";import{c3 as yt,g as v}from"./CKI5DKl7.js";var qt=1e-10;function it(t,n){const s=Wt(t),e=s.filter(l=>Ut(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=vt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const x={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],k=Math.atan2(a.x-p.x,a.y-p.y),z=Math.atan2(f.x-p.x,f.y-p.y);let T=z-k;T<0&&(T+=2*Math.PI);const w=z-T/2;let g=K(x,{x:p.x+p.radius*Math.sin(w),y:p.y+p.radius*Math.cos(w)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=at(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-qt,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}v(it,"intersectionArea");function Ut(t,n){return n.every(s=>K(t,s)<s.radius+qt)}v(Ut,"containedInCircles");function Wt(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=bt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}v(Wt,"getIntersectionPoints");function at(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}v(at,"circleArea");function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}v(K,"distance");function dt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return at(t,e)+at(n,i)}v(dt,"circleOverlap");function bt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}v(bt,"circleCircleIntersection");function vt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}v(vt,"getCenter");function Ht(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,x=t(a);if(x*r>=0&&(n=a),Math.abs(f)<o||x===0)return a}return n+f}v(Ht,"bisect");function lt(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}v(lt,"zeros");function xt(t,n){return lt(t).map(()=>lt(n))}v(xt,"zerosM");function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}v(tt,"dot");function ct(t){return Math.sqrt(tt(t,t))}v(ct,"norm2");function ut(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}v(ut,"scale");function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}v(Z,"weightedSum");function St(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,x=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let S=0;S<b;++S){const c=n.slice();c[S]=c[S]?c[S]*i:o,p[S+1]=c,p[S+1].fx=t(c),p[S+1].id=S+1}function k(S){for(let c=0;c<S.length;c++)p[b][c]=S[c];p[b].fx=S.fx}v(k,"updateSimplex");const z=v((S,c)=>S.fx-c.fx,"sortOrder"),T=n.slice(),w=n.slice(),g=n.slice(),m=n.slice();for(let S=0;S<e;++S){if(p.sort(z),s.history){const y=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});y.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:y})}h=0;for(let y=0;y<b;++y)h=Math.max(h,Math.abs(p[0][y]-p[1][y]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let y=0;y<b;++y){T[y]=0;for(let d=0;d<b;++d)T[y]+=p[d][y];T[y]/=b}const c=p[b];if(Z(w,1+f,T,-f,c),w.fx=t(w),w.fx<p[0].fx)Z(m,1+u,T,-u,c),m.fx=t(m),m.fx<w.fx?k(m):k(w);else if(w.fx>=p[b-1].fx){let y=!1;if(w.fx>c.fx?(Z(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?k(g):y=!0):(Z(g,1-a*f,T,a*f,c),g.fx=t(g),g.fx<w.fx?k(g):y=!0),y){if(x>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-x,p[0],x,p[d]),p[d].fx=t(p[d])}}else k(w)}return p.sort(z),{fx:p[0].fx,x:p[0]}}v(St,"nelderMead");function Yt(t,n,s,e,i,o,r){const l=s.fx,f=tt(s.fxprime,n);let u=l,a=l,x=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,k,z){for(let T=0;T<16;++T)if(i=(p+k)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),x=tt(e.fxprime,n),u>l+o*i*f||u>=z)k=i;else{if(Math.abs(x)<=-r*f)return i;x*(k-p)>=0&&(k=p),p=i,z=u}return 0}v(b,"zoom");for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),x=tt(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(x)<=-r*f)return i;if(x>=0)return b(i,h,u);a=u,h=i,i*=2}return i}v(Yt,"wolfeLineSearch");function Xt(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ut(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=Yt(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ut(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const x=tt(e.fxprime,e.fxprime),h=Math.max(0,tt(o,i.fxprime)/x);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ct(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}v(Xt,"conjugateGradient");function It(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||te,e=n.lossFunction||et,i=Jt(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=St(a=>{const x={};for(let h=0;h<r.length;++h){const b=r[h];x[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(x,i)},l,n).x;for(let a=0;a<r.length;++a){const x=r[a];o[x].x=u[2*a],o[x].y=u[2*a+1]}return o}v(It,"venn");var Zt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Zt?Math.abs(t-n):Ht(e=>dt(t,n,e)-s,0,t+n)}v(ft,"distanceFromIntersectArea");function Jt(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(v(i,"toKey"),s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let x=u+1;x<f.sets.length;x++){const h=String(f.sets[x]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}v(Jt,"addMissingAreas");function Qt(t,n,s){const e=xt(n.length,n.length),i=xt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(f,u,o.size);e[r][l]=e[l][r]=a;let x=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?x=1:o.size<=1e-10&&(x=-1),i[r][l]=i[l][r]=x}),{distances:e,constraints:i}}v(Qt,"getDistanceMatrices");function $t(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],x=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),k=b-x*x;h>0&&p<=x||h<0&&p>=x||(i+=2*k*k,n[2*o]+=4*k*(r-u),n[2*o+1]+=4*k*(l-a),n[2*f]+=4*k*(u-r),n[2*f+1]+=4*k*(a-l))}}return i}v($t,"constrainedMDSGradient");function te(t,n={}){let s=ne(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ee(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}v(te,"bestInitialLayout");function ee(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=Qt(t,e,i);const l=ct(o.map(ct))/o.length;o=o.map(h=>h.map(b=>b/l));const f=v((h,b)=>$t(h,b,o,r),"obj");let u=null;for(let h=0;h<s;++h){const b=lt(o.length*2).map(Math.random),p=Xt(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,x={};for(let h=0;h<e.length;++h){const b=e[h];x[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ut(h.x,l);return x}v(ee,"constrainedMDSLayout");function ne(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const x of t)if(x.sets.length===1){const h=x.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:x.size,radius:Math.sqrt(x.size/Math.PI)},i[h]=[]}t=t.filter(x=>x.sets.length===2);for(const x of t){let h=x.weight!=null?x.weight:1;const b=x.sets[0],p=x.sets[1];x.size+Zt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:x.size,weight:h}),i[p].push({set:b,size:x.size,weight:h})}const o=[];Object.keys(i).forEach(x=>{let h=0;for(let b=0;b<i[x].length;++b)h+=i[x][b].size*i[x][b].weight;o.push({set:x,size:h})});function r(x,h){return h.size-x.size}v(r,"sortOrder"),o.sort(r);const l={};function f(x){return x.set in l}v(f,"isPositioned");function u(x,h){e[h].x=x.x,e[h].y=x.y,l[h]=!0}v(u,"positionSet"),u({x:0,y:0},o[0].set);for(let x=1;x<o.length;++x){const h=o[x].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const k=[];for(var a=0;a<b.length;++a){const w=e[b[a].set],g=ft(p.radius,w.radius,b[a].size);k.push({x:w.x+g,y:w.y}),k.push({x:w.x-g,y:w.y}),k.push({y:w.y+g,x:w.x}),k.push({y:w.y-g,x:w.x});for(let m=a+1;m<b.length;++m){const S=e[b[m].set],c=ft(p.radius,S.radius,b[m].size),y=bt({x:w.x,y:w.y,radius:g},{x:S.x,y:S.y,radius:c});k.push(...y)}}let z=1e50,T=k[0];for(const w of k){e[h].x=w.x,e[h].y=w.y;const g=s(e,t);g<z&&(z=g,T=w)}u(T,h)}return e}v(ne,"greedyLayout");function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=dt(r.radius,l.radius,K(r,l))}else i=it(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}v(et,"lossFunction");function Mt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=dt(l.radius,f.radius,K(l,f))}else i=it(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}v(Mt,"logRatioLossFunction");function se(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}v(se,"orientateCircles");function ie(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}v(n,"find");function s(i,o){const r=n(i),l=n(o);r.parent=l}v(s,"union");for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;K(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}v(ie,"disjointCluster");function ht(t){const n=v(s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}},"minMax");return{xRange:n("x"),yRange:n("y")}}v(ht,"getBoundingBox");function kt(t,n,s){n==null&&(n=Math.PI/2);let e=Tt(t).map(u=>Object.assign({},u));const i=ie(e);for(const u of i){se(u,n,s);const a=ht(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,x){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const k=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;k<0&&(b+=k)}if(x)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const k=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;k<0&&(p+=k)}for(const k of u)k.x+=b,k.y+=p,e.push(k)}v(l,"addCluster");let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=ht(e);return _t(e)}v(kt,"normalizeSolution");function wt(t,n,s,e,i){const o=Tt(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=ht(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),x=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return _t(o.map(b=>({radius:a*b.radius,x:e+x+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}v(wt,"scaleSolution");function _t(t){const n={};for(const s of t)n[s.setid]=s;return n}v(_t,"toObjectNotation");function Tt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}v(Tt,"fromObjectNotation");function oe(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,x=null,h=null,b=!1,p=null,k=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,z={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=v(function(y){if(y in z)return z[y];var d=z[y]=T[w];return w+=1,w>=T.length&&(w=0),d},"colours"),m=It,S=et;function c(y){let d=y.datum();const D=new Set;d.forEach(M=>{M.size==0&&M.sets.length==1&&D.add(M.sets[0])}),d=d.filter(M=>!M.sets.some(F=>D.has(F)));let I={},O={};if(d.length>0){let M=m(d,{lossFunction:S,distinct:b});l&&(M=kt(M,r,h)),I=wt(M,s,e,i,f),O=zt(I,d,k)}const U={};d.forEach(M=>{M.label&&(U[M.sets]=M.label)});function B(M){if(M.sets in U)return U[M.sets];if(M.sets.length==1)return""+M.sets[0]}v(B,"label"),y.selectAll("svg").data([I]).enter().append("svg");const P=y.select("svg");n?P.attr("viewBox",`0 0 ${s} ${e}`):P.attr("width",s).attr("height",e);const R={};let E=!1;P.selectAll(".venn-area path").each(function(M){const F=this.getAttribute("d");M.sets.length==1&&F&&!b&&(E=!0,R[M.sets[0]]=le(F))});function C(M){return F=>{const Y=M.sets.map(nt=>{let X=R[nt],Q=I[nt];return X||(X={x:s/2,y:e/2,radius:1}),Q||(Q={x:s/2,y:e/2,radius:1}),{x:X.x*(1-F)+Q.x*F,y:X.y*(1-F)+Q.y*F,radius:X.radius*(1-F)+Q.radius*F}});return pt(Y,p)}}v(C,"pathTween");const W=P.selectAll(".venn-area").data(d,M=>M.sets),V=W.enter().append("g").attr("class",M=>`venn-area venn-${M.sets.length==1?"circle":"intersection"}${M.colour||M.color?" venn-coloured":""}`).attr("data-venn-sets",M=>M.sets.join("_")),G=V.append("path"),j=V.append("text").attr("class","label").text(M=>B(M)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(G.style("fill-opacity","0").filter(M=>M.sets.length==1).style("fill",M=>M.colour?M.colour:M.color?M.color:g(M.sets)).style("fill-opacity",".25"),j.style("fill",M=>M.colour||M.color?"#FFF":t.textFill?t.textFill:M.sets.length==1?g(M.sets):"#444"));function q(M){return typeof M.transition=="function"?M.transition("venn").duration(o):M}v(q,"asTransition");let A=y;E&&typeof A.transition=="function"?(A=q(y),A.selectAll("path").attrTween("d",C)):A.selectAll("path").attr("d",M=>pt(M.sets.map(F=>I[F])),p);const N=A.selectAll("text").filter(M=>M.sets in O).text(M=>B(M)).attr("x",M=>Math.floor(O[M.sets].x)).attr("y",M=>Math.floor(O[M.sets].y));u&&(E?"on"in N?N.on("end",ot(I,B)):N.each("end",ot(I,B)):N.each(ot(I,B)));const L=q(W.exit()).remove();typeof W.transition=="function"&&L.selectAll("path").attrTween("d",C);const J=L.selectAll("text").attr("x",s/2).attr("y",e/2);return x!==null&&(j.style("font-size","0px"),N.style("font-size",x),J.style("font-size","0px")),{circles:I,textCentres:O,nodes:W,enter:V,update:A,exit:L}}return v(c,"chart"),c.wrap=function(y){return arguments.length?(u=y,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(y){return arguments.length?(s=y,c):s},c.height=function(y){return arguments.length?(e=y,c):e},c.padding=function(y){return arguments.length?(i=y,c):i},c.distinct=function(y){return arguments.length?(b=y,c):b},c.colours=function(y){return arguments.length?(g=y,c):g},c.colors=function(y){return arguments.length?(g=y,c):g},c.fontSize=function(y){return arguments.length?(x=y,c):x},c.round=function(y){return arguments.length?(p=y,c):p},c.duration=function(y){return arguments.length?(o=y,c):o},c.layoutFunction=function(y){return arguments.length?(m=y,c):m},c.normalize=function(y){return arguments.length?(l=y,c):l},c.scaleToFit=function(y){return arguments.length?(f=y,c):f},c.styled=function(y){return arguments.length?(a=y,c):a},c.orientation=function(y){return arguments.length?(r=y,c):r},c.orientationOrder=function(y){return arguments.length?(h=y,c):h},c.lossFunction=function(y){return arguments.length?(S=y==="default"?et:y==="logRatio"?Mt:y,c):S},c}v(oe,"VennDiagram");function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],x=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}v(p,"append");let k=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");k.textContent=g,g.length>f&&k.getComputedTextLength()>i&&(a.pop(),k.textContent=a.join(" "),a=[u],k=p(u),x++)}const z=.35-x*h/2,T=e.getAttribute("x"),w=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${z+m*h}em`)})}}v(ot,"wrapText");function rt(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-K(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=K(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}v(rt,"circleMargin");function Et(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=rt(e[0],t,n);for(let a=1;a<e.length;++a){const x=rt(e[a],t,n);x>=o&&(i=e[a],o=x)}const r=St(a=>-1*rt({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(K(l,a)>a.radius){f=!1;break}for(const a of n)if(K(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return it(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Et(t,[]):vt(u.arcs.map(a=>a.p1))}v(Et,"computeTextCentre");function re(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=K(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}v(re,"getOverlappingCircles");function zt(t,n,s){const e={},i=re(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const x=Et(u,a,s);e[r]=x,x.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}v(zt,"computeTextCentres");function ae(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as R,s as W,S as N}from"./BspPTfLp.js";import{f,aO as t,c3 as H,bC as S,a6 as P,G as C,a4 as z,bz as U,ae as _,aY as F,cx as O}from"./BQY3g8uE.js";import{l as J}from"./Pq3i4zFA.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,b,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(b);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const B=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return B.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const b=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-b.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",b.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",b.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const B of a){const x=B.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=F(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:B,y:x}=O.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const b=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",B).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,B,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),b.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;b.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",B-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),m,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){m=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const B=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(B,x,void 0,!1,p,a,c);const g=m.padding,o=s.node().getBBox(),b=o.width+g*2,y=o.height+g*2,v=b*1.75;P(s,y,v,m.useMaxWidth),s.attr("viewBox",`${o.x-m.padding} ${o.y-m.padding} `+b+" "+y)},"draw"),at=f(e=>e?e.length*m.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new C({compound:!0,multigraph:!0});let s,B=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){B=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:B?1:m.edgeLengthFactor,nodeSep:B?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:B?1:m.edgeLengthFactor,nodeSep:B?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+m.padding/2,T[u.id]={y:m.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let b=0;g.forEach(function(r){b++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:m.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+b)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*m.padding,k.height=v.height+2*m.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},dt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{dt as diagram};
|
|
1
|
+
import{b as R,s as W,S as N}from"./CuG6uIIP.js";import{f,aO as t,c3 as H,bC as S,a6 as P,G as C,a4 as z,bz as U,ae as _,aY as F,cx as O}from"./CKI5DKl7.js";import{l as J}from"./Cdz-CHGd.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,b,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(b);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const B=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return B.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const b=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-b.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",b.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",b.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const B of a){const x=B.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=F(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:B,y:x}=O.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const b=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",B).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,B,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),b.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;b.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",B-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),m,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){m=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const B=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(B,x,void 0,!1,p,a,c);const g=m.padding,o=s.node().getBBox(),b=o.width+g*2,y=o.height+g*2,v=b*1.75;P(s,y,v,m.useMaxWidth),s.attr("viewBox",`${o.x-m.padding} ${o.y-m.padding} `+b+" "+y)},"draw"),at=f(e=>e?e.length*m.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new C({compound:!0,multigraph:!0});let s,B=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){B=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:B?1:m.edgeLengthFactor,nodeSep:B?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:B?1:m.edgeLengthFactor,nodeSep:B?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+m.padding/2,T[u.id]={y:m.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let b=0;g.forEach(function(r){b++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:m.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+b)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*m.padding,k.height=v.height+2*m.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},dt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{dt as diagram};
|