@softistx/pulsarix-widget 0.8.2 → 0.8.3
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/dist/chunks/{abnfDiagram-XWFEHMT6.jcqkp43e.js → abnfDiagram-XWFEHMT6.9eyf87ze.js} +1 -1
- package/dist/chunks/architecture-WOLXFQ4H.230b0n6c.js +1 -0
- package/dist/chunks/{architectureDiagram-CSQXQB3N.pk9dxdfb.js → architectureDiagram-CSQXQB3N.cy6247c8.js} +1 -1
- package/dist/chunks/{blockDiagram-BEDRHYPZ.ehefn7dt.js → blockDiagram-BEDRHYPZ.an5w7tk4.js} +1 -1
- package/dist/chunks/{c4Diagram-M2UUVUY5.knj3as6x.js → c4Diagram-M2UUVUY5.512525r3.js} +1 -1
- package/dist/chunks/{chat-markdown-DLDNLXM9.tvekh9sm.js → chat-markdown-COFhHMpe.fm39gs4e.js} +2 -2
- package/dist/chunks/{classDiagram-v2-KXABOMEV.vtb7vjzn.js → classDiagram-v2-KXABOMEV.5gw6azyv.js} +1 -1
- package/dist/chunks/{cose-bilkent-JH36ORCC.gb18dr42.js → cose-bilkent-JH36ORCC.9t42zmky.js} +1 -1
- package/dist/chunks/cynefin-EF2NZ3EQ.e9ycn4jb.js +1 -0
- package/dist/chunks/{cynefinDiagram-NJNITYFG.akmr90zk.js → cynefinDiagram-NJNITYFG.dta2tfnh.js} +1 -1
- package/dist/chunks/{dagre-KIHZ2IZ3.7n7s7vq2.js → dagre-KIHZ2IZ3.k7b2vmwy.js} +1 -1
- package/dist/chunks/{diagram-7YQZDPLS.d3sdv0py.js → diagram-7YQZDPLS.cd2t0saz.js} +1 -1
- package/dist/chunks/{diagram-QBROCOUO.2v08zs42.js → diagram-QBROCOUO.1x4d8w7m.js} +1 -1
- package/dist/chunks/{diagram-RJJCUUZO.tpnwa621.js → diagram-RJJCUUZO.jk65d82z.js} +1 -1
- package/dist/chunks/{diagram-WERXNKYE.hz7tgbtr.js → diagram-WERXNKYE.85c3en4j.js} +1 -1
- package/dist/chunks/{diagram-YHHI257C.9gge9ecb.js → diagram-YHHI257C.y494n4nm.js} +1 -1
- package/dist/chunks/{diagram-YR4HJLHV.bajpx75b.js → diagram-YR4HJLHV.z2n88j9s.js} +1 -1
- package/dist/chunks/{ebnfDiagram-N527522P.hxbbq671.js → ebnfDiagram-N527522P.cgfkzbkp.js} +1 -1
- package/dist/chunks/{editor-shortcuts-dialog-I77EAez1.0s00eh53.js → editor-shortcuts-dialog-Ch8GFC-h.n66q7eep.js} +1 -1
- package/dist/chunks/editor.yc8q5dd1.js +4 -0
- package/dist/chunks/{elk-O5DQBFGD.vy7cdqps.js → elk-O5DQBFGD.188pnf8b.js} +1 -1
- package/dist/chunks/{emoji-picker-BofyuTmK.qf287fk6.js → emoji-picker-Cv6ZOgpd.cmp5h45n.js} +1 -1
- package/dist/chunks/{erDiagram-K3K3BIDK.kzs3v0ts.js → erDiagram-K3K3BIDK.abxf5cgs.js} +1 -1
- package/dist/chunks/eventmodeling-K75KTNOO.q3y4xbmj.js +1 -0
- package/dist/chunks/{flow-diagram-OPO1ep57.5006stqg.js → flow-diagram-B6X1M34-.awp18a9v.js} +1 -1
- package/dist/chunks/flowDiagram-Z6JWZHQI.af312t1k.js +1 -0
- package/dist/chunks/{ganttDiagram-3PRQTZWP.qkcp8pvg.js → ganttDiagram-3PRQTZWP.p72ak8vx.js} +1 -1
- package/dist/chunks/gitGraph-VSP46ZUC.e4envgw8.js +1 -0
- package/dist/chunks/{gitGraphDiagram-VXDFKS5L.ry9dejxm.js → gitGraphDiagram-VXDFKS5L.vtq378bg.js} +1 -1
- package/dist/chunks/{grid-E2QIVN74.q51enfx7.js → grid-E2QIVN74.8xqrr45y.js} +1 -1
- package/dist/chunks/illustration-BpmMAKpO.brt46gkr.js +1 -0
- package/dist/chunks/{index.fvh2m60c.js → index.2jsv3483.js} +1 -1
- package/dist/chunks/index.5vcex75v.js +44 -0
- package/dist/chunks/{index.20dvswea.js → index.6tc2v7mk.js} +1 -1
- package/dist/chunks/{index.bfeafb22.js → index.8hmrz817.js} +1 -1
- package/dist/chunks/{index.eec12m3n.js → index.b0pypc3w.js} +1 -1
- package/dist/chunks/{index.yf0h5qnv.js → index.btq862bx.js} +1 -1
- package/dist/chunks/{index.fab58nn0.js → index.je7pqrtm.js} +1 -1
- package/dist/chunks/{index.51yk4ene.js → index.jgvp2nkv.js} +1 -1
- package/dist/chunks/{index.fgsp5qqn.js → index.mjfjqm0b.js} +2 -2
- package/dist/chunks/{index.vnhefjwh.js → index.nphh2dtn.js} +1 -1
- package/dist/chunks/{index.23p1k2rx.js → index.pb5tn7q8.js} +1 -1
- package/dist/chunks/{index.x163xe9c.js → index.psaka010.js} +1 -1
- package/dist/chunks/{index.153rcscj.js → index.qy1pndre.js} +1 -1
- package/dist/chunks/{index.gqa9s37g.js → index.r8wc9n4q.js} +1 -1
- package/dist/chunks/{index.x1xqs5m5.js → index.vm7ezzet.js} +1 -1
- package/dist/chunks/{index.q9dsw4bt.js → index.x22rwqsz.js} +1 -1
- package/dist/chunks/{index.h6120080.js → index.ybmxf4mt.js} +1 -1
- package/dist/chunks/{index.9zhger75.js → index.yd3167gn.js} +2 -2
- package/dist/chunks/info-OHQRW6UA.yhwzx56w.js +1 -0
- package/dist/chunks/{infoDiagram-EZ3ZOAHP.r2yygqw8.js → infoDiagram-EZ3ZOAHP.q0047zjz.js} +1 -1
- package/dist/chunks/{ishikawaDiagram-S3EKX5GW.gwqtdvb2.js → ishikawaDiagram-S3EKX5GW.41wwb1jp.js} +1 -1
- package/dist/chunks/{journeyDiagram-POQNLL5X.rp31qkq5.js → journeyDiagram-POQNLL5X.2c9swtn6.js} +1 -1
- package/dist/chunks/{kanban-definition-BH5XI6FM.ymsqx6en.js → kanban-definition-BH5XI6FM.xznh9d30.js} +1 -1
- package/dist/chunks/{markup-color-chrome-ykGNUl8y.06cy435c.js → markup-color-chrome-ykGNUl8y.955bjndb.js} +1 -1
- package/dist/chunks/{markup-custom-color-C8Xc6JxB.an2wngns.js → markup-custom-color-Dou38qUi.w8c65wn1.js} +1 -1
- package/dist/chunks/{mention-list-Dhq70jL5.1k61f24q.js → mention-list-D4eNNVs0.2k5cdtgy.js} +1 -1
- package/dist/chunks/{mermaid.core.x45crg0h.js → mermaid.core.d680cq0m.js} +2 -2
- package/dist/chunks/{mindmap-definition-WVAN44T4.5cbd4rg2.js → mindmap-definition-WVAN44T4.k41b9d4r.js} +1 -1
- package/dist/chunks/packet-JDAUHWVQ.gp9cmm94.js +1 -0
- package/dist/chunks/{panel.nm4pj2wm.js → panel.yh0jnkha.js} +1 -1
- package/dist/chunks/{pegDiagram-D4NLKWP3.fsryts4r.js → pegDiagram-D4NLKWP3.x25624w6.js} +1 -1
- package/dist/chunks/pie-XZMESJXO.fx385qqa.js +1 -0
- package/dist/chunks/{pieDiagram-36ENHN4W.k4k2gvg0.js → pieDiagram-36ENHN4W.j4fq9134.js} +1 -1
- package/dist/chunks/{plated-illustration-BzxADkoZ.wtc9psry.js → plated-illustration-0ro04oJt.0ebg0x7r.js} +1 -1
- package/dist/chunks/{quadrantDiagram-ZQUDMS73.j7nj12w0.js → quadrantDiagram-ZQUDMS73.1vgwgk90.js} +1 -1
- package/dist/chunks/radar-ABXABTNO.d58r1mqp.js +1 -0
- package/dist/chunks/railroad-I3PHUGI6.cwq84f31.js +1 -0
- package/dist/chunks/railroad-abnf-LNEFI6M7.7z7d547m.js +1 -0
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.geje0ygg.js +1 -0
- package/dist/chunks/railroad-peg-JR7BVNR7.f8xnzs1y.js +1 -0
- package/dist/chunks/{railroadDiagram-JIZHGYPL.a681wt3b.js → railroadDiagram-JIZHGYPL.pbv1rqfp.js} +1 -1
- package/dist/chunks/{render-VIF2ZAQL.rn9hpsbx.js → render-VIF2ZAQL.2kz294jj.js} +1 -1
- package/dist/chunks/{requirementDiagram-AXW2TVFA.shapgy39.js → requirementDiagram-AXW2TVFA.qnxmvqx8.js} +1 -1
- package/dist/chunks/{sankeyDiagram-FBCJTAIF.2syz1e2b.js → sankeyDiagram-FBCJTAIF.whv6dy60.js} +1 -1
- package/dist/chunks/{sequenceDiagram-3LA2ROMG.jq1w12a6.js → sequenceDiagram-3LA2ROMG.w52darq5.js} +1 -1
- package/dist/chunks/{sizeCapture-2Q2CQKSF.jtv53a6j.js → sizeCapture-2Q2CQKSF.zgscrz2v.js} +1 -1
- package/dist/chunks/{stateDiagram-v2-ATKHQDJO.x0g2rngz.js → stateDiagram-v2-ATKHQDJO.zk8w1ht1.js} +1 -1
- package/dist/chunks/{swimlanes-YQL5WMAO.j7j7c6ex.js → swimlanes-YQL5WMAO.cn1pz0jc.js} +1 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.cy9ywqbn.js +8 -0
- package/dist/chunks/{timeline-definition-7Z437IG3.s5bvn8dr.js → timeline-definition-7Z437IG3.atpqnb0j.js} +1 -1
- package/dist/chunks/treeView-D4JQ5SDB.fj76b06b.js +1 -0
- package/dist/chunks/treemap-SAJKECNS.yk7967y9.js +1 -0
- package/dist/chunks/{usecaseDiagram-RDK6N6HP.9k4r423e.js → usecaseDiagram-RDK6N6HP.ase4sfgd.js} +1 -1
- package/dist/chunks/{vennDiagram-SHRQU5PJ.82q5dzm6.js → vennDiagram-SHRQU5PJ.as8z3hh5.js} +1 -1
- package/dist/chunks/wardley-7MLQ67FV.r3k2k1ra.js +1 -0
- package/dist/chunks/{wardleyDiagram-F3OXNVQS.fm4tw2nc.js → wardleyDiagram-F3OXNVQS.8pf1xb65.js} +1 -1
- package/dist/chunks/{xychartDiagram-GDYJKCDI.57vqn2zd.js → xychartDiagram-GDYJKCDI.z35xw169.js} +1 -1
- package/dist/index.js +5 -5
- package/package.json +2 -2
- package/dist/chunks/architecture-WOLXFQ4H.6qa86taq.js +0 -1
- package/dist/chunks/cynefin-EF2NZ3EQ.e86yfa9w.js +0 -1
- package/dist/chunks/editor.h5bxwyxn.js +0 -4
- package/dist/chunks/eventmodeling-K75KTNOO.9yb5zf47.js +0 -1
- package/dist/chunks/flowDiagram-Z6JWZHQI.zf0kndsp.js +0 -1
- package/dist/chunks/gitGraph-VSP46ZUC.txpj8e6d.js +0 -1
- package/dist/chunks/illustration-BoOzuxNg.h0gnxa4s.js +0 -1
- package/dist/chunks/index.0hrfbrja.js +0 -44
- package/dist/chunks/info-OHQRW6UA.xea9bh7d.js +0 -1
- package/dist/chunks/packet-JDAUHWVQ.c7dmae11.js +0 -1
- package/dist/chunks/pie-XZMESJXO.6rv4kzjx.js +0 -1
- package/dist/chunks/radar-ABXABTNO.58dfc8ba.js +0 -1
- package/dist/chunks/railroad-I3PHUGI6.00fqbahv.js +0 -1
- package/dist/chunks/railroad-abnf-LNEFI6M7.gt1x50q5.js +0 -1
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.qr5qfkga.js +0 -1
- package/dist/chunks/railroad-peg-JR7BVNR7.m61rq7hj.js +0 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.tzqcsrmd.js +0 -8
- package/dist/chunks/treeView-D4JQ5SDB.0x1grm2t.js +0 -1
- package/dist/chunks/treemap-SAJKECNS.1te19jsm.js +0 -1
- package/dist/chunks/wardley-7MLQ67FV.zp6gykk3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,n,u,N,Bt,wl,St,gr,$t,yn,br}from"./index.fgsp5qqn.js";import{Le,Ge,st,De,vt,ir,te,Te,pt,or,mt,Hn,Oi,Pi,Bi,$r,Dt,Fi,zr,Ve,Hr,Yt,Ot,Ur,sr,qr,$i,zi,Un,Re,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,Ie,ur,ue}from"./index.20dvswea.js";import{Ii,Mi,Q,dn,cl,Ni,ot}from"./index.fvh2m60c.js";import{sa}from"./index.0hrfbrja.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)&&Dt(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 Dt(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 Oi(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(!De(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,Re(t),r)}var Ee=Qo;function ri(r,t){return r&&k(t,L(t),r)}var xe=ri;var Pe=typeof mr=="object"&&mr&&!mr.nodeType&&mr,Oe=Pe&&typeof pr=="object"&&pr&&!pr.nodeType&&pr,ei=Oe&&Oe.exports===Pe,Se=ei?Le.Buffer:void 0,Ne=Se?Se.allocUnsafe:void 0;function ti(r,t){if(t)return r.slice();var o=r.length,i=Ne?Ne(o):new r.constructor(o);return r.copy(i),i}var Z=ti;function ni(r,t){return k(r,Gn(r),t)}var ke=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 Ce=ai;function fi(r){return qi(r,L,hr)}var Ae=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 Me=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 je=pi;var li=/\w*$/;function mi(r){var t=new r.constructor(r.source,li.exec(r));return t.lastIndex=r.lastIndex,t}var Be=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]",Li="[object Symbol]",Si="[object ArrayBuffer]",ki="[object DataView]",Ti="[object Float32Array]",Ci="[object Float64Array]",Ai="[object Int8Array]",Ri="[object Int16Array]",Di="[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 Si:return z(r);case vi:case bi:return new i(+r);case ki:return je(r,o);case Ti:case Ci:case Ai:case Ri:case Di: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 Be(r);case Ei:return new i;case Li: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 De(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 De(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=Me(r),!d)return dr(r,s)}else{var m=yt(r),h=m==$e||m==ma;if(Ot(r))return Z(r,d);if(m==Qe||m==Ze||h&&!a){if(s=c||h?{}:yr(r),!d)return c?Ce(r,xe(s,r)):ke(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?Ae:Ta:c?L:Re,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||Dt(l,nt[p])&&!Da.call(r,p))r[p]=f[p]}}return r}),it=Fa;function Ga(r,t,o){if(o!==void 0&&!Dt(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&&Ot(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=Re(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)&&De(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(!Ie(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(Ie(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(!Ie(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=!Ie(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(!Ie(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(!Ie(f)&&!Ie(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(Ie(s.barycenter)||Ie(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(!Ie(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}=Ii(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,Bt,wl,St,gr,$t,yn,br}from"./index.mjfjqm0b.js";import{Le,Ge,st,De,vt,ir,te,Te,pt,or,mt,Hn,Oi,Pi,Bi,$r,Dt,Fi,zr,Ve,Hr,Yt,Ot,Ur,sr,qr,$i,zi,Un,Re,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,Ie,ur,ue}from"./index.6tc2v7mk.js";import{Ii,Mi,Q,dn,cl,Ni,ot}from"./index.2jsv3483.js";import{sa}from"./index.5vcex75v.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)&&Dt(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 Dt(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 Oi(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(!De(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,Re(t),r)}var Ee=Qo;function ri(r,t){return r&&k(t,L(t),r)}var xe=ri;var Pe=typeof mr=="object"&&mr&&!mr.nodeType&&mr,Oe=Pe&&typeof pr=="object"&&pr&&!pr.nodeType&&pr,ei=Oe&&Oe.exports===Pe,Se=ei?Le.Buffer:void 0,Ne=Se?Se.allocUnsafe:void 0;function ti(r,t){if(t)return r.slice();var o=r.length,i=Ne?Ne(o):new r.constructor(o);return r.copy(i),i}var Z=ti;function ni(r,t){return k(r,Gn(r),t)}var ke=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 Ce=ai;function fi(r){return qi(r,L,hr)}var Ae=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 Me=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 je=pi;var li=/\w*$/;function mi(r){var t=new r.constructor(r.source,li.exec(r));return t.lastIndex=r.lastIndex,t}var Be=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]",Li="[object Symbol]",Si="[object ArrayBuffer]",ki="[object DataView]",Ti="[object Float32Array]",Ci="[object Float64Array]",Ai="[object Int8Array]",Ri="[object Int16Array]",Di="[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 Si:return z(r);case vi:case bi:return new i(+r);case ki:return je(r,o);case Ti:case Ci:case Ai:case Ri:case Di: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 Be(r);case Ei:return new i;case Li: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 De(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 De(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=Me(r),!d)return dr(r,s)}else{var m=yt(r),h=m==$e||m==ma;if(Ot(r))return Z(r,d);if(m==Qe||m==Ze||h&&!a){if(s=c||h?{}:yr(r),!d)return c?Ce(r,xe(s,r)):ke(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?Ae:Ta:c?L:Re,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||Dt(l,nt[p])&&!Da.call(r,p))r[p]=f[p]}}return r}),it=Fa;function Ga(r,t,o){if(o!==void 0&&!Dt(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&&Ot(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=Re(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)&&De(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(!Ie(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(Ie(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(!Ie(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=!Ie(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(!Ie(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(!Ie(f)&&!Ie(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(Ie(s.barycenter)||Ie(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(!Ie(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}=Ii(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
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),wl(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(dn(g.id,t)),Q.set(g.id,{id:dn(g.id,t),node:g});else n.trace("Node - the non recursive path XAX",y,l,t.node(y),s),await Mi(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 $t(p,R),_.width=R.width,_.height=R.height,_.labelStyle=R.labelStyle;return}await $t(p,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=Bt(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]));Ni(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(Ni(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,St(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 gr(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),St(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=br(i,m,Q,a,w,y,f);yn(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 ue({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)}),cl(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})=>Ni(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=ot({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.btq862bx.js";import{e,n,Me,F,k,j,A,L,I,R,M,O,D,Y,K}from"./index.mjfjqm0b.js";import{se}from"./index.yd3167gn.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},C=32,b={axes:[],curves:[],options:h},x=structuredClone(b),B=F.radar,W=e(()=>K({...B,...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"),X=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:X,setOptions:Z,getConfig:W,clear:q,setAccTitle:L,getAccTitle:I,setDiagramTitle:O,getDiagramTitle:D,getAccDescription:M,setAccDescription:R},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 se("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=Y(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),P(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),z=w*Math.cos(f),G=w*Math.sin(f);return{x:z,y:G}});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 P(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(P,"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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Xn}from"./index.
|
|
1
|
+
import{Xn}from"./index.qy1pndre.js";import{e,n,be,gt,Pe,Rr,y,A,L,I,R,M,O,D,u,Pt,Kr,m,ut,dt,ve,he,pe,tt,z,We,aa,Ae,_e}from"./index.mjfjqm0b.js";import{Xt}from"./index.pb5tn7q8.js";import{Xe}from"./index.b0pypc3w.js";import{Ee}from"./index.r8wc9n4q.js";import{ge}from"./index.ybmxf4mt.js";var vt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},U1=new Set([vt.SHAPE_UNSUPPORTED,vt.SHAPE_REMOVED,vt.CONTAINMENT_VIOLATION]),vs=new Set(Object.values(vt).filter((t)=>!U1.has(t))),j1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["lean_right","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),z1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),W1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),Tt="roundedRect";function Dt(t){if(!t)return t;return j1.get(t)??t}e(Dt,"resolveShapeAlias");function _1(t,r){for(let a of t){if(a.isGroup)continue;if(!a.shape||a.shape==="squareRect"||a.shape==="rect")a.shape=Tt;if(z1.has(a.shape)){let o=`shape "${a.shape}" was removed in v0.8.1, using "${Tt}"`;if(r?.emitError)r.emitError("SHAPE_REMOVED",o,{nodeId:a.id});else n.warn(`agentflow: ${o}`);a.shape=Tt;continue}if(!W1.has(a.shape)){let o=`shape "${a.shape}" is not supported, using "${Tt}"`;if(r?.emitWarning)r.emitWarning("SHAPE_UNSUPPORTED",o,{nodeId:a.id});else n.warn(`agentflow: ${o}`);a.shape=Tt}}}e(_1,"normaliseNodeShapes");var i1=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),F1=i1.size,V1=e((t)=>`af-kind-${t}`,"kindClass"),K1=[...i1.keys()],I1=e((t)=>Math.max(1,t-F1),"containerSlotCount"),L1=e((t,r)=>{let a=F1+t%I1(r);return r>0?a%r:a},"containerSlot");function B1(t,r,a){let o=u().themeVariables?.borderColorArray,d=Array.isArray(o)?o.length:0,h=a.size;for(let l of t??[]){if(l.isGroup||l.shape==="collapsedGroup"){let k=a.get(String(l.id))??h++;l.colorIndex=L1(k,d);continue}let p=r(String(l.id));if(p&&i1.has(p))l.cssClasses=`${l.cssClasses??""} ${V1(p)}`.replace(/\s+/g," ").trim()}}e(B1,"assignColorSlots");var v1="agentflow-",c1=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),H1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),Y1={flow:"flowGroup"};function M1(t){let r=!1,a=!1,o=0,d,h=[];for(let l of t.split(`
|
|
2
2
|
`)){if(d!==void 0){let E=l.length-l.trimStart().length;if(l.trim()===""||E>d){h.push(l);continue}d=void 0}let p=-1;for(let E=0;E<l.length;E++){let S=l[E];if(a){if(S==="\\")E++;else if(S==='"')a=!1}else if(r){if(S==="'")r=!1}else if(S==='"')a=!0;else if(S==="'")r=!0;else if(S==="#"&&(E===0||l[E-1]===" "||l[E-1]==="\t")){p=E;break}else if(S==="["||S==="{")o++;else if(S==="]"||S==="}")o=Math.max(0,o-1)}if(r||a||o>0){h.push(l);continue}let k=p>=0?l.slice(0,p):l,b=p>=0?l.slice(p):"";if(/:\s*[>|][\d+-]*\s*$/.test(k)){d=l.length-l.trimStart().length,h.push(l);continue}h.push(k.replace(/,([\t ]*)$/,"$1")+b)}return h.join(`
|
|
3
3
|
`)}e(M1,"stripLineTrailingCommas");var q1=class{constructor(){this.vertexCounter=0,this.config=u(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=L,this.setAccDescription=R,this.setDiagramTitle=O,this.getAccTitle=I,this.getAccDescription=M,this.getDiagramTitle=D,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{e(this,"AgentFlowDB")}sanitizeText(t){return y.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(let r of this.vertices.values())if(r.id===t)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,r,a,o,d,h,l={},p,k){if(!t||t.trim().length===0)return;let b;if(p!==void 0){let C;if(!p.includes(`
|
|
4
4
|
`))C=`{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ee}from"./index.
|
|
1
|
+
import{ee}from"./index.btq862bx.js";import{Br}from"./index.nphh2dtn.js";import{e,n,F,k,q,j,A,L,I,R,M,O,D,Y,mr,nt,K}from"./index.mjfjqm0b.js";import{se}from"./index.yd3167gn.js";var H=/[─━│┃└┗├┣]/,W=/[└┗├┣]/,J=/[─━]/,N=/^[\s│┃]+$/,E=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,_=/^\s*%%/,Q=" ";function X(i){return i.some((r)=>H.test(r))}e(X,"isBoxDrawingFormat");function z(i){for(let r of i){let t=W.exec(r);if(t?.index&&t.index>0)return t.index}return 4}e(z,"inferSegmentWidth");function G(i,r){return i.replace(/\bline\s+(\d+)\b/gi,(t,o)=>{let c=parseInt(o,10),s=r.get(c);return s?`line ${s}`:t})}e(G,"remapErrorLines");function P(i){let r=i.split(`
|
|
2
2
|
`),t=new Map,o=-1;for(let[g,d]of r.entries())if(d.trim()==="treeView-beta"){o=g;break}if(o===-1)return{text:i,lineMap:t};let c=[];for(let g=o+1;g<r.length;g++){let d=r[g];if(d.trim()===""||_.test(d)||E.test(d))continue;if(N.test(d))continue;c.push(d.replace(/\t/g," "))}if(!X(c))return{text:i,lineMap:t};let s=z(c),a=[],l=0;for(let g=0;g<=o;g++)a.push(r[g]),l++,t.set(l,g+1);for(let g=o+1;g<r.length;g++){let d=r[g],p=d.trim(),f=g+1;if(p===""){a.push(d),l++,t.set(l,f);continue}if(_.test(d)){a.push(d),l++,t.set(l,f);continue}if(E.test(d)){a.push(d),l++,t.set(l,f);continue}if(N.test(d))continue;let h=d.replace(/\t/g," "),w=W.exec(h);if(w?.index!==void 0){let u=w.index,x=Math.round(u/s)+1,m=u+1;while(m<h.length&&J.test(h[m]))m++;while(m<h.length&&h[m]===" ")m++;let b=h.slice(m).trimEnd();if(!b)throw Error(`Line ${f}: Empty node — expected a filename or directory name after the box-drawing prefix`);let U=Q.repeat(x);a.push(U+b),l++,t.set(l,f)}else if(/^[\s─━│┃└┗├┣]+$/.test(h))continue;else if(H.test(h))a.push(d),l++,t.set(l,f);else if(/^\s+/.test(h))throw Error(`Line ${f}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else a.push(d),l++,t.set(l,f)}return{text:a.join(`
|
|
3
3
|
`),lineMap:t}}e(P,"preprocessBoxDrawing");var v=new Br(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),te=e(()=>{v.reset(),A()},"clear"),re=e(()=>v.records.stack[0],"getRoot"),ne=e(()=>v.records.cnt,"getCount"),ie=F.treeView,oe=e(()=>K(ie,k().treeView),"getConfig"),ae=e((i,r,t,o,c,s)=>{while(i<=v.records.stack[v.records.stack.length-1].level)v.records.stack.pop();let a={id:v.records.cnt++,level:i,name:r,nodeType:t,icon:c,cssClass:o,description:s,children:[]};v.records.stack[v.records.stack.length-1].children.push(a),v.records.stack.push(a)},"addNode"),ce={clear:te,addNode:ae,getRoot:re,getCount:ne,getConfig:oe,getAccTitle:I,getAccDescription:M,getDiagramTitle:D,setAccDescription:R,setAccTitle:L,setDiagramTitle:O},y=ce,le=e((i)=>{ee(i,y);for(let r of i.nodes){let t=typeof r.indent==="number"?r.indent:0,o=r.name,c=o.endsWith("/");if(c)o=o.slice(0,-1);let s=c?"directory":"file",a=r.classAnnotation||void 0,l=r.iconAnnotation,g=l!==void 0?l||"none":void 0,d=r.descAnnotation||void 0,p=d?q(d,k()):void 0;y.addNode(t,o,s,a,g,p)}},"populate"),de={parse:e(async(i)=>{let{text:r,lineMap:t}=P(i);try{let o=await se("treeView",r);n.debug(o),le(o)}catch(o){if(t.size>0&&o instanceof Error)o.message=G(o.message,t);throw o}},"parse")},C={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function Z(i,r){let t=r?.filenameIcons?.[i];if(t)return t;let o=i.lastIndexOf(".");if(o>0){let c=i.substring(o).toLowerCase(),s=r?.extensionIcons;return s?.[c]??s?.[c.slice(1)]}return}e(Z,"detectIcon");function B(i,r){if(i.includes(":"))return i;if(i in C.icons||!r)return`${C.prefix}:${i}`;return`${r}:${i}`}e(B,"qualifyIcon");function V(i,r){if(i.icon==="none")return;if(i.icon)return B(i.icon,r.defaultIconPack);if(!r.showIcons)return;if(i.nodeType==="file"){let t=Z(i.name,r);if(t==="none")return;if(t)return B(t,r.defaultIconPack)}return`${C.prefix}:${i.nodeType==="directory"?"folder":"file"}`}e(V,"getNodeIcon");mr([{name:C.prefix,icons:C}]);var T=14,he=4,pe=16,fe=e(async(i,r)=>{let t=[],o=e((s)=>{let a=V(s,r);if(a)t.push({icon:a,node:s});s.children.forEach(o)},"collect");o(i);let c=await Promise.all(t.map(async({icon:s,node:a})=>({id:a.id,svg:await nt(s,{height:T,width:T})})));return new Map(c.map(({id:s,svg:a})=>[s,a]))},"resolveNodeIcons"),ge=e((i,r,t,o,c,s)=>{let a=o.append("g"),l="treeView-node-label";if(t.nodeType==="directory")l+=" treeView-node-dir";if(t.cssClass)l+=` ${t.cssClass}`;let g=T+he,d=V(t,c),p=d!==void 0;if(d)a.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${i+c.paddingX}, ${r+c.paddingY})`).html(s.get(t.id)??"");let f=a.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:h,width:w}=f.node().getBBox(),u=h+c.paddingY*2,x=i+c.paddingX+(p?g:0);f.attr("x",x),f.attr("y",r+u/2);let m=x+w,b=w+c.paddingX*2+(p?g:0);if(t.BBox={x:i,y:r,width:b,height:u},t.cssClass?.split(/\s+/).includes("highlight"))a.insert("rect",":first-child").attr("x",i).attr("y",r+1).attr("width",0).attr("height",u-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:t,nodeGroup:a,labelRightEdge:m,centerY:r+u/2}},"positionLabel"),S=e((i,r,t,o,c,s)=>i.append("line").attr("x1",r).attr("y1",t).attr("x2",o).attr("y2",c).attr("stroke-width",s).attr("class","treeView-node-line"),"positionLine"),ue=e((i,r,t,o)=>{let c=0,s=0,a=[],l=e((p,f,h,w)=>{let u=w*(h.rowIndent+h.paddingX),x=ge(u,c,f,p,h,o);a.push(x);let{height:m,width:b}=f.BBox;S(p,u-h.rowIndent,c+m/2,u,c+m/2,h.lineThickness),s=Math.max(s,u+b),c+=m},"drawNode"),g=e((p,f=0)=>{l(i,p,t,f),p.children.forEach((x)=>{g(x,f+1)});let{x:h,y:w,height:u}=p.BBox;if(p.children.length){let{y:x,height:m}=p.children[p.children.length-1].BBox;S(i,h+t.paddingX,w+u,h+t.paddingX,x+m/2+t.lineThickness/2,t.lineThickness)}},"processNode");g(r);let d=a.filter((p)=>p.node.description);if(d.length>0){let f=Math.max(...a.map((h)=>h.labelRightEdge))+pe;for(let h of d){let u=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();s=Math.max(s,f+u.width+t.paddingX)}}for(let p of a)if(p.node.cssClass?.split(/\s+/).includes("highlight")){let f=p.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){let h=s-p.node.BBox.x+8;f.attr("width",h),s=Math.max(s,p.node.BBox.x+h+2)}}return{totalHeight:c,totalWidth:s}},"drawTree"),me=e(async(i,r,t,o)=>{n.debug(`Rendering treeView diagram
|
|
4
4
|
`+i);let c=o.db,s=c.getRoot(),a=c.getConfig(),l=Y(r),g=l.append("g");g.attr("class","tree-view");let d=await fe(s,a),{totalHeight:p,totalWidth:f}=ue(g,s,a,d);l.attr("viewBox",`-${a.lineThickness/2} 0 ${f} ${p}`),j(l,p,f,a.useMaxWidth)},"draw"),we={draw:me},xe=we,ve={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},be=e(({treeView:i})=>{let{labelFontSize:r,labelColor:t,lineColor:o,iconColor:c,descriptionColor:s,highlightBg:a,highlightStroke:l}=K(ve,i);return`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ee}from"./index.
|
|
1
|
+
import{ee}from"./index.btq862bx.js";import{e,n,F,k,j,A,L,I,R,M,O,D,Y,K}from"./index.mjfjqm0b.js";import{se}from"./index.yd3167gn.js";var E=F.packet,C=class{constructor(){this.packet=[],this.setAccTitle=L,this.getAccTitle=I,this.setDiagramTitle=O,this.getDiagramTitle=D,this.getAccDescription=M,this.setAccDescription=R}static{e(this,"PacketDB")}getConfig(){let t=K({...E,...k().packet});if(t.showBits)t.paddingY+=10;return t}getPacket(){return this.packet}pushWord(t){if(t.length>0)this.packet.push(t)}clear(){A(),this.packet=[]}},P=1e4,W=e((t,r)=>{ee(t,r);let o=-1,i=[],l=1,{bitsPerRow:d}=r.getConfig();for(let{start:a,end:s,bits:g,label:f}of t.blocks){if(a!==void 0&&s!==void 0&&s<a)throw Error(`Packet block ${a} - ${s} is invalid. End must be greater than start.`);if(a??=o+1,a!==o+1)throw Error(`Packet block ${a} - ${s??a} is not contiguous. It should start from ${o+1}.`);if(g===0)throw Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);s??=a+(g??1)-1,g??=s-a+1,o=s,n.debug(`Packet block ${a} - ${o} with label ${f}`);while(i.length<=d+1&&r.getPacket().length<P){let[p,h]=_({start:a,end:s,bits:g,label:f},l,d);if(i.push(p),p.end+1===l*d)r.pushWord(i),i=[],l++;if(!h)break;({start:a,end:s,bits:g,label:f}=h)}}r.pushWord(i)},"populate"),_=e((t,r,o)=>{if(t.start===void 0)throw Error("start should have been set during first phase");if(t.end===void 0)throw Error("end should have been set during first phase");if(t.start>t.end)throw Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=r*o)return[t,void 0];let i=r*o-1,l=r*o;return[{start:t.start,end:i,label:t.label,bits:i-t.start},{start:l,end:t.end,label:t.label,bits:t.end-l}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:e(async(t)=>{let r=await se("packet",t),o=S.parser?.yy;if(!(o instanceof C))throw Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");n.debug(r),W(r,o)},"parse")},N=e((t,r,o,i)=>{let l=i.db,d=l.getConfig(),{rowHeight:a,paddingY:s,bitWidth:g,bitsPerRow:f}=d,p=l.getPacket(),h=l.getDiagramTitle(),w=a+s,c=w*(p.length+1)-(h?0:a),m=g*f+2,u=Y(r);u.attr("viewBox",`0 0 ${m} ${c}`),j(u,c,m,d.useMaxWidth);for(let[y,b]of p.entries())G(u,b,y,d);u.append("text").text(h).attr("x",m/2).attr("y",c-w/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),G=e((t,r,o,{rowHeight:i,paddingX:l,paddingY:d,bitWidth:a,bitsPerRow:s,showBits:g,bitOrder:f})=>{let p=t.append("g"),h=o*(i+d)+d,w=f==="descending";for(let c of r){let m=c.end-c.start+1,u=c.start%s,b=(w?s-u-m:u)*a+1,v=m*a-l;if(p.append("rect").attr("x",b).attr("y",h).attr("width",v).attr("height",i).attr("class","packetBlock"),p.append("text").attr("x",b+v/2).attr("y",h+i/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(c.label),!g)continue;let[T,z]=w?[c.end,c.start]:[c.start,c.end],x=m===1,B=h-2;if(p.append("text").attr("x",b+(x?v/2:0)).attr("y",B).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",x?"middle":"start").text(T),!x)p.append("text").attr("x",b+v).attr("y",B).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(z)}},"drawWord"),H={draw:N},U={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},X=e(({packet:t}={})=>{let r=K(U,t);return`
|
|
2
2
|
.packetByte {
|
|
3
3
|
font-size: ${r.byteFontSize};
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ee}from"./index.
|
|
1
|
+
import{ee}from"./index.btq862bx.js";import{e,n,F,k,q,A,L,I,R,M,O,D,u,ra,m,Xr,Fa,K}from"./index.mjfjqm0b.js";import{ka,se}from"./index.yd3167gn.js";var H="position frame",U="frame positioned",B="position relation",_="relation positioned",pe=e(function(t){n.debug("options str",t)},"setOptions"),ve=e(function(){return{}},"getOptions"),be=e(function(){G(),A()},"clear");function G(){P={}}e(G,"reset");var we=F.eventmodeling,ye=e(()=>K({...we,...k().eventmodeling}),"getConfig"),P={};function V(){let t=Pe,{ast:r}=P,i=T();if(!r)throw Error("No data for EventModel");return r.frames.forEach((a,o)=>{let s=Z(a,r.dataEntities,i);t=y(t,{$kind:H,index:o,frame:a,textProps:s});let l=void 0;if(oe(a))n.debug("source frame",a.sourceFrames),l=r.frames.filter((c)=>a.sourceFrames.some((x)=>x.$refText===c.name)),l.forEach((c)=>{t=y(t,{$kind:B,index:o,frame:a,sourceFrame:c})});else t=y(t,{$kind:B,index:o,frame:a})}),t={...t,sortedSwimlanesArray:C(t.swimlanes)},t}e(V,"getState");function X(t){P.ast=void 0;let r=new Set;for(let i of t.frames){if(r.has(i.name)){let a=i.$cstNode?.range.start.line,o=a===void 0?"":` on line ${a+1}`;throw Error(`Duplicate event modeling frame ID "${i.name}"${o}`)}r.add(i.name)}P.ast=t}e(X,"setAst");var d={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function T(){return d}e(T,"getDiagramProps");var Pe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function j(t){let r=t.split(".");if(r.length===2)return r[0];return}e(j,"extractNamespace");function Y(t){let r=t.split(".");if(r.length===2)return r[1];return t}e(Y,"extractName");function z(t,r){if(!r||r.length===0)return;return Object.values(t).find((i)=>i.namespace===r)}e(z,"findSwimlaneByNamespace");function w(t,r,i){return Math.max(r,...Object.keys(t).filter((a)=>{let o=Number.parseInt(a);return o>r&&o<i}).map((a)=>Number.parseInt(a)))+1}e(w,"findNextAvailableIndex");function J(t,r){let i=j(t.entityIdentifier),a=z(r,i);switch(t.modelEntityType){case"ui":case"pcr":case"processor":if(a)return{index:a.index,label:a.namespace||d.labelUiAutomation};else if(i)return{index:w(r,0,100),label:d.labelUiAutomationPrefix+i};return{index:0,label:d.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":if(a)return{index:a.index,label:a.namespace||d.labelCommandReadModel};else if(i)return{index:w(r,100,200),label:d.labelCommandReadModelPrefix+i};return{index:100,label:d.labelCommandReadModel};case"evt":case"event":default:if(a)return{index:a.index,label:a.namespace||d.labelEvents};else if(i)return{index:w(r,200,300),label:d.labelEventsPrefix+i};return{index:200,label:d.labelEvents}}}e(J,"calculateSwimlaneProps");function Q(t){let{themeVariables:r}=k();switch(t.modelEntityType){case"ui":return{fill:r.emUiFill??"white",stroke:r.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:r.emProcessorFill??"#edb3f6",stroke:r.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:r.emReadModelFill??"#d3f1a2",stroke:r.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:r.emCommandFill??"#bcd6fe",stroke:r.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:r.emEventFill??"#ffb778",stroke:r.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}e(Q,"calculateEntityVisualProps");function Z(t,r,i){let a=k(),o=q(Y(t.entityIdentifier)??"",a),s,l={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},x=`<b>${Xr(o,i.textMaxWidth,l)}</b>`;if(t.dataInlineValue)s=t.dataInlineValue,s=s.substring(s.indexOf("{")+1),s=s.substring(0,s.lastIndexOf("}")-1),s=q(s,a),s=Xr(s,i.textMaxWidth,l),s=s.replaceAll(" "," ");if(t.dataReference){let b=r.find((S)=>S.name===t.dataReference?.$refText);if(b)s=b.dataBlockValue,s=s.substring(s.indexOf(`{
|
|
2
2
|
`)+2),s=s.substring(0,s.lastIndexOf("}")-1),s=q(s,a),s=Xr(s,i.textMaxWidth,l),s=s.replaceAll(" "," "),s+="<br/>"}let f=s!==void 0;if(f)x+=`<br/><br/><code style="text-align: left; display: block;max-width:${i.textMaxWidth}px">${s}</code>`;let h={fontSize:l.fontSize,fontWeight:l.fontWeight,fontFamily:l.fontFamily},g=Fa(x,h),v=f?g.width/3:g.width,p={content:x,width:v,height:g.height};return n.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}e(Z,"calculateTextProps");function te(t,r){let i=r,a=Q(i.frame),o={width:i.textProps.width+2*d.boxTextPadding,height:i.textProps.height+2*d.boxTextPadding};return[{$kind:U,frame:i.frame,index:i.index,visual:a,dimension:o,textProps:i.textProps}]}e(te,"decidePositionFrame");function ne(t,r,i){if(r===void 0)return d.contentStartX;if(r.index===t.index&&t.r)return t.r+d.boxPadding;if(i===void 0)return d.contentStartX;return i.r-d.boxOverlap+d.boxPadding}e(ne,"calculateX");function ie(t,r){let i=[...t.map((a)=>a.r),r];return Math.max(...i)}e(ie,"calculateMaxRight");function C(t){return Object.values(t).sort((r,i)=>r.index-i.index)}e(C,"sortedSwimlanesArray");function re(t,r){let i=r,a=J(i.frame,t.swimlanes),o;if(a.index in t.swimlanes)o=t.swimlanes[a.index];else o={index:a.index,label:a.label,r:0,y:a.index*d.swimlaneMinHeight+d.swimlaneGap,height:d.swimlaneMinHeight,maxHeight:d.swimlaneMinHeight};let s=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,l=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,c={width:Math.max(d.boxMinWidth,Math.min(d.boxMaxWidth,i.dimension.width))+2*d.boxPadding,height:Math.max(d.boxMinHeight,Math.min(d.boxMaxHeight,i.dimension.height))+2*d.boxPadding},x=ne(o,l,s),f=x+c.width+d.boxPadding,h=ie(Object.values(t.swimlanes),f);o.r=x+c.width,o.maxHeight=Math.max(o.maxHeight,c.height),o.height=Math.max(d.swimlaneMinHeight,o.maxHeight)+2*d.swimlanePadding;let g={x,y:d.swimlanePadding+o.y,r:f,dimension:c,leftSibling:!1,swimlane:o,visual:i.visual,text:i.textProps.content,frame:i.frame,index:i.index},v={...t,boxes:[...t.boxes,g],swimlanes:{...t.swimlanes,[`${o.index}`]:o},previousSwimlaneNumber:a.index,previousFrame:i.frame,maxR:h},p=C(v.swimlanes);if(p.length>0)p[0].y=0;for(let b=1;b<p.length;b++){let S=p[b],W=p[b-1];S.y=W.y+W.height+d.swimlaneGap}return v}e(re,"evolveFramePositioned");function ae(t,r){if(t===0&&r.sourceFrames.length===0)return!0;return!1}e(ae,"isFirstFrame");function oe(t){return t.sourceFrames!==void 0&&t.sourceFrames!==null&&t.sourceFrames.length>0}e(oe,"hasSourceFrame");function E(t,r){if(r===void 0||r===null)return;return t.find((i)=>i.frame.name===r.name)}e(E,"findBoxByFrame");function de(t,r,i){if(i<0)return;for(let a=i;a>=0;a--){let o=t[a];if(o.swimlane.index!==r)return o}return}e(de,"findBoxByLineIndex");function le(t,r){let i=r;if(ae(i.index,i.frame))return[];let a=E(t.boxes,i.frame);if(a===void 0)throw Error(`Target box not found for frame ${i.frame.name}`);let o;if(i.sourceFrame)o=E(t.boxes,i.sourceFrame);else{if(ka(i.frame))return[];o=de(t.boxes,a.swimlane.index,i.index-1)}if(o===void 0)return[];return[{$kind:_,frame:i.frame,index:i.index,sourceBox:o,targetBox:a}]}e(le,"decidePositionRelation");function ce(t,r){let i=r,a={visual:{fill:"none",stroke:"#000"},source:{x:i.sourceBox.x,y:i.sourceBox.y},target:{x:i.targetBox.x,y:i.targetBox.y},sourceBox:i.sourceBox,targetBox:i.targetBox};return{...t,relations:[...t.relations,a]}}e(ce,"evolveRelationPositioned");var Se={[H]:te,[B]:le},Me={[U]:re,[_]:ce};function me(t,r){let i=Se[r.$kind];if(i===void 0||i===null)return[];let a=i(t,r);return n.debug("decided events",a),a}e(me,"decide");function ue(t,r){let i=r.reduce((a,o)=>{let s=Me[o.$kind];if(s===void 0||s===null)return a;return s(a,o)},t);return n.debug("evolve events",{state:t,newState:i,events:r}),i}e(ue,"evolve");function y(t,r){let i=me(t,r);return ue(t,i)}e(y,"dispatch");var N={getConfig:ye,preserveCommentsWhenParsing:!0,setOptions:pe,getOptions:ve,clear:be,setAccTitle:L,getAccTitle:I,getAccDescription:M,setAccDescription:R,setDiagramTitle:O,getDiagramTitle:D,setAst:X,getDiagramProps:T,getState:V},ke={parse:e(async(t)=>{let r=await se("eventmodeling",t);n.debug(r),N.setAst(r),ee(r,N)},"parse")},Fe=u(),Be=Fe?.eventmodeling;function xe(t,r){return(i)=>{let a=i.swimlane.y+r.swimlanePadding,o=t.append("g").attr("class","em-box");o.append("rect").attr("x",i.x).attr("y",a).attr("rx","3").attr("width",i.dimension.width).attr("height",i.dimension.height).attr("stroke",i.visual.stroke).attr("fill",i.visual.fill),o.append("foreignObject").attr("x",i.x+r.boxPadding).attr("y",a+10).attr("width",i.dimension.width-2*r.boxPadding).attr("height",i.dimension.height-2*r.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(i.text)}}e(xe,"renderD3Box");function fe(t,r){return t>r}e(fe,"dirUpwards");function ge(t,r,i,a){return(o)=>{let s=o.sourceBox.swimlane.y+r.swimlanePadding,l=o.targetBox.swimlane.y+r.swimlanePadding,c=fe(s,l),x=o.sourceBox.x+o.sourceBox.dimension.width*2/3,f=o.targetBox.x+o.targetBox.dimension.width/3,h,g;if(n.debug(`rendering relation up=${c} for `,{sourceBox:o.sourceBox,targetBox:o.targetBox}),c)h=s,g=l+o.targetBox.dimension.height;else h=s+o.sourceBox.dimension.height,g=l;let v=a.emRelationStroke??o.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",o.visual.fill).attr("stroke",v).attr("stroke-width","1").attr("marker-end",`url(#${i})`).attr("d",`M${x} ${h} L${f} ${g}`)}}e(ge,"renderD3Relation");function he(t,r,i,a){return(o)=>{let s=t.append("g").attr("class","em-swimlane"),l=a.emSwimlaneBackgroundOdd??"rgb(250,250,250)",c=a.emSwimlaneBackgroundStroke??"rgb(240,240,240)";s.append("rect").attr("x",0).attr("y",o.y).attr("rx","3").attr("width",r+i.swimlanePadding).attr("height",o.height).attr("fill",l).attr("stroke",c),s.append("text").attr("font-weight",i.swimlaneTextFontWeight).attr("x",30).attr("y",o.y+30).text(o.label)}}e(he,"renderD3Swimlane");var Ee=e(function(t,r,i,a){if(n.debug("in eventmodeling renderer",t+`
|
|
3
3
|
`,"id:",r,i),!Be)throw Error("EventModeling config not found");let o=a.db,{themeVariables:s,eventmodeling:l}=u(),c=m(`[id="${r}"]`),x=o.getDiagramProps(),f=o.getState(),h=`em-arrowhead-${r}`,g=s.emArrowhead??"#000000";f.sortedSwimlanesArray.forEach(he(c,f.maxR,x,s)),f.boxes.forEach(xe(c,x)),f.relations.forEach(ge(c,x,h,s)),c.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",g),ra(void 0,c,l?.padding??30,l?.useMaxWidth)},"draw"),Ae={draw:Ee},$e=e((t)=>"","getStyles"),Re=$e,Ue={parser:ke,db:N,renderer:Ae,styles:Re};export{Ue as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,n,Me,F,k,j,A,L,I,R,M,O,D,m,Y,Ra,C,K}from"./index.fgsp5qqn.js";import{ee}from"./index.yf0h5qnv.js";import{se}from"./index.9zhger75.js";import{Er,It}from"./index.cf9nd6xy.js";import{ge}from"./index.h6120080.js";function Fe(t){var a=0,l=t.children,i=l&&l.length;if(!i)a=1;else while(--i>=0)a+=l[i].value;t.value=a}function Re(){return this.eachAfter(Fe)}function De(t,a){let l=-1;for(let i of this)t.call(a,i,++l,this);return this}function Pe(t,a){var l=this,i=[l],s,c,h=-1;while(l=i.pop())if(t.call(a,l,++h,this),s=l.children)for(c=s.length-1;c>=0;--c)i.push(s[c]);return this}function Ve(t,a){var l=this,i=[l],s=[],c,h,d,y=-1;while(l=i.pop())if(s.push(l),c=l.children)for(h=0,d=c.length;h<d;++h)i.push(c[h]);while(l=s.pop())t.call(a,l,++y,this);return this}function Ee(t,a){let l=-1;for(let i of this)if(t.call(a,i,++l,this))return i}function Ie(t){return this.eachAfter(function(a){var l=+t(a.data)||0,i=a.children,s=i&&i.length;while(--s>=0)l+=i[s].value;a.value=l})}function We(t){return this.eachBefore(function(a){if(a.children)a.children.sort(t)})}function Be(t){var a=this,l=He(a,t),i=[a];while(a!==l)a=a.parent,i.push(a);var s=i.length;while(t!==l)i.splice(s,0,t),t=t.parent;return i}function He(t,a){if(t===a)return t;var l=t.ancestors(),i=a.ancestors(),s=null;t=l.pop(),a=i.pop();while(t===a)s=t,t=l.pop(),a=i.pop();return s}function qe(){var t=this,a=[t];while(t=t.parent)a.push(t);return a}function Oe(){return Array.from(this)}function Ge(){var t=[];return this.eachBefore(function(a){if(!a.children)t.push(a)}),t}function Xe(){var t=this,a=[];return t.each(function(l){if(l!==t)a.push({source:l.parent,target:l})}),a}function*Ye(){var t=this,a,l=[t],i,s,c;do{a=l.reverse(),l=[];while(t=a.pop())if(yield t,i=t.children)for(s=0,c=i.length;s<c;++s)l.push(i[s])}while(l.length)}function fe(t,a){if(t instanceof Map){if(t=[void 0,t],a===void 0)a=Ue}else if(a===void 0)a=Ke;var l=new le(t),i,s=[l],c,h,d,y;while(i=s.pop())if((h=a(i.data))&&(y=(h=Array.from(h)).length)){i.children=h;for(d=y-1;d>=0;--d)s.push(c=h[d]=new le(h[d])),c.parent=i,c.depth=i.depth+1}return l.eachBefore(Je)}function je(){return fe(this).eachBefore(Ze)}function Ke(t){return t.children}function Ue(t){return Array.isArray(t)?t[1]:null}function Ze(t){if(t.data.value!==void 0)t.value=t.data.value;t.data=t.data.data}function Je(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function le(t){this.data=t,this.depth=this.height=0,this.parent=null}le.prototype=fe.prototype={constructor:le,count:Re,each:De,eachAfter:Ve,eachBefore:Pe,find:Ee,sum:Ie,sort:We,path:Be,ancestors:qe,descendants:Oe,leaves:Ge,links:Xe,copy:je,[Symbol.iterator]:Ye};function Qe(t){if(typeof t!=="function")throw Error();return t}function ae(){return 0}function ie(t){return function(){return t}}function et(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Se(t,a,l,i,s){var c=t.children,h,d=-1,y=c.length,u=t.value&&(i-a)/t.value;while(++d<y)h=c[d],h.y0=l,h.y1=s,h.x0=a,h.x1=a+=h.value*u}function tt(t,a){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=a}tt.prototype=Object.create(le.prototype);function ve(t,a,l,i,s){var c=t.children,h,d=-1,y=c.length,u=t.value&&(s-l)/t.value;while(++d<y)h=c[d],h.x0=a,h.x1=i,h.y0=l,h.y1=l+=h.value*u}var we=(1+Math.sqrt(5))/2;function be(t,a,l,i,s,c){var h=[],d=a.children,y,u,p=0,w=0,o=d.length,b,_,S=a.value,g,T,H,W,Z,ne,q;while(p<o){b=s-l,_=c-i;do g=d[w++].value;while(!g&&w<o);T=H=g,ne=Math.max(_/b,b/_)/(S*t),q=g*g*ne,Z=Math.max(H/q,q/T);for(;w<o;++w){if(g+=u=d[w].value,u<T)T=u;if(u>H)H=u;if(q=g*g*ne,W=Math.max(H/q,q/T),W>Z){g-=u;break}Z=W}if(h.push(y={value:g,dice:b<_,children:d.slice(p,w)}),y.dice)Se(y,l,i,s,S?i+=_*g/S:c);else ve(y,l,i,S?l+=b*g/S:s,c);S-=g,p=w}return h}var nt=function t(a){function l(i,s,c,h,d){be(a,i,s,c,h,d)}return l.ratio=function(i){return t((i=+i)>1?i:1)},l}(we);function Ce(){var t=nt,a=!1,l=1,i=1,s=[0],c=ae,h=ae,d=ae,y=ae,u=ae;function p(o){if(o.x0=o.y0=0,o.x1=l,o.y1=i,o.eachBefore(w),s=[0],a)o.eachBefore(et);return o}function w(o){var b=s[o.depth],_=o.x0+b,S=o.y0+b,g=o.x1-b,T=o.y1-b;if(g<_)_=g=(_+g)/2;if(T<S)S=T=(S+T)/2;if(o.x0=_,o.y0=S,o.x1=g,o.y1=T,o.children){if(b=s[o.depth+1]=c(o)/2,_+=u(o)-b,S+=h(o)-b,g-=d(o)-b,T-=y(o)-b,g<_)_=g=(_+g)/2;if(T<S)S=T=(S+T)/2;t(o,_,S,g,T)}}return p.round=function(o){return arguments.length?(a=!!o,p):a},p.size=function(o){return arguments.length?(l=+o[0],i=+o[1],p):[l,i]},p.tile=function(o){return arguments.length?(t=Qe(o),p):t},p.padding=function(o){return arguments.length?p.paddingInner(o).paddingOuter(o):p.paddingInner()},p.paddingInner=function(o){return arguments.length?(c=typeof o==="function"?o:ie(+o),p):c},p.paddingOuter=function(o){return arguments.length?p.paddingTop(o).paddingRight(o).paddingBottom(o).paddingLeft(o):p.paddingTop()},p.paddingTop=function(o){return arguments.length?(h=typeof o==="function"?o:ie(+o),p):h},p.paddingRight=function(o){return arguments.length?(d=typeof o==="function"?o:ie(+o),p):d},p.paddingBottom=function(o){return arguments.length?(y=typeof o==="function"?o:ie(+o),p):y},p.paddingLeft=function(o){return arguments.length?(u=typeof o==="function"?o:ie(+o),p):u},p}var dt=function t(a){function l(i,s,c,h,d){if((y=i._squarify)&&y.ratio===a){var y,u,p,w,o=-1,b,_=y.length,S=i.value;while(++o<_){u=y[o],p=u.children;for(w=u.value=0,b=p.length;w<b;++w)u.value+=p[w].value;if(u.dice)Se(u,s,c,h,S?c+=(d-c)*u.value/S:d);else ve(u,s,c,S?s+=(h-s)*u.value/S:h,d);S-=u.value}}else i._squarify=y=be(a,i,s,c,h,d),y.ratio=a}return l.ratio=function(i){return t((i=+i)>1?i:1)},l}(we);var _e=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=L,this.getAccTitle=I,this.setDiagramTitle=O,this.getDiagramTitle=D,this.getAccDescription=M,this.setAccDescription=R}static{e(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let t=F,a=k();return K({...t.treemap,...a.treemap??{}})}addNode(t,a){if(this.nodes.push(t),this.levels.set(t,a),a===0)this.outerNodes.push(t),this.root??=t}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,a){let l=this.classes.get(t)??{id:t,styles:[],textStyles:[]},i=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");if(i)i.forEach((s)=>{if(Ra(s))if(l?.textStyles)l.textStyles.push(s);else l.textStyles=[s];if(l?.styles)l.styles.push(s);else l.styles=[s]});this.classes.set(t,l)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){A(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Te(t){if(!t.length)return[];let a=[],l=[];return t.forEach((i)=>{let s={name:i.name,children:i.type==="Leaf"?void 0:[]};if(s.classSelector=i?.classSelector,i?.cssCompiledStyles)s.cssCompiledStyles=i.cssCompiledStyles;if(i.type==="Leaf"&&i.value!==void 0)s.value=i.value;while(l.length>0&&l[l.length-1].level>=i.level)l.pop();if(l.length===0)a.push(s);else{let c=l[l.length-1].node;if(c.children)c.children.push(s);else c.children=[s]}if(i.type!=="Leaf")l.push({node:s,level:i.level})}),a}e(Te,"buildHierarchy");var rt=e((t,a)=>{ee(t,a);let l=[];for(let c of t.TreemapRows??[])if(c.$type==="ClassDefStatement")a.addClass(c.className??"",c.styleText??"");for(let c of t.TreemapRows??[]){let h=c.item;if(!h)continue;let d=c.indent?parseInt(c.indent):0,y=at(h),u=h.classSelector?a.getStylesForClass(h.classSelector):[],p=u.length>0?u:void 0,w={level:d,name:y,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(w)}let i=Te(l),s=e((c,h)=>{for(let d of c)if(a.addNode(d,h),d.children&&d.children.length>0)s(d.children,h+1)},"addNodesRecursively");s(i,0)},"populate"),at=e((t)=>t.name?String(t.name):"","getItemName"),ze={parser:{yy:void 0},parse:e(async(t)=>{try{let l=await se("treemap",t);n.debug("Treemap AST:",l);let i=ze.parser?.yy;if(!(i instanceof _e))throw Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(l,i)}catch(a){throw n.error("Error parsing treemap:",a),a}},"parse")},it=10,te=10,oe=25,lt=e((t,a,l,i)=>{let s=i.db,c=s.getConfig(),h=c.padding??it,d=s.getDiagramTitle(),y=s.getRoot(),{themeVariables:u}=k();if(!y)return;let p=d?30:0,w=Y(a),o=c.nodeWidth?c.nodeWidth*te:960,b=c.nodeHeight?c.nodeHeight*te:500,_=o,S=b+p;w.attr("viewBox",`0 0 ${_} ${S}`),j(w,S,_,c.useMaxWidth);let g;try{let r=c.valueFormat||",";if(r==="$0,0")g=e((f)=>"$"+Er(",")(f),"valueFormat");else if(r.startsWith("$")&&r.includes(",")){let f=/\.\d+/.exec(r),x=f?f[0]:"";g=e((z)=>"$"+Er(","+x)(z),"valueFormat")}else if(r.startsWith("$")){let f=r.substring(1);g=e((x)=>"$"+Er(f||"")(x),"valueFormat")}else g=Er(r)}catch(r){n.error("Error creating format function:",r),g=Er(",")}let T=It().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),H=It().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),W=It().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);if(d)w.append("text").attr("x",_/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);let Z=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),ne=fe(y).sum((r)=>r.value??0).sort((r,f)=>(f.value??0)-(r.value??0)),pe=Ce().size([o,b]).paddingTop((r)=>r.children&&r.children.length>0?oe+te:0).paddingInner(h).paddingLeft((r)=>r.children&&r.children.length>0?te:0).paddingRight((r)=>r.children&&r.children.length>0?te:0).paddingBottom((r)=>r.children&&r.children.length>0?te:0).round(!0)(ne),Ae=pe.descendants().filter((r)=>r.children&&r.children.length>0),re=Z.selectAll(".treemapSection").data(Ae).enter().append("g").attr("class","treemapSection").attr("transform",(r)=>`translate(${r.x0},${r.y0})`);if(re.append("rect").attr("width",(r)=>r.x1-r.x0).attr("height",oe).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",0.6).attr("stroke-width",0.6).attr("style",(r)=>{if(r.depth===0)return"display: none;";return""}),re.append("clipPath").attr("id",(r,f)=>`clip-section-${a}-${f}`).append("rect").attr("width",(r)=>Math.max(0,r.x1-r.x0-12)).attr("height",oe),re.append("rect").attr("width",(r)=>r.x1-r.x0).attr("height",(r)=>r.y1-r.y0).attr("class",(r,f)=>`treemapSection section${f}`).attr("fill",(r)=>T(r.data.name)).attr("fill-opacity",0.6).attr("stroke",(r)=>H(r.data.name)).attr("stroke-width",2).attr("stroke-opacity",0.4).attr("style",(r)=>{if(r.depth===0)return"display: none;";let f=C({cssCompiledStyles:r.data.cssCompiledStyles});return f.nodeStyles+";"+f.borderStyles.join(";")}),re.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",oe/2).attr("dominant-baseline","middle").text((r)=>r.depth===0?"":r.data.name).attr("font-weight","bold").attr("clip-path",(r,f)=>`url(#clip-section-${a}-${f})`).attr("style",(r)=>{if(r.depth===0)return"display: none;";let f="dominant-baseline: middle; font-size: 12px; fill:"+W(r.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",x=C({cssCompiledStyles:r.data.cssCompiledStyles});return f+x.labelStyles.replace("color:","fill:")}).each(function(r){if(r.depth===0)return;let f=m(this),x=r.data.name;f.text(x);let z=r.x1-r.x0,P=6,N;if(c.showValues!==!1&&r.value){let E=z-10,U=30,ke=10;N=E-30-10-P}else N=z-P-6;let v=Math.max(15,N),X=f.node();if(X.getComputedTextLength()>v){let U=x;while(U.length>0){if(U=x.substring(0,U.length-1),U.length===0){if(f.text("..."),X.getComputedTextLength()>v)f.text("");break}if(f.text(U+"..."),X.getComputedTextLength()<=v)break}}}),c.showValues!==!1)re.append("text").attr("class","treemapSectionValue").attr("x",(r)=>r.x1-r.x0-10).attr("y",oe/2).attr("text-anchor","end").attr("dominant-baseline","middle").text((r)=>r.value?g(r.value):"").attr("font-style","italic").attr("style",(r)=>{if(r.depth===0)return"display: none;";let f="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+W(r.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",x=C({cssCompiledStyles:r.data.cssCompiledStyles});return f+x.labelStyles.replace("color:","fill:")});let me=pe.leaves(),B=me.length>20,Le=B?16:38,ce=B?14:28,J=B?4:8,Q=B?4:6,he=B?2:4,ye=B?8:10,de=B?1:2,ue=Z.selectAll(".treemapLeafGroup").data(me).enter().append("g").attr("class",(r,f)=>`treemapNode treemapLeafGroup leaf${f}${r.data.classSelector?` ${r.data.classSelector}`:""}x`).attr("transform",(r)=>`translate(${r.x0},${r.y0})`);if(ue.append("rect").attr("width",(r)=>r.x1-r.x0).attr("height",(r)=>r.y1-r.y0).attr("class","treemapLeaf").attr("fill",(r)=>r.parent?T(r.parent.data.name):T(r.data.name)).attr("style",(r)=>C({cssCompiledStyles:r.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",0.3).attr("stroke",(r)=>r.parent?T(r.parent.data.name):T(r.data.name)).attr("stroke-width",3),ue.append("clipPath").attr("id",(r,f)=>`clip-${a}-${f}`).append("rect").attr("width",(r)=>Math.max(0,r.x1-r.x0-4)).attr("height",(r)=>Math.max(0,r.y1-r.y0-4)),ue.append("text").attr("class","treemapLabel").attr("x",(r)=>(r.x1-r.x0)/2).attr("y",(r)=>(r.y1-r.y0)/2).attr("style",(r)=>{let f=`text-anchor: middle; dominant-baseline: middle; font-size: ${Le}px;fill:`+W(r.data.name)+";",x=C({cssCompiledStyles:r.data.cssCompiledStyles});return f+x.labelStyles.replace("color:","fill:")}).attr("clip-path",(r,f)=>`url(#clip-${a}-${f})`).text((r)=>r.data.name).each(function(r){let f=m(this),x=r.x1-r.x0,z=r.y1-r.y0,P=f.node(),N=x-2*he,G=z-2*he;if(N<ye||G<ye){f.style("display","none");return}let v=parseInt(f.style("font-size"),10),X=0.6;while(P.getComputedTextLength()>N&&v>J)v--,f.style("font-size",`${v}px`);let V=Math.max(Q,Math.min(ce,Math.round(v*X))),E=v+de+V;while(E>G&&v>J){if(v--,V=Math.max(Q,Math.min(ce,Math.round(v*X))),V<Q&&v===J)break;if(f.style("font-size",`${v}px`),E=v+de+V,V<=Q&&E>G);}if(f.style("font-size",`${v}px`),B){if(v<J||G<J)f.style("display","none")}else if(P.getComputedTextLength()>N||v<J||G<v)f.style("display","none")}),c.showValues!==!1)ue.append("text").attr("class","treemapValue").attr("x",(f)=>(f.x1-f.x0)/2).attr("y",function(f){return(f.y1-f.y0)/2}).attr("style",(f)=>{let x=`text-anchor: middle; dominant-baseline: hanging; font-size: ${ce}px;fill:`+W(f.data.name)+";",z=C({cssCompiledStyles:f.data.cssCompiledStyles});return x+z.labelStyles.replace("color:","fill:")}).attr("clip-path",(f,x)=>`url(#clip-${a}-${x})`).text((f)=>f.value?g(f.value):"").each(function(f){let x=m(this),z=this.parentNode;if(!z){x.style("display","none");return}let P=m(z).select(".treemapLabel");if(P.empty()||P.style("display")==="none"){x.style("display","none");return}let N=parseFloat(P.style("font-size")),v=Math.max(Q,Math.min(ce,Math.round(N*0.6)));x.style("font-size",`${v}px`);let V=(f.y1-f.y0)/2+N/2+de;x.attr("y",V);let E=f.x1-f.x0,xe=f.y1-f.y0-4,Ne=E-2*he;if(x.node().getComputedTextLength()>Ne||V+v>xe||v<Q)x.style("display","none");else x.style("display",null)});let $e=c.diagramPadding??8;ge(w,$e,"flowchart",c?.useMaxWidth||!1)},"draw"),st=e(function(t,a){return a.db.getClasses()},"getClasses"),ot={draw:lt,getClasses:st},ct={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ut=e(({treemap:t}={})=>{let a=Me(),l=k(),i=K(a,l.themeVariables),s=K(ct,t),c=s.titleColor??i.titleColor,h=s.labelColor??i.textColor,d=s.valueColor??i.textColor;return`
|
|
1
|
+
import{e,n,Me,F,k,j,A,L,I,R,M,O,D,m,Y,Ra,C,K}from"./index.mjfjqm0b.js";import{ee}from"./index.btq862bx.js";import{se}from"./index.yd3167gn.js";import{Er,It}from"./index.cf9nd6xy.js";import{ge}from"./index.ybmxf4mt.js";function Fe(t){var a=0,l=t.children,i=l&&l.length;if(!i)a=1;else while(--i>=0)a+=l[i].value;t.value=a}function Re(){return this.eachAfter(Fe)}function De(t,a){let l=-1;for(let i of this)t.call(a,i,++l,this);return this}function Pe(t,a){var l=this,i=[l],s,c,h=-1;while(l=i.pop())if(t.call(a,l,++h,this),s=l.children)for(c=s.length-1;c>=0;--c)i.push(s[c]);return this}function Ve(t,a){var l=this,i=[l],s=[],c,h,d,y=-1;while(l=i.pop())if(s.push(l),c=l.children)for(h=0,d=c.length;h<d;++h)i.push(c[h]);while(l=s.pop())t.call(a,l,++y,this);return this}function Ee(t,a){let l=-1;for(let i of this)if(t.call(a,i,++l,this))return i}function Ie(t){return this.eachAfter(function(a){var l=+t(a.data)||0,i=a.children,s=i&&i.length;while(--s>=0)l+=i[s].value;a.value=l})}function We(t){return this.eachBefore(function(a){if(a.children)a.children.sort(t)})}function Be(t){var a=this,l=He(a,t),i=[a];while(a!==l)a=a.parent,i.push(a);var s=i.length;while(t!==l)i.splice(s,0,t),t=t.parent;return i}function He(t,a){if(t===a)return t;var l=t.ancestors(),i=a.ancestors(),s=null;t=l.pop(),a=i.pop();while(t===a)s=t,t=l.pop(),a=i.pop();return s}function qe(){var t=this,a=[t];while(t=t.parent)a.push(t);return a}function Oe(){return Array.from(this)}function Ge(){var t=[];return this.eachBefore(function(a){if(!a.children)t.push(a)}),t}function Xe(){var t=this,a=[];return t.each(function(l){if(l!==t)a.push({source:l.parent,target:l})}),a}function*Ye(){var t=this,a,l=[t],i,s,c;do{a=l.reverse(),l=[];while(t=a.pop())if(yield t,i=t.children)for(s=0,c=i.length;s<c;++s)l.push(i[s])}while(l.length)}function fe(t,a){if(t instanceof Map){if(t=[void 0,t],a===void 0)a=Ue}else if(a===void 0)a=Ke;var l=new le(t),i,s=[l],c,h,d,y;while(i=s.pop())if((h=a(i.data))&&(y=(h=Array.from(h)).length)){i.children=h;for(d=y-1;d>=0;--d)s.push(c=h[d]=new le(h[d])),c.parent=i,c.depth=i.depth+1}return l.eachBefore(Je)}function je(){return fe(this).eachBefore(Ze)}function Ke(t){return t.children}function Ue(t){return Array.isArray(t)?t[1]:null}function Ze(t){if(t.data.value!==void 0)t.value=t.data.value;t.data=t.data.data}function Je(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function le(t){this.data=t,this.depth=this.height=0,this.parent=null}le.prototype=fe.prototype={constructor:le,count:Re,each:De,eachAfter:Ve,eachBefore:Pe,find:Ee,sum:Ie,sort:We,path:Be,ancestors:qe,descendants:Oe,leaves:Ge,links:Xe,copy:je,[Symbol.iterator]:Ye};function Qe(t){if(typeof t!=="function")throw Error();return t}function ae(){return 0}function ie(t){return function(){return t}}function et(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Se(t,a,l,i,s){var c=t.children,h,d=-1,y=c.length,u=t.value&&(i-a)/t.value;while(++d<y)h=c[d],h.y0=l,h.y1=s,h.x0=a,h.x1=a+=h.value*u}function tt(t,a){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=a}tt.prototype=Object.create(le.prototype);function ve(t,a,l,i,s){var c=t.children,h,d=-1,y=c.length,u=t.value&&(s-l)/t.value;while(++d<y)h=c[d],h.x0=a,h.x1=i,h.y0=l,h.y1=l+=h.value*u}var we=(1+Math.sqrt(5))/2;function be(t,a,l,i,s,c){var h=[],d=a.children,y,u,p=0,w=0,o=d.length,b,_,S=a.value,g,T,H,W,Z,ne,q;while(p<o){b=s-l,_=c-i;do g=d[w++].value;while(!g&&w<o);T=H=g,ne=Math.max(_/b,b/_)/(S*t),q=g*g*ne,Z=Math.max(H/q,q/T);for(;w<o;++w){if(g+=u=d[w].value,u<T)T=u;if(u>H)H=u;if(q=g*g*ne,W=Math.max(H/q,q/T),W>Z){g-=u;break}Z=W}if(h.push(y={value:g,dice:b<_,children:d.slice(p,w)}),y.dice)Se(y,l,i,s,S?i+=_*g/S:c);else ve(y,l,i,S?l+=b*g/S:s,c);S-=g,p=w}return h}var nt=function t(a){function l(i,s,c,h,d){be(a,i,s,c,h,d)}return l.ratio=function(i){return t((i=+i)>1?i:1)},l}(we);function Ce(){var t=nt,a=!1,l=1,i=1,s=[0],c=ae,h=ae,d=ae,y=ae,u=ae;function p(o){if(o.x0=o.y0=0,o.x1=l,o.y1=i,o.eachBefore(w),s=[0],a)o.eachBefore(et);return o}function w(o){var b=s[o.depth],_=o.x0+b,S=o.y0+b,g=o.x1-b,T=o.y1-b;if(g<_)_=g=(_+g)/2;if(T<S)S=T=(S+T)/2;if(o.x0=_,o.y0=S,o.x1=g,o.y1=T,o.children){if(b=s[o.depth+1]=c(o)/2,_+=u(o)-b,S+=h(o)-b,g-=d(o)-b,T-=y(o)-b,g<_)_=g=(_+g)/2;if(T<S)S=T=(S+T)/2;t(o,_,S,g,T)}}return p.round=function(o){return arguments.length?(a=!!o,p):a},p.size=function(o){return arguments.length?(l=+o[0],i=+o[1],p):[l,i]},p.tile=function(o){return arguments.length?(t=Qe(o),p):t},p.padding=function(o){return arguments.length?p.paddingInner(o).paddingOuter(o):p.paddingInner()},p.paddingInner=function(o){return arguments.length?(c=typeof o==="function"?o:ie(+o),p):c},p.paddingOuter=function(o){return arguments.length?p.paddingTop(o).paddingRight(o).paddingBottom(o).paddingLeft(o):p.paddingTop()},p.paddingTop=function(o){return arguments.length?(h=typeof o==="function"?o:ie(+o),p):h},p.paddingRight=function(o){return arguments.length?(d=typeof o==="function"?o:ie(+o),p):d},p.paddingBottom=function(o){return arguments.length?(y=typeof o==="function"?o:ie(+o),p):y},p.paddingLeft=function(o){return arguments.length?(u=typeof o==="function"?o:ie(+o),p):u},p}var dt=function t(a){function l(i,s,c,h,d){if((y=i._squarify)&&y.ratio===a){var y,u,p,w,o=-1,b,_=y.length,S=i.value;while(++o<_){u=y[o],p=u.children;for(w=u.value=0,b=p.length;w<b;++w)u.value+=p[w].value;if(u.dice)Se(u,s,c,h,S?c+=(d-c)*u.value/S:d);else ve(u,s,c,S?s+=(h-s)*u.value/S:h,d);S-=u.value}}else i._squarify=y=be(a,i,s,c,h,d),y.ratio=a}return l.ratio=function(i){return t((i=+i)>1?i:1)},l}(we);var _e=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=L,this.getAccTitle=I,this.setDiagramTitle=O,this.getDiagramTitle=D,this.getAccDescription=M,this.setAccDescription=R}static{e(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let t=F,a=k();return K({...t.treemap,...a.treemap??{}})}addNode(t,a){if(this.nodes.push(t),this.levels.set(t,a),a===0)this.outerNodes.push(t),this.root??=t}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,a){let l=this.classes.get(t)??{id:t,styles:[],textStyles:[]},i=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");if(i)i.forEach((s)=>{if(Ra(s))if(l?.textStyles)l.textStyles.push(s);else l.textStyles=[s];if(l?.styles)l.styles.push(s);else l.styles=[s]});this.classes.set(t,l)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){A(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Te(t){if(!t.length)return[];let a=[],l=[];return t.forEach((i)=>{let s={name:i.name,children:i.type==="Leaf"?void 0:[]};if(s.classSelector=i?.classSelector,i?.cssCompiledStyles)s.cssCompiledStyles=i.cssCompiledStyles;if(i.type==="Leaf"&&i.value!==void 0)s.value=i.value;while(l.length>0&&l[l.length-1].level>=i.level)l.pop();if(l.length===0)a.push(s);else{let c=l[l.length-1].node;if(c.children)c.children.push(s);else c.children=[s]}if(i.type!=="Leaf")l.push({node:s,level:i.level})}),a}e(Te,"buildHierarchy");var rt=e((t,a)=>{ee(t,a);let l=[];for(let c of t.TreemapRows??[])if(c.$type==="ClassDefStatement")a.addClass(c.className??"",c.styleText??"");for(let c of t.TreemapRows??[]){let h=c.item;if(!h)continue;let d=c.indent?parseInt(c.indent):0,y=at(h),u=h.classSelector?a.getStylesForClass(h.classSelector):[],p=u.length>0?u:void 0,w={level:d,name:y,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(w)}let i=Te(l),s=e((c,h)=>{for(let d of c)if(a.addNode(d,h),d.children&&d.children.length>0)s(d.children,h+1)},"addNodesRecursively");s(i,0)},"populate"),at=e((t)=>t.name?String(t.name):"","getItemName"),ze={parser:{yy:void 0},parse:e(async(t)=>{try{let l=await se("treemap",t);n.debug("Treemap AST:",l);let i=ze.parser?.yy;if(!(i instanceof _e))throw Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(l,i)}catch(a){throw n.error("Error parsing treemap:",a),a}},"parse")},it=10,te=10,oe=25,lt=e((t,a,l,i)=>{let s=i.db,c=s.getConfig(),h=c.padding??it,d=s.getDiagramTitle(),y=s.getRoot(),{themeVariables:u}=k();if(!y)return;let p=d?30:0,w=Y(a),o=c.nodeWidth?c.nodeWidth*te:960,b=c.nodeHeight?c.nodeHeight*te:500,_=o,S=b+p;w.attr("viewBox",`0 0 ${_} ${S}`),j(w,S,_,c.useMaxWidth);let g;try{let r=c.valueFormat||",";if(r==="$0,0")g=e((f)=>"$"+Er(",")(f),"valueFormat");else if(r.startsWith("$")&&r.includes(",")){let f=/\.\d+/.exec(r),x=f?f[0]:"";g=e((z)=>"$"+Er(","+x)(z),"valueFormat")}else if(r.startsWith("$")){let f=r.substring(1);g=e((x)=>"$"+Er(f||"")(x),"valueFormat")}else g=Er(r)}catch(r){n.error("Error creating format function:",r),g=Er(",")}let T=It().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),H=It().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),W=It().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);if(d)w.append("text").attr("x",_/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);let Z=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),ne=fe(y).sum((r)=>r.value??0).sort((r,f)=>(f.value??0)-(r.value??0)),pe=Ce().size([o,b]).paddingTop((r)=>r.children&&r.children.length>0?oe+te:0).paddingInner(h).paddingLeft((r)=>r.children&&r.children.length>0?te:0).paddingRight((r)=>r.children&&r.children.length>0?te:0).paddingBottom((r)=>r.children&&r.children.length>0?te:0).round(!0)(ne),Ae=pe.descendants().filter((r)=>r.children&&r.children.length>0),re=Z.selectAll(".treemapSection").data(Ae).enter().append("g").attr("class","treemapSection").attr("transform",(r)=>`translate(${r.x0},${r.y0})`);if(re.append("rect").attr("width",(r)=>r.x1-r.x0).attr("height",oe).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",0.6).attr("stroke-width",0.6).attr("style",(r)=>{if(r.depth===0)return"display: none;";return""}),re.append("clipPath").attr("id",(r,f)=>`clip-section-${a}-${f}`).append("rect").attr("width",(r)=>Math.max(0,r.x1-r.x0-12)).attr("height",oe),re.append("rect").attr("width",(r)=>r.x1-r.x0).attr("height",(r)=>r.y1-r.y0).attr("class",(r,f)=>`treemapSection section${f}`).attr("fill",(r)=>T(r.data.name)).attr("fill-opacity",0.6).attr("stroke",(r)=>H(r.data.name)).attr("stroke-width",2).attr("stroke-opacity",0.4).attr("style",(r)=>{if(r.depth===0)return"display: none;";let f=C({cssCompiledStyles:r.data.cssCompiledStyles});return f.nodeStyles+";"+f.borderStyles.join(";")}),re.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",oe/2).attr("dominant-baseline","middle").text((r)=>r.depth===0?"":r.data.name).attr("font-weight","bold").attr("clip-path",(r,f)=>`url(#clip-section-${a}-${f})`).attr("style",(r)=>{if(r.depth===0)return"display: none;";let f="dominant-baseline: middle; font-size: 12px; fill:"+W(r.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",x=C({cssCompiledStyles:r.data.cssCompiledStyles});return f+x.labelStyles.replace("color:","fill:")}).each(function(r){if(r.depth===0)return;let f=m(this),x=r.data.name;f.text(x);let z=r.x1-r.x0,P=6,N;if(c.showValues!==!1&&r.value){let E=z-10,U=30,ke=10;N=E-30-10-P}else N=z-P-6;let v=Math.max(15,N),X=f.node();if(X.getComputedTextLength()>v){let U=x;while(U.length>0){if(U=x.substring(0,U.length-1),U.length===0){if(f.text("..."),X.getComputedTextLength()>v)f.text("");break}if(f.text(U+"..."),X.getComputedTextLength()<=v)break}}}),c.showValues!==!1)re.append("text").attr("class","treemapSectionValue").attr("x",(r)=>r.x1-r.x0-10).attr("y",oe/2).attr("text-anchor","end").attr("dominant-baseline","middle").text((r)=>r.value?g(r.value):"").attr("font-style","italic").attr("style",(r)=>{if(r.depth===0)return"display: none;";let f="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+W(r.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",x=C({cssCompiledStyles:r.data.cssCompiledStyles});return f+x.labelStyles.replace("color:","fill:")});let me=pe.leaves(),B=me.length>20,Le=B?16:38,ce=B?14:28,J=B?4:8,Q=B?4:6,he=B?2:4,ye=B?8:10,de=B?1:2,ue=Z.selectAll(".treemapLeafGroup").data(me).enter().append("g").attr("class",(r,f)=>`treemapNode treemapLeafGroup leaf${f}${r.data.classSelector?` ${r.data.classSelector}`:""}x`).attr("transform",(r)=>`translate(${r.x0},${r.y0})`);if(ue.append("rect").attr("width",(r)=>r.x1-r.x0).attr("height",(r)=>r.y1-r.y0).attr("class","treemapLeaf").attr("fill",(r)=>r.parent?T(r.parent.data.name):T(r.data.name)).attr("style",(r)=>C({cssCompiledStyles:r.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",0.3).attr("stroke",(r)=>r.parent?T(r.parent.data.name):T(r.data.name)).attr("stroke-width",3),ue.append("clipPath").attr("id",(r,f)=>`clip-${a}-${f}`).append("rect").attr("width",(r)=>Math.max(0,r.x1-r.x0-4)).attr("height",(r)=>Math.max(0,r.y1-r.y0-4)),ue.append("text").attr("class","treemapLabel").attr("x",(r)=>(r.x1-r.x0)/2).attr("y",(r)=>(r.y1-r.y0)/2).attr("style",(r)=>{let f=`text-anchor: middle; dominant-baseline: middle; font-size: ${Le}px;fill:`+W(r.data.name)+";",x=C({cssCompiledStyles:r.data.cssCompiledStyles});return f+x.labelStyles.replace("color:","fill:")}).attr("clip-path",(r,f)=>`url(#clip-${a}-${f})`).text((r)=>r.data.name).each(function(r){let f=m(this),x=r.x1-r.x0,z=r.y1-r.y0,P=f.node(),N=x-2*he,G=z-2*he;if(N<ye||G<ye){f.style("display","none");return}let v=parseInt(f.style("font-size"),10),X=0.6;while(P.getComputedTextLength()>N&&v>J)v--,f.style("font-size",`${v}px`);let V=Math.max(Q,Math.min(ce,Math.round(v*X))),E=v+de+V;while(E>G&&v>J){if(v--,V=Math.max(Q,Math.min(ce,Math.round(v*X))),V<Q&&v===J)break;if(f.style("font-size",`${v}px`),E=v+de+V,V<=Q&&E>G);}if(f.style("font-size",`${v}px`),B){if(v<J||G<J)f.style("display","none")}else if(P.getComputedTextLength()>N||v<J||G<v)f.style("display","none")}),c.showValues!==!1)ue.append("text").attr("class","treemapValue").attr("x",(f)=>(f.x1-f.x0)/2).attr("y",function(f){return(f.y1-f.y0)/2}).attr("style",(f)=>{let x=`text-anchor: middle; dominant-baseline: hanging; font-size: ${ce}px;fill:`+W(f.data.name)+";",z=C({cssCompiledStyles:f.data.cssCompiledStyles});return x+z.labelStyles.replace("color:","fill:")}).attr("clip-path",(f,x)=>`url(#clip-${a}-${x})`).text((f)=>f.value?g(f.value):"").each(function(f){let x=m(this),z=this.parentNode;if(!z){x.style("display","none");return}let P=m(z).select(".treemapLabel");if(P.empty()||P.style("display")==="none"){x.style("display","none");return}let N=parseFloat(P.style("font-size")),v=Math.max(Q,Math.min(ce,Math.round(N*0.6)));x.style("font-size",`${v}px`);let V=(f.y1-f.y0)/2+N/2+de;x.attr("y",V);let E=f.x1-f.x0,xe=f.y1-f.y0-4,Ne=E-2*he;if(x.node().getComputedTextLength()>Ne||V+v>xe||v<Q)x.style("display","none");else x.style("display",null)});let $e=c.diagramPadding??8;ge(w,$e,"flowchart",c?.useMaxWidth||!1)},"draw"),st=e(function(t,a){return a.db.getClasses()},"getClasses"),ot={draw:lt,getClasses:st},ct={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ut=e(({treemap:t}={})=>{let a=Me(),l=k(),i=K(a,l.themeVariables),s=K(ct,t),c=s.titleColor??i.titleColor,h=s.labelColor??i.textColor,d=s.valueColor??i.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${s.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${s.sectionStrokeWidth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e,n}from"./index.
|
|
1
|
+
import{e,n}from"./index.mjfjqm0b.js";import{ce,Gt,Vt}from"./index.psaka010.js";import{ee}from"./index.btq862bx.js";import{Bn,Lt}from"./index.yd3167gn.js";var i=Bn().RailroadEbnf.parser.LangiumParser,o=e((r)=>{let t=r.alternatives.map(m);if(t.length===1)return t[0];return{type:"choice",alternatives:t}},"transformChoice"),m=e((r)=>{let t=r.elements.map(p);if(t.length===1)return t[0];return{type:"sequence",elements:t}},"transformSequence"),s=e((r)=>{switch(r.$type){case"EbnfTerminal":return{type:"terminal",value:r.value};case"EbnfNonTerminal":return{type:"nonterminal",name:r.name};case"EbnfSpecial":return{type:"special",text:r.text};case"EbnfGroup":return o(r.element);case"EbnfOptional":return{type:"optional",element:o(r.element)};case"EbnfRepetition":return{type:"repetition",element:o(r.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${r.$type}`)}},"transformPrimary"),l=e((r,t)=>{switch(t.$type){case"EbnfOptionalPostfix":return{type:"optional",element:r};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:r,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:r,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[r,{type:"terminal",value:"-"},s(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},"transformPostfix"),p=e((r)=>r.postfixes.reduce((t,a)=>l(t,a),s(r.base)),"transformTerm"),f=e((r)=>({name:r.name,definition:o(r.definition)}),"transformRule"),u=e((r)=>{if(ee(r,ce),r.title)ce.setTitle(r.title);r.rules.map((t)=>ce.addRule(f(t)))},"populateDb"),c={parse:e((r)=>{ce.clear(),n.debug("[EBNF Parser] Starting Langium parse");let t=i.parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new Lt(t);let a=t.value;n.debug("[EBNF Parser] Parsed rules:",a.rules.length),u(a),n.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:ce}},x={parser:c,db:ce,renderer:Vt,styles:Gt};export{x as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,a,v,je,_t,fa,ha,pa}from"./index.
|
|
1
|
+
import{r,a,v,je,_t,fa,ha,pa}from"./index.5vcex75v.js";import{V}from"./index.je7pqrtm.js";var d={ctrl:"Ctrl/⌘",shift:"Shift",alt:"Alt",delete:"Delete",esc:"Esc",enter:"Enter",space:"Space"},o="ctrl",t=["←","↑","→","↓"],p=[{id:"general",label:"Editing",items:[{id:"undo",keys:[o,"Z"],label:"Undo"},{id:"redo",keys:[o,"shift","Z"],label:"Redo"},{id:"help",keys:["?"],label:"Show this list"}]},{id:"view",label:"View",items:[{id:"zoom-in",keys:["+"],label:"Zoom in"},{id:"zoom-out",keys:["-"],label:"Zoom out"},{id:"zoom-fit",keys:["0"],label:"Fit to screen"},{id:"zoom-actual",keys:["1"],label:"Actual size"},{id:"compare-hold",keys:["\\"],label:"Hold to show the original"},{id:"zoom-pan",keys:["space"],label:"Hold and drag to pan"}]},{id:"mark",label:"Selected mark",items:[{id:"mark-delete",keys:["delete"],label:"Delete the mark"},{id:"mark-duplicate",keys:[o,"D"],label:"Duplicate the mark"},{id:"mark-nudge",keys:t,label:"Nudge the mark"},{id:"mark-move",keys:["shift",...t],label:"Big nudge (10 px)"},{id:"mark-resize",keys:["alt",...t],label:"Resize the mark"},{id:"mark-rotate",keys:["[","]"],label:"Rotate by 15°"},{id:"mark-drop",keys:["esc"],label:"Deselect"},{id:"mark-constrain",keys:["shift"],label:"Hold while drawing or resizing: keep proportions, or 45° line"},{id:"mark-step",keys:["enter"],label:"Place a step marker (Step tool)"}]},{id:"crop",label:"Crop frame",items:[{id:"crop-move",keys:t,label:"Move the frame"},{id:"crop-resize",keys:["shift",...t],label:"Resize the frame"}]}];function u({title:m}){let{state:n,actions:c}=V(),{t:l}=v();return r(fa,{open:n.shortcutsOpen,onOpenChange:c.setShortcutsOpen,children:a(pa,{"data-slot":"image-editor-shortcuts",className:"max-h-[calc(100dvh-2rem)] gap-4 overflow-y-auto sm:max-w-md",children:[r(ha,{}),r(je,{className:"text-lg/6",children:m}),r(_t,{children:l("material.image-editor.shortcuts.description","Keys work while the image or a panel has focus.")}),p.map((i)=>a("section",{className:"flex flex-col gap-1.5",children:[r("h3",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:l(`material.image-editor.shortcuts.group.${i.id}`,i.label)}),r("dl",{className:"flex flex-col divide-y rounded-lg border",children:i.items.map((s)=>a("div",{className:"flex items-center justify-between gap-3 px-3 py-1.5 text-sm",children:[r("dt",{className:"font-normal",children:l(`material.image-editor.shortcuts.${s.id}`,s.label)}),r("dd",{className:"flex shrink-0 gap-1",children:s.keys.map((e)=>r("kbd",{className:"min-w-6 rounded-md border border-foreground/25 bg-[color-mix(in_oklab,var(--foreground)_14%,var(--card))] px-1.5 py-0.5 text-center font-sans font-medium text-foreground text-xs shadow-[0_1px_0_0_var(--border)]",children:d[e]?l(`material.image-editor.shortcuts.key.${e}`,d[e]):e},e))})]},s.id))})]},i.id))]})})}export{u as default};
|