import{A as F,a as y,f as kn,B as Pn,e as Q,C as nn,D as Nn,E as Qn,F as ne,l as ee,H as re,q as te,I as ie,w as A,J as ae,K as cn,L as oe,M as Ln,t as ue,z as R,k as de,N as fe,O as _n,P as Cn,Q as se,R as en,T as In,V as ce,W as Rn,y as D,n as le,X as he,Y as ve,G as g,Z as c,_ as pe,i as m,$ as T,a0 as O,a1 as G}from"./graph.BvS0Xx32.js";import{g as we,b as be,k as V,a as Tn,c as me,d as ge,e as ye,f as xe,i as Ee,h as Mn,j as Oe,m as w}from"./map.DsahiwlY.js";var ke=/\s/;function Pe(n){for(var e=n.length;e--&&ke.test(n.charAt(e)););return e}var Ne=/^\s+/;function Le(n){return n&&n.slice(0,Pe(n)+1).replace(Ne,"")}var ln=NaN,_e=/^[-+]0x[0-9a-f]+$/i,Ce=/^0b[01]+$/i,Ie=/^0o[0-7]+$/i,Re=parseInt;function Te(n){if(typeof n=="number")return n;if(F(n))return ln;if(y(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=y(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Le(n);var r=Ce.test(n);return r||Ie.test(n)?Re(n.slice(2),r?2:8):_e.test(n)?ln:+n}var hn=1/0,Me=17976931348623157e292;function S(n){if(!n)return n===0?n:0;if(n=Te(n),n===hn||n===-hn){var e=n<0?-1:1;return e*Me}return n===n?n:0}function Se(n){var e=S(n),r=e%1;return e===e?r?e-r:e:0}function _(n,e,r){if(!y(r))return!1;var t=typeof e;return(t=="number"?kn(r)&&Pn(e,r.length):t=="string"&&e in r)?Q(r[e],n):!1}function Fe(n){return nn(function(e,r){var t=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=n.length>3&&typeof o=="function"?(i--,o):void 0,a&&_(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++t2?e[2]:void 0;for(i&&_(e[0],e[1],i)&&(t=1);++r-1?i[o?e[a]:a]:void 0}}var Ke=Math.max;function Ze(n,e,r){var t=n==null?0:n.length;if(!t)return-1;var i=r==null?0:Se(r);return i<0&&(i=Ke(t+i,0)),fe(n,R(e),i)}var rn=Je(Ze);function Qe(n,e){return n==null?n:Ln(n,_n(e),V)}function nr(n,e){return n&&Cn(n,_n(e))}function er(n,e){return n>e}var rr=Object.prototype,tr=rr.hasOwnProperty;function ir(n,e){return n!=null&&tr.call(n,e)}function Bn(n,e){return n!=null&&se(n,e,ir)}function jn(n,e){return ne||o&&a&&d&&!u&&!f||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!f&&n=u)return d;var f=r[t];return d*(f=="desc"?-1:1)}}return n.index-e.index}function sr(n,e,r){e.length?e=D(e,function(o){return A(o)?function(a){return Rn(a,o.length===1?o[0]:o)}:o}):e=[en];var t=-1;e=D(e,le(R));var i=Oe(n,function(o,a,u){var d=D(e,function(f){return f(o)});return{criteria:d,index:++t,value:o}});return ur(i,function(o,a){return fr(o,a,r)})}function cr(n,e){return or(n,e,function(r,t){return he(n,t)})}var j=Ae(function(n,e){return n==null?{}:cr(n,e)}),lr=Math.ceil,hr=Math.max;function vr(n,e,r,t){for(var i=-1,o=hr(lr((e-n)/(r||1)),0),a=Array(o);o--;)a[++i]=n,n+=r;return a}function pr(n){return function(e,r,t){return t&&typeof t!="number"&&_(e,r,t)&&(r=t=void 0),e=S(e),r===void 0?(r=e,e=0):r=S(r),t=t===void 0?e1&&_(n,e[0],e[1])?e=[]:r>2&&_(e[0],e[1],e[2])&&(e=[e[0]]),sr(n,Nn(e),[])}),wr=0;function on(n){var e=++wr;return ve(n)+e}function br(n,e,r){for(var t=-1,i=n.length,o=e.length,a={};++t0;--u)if(a=e[u].dequeue(),a){t=t.concat(q(n,e,r,a,!0));break}}}return t}function q(n,e,r,t,i){var o=i?[]:void 0;return c(n.inEdges(t.v),function(a){var u=n.edge(a),d=n.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,Z(e,r,d)}),c(n.outEdges(t.v),function(a){var u=n.edge(a),d=a.w,f=n.node(d);f.in-=u,Z(e,r,f)}),n.removeNode(t.v),o}function kr(n,e){var r=new g,t=0,i=0;c(n.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(n.edges(),function(u){var d=r.edge(u.v,u.w)||0,f=e(u),s=d+f;r.setEdge(u.v,u.w,s),i=Math.max(i,r.node(u.v).out+=f),t=Math.max(t,r.node(u.w).in+=f)});var o=k(i+t+3).map(function(){return new gr}),a=t+1;return c(r.nodes(),function(u){Z(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function Z(n,e,r){r.out?r.in?n[r.out-r.in+e].enqueue(r):n[n.length-1].enqueue(r):n[0].enqueue(r)}function Pr(n){var e=n.graph().acyclicer==="greedy"?Er(n,r(n)):Nr(n);c(e,function(t){var i=n.edge(t);n.removeEdge(t),i.forwardName=t.name,i.reversed=!0,n.setEdge(t.w,t.v,i,on("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Nr(n){var e=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,c(n.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?e.push(a):i(a.w)}),delete r[o])}return c(n.nodes(),i),e}function Lr(n){c(n.edges(),function(e){var r=n.edge(e);if(r.reversed){n.removeEdge(e);var t=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(e.w,e.v,r,t)}})}function N(n,e,r,t){var i;do i=on(t);while(n.hasNode(i));return r.dummy=e,n.setNode(i,r),i}function _r(n){var e=new g().setGraph(n.graph());return c(n.nodes(),function(r){e.setNode(r,n.node(r))}),c(n.edges(),function(r){var t=e.edge(r.v,r.w)||{weight:0,minlen:1},i=n.edge(r);e.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),e}function Gn(n){var e=new g({multigraph:n.isMultigraph()}).setGraph(n.graph());return c(n.nodes(),function(r){n.children(r).length||e.setNode(r,n.node(r))}),c(n.edges(),function(r){e.setEdge(r,n.edge(r))}),e}function pn(n,e){var r=n.x,t=n.y,i=e.x-r,o=e.y-t,a=n.width/2,u=n.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,f;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,f=u):(i<0&&(a=-a),d=a,f=a*o/i),{x:r+d,y:t+f}}function $(n){var e=w(k(Vn(n)+1),function(){return[]});return c(n.nodes(),function(r){var t=n.node(r),i=t.rank;m(i)||(e[i][t.order]=r)}),e}function Cr(n){var e=C(w(n.nodes(),function(r){return n.node(r).rank}));c(n.nodes(),function(r){var t=n.node(r);Bn(t,"rank")&&(t.rank-=e)})}function Ir(n){var e=C(w(n.nodes(),function(o){return n.node(o).rank})),r=[];c(n.nodes(),function(o){var a=n.node(o).rank-e;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=n.graph().nodeRankFactor;c(r,function(o,a){m(o)&&a%i!==0?--t:t&&c(o,function(u){n.node(u).rank+=t})})}function wn(n,e,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),N(n,"border",i,e)}function Vn(n){return x(w(n.nodes(),function(e){var r=n.node(e).rank;if(!m(r))return r}))}function Rr(n,e){var r={lhs:[],rhs:[]};return c(n,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Tr(n,e){return e()}function Mr(n){function e(r){var t=n.children(r),i=n.node(r);if(t.length&&c(t,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;oa.lim&&(u=a,d=!0);var f=T(e.edges(),function(s){return d===gn(n,n.node(s.v),u)&&d!==gn(n,n.node(s.w),u)});return an(f,function(s){return I(e,s)})}function Un(n,e,r,t){var i=r.v,o=r.w;n.removeEdge(i,o),n.setEdge(t.v,t.w,{}),fn(n),dn(n,e),zr(n,e)}function zr(n,e){var r=rn(n.nodes(),function(i){return!e.node(i).parent}),t=Xr(n,r);t=t.slice(1),c(t,function(i){var o=n.node(i).parent,a=e.edge(i,o),u=!1;a||(a=e.edge(o,i),u=!0),e.node(i).rank=e.node(o).rank+(u?a.minlen:-a.minlen)})}function Ur(n,e,r){return n.hasEdge(e,r)}function gn(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Jr(n){switch(n.graph().ranker){case"network-simplex":yn(n);break;case"tight-tree":Zr(n);break;case"longest-path":Kr(n);break;default:yn(n)}}var Kr=un;function Zr(n){un(n),$n(n)}function yn(n){E(n)}function Qr(n){var e=N(n,"root",{},"_root"),r=nt(n),t=x(O(r))-1,i=2*t+1;n.graph().nestingRoot=e,c(n.edges(),function(a){n.edge(a).minlen*=i});var o=et(n)+1;c(n.children(),function(a){Jn(n,e,i,o,t,r,a)}),n.graph().nodeRankFactor=i}function Jn(n,e,r,t,i,o,a){var u=n.children(a);if(!u.length){a!==e&&n.setEdge(e,a,{weight:0,minlen:r});return}var d=wn(n,"_bt"),f=wn(n,"_bb"),s=n.node(a);n.setParent(d,a),s.borderTop=d,n.setParent(f,a),s.borderBottom=f,c(u,function(l){Jn(n,e,r,t,i,o,l);var h=n.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,L=v!==p?1:i-o[a]+1;n.setEdge(d,v,{weight:b,minlen:L,nestingEdge:!0}),n.setEdge(p,f,{weight:b,minlen:L,nestingEdge:!0})}),n.parent(a)||n.setEdge(e,d,{weight:0,minlen:i+o[a]})}function nt(n){var e={};function r(t,i){var o=n.children(t);o&&o.length&&c(o,function(a){r(a,i+1)}),e[t]=i}return c(n.children(),function(t){r(t,1)}),e}function et(n){return G(n.edges(),function(e,r){return e+n.edge(r).weight},0)}function rt(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,c(n.edges(),function(r){var t=n.edge(r);t.nestingEdge&&n.removeEdge(r)})}function tt(n,e,r){var t={},i;c(r,function(o){for(var a=n.parent(o),u,d;a;){if(u=n.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){e.setEdge(d,a);return}a=u}})}function it(n,e,r){var t=at(n),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return n.node(o)});return c(n.nodes(),function(o){var a=n.node(o),u=n.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),c(n[r](o),function(d){var f=d.v===o?d.w:d.v,s=i.edge(f,o),l=m(s)?0:s.weight;i.setEdge(f,o,{weight:n.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i}function at(n){for(var e;n.hasNode(e=on("_root")););return e}function ot(n,e){for(var r=0,t=1;t0;)s%2&&(l+=u[s+1]),s=s-1>>1,u[s]+=f.weight;d+=f.weight*l})),d}function dt(n){var e={},r=T(n.nodes(),function(u){return!n.children(u).length}),t=x(w(r,function(u){return n.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!Bn(e,u)){e[u]=!0;var d=n.node(u);i[d.rank].push(u),c(n.successors(u),o)}}var a=M(r,function(u){return n.node(u).rank});return c(a,o),i}function ft(n,e){return w(e,function(r){var t=n.inEdges(r);if(t.length){var i=G(t,function(o,a){var u=n.edge(a),d=n.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function st(n,e){var r={};c(n,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(e.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=T(r,function(i){return!i.indegree});return ct(t)}function ct(n){var e=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&<(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&n.push(a)}}for(;n.length;){var i=n.pop();e.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return w(T(e,function(o){return!o.merged}),function(o){return j(o,["vs","i","barycenter","weight"])})}function lt(n,e){var r=0,t=0;n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=r/t,n.weight=t,n.i=Math.min(e.i,n.i),e.merged=!0}function ht(n,e){var r=Rr(n,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=M(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,d=0;t.sort(vt(!!e)),d=xn(o,i,d),c(t,function(s){d+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,d=xn(o,i,d)});var f={vs:P(o)};return u&&(f.barycenter=a/u,f.weight=u),f}function xn(n,e,r){for(var t;e.length&&(t=B(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function vt(n){return function(e,r){return e.barycenterr.barycenter?1:n?r.i-e.i:e.i-r.i}}function Kn(n,e,r,t){var i=n.children(e),o=n.node(e),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=T(i,function(p){return p!==a&&p!==u}));var f=ft(n,i);c(f,function(p){if(n.children(p.v).length){var b=Kn(n,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&wt(p,b)}});var s=st(f,r);pt(s,d);var l=ht(s,t);if(a&&(l.vs=P([a,l.vs,u]),n.predecessors(a).length)){var h=n.node(n.predecessors(a)[0]),v=n.node(n.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function pt(n,e){c(n,function(r){r.vs=P(r.vs.map(function(t){return e[t]?e[t].vs:t}))})}function wt(n,e){m(n.barycenter)?(n.barycenter=e.barycenter,n.weight=e.weight):(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight)}function bt(n){var e=Vn(n),r=En(n,k(1,e+1),"inEdges"),t=En(n,k(e-1,-1,-1),"outEdges"),i=dt(n);On(n,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){mt(u%2?r:t,u%4>=2),i=$(n);var f=ot(n,i);fa||u>e[d].lim));for(f=d,d=t;(d=n.parent(d))!==f;)o.push(d);return{path:i.concat(o.reverse()),lca:f}}function xt(n){var e={},r=0;function t(i){var o=r;c(n.children(i),t),e[i]={low:o,lim:r++}}return c(n.children(),t),e}function Et(n,e){var r={};function t(i,o){var a=0,u=0,d=i.length,f=B(o);return c(o,function(s,l){var h=kt(n,s),v=h?n.node(h).order:d;(h||s===f)&&(c(o.slice(u,l+1),function(p){c(n.predecessors(p),function(b){var L=n.node(b),sn=L.order;(snf)&&Zn(r,h,s)})})}function i(o,a){var u=-1,d,f=0;return c(a,function(s,l){if(n.node(s).dummy==="border"){var h=n.predecessors(s);h.length&&(d=n.node(h[0]).order,t(a,f,l,u,d),f=l,u=d)}t(a,f,a.length,d,o.length)}),a}return G(e,i),r}function kt(n,e){if(n.node(e).dummy)return rn(n.predecessors(e),function(r){return n.node(r).dummy})}function Zn(n,e,r){if(e>r){var t=e;e=r,r=t}Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=n[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Pt(n,e,r){if(e>r){var t=e;e=r,r=t}return!!n[e]&&Object.prototype.hasOwnProperty.call(n[e],r)}function Nt(n,e,r,t){var i={},o={},a={};return c(e,function(u){c(u,function(d,f){i[d]=d,o[d]=d,a[d]=f})}),c(e,function(u){var d=-1;c(u,function(f){var s=t(f);if(s.length){s=M(s,function(b){return a[b]});for(var l=(s.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=s[h];o[f]===f&&d{var t=r(" buildLayoutGraph",()=>Ht(n));r(" runLayout",()=>Bt(t,r)),r(" updateInputGraph",()=>jt(n,t))})}function Bt(n,e){e(" makeSpaceForEdgeLabels",()=>zt(n)),e(" removeSelfEdges",()=>ti(n)),e(" acyclic",()=>Pr(n)),e(" nestingGraph.run",()=>Qr(n)),e(" rank",()=>Jr(Gn(n))),e(" injectEdgeLabelProxies",()=>Ut(n)),e(" removeEmptyRanks",()=>Ir(n)),e(" nestingGraph.cleanup",()=>rt(n)),e(" normalizeRanks",()=>Cr(n)),e(" assignRankMinMax",()=>Jt(n)),e(" removeEdgeLabelProxies",()=>Kt(n)),e(" normalize.run",()=>jr(n)),e(" parentDummyChains",()=>gt(n)),e(" addBorderSegments",()=>Mr(n)),e(" order",()=>bt(n)),e(" insertSelfEdges",()=>ii(n)),e(" adjustCoordinateSystem",()=>Sr(n)),e(" position",()=>Ft(n)),e(" positionSelfEdges",()=>ai(n)),e(" removeBorderNodes",()=>ri(n)),e(" normalize.undo",()=>Vr(n)),e(" fixupEdgeLabelCoords",()=>ni(n)),e(" undoCoordinateSystem",()=>Fr(n)),e(" translateGraph",()=>Zt(n)),e(" assignNodeIntersects",()=>Qt(n)),e(" reversePoints",()=>ei(n)),e(" acyclic.undo",()=>Lr(n))}function jt(n,e){c(n.nodes(),function(r){var t=n.node(r),i=e.node(r);t&&(t.x=i.x,t.y=i.y,e.children(r).length&&(t.width=i.width,t.height=i.height))}),c(n.edges(),function(r){var t=n.edge(r),i=e.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var Gt=["nodesep","edgesep","ranksep","marginx","marginy"],Vt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Yt=["acyclicer","ranker","rankdir","align"],$t=["width","height"],Dt={width:0,height:0},qt=["minlen","weight","width","height","labeloffset"],Wt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Xt=["labelpos"];function Ht(n){var e=new g({multigraph:!0,compound:!0}),r=z(n.graph());return e.setGraph(K({},Vt,H(r,Gt),j(r,Yt))),c(n.nodes(),function(t){var i=z(n.node(t));e.setNode(t,He(H(i,$t),Dt)),e.setParent(t,n.parent(t))}),c(n.edges(),function(t){var i=z(n.edge(t));e.setEdge(t,K({},Wt,H(i,qt),j(i,Xt)))}),e}function zt(n){var e=n.graph();e.ranksep/=2,c(n.edges(),function(r){var t=n.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Ut(n){c(n.edges(),function(e){var r=n.edge(e);if(r.width&&r.height){var t=n.node(e.v),i=n.node(e.w),o={rank:(i.rank-t.rank)/2+t.rank,e};N(n,"edge-proxy",o,"_ep")}})}function Jt(n){var e=0;c(n.nodes(),function(r){var t=n.node(r);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,e=x(e,t.maxRank))}),n.graph().maxRank=e}function Kt(n){c(n.nodes(),function(e){var r=n.node(e);r.dummy==="edge-proxy"&&(n.edge(r.e).labelRank=r.rank,n.removeNode(e))})}function Zt(n){var e=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=n.graph(),a=o.marginx||0,u=o.marginy||0;function d(f){var s=f.x,l=f.y,h=f.width,v=f.height;e=Math.min(e,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/2)}c(n.nodes(),function(f){d(n.node(f))}),c(n.edges(),function(f){var s=n.edge(f);Object.prototype.hasOwnProperty.call(s,"x")&&d(s)}),e-=a,t-=u,c(n.nodes(),function(f){var s=n.node(f);s.x-=e,s.y-=t}),c(n.edges(),function(f){var s=n.edge(f);c(s.points,function(l){l.x-=e,l.y-=t}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=e),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=t)}),o.width=r-e+a,o.height=i-t+u}function Qt(n){c(n.edges(),function(e){var r=n.edge(e),t=n.node(e.v),i=n.node(e.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(pn(t,o)),r.points.push(pn(i,a))})}function ni(n){c(n.edges(),function(e){var r=n.edge(e);if(Object.prototype.hasOwnProperty.call(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 ei(n){c(n.edges(),function(e){var r=n.edge(e);r.reversed&&r.points.reverse()})}function ri(n){c(n.nodes(),function(e){if(n.children(e).length){var r=n.node(e),t=n.node(r.borderTop),i=n.node(r.borderBottom),o=n.node(B(r.borderLeft)),a=n.node(B(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),c(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function ti(n){c(n.edges(),function(e){if(e.v===e.w){var r=n.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:n.edge(e)}),n.removeEdge(e)}})}function ii(n){var e=$(n);c(e,function(r){var t=0;c(r,function(i,o){var a=n.node(i);a.order=o+t,c(a.selfEdges,function(u){N(n,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function ai(n){c(n.nodes(),function(e){var r=n.node(e);if(r.dummy==="selfedge"){var t=n.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;n.setEdge(r.e,r.label),n.removeNode(e),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function H(n,e){return Y(j(n,e),Number)}function z(n){var e={};return c(n,function(r,t){e[t.toLowerCase()]=r}),e}export{di as l};