@softistx/pulsarix-widget 0.8.5 → 0.10.0
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/README.md +76 -48
- package/dist/chunks/{abnfDiagram-XWFEHMT6.b9yk4x5x.js → abnfDiagram-XWFEHMT6.rxx9wyp3.js} +1 -1
- package/dist/chunks/architecture-WOLXFQ4H.hwrxbct0.js +1 -0
- package/dist/chunks/architectureDiagram-CSQXQB3N.mrm0pgc0.js +36 -0
- package/dist/chunks/{blockDiagram-BEDRHYPZ.bb08b9nt.js → blockDiagram-BEDRHYPZ.f4dfpk7e.js} +11 -11
- package/dist/chunks/{c4Diagram-M2UUVUY5.px0epccd.js → c4Diagram-M2UUVUY5.rz43j1my.js} +3 -3
- package/dist/chunks/{chat-markdown-CrbWbK1O.k4nmgyey.js → chat-markdown-BSu4FB_l.xgn4yj83.js} +29 -29
- package/dist/chunks/{classDiagram-v2-KXABOMEV.f02387t9.js → classDiagram-v2-KXABOMEV.m96cfcad.js} +8 -8
- package/dist/chunks/cose-bilkent-JH36ORCC.zz2rwyw6.js +1 -0
- package/dist/chunks/cynefin-EF2NZ3EQ.y29bn1cz.js +1 -0
- package/dist/chunks/{cynefinDiagram-NJNITYFG.zt7gprt1.js → cynefinDiagram-NJNITYFG.az2k68wq.js} +1 -1
- package/dist/chunks/{dagre-KIHZ2IZ3.702bqbr9.js → dagre-KIHZ2IZ3.mgwg8bc4.js} +2 -2
- package/dist/chunks/{diagram-7YQZDPLS.m7vf21j6.js → diagram-7YQZDPLS.x8fg6705.js} +2 -2
- package/dist/chunks/{diagram-QBROCOUO.33e5hv7x.js → diagram-QBROCOUO.db60dsss.js} +24 -24
- package/dist/chunks/{diagram-RJJCUUZO.94k74bz7.js → diagram-RJJCUUZO.a7e9w297.js} +4 -4
- package/dist/chunks/{diagram-WERXNKYE.7fe849z6.js → diagram-WERXNKYE.a04f53kd.js} +2 -2
- package/dist/chunks/diagram-YHHI257C.v19jhmrh.js +3 -0
- package/dist/chunks/{diagram-YR4HJLHV.310x2we2.js → diagram-YR4HJLHV.c5e87gmw.js} +1 -1
- package/dist/chunks/{ebnfDiagram-N527522P.a4crteq1.js → ebnfDiagram-N527522P.bjrxfgze.js} +1 -1
- package/dist/chunks/editor-shortcuts-dialog-Cz3T8435.5ve4nsaw.js +1 -0
- package/dist/chunks/editor.yak1qktd.js +4 -0
- package/dist/chunks/{elk-O5DQBFGD.dx61etan.js → elk-O5DQBFGD.1ydp0b7a.js} +13 -13
- package/dist/chunks/emoji-picker-00Bw2c2b.gzznrrz5.js +4 -0
- package/dist/chunks/{erDiagram-K3K3BIDK.qzqv67zm.js → erDiagram-K3K3BIDK.g171ckq1.js} +8 -8
- package/dist/chunks/eventmodeling-K75KTNOO.46qfxqj7.js +1 -0
- package/dist/chunks/{flow-diagram-AiM6FiIm.73jr19pb.js → flow-diagram-DGZOc1z1.3gbgbm5m.js} +6 -6
- package/dist/chunks/flowDiagram-Z6JWZHQI.f0eaj70g.js +1 -0
- package/dist/chunks/{ganttDiagram-3PRQTZWP.xngzb32h.js → ganttDiagram-3PRQTZWP.3b9dh4nr.js} +5 -5
- package/dist/chunks/gitGraph-VSP46ZUC.swware7n.js +1 -0
- package/dist/chunks/{gitGraphDiagram-VXDFKS5L.1sm36z2q.js → gitGraphDiagram-VXDFKS5L.thyp7vsd.js} +22 -22
- package/dist/chunks/{grid-E2QIVN74.76pgtn2n.js → grid-E2QIVN74.entqjpa3.js} +1 -1
- package/dist/chunks/illustration-BcaGDjvB.1q9xtmyq.js +1 -0
- package/dist/chunks/{index.r0p3fm9f.js → index.0g1t1pjx.js} +1 -1
- package/dist/chunks/{index.rfyzb2yv.js → index.35d4zbh8.js} +4 -4
- package/dist/chunks/index.5fcbba6e.js +2 -0
- package/dist/chunks/{index.7gxz6d1f.js → index.6pzexww5.js} +10 -10
- package/dist/chunks/{index.zm5x44tn.js → index.8vaktk8x.js} +1 -1
- package/dist/chunks/{index.dnnzjw18.js → index.8zg579vd.js} +2 -2
- package/dist/chunks/{index.0k4tbjhp.js → index.9n1y396a.js} +1 -1
- package/dist/chunks/{index.8f3x951p.js → index.a3njhfdd.js} +2 -2
- package/dist/chunks/{index.a6rz456z.js → index.cw97ff3b.js} +2 -2
- package/dist/chunks/{index.fv9af3wd.js → index.d57x7pg9.js} +6 -6
- package/dist/chunks/{index.fbeztcp3.js → index.g2ba0pke.js} +2 -2
- package/dist/chunks/index.h1xzvasx.js +2 -0
- package/dist/chunks/{index.hvdnkr5m.js → index.qr6a02kx.js} +2 -2
- package/dist/chunks/index.rkgfxpm3.js +44 -0
- package/dist/chunks/index.sw8gvntb.js +2 -0
- package/dist/chunks/{index.0e4s8r4m.js → index.v02zf4zg.js} +2 -2
- package/dist/chunks/{index.t34t6kpe.js → index.w1516g8q.js} +35 -35
- package/dist/chunks/{index.9bf5qrah.js → index.w4emtsqw.js} +2 -2
- package/dist/chunks/{index.nsckd1vt.js → index.yhmqh641.js} +2 -2
- package/dist/chunks/{index.1d7qpsyx.js → index.zkngte5k.js} +2 -2
- package/dist/chunks/{index.a1bxkgd3.js → index.zkx4ryzt.js} +104 -104
- package/dist/chunks/info-OHQRW6UA.1er9b42t.js +1 -0
- package/dist/chunks/{infoDiagram-EZ3ZOAHP.pfd0fjwn.js → infoDiagram-EZ3ZOAHP.833fvq8n.js} +2 -2
- package/dist/chunks/{ishikawaDiagram-S3EKX5GW.h5kjez1x.js → ishikawaDiagram-S3EKX5GW.q3evaw24.js} +5 -5
- package/dist/chunks/{journeyDiagram-POQNLL5X.55cqc9p0.js → journeyDiagram-POQNLL5X.9werrmpy.js} +5 -5
- package/dist/chunks/{kanban-definition-BH5XI6FM.pkdvda4y.js → kanban-definition-BH5XI6FM.f3ssda0m.js} +7 -7
- package/dist/chunks/markup-color-chrome-ykGNUl8y.pcgw4znz.js +1 -0
- package/dist/chunks/markup-custom-color-MM-HnrqY.sygnt3gs.js +1 -0
- package/dist/chunks/mention-list-6cR5VSPa.x0x55xzp.js +1 -0
- package/dist/chunks/{mermaid.core.j7s05j63.js → mermaid.core.5cqab0cw.js} +7 -7
- package/dist/chunks/{mindmap-definition-WVAN44T4.x3jbxvft.js → mindmap-definition-WVAN44T4.pjjxgse0.js} +6 -6
- package/dist/chunks/packet-JDAUHWVQ.t5jwb2rb.js +1 -0
- package/dist/chunks/panel.2vwd6k3h.js +7 -0
- package/dist/chunks/{pegDiagram-D4NLKWP3.xq15gqy9.js → pegDiagram-D4NLKWP3.mdacgbzb.js} +1 -1
- package/dist/chunks/pie-XZMESJXO.pe88zesw.js +1 -0
- package/dist/chunks/pieDiagram-36ENHN4W.fb0d6a9w.js +39 -0
- package/dist/chunks/plated-illustration-pTqcYOQg.6b9fm4a7.js +1 -0
- package/dist/chunks/{quadrantDiagram-ZQUDMS73.k28g8jpn.js → quadrantDiagram-ZQUDMS73.m5cgqatg.js} +4 -4
- package/dist/chunks/radar-ABXABTNO.jtbddwfq.js +1 -0
- package/dist/chunks/railroad-I3PHUGI6.kvyt0f9s.js +1 -0
- package/dist/chunks/railroad-abnf-LNEFI6M7.ybx0vspg.js +1 -0
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.yx4c4enn.js +1 -0
- package/dist/chunks/railroad-peg-JR7BVNR7.mb71eyqe.js +1 -0
- package/dist/chunks/{railroadDiagram-JIZHGYPL.e7p2vqgg.js → railroadDiagram-JIZHGYPL.w2e1k61e.js} +1 -1
- package/dist/chunks/{render-VIF2ZAQL.w5ytncsg.js → render-VIF2ZAQL.exs2rt60.js} +1 -1
- package/dist/chunks/{requirementDiagram-AXW2TVFA.arekdz02.js → requirementDiagram-AXW2TVFA.mrxb120d.js} +4 -4
- package/dist/chunks/{sankeyDiagram-FBCJTAIF.1d04xcmb.js → sankeyDiagram-FBCJTAIF.csj5n1sg.js} +6 -6
- package/dist/chunks/{sequenceDiagram-3LA2ROMG.j4xywwp1.js → sequenceDiagram-3LA2ROMG.73qx1ab4.js} +11 -11
- package/dist/chunks/{sizeCapture-2Q2CQKSF.862bnf6p.js → sizeCapture-2Q2CQKSF.vfe8maj3.js} +1 -1
- package/dist/chunks/{stateDiagram-v2-ATKHQDJO.xvvtr0y2.js → stateDiagram-v2-ATKHQDJO.h4grfmy4.js} +8 -8
- package/dist/chunks/{swimlanes-YQL5WMAO.dtnjb4xt.js → swimlanes-YQL5WMAO.e2y8jam1.js} +1 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.dtthssd5.js +8 -0
- package/dist/chunks/{timeline-definition-7Z437IG3.zfhqzc4r.js → timeline-definition-7Z437IG3.2zxa6hz5.js} +9 -9
- package/dist/chunks/treeView-D4JQ5SDB.3kgztv30.js +1 -0
- package/dist/chunks/treemap-SAJKECNS.xj47e2ae.js +1 -0
- package/dist/chunks/{usecaseDiagram-RDK6N6HP.ewxnyz4c.js → usecaseDiagram-RDK6N6HP.61cdyktj.js} +57 -57
- package/dist/chunks/{vennDiagram-SHRQU5PJ.wkzf1f00.js → vennDiagram-SHRQU5PJ.4tspw3rs.js} +7 -7
- package/dist/chunks/wardley-7MLQ67FV.pckbr6zr.js +1 -0
- package/dist/chunks/{wardleyDiagram-F3OXNVQS.srjfm4nb.js → wardleyDiagram-F3OXNVQS.q2p8tshx.js} +4 -4
- package/dist/chunks/{xychartDiagram-GDYJKCDI.xfa2vexk.js → xychartDiagram-GDYJKCDI.69desp9j.js} +5 -5
- package/dist/index.js +48 -21
- package/dist/react.js +74 -0
- package/dist/server.js +20 -0
- package/dist/types/config.d.ts +1 -1
- package/dist/types/mount.d.ts +1 -1
- package/dist/types/react.d.ts +27 -0
- package/dist/types/server.d.ts +15 -0
- package/docs/integration.md +109 -36
- package/package.json +20 -5
- package/dist/chunks/architecture-WOLXFQ4H.aft3rkrr.js +0 -1
- package/dist/chunks/architectureDiagram-CSQXQB3N.qz18rz0g.js +0 -36
- package/dist/chunks/cose-bilkent-JH36ORCC.azq9k24r.js +0 -1
- package/dist/chunks/cynefin-EF2NZ3EQ.dk039jny.js +0 -1
- package/dist/chunks/diagram-YHHI257C.qjjjfq7w.js +0 -3
- package/dist/chunks/editor-shortcuts-dialog-B0ppoiza.x3p4h07t.js +0 -1
- package/dist/chunks/editor.arg3zy29.js +0 -4
- package/dist/chunks/emoji-picker-CbvQZ2ZL.nst616hd.js +0 -4
- package/dist/chunks/eventmodeling-K75KTNOO.gmm1bcak.js +0 -1
- package/dist/chunks/flowDiagram-Z6JWZHQI.fzwqg115.js +0 -1
- package/dist/chunks/gitGraph-VSP46ZUC.0m8jykgw.js +0 -1
- package/dist/chunks/illustration-BOW28wq5.bkz28k1x.js +0 -1
- package/dist/chunks/index.32jxrb9b.js +0 -2
- package/dist/chunks/index.7k5v3p25.js +0 -2
- package/dist/chunks/index.e35b4yh5.js +0 -44
- package/dist/chunks/index.wrjdgn4c.js +0 -2
- package/dist/chunks/info-OHQRW6UA.e0a85drn.js +0 -1
- package/dist/chunks/markup-color-chrome-ykGNUl8y.0ds56d6x.js +0 -1
- package/dist/chunks/markup-custom-color-Dgm2hHI7.7darvajx.js +0 -1
- package/dist/chunks/mention-list-CkAUzPBG.mtjgmmzb.js +0 -1
- package/dist/chunks/packet-JDAUHWVQ.52409p3r.js +0 -1
- package/dist/chunks/panel.9tp7gr60.js +0 -7
- package/dist/chunks/pie-XZMESJXO.q5kre8cx.js +0 -1
- package/dist/chunks/pieDiagram-36ENHN4W.8h0wam54.js +0 -39
- package/dist/chunks/plated-illustration-COZYWJ81.xy7ba5mq.js +0 -1
- package/dist/chunks/radar-ABXABTNO.yk872k2n.js +0 -1
- package/dist/chunks/railroad-I3PHUGI6.9wfa6vs3.js +0 -1
- package/dist/chunks/railroad-abnf-LNEFI6M7.70zznk3b.js +0 -1
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.4pvdng0p.js +0 -1
- package/dist/chunks/railroad-peg-JR7BVNR7.ev15ebp6.js +0 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.0q8kd5qn.js +0 -8
- package/dist/chunks/treeView-D4JQ5SDB.3fzswdjp.js +0 -1
- package/dist/chunks/treemap-SAJKECNS.cgh74bhn.js +0 -1
- package/dist/chunks/wardley-7MLQ67FV.6q5tgt0s.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,n,u,N,Bt,wl,St,gr,$t,yn,br}from"./index.a1bxkgd3.js";import{Le,Ge,st,Oe,vt,ir,te,Te,pt,or,mt,Hn,Di,Pi,Bi,$r,Ot,Fi,zr,Ve,Hr,Yt,Dt,Ur,sr,qr,$i,zi,Un,Ie,Hi,jr,lr,Gr,qn,jn,cr,Ui,Gn,qi,Ta,yt,Vn,ji,Gi,Vi,et,Wn,Kn,Vr,Wi,Yn,b,lt,xt,Re,ur,ue}from"./index.wrjdgn4c.js";import{Ri,Mi,Q,dn,cl,Ni,ot}from"./index.hvdnkr5m.js";import{sa}from"./index.e35b4yh5.js";var mr={};sa(mr,{default:()=>Z});var so=/\s/;function uo(r){var t=r.length;while(t--&&so.test(r.charAt(t)));return t}var ae=uo;var co=/^\s+/;function po(r){return r?r.slice(0,ae(r)+1).replace(co,""):r}var fe=po;var se=NaN,lo=/^[-+]0x[0-9a-f]+$/i,mo=/^0b[01]+$/i,ho=/^0o[0-7]+$/i,go=parseInt;function vo(r){if(typeof r=="number")return r;if(vt(r))return se;if(Te(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Te(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=fe(r);var o=mo.test(r);return o||ho.test(r)?go(r.slice(2),o?2:8):lo.test(r)?se:+r}var de=vo;var ce=1/0,bo=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function yo(r){if(!r)return r===0?r:0;if(r=de(r),r===ce||r===-ce){var t=r<0?-1:1;return t*bo}return r===r?r:0}var V=yo;function wo(r){var t=V(r),o=t%1;return t===t?o?t-o:t:0}var pe=wo;var le=Object.create,_o=function(){function r(){}return function(t){if(!Te(t))return{};if(le)return le(t);r.prototype=t;var o=new r;return r.prototype=void 0,o}}(),me=_o;function Eo(r,t){var o=-1,i=r.length;t||(t=Array(i));while(++o<i)t[o]=r[o];return t}var dr=Eo;function xo(r,t,o){if(t=="__proto__"&&Hn)Hn(r,t,{configurable:!0,enumerable:!0,value:o,writable:!0});else r[t]=o}var M=xo;var Oo=Object.prototype,Lo=Oo.hasOwnProperty;function Io(r,t,o){var i=r[t];if(!(Lo.call(r,t)&&Ot(i,o))||o===void 0&&!(t in r))M(r,t,o)}var j=Io;function So(r,t,o,i){var a=!o;o||(o={});var f=-1,s=t.length;while(++f<s){var d=t[f],c=i?i(o[d],r[d],d,o,r):void 0;if(c===void 0)c=r[d];if(a)M(o,d,c);else j(o,d,c)}return o}var k=So;function No(r,t,o){if(!Te(o))return!1;var i=typeof t;if(i=="number"?Ve(o)&&$r(t,o.length):i=="string"&&(t in o))return Ot(o[t],r);return!1}var C=No;function Po(r){return zr(function(t,o){var i=-1,a=o.length,f=a>1?o[a-1]:void 0,s=a>2?o[2]:void 0;if(f=r.length>3&&typeof f=="function"?(a--,f):void 0,s&&C(o[0],o[1],s))f=a<3?void 0:f,a=1;t=Object(t);while(++i<a){var d=o[i];if(d)r(t,d,i,f)}return t})}var he=Po;function ko(r){var t=[];if(r!=null)for(var o in Object(r))t.push(o);return t}var ge=ko;var To=Object.prototype,Co=To.hasOwnProperty;function Ao(r){if(!Te(r))return ge(r);var t=Hr(r),o=[];for(var i in r)if(!(i=="constructor"&&(t||!Co.call(r,i))))o.push(i);return o}var ve=Ao;function Ro(r){return Ve(r)?$i(r,!0):ve(r)}var L=Ro;function Mo(r){var t=r==null?0:r.length;return t?jn(r,1):[]}var S=Mo;function jo(r){return Di(Fi(r,void 0,S),r+"")}var be=jo;var Bo=zi(Object.getPrototypeOf,Object),Y=Bo;var Do="[object Object]",Fo=Function.prototype,Go=Object.prototype,ye=Fo.toString,Xo=Go.hasOwnProperty,Uo=ye.call(Object);function Vo(r){if(!Oe(r)||st(r)!=Do)return!1;var t=Y(r);if(t===null)return!0;var o=Xo.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&ye.call(o)==Uo}var we=Vo;var Yo="\\ud800-\\udfff",zo="\\u0300-\\u036f",Wo="\\ufe20-\\ufe2f",qo="\\u20d0-\\u20ff",Ho=zo+Wo+qo,Ko="\\ufe0e\\ufe0f",Jo="\\u200d",Zo=RegExp("["+Jo+Yo+Ho+Ko+"]");function $o(r){return Zo.test(r)}var _e=$o;function Qo(r,t){return r&&k(t,Ie(t),r)}var Ee=Qo;function ri(r,t){return r&&k(t,L(t),r)}var xe=ri;var ke=typeof mr=="object"&&mr&&!mr.nodeType&&mr,Se=ke&&typeof pr=="object"&&pr&&!pr.nodeType&&pr,ei=Se&&Se.exports===ke,Ne=ei?Le.Buffer:void 0,Pe=Ne?Ne.allocUnsafe:void 0;function ti(r,t){if(t)return r.slice();var o=r.length,i=Pe?Pe(o):new r.constructor(o);return r.copy(i),i}var Z=ti;function ni(r,t){return k(r,Gn(r),t)}var Ce=ni;var oi=Object.getOwnPropertySymbols,ii=!oi?Ui:function(r){var t=[];while(r)qn(t,Gn(r)),r=Y(r);return t},hr=ii;function ai(r,t){return k(r,hr(r),t)}var Ae=ai;function fi(r){return qi(r,L,hr)}var Me=fi;var si=Object.prototype,ui=si.hasOwnProperty;function di(r){var t=r.length,o=new r.constructor(t);if(t&&typeof r[0]=="string"&&ui.call(r,"index"))o.index=r.index,o.input=r.input;return o}var je=di;function ci(r){var t=new r.constructor(r.byteLength);return new Vn(t).set(new Vn(r)),t}var z=ci;function pi(r,t){var o=t?z(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}var Be=pi;var li=/\w*$/;function mi(r){var t=new r.constructor(r.source,li.exec(r));return t.lastIndex=r.lastIndex,t}var De=mi;var Fe=Ge?Ge.prototype:void 0,Xe=Fe?Fe.valueOf:void 0;function hi(r){return Xe?Object(Xe.call(r)):{}}var Ue=hi;function gi(r,t){var o=t?z(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}var vr=gi;var vi="[object Boolean]",bi="[object Date]",yi="[object Map]",wi="[object Number]",_i="[object RegExp]",Ei="[object Set]",xi="[object String]",Oi="[object Symbol]",Li="[object ArrayBuffer]",Ii="[object DataView]",Si="[object Float32Array]",ki="[object Float64Array]",Ti="[object Int8Array]",Ci="[object Int16Array]",Ai="[object Int32Array]",Xi="[object Uint8Array]",Yi="[object Uint8ClampedArray]",Ki="[object Uint16Array]",Ji="[object Uint32Array]";function Zi(r,t,o){var i=r.constructor;switch(t){case Li:return z(r);case vi:case bi:return new i(+r);case Ii:return Be(r,o);case Si:case ki:case Ti:case Ci:case Ai:case Xi:case Yi:case Ki:case Ji:return vr(r,o);case yi:return new i;case wi:case xi:return new i(r);case _i:return De(r);case Ei:return new i;case Oi:return Ue(r)}}var Ye=Zi;function Qi(r){return typeof r.constructor=="function"&&!Hr(r)?me(Y(r)):{}}var yr=Qi;var ra="[object Map]";function ea(r){return Oe(r)&&yt(r)==ra}var ze=ea;var We=sr&&sr.isMap,ta=We?Ur(We):ze,qe=ta;var na="[object Set]";function oa(r){return Oe(r)&&yt(r)==na}var He=oa;var Ke=sr&&sr.isSet,ia=Ke?Ur(Ke):He,Je=ia;var aa=1,fa=2,ua=4,Ze="[object Arguments]",da="[object Array]",ca="[object Boolean]",pa="[object Date]",la="[object Error]",$e="[object Function]",ma="[object GeneratorFunction]",ha="[object Map]",ga="[object Number]",Qe="[object Object]",va="[object RegExp]",ba="[object Set]",ya="[object String]",wa="[object Symbol]",_a="[object WeakMap]",Ea="[object ArrayBuffer]",xa="[object DataView]",Oa="[object Float32Array]",La="[object Float64Array]",Ia="[object Int8Array]",Sa="[object Int16Array]",Na="[object Int32Array]",Pa="[object Uint8Array]",ka="[object Uint8ClampedArray]",Ca="[object Uint16Array]",Aa="[object Uint32Array]",x={};x[Ze]=x[da]=x[Ea]=x[xa]=x[ca]=x[pa]=x[Oa]=x[La]=x[Ia]=x[Sa]=x[Na]=x[ha]=x[ga]=x[Qe]=x[va]=x[ba]=x[ya]=x[wa]=x[Pa]=x[ka]=x[Ca]=x[Aa]=!0;x[la]=x[$e]=x[_a]=!1;function wr(r,t,o,i,a,f){var s,d=t&aa,c=t&fa,p=t&ua;if(o)s=a?o(r,i,a,f):o(r);if(s!==void 0)return s;if(!Te(r))return r;var l=te(r);if(l){if(s=je(r),!d)return dr(r,s)}else{var m=yt(r),h=m==$e||m==ma;if(Dt(r))return Z(r,d);if(m==Qe||m==Ze||h&&!a){if(s=c||h?{}:yr(r),!d)return c?Ae(r,xe(s,r)):Ce(r,Ee(s,r))}else{if(!x[m])return a?r:{};s=Ye(r,m,d)}}f||(f=new cr);var v=f.get(r);if(v)return v;if(f.set(r,s),Je(r))r.forEach(function(g){s.add(wr(g,t,o,g,r,f))});else if(qe(r))r.forEach(function(g,_){s.set(_,wr(g,t,o,_,r,f))});var w=p?c?Me:Ta:c?L:Ie,y=l?void 0:w(r);return Pi(y||r,function(g,_){if(y)_=g,g=r[_];j(s,_,wr(g,t,o,_,r,f))}),s}var rt=wr;var Ra=1,Ma=4;function ja(r){return rt(r,Ra|Ma)}var tt=ja;var Ba=function(){return Le.Date.now()},Sr=Ba;var nt=Object.prototype,Da=nt.hasOwnProperty,Fa=zr(function(r,t){r=Object(r);var o=-1,i=t.length,a=i>2?t[2]:void 0;if(a&&C(t[0],t[1],a))i=1;while(++o<i){var f=t[o],s=L(f),d=-1,c=s.length;while(++d<c){var p=s[d],l=r[p];if(l===void 0||Ot(l,nt[p])&&!Da.call(r,p))r[p]=f[p]}}return r}),it=Fa;function Ga(r,t,o){if(o!==void 0&&!Ot(r[t],o)||o===void 0&&!(t in r))M(r,t,o)}var rr=Ga;function Xa(r,t){if(t==="constructor"&&typeof r[t]==="function")return;if(t=="__proto__")return;return r[t]}var er=Xa;function Ua(r){return k(r,L(r))}var at=Ua;function Va(r,t,o,i,a,f,s){var d=er(r,o),c=er(t,o),p=s.get(c);if(p){rr(r,o,p);return}var l=f?f(d,c,o+"",r,t,s):void 0,m=l===void 0;if(m){var h=te(c),v=!h&&Dt(c),w=!h&&!v&&qr(c);if(l=c,h||v||w)if(te(d))l=d;else if(Wi(d))l=dr(d);else if(v)m=!1,l=Z(c,!0);else if(w)m=!1,l=vr(c,!0);else l=[];else if(we(c)||Yt(c)){if(l=d,Yt(d))l=at(d);else if(!Te(d)||or(d))l=yr(c)}else m=!1}if(m)s.set(c,l),a(l,c,i,f,s),s.delete(c);rr(r,o,l)}var ft=Va;function ut(r,t,o,i,a){if(r===t)return;Wn(t,function(f,s){if(a||(a=new cr),Te(f))ft(r,t,s,o,ut,i,a);else{var d=i?i(er(r,s),f,s+"",r,t,a):void 0;if(d===void 0)d=f;rr(r,s,d)}},L)}var dt=ut;function Ya(r){var t=r==null?0:r.length;return t?r[t-1]:void 0}var X=Ya;function za(r){return function(t,o,i){var a=Object(t);if(!Ve(t)){var f=et(o,3);t=Ie(t),o=function(d){return f(a[d],d,a)}}var s=r(t,o,i);return s>-1?a[f?t[s]:s]:void 0}}var ct=za;var Wa=Math.max;function qa(r,t,o){var i=r==null?0:r.length;if(!i)return-1;var a=o==null?0:pe(o);if(a<0)a=Wa(i+a,0);return Bi(r,et(t,3),a)}var ht=qa;var Ha=ct(ht),tr=Ha;function Ka(r,t){var o=-1,i=Ve(r)?Array(r.length):[];return Vr(r,function(a,f,s){i[++o]=t(a,f,s)}),i}var _r=Ka;function Ja(r,t){var o=te(r)?ir:_r;return o(r,et(t,3))}var E=Ja;function Za(r,t){return r==null?r:Wn(r,Yn(t),L)}var gt=Za;function $a(r,t){return r&&Kn(r,Yn(t))}var bt=$a;function Qa(r,t){return r>t}var wt=Qa;var rf=Object.prototype,ef=rf.hasOwnProperty;function tf(r,t){return r!=null&&ef.call(r,t)}var _t=tf;function nf(r,t){return r!=null&&ji(r,t,_t)}var Er=nf;var of="[object String]";function af(r){return typeof r=="string"||!te(r)&&Oe(r)&&st(r)==of}var Et=af;function ff(r,t){return r<t}var xr=ff;function sf(r,t){var o={};return t=et(t,3),Kn(r,function(i,a,f){M(o,a,t(i,a,f))}),o}var W=sf;function uf(r,t,o){var i=-1,a=r.length;while(++i<a){var f=r[i],s=t(f);if(s!=null&&(d===void 0?s===s&&!vt(s):o(s,d)))var d=s,c=f}return c}var q=uf;function df(r){return r&&r.length?q(r,pt,wt):void 0}var I=df;var cf=he(function(r,t,o){dt(r,t,o)}),nr=cf;function pf(r){return r&&r.length?q(r,pt,xr):void 0}var B=pf;function lf(r,t){return r&&r.length?q(r,et(t,2),xr):void 0}var H=lf;function mf(r,t,o,i){if(!Te(r))return r;t=jr(t,r);var a=-1,f=t.length,s=f-1,d=r;while(d!=null&&++a<f){var c=lr(t[a]),p=o;if(c==="__proto__"||c==="constructor"||c==="prototype")return r;if(a!=s){var l=d[c];if(p=i?i(l,c,d):void 0,p===void 0)p=Te(l)?l:$r(t[a+1])?[]:{}}j(d,c,p),d=d[c]}return r}var Lt=mf;function hf(r,t,o){var i=-1,a=t.length,f={};while(++i<a){var s=t[i],d=Gr(r,s);if(o(d,s))Lt(f,jr(s,r),d)}return f}var It=hf;function gf(r,t){var o=r.length;r.sort(t);while(o--)r[o]=r[o].value;return r}var Nt=gf;function vf(r,t){if(r!==t){var o=r!==void 0,i=r===null,a=r===r,f=vt(r),s=t!==void 0,d=t===null,c=t===t,p=vt(t);if(!d&&!p&&!f&&r>t||f&&s&&c&&!d&&!p||i&&s&&c||!o&&c||!a)return 1;if(!i&&!f&&!p&&r<t||p&&o&&a&&!i&&!f||d&&o&&a||!s&&a||!c)return-1}return 0}var Pt=vf;function bf(r,t,o){var i=-1,a=r.criteria,f=t.criteria,s=a.length,d=o.length;while(++i<s){var c=Pt(a[i],f[i]);if(c){if(i>=d)return c;var p=o[i];return c*(p=="desc"?-1:1)}}return r.index-t.index}var kt=bf;function yf(r,t,o){if(t.length)t=ir(t,function(f){if(te(f))return function(s){return Gr(s,f.length===1?f[0]:f)};return f});else t=[pt];var i=-1;t=ir(t,Ur(et));var a=_r(r,function(f,s,d){var c=ir(t,function(p){return p(f)});return{criteria:c,index:++i,value:f}});return Nt(a,function(f,s){return kt(f,s,o)})}var Tt=yf;var wf=Vi("length"),Ct=wf;var Rt="\\ud800-\\udfff",_f="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",xf="\\u20d0-\\u20ff",Of=_f+Ef+xf,Lf="\\ufe0e\\ufe0f",If="["+Rt+"]",Nr="["+Of+"]",Pr="\\ud83c[\\udffb-\\udfff]",Sf="(?:"+Nr+"|"+Pr+")",Mt="[^"+Rt+"]",jt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Nf="\\u200d",Gt=Sf+"?",Xt="["+Lf+"]?",Pf="(?:"+Nf+"(?:"+[Mt,jt,Ft].join("|")+")"+Xt+Gt+")*",kf=Xt+Gt+Pf,Tf="(?:"+[Mt+Nr+"?",Nr,jt,Ft,If].join("|")+")",At=RegExp(Pr+"(?="+Pr+")|"+Tf+kf,"g");function Cf(r){var t=At.lastIndex=0;while(At.test(r))++t;return t}var Ut=Cf;function Af(r){return _e(r)?Ut(r):Ct(r)}var Vt=Af;function Rf(r,t){return It(r,t,function(o,i){return Gi(r,i)})}var zt=Rf;var Mf=be(function(r,t){return r==null?{}:zt(r,t)}),K=Mf;var{ceil:jf,max:Bf}=Math;function Df(r,t,o,i){var a=-1,f=Bf(jf((t-r)/(o||1)),0),s=Array(f);while(f--)s[i?f:++a]=r,r+=o;return s}var Wt=Df;function Ff(r){return function(t,o,i){if(i&&typeof i!="number"&&C(t,o,i))o=i=void 0;if(t=V(t),o===void 0)o=t,t=0;else o=V(o);return i=i===void 0?t<o?1:-1:V(i),Wt(t,o,i,r)}}var qt=Ff;var Gf=qt(),P=Gf;var Xf="[object Map]",Uf="[object Set]";function Vf(r){if(r==null)return 0;if(Ve(r))return Et(r)?Vt(r):r.length;var t=yt(r);if(t==Xf||t==Uf)return r.size;return Un(r).length}var Ht=Vf;var Yf=zr(function(r,t){if(r==null)return[];var o=t.length;if(o>1&&C(r,t[0],t[1]))t=[];else if(o>2&&C(t[0],t[1],t[2]))t=[t[0]];return Tt(r,jn(t,1),[])}),A=Yf;var zf=0;function Wf(r){var t=++zf;return Hi(r)+t}var J=Wf;function qf(r,t,o){var i=-1,a=r.length,f=t.length,s={};while(++i<a){var d=i<f?t[i]:void 0;o(s,r[i],d)}return s}var Kt=qf;function Hf(r,t){return Kt(r||[],t||[],j)}var kr=Hf;class Tr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,t=r._prev;if(t!==r)return Jt(t),t}enqueue(r){var t=this._sentinel;if(r._prev&&r._next)Jt(r);r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){var r=[],t=this._sentinel,o=t._prev;while(o!==t)r.push(JSON.stringify(o,Kf)),o=o._prev;return"["+r.join(", ")+"]"}}function Jt(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function Kf(r,t){if(r!=="_next"&&r!=="_prev")return t}var Jf=mt(1);function Zt(r,t){if(r.nodeCount()<=1)return[];var o=$f(r,t||Jf),i=Zf(o.graph,o.buckets,o.zeroIdx);return S(E(i,function(a){return r.outEdges(a.v,a.w)}))}function Zf(r,t,o){var i=[],a=t[t.length-1],f=t[0],s;while(r.nodeCount()){while(s=f.dequeue())Cr(r,t,o,s);while(s=a.dequeue())Cr(r,t,o,s);if(r.nodeCount()){for(var d=t.length-2;d>0;--d)if(s=t[d].dequeue(),s){i=i.concat(Cr(r,t,o,s,!0));break}}}return i}function Cr(r,t,o,i,a){var f=a?[]:void 0;return b(r.inEdges(i.v),function(s){var d=r.edge(s),c=r.node(s.v);if(a)f.push({v:s.v,w:s.w});c.out-=d,Ar(t,o,c)}),b(r.outEdges(i.v),function(s){var d=r.edge(s),c=s.w,p=r.node(c);p.in-=d,Ar(t,o,p)}),r.removeNode(i.v),f}function $f(r,t){var o=new ue,i=0,a=0;b(r.nodes(),function(d){o.setNode(d,{v:d,in:0,out:0})}),b(r.edges(),function(d){var c=o.edge(d.v,d.w)||0,p=t(d),l=c+p;o.setEdge(d.v,d.w,l),a=Math.max(a,o.node(d.v).out+=p),i=Math.max(i,o.node(d.w).in+=p)});var f=P(a+i+3).map(function(){return new Tr}),s=i+1;return b(o.nodes(),function(d){Ar(f,s,o.node(d))}),{graph:o,buckets:f,zeroIdx:s}}function Ar(r,t,o){if(!o.out)r[0].enqueue(o);else if(!o.in)r[r.length-1].enqueue(o);else r[o.out-o.in+t].enqueue(o)}function Qt(r){var t=r.graph().acyclicer==="greedy"?Zt(r,o(r)):Qf(r);b(t,function(i){var a=r.edge(i);r.removeEdge(i),a.forwardName=i.name,a.reversed=!0,r.setEdge(i.w,i.v,a,J("rev"))});function o(i){return function(a){return i.edge(a).weight}}}function Qf(r){var t=[],o={},i={};function a(f){if(Object.prototype.hasOwnProperty.call(i,f))return;i[f]=!0,o[f]=!0,b(r.outEdges(f),function(s){if(Object.prototype.hasOwnProperty.call(o,s.w))t.push(s);else a(s.w)}),delete o[f]}return b(r.nodes(),a),t}function rn(r){b(r.edges(),function(t){var o=r.edge(t);if(o.reversed){r.removeEdge(t);var i=o.forwardName;delete o.reversed,delete o.forwardName,r.setEdge(t.w,t.v,o,i)}})}function T(r,t,o,i){var a;do a=J(i);while(r.hasNode(a));return o.dummy=t,r.setNode(a,o),a}function tn(r){var t=new ue().setGraph(r.graph());return b(r.nodes(),function(o){t.setNode(o,r.node(o))}),b(r.edges(),function(o){var i=t.edge(o.v,o.w)||{weight:0,minlen:1},a=r.edge(o);t.setEdge(o.v,o.w,{weight:i.weight+a.weight,minlen:Math.max(i.minlen,a.minlen)})}),t}function Or(r){var t=new ue({multigraph:r.isMultigraph()}).setGraph(r.graph());return b(r.nodes(),function(o){if(!r.children(o).length)t.setNode(o,r.node(o))}),b(r.edges(),function(o){t.setEdge(o,r.edge(o))}),t}function Rr(r,t){var{x:o,y:i}=r,a=t.x-o,f=t.y-i,s=r.width/2,d=r.height/2;if(!a&&!f)throw Error("Not possible to find intersection inside of the rectangle");var c,p;if(Math.abs(f)*s>Math.abs(a)*d){if(f<0)d=-d;c=d*a/f,p=d}else{if(a<0)s=-s;c=s,p=s*f/a}return{x:o+c,y:i+p}}function D(r){var t=E(P(Br(r)+1),function(){return[]});return b(r.nodes(),function(o){var i=r.node(o),a=i.rank;if(!Re(a))t[a][i.order]=o}),t}function nn(r){var t=B(E(r.nodes(),function(o){return r.node(o).rank}));b(r.nodes(),function(o){var i=r.node(o);if(Er(i,"rank"))i.rank-=t})}function on(r){var t=B(E(r.nodes(),function(f){return r.node(f).rank})),o=[];b(r.nodes(),function(f){var s=r.node(f).rank-t;if(!o[s])o[s]=[];o[s].push(f)});var i=0,a=r.graph().nodeRankFactor;b(o,function(f,s){if(Re(f)&&s%a!==0)--i;else if(i)b(f,function(d){r.node(d).rank+=i})})}function Mr(r,t,o,i){var a={width:0,height:0};if(arguments.length>=4)a.rank=o,a.order=i;return T(r,"border",a,t)}function Br(r){return I(E(r.nodes(),function(t){var o=r.node(t).rank;if(!Re(o))return o}))}function an(r,t){var o={lhs:[],rhs:[]};return b(r,function(i){if(t(i))o.lhs.push(i);else o.rhs.push(i)}),o}function fn(r,t){var o=Sr();try{return t()}finally{console.log(r+" time: "+(Sr()-o)+"ms")}}function sn(r,t){return t()}function cn(r){function t(o){var i=r.children(o),a=r.node(o);if(i.length)b(i,t);if(Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var f=a.minRank,s=a.maxRank+1;f<s;++f)un(r,"borderLeft","_bl",o,a,f),un(r,"borderRight","_br",o,a,f)}}b(r.children(),t)}function un(r,t,o,i,a,f){var s={width:0,height:0,rank:f,borderType:t},d=a[t][f-1],c=T(r,"border",s,o);if(a[t][f]=c,r.setParent(c,i),d)r.setEdge(d,c,{weight:1})}function ln(r){var t=r.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl")hn(r)}function mn(r){var t=r.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl")rs(r);if(t==="lr"||t==="rl")es(r),hn(r)}function hn(r){b(r.nodes(),function(t){pn(r.node(t))}),b(r.edges(),function(t){pn(r.edge(t))})}function pn(r){var t=r.width;r.width=r.height,r.height=t}function rs(r){b(r.nodes(),function(t){Dr(r.node(t))}),b(r.edges(),function(t){var o=r.edge(t);if(b(o.points,Dr),Object.prototype.hasOwnProperty.call(o,"y"))Dr(o)})}function Dr(r){r.y=-r.y}function es(r){b(r.nodes(),function(t){Fr(r.node(t))}),b(r.edges(),function(t){var o=r.edge(t);if(b(o.points,Fr),Object.prototype.hasOwnProperty.call(o,"x"))Fr(o)})}function Fr(r){var t=r.x;r.x=r.y,r.y=t}function gn(r){r.graph().dummyChains=[],b(r.edges(),function(t){ns(r,t)})}function ns(r,t){var o=t.v,i=r.node(o).rank,a=t.w,f=r.node(a).rank,s=t.name,d=r.edge(t),c=d.labelRank;if(f===i+1)return;r.removeEdge(t);var p=void 0,l,m;for(m=0,++i;i<f;++m,++i){if(d.points=[],p={width:0,height:0,edgeLabel:d,edgeObj:t,rank:i},l=T(r,"edge",p,"_d"),i===c)p.width=d.width,p.height=d.height,p.dummy="edge-label",p.labelpos=d.labelpos;if(r.setEdge(o,l,{weight:d.weight},s),m===0)r.graph().dummyChains.push(l);o=l}r.setEdge(o,a,{weight:d.weight},s)}function vn(r){b(r.graph().dummyChains,function(t){var o=r.node(t),i=o.edgeLabel,a;r.setEdge(o.edgeObj,i);while(o.dummy){if(a=r.successors(t)[0],r.removeNode(t),i.points.push({x:o.x,y:o.y}),o.dummy==="edge-label")i.x=o.x,i.y=o.y,i.width=o.width,i.height=o.height;t=a,o=r.node(t)}})}function ar(r){var t={};function o(i){var a=r.node(i);if(Object.prototype.hasOwnProperty.call(t,i))return a.rank;t[i]=!0;var f=B(E(r.outEdges(i),function(s){return o(s.w)-r.edge(s).minlen}));if(f===Number.POSITIVE_INFINITY||f===void 0||f===null)f=0;return a.rank=f}b(r.sources(),o)}function U(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen}function Lr(r){var t=new ue({directed:!1}),o=r.nodes()[0],i=r.nodeCount();t.setNode(o,{});var a,f;while(os(t,r)<i)a=is(t,r),f=t.hasNode(a.v)?U(r,a):-U(r,a),as(t,r,f);return t}function os(r,t){function o(i){b(t.nodeEdges(i),function(a){var f=a.v,s=i===f?a.w:f;if(!r.hasNode(s)&&!U(t,a))r.setNode(s,{}),r.setEdge(i,s,{}),o(s)})}return b(r.nodes(),o),r.nodeCount()}function is(r,t){return H(t.edges(),function(o){if(r.hasNode(o.v)!==r.hasNode(o.w))return U(t,o)})}function as(r,t,o){b(r.nodes(),function(i){t.node(i).rank+=o})}var uh=mt(1);var gh=mt(1);Xr.CycleException=fr;function Xr(r){var t={},o={},i=[];function a(f){if(Object.prototype.hasOwnProperty.call(o,f))throw new fr;if(!Object.prototype.hasOwnProperty.call(t,f))o[f]=!0,t[f]=!0,b(r.predecessors(f),a),delete o[f],i.push(f)}if(b(r.sinks(),a),Ht(t)!==r.nodeCount())throw new fr;return i}function fr(){}fr.prototype=Error();function Ir(r,t,o){if(!te(t))t=[t];var i=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],f={};return b(t,function(s){if(!r.hasNode(s))throw Error("Graph does not have node: "+s);wn(r,s,o==="post",f,i,a)}),a}function wn(r,t,o,i,a,f){if(!Object.prototype.hasOwnProperty.call(i,t)){if(i[t]=!0,!o)f.push(t);if(b(a(t),function(s){wn(r,s,o,i,a,f)}),o)f.push(t)}}function Yr(r,t){return Ir(r,t,"post")}function Wr(r,t){return Ir(r,t,"pre")}G.initLowLimValues=Jr;G.initCutValues=Kr;G.calcCutValue=En;G.leaveEdge=On;G.enterEdge=Ln;G.exchangeEdges=In;function G(r){r=tn(r),ar(r);var t=Lr(r);Jr(t),Kr(t,r);var o,i;while(o=On(t))i=Ln(t,r,o),In(t,r,o,i)}function Kr(r,t){var o=Yr(r,r.nodes());o=o.slice(0,o.length-1),b(o,function(i){cs(r,t,i)})}function cs(r,t,o){var i=r.node(o),a=i.parent;r.edge(o,a).cutvalue=En(r,t,o)}function En(r,t,o){var i=r.node(o),a=i.parent,f=!0,s=t.edge(o,a),d=0;if(!s)f=!1,s=t.edge(a,o);return d=s.weight,b(t.nodeEdges(o),function(c){var p=c.v===o,l=p?c.w:c.v;if(l!==a){var m=p===f,h=t.edge(c).weight;if(d+=m?h:-h,ls(r,o,l)){var v=r.edge(o,l).cutvalue;d+=m?-v:v}}}),d}function Jr(r,t){if(arguments.length<2)t=r.nodes()[0];xn(r,{},1,t)}function xn(r,t,o,i,a){var f=o,s=r.node(i);if(t[i]=!0,b(r.neighbors(i),function(d){if(!Object.prototype.hasOwnProperty.call(t,d))o=xn(r,t,o,d,i)}),s.low=f,s.lim=o++,a)s.parent=a;else delete s.parent;return o}function On(r){return tr(r.edges(),function(t){return r.edge(t).cutvalue<0})}function Ln(r,t,o){var{v:i,w:a}=o;if(!t.hasEdge(i,a))i=o.w,a=o.v;var f=r.node(i),s=r.node(a),d=f,c=!1;if(f.lim>s.lim)d=s,c=!0;var p=lt(t.edges(),function(l){return c===_n(r,r.node(l.v),d)&&c!==_n(r,r.node(l.w),d)});return H(p,function(l){return U(t,l)})}function In(r,t,o,i){var{v:a,w:f}=o;r.removeEdge(a,f),r.setEdge(i.v,i.w,{}),Jr(r),Kr(r,t),ps(r,t)}function ps(r,t){var o=tr(r.nodes(),function(a){return!t.node(a).parent}),i=Wr(r,o);i=i.slice(1),b(i,function(a){var f=r.node(a).parent,s=t.edge(a,f),d=!1;if(!s)s=t.edge(f,a),d=!0;t.node(a).rank=t.node(f).rank+(d?s.minlen:-s.minlen)})}function ls(r,t,o){return r.hasEdge(t,o)}function _n(r,t,o){return o.low<=t.lim&&t.lim<=o.lim}function Zr(r){switch(r.graph().ranker){case"network-simplex":Sn(r);break;case"tight-tree":hs(r);break;case"longest-path":ms(r);break;default:Sn(r)}}var ms=ar;function hs(r){ar(r),Lr(r)}function Sn(r){G(r)}function Nn(r){var t=T(r,"root",{},"_root"),o=gs(r),i=I(xt(o))-1,a=2*i+1;r.graph().nestingRoot=t,b(r.edges(),function(s){r.edge(s).minlen*=a});var f=vs(r)+1;b(r.children(),function(s){Pn(r,t,a,f,i,o,s)}),r.graph().nodeRankFactor=a}function Pn(r,t,o,i,a,f,s){var d=r.children(s);if(!d.length){if(s!==t)r.setEdge(t,s,{weight:0,minlen:o});return}var c=Mr(r,"_bt"),p=Mr(r,"_bb"),l=r.node(s);if(r.setParent(c,s),l.borderTop=c,r.setParent(p,s),l.borderBottom=p,b(d,function(m){Pn(r,t,o,i,a,f,m);var h=r.node(m),v=h.borderTop?h.borderTop:m,w=h.borderBottom?h.borderBottom:m,y=h.borderTop?i:2*i,g=v!==w?1:a-f[s]+1;r.setEdge(c,v,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,p,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(s))r.setEdge(t,c,{weight:0,minlen:a+f[s]})}function gs(r){var t={};function o(i,a){var f=r.children(i);if(f&&f.length)b(f,function(s){o(s,a+1)});t[i]=a}return b(r.children(),function(i){o(i,1)}),t}function vs(r){return ur(r.edges(),function(t,o){return t+r.edge(o).weight},0)}function kn(r){var t=r.graph();r.removeNode(t.nestingRoot),delete t.nestingRoot,b(r.edges(),function(o){var i=r.edge(o);if(i.nestingEdge)r.removeEdge(o)})}function Tn(r,t,o){var i={},a;b(o,function(f){var s=r.parent(f),d,c;while(s){if(d=r.parent(s),d)c=i[d],i[d]=s;else c=a,a=s;if(c&&c!==s){t.setEdge(c,s);return}s=d}})}function Cn(r,t,o){var i=ys(r),a=new ue({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(function(f){return r.node(f)});return b(r.nodes(),function(f){var s=r.node(f),d=r.parent(f);if(s.rank===t||s.minRank<=t&&t<=s.maxRank){if(a.setNode(f),a.setParent(f,d||i),b(r[o](f),function(c){var p=c.v===f?c.w:c.v,l=a.edge(p,f),m=!Re(l)?l.weight:0;a.setEdge(p,f,{weight:r.edge(c).weight+m})}),Object.prototype.hasOwnProperty.call(s,"minRank"))a.setNode(f,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]})}}),a}function ys(r){var t;while(r.hasNode(t=J("_root")));return t}function An(r,t){var o=0;for(var i=1;i<t.length;++i)o+=ws(r,t[i-1],t[i]);return o}function ws(r,t,o){var i=kr(o,E(o,function(p,l){return l})),a=S(E(t,function(p){return A(E(r.outEdges(p),function(l){return{pos:i[l.w],weight:r.edge(l).weight}}),"pos")})),f=1;while(f<o.length)f<<=1;var s=2*f-1;f-=1;var d=E(Array(s),function(){return 0}),c=0;return b(a.forEach(function(p){var l=p.pos+f;d[l]+=p.weight;var m=0;while(l>0){if(l%2)m+=d[l+1];l=l-1>>1,d[l]+=p.weight}c+=p.weight*m})),c}function Rn(r){var t={},o=lt(r.nodes(),function(d){return!r.children(d).length}),i=I(E(o,function(d){return r.node(d).rank})),a=E(P(i+1),function(){return[]});function f(d){if(Er(t,d))return;t[d]=!0;var c=r.node(d);a[c.rank].push(d),b(r.successors(d),f)}var s=A(o,function(d){return r.node(d).rank});return b(s,f),a}function Mn(r,t){return E(t,function(o){var i=r.inEdges(o);if(!i.length)return{v:o};else{var a=ur(i,function(f,s){var d=r.edge(s),c=r.node(s.v);return{sum:f.sum+d.weight*c.order,weight:f.weight+d.weight}},{sum:0,weight:0});return{v:o,barycenter:a.sum/a.weight,weight:a.weight}}})}function Bn(r,t){var o={};b(r,function(a,f){var s=o[a.v]={indegree:0,in:[],out:[],vs:[a.v],i:f};if(!Re(a.barycenter))s.barycenter=a.barycenter,s.weight=a.weight}),b(t.edges(),function(a){var f=o[a.v],s=o[a.w];if(!Re(f)&&!Re(s))s.indegree++,f.out.push(o[a.w])});var i=lt(o,function(a){return!a.indegree});return _s(i)}function _s(r){var t=[];function o(f){return function(s){if(s.merged)return;if(Re(s.barycenter)||Re(f.barycenter)||s.barycenter>=f.barycenter)Es(f,s)}}function i(f){return function(s){if(s.in.push(f),--s.indegree===0)r.push(s)}}while(r.length){var a=r.pop();t.push(a),b(a.in.reverse(),o(a)),b(a.out,i(a))}return E(lt(t,function(f){return!f.merged}),function(f){return K(f,["vs","i","barycenter","weight"])})}function Es(r,t){var o=0,i=0;if(r.weight)o+=r.barycenter*r.weight,i+=r.weight;if(t.weight)o+=t.barycenter*t.weight,i+=t.weight;r.vs=t.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0}function Fn(r,t){var o=an(r,function(l){return Object.prototype.hasOwnProperty.call(l,"barycenter")}),i=o.lhs,a=A(o.rhs,function(l){return-l.i}),f=[],s=0,d=0,c=0;i.sort(xs(!!t)),c=Dn(f,a,c),b(i,function(l){c+=l.vs.length,f.push(l.vs),s+=l.barycenter*l.weight,d+=l.weight,c=Dn(f,a,c)});var p={vs:S(f)};if(d)p.barycenter=s/d,p.weight=d;return p}function Dn(r,t,o){var i;while(t.length&&(i=X(t)).i<=o)t.pop(),r.push(i.vs),o++;return o}function xs(r){return function(t,o){if(t.barycenter<o.barycenter)return-1;else if(t.barycenter>o.barycenter)return 1;return!r?t.i-o.i:o.i-t.i}}function Qr(r,t,o,i){var a=r.children(t),f=r.node(t),s=f?f.borderLeft:void 0,d=f?f.borderRight:void 0,c={};if(s)a=lt(a,function(w){return w!==s&&w!==d});var p=Mn(r,a);b(p,function(w){if(r.children(w.v).length){var y=Qr(r,w.v,o,i);if(c[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Ls(w,y)}});var l=Bn(p,o);Os(l,c);var m=Fn(l,i);if(s){if(m.vs=S([s,m.vs,d]),r.predecessors(s).length){var h=r.node(r.predecessors(s)[0]),v=r.node(r.predecessors(d)[0]);if(!Object.prototype.hasOwnProperty.call(m,"barycenter"))m.barycenter=0,m.weight=0;m.barycenter=(m.barycenter*m.weight+h.order+v.order)/(m.weight+2),m.weight+=2}}return m}function Os(r,t){b(r,function(o){o.vs=S(o.vs.map(function(i){if(t[i])return t[i].vs;return i}))})}function Ls(r,t){if(!Re(r.barycenter))r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight;else r.barycenter=t.barycenter,r.weight=t.weight}function Jn(r){var t=Br(r),o=Xn(r,P(1,t+1),"inEdges"),i=Xn(r,P(t-1,-1,-1),"outEdges"),a=Rn(r);zn(r,a);var f=Number.POSITIVE_INFINITY,s;for(var d=0,c=0;c<4;++d,++c){Is(d%2?o:i,d%4>=2),a=D(r);var p=An(r,a);if(p<f)c=0,s=tt(a),f=p}zn(r,s)}function Xn(r,t,o){return E(t,function(i){return Cn(r,i,o)})}function Is(r,t){var o=new ue;b(r,function(i){var a=i.graph().root,f=Qr(i,a,o,t);b(f.vs,function(s,d){i.node(s).order=d}),Tn(i,o,f.vs)})}function zn(r,t){b(t,function(o){b(o,function(i,a){r.node(i).order=a})})}function Zn(r){var t=Ns(r);b(r.graph().dummyChains,function(o){var i=r.node(o),a=i.edgeObj,f=Ss(r,t,a.v,a.w),{path:s,lca:d}=f,c=0,p=s[c],l=!0;while(o!==a.w){if(i=r.node(o),l){while((p=s[c])!==d&&r.node(p).maxRank<i.rank)c++;if(p===d)l=!1}if(!l){while(c<s.length-1&&r.node(p=s[c+1]).minRank<=i.rank)c++;p=s[c]}r.setParent(o,p),o=r.successors(o)[0]}})}function Ss(r,t,o,i){var a=[],f=[],s=Math.min(t[o].low,t[i].low),d=Math.max(t[o].lim,t[i].lim),c,p;c=o;do c=r.parent(c),a.push(c);while(c&&(t[c].low>s||d>t[c].lim));p=c,c=i;while((c=r.parent(c))!==p)f.push(c);return{path:a.concat(f.reverse()),lca:p}}function Ns(r){var t={},o=0;function i(a){var f=o;b(r.children(a),i),t[a]={low:f,lim:o++}}return b(r.children(),i),t}function Ps(r,t){var o={};function i(a,f){var s=0,d=0,c=a.length,p=X(f);return b(f,function(l,m){var h=Ts(r,l),v=h?r.node(h).order:c;if(h||l===p)b(f.slice(d,m+1),function(w){b(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<s||v<_)&&!(g.dummy&&r.node(w).dummy))$n(o,y,w)})}),d=m+1,s=v}),f}return ur(t,i),o}function ks(r,t){var o={};function i(f,s,d,c,p){var l;b(P(s,d),function(m){if(l=f[m],r.node(l).dummy)b(r.predecessors(l),function(h){var v=r.node(h);if(v.dummy&&(v.order<c||v.order>p))$n(o,h,l)})})}function a(f,s){var d=-1,c,p=0;return b(s,function(l,m){if(r.node(l).dummy==="border"){var h=r.predecessors(l);if(h.length)c=r.node(h[0]).order,i(s,p,m,d,c),p=m,d=c}i(s,p,s.length,c,f.length)}),s}return ur(t,a),o}function Ts(r,t){if(r.node(t).dummy)return tr(r.predecessors(t),function(o){return r.node(o).dummy})}function $n(r,t,o){if(t>o){var i=t;t=o,o=i}if(!Object.prototype.hasOwnProperty.call(r,t))Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=r[t];Object.defineProperty(a,o,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Cs(r,t,o){if(t>o){var i=t;t=o,o=i}return!!r[t]&&Object.prototype.hasOwnProperty.call(r[t],o)}function As(r,t,o,i){var a={},f={},s={};return b(t,function(d){b(d,function(c,p){a[c]=c,f[c]=c,s[c]=p})}),b(t,function(d){var c=-1;b(d,function(p){var l=i(p);if(l.length){l=A(l,function(y){return s[y]});var m=(l.length-1)/2;for(var h=Math.floor(m),v=Math.ceil(m);h<=v;++h){var w=l[h];if(f[p]===p&&c<s[w]&&!Cs(o,p,w))f[w]=p,f[p]=a[p]=a[w],c=s[w]}}})}),{root:a,align:f}}function Rs(r,t,o,i,a){var f={},s=Ms(r,t,o,a),d=a?"borderLeft":"borderRight";function c(m,h){var v=s.nodes(),w=v.pop(),y={};while(w){if(y[w])m(w);else y[w]=!0,v.push(w),v=v.concat(h(w));w=v.pop()}}function p(m){f[m]=s.inEdges(m).reduce(function(h,v){return Math.max(h,f[v.v]+s.edge(v))},0)}function l(m){var h=s.outEdges(m).reduce(function(w,y){return Math.min(w,f[y.w]-s.edge(y))},Number.POSITIVE_INFINITY),v=r.node(m);if(h!==Number.POSITIVE_INFINITY&&v.borderType!==d)f[m]=Math.max(f[m],h)}return c(p,s.predecessors.bind(s)),c(l,s.successors.bind(s)),b(i,function(m){f[m]=f[o[m]]}),f}function Ms(r,t,o,i){var a=new ue,f=r.graph(),s=Fs(f.nodesep,f.edgesep,i);return b(t,function(d){var c;b(d,function(p){var l=o[p];if(a.setNode(l),c){var m=o[c],h=a.edge(m,l);a.setEdge(m,l,Math.max(s(r,p,c),h||0))}c=p})}),a}function js(r,t){return H(xt(t),function(o){var{NEGATIVE_INFINITY:i,POSITIVE_INFINITY:a}=Number;return gt(o,function(f,s){var d=Gs(r,s)/2;i=Math.max(f+d,i),a=Math.min(f-d,a)}),i-a})}function Bs(r,t){var o=xt(t),i=B(o),a=I(o);b(["u","d"],function(f){b(["l","r"],function(s){var d=f+s,c=r[d],p;if(c===t)return;var l=xt(c);if(p=s==="l"?i-B(l):a-I(l),p)r[d]=W(c,function(m){return m+p})})})}function Ds(r,t){return W(r.ul,function(o,i){if(t)return r[t.toLowerCase()][i];else{var a=A(E(r,i));return(a[1]+a[2])/2}})}function Qn(r){var t=D(r),o=nr(Ps(r,t),ks(r,t)),i={},a;b(["u","d"],function(s){a=s==="u"?t:xt(t).reverse(),b(["l","r"],function(d){if(d==="r")a=E(a,function(m){return xt(m).reverse()});var c=(s==="u"?r.predecessors:r.successors).bind(r),p=As(r,a,o,c),l=Rs(r,a,p.root,p.align,d==="r");if(d==="r")l=W(l,function(m){return-m});i[s+d]=l})});var f=js(r,i);return Bs(i,f),Ds(i,r.graph().align)}function Fs(r,t,o){return function(i,a,f){var s=i.node(a),d=i.node(f),c=0,p;if(c+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":p=-s.width/2;break;case"r":p=s.width/2;break}if(p)c+=o?p:-p;if(p=0,c+=(s.dummy?t:r)/2,c+=(d.dummy?t:r)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":p=d.width/2;break;case"r":p=-d.width/2;break}if(p)c+=o?p:-p;return p=0,c}}function Gs(r,t){return r.node(t).width}function ro(r){r=Or(r),Xs(r),bt(Qn(r),function(t,o){r.node(o).x=t})}function Xs(r){var t=D(r),o=r.graph().ranksep,i=0;b(t,function(a){var f=I(E(a,function(s){return r.node(s).height}));b(a,function(s){r.node(s).y=i+f/2}),i+=f+o})}function ne(r,t){var o=t&&t.debugTiming?fn:sn;o("layout",()=>{var i=o(" buildLayoutGraph",()=>$s(r));o(" runLayout",()=>Us(i,o)),o(" updateInputGraph",()=>Vs(r,i))})}function Us(r,t){t(" makeSpaceForEdgeLabels",()=>Qs(r)),t(" removeSelfEdges",()=>su(r)),t(" acyclic",()=>Qt(r)),t(" nestingGraph.run",()=>Nn(r)),t(" rank",()=>Zr(Or(r))),t(" injectEdgeLabelProxies",()=>ru(r)),t(" removeEmptyRanks",()=>on(r)),t(" nestingGraph.cleanup",()=>kn(r)),t(" normalizeRanks",()=>nn(r)),t(" assignRankMinMax",()=>eu(r)),t(" removeEdgeLabelProxies",()=>tu(r)),t(" normalize.run",()=>gn(r)),t(" parentDummyChains",()=>Zn(r)),t(" addBorderSegments",()=>cn(r)),t(" order",()=>Jn(r)),t(" insertSelfEdges",()=>uu(r)),t(" adjustCoordinateSystem",()=>ln(r)),t(" position",()=>ro(r)),t(" positionSelfEdges",()=>du(r)),t(" removeBorderNodes",()=>fu(r)),t(" normalize.undo",()=>vn(r)),t(" fixupEdgeLabelCoords",()=>iu(r)),t(" undoCoordinateSystem",()=>mn(r)),t(" translateGraph",()=>nu(r)),t(" assignNodeIntersects",()=>ou(r)),t(" reversePoints",()=>au(r)),t(" acyclic.undo",()=>rn(r))}function Vs(r,t){b(r.nodes(),function(o){var i=r.node(o),a=t.node(o);if(i){if(i.x=a.x,i.y=a.y,t.children(o).length)i.width=a.width,i.height=a.height}}),b(r.edges(),function(o){var i=r.edge(o),a=t.edge(o);if(i.points=a.points,Object.prototype.hasOwnProperty.call(a,"x"))i.x=a.x,i.y=a.y}),r.graph().width=t.graph().width,r.graph().height=t.graph().height}var Ys=["nodesep","edgesep","ranksep","marginx","marginy"],zs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ws=["acyclicer","ranker","rankdir","align"],qs=["width","height"],Hs={width:0,height:0},Ks=["minlen","weight","width","height","labeloffset"],Js={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Zs=["labelpos"];function $s(r){var t=new ue({multigraph:!0,compound:!0}),o=ee(r.graph());return t.setGraph(nr({},zs,re(o,Ys),K(o,Ws))),b(r.nodes(),function(i){var a=ee(r.node(i));t.setNode(i,it(re(a,qs),Hs)),t.setParent(i,r.parent(i))}),b(r.edges(),function(i){var a=ee(r.edge(i));t.setEdge(i,nr({},Js,re(a,Ks),K(a,Zs)))}),t}function Qs(r){var t=r.graph();t.ranksep/=2,b(r.edges(),function(o){var i=r.edge(o);if(i.minlen*=2,i.labelpos.toLowerCase()!=="c")if(t.rankdir==="TB"||t.rankdir==="BT")i.width+=i.labeloffset;else i.height+=i.labeloffset})}function ru(r){b(r.edges(),function(t){var o=r.edge(t);if(o.width&&o.height){var i=r.node(t.v),a=r.node(t.w),f={rank:(a.rank-i.rank)/2+i.rank,e:t};T(r,"edge-proxy",f,"_ep")}})}function eu(r){var t=0;b(r.nodes(),function(o){var i=r.node(o);if(i.borderTop)i.minRank=r.node(i.borderTop).rank,i.maxRank=r.node(i.borderBottom).rank,t=I(t,i.maxRank)}),r.graph().maxRank=t}function tu(r){b(r.nodes(),function(t){var o=r.node(t);if(o.dummy==="edge-proxy")r.edge(o.e).labelRank=o.rank,r.removeNode(t)})}function nu(r){var t=Number.POSITIVE_INFINITY,o=0,i=Number.POSITIVE_INFINITY,a=0,f=r.graph(),s=f.marginx||0,d=f.marginy||0;function c(p){var{x:l,y:m,width:h,height:v}=p;t=Math.min(t,l-h/2),o=Math.max(o,l+h/2),i=Math.min(i,m-v/2),a=Math.max(a,m+v/2)}b(r.nodes(),function(p){c(r.node(p))}),b(r.edges(),function(p){var l=r.edge(p);if(Object.prototype.hasOwnProperty.call(l,"x"))c(l)}),t-=s,i-=d,b(r.nodes(),function(p){var l=r.node(p);l.x-=t,l.y-=i}),b(r.edges(),function(p){var l=r.edge(p);if(b(l.points,function(m){m.x-=t,m.y-=i}),Object.prototype.hasOwnProperty.call(l,"x"))l.x-=t;if(Object.prototype.hasOwnProperty.call(l,"y"))l.y-=i}),f.width=o-t+s,f.height=a-i+d}function ou(r){b(r.edges(),function(t){var o=r.edge(t),i=r.node(t.v),a=r.node(t.w),f,s;if(!o.points)o.points=[],f=a,s=i;else f=o.points[0],s=o.points[o.points.length-1];o.points.unshift(Rr(i,f)),o.points.push(Rr(a,s))})}function iu(r){b(r.edges(),function(t){var o=r.edge(t);if(Object.prototype.hasOwnProperty.call(o,"x")){if(o.labelpos==="l"||o.labelpos==="r")o.width-=o.labeloffset;switch(o.labelpos){case"l":o.x-=o.width/2+o.labeloffset;break;case"r":o.x+=o.width/2+o.labeloffset;break}}})}function au(r){b(r.edges(),function(t){var o=r.edge(t);if(o.reversed)o.points.reverse()})}function fu(r){b(r.nodes(),function(t){if(r.children(t).length){var o=r.node(t),i=r.node(o.borderTop),a=r.node(o.borderBottom),f=r.node(X(o.borderLeft)),s=r.node(X(o.borderRight));o.width=Math.abs(s.x-f.x),o.height=Math.abs(a.y-i.y),o.x=f.x+o.width/2,o.y=i.y+o.height/2}}),b(r.nodes(),function(t){if(r.node(t).dummy==="border")r.removeNode(t)})}function su(r){b(r.edges(),function(t){if(t.v===t.w){var o=r.node(t.v);if(!o.selfEdges)o.selfEdges=[];o.selfEdges.push({e:t,label:r.edge(t)}),r.removeEdge(t)}})}function uu(r){var t=D(r);b(t,function(o){var i=0;b(o,function(a,f){var s=r.node(a);s.order=f+i,b(s.selfEdges,function(d){T(r,"selfedge",{width:d.label.width,height:d.label.height,rank:s.rank,order:f+ ++i,e:d.e,label:d.label},"_se")}),delete s.selfEdges})})}function du(r){b(r.nodes(),function(t){var o=r.node(t);if(o.dummy==="selfedge"){var i=r.node(o.e.v),a=i.x+i.width/2,f=i.y,s=o.x-a,d=i.height/2;r.setEdge(o.e,o.label),r.removeNode(t),o.label.points=[{x:a+2*s/3,y:f-d},{x:a+5*s/6,y:f-d},{x:a+s,y:f},{x:a+5*s/6,y:f+d},{x:a+2*s/3,y:f+d}],o.label.x=o.x,o.label.y=o.y}})}function re(r,t){return W(K(r,t),Number)}function ee(r){var t={};return b(r,function(o,i){t[i.toLowerCase()]=o}),t}var eo=e((r,t,o)=>Math.max(t,Math.min(o,r)),"clamp"),to=e((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),cu=e((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),pu=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],lu=e((r,t,o,i,a)=>{let f=[],s=new Set;if(o.forEach(({start:l,end:m})=>{if(l!==i)s.add(l);if(m!==i)s.add(m)}),s.forEach((l)=>{let m=r.node(l);if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)}),f.length===0)o.forEach(({edge:l})=>{(l.points??[]).forEach((m)=>{if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)})});if(f.length===0)return to(a);let d=f.reduce((l,m)=>({x:l.x+m.x/f.length,y:l.y+m.y/f.length}),{x:0,y:0}),c=d.x-t.x,p=d.y-t.y;if(Math.abs(c)>Math.abs(p))return c>0?"right":"left";if(Math.abs(p)>0)return p>0?"bottom":"top";return to(a)},"getSelfLoopSide"),mu=e((r,t="top",o=0,i=0)=>{let a=r.x,f=r.y-o,s=r.width/2,d=r.height/2,c=Math.max(36,Math.min(100,r.width*0.8)),p=eo(Math.max(i,r.width*0.35),36,c),l=eo(Math.min(r.width,r.height)*0.45,24,48);switch(t){case"bottom":{let m=f+d;return[{x:a-p/2,y:m},{x:a-p/2,y:m+l},{x:a+p/2,y:m+l},{x:a+p/2,y:m}]}case"right":{let m=a+s;return[{x:m,y:f-p/2},{x:m+l,y:f-p/2},{x:m+l,y:f+p/2},{x:m,y:f+p/2}]}case"left":{let m=a-s;return[{x:m,y:f-p/2},{x:m-l,y:f-p/2},{x:m-l,y:f+p/2},{x:m,y:f+p/2}]}case"top":default:{let m=f-d;return[{x:a-p/2,y:m},{x:a-p/2,y:m-l},{x:a+p/2,y:m-l},{x:a+p/2,y:m}]}}},"getSelfLoopPoints"),hu=e((r,t,o="top",i=0,a={})=>{let s=r.x,d=r.y-i,c=a.width??0,p=a.height??0;switch(o){case"bottom":return{x:s,y:Math.max(...t.map((l)=>l.y))+p/2+4};case"right":return{x:Math.max(...t.map((l)=>l.x))+c/2+4,y:d};case"left":return{x:Math.min(...t.map((l)=>l.x))-c/2-4,y:d};case"top":default:return{x:s,y:Math.min(...t.map((l)=>l.y))-p/2-4}}},"getSelfLoopLabelPosition"),oo=e((r,t=0,{mergeSelfLoops:o=!0}={})=>{let i=new Map,a=[],f=r.graph()?.rankdir;return r.edges().forEach((s)=>{let d=r.edge(s);if(o&&d.selfLoop){let c=d.selfLoop.id;if(!i.has(c))i.set(c,[]);i.get(c).push({edge:d,start:s.v,end:s.w})}else a.push({edge:d,start:s.v,end:s.w})}),i.forEach((s)=>{if(s.length!==3){s.forEach((_)=>a.push(_));return}s.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[d,c,p]=s,l=d.edge.originalEdge??c.edge.originalEdge??p.edge.originalEdge??c.edge,m=r.node(l.start);if(!m){s.forEach((_)=>a.push(_));return}let h={width:c.edge.width,height:c.edge.height},v=lu(r,m,s,l.start,f),w=mu(m,v,t,h.width??0),y=hu(m,w,v,t,h),g={...c.edge,...l,id:l.id,points:w,start:l.start,end:l.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:c.edge.labelStyle,fromCluster:d.edge.fromCluster??c.edge.fromCluster??p.edge.fromCluster,toCluster:d.edge.toCluster??c.edge.toCluster??p.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),io=e(async({element:r,graph:t,diagramType:o,id:i,parentCluster:a,siteConfig:f})=>{let s=t.graph().rankdir;n.trace("Dir in recursive render - dir:",s);let{clusters:d,edgePaths:c,edgeLabels:p,nodes:l,rootGroups:m}=Ri(r,{edgePathsClass:"edgePaths"});if(!t.nodes())n.info("No nodes found for",t);else n.info("Recursive render XXX",t.nodes());if(t.edges().length>0)n.info("Recursive edges",t.edge(t.edges()[0]));let h=cu(o);await Promise.all(t.nodes().map(async function(y){let g=t.node(y);if(a!==void 0){let _=JSON.parse(JSON.stringify(a.clusterData));if(n.trace(`Setting data for parent cluster XXX
|
|
1
|
+
import{e,n,u,N,Pt,kl,Ct,mr,Ft,xn,gr}from"./index.zkx4ryzt.js";import{Ae,je,ot,Ne,bt,ar,te,we,ht,ir,pt,Hn,Pi,Bi,Fi,Fr,Nt,$i,$r,Ge,zr,Wt,Ot,Hr,or,Ur,zi,Hi,Un,_e,Ui,qr,sr,jr,qn,jn,lr,qi,Gn,ji,Ta,vt,Vn,Gi,Vi,Wi,Ze,Wn,Kn,Gr,Ki,Yn,b,st,yt,Le,cr,le}from"./index.sw8gvntb.js";import{Mi,Ni,Q,fn,ul,Oi,it}from"./index.qr6a02kx.js";import{sa}from"./index.rkgfxpm3.js";var hr={};sa(hr,{default:()=>Z});var so=/\s/;function uo(r){var t=r.length;while(t--&&so.test(r.charAt(t)));return t}var ae=uo;var co=/^\s+/;function po(r){return r?r.slice(0,ae(r)+1).replace(co,""):r}var fe=po;var se=NaN,lo=/^[-+]0x[0-9a-f]+$/i,mo=/^0b[01]+$/i,ho=/^0o[0-7]+$/i,go=parseInt;function vo(r){if(typeof r=="number")return r;if(bt(r))return se;if(we(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=we(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=fe(r);var o=mo.test(r);return o||ho.test(r)?go(r.slice(2),o?2:8):lo.test(r)?se:+r}var ue=vo;var de=1/0,bo=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function yo(r){if(!r)return r===0?r:0;if(r=ue(r),r===de||r===-de){var t=r<0?-1:1;return t*bo}return r===r?r:0}var V=yo;function wo(r){var t=V(r),o=t%1;return t===t?o?t-o:t:0}var ce=wo;var pe=Object.create,_o=function(){function r(){}return function(t){if(!we(t))return{};if(pe)return pe(t);r.prototype=t;var o=new r;return r.prototype=void 0,o}}(),me=_o;function Eo(r,t){var o=-1,i=r.length;t||(t=Array(i));while(++o<i)t[o]=r[o];return t}var dr=Eo;function xo(r,t,o){if(t=="__proto__"&&Hn)Hn(r,t,{configurable:!0,enumerable:!0,value:o,writable:!0});else r[t]=o}var M=xo;var Oo=Object.prototype,Lo=Oo.hasOwnProperty;function Io(r,t,o){var i=r[t];if(!(Lo.call(r,t)&&Nt(i,o))||o===void 0&&!(t in r))M(r,t,o)}var j=Io;function So(r,t,o,i){var a=!o;o||(o={});var f=-1,s=t.length;while(++f<s){var d=t[f],c=i?i(o[d],r[d],d,o,r):void 0;if(c===void 0)c=r[d];if(a)M(o,d,c);else j(o,d,c)}return o}var k=So;function No(r,t,o){if(!we(o))return!1;var i=typeof t;if(i=="number"?Ge(o)&&Fr(t,o.length):i=="string"&&(t in o))return Nt(o[t],r);return!1}var C=No;function Po(r){return $r(function(t,o){var i=-1,a=o.length,f=a>1?o[a-1]:void 0,s=a>2?o[2]:void 0;if(f=r.length>3&&typeof f=="function"?(a--,f):void 0,s&&C(o[0],o[1],s))f=a<3?void 0:f,a=1;t=Object(t);while(++i<a){var d=o[i];if(d)r(t,d,i,f)}return t})}var he=Po;function ko(r){var t=[];if(r!=null)for(var o in Object(r))t.push(o);return t}var ge=ko;var To=Object.prototype,Co=To.hasOwnProperty;function Ao(r){if(!we(r))return ge(r);var t=zr(r),o=[];for(var i in r)if(!(i=="constructor"&&(t||!Co.call(r,i))))o.push(i);return o}var ve=Ao;function Ro(r){return Ge(r)?zi(r,!0):ve(r)}var L=Ro;function Mo(r){var t=r==null?0:r.length;return t?jn(r,1):[]}var S=Mo;function jo(r){return Pi($i(r,void 0,S),r+"")}var be=jo;var Bo=Hi(Object.getPrototypeOf,Object),Y=Bo;var Do="[object Object]",Fo=Function.prototype,Go=Object.prototype,ye=Fo.toString,Xo=Go.hasOwnProperty,Uo=ye.call(Object);function Vo(r){if(!Ne(r)||ot(r)!=Do)return!1;var t=Y(r);if(t===null)return!0;var o=Xo.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&ye.call(o)==Uo}var Ee=Vo;var Yo="\\ud800-\\udfff",zo="\\u0300-\\u036f",Wo="\\ufe20-\\ufe2f",qo="\\u20d0-\\u20ff",Ho=zo+Wo+qo,Ko="\\ufe0e\\ufe0f",Jo="\\u200d",Zo=RegExp("["+Jo+Yo+Ho+Ko+"]");function $o(r){return Zo.test(r)}var xe=$o;function Qo(r,t){return r&&k(t,_e(t),r)}var Oe=Qo;function ri(r,t){return r&&k(t,L(t),r)}var Ie=ri;var Te=typeof hr=="object"&&hr&&!hr.nodeType&&hr,Se=Te&&typeof pr=="object"&&pr&&!pr.nodeType&&pr,ei=Se&&Se.exports===Te,Pe=ei?Ae.Buffer:void 0,ke=Pe?Pe.allocUnsafe:void 0;function ti(r,t){if(t)return r.slice();var o=r.length,i=ke?ke(o):new r.constructor(o);return r.copy(i),i}var Z=ti;function ni(r,t){return k(r,Gn(r),t)}var Ce=ni;var oi=Object.getOwnPropertySymbols,ii=!oi?qi:function(r){var t=[];while(r)qn(t,Gn(r)),r=Y(r);return t},vr=ii;function ai(r,t){return k(r,vr(r),t)}var Re=ai;function fi(r){return ji(r,L,vr)}var Me=fi;var si=Object.prototype,ui=si.hasOwnProperty;function di(r){var t=r.length,o=new r.constructor(t);if(t&&typeof r[0]=="string"&&ui.call(r,"index"))o.index=r.index,o.input=r.input;return o}var Be=di;function ci(r){var t=new r.constructor(r.byteLength);return new Vn(t).set(new Vn(r)),t}var z=ci;function pi(r,t){var o=t?z(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}var De=pi;var li=/\w*$/;function mi(r){var t=new r.constructor(r.source,li.exec(r));return t.lastIndex=r.lastIndex,t}var Fe=mi;var Xe=je?je.prototype:void 0,Ue=Xe?Xe.valueOf:void 0;function hi(r){return Ue?Object(Ue.call(r)):{}}var Ve=hi;function gi(r,t){var o=t?z(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}var br=gi;var vi="[object Boolean]",bi="[object Date]",yi="[object Map]",wi="[object Number]",_i="[object RegExp]",Ei="[object Set]",xi="[object String]",Li="[object Symbol]",Ii="[object ArrayBuffer]",Si="[object DataView]",ki="[object Float32Array]",Ti="[object Float64Array]",Ci="[object Int8Array]",Ai="[object Int16Array]",Ri="[object Int32Array]",Di="[object Uint8Array]",Xi="[object Uint8ClampedArray]",Yi="[object Uint16Array]",Ji="[object Uint32Array]";function Zi(r,t,o){var i=r.constructor;switch(t){case Ii:return z(r);case vi:case bi:return new i(+r);case Si:return De(r,o);case ki:case Ti:case Ci:case Ai:case Ri:case Di:case Xi:case Yi:case Ji:return br(r,o);case yi:return new i;case wi:case xi:return new i(r);case _i:return Fe(r);case Ei:return new i;case Li:return Ve(r)}}var Ye=Zi;function Qi(r){return typeof r.constructor=="function"&&!zr(r)?me(Y(r)):{}}var yr=Qi;var ra="[object Map]";function ea(r){return Ne(r)&&vt(r)==ra}var ze=ea;var We=or&&or.isMap,ta=We?Hr(We):ze,qe=ta;var na="[object Set]";function oa(r){return Ne(r)&&vt(r)==na}var He=oa;var Ke=or&&or.isSet,ia=Ke?Hr(Ke):He,Je=ia;var aa=1,fa=2,ua=4,$e="[object Arguments]",da="[object Array]",ca="[object Boolean]",pa="[object Date]",la="[object Error]",Qe="[object Function]",ma="[object GeneratorFunction]",ha="[object Map]",ga="[object Number]",rt="[object Object]",va="[object RegExp]",ba="[object Set]",ya="[object String]",wa="[object Symbol]",_a="[object WeakMap]",Ea="[object ArrayBuffer]",xa="[object DataView]",Oa="[object Float32Array]",La="[object Float64Array]",Ia="[object Int8Array]",Sa="[object Int16Array]",Na="[object Int32Array]",Pa="[object Uint8Array]",ka="[object Uint8ClampedArray]",Ca="[object Uint16Array]",Aa="[object Uint32Array]",x={};x[$e]=x[da]=x[Ea]=x[xa]=x[ca]=x[pa]=x[Oa]=x[La]=x[Ia]=x[Sa]=x[Na]=x[ha]=x[ga]=x[rt]=x[va]=x[ba]=x[ya]=x[wa]=x[Pa]=x[ka]=x[Ca]=x[Aa]=!0;x[la]=x[Qe]=x[_a]=!1;function wr(r,t,o,i,a,f){var s,d=t&aa,c=t&fa,p=t&ua;if(o)s=a?o(r,i,a,f):o(r);if(s!==void 0)return s;if(!we(r))return r;var l=te(r);if(l){if(s=Be(r),!d)return dr(r,s)}else{var m=vt(r),h=m==Qe||m==ma;if(Ot(r))return Z(r,d);if(m==rt||m==$e||h&&!a){if(s=c||h?{}:yr(r),!d)return c?Re(r,Ie(s,r)):Ce(r,Oe(s,r))}else{if(!x[m])return a?r:{};s=Ye(r,m,d)}}f||(f=new lr);var v=f.get(r);if(v)return v;if(f.set(r,s),Je(r))r.forEach(function(g){s.add(wr(g,t,o,g,r,f))});else if(qe(r))r.forEach(function(g,_){s.set(_,wr(g,t,o,_,r,f))});var w=p?c?Me:Ta:c?L:_e,y=l?void 0:w(r);return Bi(y||r,function(g,_){if(y)_=g,g=r[_];j(s,_,wr(g,t,o,_,r,f))}),s}var et=wr;var Ra=1,Ma=4;function ja(r){return et(r,Ra|Ma)}var tt=ja;var Ba=function(){return Ae.Date.now()},Sr=Ba;var nt=Object.prototype,Da=nt.hasOwnProperty,Fa=$r(function(r,t){r=Object(r);var o=-1,i=t.length,a=i>2?t[2]:void 0;if(a&&C(t[0],t[1],a))i=1;while(++o<i){var f=t[o],s=L(f),d=-1,c=s.length;while(++d<c){var p=s[d],l=r[p];if(l===void 0||Nt(l,nt[p])&&!Da.call(r,p))r[p]=f[p]}}return r}),at=Fa;function Ga(r,t,o){if(o!==void 0&&!Nt(r[t],o)||o===void 0&&!(t in r))M(r,t,o)}var rr=Ga;function Xa(r,t){if(t==="constructor"&&typeof r[t]==="function")return;if(t=="__proto__")return;return r[t]}var er=Xa;function Ua(r){return k(r,L(r))}var ft=Ua;function Va(r,t,o,i,a,f,s){var d=er(r,o),c=er(t,o),p=s.get(c);if(p){rr(r,o,p);return}var l=f?f(d,c,o+"",r,t,s):void 0,m=l===void 0;if(m){var h=te(c),v=!h&&Ot(c),w=!h&&!v&&Ur(c);if(l=c,h||v||w)if(te(d))l=d;else if(Ki(d))l=dr(d);else if(v)m=!1,l=Z(c,!0);else if(w)m=!1,l=br(c,!0);else l=[];else if(Ee(c)||Wt(c)){if(l=d,Wt(d))l=ft(d);else if(!we(d)||ir(d))l=yr(c)}else m=!1}if(m)s.set(c,l),a(l,c,i,f,s),s.delete(c);rr(r,o,l)}var ut=Va;function dt(r,t,o,i,a){if(r===t)return;Wn(t,function(f,s){if(a||(a=new lr),we(f))ut(r,t,s,o,dt,i,a);else{var d=i?i(er(r,s),f,s+"",r,t,a):void 0;if(d===void 0)d=f;rr(r,s,d)}},L)}var ct=dt;function Ya(r){var t=r==null?0:r.length;return t?r[t-1]:void 0}var X=Ya;function za(r){return function(t,o,i){var a=Object(t);if(!Ge(t)){var f=Ze(o,3);t=_e(t),o=function(d){return f(a[d],d,a)}}var s=r(t,o,i);return s>-1?a[f?t[s]:s]:void 0}}var lt=za;var Wa=Math.max;function qa(r,t,o){var i=r==null?0:r.length;if(!i)return-1;var a=o==null?0:ce(o);if(a<0)a=Wa(i+a,0);return Fi(r,Ze(t,3),a)}var mt=qa;var Ha=lt(mt),tr=Ha;function Ka(r,t){var o=-1,i=Ge(r)?Array(r.length):[];return Gr(r,function(a,f,s){i[++o]=t(a,f,s)}),i}var _r=Ka;function Ja(r,t){var o=te(r)?ar:_r;return o(r,Ze(t,3))}var E=Ja;function Za(r,t){return r==null?r:Wn(r,Yn(t),L)}var gt=Za;function $a(r,t){return r&&Kn(r,Yn(t))}var wt=$a;function Qa(r,t){return r>t}var _t=Qa;var rf=Object.prototype,ef=rf.hasOwnProperty;function tf(r,t){return r!=null&&ef.call(r,t)}var Et=tf;function nf(r,t){return r!=null&&Gi(r,t,Et)}var Er=nf;var of="[object String]";function af(r){return typeof r=="string"||!te(r)&&Ne(r)&&ot(r)==of}var xt=af;function ff(r,t){return r<t}var xr=ff;function sf(r,t){var o={};return t=Ze(t,3),Kn(r,function(i,a,f){M(o,a,t(i,a,f))}),o}var W=sf;function uf(r,t,o){var i=-1,a=r.length;while(++i<a){var f=r[i],s=t(f);if(s!=null&&(d===void 0?s===s&&!bt(s):o(s,d)))var d=s,c=f}return c}var q=uf;function df(r){return r&&r.length?q(r,ht,_t):void 0}var I=df;var cf=he(function(r,t,o){ct(r,t,o)}),nr=cf;function pf(r){return r&&r.length?q(r,ht,xr):void 0}var B=pf;function lf(r,t){return r&&r.length?q(r,Ze(t,2),xr):void 0}var H=lf;function mf(r,t,o,i){if(!we(r))return r;t=qr(t,r);var a=-1,f=t.length,s=f-1,d=r;while(d!=null&&++a<f){var c=sr(t[a]),p=o;if(c==="__proto__"||c==="constructor"||c==="prototype")return r;if(a!=s){var l=d[c];if(p=i?i(l,c,d):void 0,p===void 0)p=we(l)?l:Fr(t[a+1])?[]:{}}j(d,c,p),d=d[c]}return r}var Lt=mf;function hf(r,t,o){var i=-1,a=t.length,f={};while(++i<a){var s=t[i],d=jr(r,s);if(o(d,s))Lt(f,qr(s,r),d)}return f}var It=hf;function gf(r,t){var o=r.length;r.sort(t);while(o--)r[o]=r[o].value;return r}var St=gf;function vf(r,t){if(r!==t){var o=r!==void 0,i=r===null,a=r===r,f=bt(r),s=t!==void 0,d=t===null,c=t===t,p=bt(t);if(!d&&!p&&!f&&r>t||f&&s&&c&&!d&&!p||i&&s&&c||!o&&c||!a)return 1;if(!i&&!f&&!p&&r<t||p&&o&&a&&!i&&!f||d&&o&&a||!s&&a||!c)return-1}return 0}var kt=vf;function bf(r,t,o){var i=-1,a=r.criteria,f=t.criteria,s=a.length,d=o.length;while(++i<s){var c=kt(a[i],f[i]);if(c){if(i>=d)return c;var p=o[i];return c*(p=="desc"?-1:1)}}return r.index-t.index}var Tt=bf;function yf(r,t,o){if(t.length)t=ar(t,function(f){if(te(f))return function(s){return jr(s,f.length===1?f[0]:f)};return f});else t=[ht];var i=-1;t=ar(t,Hr(Ze));var a=_r(r,function(f,s,d){var c=ar(t,function(p){return p(f)});return{criteria:c,index:++i,value:f}});return St(a,function(f,s){return Tt(f,s,o)})}var At=yf;var wf=Wi("length"),Rt=wf;var jt="\\ud800-\\udfff",_f="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",xf="\\u20d0-\\u20ff",Of=_f+Ef+xf,Lf="\\ufe0e\\ufe0f",If="["+jt+"]",Nr="["+Of+"]",Pr="\\ud83c[\\udffb-\\udfff]",Sf="(?:"+Nr+"|"+Pr+")",Bt="[^"+jt+"]",Dt="(?:\\ud83c[\\udde6-\\uddff]){2}",Gt="[\\ud800-\\udbff][\\udc00-\\udfff]",Nf="\\u200d",Xt=Sf+"?",Ut="["+Lf+"]?",Pf="(?:"+Nf+"(?:"+[Bt,Dt,Gt].join("|")+")"+Ut+Xt+")*",kf=Ut+Xt+Pf,Tf="(?:"+[Bt+Nr+"?",Nr,Dt,Gt,If].join("|")+")",Mt=RegExp(Pr+"(?="+Pr+")|"+Tf+kf,"g");function Cf(r){var t=Mt.lastIndex=0;while(Mt.test(r))++t;return t}var Vt=Cf;function Af(r){return xe(r)?Vt(r):Rt(r)}var Yt=Af;function Rf(r,t){return It(r,t,function(o,i){return Vi(r,i)})}var zt=Rf;var Mf=be(function(r,t){return r==null?{}:zt(r,t)}),K=Mf;var{ceil:jf,max:Bf}=Math;function Df(r,t,o,i){var a=-1,f=Bf(jf((t-r)/(o||1)),0),s=Array(f);while(f--)s[i?f:++a]=r,r+=o;return s}var qt=Df;function Ff(r){return function(t,o,i){if(i&&typeof i!="number"&&C(t,o,i))o=i=void 0;if(t=V(t),o===void 0)o=t,t=0;else o=V(o);return i=i===void 0?t<o?1:-1:V(i),qt(t,o,i,r)}}var Ht=Ff;var Gf=Ht(),P=Gf;var Xf="[object Map]",Uf="[object Set]";function Vf(r){if(r==null)return 0;if(Ge(r))return xt(r)?Yt(r):r.length;var t=vt(r);if(t==Xf||t==Uf)return r.size;return Un(r).length}var Kt=Vf;var Yf=$r(function(r,t){if(r==null)return[];var o=t.length;if(o>1&&C(r,t[0],t[1]))t=[];else if(o>2&&C(t[0],t[1],t[2]))t=[t[0]];return At(r,jn(t,1),[])}),A=Yf;var zf=0;function Wf(r){var t=++zf;return Ui(r)+t}var J=Wf;function qf(r,t,o){var i=-1,a=r.length,f=t.length,s={};while(++i<a){var d=i<f?t[i]:void 0;o(s,r[i],d)}return s}var Jt=qf;function Hf(r,t){return Jt(r||[],t||[],j)}var kr=Hf;class Tr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,t=r._prev;if(t!==r)return Zt(t),t}enqueue(r){var t=this._sentinel;if(r._prev&&r._next)Zt(r);r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){var r=[],t=this._sentinel,o=t._prev;while(o!==t)r.push(JSON.stringify(o,Kf)),o=o._prev;return"["+r.join(", ")+"]"}}function Zt(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function Kf(r,t){if(r!=="_next"&&r!=="_prev")return t}var Jf=pt(1);function $t(r,t){if(r.nodeCount()<=1)return[];var o=$f(r,t||Jf),i=Zf(o.graph,o.buckets,o.zeroIdx);return S(E(i,function(a){return r.outEdges(a.v,a.w)}))}function Zf(r,t,o){var i=[],a=t[t.length-1],f=t[0],s;while(r.nodeCount()){while(s=f.dequeue())Cr(r,t,o,s);while(s=a.dequeue())Cr(r,t,o,s);if(r.nodeCount()){for(var d=t.length-2;d>0;--d)if(s=t[d].dequeue(),s){i=i.concat(Cr(r,t,o,s,!0));break}}}return i}function Cr(r,t,o,i,a){var f=a?[]:void 0;return b(r.inEdges(i.v),function(s){var d=r.edge(s),c=r.node(s.v);if(a)f.push({v:s.v,w:s.w});c.out-=d,Ar(t,o,c)}),b(r.outEdges(i.v),function(s){var d=r.edge(s),c=s.w,p=r.node(c);p.in-=d,Ar(t,o,p)}),r.removeNode(i.v),f}function $f(r,t){var o=new le,i=0,a=0;b(r.nodes(),function(d){o.setNode(d,{v:d,in:0,out:0})}),b(r.edges(),function(d){var c=o.edge(d.v,d.w)||0,p=t(d),l=c+p;o.setEdge(d.v,d.w,l),a=Math.max(a,o.node(d.v).out+=p),i=Math.max(i,o.node(d.w).in+=p)});var f=P(a+i+3).map(function(){return new Tr}),s=i+1;return b(o.nodes(),function(d){Ar(f,s,o.node(d))}),{graph:o,buckets:f,zeroIdx:s}}function Ar(r,t,o){if(!o.out)r[0].enqueue(o);else if(!o.in)r[r.length-1].enqueue(o);else r[o.out-o.in+t].enqueue(o)}function Qt(r){var t=r.graph().acyclicer==="greedy"?$t(r,o(r)):Qf(r);b(t,function(i){var a=r.edge(i);r.removeEdge(i),a.forwardName=i.name,a.reversed=!0,r.setEdge(i.w,i.v,a,J("rev"))});function o(i){return function(a){return i.edge(a).weight}}}function Qf(r){var t=[],o={},i={};function a(f){if(Object.prototype.hasOwnProperty.call(i,f))return;i[f]=!0,o[f]=!0,b(r.outEdges(f),function(s){if(Object.prototype.hasOwnProperty.call(o,s.w))t.push(s);else a(s.w)}),delete o[f]}return b(r.nodes(),a),t}function rn(r){b(r.edges(),function(t){var o=r.edge(t);if(o.reversed){r.removeEdge(t);var i=o.forwardName;delete o.reversed,delete o.forwardName,r.setEdge(t.w,t.v,o,i)}})}function T(r,t,o,i){var a;do a=J(i);while(r.hasNode(a));return o.dummy=t,r.setNode(a,o),a}function tn(r){var t=new le().setGraph(r.graph());return b(r.nodes(),function(o){t.setNode(o,r.node(o))}),b(r.edges(),function(o){var i=t.edge(o.v,o.w)||{weight:0,minlen:1},a=r.edge(o);t.setEdge(o.v,o.w,{weight:i.weight+a.weight,minlen:Math.max(i.minlen,a.minlen)})}),t}function Or(r){var t=new le({multigraph:r.isMultigraph()}).setGraph(r.graph());return b(r.nodes(),function(o){if(!r.children(o).length)t.setNode(o,r.node(o))}),b(r.edges(),function(o){t.setEdge(o,r.edge(o))}),t}function Rr(r,t){var{x:o,y:i}=r,a=t.x-o,f=t.y-i,s=r.width/2,d=r.height/2;if(!a&&!f)throw Error("Not possible to find intersection inside of the rectangle");var c,p;if(Math.abs(f)*s>Math.abs(a)*d){if(f<0)d=-d;c=d*a/f,p=d}else{if(a<0)s=-s;c=s,p=s*f/a}return{x:o+c,y:i+p}}function D(r){var t=E(P(Br(r)+1),function(){return[]});return b(r.nodes(),function(o){var i=r.node(o),a=i.rank;if(!Le(a))t[a][i.order]=o}),t}function nn(r){var t=B(E(r.nodes(),function(o){return r.node(o).rank}));b(r.nodes(),function(o){var i=r.node(o);if(Er(i,"rank"))i.rank-=t})}function on(r){var t=B(E(r.nodes(),function(f){return r.node(f).rank})),o=[];b(r.nodes(),function(f){var s=r.node(f).rank-t;if(!o[s])o[s]=[];o[s].push(f)});var i=0,a=r.graph().nodeRankFactor;b(o,function(f,s){if(Le(f)&&s%a!==0)--i;else if(i)b(f,function(d){r.node(d).rank+=i})})}function Mr(r,t,o,i){var a={width:0,height:0};if(arguments.length>=4)a.rank=o,a.order=i;return T(r,"border",a,t)}function Br(r){return I(E(r.nodes(),function(t){var o=r.node(t).rank;if(!Le(o))return o}))}function an(r,t){var o={lhs:[],rhs:[]};return b(r,function(i){if(t(i))o.lhs.push(i);else o.rhs.push(i)}),o}function sn(r,t){var o=Sr();try{return t()}finally{console.log(r+" time: "+(Sr()-o)+"ms")}}function un(r,t){return t()}function cn(r){function t(o){var i=r.children(o),a=r.node(o);if(i.length)b(i,t);if(Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var f=a.minRank,s=a.maxRank+1;f<s;++f)dn(r,"borderLeft","_bl",o,a,f),dn(r,"borderRight","_br",o,a,f)}}b(r.children(),t)}function dn(r,t,o,i,a,f){var s={width:0,height:0,rank:f,borderType:t},d=a[t][f-1],c=T(r,"border",s,o);if(a[t][f]=c,r.setParent(c,i),d)r.setEdge(d,c,{weight:1})}function ln(r){var t=r.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl")hn(r)}function mn(r){var t=r.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl")rs(r);if(t==="lr"||t==="rl")es(r),hn(r)}function hn(r){b(r.nodes(),function(t){pn(r.node(t))}),b(r.edges(),function(t){pn(r.edge(t))})}function pn(r){var t=r.width;r.width=r.height,r.height=t}function rs(r){b(r.nodes(),function(t){Dr(r.node(t))}),b(r.edges(),function(t){var o=r.edge(t);if(b(o.points,Dr),Object.prototype.hasOwnProperty.call(o,"y"))Dr(o)})}function Dr(r){r.y=-r.y}function es(r){b(r.nodes(),function(t){Xr(r.node(t))}),b(r.edges(),function(t){var o=r.edge(t);if(b(o.points,Xr),Object.prototype.hasOwnProperty.call(o,"x"))Xr(o)})}function Xr(r){var t=r.x;r.x=r.y,r.y=t}function gn(r){r.graph().dummyChains=[],b(r.edges(),function(t){ns(r,t)})}function ns(r,t){var o=t.v,i=r.node(o).rank,a=t.w,f=r.node(a).rank,s=t.name,d=r.edge(t),c=d.labelRank;if(f===i+1)return;r.removeEdge(t);var p=void 0,l,m;for(m=0,++i;i<f;++m,++i){if(d.points=[],p={width:0,height:0,edgeLabel:d,edgeObj:t,rank:i},l=T(r,"edge",p,"_d"),i===c)p.width=d.width,p.height=d.height,p.dummy="edge-label",p.labelpos=d.labelpos;if(r.setEdge(o,l,{weight:d.weight},s),m===0)r.graph().dummyChains.push(l);o=l}r.setEdge(o,a,{weight:d.weight},s)}function vn(r){b(r.graph().dummyChains,function(t){var o=r.node(t),i=o.edgeLabel,a;r.setEdge(o.edgeObj,i);while(o.dummy){if(a=r.successors(t)[0],r.removeNode(t),i.points.push({x:o.x,y:o.y}),o.dummy==="edge-label")i.x=o.x,i.y=o.y,i.width=o.width,i.height=o.height;t=a,o=r.node(t)}})}function fr(r){var t={};function o(i){var a=r.node(i);if(Object.prototype.hasOwnProperty.call(t,i))return a.rank;t[i]=!0;var f=B(E(r.outEdges(i),function(s){return o(s.w)-r.edge(s).minlen}));if(f===Number.POSITIVE_INFINITY||f===void 0||f===null)f=0;return a.rank=f}b(r.sources(),o)}function U(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen}function Lr(r){var t=new le({directed:!1}),o=r.nodes()[0],i=r.nodeCount();t.setNode(o,{});var a,f;while(os(t,r)<i)a=is(t,r),f=t.hasNode(a.v)?U(r,a):-U(r,a),as(t,r,f);return t}function os(r,t){function o(i){b(t.nodeEdges(i),function(a){var f=a.v,s=i===f?a.w:f;if(!r.hasNode(s)&&!U(t,a))r.setNode(s,{}),r.setEdge(i,s,{}),o(s)})}return b(r.nodes(),o),r.nodeCount()}function is(r,t){return H(t.edges(),function(o){if(r.hasNode(o.v)!==r.hasNode(o.w))return U(t,o)})}function as(r,t,o){b(r.nodes(),function(i){t.node(i).rank+=o})}var uh=pt(1);var gh=pt(1);Vr.CycleException=ur;function Vr(r){var t={},o={},i=[];function a(f){if(Object.prototype.hasOwnProperty.call(o,f))throw new ur;if(!Object.prototype.hasOwnProperty.call(t,f))o[f]=!0,t[f]=!0,b(r.predecessors(f),a),delete o[f],i.push(f)}if(b(r.sinks(),a),Kt(t)!==r.nodeCount())throw new ur;return i}function ur(){}ur.prototype=Error();function Ir(r,t,o){if(!te(t))t=[t];var i=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],f={};return b(t,function(s){if(!r.hasNode(s))throw Error("Graph does not have node: "+s);yn(r,s,o==="post",f,i,a)}),a}function yn(r,t,o,i,a,f){if(!Object.prototype.hasOwnProperty.call(i,t)){if(i[t]=!0,!o)f.push(t);if(b(a(t),function(s){yn(r,s,o,i,a,f)}),o)f.push(t)}}function Yr(r,t){return Ir(r,t,"post")}function Wr(r,t){return Ir(r,t,"pre")}G.initLowLimValues=Jr;G.initCutValues=Kr;G.calcCutValue=_n;G.leaveEdge=On;G.enterEdge=Ln;G.exchangeEdges=In;function G(r){r=tn(r),fr(r);var t=Lr(r);Jr(t),Kr(t,r);var o,i;while(o=On(t))i=Ln(t,r,o),In(t,r,o,i)}function Kr(r,t){var o=Yr(r,r.nodes());o=o.slice(0,o.length-1),b(o,function(i){cs(r,t,i)})}function cs(r,t,o){var i=r.node(o),a=i.parent;r.edge(o,a).cutvalue=_n(r,t,o)}function _n(r,t,o){var i=r.node(o),a=i.parent,f=!0,s=t.edge(o,a),d=0;if(!s)f=!1,s=t.edge(a,o);return d=s.weight,b(t.nodeEdges(o),function(c){var p=c.v===o,l=p?c.w:c.v;if(l!==a){var m=p===f,h=t.edge(c).weight;if(d+=m?h:-h,ls(r,o,l)){var v=r.edge(o,l).cutvalue;d+=m?-v:v}}}),d}function Jr(r,t){if(arguments.length<2)t=r.nodes()[0];En(r,{},1,t)}function En(r,t,o,i,a){var f=o,s=r.node(i);if(t[i]=!0,b(r.neighbors(i),function(d){if(!Object.prototype.hasOwnProperty.call(t,d))o=En(r,t,o,d,i)}),s.low=f,s.lim=o++,a)s.parent=a;else delete s.parent;return o}function On(r){return tr(r.edges(),function(t){return r.edge(t).cutvalue<0})}function Ln(r,t,o){var{v:i,w:a}=o;if(!t.hasEdge(i,a))i=o.w,a=o.v;var f=r.node(i),s=r.node(a),d=f,c=!1;if(f.lim>s.lim)d=s,c=!0;var p=st(t.edges(),function(l){return c===wn(r,r.node(l.v),d)&&c!==wn(r,r.node(l.w),d)});return H(p,function(l){return U(t,l)})}function In(r,t,o,i){var{v:a,w:f}=o;r.removeEdge(a,f),r.setEdge(i.v,i.w,{}),Jr(r),Kr(r,t),ps(r,t)}function ps(r,t){var o=tr(r.nodes(),function(a){return!t.node(a).parent}),i=Wr(r,o);i=i.slice(1),b(i,function(a){var f=r.node(a).parent,s=t.edge(a,f),d=!1;if(!s)s=t.edge(f,a),d=!0;t.node(a).rank=t.node(f).rank+(d?s.minlen:-s.minlen)})}function ls(r,t,o){return r.hasEdge(t,o)}function wn(r,t,o){return o.low<=t.lim&&t.lim<=o.lim}function Zr(r){switch(r.graph().ranker){case"network-simplex":Sn(r);break;case"tight-tree":hs(r);break;case"longest-path":ms(r);break;default:Sn(r)}}var ms=fr;function hs(r){fr(r),Lr(r)}function Sn(r){G(r)}function Nn(r){var t=T(r,"root",{},"_root"),o=gs(r),i=I(yt(o))-1,a=2*i+1;r.graph().nestingRoot=t,b(r.edges(),function(s){r.edge(s).minlen*=a});var f=vs(r)+1;b(r.children(),function(s){Pn(r,t,a,f,i,o,s)}),r.graph().nodeRankFactor=a}function Pn(r,t,o,i,a,f,s){var d=r.children(s);if(!d.length){if(s!==t)r.setEdge(t,s,{weight:0,minlen:o});return}var c=Mr(r,"_bt"),p=Mr(r,"_bb"),l=r.node(s);if(r.setParent(c,s),l.borderTop=c,r.setParent(p,s),l.borderBottom=p,b(d,function(m){Pn(r,t,o,i,a,f,m);var h=r.node(m),v=h.borderTop?h.borderTop:m,w=h.borderBottom?h.borderBottom:m,y=h.borderTop?i:2*i,g=v!==w?1:a-f[s]+1;r.setEdge(c,v,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,p,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(s))r.setEdge(t,c,{weight:0,minlen:a+f[s]})}function gs(r){var t={};function o(i,a){var f=r.children(i);if(f&&f.length)b(f,function(s){o(s,a+1)});t[i]=a}return b(r.children(),function(i){o(i,1)}),t}function vs(r){return cr(r.edges(),function(t,o){return t+r.edge(o).weight},0)}function kn(r){var t=r.graph();r.removeNode(t.nestingRoot),delete t.nestingRoot,b(r.edges(),function(o){var i=r.edge(o);if(i.nestingEdge)r.removeEdge(o)})}function Tn(r,t,o){var i={},a;b(o,function(f){var s=r.parent(f),d,c;while(s){if(d=r.parent(s),d)c=i[d],i[d]=s;else c=a,a=s;if(c&&c!==s){t.setEdge(c,s);return}s=d}})}function Cn(r,t,o){var i=ys(r),a=new le({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(function(f){return r.node(f)});return b(r.nodes(),function(f){var s=r.node(f),d=r.parent(f);if(s.rank===t||s.minRank<=t&&t<=s.maxRank){if(a.setNode(f),a.setParent(f,d||i),b(r[o](f),function(c){var p=c.v===f?c.w:c.v,l=a.edge(p,f),m=!Le(l)?l.weight:0;a.setEdge(p,f,{weight:r.edge(c).weight+m})}),Object.prototype.hasOwnProperty.call(s,"minRank"))a.setNode(f,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]})}}),a}function ys(r){var t;while(r.hasNode(t=J("_root")));return t}function An(r,t){var o=0;for(var i=1;i<t.length;++i)o+=ws(r,t[i-1],t[i]);return o}function ws(r,t,o){var i=kr(o,E(o,function(p,l){return l})),a=S(E(t,function(p){return A(E(r.outEdges(p),function(l){return{pos:i[l.w],weight:r.edge(l).weight}}),"pos")})),f=1;while(f<o.length)f<<=1;var s=2*f-1;f-=1;var d=E(Array(s),function(){return 0}),c=0;return b(a.forEach(function(p){var l=p.pos+f;d[l]+=p.weight;var m=0;while(l>0){if(l%2)m+=d[l+1];l=l-1>>1,d[l]+=p.weight}c+=p.weight*m})),c}function Rn(r){var t={},o=st(r.nodes(),function(d){return!r.children(d).length}),i=I(E(o,function(d){return r.node(d).rank})),a=E(P(i+1),function(){return[]});function f(d){if(Er(t,d))return;t[d]=!0;var c=r.node(d);a[c.rank].push(d),b(r.successors(d),f)}var s=A(o,function(d){return r.node(d).rank});return b(s,f),a}function Mn(r,t){return E(t,function(o){var i=r.inEdges(o);if(!i.length)return{v:o};else{var a=cr(i,function(f,s){var d=r.edge(s),c=r.node(s.v);return{sum:f.sum+d.weight*c.order,weight:f.weight+d.weight}},{sum:0,weight:0});return{v:o,barycenter:a.sum/a.weight,weight:a.weight}}})}function Bn(r,t){var o={};b(r,function(a,f){var s=o[a.v]={indegree:0,in:[],out:[],vs:[a.v],i:f};if(!Le(a.barycenter))s.barycenter=a.barycenter,s.weight=a.weight}),b(t.edges(),function(a){var f=o[a.v],s=o[a.w];if(!Le(f)&&!Le(s))s.indegree++,f.out.push(o[a.w])});var i=st(o,function(a){return!a.indegree});return _s(i)}function _s(r){var t=[];function o(f){return function(s){if(s.merged)return;if(Le(s.barycenter)||Le(f.barycenter)||s.barycenter>=f.barycenter)Es(f,s)}}function i(f){return function(s){if(s.in.push(f),--s.indegree===0)r.push(s)}}while(r.length){var a=r.pop();t.push(a),b(a.in.reverse(),o(a)),b(a.out,i(a))}return E(st(t,function(f){return!f.merged}),function(f){return K(f,["vs","i","barycenter","weight"])})}function Es(r,t){var o=0,i=0;if(r.weight)o+=r.barycenter*r.weight,i+=r.weight;if(t.weight)o+=t.barycenter*t.weight,i+=t.weight;r.vs=t.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0}function Fn(r,t){var o=an(r,function(l){return Object.prototype.hasOwnProperty.call(l,"barycenter")}),i=o.lhs,a=A(o.rhs,function(l){return-l.i}),f=[],s=0,d=0,c=0;i.sort(xs(!!t)),c=Dn(f,a,c),b(i,function(l){c+=l.vs.length,f.push(l.vs),s+=l.barycenter*l.weight,d+=l.weight,c=Dn(f,a,c)});var p={vs:S(f)};if(d)p.barycenter=s/d,p.weight=d;return p}function Dn(r,t,o){var i;while(t.length&&(i=X(t)).i<=o)t.pop(),r.push(i.vs),o++;return o}function xs(r){return function(t,o){if(t.barycenter<o.barycenter)return-1;else if(t.barycenter>o.barycenter)return 1;return!r?t.i-o.i:o.i-t.i}}function Qr(r,t,o,i){var a=r.children(t),f=r.node(t),s=f?f.borderLeft:void 0,d=f?f.borderRight:void 0,c={};if(s)a=st(a,function(w){return w!==s&&w!==d});var p=Mn(r,a);b(p,function(w){if(r.children(w.v).length){var y=Qr(r,w.v,o,i);if(c[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Ls(w,y)}});var l=Bn(p,o);Os(l,c);var m=Fn(l,i);if(s){if(m.vs=S([s,m.vs,d]),r.predecessors(s).length){var h=r.node(r.predecessors(s)[0]),v=r.node(r.predecessors(d)[0]);if(!Object.prototype.hasOwnProperty.call(m,"barycenter"))m.barycenter=0,m.weight=0;m.barycenter=(m.barycenter*m.weight+h.order+v.order)/(m.weight+2),m.weight+=2}}return m}function Os(r,t){b(r,function(o){o.vs=S(o.vs.map(function(i){if(t[i])return t[i].vs;return i}))})}function Ls(r,t){if(!Le(r.barycenter))r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight;else r.barycenter=t.barycenter,r.weight=t.weight}function Jn(r){var t=Br(r),o=Xn(r,P(1,t+1),"inEdges"),i=Xn(r,P(t-1,-1,-1),"outEdges"),a=Rn(r);zn(r,a);var f=Number.POSITIVE_INFINITY,s;for(var d=0,c=0;c<4;++d,++c){Is(d%2?o:i,d%4>=2),a=D(r);var p=An(r,a);if(p<f)c=0,s=tt(a),f=p}zn(r,s)}function Xn(r,t,o){return E(t,function(i){return Cn(r,i,o)})}function Is(r,t){var o=new le;b(r,function(i){var a=i.graph().root,f=Qr(i,a,o,t);b(f.vs,function(s,d){i.node(s).order=d}),Tn(i,o,f.vs)})}function zn(r,t){b(t,function(o){b(o,function(i,a){r.node(i).order=a})})}function Zn(r){var t=Ns(r);b(r.graph().dummyChains,function(o){var i=r.node(o),a=i.edgeObj,f=Ss(r,t,a.v,a.w),{path:s,lca:d}=f,c=0,p=s[c],l=!0;while(o!==a.w){if(i=r.node(o),l){while((p=s[c])!==d&&r.node(p).maxRank<i.rank)c++;if(p===d)l=!1}if(!l){while(c<s.length-1&&r.node(p=s[c+1]).minRank<=i.rank)c++;p=s[c]}r.setParent(o,p),o=r.successors(o)[0]}})}function Ss(r,t,o,i){var a=[],f=[],s=Math.min(t[o].low,t[i].low),d=Math.max(t[o].lim,t[i].lim),c,p;c=o;do c=r.parent(c),a.push(c);while(c&&(t[c].low>s||d>t[c].lim));p=c,c=i;while((c=r.parent(c))!==p)f.push(c);return{path:a.concat(f.reverse()),lca:p}}function Ns(r){var t={},o=0;function i(a){var f=o;b(r.children(a),i),t[a]={low:f,lim:o++}}return b(r.children(),i),t}function Ps(r,t){var o={};function i(a,f){var s=0,d=0,c=a.length,p=X(f);return b(f,function(l,m){var h=Ts(r,l),v=h?r.node(h).order:c;if(h||l===p)b(f.slice(d,m+1),function(w){b(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<s||v<_)&&!(g.dummy&&r.node(w).dummy))$n(o,y,w)})}),d=m+1,s=v}),f}return cr(t,i),o}function ks(r,t){var o={};function i(f,s,d,c,p){var l;b(P(s,d),function(m){if(l=f[m],r.node(l).dummy)b(r.predecessors(l),function(h){var v=r.node(h);if(v.dummy&&(v.order<c||v.order>p))$n(o,h,l)})})}function a(f,s){var d=-1,c,p=0;return b(s,function(l,m){if(r.node(l).dummy==="border"){var h=r.predecessors(l);if(h.length)c=r.node(h[0]).order,i(s,p,m,d,c),p=m,d=c}i(s,p,s.length,c,f.length)}),s}return cr(t,a),o}function Ts(r,t){if(r.node(t).dummy)return tr(r.predecessors(t),function(o){return r.node(o).dummy})}function $n(r,t,o){if(t>o){var i=t;t=o,o=i}if(!Object.prototype.hasOwnProperty.call(r,t))Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=r[t];Object.defineProperty(a,o,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Cs(r,t,o){if(t>o){var i=t;t=o,o=i}return!!r[t]&&Object.prototype.hasOwnProperty.call(r[t],o)}function As(r,t,o,i){var a={},f={},s={};return b(t,function(d){b(d,function(c,p){a[c]=c,f[c]=c,s[c]=p})}),b(t,function(d){var c=-1;b(d,function(p){var l=i(p);if(l.length){l=A(l,function(y){return s[y]});var m=(l.length-1)/2;for(var h=Math.floor(m),v=Math.ceil(m);h<=v;++h){var w=l[h];if(f[p]===p&&c<s[w]&&!Cs(o,p,w))f[w]=p,f[p]=a[p]=a[w],c=s[w]}}})}),{root:a,align:f}}function Rs(r,t,o,i,a){var f={},s=Ms(r,t,o,a),d=a?"borderLeft":"borderRight";function c(m,h){var v=s.nodes(),w=v.pop(),y={};while(w){if(y[w])m(w);else y[w]=!0,v.push(w),v=v.concat(h(w));w=v.pop()}}function p(m){f[m]=s.inEdges(m).reduce(function(h,v){return Math.max(h,f[v.v]+s.edge(v))},0)}function l(m){var h=s.outEdges(m).reduce(function(w,y){return Math.min(w,f[y.w]-s.edge(y))},Number.POSITIVE_INFINITY),v=r.node(m);if(h!==Number.POSITIVE_INFINITY&&v.borderType!==d)f[m]=Math.max(f[m],h)}return c(p,s.predecessors.bind(s)),c(l,s.successors.bind(s)),b(i,function(m){f[m]=f[o[m]]}),f}function Ms(r,t,o,i){var a=new le,f=r.graph(),s=Fs(f.nodesep,f.edgesep,i);return b(t,function(d){var c;b(d,function(p){var l=o[p];if(a.setNode(l),c){var m=o[c],h=a.edge(m,l);a.setEdge(m,l,Math.max(s(r,p,c),h||0))}c=p})}),a}function js(r,t){return H(yt(t),function(o){var{NEGATIVE_INFINITY:i,POSITIVE_INFINITY:a}=Number;return gt(o,function(f,s){var d=Gs(r,s)/2;i=Math.max(f+d,i),a=Math.min(f-d,a)}),i-a})}function Bs(r,t){var o=yt(t),i=B(o),a=I(o);b(["u","d"],function(f){b(["l","r"],function(s){var d=f+s,c=r[d],p;if(c===t)return;var l=yt(c);if(p=s==="l"?i-B(l):a-I(l),p)r[d]=W(c,function(m){return m+p})})})}function Ds(r,t){return W(r.ul,function(o,i){if(t)return r[t.toLowerCase()][i];else{var a=A(E(r,i));return(a[1]+a[2])/2}})}function Qn(r){var t=D(r),o=nr(Ps(r,t),ks(r,t)),i={},a;b(["u","d"],function(s){a=s==="u"?t:yt(t).reverse(),b(["l","r"],function(d){if(d==="r")a=E(a,function(m){return yt(m).reverse()});var c=(s==="u"?r.predecessors:r.successors).bind(r),p=As(r,a,o,c),l=Rs(r,a,p.root,p.align,d==="r");if(d==="r")l=W(l,function(m){return-m});i[s+d]=l})});var f=js(r,i);return Bs(i,f),Ds(i,r.graph().align)}function Fs(r,t,o){return function(i,a,f){var s=i.node(a),d=i.node(f),c=0,p;if(c+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":p=-s.width/2;break;case"r":p=s.width/2;break}if(p)c+=o?p:-p;if(p=0,c+=(s.dummy?t:r)/2,c+=(d.dummy?t:r)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":p=d.width/2;break;case"r":p=-d.width/2;break}if(p)c+=o?p:-p;return p=0,c}}function Gs(r,t){return r.node(t).width}function ro(r){r=Or(r),Xs(r),wt(Qn(r),function(t,o){r.node(o).x=t})}function Xs(r){var t=D(r),o=r.graph().ranksep,i=0;b(t,function(a){var f=I(E(a,function(s){return r.node(s).height}));b(a,function(s){r.node(s).y=i+f/2}),i+=f+o})}function ne(r,t){var o=t&&t.debugTiming?sn:un;o("layout",()=>{var i=o(" buildLayoutGraph",()=>$s(r));o(" runLayout",()=>Us(i,o)),o(" updateInputGraph",()=>Vs(r,i))})}function Us(r,t){t(" makeSpaceForEdgeLabels",()=>Qs(r)),t(" removeSelfEdges",()=>su(r)),t(" acyclic",()=>Qt(r)),t(" nestingGraph.run",()=>Nn(r)),t(" rank",()=>Zr(Or(r))),t(" injectEdgeLabelProxies",()=>ru(r)),t(" removeEmptyRanks",()=>on(r)),t(" nestingGraph.cleanup",()=>kn(r)),t(" normalizeRanks",()=>nn(r)),t(" assignRankMinMax",()=>eu(r)),t(" removeEdgeLabelProxies",()=>tu(r)),t(" normalize.run",()=>gn(r)),t(" parentDummyChains",()=>Zn(r)),t(" addBorderSegments",()=>cn(r)),t(" order",()=>Jn(r)),t(" insertSelfEdges",()=>uu(r)),t(" adjustCoordinateSystem",()=>ln(r)),t(" position",()=>ro(r)),t(" positionSelfEdges",()=>du(r)),t(" removeBorderNodes",()=>fu(r)),t(" normalize.undo",()=>vn(r)),t(" fixupEdgeLabelCoords",()=>iu(r)),t(" undoCoordinateSystem",()=>mn(r)),t(" translateGraph",()=>nu(r)),t(" assignNodeIntersects",()=>ou(r)),t(" reversePoints",()=>au(r)),t(" acyclic.undo",()=>rn(r))}function Vs(r,t){b(r.nodes(),function(o){var i=r.node(o),a=t.node(o);if(i){if(i.x=a.x,i.y=a.y,t.children(o).length)i.width=a.width,i.height=a.height}}),b(r.edges(),function(o){var i=r.edge(o),a=t.edge(o);if(i.points=a.points,Object.prototype.hasOwnProperty.call(a,"x"))i.x=a.x,i.y=a.y}),r.graph().width=t.graph().width,r.graph().height=t.graph().height}var Ys=["nodesep","edgesep","ranksep","marginx","marginy"],zs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ws=["acyclicer","ranker","rankdir","align"],qs=["width","height"],Hs={width:0,height:0},Ks=["minlen","weight","width","height","labeloffset"],Js={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Zs=["labelpos"];function $s(r){var t=new le({multigraph:!0,compound:!0}),o=ee(r.graph());return t.setGraph(nr({},zs,re(o,Ys),K(o,Ws))),b(r.nodes(),function(i){var a=ee(r.node(i));t.setNode(i,at(re(a,qs),Hs)),t.setParent(i,r.parent(i))}),b(r.edges(),function(i){var a=ee(r.edge(i));t.setEdge(i,nr({},Js,re(a,Ks),K(a,Zs)))}),t}function Qs(r){var t=r.graph();t.ranksep/=2,b(r.edges(),function(o){var i=r.edge(o);if(i.minlen*=2,i.labelpos.toLowerCase()!=="c")if(t.rankdir==="TB"||t.rankdir==="BT")i.width+=i.labeloffset;else i.height+=i.labeloffset})}function ru(r){b(r.edges(),function(t){var o=r.edge(t);if(o.width&&o.height){var i=r.node(t.v),a=r.node(t.w),f={rank:(a.rank-i.rank)/2+i.rank,e:t};T(r,"edge-proxy",f,"_ep")}})}function eu(r){var t=0;b(r.nodes(),function(o){var i=r.node(o);if(i.borderTop)i.minRank=r.node(i.borderTop).rank,i.maxRank=r.node(i.borderBottom).rank,t=I(t,i.maxRank)}),r.graph().maxRank=t}function tu(r){b(r.nodes(),function(t){var o=r.node(t);if(o.dummy==="edge-proxy")r.edge(o.e).labelRank=o.rank,r.removeNode(t)})}function nu(r){var t=Number.POSITIVE_INFINITY,o=0,i=Number.POSITIVE_INFINITY,a=0,f=r.graph(),s=f.marginx||0,d=f.marginy||0;function c(p){var{x:l,y:m,width:h,height:v}=p;t=Math.min(t,l-h/2),o=Math.max(o,l+h/2),i=Math.min(i,m-v/2),a=Math.max(a,m+v/2)}b(r.nodes(),function(p){c(r.node(p))}),b(r.edges(),function(p){var l=r.edge(p);if(Object.prototype.hasOwnProperty.call(l,"x"))c(l)}),t-=s,i-=d,b(r.nodes(),function(p){var l=r.node(p);l.x-=t,l.y-=i}),b(r.edges(),function(p){var l=r.edge(p);if(b(l.points,function(m){m.x-=t,m.y-=i}),Object.prototype.hasOwnProperty.call(l,"x"))l.x-=t;if(Object.prototype.hasOwnProperty.call(l,"y"))l.y-=i}),f.width=o-t+s,f.height=a-i+d}function ou(r){b(r.edges(),function(t){var o=r.edge(t),i=r.node(t.v),a=r.node(t.w),f,s;if(!o.points)o.points=[],f=a,s=i;else f=o.points[0],s=o.points[o.points.length-1];o.points.unshift(Rr(i,f)),o.points.push(Rr(a,s))})}function iu(r){b(r.edges(),function(t){var o=r.edge(t);if(Object.prototype.hasOwnProperty.call(o,"x")){if(o.labelpos==="l"||o.labelpos==="r")o.width-=o.labeloffset;switch(o.labelpos){case"l":o.x-=o.width/2+o.labeloffset;break;case"r":o.x+=o.width/2+o.labeloffset;break}}})}function au(r){b(r.edges(),function(t){var o=r.edge(t);if(o.reversed)o.points.reverse()})}function fu(r){b(r.nodes(),function(t){if(r.children(t).length){var o=r.node(t),i=r.node(o.borderTop),a=r.node(o.borderBottom),f=r.node(X(o.borderLeft)),s=r.node(X(o.borderRight));o.width=Math.abs(s.x-f.x),o.height=Math.abs(a.y-i.y),o.x=f.x+o.width/2,o.y=i.y+o.height/2}}),b(r.nodes(),function(t){if(r.node(t).dummy==="border")r.removeNode(t)})}function su(r){b(r.edges(),function(t){if(t.v===t.w){var o=r.node(t.v);if(!o.selfEdges)o.selfEdges=[];o.selfEdges.push({e:t,label:r.edge(t)}),r.removeEdge(t)}})}function uu(r){var t=D(r);b(t,function(o){var i=0;b(o,function(a,f){var s=r.node(a);s.order=f+i,b(s.selfEdges,function(d){T(r,"selfedge",{width:d.label.width,height:d.label.height,rank:s.rank,order:f+ ++i,e:d.e,label:d.label},"_se")}),delete s.selfEdges})})}function du(r){b(r.nodes(),function(t){var o=r.node(t);if(o.dummy==="selfedge"){var i=r.node(o.e.v),a=i.x+i.width/2,f=i.y,s=o.x-a,d=i.height/2;r.setEdge(o.e,o.label),r.removeNode(t),o.label.points=[{x:a+2*s/3,y:f-d},{x:a+5*s/6,y:f-d},{x:a+s,y:f},{x:a+5*s/6,y:f+d},{x:a+2*s/3,y:f+d}],o.label.x=o.x,o.label.y=o.y}})}function re(r,t){return W(K(r,t),Number)}function ee(r){var t={};return b(r,function(o,i){t[i.toLowerCase()]=o}),t}var eo=e((r,t,o)=>Math.max(t,Math.min(o,r)),"clamp"),to=e((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),cu=e((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),pu=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],lu=e((r,t,o,i,a)=>{let f=[],s=new Set;if(o.forEach(({start:l,end:m})=>{if(l!==i)s.add(l);if(m!==i)s.add(m)}),s.forEach((l)=>{let m=r.node(l);if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)}),f.length===0)o.forEach(({edge:l})=>{(l.points??[]).forEach((m)=>{if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)})});if(f.length===0)return to(a);let d=f.reduce((l,m)=>({x:l.x+m.x/f.length,y:l.y+m.y/f.length}),{x:0,y:0}),c=d.x-t.x,p=d.y-t.y;if(Math.abs(c)>Math.abs(p))return c>0?"right":"left";if(Math.abs(p)>0)return p>0?"bottom":"top";return to(a)},"getSelfLoopSide"),mu=e((r,t="top",o=0,i=0)=>{let a=r.x,f=r.y-o,s=r.width/2,d=r.height/2,c=Math.max(36,Math.min(100,r.width*0.8)),p=eo(Math.max(i,r.width*0.35),36,c),l=eo(Math.min(r.width,r.height)*0.45,24,48);switch(t){case"bottom":{let m=f+d;return[{x:a-p/2,y:m},{x:a-p/2,y:m+l},{x:a+p/2,y:m+l},{x:a+p/2,y:m}]}case"right":{let m=a+s;return[{x:m,y:f-p/2},{x:m+l,y:f-p/2},{x:m+l,y:f+p/2},{x:m,y:f+p/2}]}case"left":{let m=a-s;return[{x:m,y:f-p/2},{x:m-l,y:f-p/2},{x:m-l,y:f+p/2},{x:m,y:f+p/2}]}case"top":default:{let m=f-d;return[{x:a-p/2,y:m},{x:a-p/2,y:m-l},{x:a+p/2,y:m-l},{x:a+p/2,y:m}]}}},"getSelfLoopPoints"),hu=e((r,t,o="top",i=0,a={})=>{let s=r.x,d=r.y-i,c=a.width??0,p=a.height??0;switch(o){case"bottom":return{x:s,y:Math.max(...t.map((l)=>l.y))+p/2+4};case"right":return{x:Math.max(...t.map((l)=>l.x))+c/2+4,y:d};case"left":return{x:Math.min(...t.map((l)=>l.x))-c/2-4,y:d};case"top":default:return{x:s,y:Math.min(...t.map((l)=>l.y))-p/2-4}}},"getSelfLoopLabelPosition"),oo=e((r,t=0,{mergeSelfLoops:o=!0}={})=>{let i=new Map,a=[],f=r.graph()?.rankdir;return r.edges().forEach((s)=>{let d=r.edge(s);if(o&&d.selfLoop){let c=d.selfLoop.id;if(!i.has(c))i.set(c,[]);i.get(c).push({edge:d,start:s.v,end:s.w})}else a.push({edge:d,start:s.v,end:s.w})}),i.forEach((s)=>{if(s.length!==3){s.forEach((_)=>a.push(_));return}s.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[d,c,p]=s,l=d.edge.originalEdge??c.edge.originalEdge??p.edge.originalEdge??c.edge,m=r.node(l.start);if(!m){s.forEach((_)=>a.push(_));return}let h={width:c.edge.width,height:c.edge.height},v=lu(r,m,s,l.start,f),w=mu(m,v,t,h.width??0),y=hu(m,w,v,t,h),g={...c.edge,...l,id:l.id,points:w,start:l.start,end:l.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:c.edge.labelStyle,fromCluster:d.edge.fromCluster??c.edge.fromCluster??p.edge.fromCluster,toCluster:d.edge.toCluster??c.edge.toCluster??p.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),io=e(async({element:r,graph:t,diagramType:o,id:i,parentCluster:a,siteConfig:f})=>{let s=t.graph().rankdir;n.trace("Dir in recursive render - dir:",s);let{clusters:d,edgePaths:c,edgeLabels:p,nodes:l,rootGroups:m}=Mi(r,{edgePathsClass:"edgePaths"});if(!t.nodes())n.info("No nodes found for",t);else n.info("Recursive render XXX",t.nodes());if(t.edges().length>0)n.info("Recursive edges",t.edge(t.edges()[0]));let h=cu(o);await Promise.all(t.nodes().map(async function(y){let g=t.node(y);if(a!==void 0){let _=JSON.parse(JSON.stringify(a.clusterData));if(n.trace(`Setting data for parent cluster XXX
|
|
2
2
|
Node.id = `,y,`
|
|
3
3
|
data=`,_.height,`
|
|
4
|
-
Parent cluster`,a.height),t.setNode(a.id,_),!t.parent(y))n.trace("Setting parent",y,a.id),t.setParent(y,a.id,_)}if(n.info("(Insert) Node XXX"+y+": "+JSON.stringify(t.node(y))),g?.clusterNode){n.info("Cluster identified XBX",y,g.width,t.node(y));let{ranksep:_,nodesep:R}=t.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:R});let oe=await wu({element:l,graph:g.graph,diagramType:o,id:i,parentCluster:t.node(y),siteConfig:f}),ie=oe.elem;N(g,ie),g.diff=oe.diff||0,n.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),
|
|
4
|
+
Parent cluster`,a.height),t.setNode(a.id,_),!t.parent(y))n.trace("Setting parent",y,a.id),t.setParent(y,a.id,_)}if(n.info("(Insert) Node XXX"+y+": "+JSON.stringify(t.node(y))),g?.clusterNode){n.info("Cluster identified XBX",y,g.width,t.node(y));let{ranksep:_,nodesep:R}=t.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:R});let oe=await wu({element:l,graph:g.graph,diagramType:o,id:i,parentCluster:t.node(y),siteConfig:f}),ie=oe.elem;N(g,ie),g.diff=oe.diff||0,n.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),kl(ie,g)}else if(t.children(y).length>0)n.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",t),n.trace(fn(g.id,t)),Q.set(g.id,{id:fn(g.id,t),node:g});else n.trace("Node - the non recursive path XAX",y,l,t.node(y),s),await Ni(l,t.node(y),{config:f,dir:s})})),await e(async()=>{let y=t.edges().map(async function(g){let _=t.edge(g.v,g.w,g.name);if(n.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),n.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(t.edge(g))),n.info("Fix",Q,"ids:",g.v,g.w,"Translating: ",Q.get(g.v),Q.get(g.w)),h&&_.selfLoop){if(_.selfLoop.order!==1)return;let R={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await Ft(p,R),_.width=R.width,_.height=R.height,_.labelStyle=R.labelStyle;return}await Ft(p,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=Pt(f);return{elem:m,graph:t,groups:{clusters:d,edgePaths:c,edgeLabels:p,nodes:l,rootGroups:m},diagramType:o,id:i,mergeSelfLoops:h,subGraphTitleTotalMargin:w}},"measureDagreGraph"),ao=e((r)=>{n.info("############################################# XXX"),n.info("### Layout ### XXX"),n.info("############################################# XXX"),ne(r)},"runDagreGraphLayout"),gu=e((r,t,o)=>{let i=r.node(t);if(!i)return;let a={...i};if(i?.clusterNode)a.y=(i.y??0)+o;else if(r.children(t).length>0)a.height=(i.height??0)+o;else a.y=(i.y??0)+o/2;return a},"normalizeDagreNode"),no=e((r,t)=>{pu.forEach((o)=>{if(t[o]!==void 0)r[o]=t[o]})},"applyDagreNodeLayout"),vu=e((r,t,o,i)=>({...r,start:r.start??t,end:r.end??o,points:(r.points??[]).map((a)=>({...a,y:typeof a.y==="number"?a.y+i:a.y}))}),"normalizeDagreEdge"),bu=e((r,t)=>{let{graph:o,mergeSelfLoops:i,subGraphTitleTotalMargin:a=0}=t,f=new Map(r.nodes.map((d)=>[d.id,d]));Oi(o).forEach((d)=>{let c=gu(o,d,a);if(!c)return;no(o.node(d),c);let p=f.get(d);if(p)no(p,c)});let s=a/2;return r.edges=oo(o,s,{mergeSelfLoops:i}).map(({edge:d,start:c,end:p})=>vu(d,c,p,s)),r},"applyDagreLayoutResult"),yu=e(async({elem:r,graph:t,groups:{clusters:o,edgePaths:i},diagramType:a,id:f,mergeSelfLoops:s,subGraphTitleTotalMargin:d})=>{let c=0;await Promise.all(Oi(t).map(async function(m){let h=t.node(m);if(n.info("Position XBX => "+m+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=d,n.info("A tainted cluster node XBX1",m,h.id,h.width,h.height,h.x,h.y,t.parent(m)),Q.get(h.id).node=h,Ct(h);else if(t.children(m).length>0){n.info("A pure cluster node XBX1",m,h.id,h.x,h.y,h.width,h.height,t.parent(m)),h.height+=d,t.node(h.parentId);let v=h?.padding/2||0,w=h?.labelBBox?.height||0,y=w-v||0;n.debug("OffsetY",y,"labelHeight",w,"halfPadding",v),await mr(o,h),Q.get(h.id).node=h}else{let v=t.node(h.parentId);h.y+=d/2,n.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",v,v?.offsetY,h),Ct(h)}}));let p=d/2;return oo(t,p,{mergeSelfLoops:s}).forEach(function({edge:m,start:h,end:v}){n.info("Edge "+h+" -> "+v+": "+JSON.stringify(m),m),m.points.forEach((_)=>_.y+=p);let w=t.node(h),y=t.node(v),g=gr(i,m,Q,a,w,y,f);xn(m,g)}),t.nodes().forEach(function(m){let h=t.node(m);if(n.info(m,h.type,h.diff),h.isGroup)c=h.diff}),n.warn("Returning from recursive render XAX",r,c),{elem:r,diff:c}},"paintDagreLayoutCore"),wu=e(async(r)=>{let t=await io(r);return ao(t.graph),await yu(t)},"renderDagreSubgraph"),fo=e((r)=>{let t=new le({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((o)=>{if(t.setNode(o.id,{...o}),o.parentId)t.setParent(o.id,o.parentId)}),n.debug("Edges:",r.edges),r.edges.forEach((o)=>{if(o.start===o.end){let i=o.start,a=i+"---"+i+"---1",f=i+"---"+i+"---2",s=t.node(i);t.setNode(a,{domId:a,id:a,parentId:s.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(a,s.parentId),t.setNode(f,{domId:f,id:f,parentId:s.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(f,s.parentId);let d=structuredClone(o),c=structuredClone(o),p=structuredClone(o),l=structuredClone(o);if(c.originalEdge=d,c.selfLoop={id:d.id,order:0},p.originalEdge=d,p.selfLoop={id:d.id,order:1},l.originalEdge=d,l.selfLoop={id:d.id,order:2},c.label="",c.arrowTypeEnd="none",c.endLabelLeft="",c.endLabelRight="",c.startLabelLeft="",c.id=i+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=i+"-cyclic-special-mid",l.label="",l.startLabelRight="",l.startLabelLeft="",l.arrowTypeStart="none",s.isGroup)c.fromCluster=i,l.toCluster=i;l.id=i+"-cyclic-special-2",l.arrowTypeStart="none",t.setEdge(i,a,c,i+"-cyclic-special-0"),t.setEdge(a,f,p,i+"-cyclic-special-1"),t.setEdge(f,i,l,i+"-cyclic-special-2")}else t.setEdge(o.start,o.end,{...o},o.id)}),ul(t),{graph:t}},"prepareLayoutForDagre"),_u=e(async(r,{element:t,preparedLayout:o})=>{let i=o??fo(r),a=u(),f=await io({element:t,graph:i.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=f,f},"measureDagreLayout"),Eu=e((r,t)=>{let o=t.preparedLayout?.measuredLayout;if(!o)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return ao(o.graph),bu(r,o),o},"runDagreLayoutCore"),xu=e((r,{measure:t})=>Oi(t.graph).map((o)=>t.graph.node(o)).filter(Boolean),"getDagrePaintNodes"),Ou=e((r,t,{measure:o})=>r?o.graph.node(r):void 0,"getDagreEdgeNode"),Kg=it({prepareLayout:fo,measureLayout:_u,runLayoutCore:Eu,paintOptions:{clusterDb:Q,getNodes:xu,getEdgeNode:Ou,skipNode:e((r,{measure:t})=>!t.graph.hasNode(r.id),"skipNode"),isCluster:e((r,{measure:t})=>t.graph.hasNode(r.id)&&(t.graph.children(r.id)??[]).length>0,"isCluster")}});export{bu as applyDagreLayoutResult,oo as getEdgesToRender,_u as measureDagreLayout,fo as prepareLayoutForDagre,Kg as render,Eu as runDagreLayoutCore,cu as shouldMergeSelfLoopSegments};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ee}from"./index.
|
|
1
|
+
import{ee}from"./index.0g1t1pjx.js";import{e,n,Ie,B,k,j,A,L,R,I,M,P,O,X,Y}from"./index.zkx4ryzt.js";import{oe}from"./index.6pzexww5.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},C=32,b={axes:[],curves:[],options:h},x=structuredClone(b),G=B.radar,W=e(()=>Y({...G,...k().radar}),"getConfig"),T=e(()=>x.axes,"getAxes"),V=e(()=>x.curves,"getCurves"),H=e(()=>x.options,"getOptions"),U=e((r)=>{x.axes=r.map((t)=>({name:t.name,label:t.label??t.name}))},"setAxes"),K=e((r)=>{x.curves=r.map((t)=>({name:t.name,label:t.label??t.name,entries:N(t.entries)}))},"setCurves"),N=e((r)=>{if(r[0].axis==null)return r.map((a)=>a.value);let t=T();if(t.length===0)throw Error("Axes must be populated before curves for reference entries");return t.map((a)=>{let s=r.find((o)=>o.axis?.$refText===a.name);if(s===void 0)throw Error("Missing entry for axis "+a.label);return s.value})},"computeCurveEntries"),Z=e((r)=>{let t=r.reduce((a,s)=>(a[s.name]=s,a),{});if(x.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule},x.options.ticks>C)n.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${C}). Using ${C} instead.`),x.options.ticks=C},"setOptions"),q=e(()=>{A(),x=structuredClone(b)},"clear"),y={getAxes:T,getCurves:V,getOptions:H,setAxes:U,setCurves:K,setOptions:Z,getConfig:W,clear:q,setAccTitle:L,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:O,getAccDescription:M,setAccDescription:I},J=e((r)=>{ee(r,y);let{axes:t,curves:a,options:s}=r;y.setAxes(t),y.setCurves(a),y.setOptions(s)},"populate"),Q={parse:e(async(r)=>{let t=await oe("radar",r);n.debug(t),J(t)},"parse")},tt=e((r,t,a,s)=>{let o=s.db,c=o.getAxes(),d=o.getCurves(),i=o.getOptions(),l=o.getConfig(),u=o.getDiagramTitle(),m=X(t),p=et(m,l),g=i.max??Math.max(...d.map((w)=>Math.max(...w.entries))),v=i.min,f=Math.min(l.width,l.height)/2;at(p,c,f,i.ticks,i.graticule),rt(p,c,f,l),S(p,c,d,v,g,i.graticule,l),F(p,d,i.showLegend,l),p.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),et=e((r,t)=>{let a=t.width+t.marginLeft+t.marginRight,s=t.height+t.marginTop+t.marginBottom,o={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return j(r,s,a,t.useMaxWidth??!0),r.attr("viewBox",`0 0 ${a} ${s}`).attr("overflow","visible"),r.append("g").attr("transform",`translate(${o.x}, ${o.y})`)},"drawFrame"),at=e((r,t,a,s,o)=>{if(o==="circle")for(let c=0;c<s;c++){let d=a*(c+1)/s;r.append("circle").attr("r",d).attr("class","radarGraticule")}else if(o==="polygon"){let c=t.length;for(let d=0;d<s;d++){let i=a*(d+1)/s,l=t.map((u,m)=>{let p=2*m*Math.PI/c-Math.PI/2,g=i*Math.cos(p),v=i*Math.sin(p);return`${g},${v}`}).join(" ");r.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),rt=e((r,t,a,s)=>{let o=t.length;for(let c=0;c<o;c++){let d=t[c].label,i=2*c*Math.PI/o-Math.PI/2,l=Math.cos(i),u=Math.sin(i);r.append("line").attr("x1",0).attr("y1",0).attr("x2",a*s.axisScaleFactor*l).attr("y2",a*s.axisScaleFactor*u).attr("class","radarAxisLine");let m=l>0.01?"start":l<-0.01?"end":"middle",p=u>0.01?"hanging":u<-0.01?"auto":"central",g=4;r.append("text").text(d).attr("x",a*s.axisLabelFactor*l+g*l).attr("y",a*s.axisLabelFactor*u+g*u).attr("text-anchor",m).attr("dominant-baseline",p).attr("class","radarAxisLabel")}},"drawAxes");function S(r,t,a,s,o,c,d){let i=t.length,l=Math.min(d.width,d.height)/2;a.forEach((u,m)=>{if(u.entries.length!==i)return;let p=u.entries.map((g,v)=>{let f=2*Math.PI*v/i-Math.PI/2,w=_(g,s,o,l),D=w*Math.cos(f),z=w*Math.sin(f);return{x:D,y:z}});if(c==="circle")r.append("path").attr("d",E(p,d.curveTension)).attr("class",`radarCurve-${m}`);else if(c==="polygon")r.append("polygon").attr("points",p.map((g)=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}e(S,"drawCurves");function _(r,t,a,s){let o=Math.min(Math.max(r,t),a);return s*(o-t)/(a-t)}e(_,"relativeRadius");function E(r,t){let a=r.length,s=`M${r[0].x},${r[0].y}`;for(let o=0;o<a;o++){let c=r[(o-1+a)%a],d=r[o],i=r[(o+1)%a],l=r[(o+2)%a],u={x:d.x+(i.x-c.x)*t,y:d.y+(i.y-c.y)*t},m={x:i.x-(l.x-d.x)*t,y:i.y-(l.y-d.y)*t};s+=` C${u.x},${u.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${s} Z`}e(E,"closedRoundCurve");function F(r,t,a,s){if(!a)return;let o=(s.width/2+s.marginRight)*3/4,c=-(s.height/2+s.marginTop)*3/4,d=20;t.forEach((i,l)=>{let u=r.append("g").attr("transform",`translate(${o}, ${c+l*d})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}e(F,"drawLegend");var nt={draw:tt},st=e((r,t)=>{let a="";for(let s=0;s<r.THEME_COLOR_LIMIT;s++){let o=r[`cScale${s}`];a+=`
|
|
2
2
|
.radarCurve-${s} {
|
|
3
3
|
color: ${o};
|
|
4
4
|
fill: ${o};
|
|
@@ -11,7 +11,7 @@ import{ee}from"./index.r0p3fm9f.js";import{e,n,Me,F,k,j,A,L,R,I,M,D,O,Y,K}from".
|
|
|
11
11
|
fill-opacity: ${t.curveOpacity};
|
|
12
12
|
stroke: ${o};
|
|
13
13
|
}
|
|
14
|
-
`}return a},"genIndexStyles"),ot=e((r)=>{let t=
|
|
14
|
+
`}return a},"genIndexStyles"),ot=e((r)=>{let t=Ie(),a=k(),s=Y(t,a.themeVariables),o=Y(s.radar,r);return{themeVariables:s,radarOptions:o}},"buildRadarStyleOptions"),it=e(({radar:r}={})=>{let{themeVariables:t,radarOptions:a}=ot(r);return`
|
|
15
15
|
.radarTitle {
|
|
16
16
|
font-size: ${t.fontSize};
|
|
17
17
|
color: ${t.titleColor};
|