import{i as F,b as gn,a as zn,c as L,k as Xn,d as Un,e as Hn,g as P,j as xn,l as En,m as kn,t as jn,n as yn,o as Kn,p as Jn,f as s,G as x,h as w,q as g,r as M,v as y,s as Y}from"./graph.kiq1lfdl.js";import{R as A,ag as Qn,ah as Zn,a6 as Nn,ai as B,K as Ln,_ as ne,E as _n,D as K,a4 as ee,aj as re,a3 as J,a2 as te,Y as Cn,Q as ie,a8 as ae,ak as H}from"../app.CV7ObeM5.js";var oe=/\s/;function ue(n){for(var e=n.length;e--&&oe.test(n.charAt(e)););return e}var de=/^\s+/;function fe(n){return n&&n.slice(0,ue(n)+1).replace(de,"")}var un=NaN,se=/^[-+]0x[0-9a-f]+$/i,ce=/^0b[01]+$/i,he=/^0o[0-7]+$/i,le=parseInt;function ve(n){if(typeof n=="number")return n;if(F(n))return un;if(A(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=A(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=fe(n);var r=ce.test(n);return r||he.test(n)?le(n.slice(2),r?2:8):se.test(n)?un:+n}var dn=1/0,pe=17976931348623157e292;function S(n){if(!n)return n===0?n:0;if(n=ve(n),n===dn||n===-dn){var e=n<0?-1:1;return e*pe}return n===n?n:0}function we(n){var e=S(n),r=e%1;return e===e?r?e-r:e:0}function _(n){var e=n==null?0:n.length;return e?gn(n):[]}function me(n){return Qn(Zn(n,void 0,_),n+"")}var be=1,ge=4;function xe(n){return zn(n,be|ge)}var In=Object.prototype,Ee=In.hasOwnProperty,ke=Nn(function(n,e){n=Object(n);var r=-1,t=e.length,i=t>2?e[2]:void 0;for(i&&B(e[0],e[1],i)&&(t=1);++r-1?i[o?e[a]:a]:void 0}}var Ne=Math.max;function Le(n,e,r){var t=n==null?0:n.length;if(!t)return-1;var i=r==null?0:we(r);return i<0&&(i=Ne(t+i,0)),Un(n,L(e),i)}var Q=ye(Le);function Rn(n,e){var r=-1,t=_n(n)?Array(n.length):[];return Hn(n,function(i,o,a){t[++r]=e(i,o,a)}),t}function m(n,e){var r=K(n)?P:Rn;return r(n,L(e))}function _e(n,e){return n==null?n:ee(n,xn(e),Ln)}function Ce(n,e){return n&&En(n,xn(e))}function Ie(n,e){return n>e}function Tn(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 Se(n,e,r){e.length?e=P(e,function(o){return K(o)?function(a){return yn(a,o.length===1?o[0]:o)}:o}):e=[J];var t=-1;e=P(e,ie(L));var i=Rn(n,function(o,a,u){var d=P(e,function(f){return f(o)});return{criteria:d,index:++t,value:o}});return Me(i,function(o,a){return Pe(o,a,r)})}function Fe(n,e){return Te(n,e,function(r,t){return Kn(n,t)})}var V=me(function(n,e){return n==null?{}:Fe(n,e)}),Ae=Math.ceil,Be=Math.max;function Ge(n,e,r,t){for(var i=-1,o=Be(Ae((e-n)/(r||1)),0),a=Array(o);o--;)a[++i]=n,n+=r;return a}function Ve(n){return function(e,r,t){return t&&typeof t!="number"&&B(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&&B(n,e[0],e[1])?e=[]:r>2&&B(e[0],e[1],e[2])&&(e=[e[0]]),Se(n,gn(e),[])}),Ye=0;function en(n){var e=++Ye;return Jn(n)+e}function De(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 s(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,j(e,r,d)}),s(n.outEdges(t.v),function(a){var u=n.edge(a),d=a.w,f=n.node(d);f.in-=u,j(e,r,f)}),n.removeNode(t.v),o}function He(n,e){var r=new x,t=0,i=0;s(n.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),s(n.edges(),function(u){var d=r.edge(u.v,u.w)||0,f=e(u),c=d+f;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=f),t=Math.max(t,r.node(u.w).in+=f)});var o=N(i+t+3).map(function(){return new qe}),a=t+1;return s(r.nodes(),function(u){j(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function j(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 je(n){var e=n.graph().acyclicer==="greedy"?Xe(n,r(n)):Ke(n);s(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,en("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Ke(n){var e=[],r={},t={};function i(o){w(t,o)||(t[o]=!0,r[o]=!0,s(n.outEdges(o),function(a){w(r,a.w)?e.push(a):i(a.w)}),delete r[o])}return s(n.nodes(),i),e}function Je(n){s(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 C(n,e,r,t){var i;do i=en(t);while(n.hasNode(i));return r.dummy=e,n.setNode(i,r),i}function Qe(n){var e=new x().setGraph(n.graph());return s(n.nodes(),function(r){e.setNode(r,n.node(r))}),s(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 Mn(n){var e=new x({multigraph:n.isMultigraph()}).setGraph(n.graph());return s(n.nodes(),function(r){n.children(r).length||e.setNode(r,n.node(r))}),s(n.edges(),function(r){e.setEdge(r,n.edge(r))}),e}function sn(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=m(N(On(n)+1),function(){return[]});return s(n.nodes(),function(r){var t=n.node(r),i=t.rank;g(i)||(e[i][t.order]=r)}),e}function Ze(n){var e=R(m(n.nodes(),function(r){return n.node(r).rank}));s(n.nodes(),function(r){var t=n.node(r);w(t,"rank")&&(t.rank-=e)})}function nr(n){var e=R(m(n.nodes(),function(o){return n.node(o).rank})),r=[];s(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;s(r,function(o,a){g(o)&&a%i!==0?--t:t&&s(o,function(u){n.node(u).rank+=t})})}function cn(n,e,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),C(n,"border",i,e)}function On(n){return E(m(n.nodes(),function(e){var r=n.node(e).rank;if(!g(r))return r}))}function er(n,e){var r={lhs:[],rhs:[]};return s(n,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function rr(n,e){return e()}function tr(n){function e(r){var t=n.children(r),i=n.node(r);if(t.length&&s(t,e),w(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;oa.lim&&(u=a,d=!0);var f=M(e.edges(),function(c){return d===vn(n,n.node(c.v),u)&&d!==vn(n,n.node(c.w),u)});return nn(f,function(c){return T(e,c)})}function Dn(n,e,r,t){var i=r.v,o=r.w;n.removeEdge(i,o),n.setEdge(t.v,t.w,{}),an(n),tn(n,e),br(n,e)}function br(n,e){var r=Q(n.nodes(),function(i){return!e.node(i).parent}),t=wr(n,r);t=t.slice(1),s(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 gr(n,e,r){return n.hasEdge(e,r)}function vn(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function xr(n){switch(n.graph().ranker){case"network-simplex":pn(n);break;case"tight-tree":kr(n);break;case"longest-path":Er(n);break;default:pn(n)}}var Er=rn;function kr(n){rn(n),Sn(n)}function pn(n){k(n)}function yr(n){var e=C(n,"root",{},"_root"),r=Nr(n),t=E(y(r))-1,i=2*t+1;n.graph().nestingRoot=e,s(n.edges(),function(a){n.edge(a).minlen*=i});var o=Lr(n)+1;s(n.children(),function(a){$n(n,e,i,o,t,r,a)}),n.graph().nodeRankFactor=i}function $n(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=cn(n,"_bt"),f=cn(n,"_bb"),c=n.node(a);n.setParent(d,a),c.borderTop=d,n.setParent(f,a),c.borderBottom=f,s(u,function(h){$n(n,e,r,t,i,o,h);var l=n.node(h),v=l.borderTop?l.borderTop:h,p=l.borderBottom?l.borderBottom:h,b=l.borderTop?t:2*t,I=v!==p?1:i-o[a]+1;n.setEdge(d,v,{weight:b,minlen:I,nestingEdge:!0}),n.setEdge(p,f,{weight:b,minlen:I,nestingEdge:!0})}),n.parent(a)||n.setEdge(e,d,{weight:0,minlen:i+o[a]})}function Nr(n){var e={};function r(t,i){var o=n.children(t);o&&o.length&&s(o,function(a){r(a,i+1)}),e[t]=i}return s(n.children(),function(t){r(t,1)}),e}function Lr(n){return Y(n.edges(),function(e,r){return e+n.edge(r).weight},0)}function _r(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,s(n.edges(),function(r){var t=n.edge(r);t.nestingEdge&&n.removeEdge(r)})}function Cr(n,e,r){var t={},i;s(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 Ir(n,e,r){var t=Rr(n),i=new x({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return n.node(o)});return s(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),s(n[r](o),function(d){var f=d.v===o?d.w:d.v,c=i.edge(f,o),h=g(c)?0:c.weight;i.setEdge(f,o,{weight:n.edge(d).weight+h})}),w(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i}function Rr(n){for(var e;n.hasNode(e=en("_root")););return e}function Tr(n,e){for(var r=0,t=1;t0;)c%2&&(h+=u[c+1]),c=c-1>>1,u[c]+=f.weight;d+=f.weight*h})),d}function Or(n){var e={},r=M(n.nodes(),function(u){return!n.children(u).length}),t=E(m(r,function(u){return n.node(u).rank})),i=m(N(t+1),function(){return[]});function o(u){if(!w(e,u)){e[u]=!0;var d=n.node(u);i[d.rank].push(u),s(n.successors(u),o)}}var a=O(r,function(u){return n.node(u).rank});return s(a,o),i}function Pr(n,e){return m(e,function(r){var t=n.inEdges(r);if(t.length){var i=Y(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 Sr(n,e){var r={};s(n,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};g(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),s(e.edges(),function(i){var o=r[i.v],a=r[i.w];!g(o)&&!g(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=M(r,function(i){return!i.indegree});return Fr(t)}function Fr(n){var e=[];function r(o){return function(a){a.merged||(g(a.barycenter)||g(o.barycenter)||a.barycenter>=o.barycenter)&&Ar(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),s(i.in.reverse(),r(i)),s(i.out,t(i))}return m(M(e,function(o){return!o.merged}),function(o){return V(o,["vs","i","barycenter","weight"])})}function Ar(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 Br(n,e){var r=er(n,function(c){return w(c,"barycenter")}),t=r.lhs,i=O(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort(Gr(!!e)),d=wn(o,i,d),s(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=wn(o,i,d)});var f={vs:_(o)};return u&&(f.barycenter=a/u,f.weight=u),f}function wn(n,e,r){for(var t;e.length&&(t=G(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function Gr(n){return function(e,r){return e.barycenterr.barycenter?1:n?r.i-e.i:e.i-r.i}}function qn(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=M(i,function(p){return p!==a&&p!==u}));var f=Pr(n,i);s(f,function(p){if(n.children(p.v).length){var b=qn(n,p.v,r,t);d[p.v]=b,w(b,"barycenter")&&Yr(p,b)}});var c=Sr(f,r);Vr(c,d);var h=Br(c,t);if(a&&(h.vs=_([a,h.vs,u]),n.predecessors(a).length)){var l=n.node(n.predecessors(a)[0]),v=n.node(n.predecessors(u)[0]);w(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+l.order+v.order)/(h.weight+2),h.weight+=2}return h}function Vr(n,e){s(n,function(r){r.vs=_(r.vs.map(function(t){return e[t]?e[t].vs:t}))})}function Yr(n,e){g(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 Dr(n){var e=On(n),r=mn(n,N(1,e+1),"inEdges"),t=mn(n,N(e-1,-1,-1),"outEdges"),i=Or(n);bn(n,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){$r(u%2?r:t,u%4>=2),i=$(n);var f=Tr(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 zr(n){var e={},r=0;function t(i){var o=r;s(n.children(i),t),e[i]={low:o,lim:r++}}return s(n.children(),t),e}function Xr(n,e){var r={};function t(i,o){var a=0,u=0,d=i.length,f=G(o);return s(o,function(c,h){var l=Hr(n,c),v=l?n.node(l).order:d;(l||c===f)&&(s(o.slice(u,h+1),function(p){s(n.predecessors(p),function(b){var I=n.node(b),on=I.order;(onf)&&Wn(r,l,c)})})}function i(o,a){var u=-1,d,f=0;return s(a,function(c,h){if(n.node(c).dummy==="border"){var l=n.predecessors(c);l.length&&(d=n.node(l[0]).order,t(a,f,h,u,d),f=h,u=d)}t(a,f,a.length,d,o.length)}),a}return Y(e,i),r}function Hr(n,e){if(n.node(e).dummy)return Q(n.predecessors(e),function(r){return n.node(r).dummy})}function Wn(n,e,r){if(e>r){var t=e;e=r,r=t}var i=n[e];i||(n[e]=i={}),i[r]=!0}function jr(n,e,r){if(e>r){var t=e;e=r,r=t}return w(n[e],r)}function Kr(n,e,r,t){var i={},o={},a={};return s(e,function(u){s(u,function(d,f){i[d]=d,o[d]=d,a[d]=f})}),s(e,function(u){var d=-1;s(u,function(f){var c=t(f);if(c.length){c=O(c,function(b){return a[b]});for(var h=(c.length-1)/2,l=Math.floor(h),v=Math.ceil(h);l<=v;++l){var p=c[l];o[f]===f&&d