@dagrejs/dagre 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dagre.min.js CHANGED
@@ -1,3 +1,3 @@
1
- var dagre=(()=>{var kt=Object.defineProperty;var yt=(e,r,t)=>r in e?kt(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var c=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var b=(e,r,t)=>yt(e,typeof r!="symbol"?r+"":r,t);var j=c((Ps,ne)=>{"use strict";var Ot="\0",k="\0",ee="",T=class{constructor(r){b(this,"_isDirected",!0);b(this,"_isMultigraph",!1);b(this,"_isCompound",!1);b(this,"_label");b(this,"_defaultNodeLabelFn",()=>{});b(this,"_defaultEdgeLabelFn",()=>{});b(this,"_nodes",{});b(this,"_in",{});b(this,"_preds",{});b(this,"_out",{});b(this,"_sucs",{});b(this,"_edgeObjs",{});b(this,"_edgeLabels",{});b(this,"_nodeCount",0);b(this,"_edgeCount",0);b(this,"_parent");b(this,"_children");r&&(this._isDirected=Object.hasOwn(r,"directed")?r.directed:!0,this._isMultigraph=Object.hasOwn(r,"multigraph")?r.multigraph:!1,this._isCompound=Object.hasOwn(r,"compound")?r.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[k]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(r){return this._label=r,this}graph(){return this._label}setDefaultNodeLabel(r){return this._defaultNodeLabelFn=r,typeof r!="function"&&(this._defaultNodeLabelFn=()=>r),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var r=this;return this.nodes().filter(t=>Object.keys(r._in[t]).length===0)}sinks(){var r=this;return this.nodes().filter(t=>Object.keys(r._out[t]).length===0)}setNodes(r,t){var n=arguments,i=this;return r.forEach(function(s){n.length>1?i.setNode(s,t):i.setNode(s)}),this}setNode(r,t){return Object.hasOwn(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=t),this):(this._nodes[r]=arguments.length>1?t:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=k,this._children[r]={},this._children[k][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)}node(r){return this._nodes[r]}hasNode(r){return Object.hasOwn(this._nodes,r)}removeNode(r){var t=this;if(Object.hasOwn(this._nodes,r)){var n=i=>t.removeEdge(t._edgeObjs[i]);delete this._nodes[r],this._isCompound&&(this._removeFromParentsChildList(r),delete this._parent[r],this.children(r).forEach(function(i){t.setParent(i)}),delete this._children[r]),Object.keys(this._in[r]).forEach(n),delete this._in[r],delete this._preds[r],Object.keys(this._out[r]).forEach(n),delete this._out[r],delete this._sucs[r],--this._nodeCount}return this}setParent(r,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t=k;else{t+="";for(var n=t;n!==void 0;n=this.parent(n))if(n===r)throw new Error("Setting "+t+" as parent of "+r+" would create a cycle");this.setNode(t)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=t,this._children[t][r]=!0,this}_removeFromParentsChildList(r){delete this._children[this._parent[r]][r]}parent(r){if(this._isCompound){var t=this._parent[r];if(t!==k)return t}}children(r=k){if(this._isCompound){var t=this._children[r];if(t)return Object.keys(t)}else{if(r===k)return this.nodes();if(this.hasNode(r))return[]}}predecessors(r){var t=this._preds[r];if(t)return Object.keys(t)}successors(r){var t=this._sucs[r];if(t)return Object.keys(t)}neighbors(r){var t=this.predecessors(r);if(t){let i=new Set(t);for(var n of this.successors(r))i.add(n);return Array.from(i.values())}}isLeaf(r){var t;return this.isDirected()?t=this.successors(r):t=this.neighbors(r),t.length===0}filterNodes(r){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([a,o]){r(a)&&t.setNode(a,o)}),Object.values(this._edgeObjs).forEach(function(a){t.hasNode(a.v)&&t.hasNode(a.w)&&t.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||t.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&t.nodes().forEach(a=>t.setParent(a,s(a))),t}setDefaultEdgeLabel(r){return this._defaultEdgeLabelFn=r,typeof r!="function"&&(this._defaultEdgeLabelFn=()=>r),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(r,t){var n=this,i=arguments;return r.reduce(function(s,a){return i.length>1?n.setEdge(s,a,t):n.setEdge(s,a),a}),this}setEdge(){var r,t,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(r=a.v,t=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(r=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),r=""+r,t=""+t,n!==void 0&&(n=""+n);var o=x(this._isDirected,r,t,n);if(Object.hasOwn(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(n!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(t),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(r,t,n);var d=xt(this._isDirected,r,t,n);return r=d.v,t=d.w,Object.freeze(d),this._edgeObjs[o]=d,re(this._preds[t],r),re(this._sucs[r],t),this._in[t][o]=d,this._out[r][o]=d,this._edgeCount++,this}edge(r,t,n){var i=arguments.length===1?R(this._isDirected,arguments[0]):x(this._isDirected,r,t,n);return this._edgeLabels[i]}edgeAsObj(){let r=this.edge(...arguments);return typeof r!="object"?{label:r}:r}hasEdge(r,t,n){var i=arguments.length===1?R(this._isDirected,arguments[0]):x(this._isDirected,r,t,n);return Object.hasOwn(this._edgeLabels,i)}removeEdge(r,t,n){var i=arguments.length===1?R(this._isDirected,arguments[0]):x(this._isDirected,r,t,n),s=this._edgeObjs[i];return s&&(r=s.v,t=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],te(this._preds[t],r),te(this._sucs[r],t),delete this._in[t][i],delete this._out[r][i],this._edgeCount--),this}inEdges(r,t){var n=this._in[r];if(n){var i=Object.values(n);return t?i.filter(s=>s.v===t):i}}outEdges(r,t){var n=this._out[r];if(n){var i=Object.values(n);return t?i.filter(s=>s.w===t):i}}nodeEdges(r,t){var n=this.inEdges(r,t);if(n)return n.concat(this.outEdges(r,t))}};function re(e,r){e[r]?e[r]++:e[r]=1}function te(e,r){--e[r]||delete e[r]}function x(e,r,t,n){var i=""+r,s=""+t;if(!e&&i>s){var a=i;i=s,s=a}return i+ee+s+ee+(n===void 0?Ot:n)}function xt(e,r,t,n){var i=""+r,s=""+t;if(!e&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function R(e,r){return x(e,r.v,r.w,r.name)}ne.exports=T});var se=c((Ds,ie)=>{ie.exports="2.2.4"});var oe=c((Gs,ae)=>{ae.exports={Graph:j(),version:se()}});var le=c((Vs,de)=>{var Nt=j();de.exports={write:It,read:qt};function It(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:jt(e),edges:Ct(e)};return e.graph()!==void 0&&(r.value=structuredClone(e.graph())),r}function jt(e){return e.nodes().map(function(r){var t=e.node(r),n=e.parent(r),i={v:r};return t!==void 0&&(i.value=t),n!==void 0&&(i.parent=n),i})}function Ct(e){return e.edges().map(function(r){var t=e.edge(r),n={v:r.v,w:r.w};return r.name!==void 0&&(n.name=r.name),t!==void 0&&(n.value=t),n})}function qt(e){var r=new Nt(e.options).setGraph(e.value);return e.nodes.forEach(function(t){r.setNode(t.v,t.value),t.parent&&r.setParent(t.v,t.parent)}),e.edges.forEach(function(t){r.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),r}});var he=c((As,ue)=>{ue.exports=Lt;function Lt(e){var r={},t=[],n;function i(s){Object.hasOwn(r,s)||(r[s]=!0,n.push(s),e.successors(s).forEach(i),e.predecessors(s).forEach(i))}return e.nodes().forEach(function(s){n=[],i(s),n.length&&t.push(n)}),t}});var P=c((Ys,fe)=>{var S=class{constructor(){b(this,"_arr",[]);b(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(r){return r.key})}has(r){return Object.hasOwn(this._keyIndices,r)}priority(r){var t=this._keyIndices[r];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(r,t){var n=this._keyIndices;if(r=String(r),!Object.hasOwn(n,r)){var i=this._arr,s=i.length;return n[r]=s,i.push({key:r,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key}decrease(r,t){var n=this._keyIndices[r];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)}_heapify(r){var t=this._arr,n=2*r,i=n+1,s=r;n<t.length&&(s=t[n].priority<t[s].priority?n:s,i<t.length&&(s=t[i].priority<t[s].priority?i:s),s!==r&&(this._swap(r,s),this._heapify(s)))}_decrease(r){for(var t=this._arr,n=t[r].priority,i;r!==0&&(i=r>>1,!(t[i].priority<n));)this._swap(r,i),r=i}_swap(r,t){var n=this._arr,i=this._keyIndices,s=n[r],a=n[t];n[r]=a,n[t]=s,i[a.key]=r,i[s.key]=t}};fe.exports=S});var F=c((Ws,ce)=>{var Mt=P();ce.exports=Tt;var Rt=()=>1;function Tt(e,r,t,n){return St(e,String(r),t||Rt,n||function(i){return e.outEdges(i)})}function St(e,r,t,n){var i={},s=new Mt,a,o,d=function(l){var u=l.v!==a?l.v:l.w,h=i[u],f=t(l),p=o.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+l+" Weight: "+f);p<h.distance&&(h.distance=p,h.predecessor=a,s.decrease(u,p))};for(e.nodes().forEach(function(l){var u=l===r?0:Number.POSITIVE_INFINITY;i[l]={distance:u},s.add(l,u)});s.size()>0&&(a=s.removeMin(),o=i[a],o.distance!==Number.POSITIVE_INFINITY);)n(a).forEach(d);return i}});var me=c((zs,pe)=>{var Pt=F();pe.exports=Ft;function Ft(e,r,t){return e.nodes().reduce(function(n,i){return n[i]=Pt(e,i,r,t),n},{})}});var D=c((Us,be)=>{be.exports=Dt;function Dt(e){var r=0,t=[],n={},i=[];function s(a){var o=n[a]={onStack:!0,lowlink:r,index:r++};if(t.push(a),e.successors(a).forEach(function(u){Object.hasOwn(n,u)?n[u].onStack&&(o.lowlink=Math.min(o.lowlink,n[u].index)):(s(u),o.lowlink=Math.min(o.lowlink,n[u].lowlink))}),o.lowlink===o.index){var d=[],l;do l=t.pop(),n[l].onStack=!1,d.push(l);while(a!==l);i.push(d)}}return e.nodes().forEach(function(a){Object.hasOwn(n,a)||s(a)}),i}});var Ee=c((Hs,we)=>{var Gt=D();we.exports=Vt;function Vt(e){return Gt(e).filter(function(r){return r.length>1||r.length===1&&e.hasEdge(r[0],r[0])})}});var ve=c((Xs,ge)=>{ge.exports=Yt;var At=()=>1;function Yt(e,r,t){return Bt(e,r||At,t||function(n){return e.outEdges(n)})}function Bt(e,r,t){var n={},i=e.nodes();return i.forEach(function(s){n[s]={},n[s][s]={distance:0},i.forEach(function(a){s!==a&&(n[s][a]={distance:Number.POSITIVE_INFINITY})}),t(s).forEach(function(a){var o=a.v===s?a.w:a.v,d=r(a);n[s][o]={distance:d,predecessor:s}})}),i.forEach(function(s){var a=n[s];i.forEach(function(o){var d=n[o];i.forEach(function(l){var u=d[s],h=a[l],f=d[l],p=u.distance+h.distance;p<f.distance&&(f.distance=p,f.predecessor=h.predecessor)})})}),n}});var G=c((Ks,ke)=>{function _e(e){var r={},t={},n=[];function i(s){if(Object.hasOwn(t,s))throw new N;Object.hasOwn(r,s)||(t[s]=!0,r[s]=!0,e.predecessors(s).forEach(i),delete t[s],n.push(s))}if(e.sinks().forEach(i),Object.keys(r).length!==e.nodeCount())throw new N;return n}var N=class extends Error{constructor(){super(...arguments)}};ke.exports=_e;_e.CycleException=N});var xe=c((Js,Oe)=>{var ye=G();Oe.exports=Wt;function Wt(e){try{ye(e)}catch(r){if(r instanceof ye.CycleException)return!1;throw r}return!0}});var V=c((Qs,Ie)=>{Ie.exports=zt;function zt(e,r,t){Array.isArray(r)||(r=[r]);var n=e.isDirected()?o=>e.successors(o):o=>e.neighbors(o),i=t==="post"?Ut:Ht,s=[],a={};return r.forEach(o=>{if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);i(o,n,a,s)}),s}function Ut(e,r,t,n){for(var i=[[e,!1]];i.length>0;){var s=i.pop();s[1]?n.push(s[0]):Object.hasOwn(t,s[0])||(t[s[0]]=!0,i.push([s[0],!0]),Ne(r(s[0]),a=>i.push([a,!1])))}}function Ht(e,r,t,n){for(var i=[e];i.length>0;){var s=i.pop();Object.hasOwn(t,s)||(t[s]=!0,n.push(s),Ne(r(s),a=>i.push(a)))}}function Ne(e,r){for(var t=e.length;t--;)r(e[t],t,e);return e}});var Ce=c((Zs,je)=>{var Xt=V();je.exports=Kt;function Kt(e,r){return Xt(e,r,"post")}});var Le=c(($s,qe)=>{var Jt=V();qe.exports=Qt;function Qt(e,r){return Jt(e,r,"pre")}});var Re=c((ea,Me)=>{var Zt=j(),$t=P();Me.exports=en;function en(e,r){var t=new Zt,n={},i=new $t,s;function a(d){var l=d.v===s?d.w:d.v,u=i.priority(l);if(u!==void 0){var h=r(d);h<u&&(n[l]=s,i.decrease(l,h))}}if(e.nodeCount()===0)return t;e.nodes().forEach(function(d){i.add(d,Number.POSITIVE_INFINITY),t.setNode(d)}),i.decrease(e.nodes()[0],0);for(var o=!1;i.size()>0;){if(s=i.removeMin(),Object.hasOwn(n,s))t.setEdge(s,n[s]);else{if(o)throw new Error("Input graph is not connected: "+e);o=!0}e.nodeEdges(s).forEach(a)}return t}});var Se=c((ra,Te)=>{Te.exports={components:he(),dijkstra:F(),dijkstraAll:me(),findCycles:Ee(),floydWarshall:ve(),isAcyclic:xe(),postorder:Ce(),preorder:Le(),prim:Re(),tarjan:D(),topsort:G()}});var E=c((ta,Fe)=>{var Pe=oe();Fe.exports={Graph:Pe.Graph,json:le(),alg:Se(),version:Pe.version}});var Ve=c((na,Ge)=>{var A=class{constructor(){let r={};r._next=r._prev=r,this._sentinel=r}dequeue(){let r=this._sentinel,t=r._prev;if(t!==r)return De(t),t}enqueue(r){let t=this._sentinel;r._prev&&r._next&&De(r),r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){let r=[],t=this._sentinel,n=t._prev;for(;n!==t;)r.push(JSON.stringify(n,rn)),n=n._prev;return"["+r.join(", ")+"]"}};function De(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function rn(e,r){if(e!=="_next"&&e!=="_prev")return r}Ge.exports=A});var Ye=c((ia,Ae)=>{var tn=E().Graph,nn=Ve();Ae.exports=an;var sn=()=>1;function an(e,r){if(e.nodeCount()<=1)return[];let t=dn(e,r||sn);return on(t.graph,t.buckets,t.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w))}function on(e,r,t){let n=[],i=r[r.length-1],s=r[0],a;for(;e.nodeCount();){for(;a=s.dequeue();)Y(e,r,t,a);for(;a=i.dequeue();)Y(e,r,t,a);if(e.nodeCount()){for(let o=r.length-2;o>0;--o)if(a=r[o].dequeue(),a){n=n.concat(Y(e,r,t,a,!0));break}}}return n}function Y(e,r,t,n,i){let s=i?[]:void 0;return e.inEdges(n.v).forEach(a=>{let o=e.edge(a),d=e.node(a.v);i&&s.push({v:a.v,w:a.w}),d.out-=o,B(r,t,d)}),e.outEdges(n.v).forEach(a=>{let o=e.edge(a),d=a.w,l=e.node(d);l.in-=o,B(r,t,l)}),e.removeNode(n.v),s}function dn(e,r){let t=new tn,n=0,i=0;e.nodes().forEach(o=>{t.setNode(o,{v:o,in:0,out:0})}),e.edges().forEach(o=>{let d=t.edge(o.v,o.w)||0,l=r(o),u=d+l;t.setEdge(o.v,o.w,u),i=Math.max(i,t.node(o.v).out+=l),n=Math.max(n,t.node(o.w).in+=l)});let s=ln(i+n+3).map(()=>new nn),a=n+1;return t.nodes().forEach(o=>{B(s,a,t.node(o))}),{graph:t,buckets:s,zeroIdx:a}}function B(e,r,t){t.out?t.in?e[t.out-t.in+r].enqueue(t):e[e.length-1].enqueue(t):e[0].enqueue(t)}function ln(e){let r=[];for(let t=0;t<e;t++)r.push(t);return r}});var w=c((sa,Ke)=>{"use strict";var Be=E().Graph;Ke.exports={addBorderNode:En,addDummyNode:We,applyWithChunking:C,asNonCompoundGraph:hn,buildLayerMatrix:mn,intersectRect:pn,mapValues:xn,maxRank:Ue,normalizeRanks:bn,notime:kn,partition:vn,pick:On,predecessorWeights:cn,range:Xe,removeEmptyRanks:wn,simplify:un,successorWeights:fn,time:_n,uniqueId:He,zipObject:W};function We(e,r,t,n){for(var i=n;e.hasNode(i);)i=He(n);return t.dummy=r,e.setNode(i,t),i}function un(e){let r=new Be().setGraph(e.graph());return e.nodes().forEach(t=>r.setNode(t,e.node(t))),e.edges().forEach(t=>{let n=r.edge(t.v,t.w)||{weight:0,minlen:1},i=e.edge(t);r.setEdge(t.v,t.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),r}function hn(e){let r=new Be({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(t=>{e.children(t).length||r.setNode(t,e.node(t))}),e.edges().forEach(t=>{r.setEdge(t,e.edge(t))}),r}function fn(e){let r=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(i=>{n[i.w]=(n[i.w]||0)+e.edge(i).weight}),n});return W(e.nodes(),r)}function cn(e){let r=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(i=>{n[i.v]=(n[i.v]||0)+e.edge(i).weight}),n});return W(e.nodes(),r)}function pn(e,r){let t=e.x,n=e.y,i=r.x-t,s=r.y-n,a=e.width/2,o=e.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let d,l;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),d=o*i/s,l=o):(i<0&&(a=-a),d=a,l=a*s/i),{x:t+d,y:n+l}}function mn(e){let r=Xe(Ue(e)+1).map(()=>[]);return e.nodes().forEach(t=>{let n=e.node(t),i=n.rank;i!==void 0&&(r[i][n.order]=t)}),r}function bn(e){let r=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MAX_VALUE:i}),t=C(Math.min,r);e.nodes().forEach(n=>{let i=e.node(n);Object.hasOwn(i,"rank")&&(i.rank-=t)})}function wn(e){let r=e.nodes().map(a=>e.node(a).rank),t=C(Math.min,r),n=[];e.nodes().forEach(a=>{let o=e.node(a).rank-t;n[o]||(n[o]=[]),n[o].push(a)});let i=0,s=e.graph().nodeRankFactor;Array.from(n).forEach((a,o)=>{a===void 0&&o%s!==0?--i:a!==void 0&&i&&a.forEach(d=>e.node(d).rank+=i)})}function En(e,r,t,n){let i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=n),We(e,"border",i,r)}function gn(e,r=ze){let t=[];for(let n=0;n<e.length;n+=r){let i=e.slice(n,n+r);t.push(i)}return t}var ze=65535;function C(e,r){if(r.length>ze){let t=gn(r);return e.apply(null,t.map(n=>e.apply(null,n)))}else return e.apply(null,r)}function Ue(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return C(Math.max,t)}function vn(e,r){let t={lhs:[],rhs:[]};return e.forEach(n=>{r(n)?t.lhs.push(n):t.rhs.push(n)}),t}function _n(e,r){let t=Date.now();try{return r()}finally{console.log(e+" time: "+(Date.now()-t)+"ms")}}function kn(e,r){return r()}var yn=0;function He(e){var r=++yn;return e+(""+r)}function Xe(e,r,t=1){r==null&&(r=e,e=0);let n=s=>s<r;t<0&&(n=s=>r<s);let i=[];for(let s=e;n(s);s+=t)i.push(s);return i}function On(e,r){let t={};for(let n of r)e[n]!==void 0&&(t[n]=e[n]);return t}function xn(e,r){let t=r;return typeof r=="string"&&(t=n=>n[r]),Object.entries(e).reduce((n,[i,s])=>(n[i]=t(s,i),n),{})}function W(e,r){return e.reduce((t,n,i)=>(t[n]=r[i],t),{})}});var Qe=c((aa,Je)=>{"use strict";var Nn=Ye(),In=w().uniqueId;Je.exports={run:jn,undo:qn};function jn(e){(e.graph().acyclicer==="greedy"?Nn(e,t(e)):Cn(e)).forEach(n=>{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,In("rev"))});function t(n){return i=>n.edge(i).weight}}function Cn(e){let r=[],t={},n={};function i(s){Object.hasOwn(n,s)||(n[s]=!0,t[s]=!0,e.outEdges(s).forEach(a=>{Object.hasOwn(t,a.w)?r.push(a):i(a.w)}),delete t[s])}return e.nodes().forEach(i),r}function qn(e){e.edges().forEach(r=>{let t=e.edge(r);if(t.reversed){e.removeEdge(r);let n=t.forwardName;delete t.reversed,delete t.forwardName,e.setEdge(r.w,r.v,t,n)}})}});var $e=c((oa,Ze)=>{"use strict";var Ln=w();Ze.exports={run:Mn,undo:Tn};function Mn(e){e.graph().dummyChains=[],e.edges().forEach(r=>Rn(e,r))}function Rn(e,r){let t=r.v,n=e.node(t).rank,i=r.w,s=e.node(i).rank,a=r.name,o=e.edge(r),d=o.labelRank;if(s===n+1)return;e.removeEdge(r);let l,u,h;for(h=0,++n;n<s;++h,++n)o.points=[],u={width:0,height:0,edgeLabel:o,edgeObj:r,rank:n},l=Ln.addDummyNode(e,"edge",u,"_d"),n===d&&(u.width=o.width,u.height=o.height,u.dummy="edge-label",u.labelpos=o.labelpos),e.setEdge(t,l,{weight:o.weight},a),h===0&&e.graph().dummyChains.push(l),t=l;e.setEdge(t,i,{weight:o.weight},a)}function Tn(e){e.graph().dummyChains.forEach(r=>{let t=e.node(r),n=t.edgeLabel,i;for(e.setEdge(t.edgeObj,n);t.dummy;)i=e.successors(r)[0],e.removeNode(r),n.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(n.x=t.x,n.y=t.y,n.width=t.width,n.height=t.height),r=i,t=e.node(r)})}});var I=c((da,er)=>{"use strict";var{applyWithChunking:Sn}=w();er.exports={longestPath:Pn,slack:Fn};function Pn(e){var r={};function t(n){var i=e.node(n);if(Object.hasOwn(r,n))return i.rank;r[n]=!0;let s=e.outEdges(n).map(o=>o==null?Number.POSITIVE_INFINITY:t(o.w)-e.edge(o).minlen);var a=Sn(Math.min,s);return a===Number.POSITIVE_INFINITY&&(a=0),i.rank=a}e.sources().forEach(t)}function Fn(e,r){return e.node(r.w).rank-e.node(r.v).rank-e.edge(r).minlen}});var z=c((la,rr)=>{"use strict";var Dn=E().Graph,q=I().slack;rr.exports=Gn;function Gn(e){var r=new Dn({directed:!1}),t=e.nodes()[0],n=e.nodeCount();r.setNode(t,{});for(var i,s;Vn(r,e)<n;)i=An(r,e),s=r.hasNode(i.v)?q(e,i):-q(e,i),Yn(r,e,s);return r}function Vn(e,r){function t(n){r.nodeEdges(n).forEach(i=>{var s=i.v,a=n===s?i.w:s;!e.hasNode(a)&&!q(r,i)&&(e.setNode(a,{}),e.setEdge(n,a,{}),t(a))})}return e.nodes().forEach(t),e.nodeCount()}function An(e,r){return r.edges().reduce((n,i)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(s=q(r,i)),s<n[0]?[s,i]:n},[Number.POSITIVE_INFINITY,null])[1]}function Yn(e,r,t){e.nodes().forEach(n=>r.node(n).rank+=t)}});var ur=c((ua,lr)=>{"use strict";var Bn=z(),tr=I().slack,Wn=I().longestPath,zn=E().alg.preorder,Un=E().alg.postorder,Hn=w().simplify;lr.exports=y;y.initLowLimValues=H;y.initCutValues=U;y.calcCutValue=ir;y.leaveEdge=ar;y.enterEdge=or;y.exchangeEdges=dr;function y(e){e=Hn(e),Wn(e);var r=Bn(e);H(r),U(r,e);for(var t,n;t=ar(r);)n=or(r,e,t),dr(r,e,t,n)}function U(e,r){var t=Un(e,e.nodes());t=t.slice(0,t.length-1),t.forEach(n=>Xn(e,r,n))}function Xn(e,r,t){var n=e.node(t),i=n.parent;e.edge(t,i).cutvalue=ir(e,r,t)}function ir(e,r,t){var n=e.node(t),i=n.parent,s=!0,a=r.edge(t,i),o=0;return a||(s=!1,a=r.edge(i,t)),o=a.weight,r.nodeEdges(t).forEach(d=>{var l=d.v===t,u=l?d.w:d.v;if(u!==i){var h=l===s,f=r.edge(d).weight;if(o+=h?f:-f,Jn(e,t,u)){var p=e.edge(t,u).cutvalue;o+=h?-p:p}}}),o}function H(e,r){arguments.length<2&&(r=e.nodes()[0]),sr(e,{},1,r)}function sr(e,r,t,n,i){var s=t,a=e.node(n);return r[n]=!0,e.neighbors(n).forEach(o=>{Object.hasOwn(r,o)||(t=sr(e,r,t,o,n))}),a.low=s,a.lim=t++,i?a.parent=i:delete a.parent,t}function ar(e){return e.edges().find(r=>e.edge(r).cutvalue<0)}function or(e,r,t){var n=t.v,i=t.w;r.hasEdge(n,i)||(n=t.w,i=t.v);var s=e.node(n),a=e.node(i),o=s,d=!1;s.lim>a.lim&&(o=a,d=!0);var l=r.edges().filter(u=>d===nr(e,e.node(u.v),o)&&d!==nr(e,e.node(u.w),o));return l.reduce((u,h)=>tr(r,h)<tr(r,u)?h:u)}function dr(e,r,t,n){var i=t.v,s=t.w;e.removeEdge(i,s),e.setEdge(n.v,n.w,{}),H(e),U(e,r),Kn(e,r)}function Kn(e,r){var t=e.nodes().find(i=>!r.node(i).parent),n=zn(e,t);n=n.slice(1),n.forEach(i=>{var s=e.node(i).parent,a=r.edge(i,s),o=!1;a||(a=r.edge(s,i),o=!0),r.node(i).rank=r.node(s).rank+(o?a.minlen:-a.minlen)})}function Jn(e,r,t){return e.hasEdge(r,t)}function nr(e,r,t){return t.low<=r.lim&&r.lim<=t.lim}});var pr=c((ha,cr)=>{"use strict";var Qn=I(),fr=Qn.longestPath,Zn=z(),$n=ur();cr.exports=ei;function ei(e){var r=e.graph().ranker;if(r instanceof Function)return r(e);switch(e.graph().ranker){case"network-simplex":hr(e);break;case"tight-tree":ti(e);break;case"longest-path":ri(e);break;case"none":break;default:hr(e)}}var ri=fr;function ti(e){fr(e),Zn(e)}function hr(e){$n(e)}});var br=c((fa,mr)=>{mr.exports=ni;function ni(e){let r=si(e);e.graph().dummyChains.forEach(t=>{let n=e.node(t),i=n.edgeObj,s=ii(e,r,i.v,i.w),a=s.path,o=s.lca,d=0,l=a[d],u=!0;for(;t!==i.w;){if(n=e.node(t),u){for(;(l=a[d])!==o&&e.node(l).maxRank<n.rank;)d++;l===o&&(u=!1)}if(!u){for(;d<a.length-1&&e.node(l=a[d+1]).minRank<=n.rank;)d++;l=a[d]}e.setParent(t,l),t=e.successors(t)[0]}})}function ii(e,r,t,n){let i=[],s=[],a=Math.min(r[t].low,r[n].low),o=Math.max(r[t].lim,r[n].lim),d,l;d=t;do d=e.parent(d),i.push(d);while(d&&(r[d].low>a||o>r[d].lim));for(l=d,d=n;(d=e.parent(d))!==l;)s.push(d);return{path:i.concat(s.reverse()),lca:l}}function si(e){let r={},t=0;function n(i){let s=t;e.children(i).forEach(n),r[i]={low:s,lim:t++}}return e.children().forEach(n),r}});var gr=c((ca,Er)=>{var L=w();Er.exports={run:ai,cleanup:li};function ai(e){let r=L.addDummyNode(e,"root",{},"_root"),t=oi(e),n=Object.values(t),i=L.applyWithChunking(Math.max,n)-1,s=2*i+1;e.graph().nestingRoot=r,e.edges().forEach(o=>e.edge(o).minlen*=s);let a=di(e)+1;e.children().forEach(o=>wr(e,r,s,a,i,t,o)),e.graph().nodeRankFactor=s}function wr(e,r,t,n,i,s,a){let o=e.children(a);if(!o.length){a!==r&&e.setEdge(r,a,{weight:0,minlen:t});return}let d=L.addBorderNode(e,"_bt"),l=L.addBorderNode(e,"_bb"),u=e.node(a);e.setParent(d,a),u.borderTop=d,e.setParent(l,a),u.borderBottom=l,o.forEach(h=>{wr(e,r,t,n,i,s,h);let f=e.node(h),p=f.borderTop?f.borderTop:h,m=f.borderBottom?f.borderBottom:h,v=f.borderTop?n:2*n,O=p!==m?1:i-s[a]+1;e.setEdge(d,p,{weight:v,minlen:O,nestingEdge:!0}),e.setEdge(m,l,{weight:v,minlen:O,nestingEdge:!0})}),e.parent(a)||e.setEdge(r,d,{weight:0,minlen:i+s[a]})}function oi(e){var r={};function t(n,i){var s=e.children(n);s&&s.length&&s.forEach(a=>t(a,i+1)),r[n]=i}return e.children().forEach(n=>t(n,1)),r}function di(e){return e.edges().reduce((r,t)=>r+e.edge(t).weight,0)}function li(e){var r=e.graph();e.removeNode(r.nestingRoot),delete r.nestingRoot,e.edges().forEach(t=>{var n=e.edge(t);n.nestingEdge&&e.removeEdge(t)})}});var kr=c((pa,_r)=>{var ui=w();_r.exports=hi;function hi(e){function r(t){let n=e.children(t),i=e.node(t);if(n.length&&n.forEach(r),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let s=i.minRank,a=i.maxRank+1;s<a;++s)vr(e,"borderLeft","_bl",t,i,s),vr(e,"borderRight","_br",t,i,s)}}e.children().forEach(r)}function vr(e,r,t,n,i,s){let a={width:0,height:0,rank:s,borderType:r},o=i[r][s-1],d=ui.addDummyNode(e,"border",a,t);i[r][s]=d,e.setParent(d,n),o&&e.setEdge(o,d,{weight:1})}});var Nr=c((ma,xr)=>{"use strict";xr.exports={adjust:fi,undo:ci};function fi(e){let r=e.graph().rankdir.toLowerCase();(r==="lr"||r==="rl")&&Or(e)}function ci(e){let r=e.graph().rankdir.toLowerCase();(r==="bt"||r==="rl")&&pi(e),(r==="lr"||r==="rl")&&(mi(e),Or(e))}function Or(e){e.nodes().forEach(r=>yr(e.node(r))),e.edges().forEach(r=>yr(e.edge(r)))}function yr(e){let r=e.width;e.width=e.height,e.height=r}function pi(e){e.nodes().forEach(r=>X(e.node(r))),e.edges().forEach(r=>{let t=e.edge(r);t.points.forEach(X),Object.hasOwn(t,"y")&&X(t)})}function X(e){e.y=-e.y}function mi(e){e.nodes().forEach(r=>K(e.node(r))),e.edges().forEach(r=>{let t=e.edge(r);t.points.forEach(K),Object.hasOwn(t,"x")&&K(t)})}function K(e){let r=e.x;e.x=e.y,e.y=r}});var Cr=c((ba,jr)=>{"use strict";var Ir=w();jr.exports=bi;function bi(e){let r={},t=e.nodes().filter(d=>!e.children(d).length),n=t.map(d=>e.node(d).rank),i=Ir.applyWithChunking(Math.max,n),s=Ir.range(i+1).map(()=>[]);function a(d){if(r[d])return;r[d]=!0;let l=e.node(d);s[l.rank].push(d),e.successors(d).forEach(a)}return t.sort((d,l)=>e.node(d).rank-e.node(l).rank).forEach(a),s}});var Lr=c((wa,qr)=>{"use strict";var wi=w().zipObject;qr.exports=Ei;function Ei(e,r){let t=0;for(let n=1;n<r.length;++n)t+=gi(e,r[n-1],r[n]);return t}function gi(e,r,t){let n=wi(t,t.map((l,u)=>u)),i=r.flatMap(l=>e.outEdges(l).map(u=>({pos:n[u.w],weight:e.edge(u).weight})).sort((u,h)=>u.pos-h.pos)),s=1;for(;s<t.length;)s<<=1;let a=2*s-1;s-=1;let o=new Array(a).fill(0),d=0;return i.forEach(l=>{let u=l.pos+s;o[u]+=l.weight;let h=0;for(;u>0;)u%2&&(h+=o[u+1]),u=u-1>>1,o[u]+=l.weight;d+=l.weight*h}),d}});var Rr=c((Ea,Mr)=>{Mr.exports=vi;function vi(e,r=[]){return r.map(t=>{let n=e.inEdges(t);if(n.length){let i=n.reduce((s,a)=>{let o=e.edge(a),d=e.node(a.v);return{sum:s.sum+o.weight*d.order,weight:s.weight+o.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:t}})}});var Sr=c((ga,Tr)=>{"use strict";var _i=w();Tr.exports=ki;function ki(e,r){let t={};e.forEach((i,s)=>{let a=t[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};i.barycenter!==void 0&&(a.barycenter=i.barycenter,a.weight=i.weight)}),r.edges().forEach(i=>{let s=t[i.v],a=t[i.w];s!==void 0&&a!==void 0&&(a.indegree++,s.out.push(t[i.w]))});let n=Object.values(t).filter(i=>!i.indegree);return yi(n)}function yi(e){let r=[];function t(i){return s=>{s.merged||(s.barycenter===void 0||i.barycenter===void 0||s.barycenter>=i.barycenter)&&Oi(i,s)}}function n(i){return s=>{s.in.push(i),--s.indegree===0&&e.push(s)}}for(;e.length;){let i=e.pop();r.push(i),i.in.reverse().forEach(t(i)),i.out.forEach(n(i))}return r.filter(i=>!i.merged).map(i=>_i.pick(i,["vs","i","barycenter","weight"]))}function Oi(e,r){let t=0,n=0;e.weight&&(t+=e.barycenter*e.weight,n+=e.weight),r.weight&&(t+=r.barycenter*r.weight,n+=r.weight),e.vs=r.vs.concat(e.vs),e.barycenter=t/n,e.weight=n,e.i=Math.min(r.i,e.i),r.merged=!0}});var Dr=c((va,Fr)=>{var xi=w();Fr.exports=Ni;function Ni(e,r){let t=xi.partition(e,u=>Object.hasOwn(u,"barycenter")),n=t.lhs,i=t.rhs.sort((u,h)=>h.i-u.i),s=[],a=0,o=0,d=0;n.sort(Ii(!!r)),d=Pr(s,i,d),n.forEach(u=>{d+=u.vs.length,s.push(u.vs),a+=u.barycenter*u.weight,o+=u.weight,d=Pr(s,i,d)});let l={vs:s.flat(!0)};return o&&(l.barycenter=a/o,l.weight=o),l}function Pr(e,r,t){let n;for(;r.length&&(n=r[r.length-1]).i<=t;)r.pop(),e.push(n.vs),t++;return t}function Ii(e){return(r,t)=>r.barycenter<t.barycenter?-1:r.barycenter>t.barycenter?1:e?t.i-r.i:r.i-t.i}});var Ar=c((_a,Vr)=>{var ji=Rr(),Ci=Sr(),qi=Dr();Vr.exports=Gr;function Gr(e,r,t,n){let i=e.children(r),s=e.node(r),a=s?s.borderLeft:void 0,o=s?s.borderRight:void 0,d={};a&&(i=i.filter(f=>f!==a&&f!==o));let l=ji(e,i);l.forEach(f=>{if(e.children(f.v).length){let p=Gr(e,f.v,t,n);d[f.v]=p,Object.hasOwn(p,"barycenter")&&Mi(f,p)}});let u=Ci(l,t);Li(u,d);let h=qi(u,n);if(a&&(h.vs=[a,h.vs,o].flat(!0),e.predecessors(a).length)){let f=e.node(e.predecessors(a)[0]),p=e.node(e.predecessors(o)[0]);Object.hasOwn(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+p.order)/(h.weight+2),h.weight+=2}return h}function Li(e,r){e.forEach(t=>{t.vs=t.vs.flatMap(n=>r[n]?r[n].vs:n)})}function Mi(e,r){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+r.barycenter*r.weight)/(e.weight+r.weight),e.weight+=r.weight):(e.barycenter=r.barycenter,e.weight=r.weight)}});var Br=c((ka,Yr)=>{var Ri=E().Graph,Ti=w();Yr.exports=Si;function Si(e,r,t,n){n||(n=e.nodes());let i=Pi(e),s=new Ri({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(a=>e.node(a));return n.forEach(a=>{let o=e.node(a),d=e.parent(a);(o.rank===r||o.minRank<=r&&r<=o.maxRank)&&(s.setNode(a),s.setParent(a,d||i),e[t](a).forEach(l=>{let u=l.v===a?l.w:l.v,h=s.edge(u,a),f=h!==void 0?h.weight:0;s.setEdge(u,a,{weight:e.edge(l).weight+f})}),Object.hasOwn(o,"minRank")&&s.setNode(a,{borderLeft:o.borderLeft[r],borderRight:o.borderRight[r]}))}),s}function Pi(e){for(var r;e.hasNode(r=Ti.uniqueId("_root")););return r}});var zr=c((ya,Wr)=>{Wr.exports=Fi;function Fi(e,r,t){let n={},i;t.forEach(s=>{let a=e.parent(s),o,d;for(;a;){if(o=e.parent(a),o?(d=n[o],n[o]=a):(d=i,i=a),d&&d!==a){r.setEdge(d,a);return}a=o}})}});var Jr=c((Oa,Kr)=>{"use strict";var Di=Cr(),Gi=Lr(),Vi=Ar(),Ai=Br(),Yi=zr(),Bi=E().Graph,M=w();Kr.exports=Xr;function Xr(e,r){if(r&&typeof r.customOrder=="function"){r.customOrder(e,Xr);return}let t=M.maxRank(e),n=Ur(e,M.range(1,t+1),"inEdges"),i=Ur(e,M.range(t-1,-1,-1),"outEdges"),s=Di(e);if(Hr(e,s),r&&r.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,o;for(let d=0,l=0;l<4;++d,++l){Wi(d%2?n:i,d%4>=2),s=M.buildLayerMatrix(e);let u=Gi(e,s);u<a&&(l=0,o=Object.assign({},s),a=u)}Hr(e,o)}function Ur(e,r,t){let n=new Map,i=(s,a)=>{n.has(s)||n.set(s,[]),n.get(s).push(a)};for(let s of e.nodes()){let a=e.node(s);if(typeof a.rank=="number"&&i(a.rank,s),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let o=a.minRank;o<=a.maxRank;o++)o!==a.rank&&i(o,s)}return r.map(function(s){return Ai(e,s,t,n.get(s)||[])})}function Wi(e,r){let t=new Bi;e.forEach(function(n){let i=n.graph().root,s=Vi(n,i,t,r);s.vs.forEach((a,o)=>n.node(a).order=o),Yi(n,t,s.vs)})}function Hr(e,r){Object.values(r).forEach(t=>t.forEach((n,i)=>e.node(n).order=i))}});var at=c((xa,st)=>{"use strict";var zi=E().Graph,_=w();st.exports={positionX:Xi,findType1Conflicts:Qr,findType2Conflicts:Zr,addConflict:J,hasConflict:$r,verticalAlignment:et,horizontalCompaction:rt,alignCoordinates:nt,findSmallestWidthAlignment:tt,balance:it};function Qr(e,r){let t={};function n(i,s){let a=0,o=0,d=i.length,l=s[s.length-1];return s.forEach((u,h)=>{let f=Ui(e,u),p=f?e.node(f).order:d;(f||u===l)&&(s.slice(o,h+1).forEach(m=>{e.predecessors(m).forEach(v=>{let O=e.node(v),$=O.order;($<a||p<$)&&!(O.dummy&&e.node(m).dummy)&&J(t,v,m)})}),o=h+1,a=p)}),s}return r.length&&r.reduce(n),t}function Zr(e,r){let t={};function n(s,a,o,d,l){let u;_.range(a,o).forEach(h=>{u=s[h],e.node(u).dummy&&e.predecessors(u).forEach(f=>{let p=e.node(f);p.dummy&&(p.order<d||p.order>l)&&J(t,f,u)})})}function i(s,a){let o=-1,d,l=0;return a.forEach((u,h)=>{if(e.node(u).dummy==="border"){let f=e.predecessors(u);f.length&&(d=e.node(f[0]).order,n(a,l,h,o,d),l=h,o=d)}n(a,l,a.length,d,s.length)}),a}return r.length&&r.reduce(i),t}function Ui(e,r){if(e.node(r).dummy)return e.predecessors(r).find(t=>e.node(t).dummy)}function J(e,r,t){if(r>t){let i=r;r=t,t=i}let n=e[r];n||(e[r]=n={}),n[t]=!0}function $r(e,r,t){if(r>t){let n=r;r=t,t=n}return!!e[r]&&Object.hasOwn(e[r],t)}function et(e,r,t,n){let i={},s={},a={};return r.forEach(o=>{o.forEach((d,l)=>{i[d]=d,s[d]=d,a[d]=l})}),r.forEach(o=>{let d=-1;o.forEach(l=>{let u=n(l);if(u.length){u=u.sort((f,p)=>a[f]-a[p]);let h=(u.length-1)/2;for(let f=Math.floor(h),p=Math.ceil(h);f<=p;++f){let m=u[f];s[l]===l&&d<a[m]&&!$r(t,l,m)&&(s[m]=l,s[l]=i[l]=i[m],d=a[m])}}})}),{root:i,align:s}}function rt(e,r,t,n,i){let s={},a=Hi(e,r,t,i),o=i?"borderLeft":"borderRight";function d(h,f){let p=a.nodes(),m=p.pop(),v={};for(;m;)v[m]?h(m):(v[m]=!0,p.push(m),p=p.concat(f(m))),m=p.pop()}function l(h){s[h]=a.inEdges(h).reduce((f,p)=>Math.max(f,s[p.v]+a.edge(p)),0)}function u(h){let f=a.outEdges(h).reduce((m,v)=>Math.min(m,s[v.w]-a.edge(v)),Number.POSITIVE_INFINITY),p=e.node(h);f!==Number.POSITIVE_INFINITY&&p.borderType!==o&&(s[h]=Math.max(s[h],f))}return d(l,a.predecessors.bind(a)),d(u,a.successors.bind(a)),Object.keys(n).forEach(h=>s[h]=s[t[h]]),s}function Hi(e,r,t,n){let i=new zi,s=e.graph(),a=Ki(s.nodesep,s.edgesep,n);return r.forEach(o=>{let d;o.forEach(l=>{let u=t[l];if(i.setNode(u),d){var h=t[d],f=i.edge(h,u);i.setEdge(h,u,Math.max(a(e,l,d),f||0))}d=l})}),i}function tt(e,r){return Object.values(r).reduce((t,n)=>{let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([o,d])=>{let l=Ji(e,o)/2;i=Math.max(d+l,i),s=Math.min(d-l,s)});let a=i-s;return a<t[0]&&(t=[a,n]),t},[Number.POSITIVE_INFINITY,null])[1]}function nt(e,r){let t=Object.values(r),n=_.applyWithChunking(Math.min,t),i=_.applyWithChunking(Math.max,t);["u","d"].forEach(s=>{["l","r"].forEach(a=>{let o=s+a,d=e[o];if(d===r)return;let l=Object.values(d),u=n-_.applyWithChunking(Math.min,l);a!=="l"&&(u=i-_.applyWithChunking(Math.max,l)),u&&(e[o]=_.mapValues(d,h=>h+u))})})}function it(e,r){return _.mapValues(e.ul,(t,n)=>{if(r)return e[r.toLowerCase()][n];{let i=Object.values(e).map(s=>s[n]).sort((s,a)=>s-a);return(i[1]+i[2])/2}})}function Xi(e){let r=_.buildLayerMatrix(e),t=Object.assign(Qr(e,r),Zr(e,r)),n={},i;["u","d"].forEach(a=>{i=a==="u"?r:Object.values(r).reverse(),["l","r"].forEach(o=>{o==="r"&&(i=i.map(h=>Object.values(h).reverse()));let d=(a==="u"?e.predecessors:e.successors).bind(e),l=et(e,i,t,d),u=rt(e,i,l.root,l.align,o==="r");o==="r"&&(u=_.mapValues(u,h=>-h)),n[a+o]=u})});let s=tt(e,n);return nt(n,s),it(n,e.graph().align)}function Ki(e,r,t){return(n,i,s)=>{let a=n.node(i),o=n.node(s),d=0,l;if(d+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":l=-a.width/2;break;case"r":l=a.width/2;break}if(l&&(d+=t?l:-l),l=0,d+=(a.dummy?r:e)/2,d+=(o.dummy?r:e)/2,d+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":l=o.width/2;break;case"r":l=-o.width/2;break}return l&&(d+=t?l:-l),l=0,d}}function Ji(e,r){return e.node(r).width}});var lt=c((Na,dt)=>{"use strict";var ot=w(),Qi=at().positionX;dt.exports=Zi;function Zi(e){e=ot.asNonCompoundGraph(e),$i(e),Object.entries(Qi(e)).forEach(([r,t])=>e.node(r).x=t)}function $i(e){let r=ot.buildLayerMatrix(e),t=e.graph().ranksep,n=0;r.forEach(i=>{let s=i.reduce((a,o)=>{let d=e.node(o).height;return a>d?a:d},0);i.forEach(a=>e.node(a).y=n+s/2),n+=s+t})}});var bt=c((Ia,mt)=>{"use strict";var ut=Qe(),ht=$e(),es=pr(),rs=w().normalizeRanks,ts=br(),ns=w().removeEmptyRanks,ft=gr(),is=kr(),ct=Nr(),ss=Jr(),as=lt(),g=w(),os=E().Graph;mt.exports=ds;function ds(e,r){let t=r&&r.debugTiming?g.time:g.notime;t("layout",()=>{let n=t(" buildLayoutGraph",()=>Es(e));t(" runLayout",()=>ls(n,t,r)),t(" updateInputGraph",()=>us(e,n))})}function ls(e,r,t){r(" makeSpaceForEdgeLabels",()=>gs(e)),r(" removeSelfEdges",()=>js(e)),r(" acyclic",()=>ut.run(e)),r(" nestingGraph.run",()=>ft.run(e)),r(" rank",()=>es(g.asNonCompoundGraph(e))),r(" injectEdgeLabelProxies",()=>vs(e)),r(" removeEmptyRanks",()=>ns(e)),r(" nestingGraph.cleanup",()=>ft.cleanup(e)),r(" normalizeRanks",()=>rs(e)),r(" assignRankMinMax",()=>_s(e)),r(" removeEdgeLabelProxies",()=>ks(e)),r(" normalize.run",()=>ht.run(e)),r(" parentDummyChains",()=>ts(e)),r(" addBorderSegments",()=>is(e)),r(" order",()=>ss(e,t)),r(" insertSelfEdges",()=>Cs(e)),r(" adjustCoordinateSystem",()=>ct.adjust(e)),r(" position",()=>as(e)),r(" positionSelfEdges",()=>qs(e)),r(" removeBorderNodes",()=>Is(e)),r(" normalize.undo",()=>ht.undo(e)),r(" fixupEdgeLabelCoords",()=>xs(e)),r(" undoCoordinateSystem",()=>ct.undo(e)),r(" translateGraph",()=>ys(e)),r(" assignNodeIntersects",()=>Os(e)),r(" reversePoints",()=>Ns(e)),r(" acyclic.undo",()=>ut.undo(e))}function us(e,r){e.nodes().forEach(t=>{let n=e.node(t),i=r.node(t);n&&(n.x=i.x,n.y=i.y,n.rank=i.rank,r.children(t).length&&(n.width=i.width,n.height=i.height))}),e.edges().forEach(t=>{let n=e.edge(t),i=r.edge(t);n.points=i.points,Object.hasOwn(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=r.graph().width,e.graph().height=r.graph().height}var hs=["nodesep","edgesep","ranksep","marginx","marginy"],fs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},cs=["acyclicer","ranker","rankdir","align"],ps=["width","height","rank"],pt={width:0,height:0},ms=["minlen","weight","width","height","labeloffset"],bs={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ws=["labelpos"];function Es(e){let r=new os({multigraph:!0,compound:!0}),t=Z(e.graph());return r.setGraph(Object.assign({},fs,Q(t,hs),g.pick(t,cs))),e.nodes().forEach(n=>{let i=Z(e.node(n)),s=Q(i,ps);Object.keys(pt).forEach(a=>{s[a]===void 0&&(s[a]=pt[a])}),r.setNode(n,s),r.setParent(n,e.parent(n))}),e.edges().forEach(n=>{let i=Z(e.edge(n));r.setEdge(n,Object.assign({},bs,Q(i,ms),g.pick(i,ws)))}),r}function gs(e){let r=e.graph();r.ranksep/=2,e.edges().forEach(t=>{let n=e.edge(t);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(r.rankdir==="TB"||r.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function vs(e){e.edges().forEach(r=>{let t=e.edge(r);if(t.width&&t.height){let n=e.node(r.v),s={rank:(e.node(r.w).rank-n.rank)/2+n.rank,e:r};g.addDummyNode(e,"edge-proxy",s,"_ep")}})}function _s(e){let r=0;e.nodes().forEach(t=>{let n=e.node(t);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,r=Math.max(r,n.maxRank))}),e.graph().maxRank=r}function ks(e){e.nodes().forEach(r=>{let t=e.node(r);t.dummy==="edge-proxy"&&(e.edge(t.e).labelRank=t.rank,e.removeNode(r))})}function ys(e){let r=Number.POSITIVE_INFINITY,t=0,n=Number.POSITIVE_INFINITY,i=0,s=e.graph(),a=s.marginx||0,o=s.marginy||0;function d(l){let u=l.x,h=l.y,f=l.width,p=l.height;r=Math.min(r,u-f/2),t=Math.max(t,u+f/2),n=Math.min(n,h-p/2),i=Math.max(i,h+p/2)}e.nodes().forEach(l=>d(e.node(l))),e.edges().forEach(l=>{let u=e.edge(l);Object.hasOwn(u,"x")&&d(u)}),r-=a,n-=o,e.nodes().forEach(l=>{let u=e.node(l);u.x-=r,u.y-=n}),e.edges().forEach(l=>{let u=e.edge(l);u.points.forEach(h=>{h.x-=r,h.y-=n}),Object.hasOwn(u,"x")&&(u.x-=r),Object.hasOwn(u,"y")&&(u.y-=n)}),s.width=t-r+a,s.height=i-n+o}function Os(e){e.edges().forEach(r=>{let t=e.edge(r),n=e.node(r.v),i=e.node(r.w),s,a;t.points?(s=t.points[0],a=t.points[t.points.length-1]):(t.points=[],s=i,a=n),t.points.unshift(g.intersectRect(n,s)),t.points.push(g.intersectRect(i,a))})}function xs(e){e.edges().forEach(r=>{let t=e.edge(r);if(Object.hasOwn(t,"x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function Ns(e){e.edges().forEach(r=>{let t=e.edge(r);t.reversed&&t.points.reverse()})}function Is(e){e.nodes().forEach(r=>{if(e.children(r).length){let t=e.node(r),n=e.node(t.borderTop),i=e.node(t.borderBottom),s=e.node(t.borderLeft[t.borderLeft.length-1]),a=e.node(t.borderRight[t.borderRight.length-1]);t.width=Math.abs(a.x-s.x),t.height=Math.abs(i.y-n.y),t.x=s.x+t.width/2,t.y=n.y+t.height/2}}),e.nodes().forEach(r=>{e.node(r).dummy==="border"&&e.removeNode(r)})}function js(e){e.edges().forEach(r=>{if(r.v===r.w){var t=e.node(r.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:r,label:e.edge(r)}),e.removeEdge(r)}})}function Cs(e){var r=g.buildLayerMatrix(e);r.forEach(t=>{var n=0;t.forEach((i,s)=>{var a=e.node(i);a.order=s+n,(a.selfEdges||[]).forEach(o=>{g.addDummyNode(e,"selfedge",{width:o.label.width,height:o.label.height,rank:a.rank,order:s+ ++n,e:o.e,label:o.label},"_se")}),delete a.selfEdges})})}function qs(e){e.nodes().forEach(r=>{var t=e.node(r);if(t.dummy==="selfedge"){var n=e.node(t.e.v),i=n.x+n.width/2,s=n.y,a=t.x-i,o=n.height/2;e.setEdge(t.e,t.label),e.removeNode(r),t.label.points=[{x:i+2*a/3,y:s-o},{x:i+5*a/6,y:s-o},{x:i+a,y:s},{x:i+5*a/6,y:s+o},{x:i+2*a/3,y:s+o}],t.label.x=t.x,t.label.y=t.y}})}function Q(e,r){return g.mapValues(g.pick(e,r),Number)}function Z(e){var r={};return e&&Object.entries(e).forEach(([t,n])=>{typeof t=="string"&&(t=t.toLowerCase()),r[t]=n}),r}});var Et=c((ja,wt)=>{var Ls=w(),Ms=E().Graph;wt.exports={debugOrdering:Rs};function Rs(e){let r=Ls.buildLayerMatrix(e),t=new Ms({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(n=>{t.setNode(n,{label:n}),t.setParent(n,"layer"+e.node(n).rank)}),e.edges().forEach(n=>t.setEdge(n.v,n.w,{},n.name)),r.forEach((n,i)=>{let s="layer"+i;t.setNode(s,{rank:"same"}),n.reduce((a,o)=>(t.setEdge(a,o,{style:"invis"}),o))}),t}});var vt=c((Ca,gt)=>{gt.exports="2.0.0"});var Ts=c((qa,_t)=>{_t.exports={graphlib:E(),layout:bt(),debug:Et(),util:{time:w().time,notime:w().notime},version:vt()}});return Ts();})();
1
+ var dagre=(()=>{var g=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var A=p((ai,Y)=>{var L=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,r=t._prev;if(r!==t)return D(r),r}enqueue(t){let r=this._sentinel;t._prev&&t._next&&D(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){let t=[],r=this._sentinel,n=r._prev;for(;n!==r;)t.push(JSON.stringify(n,Ot)),n=n._prev;return"["+t.join(", ")+"]"}};function D(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ot(e,t){if(e!=="_next"&&e!=="_prev")return t}Y.exports=L});var z=p((li,W)=>{var It=g("@dagrejs/graphlib").Graph,qt=A();W.exports=Rt;var Lt=()=>1;function Rt(e,t){if(e.nodeCount()<=1)return[];let r=Mt(e,t||Lt);return Ct(r.graph,r.buckets,r.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w))}function Ct(e,t,r){let n=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)R(e,t,r,o);for(;o=i.dequeue();)R(e,t,r,o);if(e.nodeCount()){for(let l=t.length-2;l>0;--l)if(o=t[l].dequeue(),o){n=n.concat(R(e,t,r,o,!0));break}}}return n}function R(e,t,r,n,i){let a=i?[]:void 0;return e.inEdges(n.v).forEach(o=>{let l=e.edge(o),s=e.node(o.v);i&&a.push({v:o.v,w:o.w}),s.out-=l,C(t,r,s)}),e.outEdges(n.v).forEach(o=>{let l=e.edge(o),s=o.w,d=e.node(s);d.in-=l,C(t,r,d)}),e.removeNode(n.v),a}function Mt(e,t){let r=new It,n=0,i=0;e.nodes().forEach(l=>{r.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let s=r.edge(l.v,l.w)||0,d=t(l),u=s+d;r.setEdge(l.v,l.w,u),i=Math.max(i,r.node(l.v).out+=d),n=Math.max(n,r.node(l.w).in+=d)});let a=Tt(i+n+3).map(()=>new qt),o=n+1;return r.nodes().forEach(l=>{C(a,o,r.node(l))}),{graph:r,buckets:a,zeroIdx:o}}function C(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Tt(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t}});var m=p((si,Z)=>{"use strict";var X=g("@dagrejs/graphlib").Graph;Z.exports={addBorderNode:Dt,addDummyNode:H,applyWithChunking:N,asNonCompoundGraph:_t,buildLayerMatrix:Vt,intersectRect:Gt,mapValues:Ut,maxRank:J,normalizeRanks:Ft,notime:zt,partition:At,pick:Ht,predecessorWeights:Pt,range:Q,removeEmptyRanks:Bt,simplify:jt,successorWeights:St,time:Wt,uniqueId:K,zipObject:M};function H(e,t,r,n){for(var i=n;e.hasNode(i);)i=K(n);return r.dummy=t,e.setNode(i,r),i}function jt(e){let t=new X().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function _t(e){let t=new X({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t}function St(e){let t=e.nodes().map(r=>{let n={};return e.outEdges(r).forEach(i=>{n[i.w]=(n[i.w]||0)+e.edge(i).weight}),n});return M(e.nodes(),t)}function Pt(e){let t=e.nodes().map(r=>{let n={};return e.inEdges(r).forEach(i=>{n[i.v]=(n[i.v]||0)+e.edge(i).weight}),n});return M(e.nodes(),t)}function Gt(e,t){let r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,l=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");let s,d;return Math.abs(a)*o>Math.abs(i)*l?(a<0&&(l=-l),s=l*i/a,d=l):(i<0&&(o=-o),s=o,d=o*a/i),{x:r+s,y:n+d}}function Vt(e){let t=Q(J(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),i=n.rank;i!==void 0&&(t[i][n.order]=r)}),t}function Ft(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MAX_VALUE:i}),r=N(Math.min,t);e.nodes().forEach(n=>{let i=e.node(n);Object.hasOwn(i,"rank")&&(i.rank-=r)})}function Bt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),r=N(Math.min,t),n=[];e.nodes().forEach(o=>{let l=e.node(o).rank-r;n[l]||(n[l]=[]),n[l].push(o)});let i=0,a=e.graph().nodeRankFactor;Array.from(n).forEach((o,l)=>{o===void 0&&l%a!==0?--i:o!==void 0&&i&&o.forEach(s=>e.node(s).rank+=i)})}function Dt(e,t,r,n){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),H(e,"border",i,t)}function Yt(e,t=U){let r=[];for(let n=0;n<e.length;n+=t){let i=e.slice(n,n+t);r.push(i)}return r}var U=65535;function N(e,t){if(t.length>U){let r=Yt(t);return e.apply(null,r.map(n=>e.apply(null,n)))}else return e.apply(null,t)}function J(e){let r=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return N(Math.max,r)}function At(e,t){let r={lhs:[],rhs:[]};return e.forEach(n=>{t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Wt(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}}function zt(e,t){return t()}var Xt=0;function K(e){var t=++Xt;return e+(""+t)}function Q(e,t,r=1){t==null&&(t=e,e=0);let n=a=>a<t;r<0&&(n=a=>t<a);let i=[];for(let a=e;n(a);a+=r)i.push(a);return i}function Ht(e,t){let r={};for(let n of t)e[n]!==void 0&&(r[n]=e[n]);return r}function Ut(e,t){let r=t;return typeof t=="string"&&(r=n=>n[t]),Object.entries(e).reduce((n,[i,a])=>(n[i]=r(a,i),n),{})}function M(e,t){return e.reduce((r,n,i)=>(r[n]=t[i],r),{})}});var ee=p((di,$)=>{"use strict";var Jt=z(),Kt=m().uniqueId;$.exports={run:Qt,undo:$t};function Qt(e){(e.graph().acyclicer==="greedy"?Jt(e,r(e)):Zt(e)).forEach(n=>{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,Kt("rev"))});function r(n){return i=>n.edge(i).weight}}function Zt(e){let t=[],r={},n={};function i(a){Object.hasOwn(n,a)||(n[a]=!0,r[a]=!0,e.outEdges(a).forEach(o=>{Object.hasOwn(r,o.w)?t.push(o):i(o.w)}),delete r[a])}return e.nodes().forEach(i),t}function $t(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}});var re=p((ui,te)=>{"use strict";var er=m();te.exports={run:tr,undo:nr};function tr(e){e.graph().dummyChains=[],e.edges().forEach(t=>rr(e,t))}function rr(e,t){let r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,l=e.edge(t),s=l.labelRank;if(a===n+1)return;e.removeEdge(t);let d,u,h;for(h=0,++n;n<a;++h,++n)l.points=[],u={width:0,height:0,edgeLabel:l,edgeObj:t,rank:n},d=er.addDummyNode(e,"edge",u,"_d"),n===s&&(u.width=l.width,u.height=l.height,u.dummy="edge-label",u.labelpos=l.labelpos),e.setEdge(r,d,{weight:l.weight},o),h===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:l.weight},o)}function nr(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=i,r=e.node(t)})}});var v=p((hi,ne)=>{"use strict";var{applyWithChunking:ir}=m();ne.exports={longestPath:or,slack:ar};function or(e){var t={};function r(n){var i=e.node(n);if(Object.hasOwn(t,n))return i.rank;t[n]=!0;let a=e.outEdges(n).map(l=>l==null?Number.POSITIVE_INFINITY:r(l.w)-e.edge(l).minlen);var o=ir(Math.min,a);return o===Number.POSITIVE_INFINITY&&(o=0),i.rank=o}e.sources().forEach(r)}function ar(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}});var T=p((fi,ie)=>{"use strict";var lr=g("@dagrejs/graphlib").Graph,O=v().slack;ie.exports=sr;function sr(e){var t=new lr({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,a;dr(t,e)<n;)i=ur(t,e),a=t.hasNode(i.v)?O(e,i):-O(e,i),hr(t,e,a);return t}function dr(e,t){function r(n){t.nodeEdges(n).forEach(i=>{var a=i.v,o=n===a?i.w:a;!e.hasNode(o)&&!O(t,i)&&(e.setNode(o,{}),e.setEdge(n,o,{}),r(o))})}return e.nodes().forEach(r),e.nodeCount()}function ur(e,t){return t.edges().reduce((n,i)=>{let a=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(a=O(t,i)),a<n[0]?[a,i]:n},[Number.POSITIVE_INFINITY,null])[1]}function hr(e,t,r){e.nodes().forEach(n=>t.node(n).rank+=r)}});var ce=p((ci,fe)=>{"use strict";var fr=T(),oe=v().slack,cr=v().longestPath,pr=g("@dagrejs/graphlib").alg.preorder,mr=g("@dagrejs/graphlib").alg.postorder,br=m().simplify;fe.exports=y;y.initLowLimValues=_;y.initCutValues=j;y.calcCutValue=le;y.leaveEdge=de;y.enterEdge=ue;y.exchangeEdges=he;function y(e){e=br(e),cr(e);var t=fr(e);_(t),j(t,e);for(var r,n;r=de(t);)n=ue(t,e,r),he(t,e,r,n)}function j(e,t){var r=mr(e,e.nodes());r=r.slice(0,r.length-1),r.forEach(n=>wr(e,t,n))}function wr(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=le(e,t,r)}function le(e,t,r){var n=e.node(r),i=n.parent,a=!0,o=t.edge(r,i),l=0;return o||(a=!1,o=t.edge(i,r)),l=o.weight,t.nodeEdges(r).forEach(s=>{var d=s.v===r,u=d?s.w:s.v;if(u!==i){var h=d===a,f=t.edge(s).weight;if(l+=h?f:-f,gr(e,r,u)){var c=e.edge(r,u).cutvalue;l+=h?-c:c}}}),l}function _(e,t){arguments.length<2&&(t=e.nodes()[0]),se(e,{},1,t)}function se(e,t,r,n,i){var a=r,o=e.node(n);return t[n]=!0,e.neighbors(n).forEach(l=>{Object.hasOwn(t,l)||(r=se(e,t,r,l,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function de(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function ue(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var a=e.node(n),o=e.node(i),l=a,s=!1;a.lim>o.lim&&(l=o,s=!0);var d=t.edges().filter(u=>s===ae(e,e.node(u.v),l)&&s!==ae(e,e.node(u.w),l));return d.reduce((u,h)=>oe(t,h)<oe(t,u)?h:u)}function he(e,t,r,n){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(n.v,n.w,{}),_(e),j(e,t),Er(e,t)}function Er(e,t){var r=e.nodes().find(i=>!t.node(i).parent),n=pr(e,r);n=n.slice(1),n.forEach(i=>{var a=e.node(i).parent,o=t.edge(i,a),l=!1;o||(o=t.edge(a,i),l=!0),t.node(i).rank=t.node(a).rank+(l?o.minlen:-o.minlen)})}function gr(e,t,r){return e.hasEdge(t,r)}function ae(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}});var we=p((pi,be)=>{"use strict";var kr=v(),me=kr.longestPath,xr=T(),yr=ce();be.exports=vr;function vr(e){var t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case"network-simplex":pe(e);break;case"tight-tree":Or(e);break;case"longest-path":Nr(e);break;case"none":break;default:pe(e)}}var Nr=me;function Or(e){me(e),xr(e)}function pe(e){yr(e)}});var ge=p((mi,Ee)=>{Ee.exports=Ir;function Ir(e){let t=Lr(e);e.graph().dummyChains.forEach(r=>{let n=e.node(r),i=n.edgeObj,a=qr(e,t,i.v,i.w),o=a.path,l=a.lca,s=0,d=o[s],u=!0;for(;r!==i.w;){if(n=e.node(r),u){for(;(d=o[s])!==l&&e.node(d).maxRank<n.rank;)s++;d===l&&(u=!1)}if(!u){for(;s<o.length-1&&e.node(d=o[s+1]).minRank<=n.rank;)s++;d=o[s]}e.setParent(r,d),r=e.successors(r)[0]}})}function qr(e,t,r,n){let i=[],a=[],o=Math.min(t[r].low,t[n].low),l=Math.max(t[r].lim,t[n].lim),s,d;s=r;do s=e.parent(s),i.push(s);while(s&&(t[s].low>o||l>t[s].lim));for(d=s,s=n;(s=e.parent(s))!==d;)a.push(s);return{path:i.concat(a.reverse()),lca:d}}function Lr(e){let t={},r=0;function n(i){let a=r;e.children(i).forEach(n),t[i]={low:a,lim:r++}}return e.children().forEach(n),t}});var ye=p((bi,xe)=>{var I=m();xe.exports={run:Rr,cleanup:Tr};function Rr(e){let t=I.addDummyNode(e,"root",{},"_root"),r=Cr(e),n=Object.values(r),i=I.applyWithChunking(Math.max,n)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=a);let o=Mr(e)+1;e.children().forEach(l=>ke(e,t,a,o,i,r,l)),e.graph().nodeRankFactor=a}function ke(e,t,r,n,i,a,o){let l=e.children(o);if(!l.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:r});return}let s=I.addBorderNode(e,"_bt"),d=I.addBorderNode(e,"_bb"),u=e.node(o);e.setParent(s,o),u.borderTop=s,e.setParent(d,o),u.borderBottom=d,l.forEach(h=>{ke(e,t,r,n,i,a,h);let f=e.node(h),c=f.borderTop?f.borderTop:h,b=f.borderBottom?f.borderBottom:h,w=f.borderTop?n:2*n,x=c!==b?1:i-a[o]+1;e.setEdge(s,c,{weight:w,minlen:x,nestingEdge:!0}),e.setEdge(b,d,{weight:w,minlen:x,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,s,{weight:0,minlen:i+a[o]})}function Cr(e){var t={};function r(n,i){var a=e.children(n);a&&a.length&&a.forEach(o=>r(o,i+1)),t[n]=i}return e.children().forEach(n=>r(n,1)),t}function Mr(e){return e.edges().reduce((t,r)=>t+e.edge(r).weight,0)}function Tr(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(r=>{var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}});var Oe=p((wi,Ne)=>{var jr=m();Ne.exports=_r;function _r(e){function t(r){let n=e.children(r),i=e.node(r);if(n.length&&n.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let a=i.minRank,o=i.maxRank+1;a<o;++a)ve(e,"borderLeft","_bl",r,i,a),ve(e,"borderRight","_br",r,i,a)}}e.children().forEach(t)}function ve(e,t,r,n,i,a){let o={width:0,height:0,rank:a,borderType:t},l=i[t][a-1],s=jr.addDummyNode(e,"border",o,r);i[t][a]=s,e.setParent(s,n),l&&e.setEdge(l,s,{weight:1})}});var Re=p((Ei,Le)=>{"use strict";Le.exports={adjust:Sr,undo:Pr};function Sr(e){let t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&qe(e)}function Pr(e){let t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&Gr(e),(t==="lr"||t==="rl")&&(Vr(e),qe(e))}function qe(e){e.nodes().forEach(t=>Ie(e.node(t))),e.edges().forEach(t=>Ie(e.edge(t)))}function Ie(e){let t=e.width;e.width=e.height,e.height=t}function Gr(e){e.nodes().forEach(t=>S(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);r.points.forEach(S),Object.hasOwn(r,"y")&&S(r)})}function S(e){e.y=-e.y}function Vr(e){e.nodes().forEach(t=>P(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);r.points.forEach(P),Object.hasOwn(r,"x")&&P(r)})}function P(e){let t=e.x;e.x=e.y,e.y=t}});var Te=p((gi,Me)=>{"use strict";var Ce=m();Me.exports=Fr;function Fr(e){let t={},r=e.nodes().filter(s=>!e.children(s).length),n=r.map(s=>e.node(s).rank),i=Ce.applyWithChunking(Math.max,n),a=Ce.range(i+1).map(()=>[]);function o(s){if(t[s])return;t[s]=!0;let d=e.node(s);a[d.rank].push(s),e.successors(s).forEach(o)}return r.sort((s,d)=>e.node(s).rank-e.node(d).rank).forEach(o),a}});var _e=p((ki,je)=>{"use strict";var Br=m().zipObject;je.exports=Dr;function Dr(e,t){let r=0;for(let n=1;n<t.length;++n)r+=Yr(e,t[n-1],t[n]);return r}function Yr(e,t,r){let n=Br(r,r.map((d,u)=>u)),i=t.flatMap(d=>e.outEdges(d).map(u=>({pos:n[u.w],weight:e.edge(u).weight})).sort((u,h)=>u.pos-h.pos)),a=1;for(;a<r.length;)a<<=1;let o=2*a-1;a-=1;let l=new Array(o).fill(0),s=0;return i.forEach(d=>{let u=d.pos+a;l[u]+=d.weight;let h=0;for(;u>0;)u%2&&(h+=l[u+1]),u=u-1>>1,l[u]+=d.weight;s+=d.weight*h}),s}});var Pe=p((xi,Se)=>{Se.exports=Ar;function Ar(e,t=[]){return t.map(r=>{let n=e.inEdges(r);if(n.length){let i=n.reduce((a,o)=>{let l=e.edge(o),s=e.node(o.v);return{sum:a.sum+l.weight*s.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}});var Ve=p((yi,Ge)=>{"use strict";var Wr=m();Ge.exports=zr;function zr(e,t){let r={};e.forEach((i,a)=>{let o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};i.barycenter!==void 0&&(o.barycenter=i.barycenter,o.weight=i.weight)}),t.edges().forEach(i=>{let a=r[i.v],o=r[i.w];a!==void 0&&o!==void 0&&(o.indegree++,a.out.push(r[i.w]))});let n=Object.values(r).filter(i=>!i.indegree);return Xr(n)}function Xr(e){let t=[];function r(i){return a=>{a.merged||(a.barycenter===void 0||i.barycenter===void 0||a.barycenter>=i.barycenter)&&Hr(i,a)}}function n(i){return a=>{a.in.push(i),--a.indegree===0&&e.push(a)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(r(i)),i.out.forEach(n(i))}return t.filter(i=>!i.merged).map(i=>Wr.pick(i,["vs","i","barycenter","weight"]))}function Hr(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}});var De=p((vi,Be)=>{var Ur=m();Be.exports=Jr;function Jr(e,t){let r=Ur.partition(e,u=>Object.hasOwn(u,"barycenter")),n=r.lhs,i=r.rhs.sort((u,h)=>h.i-u.i),a=[],o=0,l=0,s=0;n.sort(Kr(!!t)),s=Fe(a,i,s),n.forEach(u=>{s+=u.vs.length,a.push(u.vs),o+=u.barycenter*u.weight,l+=u.weight,s=Fe(a,i,s)});let d={vs:a.flat(!0)};return l&&(d.barycenter=o/l,d.weight=l),d}function Fe(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Kr(e){return(t,r)=>t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}});var We=p((Ni,Ae)=>{var Qr=Pe(),Zr=Ve(),$r=De();Ae.exports=Ye;function Ye(e,t,r,n){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,l=a?a.borderRight:void 0,s={};o&&(i=i.filter(f=>f!==o&&f!==l));let d=Qr(e,i);d.forEach(f=>{if(e.children(f.v).length){let c=Ye(e,f.v,r,n);s[f.v]=c,Object.hasOwn(c,"barycenter")&&tn(f,c)}});let u=Zr(d,r);en(u,s);let h=$r(u,n);if(o&&(h.vs=[o,h.vs,l].flat(!0),e.predecessors(o).length)){let f=e.node(e.predecessors(o)[0]),c=e.node(e.predecessors(l)[0]);Object.hasOwn(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+c.order)/(h.weight+2),h.weight+=2}return h}function en(e,t){e.forEach(r=>{r.vs=r.vs.flatMap(n=>t[n]?t[n].vs:n)})}function tn(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}});var Xe=p((Oi,ze)=>{var rn=g("@dagrejs/graphlib").Graph,nn=m();ze.exports=on;function on(e,t,r,n){n||(n=e.nodes());let i=an(e),a=new rn({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(o=>e.node(o));return n.forEach(o=>{let l=e.node(o),s=e.parent(o);(l.rank===t||l.minRank<=t&&t<=l.maxRank)&&(a.setNode(o),a.setParent(o,s||i),e[r](o).forEach(d=>{let u=d.v===o?d.w:d.v,h=a.edge(u,o),f=h!==void 0?h.weight:0;a.setEdge(u,o,{weight:e.edge(d).weight+f})}),Object.hasOwn(l,"minRank")&&a.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]}))}),a}function an(e){for(var t;e.hasNode(t=nn.uniqueId("_root")););return t}});var Ue=p((Ii,He)=>{He.exports=ln;function ln(e,t,r){let n={},i;r.forEach(a=>{let o=e.parent(a),l,s;for(;o;){if(l=e.parent(o),l?(s=n[l],n[l]=o):(s=i,i=o),s&&s!==o){t.setEdge(s,o);return}o=l}})}});var $e=p((qi,Ze)=>{"use strict";var sn=Te(),dn=_e(),un=We(),hn=Xe(),fn=Ue(),cn=g("@dagrejs/graphlib").Graph,q=m();Ze.exports=Qe;function Qe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,Qe);return}let r=q.maxRank(e),n=Je(e,q.range(1,r+1),"inEdges"),i=Je(e,q.range(r-1,-1,-1),"outEdges"),a=sn(e);if(Ke(e,a),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,s=t.constraints||[];for(let d=0,u=0;u<4;++d,++u){pn(d%2?n:i,d%4>=2,s),a=q.buildLayerMatrix(e);let h=dn(e,a);h<o?(u=0,l=Object.assign({},a),o=h):h===o&&(l=structuredClone(a))}Ke(e,l)}function Je(e,t,r){let n=new Map,i=(a,o)=>{n.has(a)||n.set(a,[]),n.get(a).push(o)};for(let a of e.nodes()){let o=e.node(a);if(typeof o.rank=="number"&&i(o.rank,a),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&i(l,a)}return t.map(function(a){return hn(e,a,r,n.get(a)||[])})}function pn(e,t,r){let n=new cn;e.forEach(function(i){r.forEach(l=>n.setEdge(l.left,l.right));let a=i.graph().root,o=un(i,a,n,t);o.vs.forEach((l,s)=>i.node(l).order=s),fn(i,n,o.vs)})}function Ke(e,t){Object.values(t).forEach(r=>r.forEach((n,i)=>e.node(n).order=i))}});var dt=p((Li,st)=>{"use strict";var mn=g("@dagrejs/graphlib").Graph,k=m();st.exports={positionX:En,findType1Conflicts:et,findType2Conflicts:tt,addConflict:G,hasConflict:rt,verticalAlignment:nt,horizontalCompaction:it,alignCoordinates:at,findSmallestWidthAlignment:ot,balance:lt};function et(e,t){let r={};function n(i,a){let o=0,l=0,s=i.length,d=a[a.length-1];return a.forEach((u,h)=>{let f=bn(e,u),c=f?e.node(f).order:s;(f||u===d)&&(a.slice(l,h+1).forEach(b=>{e.predecessors(b).forEach(w=>{let x=e.node(w),B=x.order;(B<o||c<B)&&!(x.dummy&&e.node(b).dummy)&&G(r,w,b)})}),l=h+1,o=c)}),a}return t.length&&t.reduce(n),r}function tt(e,t){let r={};function n(a,o,l,s,d){let u;k.range(o,l).forEach(h=>{u=a[h],e.node(u).dummy&&e.predecessors(u).forEach(f=>{let c=e.node(f);c.dummy&&(c.order<s||c.order>d)&&G(r,f,u)})})}function i(a,o){let l=-1,s,d=0;return o.forEach((u,h)=>{if(e.node(u).dummy==="border"){let f=e.predecessors(u);f.length&&(s=e.node(f[0]).order,n(o,d,h,l,s),d=h,l=s)}n(o,d,o.length,s,a.length)}),o}return t.length&&t.reduce(i),r}function bn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(r=>e.node(r).dummy)}function G(e,t,r){if(t>r){let i=t;t=r,r=i}let n=e[t];n||(e[t]=n={}),n[r]=!0}function rt(e,t,r){if(t>r){let n=t;t=r,r=n}return!!e[t]&&Object.hasOwn(e[t],r)}function nt(e,t,r,n){let i={},a={},o={};return t.forEach(l=>{l.forEach((s,d)=>{i[s]=s,a[s]=s,o[s]=d})}),t.forEach(l=>{let s=-1;l.forEach(d=>{let u=n(d);if(u.length){u=u.sort((f,c)=>o[f]-o[c]);let h=(u.length-1)/2;for(let f=Math.floor(h),c=Math.ceil(h);f<=c;++f){let b=u[f];a[d]===d&&s<o[b]&&!rt(r,d,b)&&(a[b]=d,a[d]=i[d]=i[b],s=o[b])}}})}),{root:i,align:a}}function it(e,t,r,n,i){let a={},o=wn(e,t,r,i),l=i?"borderLeft":"borderRight";function s(h,f){let c=o.nodes().slice(),b={},w=c.pop();for(;w;){if(b[w])h(w);else{b[w]=!0,c.push(w);for(let x of f(w))c.push(x)}w=c.pop()}}function d(h){a[h]=o.inEdges(h).reduce((f,c)=>Math.max(f,a[c.v]+o.edge(c)),0)}function u(h){let f=o.outEdges(h).reduce((b,w)=>Math.min(b,a[w.w]-o.edge(w)),Number.POSITIVE_INFINITY),c=e.node(h);f!==Number.POSITIVE_INFINITY&&c.borderType!==l&&(a[h]=Math.max(a[h],f))}return s(d,o.predecessors.bind(o)),s(u,o.successors.bind(o)),Object.keys(n).forEach(h=>a[h]=a[r[h]]),a}function wn(e,t,r,n){let i=new mn,a=e.graph(),o=gn(a.nodesep,a.edgesep,n);return t.forEach(l=>{let s;l.forEach(d=>{let u=r[d];if(i.setNode(u),s){var h=r[s],f=i.edge(h,u);i.setEdge(h,u,Math.max(o(e,d,s),f||0))}s=d})}),i}function ot(e,t){return Object.values(t).reduce((r,n)=>{let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([l,s])=>{let d=kn(e,l)/2;i=Math.max(s+d,i),a=Math.min(s-d,a)});let o=i-a;return o<r[0]&&(r=[o,n]),r},[Number.POSITIVE_INFINITY,null])[1]}function at(e,t){let r=Object.values(t),n=k.applyWithChunking(Math.min,r),i=k.applyWithChunking(Math.max,r);["u","d"].forEach(a=>{["l","r"].forEach(o=>{let l=a+o,s=e[l];if(s===t)return;let d=Object.values(s),u=n-k.applyWithChunking(Math.min,d);o!=="l"&&(u=i-k.applyWithChunking(Math.max,d)),u&&(e[l]=k.mapValues(s,h=>h+u))})})}function lt(e,t){return k.mapValues(e.ul,(r,n)=>{if(t)return e[t.toLowerCase()][n];{let i=Object.values(e).map(a=>a[n]).sort((a,o)=>a-o);return(i[1]+i[2])/2}})}function En(e){let t=k.buildLayerMatrix(e),r=Object.assign(et(e,t),tt(e,t)),n={},i;["u","d"].forEach(o=>{i=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(i=i.map(h=>Object.values(h).reverse()));let s=(o==="u"?e.predecessors:e.successors).bind(e),d=nt(e,i,r,s),u=it(e,i,d.root,d.align,l==="r");l==="r"&&(u=k.mapValues(u,h=>-h)),n[o+l]=u})});let a=ot(e,n);return at(n,a),lt(n,e.graph().align)}function gn(e,t,r){return(n,i,a)=>{let o=n.node(i),l=n.node(a),s=0,d;if(s+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":d=-o.width/2;break;case"r":d=o.width/2;break}if(d&&(s+=r?d:-d),d=0,s+=(o.dummy?t:e)/2,s+=(l.dummy?t:e)/2,s+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":d=l.width/2;break;case"r":d=-l.width/2;break}return d&&(s+=r?d:-d),d=0,s}}function kn(e,t){return e.node(t).width}});var ft=p((Ri,ht)=>{"use strict";var ut=m(),xn=dt().positionX;ht.exports=yn;function yn(e){e=ut.asNonCompoundGraph(e),vn(e),Object.entries(xn(e)).forEach(([t,r])=>e.node(t).x=r)}function vn(e){let t=ut.buildLayerMatrix(e),r=e.graph().ranksep,n=0;t.forEach(i=>{let a=i.reduce((o,l)=>{let s=e.node(l).height;return o>s?o:s},0);i.forEach(o=>e.node(o).y=n+a/2),n+=a+r})}});var gt=p((Ci,Et)=>{"use strict";var ct=ee(),pt=re(),Nn=we(),On=m().normalizeRanks,In=ge(),qn=m().removeEmptyRanks,mt=ye(),Ln=Oe(),bt=Re(),Rn=$e(),Cn=ft(),E=m(),Mn=g("@dagrejs/graphlib").Graph;Et.exports=Tn;function Tn(e,t={}){let r=t.debugTiming?E.time:E.notime;return r("layout",()=>{let n=r(" buildLayoutGraph",()=>Yn(e));return r(" runLayout",()=>jn(n,r,t)),r(" updateInputGraph",()=>_n(e,n)),n})}function jn(e,t,r){t(" makeSpaceForEdgeLabels",()=>An(e)),t(" removeSelfEdges",()=>Zn(e)),t(" acyclic",()=>ct.run(e)),t(" nestingGraph.run",()=>mt.run(e)),t(" rank",()=>Nn(E.asNonCompoundGraph(e))),t(" injectEdgeLabelProxies",()=>Wn(e)),t(" removeEmptyRanks",()=>qn(e)),t(" nestingGraph.cleanup",()=>mt.cleanup(e)),t(" normalizeRanks",()=>On(e)),t(" assignRankMinMax",()=>zn(e)),t(" removeEdgeLabelProxies",()=>Xn(e)),t(" normalize.run",()=>pt.run(e)),t(" parentDummyChains",()=>In(e)),t(" addBorderSegments",()=>Ln(e)),t(" order",()=>Rn(e,r)),t(" insertSelfEdges",()=>$n(e)),t(" adjustCoordinateSystem",()=>bt.adjust(e)),t(" position",()=>Cn(e)),t(" positionSelfEdges",()=>ei(e)),t(" removeBorderNodes",()=>Qn(e)),t(" normalize.undo",()=>pt.undo(e)),t(" fixupEdgeLabelCoords",()=>Jn(e)),t(" undoCoordinateSystem",()=>bt.undo(e)),t(" translateGraph",()=>Hn(e)),t(" assignNodeIntersects",()=>Un(e)),t(" reversePoints",()=>Kn(e)),t(" acyclic.undo",()=>ct.undo(e))}function _n(e,t){e.nodes().forEach(r=>{let n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,n.order=i.order,n.rank=i.rank,t.children(r).length&&(n.width=i.width,n.height=i.height))}),e.edges().forEach(r=>{let n=e.edge(r),i=t.edge(r);n.points=i.points,Object.hasOwn(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Sn=["nodesep","edgesep","ranksep","marginx","marginy"],Pn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Gn=["acyclicer","ranker","rankdir","align"],Vn=["width","height","rank"],wt={width:0,height:0},Fn=["minlen","weight","width","height","labeloffset"],Bn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Dn=["labelpos"];function Yn(e){let t=new Mn({multigraph:!0,compound:!0}),r=F(e.graph());return t.setGraph(Object.assign({},Pn,V(r,Sn),E.pick(r,Gn))),e.nodes().forEach(n=>{let i=F(e.node(n)),a=V(i,Vn);Object.keys(wt).forEach(o=>{a[o]===void 0&&(a[o]=wt[o])}),t.setNode(n,a),t.setParent(n,e.parent(n))}),e.edges().forEach(n=>{let i=F(e.edge(n));t.setEdge(n,Object.assign({},Bn,V(i,Fn),E.pick(i,Dn)))}),t}function An(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(r=>{let n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function Wn(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.width&&r.height){let n=e.node(t.v),a={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};E.addDummyNode(e,"edge-proxy",a,"_ep")}})}function zn(e){let t=0;e.nodes().forEach(r=>{let n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Math.max(t,n.maxRank))}),e.graph().maxRank=t}function Xn(e){e.nodes().forEach(t=>{let r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function Hn(e){let t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,l=a.marginy||0;function s(d){let u=d.x,h=d.y,f=d.width,c=d.height;t=Math.min(t,u-f/2),r=Math.max(r,u+f/2),n=Math.min(n,h-c/2),i=Math.max(i,h+c/2)}e.nodes().forEach(d=>s(e.node(d))),e.edges().forEach(d=>{let u=e.edge(d);Object.hasOwn(u,"x")&&s(u)}),t-=o,n-=l,e.nodes().forEach(d=>{let u=e.node(d);u.x-=t,u.y-=n}),e.edges().forEach(d=>{let u=e.edge(d);u.points.forEach(h=>{h.x-=t,h.y-=n}),Object.hasOwn(u,"x")&&(u.x-=t),Object.hasOwn(u,"y")&&(u.y-=n)}),a.width=r-t+o,a.height=i-n+l}function Un(e){e.edges().forEach(t=>{let r=e.edge(t),n=e.node(t.v),i=e.node(t.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(E.intersectRect(n,a)),r.points.push(E.intersectRect(i,o))})}function Jn(e){e.edges().forEach(t=>{let r=e.edge(t);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Kn(e){e.edges().forEach(t=>{let r=e.edge(t);r.reversed&&r.points.reverse()})}function Qn(e){e.nodes().forEach(t=>{if(e.children(t).length){let r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(r.borderLeft[r.borderLeft.length-1]),o=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function Zn(e){e.edges().forEach(t=>{if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function $n(e){var t=E.buildLayerMatrix(e);t.forEach(r=>{var n=0;r.forEach((i,a)=>{var o=e.node(i);o.order=a+n,(o.selfEdges||[]).forEach(l=>{E.addDummyNode(e,"selfedge",{width:l.label.width,height:l.label.height,rank:o.rank,order:a+ ++n,e:l.e,label:l.label},"_se")}),delete o.selfEdges})})}function ei(e){e.nodes().forEach(t=>{var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,l=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-l},{x:i+5*o/6,y:a-l},{x:i+o,y:a},{x:i+5*o/6,y:a+l},{x:i+2*o/3,y:a+l}],r.label.x=r.x,r.label.y=r.y}})}function V(e,t){return E.mapValues(E.pick(e,t),Number)}function F(e){var t={};return e&&Object.entries(e).forEach(([r,n])=>{typeof r=="string"&&(r=r.toLowerCase()),t[r]=n}),t}});var xt=p((Mi,kt)=>{var ti=m(),ri=g("@dagrejs/graphlib").Graph;kt.exports={debugOrdering:ni};function ni(e){let t=ti.buildLayerMatrix(e),r=new ri({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(n=>{r.setNode(n,{label:n}),r.setParent(n,"layer"+e.node(n).rank)}),e.edges().forEach(n=>r.setEdge(n.v,n.w,{},n.name)),t.forEach((n,i)=>{let a="layer"+i;r.setNode(a,{rank:"same"}),n.reduce((o,l)=>(r.setEdge(o,l,{style:"invis"}),l))}),r}});var vt=p((Ti,yt)=>{yt.exports="2.0.1"});var ii=p((ji,Nt)=>{Nt.exports={graphlib:g("@dagrejs/graphlib"),layout:gt(),debug:xt(),util:{time:m().time,notime:m().notime},version:vt()}});return ii();})();
2
2
  /*! For license information please see dagre.min.js.LEGAL.txt */
3
3
  //# sourceMappingURL=dagre.min.js.map