@knowvah/dot-engine 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +7 -4
  2. package/package.json +10 -9
  3. package/dist/bundle.js +0 -101
package/dist/bundle.js DELETED
@@ -1,101 +0,0 @@
1
- "use strict";var s0=Object.defineProperty;var TA=Object.getOwnPropertyDescriptor;var kA=Object.getOwnPropertyNames;var CA=Object.prototype.hasOwnProperty;var _A=(e,n)=>{for(var t in n)s0(e,t,{get:n[t],enumerable:!0})},AA=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of kA(n))!CA.call(e,r)&&r!==t&&s0(e,r,{get:()=>n[r],enumerable:!(o=TA(n,r))||o.enumerable});return e};var GA=e=>AA(s0({},"__esModule",{value:!0}),e);var qfe={};_A(qfe,{CanvasTextMeasurer:()=>Ts,DEFAULT_DRAW_ENGINE:()=>fg,EstimateTextMeasurer:()=>$r,GvcContext:()=>ps,LutTextMeasurer:()=>Rs,ParseError:()=>mo,RenderError:()=>Ye,addEdge:()=>Kp,createGraph:()=>WC,getDrawOps:()=>qC,getLayout:()=>JC,getTextMeasurer:()=>o6,parse:()=>Wo,render:()=>KC,renderSvg:()=>e_,renderWithContext:()=>eo,setImageSizer:()=>N4,setTextMeasurer:()=>t6,tryRenderSvg:()=>Kfe});module.exports=GA(qfe);var pa=class extends SyntaxError{constructor(n,t,o,r){super(n),this.expected=t,this.found=o,this.location=r,this.name="SyntaxError"}format(n){let t="Error: "+this.message;if(this.location){let o=null,r=n.find(a=>a.source===this.location.source);r&&(o=r.text.split(/\r\n|\n|\r/g));let i=this.location.start,s=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(i):i,l=this.location.source+":"+s.line+":"+s.column;if(o){let a=this.location.end,u="".padEnd(s.line.toString().length," "),f=o[i.line-1],c=(i.line===a.line?a.column:f.length+1)-i.column||1;t+=`
2
- --> `+l+`
3
- `+u+` |
4
- `+s.line+" | "+f+`
5
- `+u+" | "+"".padEnd(i.column-1," ")+"".padEnd(c,"^")}else t+=`
6
- at `+l}return t}static buildMessage(n,t){function o(c){return c.codePointAt(0).toString(16).toUpperCase()}let r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function i(c){return r?c.replace(r,m=>"\\u{"+o(m)+"}"):c}function s(c){return i(c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,m=>"\\x0"+o(m)).replace(/[\x10-\x1F\x7F-\x9F]/g,m=>"\\x"+o(m)))}function l(c){return i(c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,m=>"\\x0"+o(m)).replace(/[\x10-\x1F\x7F-\x9F]/g,m=>"\\x"+o(m)))}let a={literal(c){return'"'+s(c.text)+'"'},class(c){let m=c.parts.map(b=>Array.isArray(b)?l(b[0])+"-"+l(b[1]):l(b));return"["+(c.inverted?"^":"")+m.join("")+"]"+(c.unicode?"u":"")},any(){return"any character"},end(){return"end of input"},other(c){return c.description}};function u(c){return a[c.type](c)}function f(c){let m=c.map(u);if(m.sort(),m.length>0){let b=1;for(let g=1;g<m.length;g++)m[g-1]!==m[g]&&(m[b]=m[g],b++);m.length=b}switch(m.length){case 1:return m[0];case 2:return m[0]+" or "+m[1];default:return m.slice(0,-1).join(", ")+", or "+m[m.length-1]}}function d(c){return c?'"'+s(c)+'"':"end of input"}return"Expected "+f(n)+" but "+d(t)+" found."}};function Kg(e,n){n=n!==void 0?n:{};let t={},o=n.grammarSource,r={Graph:Og},i=Og,s="{",l="}",a=";",u="[",f="]",d="=",c=":",m="->",b="--",g="+",E='"',R='\\"',N=`\\
7
- `,C="\\",ne="<",I=">",me="-",Xe=".",Do="/*",Bo="*/",Tf="//",la=`
8
- `,aa="#",dg=/^[;,]/,n_=/^[^"\\]/,t_=/^[^<>]/,o_=/^[A-Za-z_\x80-\uFFFF]/,qp=/^[A-Za-z_0-9\x80-\uFFFF]/,Fo=/^[0-9]/,r_=/^[eE]/,i_=/^[+\-]/,kf=/^[Ss]/,Cf=/^[Tt]/,zo=/^[Rr]/,_f=/^[Ii]/,cg=/^[Cc]/,jo=/^[Gg]/,Qi=/^[Aa]/,Zi=/^[Pp]/,es=/^[Hh]/,ns=/^[Dd]/,pg=/^[Nn]/,mg=/^[Oo]/,ts=/^[Ee]/,xg=/^[Uu]/,hg=/^[Bb]/,Af=/^[ \t\r\n]/,Gf=/^[^\n]/,Mf=Se("{",!1),Lf=Se("}",!1),bg=Se(";",!1),gg=Se("[",!1),yg=Se("]",!1),Pg=ye([";",","],!1,!1,!1),s_=Se("=",!1),Qp=Se(":",!1),l_=Mg("edge operator"),a_=Se("->",!1),u_=Se("--",!1),Eg=Se("+",!1),vg=Se('"',!1),f_=Se('\\"',!1),d_=Se(`\\
9
- `,!1),c_=Se("\\",!1),ua=oA(),p_=ye(['"',"\\"],!0,!1,!1),Sg=Se("<",!1),wg=Se(">",!1),m_=ye(["<",">"],!0,!1,!1),x_=ye([["A","Z"],["a","z"],"_",["\x80","\uFFFF"]],!1,!1,!1),Zp=ye([["A","Z"],["a","z"],"_",["0","9"],["\x80","\uFFFF"]],!1,!1,!1),h_=Se("-",!1),Ho=ye([["0","9"]],!1,!1,!1),Ng=Se(".",!1),b_=ye(["e","E"],!1,!1,!1),g_=ye(["+","-"],!1,!1,!1),If=ye(["S","s"],!1,!1,!1),Of=ye(["T","t"],!1,!1,!1),Vo=ye(["R","r"],!1,!1,!1),Df=ye(["I","i"],!1,!1,!1),Rg=ye(["C","c"],!1,!1,!1),Uo=ye(["G","g"],!1,!1,!1),os=ye(["A","a"],!1,!1,!1),rs=ye(["P","p"],!1,!1,!1),is=ye(["H","h"],!1,!1,!1),ss=ye(["D","d"],!1,!1,!1),Tg=ye(["N","n"],!1,!1,!1),kg=ye(["O","o"],!1,!1,!1),ls=ye(["E","e"],!1,!1,!1),Cg=ye(["U","u"],!1,!1,!1),_g=ye(["B","b"],!1,!1,!1),Bf=ye([" "," ","\r",`
10
- `],!1,!1,!1),y_=Se("/*",!1),e0=Se("*/",!1),P_=Se("//",!1),Ff=ye([`
11
- `],!0,!1,!1),Ag=Se(`
12
- `,!1),E_=Se("#",!1);function v_(p,h,P,y){return{type:"graph",strict:p,directed:h,id:P,stmts:y}}function S_(){return{type:"graph",strict:!1,directed:!1,id:null,stmts:[]}}function w_(){return!0}function N_(){return!1}function R_(){return!0}function T_(){return!1}function Qfe(p){return p}function k_(){return null}function Zfe(p){return p}function ede(p){return p}function nde(p){return p}function tde(p){return p}function C_(p,h){return{type:"attr",target:p,attrs:h}}function __(p){return{type:"assign",key:p.key,value:p.value}}function A_(){return"graph"}function G_(){return"node"}function M_(){return"edge"}function L_(p,h){return p.concat(h)}function ode(p){return p}function I_(){return[]}function rde(p){return p}function ide(p){return p}function O_(p,h){return{key:p,value:h}}function D_(p,h,P){return h.length>0?{type:"edge",nodes:[p].concat(h),attrs:P}:p.type==="subgraph"?p:{type:"node",id:p,attrs:P}}function sde(p){return p}function lde(p){return p}function B_(p,h,P){return{id:p,port:h,compass:P}}function F_(p,h){return{id:p,port:h,compass:null}}function z_(p){return{id:p,port:null,compass:null}}function j_(p,h){return[p].concat(h)}function H_(){return[]}function V_(p,h){return{type:"subgraph",id:p,stmts:h}}function U_(p){return{type:"subgraph",id:null,stmts:p}}function X_(p){return{type:"subgraph",id:null,stmts:p}}function Gg(p,h){return h}function $_(p,h){return h.length>0?p+h.join(""):p}function W_(p){return p.join("")}function Y_(){return'"'}function J_(){return""}function K_(p){return"\\"+p}function q_(p){return""+p}function Q_(p){return p.join("")}function Z_(p,h){return"<"+h+">"}function ade(p){return p}function eA(p,h){return p+h.join("")}function nA(p){return Array.isArray(p)?p.flat(1/0).filter(h=>h!=null).join(""):String(p)}let x=n.peg$currPos|0,D=x,as=[{line:1,column:1}],Pt=x,zf=n.peg$maxFailExpected||[],S=n.peg$silentFails|0,fa;if(n.startRule){if(!(n.startRule in r))throw new Error(`Can't start parsing from rule "`+n.startRule+'".');i=r[n.startRule]}function ude(){return e.substring(D,x)}function fde(){return D}function dde(){return{source:o,start:D,end:x}}function cde(){return da(D,x)}function pde(p,h){throw h=h!==void 0?h:da(D,x),Ig([Mg(p)],e.substring(D,x),h)}function mde(p,h){throw h=h!==void 0?h:da(D,x),iA(p,h)}function tA(p=x){let h=e.codePointAt(p);return h===void 0?"":String.fromCodePoint(h)}function Se(p,h){return{type:"literal",text:p,ignoreCase:h}}function ye(p,h,P,y){return{type:"class",parts:p,inverted:h,ignoreCase:P,unicode:y}}function oA(){return{type:"any"}}function rA(){return{type:"end"}}function Mg(p){return{type:"other",description:p}}function Lg(p){let h=as[p],P;if(h)return h;if(p>=as.length)P=as.length-1;else for(P=p;!as[--P];);for(h=as[P],h={line:h.line,column:h.column};P<p;)e.charCodeAt(P)===10?(h.line++,h.column=1):h.column++,P++;return as[p]=h,h}function da(p,h,P){let y=Lg(p),w=Lg(h),v={source:o,start:{offset:p,line:y.line,column:y.column},end:{offset:h,line:w.line,column:w.column}};return P&&o&&typeof o.offset=="function"&&(v.start=o.offset(v.start),v.end=o.offset(v.end)),v}function T(p){x<Pt||(x>Pt&&(Pt=x,zf=[]),zf.push(p))}function iA(p,h){return new pa(p,null,null,h)}function Ig(p,h,P){return new pa(pa.buildMessage(p,h),p,h,P)}function Og(){let p,h,P,y,w,v,k,G,z,Pe,ca,NA,i0,RA;return p=x,h=F(),P=sA(),P!==t?(y=F(),w=lA(),w!==t?(v=F(),k=aA(),k!==t?(G=F(),e.charCodeAt(x)===123?(z=s,x++):(z=t,S===0&&T(Mf)),z!==t?(Pe=F(),ca=jf(),NA=F(),e.charCodeAt(x)===125?(i0=l,x++):(i0=t,S===0&&T(Lf)),i0!==t?(RA=F(),D=p,p=v_(P,w,k,ca)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,h=F(),P="",D=p,p=S_()),p}function sA(){let p,h,P;return p=x,h=PA(),h!==t?(P=F(),D=p,p=w_()):(x=p,p=t),p===t&&(p=x,h="",D=p,h=N_(),p=h),p}function lA(){let p,h;return p=x,h=EA(),h!==t&&(D=p,h=R_()),p=h,p===t&&(p=x,h=Ug(),h!==t&&(D=p,h=T_()),p=h),p}function aA(){let p,h,P;return p=x,h=jt(),h!==t?(P=F(),D=p,p=h):(x=p,p=t),p===t&&(p=x,h="",D=p,h=k_(),p=h),p}function jf(){let p,h,P,y,w;for(p=x,h=[],P=x,y=Dg(),y!==t?(w=F(),D=P,P=y):(x=P,P=t);P!==t;)h.push(P),P=x,y=Dg(),y!==t?(w=F(),D=P,P=y):(x=P,P=t);return D=p,h=h,p=h,p}function Dg(){let p,h,P,y,w,v;return p=x,h=uA(),h!==t?(P=F(),y=x,e.charCodeAt(x)===59?(w=a,x++):(w=t,S===0&&T(bg)),w!==t?(v=F(),w=[w,v],y=w):(x=y,y=t),y===t&&(y=null),D=p,p=h):(x=p,p=t),p===t&&(p=x,h=dA(),h!==t?(P=F(),y=x,e.charCodeAt(x)===59?(w=a,x++):(w=t,S===0&&T(bg)),w!==t?(v=F(),w=[w,v],y=w):(x=y,y=t),y===t&&(y=null),D=p,p=h):(x=p,p=t)),p}function uA(){let p,h,P,y;return p=x,h=fA(),h!==t?(P=F(),y=n0(),y!==t?(D=p,p=C_(h,y)):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,h=t0(),h!==t&&(D=p,h=__(h)),p=h),p}function fA(){let p,h;return p=x,h=Ug(),h!==t&&(D=p,h=A_()),p=h,p===t&&(p=x,h=vA(),h!==t&&(D=p,h=G_()),p=h,p===t&&(p=x,h=SA(),h!==t&&(D=p,h=M_()),p=h)),p}function n0(){let p,h,P,y,w,v,k,G;return p=x,h=F(),e.charCodeAt(x)===91?(P=u,x++):(P=t,S===0&&T(gg)),P!==t?(y=F(),w=Bg(),v=F(),e.charCodeAt(x)===93?(k=f,x++):(k=t,S===0&&T(yg)),k!==t?(G=n0(),G!==t?(D=p,p=L_(w,G)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,h=F(),e.charCodeAt(x)===91?(P=u,x++):(P=t,S===0&&T(gg)),P!==t?(y=F(),w=Bg(),v=F(),e.charCodeAt(x)===93?(k=f,x++):(k=t,S===0&&T(yg)),k!==t?(D=p,p=w):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,h="",D=p,h=I_(),p=h)),p}function Bg(){let p,h,P,y,w,v,k,G;for(p=x,h=[],P=x,y=t0(),y!==t?(w=F(),v=x,k=e.charAt(x),dg.test(k)?x++:(k=t,S===0&&T(Pg)),k!==t?(G=F(),k=[k,G],v=k):(x=v,v=t),v===t&&(v=null),D=P,P=y):(x=P,P=t);P!==t;)h.push(P),P=x,y=t0(),y!==t?(w=F(),v=x,k=e.charAt(x),dg.test(k)?x++:(k=t,S===0&&T(Pg)),k!==t?(G=F(),k=[k,G],v=k):(x=v,v=t),v===t&&(v=null),D=P,P=y):(x=P,P=t);return D=p,h=h,p=h,p}function t0(){let p,h,P,y,w,v;return p=x,h=jt(),h!==t?(P=F(),e.charCodeAt(x)===61?(y=d,x++):(y=t,S===0&&T(s_)),y!==t?(w=F(),v=jt(),v!==t?(D=p,p=O_(h,v)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p}function dA(){let p,h,P,y,w,v;return p=x,h=Fg(),h!==t?(P=F(),y=zg(),y!==t?(w=F(),v=n0(),v!==t?(D=p,p=D_(h,y,v)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p}function Fg(){let p,h;return p=x,h=mA(),h!==t&&(D=p,h=h),p=h,p===t&&(p=x,h=cA(),h!==t&&(D=p,h=h),p=h),p}function cA(){let p,h,P,y,w,v,k,G,z,Pe;return p=x,h=jt(),h!==t?(P=F(),e.charCodeAt(x)===58?(y=c,x++):(y=t,S===0&&T(Qp)),y!==t?(w=F(),v=jt(),v!==t?(k=F(),e.charCodeAt(x)===58?(G=c,x++):(G=t,S===0&&T(Qp)),G!==t?(z=F(),Pe=jt(),Pe!==t?(D=p,p=B_(h,v,Pe)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,h=jt(),h!==t?(P=F(),e.charCodeAt(x)===58?(y=c,x++):(y=t,S===0&&T(Qp)),y!==t?(w=F(),v=jt(),v!==t?(D=p,p=F_(h,v)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,h=jt(),h!==t&&(D=p,h=z_(h)),p=h)),p}function zg(){let p,h,P,y,w,v;return p=x,h=pA(),h!==t?(P=F(),y=Fg(),y!==t?(w=F(),v=zg(),v!==t?(D=p,p=j_(y,v)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,h="",D=p,h=H_(),p=h),p}function pA(){let p,h;return S++,e.substr(x,2)===m?(p=m,x+=2):(p=t,S===0&&T(a_)),p===t&&(e.substr(x,2)===b?(p=b,x+=2):(p=t,S===0&&T(u_))),S--,p===t&&(h=t,S===0&&T(l_)),p}function mA(){let p,h,P,y,w,v,k,G,z,Pe;return p=x,h=Xg(),h!==t?(P=F(),y=jt(),y!==t?(w=F(),e.charCodeAt(x)===123?(v=s,x++):(v=t,S===0&&T(Mf)),v!==t?(k=F(),G=jf(),G!==t?(z=F(),e.charCodeAt(x)===125?(Pe=l,x++):(Pe=t,S===0&&T(Lf)),Pe!==t?(D=p,p=V_(y,G)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,h=Xg(),h!==t?(P=F(),e.charCodeAt(x)===123?(y=s,x++):(y=t,S===0&&T(Mf)),y!==t?(w=F(),v=jf(),v!==t?(k=F(),e.charCodeAt(x)===125?(G=l,x++):(G=t,S===0&&T(Lf)),G!==t?(D=p,p=U_(v)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p===t&&(p=x,e.charCodeAt(x)===123?(h=s,x++):(h=t,S===0&&T(Mf)),h!==t?(P=F(),y=jf(),y!==t?(w=F(),e.charCodeAt(x)===125?(v=l,x++):(v=t,S===0&&T(Lf)),v!==t?(D=p,p=X_(y)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t))),p}function jt(){let p,h,P,y,w,v,k,G;if(p=x,h=o0(),h!==t){for(P=[],y=x,w=F(),e.charCodeAt(x)===43?(v=g,x++):(v=t,S===0&&T(Eg)),v!==t?(k=F(),G=o0(),G!==t?(D=y,y=Gg(h,G)):(x=y,y=t)):(x=y,y=t);y!==t;)P.push(y),y=x,w=F(),e.charCodeAt(x)===43?(v=g,x++):(v=t,S===0&&T(Eg)),v!==t?(k=F(),G=o0(),G!==t?(D=y,y=Gg(h,G)):(x=y,y=t)):(x=y,y=t);D=p,p=$_(h,P)}else x=p,p=t;return p===t&&(p=bA()),p}function o0(){let p;return p=xA(),p===t&&(p=hA()),p}function xA(){let p,h,P,y;if(p=x,e.charCodeAt(x)===34?(h=E,x++):(h=t,S===0&&T(vg)),h!==t){for(P=[],y=jg();y!==t;)P.push(y),y=jg();e.charCodeAt(x)===34?(y=E,x++):(y=t,S===0&&T(vg)),y!==t?(D=p,p=W_(P)):(x=p,p=t)}else x=p,p=t;return p}function jg(){let p,h,P;return p=x,e.substr(x,2)===R?(h=R,x+=2):(h=t,S===0&&T(f_)),h!==t&&(D=p,h=Y_()),p=h,p===t&&(p=x,e.substr(x,2)===N?(h=N,x+=2):(h=t,S===0&&T(d_)),h!==t&&(D=p,h=J_()),p=h,p===t&&(p=x,e.charCodeAt(x)===92?(h=C,x++):(h=t,S===0&&T(c_)),h!==t?(e.length>x?(P=e.charAt(x),x++):(P=t,S===0&&T(ua)),P!==t?(D=p,p=K_(P)):(x=p,p=t)):(x=p,p=t),p===t&&(p=e.charAt(x),n_.test(p)?x++:(p=t,S===0&&T(p_))))),p}function hA(){let p,h,P,y;return p=x,e.charCodeAt(x)===60?(h=ne,x++):(h=t,S===0&&T(Sg)),h!==t?(P=Hg(),e.charCodeAt(x)===62?(y=I,x++):(y=t,S===0&&T(wg)),y!==t?(D=p,p=q_(P)):(x=p,p=t)):(x=p,p=t),p}function Hg(){let p,h,P;for(p=x,h=[],P=Vg();P!==t;)h.push(P),P=Vg();return D=p,h=Q_(h),p=h,p}function Vg(){let p,h,P,y;return p=x,e.charCodeAt(x)===60?(h=ne,x++):(h=t,S===0&&T(Sg)),h!==t?(P=Hg(),P!==t?(e.charCodeAt(x)===62?(y=I,x++):(y=t,S===0&&T(wg)),y!==t?(D=p,p=Z_(h,P)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p===t&&(p=e.charAt(x),t_.test(p)?x++:(p=t,S===0&&T(m_))),p}function bA(){let p,h,P;return p=yA(),p===t&&(p=x,h=x,S++,P=wA(),S--,P===t?h=void 0:(x=h,h=t),h!==t?(P=gA(),P!==t?(D=p,p=P):(x=p,p=t)):(x=p,p=t)),p}function gA(){let p,h,P,y;if(p=x,h=e.charAt(x),o_.test(h)?x++:(h=t,S===0&&T(x_)),h!==t){for(P=[],y=e.charAt(x),qp.test(y)?x++:(y=t,S===0&&T(Zp));y!==t;)P.push(y),y=e.charAt(x),qp.test(y)?x++:(y=t,S===0&&T(Zp));D=p,p=eA(h,P)}else x=p,p=t;return p}function yA(){let p,h,P,y,w,v,k,G,z;if(p=x,h=x,e.charCodeAt(x)===45?(P=me,x++):(P=t,S===0&&T(h_)),P===t&&(P=null),y=x,w=[],v=e.charAt(x),Fo.test(v)?x++:(v=t,S===0&&T(Ho)),v!==t)for(;v!==t;)w.push(v),v=e.charAt(x),Fo.test(v)?x++:(v=t,S===0&&T(Ho));else w=t;if(w!==t){if(v=x,e.charCodeAt(x)===46?(k=Xe,x++):(k=t,S===0&&T(Ng)),k!==t){for(G=[],z=e.charAt(x),Fo.test(z)?x++:(z=t,S===0&&T(Ho));z!==t;)G.push(z),z=e.charAt(x),Fo.test(z)?x++:(z=t,S===0&&T(Ho));k=[k,G],v=k}else x=v,v=t;v===t&&(v=null),w=[w,v],y=w}else x=y,y=t;if(y===t)if(y=x,e.charCodeAt(x)===46?(w=Xe,x++):(w=t,S===0&&T(Ng)),w!==t){if(v=[],k=e.charAt(x),Fo.test(k)?x++:(k=t,S===0&&T(Ho)),k!==t)for(;k!==t;)v.push(k),k=e.charAt(x),Fo.test(k)?x++:(k=t,S===0&&T(Ho));else v=t;v!==t?(w=[w,v],y=w):(x=y,y=t)}else x=y,y=t;if(y!==t){if(w=x,v=e.charAt(x),r_.test(v)?x++:(v=t,S===0&&T(b_)),v!==t){if(k=e.charAt(x),i_.test(k)?x++:(k=t,S===0&&T(g_)),k===t&&(k=null),G=[],z=e.charAt(x),Fo.test(z)?x++:(z=t,S===0&&T(Ho)),z!==t)for(;z!==t;)G.push(z),z=e.charAt(x),Fo.test(z)?x++:(z=t,S===0&&T(Ho));else G=t;G!==t?(v=[v,k,G],w=v):(x=w,w=t)}else x=w,w=t;w===t&&(w=null),P=[P,y,w],h=P}else x=h,h=t;return h!==t&&(D=p,h=nA(h)),p=h,p}function PA(){let p,h,P,y,w,v,k,G,z;return p=x,h=e.charAt(x),kf.test(h)?x++:(h=t,S===0&&T(If)),h!==t?(P=e.charAt(x),Cf.test(P)?x++:(P=t,S===0&&T(Of)),P!==t?(y=e.charAt(x),zo.test(y)?x++:(y=t,S===0&&T(Vo)),y!==t?(w=e.charAt(x),_f.test(w)?x++:(w=t,S===0&&T(Df)),w!==t?(v=e.charAt(x),cg.test(v)?x++:(v=t,S===0&&T(Rg)),v!==t?(k=e.charAt(x),Cf.test(k)?x++:(k=t,S===0&&T(Of)),k!==t?(G=x,S++,z=zr(),S--,z===t?G=void 0:(x=G,G=t),G!==t?(h=[h,P,y,w,v,k,G],p=h):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p}function Ug(){let p,h,P,y,w,v,k,G;return p=x,h=e.charAt(x),jo.test(h)?x++:(h=t,S===0&&T(Uo)),h!==t?(P=e.charAt(x),zo.test(P)?x++:(P=t,S===0&&T(Vo)),P!==t?(y=e.charAt(x),Qi.test(y)?x++:(y=t,S===0&&T(os)),y!==t?(w=e.charAt(x),Zi.test(w)?x++:(w=t,S===0&&T(rs)),w!==t?(v=e.charAt(x),es.test(v)?x++:(v=t,S===0&&T(is)),v!==t?(k=x,S++,G=zr(),S--,G===t?k=void 0:(x=k,k=t),k!==t?(h=[h,P,y,w,v,k],p=h):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p}function EA(){let p,h,P,y,w,v,k,G,z,Pe;return p=x,h=e.charAt(x),ns.test(h)?x++:(h=t,S===0&&T(ss)),h!==t?(P=e.charAt(x),_f.test(P)?x++:(P=t,S===0&&T(Df)),P!==t?(y=e.charAt(x),jo.test(y)?x++:(y=t,S===0&&T(Uo)),y!==t?(w=e.charAt(x),zo.test(w)?x++:(w=t,S===0&&T(Vo)),w!==t?(v=e.charAt(x),Qi.test(v)?x++:(v=t,S===0&&T(os)),v!==t?(k=e.charAt(x),Zi.test(k)?x++:(k=t,S===0&&T(rs)),k!==t?(G=e.charAt(x),es.test(G)?x++:(G=t,S===0&&T(is)),G!==t?(z=x,S++,Pe=zr(),S--,Pe===t?z=void 0:(x=z,z=t),z!==t?(h=[h,P,y,w,v,k,G,z],p=h):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p}function vA(){let p,h,P,y,w,v,k;return p=x,h=e.charAt(x),pg.test(h)?x++:(h=t,S===0&&T(Tg)),h!==t?(P=e.charAt(x),mg.test(P)?x++:(P=t,S===0&&T(kg)),P!==t?(y=e.charAt(x),ns.test(y)?x++:(y=t,S===0&&T(ss)),y!==t?(w=e.charAt(x),ts.test(w)?x++:(w=t,S===0&&T(ls)),w!==t?(v=x,S++,k=zr(),S--,k===t?v=void 0:(x=v,v=t),v!==t?(h=[h,P,y,w,v],p=h):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p}function SA(){let p,h,P,y,w,v,k;return p=x,h=e.charAt(x),ts.test(h)?x++:(h=t,S===0&&T(ls)),h!==t?(P=e.charAt(x),ns.test(P)?x++:(P=t,S===0&&T(ss)),P!==t?(y=e.charAt(x),jo.test(y)?x++:(y=t,S===0&&T(Uo)),y!==t?(w=e.charAt(x),ts.test(w)?x++:(w=t,S===0&&T(ls)),w!==t?(v=x,S++,k=zr(),S--,k===t?v=void 0:(x=v,v=t),v!==t?(h=[h,P,y,w,v],p=h):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p}function Xg(){let p,h,P,y,w,v,k,G,z,Pe,ca;return p=x,h=e.charAt(x),kf.test(h)?x++:(h=t,S===0&&T(If)),h!==t?(P=e.charAt(x),xg.test(P)?x++:(P=t,S===0&&T(Cg)),P!==t?(y=e.charAt(x),hg.test(y)?x++:(y=t,S===0&&T(_g)),y!==t?(w=e.charAt(x),jo.test(w)?x++:(w=t,S===0&&T(Uo)),w!==t?(v=e.charAt(x),zo.test(v)?x++:(v=t,S===0&&T(Vo)),v!==t?(k=e.charAt(x),Qi.test(k)?x++:(k=t,S===0&&T(os)),k!==t?(G=e.charAt(x),Zi.test(G)?x++:(G=t,S===0&&T(rs)),G!==t?(z=e.charAt(x),es.test(z)?x++:(z=t,S===0&&T(is)),z!==t?(Pe=x,S++,ca=zr(),S--,ca===t?Pe=void 0:(x=Pe,Pe=t),Pe!==t?(h=[h,P,y,w,v,k,G,z,Pe],p=h):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t)):(x=p,p=t),p}function zr(){let p;return p=e.charAt(x),qp.test(p)?x++:(p=t,S===0&&T(Zp)),p}function wA(){let p,h,P,y,w,v,k,G,z,Pe;return p=x,h=x,P=e.charAt(x),kf.test(P)?x++:(P=t,S===0&&T(If)),P!==t?(y=e.charAt(x),Cf.test(y)?x++:(y=t,S===0&&T(Of)),y!==t?(w=e.charAt(x),zo.test(w)?x++:(w=t,S===0&&T(Vo)),w!==t?(v=e.charAt(x),_f.test(v)?x++:(v=t,S===0&&T(Df)),v!==t?(k=e.charAt(x),cg.test(k)?x++:(k=t,S===0&&T(Rg)),k!==t?(G=e.charAt(x),Cf.test(G)?x++:(G=t,S===0&&T(Of)),G!==t?(P=[P,y,w,v,k,G],h=P):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t),h===t&&(h=x,P=e.charAt(x),ns.test(P)?x++:(P=t,S===0&&T(ss)),P!==t?(y=e.charAt(x),_f.test(y)?x++:(y=t,S===0&&T(Df)),y!==t?(w=e.charAt(x),jo.test(w)?x++:(w=t,S===0&&T(Uo)),w!==t?(v=e.charAt(x),zo.test(v)?x++:(v=t,S===0&&T(Vo)),v!==t?(k=e.charAt(x),Qi.test(k)?x++:(k=t,S===0&&T(os)),k!==t?(G=e.charAt(x),Zi.test(G)?x++:(G=t,S===0&&T(rs)),G!==t?(z=e.charAt(x),es.test(z)?x++:(z=t,S===0&&T(is)),z!==t?(P=[P,y,w,v,k,G,z],h=P):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t),h===t&&(h=x,P=e.charAt(x),jo.test(P)?x++:(P=t,S===0&&T(Uo)),P!==t?(y=e.charAt(x),zo.test(y)?x++:(y=t,S===0&&T(Vo)),y!==t?(w=e.charAt(x),Qi.test(w)?x++:(w=t,S===0&&T(os)),w!==t?(v=e.charAt(x),Zi.test(v)?x++:(v=t,S===0&&T(rs)),v!==t?(k=e.charAt(x),es.test(k)?x++:(k=t,S===0&&T(is)),k!==t?(P=[P,y,w,v,k],h=P):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t),h===t&&(h=x,P=e.charAt(x),pg.test(P)?x++:(P=t,S===0&&T(Tg)),P!==t?(y=e.charAt(x),mg.test(y)?x++:(y=t,S===0&&T(kg)),y!==t?(w=e.charAt(x),ns.test(w)?x++:(w=t,S===0&&T(ss)),w!==t?(v=e.charAt(x),ts.test(v)?x++:(v=t,S===0&&T(ls)),v!==t?(P=[P,y,w,v],h=P):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t),h===t&&(h=x,P=e.charAt(x),ts.test(P)?x++:(P=t,S===0&&T(ls)),P!==t?(y=e.charAt(x),ns.test(y)?x++:(y=t,S===0&&T(ss)),y!==t?(w=e.charAt(x),jo.test(w)?x++:(w=t,S===0&&T(Uo)),w!==t?(v=e.charAt(x),ts.test(v)?x++:(v=t,S===0&&T(ls)),v!==t?(P=[P,y,w,v],h=P):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t),h===t&&(h=x,P=e.charAt(x),kf.test(P)?x++:(P=t,S===0&&T(If)),P!==t?(y=e.charAt(x),xg.test(y)?x++:(y=t,S===0&&T(Cg)),y!==t?(w=e.charAt(x),hg.test(w)?x++:(w=t,S===0&&T(_g)),w!==t?(v=e.charAt(x),jo.test(v)?x++:(v=t,S===0&&T(Uo)),v!==t?(k=e.charAt(x),zo.test(k)?x++:(k=t,S===0&&T(Vo)),k!==t?(G=e.charAt(x),Qi.test(G)?x++:(G=t,S===0&&T(os)),G!==t?(z=e.charAt(x),Zi.test(z)?x++:(z=t,S===0&&T(rs)),z!==t?(Pe=e.charAt(x),es.test(Pe)?x++:(Pe=t,S===0&&T(is)),Pe!==t?(P=[P,y,w,v,k,G,z,Pe],h=P):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)):(x=h,h=t)))))),h!==t?(P=x,S++,y=zr(),S--,y===t?P=void 0:(x=P,P=t),P!==t?(h=[h,P],p=h):(x=p,p=t)):(x=p,p=t),p}function F(){let p,h,P;if(p=[],h=[],P=e.charAt(x),Af.test(P)?x++:(P=t,S===0&&T(Bf)),P!==t)for(;P!==t;)h.push(P),P=e.charAt(x),Af.test(P)?x++:(P=t,S===0&&T(Bf));else h=t;for(h===t&&(h=$g(),h===t&&(h=Wg(),h===t&&(h=Yg())));h!==t;){if(p.push(h),h=[],P=e.charAt(x),Af.test(P)?x++:(P=t,S===0&&T(Bf)),P!==t)for(;P!==t;)h.push(P),P=e.charAt(x),Af.test(P)?x++:(P=t,S===0&&T(Bf));else h=t;h===t&&(h=$g(),h===t&&(h=Wg(),h===t&&(h=Yg())))}return p}function $g(){let p,h,P,y,w,v;if(p=x,e.substr(x,2)===Do?(h=Do,x+=2):(h=t,S===0&&T(y_)),h!==t){for(P=[],y=x,w=x,S++,e.substr(x,2)===Bo?(v=Bo,x+=2):(v=t,S===0&&T(e0)),S--,v===t?w=void 0:(x=w,w=t),w!==t?(e.length>x?(v=e.charAt(x),x++):(v=t,S===0&&T(ua)),v!==t?(w=[w,v],y=w):(x=y,y=t)):(x=y,y=t);y!==t;)P.push(y),y=x,w=x,S++,e.substr(x,2)===Bo?(v=Bo,x+=2):(v=t,S===0&&T(e0)),S--,v===t?w=void 0:(x=w,w=t),w!==t?(e.length>x?(v=e.charAt(x),x++):(v=t,S===0&&T(ua)),v!==t?(w=[w,v],y=w):(x=y,y=t)):(x=y,y=t);e.substr(x,2)===Bo?(y=Bo,x+=2):(y=t,S===0&&T(e0)),y!==t?(h=[h,P,y],p=h):(x=p,p=t)}else x=p,p=t;return p}function Wg(){let p,h,P,y,w;if(p=x,e.substr(x,2)===Tf?(h=Tf,x+=2):(h=t,S===0&&T(P_)),h!==t){for(P=[],y=e.charAt(x),Gf.test(y)?x++:(y=t,S===0&&T(Ff));y!==t;)P.push(y),y=e.charAt(x),Gf.test(y)?x++:(y=t,S===0&&T(Ff));e.charCodeAt(x)===10?(y=la,x++):(y=t,S===0&&T(Ag)),y===t&&(y=x,S++,e.length>x?(w=e.charAt(x),x++):(w=t,S===0&&T(ua)),S--,w===t?y=void 0:(x=y,y=t)),y!==t?(h=[h,P,y],p=h):(x=p,p=t)}else x=p,p=t;return p}function Yg(){let p,h,P,y,w;if(p=x,e.charCodeAt(x)===35?(h=aa,x++):(h=t,S===0&&T(E_)),h!==t){for(P=[],y=e.charAt(x),Gf.test(y)?x++:(y=t,S===0&&T(Ff));y!==t;)P.push(y),y=e.charAt(x),Gf.test(y)?x++:(y=t,S===0&&T(Ff));e.charCodeAt(x)===10?(y=la,x++):(y=t,S===0&&T(Ag)),y===t&&(y=x,S++,e.length>x?(w=e.charAt(x),x++):(w=t,S===0&&T(ua)),S--,w===t?y=void 0:(x=y,y=t)),y!==t?(h=[h,P,y],p=h):(x=p,p=t)}else x=p,p=t;return p}fa=i();let r0=fa!==t&&x===e.length;function Jg(){throw fa!==t&&x<e.length&&T(rA()),Ig(zf,Pt<e.length?tA(Pt):null,Pt<e.length?da(Pt,Pt+1):da(Pt,Pt))}if(n.peg$library)return{peg$result:fa,peg$currPos:x,peg$FAILED:t,peg$maxFailExpected:zf,peg$maxFailPos:Pt,peg$success:r0,peg$throw:r0?void 0:Jg};if(r0)return fa;Jg()}function Sn(e){return e.startsWith("")}function wn(e){return e.slice(1)}var us={NativeFonts:0,PsFonts:1,SvgFonts:2};function Hf(e){let n={x:0,y:0};return{quantum:0,scale:0,ratio:0,dpi:0,margin:{...n},page:{...n},size:{...n},filled:!1,landscape:!1,centered:!1,ratioKind:"none",xdots:null,id:null,...e}}function l0(){return{bb:{ll:{x:0,y:0},ur:{x:0,y:0}},rankdir:0,flags:0,charset:0,gui_state:0,has_labels:0,has_images:!1}}var $e=class{name;anonymous;kind;nodes;edges;subgraphs;attrs;nodeDefaults;edgeDefaults;graphDefaultsSnapshot;info;parent;root;seq=0;subgSeqCounter=0;declaredGraphAttrs=new Set;constructor(n,t,o=!1){this.name=n,this.anonymous=o,this.kind=t,this.nodes=new Map,this.edges=[],this.subgraphs=new Map,this.attrs=new Map,this.nodeDefaults=new Map,this.edgeDefaults=new Map,this.info=l0(),this.parent=null,this.root=this}};function a0(){return{coord:{x:0,y:0},width:0,height:0,bb:{ll:{x:0,y:0},ur:{x:0,y:0}},ht:0,lw:0,rw:0,outline_width:0,outline_height:0,state:0,gui_state:0,clustnode:!1,base_width:void 0,base_height:void 0,label:void 0,xlabel:void 0,shape:void 0,shape_info:void 0,rank:void 0,order:void 0,rankIsXCoord:void 0,mval:void 0,node_type:void 0,ranktype:void 0,weight_class:void 0,mark:void 0,onstack:void 0,has_port:void 0,showboxes:void 0,in:void 0,out:void 0,flat_in:void 0,flat_out:void 0,other:void 0,save_in:void 0,save_out:void 0,tree_in:void 0,tree_out:void 0,next:void 0,prev:void 0,par:void 0,low:void 0,lim:void 0,priority:void 0,UF_size:void 0,UF_parent:void 0,rep:void 0,set:void 0,clust:void 0,posAlg:void 0,pinned:void 0,id:void 0,heapindex:void 0,hops:void 0,pos:void 0,dist:void 0,alg:void 0}}var We=class{id;name;attrs;info;root;nodeDefaultsSnapshot;constructor(n,t,o){this.id=n,this.name=t,this.attrs=new Map,this.info=a0(),this.root=o}outEdges(n){return n.edges.filter(t=>t.tail===this).sort((t,o)=>t.head.id-o.head.id||t.seq-o.seq)}inEdges(n){return n.edges.filter(t=>t.head===this&&t.tail!==this).sort((t,o)=>t.tail.id-o.tail.id||t.seq-o.seq)}};function Xo(e){let n=new Map;for(let t of e.edges){let o=n.get(t.tail);o!==void 0?o.push(t):n.set(t.tail,[t])}for(let t of n.values())t.sort((o,r)=>o.head.id-r.head.id||o.seq-r.seq);return n}function ue(){return{p:{x:0,y:0},theta:0,bp:null,defined:!1,constrained:!1,clip:!0,dyna:!1,order:0,side:0,name:null}}function u0(e,n){return{tail_port:e,head_port:n,spl:void 0,label:void 0,head_label:void 0,tail_label:void 0,xlabel:void 0,headArrowOps:void 0,tailArrowOps:void 0,constraint:void 0,edge_type:void 0,compound:void 0,adjacent:void 0,label_ontop:void 0,gui_state:void 0,to_orig:void 0,to_virt:void 0,lost:void 0,alg:void 0,weight:void 0,minlen:void 0,cutvalue:void 0,tree_index:void 0,xpenalty:void 0,count:void 0,conc_opp_flag:void 0,showboxes:void 0,stale_arrow_attrs:void 0,factor:void 0,dist:void 0,path:void 0,samehead:void 0,sametail:void 0,lhead:void 0,ltail:void 0,reversed:void 0}}var Ae=class e{static _nextSeq=0;seq;graphSeq=0;tail;head;name;attrs;info;constructor(n,t,o){this.seq=e._nextSeq++,this.tail=n,this.head=t,this.name=o,this.attrs=new Map,this.info=u0(ue(),ue())}};var MA="%";function qg(e){let n=-1;for(let t of e.nodes.values())t.id>n&&(n=t.id);return n+1}function jr(e,n,t){let o=e.root;if(n!==null&&n!==""){let l=o.nodes.get(n);if(l!==void 0)return l;if(!t)return null;let a=new We(qg(o),n,o);return o.nodes.set(n,a),a}if(!t)return null;let r=qg(o),i=MA+String(r),s=new We(r,i,o);return o.nodes.set(i,s),s}function f0(e,n){n.seq=++e.root.subgSeqCounter}function $o(e,n,t){let o=e.subgraphs.get(n);if(o!==void 0)return o;if(!t)return null;let r=new $e(n,e.kind);return r.parent=e,r.root=e.root,f0(e,r),e.subgraphs.set(n,r),r}function ds(e,n,t){if(e.root!==n.root)return null;let o=e.nodes.get(n.name);if(o!==void 0)return o;if(!t)return null;let r=e.parent;return r!==null&&ds(r,n,t),e.nodes.set(n.name,n),n}function Qg(e,n){for(let t=e;t!==null;t=t.parent)t.nodes.delete(n.name)}function Zg(e,n){e.subgraphs.delete(n.name)}function ey(e,n){let t=e.attrs.get(n);return t!==void 0?t:e.root.declaredGraphAttrs.has(n)?"":void 0}function ma(e,n){for(let{key:t,value:o}of e)n.set(t,o)}function LA(e){if("type"in e&&e.type==="subgraph")return"";let n=e;return n.port===null||n.port===""?"":n.compass?n.port+":"+n.compass:n.port}function IA(e){let n=new Map;for(let t=e;t!==null;t=t.parent)for(let[o,r]of t.nodeDefaults)n.has(o)||n.set(o,r);return n}var OA=["label","fontname","fontsize","fontcolor","labelloc","labeljust"];function DA(e){let n=new Map;for(let t=e;t!==null;t=t.parent)for(let[o,r]of t.attrs)n.has(o)||n.set(o,r);return n}var d0=class{nextId=0;reset(){this.nextId=0}ensure(n,t,o=t){let r=t.nodes.get(n);if(r!==void 0)return r;let i=new We(this.nextId++,n,t);return i.nodeDefaultsSnapshot=IA(o),t.nodes.set(n,i),i}},c0=class e{static fromStmts(n){let t=[];for(let o of n)e.fromStmt(o,t);return t}static fromStmt(n,t){if(n.type==="node")t.push(n.id.id);else if(n.type==="edge")for(let o of n.nodes)e.fromEndpoint(o,t);else n.type==="subgraph"&&t.push(...e.fromStmts(n.stmts))}static fromEndpoint(n,t){"type"in n&&n.type==="subgraph"?t.push(...e.fromStmts(n.stmts)):t.push(n.id)}},p0=class{constructor(n){this.registry=n}registry;anonCounter=0;nextAnonId(){return this.anonCounter++*2+1}advanceAnonId(){this.anonCounter++}processAssign(n,t){t.attrs.set(n.key,n.value),t.root.declaredGraphAttrs.add(n.key)}processAttr(n,t){if(n.target==="graph"){ma(n.attrs,t.attrs);for(let o of n.attrs)t.root.declaredGraphAttrs.add(o.key)}else n.target==="node"?ma(n.attrs,t.nodeDefaults):ma(n.attrs,t.edgeDefaults)}processNodeStmt(n,t,o){let r=this.registry.ensure(n.id.id,o,t);ma(n.attrs,r.attrs);for(let i=t;i!==null&&i!==o;i=i.parent)i.nodes.set(r.name,r)}processEdgeStmt(n,t,o,r){let i=n.nodes.map(s=>({nodes:this.resolveEndpoint(s,o,t,r),port:LA(s)}));for(let s=0;s<i.length-1;s++)this.connectEndpoints(i[s],i[s+1],n.attrs,t,o)}processSubgraph(n,t,o,r){let i=n.id??`%${this.nextAnonId()}`,s=t.subgraphs.get(i),l=new $e(i,t.kind);l.parent=t,l.root=o,s!==void 0?l.seq=s.seq:f0(t,l),l.graphDefaultsSnapshot=DA(t),ny(n.stmts,l,o,r,this);for(let a of OA){let u=l.graphDefaultsSnapshot.get(a);u!==void 0&&!l.attrs.has(a)&&l.attrs.set(a,u)}return t.subgraphs.set(i,l),l}dispatch(n,t,o,r){switch(n.type){case"assign":this.processAssign(n,t);break;case"attr":this.processAttr(n,t);break;case"node":this.processNodeStmt(n,t,o);break;case"edge":this.processEdgeStmt(n,t,o,r);break;case"subgraph":this.processSubgraph(n,t,o,r);break}}snapshotEdgeDefaults(n,t){for(let o=t;o!==null;o=o.parent)for(let[r,i]of o.edgeDefaults)n.attrs.has(r)||n.attrs.set(r,i)}resolveEndpoint(n,t,o,r){if("type"in n&&n.type==="subgraph"){this.processSubgraph(n,o,t,r);let i=new Set;return c0.fromStmts(n.stmts).map(l=>this.registry.ensure(l,t,o)).filter(l=>i.has(l.id)?!1:(i.add(l.id),!0)).sort((l,a)=>l.id-a.id)}return[this.registry.ensure(n.id,t,o)]}connectEndpoints(n,t,o,r,i){let s=n.port,l=t.port;for(let a of n.nodes)for(let u of t.nodes){let f=new Ae(a,u,"");this.advanceAnonId(),ma(o,f.attrs),this.snapshotEdgeDefaults(f,r),s&&!f.attrs.has("tailport")&&f.attrs.set("tailport",s),l&&!f.attrs.has("headport")&&f.attrs.set("headport",l),i.edges.push(f),f.graphSeq=i.edges.length;for(let d=r;d!==null&&d!==i;d=d.parent)d.nodes.set(a.name,a),d.nodes.set(u.name,u),d.edges.push(f)}}};function ny(e,n,t,o,r){for(let i of e)r.dispatch(i,n,t,o)}function ty(e){let n=new d0,t=new p0(n),o;e.directed&&e.strict?o="strict-directed":e.directed?o="directed":e.strict?o="strict-undirected":o="undirected";let r=new $e(e.id??"",o,e.id==null);return e.id||t.advanceAnonId(),ny(e.stmts,r,r,e.directed,t),r}var BA={SYNTAX_ERROR:"There is a syntax error in the DOT source.",SYNTAX_UNEXPECTED_EOF:"The DOT source ended unexpectedly \u2014 a bracket or statement may be unclosed.",EDGE_OP_DIRECTED_IN_UNDIRECTED:"A directed edge '->' was used in an undirected graph; use '--' instead.",EDGE_OP_UNDIRECTED_IN_DIRECTED:"An undirected edge '--' was used in a directed graph; use '->' instead.",HTML_PARSE_ERROR:"An HTML-like label could not be parsed.",RENDER_ERROR:"The graph could not be laid out or rendered.",GENERIC_ERROR:"An unexpected error occurred while rendering the graph."};function xa(e){return BA[e]}var Ye=class extends Error{type="render";code;friendlyMessage;constructor(n,t="RENDER_ERROR"){super(n),this.name="RenderError",this.code=t,this.friendlyMessage=xa(t)}};var mo=class extends Error{type="syntax";code;friendlyMessage;location;expected;constructor(n,t,o,r){super(n),this.name="ParseError",this.code=t,this.location=o,this.friendlyMessage=xa(t),r!==void 0&&(this.expected=r)}get line(){return this.location.line}get column(){return this.location.column}},Vf=class e{static strip(n){let t=[],o=n.length,r=0;for(;r<o;){let i=n[r];i==="/"&&n[r+1]==="*"?r=e.blankBlock(n,r,t):i==="/"&&n[r+1]==="/"||i==="#"?r=e.blankLine(n,r,t):i==='"'?r=e.blankQuoted(n,r,t):i==="<"?r=e.blankHtml(n,r,t):(t.push(i),r++)}return t.join("")}static blankBlock(n,t,o){let r=n.length;for(o.push(" "),t+=2;t<r&&!(n[t]==="*"&&n[t+1]==="/");)o.push(" "),t++;return t<r&&(o.push(" "),t+=2),t}static blankLine(n,t,o){let r=n.length,i=n[t]==="#"?1:2;for(o.push(" ".repeat(i)),t+=i;t<r&&n[t]!==`
13
- `;)o.push(" "),t++;return t}static blankQuoted(n,t,o){let r=n.length;for(o.push('"'),t++;t<r&&n[t]!=='"';)n[t]==="\\"&&t+1<r?(o.push(" "),t+=2):(o.push(" "),t++);return t<r&&(o.push('"'),t++),t}static blankHtml(n,t,o){let r=n.length;o.push("<"),t++;let i=1;for(;t<r&&i>0;){if(n[t]==="<")i++;else if(n[t]===">"&&(i--,i===0))break;o.push(" "),t++}return t<r&&(o.push(">"),t++),t}};function FA(e,n){let o=e.slice(0,n).split(`
14
- `);return{line:o.length,column:(o[o.length-1]?.length??0)+1,offset:n}}function oy(e,n){let t=Vf.strip(e).search(n);return t===-1?{line:1,column:1,offset:0}:FA(e,t)}function zA(e,n){let t=Vf.strip(e);if(n&&/--(?!>)/.test(t)){let o=oy(e,/--(?!>)/);throw new mo("undirected edge operator '--' is not allowed in a digraph; use '->'","EDGE_OP_UNDIRECTED_IN_DIRECTED",o)}if(!n&&/->/.test(t)){let o=oy(e,/->/);throw new mo("directed edge operator '->' is not allowed in an undirected graph; use '--'","EDGE_OP_DIRECTED_IN_UNDIRECTED",o)}}function jA(e){if(e===null||typeof e!="object")return!1;let n=e;return typeof n.location!="object"||n.location===null?!1:"start"in n.location}function Wo(e){if(typeof e!="string")throw new mo("DOT source must be a string","GENERIC_ERROR",{line:1,column:1,offset:0});let n;try{n=Kg(e)}catch(t){if(jA(t)){let o=t.location.start,r=t.found===null?"SYNTAX_UNEXPECTED_EOF":"SYNTAX_ERROR";throw new mo(t instanceof Error?t.message:String(t),r,{line:o.line,column:o.column,offset:o.offset},t.expected)}throw t instanceof RangeError?new mo("DOT source is too deeply nested to parse","GENERIC_ERROR",{line:1,column:1,offset:0}):t}return zA(e,n.directed),ty(n)}function Yo(e,n){switch(n){case 0:return e;case 90:return{x:-e.y,y:e.x};case 180:return{x:e.x,y:-e.y};case 270:return{x:e.y,y:e.x};default:return e}}function Uf(e,n){return e.ur.x>=n.ll.x&&n.ur.x>=e.ll.x&&e.ur.y>=n.ll.y&&n.ur.y>=e.ll.y}var De=72;var Ee={filled:!1,radial:!1,rounded:!1,diagonals:!1,auxlabels:!1,invisible:!1,striped:!1,dotted:!1,dashed:!1,wedged:!1,underline:!1,fixedshape:!1,shape:0};function xe(e){return{...Ee,shape:e}}function Xf(e){return{...Ee,...e}}var ry={regular:!1,peripheries:1,sides:0,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},m0={regular:!1,peripheries:1,sides:1,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},x0={regular:!0,peripheries:1,sides:1,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},iy={regular:!1,peripheries:1,sides:1,orientation:0,distortion:-.3,skew:0,option:Ee,vertices:null},sy={regular:!1,peripheries:1,sides:3,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},cs={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},ly={regular:!0,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},h0={regular:!1,peripheries:0,sides:4,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},ay={regular:!1,peripheries:0,sides:4,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},uy={regular:!1,peripheries:1,sides:4,orientation:45,distortion:0,skew:0,option:Ee,vertices:null},fy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:-.4,skew:0,option:Ee,vertices:null},dy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:.6,option:Ee,vertices:null},cy={regular:!1,peripheries:1,sides:5,orientation:0,distortion:-.64,skew:0,option:Ee,vertices:null},py={regular:!1,peripheries:1,sides:5,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},my={regular:!1,peripheries:1,sides:6,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},xy={regular:!1,peripheries:1,sides:7,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},hy={regular:!1,peripheries:1,sides:8,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},by={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(1),vertices:null},gy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(2),vertices:null},yy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(3),vertices:null},Py={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(4),vertices:null},Ey={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(5),vertices:null},vy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:Xf({underline:!0}),vertices:null},Sy={regular:!1,peripheries:1,sides:19,orientation:0,distortion:0,skew:0,option:xe(26),vertices:null},wy={regular:!0,peripheries:2,sides:1,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},Ny={regular:!1,peripheries:1,sides:3,orientation:180,distortion:0,skew:0,option:Ee,vertices:null},Ry={regular:!1,peripheries:1,sides:4,orientation:180,distortion:-.4,skew:0,option:Ee,vertices:null},Ty={regular:!1,peripheries:1,sides:5,orientation:180,distortion:-.64,skew:0,option:Ee,vertices:null},ky={regular:!1,peripheries:2,sides:8,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},Cy={regular:!1,peripheries:3,sides:8,orientation:0,distortion:0,skew:0,option:Ee,vertices:null},_y={regular:!1,peripheries:1,sides:4,orientation:45,distortion:0,skew:0,option:Xf({diagonals:!0,auxlabels:!0}),vertices:null},Ay={regular:!0,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:Xf({diagonals:!0}),vertices:null},Gy={regular:!0,peripheries:1,sides:1,orientation:0,distortion:0,skew:0,option:Xf({diagonals:!0,auxlabels:!0}),vertices:null},My={regular:!1,peripheries:1,sides:10,orientation:0,distortion:0,skew:0,option:xe(27),vertices:null},Ly={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(6),vertices:null},Iy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(7),vertices:null},Oy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(8),vertices:null},Dy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(9),vertices:null},By={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(17),vertices:null},Fy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(18),vertices:null},zy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(19),vertices:null},jy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(20),vertices:null},Hy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(21),vertices:null},Vy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(10),vertices:null},Uy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(11),vertices:null},Xy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(12),vertices:null},$y={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(13),vertices:null},Wy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(14),vertices:null},Yy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(15),vertices:null},Jy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(16),vertices:null},Ky={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(22),vertices:null},qy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(23),vertices:null},Qy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(24),vertices:null},Zy={regular:!1,peripheries:1,sides:4,orientation:0,distortion:0,skew:0,option:xe(25),vertices:null};var b0=class{static insertionIdx(n,t){let o=t.type.split(":")[0];for(let r=0;r<n.length;r++){let i=n[r],s=i.type.split(":")[0];if(!(s<o)){if(s>o)return r;if(!(i.quality>t.quality))return r}}return n.length}},ps=class{renderers=[];layouts=new Map;textMeasurer;debug;constructor(n,t){this.textMeasurer=n,this.debug=t?.debug}register(n){if("quality"in n){let t=b0.insertionIdx(this.renderers,n);this.renderers.splice(t,0,n)}else this.layouts.set(n.type,n)}bestRenderer(n){for(let t of this.renderers)if(t.type.split(":")[0]===n)return t;throw new Error(`no renderer registered for format: ${n}`)}layout(n,t){let o=n.attrs?.get("layout"),r=t;if(o!==void 0&&o!==""){if(!this.layouts.has(o))throw new Error(`Layout type: "${o}" not recognized`);r=o}let i=this.layouts.get(r);if(i===void 0)throw new Error(`no layout engine registered: ${r}`);n.info&&(n.info.gvc=this),i.layout(n),n.info&&(n.info.laidOut=!0)}freeLayout(n,t){let o=this.layouts.get(t);if(o===void 0)throw new Error(`no layout engine registered: ${t}`);o.cleanup(n)}};function HA(e){let n=new DataView(new ArrayBuffer(8));n.setFloat64(0,e,!1);let t=n.getUint32(0,!1),o=n.getUint32(4,!1),r=t>>>20&2047,i=BigInt(t&1048575),s=BigInt(o>>>0),l=i<<32n|s,a;return r===0?a=-1074:(l|=1n<<52n,a=r-1075),{mantissa:l,binExp:a}}function e3(e){let{mantissa:n,binExp:t}=HA(e),o,r;for(t>=0?(o=n<<BigInt(t),r=0):(o=n*5n**BigInt(-t),r=t);o!==0n&&o%10n===0n;)o/=10n,r+=1;return{digits:o,exponent10:r}}function n3(e,n){let t=10n**BigInt(n),o=e/t,r=e%t,i=t/2n;return r>i||r===i&&o%2n===1n?o+1n:o}function $f(e,n){if(!Number.isFinite(e))return e.toFixed(n);if(e===0)return n>0?"0."+"0".repeat(n):"0";let t=e<0?"-":"",{digits:o,exponent10:r}=e3(Math.abs(e)),i=r+n,s=i>=0?o*10n**BigInt(i):n3(o,-i);if(n===0)return t+s.toString();let l=s.toString();l.length<=n&&(l="0".repeat(n-l.length+1)+l);let a=l.slice(0,l.length-n),u=l.slice(l.length-n);return t+a+"."+u}function t3(e,n){if(!Number.isFinite(e))return e.toPrecision(n);if(e===0)return n>1?"0."+"0".repeat(n-1):"0";let t=e<0?"-":"",{digits:o,exponent10:r}=e3(Math.abs(e)),i=o.toString(),s=i.length,l=s+r,a,u=l;if(s<=n)a=i+"0".repeat(n-s);else{let c=n3(o,s-n).toString();c.length>n&&(c=c.slice(0,n),u+=1),a=c}let f=u-1;if(f<-6||f>=n){let d=n>1?a[0]+"."+a.slice(1):a[0];return t+d+"e"+(f>=0?"+":"-")+String(Math.abs(f))}if(f>=0){let d=a.slice(0,f+1),c=a.slice(f+1);return t+d+(c.length>0?"."+c:"")}return t+"0."+"0".repeat(-(f+1))+a}var xo=4;var o3=8192;var tce=1<<17,oce=1<<18,rce=1<<19,ice=1<<20,sce=1<<21,lce=1<<22,ace=1<<23,uce=1<<24,fce=1<<25,dce=1<<26,cce=1<<27;function VA(){return{penColor:{type:"string",s:"black"},fillColor:{type:"string",s:"white"},stopColor:{type:"none"},gradientAngle:0,gradientFrac:0,pen:3,fill:0,penWidth:1,rawStyle:[]}}function UA(){return{label:null,xlabel:null,tailLabel:null,headLabel:null,url:null,id:null,labelUrl:null,tailUrl:null,headUrl:null,tooltip:null,labelTooltip:null,tailTooltip:null,headTooltip:null,target:null,labelTarget:null,tailTarget:null,headTarget:null}}function XA(){return{explicitTooltip:!1,explicitTailTooltip:!1,explicitHeadTooltip:!1,explicitLabelTooltip:!1,explicitTailTarget:!1,explicitHeadTarget:!1,explicitEdgeTarget:!1,explicitTailUrl:!1,explicitHeadUrl:!1,labelEdgeAligned:!1,urlMapShape:0,urlMapPts:[],urlBsplineMapPts:[],tailEndMapPts:[],headEndMapPts:[]}}function Hr(e=2){return{parent:null,type:e,graphObj:null,emitState:8,...VA(),...UA(),...XA()}}function g0(e){return $f(e,2)}function $A(e){let n=e.indexOf(".");if(n<0)return e;let t=e[n+1];return e[n+2]==="0"?t==="0"?e.slice(0,n):e.slice(0,n+2):e}var Wf=class{output=[];measurer;format;bb={ll:{x:0,y:0},ur:{x:0,y:0}};pad={x:0,y:0};margin={x:0,y:0};zoom=1;dpi={x:96,y:96};rotation=0;scale={x:1,y:1};translation={x:0,y:0};devscale={x:1,y:1};flags=0;numLayers=1;layerNum=1;layerIDs=[];nodeId=0;edgeId=0;linearGradId=0;radialGradId=0;directed=!0;drawingId="";objId(n,t,o=!1){return n!==void 0&&n.length>0?n:!o&&this.drawingId.length>0?this.drawingId+"_"+t:t}renderer;labelEmitOverride=null;objStack=[];constructor(n,t){this.format=n,this.measurer=t}idLayerPrefix(){return this.layerNum>1?this.layerIDs[this.layerNum]+"_":""}idLayerSuffix(){return this.layerNum>1?"_"+this.layerIDs[this.layerNum]:""}get obj(){let n=this.objStack.length;return n>0?this.objStack[n-1]??null:null}pushObj(n){this.objStack.push(n)}popObj(){if(this.objStack.length===0)throw new Error("RenderJob.popObj: stack is empty");this.objStack.pop()}write(n){this.output.push(n)}printDouble(n){if(n>-.005&&n<.005){this.output.push("0");return}let t=g0(n);this.output.push($A(t))}printPoint(n){this.printDouble(n.x),this.output.push(" "),this.printDouble(n.y)}};function WA(e){switch(e){case 0:return 4;case 1:return 5;case 3:return 11;default:return 10}}function r3(e,n){return e.labelEmitOverride??WA(n)}function Jf(e,n){let t=e.obj;if(t===null){n();return}let o=t.emitState;t.emitState=r3(e,t.type);try{n()}finally{t.emitState=o}}function YA(e,n){return e.str.length===0?!1:n.obj===null||n.obj.pen!==0}function hs(e,n,t,o){if(!YA(t,o))return;let r=o.obj;if(r===null){e.textspan(n,t,o);return}let i=r.emitState;r.emitState=r3(o,r.type);try{e.textspan(n,t,o)}finally{r.emitState=i}}function P0(e,n){let t=new ArrayBuffer(16),o=new DataView(t);o.setFloat64(0,e,!1),o.setFloat64(8,n,!1);let r=new Uint8Array(t);for(let i=0;i<8;i++)if(r[i]!==r[i+8])return!1;return!0}var Vr=[["/accent3/1",85,93,201,127,201,127,255],["/accent3/2",187,45,212,190,174,212,255],["/accent3/3",20,119,253,253,192,134,255],["/accent4/1",85,93,201,127,201,127,255],["/accent4/2",187,45,212,190,174,212,255],["/accent4/3",20,119,253,253,192,134,255],["/accent4/4",42,102,255,255,255,153,255],["/accent5/1",85,93,201,127,201,127,255],["/accent5/2",187,45,212,190,174,212,255],["/accent5/3",20,119,253,253,192,134,255],["/accent5/4",42,102,255,255,255,153,255],["/accent5/5",151,173,176,56,108,176,255],["/accent6/1",85,93,201,127,201,127,255],["/accent6/2",187,45,212,190,174,212,255],["/accent6/3",20,119,253,253,192,134,255],["/accent6/4",42,102,255,255,255,153,255],["/accent6/5",151,173,176,56,108,176,255],["/accent6/6",232,252,240,240,2,127,255],["/accent7/1",85,93,201,127,201,127,255],["/accent7/2",187,45,212,190,174,212,255],["/accent7/3",20,119,253,253,192,134,255],["/accent7/4",42,102,255,255,255,153,255],["/accent7/5",151,173,176,56,108,176,255],["/accent7/6",232,252,240,240,2,127,255],["/accent7/7",17,224,191,191,91,23,255],["/accent8/1",85,93,201,127,201,127,255],["/accent8/2",187,45,212,190,174,212,255],["/accent8/3",20,119,253,253,192,134,255],["/accent8/4",42,102,255,255,255,153,255],["/accent8/5",151,173,176,56,108,176,255],["/accent8/6",232,252,240,240,2,127,255],["/accent8/7",17,224,191,191,91,23,255],["/accent8/8",0,0,102,102,102,102,255],["/blues3/1",147,25,247,222,235,247,255],["/blues3/2",142,75,225,158,202,225,255],["/blues3/3",145,188,189,49,130,189,255],["/blues4/1",159,16,255,239,243,255,255],["/blues4/2",143,46,231,189,215,231,255],["/blues4/3",143,127,214,107,174,214,255],["/blues4/4",147,208,181,33,113,181,255],["/blues5/1",159,16,255,239,243,255,255],["/blues5/2",143,46,231,189,215,231,255],["/blues5/3",143,127,214,107,174,214,255],["/blues5/4",145,188,189,49,130,189,255],["/blues5/5",149,241,156,8,81,156,255],["/blues6/1",159,16,255,239,243,255,255],["/blues6/2",148,43,239,198,219,239,255],["/blues6/3",142,75,225,158,202,225,255],["/blues6/4",143,127,214,107,174,214,255],["/blues6/5",145,188,189,49,130,189,255],["/blues6/6",149,241,156,8,81,156,255],["/blues7/1",159,16,255,239,243,255,255],["/blues7/2",148,43,239,198,219,239,255],["/blues7/3",142,75,225,158,202,225,255],["/blues7/4",143,127,214,107,174,214,255],["/blues7/5",144,169,198,66,146,198,255],["/blues7/6",147,208,181,33,113,181,255],["/blues7/7",151,241,148,8,69,148,255],["/blues8/1",148,8,255,247,251,255,255],["/blues8/2",147,25,247,222,235,247,255],["/blues8/3",148,43,239,198,219,239,255],["/blues8/4",142,75,225,158,202,225,255],["/blues8/5",143,127,214,107,174,214,255],["/blues8/6",144,169,198,66,146,198,255],["/blues8/7",147,208,181,33,113,181,255],["/blues8/8",151,241,148,8,69,148,255],["/blues9/1",148,8,255,247,251,255,255],["/blues9/2",147,25,247,222,235,247,255],["/blues9/3",148,43,239,198,219,239,255],["/blues9/4",142,75,225,158,202,225,255],["/blues9/5",143,127,214,107,174,214,255],["/blues9/6",144,169,198,66,146,198,255],["/blues9/7",147,208,181,33,113,181,255],["/blues9/8",149,241,156,8,81,156,255],["/blues9/9",152,235,107,8,48,107,255],["/brbg10/1",23,239,84,84,48,5,255],["/brbg10/10",119,255,60,0,60,48,255],["/brbg10/2",23,236,140,140,81,10,255],["/brbg10/3",24,194,191,191,129,45,255],["/brbg10/4",29,112,223,223,194,125,255],["/brbg10/5",30,52,246,246,232,195,255],["/brbg10/6",121,38,234,199,234,229,255],["/brbg10/7",120,95,205,128,205,193,255],["/brbg10/8",124,165,151,53,151,143,255],["/brbg10/9",124,252,102,1,102,94,255],["/brbg11/1",23,239,84,84,48,5,255],["/brbg11/10",124,252,102,1,102,94,255],["/brbg11/11",119,255,60,0,60,48,255],["/brbg11/2",23,236,140,140,81,10,255],["/brbg11/3",24,194,191,191,129,45,255],["/brbg11/4",29,112,223,223,194,125,255],["/brbg11/5",30,52,246,246,232,195,255],["/brbg11/6",0,0,245,245,245,245,255],["/brbg11/7",121,38,234,199,234,229,255],["/brbg11/8",120,95,205,128,205,193,255],["/brbg11/9",124,165,151,53,151,143,255],["/brbg3/1",28,135,216,216,179,101,255],["/brbg3/2",0,0,245,245,245,245,255],["/brbg3/3",123,127,180,90,180,172,255],["/brbg4/1",21,215,166,166,97,26,255],["/brbg4/2",29,112,223,223,194,125,255],["/brbg4/3",120,95,205,128,205,193,255],["/brbg4/4",121,253,133,1,133,113,255],["/brbg5/1",21,215,166,166,97,26,255],["/brbg5/2",29,112,223,223,194,125,255],["/brbg5/3",0,0,245,245,245,245,255],["/brbg5/4",120,95,205,128,205,193,255],["/brbg5/5",121,253,133,1,133,113,255],["/brbg6/1",23,236,140,140,81,10,255],["/brbg6/2",28,135,216,216,179,101,255],["/brbg6/3",30,52,246,246,232,195,255],["/brbg6/4",121,38,234,199,234,229,255],["/brbg6/5",123,127,180,90,180,172,255],["/brbg6/6",124,252,102,1,102,94,255],["/brbg7/1",23,236,140,140,81,10,255],["/brbg7/2",28,135,216,216,179,101,255],["/brbg7/3",30,52,246,246,232,195,255],["/brbg7/4",0,0,245,245,245,245,255],["/brbg7/5",121,38,234,199,234,229,255],["/brbg7/6",123,127,180,90,180,172,255],["/brbg7/7",124,252,102,1,102,94,255],["/brbg8/1",23,236,140,140,81,10,255],["/brbg8/2",24,194,191,191,129,45,255],["/brbg8/3",29,112,223,223,194,125,255],["/brbg8/4",30,52,246,246,232,195,255],["/brbg8/5",121,38,234,199,234,229,255],["/brbg8/6",120,95,205,128,205,193,255],["/brbg8/7",124,165,151,53,151,143,255],["/brbg8/8",124,252,102,1,102,94,255],["/brbg9/1",23,236,140,140,81,10,255],["/brbg9/2",24,194,191,191,129,45,255],["/brbg9/3",29,112,223,223,194,125,255],["/brbg9/4",30,52,246,246,232,195,255],["/brbg9/5",0,0,245,245,245,245,255],["/brbg9/6",121,38,234,199,234,229,255],["/brbg9/7",120,95,205,128,205,193,255],["/brbg9/8",124,165,151,53,151,143,255],["/brbg9/9",124,252,102,1,102,94,255],["/bugn3/1",135,20,249,229,245,249,255],["/bugn3/2",117,74,216,153,216,201,255],["/bugn3/3",103,185,162,44,162,95,255],["/bugn4/1",136,14,251,237,248,251,255],["/bugn4/2",127,54,226,178,226,226,255],["/bugn4/3",113,120,194,102,194,164,255],["/bugn4/4",98,190,139,35,139,69,255],["/bugn5/1",136,14,251,237,248,251,255],["/bugn5/2",127,54,226,178,226,226,255],["/bugn5/3",113,120,194,102,194,164,255],["/bugn5/4",103,185,162,44,162,95,255],["/bugn5/5",102,255,109,0,109,44,255],["/bugn6/1",136,14,251,237,248,251,255],["/bugn6/2",119,34,236,204,236,230,255],["/bugn6/3",117,74,216,153,216,201,255],["/bugn6/4",113,120,194,102,194,164,255],["/bugn6/5",103,185,162,44,162,95,255],["/bugn6/6",102,255,109,0,109,44,255],["/bugn7/1",136,14,251,237,248,251,255],["/bugn7/2",119,34,236,204,236,230,255],["/bugn7/3",117,74,216,153,216,201,255],["/bugn7/4",113,120,194,102,194,164,255],["/bugn7/5",105,159,174,65,174,118,255],["/bugn7/6",98,190,139,35,139,69,255],["/bugn7/7",102,255,88,0,88,36,255],["/bugn8/1",134,6,253,247,252,253,255],["/bugn8/2",135,20,249,229,245,249,255],["/bugn8/3",119,34,236,204,236,230,255],["/bugn8/4",117,74,216,153,216,201,255],["/bugn8/5",113,120,194,102,194,164,255],["/bugn8/6",105,159,174,65,174,118,255],["/bugn8/7",98,190,139,35,139,69,255],["/bugn8/8",102,255,88,0,88,36,255],["/bugn9/1",134,6,253,247,252,253,255],["/bugn9/2",135,20,249,229,245,249,255],["/bugn9/3",119,34,236,204,236,230,255],["/bugn9/4",117,74,216,153,216,201,255],["/bugn9/5",113,120,194,102,194,164,255],["/bugn9/6",105,159,174,65,174,118,255],["/bugn9/7",98,190,139,35,139,69,255],["/bugn9/8",102,255,109,0,109,44,255],["/bugn9/9",101,255,68,0,68,27,255],["/bupu3/1",144,20,244,224,236,244,255],["/bupu3/2",148,70,218,158,188,218,255],["/bupu3/3",196,123,167,136,86,167,255],["/bupu4/1",136,14,251,237,248,251,255],["/bupu4/2",146,53,227,179,205,227,255],["/bupu4/3",162,74,198,140,150,198,255],["/bupu4/4",202,149,157,136,65,157,255],["/bupu5/1",136,14,251,237,248,251,255],["/bupu5/2",146,53,227,179,205,227,255],["/bupu5/3",162,74,198,140,150,198,255],["/bupu5/4",196,123,167,136,86,167,255],["/bupu5/5",214,225,129,129,15,124,255],["/bupu6/1",136,14,251,237,248,251,255],["/bupu6/2",148,43,230,191,211,230,255],["/bupu6/3",148,70,218,158,188,218,255],["/bupu6/4",162,74,198,140,150,198,255],["/bupu6/5",196,123,167,136,86,167,255],["/bupu6/6",214,225,129,129,15,124,255],["/bupu7/1",136,14,251,237,248,251,255],["/bupu7/2",148,43,230,191,211,230,255],["/bupu7/3",148,70,218,158,188,218,255],["/bupu7/4",162,74,198,140,150,198,255],["/bupu7/5",190,100,177,140,107,177,255],["/bupu7/6",202,149,157,136,65,157,255],["/bupu7/7",213,252,110,110,1,107,255],["/bupu8/1",134,6,253,247,252,253,255],["/bupu8/2",144,20,244,224,236,244,255],["/bupu8/3",148,43,230,191,211,230,255],["/bupu8/4",148,70,218,158,188,218,255],["/bupu8/5",162,74,198,140,150,198,255],["/bupu8/6",190,100,177,140,107,177,255],["/bupu8/7",202,149,157,136,65,157,255],["/bupu8/8",213,252,110,110,1,107,255],["/bupu9/1",134,6,253,247,252,253,255],["/bupu9/2",144,20,244,224,236,244,255],["/bupu9/3",148,43,230,191,211,230,255],["/bupu9/4",148,70,218,158,188,218,255],["/bupu9/5",162,74,198,140,150,198,255],["/bupu9/6",190,100,177,140,107,177,255],["/bupu9/7",202,149,157,136,65,157,255],["/bupu9/8",214,225,129,129,15,124,255],["/bupu9/9",213,255,77,77,0,75,255],["/dark23/1",114,211,158,27,158,119,255],["/dark23/2",18,252,217,217,95,2,255],["/dark23/3",173,95,179,117,112,179,255],["/dark24/1",114,211,158,27,158,119,255],["/dark24/2",18,252,217,217,95,2,255],["/dark24/3",173,95,179,117,112,179,255],["/dark24/4",233,209,231,231,41,138,255],["/dark25/1",114,211,158,27,158,119,255],["/dark25/2",18,252,217,217,95,2,255],["/dark25/3",173,95,179,117,112,179,255],["/dark25/4",233,209,231,231,41,138,255],["/dark25/5",62,208,166,102,166,30,255],["/dark26/1",114,211,158,27,158,119,255],["/dark26/2",18,252,217,217,95,2,255],["/dark26/3",173,95,179,117,112,179,255],["/dark26/4",233,209,231,231,41,138,255],["/dark26/5",62,208,166,102,166,30,255],["/dark26/6",31,252,230,230,171,2,255],["/dark27/1",114,211,158,27,158,119,255],["/dark27/2",18,252,217,217,95,2,255],["/dark27/3",173,95,179,117,112,179,255],["/dark27/4",233,209,231,231,41,138,255],["/dark27/5",62,208,166,102,166,30,255],["/dark27/6",31,252,230,230,171,2,255],["/dark27/7",27,210,166,166,118,29,255],["/dark28/1",114,211,158,27,158,119,255],["/dark28/2",18,252,217,217,95,2,255],["/dark28/3",173,95,179,117,112,179,255],["/dark28/4",233,209,231,231,41,138,255],["/dark28/5",62,208,166,102,166,30,255],["/dark28/6",31,252,230,230,171,2,255],["/dark28/7",27,210,166,166,118,29,255],["/dark28/8",0,0,102,102,102,102,255],["/gnbu3/1",76,25,243,224,243,219,255],["/gnbu3/2",95,61,221,168,221,181,255],["/gnbu3/3",140,170,202,67,162,202,255],["/gnbu4/1",65,17,249,240,249,232,255],["/gnbu4/2",87,46,228,186,228,188,255],["/gnbu4/3",123,101,204,123,204,196,255],["/gnbu4/4",141,197,190,43,140,190,255],["/gnbu5/1",65,17,249,240,249,232,255],["/gnbu5/2",87,46,228,186,228,188,255],["/gnbu5/3",123,101,204,123,204,196,255],["/gnbu5/4",140,170,202,67,162,202,255],["/gnbu5/5",145,243,172,8,104,172,255],["/gnbu6/1",65,17,249,240,249,232,255],["/gnbu6/2",77,41,235,204,235,197,255],["/gnbu6/3",95,61,221,168,221,181,255],["/gnbu6/4",123,101,204,123,204,196,255],["/gnbu6/5",140,170,202,67,162,202,255],["/gnbu6/6",145,243,172,8,104,172,255],["/gnbu7/1",65,17,249,240,249,232,255],["/gnbu7/2",77,41,235,204,235,197,255],["/gnbu7/3",95,61,221,168,221,181,255],["/gnbu7/4",123,101,204,123,204,196,255],["/gnbu7/5",137,160,211,78,179,211,255],["/gnbu7/6",141,197,190,43,140,190,255],["/gnbu7/7",147,242,158,8,88,158,255],["/gnbu8/1",60,12,252,247,252,240,255],["/gnbu8/2",76,25,243,224,243,219,255],["/gnbu8/3",77,41,235,204,235,197,255],["/gnbu8/4",95,61,221,168,221,181,255],["/gnbu8/5",123,101,204,123,204,196,255],["/gnbu8/6",137,160,211,78,179,211,255],["/gnbu8/7",141,197,190,43,140,190,255],["/gnbu8/8",147,242,158,8,88,158,255],["/gnbu9/1",60,12,252,247,252,240,255],["/gnbu9/2",76,25,243,224,243,219,255],["/gnbu9/3",77,41,235,204,235,197,255],["/gnbu9/4",95,61,221,168,221,181,255],["/gnbu9/5",123,101,204,123,204,196,255],["/gnbu9/6",137,160,211,78,179,211,255],["/gnbu9/7",141,197,190,43,140,190,255],["/gnbu9/8",145,243,172,8,104,172,255],["/gnbu9/9",150,239,129,8,64,129,255],["/greens3/1",74,21,245,229,245,224,255],["/greens3/2",80,72,217,161,217,155,255],["/greens3/3",98,178,163,49,163,84,255],["/greens4/1",73,15,248,237,248,233,255],["/greens4/2",78,54,228,186,228,179,255],["/greens4/3",86,104,196,116,196,118,255],["/greens4/4",98,190,139,35,139,69,255],["/greens5/1",73,15,248,237,248,233,255],["/greens5/2",78,54,228,186,228,179,255],["/greens5/3",86,104,196,116,196,118,255],["/greens5/4",98,178,163,49,163,84,255],["/greens5/5",102,255,109,0,109,44,255],["/greens6/1",73,15,248,237,248,233,255],["/greens6/2",77,44,233,199,233,192,255],["/greens6/3",80,72,217,161,217,155,255],["/greens6/4",86,104,196,116,196,118,255],["/greens6/5",98,178,163,49,163,84,255],["/greens6/6",102,255,109,0,109,44,255],["/greens7/1",73,15,248,237,248,233,255],["/greens7/2",77,44,233,199,233,192,255],["/greens7/3",80,72,217,161,217,155,255],["/greens7/4",86,104,196,116,196,118,255],["/greens7/5",96,158,171,65,171,93,255],["/greens7/6",98,190,139,35,139,69,255],["/greens7/7",108,255,90,0,90,50,255],["/greens8/1",72,7,252,247,252,245,255],["/greens8/2",74,21,245,229,245,224,255],["/greens8/3",77,44,233,199,233,192,255],["/greens8/4",80,72,217,161,217,155,255],["/greens8/5",86,104,196,116,196,118,255],["/greens8/6",96,158,171,65,171,93,255],["/greens8/7",98,190,139,35,139,69,255],["/greens8/8",108,255,90,0,90,50,255],["/greens9/1",72,7,252,247,252,245,255],["/greens9/2",74,21,245,229,245,224,255],["/greens9/3",77,44,233,199,233,192,255],["/greens9/4",80,72,217,161,217,155,255],["/greens9/5",86,104,196,116,196,118,255],["/greens9/6",96,158,171,65,171,93,255],["/greens9/7",98,190,139,35,139,69,255],["/greens9/8",102,255,109,0,109,44,255],["/greens9/9",101,255,68,0,68,27,255],["/greys3/1",0,0,240,240,240,240,255],["/greys3/2",0,0,189,189,189,189,255],["/greys3/3",0,0,99,99,99,99,255],["/greys4/1",0,0,247,247,247,247,255],["/greys4/2",0,0,204,204,204,204,255],["/greys4/3",0,0,150,150,150,150,255],["/greys4/4",0,0,82,82,82,82,255],["/greys5/1",0,0,247,247,247,247,255],["/greys5/2",0,0,204,204,204,204,255],["/greys5/3",0,0,150,150,150,150,255],["/greys5/4",0,0,99,99,99,99,255],["/greys5/5",0,0,37,37,37,37,255],["/greys6/1",0,0,247,247,247,247,255],["/greys6/2",0,0,217,217,217,217,255],["/greys6/3",0,0,189,189,189,189,255],["/greys6/4",0,0,150,150,150,150,255],["/greys6/5",0,0,99,99,99,99,255],["/greys6/6",0,0,37,37,37,37,255],["/greys7/1",0,0,247,247,247,247,255],["/greys7/2",0,0,217,217,217,217,255],["/greys7/3",0,0,189,189,189,189,255],["/greys7/4",0,0,150,150,150,150,255],["/greys7/5",0,0,115,115,115,115,255],["/greys7/6",0,0,82,82,82,82,255],["/greys7/7",0,0,37,37,37,37,255],["/greys8/1",0,0,255,255,255,255,255],["/greys8/2",0,0,240,240,240,240,255],["/greys8/3",0,0,217,217,217,217,255],["/greys8/4",0,0,189,189,189,189,255],["/greys8/5",0,0,150,150,150,150,255],["/greys8/6",0,0,115,115,115,115,255],["/greys8/7",0,0,82,82,82,82,255],["/greys8/8",0,0,37,37,37,37,255],["/greys9/1",0,0,255,255,255,255,255],["/greys9/2",0,0,240,240,240,240,255],["/greys9/3",0,0,217,217,217,217,255],["/greys9/4",0,0,189,189,189,189,255],["/greys9/5",0,0,150,150,150,150,255],["/greys9/6",0,0,115,115,115,115,255],["/greys9/7",0,0,82,82,82,82,255],["/greys9/8",0,0,37,37,37,37,255],["/greys9/9",0,0,0,0,0,0,255],["/oranges3/1",21,48,254,254,230,206,255],["/oranges3/2",19,147,253,253,174,107,255],["/oranges3/3",14,240,230,230,85,13,255],["/oranges4/1",19,32,254,254,237,222,255],["/oranges4/2",20,120,253,253,190,133,255],["/oranges4/3",17,194,253,253,141,60,255],["/oranges4/4",13,253,217,217,71,1,255],["/oranges5/1",19,32,254,254,237,222,255],["/oranges5/2",20,120,253,253,190,133,255],["/oranges5/3",17,194,253,253,141,60,255],["/oranges5/4",14,240,230,230,85,13,255],["/oranges5/5",13,250,166,166,54,3,255],["/oranges6/1",19,32,254,254,237,222,255],["/oranges6/2",21,91,253,253,208,162,255],["/oranges6/3",19,147,253,253,174,107,255],["/oranges6/4",17,194,253,253,141,60,255],["/oranges6/5",14,240,230,230,85,13,255],["/oranges6/6",13,250,166,166,54,3,255],["/oranges7/1",19,32,254,254,237,222,255],["/oranges7/2",21,91,253,253,208,162,255],["/oranges7/3",19,147,253,253,174,107,255],["/oranges7/4",17,194,253,253,141,60,255],["/oranges7/5",16,234,241,241,105,19,255],["/oranges7/6",13,253,217,217,72,1,255],["/oranges7/7",12,247,140,140,45,4,255],["/oranges8/1",21,20,255,255,245,235,255],["/oranges8/2",21,48,254,254,230,206,255],["/oranges8/3",21,91,253,253,208,162,255],["/oranges8/4",19,147,253,253,174,107,255],["/oranges8/5",17,194,253,253,141,60,255],["/oranges8/6",16,234,241,241,105,19,255],["/oranges8/7",13,253,217,217,72,1,255],["/oranges8/8",12,247,140,140,45,4,255],["/oranges9/1",21,20,255,255,245,235,255],["/oranges9/2",21,48,254,254,230,206,255],["/oranges9/3",21,91,253,253,208,162,255],["/oranges9/4",19,147,253,253,174,107,255],["/oranges9/5",17,194,253,253,141,60,255],["/oranges9/6",16,234,241,241,105,19,255],["/oranges9/7",13,253,217,217,72,1,255],["/oranges9/8",13,250,166,166,54,3,255],["/oranges9/9",12,246,127,127,39,4,255],["/orrd3/1",25,54,254,254,232,200,255],["/orrd3/2",19,121,253,253,187,132,255],["/orrd3/3",5,197,227,227,74,51,255],["/orrd4/1",26,37,254,254,240,217,255],["/orrd4/2",24,115,253,253,204,138,255],["/orrd4/3",13,164,252,252,141,89,255],["/orrd4/4",3,218,215,215,48,31,255],["/orrd5/1",26,37,254,254,240,217,255],["/orrd5/2",24,115,253,253,204,138,255],["/orrd5/3",13,164,252,252,141,89,255],["/orrd5/4",5,197,227,227,74,51,255],["/orrd5/5",0,255,179,179,0,0,255],["/orrd6/1",26,37,254,254,240,217,255],["/orrd6/2",24,95,253,253,212,158,255],["/orrd6/3",19,121,253,253,187,132,255],["/orrd6/4",13,164,252,252,141,89,255],["/orrd6/5",5,197,227,227,74,51,255],["/orrd6/6",0,255,179,179,0,0,255],["/orrd7/1",26,37,254,254,240,217,255],["/orrd7/2",24,95,253,253,212,158,255],["/orrd7/3",19,121,253,253,187,132,255],["/orrd7/4",13,164,252,252,141,89,255],["/orrd7/5",7,178,239,239,101,72,255],["/orrd7/6",3,218,215,215,48,31,255],["/orrd7/7",0,255,153,153,0,0,255],["/orrd8/1",24,18,255,255,247,236,255],["/orrd8/2",25,54,254,254,232,200,255],["/orrd8/3",24,95,253,253,212,158,255],["/orrd8/4",19,121,253,253,187,132,255],["/orrd8/5",13,164,252,252,141,89,255],["/orrd8/6",7,178,239,239,101,72,255],["/orrd8/7",3,218,215,215,48,31,255],["/orrd8/8",0,255,153,153,0,0,255],["/orrd9/1",24,18,255,255,247,236,255],["/orrd9/2",25,54,254,254,232,200,255],["/orrd9/3",24,95,253,253,212,158,255],["/orrd9/4",19,121,253,253,187,132,255],["/orrd9/5",13,164,252,252,141,89,255],["/orrd9/6",7,178,239,239,101,72,255],["/orrd9/7",3,218,215,215,48,31,255],["/orrd9/8",0,255,179,179,0,0,255],["/orrd9/9",0,255,127,127,0,0,255],["/paired10/1",142,68,227,166,206,227,255],["/paired10/10",190,153,154,106,61,154,255],["/paired10/2",144,211,180,31,120,180,255],["/paired10/3",65,97,223,178,223,138,255],["/paired10/4",82,184,160,51,160,44,255],["/paired10/5",0,99,251,251,154,153,255],["/paired10/6",254,225,227,227,26,28,255],["/paired10/7",23,143,253,253,191,111,255],["/paired10/8",21,255,255,255,127,0,255],["/paired10/9",198,42,214,202,178,214,255],["/paired11/1",142,68,227,166,206,227,255],["/paired11/10",190,153,154,106,61,154,255],["/paired11/11",42,102,255,255,255,153,255],["/paired11/2",144,211,180,31,120,180,255],["/paired11/3",65,97,223,178,223,138,255],["/paired11/4",82,184,160,51,160,44,255],["/paired11/5",0,99,251,251,154,153,255],["/paired11/6",254,225,227,227,26,28,255],["/paired11/7",23,143,253,253,191,111,255],["/paired11/8",21,255,255,255,127,0,255],["/paired11/9",198,42,214,202,178,214,255],["/paired12/1",142,68,227,166,206,227,255],["/paired12/10",190,153,154,106,61,154,255],["/paired12/11",42,102,255,255,255,153,255],["/paired12/12",15,197,177,177,89,40,255],["/paired12/2",144,211,180,31,120,180,255],["/paired12/3",65,97,223,178,223,138,255],["/paired12/4",82,184,160,51,160,44,255],["/paired12/5",0,99,251,251,154,153,255],["/paired12/6",254,225,227,227,26,28,255],["/paired12/7",23,143,253,253,191,111,255],["/paired12/8",21,255,255,255,127,0,255],["/paired12/9",198,42,214,202,178,214,255],["/paired3/1",142,68,227,166,206,227,255],["/paired3/2",144,211,180,31,120,180,255],["/paired3/3",65,97,223,178,223,138,255],["/paired4/1",142,68,227,166,206,227,255],["/paired4/2",144,211,180,31,120,180,255],["/paired4/3",65,97,223,178,223,138,255],["/paired4/4",82,184,160,51,160,44,255],["/paired5/1",142,68,227,166,206,227,255],["/paired5/2",144,211,180,31,120,180,255],["/paired5/3",65,97,223,178,223,138,255],["/paired5/4",82,184,160,51,160,44,255],["/paired5/5",0,99,251,251,154,153,255],["/paired6/1",142,68,227,166,206,227,255],["/paired6/2",144,211,180,31,120,180,255],["/paired6/3",65,97,223,178,223,138,255],["/paired6/4",82,184,160,51,160,44,255],["/paired6/5",0,99,251,251,154,153,255],["/paired6/6",254,225,227,227,26,28,255],["/paired7/1",142,68,227,166,206,227,255],["/paired7/2",144,211,180,31,120,180,255],["/paired7/3",65,97,223,178,223,138,255],["/paired7/4",82,184,160,51,160,44,255],["/paired7/5",0,99,251,251,154,153,255],["/paired7/6",254,225,227,227,26,28,255],["/paired7/7",23,143,253,253,191,111,255],["/paired8/1",142,68,227,166,206,227,255],["/paired8/2",144,211,180,31,120,180,255],["/paired8/3",65,97,223,178,223,138,255],["/paired8/4",82,184,160,51,160,44,255],["/paired8/5",0,99,251,251,154,153,255],["/paired8/6",254,225,227,227,26,28,255],["/paired8/7",23,143,253,253,191,111,255],["/paired8/8",21,255,255,255,127,0,255],["/paired9/1",142,68,227,166,206,227,255],["/paired9/2",144,211,180,31,120,180,255],["/paired9/3",65,97,223,178,223,138,255],["/paired9/4",82,184,160,51,160,44,255],["/paired9/5",0,99,251,251,154,153,255],["/paired9/6",254,225,227,227,26,28,255],["/paired9/7",23,143,253,253,191,111,255],["/paired9/8",21,255,255,255,127,0,255],["/paired9/9",198,42,214,202,178,214,255],["/pastel13/1",3,78,251,251,180,174,255],["/pastel13/2",146,53,227,179,205,227,255],["/pastel13/3",77,41,235,204,235,197,255],["/pastel14/1",3,78,251,251,180,174,255],["/pastel14/2",146,53,227,179,205,227,255],["/pastel14/3",77,41,235,204,235,197,255],["/pastel14/4",202,27,228,222,203,228,255],["/pastel15/1",3,78,251,251,180,174,255],["/pastel15/2",146,53,227,179,205,227,255],["/pastel15/3",77,41,235,204,235,197,255],["/pastel15/4",202,27,228,222,203,228,255],["/pastel15/5",24,88,254,254,217,166,255],["/pastel16/1",3,78,251,251,180,174,255],["/pastel16/2",146,53,227,179,205,227,255],["/pastel16/3",77,41,235,204,235,197,255],["/pastel16/4",202,27,228,222,203,228,255],["/pastel16/5",24,88,254,254,217,166,255],["/pastel16/6",42,50,255,255,255,204,255],["/pastel17/1",3,78,251,251,180,174,255],["/pastel17/2",146,53,227,179,205,227,255],["/pastel17/3",77,41,235,204,235,197,255],["/pastel17/4",202,27,228,222,203,228,255],["/pastel17/5",24,88,254,254,217,166,255],["/pastel17/6",42,50,255,255,255,204,255],["/pastel17/7",28,44,229,229,216,189,255],["/pastel18/1",3,78,251,251,180,174,255],["/pastel18/2",146,53,227,179,205,227,255],["/pastel18/3",77,41,235,204,235,197,255],["/pastel18/4",202,27,228,222,203,228,255],["/pastel18/5",24,88,254,254,217,166,255],["/pastel18/6",42,50,255,255,255,204,255],["/pastel18/7",28,44,229,229,216,189,255],["/pastel18/8",233,35,253,253,218,236,255],["/pastel19/1",3,78,251,251,180,174,255],["/pastel19/2",146,53,227,179,205,227,255],["/pastel19/3",77,41,235,204,235,197,255],["/pastel19/4",202,27,228,222,203,228,255],["/pastel19/5",24,88,254,254,217,166,255],["/pastel19/6",42,50,255,255,255,204,255],["/pastel19/7",28,44,229,229,216,189,255],["/pastel19/8",233,35,253,253,218,236,255],["/pastel19/9",0,0,242,242,242,242,255],["/pastel23/1",108,53,226,179,226,205,255],["/pastel23/2",17,81,253,253,205,172,255],["/pastel23/3",155,31,232,203,213,232,255],["/pastel24/1",108,53,226,179,226,205,255],["/pastel24/2",17,81,253,253,205,172,255],["/pastel24/3",155,31,232,203,213,232,255],["/pastel24/4",228,43,244,244,202,228,255],["/pastel25/1",108,53,226,179,226,205,255],["/pastel25/2",17,81,253,253,205,172,255],["/pastel25/3",155,31,232,203,213,232,255],["/pastel25/4",228,43,244,244,202,228,255],["/pastel25/5",56,45,245,230,245,201,255],["/pastel26/1",108,53,226,179,226,205,255],["/pastel26/2",17,81,253,253,205,172,255],["/pastel26/3",155,31,232,203,213,232,255],["/pastel26/4",228,43,244,244,202,228,255],["/pastel26/5",56,45,245,230,245,201,255],["/pastel26/6",35,81,255,255,242,174,255],["/pastel27/1",108,53,226,179,226,205,255],["/pastel27/2",17,81,253,253,205,172,255],["/pastel27/3",155,31,232,203,213,232,255],["/pastel27/4",228,43,244,244,202,228,255],["/pastel27/5",56,45,245,230,245,201,255],["/pastel27/6",35,81,255,255,242,174,255],["/pastel27/7",25,39,241,241,226,204,255],["/pastel28/1",108,53,226,179,226,205,255],["/pastel28/2",17,81,253,253,205,172,255],["/pastel28/3",155,31,232,203,213,232,255],["/pastel28/4",228,43,244,244,202,228,255],["/pastel28/5",56,45,245,230,245,201,255],["/pastel28/6",35,81,255,255,242,174,255],["/pastel28/7",25,39,241,241,226,204,255],["/pastel28/8",0,0,204,204,204,204,255],["/piyg10/1",230,253,142,142,1,82,255],["/piyg10/10",77,191,100,39,100,25,255],["/piyg10/2",230,220,197,197,27,125,255],["/piyg10/3",232,118,222,222,119,174,255],["/piyg10/4",229,62,241,241,182,218,255],["/piyg10/5",233,29,253,253,224,239,255],["/piyg10/6",59,38,245,230,245,208,255],["/piyg10/7",61,103,225,184,225,134,255],["/piyg10/8",63,166,188,127,188,65,255],["/piyg10/9",68,197,146,77,146,33,255],["/piyg11/1",230,253,142,142,1,82,255],["/piyg11/10",68,197,146,77,146,33,255],["/piyg11/11",77,191,100,39,100,25,255],["/piyg11/2",230,220,197,197,27,125,255],["/piyg11/3",232,118,222,222,119,174,255],["/piyg11/4",229,62,241,241,182,218,255],["/piyg11/5",233,29,253,253,224,239,255],["/piyg11/6",0,0,247,247,247,247,255],["/piyg11/7",59,38,245,230,245,208,255],["/piyg11/8",61,103,225,184,225,134,255],["/piyg11/9",63,166,188,127,188,65,255],["/piyg3/1",231,76,233,233,163,201,255],["/piyg3/2",0,0,247,247,247,247,255],["/piyg3/3",63,129,215,161,215,106,255],["/piyg4/1",228,220,208,208,28,139,255],["/piyg4/2",229,62,241,241,182,218,255],["/piyg4/3",61,103,225,184,225,134,255],["/piyg4/4",72,198,172,77,172,38,255],["/piyg5/1",228,220,208,208,28,139,255],["/piyg5/2",229,62,241,241,182,218,255],["/piyg5/3",0,0,247,247,247,247,255],["/piyg5/4",61,103,225,184,225,134,255],["/piyg5/5",72,198,172,77,172,38,255],["/piyg6/1",230,220,197,197,27,125,255],["/piyg6/2",231,76,233,233,163,201,255],["/piyg6/3",233,29,253,253,224,239,255],["/piyg6/4",59,38,245,230,245,208,255],["/piyg6/5",63,129,215,161,215,106,255],["/piyg6/6",68,197,146,77,146,33,255],["/piyg7/1",230,220,197,197,27,125,255],["/piyg7/2",231,76,233,233,163,201,255],["/piyg7/3",233,29,253,253,224,239,255],["/piyg7/4",0,0,247,247,247,247,255],["/piyg7/5",59,38,245,230,245,208,255],["/piyg7/6",63,129,215,161,215,106,255],["/piyg7/7",68,197,146,77,146,33,255],["/piyg8/1",230,220,197,197,27,125,255],["/piyg8/2",232,118,222,222,119,174,255],["/piyg8/3",229,62,241,241,182,218,255],["/piyg8/4",233,29,253,253,224,239,255],["/piyg8/5",59,38,245,230,245,208,255],["/piyg8/6",61,103,225,184,225,134,255],["/piyg8/7",63,166,188,127,188,65,255],["/piyg8/8",68,197,146,77,146,33,255],["/piyg9/1",230,220,197,197,27,125,255],["/piyg9/2",232,118,222,222,119,174,255],["/piyg9/3",229,62,241,241,182,218,255],["/piyg9/4",233,29,253,253,224,239,255],["/piyg9/5",0,0,247,247,247,247,255],["/piyg9/6",59,38,245,230,245,208,255],["/piyg9/7",61,103,225,184,225,134,255],["/piyg9/8",63,166,188,127,188,65,255],["/piyg9/9",68,197,146,77,146,33,255],["/prgn10/1",206,255,75,64,0,75,255],["/prgn10/10",101,255,68,0,68,27,255],["/prgn10/2",206,173,131,118,42,131,255],["/prgn10/3",199,87,171,153,112,171,255],["/prgn10/4",199,51,207,194,165,207,255],["/prgn10/5",210,21,232,231,212,232,255],["/prgn10/6",76,30,240,217,240,211,255],["/prgn10/7",80,68,219,166,219,160,255],["/prgn10/8",88,123,174,90,174,97,255],["/prgn10/9",97,197,120,27,120,55,255],["/prgn11/1",206,255,75,64,0,75,255],["/prgn11/10",97,197,120,27,120,55,255],["/prgn11/11",101,255,68,0,68,27,255],["/prgn11/2",206,173,131,118,42,131,255],["/prgn11/3",199,87,171,153,112,171,255],["/prgn11/4",199,51,207,194,165,207,255],["/prgn11/5",210,21,232,231,212,232,255],["/prgn11/6",0,0,247,247,247,247,255],["/prgn11/7",76,30,240,217,240,211,255],["/prgn11/8",80,68,219,166,219,160,255],["/prgn11/9",88,123,174,90,174,97,255],["/prgn3/1",196,70,195,175,141,195,255],["/prgn3/2",0,0,247,247,247,247,255],["/prgn3/3",82,90,191,127,191,123,255],["/prgn4/1",201,168,148,123,50,148,255],["/prgn4/2",199,51,207,194,165,207,255],["/prgn4/3",80,68,219,166,219,160,255],["/prgn4/4",102,255,136,0,136,55,255],["/prgn5/1",201,168,148,123,50,148,255],["/prgn5/2",199,51,207,194,165,207,255],["/prgn5/3",0,0,247,247,247,247,255],["/prgn5/4",80,68,219,166,219,160,255],["/prgn5/5",102,255,136,0,136,55,255],["/prgn6/1",206,173,131,118,42,131,255],["/prgn6/2",196,70,195,175,141,195,255],["/prgn6/3",210,21,232,231,212,232,255],["/prgn6/4",76,30,240,217,240,211,255],["/prgn6/5",82,90,191,127,191,123,255],["/prgn6/6",97,197,120,27,120,55,255],["/prgn7/1",206,173,131,118,42,131,255],["/prgn7/2",196,70,195,175,141,195,255],["/prgn7/3",210,21,232,231,212,232,255],["/prgn7/4",0,0,247,247,247,247,255],["/prgn7/5",76,30,240,217,240,211,255],["/prgn7/6",82,90,191,127,191,123,255],["/prgn7/7",97,197,120,27,120,55,255],["/prgn8/1",206,173,131,118,42,131,255],["/prgn8/2",199,87,171,153,112,171,255],["/prgn8/3",199,51,207,194,165,207,255],["/prgn8/4",210,21,232,231,212,232,255],["/prgn8/5",76,30,240,217,240,211,255],["/prgn8/6",80,68,219,166,219,160,255],["/prgn8/7",88,123,174,90,174,97,255],["/prgn8/8",97,197,120,27,120,55,255],["/prgn9/1",206,173,131,118,42,131,255],["/prgn9/2",199,87,171,153,112,171,255],["/prgn9/3",199,51,207,194,165,207,255],["/prgn9/4",210,21,232,231,212,232,255],["/prgn9/5",0,0,247,247,247,247,255],["/prgn9/6",76,30,240,217,240,211,255],["/prgn9/7",80,68,219,166,219,160,255],["/prgn9/8",88,123,174,90,174,97,255],["/prgn9/9",97,197,120,27,120,55,255],["/pubu3/1",189,11,242,236,231,242,255],["/pubu3/2",151,61,219,166,189,219,255],["/pubu3/3",141,197,190,43,140,190,255],["/pubu4/1",185,8,246,241,238,246,255],["/pubu4/2",155,40,225,189,201,225,255],["/pubu4/3",145,112,207,116,169,207,255],["/pubu4/4",143,247,176,5,112,176,255],["/pubu5/1",185,8,246,241,238,246,255],["/pubu5/2",155,40,225,189,201,225,255],["/pubu5/3",145,112,207,116,169,207,255],["/pubu5/4",141,197,190,43,140,190,255],["/pubu5/5",143,247,141,4,90,141,255],["/pubu6/1",185,8,246,241,238,246,255],["/pubu6/2",168,24,230,208,209,230,255],["/pubu6/3",151,61,219,166,189,219,255],["/pubu6/4",145,112,207,116,169,207,255],["/pubu6/5",141,197,190,43,140,190,255],["/pubu6/6",143,247,141,4,90,141,255],["/pubu7/1",185,8,246,241,238,246,255],["/pubu7/2",168,24,230,208,209,230,255],["/pubu7/3",151,61,219,166,189,219,255],["/pubu7/4",145,112,207,116,169,207,255],["/pubu7/5",142,183,192,54,144,192,255],["/pubu7/6",143,247,176,5,112,176,255],["/pubu7/7",143,248,123,3,78,123,255],["/pubu8/1",233,8,255,255,247,251,255],["/pubu8/2",189,11,242,236,231,242,255],["/pubu8/3",168,24,230,208,209,230,255],["/pubu8/4",151,61,219,166,189,219,255],["/pubu8/5",145,112,207,116,169,207,255],["/pubu8/6",142,183,192,54,144,192,255],["/pubu8/7",143,247,176,5,112,176,255],["/pubu8/8",143,248,123,3,78,123,255],["/pubu9/1",233,8,255,255,247,251,255],["/pubu9/2",189,11,242,236,231,242,255],["/pubu9/3",168,24,230,208,209,230,255],["/pubu9/4",151,61,219,166,189,219,255],["/pubu9/5",145,112,207,116,169,207,255],["/pubu9/6",142,183,192,54,144,192,255],["/pubu9/7",143,247,176,5,112,176,255],["/pubu9/8",143,247,141,4,90,141,255],["/pubu9/9",143,249,88,2,56,88,255],["/pubugn3/1",200,14,240,236,226,240,255],["/pubugn3/2",151,61,219,166,189,219,255],["/pubugn3/3",130,208,153,28,144,153,255],["/pubugn4/1",207,8,247,246,239,247,255],["/pubugn4/2",155,40,225,189,201,225,255],["/pubugn4/3",143,128,207,103,169,207,255],["/pubugn4/4",130,251,138,2,129,138,255],["/pubugn5/1",207,8,247,246,239,247,255],["/pubugn5/2",155,40,225,189,201,225,255],["/pubugn5/3",143,128,207,103,169,207,255],["/pubugn5/4",130,208,153,28,144,153,255],["/pubugn5/5",119,252,108,1,108,89,255],["/pubugn6/1",207,8,247,246,239,247,255],["/pubugn6/2",168,24,230,208,209,230,255],["/pubugn6/3",151,61,219,166,189,219,255],["/pubugn6/4",143,128,207,103,169,207,255],["/pubugn6/5",130,208,153,28,144,153,255],["/pubugn6/6",119,252,108,1,108,89,255],["/pubugn7/1",207,8,247,246,239,247,255],["/pubugn7/2",168,24,230,208,209,230,255],["/pubugn7/3",151,61,219,166,189,219,255],["/pubugn7/4",143,128,207,103,169,207,255],["/pubugn7/5",142,183,192,54,144,192,255],["/pubugn7/6",130,251,138,2,129,138,255],["/pubugn7/7",118,252,100,1,100,80,255],["/pubugn8/1",233,8,255,255,247,251,255],["/pubugn8/2",200,14,240,236,226,240,255],["/pubugn8/3",168,24,230,208,209,230,255],["/pubugn8/4",151,61,219,166,189,219,255],["/pubugn8/5",143,128,207,103,169,207,255],["/pubugn8/6",142,183,192,54,144,192,255],["/pubugn8/7",130,251,138,2,129,138,255],["/pubugn8/8",118,252,100,1,100,80,255],["/pubugn9/1",233,8,255,255,247,251,255],["/pubugn9/2",200,14,240,236,226,240,255],["/pubugn9/3",168,24,230,208,209,230,255],["/pubugn9/4",151,61,219,166,189,219,255],["/pubugn9/5",143,128,207,103,169,207,255],["/pubugn9/6",142,183,192,54,144,192,255],["/pubugn9/7",130,251,138,2,129,138,255],["/pubugn9/8",119,252,108,1,108,89,255],["/pubugn9/9",117,251,70,1,70,54,255],["/puor10/1",18,238,127,127,59,8,255],["/puor10/10",195,255,75,45,0,75,255],["/puor10/2",20,246,179,179,88,6,255],["/puor10/3",22,232,224,224,130,20,255],["/puor10/4",23,155,253,253,184,99,255],["/puor10/5",24,72,254,254,224,182,255],["/puor10/6",165,20,235,216,218,235,255],["/puor10/7",177,47,210,178,171,210,255],["/puor10/8",179,84,172,128,115,172,255],["/puor10/9",189,181,136,84,39,136,255],["/puor11/1",18,238,127,127,59,8,255],["/puor11/10",189,181,136,84,39,136,255],["/puor11/11",195,255,75,45,0,75,255],["/puor11/2",20,246,179,179,88,6,255],["/puor11/3",22,232,224,224,130,20,255],["/puor11/4",23,155,253,253,184,99,255],["/puor11/5",24,72,254,254,224,182,255],["/puor11/6",0,0,247,247,247,247,255],["/puor11/7",165,20,235,216,218,235,255],["/puor11/8",177,47,210,178,171,210,255],["/puor11/9",179,84,172,128,115,172,255],["/puor3/1",23,187,241,241,163,64,255],["/puor3/2",0,0,247,247,247,247,255],["/puor3/3",178,69,195,153,142,195,255],["/puor4/1",17,253,230,230,97,1,255],["/puor4/2",23,155,253,253,184,99,255],["/puor4/3",177,47,210,178,171,210,255],["/puor4/4",185,155,153,94,60,153,255],["/puor5/1",17,253,230,230,97,1,255],["/puor5/2",23,155,253,253,184,99,255],["/puor5/3",0,0,247,247,247,247,255],["/puor5/4",177,47,210,178,171,210,255],["/puor5/5",185,155,153,94,60,153,255],["/puor6/1",20,246,179,179,88,6,255],["/puor6/2",23,187,241,241,163,64,255],["/puor6/3",24,72,254,254,224,182,255],["/puor6/4",165,20,235,216,218,235,255],["/puor6/5",178,69,195,153,142,195,255],["/puor6/6",189,181,136,84,39,136,255],["/puor7/1",20,246,179,179,88,6,255],["/puor7/2",23,187,241,241,163,64,255],["/puor7/3",24,72,254,254,224,182,255],["/puor7/4",0,0,247,247,247,247,255],["/puor7/5",165,20,235,216,218,235,255],["/puor7/6",178,69,195,153,142,195,255],["/puor7/7",189,181,136,84,39,136,255],["/puor8/1",20,246,179,179,88,6,255],["/puor8/2",22,232,224,224,130,20,255],["/puor8/3",23,155,253,253,184,99,255],["/puor8/4",24,72,254,254,224,182,255],["/puor8/5",165,20,235,216,218,235,255],["/puor8/6",177,47,210,178,171,210,255],["/puor8/7",179,84,172,128,115,172,255],["/puor8/8",189,181,136,84,39,136,255],["/puor9/1",20,246,179,179,88,6,255],["/puor9/2",22,232,224,224,130,20,255],["/puor9/3",23,155,253,253,184,99,255],["/puor9/4",24,72,254,254,224,182,255],["/puor9/5",0,0,247,247,247,247,255],["/puor9/6",165,20,235,216,218,235,255],["/puor9/7",177,47,210,178,171,210,255],["/puor9/8",179,84,172,128,115,172,255],["/puor9/9",189,181,136,84,39,136,255],["/purd3/1",188,14,239,231,225,239,255],["/purd3/2",214,67,201,201,148,199,255],["/purd3/3",234,222,221,221,28,119,255],["/purd4/1",185,8,246,241,238,246,255],["/purd4/2",211,41,216,215,181,216,255],["/purd4/3",228,139,223,223,101,176,255],["/purd4/4",239,232,206,206,18,86,255],["/purd5/1",185,8,246,241,238,246,255],["/purd5/2",211,41,216,215,181,216,255],["/purd5/3",228,139,223,223,101,176,255],["/purd5/4",234,222,221,221,28,119,255],["/purd5/5",236,255,152,152,0,67,255],["/purd6/1",185,8,246,241,238,246,255],["/purd6/2",204,38,218,212,185,218,255],["/purd6/3",214,67,201,201,148,199,255],["/purd6/4",228,139,223,223,101,176,255],["/purd6/5",234,222,221,221,28,119,255],["/purd6/6",236,255,152,152,0,67,255],["/purd7/1",185,8,246,241,238,246,255],["/purd7/2",204,38,218,212,185,218,255],["/purd7/3",214,67,201,201,148,199,255],["/purd7/4",228,139,223,223,101,176,255],["/purd7/5",233,209,231,231,41,138,255],["/purd7/6",239,232,206,206,18,86,255],["/purd7/7",236,255,145,145,0,63,255],["/purd8/1",195,5,249,247,244,249,255],["/purd8/2",188,14,239,231,225,239,255],["/purd8/3",204,38,218,212,185,218,255],["/purd8/4",214,67,201,201,148,199,255],["/purd8/5",228,139,223,223,101,176,255],["/purd8/6",233,209,231,231,41,138,255],["/purd8/7",239,232,206,206,18,86,255],["/purd8/8",236,255,145,145,0,63,255],["/purd9/1",195,5,249,247,244,249,255],["/purd9/2",188,14,239,231,225,239,255],["/purd9/3",204,38,218,212,185,218,255],["/purd9/4",214,67,201,201,148,199,255],["/purd9/5",228,139,223,223,101,176,255],["/purd9/6",233,209,231,231,41,138,255],["/purd9/7",239,232,206,206,18,86,255],["/purd9/8",236,255,152,152,0,67,255],["/purd9/9",242,255,103,103,0,31,255],["/purples3/1",180,8,245,239,237,245,255],["/purples3/2",168,37,220,188,189,220,255],["/purples3/3",176,100,177,117,107,177,255],["/purples4/1",182,7,247,242,240,247,255],["/purples4/2",173,28,226,203,201,226,255],["/purples4/3",173,58,200,158,154,200,255],["/purples4/4",182,128,163,106,81,163,255],["/purples5/1",182,7,247,242,240,247,255],["/purples5/2",173,28,226,203,201,226,255],["/purples5/3",173,58,200,158,154,200,255],["/purples5/4",176,100,177,117,107,177,255],["/purples5/5",188,185,143,84,39,143,255],["/purples6/1",182,7,247,242,240,247,255],["/purples6/2",170,18,235,218,218,235,255],["/purples6/3",168,37,220,188,189,220,255],["/purples6/4",173,58,200,158,154,200,255],["/purples6/5",176,100,177,117,107,177,255],["/purples6/6",188,185,143,84,39,143,255],["/purples7/1",182,7,247,242,240,247,255],["/purples7/2",170,18,235,218,218,235,255],["/purples7/3",168,37,220,188,189,220,255],["/purples7/4",173,58,200,158,154,200,255],["/purples7/5",172,83,186,128,125,186,255],["/purples7/6",182,128,163,106,81,163,255],["/purples7/7",190,216,134,74,20,134,255],["/purples8/1",191,2,253,252,251,253,255],["/purples8/2",180,8,245,239,237,245,255],["/purples8/3",170,18,235,218,218,235,255],["/purples8/4",168,37,220,188,189,220,255],["/purples8/5",173,58,200,158,154,200,255],["/purples8/6",172,83,186,128,125,186,255],["/purples8/7",182,128,163,106,81,163,255],["/purples8/8",190,216,134,74,20,134,255],["/purples9/1",191,2,253,252,251,253,255],["/purples9/2",180,8,245,239,237,245,255],["/purples9/3",170,18,235,218,218,235,255],["/purples9/4",168,37,220,188,189,220,255],["/purples9/5",173,58,200,158,154,200,255],["/purples9/6",172,83,186,128,125,186,255],["/purples9/7",182,128,163,106,81,163,255],["/purples9/8",188,185,143,84,39,143,255],["/purples9/9",191,255,125,63,0,125,255],["/rdbu10/1",242,255,103,103,0,31,255],["/rdbu10/10",150,241,97,5,48,97,255],["/rdbu10/2",249,220,178,178,24,43,255],["/rdbu10/3",5,163,214,214,96,77,255],["/rdbu10/4",13,119,244,244,165,130,255],["/rdbu10/5",15,54,253,253,219,199,255],["/rdbu10/6",142,32,240,209,229,240,255],["/rdbu10/7",141,87,222,146,197,222,255],["/rdbu10/8",143,167,195,67,147,195,255],["/rdbu10/9",148,206,172,33,102,172,255],["/rdbu11/1",242,255,103,103,0,31,255],["/rdbu11/10",148,206,172,33,102,172,255],["/rdbu11/11",150,241,97,5,48,97,255],["/rdbu11/2",249,220,178,178,24,43,255],["/rdbu11/3",5,163,214,214,96,77,255],["/rdbu11/4",13,119,244,244,165,130,255],["/rdbu11/5",15,54,253,253,219,199,255],["/rdbu11/6",0,0,247,247,247,247,255],["/rdbu11/7",142,32,240,209,229,240,255],["/rdbu11/8",141,87,222,146,197,222,255],["/rdbu11/9",143,167,195,67,147,195,255],["/rdbu3/1",12,150,239,239,138,98,255],["/rdbu3/2",0,0,247,247,247,247,255],["/rdbu3/3",143,128,207,103,169,207,255],["/rdbu4/1",248,255,202,202,0,32,255],["/rdbu4/2",13,119,244,244,165,130,255],["/rdbu4/3",141,87,222,146,197,222,255],["/rdbu4/4",143,247,176,5,113,176,255],["/rdbu5/1",248,255,202,202,0,32,255],["/rdbu5/2",13,119,244,244,165,130,255],["/rdbu5/3",0,0,247,247,247,247,255],["/rdbu5/4",141,87,222,146,197,222,255],["/rdbu5/5",143,247,176,5,113,176,255],["/rdbu6/1",249,220,178,178,24,43,255],["/rdbu6/2",12,150,239,239,138,98,255],["/rdbu6/3",15,54,253,253,219,199,255],["/rdbu6/4",142,32,240,209,229,240,255],["/rdbu6/5",143,128,207,103,169,207,255],["/rdbu6/6",148,206,172,33,102,172,255],["/rdbu7/1",249,220,178,178,24,43,255],["/rdbu7/2",12,150,239,239,138,98,255],["/rdbu7/3",15,54,253,253,219,199,255],["/rdbu7/4",0,0,247,247,247,247,255],["/rdbu7/5",142,32,240,209,229,240,255],["/rdbu7/6",143,128,207,103,169,207,255],["/rdbu7/7",148,206,172,33,102,172,255],["/rdbu8/1",249,220,178,178,24,43,255],["/rdbu8/2",5,163,214,214,96,77,255],["/rdbu8/3",13,119,244,244,165,130,255],["/rdbu8/4",15,54,253,253,219,199,255],["/rdbu8/5",142,32,240,209,229,240,255],["/rdbu8/6",141,87,222,146,197,222,255],["/rdbu8/7",143,167,195,67,147,195,255],["/rdbu8/8",148,206,172,33,102,172,255],["/rdbu9/1",249,220,178,178,24,43,255],["/rdbu9/2",5,163,214,214,96,77,255],["/rdbu9/3",13,119,244,244,165,130,255],["/rdbu9/4",15,54,253,253,219,199,255],["/rdbu9/5",0,0,247,247,247,247,255],["/rdbu9/6",142,32,240,209,229,240,255],["/rdbu9/7",141,87,222,146,197,222,255],["/rdbu9/8",143,167,195,67,147,195,255],["/rdbu9/9",148,206,172,33,102,172,255],["/rdgy10/1",242,255,103,103,0,31,255],["/rdgy10/10",0,0,26,26,26,26,255],["/rdgy10/2",249,220,178,178,24,43,255],["/rdgy10/3",5,163,214,214,96,77,255],["/rdgy10/4",13,119,244,244,165,130,255],["/rdgy10/5",15,54,253,253,219,199,255],["/rdgy10/6",0,0,224,224,224,224,255],["/rdgy10/7",0,0,186,186,186,186,255],["/rdgy10/8",0,0,135,135,135,135,255],["/rdgy10/9",0,0,77,77,77,77,255],["/rdgy11/1",242,255,103,103,0,31,255],["/rdgy11/10",0,0,77,77,77,77,255],["/rdgy11/11",0,0,26,26,26,26,255],["/rdgy11/2",249,220,178,178,24,43,255],["/rdgy11/3",5,163,214,214,96,77,255],["/rdgy11/4",13,119,244,244,165,130,255],["/rdgy11/5",15,54,253,253,219,199,255],["/rdgy11/6",0,0,255,255,255,255,255],["/rdgy11/7",0,0,224,224,224,224,255],["/rdgy11/8",0,0,186,186,186,186,255],["/rdgy11/9",0,0,135,135,135,135,255],["/rdgy3/1",12,150,239,239,138,98,255],["/rdgy3/2",0,0,255,255,255,255,255],["/rdgy3/3",0,0,153,153,153,153,255],["/rdgy4/1",248,255,202,202,0,32,255],["/rdgy4/2",13,119,244,244,165,130,255],["/rdgy4/3",0,0,186,186,186,186,255],["/rdgy4/4",0,0,64,64,64,64,255],["/rdgy5/1",248,255,202,202,0,32,255],["/rdgy5/2",13,119,244,244,165,130,255],["/rdgy5/3",0,0,255,255,255,255,255],["/rdgy5/4",0,0,186,186,186,186,255],["/rdgy5/5",0,0,64,64,64,64,255],["/rdgy6/1",249,220,178,178,24,43,255],["/rdgy6/2",12,150,239,239,138,98,255],["/rdgy6/3",15,54,253,253,219,199,255],["/rdgy6/4",0,0,224,224,224,224,255],["/rdgy6/5",0,0,153,153,153,153,255],["/rdgy6/6",0,0,77,77,77,77,255],["/rdgy7/1",249,220,178,178,24,43,255],["/rdgy7/2",12,150,239,239,138,98,255],["/rdgy7/3",15,54,253,253,219,199,255],["/rdgy7/4",0,0,255,255,255,255,255],["/rdgy7/5",0,0,224,224,224,224,255],["/rdgy7/6",0,0,153,153,153,153,255],["/rdgy7/7",0,0,77,77,77,77,255],["/rdgy8/1",249,220,178,178,24,43,255],["/rdgy8/2",5,163,214,214,96,77,255],["/rdgy8/3",13,119,244,244,165,130,255],["/rdgy8/4",15,54,253,253,219,199,255],["/rdgy8/5",0,0,224,224,224,224,255],["/rdgy8/6",0,0,186,186,186,186,255],["/rdgy8/7",0,0,135,135,135,135,255],["/rdgy8/8",0,0,77,77,77,77,255],["/rdgy9/1",249,220,178,178,24,43,255],["/rdgy9/2",5,163,214,214,96,77,255],["/rdgy9/3",13,119,244,244,165,130,255],["/rdgy9/4",15,54,253,253,219,199,255],["/rdgy9/5",0,0,255,255,255,255,255],["/rdgy9/6",0,0,224,224,224,224,255],["/rdgy9/7",0,0,186,186,186,186,255],["/rdgy9/8",0,0,135,135,135,135,255],["/rdgy9/9",0,0,77,77,77,77,255],["/rdpu3/1",3,32,253,253,224,221,255],["/rdpu3/2",244,92,250,250,159,181,255],["/rdpu3/3",227,220,197,197,27,138,255],["/rdpu4/1",13,28,254,254,235,226,255],["/rdpu4/2",252,72,251,251,180,185,255],["/rdpu4/3",238,147,247,247,104,161,255],["/rdpu4/4",224,253,174,174,1,126,255],["/rdpu5/1",13,28,254,254,235,226,255],["/rdpu5/2",252,72,251,251,180,185,255],["/rdpu5/3",238,147,247,247,104,161,255],["/rdpu5/4",227,220,197,197,27,138,255],["/rdpu5/5",213,252,122,122,1,119,255],["/rdpu6/1",13,28,254,254,235,226,255],["/rdpu6/2",3,60,252,252,197,192,255],["/rdpu6/3",244,92,250,250,159,181,255],["/rdpu6/4",238,147,247,247,104,161,255],["/rdpu6/5",227,220,197,197,27,138,255],["/rdpu6/6",213,252,122,122,1,119,255],["/rdpu7/1",13,28,254,254,235,226,255],["/rdpu7/2",3,60,252,252,197,192,255],["/rdpu7/3",244,92,250,250,159,181,255],["/rdpu7/4",238,147,247,247,104,161,255],["/rdpu7/5",230,195,221,221,52,151,255],["/rdpu7/6",224,253,174,174,1,126,255],["/rdpu7/7",213,252,122,122,1,119,255],["/rdpu8/1",14,12,255,255,247,243,255],["/rdpu8/2",3,32,253,253,224,221,255],["/rdpu8/3",3,60,252,252,197,192,255],["/rdpu8/4",244,92,250,250,159,181,255],["/rdpu8/5",238,147,247,247,104,161,255],["/rdpu8/6",230,195,221,221,52,151,255],["/rdpu8/7",224,253,174,174,1,126,255],["/rdpu8/8",213,252,122,122,1,119,255],["/rdpu9/1",14,12,255,255,247,243,255],["/rdpu9/2",3,32,253,253,224,221,255],["/rdpu9/3",3,60,252,252,197,192,255],["/rdpu9/4",244,92,250,250,159,181,255],["/rdpu9/5",238,147,247,247,104,161,255],["/rdpu9/6",230,195,221,221,52,151,255],["/rdpu9/7",224,253,174,174,1,126,255],["/rdpu9/8",213,252,122,122,1,119,255],["/rdpu9/9",199,255,106,73,0,106,255],["/rdylbu10/1",245,255,165,165,0,38,255],["/rdylbu10/10",167,171,149,49,54,149,255],["/rdylbu10/2",2,208,215,215,48,39,255],["/rdylbu10/3",10,184,244,244,109,67,255],["/rdylbu10/4",20,157,253,253,174,97,255],["/rdylbu10/5",30,110,254,254,224,144,255],["/rdylbu10/6",136,24,248,224,243,248,255],["/rdylbu10/7",138,67,233,171,217,233,255],["/rdylbu10/8",143,113,209,116,173,209,255],["/rdylbu10/9",151,157,180,69,117,180,255],["/rdylbu11/1",245,255,165,165,0,38,255],["/rdylbu11/10",151,157,180,69,117,180,255],["/rdylbu11/11",167,171,149,49,54,149,255],["/rdylbu11/2",2,208,215,215,48,39,255],["/rdylbu11/3",10,184,244,244,109,67,255],["/rdylbu11/4",20,157,253,253,174,97,255],["/rdylbu11/5",30,110,254,254,224,144,255],["/rdylbu11/6",42,64,255,255,255,191,255],["/rdylbu11/7",136,24,248,224,243,248,255],["/rdylbu11/8",138,67,233,171,217,233,255],["/rdylbu11/9",143,113,209,116,173,209,255],["/rdylbu3/1",13,164,252,252,141,89,255],["/rdylbu3/2",42,64,255,255,255,191,255],["/rdylbu3/3",143,86,219,145,191,219,255],["/rdylbu4/1",254,225,215,215,25,28,255],["/rdylbu4/2",20,157,253,253,174,97,255],["/rdylbu4/3",138,67,233,171,217,233,255],["/rdylbu4/4",145,193,182,44,123,182,255],["/rdylbu5/1",254,225,215,215,25,28,255],["/rdylbu5/2",20,157,253,253,174,97,255],["/rdylbu5/3",42,64,255,255,255,191,255],["/rdylbu5/4",138,67,233,171,217,233,255],["/rdylbu5/5",145,193,182,44,123,182,255],["/rdylbu6/1",2,208,215,215,48,39,255],["/rdylbu6/2",13,164,252,252,141,89,255],["/rdylbu6/3",30,110,254,254,224,144,255],["/rdylbu6/4",136,24,248,224,243,248,255],["/rdylbu6/5",143,86,219,145,191,219,255],["/rdylbu6/6",151,157,180,69,117,180,255],["/rdylbu7/1",2,208,215,215,48,39,255],["/rdylbu7/2",13,164,252,252,141,89,255],["/rdylbu7/3",30,110,254,254,224,144,255],["/rdylbu7/4",42,64,255,255,255,191,255],["/rdylbu7/5",136,24,248,224,243,248,255],["/rdylbu7/6",143,86,219,145,191,219,255],["/rdylbu7/7",151,157,180,69,117,180,255],["/rdylbu8/1",2,208,215,215,48,39,255],["/rdylbu8/2",10,184,244,244,109,67,255],["/rdylbu8/3",20,157,253,253,174,97,255],["/rdylbu8/4",30,110,254,254,224,144,255],["/rdylbu8/5",136,24,248,224,243,248,255],["/rdylbu8/6",138,67,233,171,217,233,255],["/rdylbu8/7",143,113,209,116,173,209,255],["/rdylbu8/8",151,157,180,69,117,180,255],["/rdylbu9/1",2,208,215,215,48,39,255],["/rdylbu9/2",10,184,244,244,109,67,255],["/rdylbu9/3",20,157,253,253,174,97,255],["/rdylbu9/4",30,110,254,254,224,144,255],["/rdylbu9/5",42,64,255,255,255,191,255],["/rdylbu9/6",136,24,248,224,243,248,255],["/rdylbu9/7",138,67,233,171,217,233,255],["/rdylbu9/8",143,113,209,116,173,209,255],["/rdylbu9/9",151,157,180,69,117,180,255],["/rdylgn10/1",245,255,165,165,0,38,255],["/rdylgn10/10",107,255,104,0,104,55,255],["/rdylgn10/2",2,208,215,215,48,39,255],["/rdylgn10/3",10,184,244,244,109,67,255],["/rdylgn10/4",20,157,253,253,174,97,255],["/rdylgn10/5",31,115,254,254,224,139,255],["/rdylgn10/6",51,106,239,217,239,139,255],["/rdylgn10/7",62,130,217,166,217,106,255],["/rdylgn10/8",83,121,189,102,189,99,255],["/rdylgn10/9",103,211,152,26,152,80,255],["/rdylgn11/1",245,255,165,165,0,38,255],["/rdylgn11/10",103,211,152,26,152,80,255],["/rdylgn11/11",107,255,104,0,104,55,255],["/rdylgn11/2",2,208,215,215,48,39,255],["/rdylgn11/3",10,184,244,244,109,67,255],["/rdylgn11/4",20,157,253,253,174,97,255],["/rdylgn11/5",31,115,254,254,224,139,255],["/rdylgn11/6",42,64,255,255,255,191,255],["/rdylgn11/7",51,106,239,217,239,139,255],["/rdylgn11/8",62,130,217,166,217,106,255],["/rdylgn11/9",83,121,189,102,189,99,255],["/rdylgn3/1",13,164,252,252,141,89,255],["/rdylgn3/2",42,64,255,255,255,191,255],["/rdylgn3/3",66,136,207,145,207,96,255],["/rdylgn4/1",254,225,215,215,25,28,255],["/rdylgn4/2",20,157,253,253,174,97,255],["/rdylgn4/3",62,130,217,166,217,106,255],["/rdylgn4/4",98,210,150,26,150,65,255],["/rdylgn5/1",254,225,215,215,25,28,255],["/rdylgn5/2",20,157,253,253,174,97,255],["/rdylgn5/3",42,64,255,255,255,191,255],["/rdylgn5/4",62,130,217,166,217,106,255],["/rdylgn5/5",98,210,150,26,150,65,255],["/rdylgn6/1",2,208,215,215,48,39,255],["/rdylgn6/2",13,164,252,252,141,89,255],["/rdylgn6/3",31,115,254,254,224,139,255],["/rdylgn6/4",51,106,239,217,239,139,255],["/rdylgn6/5",66,136,207,145,207,96,255],["/rdylgn6/6",103,211,152,26,152,80,255],["/rdylgn7/1",2,208,215,215,48,39,255],["/rdylgn7/2",13,164,252,252,141,89,255],["/rdylgn7/3",31,115,254,254,224,139,255],["/rdylgn7/4",42,64,255,255,255,191,255],["/rdylgn7/5",51,106,239,217,239,139,255],["/rdylgn7/6",66,136,207,145,207,96,255],["/rdylgn7/7",103,211,152,26,152,80,255],["/rdylgn8/1",2,208,215,215,48,39,255],["/rdylgn8/2",10,184,244,244,109,67,255],["/rdylgn8/3",20,157,253,253,174,97,255],["/rdylgn8/4",31,115,254,254,224,139,255],["/rdylgn8/5",51,106,239,217,239,139,255],["/rdylgn8/6",62,130,217,166,217,106,255],["/rdylgn8/7",83,121,189,102,189,99,255],["/rdylgn8/8",103,211,152,26,152,80,255],["/rdylgn9/1",2,208,215,215,48,39,255],["/rdylgn9/2",10,184,244,244,109,67,255],["/rdylgn9/3",20,157,253,253,174,97,255],["/rdylgn9/4",31,115,254,254,224,139,255],["/rdylgn9/5",42,64,255,255,255,191,255],["/rdylgn9/6",51,106,239,217,239,139,255],["/rdylgn9/7",62,130,217,166,217,106,255],["/rdylgn9/8",83,121,189,102,189,99,255],["/rdylgn9/9",103,211,152,26,152,80,255],["/reds3/1",13,44,254,254,224,210,255],["/reds3/2",9,139,252,252,146,114,255],["/reds3/3",1,211,222,222,45,38,255],["/reds4/1",13,37,254,254,229,217,255],["/reds4/2",11,108,252,252,174,145,255],["/reds4/3",7,179,251,251,106,74,255],["/reds4/4",253,224,203,203,24,29,255],["/reds5/1",13,37,254,254,229,217,255],["/reds5/2",11,108,252,252,174,145,255],["/reds5/3",7,179,251,251,106,74,255],["/reds5/4",1,211,222,222,45,38,255],["/reds5/5",253,231,165,165,15,21,255],["/reds6/1",13,37,254,254,229,217,255],["/reds6/2",12,92,252,252,187,161,255],["/reds6/3",9,139,252,252,146,114,255],["/reds6/4",7,179,251,251,106,74,255],["/reds6/5",1,211,222,222,45,38,255],["/reds6/6",253,231,165,165,15,21,255],["/reds7/1",13,37,254,254,229,217,255],["/reds7/2",12,92,252,252,187,161,255],["/reds7/3",9,139,252,252,146,114,255],["/reds7/4",7,179,251,251,106,74,255],["/reds7/5",3,208,239,239,59,44,255],["/reds7/6",253,224,203,203,24,29,255],["/reds7/7",251,255,153,153,0,13,255],["/reds8/1",14,15,255,255,245,240,255],["/reds8/2",13,44,254,254,224,210,255],["/reds8/3",12,92,252,252,187,161,255],["/reds8/4",9,139,252,252,146,114,255],["/reds8/5",7,179,251,251,106,74,255],["/reds8/6",3,208,239,239,59,44,255],["/reds8/7",253,224,203,203,24,29,255],["/reds8/8",251,255,153,153,0,13,255],["/reds9/1",14,15,255,255,245,240,255],["/reds9/2",13,44,254,254,224,210,255],["/reds9/3",12,92,252,252,187,161,255],["/reds9/4",9,139,252,252,146,114,255],["/reds9/5",7,179,251,251,106,74,255],["/reds9/6",3,208,239,239,59,44,255],["/reds9/7",253,224,203,203,24,29,255],["/reds9/8",253,231,165,165,15,21,255],["/reds9/9",249,255,103,103,0,13,255],["/set13/1",254,225,228,228,26,28,255],["/set13/2",146,178,184,55,126,184,255],["/set13/3",83,147,175,77,175,74,255],["/set14/1",254,225,228,228,26,28,255],["/set14/2",146,178,184,55,126,184,255],["/set14/3",83,147,175,77,175,74,255],["/set14/4",207,132,163,152,78,163,255],["/set15/1",254,225,228,228,26,28,255],["/set15/2",146,178,184,55,126,184,255],["/set15/3",83,147,175,77,175,74,255],["/set15/4",207,132,163,152,78,163,255],["/set15/5",21,255,255,255,127,0,255],["/set16/1",254,225,228,228,26,28,255],["/set16/2",146,178,184,55,126,184,255],["/set16/3",83,147,175,77,175,74,255],["/set16/4",207,132,163,152,78,163,255],["/set16/5",21,255,255,255,127,0,255],["/set16/6",42,204,255,255,255,51,255],["/set17/1",254,225,228,228,26,28,255],["/set17/2",146,178,184,55,126,184,255],["/set17/3",83,147,175,77,175,74,255],["/set17/4",207,132,163,152,78,163,255],["/set17/5",21,255,255,255,127,0,255],["/set17/6",42,204,255,255,255,51,255],["/set17/7",15,193,166,166,86,40,255],["/set18/1",254,225,228,228,26,28,255],["/set18/2",146,178,184,55,126,184,255],["/set18/3",83,147,175,77,175,74,255],["/set18/4",207,132,163,152,78,163,255],["/set18/5",21,255,255,255,127,0,255],["/set18/6",42,204,255,255,255,51,255],["/set18/7",15,193,166,166,86,40,255],["/set18/8",232,121,247,247,129,191,255],["/set19/1",254,225,228,228,26,28,255],["/set19/2",146,178,184,55,126,184,255],["/set19/3",83,147,175,77,175,74,255],["/set19/4",207,132,163,152,78,163,255],["/set19/5",21,255,255,255,127,0,255],["/set19/6",42,204,255,255,255,51,255],["/set19/7",15,193,166,166,86,40,255],["/set19/8",232,121,247,247,129,191,255],["/set19/9",0,0,153,153,153,153,255],["/set23/1",114,120,194,102,194,165,255],["/set23/2",11,155,252,252,141,98,255],["/set23/3",156,77,203,141,160,203,255],["/set24/1",114,120,194,102,194,165,255],["/set24/2",11,155,252,252,141,98,255],["/set24/3",156,77,203,141,160,203,255],["/set24/4",228,102,231,231,138,195,255],["/set25/1",114,120,194,102,194,165,255],["/set25/2",11,155,252,252,141,98,255],["/set25/3",156,77,203,141,160,203,255],["/set25/4",228,102,231,231,138,195,255],["/set25/5",58,155,216,166,216,84,255],["/set26/1",114,120,194,102,194,165,255],["/set26/2",11,155,252,252,141,98,255],["/set26/3",156,77,203,141,160,203,255],["/set26/4",228,102,231,231,138,195,255],["/set26/5",58,155,216,166,216,84,255],["/set26/6",34,208,255,255,217,47,255],["/set27/1",114,120,194,102,194,165,255],["/set27/2",11,155,252,252,141,98,255],["/set27/3",156,77,203,141,160,203,255],["/set27/4",228,102,231,231,138,195,255],["/set27/5",58,155,216,166,216,84,255],["/set27/6",34,208,255,255,217,47,255],["/set27/7",25,90,229,229,196,148,255],["/set28/1",114,120,194,102,194,165,255],["/set28/2",11,155,252,252,141,98,255],["/set28/3",156,77,203,141,160,203,255],["/set28/4",228,102,231,231,138,195,255],["/set28/5",58,155,216,166,216,84,255],["/set28/6",34,208,255,255,217,47,255],["/set28/7",25,90,229,229,196,148,255],["/set28/8",0,0,179,179,179,179,255],["/set310/1",120,84,211,141,211,199,255],["/set310/10",211,82,189,188,128,189,255],["/set310/2",42,76,255,255,255,179,255],["/set310/3",175,37,218,190,186,218,255],["/set310/4",4,139,251,251,128,114,255],["/set310/5",144,100,211,128,177,211,255],["/set310/6",22,156,253,253,180,98,255],["/set310/7",58,134,222,179,222,105,255],["/set310/8",233,47,252,252,205,229,255],["/set310/9",0,0,217,217,217,217,255],["/set311/1",120,84,211,141,211,199,255],["/set311/10",211,82,189,188,128,189,255],["/set311/11",77,41,235,204,235,197,255],["/set311/2",42,76,255,255,255,179,255],["/set311/3",175,37,218,190,186,218,255],["/set311/4",4,139,251,251,128,114,255],["/set311/5",144,100,211,128,177,211,255],["/set311/6",22,156,253,253,180,98,255],["/set311/7",58,134,222,179,222,105,255],["/set311/8",233,47,252,252,205,229,255],["/set311/9",0,0,217,217,217,217,255],["/set312/1",120,84,211,141,211,199,255],["/set312/10",211,82,189,188,128,189,255],["/set312/11",77,41,235,204,235,197,255],["/set312/12",37,144,255,255,237,111,255],["/set312/2",42,76,255,255,255,179,255],["/set312/3",175,37,218,190,186,218,255],["/set312/4",4,139,251,251,128,114,255],["/set312/5",144,100,211,128,177,211,255],["/set312/6",22,156,253,253,180,98,255],["/set312/7",58,134,222,179,222,105,255],["/set312/8",233,47,252,252,205,229,255],["/set312/9",0,0,217,217,217,217,255],["/set33/1",120,84,211,141,211,199,255],["/set33/2",42,76,255,255,255,179,255],["/set33/3",175,37,218,190,186,218,255],["/set34/1",120,84,211,141,211,199,255],["/set34/2",42,76,255,255,255,179,255],["/set34/3",175,37,218,190,186,218,255],["/set34/4",4,139,251,251,128,114,255],["/set35/1",120,84,211,141,211,199,255],["/set35/2",42,76,255,255,255,179,255],["/set35/3",175,37,218,190,186,218,255],["/set35/4",4,139,251,251,128,114,255],["/set35/5",144,100,211,128,177,211,255],["/set36/1",120,84,211,141,211,199,255],["/set36/2",42,76,255,255,255,179,255],["/set36/3",175,37,218,190,186,218,255],["/set36/4",4,139,251,251,128,114,255],["/set36/5",144,100,211,128,177,211,255],["/set36/6",22,156,253,253,180,98,255],["/set37/1",120,84,211,141,211,199,255],["/set37/2",42,76,255,255,255,179,255],["/set37/3",175,37,218,190,186,218,255],["/set37/4",4,139,251,251,128,114,255],["/set37/5",144,100,211,128,177,211,255],["/set37/6",22,156,253,253,180,98,255],["/set37/7",58,134,222,179,222,105,255],["/set38/1",120,84,211,141,211,199,255],["/set38/2",42,76,255,255,255,179,255],["/set38/3",175,37,218,190,186,218,255],["/set38/4",4,139,251,251,128,114,255],["/set38/5",144,100,211,128,177,211,255],["/set38/6",22,156,253,253,180,98,255],["/set38/7",58,134,222,179,222,105,255],["/set38/8",233,47,252,252,205,229,255],["/set39/1",120,84,211,141,211,199,255],["/set39/2",42,76,255,255,255,179,255],["/set39/3",175,37,218,190,186,218,255],["/set39/4",4,139,251,251,128,114,255],["/set39/5",144,100,211,128,177,211,255],["/set39/6",22,156,253,253,180,98,255],["/set39/7",58,134,222,179,222,105,255],["/set39/8",233,47,252,252,205,229,255],["/set39/9",0,0,217,217,217,217,255],["/spectral10/1",237,253,158,158,1,66,255],["/spectral10/10",177,130,162,94,79,162,255],["/spectral10/2",250,180,213,213,62,79,255],["/spectral10/3",10,184,244,244,109,67,255],["/spectral10/4",20,157,253,253,174,97,255],["/spectral10/5",31,115,254,254,224,139,255],["/spectral10/6",49,96,245,230,245,152,255],["/spectral10/7",79,65,221,171,221,164,255],["/spectral10/8",114,120,194,102,194,165,255],["/spectral10/9",143,187,189,50,136,189,255],["/spectral11/1",237,253,158,158,1,66,255],["/spectral11/10",143,187,189,50,136,189,255],["/spectral11/11",177,130,162,94,79,162,255],["/spectral11/2",250,180,213,213,62,79,255],["/spectral11/3",10,184,244,244,109,67,255],["/spectral11/4",20,157,253,253,174,97,255],["/spectral11/5",31,115,254,254,224,139,255],["/spectral11/6",42,64,255,255,255,191,255],["/spectral11/7",49,96,245,230,245,152,255],["/spectral11/8",79,65,221,171,221,164,255],["/spectral11/9",114,120,194,102,194,165,255],["/spectral3/1",13,164,252,252,141,89,255],["/spectral3/2",42,64,255,255,255,191,255],["/spectral3/3",81,77,213,153,213,148,255],["/spectral4/1",254,225,215,215,25,28,255],["/spectral4/2",20,157,253,253,174,97,255],["/spectral4/3",79,65,221,171,221,164,255],["/spectral4/4",143,196,186,43,131,186,255],["/spectral5/1",254,225,215,215,25,28,255],["/spectral5/2",20,157,253,253,174,97,255],["/spectral5/3",42,64,255,255,255,191,255],["/spectral5/4",79,65,221,171,221,164,255],["/spectral5/5",143,196,186,43,131,186,255],["/spectral6/1",250,180,213,213,62,79,255],["/spectral6/2",13,164,252,252,141,89,255],["/spectral6/3",31,115,254,254,224,139,255],["/spectral6/4",49,96,245,230,245,152,255],["/spectral6/5",81,77,213,153,213,148,255],["/spectral6/6",143,187,189,50,136,189,255],["/spectral7/1",250,180,213,213,62,79,255],["/spectral7/2",13,164,252,252,141,89,255],["/spectral7/3",31,115,254,254,224,139,255],["/spectral7/4",42,64,255,255,255,191,255],["/spectral7/5",49,96,245,230,245,152,255],["/spectral7/6",81,77,213,153,213,148,255],["/spectral7/7",143,187,189,50,136,189,255],["/spectral8/1",250,180,213,213,62,79,255],["/spectral8/2",10,184,244,244,109,67,255],["/spectral8/3",20,157,253,253,174,97,255],["/spectral8/4",31,115,254,254,224,139,255],["/spectral8/5",49,96,245,230,245,152,255],["/spectral8/6",79,65,221,171,221,164,255],["/spectral8/7",114,120,194,102,194,165,255],["/spectral8/8",143,187,189,50,136,189,255],["/spectral9/1",250,180,213,213,62,79,255],["/spectral9/2",10,184,244,244,109,67,255],["/spectral9/3",20,157,253,253,174,97,255],["/spectral9/4",31,115,254,254,224,139,255],["/spectral9/5",42,64,255,255,255,191,255],["/spectral9/6",49,96,245,230,245,152,255],["/spectral9/7",79,65,221,171,221,164,255],["/spectral9/8",114,120,194,102,194,165,255],["/spectral9/9",143,187,189,50,136,189,255],["/svg/aliceblue",147,15,255,240,248,255,255],["/svg/antiquewhite",24,35,250,250,235,215,255],["/svg/aqua",127,255,255,0,255,255,255],["/svg/aquamarine",113,128,255,127,255,212,255],["/svg/azure",127,15,255,240,255,255,255],["/svg/beige",42,26,245,245,245,220,255],["/svg/bisque",23,58,255,255,228,196,255],["/svg/black",0,0,0,0,0,0,255],["/svg/blanchedalmond",25,49,255,255,235,205,255],["/svg/blue",170,255,255,0,0,255,255],["/svg/blueviolet",192,206,226,138,43,226,255],["/svg/brown",0,190,165,165,42,42,255],["/svg/burlywood",23,99,222,222,184,135,255],["/svg/cadetblue",128,103,160,95,158,160,255],["/svg/chartreuse",63,255,255,127,255,0,255],["/svg/chocolate",17,218,210,210,105,30,255],["/svg/coral",11,175,255,255,127,80,255],["/svg/cornflowerblue",154,147,237,100,149,237,255],["/svg/cornsilk",33,34,255,255,248,220,255],["/svg/crimson",246,231,220,220,20,60,255],["/svg/cyan",127,255,255,0,255,255,255],["/svg/darkblue",170,255,139,0,0,139,255],["/svg/darkcyan",127,255,139,0,139,139,255],["/svg/darkgoldenrod",30,239,184,184,134,11,255],["/svg/darkgray",0,0,169,169,169,169,255],["/svg/darkgreen",85,255,100,0,100,0,255],["/svg/darkgrey",0,0,169,169,169,169,255],["/svg/darkkhaki",39,110,189,189,183,107,255],["/svg/darkmagenta",212,255,139,139,0,139,255],["/svg/darkolivegreen",58,142,107,85,107,47,255],["/svg/darkorange",23,255,255,255,140,0,255],["/svg/darkorchid",198,192,204,153,50,204,255],["/svg/darkred",0,255,139,139,0,0,255],["/svg/darksalmon",10,121,233,233,150,122,255],["/svg/darkseagreen",85,61,188,143,188,143,255],["/svg/darkslateblue",175,143,139,72,61,139,255],["/svg/darkslategray",127,103,79,47,79,79,255],["/svg/darkslategrey",127,103,79,47,79,79,255],["/svg/darkturquoise",128,255,209,0,206,209,255],["/svg/darkviolet",199,255,211,148,0,211,255],["/svg/deeppink",232,235,255,255,20,147,255],["/svg/deepskyblue",138,255,255,0,191,255,255],["/svg/dimgray",0,0,105,105,105,105,255],["/svg/dimgrey",0,0,105,105,105,105,255],["/svg/dodgerblue",148,225,255,30,144,255,255],["/svg/firebrick",0,206,178,178,34,34,255],["/svg/floralwhite",28,15,255,255,250,240,255],["/svg/forestgreen",85,192,139,34,139,34,255],["/svg/fuchsia",212,255,255,255,0,255,255],["/svg/gainsboro",0,0,220,220,220,220,255],["/svg/ghostwhite",170,7,255,248,248,255,255],["/svg/gold",35,255,255,255,215,0,255],["/svg/goldenrod",30,217,218,218,165,32,255],["/svg/gray",0,0,128,128,128,128,255],["/svg/green",85,255,128,0,128,0,255],["/svg/greenyellow",59,208,255,173,255,47,255],["/svg/grey",0,0,128,128,128,128,255],["/svg/honeydew",85,15,255,240,255,240,255],["/svg/hotpink",233,150,255,255,105,180,255],["/svg/indianred",0,140,205,205,92,92,255],["/svg/indigo",194,255,130,75,0,130,255],["/svg/ivory",42,15,255,255,255,240,255],["/svg/khaki",38,106,240,240,230,140,255],["/svg/lavender",170,20,250,230,230,250,255],["/svg/lavenderblush",240,15,255,255,240,245,255],["/svg/lawngreen",64,255,252,124,252,0,255],["/svg/lemonchiffon",38,49,255,255,250,205,255],["/svg/lightblue",137,63,230,173,216,230,255],["/svg/lightcoral",0,119,240,240,128,128,255],["/svg/lightcyan",127,31,255,224,255,255,255],["/svg/lightgoldenrodyellow",42,40,250,250,250,210,255],["/svg/lightgray",0,0,211,211,211,211,255],["/svg/lightgreen",85,100,238,144,238,144,255],["/svg/lightgrey",0,0,211,211,211,211,255],["/svg/lightpink",248,73,255,255,182,193,255],["/svg/lightsalmon",12,132,255,255,160,122,255],["/svg/lightseagreen",125,209,178,32,178,170,255],["/svg/lightskyblue",143,117,250,135,206,250,255],["/svg/lightslategray",148,56,153,119,136,153,255],["/svg/lightslategrey",148,56,153,119,136,153,255],["/svg/lightsteelblue",151,52,222,176,196,222,255],["/svg/lightyellow",42,31,255,255,255,224,255],["/svg/lime",85,255,255,0,255,0,255],["/svg/limegreen",85,192,205,50,205,50,255],["/svg/linen",21,20,250,250,240,230,255],["/svg/magenta",212,255,255,255,0,255,255],["/svg/maroon",0,255,128,128,0,0,255],["/svg/mediumaquamarine",113,128,205,102,205,170,255],["/svg/mediumblue",170,255,205,0,0,205,255],["/svg/mediumorchid",204,152,211,186,85,211,255],["/svg/mediumpurple",183,124,219,147,112,219,255],["/svg/mediumseagreen",103,169,179,60,179,113,255],["/svg/mediumslateblue",176,143,238,123,104,238,255],["/svg/mediumspringgreen",111,255,250,0,250,154,255],["/svg/mediumturquoise",125,167,209,72,209,204,255],["/svg/mediumvioletred",228,228,199,199,21,133,255],["/svg/midnightblue",170,198,112,25,25,112,255],["/svg/mintcream",106,9,255,245,255,250,255],["/svg/mistyrose",4,30,255,255,228,225,255],["/svg/moccasin",26,73,255,255,228,181,255],["/svg/navajowhite",25,81,255,255,222,173,255],["/svg/navy",170,255,128,0,0,128,255],["/svg/oldlace",27,23,253,253,245,230,255],["/svg/olive",42,255,128,128,128,0,255],["/svg/olivedrab",56,192,142,107,142,35,255],["/svg/orange",27,255,255,255,165,0,255],["/svg/orangered",11,255,255,255,69,0,255],["/svg/orchid",214,123,218,218,112,214,255],["/svg/palegoldenrod",38,72,238,238,232,170,255],["/svg/palegreen",85,100,251,152,251,152,255],["/svg/paleturquoise",127,67,238,175,238,238,255],["/svg/palevioletred",241,124,219,219,112,147,255],["/svg/papayawhip",26,41,255,255,239,213,255],["/svg/peachpuff",20,70,255,255,218,185,255],["/svg/peru",20,176,205,205,133,63,255],["/svg/pink",247,63,255,255,192,203,255],["/svg/plum",212,70,221,221,160,221,255],["/svg/powderblue",132,59,230,176,224,230,255],["/svg/purple",212,255,128,128,0,128,255],["/svg/red",0,255,255,255,0,0,255],["/svg/rosybrown",0,61,188,188,143,143,255],["/svg/royalblue",159,181,225,65,105,225,255],["/svg/saddlebrown",17,220,139,139,69,19,255],["/svg/salmon",4,138,250,250,128,114,255],["/svg/sandybrown",19,154,244,244,164,96,255],["/svg/seagreen",103,170,139,46,139,87,255],["/svg/seashell",17,16,255,255,245,238,255],["/svg/sienna",13,183,160,160,82,45,255],["/svg/silver",0,0,192,192,192,192,255],["/svg/skyblue",139,108,235,135,206,235,255],["/svg/slateblue",175,143,205,106,90,205,255],["/svg/slategray",148,56,144,112,128,144,255],["/svg/slategrey",148,56,144,112,128,144,255],["/svg/snow",0,5,255,255,250,250,255],["/svg/springgreen",106,255,255,0,255,127,255],["/svg/steelblue",146,155,180,70,130,180,255],["/svg/tan",24,84,210,210,180,140,255],["/svg/teal",127,255,128,0,128,128,255],["/svg/thistle",212,29,216,216,191,216,255],["/svg/tomato",6,184,255,255,99,71,255],["/svg/turquoise",123,182,224,64,224,208,255],["/svg/violet",212,115,238,238,130,238,255],["/svg/wheat",27,68,245,245,222,179,255],["/svg/white",0,0,255,255,255,255,255],["/svg/whitesmoke",0,0,245,245,245,245,255],["/svg/yellow",42,255,255,255,255,0,255],["/svg/yellowgreen",56,192,205,154,205,50,255],["/ylgn3/1",45,67,252,247,252,185,255],["/ylgn3/2",68,91,221,173,221,142,255],["/ylgn3/3",98,178,163,49,163,84,255],["/ylgn4/1",42,50,255,255,255,204,255],["/ylgn4/2",62,85,230,194,230,153,255],["/ylgn4/3",85,100,198,120,198,121,255],["/ylgn4/4",99,187,132,35,132,67,255],["/ylgn5/1",42,50,255,255,255,204,255],["/ylgn5/2",62,85,230,194,230,153,255],["/ylgn5/3",85,100,198,120,198,121,255],["/ylgn5/4",98,178,163,49,163,84,255],["/ylgn5/5",107,255,104,0,104,55,255],["/ylgn6/1",42,50,255,255,255,204,255],["/ylgn6/2",55,81,240,217,240,163,255],["/ylgn6/3",68,91,221,173,221,142,255],["/ylgn6/4",85,100,198,120,198,121,255],["/ylgn6/5",98,178,163,49,163,84,255],["/ylgn6/6",107,255,104,0,104,55,255],["/ylgn7/1",42,50,255,255,255,204,255],["/ylgn7/2",55,81,240,217,240,163,255],["/ylgn7/3",68,91,221,173,221,142,255],["/ylgn7/4",85,100,198,120,198,121,255],["/ylgn7/5",96,158,171,65,171,93,255],["/ylgn7/6",99,187,132,35,132,67,255],["/ylgn7/7",108,255,90,0,90,50,255],["/ylgn8/1",42,25,255,255,255,229,255],["/ylgn8/2",45,67,252,247,252,185,255],["/ylgn8/3",55,81,240,217,240,163,255],["/ylgn8/4",68,91,221,173,221,142,255],["/ylgn8/5",85,100,198,120,198,121,255],["/ylgn8/6",96,158,171,65,171,93,255],["/ylgn8/7",99,187,132,35,132,67,255],["/ylgn8/8",108,255,90,0,90,50,255],["/ylgn9/1",42,25,255,255,255,229,255],["/ylgn9/2",45,67,252,247,252,185,255],["/ylgn9/3",55,81,240,217,240,163,255],["/ylgn9/4",68,91,221,173,221,142,255],["/ylgn9/5",85,100,198,120,198,121,255],["/ylgn9/6",96,158,171,65,171,93,255],["/ylgn9/7",99,187,132,35,132,67,255],["/ylgn9/8",107,255,104,0,104,55,255],["/ylgn9/9",110,255,69,0,69,41,255],["/ylgnbu3/1",49,73,248,237,248,177,255],["/ylgnbu3/2",117,97,205,127,205,187,255],["/ylgnbu3/3",144,194,184,44,127,184,255],["/ylgnbu4/1",42,50,255,255,255,204,255],["/ylgnbu4/2",99,66,218,161,218,180,255],["/ylgnbu4/3",132,170,196,65,182,196,255],["/ylgnbu4/4",150,203,168,34,94,168,255],["/ylgnbu5/1",42,50,255,255,255,204,255],["/ylgnbu5/2",99,66,218,161,218,180,255],["/ylgnbu5/3",132,170,196,65,182,196,255],["/ylgnbu5/4",144,194,184,44,127,184,255],["/ylgnbu5/5",164,191,148,37,52,148,255],["/ylgnbu6/1",42,50,255,255,255,204,255],["/ylgnbu6/2",69,58,233,199,233,180,255],["/ylgnbu6/3",117,97,205,127,205,187,255],["/ylgnbu6/4",132,170,196,65,182,196,255],["/ylgnbu6/5",144,194,184,44,127,184,255],["/ylgnbu6/6",164,191,148,37,52,148,255],["/ylgnbu7/1",42,50,255,255,255,204,255],["/ylgnbu7/2",69,58,233,199,233,180,255],["/ylgnbu7/3",117,97,205,127,205,187,255],["/ylgnbu7/4",132,170,196,65,182,196,255],["/ylgnbu7/5",139,216,192,29,145,192,255],["/ylgnbu7/6",150,203,168,34,94,168,255],["/ylgnbu7/7",158,231,132,12,44,132,255],["/ylgnbu8/1",42,38,255,255,255,217,255],["/ylgnbu8/2",49,73,248,237,248,177,255],["/ylgnbu8/3",69,58,233,199,233,180,255],["/ylgnbu8/4",117,97,205,127,205,187,255],["/ylgnbu8/5",132,170,196,65,182,196,255],["/ylgnbu8/6",139,216,192,29,145,192,255],["/ylgnbu8/7",150,203,168,34,94,168,255],["/ylgnbu8/8",158,231,132,12,44,132,255],["/ylgnbu9/1",42,38,255,255,255,217,255],["/ylgnbu9/2",49,73,248,237,248,177,255],["/ylgnbu9/3",69,58,233,199,233,180,255],["/ylgnbu9/4",117,97,205,127,205,187,255],["/ylgnbu9/5",132,170,196,65,182,196,255],["/ylgnbu9/6",139,216,192,29,145,192,255],["/ylgnbu9/7",150,203,168,34,94,168,255],["/ylgnbu9/8",164,191,148,37,52,148,255],["/ylgnbu9/9",158,231,88,8,29,88,255],["/ylorbr3/1",37,66,255,255,247,188,255],["/ylorbr3/2",28,175,254,254,196,79,255],["/ylorbr3/3",16,238,217,217,95,14,255],["/ylorbr4/1",42,42,255,255,255,212,255],["/ylorbr4/2",28,112,254,254,217,142,255],["/ylorbr4/3",22,213,254,254,153,41,255],["/ylorbr4/4",15,252,204,204,76,2,255],["/ylorbr5/1",42,42,255,255,255,212,255],["/ylorbr5/2",28,112,254,254,217,142,255],["/ylorbr5/3",22,213,254,254,153,41,255],["/ylorbr5/4",16,238,217,217,95,14,255],["/ylorbr5/5",13,248,153,153,52,4,255],["/ylorbr6/1",42,42,255,255,255,212,255],["/ylorbr6/2",31,109,254,254,227,145,255],["/ylorbr6/3",28,175,254,254,196,79,255],["/ylorbr6/4",22,213,254,254,153,41,255],["/ylorbr6/5",16,238,217,217,95,14,255],["/ylorbr6/6",13,248,153,153,52,4,255],["/ylorbr7/1",42,42,255,255,255,212,255],["/ylorbr7/2",31,109,254,254,227,145,255],["/ylorbr7/3",28,175,254,254,196,79,255],["/ylorbr7/4",22,213,254,254,153,41,255],["/ylorbr7/5",18,233,236,236,112,20,255],["/ylorbr7/6",15,252,204,204,76,2,255],["/ylorbr7/7",12,247,140,140,45,4,255],["/ylorbr8/1",42,25,255,255,255,229,255],["/ylorbr8/2",37,66,255,255,247,188,255],["/ylorbr8/3",31,109,254,254,227,145,255],["/ylorbr8/4",28,175,254,254,196,79,255],["/ylorbr8/5",22,213,254,254,153,41,255],["/ylorbr8/6",18,233,236,236,112,20,255],["/ylorbr8/7",15,252,204,204,76,2,255],["/ylorbr8/8",12,247,140,140,45,4,255],["/ylorbr9/1",42,25,255,255,255,229,255],["/ylorbr9/2",37,66,255,255,247,188,255],["/ylorbr9/3",31,109,254,254,227,145,255],["/ylorbr9/4",28,175,254,254,196,79,255],["/ylorbr9/5",22,213,254,254,153,41,255],["/ylorbr9/6",18,233,236,236,112,20,255],["/ylorbr9/7",15,252,204,204,76,2,255],["/ylorbr9/8",13,248,153,153,52,4,255],["/ylorbr9/9",13,240,102,102,37,6,255],["/ylorrd3/1",34,95,255,255,237,160,255],["/ylorrd3/2",24,178,254,254,178,76,255],["/ylorrd3/3",5,221,240,240,59,32,255],["/ylorrd4/1",42,77,255,255,255,178,255],["/ylorrd4/2",29,162,254,254,204,92,255],["/ylorrd4/3",17,194,253,253,141,60,255],["/ylorrd4/4",254,225,227,227,26,28,255],["/ylorrd5/1",42,77,255,255,255,178,255],["/ylorrd5/2",29,162,254,254,204,92,255],["/ylorrd5/3",17,194,253,253,141,60,255],["/ylorrd5/4",5,221,240,240,59,32,255],["/ylorrd5/5",246,255,189,189,0,38,255],["/ylorrd6/1",42,77,255,255,255,178,255],["/ylorrd6/2",30,136,254,254,217,118,255],["/ylorrd6/3",24,178,254,254,178,76,255],["/ylorrd6/4",17,194,253,253,141,60,255],["/ylorrd6/5",5,221,240,240,59,32,255],["/ylorrd6/6",246,255,189,189,0,38,255],["/ylorrd7/1",42,77,255,255,255,178,255],["/ylorrd7/2",30,136,254,254,217,118,255],["/ylorrd7/3",24,178,254,254,178,76,255],["/ylorrd7/4",17,194,253,253,141,60,255],["/ylorrd7/5",7,212,252,252,78,42,255],["/ylorrd7/6",254,225,227,227,26,28,255],["/ylorrd7/7",245,255,177,177,0,38,255],["/ylorrd8/1",42,50,255,255,255,204,255],["/ylorrd8/2",34,95,255,255,237,160,255],["/ylorrd8/3",30,136,254,254,217,118,255],["/ylorrd8/4",24,178,254,254,178,76,255],["/ylorrd8/5",17,194,253,253,141,60,255],["/ylorrd8/6",7,212,252,252,78,42,255],["/ylorrd8/7",254,225,227,227,26,28,255],["/ylorrd8/8",245,255,177,177,0,38,255],["/ylorrd9/1",42,50,255,255,255,204,255],["/ylorrd9/2",34,95,255,255,237,160,255],["/ylorrd9/3",30,136,254,254,217,118,255],["/ylorrd9/4",24,178,254,254,178,76,255],["/ylorrd9/5",17,194,253,253,141,60,255],["/ylorrd9/6",7,212,252,252,78,42,255],["/ylorrd9/7",254,225,227,227,26,28,255],["/ylorrd9/8",246,255,189,189,0,38,255],["/ylorrd9/9",242,255,128,128,0,38,255],["aliceblue",147,15,255,240,248,255,255],["antiquewhite",24,35,250,250,235,215,255],["antiquewhite1",23,36,255,255,239,219,255],["antiquewhite2",23,36,238,238,223,204,255],["antiquewhite3",23,36,205,205,192,176,255],["antiquewhite4",24,34,139,139,131,120,255],["aqua",127,255,255,0,255,255,255],["aquamarine",113,128,255,127,255,212,255],["aquamarine1",113,128,255,127,255,212,255],["aquamarine2",113,128,238,118,238,198,255],["aquamarine3",113,128,205,102,205,170,255],["aquamarine4",113,128,139,69,139,116,255],["azure",127,15,255,240,255,255,255],["azure1",127,15,255,240,255,255,255],["azure2",127,15,238,224,238,238,255],["azure3",127,14,205,193,205,205,255],["azure4",127,14,139,131,139,139,255],["beige",42,26,245,245,245,220,255],["bisque",23,58,255,255,228,196,255],["bisque1",23,58,255,255,228,196,255],["bisque2",23,58,238,238,213,183,255],["bisque3",22,58,205,205,183,158,255],["bisque4",23,58,139,139,125,107,255],["black",0,0,0,0,0,0,255],["blanchedalmond",25,49,255,255,235,205,255],["blue",170,255,255,0,0,255,255],["blue1",170,255,255,0,0,255,255],["blue2",170,255,238,0,0,238,255],["blue3",170,255,205,0,0,205,255],["blue4",170,255,139,0,0,139,255],["blueviolet",192,206,226,138,43,226,255],["brown",0,190,165,165,42,42,255],["brown1",0,191,255,255,64,64,255],["brown2",0,191,238,238,59,59,255],["brown3",0,191,205,205,51,51,255],["brown4",0,190,139,139,35,35,255],["burlywood",23,99,222,222,184,135,255],["burlywood1",23,100,255,255,211,155,255],["burlywood2",23,99,238,238,197,145,255],["burlywood3",23,99,205,205,170,125,255],["burlywood4",23,99,139,139,115,85,255],["cadetblue",128,103,160,95,158,160,255],["cadetblue1",131,103,255,152,245,255,255],["cadetblue2",131,102,238,142,229,238,255],["cadetblue3",131,103,205,122,197,205,255],["cadetblue4",131,102,139,83,134,139,255],["chartreuse",63,255,255,127,255,0,255],["chartreuse1",63,255,255,127,255,0,255],["chartreuse2",63,255,238,118,238,0,255],["chartreuse3",63,255,205,102,205,0,255],["chartreuse4",63,255,139,69,139,0,255],["chocolate",17,218,210,210,105,30,255],["chocolate1",17,219,255,255,127,36,255],["chocolate2",17,219,238,238,118,33,255],["chocolate3",17,218,205,205,102,29,255],["chocolate4",17,220,139,139,69,19,255],["coral",11,175,255,255,127,80,255],["coral1",7,169,255,255,114,86,255],["coral2",6,169,238,238,106,80,255],["coral3",6,169,205,205,91,69,255],["coral4",6,168,139,139,62,47,255],["cornflowerblue",154,147,237,100,149,237,255],["cornsilk",33,34,255,255,248,220,255],["cornsilk1",33,34,255,255,248,220,255],["cornsilk2",34,35,238,238,232,205,255],["cornsilk3",34,34,205,205,200,177,255],["cornsilk4",35,34,139,139,136,120,255],["crimson",246,231,220,220,20,60,255],["cyan",127,255,255,0,255,255,255],["cyan1",127,255,255,0,255,255,255],["cyan2",127,255,238,0,238,238,255],["cyan3",127,255,205,0,205,205,255],["cyan4",127,255,139,0,139,139,255],["darkblue",170,255,139,0,0,139,255],["darkcyan",127,255,139,0,139,139,255],["darkgoldenrod",30,239,184,184,134,11,255],["darkgoldenrod1",30,240,255,255,185,15,255],["darkgoldenrod2",30,240,238,238,173,14,255],["darkgoldenrod3",30,240,205,205,149,12,255],["darkgoldenrod4",30,240,139,139,101,8,255],["darkgray",0,0,169,169,169,169,255],["darkgreen",85,255,100,0,100,0,255],["darkgrey",0,0,169,169,169,169,255],["darkkhaki",39,110,189,189,183,107,255],["darkmagenta",212,255,139,139,0,139,255],["darkolivegreen",58,142,107,85,107,47,255],["darkolivegreen1",58,143,255,202,255,112,255],["darkolivegreen2",58,143,238,188,238,104,255],["darkolivegreen3",58,143,205,162,205,90,255],["darkolivegreen4",58,143,139,110,139,61,255],["darkorange",23,255,255,255,140,0,255],["darkorange1",21,255,255,255,127,0,255],["darkorange2",21,255,238,238,118,0,255],["darkorange3",21,255,205,205,102,0,255],["darkorange4",21,255,139,139,69,0,255],["darkorchid",198,192,204,153,50,204,255],["darkorchid1",198,193,255,191,62,255,255],["darkorchid2",198,192,238,178,58,238,255],["darkorchid3",198,192,205,154,50,205,255],["darkorchid4",198,192,139,104,34,139,255],["darkred",0,255,139,139,0,0,255],["darksalmon",10,121,233,233,150,122,255],["darkseagreen",85,61,188,143,188,143,255],["darkseagreen1",85,62,255,193,255,193,255],["darkseagreen2",85,62,238,180,238,180,255],["darkseagreen3",85,62,205,155,205,155,255],["darkseagreen4",85,62,139,105,139,105,255],["darkslateblue",175,143,139,72,61,139,255],["darkslategray",127,103,79,47,79,79,255],["darkslategray1",127,104,255,151,255,255,255],["darkslategray2",127,103,238,141,238,238,255],["darkslategray3",127,104,205,121,205,205,255],["darkslategray4",127,104,139,82,139,139,255],["darkslategrey",127,103,79,47,79,79,255],["darkturquoise",128,255,209,0,206,209,255],["darkviolet",199,255,211,148,0,211,255],["deeppink",232,235,255,255,20,147,255],["deeppink1",232,235,255,255,20,147,255],["deeppink2",232,235,238,238,18,137,255],["deeppink3",232,235,205,205,16,118,255],["deeppink4",231,236,139,139,10,80,255],["deepskyblue",138,255,255,0,191,255,255],["deepskyblue1",138,255,255,0,191,255,255],["deepskyblue2",138,255,238,0,178,238,255],["deepskyblue3",138,255,205,0,154,205,255],["deepskyblue4",138,255,139,0,104,139,255],["dimgray",0,0,105,105,105,105,255],["dimgrey",0,0,105,105,105,105,255],["dodgerblue",148,225,255,30,144,255,255],["dodgerblue1",148,225,255,30,144,255,255],["dodgerblue2",148,225,238,28,134,238,255],["dodgerblue3",148,225,205,24,116,205,255],["dodgerblue4",148,225,139,16,78,139,255],["firebrick",0,206,178,178,34,34,255],["firebrick1",0,207,255,255,48,48,255],["firebrick2",0,207,238,238,44,44,255],["firebrick3",0,207,205,205,38,38,255],["firebrick4",0,207,139,139,26,26,255],["floralwhite",28,15,255,255,250,240,255],["forestgreen",85,192,139,34,139,34,255],["fuchsia",212,255,255,255,0,255,255],["gainsboro",0,0,220,220,220,220,255],["ghostwhite",170,7,255,248,248,255,255],["gold",35,255,255,255,215,0,255],["gold1",35,255,255,255,215,0,255],["gold2",35,255,238,238,201,0,255],["gold3",35,255,205,205,173,0,255],["gold4",35,255,139,139,117,0,255],["goldenrod",30,217,218,218,165,32,255],["goldenrod1",30,218,255,255,193,37,255],["goldenrod2",30,218,238,238,180,34,255],["goldenrod3",30,218,205,205,155,29,255],["goldenrod4",30,218,139,139,105,20,255],["gray",0,0,192,192,192,192,255],["gray0",0,0,0,0,0,0,255],["gray1",0,0,3,3,3,3,255],["gray10",0,0,26,26,26,26,255],["gray100",0,0,255,255,255,255,255],["gray11",0,0,28,28,28,28,255],["gray12",0,0,31,31,31,31,255],["gray13",0,0,33,33,33,33,255],["gray14",0,0,36,36,36,36,255],["gray15",0,0,38,38,38,38,255],["gray16",0,0,41,41,41,41,255],["gray17",0,0,43,43,43,43,255],["gray18",0,0,46,46,46,46,255],["gray19",0,0,48,48,48,48,255],["gray2",0,0,5,5,5,5,255],["gray20",0,0,51,51,51,51,255],["gray21",0,0,54,54,54,54,255],["gray22",0,0,56,56,56,56,255],["gray23",0,0,59,59,59,59,255],["gray24",0,0,61,61,61,61,255],["gray25",0,0,64,64,64,64,255],["gray26",0,0,66,66,66,66,255],["gray27",0,0,69,69,69,69,255],["gray28",0,0,71,71,71,71,255],["gray29",0,0,74,74,74,74,255],["gray3",0,0,8,8,8,8,255],["gray30",0,0,77,77,77,77,255],["gray31",0,0,79,79,79,79,255],["gray32",0,0,82,82,82,82,255],["gray33",0,0,84,84,84,84,255],["gray34",0,0,87,87,87,87,255],["gray35",0,0,89,89,89,89,255],["gray36",0,0,92,92,92,92,255],["gray37",0,0,94,94,94,94,255],["gray38",0,0,97,97,97,97,255],["gray39",0,0,99,99,99,99,255],["gray4",0,0,10,10,10,10,255],["gray40",0,0,102,102,102,102,255],["gray41",0,0,105,105,105,105,255],["gray42",0,0,107,107,107,107,255],["gray43",0,0,110,110,110,110,255],["gray44",0,0,112,112,112,112,255],["gray45",0,0,115,115,115,115,255],["gray46",0,0,117,117,117,117,255],["gray47",0,0,120,120,120,120,255],["gray48",0,0,122,122,122,122,255],["gray49",0,0,125,125,125,125,255],["gray5",0,0,13,13,13,13,255],["gray50",0,0,127,127,127,127,255],["gray51",0,0,130,130,130,130,255],["gray52",0,0,133,133,133,133,255],["gray53",0,0,135,135,135,135,255],["gray54",0,0,138,138,138,138,255],["gray55",0,0,140,140,140,140,255],["gray56",0,0,143,143,143,143,255],["gray57",0,0,145,145,145,145,255],["gray58",0,0,148,148,148,148,255],["gray59",0,0,150,150,150,150,255],["gray6",0,0,15,15,15,15,255],["gray60",0,0,153,153,153,153,255],["gray61",0,0,156,156,156,156,255],["gray62",0,0,158,158,158,158,255],["gray63",0,0,161,161,161,161,255],["gray64",0,0,163,163,163,163,255],["gray65",0,0,166,166,166,166,255],["gray66",0,0,168,168,168,168,255],["gray67",0,0,171,171,171,171,255],["gray68",0,0,173,173,173,173,255],["gray69",0,0,176,176,176,176,255],["gray7",0,0,18,18,18,18,255],["gray70",0,0,179,179,179,179,255],["gray71",0,0,181,181,181,181,255],["gray72",0,0,184,184,184,184,255],["gray73",0,0,186,186,186,186,255],["gray74",0,0,189,189,189,189,255],["gray75",0,0,191,191,191,191,255],["gray76",0,0,194,194,194,194,255],["gray77",0,0,196,196,196,196,255],["gray78",0,0,199,199,199,199,255],["gray79",0,0,201,201,201,201,255],["gray8",0,0,20,20,20,20,255],["gray80",0,0,204,204,204,204,255],["gray81",0,0,207,207,207,207,255],["gray82",0,0,209,209,209,209,255],["gray83",0,0,212,212,212,212,255],["gray84",0,0,214,214,214,214,255],["gray85",0,0,217,217,217,217,255],["gray86",0,0,219,219,219,219,255],["gray87",0,0,222,222,222,222,255],["gray88",0,0,224,224,224,224,255],["gray89",0,0,227,227,227,227,255],["gray9",0,0,23,23,23,23,255],["gray90",0,0,229,229,229,229,255],["gray91",0,0,232,232,232,232,255],["gray92",0,0,235,235,235,235,255],["gray93",0,0,237,237,237,237,255],["gray94",0,0,240,240,240,240,255],["gray95",0,0,242,242,242,242,255],["gray96",0,0,245,245,245,245,255],["gray97",0,0,247,247,247,247,255],["gray98",0,0,250,250,250,250,255],["gray99",0,0,252,252,252,252,255],["green",85,255,255,0,255,0,255],["green1",85,255,255,0,255,0,255],["green2",85,255,238,0,238,0,255],["green3",85,255,205,0,205,0,255],["green4",85,255,139,0,139,0,255],["greenyellow",59,208,255,173,255,47,255],["grey",0,0,192,192,192,192,255],["grey0",0,0,0,0,0,0,255],["grey1",0,0,3,3,3,3,255],["grey10",0,0,26,26,26,26,255],["grey100",0,0,255,255,255,255,255],["grey11",0,0,28,28,28,28,255],["grey12",0,0,31,31,31,31,255],["grey13",0,0,33,33,33,33,255],["grey14",0,0,36,36,36,36,255],["grey15",0,0,38,38,38,38,255],["grey16",0,0,41,41,41,41,255],["grey17",0,0,43,43,43,43,255],["grey18",0,0,46,46,46,46,255],["grey19",0,0,48,48,48,48,255],["grey2",0,0,5,5,5,5,255],["grey20",0,0,51,51,51,51,255],["grey21",0,0,54,54,54,54,255],["grey22",0,0,56,56,56,56,255],["grey23",0,0,59,59,59,59,255],["grey24",0,0,61,61,61,61,255],["grey25",0,0,64,64,64,64,255],["grey26",0,0,66,66,66,66,255],["grey27",0,0,69,69,69,69,255],["grey28",0,0,71,71,71,71,255],["grey29",0,0,74,74,74,74,255],["grey3",0,0,8,8,8,8,255],["grey30",0,0,77,77,77,77,255],["grey31",0,0,79,79,79,79,255],["grey32",0,0,82,82,82,82,255],["grey33",0,0,84,84,84,84,255],["grey34",0,0,87,87,87,87,255],["grey35",0,0,89,89,89,89,255],["grey36",0,0,92,92,92,92,255],["grey37",0,0,94,94,94,94,255],["grey38",0,0,97,97,97,97,255],["grey39",0,0,99,99,99,99,255],["grey4",0,0,10,10,10,10,255],["grey40",0,0,102,102,102,102,255],["grey41",0,0,105,105,105,105,255],["grey42",0,0,107,107,107,107,255],["grey43",0,0,110,110,110,110,255],["grey44",0,0,112,112,112,112,255],["grey45",0,0,115,115,115,115,255],["grey46",0,0,117,117,117,117,255],["grey47",0,0,120,120,120,120,255],["grey48",0,0,122,122,122,122,255],["grey49",0,0,125,125,125,125,255],["grey5",0,0,13,13,13,13,255],["grey50",0,0,127,127,127,127,255],["grey51",0,0,130,130,130,130,255],["grey52",0,0,133,133,133,133,255],["grey53",0,0,135,135,135,135,255],["grey54",0,0,138,138,138,138,255],["grey55",0,0,140,140,140,140,255],["grey56",0,0,143,143,143,143,255],["grey57",0,0,145,145,145,145,255],["grey58",0,0,148,148,148,148,255],["grey59",0,0,150,150,150,150,255],["grey6",0,0,15,15,15,15,255],["grey60",0,0,153,153,153,153,255],["grey61",0,0,156,156,156,156,255],["grey62",0,0,158,158,158,158,255],["grey63",0,0,161,161,161,161,255],["grey64",0,0,163,163,163,163,255],["grey65",0,0,166,166,166,166,255],["grey66",0,0,168,168,168,168,255],["grey67",0,0,171,171,171,171,255],["grey68",0,0,173,173,173,173,255],["grey69",0,0,176,176,176,176,255],["grey7",0,0,18,18,18,18,255],["grey70",0,0,179,179,179,179,255],["grey71",0,0,181,181,181,181,255],["grey72",0,0,184,184,184,184,255],["grey73",0,0,186,186,186,186,255],["grey74",0,0,189,189,189,189,255],["grey75",0,0,191,191,191,191,255],["grey76",0,0,194,194,194,194,255],["grey77",0,0,196,196,196,196,255],["grey78",0,0,199,199,199,199,255],["grey79",0,0,201,201,201,201,255],["grey8",0,0,20,20,20,20,255],["grey80",0,0,204,204,204,204,255],["grey81",0,0,207,207,207,207,255],["grey82",0,0,209,209,209,209,255],["grey83",0,0,212,212,212,212,255],["grey84",0,0,214,214,214,214,255],["grey85",0,0,217,217,217,217,255],["grey86",0,0,219,219,219,219,255],["grey87",0,0,222,222,222,222,255],["grey88",0,0,224,224,224,224,255],["grey89",0,0,227,227,227,227,255],["grey9",0,0,23,23,23,23,255],["grey90",0,0,229,229,229,229,255],["grey91",0,0,232,232,232,232,255],["grey92",0,0,235,235,235,235,255],["grey93",0,0,237,237,237,237,255],["grey94",0,0,240,240,240,240,255],["grey95",0,0,242,242,242,242,255],["grey96",0,0,245,245,245,245,255],["grey97",0,0,247,247,247,247,255],["grey98",0,0,250,250,250,250,255],["grey99",0,0,252,252,252,252,255],["honeydew",85,15,255,240,255,240,255],["honeydew1",85,15,255,240,255,240,255],["honeydew2",85,15,238,224,238,224,255],["honeydew3",85,14,205,193,205,193,255],["honeydew4",85,14,139,131,139,131,255],["hotpink",233,150,255,255,105,180,255],["hotpink1",234,145,255,255,110,180,255],["hotpink2",235,141,238,238,106,167,255],["hotpink3",236,135,205,205,96,144,255],["hotpink4",234,148,139,139,58,98,255],["indianred",0,140,205,205,92,92,255],["indianred1",0,148,255,255,106,106,255],["indianred2",0,148,238,238,99,99,255],["indianred3",0,149,205,205,85,85,255],["indianred4",0,148,139,139,58,58,255],["indigo",194,255,130,75,0,130,255],["invis",42,0,255,255,255,254,0],["ivory",42,15,255,255,255,240,255],["ivory1",42,15,255,255,255,240,255],["ivory2",42,15,238,238,238,224,255],["ivory3",42,14,205,205,205,193,255],["ivory4",42,14,139,139,139,131,255],["khaki",38,106,240,240,230,140,255],["khaki1",39,112,255,255,246,143,255],["khaki2",39,112,238,238,230,133,255],["khaki3",39,111,205,205,198,115,255],["khaki4",39,111,139,139,134,78,255],["lavender",170,20,250,230,230,250,255],["lavenderblush",240,15,255,255,240,245,255],["lavenderblush1",240,15,255,255,240,245,255],["lavenderblush2",239,15,238,238,224,229,255],["lavenderblush3",240,14,205,205,193,197,255],["lavenderblush4",239,14,139,139,131,134,255],["lawngreen",64,255,252,124,252,0,255],["lemonchiffon",38,49,255,255,250,205,255],["lemonchiffon1",38,49,255,255,250,205,255],["lemonchiffon2",37,50,238,238,233,191,255],["lemonchiffon3",38,49,205,205,201,165,255],["lemonchiffon4",39,49,139,139,137,112,255],["lightblue",137,63,230,173,216,230,255],["lightblue1",138,64,255,191,239,255,255],["lightblue2",138,64,238,178,223,238,255],["lightblue3",138,63,205,154,192,205,255],["lightblue4",137,64,139,104,131,139,255],["lightcoral",0,119,240,240,128,128,255],["lightcyan",127,31,255,224,255,255,255],["lightcyan1",127,31,255,224,255,255,255],["lightcyan2",127,31,238,209,238,238,255],["lightcyan3",127,31,205,180,205,205,255],["lightcyan4",127,31,139,122,139,139,255],["lightgoldenrod",35,115,238,238,221,130,255],["lightgoldenrod1",35,116,255,255,236,139,255],["lightgoldenrod2",35,115,238,238,220,130,255],["lightgoldenrod3",35,115,205,205,190,112,255],["lightgoldenrod4",35,115,139,139,129,76,255],["lightgoldenrodyellow",42,40,250,250,250,210,255],["lightgray",0,0,211,211,211,211,255],["lightgreen",85,100,238,144,238,144,255],["lightgrey",0,0,211,211,211,211,255],["lightpink",248,73,255,255,182,193,255],["lightpink1",249,81,255,255,174,185,255],["lightpink2",248,81,238,238,162,173,255],["lightpink3",249,80,205,205,140,149,255],["lightpink4",249,80,139,139,95,101,255],["lightsalmon",12,132,255,255,160,122,255],["lightsalmon1",12,132,255,255,160,122,255],["lightsalmon2",11,132,238,238,149,114,255],["lightsalmon3",12,133,205,205,129,98,255],["lightsalmon4",12,133,139,139,87,66,255],["lightseagreen",125,209,178,32,178,170,255],["lightskyblue",143,117,250,135,206,250,255],["lightskyblue1",143,79,255,176,226,255,255],["lightskyblue2",143,79,238,164,211,238,255],["lightskyblue3",142,79,205,141,182,205,255],["lightskyblue4",143,78,139,96,123,139,255],["lightslateblue",175,143,255,132,112,255,255],["lightslategray",148,56,153,119,136,153,255],["lightslategrey",148,56,153,119,136,153,255],["lightsteelblue",151,52,222,176,196,222,255],["lightsteelblue1",151,53,255,202,225,255,255],["lightsteelblue2",151,53,238,188,210,238,255],["lightsteelblue3",151,53,205,162,181,205,255],["lightsteelblue4",150,53,139,110,123,139,255],["lightyellow",42,31,255,255,255,224,255],["lightyellow1",42,31,255,255,255,224,255],["lightyellow2",42,31,238,238,238,209,255],["lightyellow3",42,31,205,205,205,180,255],["lightyellow4",42,31,139,139,139,122,255],["lime",85,255,255,0,255,0,255],["limegreen",85,192,205,50,205,50,255],["linen",21,20,250,250,240,230,255],["magenta",212,255,255,255,0,255,255],["magenta1",212,255,255,255,0,255,255],["magenta2",212,255,238,238,0,238,255],["magenta3",212,255,205,205,0,205,255],["magenta4",212,255,139,139,0,139,255],["maroon",239,185,176,176,48,96,255],["maroon1",228,203,255,255,52,179,255],["maroon2",228,203,238,238,48,167,255],["maroon3",228,204,205,205,41,144,255],["maroon4",228,203,139,139,28,98,255],["mediumaquamarine",113,128,205,102,205,170,255],["mediumblue",170,255,205,0,0,205,255],["mediumorchid",204,152,211,186,85,211,255],["mediumorchid1",203,153,255,224,102,255,255],["mediumorchid2",203,153,238,209,95,238,255],["mediumorchid3",203,153,205,180,82,205,255],["mediumorchid4",203,154,139,122,55,139,255],["mediumpurple",183,124,219,147,112,219,255],["mediumpurple1",183,125,255,171,130,255,255],["mediumpurple2",183,125,238,159,121,238,255],["mediumpurple3",183,125,205,137,104,205,255],["mediumpurple4",183,124,139,93,71,139,255],["mediumseagreen",103,169,179,60,179,113,255],["mediumslateblue",176,143,238,123,104,238,255],["mediumspringgreen",111,255,250,0,250,154,255],["mediumturquoise",125,167,209,72,209,204,255],["mediumvioletred",228,228,199,199,21,133,255],["midnightblue",170,198,112,25,25,112,255],["mintcream",106,9,255,245,255,250,255],["mistyrose",4,30,255,255,228,225,255],["mistyrose1",4,30,255,255,228,225,255],["mistyrose2",4,30,238,238,213,210,255],["mistyrose3",3,29,205,205,183,181,255],["mistyrose4",5,29,139,139,125,123,255],["moccasin",26,73,255,255,228,181,255],["navajowhite",25,81,255,255,222,173,255],["navajowhite1",25,81,255,255,222,173,255],["navajowhite2",25,82,238,238,207,161,255],["navajowhite3",25,82,205,205,179,139,255],["navajowhite4",25,82,139,139,121,94,255],["navy",170,255,128,0,0,128,255],["navyblue",170,255,128,0,0,128,255],["none",42,0,255,255,255,254,0],["oldlace",27,23,253,253,245,230,255],["olive",42,255,128,128,128,0,255],["olivedrab",56,192,142,107,142,35,255],["olivedrab1",56,193,255,192,255,62,255],["olivedrab2",56,192,238,179,238,58,255],["olivedrab3",56,192,205,154,205,50,255],["olivedrab4",56,192,139,105,139,34,255],["orange",27,255,255,255,165,0,255],["orange1",27,255,255,255,165,0,255],["orange2",27,255,238,238,154,0,255],["orange3",27,255,205,205,133,0,255],["orange4",27,255,139,139,90,0,255],["orangered",11,255,255,255,69,0,255],["orangered1",11,255,255,255,69,0,255],["orangered2",11,255,238,238,64,0,255],["orangered3",11,255,205,205,55,0,255],["orangered4",11,255,139,139,37,0,255],["orchid",214,123,218,218,112,214,255],["orchid1",214,124,255,255,131,250,255],["orchid2",214,124,238,238,122,233,255],["orchid3",214,124,205,205,105,201,255],["orchid4",213,124,139,139,71,137,255],["palegoldenrod",38,72,238,238,232,170,255],["palegreen",85,100,251,152,251,152,255],["palegreen1",85,101,255,154,255,154,255],["palegreen2",85,100,238,144,238,144,255],["palegreen3",85,100,205,124,205,124,255],["palegreen4",85,100,139,84,139,84,255],["paleturquoise",127,67,238,175,238,238,255],["paleturquoise1",127,68,255,187,255,255,255],["paleturquoise2",127,68,238,174,238,238,255],["paleturquoise3",127,68,205,150,205,205,255],["paleturquoise4",127,67,139,102,139,139,255],["palevioletred",241,124,219,219,112,147,255],["palevioletred1",241,125,255,255,130,171,255],["palevioletred2",241,125,238,238,121,159,255],["palevioletred3",241,125,205,205,104,137,255],["palevioletred4",241,124,139,139,71,93,255],["papayawhip",26,41,255,255,239,213,255],["peachpuff",20,70,255,255,218,185,255],["peachpuff1",20,70,255,255,218,185,255],["peachpuff2",19,69,238,238,203,173,255],["peachpuff3",19,69,205,205,175,149,255],["peachpuff4",20,69,139,139,119,101,255],["peru",20,176,205,205,133,63,255],["pink",247,63,255,255,192,203,255],["pink1",245,73,255,255,181,197,255],["pink2",245,73,238,238,169,184,255],["pink3",245,74,205,205,145,158,255],["pink4",245,73,139,139,99,108,255],["plum",212,70,221,221,160,221,255],["plum1",212,68,255,255,187,255,255],["plum2",212,68,238,238,174,238,255],["plum3",212,68,205,205,150,205,255],["plum4",212,67,139,139,102,139,255],["powderblue",132,59,230,176,224,230,255],["purple",196,221,240,160,32,240,255],["purple1",191,207,255,155,48,255,255],["purple2",192,207,238,145,44,238,255],["purple3",192,207,205,125,38,205,255],["purple4",192,207,139,85,26,139,255],["rebeccapurple",191,170,153,102,51,153,255],["red",0,255,255,255,0,0,255],["red1",0,255,255,255,0,0,255],["red2",0,255,238,238,0,0,255],["red3",0,255,205,205,0,0,255],["red4",0,255,139,139,0,0,255],["rosybrown",0,61,188,188,143,143,255],["rosybrown1",0,62,255,255,193,193,255],["rosybrown2",0,62,238,238,180,180,255],["rosybrown3",0,62,205,205,155,155,255],["rosybrown4",0,62,139,139,105,105,255],["royalblue",159,181,225,65,105,225,255],["royalblue1",159,183,255,72,118,255,255],["royalblue2",159,183,238,67,110,238,255],["royalblue3",159,182,205,58,95,205,255],["royalblue4",159,183,139,39,64,139,255],["saddlebrown",17,220,139,139,69,19,255],["salmon",4,138,250,250,128,114,255],["salmon1",9,150,255,255,140,105,255],["salmon2",9,150,238,238,130,98,255],["salmon3",9,150,205,205,112,84,255],["salmon4",9,150,139,139,76,57,255],["sandybrown",19,154,244,244,164,96,255],["seagreen",103,170,139,46,139,87,255],["seagreen1",103,171,255,84,255,159,255],["seagreen2",103,171,238,78,238,148,255],["seagreen3",103,171,205,67,205,128,255],["seagreen4",103,170,139,46,139,87,255],["seashell",17,16,255,255,245,238,255],["seashell1",17,16,255,255,245,238,255],["seashell2",18,17,238,238,229,222,255],["seashell3",18,17,205,205,197,191,255],["seashell4",18,16,139,139,134,130,255],["sienna",13,183,160,160,82,45,255],["sienna1",13,184,255,255,130,71,255],["sienna2",13,184,238,238,121,66,255],["sienna3",13,184,205,205,104,57,255],["sienna4",13,185,139,139,71,38,255],["silver",0,0,192,192,192,192,255],["skyblue",139,108,235,135,206,235,255],["skyblue1",144,120,255,135,206,255,255],["skyblue2",144,120,238,126,192,238,255],["skyblue3",144,120,205,108,166,205,255],["skyblue4",145,119,139,74,112,139,255],["slateblue",175,143,205,106,90,205,255],["slateblue1",175,144,255,131,111,255,255],["slateblue2",175,144,238,122,103,238,255],["slateblue3",175,144,205,105,89,205,255],["slateblue4",175,144,139,71,60,139,255],["slategray",148,56,144,112,128,144,255],["slategray1",149,56,255,198,226,255,255],["slategray2",149,56,238,185,211,238,255],["slategray3",148,57,205,159,182,205,255],["slategray4",149,56,139,108,123,139,255],["slategrey",148,56,144,112,128,144,255],["snow",0,5,255,255,250,250,255],["snow1",0,5,255,255,250,250,255],["snow2",0,5,238,238,233,233,255],["snow3",0,4,205,205,201,201,255],["snow4",0,3,139,139,137,137,255],["springgreen",106,255,255,0,255,127,255],["springgreen1",106,255,255,0,255,127,255],["springgreen2",106,255,238,0,238,118,255],["springgreen3",106,255,205,0,205,102,255],["springgreen4",106,255,139,0,139,69,255],["steelblue",146,155,180,70,130,180,255],["steelblue1",146,156,255,99,184,255,255],["steelblue2",146,156,238,92,172,238,255],["steelblue3",146,156,205,79,148,205,255],["steelblue4",147,155,139,54,100,139,255],["tan",24,84,210,210,180,140,255],["tan1",20,176,255,255,165,79,255],["tan2",20,176,238,238,154,73,255],["tan3",20,176,205,205,133,63,255],["tan4",20,176,139,139,90,43,255],["teal",127,255,128,0,128,128,255],["thistle",212,29,216,216,191,216,255],["thistle1",212,30,255,255,225,255,255],["thistle2",212,30,238,238,210,238,255],["thistle3",212,29,205,205,181,205,255],["thistle4",212,29,139,139,123,139,255],["tomato",6,184,255,255,99,71,255],["tomato1",6,184,255,255,99,71,255],["tomato2",6,184,238,238,92,66,255],["tomato3",6,184,205,205,79,57,255],["tomato4",6,185,139,139,54,38,255],["transparent",42,0,255,255,255,254,0],["turquoise",123,182,224,64,224,208,255],["turquoise1",129,255,255,0,245,255,255],["turquoise2",129,255,238,0,229,238,255],["turquoise3",129,255,205,0,197,205,255],["turquoise4",129,255,139,0,134,139,255],["violet",212,115,238,238,130,238,255],["violetred",227,215,208,208,32,144,255],["violetred1",235,193,255,255,62,150,255],["violetred2",235,192,238,238,58,140,255],["violetred3",235,192,205,205,50,120,255],["violetred4",235,192,139,139,34,82,255],["webgray",0,0,128,128,128,128,255],["webgreen",85,255,128,0,128,0,255],["webgrey",0,0,128,128,128,128,255],["webmaroon",0,255,128,128,0,0,255],["webpurple",212,255,128,128,0,128,255],["wheat",27,68,245,245,222,179,255],["wheat1",27,69,255,255,231,186,255],["wheat2",27,68,238,238,216,174,255],["wheat3",27,68,205,205,186,150,255],["wheat4",27,67,139,139,126,102,255],["white",0,0,255,255,255,255,255],["whitesmoke",0,0,245,245,245,245,255],["x11gray",0,0,190,190,190,190,255],["x11green",85,255,255,0,255,0,255],["x11grey",0,0,190,190,190,190,255],["x11maroon",239,185,176,176,48,96,255],["x11purple",196,221,240,160,32,240,255],["yellow",42,255,255,255,255,0,255],["yellow1",42,255,255,255,255,0,255],["yellow2",42,255,238,238,238,0,255],["yellow3",42,255,205,205,205,0,255],["yellow4",42,255,139,139,139,0,255],["yellowgreen",56,192,205,154,205,50,255]];var bs="";function E0(e){bs=e}function s3(){return bs}function JA(e,n,t,o,r){switch(e){case 0:return{r:n,g:r,b:t};case 1:return{r:o,g:n,b:t};case 2:return{r:t,g:n,b:r};case 3:return{r:t,g:o,b:n};case 4:return{r,g:t,b:n};default:return{r:n,g:t,b:o}}}function KA(e,n,t){if(n<=0)return{r:t,g:t,b:t};e>=1&&(e=0),e=6*e;let o=Math.trunc(e),r=e-o,i=t*(1-n),s=t*(1-n*r),l=t*(1-n*(1-r));return JA(o,t,i,s,l)}function qA(e,n,t,o,r){let i=o-r,s=(o-e)/i,l=(o-n)/i,a=(o-t)/i;return P0(e,o)?a-l:P0(n,o)?2+s-a:4+l-s}function QA(e,n,t){let o=Math.min(e,Math.min(n,t)),r=Math.max(e,Math.max(n,t)),i=0,s=0;return r>0&&(i=(r-o)/r),i>0&&(s=qA(e,n,t,r,o)*60,s<0&&(s+=360)),{h:s/360,v:r,s:i}}function l3(e){return!e||e.length===0?!1:e.toLowerCase()!=="x11"}function ZA(e){let n=e.slice(1),t=n.indexOf("/");if(t<0)return n;if(n.startsWith("/")){let o=n.slice(1);return l3(bs)?`/${bs}/${o}`:o}return n.slice(0,4).toLowerCase()!=="x11/"?e:n.slice(t+1)}function eG(e){return e==="black"||e==="white"||e==="lightgrey"?e:e.startsWith("/")?ZA(e):l3(bs)?`/${bs}/${e}`:e}function nG(e){let n=e.toLowerCase(),t=0,o=Vr.length-1;for(;t<=o;){let r=t+o>>1,i=Vr[r][0].toLowerCase().localeCompare(n);if(i<0)t=r+1;else if(i>0)o=r-1;else return{r:Vr[r][4],g:Vr[r][5],b:Vr[r][6],a:Vr[r][7]}}return null}function a3(e,n,t,o,r){let i=e;i.type="rgba",i.r=n/255,i.g=t/255,i.b=o/255,i.a=r/255}function tG(e,n,t,o,r){let i=e,{h:s,s:l,v:a}=QA(n/255,t/255,o/255);i.type="hsva",i.h=s,i.s=l,i.v=a,i.a=r/255}function u3(e,n,t,o,r){let i=e;i.type="hsva",i.h=n,i.s=t,i.v=o,i.a=r}function oG(e,n,t,o,r){let i=e,s=KA(n,t,o);i.type="rgba",i.r=Kf(s.r),i.g=Kf(s.g),i.b=Kf(s.b),i.a=Kf(r)}function Kf(e){return Math.trunc(e*255)/255}function rG(e,n){n==="rgba"?a3(e,0,0,0,255):n==="hsva"&&u3(e,0,0,0,1)}function iG(e){if(e.charAt(0)!=="#")return null;let n=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e);if(n)return{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:parseInt(n[4],16)};let t=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e);if(t)return{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16),a:255};let o=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(e);if(!o)return null;let r=parseInt(o[1],16),i=parseInt(o[2],16),s=parseInt(o[3],16);return{r:r|r<<4,g:i|i<<4,b:s|s<<4,a:255}}function qf(e){return Math.max(0,Math.min(1,e))}function sG(e){let n=e.charAt(0);if(n!=="."&&!(n>="0"&&n<="9"))return null;let t=e.replace(/,/g," ").trim().split(/\s+/);if(t.length<3)return null;let o=parseFloat(t[0]),r=parseFloat(t[1]),i=parseFloat(t[2]);if(isNaN(o)||isNaN(r)||isNaN(i))return null;let s=t.length>=4?parseFloat(t[3]):1;return{H:qf(o),S:qf(r),V:qf(i),A:qf(isNaN(s)?1:s)}}function i3(e,n,t){n==="rgba"?a3(e,t.r,t.g,t.b,t.a):n==="hsva"&&tG(e,t.r,t.g,t.b,t.a)}function lG(e,n,t){n==="hsva"?u3(e,t.H,t.S,t.V,t.A):n==="rgba"&&oG(e,t.H,t.S,t.V,t.A)}function Qf(e,n,t){let o=e.replace(/^ +/,""),r=iG(o);if(r!==null)return i3(n,t,r),0;let i=sG(o);if(i!==null)return lG(n,t,i),0;let s=nG(eG(o));return s!==null?(i3(n,t,s),0):(rG(n,t),1)}var aG=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],uG=new Set(aG);function X(e){if(e===""||e==="none")return{type:"none"};if(uG.has(e.toLowerCase()))return{type:"string",s:e};let n={type:"rgba",r:0,g:0,b:0,a:0};return Qf(e,n,"rgba"),n}function Ur(e,n){let t=s3();E0(e??"");try{return n()}finally{E0(t)}}function f3(e,n,t){let o=Math.round(e*255).toString(16).padStart(2,"0"),r=Math.round(n*255).toString(16).padStart(2,"0"),i=Math.round(t*255).toString(16).padStart(2,"0");return"#"+o+r+i}function Ht(e){return e.type==="none"?"none":e.type==="string"?e.s==="transparent"?"none":e.s:e.type==="rgba"?e.a===0?"none":f3(e.r,e.g,e.b):"black"}function Vt(e){if(e.type!=="rgba")return null;let n=Math.round(e.a*255);return n<=0||n>=255?null:(n/255).toFixed(6)}function d3(e){if(e===null)return"";let n=X(e);if(n.type==="none")return"";if(n.type==="string")return n.s.toLowerCase()==="black"?"":' fill="'+n.s+'"';if(n.type!=="rgba")return"";let t=' fill="'+f3(n.r,n.g,n.b)+'"',o=Math.round(n.a*255);return o<255&&(t+=' fill-opacity="'+(o/255).toFixed(6)+'"'),t}var fG=12,c3=.5;function Zf(e,n,t){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function mn(e,n){return{x:e.x+n.x,y:e.y+n.y}}function xn(e,n){return{x:e.x-n.x,y:e.y-n.y}}function Nn(e){return(e[0].x+e[1].x)/2}function Ge(e){return(e[1].y+e[2].y)/2}function Ut(e){return[{x:e[1].x,y:Ge(e)},{x:e[0].x,y:e[2].y+(e[0].y-e[3].y)/2}]}function gs(e,n,t,o){return[{x:e,y:n},{x:e+t,y:n},{x:e+t,y:n+o},{x:e,y:n+o}]}function ho(e){return e[2].y+(e[0].y-e[3].y)/2}function p3(e,n,t){return n+1<t?e[n+1]:e[0]}function ed(e,n,t,o=!1){let r=fG;for(let s=0;s<n;s++){let l=e[s],a=p3(e,s,n);r=Math.min(r,Math.hypot(a.x-l.x,a.y-l.y)/3)}let i=[];for(let s=0;s<n;s++){let l=e[s],a=p3(e,s,n),u=r/Math.hypot(a.x-l.x,a.y-l.y);t===4||t===5?u/=3:t===1&&(u/=2),i.push(o?Zf(c3*u,l,a):l),i.push(Zf(u,l,a),Zf(1-u,l,a)),o&&i.push(Zf(1-c3*u,l,a))}return i.push(i[0],i[1],i[2]),i}function te(e,n,t,o){let r=e.map(i=>K({x:i.x+n.x,y:i.y+n.y},t.job));t.renderer.polygon(r,o,t.job)}function $(e,n,t){let o=e.map(r=>K({x:r.x+n.x,y:r.y+n.y},t.job));t.renderer.polyline(o,t.job)}function nd(e,n,t,o){let r=e.map(i=>K({x:i.x+n.x,y:i.y+n.y},t.job));t.renderer.bezier(r,o,t.job)}function m3(e,n,t,o,r){let i=n[3].y-n[4].y,s=[{x:n[1].x,y:n[1].y-i/2},{x:n[3].x,y:n[3].y-i/2},{x:e[2].x,y:e[2].y+i/2},{x:n[1].x,y:e[2].y+i/2},{x:e[0].x,y:e[0].y-(e[0].y-e[3].y)/2}];te(s,t,r,o)}function x3(e,n,t,o,r){let i=e.length,s=new Array(i+1);for(let f=1;f<i;f++)s[f]=e[f];s[0]=n[3*(i-1)+4],s[i]=n[3*(i-1)+2],te(s,t,r,o);let l=i-1,a=n[3*l+2],u=mn(n[3*l+4],xn(a,n[3*l+3]));$([n[3*l+4],u],t,r),$([a,u],t,r)}function h3(e,n,t,o,r){let i=e.length,s={x:(n[3].x-n[4].x)/3,y:(n[3].y-n[4].y)/3},l=[e[0],n[2],mn(n[2],s),mn(n[3],s)];for(let a=4;a<i+2;a++)l.push(e[a-2]);te(l,t,r,o),$([n[3],n[2]],t,r)}function b3(e,n,t,o,r){let i=e.length,s=e[0].x-n[1].x,l=(n[3].y-n[4].y)/3,a=[e[0],{x:e[0].x-s/4,y:e[0].y+l},{x:e[0].x-2*s,y:e[0].y+l},{x:e[0].x-2.25*s,y:n[3].y}];for(let u=4;u<i+3;u++)a.push(e[u-3]);te(a,t,r,o)}function g3(e,n,t,o,r){let i=[e[0],n[2],n[4],e[2],n[8],n[10]];te(i,t,r,o);let s=mn(n[1],xn(n[11],n[0]));$([s,n[4]],t,r),$([s,n[8]],t,r),$([s,n[0]],t,r)}function y3(e,n,t,o,r){let i=xn(n[4],n[3]),s=xn(n[3],n[2]),l=new Array(12);l[0]=e[0],l[1]=e[1],l[2]=mn(n[3],i),l[3]=mn(l[2],s),l[4]=mn(l[3],i),l[5]=mn(l[4],xn(l[2],l[3]));let a=xn(n[5],n[6]),u=xn(n[6],n[7]);l[9]=mn(n[6],a),l[8]=mn(l[9],u),l[7]=mn(l[8],a),l[6]=mn(l[7],xn(l[9],l[8])),l[10]=e[2],l[11]=e[3],te(l,t,r,o),dG(l,t,r)}function dG(e,n,t){let o=xn(e[2],xn(e[3],e[2])),r=mn(o,xn(e[4],e[3]));$([e[2],o,r,e[5]],n,t);let i=xn(e[6],xn(e[7],e[6])),s=mn(i,xn(e[8],e[7]));$([e[6],i,s,e[9]],n,t)}function P3(e,n,t,o,r){let i=Nn(e),s=Ge(e),l=n[3].y-n[4].y,a=n[2].x-n[3].x,u={x:i+(e[0].x-e[1].x)/8,y:s+l*3/2},f={x:i-(e[0].x-e[1].x)/4,y:u.y},d={x:f.x,y:s},c={x:d.x+a/2,y:s},m={x:c.x,y:s+l},b={x:u.x,y:m.y},g={x:u.x,y:m.y-l/4},E={x:g.x+a,y:g.y+l/2},R={x:u.x,y:u.y+l/4};te([u,f,d,c,m,b,g,E,R],t,r,o),$(Ut(e),t,r)}function E3(e,n,t,o,r){let i=Nn(e),s=Ge(e),l=n[3].y-n[4].y,a=n[2].x-n[3].x,u={x:i+a/4,y:s},f={x:u.x,y:u.y+l/2},d={x:f.x+a/2,y:f.y},c={x:d.x,y:d.y+l/2},m={x:i-a*3/4,y:c.y},b={x:m.x,y:d.y},g={x:i-a/4,y:f.y},E={x:g.x,y:u.y};te([u,f,d,c,m,b,g,E],t,r,o),$(Ut(e),t,r)}function v3(e,n,t,o,r){let i=Nn(e),s=Ge(e),l=n[3].y-n[4].y,a=n[2].x-n[3].x,u={x:i+a*3/4,y:s},f={x:u.x,y:u.y+l/4},d={x:i+a/4,y:f.y+l/2},c={x:i-a/4,y:d.y},m={x:i-a*3/4,y:f.y},b={x:m.x,y:u.y};te([u,f,d,c,m,b],t,r,o),$(Ut(e),t,r)}function S3(e,n,t,o,r){let i=Nn(e),s=Ge(e),l=(n[2].x-n[3].x)/2,a=(n[2].x-n[3].x)*3/4,u=e[2].y+(e[0].y-e[3].y)/2;te([{x:i+l,y:s+l},{x:i+l,y:s-l},{x:i-l,y:s-l},{x:i-l,y:s+l}],t,r,o),$([{x:i+a,y:s+a},{x:i+a,y:s-a},{x:i-a,y:s-a},{x:i-a,y:s+a},{x:i+a,y:s+a}],t,r),$([{x:i+a,y:s},{x:e[0].x,y:u}],t,r),$([{x:e[1].x,y:s},{x:i-a,y:u}],t,r)}function w3(e,n){let t=Nn(e),o=Ge(e),r=n[3].y-n[4].y,i=n[2].x-n[3].x,s={x:t+i/4,y:o+r/2},l={x:s.x,y:s.y+r/8},a={x:s.x-i/8,y:l.y+r/8},u={x:s.x,y:a.y+r/8},f={x:s.x,y:u.y+r/8},d={x:a.x,y:f.y},c={x:t,y:u.y},m={x:c.x-i/8,y:d.y},b={x:m.x-i/8,y:m.y},g={x:b.x,y:u.y},E={x:b.x+i/8,y:a.y},R={x:b.x,y:l.y},N={x:b.x,y:s.y},C={x:E.x,y:N.y},ne={x:c.x,y:l.y},I={x:a.x,y:s.y};return[s,l,a,u,f,d,c,m,b,g,E,R,N,C,ne,I]}function N3(e,n){let t=Nn(e),o=Ge(e),r=n[3].y-n[4].y,i=n[2].x-n[3].x,s={x:t+i/8,y:o+r/2},l={x:s.x+i/8,y:s.y+r/8},a={x:l.x,y:l.y+r/4},u={x:s.x,y:a.y+r/8},f={x:u.x-i/4,y:u.y},d={x:f.x-i/8,y:a.y},c={x:d.x,y:l.y},m={x:f.x,y:s.y};return[s,l,a,u,f,d,c,m]}function R3(e,n,t,o,r){let i=w3(e,n),s=Ge(e),l=n[3].y-n[4].y,a=i[14].x;te(i,t,r,o),$([{x:a,y:s},{x:a,y:s+l/8}],t,r),$([{x:a,y:s+l/4},{x:a,y:s+l/4+l/8}],t,r),$(Ut(e),t,r)}function T3(e,n,t,o,r){let i=w3(e,n);te(i,t,r,o),$([i[14],{x:i[14].x,y:Ge(e)}],t,r),$(Ut(e),t,r)}function k3(e,n,t,o,r){let i=N3(e,n),s=Nn(e),l=Ge(e),a=n[3].y-n[4].y;te(i,t,r,o),$([{x:s,y:l},{x:s,y:l+a/8}],t,r),$([{x:s,y:l+a/4},{x:s,y:l+a/4+a/8}],t,r),$(Ut(e),t,r)}function C3(e,n,t,o,r){let i=N3(e,n),s=Nn(e);te(i,t,r,o),$([{x:s,y:i[0].y},{x:s,y:Ge(e)}],t,r),$(Ut(e),t,r)}function _3(e,n,t,o,r){let i=Nn(e),s=Ge(e),l=n[3].y-n[4].y,a=n[2].x-n[3].x,u={x:i+a,y:s+l/4},f={x:u.x-a,y:u.y+l},d={x:f.x,y:u.y+l/2},c={x:i-(e[0].x-e[1].x)/4,y:d.y},m={x:c.x,y:u.y};te([u,f,d,c,m],t,r,o),$(Ut(e),t,r)}function A3(e,n,t,o,r){let i=Nn(e),s=Ge(e),l=(e[0].x-e[1].x)/8,a=n[3].y-n[4].y,u=n[2].x-n[3].x,f={x:i+l+u/2,y:s+a/4},d={x:i-l,y:f.y},c={x:d.x,y:d.y+a/2},m={x:c.x-u/2,y:c.y},b={x:m.x,y:s-a/4},g={x:f.x-u/2,y:b.y},E={x:g.x,y:g.y-a/2},R={x:f.x,y:E.y};te([f,d,c,m,b,g,E,R],t,r,o),$([{x:e[1].x,y:s},{x:b.x,y:ho(e)}],t,r),$([{x:R.x,y:s},{x:e[0].x,y:ho(e)}],t,r)}function G3(e,n,t,o,r){let i=Ge(e),s=n[3].y-n[4].y,l=n[2].x-n[3].x;te(gs(e[1].x,i+s/8,2*l,s/2),t,r,o);let a=gs(e[1].x+l,i-s*5/8,l,s/2);te(a,t,r,o),$([{x:a[1].x,y:i},{x:e[0].x,y:ho(e)}],t,r)}function M3(e,n,t,o,r){let i=Ge(e),s=n[3].y-n[4].y,l=n[2].x-n[3].x,a={x:e[0].x,y:i+s/8},u={x:a.x,y:a.y+s/2};te([a,u,{x:u.x-2*s,y:u.y},{x:u.x-2*s,y:a.y}],t,r,o);let f={x:e[0].x-l,y:i-s*5/8},d={x:f.x,y:f.y+s/2},c=d.x-s;te([f,d,{x:c,y:d.y},{x:c,y:f.y}],t,r,o),$([{x:e[1].x,y:i},{x:c,y:ho(e)}],t,r)}function L3(e,n,t,o,r){let i=Nn(e),s=Ge(e),l=n[3].y-n[4].y,a=n[2].x-n[3].x,u=i-a*9/8,f=i+a/8,d=s+l/8,c=s-l*5/8;for(let[m,b]of[[u,d],[u,c],[f,c],[f,d]])te(gs(m,b,a,l/2),t,r,o);$([{x:f+a,y:s},{x:e[0].x,y:ho(e)}],t,r),$([{x:u,y:s},{x:e[1].x,y:ho(e)}],t,r)}function I3(e,n,t,o,r){let i=Nn(e),s=Ge(e),l=n[3].y-n[4].y,a=n[2].x-n[3].x,u=i-a;te(gs(u,s+l/8,2*a,l/2),t,r,o),te(gs(u,s-l*5/8,2*a,l/2),t,r,o),$([{x:u+2*a,y:s},{x:e[0].x,y:ho(e)}],t,r),$([{x:e[1].x,y:s},{x:u,y:ho(e)}],t,r)}function O3(e,n,t,o,r){let i=Ge(e),s=n[3].y-n[4].y,l=n[2].x-n[3].x;te([{x:e[0].x,y:n[1].y-s/2},{x:n[3].x,y:n[3].y-s/2},{x:e[2].x,y:e[2].y+s/2},{x:e[0].x,y:e[2].y+s/2}],t,r,o);let a=e[1].x+l/4;$([{x:a,y:i+s/8},{x:a+l/4,y:i+s/8-s/4}],t,r),$([{x:a,y:i-s/8},{x:a+l/4,y:i-s/8+s/4}],t,r);let u=e[2].y+s*3/4;$([{x:a,y:u},{x:e[0].x-l/4,y:u}],t,r)}function D3(e,n,t,o,r){let i=n[3].y-n[4].y,s=(n[2].x-n[3].x)/2,l=n[1].x-s,a=n[2].x+s;te([{x:l,y:n[1].y-i/2},{x:n[3].x,y:n[3].y-i/2},{x:e[2].x,y:e[2].y},{x:a,y:e[2].y},{x:a,y:e[2].y+i/2},{x:l,y:e[2].y+i/2},{x:l,y:e[3].y},{x:e[0].x,y:e[0].y-(e[0].y-e[3].y)/2},{x:l,y:e[0].y}],t,r,o)}function B3(e,n,t,o,r){let i=n[3].y-n[4].y,s=n[1].x-(n[2].x-n[3].x)/2;te([{x:s,y:n[1].y-i/2},{x:n[3].x,y:n[3].y-i/2},{x:e[2].x,y:e[2].y+i/2},{x:s,y:e[2].y+i/2},{x:s,y:e[3].y},{x:e[0].x,y:e[0].y-(e[0].y-e[3].y)/2},{x:s,y:e[0].y}],t,r,o)}function F3(e,n){let t=n[3].y-n[4].y,o=n[2].x+(n[2].x-n[3].x)/2;return[{x:e[0].x,y:e[0].y-t/2},{x:o,y:e[0].y-t/2},{x:o,y:n[2].y},{x:e[1].x,y:e[1].y-(e[1].y-e[2].y)/2},{x:o,y:e[2].y},{x:o,y:e[2].y+t/2}]}function z3(e,n,t,o,r){let i=n[3].y-n[4].y,s=F3(e,n);s.push({x:e[0].x,y:e[3].y+i/2}),te(s,t,r,o)}function j3(e,n,t,o,r){let i=n[3].y-n[4].y,s=n[1].x-(n[2].x-n[3].x)/2,l=F3(e,n);l.push({x:s,y:e[3].y+i/2},{x:s,y:e[3].y},{x:e[3].x,y:e[3].y}),te(l,t,r,o)}var OG=new Map([[7,m3],[1,x3],[2,h3],[3,b3],[4,g3],[5,y3],[6,P3],[8,E3],[9,v3],[17,S3],[18,R3],[19,k3],[20,T3],[21,C3],[10,_3],[11,A3],[12,G3],[13,M3],[14,L3],[15,I3],[16,O3],[22,D3],[23,B3],[24,z3],[25,j3]]);function DG(e,n,t,o,r){if(e===26){BG(n,t,o,r);return}let i=OG.get(e);if(i===void 0)throw new Error("special shape "+String(e)+" not yet ported");let s=ed(n,n.length,e);i(n,s,t,o,r)}function BG(e,n,t,o){nd(e,n,o,t);let r=2*e[0].y,i=[e[0]];for(let s=1;s<=5;s++)i.push({x:e[s].x,y:r-e[s].y});i.push(e[6]),nd(i,n,o,!1)}function H3(e,n,t,o){o.diagonals?FG(e,n,t,o):o.shape!==0&&o.shape!==27?DG(o.shape,e,n,t,o):o.rounded&&zG(e,n,t,o)}function FG(e,n,t,o){let r=e.length,i=ed(e,r,0);te(e,n,o,t);for(let s=0;s<r;s++)$([i[3*s+2],i[3*s+4]],n,o)}function zG(e,n,t,o){bo(e,n,t,o)}function bo(e,n,t,o){let r=e.length,i=ed(e,r,0,!0),s=[];for(let l=0;l<r;l++)s.push(i[4*l],i[4*l+1],i[4*l+1],i[4*l+2],i[4*l+2],i[4*l+3]);s.push(s[0],s[1]),nd(s.slice(1),n,o,t)}function V3(e,n,t){let o=e[1].x*.6614,r=.75*(e[1].y-e[0].y)/2;$([{x:o,y:r},{x:-o,y:r}],n,t),$([{x:o,y:-r},{x:-o,y:-r}],n,t)}function U3(e,n,t,o){let r=o.job.obj,i=r?.penColor;r&&(r.penColor={type:"none"});try{te(e,n,o,t)}finally{r&&i!==void 0&&(r.penColor=i)}$([e[2],e[3]],n,o)}function X3(e){return e<1e-5&&e>-1e-5}function jG(e){let n=e.indexOf(";");if(n===-1)return{color:e,v:0};let t=e.slice(0,n),o=e.slice(n+1);if(o.length===0)return{color:t,v:-1};let r=parseFloat(o);return!isNaN(r)&&r>=0?{color:t,v:r}:{color:t,v:-1}}function HG(e,n,t,o){let{color:r,v:i}=jG(e);if(i<0)return null;let s=i,l=0,a=s-n;return a>0&&(!X3(a)&&!o.v&&(o.v=!0,l=3),s=n),n-=s,t.push({color:r.length>0?r:null,t:s,hasFraction:s>0&&i>0}),{left:n,rval:l}}function VG(e,n){if(n<=0)return;let t=e.filter(o=>o.t<=0).length;if(t>0){let o=n/t;for(let r of e)r.t<=0&&(r.t=o)}else e.length>0&&(e[e.length-1].t+=n)}function UG(e){for(;e.length>0&&(e[e.length-1]?.t??0)<=0;)e.pop()}function nt(e){let n=[],t=1,o=0,r=0,i={v:!1};for(let s of e.split(":")){let l=HG(s,t,n,i);if(l===null){let a=r===0?2:1;return r++,{segs:[],error:a}}if(l.rval===3&&(o=3),t=l.left,X3(t)){t=0;break}}return VG(n,t),UG(n),{segs:n,error:o}}var Y3="black",J3="lightgrey",XG=2,$G={filled:"filled",dashed:"dashed",dotted:"dotted",bold:"bold",invis:"invis",diagonals:"diagonals",rounded:"rounded",striped:"striped",wedged:"wedged",underline:"underline"};function $3(){return{filled:!1,dashed:!1,dotted:!1,bold:!1,invis:!1,diagonals:!1,rounded:!1,radial:!1,striped:!1,wedged:!1,underline:!1,setLineWidth:null}}var N0=64;function td(e){if(!e)return[];let n=[],t=0;for(let o of e.split(",")){let r=o.trim();if(r.length!==0){if(t===N0-1)return[];t++,n.push(r)}}return n}function WG(e){let n=/^setlinewidth\s*\(\s*([^)]*)\)\s*$/.exec(e);if(n===null)return null;let t=parseFloat(n[1]);return Number.isNaN(t)?0:t}function YG(e,n){if(n==="radial"){e.radial=!0,e.filled=!0;return}let t=$G[n];t!==void 0&&(e[t]=!0)}function Xr(e){return e!==void 0&&e.length>0}function W3(e,n){return Xr(e)?e:n}function JG(e){let n=Es(e);return n!==null?n[0]:e}function ce(e){let n=$3();if(!e)return n;let t=0;for(let o of e.split(",")){let r=o.trim();if(r.length===0)continue;if(t===N0-1)return $3();t++;let i=WG(r);if(i!==null){n.setLineWidth=i;continue}r.includes("(")||YG(n,r)}return n}function R0(e){if(!e)return!1;let n=0;for(let t of e.split(",")){let o=t.trim();if(o.length!==0){if(n===N0-1)return!1;if(n++,o==="invisible")return!0}}return!1}function ys(e){return e.invis?0:e.dashed?1:e.dotted?2:3}function Xt(e,n){if(n&&n.length>0){let t=parseFloat(n);if(isFinite(t))return t}return e.setLineWidth!==null?e.setLineWidth:e.bold?XG:1}function Ps(e){return!e||e.length===0?Y3:JG(e)}function KG(e){let n=Xr(e.color)?e.color:void 0,t=W3(e.pencolor,n??""),o=W3(e.fillcolor,n??"");return{fillcolor:Xr(o)?o:void 0,pencolor:Xr(t)?t:void 0}}function qG(e,n,t){return(!n||!t)&&Xr(e.bgcolor)?{filled:!0,fillcolor:e.bgcolor}:{filled:n,fillcolor:t}}function ba(e){let{segs:n,error:t}=nt(e);if(t===1||t===2||n.length<2)return null;let o=n[0],r=n[1];if(o.color===null)return null;let i=o.color,s=r.color??Y3,l=o.hasFraction?o.t:r.hasFraction?1-r.t:0;return{fillColor:i,stopColor:s,frac:l}}function K3(e){if(!e||e.length===0)return 0;let n=parseInt(e,10);return isFinite(n)?n:0}function q3(e,n,t){let o=ba(e);return o===null?{kind:"solid",color:e}:{kind:n.radial?"radial":"linear",fillColor:o.fillColor,stopColor:o.stopColor,frac:o.frac,angle:t}}function Q3(e){let n=ce(e.style);if(!n.filled)return{kind:"none"};let t=Xr(e.fillcolor)?e.fillcolor:Xr(e.color)?e.color:J3;return q3(t,n,K3(e.gradientangle))}function Z3(e){let n=ce(e.style),t=KG(e),o=qG(e,n.filled,t.fillcolor);if(!o.filled)return{kind:"none"};let r=o.fillcolor??J3;return q3(r,n,K3(e.gradientangle))}var hn=class extends Error{type="semantic";code="HTML_PARSE_ERROR";friendlyMessage=xa("HTML_PARSE_ERROR");tag;constructor(n){super(`Unknown HTML element <${n}>`),this.tag=n,this.name="HtmlParseError"}},ga=1024,ya=2048,Pa=4096,Ea=8192,va=ga|ya|Pa|Ea;function Es(e){let n=e.indexOf(":");if(n<1)return null;let t=e.slice(0,n).trim(),o=e.slice(n+1).trim();return t.length===0?null:[t,o.length>0?o:"black"]}var en={parent:null,type:2,graphObj:null,emitState:8,penColor:{type:"string",s:"black"},fillColor:{type:"none"},stopColor:{type:"none"},gradientAngle:0,gradientFrac:0,pen:3,fill:0,penWidth:1,rawStyle:[],label:null,xlabel:null,tailLabel:null,headLabel:null,url:null,id:null,labelUrl:null,tailUrl:null,headUrl:null,tooltip:null,labelTooltip:null,tailTooltip:null,headTooltip:null,target:null,labelTarget:null,tailTarget:null,headTarget:null,explicitTooltip:!1,explicitTailTooltip:!1,explicitHeadTooltip:!1,explicitLabelTooltip:!1,explicitTailTarget:!1,explicitHeadTarget:!1,explicitEdgeTarget:!1,explicitTailUrl:!1,explicitHeadUrl:!1,labelEdgeAligned:!1,urlMapShape:0,urlMapPts:[],urlBsplineMapPts:[],tailEndMapPts:[],headEndMapPts:[]},T0=1;function n4(){return T0}function t4(){T0=1}function QG(e){return e!==void 0&&e.includes("dashed")?1:e!==void 0&&e.includes("dotted")?2:3}function Sa(e,n,t){en.fillColor=e.fill!==void 0?X(e.fill):{type:"none"},en.penColor=e.pen!==void 0?X(e.pen):{type:"string",s:"transparent"},ZG(e),en.pen=QG(e.penStyle),en.penWidth=e.penWidth!==void 0?e.penWidth:1,en.rawStyle=en.pen===3?["solid"]:[],en.emitState=n.obj?.emitState??8,n.pushObj(en);try{t()}finally{n.popObj()}}function ZG(e){if(e.stop!==void 0){en.fill=e.radial===!0?3:2,en.stopColor=X(e.stop),en.gradientAngle=e.gradientAngle??0,en.gradientFrac=0;return}en.fill=e.fill!==void 0?1:0,en.stopColor={type:"none"},en.gradientAngle=0,en.gradientFrac=0}function od(e,n,t){let o=e.ll.x+t.x,r=e.ll.y+t.y,i=e.ur.x+t.x,s=e.ur.y+t.y;if(n>1){let l=n/2;o+=l,r+=l,i-=l,s-=l}return[{x:o,y:r},{x:i,y:r},{x:i,y:s},{x:o,y:s}]}function k0(e,n,t,o,r){let i=[{x:e.x,y:e.y},{x:e.x,y:e.y+t},{x:e.x+n,y:e.y+t},{x:e.x+n,y:e.y}].map(s=>K(s,r));o.polygon(i,!0,r)}function o4(e,n,t){let{box:o,pos:r,border:i,color:s,sides:l,style:a}=e;T0=i,Sa({pen:s,penWidth:i,penStyle:a},t,()=>{if(ce(a).rounded){bo(od(o,i,r),{x:0,y:0},!1,{renderer:n,job:t});return}let u=l!==void 0?l&va:0;if(u!==0){let f=od(o,i,r).map(d=>K(d,t));tM(u,f,n,t)}else eM(o,r,i,n,t)})}function eM(e,n,t,o,r){let i=t>1?{ll:{x:e.ll.x+t/2,y:e.ll.y+t/2},ur:{x:e.ur.x-t/2,y:e.ur.y-t/2}}:e,s=[{x:i.ll.x+n.x,y:i.ll.y+n.y},{x:i.ll.x+n.x,y:i.ur.y+n.y},{x:i.ur.x+n.x,y:i.ur.y+n.y},{x:i.ur.x+n.x,y:i.ll.y+n.y}].map(l=>K(l,r));o.polygon(s,!1,r)}var jn=0,tt=1,ot=2,rt=3,Ko=Ea,qo=Pa,Qo=ya,Zo=ga,nM=new Map([[Ko|qo|Qo|Zo,[[jn,tt,ot,rt,jn]]],[Ko|qo|Qo,[[jn,tt,ot,rt]]],[qo|Qo|Zo,[[tt,ot,rt,jn]]],[Qo|Zo|Ko,[[ot,rt,jn,tt]]],[Zo|Ko|qo,[[rt,jn,tt,ot]]],[Ko|qo,[[jn,tt,ot]]],[qo|Qo,[[tt,ot,rt]]],[Qo|Zo,[[ot,rt,jn]]],[Zo|Ko,[[rt,jn,tt]]],[Qo|Ko,[[jn,tt],[ot,rt]]],[Zo|qo,[[rt,jn],[tt,ot]]],[Ko,[[jn,tt]]],[qo,[[tt,ot]]],[Qo,[[ot,rt]]],[Zo,[[rt,jn]]]]);function tM(e,n,t,o){let r=nM.get(e&va);if(r!==void 0)for(let i of r)t.polyline(i.map(s=>n[s]),o)}function r4(e){Sa({fill:e.color,pen:e.color,penWidth:1},e.job,()=>{e.cell.vruled===!0&&rM(e),e.cell.hruled===!0&&sM(e)})}function oM(e,n){if(n.idx===0)return{ruleY:e-n.sp/2,base:n.border+n.sp/2};if(n.idx+n.span===n.count){let t=n.border+n.sp/2;return{ruleY:e-n.sp/2-t,base:t}}return{ruleY:e-n.sp/2,base:0}}function rM(e){let{cell:n,tbl:t,pos:o,renderer:r,job:i}=e;if(n.col+n.colspan>=t.columnCount)return;let s=t.spacing,l=n.box.ll.y+o.y,a=n.box.ur.y+o.y,u=n.box.ur.x+o.x,f={idx:n.row,span:n.rowspan,count:t.rowCount,border:t.border,sp:s},{ruleY:d,base:c}=oM(l,f);k0({x:u+s/2,y:d},0,c+(a-l)+s,r,i)}function iM(e,n,t){let{cell:o,tbl:r,pos:i,nextCell:s}=e,l=r.spacing,a=o.col+o.colspan===r.columnCount,u=s!==void 0&&s.row!==o.row?r.box.ur.x+i.x-(t+l/2):0;if(o.col===0){let f=r.border+l/2,d=n-f-l/2;return a?f*=2:u!==0&&(f+=u),{ruleX:d,base:f}}return a?{ruleX:n-l/2,base:r.border+l/2}:{ruleX:n-l/2,base:u}}function sM(e){let{cell:n,tbl:t,pos:o,renderer:r,job:i}=e;if(n.row+n.rowspan>=t.rowCount)return;let s=t.spacing,l=n.box.ll.x+o.x,a=n.box.ur.x+o.x,u=n.box.ll.y+o.y,{ruleX:f,base:d}=iM(e,l,a);k0({x:f,y:u-s/2},d+(a-l)+s,0,r,i)}var Et={objId:"",objLabel:null,imgscale:"false"},vs={url:null,tooltip:null,explicitTooltip:!1,target:null,opened:!1},Ss=[];function lM(){return Ss.length>0?Ss[Ss.length-1]:vs}var i4=0;function wa(e,n,t){Et.objId=e,Et.objLabel=n,Et.imgscale="false",Ss.length=0,vs.url=t?.url??null,vs.tooltip=t?.tooltip??null,vs.explicitTooltip=t?.explicitTooltip??!1,vs.target=t?.target??null,vs.opened=!1}function s4(e){Et.imgscale=e!==void 0&&e!==""?e:"false"}function l4(){return Et.imgscale}function a4(){i4=0,Et.objId="",Et.objLabel=null,Et.imgscale="false"}function rd(e,n,t,o){if(e.href===void 0&&e.title===void 0&&e.target===void 0)return!1;let r=e.id!==void 0&&e.id!==""?e.id:`${Et.objId}_${i4++}`,s={...lM(),opened:!1};return e.href!==void 0&&e.href!==""&&(s.url=e.href),e.title!==void 0&&e.title!==""?(s.tooltip=e.title,s.explicitTooltip=!0):s.tooltip===null&&Et.objLabel!==null&&(s.tooltip=Et.objLabel),e.target!==void 0&&e.target!==""&&(s.target=e.target),(s.url!==null||s.explicitTooltip)&&(t.emitMapRect?.(n,o),t.beginAnchor?.(s.url??"",s.tooltip??"",s.target??"",r,o),s.opened=!0),Ss.push(s),!0}function id(e,n){Ss.pop()?.opened&&e.endAnchor?.(n)}function u4(e,n){return{ll:{x:e.ll.x+n.x,y:e.ll.y+n.y},ur:{x:e.ur.x+n.x,y:e.ur.y+n.y}}}function aM(e){return{str:e.text,fontName:e.fontName,fontSize:e.fontSize,fontColor:e.fontColor,fontFlags:e.fontFlags,yoffset_layout:0,yoffset_centerline:e.yoffsetCenterline??0,size:{x:e.width,y:e.fontSize},just:"l"}}function uM(e,n,t,o){hs(t,{x:e.x+n.x,y:e.baseline+n.y},aM(e),o)}function fM(e){let n=n4(),t=Es(e.bgcolor);return t===null?{fill:e.bgcolor,penWidth:n}:{fill:t[0],stop:t[1],gradientAngle:e.gradientangle??0,radial:e.style!==void 0&&e.style.includes("radial"),penWidth:n}}function f4(e){let{box:n,pos:t,border:o,renderer:r,job:i}=e;Sa(fM(e),i,()=>{if(ce(e.style).rounded){bo(od(n,o,t),{x:0,y:0},!0,{renderer:r,job:i});return}let s=[{x:n.ll.x+t.x,y:n.ll.y+t.y},{x:n.ll.x+t.x,y:n.ur.y+t.y},{x:n.ur.x+t.x,y:n.ur.y+t.y},{x:n.ur.x+t.x,y:n.ll.y+t.y}].map(l=>K(l,i));r.polygon(s,!0,i)})}function d4(e,n,t){o4({box:e.box,pos:e.pos,border:e.border,color:e.color??"black",sides:e.sides,style:e.style},n,t)}function dM(e,n,t,o){e.bgcolor!==void 0&&f4({bgcolor:e.bgcolor,box:e.box,pos:n,border:e.border,renderer:t,job:o,gradientangle:e.gradientangle,style:e.style}),e.border>0&&d4({box:e.box,pos:n,border:e.border,color:e.color,sides:e.sides,style:e.style},t,o)}function cM(e){let n=e.pw/e.iw,t=e.ph/e.ih,o=(e.scale??"").toLowerCase();if(o==="width")return{iw:e.iw*n,ih:e.ih};if(o==="height")return{iw:e.iw,ih:e.ih*t};if(o==="both")return{iw:e.iw*n,ih:e.ih*t};if(o==="true"||o==="yes"||o==="1"){let r=Math.min(n,t);return{iw:e.iw*r,ih:e.ih*r}}return{iw:e.iw,ih:e.ih}}function pM(e,n,t,o){if(e.iw<=0&&e.ih<=0)return;let r={ll:{x:e.box.ll.x+n.x,y:e.box.ll.y+n.y},ur:{x:e.box.ur.x+n.x,y:e.box.ur.y+n.y}},i=r.ur.x-r.ll.x,s=r.ur.y-r.ll.y,l=e.scale!==void 0?e.scale:l4(),{iw:a,ih:u}=cM({iw:e.iw,ih:e.ih,pw:i,ph:s,scale:l});a<i&&(r.ll.x+=(i-a)/2,r.ur.x-=(i-a)/2),u<s&&(r.ll.y+=(s-u)/2,r.ur.y-=(s-u)/2),t.usershape?.(e.src,r,o)}function mM(e,n,t,o){let r=rd({href:e.href,title:e.title,target:e.target,id:e.id},u4(e.box,n),t,o);if(dM(e,n,t,o),e.nested!==void 0)Na(e.nested,n,t,o);else if(e.image!==void 0)pM(e.image,n,t,o);else for(let i of e.lines)uM(i,n,t,o);r&&id(t,o)}function xM(e,n,t,o){let r=e.color??"black";e.cells.forEach((i,s)=>{(i.vruled===!0||i.hruled===!0)&&r4({cell:i,tbl:e,pos:n,color:r,nextCell:e.cells[s+1],renderer:t,job:o})})}function Na(e,n,t,o){t4();let r={href:e.href,title:e.title,target:e.target,id:e.id},i=u4(e.box,n),s=(o.flags&xo)!==0,l=s?!1:rd(r,i,t,o);e.bgcolor!==void 0&&f4({bgcolor:e.bgcolor,box:e.box,pos:n,border:e.border,renderer:t,job:o,gradientangle:e.gradientangle,style:e.style});for(let a of e.cells)mM(a,n,t,o);xM(e,n,t,o),e.border>0&&d4({box:e.box,pos:n,border:e.border,color:e.color,sides:e.sides,style:e.style},t,o),l&&id(t,o),s&&rd(r,i,t,o)&&id(t,o)}var hM={AElig:198,Aacute:193,Acirc:194,Agrave:192,Alpha:913,Aring:197,Atilde:195,Auml:196,Beta:914,Ccedil:199,Chi:935,Dagger:8225,Delta:916,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Epsilon:917,Eta:919,Euml:203,Gamma:915,Iacute:205,Icirc:206,Igrave:204,Iota:921,Iuml:207,Kappa:922,Lambda:923,Mu:924,Ntilde:209,Nu:925,OElig:338,Oacute:211,Ocirc:212,Ograve:210,Omega:937,Omicron:927,Oslash:216,Otilde:213,Ouml:214,Phi:934,Pi:928,Prime:8243,Psi:936,Rho:929,Scaron:352,Sigma:931,THORN:222,Tau:932,Theta:920,Uacute:218,Ucirc:219,Ugrave:217,Upsilon:933,Uuml:220,Xi:926,Yacute:221,Yuml:376,Zeta:918,aacute:225,acirc:226,acute:180,aelig:230,agrave:224,alefsym:8501,alpha:945,amp:38,and:8743,ang:8736,aring:229,asymp:8776,atilde:227,auml:228,bdquo:8222,beta:946,brvbar:166,bull:8226,cap:8745,ccedil:231,cedil:184,cent:162,chi:967,circ:710,clubs:9827,cong:8773,copy:169,crarr:8629,cup:8746,curren:164,dArr:8659,dagger:8224,darr:8595,deg:176,delta:948,diams:9830,divide:247,eacute:233,ecirc:234,egrave:232,empty:8709,emsp:8195,ensp:8194,epsilon:949,equiv:8801,eta:951,eth:240,euml:235,euro:8364,exist:8707,fnof:402,forall:8704,frac12:189,frac14:188,frac34:190,frasl:8260,gamma:947,ge:8805,gt:62,hArr:8660,harr:8596,hearts:9829,hellip:8230,iacute:237,icirc:238,iexcl:161,igrave:236,image:8465,infin:8734,int:8747,iota:953,iquest:191,isin:8712,iuml:239,kappa:954,lArr:8656,lambda:955,lang:9001,laquo:171,larr:8592,lceil:8968,ldquo:8220,le:8804,lfloor:8970,lowast:8727,loz:9674,lrm:8206,lsaquo:8249,lsquo:8216,lt:60,macr:175,mdash:8212,micro:181,middot:183,minus:8722,mu:956,nabla:8711,nbsp:160,ndash:8211,ne:8800,ni:8715,not:172,notin:8713,nsub:8836,ntilde:241,nu:957,oacute:243,ocirc:244,oelig:339,ograve:242,oline:8254,omega:969,omicron:959,oplus:8853,or:8744,ordf:170,ordm:186,oslash:248,otilde:245,otimes:8855,ouml:246,para:182,part:8706,permil:8240,perp:8869,phi:966,pi:960,piv:982,plusmn:177,pound:163,prime:8242,prod:8719,prop:8733,psi:968,quot:34,rArr:8658,radic:8730,rang:9002,raquo:187,rarr:8594,rceil:8969,rdquo:8221,real:8476,reg:174,rfloor:8971,rho:961,rlm:8207,rsaquo:8250,rsquo:8217,sbquo:8218,scaron:353,sdot:8901,sect:167,shy:173,sigma:963,sigmaf:962,sim:8764,spades:9824,sub:8834,sube:8838,sum:8721,sup:8835,sup1:185,sup2:178,sup3:179,supe:8839,szlig:223,tau:964,there4:8756,theta:952,thetasym:977,thinsp:8201,thorn:254,tilde:732,times:215,trade:8482,uArr:8657,uacute:250,uarr:8593,ucirc:251,ugrave:249,uml:168,upsih:978,upsilon:965,uuml:252,weierp:8472,xi:958,yacute:253,yen:165,yuml:255,zeta:950,zwj:8205,zwnj:8204},bM={amp:38,lt:60,gt:62,quot:34,apos:39};function gM(e){let t=e[1]==="x"||e[1]==="X"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Number.isFinite(t)&&t>0&&t<=1114111?t:null}function yM(e){return e[0]==="#"?gM(e):bM[e]??hM[e]??null}function ws(e){return e.indexOf("&")<0?e:e.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[A-Za-z]+);/g,(n,t)=>{let o=yM(t);return o===null?n:String.fromCodePoint(o)})}var PM=new Set(["TABLE","TR","TD","TH","FONT","BR","IMG","B","I","U","O","S","SUB","SUP","HR","VR","HTML"]);function _0(e){if(!PM.has(e.toUpperCase()))throw new hn(e)}var C0=e=>e===" "||e===" "||e===`
15
- `||e==="\r";function c4(e){let n={},t=0;for(;t<e.length;){for(;C0(e[t]);)t++;if(t>=e.length)break;let o=/^[\w-]+/.exec(e.slice(t));if(o===null)throw new hn(e.slice(t,t+10));let r=o[0].toLowerCase();for(t+=o[0].length;C0(e[t]);)t++;if(e[t]!=="=")throw new hn(r);for(t++;C0(e[t]);)t++;let i=e[t];if(i!=='"'&&i!=="'")throw new hn(r);let s=e.indexOf(i,t+1);if(s<0)throw new hn(r);n[r]=e.slice(t+1,s),t=s+1}return n}function EM(e){let n=e.slice(1).trim(),t=n.search(/\s/),o=(t===-1?n:n.slice(0,t)).toUpperCase();return _0(o),{type:"close",tag:o}}function vM(e){let n=t=>t===" "||t===" "||t===`
16
- `||t==="\r";return e.replace(/[\x00-\x1f\x7f]/g,t=>n(t)?t:"")}function SM(e,n,t){let o=n;for(;o<e.length&&e[o]!=="<";)o++;let r=ws(vM(e.slice(n,o)));return r.length>0&&t.push({type:"text",value:r}),o}function wM(e,n,t){let o=n+1;for(;o<e.length&&e[o]!==">";)o++;let r=e.slice(n+1,o).trim(),i=o+1;if(r.startsWith("!--"))return i;if(r.startsWith("/"))return t.push(EM(r)),i;if(r.endsWith("/")){let s=p4(r.slice(0,-1).trim());return t.push(s,{type:"close",tag:s.tag}),i}return t.push(p4(r)),i}function p4(e){let n=e.search(/\s/);if(n===-1)return _0(e.toUpperCase()),{type:"open",tag:e.toUpperCase(),attrs:c4("")};let t=e.slice(0,n).toUpperCase();return _0(t),{type:"open",tag:t,attrs:c4(e.slice(n+1))}}function m4(e){let n=[],t=0;for(;t<e.length;)t=e[t]==="<"?wM(e,t,n):SM(e,t,n);return n}function sd(e){return e===void 0?void 0:ws(e)}var ld=e=>{let n=e.toUpperCase();if(n==="LEFT")return"left";if(n==="RIGHT")return"right";if(n==="CENTER")return"center"},x4=e=>{let n=e.toUpperCase();if(n==="TOP")return"top";if(n==="BOTTOM")return"bottom";if(n==="MIDDLE")return"middle"},Rn=e=>{if(e===void 0)return;let n=parseInt(e,10);return isNaN(n)?void 0:n},NM=e=>Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0)),h4=(e,n)=>({...e,...NM(n)}),RM=["bold","italic","underline","overline","strikethrough","subscript","superscript"],b4=e=>{let n={};for(let t of RM)e[t]&&(n[t]=!0);return e.fontColor&&(n.fontColor=e.fontColor),e.fontFace&&(n.fontFace=e.fontFace),e.fontSize!==void 0&&(n.fontSize=e.fontSize),n},nn=e=>e.tokens[e.pos],he=e=>{let n=e.tokens[e.pos];return e.pos++,n},TM=e=>["B","I","U","O","S","SUB","SUP"].includes(e),kM=(e,n)=>{let t={};return e==="B"&&(t.bold=!0),e==="I"&&(t.italic=!0),e==="U"&&(t.underline=!0),e==="O"&&(t.overline=!0),e==="S"&&(t.strikethrough=!0),e==="SUB"&&(t.subscript=!0),e==="SUP"&&(t.superscript=!0),t},CM=(e,n,t,o)=>{he(e);let r=t[t.length-1]??{};o.push({br:!0,brAlign:ld(n.attrs.align??""),...b4(r)});let i=nn(e);i?.type==="close"&&i.tag==="BR"&&he(e)},_M=(e,n,t,o)=>{he(e);let r=t[t.length-1]??{};t.push(h4(r,{fontColor:n.attrs.color,fontFace:n.attrs.face,fontSize:Rn(n.attrs["point-size"])}));let i=ad(e,t);t.pop(),o.push(...i.items);let s=nn(e);s?.type==="close"&&s.tag==="FONT"&&he(e)},AM=(e,n,t,o)=>{he(e);let r=t[t.length-1]??{};t.push(h4(r,kM(n.tag,n.attrs)));let i=ad(e,t);t.pop(),o.push(...i.items);let s=nn(e);s?.type==="close"&&s.tag===n.tag&&he(e)},GM=(e,n,t,o)=>n.tag==="BR"?(CM(e,n,t,o),!0):n.tag==="FONT"?(_M(e,n,t,o),!0):TM(n.tag)?(AM(e,n,t,o),!0):!1,ad=(e,n)=>{let t=[];for(;e.pos<e.tokens.length;){let o=nn(e);if(!o)break;if(o.type==="text"){he(e),t.push({text:o.value,...b4(n[n.length-1]??{})});continue}if(o.type==="close")break;if(!(o.type==="open"&&GM(e,o,n,t)))break}return{kind:"text",items:t}},MM=e=>{he(e);let n=nn(e);return n?.type==="close"&&n.tag==="HR"&&he(e),{kind:"hr"}},LM=(e,n,t)=>{he(e);let o={kind:"image",src:t.src??n.attrs.src??"",scale:n.attrs.scale},r=nn(e);return r?.type==="close"&&r.tag==="IMG"&&he(e),o},IM=(e,n,t,o)=>{if(n.type==="open"&&n.tag==="TABLE")return[w4(e,o)];if(n.type==="open"&&n.tag==="IMG")return[LM(e,n,t)];if(n.type==="open"&&n.tag==="HR")return[MM(e)];let r=ad(e,o);return r.items.length>0?[r]:[]},OM=(e,n,t)=>{let o=[];for(;e.pos<e.tokens.length;){let s=nn(e);if(!s||s.type==="close"&&s.tag==="TD")break;o.push(...IM(e,s,n,t))}let r=nn(e);r?.type==="close"&&r.tag==="TD"&&he(e);let i=o.find(s=>s.kind==="table");return i!==void 0?[i]:o},g4=e=>e.fixedsize?.toUpperCase()==="TRUE"?!0:void 0,y4=e=>e.title!==void 0?e.title:e.tooltip,P4=e=>{if(e===void 0)return;let n=0;for(let t of e.toLowerCase())t==="l"?n|=ga:t==="t"?n|=ya:t==="r"?n|=Pa:t==="b"&&(n|=Ea);if(!(n===0||n===va))return n},E4=e=>{if(e===void 0)return;let n=parseInt(e,10);if(!(isNaN(n)||String(n)!==e.trim())&&!(n<0||n>360))return n},v4=e=>e==="*"?!0:void 0,S4=e=>e==="*"?!0:void 0,DM=(e,n)=>({kind:"cell",content:e,port:n.port,align:ld(n.align!==void 0?n.align:""),valign:x4(n.valign!==void 0?n.valign:""),balign:ld(n.balign!==void 0?n.balign:""),bgcolor:n.bgcolor,color:n.color,border:Rn(n.border),cellpadding:Rn(n.cellpadding),cellspacing:Rn(n.cellspacing),sides:P4(n.sides),gradientangle:E4(n.gradientangle),style:n.style,width:Rn(n.width),height:Rn(n.height),fixedsize:g4(n),colspan:Rn(n.colspan),rowspan:Rn(n.rowspan),href:sd(n.href),title:y4(n),target:sd(n.target),id:n.id}),BM=(e,n,t)=>DM(OM(e,n,t),n),FM=(e,n,t,o)=>{if(n.type==="open"&&(n.tag==="TD"||n.tag==="TH")){he(e),t.push(BM(e,n.attrs,o));return}if(n.type==="open"&&n.tag==="VR"){he(e);let r=nn(e);r?.type==="close"&&r.tag==="VR"&&he(e);let i=t[t.length-1];if(i===void 0)throw new hn("VR");i.vruled=!0;return}he(e)},zM=(e,n)=>{let t=[];for(;e.pos<e.tokens.length;){let r=nn(e);if(!r||r.type==="close"&&r.tag==="TR")break;FM(e,r,t,n)}let o=nn(e);return o?.type==="close"&&o.tag==="TR"&&he(e),{cells:t}},jM=(e,n)=>({kind:"table",rows:e,border:Rn(n.border),cellborder:Rn(n.cellborder),cellspacing:Rn(n.cellspacing),cellpadding:Rn(n.cellpadding),bgcolor:n.bgcolor,color:n.color,style:n.style,align:ld(n.align!==void 0?n.align:""),valign:x4(n.valign!==void 0?n.valign:""),fixedsize:g4(n),width:Rn(n.width),height:Rn(n.height),href:sd(n.href),title:y4(n),target:sd(n.target),id:n.id,port:n.port,sides:P4(n.sides),gradientangle:E4(n.gradientangle),vrule:v4(n.columns),hrule:S4(n.rows)}),w4=(e,n)=>{let t=he(e);if(t.type!=="open"||t.tag!=="TABLE")throw new hn("TABLE");let o=S4(t.attrs.rows)===!0,r=v4(t.attrs.columns)===!0,i=[];for(;e.pos<e.tokens.length;){let s=nn(e);if(!s)break;if(s.type==="close"&&s.tag==="TABLE"){he(e);break}if(s.type==="open"&&s.tag==="TR"){he(e),i.push(HM(e,n,{hrule:o,vrule:r}));continue}if(s.type==="open"&&s.tag==="HR"){VM(e,i);continue}he(e)}return jM(i,t.attrs)},HM=(e,n,t)=>{let o=zM(e,n);if(t.hrule&&(o.ruled=!0),t.vrule)for(let r of o.cells)r.vruled=!0;return o},VM=(e,n)=>{he(e);let t=nn(e);t?.type==="close"&&t.tag==="HR"&&he(e);let o=n[n.length-1];if(o===void 0)throw new hn("HR");o.ruled=!0},UM=(e,n)=>{for(let t=n;t<e.length;t++){let o=e[t];if(o.type!=="text"||o.value.trim()!=="")return o}},XM=e=>{for(;;){let n=nn(e);if(!n||n.type!=="text"||n.value.trim()!=="")break;he(e)}},$M=(e,n)=>{XM(e);let t=w4(e,n),o=nn(e);return o?.type==="close"&&o.tag==="HTML"&&he(e),{kind:"table",table:t}},A0=e=>{let n=`<HTML>${e}</HTML>`,t=m4(n),o={tokens:t,pos:0},r=[{}],i=he(o);if(i.type!=="open"||i.tag!=="HTML")throw new hn("HTML");let s=UM(t,o.pos);if(s?.type==="open"&&s.tag==="TABLE")return $M(o,r);let l=[],a=ad(o,r);a.items.length>0&&l.push(a);let u=nn(o);if(u?.type==="open"&&u.tag==="TABLE")throw new hn("non-space string used before <TABLE>");return u?.type==="close"&&u.tag==="HTML"&&he(o),{kind:"text",texts:l}};var G0=null;function N4(e){G0=e}function R4(e){return G0!==null?G0(e):null}var T4=1,WM=2,YM=2,M0=14,JM=(e,n,t,o,r)=>{let i=t;for(;;){let s=!1;for(let l=i;l<i+o&&!s;l++)for(let a=n;a<n+r&&!s;a++)e.has(`${l},${a}`)&&(s=!0,i=l+1);if(!s)break}for(let s=i;s<i+o;s++)for(let l=n;l<n+r;l++)e.add(`${s},${l}`);return i},L0={fontsize:M0,fontname:""},I0=(e,n)=>({fs:e.fontSize!==void 0?e.fontSize:n.fontsize,face:e.fontFace!==void 0?e.fontFace:n.fontname}),KM=(e,n,t)=>{let{fs:o,face:r}=I0(e,t),i=e.bold===!0||e.italic===!0?{bold:e.bold===!0,italic:e.italic===!0}:void 0;return n.measure(e.text??"",r,o,i)},qM=(e,n,t)=>{let o=[],r={items:[],width:0,mxysize:0,mxfsize:0},i=l=>{let a=KM(l,n,t);r.items.push(l),r.width+=a.w,r.mxysize=Math.max(r.mxysize,a.h),r.mxfsize=Math.max(r.mxfsize,I0(l,t).fs)},s=l=>{if(r.items.length===0&&l!==void 0){let{br:a,brAlign:u,...f}=l;i({text:"",...f})}o.push(r),r={items:[],width:0,mxysize:0,mxfsize:0}};for(let l of e){for(let a of l.items){if(a.br){s(a);continue}a.text!==void 0&&i(a)}r.items.length>0&&s()}return o},QM=e=>e.bold===!0||e.italic===!0||e.underline===!0||e.strikethrough===!0||e.overline===!0||e.subscript===!0||e.superscript===!0,ZM=(e,n)=>{let t=-1,o=null,r=0;for(let i of e)for(let s of i.items){if(s.br){r=0;continue}if(s.text===void 0)continue;if(++r>1||QM(s))return!1;let{fs:l,face:a}=I0(s,n);if(t<0)t=l;else if(l!==t)return!1;if(o===null)o=a;else if(a!==o)return!1}return!0},k4=(e,n,t=L0)=>{let o=qM(e,n,t),r=ZM(e,t),i=0,s=0;for(let l of o){i=Math.max(i,l.width);let a=r?l.mxysize:l.mxfsize;s+=l.items.length>0?a:M0}return o.length===1&&(s=o[0].items.length>0?o[0].mxysize:M0),{w:i,h:s}},eL=(e,n)=>{if(e.width!==void 0&&e.height!==void 0)return;let t=n!==void 0?n(e.src):R4(e.src);if(t!==null){e.width=t.w,e.height=t.h;return}console.error(`Error: No or improper image file="${e.src}"`),e.width=0,e.height=0},nL=(e,n,t)=>e.kind==="text"?k4([e],n,t):e.kind==="table"?(C4(e,n,t),e.dimen!==void 0?e.dimen:{w:0,h:0}):e.kind==="image"?(eL(e,t.imageSizer),{w:e.width??0,h:e.height??0}):{w:0,h:0},Ra=(e,n)=>e.cellpadding!==void 0?e.cellpadding:n.cellpadding!==void 0?n.cellpadding:WM,Ns=(e,n)=>{if(e.border!==void 0)return e.border;let t=n.cellborder;return t!==void 0&&t>=0?t:n.border!==void 0?n.border:T4},tL=(e,n,t,o)=>{let r=2*(Ra(e,n)+Ns(e,n)),i=0,s=0;for(let d of e.content){let c=nL(d,t,o);i=Math.max(i,c.w),s+=c.h}let l=i+r,a=s+r;e.fixedsize&&e.width&&e.height&&(l=0,a=0);let u=e.width!==void 0?e.width:0,f=e.height!==void 0?e.height:0;return{w:Math.max(l,u),h:Math.max(a,f)}},oL=(e,n,t)=>{let o=[],r=new Set,i=0;for(let s of e.rows){let l=0;for(let a of s.cells){if(a.kind!=="cell")continue;let u=a.colspan!==void 0?a.colspan:1,f=a.rowspan!==void 0?a.rowspan:1,{w:d,h:c}=tL(a,e,n,t);l=JM(r,i,l,u,f),o.push({cell:a,row:i,col:l,colspan:u,rowspan:f,w:d,h:c}),l+=u}i++}return o},rL=(e,n,t)=>{let o=new Array(n+1).fill(0);for(let r of e)r.colspan===1&&(o[r.col]=Math.max(o[r.col],r.w));for(let r of e){if(r.colspan===1)continue;let i=o.slice(r.col,r.col+r.colspan).reduce((l,a)=>l+a,0),s=r.w-i-(r.colspan-1)*t;if(s>0){let l=s/r.colspan;for(let a=0;a<r.colspan;a++)o[r.col+a]+=l}}for(let r of e){let i=o.slice(r.col,r.col+r.colspan).reduce((s,l)=>s+l,0);r.w=Math.max(r.w,i+(r.colspan-1)*t)}return o},iL=(e,n,t)=>{let o=new Array(n+1).fill(0);for(let r of e)r.rowspan===1&&(o[r.row]=Math.max(o[r.row],r.h));for(let r of e){if(r.rowspan===1)continue;let i=o.slice(r.row,r.row+r.rowspan).reduce((l,a)=>l+a,0),s=r.h-i-(r.rowspan-1)*t;if(s>0){let l=s/r.rowspan;for(let a=0;a<r.rowspan;a++)o[r.row+a]+=l}}for(let r of e){let i=o.slice(r.row,r.row+r.rowspan).reduce((s,l)=>s+l,0);r.h=Math.max(r.h,i+(r.rowspan-1)*t)}return o},sL=e=>e.cellspacing!==void 0?e.cellspacing:YM,lL=e=>e.border!==void 0?e.border:T4,aL=e=>e.fixedsize===!0&&e.width!==void 0&&e.height!==void 0,uL=e=>{let n=(e.ncols+1)*e.spacing+2*e.border,t=(e.nrows+1)*e.spacing+2*e.border;for(let o=0;o<e.ncols;o++)n+=e.widths[o];for(let o=0;o<e.nrows;o++)t+=e.heights[o];return{wd:n,ht:t}},O0=(e,n,t=L0)=>{let o=sL(e),r=lL(e),i=oL(e,n,t);if(i.length===0)return{entries:i,widths:[],heights:[],spacing:o,border:r};let s=Math.max(...i.map(f=>f.col+f.colspan)),l=Math.max(...i.map(f=>f.row+f.rowspan)),a=rL(i,s,o),u=iL(i,l,o);return{entries:i,widths:a,heights:u,spacing:o,border:r}},C4=(e,n,t)=>{let{entries:o,widths:r,heights:i,spacing:s,border:l}=O0(e,n,t);if(o.length===0){e.dimen={w:0,h:0};return}let a=Math.max(...o.map(g=>g.col+g.colspan)),u=Math.max(...o.map(g=>g.row+g.rowspan));for(let g of o)g.cell.dimen={w:g.w,h:g.h};let{wd:f,ht:d}=uL({widths:r,heights:i,ncols:a,nrows:u,spacing:s,border:l}),c=e.width!==void 0?e.width:0,m=e.height!==void 0?e.height:0,b=aL(e)&&c!==0&&m!==0;e.dimen={w:Math.max(b?0:f,c),h:Math.max(b?0:d,m)}},_4=(e,n,t=L0)=>{e.kind==="table"?(C4(e.table,n,t),e.dimen=e.table.dimen):e.dimen=k4(e.texts,n,t)};var fL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,512,682,836,1024,1024,1706,1593,369,682,682,1024,1155,512,682,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,569,569,1155,1155,1155,909,1886,1479,1366,1366,1479,1251,1139,1479,1479,682,797,1479,1251,1821,1479,1479,1139,1479,1366,1139,1251,1479,1479,1933,1479,1479,1251,682,569,682,961,1024,682,909,1024,909,1024,909,682,1024,1024,569,569,1024,569,1593,1024,1024,1024,1024,682,797,569,1024,1024,1479,1024,1024,909,983,410,983,1108,-1],dL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,512,682,1137,1024,1024,2048,1706,569,682,682,1024,1167,512,682,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,682,682,1167,1167,1167,1024,1905,1479,1366,1479,1479,1366,1251,1593,1593,797,1024,1593,1366,1933,1479,1593,1251,1593,1479,1139,1366,1479,1479,2048,1479,1479,1366,682,569,682,1190,1024,682,1024,1139,909,1139,909,682,1024,1139,569,682,1139,569,1706,1139,1024,1139,1139,909,797,682,1139,1024,1479,1024,1024,909,807,451,807,1065,-1],cL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,512,682,860,1024,1024,1706,1593,438,682,682,1024,1382,512,682,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,682,682,1382,1382,1382,1024,1884,1251,1251,1366,1479,1251,1251,1479,1479,682,909,1366,1139,1706,1366,1479,1251,1479,1251,1024,1139,1479,1251,1706,1251,1139,1139,797,569,797,864,1024,682,1024,1024,909,1024,909,569,1024,1024,569,569,909,569,1479,1024,1024,1024,1024,797,797,569,1024,909,1366,909,909,797,819,563,819,1108,-1],pL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,512,797,1137,1024,1024,1706,1593,569,682,682,1024,1167,512,682,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,682,682,1167,1167,1167,1024,1704,1366,1366,1366,1479,1366,1366,1479,1593,797,1024,1366,1251,1821,1479,1479,1251,1479,1366,1139,1251,1479,1366,1821,1366,1251,1251,682,569,682,1167,1024,682,1024,1024,909,1024,909,682,1024,1139,569,569,1024,569,1593,1139,1024,1024,1024,797,797,569,1139,909,1366,1024,909,797,713,451,713,1167,-1],D0={names:["times","timesroman","timesnewroman","freeserif","liberationserif","nimbusroman","texgyretermes","tinos","thorndale"],unitsPerEm:2048,regular:fL,bold:dL,italic:cL,boldItalic:pL},A4=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,569,569,727,1139,1139,1821,1366,391,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,569,569,1196,1196,1196,1139,2079,1366,1366,1479,1479,1366,1251,1593,1479,569,1024,1366,1139,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,569,569,569,961,1139,682,1139,1139,1024,1139,1139,569,1139,1139,455,455,1024,455,1706,1139,1139,1139,1139,682,1024,569,1139,1024,1479,1024,1024,1024,684,532,684,1196,-1],G4=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,569,682,971,1139,1139,1821,1479,487,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,682,682,1196,1196,1196,1251,1997,1479,1479,1479,1479,1366,1251,1593,1479,569,1139,1479,1251,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,682,569,682,1196,1139,682,1139,1251,1139,1251,1139,682,1251,1251,569,569,1139,569,1821,1251,1251,1251,1251,797,1139,682,1251,1139,1593,1139,1139,1024,797,573,797,1196,-1],B0={names:["helvetica","arial","arialmt","freesans","liberationsans","arimo","albany","nimbussans","nimbussansa","texgyreheros"],unitsPerEm:2048,regular:A4,bold:G4,italic:A4,boldItalic:G4},ud=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,-1],F0={names:["cour","courier","couriernew","nimbusmono","texgyrecursor","freemono","liberationmono","cousine","cumberland"],unitsPerEm:2048,regular:ud,bold:ud,italic:ud,boldItalic:ud},mL=[0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,258,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,258,228,392,600,600,930,693,221,317,317,450,600,228,424,228,283,600,600,600,600,600,600,600,600,600,600,228,228,600,600,600,443,946,729,676,673,742,583,548,726,761,257,324,625,543,855,740,767,633,767,669,615,602,728,689,1101,650,596,589,315,283,315,600,500,500,530,583,463,583,532,333,586,568,232,236,500,296,856,568,556,583,583,358,481,350,561,515,841,525,514,463,352,265,352,600,-1],xL=[0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,258,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,258,228,392,600,600,930,693,221,317,317,450,600,228,424,228,283,600,600,600,600,600,600,600,600,600,600,228,228,600,600,600,443,946,729,676,673,742,583,548,726,761,257,324,625,543,856,739,767,633,767,669,615,602,728,688,1101,650,596,589,315,283,315,600,500,500,530,583,463,583,532,333,586,568,232,236,500,296,856,568,556,583,583,358,481,350,561,515,841,525,514,463,352,265,352,600,-1],hL=[0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,271,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,271,248,448,600,600,945,726,243,358,358,453,600,248,434,248,313,600,600,600,600,600,600,600,600,600,600,248,248,600,600,600,459,950,744,688,680,762,597,562,736,773,282,354,665,562,868,748,785,652,785,686,631,621,738,713,1113,672,618,605,354,313,354,600,500,500,547,600,472,600,542,364,604,585,255,259,536,319,877,585,576,600,600,392,488,384,579,527,853,546,526,474,391,288,391,600,-1],bL=[0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,271,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,271,248,448,600,600,945,726,243,358,358,453,600,248,434,248,313,600,600,600,600,600,600,600,600,600,600,248,248,600,600,600,459,950,744,688,680,762,597,562,736,773,282,354,664,562,869,747,785,652,785,686,631,621,738,713,1113,672,618,605,354,313,354,600,500,500,547,600,472,600,542,364,604,585,255,259,536,319,877,585,576,600,600,392,488,384,579,527,853,546,526,474,391,288,391,600,-1],z0={names:["nunito"],unitsPerEm:1e3,regular:mL,bold:hL,italic:xL,boldItalic:bL};var M4=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,651,821,942,1716,1303,1946,1597,563,799,799,1024,1716,651,739,651,690,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,690,690,1716,1716,1716,1087,2048,1401,1405,1430,1577,1294,1178,1587,1540,604,604,1343,1141,1767,1532,1612,1235,1612,1423,1300,1251,1499,1401,2025,1403,1251,1403,799,690,799,1716,1024,1024,1255,1300,1126,1300,1260,721,1300,1298,569,569,1186,569,1995,1298,1253,1300,1300,842,1067,803,1298,1212,1675,1212,1212,1075,1303,690,1303,1716,-1],gL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,713,934,1067,1716,1425,2052,1786,627,936,936,1071,1716,778,850,778,748,1425,1425,1425,1425,1425,1425,1425,1425,1425,1425,819,819,1716,1716,1716,1188,2048,1585,1561,1503,1700,1399,1399,1681,1714,762,762,1587,1305,2038,1714,1741,1501,1741,1577,1475,1397,1663,1585,2259,1579,1483,1485,936,748,936,1716,1024,1024,1382,1466,1214,1466,1389,891,1466,1458,702,702,1362,702,2134,1458,1407,1466,1466,1010,1219,979,1458,1335,1892,1321,1335,1192,1458,748,1458,1716,-1],yL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,713,934,1067,1425,1425,2052,1786,627,936,936,1071,1716,778,850,778,748,1425,1425,1425,1425,1425,1425,1425,1425,1425,1425,819,819,1716,1716,1716,1188,2048,1585,1561,1503,1700,1399,1399,1681,1714,762,762,1587,1305,2038,1714,1741,1501,1741,1577,1475,1397,1663,1585,2259,1579,1483,1485,936,748,936,1716,1024,1024,1382,1466,1214,1466,1389,891,1466,1458,702,702,1362,702,2134,1458,1407,1466,1466,1010,1219,979,1458,1335,1892,1321,1335,1192,1458,748,1458,1716,-1],H0={names:["dejavusans"],unitsPerEm:2048,regular:M4,bold:gL,italic:M4,boldItalic:yL},j0=[1126,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,-1],PL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,1126,-1],V0={names:["consola","consolas"],unitsPerEm:2048,regular:j0,bold:j0,italic:j0,boldItalic:PL},EL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,617,752,665,1074,1074,1229,1446,327,752,752,752,1074,752,752,752,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,752,752,1074,1074,1074,752,1578,1208,1159,1225,1256,1097,1075,1385,1340,570,976,1179,1037,1453,1307,1380,1142,1384,1192,985,1189,1328,1203,1745,1140,1168,1127,752,728,752,1074,1074,1074,1076,1141,1014,1141,1117,757,1028,1119,584,751,1033,604,1700,1119,1099,1141,1141,796,829,812,1119,1003,1524,1026,1010,972,752,1074,752,1074,-1],vL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,617,752,751,1200,1200,1401,1446,470,752,752,885,1200,752,752,752,799,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,752,752,1200,1200,1200,897,1578,1297,1219,1253,1316,1165,1195,1375,1400,570,1091,1264,1132,1526,1367,1440,1202,1452,1251,1047,1253,1388,1273,1810,1230,1256,1147,823,728,823,1200,1200,1200,1091,1191,1048,1189,1177,757,1028,1214,611,751,1122,604,1760,1209,1159,1193,1196,875,882,812,1210,1080,1605,1131,1093,1082,888,1200,888,1200,-1],SL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,617,752,665,1074,985,1229,1446,327,752,752,752,1074,752,752,752,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,1074,752,752,1074,1074,1074,752,1578,1251,1159,1225,1256,1097,1075,1385,1340,570,976,1179,1037,1559,1307,1380,1113,1380,1192,985,1189,1328,1203,1745,1140,1168,1127,752,728,752,1074,1074,1074,1076,1141,942,1141,1100,822,1028,1141,628,751,1033,656,1700,1119,1099,1141,1141,853,829,860,1140,1003,1524,1026,1010,972,752,1074,752,1074,-1],wL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,617,752,800,1200,1200,1500,1446,617,752,752,885,1200,752,752,752,813,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,752,752,1200,1200,1200,813,1578,1257,1208,1255,1295,1215,1199,1385,1389,570,1021,1331,1082,1610,1352,1438,1195,1576,1277,1027,1403,1355,1399,1897,1345,1400,1252,994,978,994,1200,1200,1200,1214,1215,1009,1215,1130,840,1096,1151,669,794,1105,655,1700,1151,1167,1226,1226,915,940,897,1141,1131,1584,1179,1155,1091,994,1200,994,1200,-1],U0={names:["trebuchetms","trebuchet"],unitsPerEm:2048,regular:EL,bold:vL,italic:SL,boldItalic:wL};var NL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,720,806,940,1676,1302,2204,1488,550,930,930,1302,1676,745,930,745,930,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,930,930,1676,1676,1676,1117,2048,1400,1404,1430,1578,1295,1177,1588,1539,862,931,1419,1140,1726,1532,1612,1235,1612,1424,1400,1262,1499,1400,2025,1403,1260,1403,930,930,930,1676,1302,1302,1230,1276,1067,1276,1220,720,1276,1296,562,705,1212,562,1992,1296,1243,1276,1276,874,1067,807,1296,1212,1676,1212,1212,1076,1300,930,1300,1676,-1],RL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,700,824,1203,1776,1456,2605,1766,680,1113,1113,1456,1776,740,983,740,1412,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,824,824,1776,1776,1776,1263,1974,1590,1560,1482,1700,1399,1332,1661,1715,1118,1137,1579,1305,1941,1734,1741,1501,1741,1602,1455,1396,1663,1564,2311,1564,1509,1417,1113,1412,1113,1776,1456,1456,1368,1432,1205,1432,1360,865,1432,1459,700,825,1374,700,2167,1459,1406,1432,1432,1018,1215,933,1459,1331,2006,1370,1333,1222,1456,1113,1456,1776,-1],TL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,720,806,940,1676,1302,2204,1488,550,930,930,1302,1676,745,930,745,930,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,930,930,1676,1676,1676,1117,2048,1398,1404,1430,1568,1295,1177,1588,1539,862,931,1419,1140,1726,1532,1612,1235,1612,1424,1400,1262,1499,1398,2028,1403,1260,1403,930,930,930,1676,1302,1302,1230,1276,1067,1276,1220,720,1273,1296,562,705,1202,562,1993,1296,1243,1276,1276,874,1067,807,1296,1210,1676,1212,1210,1076,1300,930,1300,1676,-1],kL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,700,824,1203,1776,1456,2605,1766,680,1113,1113,1456,1776,740,983,740,1412,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,824,824,1776,1776,1776,1263,1974,1590,1560,1482,1700,1399,1332,1661,1715,1118,1137,1579,1305,1941,1734,1741,1501,1741,1602,1455,1396,1663,1564,2311,1564,1509,1417,1113,1412,1113,1776,1456,1456,1368,1432,1205,1432,1360,865,1432,1459,700,825,1374,700,2167,1459,1404,1432,1432,1018,1215,933,1459,1329,2006,1370,1333,1222,1456,1113,1456,1776,-1],X0={names:["verdana"],unitsPerEm:2048,regular:NL,bold:RL,italic:TL,boldItalic:kL},CL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,532,547,821,1323,1171,1686,1495,453,606,606,1130,1171,502,659,545,752,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,545,545,1171,1171,1171,879,1841,1296,1327,1292,1493,1139,1057,1491,1511,571,547,1257,1063,1849,1544,1595,1233,1595,1266,1124,1133,1491,1219,1896,1182,1147,1169,674,752,674,1110,918,1182,1139,1255,975,1255,1149,694,1122,1257,518,518,1075,518,1905,1257,1237,1255,1255,836,977,723,1257,1026,1593,1073,1032,958,776,1128,776,1171,-1],_L=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,532,586,967,1323,1169,1845,1536,545,694,694,1116,1169,594,659,584,846,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,584,594,1169,1169,1169,977,1837,1413,1376,1305,1516,1147,1124,1483,1567,678,678,1360,1157,1931,1665,1630,1286,1630,1352,1128,1186,1548,1331,1980,1366,1278,1186,678,846,678,1090,842,1243,1237,1296,1053,1296,1210,793,1157,1346,625,625,1270,625,2011,1346,1268,1296,1296,930,1018,889,1346,1165,1753,1184,1165,999,807,1128,807,1169,-1],AL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,532,530,791,1323,1128,1624,1372,444,584,584,1130,1128,492,639,518,717,1128,1128,1128,1128,1128,1128,1128,1128,1128,1128,518,518,1128,1128,1128,874,1735,1137,1225,1198,1364,1047,967,1386,1389,559,547,1141,971,1714,1438,1475,1159,1475,1165,1028,1020,1384,1122,1745,1063,1030,1087,586,717,586,1059,807,1135,1157,1182,922,1182,1010,641,1026,1182,520,520,999,520,1786,1182,1149,1182,1182,811,877,664,1182,946,1468,979,946,909,715,1128,715,1128,-1],GL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,532,586,928,1323,1128,1753,1450,522,694,694,1116,1128,569,659,584,862,1128,1128,1128,1128,1128,1128,1128,1128,1128,1128,584,584,1128,1128,1128,940,1753,1286,1270,1253,1386,1110,1087,1413,1434,659,678,1255,1061,1802,1546,1495,1188,1495,1247,1085,1087,1415,1208,1831,1241,1155,1098,678,862,678,1081,819,1135,1217,1219,989,1217,1141,764,1108,1237,608,608,1163,608,1853,1237,1198,1219,1217,862,969,840,1237,1049,1614,1087,1063,932,727,1128,727,1128,-1],$0={names:["opensans"],unitsPerEm:2048,regular:CL,bold:_L,italic:AL,boldItalic:GL},ML=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,494,678,843,1317,1249,1674,1455,441,768,768,967,1317,552,766,552,960,1257,880,1144,1130,1157,1082,1159,1029,1221,1159,640,640,1317,1317,1317,980,1902,1374,1339,1315,1534,1338,1227,1485,1669,798,1060,1422,1236,1899,1571,1524,1249,1524,1437,1149,1267,1549,1365,1998,1455,1260,1232,768,960,768,1317,1317,1024,1032,1147,930,1176,990,666,1043,1192,600,598,1097,586,1804,1210,1104,1170,1146,839,885,707,1178,1017,1510,1034,1008,909,881,768,881,1317,-1],LL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,520,771,1044,1440,1312,1801,1637,551,915,915,987,1440,672,776,672,966,1436,1003,1283,1279,1330,1227,1327,1135,1385,1327,752,752,1440,1440,1440,1123,1980,1553,1551,1465,1708,1477,1375,1653,1870,913,1219,1673,1404,2096,1719,1679,1436,1679,1633,1329,1401,1707,1561,2307,1656,1499,1412,915,966,915,1440,1440,1024,1220,1322,1088,1358,1171,805,1181,1392,724,709,1294,705,2080,1413,1302,1347,1328,1065,1050,814,1386,1161,1768,1204,1151,1076,1024,794,1024,1440,-1],IL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,494,678,843,1317,1249,1674,1455,441,768,768,967,1317,552,766,552,960,1257,880,1144,1130,1157,1082,1159,1017,1221,1159,786,786,1317,1317,1317,980,1902,1374,1339,1315,1534,1338,1227,1485,1669,798,1060,1422,1236,1899,1571,1496,1249,1496,1437,1149,1267,1549,1365,1998,1455,1260,1232,768,960,768,1317,1317,1024,1173,1134,929,1178,966,673,1173,1152,609,596,1081,584,1801,1208,1100,1184,1137,945,883,711,1178,1102,1684,1026,1146,909,881,768,881,1317,-1],OL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,520,771,1044,1440,1312,1801,1637,551,915,915,987,1440,672,776,672,966,1436,1003,1283,1279,1330,1227,1327,1160,1385,1327,752,752,1440,1440,1440,1123,1980,1553,1555,1465,1708,1477,1375,1653,1870,923,1219,1673,1404,2116,1699,1679,1446,1679,1633,1337,1401,1707,1561,2307,1643,1499,1412,915,966,915,1440,1440,1024,1352,1329,1097,1357,1141,780,1330,1383,749,747,1313,726,2052,1413,1302,1357,1331,1093,1059,854,1403,1254,1912,1195,1371,1059,1024,794,1024,1440,-1],W0={names:["georgia"],unitsPerEm:2048,regular:ML,bold:LL,italic:IL,boldItalic:OL},DL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,463,667,821,1020,1038,1464,1397,452,621,621,1020,1020,511,627,517,791,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,548,548,1020,1020,1020,949,1831,1185,1114,1092,1260,1e3,941,1292,1276,516,653,1064,861,1751,1322,1356,1058,1378,1112,941,998,1314,1162,1822,1063,998,959,628,791,628,1020,1020,596,981,1076,866,1076,1019,625,964,1076,470,490,931,470,1636,1076,1080,1076,1076,714,801,686,1076,925,1464,887,927,809,644,943,644,1020,-1],BL=[0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,463,667,898,1020,1038,1493,1443,478,638,638,1020,1020,528,627,547,880,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,565,565,1020,1020,1020,949,1840,1241,1148,1084,1291,999,940,1305,1292,546,678,1120,866,1790,1349,1385,1090,1405,1153,968,1014,1337,1211,1856,1128,1064,979,665,880,665,1020,1020,615,1011,1099,857,1099,1031,648,971,1099,503,523,983,503,1666,1099,1101,1099,1099,728,817,710,1099,969,1526,941,970,814,704,973,704,1020,-1],FL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,463,667,821,1020,1038,1464,1397,452,621,621,1020,1020,511,627,517,794,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,548,548,1020,1020,1020,949,1831,1185,1114,1070,1260,1e3,941,1292,1276,516,653,1064,861,1751,1320,1340,1058,1360,1112,926,998,1314,1162,1823,1063,998,959,628,787,628,1020,1020,596,1053,1053,852,1053,978,625,1053,1053,470,490,931,470,1620,1053,1051,1053,1053,702,797,686,1053,913,1464,887,916,809,644,943,644,1020,-1],zL=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,463,667,898,1020,1038,1493,1443,478,638,638,1020,1020,528,627,547,889,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,565,565,1020,1020,1020,949,1840,1241,1148,1062,1291,999,940,1305,1292,546,678,1120,866,1790,1344,1369,1090,1387,1153,953,1014,1337,1211,1857,1128,1064,979,665,870,665,1020,1020,615,1081,1081,843,1081,1006,648,1081,1080,503,523,983,503,1646,1080,1080,1081,1081,721,807,710,1080,961,1526,941,963,814,704,973,704,1020,-1],Y0={names:["calibri"],unitsPerEm:2048,regular:DL,bold:BL,italic:FL,boldItalic:zL};var J0=[D0,B0,F0,z0,H0,V0,U0,X0,$0,W0,Y0];var jL=J0[0];function K0(e){let n="";for(let t=0;t<e.length;t++){let o=e[t],r=o.charCodeAt(0);(r>=65&&r<=90||r>=97&&r<=122)&&(n+=o.toLowerCase())}return n}var L4=new Set;function q0(e){let n=K0(e);for(let t of J0)if(t.names.includes(n))return t;return L4.has(e)||(L4.add(e),console.warn(`Warning: no hard-coded metrics for '${e}'. Falling back to 'Times' metrics`)),jL}function O4(e,n,t){return n&&t?e.boldItalic:n?e.bold:t?e.italic:e.regular}var HL=32;function D4(e,n){let t=n>=128?HL:n,o=e[t]??-1;return o<0?0:o}var VL=new TextEncoder;function B4(e){return VL.encode(e)}function UL(e,n,t,o){let r=q0(e),i=O4(r,t,o),s=0;for(let l of B4(n))s+=D4(i,l);return s/r.unitsPerEm}var _1e=16.5/14,fd=96/72,Q0=72/96;function XL(e,n,t,o=!1,r=!1){let i=q0(e),s=O4(i,o,r),l=0;for(let a of B4(n)){let u=D4(s,a),f=Math.round(u/i.unitsPerEm*t*fd);l+=f*Q0}return l}var $L=1825/2048,WL=443/2048,I4={ascent:$L,descent:WL},YL={ascent:1577/2048,descent:471/2048},JL=new Set(["helvetica","arialmt","arimo","albany","nimbussans","nimbussansa","texgyreheros","freesans","liberationsans"]);function F4(e){return e===void 0?I4:JL.has(K0(e))?YL:I4}function z4(e,n){return Math.ceil(F4(n).ascent*e*fd)*Q0}function KL(e,n){let t=F4(n),o=Math.ceil(t.ascent*e*fd),r=Math.ceil(t.descent*e*fd);return(o+r)*Q0}var Rs=class{measure(n,t,o,r){let i=r?.bold===!0,s=r?.italic===!0;return{w:XL(t,n,o,i,s),h:KL(o,t)}}},Ts=class{constructor(n){this.ctx=n}ctx;measure(n,t,o,r){let i=r?.bold===!0,s=r?.italic===!0,l=i&&s?"bold italic":i?"bold":s?"italic":"";return this.ctx.font=l?`${l} ${o}px ${t}`:`${o}px ${t}`,{w:this.ctx.measureText(n).width,h:o}}},qL=1.2,$r=class{measure(n,t,o,r){return{w:o*UL(t,n,r?.bold===!0,r?.italic===!0),h:o*qL,yoffsetCenterline:.1*o,yoffsetLayout:o}}};var ks=1,Cs=2,Ta=4,dd=8,cd=16,ka=32,Ca=64;function pd(e){let n=0;return e.bold&&(n|=ks),e.italic&&(n|=Cs),e.underline&&(n|=Ta),e.superscript&&(n|=dd),e.subscript&&(n|=cd),e.strikethrough&&(n|=ka),e.overline&&(n|=Ca),n}function Z0(e,n){return{fs:e.fontSize!==void 0?e.fontSize:n.fontsize,face:e.fontFace!==void 0?e.fontFace:n.fontname}}function j4(e,n,t){if(e.text===void 0)return null;let{fs:o,face:r}=Z0(e,n),i=pd(e),s=t.measure(e.text,r,o,{bold:!!(i&ks),italic:!!(i&Cs)});return{w:s.w,h:s.h,fs:o,yoffsetCenterline:s.yoffsetCenterline,yoffsetLayout:s.yoffsetLayout}}function H4(){return{items:[],width:0,fontSize:0,height:0,maxOffset:0,maxLayout:0}}function U4(e,n,t){return e.just==="left"?n.ll.x:e.just==="right"?n.ur.x-e.width:t-e.width/2}function V4(e,n,t){e.items.push(n),e.width+=t.w,e.fontSize=Math.max(e.fontSize,t.fs),e.height=Math.max(e.height,t.h),e.maxOffset=Math.max(e.maxOffset,t.yoffsetCenterline??.05*t.fs),e.maxLayout=Math.max(e.maxLayout,t.yoffsetLayout??0)}function e2(e,n,t){let o=[],r=H4(),i=s=>{if(r.items.length===0&&s!==void 0){let{br:l,brAlign:a,...u}=s,f={text:"",...u},d=j4(f,n,t);d!==null&&V4(r,f,d)}r.just=s?.brAlign,o.push(r),r=H4()};for(let s of e){for(let l of s.items){if(l.br){i(l);continue}let a=j4(l,n,t);a!==null&&V4(r,l,a)}r.items.length>0&&i()}return o}function QL(e,n){if(e.items.length>1)return null;let t=e.items[0];if(t!==void 0)return pd(t)!==0?null:Z0(t,n)}function n2(e,n){let t=-1,o=null;for(let r of e){let i=QL(r,n);if(i===null)return!1;if(i!==void 0){if(t<0)t=i.fs;else if(i.fs!==t)return!1;if(o===null)o=i.face;else if(i.face!==o)return!1}}return!0}function t2(e,n,t,o,r){let i=[],s=n;for(let l of e.items){let{fs:a,face:u}=Z0(l,o),f=pd(l),d=r.measure(l.text,u,a,{bold:!!(f&ks),italic:!!(f&Cs)});i.push({text:l.text,x:s,baseline:t,width:d.w,fontSize:a,fontName:u,fontColor:l.fontColor??o.fontcolor,fontFlags:f}),s+=d.w}return i}function o2(e,n,t,o){return n2(e,t)?ZL(e,n,t,o):eI(e,n,t,o)}function ZL(e,n,t,o){let r=(n.ll.x+n.ur.x)/2,i=[],s=n.ur.y;for(let l=0;l<e.length;l++){let a=e[l],u=a.maxLayout>0?a.maxLayout:z4(a.fontSize,t.fontname);s-=l===0?u:a.height,i.push(...t2(a,U4(a,n,r),s,t,o))}return i}function eI(e,n,t,o){let r=(n.ll.x+n.ur.x)/2,i=[],s=0,l=0;for(let a=0;a<e.length;a++){let u=e[a],f=a===0?u.fontSize-u.maxOffset:u.fontSize+l-s-u.maxOffset;s+=f,l+=u.fontSize;let d=n.ur.y-s;for(let c of t2(u,U4(u,n,r),d,t,o))c.yoffsetCenterline=1,i.push(c)}return i}function nI(e,n,t,o){let r={ll:{...e.ll},ur:{...e.ur}},i=r.ur.x-r.ll.x-t;i>0&&(n.align==="left"?r.ur.x-=i:n.align==="right"?r.ll.x+=i:(r.ll.x+=i/2,r.ur.x-=i/2));let s=r.ur.y-r.ll.y-o;return s>0&&(n.valign==="bottom"?r.ur.y-=s:n.valign==="top"?r.ll.y+=s:(r.ll.y+=s/2,r.ur.y-=s/2)),r}var md=15;function tI(e){let{cell:n,tbl:t,box:o,finfo:r,measurer:i}=e,l=Ns(n,t)+Ra(n,t),a={ll:{x:o.ll.x+l,y:o.ll.y+l},ur:{x:o.ur.x-l,y:o.ur.y-l}},u=n.content.filter(b=>b.kind==="text"),f=e2(u,r,i);if(n.balign==="left"||n.balign==="right")for(let b of f)b.just===void 0&&(b.just=n.balign);let d=Math.max(...f.map(b=>b.width),0),c=f.length===1||n2(f,r),m=f.reduce((b,g)=>b+(c?g.height:g.fontSize),0);return o2(f,nI(a,n,d,m),r,i)}function oI(e,n,t){let o=e.content.find(a=>a.kind==="image");if(o===void 0)return;let r=Ns(e,n)+Ra(e,n),i=o.width??0,s=o.height??0,l={ll:{x:t.ll.x+r,y:t.ll.y+r},ur:{x:t.ur.x-r,y:t.ur.y-r}};return rI(l,e,i,s),{src:o.src,scale:o.scale,iw:i,ih:s,box:l}}function rI(e,n,t,o){let r=e.ur.x-e.ll.x-t;r>0&&(n.align==="left"?e.ur.x-=r:n.align==="right"&&(e.ll.x+=r));let i=e.ur.y-e.ll.y-o;i>0&&(n.valign==="bottom"?e.ur.y-=i:n.valign==="top"&&(e.ll.y+=i))}function iI(e){let{cell:n,tbl:t,box:o,finfo:r,measurer:i,sidesMask:s}=e,l=n.content.find(f=>f.kind==="table");if(l===void 0)return;let a=Ns(n,t)+Ra(n,t),u={ll:{x:o.ll.x+a,y:o.ll.y+a},ur:{x:o.ur.x-a,y:o.ur.y-a}};return $4(l,r,i,u,s)}function sI(e){let{cell:n,tbl:t,box:o,col:r,row:i,colspan:s,rowspan:l}=e,a=Ns(n,t),u=n.vruled,f=iI(e),d=f===void 0?oI(n,t,o):void 0;return{box:o,border:a,lines:f===void 0?tI(e):[],image:d,nested:f,port:n.port,sidesMask:e.sidesMask,bgcolor:n.bgcolor,color:n.color,sides:n.sides,href:n.href,title:n.title,target:n.target,id:n.id,style:n.style,gradientangle:n.gradientangle,col:r,row:i,colspan:s,rowspan:l,vruled:u}}function X4(e,n,t){if(n<=0||t<=0)return e;let o=n/t,r=n-o*t,i=r>=0?Math.floor(r+.5):Math.ceil(r-.5);return e.map((s,l)=>s+o+(l<i?1:0))}function lI(e,n,t,o){let r=[],i=e.ll.x+n+t;for(let s=0;s<o.length;s++)r[s]=i,i+=o[s]+t;return r}function aI(e,n,t,o){let r=[],i=e.ur.y-n-t;for(let s=0;s<o.length;s++)r[s]=i,i-=o[s]+t;return r}function uI(e){return{bgcolor:e.bgcolor,color:e.color,sides:e.sides,href:e.href,title:e.title,target:e.target,id:e.id,style:e.style,gradientangle:e.gradientangle}}function fI(e,n,t,o){if(o===0)return 0;let r=0;return e.col===0&&(r|=8),e.row===0&&(r|=4),e.col+e.colspan===n&&(r|=2),e.row+e.rowspan===t&&(r|=1),o&r}function dI(e){let n=new Set;return e.rows.forEach((t,o)=>{t.ruled===!0&&n.add(o+1)}),n}function cI(e){let{tbl:n,entries:t,colX:o,rowY:r,spacing:i,ncols:s,nrows:l,sides:a,finfo:u,measurer:f}=e,d=dI(n);return t.map(c=>{let m={ll:{x:o[c.col],y:r[c.row+c.rowspan]+i},ur:{x:o[c.col+c.colspan]-i,y:r[c.row]}},b=sI({cell:c.cell,tbl:n,box:m,finfo:u,measurer:f,col:c.col,row:c.row,colspan:c.colspan,rowspan:c.rowspan,sidesMask:fI(c,s,l,a)});return d.has(c.row+c.rowspan)&&(b.hruled=!0),b})}function $4(e,n,t,o,r=md){let i=e.dimen??{w:0,h:0},s=o!==void 0?{ll:{...o.ll},ur:{...o.ur}}:{ll:{x:-i.w/2,y:-i.h/2},ur:{x:i.w/2,y:i.h/2}},{entries:l,widths:a,heights:u,spacing:f,border:d}=O0(e,t,{fontsize:n.fontsize,fontname:n.fontname}),c=a.length>0?Math.max(...l.map(C=>C.col+C.colspan)):0,m=u.length>0?Math.max(...l.map(C=>C.row+C.rowspan)):0,b=Math.max(s.ur.x-s.ll.x-i.w,0),g=Math.max(s.ur.y-s.ll.y-i.h,0);e.fixedsize===!0&&(b>0&&(e.align==="left"?s.ur.x=s.ll.x+i.w:e.align==="right"?(s.ur.x+=b,s.ll.x+=b):(s.ll.x+=b/2,s.ur.x-=b/2),b=0),g>0&&(e.valign==="bottom"?s.ur.y=s.ll.y+i.h:e.valign==="top"?(s.ll.y+=g,s.ur.y=s.ll.y+i.h):(s.ll.y+=g/2,s.ur.y-=g/2),g=0));let E=lI(s,d,f,X4(a,b,c)),R=aI(s,d,f,X4(u,g,m)),N=cI({tbl:e,entries:l,colX:E,rowY:R,spacing:f,ncols:c,nrows:m,sides:r,finfo:n,measurer:t});return{box:s,border:d,cells:N,spacing:f,columnCount:c,rowCount:m,port:e.port,boundarySides:r,...uI(e)}}function pI(e,n,t){let o=e.dimen??{w:0,h:0},r={ll:{x:-o.w/2,y:-o.h/2},ur:{x:o.w/2,y:o.h/2}},i=e2(e.texts,n,t);return{box:r,border:0,columnCount:1,rowCount:1,spacing:0,cells:[{box:r,border:0,col:0,row:0,colspan:1,rowspan:1,lines:o2(i,r,n,t)}]}}function mI(e,n,t){return e.kind==="table"?$4(e.table,n,t):pI(e,n,t)}function W4(e,n){e.color===void 0&&(e.color=n);let t=e.color;for(let o of e.rows)for(let r of o.cells){r.color===void 0&&(r.color=t);for(let i of r.content)i.kind==="table"&&W4(i,r.color)}}function Y4(e,n,t){let{fontname:o,fontsize:r,fontcolor:i,imageSizer:s,pencolor:l}=n,a;try{a=A0(e)}catch{return xd("",o,r,i,t)}a.kind==="table"&&W4(a.table,l),_4(a,t,{fontsize:r,fontname:o,imageSizer:s});let u=mI(a,{fontname:o,fontsize:r,fontcolor:i},t),f=a.dimen??{w:0,h:0},d=a.kind==="table"?"<TABLE>":e;return xI(d,{fontname:o,fontsize:r,fontcolor:i},u,f)}function xI(e,n,t,o){return{text:e,fontname:n.fontname,fontcolor:n.fontcolor,charset:0,fontsize:n.fontsize,dimen:{x:o.w,y:o.h},space:{x:o.w,y:o.h},pos:{x:0,y:0},u:{kind:"html",html:t},valign:99,set:!1,html:!0}}function r2(e){let n=e.label;return n!==void 0?n.text:null}var _s={G:"\\G",N:"\\N",E:"",T:"\\T",H:"\\H",L:"\\L"};function hI(e){return{..._s,G:e.root.name,N:e.name,L:r2(e.info)??_s.L}}function bI(e){let n=e.info,t=n.tail_port?.name??"",o=n.head_port?.name??"",r=e.tail.root.kind==="directed"?"->":"--";return e.tail.name+(t!==""?":"+t:"")+r+e.head.name+(o!==""?":"+o:"")}function gI(e){return{G:e.tail.root.name,N:_s.N,E:bI(e),T:e.tail.name,H:e.head.name,L:r2(e.info)??_s.L}}function yI(e){return{..._s,G:e.name,L:r2(e.info)??_s.L}}function PI(e){return e instanceof We?hI(e):e instanceof Ae?gI(e):yI(e)}var EI=e=>e==="G"||e==="N"||e==="E"||e==="T"||e==="H"||e==="L";function i2(e,n,t){if(!e.includes("\\"))return e;let o=PI(n),r="";for(let i=0;i<e.length;i++){let s=e[i];if(s!=="\\"||i+1>=e.length){r+=s;continue}let l=e[++i];EI(l)?r+=o[l]:l==="\\"&&t?r+="\\":r+="\\"+l}return r}function er(e,n){return i2(e,n,!0)}function hd(e){let n="",t=!1;for(let o of e)t?(o==="n"||o==="l"?n+=`
17
- `:o==="r"?n+="\r":n+=o,t=!1):o==="\\"?t=!0:n+=o;return n}var As=14,Gs="Times,serif",Ms="black";function vI(e){if(e===void 0)return;let n=e.attrs.get("pencolor");if(n!==void 0&&n!=="")return n;let t=e.attrs.get("color");if(t!==void 0&&t!=="")return t}function SI(e,n,t){return{str:e,fontName:n.fontname,fontSize:n.fontsize,fontColor:n.fontcolor,fontFlags:0,yoffset_layout:0,yoffset_centerline:t.yoffsetCenterline??.05*n.fontsize,size:{x:t.w,y:t.h},just:"n"}}var wI=e=>e==="n"||e==="l"||e==="r";function NI(e){let n=[],t="";for(let o=0;o<e.length;o++){let r=e[o];if(r==="\\"&&o+1<e.length){let i=e[++o];wI(i)?(n.push({text:t,just:i}),t=""):t+=i}else r===`
18
- `?(n.push({text:t,just:"n"}),t=""):t+=r}return t.length>0&&n.push({text:t,just:"n"}),n}var RI=1.2;function TI(e,n,t){let o=e.text.length>0?t.measure(e.text,n.fontname,n.fontsize):{w:0,h:Math.trunc(n.fontsize*RI)},r=SI(e.text,n,o);return r.just=e.just,r}function J4(e,n,t){let o=NI(e).map(s=>TI(s,n,t)),r=o.reduce((s,l)=>Math.max(s,l.size.x),0),i=o.reduce((s,l)=>s+l.size.y,0);return{text:e,...n,charset:0,dimen:{x:r,y:i},space:{x:r,y:i},pos:{x:0,y:0},u:{kind:"txt",span:o,nspans:o.length},valign:99,set:!1,html:!1}}function xd(e,n,t,o,r){return J4(e,{fontname:n,fontsize:t,fontcolor:o},r)}function Hn(e,n,t,o,r){if(n&&e!=="")return Y4(e,{...t,pencolor:vI(r)},o);let i=r!==void 0?i2(e,r,!1):e,s=ws(i);return J4(s,t,o)}function kI(e,n){return[{x:-e/2,y:-n/2},{x:e/2,y:n/2}]}function CI(e,n){let t=e/2,o=n/2,r=n/11,i=(1-.551784)*r,s=a=>({x:a.x,y:-a.y}),l=[{x:t,y:o-r},{x:t,y:o-i},{x:.551784*t,y:o},{x:0,y:o},{x:-.551784*t,y:o},{x:-t,y:o-i},{x:-t,y:o-r}];l.push(l[6],{x:-t,y:r-o}),l.push(l[8]);for(let a=5;a>=0;a--)l.push(s(l[a]));return l.push(l[15],l[0],l[0]),l}function K4(e,n,t=0){let o=[{x:e/2,y:n/2},{x:-e/2,y:n/2},{x:-e/2,y:-n/2},{x:e/2,y:-n/2}],r=(Math.round(t/90)%4+4)%4,i=o[r];return[{x:i.x,y:i.y},{x:-i.x,y:i.y},{x:-i.x,y:-i.y},{x:i.x,y:-i.y}]}function q4(e,n,t){let{verts:o,xmax:r,ymax:i}=s2({x:n,y:t},{sides:e.sides,orientation:e.orientation,distortion:e.distortion,skew:e.skew},!1),s=r!==0?n/(2*r):1,l=i!==0?t/(2*i):1;return o.map(a=>({x:a.x*s,y:a.y*l}))}function _I(e,n,t){let o=[];for(let r=0;r<t;r++){let i=(t-1-r)*vt;o.push(...kI(e-2*i,n-2*i))}return o}function AI(e,n,t,o,r){if(t<=1||r===void 0){let a=[];for(let u=0;u<t;u++){let f=(t-1-u)*vt;a.push(...K4(e-2*f,n-2*f,o))}return a}let i=K4(r.w,r.h,o),s=gd(i,4),l=[i];for(let a=1;a<t;a++)l.push(i.map((u,f)=>({x:u.x+a*s[f].x,y:u.y+a*s[f].y})));return l.flat()}function GI(e,n,t){if(t<=1||n.base===void 0)return q4(e,n.w,n.h);let o=q4(e,n.base.w,n.base.h),r=gd(o,e.sides),i=[o];for(let s=1;s<t;s++)i.push(o.map((l,a)=>({x:l.x+s*r[a].x,y:l.y+s*r[a].y})));return i.flat()}function bd(e,n){let t=Math.PI/10,o=2*t,r=3*t,i=2*o,s=e,l=(1+Math.sin(r))/(2*Math.cos(t));n/s>l&&(s=n/l);let a=s/(2*Math.cos(t)),u=a*Math.cos(t)*Math.cos(i)/(Math.sin(i)*Math.cos(o)),f=a*(1-Math.sin(r))/2,d=[],c=t;for(let m=0;m<10;m+=2)d.push({x:a*Math.cos(c),y:a*Math.sin(c)-f}),c+=o,d.push({x:u*Math.cos(c),y:u*Math.sin(c)-f}),c+=o;return d}function MI(e,n){if(n<=1||e.base===void 0)return bd(e.w,e.h);let t=bd(e.base.w,e.base.h),o=gd(t,10),r=[t];for(let i=1;i<n;i++)r.push(t.map((s,l)=>({x:s.x+i*o[l].x,y:s.y+i*o[l].y})));return r.flat()}function Q4(e,n,t,o){let r=e.sides;if(e.option.shape===26)return CI(n,t);let i=Math.max(e.peripheries,1);return e.option.shape===27?MI({w:n,h:t,base:o},i):r<=2?_I(n,t,i):r===4&&Math.abs(e.orientation%90)<.5&&e.distortion===0&&e.skew===0?AI(n,t,i,e.orientation,o):GI(e,{w:n,h:t,base:o},i)}function Y(e,n,t){let o=e*n,r=134217729*e,i=r-(r-e),s=e-i,l=134217729*n,a=l-(l-n),u=n-a,f=i*a-o+i*u+s*a+s*u,d=o+t,c=d-o,m=o-(d-c)+(t-c);return d+(m+f)}function _a(e,n,t){return Y(-e,n,t)}var vt=4,LI=4*vt,II=2*vt,l2=1.4142135623730951,Ls=72;function OI(e){if(!e||e.toLowerCase()==="false"||e.toLowerCase()==="no")return!1;if(e.toLowerCase()==="true"||e.toLowerCase()==="yes")return!0;let n=parseInt(e,10);return!Number.isNaN(n)&&n!==0}function DI(e){if(e.isPlain)return{width:0,height:0};if(e.regular){if(e.userSizePts>0)return{width:e.userSizePts,height:e.userSizePts};let n=Ls*Math.min(e.widthIn,e.heightIn);return{width:n,height:n}}return{width:Ls*e.widthIn,height:Ls*e.heightIn}}function BI(e){if(e===void 0)return null;let n=parseFloat(e);if(Number.isNaN(n))return null;let t=e.indexOf(","),o=t>=0?parseFloat(e.slice(t+1)):NaN,r=Math.max(n,0);return{x:r,y:Number.isNaN(o)?r:Math.max(o,0)}}function FI(e,n,t){let o={x:e.x,y:e.y};if((o.x>0||o.y>0)&&!t){let r=BI(n);r?(o.x+=2*Ls*r.x,o.y+=2*Ls*r.y):(o.x+=LI,o.y+=II)}return o}function zI(e,n){if(n<=0)return e;let t=Ls*n;return{x:Math.ceil(e.x/t)*t,y:Math.ceil(e.y/t)*t}}function jI(e){let n=Math.PI/10,t=2*n,o=3*n,r=2*t,i=e.x/(2*Math.cos(n)),s=e.y/(Math.sin(n)+Math.sin(o)),a=Math.max(i,s)*Math.sin(r)*Math.cos(t)/(Math.cos(n)*Math.cos(r));return{x:2*a*Math.cos(n),y:a*(1+Math.sin(o))}}function HI(e){return{x:e.x,y:e.y*1.375}}function VI(e,n,t,o){let r={x:e.x,y:e.y},i=r.y*l2;if(t>i&&o==="c"?r.x*=Math.sqrt(1/(1-(r.y/t)**2)):(r.x*=l2,r.y=i),n>2){let s=Math.cos(Math.PI/n);r.x/=s,r.y/=s}return r}function UI(e,n,t,o){let r=e;if(n>1){let s=2*vt*(n-1);r={x:e.x+s,y:e.y+s}}let i=o?{x:r.x+t,y:r.y+t}:r;return{bb:r,outline:i}}function XI(e,n,t,o){let r={x:e.x*(t.skewdist+e.y*t.gdistortion)+e.y*t.gskew,y:e.y},i=n.orientation*Math.PI/180+Math.atan2(r.y,r.x),s=Math.sqrt(r.x*r.x+r.y*r.y);return{x:s*Math.cos(i)*o.x,y:s*Math.sin(i)*o.y}}function s2(e,n,t){let o=2*Math.PI/n.sides,r=Math.sin(o/2),i={skewdist:Math.hypot(Math.abs(n.distortion)+Math.abs(n.skew),1),gdistortion:n.distortion*l2/Math.cos(o/2),gskew:n.skew/2},s=(o-Math.PI)/2,l={x:.5*Math.cos(s),y:.5*Math.sin(s)};s+=(Math.PI-o)/2;let a=[];for(let u=0;u<n.sides;u++){s+=o,l.x=Y(r,Math.cos(s),l.x),l.y=Y(r,Math.sin(s),l.y);let f=XI(l,n,i,e);if(a.push(f),t){a.push({x:-f.x,y:f.y},{x:-f.x,y:-f.y},{x:f.x,y:-f.y});break}}return{verts:a,...$I(a)}}function $I(e){let n=0,t=0;for(let o of e)n=Math.max(Math.abs(o.x),n),t=Math.max(Math.abs(o.y),t);return{xmax:n,ymax:t}}function a2(e,n){let t=e[0],o=t;for(let r=1;r<n&&(o=e[(n-r)%n],!(o.x!==t.x||o.y!==t.y));r++);return{beta:Math.atan2(t.y-o.y,t.x-o.x),Qprev:o,sinx:0,cosx:0}}function u2(e,n,t,o){let r=e[t];if(r.x!==o.Qprev.x||r.y!==o.Qprev.y){let i=r;for(let u=1;u<n&&(i=e[(t+u)%n],!(i.x!==r.x||i.y!==r.y));u++);let s=o.beta;o.beta=Math.atan2(i.y-r.y,i.x-r.x);let l=(s+Math.PI-o.beta)/2,a=vt/Math.sin(l);o.sinx=Math.sin(s-l)*a,o.cosx=Math.cos(s-l)*a}o.Qprev=r}function gd(e,n){let t=a2(e,n),o=[];for(let r=0;r<n;r++)u2(e,n,r,t),o.push({x:t.cosx,y:t.sinx});return o}function Aa(e,n,t){let o=a2(e,n),r=[],i=t/2/vt;for(let s=0;s<n;s++){u2(e,n,s,o);let l=e[s];r.push({x:l.x+i*o.cosx,y:l.y+i*o.sinx})}return r}function WI(e,n,t,o){let r=a2(e,n),i={x:o.x,y:o.y},s={x:o.x,y:o.y};for(let l=0;l<n;l++){u2(e,n,l,r);let a=t.peripheries-1,u=e[l],f={x:u.x+a*r.cosx,y:u.y+a*r.sinx};i.x=Math.max(2*Math.abs(f.x),i.x),i.y=Math.max(2*Math.abs(f.y),i.y);let d=t.hasOutline?t.penwidth/2/vt:0,c={x:f.x+d*r.cosx,y:f.y+d*r.sinx};s.x=Math.max(2*Math.abs(c.x),s.x),s.y=Math.max(2*Math.abs(c.y),s.y)}return{bb:i,outline:{x:Math.max(s.x,i.x),y:Math.max(s.y,i.y)}}}function YI(e){let n=Math.PI/10,t=3*n,o=(1+Math.sin(t))/(2*Math.cos(n)),r=e;if(e.x>0){let i=e.y/e.x;i>o?r={x:e.y/o,y:e.y}:i<o&&(r={x:e.x,y:e.x*o})}return{verts:bd(e.x,e.y),xmax:r.x/2,ymax:r.y/2}}function JI(e,n,t,o,r){let i={sides:o,orientation:t.orientation,distortion:t.distortion,skew:t.skew},{verts:s,xmax:l,ymax:a}=t.optionShape===27?YI(e):s2(e,i,r),u=2*l,f=2*a,d={x:Math.max(n.x,u),y:Math.max(n.y,f)};if(!(t.peripheries>1||t.peripheries>=1&&t.penwidth>0))return{bb:d,outline:d,base:d};let m=d.x/u,b=d.y/f;for(let g of s)g.x*=m,g.y*=b;return{...WI(s,r?4:o,t,d),base:d}}function go(e,n,t){return t?{lw:n/2,rw:n/2,ht:e}:{lw:e/2,rw:e/2,ht:n}}function KI(e,n,t,o){let r;if(e.fixedsize==="shape")r={bb:{x:t,y:o},width:t,height:o,fixedshape:!0};else if(OI(e.fixedsize))r={bb:{x:t,y:o},width:t,height:o,fixedshape:!1};else{let i={x:Math.max(t,n.x),y:Math.max(o,n.y)};r={bb:i,width:i.x,height:i.y,fixedshape:!1}}if(e.regular){let i=Math.max(r.bb.x,r.bb.y);r={bb:{x:i,y:i},width:i,height:i,fixedshape:r.fixedshape}}return r}function Z4(e){let n=DI(e),t=zI(FI(e.labelDimen,e.margin,e.isPlain),e.quantumIn),{sides:o,isBox:r}=QI(e),i={x:t.x,y:t.y};r||(e.optionShape===27?i=jI(i):e.optionShape===26?i=HI(i):i=VI(i,o,n.height,eP(e)));let s=i,l=KI(e,i,n.width,n.height),a=e.penwidth??1,u=a>0||e.peripheries<1,f=o<3?{...UI(l.bb,e.peripheries,a,u),base:l.bb}:JI(l.bb,{x:l.width,y:l.height},{...e,penwidth:a,hasOutline:u},o,r);return{...ZI(e,t,f,l.fixedshape),...qI(e,t,l.bb,s,r,l.fixedshape)}}function qI(e,n,t,o,r,i){let s=n.x-e.labelDimen.x,l;e.nojustify?l=n.x-s:r?l=Math.max(n.x,t.x)-s:n.y<t.y?l=Math.max(n.x,t.x*Math.sqrt(1-n.y*n.y/(t.y*t.y)))-s:l=n.x-s;let a=i?n.y:n.y+(t.y-o.y);return{space:{x:l,y:a},valign:eP(e)}}function QI(e){let n=e.sides;n<=2&&(e.distortion!==0||e.skew!==0)&&(n=120);let t=n===4&&Math.abs(e.orientation%90)<.5&&e.distortion===0&&e.skew===0;return{sides:n,isBox:t}}function eP(e){let n=e.labelloc?.[0];return n==="t"||n==="b"?n:"c"}function ZI(e,n,t,o){return o?{...go(Math.max(n.x,t.bb.x),Math.max(n.y,t.bb.y),e.flip),outlineW:Math.max(n.x,t.outline.x),outlineH:Math.max(n.y,t.outline.y),baseW:t.base.x,baseH:t.base.y}:{...go(t.bb.x,t.bb.y,e.flip),outlineW:t.outline.x,outlineH:t.outline.y,baseW:t.base.x,baseH:t.base.y}}var Ga=1,nP=2,Ma=4,Pd=8,Is=16,Wr=1,Yr=2,Jr=4,Kr=8,eO=16,nO=8;function oP(){return{size:{x:0,y:0},b:{ll:{x:0,y:0},ur:{x:0,y:0}},n_flds:0,lp:null,fld:null,id:null,LR:0,sides:0}}function tO(e,n){if(e[n]!=="\\")return!1;let t=e[n+1];return t==="{"||t==="}"||t==="|"||t==="\\"}function oO(e){let n=1,t=0;for(let o=e.i;o<e.s.length;o++){if(tO(e.s,o)){o++;continue}let r=e.s[o];if(r==="{"?t++:r==="}"?t--:r==="|"&&t===0&&n++,t<0)break}return n}function rO(e,n){return n.mode&(Ma|nP)?-1:(n.mode|=nP|Is,e.i++,n.pbuf=[],n.hspIdx=0,0)}function iO(e,n){if(!(n.mode&Is))return-1;let t=n.pbuf;return t.length>1&&n.hspIdx!==t.length-1&&t[t.length-1]===" "&&t.pop(),n.tmpport=t.join(""),n.mode&=~Is,e.i++,0}function sO(e,n,t){if(e.i++,n.mode!==0||e.i>=e.s.length)return-1;n.mode=Ma;let o=f2(e,t?0:1,!1);return o===null?-1:(n.rv.fld[n.fi++]=o,n.fp=o,0)}function lO(e,n){if(n.mode&(Ga|Ma)||(n.mode|=Ga,n.tbuf.push(" ")),n.mode&Ga){let t=n.tbuf;t.length>1&&n.hstIdx!==t.length-1&&t[t.length-1]===" "&&t.pop(),n.fp.lp=Hn(t.join(""),!1,{fontname:e.lbl.fontname,fontsize:e.lbl.fontsize,fontcolor:e.lbl.fontcolor},e.measurer,e.obj),n.fp.LR=1,n.tbuf=[],n.hstIdx=0}}function aO(e,n,t){let o=e.i<e.s.length?e.s[e.i]:"";return o===""&&!t||n.mode&Is?-1:(n.mode&Ma||(n.fp=oP(),n.rv.fld[n.fi++]=n.fp),n.tmpport!==null&&(n.fp.id=n.tmpport,n.tmpport=null),lO(e,n),o!==""?o==="}"?(e.i++,n.rv.n_flds=n.fi,1):(n.mode=0,e.i++,0):(n.rv.n_flds=n.fi,1))}function uO(e,n){let t=e.s[e.i+1];t!==void 0&&(t<" "||(t===" "&&!e.lbl.html?n.ishardspace=!0:(n.tbuf.push("\\"),n.mode|=Pd|Ga)),e.i++)}function fO(e,n,t){let o=e.tbuf[e.tbuf.length-1]===" ";n===" "&&!e.ishardspace&&o&&!t||e.tbuf.push(n),e.ishardspace&&(e.hstIdx=e.tbuf.length-1)}function dO(e,n){let t=e.pbuf.length===0||e.pbuf[e.pbuf.length-1]===" ";n===" "&&!e.ishardspace&&t||e.pbuf.push(n),e.ishardspace&&(e.hspIdx=e.pbuf.length-1)}function yd(e,n,t){return n.mode&Ma&&t!==" "?-1:(!(n.mode&(Pd|Is))&&t!==" "&&(n.mode|=Pd|Ga),n.mode&Pd?fO(n,t,e.lbl.html):n.mode&Is&&dO(n,t),e.i++,0)}function cO(e,n,t,o){let r=e.s[e.i];switch(r){case"<":return e.lbl.html?yd(e,n,r):rO(e,n);case">":return e.lbl.html?yd(e,n,r):iO(e,n);case"{":return sO(e,n,t);case"}":case"|":case void 0:return aO(e,n,o);case"\\":return uO(e,n),yd(e,n,e.s[e.i]);default:return yd(e,n,r)}}function f2(e,n,t){let o=oP();o.fld=new Array(oO(e)),o.LR=n;let r={rv:o,fi:0,mode:0,tbuf:[],hstIdx:0,pbuf:[],hspIdx:0,tmpport:null,ishardspace:!1,fp:null};for(;;){if(e.i<e.s.length&&e.s[e.i]<" "&&e.s[e.i]!==""){e.i++;continue}let i=cO(e,r,n,t);if(i===-1)return null;if(i===1||e.i>e.s.length)break}return o.n_flds=r.fi,o}function pO(e,n,t){let o={x:t.lp.dimen.x,y:t.lp.dimen.y};if(o.x>0||o.y>0){let r=L(e,n,"margin"),i=r!==void 0?r.split(",").map(parseFloat):[];i.length>0&&!Number.isNaN(i[0])?(o.x+=2*i[0]*72,o.y+=2*(i.length>1&&!Number.isNaN(i[1])?i[1]:i[0])*72):(o.x+=eO,o.y+=nO)}return o}function rP(e,n,t){let o;if(t.lp)o=pO(e,n,t);else{o={x:0,y:0};for(let r=0;r<t.n_flds;r++){let i=rP(e,n,t.fld[r]);t.LR?(o.x+=i.x,o.y=Math.max(o.y,i.y)):(o.y+=i.y,o.x=Math.max(o.x,i.x))}}return t.size=o,o}function iP(e,n,t){let o={x:n.x-e.size.x,y:n.y-e.size.y};if(e.size=n,e.lp&&!t&&(e.lp.space.x+=o.x,e.lp.space.y+=o.y),e.n_flds){let r=e.LR?o.x/e.n_flds:o.y/e.n_flds;for(let i=0;i<e.n_flds;i++){let s=e.fld[i],l=Math.trunc((i+1)*r)-Math.trunc(i*r),a=e.LR?{x:s.size.x+l,y:n.y}:{x:n.x,y:s.size.y+l};iP(s,a,t)}}}function mO(e,n,t){return e.LR?n===0?n===t?Jr|Wr|Yr|Kr:Jr|Wr|Kr:n===t?Jr|Wr|Yr:Jr|Wr:n===0?n===t?Jr|Wr|Yr|Kr:Jr|Yr|Kr:n===t?Kr|Wr|Yr:Kr|Yr}function sP(e,n,t){e.sides=t,e.b={ll:{x:n.x,y:n.y-e.size.y},ur:{x:n.x+e.size.x,y:n.y}};let o=e.n_flds-1,r={x:n.x,y:n.y};for(let i=0;i<=o;i++){let s=t?mO(e,i,o):0;sP(e.fld[i],{x:r.x,y:r.y},t&s),e.LR?r.x+=e.fld[i].size.x:r.y-=e.fld[i].size.y}}function tP(e,n,t){let o=L(e,n,t);return!o||o.toLowerCase()==="false"||o.toLowerCase()==="no"?!1:o.toLowerCase()==="true"||o.toLowerCase()==="yes"?!0:parseInt(o,10)!==0}function xO(e,n){let t=L(e,n,"width"),o=L(e,n,"height");return{x:(t!==void 0?parseFloat(t):.75)*72,y:(o!==void 0?parseFloat(o):.5)*72}}function hO(e,n,t,o){let r={s:e.text,i:0,lbl:e,measurer:n,obj:o},i=f2(r,t,!0);return i!==null?i:f2({s:"\\N",i:0,lbl:e,measurer:n,obj:o},t,!0)}function d2(e,n,t){let o=e.info.label,r=((n.root.info.rankdir??0)>>2&1)===1?0:1,i=hO(o,t,r,e);rP(e,n,i);let s=xO(e,n);tP(e,n,"fixedsize")||(s.x=Math.max(i.size.x,s.x),s.y=Math.max(i.size.y,s.y)),iP(i,s,tP(e,n,"nojustify")),sP(i,{x:-s.x/2,y:s.y/2},Wr|Yr|Jr|Kr),e.info.width=i.size.x/72,e.info.height=(i.size.y+1)/72;let l=go(i.size.x,i.size.y+1,n.root.info.flip===!0);e.info.lw=l.lw,e.info.rw=l.rw,e.info.ht=l.ht,e.info.shape_info=i}function c2(e,n,t){let o=L(e,n,"label")??e.name,{fontname:r,fontsize:i,fontcolor:s}=La(e,n);e.info.label=xd(o,r,i,s,t)}function lP(e,n,t){c2(e,n,t),d2(e,n,t)}function aP(e,n,t){let o=e.renderer,r=n.info.coord??{x:0,y:0};if(t.lp){let i={x:(t.b.ll.x+t.b.ur.x)/2+r.x,y:(t.b.ll.y+t.b.ur.y)/2+r.y};p2(t.lp,i,o,e)}for(let i=0;i<t.n_flds;i++)i>0&&bO(e,r,t,t.fld[i]),aP(e,n,t.fld[i])}function bO(e,n,t,o){let r={x:0,y:0},i={x:0,y:0};t.LR?(r.x=o.b.ll.x,r.y=o.b.ll.y,i.x=r.x,i.y=o.b.ur.y):(i.x=o.b.ur.x,i.y=o.b.ur.y,r.x=o.b.ll.x,r.y=i.y);let s=[K({x:r.x+n.x,y:r.y+n.y},e),K({x:i.x+n.x,y:i.y+n.y},e)];e.renderer.polyline(s,e)}function uP(e,n){let t=e,o=n;if(!t.renderer)return;let r=o.info.shape_info;if(!r)return;let i=o.info.coord??{x:0,y:0},s={x:r.b.ll.x+i.x,y:r.b.ll.y+i.y},l={x:r.b.ur.x+i.x,y:r.b.ur.y+i.y},a=t.obj!==null&&m2(t.obj,o,t);gO(t,o,s,l,a),aP(t,o,r)}function gO(e,n,t,o,r){if(L(n,n.root,"shape")==="Mrecord"||ce(L(n,n.root,"style")).rounded){let a=[{x:t.x,y:t.y},{x:o.x,y:t.y},{x:o.x,y:o.y},{x:t.x,y:o.y}];bo(a,{x:0,y:0},r,{renderer:e.renderer,job:e});return}let l=[{x:t.x,y:t.y},{x:t.x,y:o.y},{x:o.x,y:o.y},{x:o.x,y:t.y}].map(a=>K(a,e));e.renderer.polygon(l,r,e)}var yO=27,PO=27,EO=36;function L(e,n,t){let o=e.attrs.get(t);return o!==void 0?o:e.nodeDefaultsSnapshot!==void 0?e.nodeDefaultsSnapshot.get(t):n.nodeDefaults.get(t)??(n!==n.root?n.root.nodeDefaults.get(t):void 0)}function La(e,n){return{fontname:L(e,n,"fontname")??Gs,fontsize:parseFloat(L(e,n,"fontsize")??String(As)),fontcolor:L(e,n,"fontcolor")??Ms}}function Ed(e,n){let t=e.info.width!==void 0?e.info.width*72:(e.info.lw||yO)+(e.info.rw||PO),o=e.info.height!==void 0?e.info.height*72:e.info.ht||EO,r=e.info.base_width!==void 0&&e.info.base_height!==void 0?{w:e.info.base_width*72,h:e.info.base_height*72}:void 0;e.info.shape_info={...n,vertices:Q4(n,t,o,r)}}function x2(e,n,t){if(e.info.label!==void 0)return;let o=L(e,n,"label"),r=La(e,n),i=o!==void 0&&Sn(o),s=i?wn(o):o??e.name;e.info.label=Hn(s,i,r,t,e)}function fP(e,n,t){let o=L(e,n,"shape")??"ellipse",r=L(e,n,"shapefile");if(e.info.shape=vd(o,r),r!==void 0&&r!==""&&o!=="epsf"&&console.error(`Warning: No or improper shapefile="${r}" for node "${e.name}"`),e.info.shape.kind===2){e.info.shape_info===void 0&&lP(e,n,t);return}if(x2(e,n,t),e.info.shape_info!==void 0)return;let i=e.info.shape.polygon;i!==null&&Ed(e,i)}var Os=.5;function yo(e,n){return(e*(e*n[0]+n[1])+n[2])/(e+n[3])}var vO=[[[3.85268,-21.229,-.330434,.0127842],[-1.61486,.706564,.225945,.263682],[-.910164,.388383,.00551445,.00671814],[-.630184,.192402,.0098871,.0102527]],[[-.162211,9.94329,.13723,.0124084],[-.253135,.00187735,.0230286,.01264],[-.0695069,-.0437594,.0120636,.0163087],[-.0328856,-.00926032,-.00173573,.00527385]]],SO=[[[.0899116,-19.2349,-4.11711,.183362],[.138148,-1.45804,1.32044,1.38474],[.230903,-.450262,.219963,.414038],[.0590565,-.101062,.0430592,.0204699]],[[.0164649,9.89394,.0919496,.00760802],[.0191603,-.0322058,.0134667,-.0825018],[.0156192,-.017535,.00326508,-.228157],[-.0236752,.0405821,-.0173086,.176187]]],wO=[.001,4.98,.207,.0067];function NO(e,n,t,o){let r=.5*(t+o),i=n/e,s=o-t,l=Math.cos(2*r),a=Math.cos(4*r),u=Math.cos(6*r),f=i<.25?vO:SO,d=yo(i,f[0][0])+l*yo(i,f[0][1])+a*yo(i,f[0][2])+u*yo(i,f[0][3]),c=yo(i,f[1][0])+l*yo(i,f[1][1])+a*yo(i,f[1][2])+u*yo(i,f[1][3]);return yo(i,wO)*e*Math.exp(d+c*s)}function RO(e,n,t,o,r){let i=t;for(let s=0;s<o;s++){if(NO(e,n,i,i+r)>1e-5)return!1;i+=r}return!0}function TO(e,n,t,o){let r=1;for(;r<1024;){let i=(o-t)/r;if(i<=.5*Math.PI&&RO(e,n,t,r,i))break;r<<=1}return r}function kO(e,n,t){let o=Math.cos(t),r=Math.sin(t),i=n.cx+n.xsemi*o,s=n.cy+n.ysemi*r;return e.push({x:n.cx,y:n.cy},{x:n.cx,y:n.cy},{x:i,y:s},{x:i,y:s}),{xB:i,yB:s,xBDot:-n.xsemi*r,yBDot:n.ysemi*o}}function CO(e,n,t,o){let r=n.xB,i=n.yB,s=n.xBDot,l=n.yBDot,a=o.etaB+o.dEta,u=Math.cos(a),f=Math.sin(a);return n.xB=t.cx+t.xsemi*u,n.yB=t.cy+t.ysemi*f,n.xBDot=-t.xsemi*f,n.yBDot=t.ysemi*u,e.push({x:r+o.alpha*s,y:i+o.alpha*l}),e.push({x:n.xB-o.alpha*n.xBDot,y:n.yB-o.alpha*n.yBDot}),e.push({x:n.xB,y:n.yB}),a}function _O(e,n,t){let o=2*Math.PI,r=Math.atan2(Math.sin(n)/e.ysemi,Math.cos(n)/e.xsemi),i=Math.atan2(Math.sin(t)/e.ysemi,Math.cos(t)/e.xsemi);i-=o*Math.floor((i-r)/o),t-n>Math.PI&&i-r<Math.PI&&(i+=o);let s=TO(e.xsemi,e.ysemi,r,i),l=(i-r)/s,a=Math.tan(.5*l),u=Math.sin(l)*(Math.sqrt(4+3*a*a)-1)/3,f=[],d=kO(f,e,r),c={etaB:r,dEta:l,alpha:u};for(let m=0;m<s;m++)c={...c,etaB:CO(f,d,e,c)};return f.push({x:d.xB,y:d.yB},{x:e.cx,y:e.cy},{x:e.cx,y:e.cy}),f}function AO(e,n,t){let o=2*Math.PI,r=e.isLast?o:e.angle0+o*e.t,i=t.job.obj;i!==null&&(i.fillColor=X(e.color));let s=_O(n,e.angle0,r);return t.renderer.bezier(s.map(l=>({x:l.x,y:-l.y})),!0,t.job),r}function dP(e,n,t,o){let{segs:r,error:i}=nt(t);if(i===1||i===2)return i;let s=(n[0].x+n[1].x)/2,l=(n[0].y+n[1].y)/2,a={cx:s,cy:-l,xsemi:n[1].x-s,ysemi:Math.abs(n[1].y-l)},u={job:e,renderer:o},f=e.obj,d=f!==null?f.penWidth:1;f!==null&&d>Os&&(f.penWidth=Os);let c=0;for(let m=0;m<r.length;m++){let b=r[m];if(b.color===null)break;b.t>0&&(c=AO({angle0:c,t:b.t,isLast:m+1===r.length,color:b.color},a,u))}return f!==null&&d>Os&&(f.penWidth=d),i}function GO(e,n,t){let o=t.job.obj;o!==null&&(o.fillColor=X(n.color)),e[1].x=e[2].x=n.isLast?n.lastx:e[0].x+n.segWidth,t.renderer.polygon([...e],!0,t.job),e[0].x=e[3].x=e[1].x}function cP(e,n,t,o,r){let{segs:i,error:s}=nt(t);if(s===1||s===2)return s;let l=o?[{...n[2]},{...n[3]},{...n[0]},{...n[1]}]:[{...n[0]},{...n[1]},{...n[2]},{...n[3]}],a=l[1].x,u=l[1].x-l[0].x;l[1].x=l[2].x=l[0].x;let f={job:e,renderer:r},d=e.obj,c=d!==null?d.penWidth:1;d!==null&&c>Os&&(d.penWidth=Os);for(let m=0;m<i.length;m++){let b=i[m];if(b.color===null)break;b.t>0&&GO(l,{color:b.color,isLast:m+1===i.length,segWidth:u*b.t,lastx:a},f)}return d!==null&&c>Os&&(d.penWidth=c),s}var MO=new RegExp('"',"g"),LO=new RegExp("'","g"),IO=/&(?![A-Za-z]+;|#[0-9]+;|#x[0-9A-Fa-f]+;)/g;function Je(e){let n=e.replace(IO,"&amp;");return n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(MO,"&quot;"),n=n.replace(LO,"&#39;"),n}function Ke(e){let n=Je(e);return n=n.replace(/-/g,"&#45;"),n=n.replace(/ {2,}/g,t=>" "+"&#160;".repeat(t.length-1)),n}function h2(e){let n=Je(e);return n=n.replace(/-/g,"&#45;"),n=n.replace(/\n/g,"&#10;"),n=n.replace(/\r/g,"&#13;"),n=n.replace(/ {2,}/g,t=>" "+"&#160;".repeat(t.length-1)),n}function OO(e,n){e.fill=n.kind==="radial"?3:2,e.fillColor=X(n.fillColor),e.stopColor=X(n.stopColor),e.gradientFrac=n.frac,e.gradientAngle=n.angle}function Tn(e,n){for(let t=e;t!==null;t=t.parent){let o=t.attrs.get(n);if(o!==void 0)return o}}function Sd(e){return Tn(e,"style")}function b2(e){let n=Tn(e,"peripheries");if(n===void 0||n.length===0)return 1;let t=parseInt(n,10);return Number.isNaN(t)?1:t<0?0:t}function DO(e,n){let t=ce(Sd(n)),o=Tn(n,"pencolor")??Tn(n,"color");e.penColor=b2(n)===0?X("transparent"):X(Ps(o)),e.penWidth=Xt(t,Tn(n,"penwidth")),e.pen=ys(t)}function BO(e){return{style:Sd(e),color:Tn(e,"color"),pencolor:Tn(e,"pencolor"),fillcolor:Tn(e,"fillcolor"),bgcolor:Tn(e,"bgcolor"),penwidth:Tn(e,"penwidth"),gradientangle:Tn(e,"gradientangle")}}function pP(e,n){let t=Z3(BO(e));if(n.obj===null)return!1;let o=n.obj;return Ur(Tn(e,"colorscheme"),()=>(DO(o,e),t.kind==="none"?(o.fill=0,!1):t.kind==="solid"?(o.fill=1,o.fillColor=X(t.color),!0):(OO(o,t),!0)))}function wd(e,n){return n!==void 0&&n.length>0?'class="'+e+" "+Ke(n)+'"':'class="'+e+'"'}function qr(e,n){return n.objId(e.attrs.get("id"),"node"+(e.id+1))}function Oa(e,n){return n.objId(e.attrs.get("id"),"edge"+e.graphSeq)}function Ds(e,n){return n.objId(e.attrs.get("id"),"clust"+e.seq)}function Da(e,n){return n.objId(e.attrs.get("id"),"graph0",!0)}function mP(e){return wd("node",L(e,e.root,"class"))}function xP(e){return wd("edge",e.attrs.get("class"))}function hP(e){return wd("cluster",Tn(e,"class"))}function bP(e){return wd("graph",e.attrs.get("class"))}function FO(e){return e.includes(":")}function gP(e,n,t,o,r){let i=Math.abs((e[1].x-e[0].x)/2),s=Math.abs((e[1].y-e[0].y)/2),l=K(n,o);t.ellipse(l,i,s,r,o)}function PP(e,n,t,o,r){let i=e.map(s=>K({x:s.x+n.x,y:s.y+n.y},o));t.polygon(i,r,o)}function zO(e,n,t,o,r){if(r.style.wedged&&o===0&&FO(r.fillcolor)){let i=e.map(s=>K({x:s.x+n.x,y:s.y+n.y},r.job));dP(r.job,i,r.fillcolor,r.renderer),gP(e,n,r.renderer,r.job,!1)}else gP(e,n,r.renderer,r.job,t);r.diagonals&&V3(e,n,r)}function jO(e,n,t){let o=e.map(r=>K({x:r.x+n.x,y:r.y+n.y},t.job));cP(t.job,o,t.fillcolor,!0,t.renderer),PP(e,n,t.renderer,t.job,!1)}function HO(e,n,t,o,r){r.style.striped&&o===0?jO(e,n,r):r.underline?U3(e,n,t,r):r.shape!==0&&r.shape!==27||r.diagonals||r.rounded?H3(e,n,t,r):PP(e,n,r.renderer,r.job,t)}function VO(e,n,t,o){let r=e.sides<=2?2:e.sides,i=e.vertices;for(let s=0;s<e.peripheries;s++){let l=i.slice(s*r,(s+1)*r);if(l.length<r)break;let a=s===0?t:!1;e.sides<=2?zO(l,n,a,s,o):HO(l,n,a,s,o)}}function p2(e,n,t,o){if(e.u.kind!=="txt"||e.u.nspans<1)return;e.pos=n,e.set=!0;let s=e.valign===116?n.y+e.space.y/2-e.fontsize:e.valign===98?n.y-e.space.y/2+e.dimen.y-e.fontsize:n.y+e.dimen.y/2-e.fontsize;for(let l=0;l<e.u.nspans;l++){let a=e.u.span[l],u=a.just==="l"?n.x-e.space.x/2:a.just==="r"?n.x+e.space.x/2:n.x;hs(t,{x:u,y:s},a,o),s-=a.size.y}}function UO(e,n,t,o){let r=e.info.label;if(r!==void 0)if(r.html&&r.u.kind==="html"){r.pos=n,r.set=!0;let i=r.u.html;Jf(o,()=>Na(i,n,t,o))}else p2(r,n,t,o)}function Nd(e,n){let t=L(e,e.root,n);return t!==void 0&&t!==""?t:void 0}function XO(e,n){return n!==void 0?er(hd(n),e):e.info.label?.text??""}function yP(e,n,t){let o=Nd(e,"href")??Nd(e,"URL"),r=Nd(e,"tooltip");return o===void 0&&r===void 0?!1:(n.beginAnchor?.(o!==void 0?er(o,e):"",XO(e,r),Nd(e,"target")??"",qr(e,t),t),!0)}function $O(e,n){e.fill=n.kind==="radial"?3:2,e.fillColor=X(n.fillColor),e.stopColor=X(n.stopColor),e.gradientFrac=n.frac,e.gradientAngle=n.angle}function Rd(e){return e.info.shape?.kind===3}function WO(e){let n=L(e,e.root,"fillcolor");if(n!==void 0&&n!=="")return n;let t=L(e,e.root,"color");return t!==void 0&&t!==""?t:"black"}function YO(e,n,t){if(e.id=qr(n,t),Rd(n))return e.fill=1,e.fillColor=X(WO(n)),!0;let o=Q3({style:L(n,n.root,"style"),fillcolor:L(n,n.root,"fillcolor"),color:L(n,n.root,"color"),gradientangle:L(n,n.root,"gradientangle")});return o.kind==="none"?(e.fill=0,!1):o.kind==="solid"?(e.fill=1,e.fillColor=X(o.color),!0):($O(e,o),!0)}function JO(e,n,t,o){let r=ce(n);e.penColor=X(Ps(t)),e.pen=ys(r),e.penWidth=Xt(r,o),e.rawStyle=td(n)}function m2(e,n,t){let o=L(n,n.root,"style"),r=L(n,n.root,"color");return Ur(L(n,n.root,"colorscheme"),()=>{let i=YO(e,n,t);return JO(e,o,r,L(n,n.root,"penwidth")),i})}function KO(e,n,t){return e.peripheries!==0||!n?e:(t.penColor={type:"string",s:"transparent"},{...e,peripheries:1})}function qO(e,n){let t=e.info;if(n.vertices==null||t.width===void 0||t.height===void 0)return n;let o=(t.lw+t.rw)/(t.width*72),r=t.ht/(t.height*72);return Math.abs(o-1)<1e-9&&Math.abs(r-1)<1e-9?n:{...n,vertices:n.vertices.map(i=>({x:i.x*o,y:i.y*r}))}}function QO(e,n){let t=n.info.shape_info;if(t===void 0||t.vertices===void 0)return null;let o=qO(n,t),r=n.info.coord??{x:0,y:0},i=e.obj,s=i!==null&&m2(i,n,e),l=i!==null?KO(o,s,i):o,a=ce(L(n,n.root,"style")),u={renderer:e.renderer,job:e,style:a,fillcolor:L(n,n.root,"fillcolor")??"",...ZO(l.option,a)};return{poly:l,coord:r,filled:s,ringCtx:u}}function ZO(e,n){return{shape:e.shape,diagonals:e.diagonals||n.diagonals,rounded:e.rounded||n.rounded,underline:e.underline||n.underline}}function EP(e,n){let t=e,o=n,r=t.renderer;if(!r)return;let i=QO(t,o);if(i===null)return;let s=(t.flags&xo)!==0,l=t.obj?.urlMapShape,a=t.obj?.urlMapPts,u=s?!1:yP(o,r,t);VO(i.poly,i.coord,i.filled,i.ringCtx),Rd(o)||UO(o,i.coord,r,t),s&&(t.obj&&a!==void 0&&l!==void 0&&(t.obj.urlMapShape=l,t.obj.urlMapPts=a),u=yP(o,r,t)),u&&r.endAnchor?.(t)}function Ba(e,n,t,o){let r=-(o.y-t.y),i=o.x-t.x,s=r*t.x+i*t.y,l=r*e.x+i*e.y-s>=0,a=r*n.x+i*n.y-s>=0;return l===a}function eD(e){let n=0,t=0;for(let o of e.vertices??[])n=Math.max(n,Math.abs(o.x)),t=Math.max(t,Math.abs(o.y));return{w:2*n,h:2*t}}function nD(e,n,t,o){if(n.option.fixedshape){let{w:s,h:l}=eD(n);return{w:s,h:l,ow:s,oh:l}}let r=72*(e.info.width||t/72),i=72*(e.info.height||o/72);return{w:r,h:i,ow:72*e.info.outline_width||r,oh:72*e.info.outline_height||i}}function tD(e,n){let t=e.root.info.flip===!0,o=e.info.lw+e.info.rw,r=t?e.info.ht:o,i=t?o:e.info.ht,{w:s,h:l,ow:a,oh:u}=nD(e,n,r,i);return{scalex:r!==0?s/r:s,scaley:i!==0?l/i:l,boxURx:a/2,boxURy:u/2}}function oD(e,n,t){let o={x:0,y:0},r=0,i=1%t,s=n[r],l=n[i];if(!Ba(e,o,s,l))return!1;let a=Ba(e,s,l,o);if(a&&Ba(e,l,o,s))return!0;for(let u=1;u<t;u++)if(a?(r=i,i=(r+1)%t):(i=r,r=(r+t-1)%t),!Ba(e,o,n[r],n[i]))return!1;return!0}function rD(e,n,t){let o=tD(e,n),r={x:t.x*o.scalex,y:t.y*o.scaley};if(Math.abs(r.x)>o.boxURx||Math.abs(r.y)>o.boxURy)return!1;if(n.sides<=2)return Math.hypot(r.x/o.boxURx,r.y/o.boxURy)<1;let i=(Math.max(n.peripheries,1)-1)*n.sides,s=n.vertices.slice(i,i+n.sides),l=Aa(s,n.sides,n.penwidth??1);return oD(r,l,n.sides)}function vP(e,n){let t=e.node;if(t===void 0)return!1;let o=(t.root.info.rankdir??0)&3,r=o===0?n:Yo(n,o*90);if(e.bp){let s=e.bp;return r.x>=s.ll.x&&r.x<=s.ur.x&&r.y>=s.ll.y&&r.y<=s.ur.y}let i=t.info.shape_info;return i===void 0||i.vertices===null?!1:rD(t,i,r)}function SP(e,n){let t=e.node;if(t===void 0)return!1;let o=(t.root.info.rankdir??0)&3,r=o===0?n:Yo(n,o*90);if(e.bp){let c=e.bp;return r.x>=c.ll.x&&r.x<=c.ur.x&&r.y>=c.ll.y&&r.y<=c.ur.y}let i=t.info.shape_info;if(i===void 0||i.vertices===null)return!1;let s=i.sides,l=(Math.max(i.peripheries,1)-1)*s,a=i.vertices.slice(l,l+s),u=Aa(a,s,i.penwidth??1),f={x:0,y:0},d=0;for(let c=0;c<s;c+=2){let m=u[c],b=u[(c+4)%s];if(Ba(r,f,m,b)||d++,d===2)return!1}return!0}function wP(e,n){let t=e.node;if(t===void 0)return!1;let o=(t.root.info.rankdir??0)&3,r=o===0?n:Yo(n,o*90),i;if(e.bp)i=e.bp;else{let l=t.info.shape_info;if(!l?.b)return!1;i=l.b}let s=.5;return r.x>=i.ll.x-s&&r.x<=i.ur.x+s&&r.y>=i.ll.y-s&&r.y<=i.ur.y+s}var U=1,B=0,tn=4,NP=3,ei=256;function Qr(e,n){e.list[e.size++]=n}function Zr(e,n){let t=0;for(;t<e.size&&e.list[t]!==n;)t++;t<e.size&&(e.list[t]=e.list[--e.size],e.list[e.size]=void 0)}function it(e){e.tail.info.out&&Zr(e.tail.info.out,e),e.head.info.in&&Zr(e.head.info.in,e)}function Fa(e){e.tail.info.out||(e.tail.info.out={list:[],size:0}),e.head.info.in||(e.head.info.in={list:[],size:0}),Qr(e.tail.info.out,e),Qr(e.head.info.in,e)}function St(e,n){let t=e.info.out,o=n.info.in;if(!(t===void 0||o===void 0)){if(t.size<=o.size){for(let r=0;r<t.size;r++)if(t.list[r].head===n)return t.list[r]}else for(let r=0;r<o.size;r++)if(o.list[r].tail===e)return o.list[r]}}function Td(e){let n=e.bp!==null?{ll:{x:e.bp.ll.x,y:e.bp.ll.y},ur:{x:e.bp.ur.x,y:e.bp.ur.y}}:null;return{p:{x:e.p.x,y:e.p.y},theta:e.theta,bp:n,defined:e.defined,constrained:e.constrained,clip:e.clip,dyna:e.dyna,order:e.order,side:e.side,name:e.name}}function iD(e,n){e.tail===n.tail?e.info.tail_port=Td(n.info.tail_port):e.tail===n.head&&(e.info.tail_port=Td(n.info.head_port)),e.head===n.head?e.info.head_port=Td(n.info.head_port):e.head===n.tail&&(e.info.head_port=Td(n.info.tail_port))}function sD(e,n){e.info.count=n.info.count,e.info.xpenalty=n.info.xpenalty,e.info.weight=n.info.weight,e.info.minlen=n.info.minlen,iD(e,n),e.info.label=n.info.label,e.info.head_label=n.info.head_label,e.info.tail_label=n.info.tail_label,e.info.xlabel=n.info.xlabel,n.info.to_virt===void 0&&(n.info.to_virt=e),e.info.to_orig=n,e.seq=n.seq}function ni(e,n,t){let o=new Ae(e,n,"");return o.info.edge_type=U,t?sD(o,t):(o.info.weight=1,o.info.xpenalty=1,o.info.count=1,o.info.minlen=1),o}function Be(e,n,t){let o=ni(e,n,t);return Fa(o),o}function lD(e,n,t,o){e.info.weight=(e.info.weight??0)+n,e.info.minlen=Math.max(e.info.minlen??1,t),e.info.count=(e.info.count??1)+1,e.info.xpenalty=(e.info.xpenalty??0)+o}function aD(e,n){let t=e.info.weight??1,o=e.info.minlen??1,r=e.info.xpenalty??0;for(let i=n;i!==void 0;i=i.info.to_virt)lD(i,t,o,r)}function kn(e,n){e.info.to_virt===void 0&&(e.info.to_virt=n,aD(e,n))}function za(e){e.info.to_virt=void 0,e.tail.info.flat_out&&Zr(e.tail.info.flat_out,e),e.head.info.flat_in&&Zr(e.head.info.flat_in,e)}function nr(e,n){n.tail.info.flat_out||(n.tail.info.flat_out={list:[],size:0}),n.head.info.flat_in||(n.head.info.flat_in={list:[],size:0}),Qr(n.tail.info.flat_out,n),Qr(n.head.info.flat_in,n),e.info.has_flat_edges=!0}function kd(e,n){let t=e.info.flat_out,o=n.info.flat_in;if(!(t===void 0||o===void 0)){if(t.size<=o.size){for(let r=0;r<t.size;r++)if(t.list[r].head===n)return t.list[r]}else for(let r=0;r<o.size;r++)if(o.list[r].tail===e)return o.list[r]}}function Cd(e){it(e),e.info.reversed=!0;let n=St(e.head,e.tail);n!==void 0?kn(e,n):Be(e.head,e.tail,e)}function ja(e,n){n.info.next=e.info.nlist,e.info.nlist!==void 0&&(e.info.nlist.info.prev=n),n.info.prev=void 0,e.info.nlist=n}function tr(e,n){n.info.prev!==void 0?n.info.prev.info.next=n.info.next:e.info.nlist=n.info.next,n.info.next!==void 0&&(n.info.next.info.prev=n.info.prev)}function RP(e,n){let t=n.info.rank!==void 0?n.info.rank:0,o=e.info.rank;if(o===void 0)return;let r=o[t];for(let i=0;i<r.n;i++)if(r.v[i]===n){for(i++;i<r.n;i++)r.v[i-1]=r.v[i];r.n--;break}}function bn(e){let n=new We(0,"",e.root);return n.info.node_type=U,n.info.lw=1,n.info.rw=1,n.info.ht=1,n.info.UF_size=1,n.info.in={list:[],size:0},n.info.out={list:[],size:0},ja(e,n),n}function ti(e){e.tail.info.other||(e.tail.info.other={list:[],size:0}),Qr(e.tail.info.other,e)}function M(e){return[...e.nodes.values()].sort((n,t)=>n.id-t.id)}function Fe(e){for(;e.info.UF_parent!==void 0&&e.info.UF_parent!==e;){let n=e.info.UF_parent.info.UF_parent;n!==void 0&&(e.info.UF_parent=n),e=e.info.UF_parent}return e}function Ha(e,n){if(e===n||(e.info.UF_parent===void 0?(e.info.UF_parent=e,e.info.UF_size=1):e=Fe(e),n.info.UF_parent===void 0?(n.info.UF_parent=n,n.info.UF_size=1):n=Fe(n),e===n))return e;let t=e.info.UF_size??0,o=n.info.UF_size??0;return n.info.UF_parent=e,e.info.UF_size=t+o,e}function Ad(e){e.info.UF_size=1,e.info.UF_parent=void 0,e.info.ranktype=0}function TP(e,n){e.info.UF_parent=n,n.info.UF_size=(n.info.UF_size??0)+(e.info.UF_size??0)}function _d(e,n,t,o){if(!(!n||n.size===0))for(let r=n.size-1;r>=0;r--){let i=n.list[r],s=i.head===t?i.tail:i.head;s.info.mark!==o&&s===Fe(s)&&(s.info.mark=o+1,e.push(s))}}function uD(e,n,t){let o=[],r;n.info.mark=t+1,o.push(n),e.info.nlist=void 0;let i;for(;(i=o.pop())!==void 0;)i.info.mark!==t&&(i.info.mark=t,r!==void 0?(i.info.prev=r,r.info.next=i):(i.info.prev=void 0,e.info.nlist=i),r=i,i.info.next=void 0,_d(o,i.info.flat_in,i,t),_d(o,i.info.flat_out,i,t),_d(o,i.info.in,i,t),_d(o,i.info.out,i,t))}var g2={cmark:0};function fD(e,n){if(n>0){let t=e.info.clust;if(t)return t.info.rankleader?.[e.info.rank??0]}return e===Fe(e)?e:void 0}function Va(e,n){++g2.cmark===0&&(g2.cmark=1);let t=g2.cmark;e.info.comp=[];for(let o of M(e)){let r=fD(o,n);r!==void 0&&r.info.mark!==t&&(uD(e,r,t),e.info.comp.push(e.info.nlist))}}var y2=.995;function Gd(e,n,t){if(n>=e.nrows||t>=e.ncols)return!1;let o=n*e.ncols+t;return(e.data[o>>3]>>(o&7)&1)===1}function Md(e,n,t){(n>=e.nrows||t>=e.ncols)&&dD(e,n,t);let o=n*e.ncols+t;e.data[o>>3]|=1<<(o&7)}function kP(e,n,t){for(let o=0;o<e.nrows;o++)for(let r=0;r<e.ncols;r++){if(!Gd(e,o,r))continue;let i=o*t+r;n[i>>3]|=1<<(i&7)}}function dD(e,n,t){let o=Math.max(e.nrows,n+1),r=Math.max(e.ncols,t+1),i=o*r,s=(i>>3)+(i&7?1:0),l=new Uint8Array(s);kP(e,l,r),e.nrows=o,e.ncols=r,e.data=l}function P2(e,n){let t=e*n,o=(t>>3)+(t&7?1:0);return{nrows:e,ncols:n,data:new Uint8Array(o)}}function W(e){return e.info.dotroot??e.root}function or(e,n){return e.nodes.get(n.name)===n}function Ld(e,n){return e.edges.includes(n)}function oe(e,n){return e.v[(e.vStart??0)+n]}function E2(e,n,t){e.v[(e.vStart??0)+n]=t}function v2(e,n){return n.info.node_type===B&&or(e,n)}function S2(e,n){if(n.info.node_type!==U)return!1;let t=n.info.in?n.info.in.size:0,o=n.info.out?n.info.out.size:0;if(t!==1||o!==1)return!1;let r=n.info.out.list[0];for(;r.info.edge_type!==B&&r.info.to_orig;)r=r.info.to_orig;return Ld(e,r)}function Id(e,n){return v2(e,n)||S2(e,n)}function CP(e,n,t){let o=e.root.info.rank?.[n.info.rank??0];if(!o)return;let r=n.info.order??0;return(t<0?r>0?o.v[r-1]:void 0:o.v[r+1])??void 0}function Od(e,n,t,o){let r=t,i=t;for(;(i=CP(e,i,o))!==void 0;)(v2(n,i)||S2(n,i))&&(r=i);return r}function Bs(e,n,t){let o=e.x-n.x,r=e.y-n.y;return o*o+r*r<t*t}function w2(e,n,t,o){let r={x:e[0].x+n*(e[1].x-e[0].x),y:e[0].y+n*(e[1].y-e[0].y)},i={x:e[1].x+n*(e[2].x-e[1].x),y:e[1].y+n*(e[2].y-e[1].y)},s={x:e[2].x+n*(e[3].x-e[2].x),y:e[2].y+n*(e[3].y-e[2].y)},l={x:r.x+n*(i.x-r.x),y:r.y+n*(i.y-r.y)},a={x:i.x+n*(s.x-i.x),y:i.y+n*(s.y-i.y)},u={x:l.x+n*(a.x-l.x),y:l.y+n*(a.y-l.y)};return t!==null&&(t[0]=e[0],t[1]=r,t[2]=l,t[3]=u),o!==null&&(o[0]=u,o[1]=a,o[2]=s,o[3]=e[3]),u}var Dd=2,cD=1e-10;function _P(e,n,t){let o=n.x-e.x,r=n.y-e.y,i=(t.y-e.y)*o-(t.x-e.x)*r;return i*=i,i<cD?0:i/(o*o+r*r)}function pD(e){let n=_P(e[0],e[3],e[1]),t=_P(e[0],e[3],e[2]);return n<Dd*Dd&&t<Dd*Dd}function mD(e,n){return n.some(t=>t.x>e.ur.x||t.x<e.ll.x||t.y>e.ur.y||t.y<e.ll.y)}function xD(e,n){for(let t of n)t.x>e.ur.x?e.ur.x=t.x:t.x<e.ll.x&&(e.ll.x=t.x),t.y>e.ur.y?e.ur.y=t.y:t.y<e.ll.y&&(e.ll.y=t.y)}function wt(e,n){if(!mD(e,n))return;if(pD(n)){xD(e,n);return}let t=[],o=[];w2(n,.5,t,o),wt(e,t),wt(e,o)}function oi(e,n,t,o){let r=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],i=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],s=o?null:r,l=o?r:null,a=o?{x:t[0].x,y:t[0].y}:{x:t[3].x,y:t[3].y},u=0,f=1,d=!1;do{let m=a,b=(f+u)/2;if(a=w2(t,b,s,l),n(e,a)){o?u=b:f=b;for(let g=0;g<4;g++)i[g]={x:r[g].x,y:r[g].y};d=!0}else o?f=b:u=b;if(Math.abs(m.x-a.x)<=.5&&Math.abs(m.y-a.y)<=.5)break}while(!0);let c=d?i:r;for(let m=0;m<4;m++)t[m]=c[m]}var N2=(()=>{let e=[];return e[0]=0,e[1]=1,e[2]=1,e[3]=.5,e[4]=1,e[5]=1.2,e[6]=.8,e[7]=1,e[8]=.5,e})(),Fs=15,Vn=16,re=32,Re=64,Ie=128,AP=[{name:"invempty",type:1|re|Vn}],GP=[{name:"o",type:Vn},{name:"r",type:Ie},{name:"l",type:Re},{name:"e",type:Vn},{name:"half",type:Re}],MP=[{name:"normal",type:1},{name:"crow",type:2},{name:"tee",type:3},{name:"box",type:4},{name:"diamond",type:5},{name:"dot",type:6},{name:"none",type:8},{name:"inv",type:1|re},{name:"vee",type:2|re},{name:"pen",type:2|re},{name:"mpty",type:1},{name:"curve",type:7},{name:"icurve",type:7|re}];var hD=e=>{for(let n of AP)if(e.startsWith(n.name))return{flag:n.type,rest:e.slice(n.name.length)};return null},bD=e=>{let n=0,t=e,o=!0;for(;o;){o=!1;for(let r of GP)if(t.startsWith(r.name)){n|=r.type,t=t.slice(r.name.length),o=!0;break}}return{flag:n,rest:t}},gD=e=>{for(let n of MP)if(e.startsWith(n.name))return{flag:n.type,baseName:n.name,rest:e.slice(n.name.length)};return null},yD=e=>e==="pen"?"open":e==="mpty"?"empty":e,PD=e=>{let n=hD(e);if(n){let s=n.flag;return{comp:{name:"invempty",open:!!(s&Vn),left:!!(s&Re),right:!!(s&Ie)},rest:n.rest}}let{flag:t,rest:o}=bD(e),r=gD(o);if(!r)return null;let i=t|r.flag;return{comp:{name:yD(r.baseName),open:!!(i&Vn),left:!!(i&Re),right:!!(i&Ie)},rest:r.rest}};function Hd(e){let n=[],t=e;for(;t.length>0;){let o=PD(t);if(!o)break;n.push(o.comp),t=o.rest}return n.length===0&&n.push({name:"normal",open:!1,left:!1,right:!1}),n}var ED=new Map([["normal",1],["crow",2],["tee",3],["box",4],["diamond",5],["dot",6],["none",8],["inv",1|re],["vee",2|re],["open",2|re],["empty",1],["curve",7],["icurve",7|re],["invempty",1|re]]);function Vd(e){let n=ED.get(e.name)??1,t=n&Fs,o=(n&re)!==0;return{type:t|(o?re:0),open:e.open,left:e.left,right:e.right,lenfact:N2[t]??N2[1]}}var Xa=1e-4,Q=(e,n)=>({x:e.x-n.x,y:e.y-n.y}),ze=(e,n)=>({x:e.x+n.x,y:e.y+n.y}),Ud=(e,n)=>({x:e*n.x,y:e*n.y}),Xd=(e,n)=>{if(e.x===0&&e.y===0)return{x:0,y:0};let t=Math.hypot(e.x,e.y);return{x:n*(-e.x/t),y:n*(-e.y/t)}},$a=(e,n)=>Xd(e,n/2);function Wa(e,n,t,o){let r=Math.hypot(e.x,e.y),i=e.x/r,s=e.y/r,l=e.y>0?Math.acos(i):-Math.acos(i),a=t.x-n.x,u=t.y-n.y,f=Math.hypot(a,u),d=a/f,c=u>0?Math.acos(d):-Math.acos(d),m=o*f*Math.cos(c-l);return{x:m*i,y:m*s}}var IP=(e,n,t)=>{let o=10/(Math.hypot(e.x,e.y)+Xa),r=(e.x+(e.x>=0?Xa:-Xa))*o,i=(e.y+(e.y>=0?Xa:-Xa))*o;return{x:r*n*t,y:i*n*t}},T2=e=>e.type|(e.open?Vn:0)|(e.left?Re:0)|(e.right?Ie:0);function js(e,n){switch(e.kind){case"ellipse":return{...e,center:n(e.center)};case"polygon":return{...e,points:e.points.map(n)};case"polyline":return{kind:"polyline",points:e.points.map(n)};case"bezier":return{kind:"bezier",points:e.points.map(n)}}}var vD=4;function LP(e,n){let t=n.x-e.x,o=n.y-e.y,r=Math.hypot(t,o),i=t/r,s=o/r;return{cos:i,sin:s,angle:o>0?Math.acos(i):-Math.acos(i)}}function Hs(e,n,t,o){if(e.x===n.x&&e.y===n.y||t.x===n.x&&t.y===n.y)return[n,n,n];let r=LP(e,n),i=LP(n,t),s=o/2,l={x:n.x-s*r.sin,y:n.y+s*r.cos},a={x:n.x-s*i.sin,y:n.y+s*i.cos},u=i.angle-Math.PI-r.angle,f=u+(u<=-Math.PI?2*Math.PI:0);if(1/Math.sin(f/2)>vD)return[{x:(l.x+a.x)/2,y:(l.y+a.y)/2},l,a];let d=s/Math.tan(f/2);return[{x:l.x+d*r.cos,y:l.y+d*r.sin},l,a]}var SD=.45;function wD(e,n,t){let o={x:0,y:0},r={x:-n.x,y:-n.y},i=t&Ie?o:n,s=t&Re?o:r;return{baseLeft:t&re?s:i,baseRight:t&re?i:s,P:t&re?{x:-e.x,y:-e.y}:e}}function ND(e,n,t){let o=Hs(e.baseLeft,e.P,e.baseRight,n);if(!(t&Re)&&!(t&Ie))return Q(o[0],e.P);let r=!!(t&Re)==!!(t&re);return Wa(e.P,e.P,r?o[2]:o[1],1)}function RD(e,n,t){if(t&re)return Xd(e.P,-n/2);let o=ze(Q(e.m,e.q0),e.w),r=Q(e.v,e.u),i=Hs(o,r,{x:0,y:0},n);return Wa(e.P,r,i[1],-1)}function TD(e,n,t){let o=Q(e.p0,t),r=Q(e.q0,t);return{a:[o,Q(r,e.v),Q(e.m,e.w),Q(r,e.w),r,ze(r,e.w),ze(e.m,e.w),ze(r,e.v),o],q:Q(r,n)}}function kD(e,n,t){let o=ze(e.p0,n),r=ze(e.q0,n),i=ze(o,n);return{a:[r,Q(o,e.v),Q(e.m,e.w),i,i,i,ze(e.m,e.w),ze(o,e.v),r],q:ze(r,t)}}function DP(e,n,t,o,r){let i=SD;o>4*t&&r&re&&(i*=o/(4*t));let s=0;o>1&&r&re&&(s=.05*(o-1)/t);let l={x:-n.y*i,y:n.x*i},a={x:-n.y*s,y:n.x*s},u={x:e.x+n.x,y:e.y+n.y},f={x:e.x+n.x*.5,y:e.y+n.y*.5},d=r&re?{x:-n.x,y:-n.y}:n,c={p0:e,u:n,v:l,w:a,m:f,q0:u,P:d},m={x:0,y:0},b={x:0,y:0};return(n.x!==0||n.y!==0)&&(b=ND(wD(n,l,r),o,r),m=RD(c,o,r)),r&re?TD(c,m,b):kD(c,m,b)}function BP(e,n,t,o,r){let{a:i,q:s}=DP(e,n,t,o,r),l;return r&Re?l=i.slice(0,5):r&Ie?l=i.slice(4,9):l=i.slice(0,8),{ops:[{kind:"polygon",points:l,filled:!0}],q:s}}function FP(e,n,t,o){let r={x:e*n*10,y:0},{a:i,q:s}=DP({x:0,y:0},r,n,t,o),l=i[1],a=s.x,u=a-(l.x-i[3].x),f=Math.abs(l.x-i[0].x),c=(i[7].y-l.y)*u/f,m=t/2,b=u*t/c,g=o&re?m:b;return a-g}function zP(e,n,t,o,r){let i={x:e.x+n.x,y:e.y+n.y};return{ops:[{kind:"polyline",points:[e,i]}],q:i}}function jP(e,n,t,o,r){let i={x:-n.y,y:n.x},s=Math.hypot(n.x,n.y),l=o/2-.2*s,a=s>0&&l>0?Xd(n,l):{x:0,y:0},u=Q(e,a),f=Q({x:e.x+n.x*.2,y:e.y+n.y*.2},a),d=Q({x:e.x+n.x*.6,y:e.y+n.y*.6},a),c=Q({x:e.x+n.x,y:e.y+n.y},a),m=[{x:f.x+i.x,y:f.y+i.y},{x:f.x-i.x,y:f.y-i.y},{x:d.x-i.x,y:d.y-i.y},{x:d.x+i.x,y:d.y+i.y}];return r&Re?(m[0]=f,m[3]=d):r&Ie&&(m[1]=f,m[2]=d),{ops:[{kind:"polygon",points:m,filled:!0},{kind:"polyline",points:[u,c]}],q:c}}function HP(e,n,t){let o=e*n*10,r=o,i=t/2-(1-.6)*o;i>0&&(r+=i);let s=t/2-.2*o;return i>0&&(r+=s),r}var Vs=(e,n)=>({x:(e.x+n.x)/2,y:(e.y+n.y)/2});function OP(e,n){let t=Vs(e[0],e[1]),o=Vs(e[1],e[2]),r=Vs(e[2],e[3]),i=Vs(t,o),s=Vs(o,r),l=Vs(i,s);return n?[l,s,r,e[3]]:[e[0],t,i,l]}function CD(e,n,t,o){let r={x:e.x+n.x+t.x,y:e.y+n.y+t.y},i={x:e.x-n.x+t.x,y:e.y-n.y+t.y},s=o&re?1:-1,l={x:e.x+.95*n.x+t.x+s*t.x*(4/3),y:r.y+s*t.y*(4/3)},a={x:e.x-.95*n.x+t.x+s*t.x*(4/3),y:i.y+s*t.y*(4/3)};return[r,l,a,i]}function VP(e,n,t,o,r){let i=o>4?.5*o/4:.5,l=r&re||n.x===0&&n.y===0?e:Q(e,$a(n,o)),a={x:l.x+n.x,y:l.y+n.y},u={x:-n.y*i,y:n.x*i},f={x:u.y,y:-u.x},d=CD(l,u,f,r);return r&Re?d=OP(d,!0):r&Ie&&(d=OP(d,!1)),{ops:[{kind:"polyline",points:[e,a]},{kind:"bezier",points:d}],q:a}}var UP=(e,n,t)=>e*n*10+t/2;var AD=.35;function GD(e,n,t){let o={x:0,y:0},r={x:-n.x,y:-n.y},i=t&Ie?o:r,s=t&Re?o:n;return{baseLeft:t&re?s:i,baseRight:t&re?i:s,P:t&re?e:{x:-e.x,y:-e.y}}}function MD(e,n,t){let o=Hs(e.baseLeft,e.P,e.baseRight,n);if(!(t&Re)&&!(t&Ie))return Q(o[0],e.P);let r=t&Re?o[1]:o[2];return Wa(e.P,e.P,r,1)}function LD(e,n,t,o,r){let i={x:e.x,y:e.y},s={x:e.x+n.x,y:e.y+n.y},l=new Array(5);return r&re?(i=ze(i,o.base),s=ze(s,o.base),l[0]=l[4]=i,l[1]=Q(i,t),l[2]=s,l[3]=ze(i,t),s=ze(s,o.tip)):(i=Q(i,o.tip),s=Q(s,o.tip),l[0]=l[4]=s,l[1]=Q(s,t),l[2]=i,l[3]=ze(s,t),s=Q(s,o.base)),{a:l,q:s}}function $P(e,n,t,o){let r=AD;t>4&&(r*=t/4);let i={x:-n.y*r,y:n.x*r},s=GD(n,i,o),l={x:0,y:0},a={x:0,y:0};if(n.x!==0||n.y!==0){let u=Math.hypot(s.P.x,s.P.y);a=MD(s,t,o),l={x:t/2*(s.P.x/u),y:t/2*(s.P.y/u)}}return LD(e,n,i,{base:l,tip:a},o)}function ID(e,n,t,o,r){let{a:i,q:s}=$P(e,n,o,r),l=!(r&Vn),a;return r&Re?a=[i[0],i[1],i[2]]:r&Ie?a=[i[2],i[3],i[4]]:a=[i[1],i[2],i[3]],{ops:[{kind:"polygon",points:a,filled:l}],q:s}}var XP=.4;function OD(e,n,t,o,r){let i={x:-n.y*XP,y:n.x*XP},s=$a(n,o),l=Q(e,s),a=Q({x:e.x+n.x*.8,y:e.y+n.y*.8},s),u=Q({x:e.x+n.x,y:e.y+n.y},s),f=[{x:l.x+i.x,y:l.y+i.y},{x:l.x-i.x,y:l.y-i.y},{x:a.x-i.x,y:a.y-i.y},{x:a.x+i.x,y:a.y+i.y}];return r&Re?(f[0]=l,f[3]=a):r&Ie&&(f[1]=l,f[2]=a),{ops:[{kind:"polygon",points:f,filled:!(r&Vn)},{kind:"polyline",points:[a,u]}],q:u}}function WP(e,n,t,o){let r={x:-n.y/3,y:n.x/3},i={x:e.x+n.x/2,y:e.y+n.y/2},s={x:e.x+n.x,y:e.y+n.y},l={x:e.x,y:e.y},a={x:0,y:0},u=Q(Ud(-.5,n),r),f=ze(Ud(-.5,n),r),d=o&Ie?a:u,c=o&Re?a:f,m=Ud(-1,n),b=Hs(d,m,c,t),g=Q(b[0],m);l=Q(l,g),i=Q(i,g),s=Q(s,g);let E=new Array(5);return E[0]=E[4]=s,E[1]={x:i.x+r.x,y:i.y+r.y},E[2]=l,E[3]={x:i.x-r.x,y:i.y-r.y},s=Q(s,g),{a:E,q:s}}function DD(e,n,t,o,r){let{a:i,q:s}=WP(e,n,o,r),l=!(r&Vn),a;return r&Re?a=[i[2],i[3],i[4]]:r&Ie?a=[i[0],i[1],i[2]]:a=[i[0],i[1],i[2],i[3]],{ops:[{kind:"polygon",points:a,filled:l}],q:s}}function BD(e,n,t,o,r){let i=Math.hypot(n.x,n.y)/2,s=$a(n,o),l=Q(e,s),a={x:l.x+n.x/2,y:l.y+n.y/2},u=Q({x:l.x+n.x,y:l.y+n.y},s);return{ops:[{kind:"ellipse",center:a,rx:i,ry:i,filled:!(r&Vn)}],q:u}}var FD=(e,n)=>e*n*10;function zD(e,n,t,o){let r={x:e*n*10,y:0},{a:i,q:s}=$P({x:0,y:0},r,t,o),l=i[1],a=i[3],u=i[2],f=s.x,d=Math.abs(l.x-u.x),m=(a.y-l.y)*f/d,b=t/2,g=f*t/m,E=o&re?g:b;return f-E}var jD=(e,n,t)=>e*n*10+t/2,HD=(e,n,t)=>e*n*10+t;function VD(e,n,t,o){let r={x:e*n*10,y:0},{a:i,q:s}=WP({x:0,y:0},r,t,o),l=i[3],a=i[1],u=i[2],f=s.x/2,d=Math.abs(l.x-u.x),m=(a.y-l.y)*f/d,b=f*t/m;return 2*f-b}function UD(e,n,t){let o=T2(e);switch(e.type&Fs){case 1:return zD(e.lenfact,n,t,o);case 2:return FP(e.lenfact,n,t,o);case 3:return HP(e.lenfact,n,t);case 4:return jD(e.lenfact,n,t);case 5:return VD(e.lenfact,n,t,o);case 6:return HD(e.lenfact,n,t);case 7:return UP(e.lenfact,n,t);default:return FD(e.lenfact,n)}}function YP(e,n,t){if(n===0)return 0;let o=0,r=Math.min(e.length,4);for(let i=0;i<r;i++)o+=UD(e[i],n,t);return o}function XD(e,n,t,o,r){let i=T2(e),s=IP(t,e.lenfact,o);switch(e.type&Fs){case 2:return BP(n,s,o,r,i);case 3:return jP(n,s,o,r,i);case 4:return OD(n,s,o,r,i);case 5:return DD(n,s,o,r,i);case 6:return BD(n,s,o,r,i);case 7:return VP(n,s,o,r,i);case 8:return zP(n,s,o,r,i);case 1:default:return ID(n,s,o,r,i)}}function JP(e,n,t,o,r){let i=[],s=n,l=Math.min(e.length,4);for(let a=0;a<l;a++){let u=e[a];if((u.type&Fs)===0)break;let f=XD(u,s,t,o,r);i.push(...f.ops),s=f.q}return i}function $D(e,n){let t=1-n,o=[[e[0],e[1],e[2],e[3]],[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}]];for(let r=1;r<=3;r++)for(let i=0;i<=3-r;i++)o[r][i]={x:t*o[r-1][i].x+n*o[r-1][i+1].x,y:t*o[r-1][i].y+n*o[r-1][i+1].y};return o}function k2(e,n){let t=$D(e,n),o=[t[0][0],t[1][0],t[2][0],t[3][0]],r=[t[3][0],t[2][1],t[1][2],t[0][3]];return[o,r,t[3][0]]}function WD(e,n,t,o){let r=(o.high+o.low)/2,[i,s,l]=k2(e,r);return n(l.x,l.y)?t?{low:r,high:o.high,best:s,found:!0,pt:l}:{low:o.low,high:r,best:i,found:!0,pt:l}:t?{...o,high:r,pt:l}:{...o,low:r,pt:l}}function KP(e,n,t){let o={low:0,high:1,best:e.slice(),found:!1,pt:t?e[0]:e[3]},r;do r=o.pt,o=WD(e,n,t,o);while(Math.abs(r.x-o.pt.x)>.5||Math.abs(r.y-o.pt.y)>.5);if(o.found)return o.best;let[i,s]=k2(e,(o.high+o.low)/2);return t?s:i}function ri(e,n,t,o,r){let i=e.map(s=>({x:s.x-n,y:s.y-t}));return KP(i,o,r).map(s=>({x:s.x+n,y:s.y+t}))}function $d(e,n,t){if(t<=0)return e;let o=[n,e[2],e[1],e[0]],r=(a,u)=>Math.hypot(a,u)<=t,i=o.map(a=>({x:a.x-n.x,y:a.y-n.y})),l=KP(i,r,!0).map(a=>({x:a.x+n.x,y:a.y+n.y}));return[l[3],l[2],l[1],l[0]]}function rr(e,n,t){let o=Hd(e).map(Vd);return YP(o,n,t)}var Eo=1;function C2(e,n,t=Eo){let o=e+t/2,r=n+t/2;return(i,s)=>Math.abs(i)<=o&&Math.abs(s)<=r}function qP(e,n,t=Eo){let o=e+t/2,r=n+t/2;return(i,s)=>i*i/(o*o)+s*s/(r*r)<1}function _2(e,n,t){if(t<=0)return e;let o=(r,i)=>Math.hypot(r,i)<=t;return ri(e,n.x,n.y,o,!0)}function Us(e){let n=Math.sqrt(e.x*e.x+e.y*e.y);return n<1e-10?{x:0,y:0}:{x:e.x/n,y:e.y/n}}function A2(e){return{x:-e.x,y:-e.y}}function G2(e,n,t){return{x:e.x+n.x*t,y:e.y+n.y*t}}function QP(e,n){return e>0?n/e:e<0?-n/e:1/0}function ZP(e,n){return e>0?n/e:e<0?-n/e:1/0}function Wd(e,n){if(n.x===0&&n.y===0)return{x:e.center.x,y:e.center.y};if(e.isEllipse){let r=(e.lw+e.rw)/2,i=e.ht/2,s=n.x/r,l=n.y/i,a=Math.sqrt(s*s+l*l);if(a<1e-10)return{x:e.center.x,y:e.center.y};let u=1/a;return{x:e.center.x+n.x*u,y:e.center.y+n.y*u}}let t=n.x>0?e.rw:e.lw,o=Math.min(QP(n.x,t),ZP(n.y,e.ht/2));return o===1/0?{x:e.center.x,y:e.center.y}:{x:e.center.x+n.x*o,y:e.center.y+n.y*o}}function vo(e,n){return e.attrs.get(n==="head"?"arrowhead":"arrowtail")??"normal"}function Xs(e){let n=parseFloat(e.attrs.get("arrowsize")??"");return Number.isFinite(n)?Math.max(n,0):1}function $s(e,n,t,o,r){let i=Hd(vo(e,n)).map(Vd);return JP(i,t,o,Xs(e),r)}var ii=1,Un=class e{static makeEmptySpl(){return{list:[],size:0,bb:{ll:{x:0,y:0},ur:{x:0,y:0}}}}static makeEmptyBz(n){return{list:Array.from({length:n},()=>({x:0,y:0})),size:n,sflag:0,eflag:0,sp:{x:0,y:0},ep:{x:0,y:0}}}static getInsideFn(n){return n.info.shape?.fns?.insidefn??null}static shapeClip0(n,t,o,r,i){let s=o.info.rw,l=r.map(a=>({x:a.x-o.info.coord.x,y:a.y-o.info.coord.y}));oi(n,t,l,i);for(let a=0;a<4;a++)r[a]={x:l[a].x+o.info.coord.x,y:l[a].y+o.info.coord.y};o.info.rw=s}static resolveSwap(n,t){return n.ignoreSwap||n.swapEnds==null?!1:n.swapEnds(t)}static arrowFlags(n){let t=0,o=n.tail.root.kind.includes("undirected")?0:ii,r=n.attrs.get("dir");if(r==="forward"?(t=0,o=ii):r==="back"?(t=ii,o=0):r==="both"?(t=ii,o=ii):r==="none"&&(t=0,o=0),o===ii&&n.attrs.get("arrowhead")==="none"&&(o=0),t===ii&&n.attrs.get("arrowtail")==="none"&&(t=0),n.info.conc_opp_flag){let i=n.head.outEdges(n.head.root).find(s=>s.head===n.tail);if(i){let[s,l]=e.arrowFlags(i);o|=s,t|=l}}return[t,o]}static resolveArrowFlags(n,t,o,r,i){let[s,l]=e.arrowFlags(r);return n.splineMerge!=null&&(n.splineMerge(t)&&(l=0),n.splineMerge(o.tail)&&(s=0)),i?[l,s]:[s,l]}static dist(n,t){return Math.hypot(n.x-t.x,n.y-t.y)}static sphereCtx(n,t){return{ctx:{nodeCoord:{x:0,y:0},rw:0,bp:null},fn:(o,r)=>e.dist(r,n)<=t}}static clipArrowsize(n){return n.info.stale_arrow_attrs?1:Xs(n)}static clipPenwidth(n){return n.info.stale_arrow_attrs?1:e.edgePenwidth(n)}static arrowEndClip(n,t,o,r,i,s){let l=r,a=rr(vo(n,"head"),e.clipArrowsize(n),e.clipPenwidth(n));i.eflag=s,i.ep=t[l+3],l>o&&e.dist(t[l],t[l+3])<a&&(l-=3);let u=[i.ep,t[l+2],t[l+1],t[l]];if(a>0){let{ctx:f,fn:d}=e.sphereCtx(i.ep,a);oi(f,d,u,!0)}return t[l]=u[3],t[l+1]=u[2],t[l+2]=u[1],t[l+3]=u[0],l}static arrowStartClip(n,t,o,r,i,s){let l=o,a=rr(vo(n,"tail"),e.clipArrowsize(n),e.clipPenwidth(n));i.sflag=s,i.sp=t[l],r>l&&e.dist(t[l],t[l+3])<a&&(l+=3);let u=[t[l+3],t[l+2],t[l+1],i.sp];if(a>0){let{ctx:f,fn:d}=e.sphereCtx(i.sp,a);oi(f,d,u,!1)}return t[l]=u[3],t[l+1]=u[2],t[l+2]=u[1],t[l+3]=u[0],l}static edgePenwidth(n){let t=parseFloat(n.attrs.get("penwidth")??"");return Number.isNaN(t)?1:t}static renderPenwidth(n){return Xt(ce(n.attrs.get("style")),n.attrs.get("penwidth"))}static arrowClip(n,t,o,r,i,s){let l=n;for(;l.info.to_orig!=null;)l=l.info.to_orig;let a=e.resolveSwap(s,l),[u,f]=e.resolveArrowFlags(s,t,n,l,a);if(i.sflag=u,i.eflag=f,s.isOrtho){(u||f)&&(e.arrowOrthoClip(l,o,r.start,r.end,i,u,f),u&&e.stashArrow(l,i.sp,o[r.start],!0),f&&e.stashArrow(l,i.ep,o[r.end+3],!1));return}u&&(r.start=e.arrowStartClip(l,o,r.start,r.end,i,u),e.stashArrow(l,i.sp,o[r.start],!0)),f&&(r.end=e.arrowEndClip(l,o,r.start,r.end,i,f),e.stashArrow(l,i.ep,o[r.end+3],!1))}static arrowOrthoClip(n,t,o,r,i,s,l){let a=e.clipPenwidth(n),u=e.clipArrowsize(n),f=rr(vo(n,"head"),u,a),d=rr(vo(n,"tail"),u,a);if(s&&l&&r===o){let c=t[r],m=t[r+3],b=e.dist(c,m),g=f,E=d;g+E>=b&&(g=E=b/3);let R={x:c.x,y:c.y},N={x:m.x,y:m.y};c.y===m.y?(R.y=c.y,N.y=c.y,c.x<m.x?(N.x=m.x-g,R.x=c.x+E):(N.x=m.x+g,R.x=c.x-E)):(R.x=c.x,N.x=c.x,c.y<m.y?(N.y=m.y-g,R.y=c.y+E):(N.y=m.y+g,R.y=c.y-E)),t[r]=R,t[r+1]={...R},t[r+2]=N,t[r+3]={...N},i.sflag=s,i.sp=c,i.eflag=l,i.ep=m;return}if(l){let c=f,m=t[r],b=t[r+3],g=.9*e.dist(m,b);c>=g&&(c=g);let E={x:m.x,y:m.y};m.y===b.y?(E.y=m.y,E.x=m.x<b.x?b.x-c:b.x+c):(E.x=m.x,E.y=m.y<b.y?b.y-c:b.y+c),t[r+1]={...m},t[r+2]=E,t[r+3]={...E},i.eflag=l,i.ep=b}if(s){let c=d,m=t[o],b=t[o+3],g=.9*e.dist(m,b);c>=g&&(c=g);let E={x:m.x,y:m.y};m.y===b.y?(E.y=m.y,E.x=m.x<b.x?m.x+c:m.x-c):(E.x=m.x,E.y=m.y<b.y?m.y+c:m.y-c),t[o]=E,t[o+1]={...E},t[o+2]={...b},i.sflag=s,i.sp=m}}static stashArrow(n,t,o,r){let i={x:o.x-t.x,y:o.y-t.y},s=$s(n,r?"tail":"head",t,i,e.renderPenwidth(n));r?n.info.tailArrowOps=s:n.info.headArrowOps=s}static clipSide(n,t,o,r,i){let s=e.getInsideFn(n);if(s==null)return i?0:r-4;let l={nodeCoord:n.info.coord,rw:n.info.rw,bp:t,node:n},a=i?0:r-4,u=i?3:-3,f=i?r-4:0;for(;i?a<f:a>f;){let c=i?o[a+3]:o[a];if(!s(l,{x:c.x-n.info.coord.x,y:c.y-n.info.coord.y}))break;a+=u}let d=o.slice(a,a+4);e.shapeClip0(l,s,n,d,i);for(let c=0;c<4;c++)o[a+c]=d[c];return a}static copyToBezier(n,t,o,r,i){for(let s=o;s<r+4;){n.list[s-o]=t[s];let l=[t[s]];if(s++,s>=r+4)break;n.list[s-o]=t[s],l.push(t[s]),s++,n.list[s-o]=t[s],l.push(t[s]),s++,s<t.length&&l.push(t[s]),l.length===4&&i!=null&&wt(i,l)}n.size=r-o+4}static needsSwap(n,t,o){if(n.ignoreSwap||t.info.rank!==o.info.rank)return!1;let r=t.info.order!==void 0?t.info.order:0,i=o.info.order!==void 0?o.info.order:0;return r>i}static resolveOrig(n){let t=n;for(;t.info.to_orig!=null&&t.info.edge_type!==0;)t=t.info.to_orig;return t}static getPortConfig(n,t){let o=n.tail===t.tail;return{clipTail:o?t.info.tail_port.clip:t.info.head_port.clip,clipHead:o?t.info.head_port.clip:t.info.tail_port.clip,tbox:o?t.info.tail_port.bp:t.info.head_port.bp,hbox:o?t.info.head_port.bp:t.info.tail_port.bp}}static resolveEndpoints(n,t,o){return e.needsSwap(o,n.tail,t)?[t,n.tail]:[n.tail,t]}static findStart(n,t,o,r,i){return n?e.clipSide(t,o,r,i,!0):0}static findEnd(n,t,o,r,i){return n?e.clipSide(t,o,r,i,!1):i-4}static trimStart(n,t,o){let r=o;for(;r<t-4&&Bs(n[r],n[r+3],.001);)r+=3;return r}static trimEnd(n,t){let o=t;for(;o>0&&Bs(n[o],n[o+3],.001);)o-=3;return o}};function Ja(e,n){let t=e;for(;t.info.to_orig!=null&&t.info.edge_type!==0;)t=t.info.to_orig;t.info.spl==null&&(t.info.spl=Un.makeEmptySpl());let o=Un.makeEmptyBz(n);return t.info.spl.list.push(o),t.info.spl.size++,o}function Z(e,n,t,o,r){let i=e.tail.root,s=Ja(e,o),l=Un.resolveOrig(e),{clipTail:a,clipHead:u,tbox:f,hbox:d}=Un.getPortConfig(e,l),[c,m]=Un.resolveEndpoints(e,n,r),b=Un.findStart(a,c,f,t,o),g=Un.findEnd(u,m,d,t,o),E={start:Un.trimStart(t,o,b),end:Un.trimEnd(t,g)};Un.arrowClip(e,n,t,E,s,r),Un.copyToBezier(s,t,E.start,E.end,i.info.bb)}var e8=[12,4,6,2,3,1,9,8],YD=[[11,12,13,14,15,16,17,18],[21,22,23,24,25,26,27,28],[31,32,33,34,35,36,37,38],[41,42,43,44,45,46,47,48],[51,52,53,54,55,56,57,58],[61,62,63,64,65,66,67,68],[71,72,73,74,75,76,77,78],[81,82,83,84,85,86,87,88]],JD=new Set([14,37,47,51,57,58]),KD=new Set([74,75,85]),Cn=class e{static sidesToPoints(n,t){let o=-1,r=-1;for(let i=0;i<8;i++)t===e8[i]&&(r=i),n===e8[i]&&(o=i);return o<0||r<0?0:YD[o][r]}static setLabelY(n,t){let o=n.info.label;if(!o?.dimen)return 0;let i=n.tail.root.info.flip===!0?o.dimen.x:o.dimen.y;return o.pos={x:t.x,y:t.y+t.sign*i/2},o.set=!0,i}static setLabelX(n,t){let o=n.info.label;if(!o?.dimen)return 0;let i=n.tail.root.info.flip===!0?o.dimen.y:o.dimen.x;return o.pos={x:t.x+t.sign*i/2,y:t.y},o.set=!0,i}static bottomPts(n){let{tp:t,hp:o,np:r,dx:i,dy:s,ty:l,hy:a}=n;return[t,{x:t.x+i,y:t.y-l/3},{x:t.x+i,y:r.y-s},{x:(t.x+o.x)/2,y:r.y-s},{x:o.x-i,y:r.y-s},{x:o.x-i,y:o.y-a/3},o]}static topPts(n){let{tp:t,hp:o,np:r,dx:i,dy:s,ty:l,hy:a}=n;return[t,{x:t.x+i,y:t.y+l/3},{x:t.x+i,y:r.y+s},{x:(t.x+o.x)/2,y:r.y+s},{x:o.x-i,y:r.y+s},{x:o.x-i,y:o.y+a/3},o]}static rightPts(n){let{tp:t,hp:o,np:r,dx:i,dy:s,tx:l,hx:a}=n;return[t,{x:t.x+l/3,y:t.y+s},{x:r.x+i,y:t.y+s},{x:r.x+i,y:(t.y+o.y)/2},{x:r.x+i,y:o.y-s},{x:o.x+a/3,y:o.y-s},o]}static leftPts(n){let{tp:t,hp:o,np:r,dx:i,dy:s,tx:l,hx:a}=n;return[t,{x:t.x-l/3,y:t.y+s},{x:r.x-i,y:t.y+s},{x:r.x-i,y:(t.y+o.y)/2},{x:r.x-i,y:o.y-s},{x:o.x-a/3,y:o.y-s},o]}static topDxBase(n,t,o,r){return n.info.lw-(t.x-o.x)+(n.info.rw-(r.x-t.x))}static topDx(n,t,o){let{pp:r,n:i,np:s,tp:l,hp:a}=n;if(r===15)return t*(i.info.rw-(a.x-s.x)+o);if(r===38)return t*(i.info.lw-(s.x-a.x)+o);if(r===41||r===48)return t*(i.info.rw-(l.x-s.x)+o);let u=e.topDxBase(i,s,l,a);return JD.has(r)?t*(u/3):r===73?t*(i.info.lw-(s.x-l.x)+o):r===83?t*(i.info.lw-(s.x-l.x)):r===84?t*(u/2+o):KD.has(r)?t*(u/2+2*o):0}static bottomLoop(n,t){let{edges:o,cnt:r,size1:i,size2:s,sinfo:l}=n,{dy:a,dx:u,ty:f,hy:d}=t;for(let c=0;c<r;c++){a+=s,f+=s,d+=s,u+=t.sgn*i;let m=e.bottomPts({...t,dx:u,dy:a,ty:f,hy:d}),b=e.setLabelY(o[c],{y:t.np.y-a,x:t.np.x,sign:-1});b>s&&(a+=b-s),Z(o[c],o[c].head,m,m.length,l)}}static topLoop(n,t){let{edges:o,cnt:r,size1:i,size2:s,sinfo:l}=n,{dy:a,dx:u,ty:f,hy:d}=t;for(let c=0;c<r;c++){a+=s,f+=s,d+=s,u+=t.sgn*i;let m=e.topPts({...t,dx:u,dy:a,ty:f,hy:d}),b=e.setLabelY(o[c],{y:t.np.y+a,x:t.np.x,sign:1});b>s&&(a+=b-s),Z(o[c],o[c].head,m,m.length,l)}}static rightLoop(n,t){let{edges:o,cnt:r,size1:i,size2:s,sinfo:l}=n,{dx:a,dy:u,tx:f,hx:d}=t;for(let c=0;c<r;c++){a+=i,f+=i,d+=i,u+=t.sgn*s;let m=e.rightPts({...t,dx:a,dy:u,tx:f,hx:d}),b=e.setLabelX(o[c],{x:t.np.x+a,y:t.np.y,sign:1});b>i&&(a+=b-i),Z(o[c],o[c].head,m,m.length,l)}}static leftLoop(n,t){let{edges:o,cnt:r,size1:i,size2:s,sinfo:l}=n,{dx:a,dy:u,tx:f,hx:d}=t;for(let c=0;c<r;c++){a+=i,f+=i,d+=i,u+=t.sgn*s;let m=e.leftPts({...t,dx:a,dy:u,tx:f,hx:d}),b=e.setLabelX(o[c],{x:t.np.x-a,y:t.np.y,sign:-1});b>i&&(a+=b-i),Z(o[c],o[c].head,m,m.length,l)}}static goesRight(n){let{tp:t,hp:o}=n;return!t.defined&&!o.defined?!0:t.side&8||o.side&8?!1:t.side!==o.side||!(t.side&5)}static dispatchLeft(n,t){let{edges:o,cnt:r,size1:i,size2:s,sinfo:l}=n,{tp:a,hp:u}=t;a.side&2||u.side&2?L2(o,r,i,s,l):o8(o,r,i,s,l)}};function n8(e,n,t,o,r){let i=e[0],s=i.tail,l=Math.max(t/2/n,2),a=s.info.coord,u={x:i.info.tail_port.p.x+a.x,y:i.info.tail_port.p.y+a.y},f={x:i.info.head_port.p.x+a.x,y:i.info.head_port.p.y+a.y},d=Cn.sidesToPoints(i.info.tail_port.side,i.info.head_port.side),c=u.x>=f.x?1:-1;d===67&&(c=-c);let m=s.info.ht/2,b=Math.min(m,3*(u.y+m-a.y)),g=Math.min(m,3*(f.y+m-a.y));Cn.bottomLoop({edges:e,cnt:n,size1:l,size2:o,sinfo:r},{np:a,tp:u,hp:f,dy:m,dx:0,ty:b,hy:g,sgn:c})}function L2(e,n,t,o,r){let i=e[0],s=i.tail,l=Math.max(t/2/n,2),a=s.info.coord,u={x:i.info.tail_port.p.x+a.x,y:i.info.tail_port.p.y+a.y},f={x:i.info.head_port.p.x+a.x,y:i.info.head_port.p.y+a.y},d=u.x>=f.x?1:-1,c=Cn.sidesToPoints(i.info.tail_port.side,i.info.head_port.side),m=s.info.ht/2,b=Cn.topDx({pp:c,n:s,np:a,tp:u,hp:f},d,l),g=Math.min(m,3*(a.y+m-u.y)),E=Math.min(m,3*(a.y+m-f.y));Cn.topLoop({edges:e,cnt:n,size1:l,size2:o,sinfo:r},{np:a,tp:u,hp:f,dy:m,dx:b,ty:g,hy:E,sgn:d})}function t8(e,n,t,o,r){let i=e[0],s=i.tail,l=Math.max(o/2/n,2),a=s.info.coord,u={x:i.info.tail_port.p.x+a.x,y:i.info.tail_port.p.y+a.y},f={x:i.info.head_port.p.x+a.x,y:i.info.head_port.p.y+a.y},d=Cn.sidesToPoints(i.info.tail_port.side,i.info.head_port.side),c=u.y>=f.y?1:-1;(d===32||d===65)&&u.y===f.y&&(c=-c);let m=s.info.rw,b=Math.min(m,3*(a.x+m-u.x)),g=Math.min(m,3*(a.x+m-f.x));Cn.rightLoop({edges:e,cnt:n,size1:t,size2:l,sinfo:r},{np:a,tp:u,hp:f,dx:m,dy:0,tx:b,hx:g,sgn:c})}function o8(e,n,t,o,r){let i=e[0],s=i.tail,l=Math.max(o/2/n,2),a=s.info.coord,u={x:i.info.tail_port.p.x+a.x,y:i.info.tail_port.p.y+a.y},f={x:i.info.head_port.p.x+a.x,y:i.info.head_port.p.y+a.y},d=Cn.sidesToPoints(i.info.tail_port.side,i.info.head_port.side),c=u.y>=f.y?1:-1;(d===12||d===67)&&u.y===f.y&&(c=-c);let m=s.info.lw,b=Math.min(m,3*(u.x+m-a.x)),g=Math.min(m,3*(f.x+m-a.x));Cn.leftLoop({edges:e,cnt:n,size1:t,size2:l,sinfo:r},{np:a,tp:u,hp:f,dx:m,dy:0,tx:b,hx:g,sgn:c})}function I2(e){let n=e.info.tail_port,t=e.info.head_port;if(!Cn.goesRight({tp:n,hp:t}))return 0;let o=e.info.label;if(!o?.dimen)return 18;let r=e.head.root.info.flip===!0;return 18+(r?o.dimen.y:o.dimen.x)}function Ws(e,n,t,o,r){let i=e[0],s=i.info.tail_port,l=i.info.head_port,a={tp:s,hp:l};Cn.goesRight(a)?t8(e,n,t,o,r):s.side&8||l.side&8?Cn.dispatchLeft({edges:e,cnt:n,size1:t,size2:o,sinfo:r},a):s.side&4?L2(e,n,t,o,r):s.side&1&&n8(e,n,t,o,r)}function A(e){return e>=0?Math.floor(e+.5):Math.ceil(e-.5)}var li=8;function Yd(e){let n;for(let t=e;t!==null;t=t.parent){let o=t.attrs.get("margin");if(o!==void 0){n=o;break}}return Te(n,li,0)}var _n=0,$t=1,An=2,sr=3;function ir(e){return e.info.rw??0}function si(e){return e.info.lw??0}function So(e){return e.info.order??0}function st(e){return e.info.rank??0}function i8(e){return e.info.UF_size??1}function s8(e){return e.info.minlen??1}function Ys(e){return e.info.weight??0}function qD(e){return e.info.dist??0}function O2(e){return e.info.nodesep??0}function fe(e){return e.info.minrank??0}function se(e){return e.info.maxrank??0}function ai(e){return e.info.n_cluster??0}function Tt(e){return e.info.ht1??0}function lt(e){return e.info.ht2??0}function Gn(e){return e.info.ranksep??0}function we(e,n,t,o){let r=new Ae(e,n,"");return r.info.minlen=A(Math.min(t,2147483647)),r.info.weight=o,Fa(r),r}function QD(e){for(let n=e.info.nlist;n!==void 0;n=n.info.next){n.info.save_in=n.info.in,n.info.save_out=n.info.out;let t=n.info.out?.size??0,o=n.info.in?.size??0;n.info.in={list:new Array(t+o+3),size:0},n.info.out={list:new Array(3),size:0}}}function ZD(e,n){let t=O2(e);return(e.root.info.has_labels??0)&on&&n+(e.info.abomShift??0)&1?5:t}function eB(e,n,t){let o=O2(e),r=So(n)<So(t.head),i=r?t.tail:t.head,s=r?t.head:t.tail,l=ir(i)+si(s),a=Math.trunc(s8(t)*o+l),u=St(i,s);u!==void 0?(a=Math.trunc(Math.max(a,l+o+A(qD(t)))),u.info.minlen=Math.max(u.info.minlen??1,a),u.info.weight=Math.max(u.info.weight??0,Ys(t))):t.info.label||we(i,s,a,Ys(t))}function nB(e,n){let t=n.info.flat_out;if(t)for(let o=0;o<t.size;o++)eB(e,n,t.list[o])}function tB(e,n,t,o){let r=O2(e),i=So(t.head)<=So(o.head)?t:o,s=i===t?o:t,l=s8(n)*r/2,a=l+ir(i.head)+si(i.tail);r8(i.tail,i.head)||we(i.head,i.tail,a,Ys(n));let u=l+ir(s.tail)+si(s.head);r8(s.head,s.tail)||we(s.tail,s.head,u,Ys(n))}function oB(e,n){let t=n.info.posAlg;if(!t)return;let o=n.info.save_out;!o||o.size<2||tB(e,t,o.list[0],o.list[1])}function l8(e,n){if(e===n)return!0;let t=e.info.out;if(!t)return!1;for(let o=0;o<t.size;o++)if(l8(t.list[o].head,n))return!0;return!1}function r8(e,n){return l8(e,n)}function rB(e){let n=e.info.other;if(!n||n.size===0)return 0;let t=0;for(let o=0;o<n.size;o++){let r=n.list[o];r.tail===r.head&&(t+=I2(r))}return t}function iB(e,n,t,o,r){let i=ZD(e,n),s=ir(t)+si(o)+i;we(t,o,s,0);let l=Math.trunc(r+s);return o.info.rank=l,l}function sB(e,n){let o=e.info.rank[n],r=0;for(let i=0;i<o.n;i++){let s=o.v[i];s.info.mval=s.info.rw,s.info.rw=ir(s)+rB(s),o.v[0]&&(s.info.rank=r);let l=o.v[i+1];l&&(r=iB(e,n,s,l,r)),oB(e,s),nB(e,s)}o.n>0&&(o.v[0].info.rank=0)}function lB(e){for(let n=e.info.minrank??0;n<=(e.info.maxrank??0);n++)sB(e,n)}function aB(e,n){let t=fB(e),o=n.info.head_port.p,r=n.info.tail_port.p,i=Math.trunc(o.x-r.x),s=Math.max(0,i),l=Math.max(0,-i);we(t,n.tail,s+1,Ys(n)),we(t,n.head,l+1,Ys(n)),t.info.rank=Math.min(st(n.tail)-s-1,st(n.head)-l-1)}function uB(e){for(let n=e.info.nlist;n!==void 0;n=n.info.next){let t=n.info.save_out;if(t)for(let o=0;o<t.size;o++)aB(e,t.list[o])}}function fB(e){let n=new We(0,"",e);return n.info.node_type=kt,n.info.in={list:[],size:0},n.info.out={list:[],size:0},n.info.next=e.info.nlist,e.info.nlist!==void 0&&(e.info.nlist.info.prev=n),e.info.nlist=n,n}function a8(e,n,t){QD(e),lB(e),uB(e),n(e),t(e)}function dB(e){let n,t=e.info.nlist;for(;t!==void 0;){let o=t.info.next;(t.info.node_type??0)===kt?(n!==void 0?n.info.next=o:e.info.nlist=o,o!==void 0&&(o.info.prev=n)):n=t,t=o}}function cB(e){let n=e.info.out;if(n){for(let o=0;o<n.size;o++)n.list[o].info.weight=void 0;n.list.length=0,n.size=0}let t=e.info.in;t&&(t.list.length=0,t.size=0),e.info.out=e.info.save_out,e.info.in=e.info.save_in}function u8(e){for(let n=e.info.nlist;n!==void 0;n=n.info.next)cB(n);dB(e)}var D2=8,f8=4,pB=1,mB=2,xB=4;function hB(e){let n=Js(e,"labelloc"),t=n&&n[0]==="b"?0:pB,o=Js(e,"labeljust");return o&&(o[0]==="l"?t|=mB:o[0]==="r"&&(t|=xB)),t}function Js(e,n){return e.attrs.get(n)??e.graphDefaultsSnapshot?.get(n)}function bB(e){return{fontsize:parseFloat(Js(e,"fontsize")??"")||As,fontname:Js(e,"fontname")??Gs,fontcolor:Js(e,"fontcolor")??Ms}}function gB(e,n){e.info.border||(e.info.border=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}]);let t=e.info.label_pos??1;e.root.info.flip?e.info.border[t&1?$t:sr]={x:n.y,y:n.x}:e.info.border[t&1?An:_n]=n}function Wt(e,n){if(!n)return;let t=Js(e,"label");if(!t)return;let{fontsize:o,fontname:r,fontcolor:i}=bB(e),s=Sn(t),l=s?wn(t):t,a=Hn(l,s,{fontname:r,fontsize:o,fontcolor:i},n,e);e.info.label=a,e.root.info.has_labels|=D2,e!==e.root&&(e.info.label_pos=hB(e),gB(e,{x:a.dimen.x+4*f8,y:a.dimen.y+2*f8}))}function yB(e){let n=e[e.length-1],t=n.n.info.out;for(;t&&n.i<t.size;){let o=t.list[n.i],r=o.head;if(r.info.onstack)Cd(o);else if(r.info.mark)n.i++;else{r.info.mark=1,r.info.onstack=1,n.i++,e.push({n:r,i:0});return}}n.n.info.onstack=0,e.pop()}function PB(e){if(e.info.mark)return;e.info.mark=1,e.info.onstack=1;let n=[{n:e,i:0}];for(;n.length>0;)yB(n)}function d8(e){let n=e.info.comp??[];for(let t=0;t<n.length;t++){e.info.nlist=n[t];for(let o=n[t];o!==void 0;o=o.info.next)o.info.mark=0;for(let o=n[t];o!==void 0;o=o.info.next)PB(o)}}function EB(e){return(e.head.info.rank??0)-(e.tail.info.rank??0)}function Xn(e){return EB(e)-(e.info.minlen??1)}function lr(e){return(e.info.tree_index??-1)>=0}function Kd(e,n,t){return e<=n&&n<=t}function Jd(e,n){e.list[e.size++]=n}function c8(e,n){let t=0,o=--e.size;for(;t<=o&&e.list[t]!==n;)t++;t<=o&&(e.list[t]=e.list[o])}function B2(e,n){if(lr(n))return-1;n.info.tree_index=e.treeEdges.length,e.treeEdges.push(n);let t=n.tail;t.info.mark=1,t.info.tree_out||(t.info.tree_out={list:[],size:0}),Jd(t.info.tree_out,n);let o=n.head;return o.info.mark=1,o.info.tree_in||(o.info.tree_in={list:[],size:0}),Jd(o.info.tree_in,n),0}function vB(e){return(e.tail.info.lim??0)>(e.head.info.lim??0)?e.tail:e.head}function F2(e,n){let t=e.info.lim??0,o=n;for(;o.info.low!==-1;){o.info.low=-1;let r=o.info.par;if(!r||(o.info.lim??0)>=t)break;o=vB(r)}}function p8(e,n,t){let o=n.info.tree_index;t.info.tree_index=o,e.treeEdges[o]=t,n.info.tree_index=-1,c8(n.tail.info.tree_out,n),c8(n.head.info.tree_in,n),t.tail.info.tree_out||(t.tail.info.tree_out={list:[],size:0}),Jd(t.tail.info.tree_out,t),t.head.info.tree_in||(t.head.info.tree_in={list:[],size:0}),Jd(t.head.info.tree_in,t)}var Ka=[],Ks=[],wo=[],qd=[],Qd=[];function qs(e,n,t,o){return Ka[o]=e,Ks[o]=n,wo[o]=t,qd[o]=0,Qd[o]=0,o+1}function z2(e){let n=e-1;return Ka[n]=void 0,Ks[n]=void 0,n}function SB(e,n){return n?[0,(lr(e)?e.info.cutvalue??0:0)-(e.info.weight??1)]:[1,e.info.weight??1]}function wB(e,n,t){return t>0?e.head===n?1:-1:e.tail===n?1:-1}function m8(e,n,t){let o=e.tail===n?e.head:e.tail,r=Kd(n.info.low??0,o.info.lim??0,n.info.lim??0),[i,s]=SB(e,r),l=wB(e,n,t);return i&&(l=-l),l<0?-s:s}function NB(e){let n=e.tail.info.par===e?e.tail:e.head,t=e.tail.info.par===e?1:-1,o=0,r=n.info.out;if(r)for(let s=0;s<r.size;s++)o+=m8(r.list[s],n,t);let i=n.info.in;if(i)for(let s=0;s<i.size;s++)o+=m8(i.list[s],n,t);e.info.cutvalue=o}function x8(e,n,t,o,r){if(!e)return o;let i=Ks[t];for(;n[t]<e.size;){let s=e.list[n[t]++];if(s!==i)return qs(r?s.head:s.tail,s,0,o)}return o}function RB(e,n){let t=qs(e,n,0,0);for(;t>0;){let o=t-1,r=Ka[o],i=x8(r.info.tree_out,qd,o,t,!0);if(i!==t){t=i;continue}if(i=x8(r.info.tree_in,Qd,o,t,!1),i!==t){t=i;continue}let s=Ks[o];s&&NB(s),t=z2(t)}}function g8(e){TB(e.g.info.nlist),RB(e.g.info.nlist)}function h8(e,n,t,o,r){if(!e)return o;let i=Ks[t],s=wo[t];for(;n[t]<e.size;){let l=e.list[n[t]++];if(l!==i){let a=r?l.head:l.tail;return a.info.par=l,a.info.low=s,qs(a,l,s,o)}}return o}function TB(e){e.info.par=void 0,e.info.low=1;let n=qs(e,void 0,1,0),t=0;for(;n>0;){let o=n-1,r=Ka[o],i=h8(r.info.tree_out,qd,o,n,!0);if(i!==n){n=i;continue}if(i=h8(r.info.tree_in,Qd,o,n,!1),i!==n){n=i;continue}r.info.lim=wo[o],t=wo[o],n=z2(n),n>0&&(wo[n-1]=t+1)}return t+1}function b8(e,n,t,o,r){if(!e)return o;let i=Ks[t];for(;n[t]<e.size;){let s=e.list[n[t]++];if(s===i)continue;let l=r?s.head:s.tail,a=l.info,u=wo[t];if(a.par===s&&a.low===u){wo[t]=a.lim+1;continue}return a.par=s,a.low=u,qs(l,s,u,o)}return o}function kB(e){let n=e-1,t=Ka[n].info,o=b8(t.tree_out,qd,n,e,!0);if(o!==e||(o=b8(t.tree_in,Qd,n,e,!1),o!==e))return o;let r=wo[n];return t.lim=r,e=z2(e),e>0&&(wo[e-1]=r+1),e}function y8(e,n,t){if(e.info.par===n&&(e.info.low??0)===t)return(e.info.lim??0)+1;e.info.par=n,e.info.low=t;let o=qs(e,n,t,0);for(;o>0;)o=kB(o);return(e.info.lim??0)+1}function j2(e){return e.heapIndex>=0}function ui(e,n){let t=n.get(e);for(;t.par&&t.par!==t;)t.par.par&&(t.par=t.par.par),t=t.par;return t}function CB(e,n){return j2(n)?j2(e)&&n.size<e.size?e:n:e}function _B(e,n){let t=e;for(;t.par&&t.par!==t;)t=t.par;let o=n;for(;o.par&&o.par!==o;)o=o.par;if(t===o)return t;let r=CB(t,o);return t.par=r,o.par=r,r.size=t.size+o.size,r}function E8(e,n,t){return B2(e.ctx,t)!==0?-1:(e.nodeMap.set(n,e.st),e.todo.push({v:n,inI:0,outI:0,rv:1}),1)}function AB(e){let n=e.todo[e.todo.length-1],t=n.v.info.in;if(!t)return 0;for(;n.inI<t.size;){let o=t.list[n.inI++];if(!(lr(o)||e.nodeMap.has(o.tail)||Xn(o)!==0))return E8(e,o.tail,o)}return 0}function GB(e){let n=e.todo[e.todo.length-1],t=n.v.info.out;if(!t)return 0;for(;n.outI<t.size;){let o=t.list[n.outI++];if(!(lr(o)||e.nodeMap.has(o.head)||Xn(o)!==0))return E8(e,o.head,o)}return 0}function MB(e){let n=AB(e);if(n===-1)return-1;if(n===1)return;let t=GB(e);if(t===-1)return-1;if(t===1)return;let o=e.todo.pop();if(e.todo.length===0)return o.rv;e.todo[e.todo.length-1].rv+=o.rv}function LB(e,n,t,o){o.set(n,t);let r=[{v:n,inI:0,outI:0,rv:1}],i={ctx:e,st:t,nodeMap:o,todo:r},s=1;for(;r.length>0;){let l=MB(i);if(l===-1)return-1;if(l!==void 0){s=l;break}}return s}function IB(e,n,t){let o={rep:n,size:0,heapIndex:-1};o.par=o;let r=LB(e,n,o,t);return r<0?null:(o.size=r,o)}function OB(e,n,t){let o=e[e.length-1],r=o.v.info.out;if(!r)return[!1,t];for(;o.outI<r.size;){let i=r.list[o.outI++];if(!lr(i))ui(i.head,n)!==o.ts&&(t===void 0||Xn(i)<Xn(t))&&(t=i);else if(i.head!==o.from)return e.push({v:i.head,ts:ui(i.head,n),from:o.v,outI:0,inI:0}),[!0,t]}return[!1,t]}function DB(e,n,t){let o=e[e.length-1],r=o.v.info.in;if(!r)return[!1,t];for(;o.inI<r.size;){let i=r.list[o.inI++];if(!lr(i))ui(i.tail,n)!==o.ts&&(t===void 0||Xn(i)<Xn(t))&&(t=i);else if(i.tail!==o.from)return e.push({v:i.tail,ts:ui(i.tail,n),from:o.v,outI:0,inI:0}),[!0,t]}return[!1,t]}function BB(e,n){let t=[{v:e,ts:ui(e,n),outI:0,inI:0}],o;for(;t.length>0;){let r=t[t.length-1];if(r.outI===0&&r.inI===0&&o!==void 0&&Xn(o)===0){t.pop();continue}let[i,s]=OB(t,n,o);if(o=s,i)continue;let[l,a]=DB(t,n,o);o=a,l||t.pop()}return o}function FB(e,n,t){let o=e.elt,r=o[n];o[n]=o[t],o[t]=r,o[n].heapIndex=n,o[t].heapIndex=t}function zB(e,n){let t=e.elt,o=2*(n+1)-1,r=2*(n+1),i=n;return o<e.size&&t[o].size<t[i].size&&(i=o),r<e.size&&t[r].size<t[i].size&&(i=r),i}function H2(e,n){let t=n;for(;t<e.size;){let o=zB(e,t);if(o===t)break;FB(e,t,o),t=o}}function jB(e,n){let t={elt:e,size:n};for(let o=0;o<n;o++)e[o].heapIndex=o;for(let o=Math.floor(n/2)-1;o>=0;o--)H2(t,o);return t}function HB(e){let n=e.elt[0];return n.heapIndex=-1,e.elt[0]=e.elt[e.size-1],e.elt[0].heapIndex=0,e.elt[e.size-1]=n,e.size--,H2(e,0),n}function P8(e,n,t){let o=[[e,n]];for(;o.length>0;){let[r,i]=o.pop();r.info.rank=(r.info.rank??0)+t;let s=r.info.tree_in;if(s)for(let a=0;a<s.size;a++){let u=s.list[a].tail;u!==i&&o.push([u,r])}let l=r.info.tree_out;if(l)for(let a=0;a<l.size;a++){let u=l.list[a].head;u!==i&&o.push([u,r])}}}function VB(e,n,t){let o=ui(n.tail,t),r=ui(n.head,t);if(j2(o)){let i=-Xn(n);i!==0&&P8(r.rep,void 0,i)}else{let i=Xn(n);i!==0&&P8(o.rep,void 0,i)}return B2(e,n)!==0?null:_B(o,r)}function UB(e,n,t){let o=0;for(let r=e.g.info.nlist;r;r=r.info.next){if(n.has(r))continue;let i=IB(e,r,n);if(i===null)return-1;t[o++]=i}return o}function XB(e,n,t){for(;n.size>1;){let o=HB(n),r=BB(o.rep,t);if(!r)return!1;let i=VB(e,r,t);if(i===null)return!1;H2(n,i.heapIndex)}return!0}function v8(e){let n=new Map,t=new Array(e.nNodes),o=UB(e,n,t);if(o<0)return 2;let r=jB(t,o);return XB(e,r,n)?(g8(e),0):1}function Qs(e,n,t){let o=e[n];e[n]=e[t],e[t]=o}function S8(e,n,t,o){let r=o;for(;r-- >0;)Qs(e,n++,t++)}function Zd(e,n,t,o,r){return r(e[n],e[t])<0?r(e[t],e[o])<0?t:r(e[n],e[o])<0?o:n:r(e[t],e[o])>0?t:r(e[n],e[o])<0?n:o}function w8(e,n,t,o,r=0){let i=0;for(let s=n+1;s<n+t;s++)for(let l=s;l>n&&o(e[l-1],e[l])>0;l--)if(Qs(e,l,l-1),r!==0&&++i>r)return!1;return!0}function $B(e,n,t,o){let r=n+(t>>1),i=n,s=n+(t-1);if(t>40){let l=t>>3;i=Zd(e,i,i+l,i+2*l,o),r=Zd(e,r-l,r,r+l,o),s=Zd(e,s-2*l,s-l,s,o)}return Zd(e,i,r,s,o)}function WB(e,n,t,o){let r=n+1,i=n+1,s=n+(t-1),l=n+(t-1),a=!1;for(;;){let u;for(;i<=s&&(u=o(e[i],e[n]))<=0;)u===0&&(a=!0,Qs(e,r,i),r++),i++;for(;i<=s&&(u=o(e[s],e[n]))>=0;)u===0&&(a=!0,Qs(e,s,l),l--),s--;if(i>s)break;Qs(e,i,s),a=!0,i++,s--}return{pa:r,pb:i,pc:s,pd:l,swapped:a}}function YB(e,n,t,o,r){let i=s=>e[n+s-1];for(;;){let s=o*2;if(s>t||(s<t&&r(i(s),i(s+1))<0&&s++,r(i(s),i(o))<=0))return;let l=e[n+o-1];e[n+o-1]=e[n+s-1],e[n+s-1]=l,o=s}}function JB(e,n,t,o,r){let i=a=>e[n+a-1],s=1,l;for(;l=s*2,!(l>t);)l<t&&r(i(l),i(l+1))<0&&l++,e[n+s-1]=e[n+l-1],s=l;for(;;){if(l=s,s=l>>1,l===1||r(o,i(s))<0){e[n+l-1]=o;return}e[n+l-1]=e[n+s-1]}}function KB(e,n,t,o){if(!(t<=1)){for(let r=t>>1;r>=1;r--)YB(e,n,t,r,o);for(let r=t;r>1;r--){let i=e[n+r-1];e[n+r-1]=e[n],JB(e,n,r-1,i,o)}}}function V2(e,n,t,o,r){for(;;){if(r--<=0){KB(e,n,t,o);return}if(t<=7){w8(e,n,t,o);return}Qs(e,n,$B(e,n,t,o));let{pa:i,pb:s,pc:l,pd:a,swapped:u}=WB(e,n,t,o),f=n+t,d=Math.min(i-n,s-i);if(S8(e,n,s-d,d),d=Math.min(a-l,f-a-1),S8(e,s,f-d,d),!u){let b=1+Math.floor(t/4);if(w8(e,n,t,o,b))return}let c=s-i,m=a-l;if(c<=m){if(c>1&&V2(e,n,c,o,r),m>1){n=f-m,t=m;continue}}else if(m>1&&V2(e,f-m,m,o,r),c>1){t=c;continue}return}}function be(e,n){if(e.length>1){let t=2*(32-Math.clz32(e.length)-1);V2(e,0,e.length,n,t)}return e}function Mn(e){return e.info.rank??0}function ec(e){return e.info.low??0}function Yt(e){return e.info.lim??0}function oc(e){return e.info.node_type??0}function qB(e){return e.info.in?.size??0}function QB(e){return e.info.out?.size??0}function N8(e){return(e.info.tree_in?.size??0)+(e.info.tree_out?.size??0)}function Jt(e){return e.info.cutvalue??0}function R8(e){return e.info.weight??1}function nc(e){return e.info.minlen??1}function ZB(e){e.info.rank=0;let n=e.info.in;if(n)for(let t=0;t<n.size;t++){let o=n.list[t],r=Mn(o.tail)+nc(o);r>Mn(e)&&(e.info.rank=r)}}function eF(e,n){let t=e.info.out;if(t)for(let o=0;o<t.size;o++){let r=t.list[o],i=(r.head.info.priority??0)-1;r.head.info.priority=i,i<=0&&n.push(r.head)}}function nF(e){let n=[];for(let t=e.g.info.nlist;t;t=t.info.next)(t.info.priority??0)===0&&n.push(t);for(;n.length>0;){let t=n.shift();ZB(t),eF(t,n)}}function tF(e,n,t,o){for(;e.sI<n;){let r=e.treeEdges[e.sI];if(Jt(r)<0&&((!o||Jt(r)<Jt(o))&&(o=r),++t>=e.searchSize))return[o,t];e.sI++}return[o,t]}function oF(e){let n,t=0,o=e.sI;for(;e.sI<e.treeEdges.length;){let r=e.treeEdges[e.sI];if(Jt(r)<0&&((!n||Jt(r)<Jt(n))&&(n=r),++t>=e.searchSize))return n;e.sI++}return o>0&&(e.sI=0,[n,t]=tF(e,o,t,n)),n}function rF(e,n,t,o,r){let i=e.info.out;if(!i)return;let s=e.info.lim,l=i.list,a=i.size;for(let u=0;u<a;u++){let f=l[u],d=f.info,c=f.head,m=c.info;if((d.tree_index??-1)>=0)m.lim<s&&o.push(c);else{let b=m.lim;if(b<n||b>t){let g=(m.rank??0)-(f.tail.info.rank??0)-(d.minlen??1);(r.e===void 0||g<r.slack)&&(r.e=f,r.slack=g)}}}}function iF(e,n,t){let o=e.info.tree_in;if(!o||t<=0)return;let r=e.info.lim;for(let i=0;i<o.size;i++){let s=o.list[i];s.tail.info.lim<r&&n.push(s.tail)}}function sF(e,n,t){let o=[e],r={e:void 0,slack:Number.MAX_SAFE_INTEGER};for(;o.length>0;){let i=o.pop();rF(i,n,t,o,r),iF(i,o,r.slack)}return r.e}function lF(e,n,t,o,r){let i=e.info.in;if(!i)return;let s=e.info.lim,l=i.list,a=i.size;for(let u=0;u<a;u++){let f=l[u],d=f.info,c=f.tail,m=c.info;if((d.tree_index??-1)>=0)m.lim<s&&o.push(c);else{let b=m.lim;if(b<n||b>t){let g=(f.head.info.rank??0)-(m.rank??0)-(d.minlen??1);(r.e===void 0||g<r.slack)&&(r.e=f,r.slack=g)}}}}function aF(e,n,t){let o=e.info.tree_out;if(!o||t<=0)return;let r=e.info.lim;for(let i=0;i<o.size;i++){let s=o.list[i];s.head.info.lim<r&&n.push(s.head)}}function uF(e,n,t){let o=[e],r={e:void 0,slack:Number.MAX_SAFE_INTEGER};for(;o.length>0;){let i=o.pop();lF(i,n,t,o,r),aF(i,o,r.slack)}return r.e}function k8(e){let n=Yt(e.tail),t=Yt(e.head);return n<t?uF(e.tail,ec(e.tail),n):sF(e.head,ec(e.head),t)}function T8(e,n,t,o){let r=e;for(;!Kd(ec(r),Yt(n),Yt(r));){let i=r.info.par;(r===i.tail?o:!o)?i.info.cutvalue=Jt(i)+t:i.info.cutvalue=Jt(i)-t,r=Yt(i.tail)>Yt(i.head)?i.tail:i.head}return r}function Zs(e,n){let t=[e];for(;t.length>0;){let r=t.pop().info;r.rank=(r.rank??0)-n;let i=r.par,s=r.tree_out;if(s)for(let a=0;a<s.size;a++){let u=s.list[a];u!==i&&t.push(u.head)}let l=r.tree_in;if(l)for(let a=0;a<l.size;a++){let u=l.list[a];u!==i&&t.push(u.tail)}}}function fF(e,n){if(!(n<=0)){if(N8(e.tail)===1){Zs(e.tail,n);return}if(N8(e.head)===1){Zs(e.head,-n);return}Yt(e.tail)<Yt(e.head)?Zs(e.tail,n):Zs(e.head,-n)}}function dF(e,n,t){fF(n,Xn(t));let o=Jt(n),r=T8(t.tail,t.head,o,!0);if(T8(t.head,t.tail,o,!1)!==r)return 2;let i=ec(r);return F2(r,t.head),F2(r,t.tail),t.info.cutvalue=-o,n.info.cutvalue=0,p8(e,n,t),y8(r,r.info.par,i),0}function C8(e){let n=Number.MAX_SAFE_INTEGER,t=Number.MIN_SAFE_INTEGER;for(let o=e.g.info.nlist;o;o=o.info.next)if(oc(o)===0){let r=Mn(o);r<n&&(n=r),r>t&&(t=r)}for(let o=e.g.info.nlist;o;o=o.info.next)o.info.rank=Mn(o)-n;return t-n}function U2(e){e.info.tree_in=void 0,e.info.tree_out=void 0,e.info.mark=0}function $2(e){e.treeEdges.length=0,e.sI=0}function el(e){for(let n=e.g.info.nlist;n;n=n.info.next)U2(n);$2(e)}function cF(e){for(let n=0;n<e.treeEdges.length;n++){let t=e.treeEdges[n];if(Jt(t)!==0)continue;let o=k8(t);if(!o)continue;let r=Xn(o);if(r<=1)continue;let i=r>>1;Yt(t.tail)<Yt(t.head)?Zs(t.tail,i):Zs(t.head,-i)}el(e)}function pF(e){let n=e.attrs.get("TBbalance")??"";return n==="min"?1:n==="max"?2:0}function mF(e,n,t){if(n!==0)for(let o=e.g.info.nlist;o;o=o.info.next)oc(o)===0&&(n===1&&qB(o)===0&&(o.info.rank=0),n===2&&QB(o)===0&&(o.info.rank=t))}function xF(e,n,t){return t>1?Mn(n)-Mn(e):Mn(e)-Mn(n)}function hF(e,n,t){let o=[];for(let r=e.g.info.nlist;r;r=r.info.next)o.push(r);be(o,(r,i)=>xF(r,i,t));for(let r of o)oc(r)===0&&n[Mn(r)]++;return o}function bF(e,n){let t=0,o=0,r=0,i=n,s=e.info.in;if(s)for(let a=0;a<s.size;a++){let u=s.list[a];t+=R8(u);let f=Mn(u.tail)+nc(u);f>r&&(r=f)}let l=e.info.out;if(l)for(let a=0;a<l.size;a++){let u=l.list[a];o+=R8(u);let f=Mn(u.head)-nc(u);f<i&&(i=f)}return r<0&&(r=0),[t,o,r,i]}function gF(e,n,t,o,r){if(r>0){e.info.rank=r===1?n:t;return}let i=n;for(let s=n+1;s<=t;s++)o[s]<o[i]&&(i=s);o[Mn(e)]--,o[i]++,e.info.rank=i}function yF(e){let n=C8(e),t=new Array(n+1).fill(0),o=pF(e.g);mF(e,o,n);let r=hF(e,t,o);for(let i of r){if(oc(i)!==0){U2(i);continue}let[s,l,a,u]=bF(i,n);s===l&&gF(i,a,u,t,o),U2(i)}$2(e)}function PF(e,n){return e.info.priority=(e.info.priority??0)+1,n.info.cutvalue=0,n.info.tree_index=-1,Mn(n.head)-Mn(n.tail)<nc(n)}function EF(e,n){e.g=n,e.treeEdges=[],e.sI=0,e.nEdges=0,e.nNodes=0,e.searchSize=30;let t=!0;for(let o=n.info.nlist;o;o=o.info.next){o.info.mark=0,e.nNodes++,o.info.priority=0;let r=o.info.in;if(r)for(let s=0;s<r.size;s++)PF(o,r.list[s])&&(t=!1);o.info.tree_in={list:[],size:0};let i=o.info.out;if(i)for(let s=0;s<i.size;s++)e.nEdges++;o.info.tree_out={list:[],size:0}}return t}function vF(e,n){let t=0,o;for(;(o=oF(e))!==void 0;){let r=k8(o);if(!r)break;let i=dF(e,o,r);if(i!==0)return el(e),i;if(++t>=n)break}return 0}function SF(e,n){n===1?(yF(e),$2(e)):n===2?cF(e):(C8(e),el(e))}function W2(e,n,t,o){let r={g:e,treeEdges:[],sI:0,nEdges:0,nNodes:0,searchSize:30};EF(r,e)||nF(r),o>=0&&(r.searchSize=o);let i=v8(r);if(i!==0)return el(r),i;if(t<=0)return el(r),0;let s=vF(r,t);return s!==0?(el(r),s):(SF(r,n),0)}function qa(e,n,t){let o=e.attrs.get("searchsize"),r=o!==void 0?parseInt(o,10):30;return W2(e,n,t,r)}var wF=1e3,NF=1e3,A8=6,RF="\x7Froot",TF="\x7Ftop",kF="\x7Fbot";function nl(e){return e.info.minlen??1}function tl(e){return e.info.weight??1}function fi(e){return e.info.rank??0}function q2(e){return e.info.maxrank??-1}function Q2(e){return e.info.minrank??Number.MAX_SAFE_INTEGER}function CF(e){return e.info.parent!==void 0}function Y2(e){return e.info.level??0}function _8(e){return e.info.parent??e}function at(e){let n=e.info.set;return n?(n!==e&&(n=e.info.set=at(n)),n):(e.info.set=e,e)}function J2(e,n){return n&&(at(n).info.set=at(e)),e}function G8(e){let n=M(e),t=n[0];if(!t)return;let o=at(t);for(let r of n)J2(o,r);return o}function Qa(e,n,t){let o=e.nodes.get(n);if(o)return o;let r=new We(e.nodes.size,n,e);return r.info.in={list:[],size:0},r.info.out={list:[],size:0},t.lastNode?(r.info.prev=t.lastNode,t.lastNode.info.next=r):(r.info.prev=void 0,e.info.nlist=r),t.lastNode=r,r.info.next=void 0,e.nodes.set(n,r),r}function rc(e,n,t){return e.edges.find(o=>o.tail===n&&o.head===t)}function ar(e,n,t){let o=new Ae(n,t,"");return o.info.minlen=0,o.info.weight=0,e.edges.push(o),o}function _F(e,n){let t=e.edges.indexOf(n);t>=0&&e.edges.splice(t,1)}function Z2(e,n,t){e.info.minlen=Math.max(nl(e),n),e.info.weight=tl(e)+t}function AF(e){let n=e.attrs.get("rank")??"";return n==="min"?ol:n==="source"?di:n==="max"?Za:n==="sink"?rl:n==="same"?em:A8}function GF(e,n){return gn(e)?(n?(e.info.level=Y2(n)+1,e.info.parent=n,tm(n,e),om(n,e)):e.info.level=0,e):n}function MF(e){for(let n of M(e))n.info.clust||(n.info.clust=e)}function LF(e,n){let t=AF(e);if(t===A8)return;let o=G8(e);!o||!n||(t===ol||t===di?n.info.minrep=J2(o,n.info.minrep):(t===Za||t===rl)&&(n.info.maxrep=J2(o,n.info.maxrep)))}function IF(e){if(!gn(e)||!e.info.minrep||e.info.minrep!==e.info.maxrep)return;let n=G8(e);n&&(e.info.minrep=n,e.info.maxrep=n)}function M8(e,n){if(e.nodes.size===0)return;let t=GF(e,n);for(let o of e.subgraphs.values())M8(o,t);gn(e)&&MF(e),LF(e,t),IF(e)}function OF(e,n,t){t.lastNode=void 0;let o=M(e);for(let r of o)at(r)===r&&(r.info.rep=Qa(n,r.name,t));for(let r of o)r.info.rep||(r.info.rep=at(r).info.rep)}function L8(e,n,t,o){let r=rc(e,n,t)??rc(e,t,n)??ar(e,n,t);Z2(r,nl(o),tl(o))}function DF(e,n,t){for(let o of e.edges){if(o.head!==n)continue;let r=o.tail;for(let i of e.edges)if(i.tail===r&&i.head===t)return!0}return!1}function BF(e,n,t,o){e.info.minlen=Math.max(nl(e),0),e.info.weight=tl(e)+t*wF,n.info.minlen=Math.max(nl(n),o),n.info.weight=tl(n)+t}function FF(e,n,t,o,r){if(DF(e,n,t))return;let i=Qa(e,`_weak_${r.weakId++}`,r);BF(ar(e,i,n),ar(e,i,t),tl(o),nl(o))}function zF(e){let n=e.attrs.get("constraint");return n?!Ne(n):!1}function K2(e){return Ne(e.attrs.get("compact")??"")}function jF(e,n){let t=e,o=n;for(;t!==o;)Y2(t)>=Y2(o)?t=_8(t):o=_8(o);return t}function HF(e){let n=e.tail.info.clust,t=e.head.info.clust;if(n===t)return!0;if(!n||!t)return!1;let o=jF(n,t);return o===n||o===t}function VF(e,n,t){let o=n?at(e.tail):void 0,r=t?at(e.head):void 0;return n!==void 0&&o===n.info.maxrep||t!==void 0&&r===t.info.minrep}function UF(e,n,t,o){let r=n.tail.info.clust,i=n.head.info.clust,s=t,l=o;if(VF(n,r,i)){let a=s;s=l,l=a}L8(e,s,l,n)}function XF(e,n,t,o){if(zF(n))return;let r=at(n.head).info.rep;if(!r||t===r)return;if(HF(n)){UF(e,n,t,r);return}let i=n.tail.info.clust,s=n.head.info.clust;i&&K2(i)||s&&K2(s)?FF(e,t,r,n,o):L8(e,t,r,n)}function $F(e,n,t){for(let o of M(e)){let r=o.info.rep;if(r)for(let i of o.outEdges(e))XF(n,i,r,t)}}function WF(e,n,t,o,r){let i=at(o).info.rep;i&&(o.inEdges(e).length===0&&(r.top||(r.top=Qa(n,TF,t)),ar(n,r.top,i)),o.outEdges(e).length===0&&(r.bot||(r.bot=Qa(n,kF,t)),ar(n,i,r.bot)))}function YF(e,n,t,o,r){let i={top:o,bot:r};for(let s of M(e))WF(e,n,t,s,i);return i.top&&i.bot&&Z2(rc(n,i.top,i.bot)??ar(n,i.top,i.bot),0,NF),i}function I8(e,n,t,o,r){let i=o,s=r;if(gn(e)&&K2(e)){let l=YF(e,n,t,i,s);i=l.top,s=l.bot}for(let l of e.subgraphs.values())I8(l,n,t,i,s)}function JF(e,n){let t=rc(e,n.head,n.tail)??ar(e,n.head,n.tail);Z2(t,nl(n),tl(n)),_F(e,n)}function O8(e,n,t){n.info.mark||(n.info.mark=1,n.info.onstack=1,t.push({v:n,edges:n.outEdges(e).slice(),i:0}))}function KF(e,n){let t=n[n.length-1];if(t.i<t.edges.length){let o=t.edges[t.i++];o.head.info.onstack?JF(e,o):o.head.info.mark||O8(e,o.head,n)}else t.v.info.onstack=0,n.pop()}function qF(e){for(let n of e.nodes.values())n.info.mark=0,n.info.onstack=0;for(let n of e.nodes.values()){if(n.info.mark)continue;let t=[];for(O8(e,n,t);t.length>0;)KF(e,t)}}function QF(e,n,t){let o=[n];for(n.info.hops=t;o.length>0;){let r=o.pop();for(let i of r.outEdges(e))i.head.info.hops||(i.head.info.hops=t,o.push(i.head));for(let i of e.edges)i.head===r&&!i.tail.info.hops&&(i.tail.info.hops=t,o.push(i.tail))}}function ZF(e,n){for(let o of e.nodes.values())o.info.hops=0;let t=0;for(let o of e.nodes.values())o.info.hops||QF(e,o,++t);if(t>1){let o=Qa(e,RF,n),r=1;for(let i of e.nodes.values())i.info.hops===r&&(ar(e,o,i),r++)}return t}function ez(e){for(let n of e.edges)n.tail.info.out||(n.tail.info.out={list:[],size:0}),n.tail.info.out.list[n.tail.info.out.size++]=n,n.head.info.in||(n.head.info.in={list:[],size:0}),n.head.info.in.list[n.head.info.in.size++]=n}function nz(e){let n=e.info.n_cluster??0,t=e.info.clust??[];for(let o=1;o<=n;o++)D8(t[o-1],!1)}function tz(e,n,t){let o=fi(n);q2(e)<o&&(e.info.maxrank=o),Q2(e)>o&&(e.info.minrank=o,t.v=n)}function D8(e,n){if(nz(e),!CF(e)&&!n)return;e.info.minrank=Number.MAX_SAFE_INTEGER,e.info.maxrank=-1;let t={v:void 0};for(let o of M(e))tz(e,o,t);e.info.leader=t.v}function oz(e,n){n.info.rank=fi(at(n).info.rep),q2(e)<fi(n)&&(e.info.maxrank=n.info.rank),Q2(e)>fi(n)&&(e.info.minrank=n.info.rank)}function rz(e,n,t){e.info.hops=n.info.hops??0;let o=fi(e);t[e.info.hops]>o&&(t[e.info.hops]=o)}function iz(e,n){for(let t of M(e))t.info.rank=fi(t)-n[t.info.hops??0]}function sz(e,n){for(let t of M(e))t.info.rank=fi(t)-n}function lz(e,n){for(let t of M(e))oz(e,t),n&&rz(t,at(t).info.rep,n)}function az(e,n){if(n)return iz(e,n),!0;let t=Q2(e)===Number.MAX_SAFE_INTEGER?0:e.info.minrank??0;return t>0&&(sz(e,t),e.info.minrank=0,e.info.maxrank=q2(e)-t),!1}function uz(e,n,t){e.info.minrank=Number.MAX_SAFE_INTEGER,e.info.maxrank=-1;let o=t>1?new Array(t+1).fill(Number.MAX_SAFE_INTEGER):void 0;lz(e,o);let r=az(e,o);D8(e,r);for(let i of n.nodes.values())i.info.in=void 0,i.info.out=void 0}function B8(e){let n={lastNode:void 0,weakId:0},t=new $e("level assignment constraints","strict-directed");nm(e);let o=e.attrs.get("nslimit1"),r=o?il(e.nodes.size,parseFloat(o)):Number.MAX_SAFE_INTEGER,i=e.attrs.get("searchsize"),s=i?parseInt(i,10):-1;M8(e,void 0),OF(e,t,n),$F(e,t,n),I8(e,t,n,void 0,void 0),qF(t);let l=ZF(t,n);ez(t),W2(t,1,r,s),uz(e,t,l)}var U8=!1;function rm(e){U8=e}function im(e,n){let t=e.info.order!==void 0?e.info.order:0;return ei*t+n}function Ct(e){return e.info.xpenalty!==void 0?e.info.xpenalty:1}function F8(e){return e.info.ranktype===rn&&e.info.node_type===U}function fz(e,n){let t=e.info.clust,o=n.info.clust;if(U8){if(t!==o)return 1}else if(t!==o&&t&&o)return F8(e)||F8(n)?0:1;return 0}function sm(e,n,t){if(fz(n,t)!==0)return 1;let o=n.info.rank!==void 0?n.info.rank:0,r=e.info.rank;if(!r)return 0;let s=r[o].flat;if(!s)return 0;let l=n.info.low!==void 0?n.info.low:0,a=t.info.low!==void 0?t.info.low:0,u=e.info.flip??!1;return Gd(s,u?a:l,u?l:a)?1:0}function z8(e,n){return(n?e.head:e.tail).info.order??0}function j8(e,n){return n?e.info.head_port.p.x:e.info.tail_port.p.x}function dz(e,n,t,o){return e>t||e===t&&n>o?1:e<t||e===t&&n<o?-1:0}function H8(e,n,t,o){if(!(!e||!n))for(let r=0;r<e.size;r++){let i=e.list[r],s=z8(i,t),l=j8(i,t),a=Ct(i);for(let u=0;u<n.size;u++){let f=n.list[u],d=dz(s,l,z8(f,t),j8(f,t));d>0?o[0]+=a*Ct(f):d<0&&(o[1]+=a*Ct(f))}}}function cz(e,n,t,o){let r=[0,0];return t&&H8(e.info.in,n.info.in,!1,r),o&&H8(e.info.out,n.info.out,!0,r),r}function eu(e,n,t){let o=n.info.rank!==void 0?n.info.rank:0,r=e.root.info.rank;if(!r)return;let i=n.info.order!==void 0?n.info.order:0,s=t.info.order!==void 0?t.info.order:0;r[o].v[i]=t,r[o].v[s]=n,n.info.order=s,t.info.order=i}function pz(e,n,t){return n<e||e>0&&t&&n===e}function mz(e,n,t,o){e&&(e[n].valid=!1,n>t&&(e[n-1].valid=!1),n<o&&(e[n+1].valid=!1))}function X8(e){return[e.info.minrank??0,e.info.maxrank??0]}function xz(e,n,t,o){e[n].candidate=!0,n>t&&(e[n-1].candidate=!0),n<o&&(e[n+1].candidate=!0)}function hz(e,n,t,o){let r=n.info.rank;if(!r)return 0;let i=r[t],[s,l]=X8(n);i.candidate=!1;let a=0;for(let u=0;u<i.n-1;u++){let f=oe(i,u),d=oe(i,u+1);if(!f||!d||sm(n,f,d)!==0)continue;let c=t>0,m=(r[t+1]?.n??0)>0,[b,g]=cz(f,d,c,m);pz(b,g,o)&&(eu(e,f,d),a+=b-g,xz(r,t,s,l),mz(e.root.info.rank,t,s,l))}return a}function bz(e,n,t){for(let o=n;o<=t;o++)e[o]&&(e[o].candidate=!0)}function nu(e,n,t){let o=n.info.rank;if(!o)return;let[r,i]=X8(n);bz(o,r,i);let s;do{s=0;for(let l=r;l<=i;l++)o[l]?.candidate&&(s+=hz(e,n,l,t))}while(s>=1)}function gz(e,n,t){if(t){let i=e.head.info.order!==void 0?e.head.info.order:0;return((n.head.info.order!==void 0?n.head.info.order:0)-i)*(n.info.tail_port.p.x-e.info.tail_port.p.x)<0?Ct(e)*Ct(n):0}let o=e.tail.info.order!==void 0?e.tail.info.order:0;return((n.tail.info.order!==void 0?n.tail.info.order:0)-o)*(n.info.head_port.p.x-e.info.head_port.p.x)<0?Ct(e)*Ct(n):0}function yz(e,n){let t=n>0,o=0;for(let r=0;r<e.size;r++){let i=e.list[r];for(let s=r+1;s<e.size;s++)o+=gz(i,e.list[s],t)}return o}function Pz(e,n,t,o){let r=0;for(let i=0;i<e.size;i++){let s=e.list[i],l=(s.head.info.order!==void 0?s.head.info.order:0)-o;for(let a=l+1;a<=t;a++)r+=n[a]*Ct(s)}return r}function Ez(e,n,t,o){for(let r=0;r<e.size;r++){let i=e.list[r],s=(i.head.info.order!==void 0?i.head.info.order:0)-o;s>t&&(t=s),n[s]+=Ct(i)}return t}function V8(e,n){let t=0;for(let o=0;o<e.n;o++){let r=oe(e,o);if(!r||!r.info.has_port)continue;let i=n>0?r.info.out:r.info.in;i&&(t+=yz(i,n))}return t}function vz(e,n,t){let o=n.info.rank;if(!o)return 0;let r=e.root.info.rank;if(!r)return 0;let i=r[t+1],s=i!==void 0?i.n:0,l=new Array(s+1).fill(0),a=o[t],u=o[t+1]!==void 0?o[t+1].vStart??0:0,f=0,d=0;for(let m=0;m<a.n;m++){let b=oe(a,m);!b||!b.info.out||(d>0&&(f+=Pz(b.info.out,l,d,u)),d=Ez(b.info.out,l,d,u))}f+=V8(a,1);let c=o[t+1];return c&&(f+=V8(c,-1)),f}function ci(e){let n=e.globalMinRank,t=e.globalMaxRank,o=e.root.info.rank;if(!o)return 0;let r=0;for(let i=n;i<t;i++){let s=o[i];if(s.valid)r+=s.cache_nc;else{let l=vz(e,e.root,i);s.cache_nc=l,s.valid=!0,r+=l}}return r}function $8(e,n){let t=e.info.flat_out;if(t){for(let o=0;o<t.size;o++)if(t.list[o].head===n)return t.list[o]}}function am(e,n){let t=$8(n.head,n.tail);if(t!==void 0)kn(n,t),t.info.edge_type===tn&&t.info.to_orig===void 0&&(t.info.to_orig=n),n.tail.info.other||(n.tail.info.other={list:[],size:0}),Qr(n.tail.info.other,n);else{let o=ni(n.head,n.tail,n);o.info.edge_type=n.info.edge_type===tn?tn:NP,o.info.label=n.info.label,nr(e,o)}}function W8(e,n,t,o){let r=n.info.low!==void 0?n.info.low:0,i=t.head.info.low!==void 0?t.head.info.low:0;return Md(o,i,r),za(t),t.info.edge_type!==tn&&am(e,t),!0}function Y8(e,n,t,o,r){let i=n.info.low!==void 0?n.info.low:0,s=t.head.info.low!==void 0?t.head.info.low:0;Md(o,i,s),t.head.info.mark||um(e,t.head,o,r)}function J8(e,n,t,o,r){return!o||r&&!(or(e,t.tail)&&or(e,t.head))||(t.info.weight!==void 0?t.info.weight:0)===0?!1:t.head.info.onstack?W8(e,n,t,o):(Y8(e,n,t,o,r),!1)}function um(e,n,t,o){n.info.mark=1,n.info.onstack=1;let r=n.info.flat_out;if(r){let i=0;for(;i<r.size;)J8(e,n,r.list[i],t,o)||i++}n.info.onstack=0}function K8(e,n,t){let o=!1;for(let r=0;r<n.n;r++){let i=oe(n,r);i.info.mark=0,i.info.onstack=0,i.info.low=r,(i.info.flat_out!==void 0?i.info.flat_out.size:0)>0&&!o&&(n.flat=P2(n.n,n.n),o=!0)}if(o&&n.flat)for(let r=0;r<n.n;r++){let i=oe(n,r);i.info.mark||um(e,i,n.flat,t)}}function tu(e,n){let t=n.info.rank;if(!t)return;let o=n.info.minrank!==void 0?n.info.minrank:0,r=n.info.maxrank!==void 0?n.info.maxrank:0,i=W(n),l=(i.info.n_cluster!==void 0?i.info.n_cluster:0)>0;for(let a=o;a<=r;a++)K8(n,t[a],l)}function fm(e,n){return!((n.info.weight!==void 0?n.info.weight:0)===0||!Id(e,n.tail)||!Id(e,n.head))}function lm(e,n){let t=0;for(let o=0;o<n.size;o++)fm(e,n.list[o])&&t++;return t}function dm(e,n,t,o){n.info.mark=1;let r=n.info.flat_out;if(r!==void 0&&r.size>0)for(let i=0;i<r.size;i++){let s=r.list[i];fm(e,s)&&(s.head.info.mark||dm(e,s.head,t,o))}t.push(n)}function q8(e,n,t,o){for(let r=0;r<n.n;r++){let i=o?oe(n,r):oe(n,n.n-r-1),s=i.info.flat_in!==void 0?lm(e,i.info.flat_in):0,l=i.info.flat_out!==void 0?lm(e,i.info.flat_out):0;if(s===0&&l===0){t.push(i);continue}!i.info.mark&&s===0&&dm(e,i,t,i.info.rank!==void 0?i.info.rank:0)}}function Q8(e,n,t){for(let o=0;o<n.n;o++){let i=oe(n,o).info.flat_out;if(!i)continue;let s=0;for(;s<i.size;){let l=i.list[s],a=l.head.info.order!==void 0?l.head.info.order:0,u=l.tail.info.order!==void 0?l.tail.info.order:0;!t&&a<u||t&&a>u?(za(l),am(e,l)):s++}}}function Z8(e,n,t,o,r){if(n.n===0)return;let i=oe(n,0).info.order!==void 0?oe(n,0).info.order:0;for(let l=0;l<n.n;l++)oe(n,l).info.mark=0;let s=[];if(q8(e,n,s,r),s.length>0){r||s.reverse();for(let l=0;l<n.n;l++)E2(n,l,s[l]),s[l].info.order=l+i;Q8(e,n,r)}t[o].valid=!1}function ou(e,n){if(!n.info.has_flat_edges)return;let t=n.info.rank;if(!t)return;let o=W(n).info.rank;if(!o)return;let r=n.info.minrank!==void 0?n.info.minrank:0,i=n.info.maxrank!==void 0?n.info.maxrank:0,s=n.info.flip===!0;for(let l=r;l<=i;l++)Z8(n,t[l],o,l,s)}function Sz(e){let n=e;for(;n.info.to_orig!==void 0;)n=n.info.to_orig;return n.tail.info.clust!==n.head.info.clust}function wz(){return{n:0,v:[],an:0,av:[],ht1:0,ht2:0,pht1:0,pht2:0,candidate:!1,valid:!1,cache_nc:0,flat:void 0,vStart:0}}function Nz(e,n){for(let t of e.nodes.values()){let o=t.info.rank!==void 0?t.info.rank:0;n[o]++}for(let t of e.edges){let o=t.tail.info.rank!==void 0?t.tail.info.rank:0,r=t.head.info.rank!==void 0?t.head.info.rank:0;if(o>r){let i=o;o=r,r=i}for(let i=o+1;i<r;i++)n[i]++}}function ic(e){let n=e.info.maxrank!==void 0?e.info.maxrank:0,t=e.info.minrank!==void 0?e.info.minrank:0,o=new Array(n+2).fill(0);Nz(e,o);let r=[];for(let i=0;i<=n+1;i++)r.push(wz());for(let i=t;i<=n;i++){let s=o[i]+1;r[i].an=s,r[i].n=s,r[i].v=new Array(s).fill(null),r[i].av=r[i].v}e.info.rank=r}var n9=0;function Rz(e,n,t){let o=jr(e,`__fill_${n}_${t}`,!0);return ds(e,o,!0),o.info.rank=n,o.info.lw=.5,o.info.rw=.5,o.info.ht=1,o.info.UF_size=1,o.info.in={list:[],size:0},o.info.out={list:[],size:0},o}function Tz(e,n){n.fill(!1);for(let t of e.nodes.values()){let o=t.info.rank??0;n[o]=!0;for(let r of t.outEdges(e)){let i=r.head.info.rank??0;for(let s=o+1;s<=i;s++)n[s]=!0}}}function kz(e,n,t){let o=e.info.minrank??0,r=e.info.maxrank??0;for(let i=o;i<=r;i++){if(n[i])continue;t||(t=$o(e.root,"_new_rank",!0));let s=Rz(t,i,n9++);ds(e,s,!0)}return t}function t9(e,n,t){let o=e.info.n_cluster??0,r=e.info.clust;for(let i=1;i<=o;i++)t=t9(r[i-1],n,t);return W(e)===e?t:(Tz(e,n),kz(e,n,t))}function o9(e){n9=0;let n=(e.info.maxrank??0)+2,t=new Array(n).fill(!1);t9(e,t,null)}function Cz(e,n){let t=e.info.minrank!==void 0?e.info.minrank:0,o=e.info.maxrank!==void 0?e.info.maxrank:0;return n>=t&&n<=o}function _z(e,n,t){let o=e.root.info.rank;return!o||t<=o[n].an}function Az(e,n,t){let o=e.info.rank;if(!o)return-1;let r=o[t];if(r.an<=0)return-1;let i=(r.vStart??0)+r.n;return r.v[i]=n,n.info.order=i,r.n++,i}function pm(e,n,t){let o=t.info.rank!==void 0?t.info.rank:0;return Az(n,t,o)<0||!Cz(n,o)||!_z(e,o,t.info.order??0)?-1:0}function mm(e,n,t){let o=t===0?n.info.out:n.info.in;if(o)for(let r=0;r<o.size;r++){let i=o.list[r],s=t===0?i.head:i.tail;s.info.mark||(s.info.mark=1,e.push(s))}}function Gz(e,n,t,o){let r=n.info.rank,i=e.root.info.rank;if(!(!r||!i))for(let s=t;s<=o;s++){i[s].valid=!1;let l=r[s];if(!n.info.flip||l.n<=0)continue;let a=l.n-1;for(let u=0;u<=a>>1;u++)eu(e,oe(l,u),oe(l,a-u))}}function Mz(e,n,t,o){let r=[o];for(o.info.mark=1;r.length>0;){let i=r.shift();if((i.info.ranktype!==void 0?i.info.ranktype:0)!==rn){if(pm(e,n,i)!==0)return-1;mm(r,i,t)}else{let s=r9(n,i,t,r);if(s!==0)return s}}return 0}function Lz(e){if(e===e.root)return e.info.nlist;let n=e.info.nlist;for(;n!==void 0&&n.info.next!==void 0;)n=n.info.next;return n}function Iz(e,n,t,o){let r=n!==n.root;for(let i=o;i!==void 0;i=r?i.info.prev:i.info.next){let s=t===0?i.info.in:i.info.out;if(!(s!==void 0&&s.size>0)&&!i.info.mark){let l=Mz(e,n,t,i);if(l!==0)return l}}return 0}function sc(e,n,t){let o=n.info.rank;if(!o)return-1;let r=n.info.minrank!==void 0?n.info.minrank:0,i=n.info.maxrank!==void 0?n.info.maxrank:0;for(let l=n.info.nlist;l!==void 0;l=l.info.next)l.info.mark=0;for(let l=r;l<=i;l++)o[l].n=0;let s=Iz(e,n,t,Lz(n));return s!==0?s:(Gz(e,n,r,i),n===W(n)&&ci(e)>0&&nu(e,n,!1),0)}function Oz(e,n,t){for(let o=1;o<n.length;o++){let r=n[o-1],i=n[o],s=t?r.head:r.tail,l=t?i.head:i.tail;if(kd(s,l))return;let a=ni(s,l,null);a.info.edge_type=tn,nr(e,a)}}function cm(e,n,t,o){if(t.info.clust)return;let r=o?t.info.out:t.info.in;if(!r)return;let i=[];for(let s=0;s<r.size;s++){let l=r.list[s];Sz(l)||i.push(l)}i.length<=1||(e.teList=i,i.sort((s,l)=>s.seq-l.seq),Oz(n,i,o))}function Dz(e,n){for(let t of M(n)){let o=t.attrs.get("ordering");o==="out"?cm(e,n,t,!0):o==="in"&&cm(e,n,t,!1)}}function e9(e,n,t){for(let o of M(n))cm(e,n,o,t)}function lc(e,n){let t=ey(n,"ordering");if(t!==void 0){t==="out"?e9(e,n,!0):t==="in"&&e9(e,n,!1);return}for(let o of n.subgraphs.values())gn(o)||lc(e,o);Dz(e,n)}var ac=5;function hm(e){let n=e.info.clust;return n===void 0||n.info.expanded?e:n.info.rankleader[e.info.rank??0]}function Bz(e,n,t,o){let r=e.info.rank[n];for(let i=t-o+1;i<r.n;i++){let s=r.v[i];s.info.order=i+o-1,r.v[s.info.order]=s}for(let i=r.n+o-1;i<r.n;i++)r.v[i]=null}function Fz(e,n,t,o){let r=e.info.rank[n];for(let i=r.n-1;i>t;i--){let s=r.v[i];s.info.order=i+o-1,r.v[s.info.order]=s}for(let i=t+1;i<t+o;i++)r.v[i]=null}function bm(e,n,t,o){o<=0?Bz(e,n,t,o):Fz(e,n,t,o),e.info.rank[n].n+=o-1}function zz(e,n){let t=n.info.rank??0;bm(e,t,n.info.order,2);let o=bn(e);return o.info.lw=n.info.lw,o.info.rw=n.info.rw,o.info.rank=t,o.info.order=(n.info.order??0)+1,e.info.rank[t].v[o.info.order]=o,o}function iu(e){e.tail.info.other||(e.tail.info.other={list:[],size:0});let n=e.tail.info.other;for(let t=0;t<n.size;t++)if(n.list[t]===e)return;n.list[n.size++]=e}function i9(e,n){let t=e.info.head_port,o=e.info.tail_port,r=n.info.head_port,i=n.info.tail_port;return t.defined===r.defined&&o.defined===i.defined&&(!t.defined||t.p.x===r.p.x&&t.p.y===r.p.y)&&(!o.defined||o.p.x===i.p.x&&o.p.y===i.p.y)}function jz(e,n,t,o,r){let i=W(e.root),s=e;for(let l=e.info.rank??0;l<(n.info.rank??0);l++){let a=l<(n.info.rank??0)-1?zz(i,o.head):n,u=Be(s,a,t);u.info.edge_type=r,s=a,o.info.count=(o.info.count??1)-1,o=o.head.info.out.list[0]}}function Hz(e,n,t,o,r){let i=St(e,n);if(i!==void 0&&i9(t,i))t.info.to_virt=i,i.info.edge_type=r,i.info.count=(i.info.count??1)+1,e.info.node_type===B&&n.info.node_type===B&&iu(t);else{t.info.to_virt=void 0;let s=Be(e,n,t);s.info.edge_type=r,o.info.count=(o.info.count??1)-1}}function Vz(e,n,t,o,r){let i;for(o.tail!==e?(t.info.to_virt=void 0,i=t.info.to_virt=Be(e,o.head,t),it(o)):i=o;(i.head.info.rank??0)!==(n.info.rank??0);)i=i.head.info.out.list[0];if(i.head!==n){let s=i;i=Be(i.tail,n,t),i.info.edge_type=r,it(s)}}function Uz(e,n,t,o,r){if(t.info.to_virt=void 0,(n.info.rank??0)-(e.info.rank??0)===1){let s=St(e,n);if(s!==void 0&&i9(t,s)){kn(t,s),e.info.node_type===B&&n.info.node_type===B&&iu(t);return}}jz(e,n,t,o,r)}function Xz(e,n,t,o,r){if(o.tail===e&&o.head===n)return;let i=(n.info.rank??0)-(e.info.rank??0);(o.info.count??1)>1?Uz(e,n,t,o,r):i===1?Hz(e,n,t,o,r):Vz(e,n,t,o,r)}function gm(e,n,t){let o=hm(e),r=hm(n),i=o===e&&r===n?U:ac;Xz(o,r,t,t.info.to_virt,i)}function $z(e,n){return e?e.tail===n.tail&&e.head===n.head&&e.info.label===n.info.label&&su(e,n):!1}function s9(e){return(e.tail.info.rank??0)===(e.head.info.rank??0)}function Wz(e){return(e.head.info.rank??0)>(e.tail.info.rank??0)}function Yz(e,n,t){let o=kd(n.tail,n.head);return o===void 0?(n.info.to_virt||nr(e,n),n):(n!==o&&(iu(n),n.info.to_virt||kn(n,o)),t)}function Jz(e,n,t){return s9(n)?n.info.to_virt=t:n.info.to_virt=void 0,t.info.to_virt===void 0||(n.info.to_virt=void 0,sl(e,n,t.info.to_virt,!1),iu(n)),t}function Kz(e,n,t,o){return $z(o,t)?Jz(e,t,o):s9(t)?Yz(n,t,o):Wz(t)?(gm(t.tail,t.head,t),t):(gm(t.head,t.tail,t),t)}function qz(e){let n=W(e);for(let t of M(e)){let o;for(let r of[...t.outEdges(n),...t.inEdges(n)])Ld(e,r)||(o=Kz(e,n,r,o))}}function uc(e){return[e.info.minrank??0,e.info.maxrank??0]}function Qz(e,n,t,o){let r=e.info.rank[t].n;return bm(n,t,o,r),o}function Zz(e,n,t,o){let r=o;for(let i=0;i<e.info.rank[t].n;i++){let s=n.info.rank[t].v[r]=e.info.rank[t].v[i];s.info.order=r++,tr(e,s),ja(n,s)}e.info.rank[t].v=n.info.rank[t].v,e.info.rank[t].vStart=o,n.info.rank[t].valid=!1}function ej(e,n,t){let o=e.info.rankleader[t],r=Qz(e,n,t,o.info.order??0);Zz(e,n,t,r)}function nj(e){let n=W(e),[t,o]=uc(e);t>0&&(n.info.rank[t-1].valid=!1);for(let r=t;r<=o;r++)ej(e,n,r);o+1<(n.info.maxrank??0)&&(n.info.rank[o+1].valid=!1),e.info.expanded=!0}function tj(e){let n=W(e),[t,o]=uc(e);for(let r=t;r<=o;r++){let i=e.info.rankleader[r],s;for(;(s=i.info.out?.list[0])!==void 0;)it(s);for(;(s=i.info.in?.list[0])!==void 0;)it(s);tr(n,i),e.info.rankleader[r]=null}}function l9(e,n,t){return{root:e,globalMinRank:n,globalMaxRank:t,teList:[],tiList:[],reMincross:!1,minQuit:1,maxIter:0}}function xm(e){ru(e),e.info.comp||(e.info.comp=[]),e.info.comp[0]=e.info.nlist??null,ic(e);let[n,t]=uc(e),o=l9(W(e),n,t),r=sc(o,e,0);return r!==0?r:(nj(e),qz(e),tj(e),0)}function oj(e,n){for(let t of e.edges){if(t.tail!==n)continue;let o=t.info.to_virt;for(;o!==void 0&&o.head.info.node_type===U;)o.head.info.clust=e,o=o.head.info.out?.list[0]}}function a9(e,n){e.nodes.delete(n.name);let t=e.edges;for(let o=t.length-1;o>=0;o--)(t[o].tail===n||t[o].head===n)&&t.splice(o,1);for(let[,o]of e.subgraphs)u9(o,n)}function u9(e,n){e.nodes.delete(n.name);for(let[,t]of e.subgraphs)u9(t,n)}function f9(e,n){let t=e.info.clust,o=e.info.n_cluster??0;for(let r of M(n)){let i=(r.info.ranktype??0)!==0;for(let s=0;!i&&t&&s<o-1;s++)t[s].nodes.get(r.name)===r&&(i=!0);i&&a9(n,r),r.info.clust=void 0}}function rj(e,n,t){if((n.info.ranktype??0)!==0){console.error(`Warning: ${n.name} was already in a rankset, deleted from cluster ${t.name}`),a9(e,n);return}TP(n,e.info.leader),n.info.clust=e,n.info.ranktype=rn,oj(e,n)}function ym(e){for(let t of M(e))t.info.ranktype===rn&&Ad(t),t.info.clust=void 0;let n=e.info.n_cluster??0;for(let t=1;t<=n;t++){let o=e.info.clust[t-1];for(let r of M(o))rj(o,r,e)}}function ij(e,n){let t=n.info.rank??0,o=e.info.rankleader[t];for(let r of e.edges){if(r.tail!==n)continue;let i=r.head.info.rank??0;for(let s=t;s<i;s++)o.info.out.list[0].info.count=(o.info.out.list[0].info.count??1)+1}}function sj(e,n){let t=e.info.rankleader[n.info.rank??0];t.info.UF_size=(t.info.UF_size??0)+1,ij(e,n)}function lj(e,n,t){for(let o=n;o<=t;o++){let r=e.info.rankleader[o];(r.info.UF_size??0)>1&&(r.info.UF_size=(r.info.UF_size??0)-1)}}function aj(e,n,t,o){for(let r of M(n))sj(n,r);lj(n,t,o)}function d9(e,n){let[t,o]=uc(n);n.info.rankleader=new Array(o+2).fill(null);let r;for(let i=t;i<=o;i++){let s=bn(e);if(s.info.rank=i,s.info.ranktype=rn,s.info.clust=n,n.info.rankleader[i]=s,r!==void 0){let l=ni(r,s,null);Fa(l),l.info.xpenalty=(l.info.xpenalty??1)*1e3}r=s}aj(e,n,t,o)}function uj(e,n,t,o,r){for(let i=o;i<=r;i++){let s=pm(e,n,t.info.rankleader[i]);if(s!==0)return s}return 0}function r9(e,n,t,o){let r=n.info.clust;if((r.info.installed??0)===t+1)return 0;let i=r.info.minrank??0,s=r.info.maxrank??0,l=l9(e,i,s),a=uj(l,e,r,i,s);if(a!==0)return a;for(let u=i;u<=s;u++)mm(o,r.info.rankleader[u],t);return r.info.installed=t+1,0}function c9(e){let n=new Map;for(let t of e){let o=n.get(t.tail);o!==void 0?o.push(t):n.set(t.tail,[t])}return n}function fj(e){let n=c9(e.edges);for(let t of M(e)){t.info.clust=void 0;let o=n.get(t);if(o!==void 0)for(let r of o){let i=r.info.to_virt;for(;i!==void 0&&i.head.info.node_type===U;)i.head.info.clust=void 0,i=i.head.info.out?.list[0]}}}function dj(e,n){let t=e.info.to_virt;for(;t!==void 0&&t.head.info.node_type===U;)t.head.info.clust===void 0&&(t.head.info.clust=n),t=t.head.info.out?.list[0]}function p9(e){let n=e.info.n_cluster??0;for(let o=1;o<=n;o++)p9(e.info.clust[o-1]);let t=c9(e.edges);for(let o of M(e)){o.info.clust===void 0&&(o.info.clust=e);let r=t.get(o);if(r!==void 0)for(let i of r)dj(i,e)}}function pi(e){fj(e),p9(e)}var em=1,ol=2,di=3,Za=4,rl=5,Pm=6,rn=7,kt=2,on=1,dc=2,cc=4,pc=16,mc=32,Em=16,mi=100,h9=101,b9=102,g9=10,$n=6,xc=mi;function y9(e){xc=e}function Ne(e){if(!e||e==="")return!1;let n=e.toLowerCase();return n==="false"||n==="no"?!1:n==="true"||n==="yes"?!0:e[0]>="0"&&e[0]<="9"?parseInt(e,10)!==0:!1}function il(e,n){return n<0?0:n>1&&e>Number.MAX_SAFE_INTEGER/n?Number.MAX_SAFE_INTEGER:Math.floor(e*n)}function gn(e){return e===e.root||e.name.toLowerCase().startsWith("cluster")?!0:Ne(e.attrs.get("cluster"))}function cj(e){e.info.in&&(e.info.in.size=0),e.info.out&&(e.info.out.size=0),e.info.mark=0}function pj(e,n,t){let o,r=n[t];for(;r!==void 0;){let i=r.info.next;cj(r),(r.info.node_type??0)===kt?(o===void 0?(n[t]=i,e.info.nlist=i):o.info.next=i,i!==void 0&&(i.info.prev=o)):o=r,r=i}}function mj(e){for(let n of M(e)){let t=n.outEdges(e);for(let o of t){let r=o.info.to_virt;r!==void 0&&o!==r.info.to_orig&&(o.info.to_virt=void 0)}}}function xj(e){for(let n of M(e)){let t=n.outEdges(e);for(let o of t){let r=o.info.to_virt;r!==void 0&&r.info.to_orig===o&&(o.info.to_virt=void 0)}}}function hj(e){let n=e.info.comp;if(n)for(let t=0;t<n.length;t++)e.info.nlist=n[t],pj(e,n,t);mj(e),xj(e),e.info.comp=void 0}function nm(e){if((e.info.has_labels??0)&on){for(let n of M(e))for(let t of n.outEdges(e))t.info.minlen=(t.info.minlen??1)*2;e.info.ranksep=Math.floor(((e.info.ranksep??0)+1)/2)}}function bj(e){if(gn(e))return rn;let n=e.attrs.get("rank")??"";return n==="min"?ol:n==="source"?di:n==="max"?Za:n==="sink"?rl:n==="same"?em:0}function gj(e,n,t){n===ol||n===di?(e.info.minset||(e.info.minset=t),e.info.minset=Ha(e.info.minset,t)):(e.info.maxset||(e.info.maxset=t),e.info.maxset=Ha(e.info.maxset,t))}function yj(e,n,t){let o=M(n),r=o[0];if(!r)return;r.info.ranktype=t,(t===ol||t===di||t===Za||t===rl)&&gj(e,t,r);for(let s of o)s!==r&&(Ha(r,s),s.info.ranktype=t)}function tm(e,n){let t=(e.info.n_cluster??0)+1;e.info.n_cluster=t,e.info.clust||(e.info.clust=[]),e.info.clust[t-1]=n;let o=e.root.info.gvc?.textMeasurer;Wt(n,o)}function Pj(e){let n=new Set(e.edges);for(let t of M(e))for(let o of t.outEdges(e.root))e.nodes.get(o.head.name)===o.head&&!n.has(o)&&(Ej(e,o),n.add(o))}function Ej(e,n){let t=e;for(;t&&!t.edges.includes(n);)t.edges.push(n),t=t.parent}function om(e,n){f9(e,n);for(let t of M(n))if(!t.info.clust){if(t.info.clust=n,t.info.clustnode=!0,t.info.in)for(let o=t.info.in.size-1;o>=0;o--){let r=t.info.in.list[o];e.nodes.has(r.tail.name)||Zr(t.info.in,r)}if(t.info.out)for(let o=t.info.out.size-1;o>=0;o--){let r=t.info.out.list[o];e.nodes.has(r.head.name)||Zr(t.info.out,r)}}Pj(n)}function vm(e){let n,t=0,o=Number.MAX_SAFE_INTEGER,r=-1;for(let i of M(e)){let s=i.info.rank??0;s>r&&(r=s),s<o&&(o=s),(n===void 0||s<t)&&(n=i,t=s)}e.info.minrank=o,e.info.maxrank=r,e.info.leader=n}function vj(e){let n,t=0;for(let o=e.info.nlist;o;o=o.info.next){let r=o.info.rank??0;r===0&&(o.info.node_type??0)===0&&(n=o),t<r&&(t=r)}return[n,t]}function Sj(e){let[n]=vj(e);if(n){e.info.leader=n;for(let t of M(e))Ha(t,n),t.info.ranktype=rn}}function P9(e,n){n.info.parent||(n.info.parent=e,om(e,n),n.nodes.size!==0&&(tm(e,n),xc===mi?(T9(n),Sj(n)):vm(n)))}function E9(e,n){for(let t of n.subgraphs.values()){let o=bj(t);o!==0?o===rn&&xc===mi?P9(e,t):yj(e,t,o):E9(e,t)}}function wj(e){let n=e.root;for(let t of n.subgraphs.values())(t.info.set_type??0)===rn&&P9(e,t)}function Nj(e){return e.info.leader?.info.rank??0}function Rj(e){return e.info.minrank??0}function Tj(e){return e.info.maxrank??0}function v9(e){return e.info.n_cluster??0}function S9(e){return e.info.clust??[]}function fc(e){return e.info.rank??0}function m9(e){return e.info.ranktype??0}function kj(e){return e.info.maxrank??-1}function Cj(e){return e.info.minrank??Number.MAX_SAFE_INTEGER}function w9(e){let n=Nj(e);e.info.minrank=Rj(e)+n,e.info.maxrank=Tj(e)+n;let t=S9(e),o=v9(e);for(let r=1;r<=o;r++)w9(t[r-1])}function x9(e,n){let t=e.info.ranktype??0,o=n?t===rl:t===di,r=n?e.info.out:e.info.in;if(r)for(;r.size>0;)Cd(r.list[0]);return o?1:0}function _j(e){if(!e.info.maxset&&!e.info.minset)return[0,0];e.info.minset&&(e.info.minset=Fe(e.info.minset)),e.info.maxset&&(e.info.maxset=Fe(e.info.maxset));let n=e.info.maxset?x9(e.info.maxset,!0):0;return[e.info.minset?x9(e.info.minset,!1):0,n]}function N9(e){return e.info.out?.list[0]}function R9(e){return e.info.in?.list[0]}function Aj(e,n,t){let o=n.info.out;if((!o||o.size===0)&&e.info.maxset&&n!==e.info.maxset){let r=N9(n)??R9(n),i=Be(n,e.info.maxset,r);return i.info.minlen=t,i.info.weight=0,!0}return!1}function Gj(e,n,t){let o=n.info.in;if((!o||o.size===0)&&e.info.minset&&n!==e.info.minset){let r=R9(n)??N9(n),i=Be(e.info.minset,n,r);return i.info.minlen=t,i.info.weight=0,!0}return!1}function Mj(e,n){if(!e.info.maxset&&!e.info.minset)return!1;let t=!1;for(let o of M(e))o===Fe(o)&&(Aj(e,o,n[1])&&(t=!0),Gj(e,o,n[0])&&(t=!0));return t}function Lj(e){let n=e.attrs.get("nslimit1")??e.graphDefaultsSnapshot?.get("nslimit1")??e.root.attrs.get("nslimit1"),t=n?il(e.nodes.size,parseFloat(n)):Number.MAX_SAFE_INTEGER,o=e.info.comp??[],r=(e.info.n_cluster??0)>0;for(let i=0;i<o.length;i++)e.info.nlist=o[i],qa(e,r?0:1,t)}function Ij(e,n){let t=Fe(n);t!==n&&(n.info.rank=fc(n)+fc(t)),kj(e)<fc(n)&&(e.info.maxrank=n.info.rank),Cj(e)>fc(n)&&(e.info.minrank=n.info.rank),m9(n)!==0&&m9(n)!==Pm&&Ad(n)}function Oj(e){if(xc===mi){let n=S9(e);for(let t=1;t<=v9(e);t++)w9(n[t-1])}else wj(e)}function Dj(e){if(!e.nodes.values().next().value){e.info.minrank=0,e.info.maxrank=0;return}e.info.minrank=Number.MAX_SAFE_INTEGER,e.info.maxrank=-1;for(let t of M(e))Ij(e,t);e===(e.info.dotroot??e.root)&&Oj(e)}function T9(e){nm(e),E9(e,e),k9(e);let n=_j(e);Va(e,0),d8(e),Mj(e,n)&&Va(e,0),Lj(e),Dj(e),hj(e)}function ll(e){Ne(e.attrs.get("newrank"))?(e.info.flags=(e.info.flags??0)|Em,B8(e)):T9(e)}function su(e,n){let t=e.info.head_port,o=n.info.head_port,r=e.info.tail_port,i=n.info.tail_port,s=t.p.x===o.p.x&&t.p.y===o.p.y||!t.defined,l=r.p.x===i.p.x&&r.p.y===i.p.y||!r.defined;return t.defined===o.defined&&s&&l}function Sm(e){return e.info.constraint===!1}var Bj=0,Fj=1,zj=2,jj=[[1,1,1],[1,2,2],[1,2,4]];function C9(e){return e.info.node_type===U?zj:(e.info.weight_class??2)<=1?Fj:Bj}function Hj(e){let n=jj[C9(e.tail)][C9(e.head)];e.info.weight=(e.info.weight??1)*n}function Vj(e){let n=e.tail.info.clust;return n?(e.tail.info.rank??0)-(n.info.leader?.info.rank??0):0}function Uj(e){let n=e.head.info.clust;return n?(e.head.info.rank??0)-(n.info.leader?.info.rank??0):0}function Xj(e){let n=(e.info.minlen??1)+Vj(e)-Uj(e);return n>0?[0,n]:[-n,0]}function $j(e,n,t,o){let[r,i]=Xj(o),s=bn(e);s.info.node_type=kt;let l=Fe(n),a=Fe(t),u=o.info.weight??1,f=we(s,l,r,g9*u),d=we(s,a,i,u);f.info.to_orig=o,d.info.to_orig=o}function Wj(e,n){if(n.info.to_virt!==void 0||Sm(n))return;let t=Fe(n.tail),o=Fe(n.head);if(t===o)return;if(t.info.clust||o.info.clust){$j(e,n.tail,n.head,n);return}let r=St(t,o);r!==void 0?kn(n,r):Be(t,o,n)}function k9(e){ym(e);for(let n of M(e))for(let t of n.outEdges(e))Wj(e,t)}function Yj(e){return e.info.label?.dimen}function Jj(e,n){let t=Yj(n),o=bn(e);if(o.info.label=n.info.label,o.info.lw=W(e).info.nodesep??0,!n.info.label_ontop&&t){let r=W(e).info.flip===!0;o.info.ht=r?t.x:t.y,o.info.rw=r?t.y:t.x}return o}function D9(e,n){let t=Math.floor((e.info.nodesep??0)/2);n.info.lw=(n.info.lw??0)+t,n.info.rw=(n.info.rw??0)+t}function Kj(e){let n=bn(e);return D9(e,n),n}function _9(e){return e.info.ranktype!==rn?Fe(e):e.info.clust.info.rankleader[e.info.rank??0]}function qj(e,n,t,o){return t===o?Jj(e,n):Kj(e)}function hc(e,n,t,o){let r=o.info.label!==void 0?Math.floor(((n.info.rank??0)+(t.info.rank??0))/2):-1,i=n,s=t.info.rank??0;for(let l=(n.info.rank??0)+1;l<=s;l++){let a=l<s?(()=>{let f=qj(e,o,l,r);return f.info.rank=l,f})():t,u=Be(i,a,o);Hj(u),i=a}}function Kt(e){return e.info.rank??0}function A9(e){return e.info.count??1}function G9(e){return e.info.xpenalty??0}function M9(e){return e.info.weight??1}function Qj(e){return e.head.info.out?.list[0]}function L9(e,n,t){return t&&(e.info.count=A9(e)+A9(n)),e.info.xpenalty=G9(e)+G9(n),e.info.weight=M9(e)+M9(n),Qj(e)}function sl(e,n,t,o){let r=Math.max(n.tail.info.rank??0,n.head.info.rank??0);n.info.to_virt=t;let i=t;for(;i!==void 0;){if((i.head.info.rank??0)===r){L9(i,n,o);break}D9(e,i.head),i=L9(i,n,o)}}function Zj(e,n){return!e||!n?!1:e.tail===n.tail&&e.head===n.head&&e.info.label===n.info.label&&su(e,n)}function eH(e,n,t,o){hc(e,t,o,n);let r=n.info.to_virt;for(;r!==void 0&&Kt(r.head)<=Kt(o);)r.info.edge_type=ac,r=r.head.info.out?.list[0]}function nH(e,n){let t=_9(n.tail),o=_9(n.head);if(Kt(t)>Kt(o)){let i=t;t=o,o=i}if(t.info.clust===o.info.clust)return;let r=St(t,o);if(r!==void 0){sl(e,n,r,!0);return}Kt(t)!==Kt(o)&&eH(e,n,t,o)}function tH(e){return e.tail.info.ranktype===rn||e.head.info.ranktype===rn}function oH(e,n,t){return t.info.to_virt!==void 0?(sl(e,n,t.info.to_virt,!1),ti(n)):(n.tail.info.rank??0)===(n.head.info.rank??0)&&(kn(n,t),ti(n)),t}function rH(e,n,t){return Zj(t,n)?oH(e,n,t):(nH(e,n),n)}function iH(e,n,t){W(e).info.concentrate??!1?n.info.edge_type=$n:t.info.to_virt!==void 0&&(sl(e,n,t.info.to_virt,!0),ti(n))}function sH(e,n){return(e.tail.info.rank??0)!==(e.head.info.rank??0)?!1:(kn(e,n),ti(e),!0)}function lH(e,n,t){return n.info.label!==void 0||t.info.label!==void 0||!su(n,t)?!1:(iH(e,n,t),!0)}function aH(e,n,t){return!t||n.tail!==t.tail||n.head!==t.head?!1:sH(n,t)?!0:lH(e,n,t)}function uH(e,n,t){return n.info.label!==void 0||t.info.label!==void 0||!su(n,t)?!1:(W(e).info.concentrate??!1?(n.info.edge_type=$n,t.info.conc_opp_flag=!0):(ti(n),sl(e,n,t.info.to_virt,!0)),!0)}function fH(e,n,t){return t.head!==n.tail||t.info.edge_type===$n?!1:(t.info.to_virt===void 0&&hc(e,t.tail,t.head,t),uH(e,n,t))}function dH(e,n){for(let t of n.head.outEdges(e))if(fH(e,n,t))return;return hc(e,n.head,n.tail,n),n}function cH(e,n){return Kt(n.tail)===Kt(n.head)?(nr(e,n),n):Kt(n.head)>Kt(n.tail)?(hc(e,n.tail,n.head,n),n):dH(e,n)}function pH(e,n,t){if(n.info.to_virt!==void 0)return n;if(tH(n))return rH(e,n,t);if(aH(e,n,t))return t;if(n.tail===n.head)return ti(n),n;let o=Fe(n.tail),r=Fe(n.head);return n.tail!==o||n.head!==r?t:cH(e,n)}function mH(e,n){let t;for(let o of n){let r=pH(e,o,t);t=r!==void 0?r:t}}function I9(e){return e.info.weight_class??0}function O9(e){I9(e)<=2&&(e.info.weight_class=I9(e)+1)}function xH(e){for(let n of e.edges)O9(n.head),O9(n.tail)}function hH(e){let n=Xo(e);for(let t of M(e))t.info.clust===void 0&&t===Fe(t)&&ja(e,t),mH(e,n.get(t)??[])}function ru(e){e.info.nlist=void 0,ym(e);let n=e.info.n_cluster??0;for(let t=1;t<=n;t++)d9(e,e.info.clust[t-1]);xH(e),hH(e),e!==W(e)&&(e.info.comp=[e.info.nlist??null])}var j9=1;function bH(e){if(!e||e.toLowerCase()==="false"||e.toLowerCase()==="no")return!1;if(e.toLowerCase()==="true"||e.toLowerCase()==="yes")return!0;let n=parseInt(e,10);return!Number.isNaN(n)&&n!==0}function wm(e){return{fontsize:V(e.attrs.get("fontsize"),As,j9),fontname:e.attrs.get("fontname")||Gs,fontcolor:e.attrs.get("fontcolor")||Ms}}function gH(e,n){return{fontsize:V(e.attrs.get("labelfontsize"),n.fontsize,j9),fontname:e.attrs.get("labelfontname")||n.fontname,fontcolor:e.attrs.get("labelfontcolor")||n.fontcolor}}function yH(e){let n=wm(e);return gH(e,n)}function PH(e,n,t,o){let r=e.attrs.get("label");if(!r)return;let i=Sn(r),s=i?wn(r):r;e.info.label=Hn(s,i,t,o,e),n.root.info.has_labels|=on,e.info.label_ontop=bH(e.attrs.get("label_float"))?1:0}function EH(e,n,t,o){let r=e.attrs.get("xlabel");if(!r)return;let i=Sn(r),s=i?wn(r):r;e.info.xlabel=Hn(s,i,t,o,e),n.root.info.has_labels|=mc}function vH(e,n,t,o){let r=e.attrs.get("headlabel");if(!r)return;let i=Sn(r),s=i?wn(r):r;e.info.head_label=Hn(s,i,t,o,e),n.root.info.has_labels=(n.root.info.has_labels??0)|dc}function SH(e,n,t,o){let r=e.attrs.get("taillabel");if(!r)return;let i=Sn(r),s=i?wn(r):r;e.info.tail_label=Hn(s,i,t,o,e),n.root.info.has_labels=(n.root.info.has_labels??0)|cc}function wH(e,n,t){let o=null;e.attrs.get("label")&&(o=wm(e),PH(e,n,o,t)),e.attrs.get("xlabel")&&EH(e,n,o??wm(e),t)}function NH(e,n,t){let o=yH(e);vH(e,n,o,t),SH(e,n,o,t)}function B9(e,n,t){let o=t.indexOf(":");if(o>=0){let i=t.slice(o+1),s=e?e(n,t.slice(0,o),i):ue();return s.name=i,s}let r=e?e(n,t,""):ue();return r.name=t,r}function F9(e){return e!==void 0&&/^(false|no|0)$/i.test(e.trim())}function z9(e){return e.info.shape?.fns?.portfn??null}function RH(e){let n=e.attrs.get("tailport")??"";n.length>0&&(e.tail.info.has_port=!0),e.info.tail_port=B9(z9(e.tail),e.tail,n),F9(e.attrs.get("tailclip"))&&(e.info.tail_port.clip=!1);let t=e.attrs.get("headport")??"";t.length>0&&(e.head.info.has_port=!0),e.info.head_port=B9(z9(e.head),e.head,t),F9(e.attrs.get("headclip"))&&(e.info.head_port.clip=!1)}function Ln(e,n,t){RH(e);let o=e.attrs.has("label")||e.attrs.has("xlabel"),r=e.attrs.has("headlabel")||e.attrs.has("taillabel");!o&&!r||(o&&wH(e,n,t),r&&NH(e,n,t))}var xi=0,ut=1,ft=2,dt=3,TH=.25,kH=.02,H9=.5,CH=.02,X9=18,_H=255,V9=0,Rm=1,AH=2;function al(e){return A(e*De)}function GH(e){let n=e.attrs.get("charset"),t=(n===void 0||n===""?"utf-8":n).toLowerCase();return t==="latin-1"||t==="latin1"||t==="l1"||t==="iso-8859-1"||t==="iso_8859-1"||t==="iso8859-1"||t==="iso-ir-100"?Rm:t==="big-5"||t==="big5"?AH:(t==="utf-8"||t==="utf8"||console.error(`Warning: Unsupported charset "${n}" - assuming utf-8`),V9)}function U9(e,n,t){for(let o=0;o<n.length;o++)if(e!==void 0&&e===n[o])return t[o];return t[n.length]}function MH(e){e.info.nodesep=al(V(e.attrs.get("nodesep"),TH,kH));let n=e.attrs.get("ranksep"),t=H9;if(n!==void 0&&n!==""){let o=Number.parseFloat(n);t=Number.isNaN(o)?H9:Math.max(o,CH),n.includes("equally")&&(e.info.exact_ranksep=!0)}e.info.ranksep=al(t)}var Nm="[-+]?[0-9.]+(?:[eE][-+]?[0-9]+)?",LH=new RegExp(`^\\s*(${Nm})\\s*,\\s*(${Nm})(.?)`),IH=new RegExp(`^\\s*(${Nm})(.?)`);function OH(e){if(e===void 0)return null;let n=LH.exec(e);if(n){let o=Number(n[1]),r=Number(n[2]);if(o>0&&r>0)return{x:al(o),y:al(r),filled:n[3]==="!"}}let t=IH.exec(e);if(t){let o=Number(t[1]);if(o>0)return{x:al(o),y:al(o),filled:t[2]==="!"}}return null}function DH(e){let n=e.attrs.get("ratio");if(n!==void 0)return n==="auto"?"auto":n==="compress"?"compress":n==="expand"?"expand":n==="fill"?"fill":Number.parseFloat(n)>0?"value":void 0}function BH(e){let n=DH(e);if(n!=="compress"&&n!=="fill")return;let t=OH(e.attrs.get("size"));e.info.drawing=Hf({ratioKind:n,size:t?{x:t.x,y:t.y}:{x:0,y:0},filled:t?.filled??!1})}var FH=["local","global","none"],zH=["gd","ps","svg"];function jH(){return[mi,h9,b9,mi]}function HH(){return[us.NativeFonts,us.PsFonts,us.SvgFonts,-1]}function sn(e,n){e.info.charset=GH(e);let t=xi,o=e.attrs.get("rankdir");o==="LR"?t=ut:o==="BT"?t=ft:o==="RL"&&(t=dt),n?(e.info.rankdir=t<<2|t,e.info.flip=(t&1)===1):(e.info.rankdir=t<<2,e.info.flip=!1),MH(e),e.info.showboxes=Math.min(Te(e.attrs.get("showboxes"),0,0),_H);let r=U9(e.attrs.get("fontnames"),zH,HH());r!==-1&&(e.info.fontnames=r),BH(e),y9(U9(e.attrs.get("clusterrank"),FH,jH())),e.info.concentrate=Ne(e.attrs.get("concentrate")),e.info.edgeLabelsDone=!1,Wt(e,Oe(e))}function lu(e){sn(e,!0),$9(e)}function $9(e){let n=e.info.n_cluster??0,t=e.info.clust;for(let o=1;o<=n;o++)if(t&&t[o-1]){let r=t[o-1];r.info.rankdir=e.info.rankdir,r.info.flip=e.info.flip,$9(r)}}var W9=1e3;function Y9(e){e.info.UF_size=1,e.info.in||(e.info.in={list:[],size:0}),e.info.out||(e.info.out={list:[],size:0}),e.info.flat_in||(e.info.flat_in={list:[],size:0}),e.info.flat_out||(e.info.flat_out={list:[],size:0}),e.info.other||(e.info.other={list:[],size:0}),e.info.lw===void 0&&(e.info.lw=27),e.info.rw===void 0&&(e.info.rw=27),e.info.ht===void 0&&(e.info.ht=36),e.info.node_type=B}function VH(e){let n=L(e.tail,e.tail.root,"group")??"",t=L(e.head,e.head.root,"group")??"";return n!==""&&n===t}function UH(e){let n=e.attrs.get("constraint");n!==void 0&&n!==""&&(e.info.constraint=Ne(n))}function XH(e){VH(e)&&(e.info.xpenalty=W9,e.info.weight=(e.info.weight??1)*100)}function $H(e){Sm(e)&&(e.info.xpenalty=0,e.info.weight=0)}function J9(e){UH(e),e.info.weight=e.attrs.has("weight")?Te(e.attrs.get("weight"),1,0):e.info.weight??1,e.info.count=1,e.info.xpenalty=1,XH(e),$H(e),e.info.minlen=Te(e.attrs.get("minlen"),1,0);let n=e.attrs.get("samehead");e.info.samehead=n||void 0;let t=e.attrs.get("sametail");e.info.sametail=t||void 0}function bc(e){e.info.nodesep===void 0&&(e.info.nodesep=18),e.info.ranksep===void 0&&(e.info.ranksep=36);let n=e.info.n_cluster??0,t=e.info.clust;for(let o=1;o<=n;o++)t&&t[o-1]&&bc(t[o-1])}function au(e){for(let t of M(e))hi(t,e),Y9(t);let n=e.root.info.gvc?.textMeasurer;for(let t of e.edges)J9(t),n&&Ln(t,e,n)}function Tm(e){let n=$o(e.root,"_new_rank",!1);if(n===null)return;let t=M(n);for(let o of t)tr(e.root,o),RP(e.root,o),Qg(e.root,o);Zg(e.root,n)}function km(e){let n=e.info.nlist;for(;n!==void 0;){let t=n.info.next;n.info.in=void 0,n.info.out=void 0,n.info.flat_in=void 0,n.info.flat_out=void 0,n.info.other=void 0,n.info.next=void 0,n.info.prev=void 0,n=t}e.info.nlist=void 0}var K9=(e,n)=>e!==void 0&&e.toLowerCase()===n.toLowerCase();function WH(e,n){return K9(e.port,n)?{box:e.box,sides:e.sidesMask??md}:e.nested!==void 0?Cm(e.nested,n):null}function Cm(e,n){if(K9(e.port,n))return{box:e.box,sides:e.boundarySides??md};for(let t of e.cells){let o=WH(t,n);if(o!==null)return o}return null}function YH(e){return e.info.shape?.polygon===cs}function _m(e){return e.root.info.rankdir&3}function JH(e){return(_m(e)&1)!==0}function Q9(e,n){switch(n){case 90:return{x:e.y,y:-e.x};case 180:return{x:e.x,y:-e.y};case 270:return{x:e.y,y:e.x};default:return e}}function KH(e){return e===4?1:e===1?4:e}function qH(e){return e===4?2:e===1?8:e===8?4:e===2?1:e}function QH(e){return e===4?2:e===1?8:e===8?1:e===2?4:e}function ZH(e,n){switch(n){case ft:return KH(e);case ut:return qH(e);case dt:return QH(e);default:return e}}function eV(e){return e===Math.PI?-.5*Math.PI:e===Math.PI*.75?-.25*Math.PI:e===Math.PI*.5?0:e===0?Math.PI*.5:e===Math.PI*-.25?Math.PI*.75:e===Math.PI*-.5?Math.PI:e}function nV(e,n){switch(n){case ft:return-e;case ut:return e-Math.PI*.5;case dt:return eV(e);default:return e}}function tV(e){return{ur:{x:e.info.lw,y:e.info.ht/2},ll:{x:-e.info.lw,y:-(e.info.ht/2)}}}function oV(e){return{ur:{x:e.info.ht/2,y:e.info.lw},ll:{x:-(e.info.ht/2),y:-e.info.lw}}}function rV(e,n){if(n!==null){let t={x:(n.ll.x+n.ur.x)/2,y:(n.ll.y+n.ur.y)/2};return{b:n,p:t,defined:!0}}return{b:JH(e)?oV(e):tV(e),p:{x:0,y:0},defined:!1}}function q9(e){return{p:e,theta:0,side:0,constrain:!1,clip:!0,dyna:!1,defined:!1,rv:0}}function uu(e){return{p:e,theta:0,side:0,constrain:!1,clip:!0,dyna:!1,defined:!1,rv:1}}function iV(e,n,t,o){let r={constrain:!0,clip:!1,dyna:!1};switch(e){case"":return{...r,p:{x:t.x,y:n.ur.y},theta:Math.PI*.5,side:o&4,defined:!0,rv:0};case"e":return{...r,p:{x:n.ur.x,y:n.ur.y},theta:Math.PI*.25,side:o&6,defined:!0,rv:0};case"w":return{...r,p:{x:n.ll.x,y:n.ur.y},theta:Math.PI*.75,side:o&12,defined:!0,rv:0};default:return uu({x:t.x,y:t.y})}}function sV(e,n,t,o){let r={constrain:!0,clip:!1,dyna:!1};switch(e){case"":return{...r,p:{x:t.x,y:n.ll.y},theta:-Math.PI*.5,side:o&1,defined:!0,rv:0};case"e":return{...r,p:{x:n.ur.x,y:n.ll.y},theta:-Math.PI*.25,side:o&3,defined:!0,rv:0};case"w":return{...r,p:{x:n.ll.x,y:n.ll.y},theta:-Math.PI*.75,side:o&9,defined:!0,rv:0};default:return uu({x:t.x,y:t.y})}}function lV(e,n,t,o){return e.length>0?uu(t):{p:{x:n.ur.x,y:t.y},theta:0,side:o&2,constrain:!0,clip:!1,dyna:!1,defined:!0,rv:0}}function aV(e,n,t,o){return e.length>0?uu(t):{p:{x:n.ll.x,y:t.y},theta:Math.PI,side:o&8,constrain:!0,clip:!1,dyna:!1,defined:!0,rv:0}}function uV(e,n,t,o){if(e.length===0)return q9(t);let r=e.slice(1);switch(e[0]){case"n":return iV(r,n,t,o);case"s":return sV(r,n,t,o);case"e":return lV(r,n,t,o);case"w":return aV(r,n,t,o);case"_":return{p:{...t},theta:0,side:o,constrain:!1,clip:!0,dyna:!0,defined:!1,rv:0};case"c":return q9(t);default:return uu(t)}}function fV(e,n){if(n.x===0&&n.y===0){e.order=ei/2|0;return}let t=Math.atan2(n.y,n.x)+1.5*Math.PI;t>=2*Math.PI&&(t-=2*Math.PI),e.order=ei*t/(2*Math.PI)|0}function dV(e,n,t,o,r){let i=Q9(t.p,90*o);e.p=i,e.bp=n,e.side=t.dyna?t.side:ZH(t.side,o),e.theta=nV(t.theta,o),fV(e,i),e.constrained=t.constrain,e.defined=r,e.clip=t.clip,e.dyna=t.dyna}function cV(e){return e.info.shape?.fns?.insidefn??null}function pV(e,n,t,o,r){let i={x:o,y:t};r&&(i=Q9(i,90*r));let s=[{x:0,y:0},{x:0,y:0},{x:i.x,y:i.y},{x:i.x,y:i.y}],l={nodeCoord:e.info.coord,rw:e.info.rw,bp:null,node:e};return oi(l,n,s,!0),r?Yo(s[0],90*r):s[0]}function mV(e,n,t,o){if(n.rv!==0||!n.constrain)return;let r=cV(e);if(r===null)return;let i=4*Math.max(t.ur.x,t.ur.y),s=n.p.x===t.ur.x?i:n.p.x===t.ll.x?-i:o.x,l=n.p.y===t.ur.y?i:n.p.y===t.ll.y?-i:o.y;n.p=pV(e,r,l,s,_m(e))}function bi(e,n,t){let{bp:o,compass:r,sides:i}=n,{b:s,p:l,defined:a}=rV(e,o),u=uV(r,s,l,i);o===null&&!YH(e)&&mV(e,u,s,l);let f=u.rv===1?a:u.defined||a;return dV(t,o,u,_m(e),f),u.rv}function xV(e,n,t){let o=e.info.label,r=o?.u?.kind==="html"?o.u.html:void 0;if(r===void 0)return null;let i=Cm(r,n);return i===null?null:(t.value=i.sides,i.box)}function Z9(e,n,t){if(n.length===0)return ue();let o=t.length===0?"_":t,r=15,i=ue();if(e.info.label?.html===!0){let l={value:r},a=xV(e,n,l);if(a!==null)return bi(e,{bp:a,compass:o,sides:l.value},i),i.name=null,i}return bi(e,{bp:null,compass:n,sides:r},i),i.name=null,i}var hV=15;function e7(e,n){if(e.id!==null&&e.id===n)return e;if(e.fld!==null)for(let t=0;t<e.n_flds;t++){let o=e7(e.fld[t],n);if(o!==null)return o}return null}function n7(e,n,t){if(n.length===0)return ue();let o=t.length===0?"_":t,r=e.info.shape_info,i=ue();if(r===void 0)return i;let s=e7(r,n);return s!==null?bi(e,{bp:s.b,compass:o,sides:s.sides},i):bi(e,{bp:r.b,compass:n,sides:hV},i),i}function t7(e,n,t,o,r){if(!n.defined)return 0;let i=e.info.shape_info;if(i===void 0||i.fld===null)return t;let s=e.root.info.flip===!0,l=e.info.coord.x,a=e.info.coord.y,u=e.info.ht/2;for(let f=0;f<i.n_flds;f++){let d=i.fld[f].b,c=s?d.ll.y:d.ll.x,m=s?d.ur.y:d.ur.x;if(c<=n.p.x&&n.p.x<=m){o[0]=s?{ll:{x:d.ll.y+l,y:d.ll.x+a},ur:{x:d.ur.y+l,y:a+u}}:{ll:{x:l+c,y:a-u},ur:{x:l+m,y:a+u}},r[0]=1;break}}return t}var bV=vP,Am={initfn:null,freefn:null,portfn:Z9,insidefn:bV,pboxfn:null,codefn:EP},gV={...Am,insidefn:SP},yV={initfn:null,freefn:null,portfn:n7,insidefn:wP,pboxfn:t7,codefn:uP},O=(e,n)=>({name:e,fns:Am,polygon:n,kind:1,usershape:!1}),PV=(e,n)=>({name:e,fns:gV,polygon:n,kind:1,usershape:!1}),EV=(e,n)=>({name:e,fns:Am,polygon:n,kind:3,usershape:!1}),o7=e=>({name:e,fns:yV,polygon:null,kind:2,usershape:!1}),vV=e=>({name:e,fns:null,polygon:null,kind:4,usershape:!1}),r7=[O("box",cs),O("polygon",ry),O("ellipse",m0),O("oval",m0),O("circle",x0),EV("point",x0),O("egg",iy),O("triangle",sy),O("none",h0),O("plaintext",h0),O("plain",ay),O("diamond",uy),O("trapezium",fy),O("parallelogram",dy),O("house",cy),O("pentagon",py),O("hexagon",my),O("septagon",xy),O("octagon",hy),O("note",by),O("tab",gy),O("folder",yy),O("box3d",Py),O("component",Ey),O("cylinder",Sy),O("rect",cs),O("rectangle",cs),O("square",ly),O("doublecircle",wy),O("doubleoctagon",ky),O("tripleoctagon",Cy),O("invtriangle",Ny),O("invtrapezium",Ry),O("invhouse",Ty),O("underline",vy),O("Mdiamond",_y),O("Msquare",Ay),O("Mcircle",Gy),O("promoter",Ly),O("cds",Iy),O("terminator",Oy),O("utr",Dy),O("insulator",By),O("ribosite",Fy),O("rnastab",zy),O("proteasesite",jy),O("proteinstab",Hy),O("primersite",Vy),O("restrictionsite",Uy),O("fivepoverhang",Xy),O("threepoverhang",$y),O("noverhang",Wy),O("assembly",Yy),O("signature",Jy),O("rpromoter",Ky),O("larrow",Qy),O("rarrow",qy),O("lpromoter",Zy),o7("record"),o7("Mrecord"),vV("epsf"),PV("star",My)];function vd(e,n){let t=e;n!==void 0&&n!==""&&e!=="epsf"&&(t="box");for(let o of r7)if(o.name===t)return o;return r7[0]}var i7=27,SV=36,a7=.75,gc=.01,u7=.5,yc=.02,Gm=72,wV=.05,NV=3e-4,RV=1,TV=0;function V(e,n,t){if(e===void 0||e==="")return n;let o=parseFloat(e);return Number.isNaN(o)?n:o<t?t:o}function Te(e,n,t){if(e===void 0||e==="")return n;let o=parseInt(e,10);return Number.isNaN(o)?n:o<t?t:o}function s7(e){if(!e||e.toLowerCase()==="false"||e.toLowerCase()==="no")return!1;if(e.toLowerCase()==="true"||e.toLowerCase()==="yes")return!0;let n=parseInt(e,10);return!Number.isNaN(n)&&n!==0}function Oe(e){return e.root.info.gvc?.textMeasurer}function kV(e,n,t){return t.sides!==0?{sides:t.sides,skew:t.skew,distortion:t.distortion}:{skew:V(L(e,n,"skew"),0,-100),sides:Te(L(e,n,"sides"),4,0),distortion:V(L(e,n,"distortion"),0,-100)}}function CV(e,n){let t=V(L(e,n,"width"),0,gc),o=V(L(e,n,"height"),0,yc);return 72*Math.max(t,o)}function _V(e,n){return{widthIn:V(L(e,n,"width"),a7,gc),heightIn:V(L(e,n,"height"),u7,yc),userSizePts:CV(e,n),margin:L(e,n,"margin"),fixedsize:L(e,n,"fixedsize")??"false",labelloc:L(e,n,"labelloc"),quantumIn:V(n.root.attrs.get("quantum"),0,0)}}function AV(e,n,t,o,r){let i=t.polygon;return{labelDimen:o,...kV(e,n,i),..._V(e,n),peripheries:Te(L(e,n,"peripheries"),i.peripheries,0),orientation:i.orientation+V(L(e,n,"orientation"),0,-360),penwidth:V(L(e,n,"penwidth"),1,0),regular:i.regular||s7(L(e,n,"regular")),isPlain:t.name==="plain",optionShape:i.option.shape,nojustify:s7(L(e,n,"nojustify")),flip:r}}function l7(e,n,t){let o=L(e,n,"xlabel");if(!o||o.length===0)return;let r=La(e,n),i=Sn(o),s=i?wn(o):o;e.info.xlabel=Hn(s,i,r,t,e),n.root.info.has_labels=(n.root.info.has_labels??0)|pc}function GV(e,n){let t=V(L(e,n,"width"),Number.MAX_VALUE,gc),o=V(L(e,n,"height"),Number.MAX_VALUE,yc),r=Math.min(t,o);return r===Number.MAX_VALUE?wV:r>0?Math.max(r,NV):r}function MV(e,n,t){let o=n>1?e+2*vt*(n-1):e,r=n>=1&&t>0?o+t:o;return{...go(o,o,!1),outlineW:r,outlineH:r,baseW:e,baseH:e}}function LV(e,n,t){let o=n.root.info.flip===!0,r=Te(L(e,n,"peripheries"),t.polygon.peripheries,0),i=V(L(e,n,"penwidth"),RV,TV),s=GV(e,n)*Gm;f7(e,MV(s,r,i),o),Ed(e,{...t.polygon,peripheries:r,sides:2,penwidth:i,vertices:null})}function IV(e,n,t){let o=vd(L(e,n,"shape")??"ellipse",L(e,n,"shapefile"));if(e.info.shape=o,o.kind===2)return c2(e,n,t),l7(e,n,t),d2(e,n,t),!0;x2(e,n,t),l7(e,n,t);let r=o.polygon;if(r===null)return!1;if(o.kind===3)return LV(e,n,{...o,polygon:r}),!0;let i=e.info.label,s=n.root.info.flip===!0,l=AV(e,n,{...o,polygon:r},i.dimen,s),a=Z4({...l,flip:!1});return i.space=a.space,i.valign=a.valign.charCodeAt(0),f7(e,a,s),Ed(e,OV(r,l)),!0}function OV(e,n){let t=n.sides;return t<=2&&(n.distortion!==0||n.skew!==0)&&(t=120),{...e,regular:n.regular,peripheries:n.peripheries,sides:t,orientation:n.orientation,distortion:n.distortion,skew:n.skew,penwidth:n.penwidth??1}}function f7(e,n,t){let o=n.lw+n.rw;e.info.width=o/72,e.info.height=n.ht/72,e.info.outline_width=n.outlineW/72,e.info.outline_height=n.outlineH/72,e.info.base_width=n.baseW/72,e.info.base_height=n.baseH/72;let r=go(e.info.width*Gm,e.info.height*Gm,t);e.info.lw=r.lw,e.info.rw=r.rw,e.info.ht=r.ht}function DV(e,n){let t=V(L(e,n,"width"),a7,gc),o=V(L(e,n,"height"),u7,yc),r=n.root.info.flip===!0,i=r?o:t,s=r?t:o;e.info.lw||(e.info.lw=Math.max(i*72/2,i7)),e.info.rw||(e.info.rw=Math.max(i*72/2,i7)),e.info.ht||(e.info.ht=Math.max(s*72,SV))}function hi(e,n){let t=Oe(n);t!==void 0&&IV(e,n,t)||DV(e,n)}function qt(e){for(let n of e.nodes.values())hi(n,e)}var BV=[["AvantGarde-Book","URW Gothic L","book",null,null,"sans-Serif"],["AvantGarde-BookOblique","URW Gothic L","book",null,"oblique","sans-Serif"],["AvantGarde-Demi","URW Gothic L","demi",null,null,"sans-Serif"],["AvantGarde-DemiOblique","URW Gothic L","demi",null,"oblique","sans-Serif"],["Bookman-Demi","URW Bookman L","demi",null,null,"serif"],["Bookman-DemiItalic","URW Bookman L","demi",null,"italic","serif"],["Bookman-Light","URW Bookman L","light",null,null,"serif"],["Bookman-LightItalic","URW Bookman L","light",null,"italic","serif"],["Courier","Courier",null,null,null,"monospace"],["Courier-Bold","Courier","bold",null,null,"monospace"],["Courier-BoldOblique","Courier","bold",null,"oblique","monospace"],["Courier-Oblique","Courier",null,null,"oblique","monospace"],["Helvetica","Helvetica",null,null,null,"sans-Serif"],["Helvetica-Bold","Helvetica","bold",null,null,"sans-Serif"],["Helvetica-BoldOblique","Helvetica","bold",null,"oblique","sans-Serif"],["Helvetica-Narrow","Helvetica",null,"condensed",null,"sans-Serif"],["Helvetica-Narrow-Bold","Helvetica","bold","condensed",null,"sans-Serif"],["Helvetica-Narrow-BoldOblique","Helvetica","bold","condensed","oblique","sans-Serif"],["Helvetica-Narrow-Oblique","Helvetica",null,"condensed","oblique","sans-Serif"],["Helvetica-Oblique","Helvetica",null,null,"oblique","sans-Serif"],["NewCenturySchlbk-Bold","Century Schoolbook L","bold",null,null,"serif"],["NewCenturySchlbk-BoldItalic","Century Schoolbook L","bold",null,"italic","serif"],["NewCenturySchlbk-Italic","Century Schoolbook L",null,null,"italic","serif"],["NewCenturySchlbk-Roman","Century Schoolbook L","roman",null,null,"serif"],["Palatino-Bold","Palatino Linotype","bold",null,null,"serif"],["Palatino-BoldItalic","Palatino Linotype","bold",null,"italic","serif"],["Palatino-Italic","Palatino Linotype",null,null,"italic","serif"],["Palatino-Roman","Palatino Linotype","roman",null,null,"serif"],["Symbol","Symbol",null,null,null,"fantasy"],["Times-Bold","Times","bold",null,null,"serif"],["Times-BoldItalic","Times","bold",null,"italic","serif"],["Times-Italic","Times",null,null,"italic","serif"],["Times-Roman","Times",null,null,null,"serif"],["ZapfChancery-MediumItalic","URW Chancery L","medium",null,"italic","serif"],["ZapfDingbats","Dingbats",null,null,null,"fantasy"]],FV=new Map(BV.map(e=>[e[0].toLowerCase(),{family:e[1],weight:e[2],stretch:e[3],style:e[4],svgFontFamily:e[5]}]));function zV(e){return FV.get(e.toLowerCase())??null}function d7(e){let n=e!==null?zV(e):null;if(n===null)return null;let o=' font-family="'+(n.svgFontFamily!==n.family?n.family+","+n.svgFontFamily:n.family)+'"';return n.weight!==null&&(o+=' font-weight="'+n.weight+'"'),n.stretch!==null&&(o+=' font-stretch="'+n.stretch+'"'),n.style!==null&&(o+=' font-style="'+n.style+'"'),{attrs:o,weight:n.weight!==null,style:n.style!==null}}function jV(e){let n=e[1].x-e[0].x,t=e[1].y-e[0].y;return{minX:e[0].x-n,maxX:e[0].x+n,minY:e[0].y-t,maxY:e[0].y+t}}function HV(e){let n=e[0].x,t=e[0].x,o=e[0].y,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];s.x<n&&(n=s.x),s.x>t&&(t=s.x),s.y<o&&(o=s.y),s.y>r&&(r=s.y)}return{minX:n,maxX:t,minY:o,maxY:r}}function VV(e,n,t,o){let r=Math.hypot(n-e.minX,t-e.minY);return{g0:{x:n,y:o?t:-t},g1:{x:r/4,y:r}}}function UV(e,n,t,o,r){let i=e.maxX-n,s=Math.sin(o),l=Math.cos(o),a=n-i*l,u=n+i*l;if(r){let f=e.maxY-t;return{g0:{x:a,y:t-f*s},g1:{x:u,y:t+f*s}}}return{g0:{x:a,y:-t+(e.maxY-t)*s},g1:{x:u,y:-t-(t-e.minY)*s}}}function Ec(e,n,t,o=!1){let r=e.length===2?jV(e):HV(e),i=r.minX+(r.maxX-r.minX)/2,s=r.minY+(r.maxY-r.minY)/2;return t?VV(r,i,s,o):UV(r,i,s,n,o)}function XV(e,n){if(n.type==="string")e.write(n.s==="transparent"?"black":n.s);else if(n.type==="rgba"){let t=Math.round(n.r*255).toString(16).padStart(2,"0"),o=Math.round(n.g*255).toString(16).padStart(2,"0"),r=Math.round(n.b*255).toString(16).padStart(2,"0");e.write("#"+t+o+r)}}function $V(e,n){n.type==="rgba"&&Math.round(n.a*255)<255?e.write(String(Math.round(n.a*255)/255)):n.type==="string"&&n.s==="transparent"?e.write("0"):e.write("1.")}function Pc(e,n,t){Math.abs(n)<5e-4?e.write('<stop offset="0" style="stop-color:'):Math.abs(n-1)<5e-4?e.write('<stop offset="1" style="stop-color:'):e.write('<stop offset="'+n.toFixed(3)+'" style="stop-color:'),XV(e,t),e.write(";stop-opacity:"),$V(e,t),e.write(`;"/>
19
- `)}function ul(e,n,t){return(e!==null?Je(e)+"_":"")+n+"_"+String(t)}function WV(e,n,t,o){let{g0:r,g1:i}=Ec(n,o*Math.PI/180,!1);e.write(`<defs>
20
- <linearGradient id="`+t+'"'),e.write(' gradientUnits="userSpaceOnUse" '),e.write('x1="'),e.printDouble(r.x),e.write('" y1="'),e.printDouble(r.y),e.write('" x2="'),e.printDouble(i.x),e.write('" y2="'),e.printDouble(i.y),e.write(`" >
21
- `)}function vc(e,n,t){let o=e.obj;if(o===null)return;WV(e,n,t,o.gradientAngle);let r=o.gradientFrac;Pc(e,r>0?r-.001:0,o.fillColor),Pc(e,r>0?r:1,o.stopColor),e.write(`</linearGradient>
22
- </defs>
23
- `)}function Sc(e,n){let t=e.obj;if(t===null)return;let o=50,r=50;if(t.gradientAngle!==0){let i=t.gradientAngle*Math.PI/180;o=A(50*(1+Math.cos(i))),r=A(50*(1-Math.sin(i)))}e.write(`<defs>
24
- <radialGradient id="`+n+'"'),e.write(' cx="50%" cy="50%" r="75%"'),e.write(' fx="'+String(o)+'%" fy="'+String(r)+`%">
25
- `),Pc(e,0,t.fillColor),Pc(e,1,t.stopColor),e.write(`</radialGradient>
26
- </defs>
27
- `)}var YV=1,JV=.005;function wc(e,n){Math.abs(n-YV)>=JV&&ur(e,n)}function fl(e,n,t){t!==null&&e.write(" "+n+'="'+t+'"')}function KV(e,n,t,o,r,i){let s=e.map(l=>K(l,o));if(o.write('<polygon fill="'+(n?t:"none")+'"'),n&&fl(o,"fill-opacity",i),o.write(' stroke="'+t+'"'),wc(o,r),fl(o,"stroke-opacity",i),o.write(' points="'),gi(o,s),s.length>0){let l=s[0];o.write(" "),o.printDouble(l.x),o.write(","),o.printDouble(l.y)}o.write(`"/>
28
- `)}function qV(e,n,t,o,r){let i=K(e.center,t);t.write('<ellipse fill="'+(e.filled?n:"none")+'"'),e.filled&&fl(t,"fill-opacity",r),t.write(' stroke="'+n+'"'),wc(t,o),fl(t,"stroke-opacity",r),t.write(' cx="'),t.printDouble(i.x),t.write('" cy="'),t.printDouble(i.y),t.write('" rx="'),t.printDouble(e.rx),t.write('" ry="'),t.printDouble(e.ry),t.write(`"/>
29
- `)}function QV(e,n,t,o,r){let i=e.map(s=>K(s,t));t.write('<polyline fill="none" stroke="'+n+'"'),wc(t,o),fl(t,"stroke-opacity",r),t.write(' points="'),gi(t,i),t.write(`"/>
30
- `)}function ZV(e,n,t,o,r){let i=e.map(s=>K(s,t));t.write('<path fill="none" stroke="'+n+'"'),wc(t,o),fl(t,"stroke-opacity",r),t.write(' d="'),fr(t,i),t.write(`"/>
31
- `)}function Qt(e,n,t,o,r=null){for(let i of e)switch(i.kind){case"polygon":KV(i.points,i.filled,n,t,o,r);break;case"ellipse":qV(i,n,t,o,r);break;case"polyline":QV(i.points,n,t,o,r);break;case"bezier":ZV(i.points,n,t,o,r);break}}var Mm=2*Math.PI;function eU(e,n,t,o,r,i){let s=Math.atan2(Math.sin(r)/o,Math.cos(r)/t),l=Math.atan2(Math.sin(i)/o,Math.cos(i)/t);return l-=Mm*Math.floor((l-s)/Mm),i-r>Math.PI&&l-s<Math.PI&&(l+=Mm),{cx:e,cy:n,a:t,b:o,eta1:s,eta2:l}}var nU=[[[3.85268,-21.229,-.330434,.0127842],[-1.61486,.706564,.225945,.263682],[-.910164,.388383,.00551445,.00671814],[-.630184,.192402,.0098871,.0102527]],[[-.162211,9.94329,.13723,.0124084],[-.253135,.00187735,.0230286,.01264],[-.0695069,-.0437594,.0120636,.0163087],[-.0328856,-.00926032,-.00173573,.00527385]]],tU=[[[.0899116,-19.2349,-4.11711,.183362],[.138148,-1.45804,1.32044,1.38474],[.230903,-.450262,.219963,.414038],[.0590565,-.101062,.0430592,.0204699]],[[.0164649,9.89394,.0919496,.00760802],[.0191603,-.0322058,.0134667,-.0825018],[.0156192,-.017535,.00326508,-.228157],[-.0236752,.0405821,-.0173086,.176187]]],oU=[.001,4.98,.207,.0067];function No(e,n){return(e*(e*n[0]+n[1])+n[2])/(e+n[3])}function rU(e,n,t){let o=.5*(n+t),r=e.b/e.a,i=t-n,s=Math.cos(2*o),l=Math.cos(4*o),a=Math.cos(6*o),u=r<.25?nU:tU,f=No(r,u[0][0])+s*No(r,u[0][1])+l*No(r,u[0][2])+a*No(r,u[0][3]),d=No(r,u[1][0])+s*No(r,u[1][1])+l*No(r,u[1][2])+a*No(r,u[1][3]);return No(r,oU)*e.a*Math.exp(f+d*i)}function p7(e,n,t,o,r,i,s){e.push({x:n,y:t},{x:o,y:r},{x:i,y:s})}function c7(e,n,t){let o=e[e.length-1];p7(e,o.x,o.y,n,t,n,t)}function iU(e){let t=!1,o=1;for(;!t&&o<1024;){let C=(e.eta2-e.eta1)/o;if(C<=.5*Math.PI){let ne=e.eta1;t=!0;for(let I=0;t&&I<o;++I){let me=ne;ne+=C,t=rU(e,me,ne)<=1e-5}}o=o<<1}let r=(e.eta2-e.eta1)/o,i=e.eta1,s=Math.cos(i),l=Math.sin(i),a=e.a*s,u=e.b*l,f=e.a*l,d=e.b*s,c=e.cx+a,m=e.cy+u,b=-f,g=d,E=[];E.push({x:e.cx,y:e.cy}),c7(E,c,m);let R=Math.tan(.5*r),N=Math.sin(r)*(Math.sqrt(4+3*R*R)-1)/3;for(let C=0;C<o;++C){let ne=c,I=m,me=b,Xe=g;i+=r,s=Math.cos(i),l=Math.sin(i),a=e.a*s,u=e.b*l,f=e.a*l,d=e.b*s,c=e.cx+a,m=e.cy+u,b=-f,g=d,p7(E,ne+N*me,I+N*Xe,c-N*b,m-N*g,c,m)}return c7(E,E[0].x,E[0].y),E}function m7(e,n,t,o,r){let i=eU(e.x,e.y,n,t,o,r);return iU(i)}function sU(e,n){for(let o=n-1;o>=0;o--)if(Math.hypot(e[o].x-e[n].x,e[o].y-e[n].y)>.01)return o;return-1}function lU(e,n,t){for(let r=n+1;r<t;r++)if(Math.hypot(e[r].x-e[n].x,e[r].y-e[n].y)>.01)return r;return-1}function aU(e,n,t,o,r,i,s,l,a){l&&a?t>0&&i<0?(e.wedgeCenter={x:n.x-s,y:n.y-s},e.angle1=0,e.angle2=Math.PI/2):t>0&&i>0?(e.wedgeCenter={x:n.x-s,y:n.y+s},e.angle1=-Math.PI/2,e.angle2=0):t<0&&i<0?(e.wedgeCenter={x:n.x+s,y:n.y-s},e.angle1=Math.PI/2,e.angle2=Math.PI):(e.wedgeCenter={x:n.x+s,y:n.y+s},e.angle1=Math.PI,e.angle2=3*Math.PI/2):o<0&&r>0?(e.wedgeCenter={x:n.x+s,y:n.y+s},e.angle1=Math.PI,e.angle2=3*Math.PI/2):o<0&&r<0?(e.wedgeCenter={x:n.x-s,y:n.y+s},e.angle1=3*Math.PI/2,e.angle2=2*Math.PI):o>0&&r>0?(e.wedgeCenter={x:n.x+s,y:n.y-s},e.angle1=Math.PI/2,e.angle2=Math.PI):(e.wedgeCenter={x:n.x-s,y:n.y-s},e.angle1=0,e.angle2=Math.PI/2)}function uU(e,n,t,o,r,i,s,l,a,u,f){for(let C of e){let ne=n[C.idx];if(Math.hypot(o.x-ne.x,o.y-ne.y)<.01)return}let c={idx:t,truncPrev:{x:0,y:0},truncNext:{x:0,y:0},wedgeCenter:{x:0,y:0},angle1:0,angle2:0},m=Math.hypot(r,i),b=Math.hypot(s,l),g=r/m,E=i/m,R=s/b,N=l/b;c.truncPrev={x:o.x-g*a,y:o.y-E*a},c.truncNext={x:o.x+R*a,y:o.y+N*a},aU(c,o,r,i,s,l,a,u,f),e.push(c)}function fU(e,n){let o=e.length,r=[];for(let i=0;i<o;i++){let s=sU(e,i),l=lU(e,i,o);if(s===-1||l===-1)continue;let a=e[s],u=e[i],f=e[l],d=u.x-a.x,c=u.y-a.y,m=f.x-u.x,b=f.y-u.y,g=Math.abs(c)<.1&&Math.abs(d)>.1,E=Math.abs(d)<.1&&Math.abs(c)>.1,R=Math.abs(b)<.1&&Math.abs(m)>.1,N=Math.abs(m)<.1&&Math.abs(b)>.1;(g&&N||E&&R)&&uU(r,e,i,u,d,c,m,b,n,g,N)}return r.sort((i,s)=>i.idx-s.idx),r}function x7(e,n,t,o){for(let r of t){let i=n[r.idx];if(Math.hypot(e.x-i.x,e.y-i.y)<o)return!0}return!1}function dU(e,n){let o=e.length,r=[],i=0,s=e[0];for(let l=0;l<=n.length;l++){let a,u;l<n.length?(a=n[l].idx,u=n[l].truncPrev):(a=o-1,u=e[o-1]);let f=[s];for(let d=i+1;d<a;d++)x7(e[d],e,n,.01)||f.push(e[d]);if(f.push(u),r.push(f),l<n.length){let d=n[l].idx+1;for(;d<o&&x7(e[d],e,n,.01);)d++;i=d,s=n[l].truncNext}}return r}function cU(e,n){let t=[];for(let o of e){let r=m7(o.wedgeCenter,n,n,o.angle1,o.angle2);if(r.length>4){let s=r.length-4;(s>=3?s-3+1:0)>=2&&t.push(r.slice(3,s+1))}}return t}function Nc(e,n){let t=fU(e,n);return t.length===0?[]:[...dU(e,t),...cU(t,n)]}var pU=`<?xml version="1.0" encoding="UTF-8" standalone="no"?>
32
- `,mU=`<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
33
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
34
- `,xU=`<!-- Generated by graphviz-ts -->
35
- `,g7="\0transparent";function h7(e){return String(parseFloat(e.toPrecision(6)))}function y7(e){let n=e.bb,t=n.ur.x-n.ll.x+2*e.pad.x,o=n.ur.y-n.ll.y+2*e.pad.y,r=t*e.scale.x,i=o*e.scale.y,s=e.rotation!==0,l=s?i:r,a=s?r:i,u=A(l+2*e.margin.x),f=A(a+2*e.margin.y);e.write('<svg width="'+String(u)+'pt" height="'+String(f)+`pt"
36
- `);let d=A(e.margin.x),c=A(e.margin.y),m=A(e.margin.x+l),b=A(e.margin.y+a);e.write(' viewBox="'+String(d)+".00 "+String(c)+".00 "+String(m)+".00 "+String(b)+`.00"
37
- `),e.write(' xmlns="http://www.w3.org/2000/svg"'),e.write(` xmlns:xlink="http://www.w3.org/1999/xlink">
38
- `)}function P7(e,n,t,o,r){let i=h7(r.scale.x),s=h7(r.scale.y),l=String(-r.rotation);r.write('<g id="'+Ke(e)+'" '+n+' transform="scale('+i+" "+s+") rotate("+l+") translate("),r.printDouble(t),r.write(" "),r.printDouble(o),r.write(`)">
39
- `)}function E7(e,n){e.name.length>0&&e.name[0]!=="%"&&n.write("<title>"+Ke(e.name)+`</title>
40
- `)}function b7(e){if(!e||e.length===0)return"white";if(e==="transparent")return g7;let n=Es(e),t=n!==null?n[0]:e;return Ht(X(t))}function Lm(e,n,t){if(n===g7)return;let o=e.ll.x-t.pad.x,r=e.ur.x+t.pad.x,i=-(e.ur.y+t.pad.y),s=-(e.ll.y-t.pad.y),l=[[o,s],[o,i],[r,i],[r,s],[o,s]];t.write('<polygon fill="'+n+'" stroke="none" points="'),l.forEach(([a,u],f)=>{f>0&&t.write(" "),t.printDouble(a),t.write(","),t.printDouble(u)}),t.write(`"/>
41
- `)}function hU(e,n){let t=e.ll.x-n.x,o=e.ur.x+n.x,r=e.ll.y-n.y,i=e.ur.y+n.y;return[{x:t,y:r},{x:t,y:i},{x:o,y:i},{x:o,y:r}]}function bU(e,n,t){let o=e.ll.x-t.pad.x,r=e.ur.x+t.pad.x,i=-(e.ur.y+t.pad.y),s=-(e.ll.y-t.pad.y),l=[[o,s],[o,i],[r,i],[r,s],[o,s]];t.write('<polygon fill="url(#'+n+')" stroke="none" points="'),l.forEach(([a,u],f)=>{f>0&&t.write(" "),t.printDouble(a),t.write(","),t.printDouble(u)}),t.write(`"/>
42
- `)}function gU(e,n,t){let o=Hr(0);o.id="graph0",o.fillColor=X(n.fillColor),o.stopColor=X(n.stopColor),o.gradientFrac=n.frac,o.gradientAngle=n.angle,o.fill=n.radial?3:2,t.pushObj(o);let r;n.radial?(r=ul("graph0","r",t.radialGradId++),Sc(t,r)):(r=ul("graph0","l",t.linearGradId++),vc(t,hU(e,t.pad),r)),t.popObj(),bU(e,r,t)}function yU(e,n){let t=ba(n);if(t===null)return null;let o=ce(e.attrs.get("style")),r=e.attrs.get("gradientangle"),i=r&&parseInt(r,10)||0;return{fillColor:t.fillColor,stopColor:t.stopColor,frac:t.frac,angle:i,radial:o.radial}}function PU(e,n,t,o){if(!t||t.length===0||t==="transparent"){Lm(n,b7(t),o);return}let r=yU(e,t);if(r!==null){gU(n,r,o);return}Lm(n,b7(t),o)}function Im(e,n){n.devscale={x:1,y:-1},n.directed=e.kind==="directed"||e.kind==="strict-directed",n.drawingId=e.attrs.get("id")??"",n.write(pU);let t=e.attrs.get("stylesheet");t!==void 0&&t.length>0&&n.write('<?xml-stylesheet href="'+t+`" type="text/css"?>
43
- `),n.write(mU),n.write(xU),y7(n)}function Om(e,n){let t=n.bb,o=n.scale.x,r=n.rotation!==0?-(t.ur.x+n.pad.x)-n.margin.x/o:n.pad.x+n.margin.x/o,i=t.ur.y+n.pad.y+n.margin.y/o;P7(n.idLayerPrefix()+Da(e,n),bP(e),r,i,n),E7(e,n)}function Dm(e,n){PU(e,n.bb,e.attrs.get("bgcolor"),n)}function Bm(e){e.write(`</g>
44
- `)}function Fm(e,n){n.write('<g id="'+Je(e)+`" class="layer">
45
- `)}function zm(e){e.write(`</g>
46
- `)}function jm(e){e.write(`</svg>
47
- `)}function Hm(e,n,t){let o=e.x-n.x,r=e.y-n.y,i=t/Math.sqrt(o*o+r*r+1e-4);return{x:r*i,y:-o*i}}function EU(e,n,t,o,r){let i=n.x-t.x,s=n.y-t.y,l=Math.hypot(i,s),a=i,u=s;l<1e-4&&(a=e.x-o.x,u=e.y-o.y,l=Math.sqrt(a*a+u*u+1e-4));let f=r/l;return{x:u*f,y:-a*f}}function Rc(e,n){let t=e.length,o=new Array(t).fill({x:0,y:0}),r=new Array(t).fill({x:0,y:0}),i=e[0],s={x:0,y:0},l=0;for(l=0;l<t-1;l+=3){let a=i,u=e[l+1];l===0?o[l]=Hm(a,u,2):o[l]=Hm(s,u,2),s=e[l+2],i=e[l+3];let f=EU(a,u,s,i,2);o[l+1]=f,o[l+2]=f,r[l]={x:a.x-n*o[l].x,y:a.y-n*o[l].y},r[l+1]={x:u.x-n*o[l+1].x,y:u.y-n*o[l+1].y},r[l+2]={x:s.x-n*o[l+2].x,y:s.y-n*o[l+2].y}}return o[l]=Hm(s,i,2),r[l]={x:i.x-n*o[l].x,y:i.y-n*o[l].y},{offlist:o,tmplist:r}}function Tc(e,n){for(let t=0;t<e.length;t++)e[t]={x:e[t].x+n[t].x,y:e[t].y+n[t].y}}var vU=1,SU=.005,Vm="black";function wU(e,n,t){let o=n.obj,r=X(t);o!==null&&(o.penColor=r),n.write('<path fill="none" stroke="'+Ht(r)+'"'),o!==null&&Math.abs(o.penWidth-vU)>=SU&&ur(n,o.penWidth),o!==null&&dl(n,o.pen);let i=Vt(r);i!==null&&n.write(' stroke-opacity="'+i+'"'),n.write(' d="'),fr(n,e),n.write(`"/>
48
- `)}function NU(e,n){let t=[];for(let o of e){if(o===void 0||o.size<4){t.push({offlist:[],tmplist:[]});continue}t.push(Rc(o.list,n))}return t}function RU(e,n,t){for(let o of n)for(let r of e)r.offlist.length!==0&&(Tc(r.tmplist,r.offlist),wU(r.tmplist.map(i=>K(i,t)),t,o))}function Um(e,n,t){let o=e.info.spl,r=(t.match(/:/g)??[]).length,i=NU(o?.list??[],(2+r)/2),s=nt(t).segs.map(l=>l.color??Vm);return RU(i,s,n),{headColor:s[0]??Vm,tailColor:s[1]??s[0]??Vm}}var TU="5,2",kU="1,5",S7=1,v7=2,$m=.005,Wm=4,Ym=0;function yi(e,n){return Ht(n?e.fillColor:e.penColor)}function dl(e,n){n===1?e.write(' stroke-dasharray="'+TU+'"'):n===2&&e.write(' stroke-dasharray="'+kU+'"')}function ur(e,n){if(Math.abs(n-v7)<$m){e.write(' stroke-width="'+String(v7)+'"');return}e.write(' stroke-width="'),e.printDouble(n),e.write('"')}function Xm(e,n,t){let o=Vt(t);o!==null&&e.write(" "+n+'="'+o+'"')}function kc(e,n,t){let o=e.obj,r=o!==null&&n,i=t!==void 0?"url(#"+t+")":r?yi(o,!0):"none";e.write(' fill="'+i+'"'),t===void 0&&r&&Xm(e,"fill-opacity",o.fillColor);let s=o!==null?yi(o,!1):"black";if(e.write(' stroke="'+s+'"'),o===null)return;let l=o.penWidth;Math.abs(l-S7)>=$m&&ur(e,l),dl(e,o.pen),Xm(e,"stroke-opacity",o.penColor)}function gi(e,n){for(let t=0;t<n.length;t++){let o=n[t];e.printDouble(o.x),e.write(","),e.printDouble(o.y),t+1<n.length&&e.write(" ")}}function fr(e,n){for(let t=0;t<n.length;t++){let o=n[t],r=t===0?"M":t===1?"C":" ";e.write(r),e.printDouble(o.x),e.write(","),e.printDouble(o.y)}}function CU(e){return e==="l"?"start":e==="r"?"end":"middle"}function w7(e,n){n.write('<g id="'+Ke(n.idLayerPrefix()+qr(e,n)+n.idLayerSuffix())+'" '+mP(e)+`>
49
- `),n.write("<title>"+Ke(e.name)+`</title>
50
- `)}function N7(e){e.write(`</g>
51
- `)}function _U(e){return Ke(e)}function R7(e,n){let t=n.directed?"->":"--",o=e.info.tail_port?.name,r=e.info.head_port?.name,i=e.tail.name+(o?":"+o:"")+t+e.head.name+(r?":"+r:"");n.write('<g id="'+Ke(n.idLayerPrefix()+Oa(e,n))+'" '+xP(e)+`>
52
- `),n.write("<title>"+_U(i)+`</title>
53
- `)}function T7(e){e.write(`</g>
54
- `)}function AU(e,n,t,o){e.length>0&&o.write(' xlink:href="'+Je(e)+'"'),n.length>0&&o.write(' xlink:title="'+h2(n)+'"'),t.length>0&&o.write(' target="'+Je(t)+'"')}function k7(e,n,t,o,r){o.length>0?r.write('<g id="a_'+Ke(o)+'"><a'):r.write("<g><a"),AU(e,n,t,r),r.write(`>
55
- `)}function C7(e){e.write(`</a>
56
- </g>
57
- `)}function GU(e){let n=[];return e&Ta&&n.push("underline"),e&Ca&&n.push("overline"),e&ka&&n.push("line-through"),n.join(",")}function MU(e,n,t){e&ks&&!t.weight&&n.write(' font-weight="bold"'),e&Cs&&!t.style&&n.write(' font-style="italic"');let o=e&(Ta|Ca|ka)?GU(e):"";o&&n.write(' text-decoration="'+o+'"'),e&dd&&n.write(' baseline-shift="super"'),e&cd&&n.write(' baseline-shift="sub"')}function _7(e,n,t){let o=CU(n.just),r=-(e.y+n.yoffset_centerline);t.write('<text xml:space="preserve" text-anchor="'+o+'"'),t.write(' x="'),t.printDouble(e.x),t.write('" y="'),t.printDouble(r),t.write('"');let i=d7(n.fontName);i!==null?t.write(i.attrs):t.write(' font-family="'+Je(n.fontName??"Times,serif")+'"'),MU(n.fontFlags,t,i??{weight:!1,style:!1}),t.write(' font-size="'+n.fontSize.toFixed(2)+'"'),t.write(d3(n.fontColor)),t.write(">"+h2(n.str)+`</text>
58
- `)}function Jm(e,n,t){if(!t)return;let o=e.obj;if(o!==null){if(o.fill===2){let r=ul(o.id,"l",e.linearGradId++);return vc(e,n,r),r}if(o.fill===3){let r=ul(o.id,"r",e.radialGradId++);return Sc(e,r),r}}}function A7(e,n,t,o,r){let i=[{x:e.x,y:-e.y},{x:e.x+n,y:-e.y+t}],s=Jm(r,i,o);r.write("<ellipse"),kc(r,o,s),r.write(' cx="'),r.printDouble(e.x),r.write('" cy="'),r.printDouble(e.y),r.write('" rx="'),r.printDouble(n),r.write('" ry="'),r.printDouble(t),r.write(`"/>
59
- `)}function Cc(e,n,t){let o=e.map(i=>({x:i.x,y:-i.y})),r=Jm(t,o,n);if(t.write("<polygon"),kc(t,n,r),t.write(' points="'),gi(t,e),e.length>0){let i=e[0];t.write(" "),t.printDouble(i.x),t.write(","),t.printDouble(i.y)}t.write(`"/>
60
- `)}function G7(e,n,t){let o=e.map(i=>({x:i.x,y:-i.y})),r=Jm(t,o,n);t.write("<path"),kc(t,n,r),t.write(' d="'),fr(t,e),t.write(`"/>
61
- `)}function Km(e,n){n.write("<polyline"),kc(n,!1),n.write(' points="'),gi(n,e),n.write(`"/>
62
- `)}function M7(e,n){n.write("<!-- "+Je(e)+` -->
63
- `)}function L7(e,n){let t=e.info.spl;if(t===void 0||t.size===0)return;let o=n.obj,r=o!==null?yi(o,!1):"black",i={tailDone:!1,headDone:!1};for(let s=0;s<t.size;s++){let l=t.list[s];l===void 0||l.size<4||(I7(l,r,n),LU(e,l,n,i))}IU(e,n,i)}function LU(e,n,t,o){let r=t.obj,i=r!==null?yi(r,!1):"black",s=r!==null?Vt(r.penColor):null,l=r!==null?r.penWidth:1;n.sflag!==0&&!o.tailDone&&e.info.tailArrowOps?.length&&(Qt(e.info.tailArrowOps,i,t,l,s),o.tailDone=!0),n.eflag!==0&&!o.headDone&&e.info.headArrowOps?.length&&(Qt(e.info.headArrowOps,i,t,l,s),o.headDone=!0)}function IU(e,n,t){let o=n.obj,r=o!==null?yi(o,!1):"black",i=o!==null?Vt(o.penColor):null,s=o!==null?o.penWidth:1;!t.tailDone&&e.info.tailArrowOps?.length&&Qt(e.info.tailArrowOps,r,n,s,i),!t.headDone&&e.info.headArrowOps?.length&&Qt(e.info.headArrowOps,r,n,s,i)}function I7(e,n,t){let o=t.obj,r=e.list.slice(0,e.size).map(i=>K(i,t));t.write('<path fill="none" stroke="'+n+'"'),o!==null&&Math.abs(o.penWidth-S7)>=$m&&ur(t,o.penWidth),o!==null&&dl(t,o.pen),o!==null&&Xm(t,"stroke-opacity",o.penColor),t.write(' d="'),fr(t,r),t.write(`"/>
64
- `)}function _c(e,n){if(e.head.root.attrs.get("splines")!=="ortho")return null;let t=!1,o=0,r=e.attrs.get("style");r!==void 0&&r.split(",").map(s=>s.trim()).includes("rounded")&&(t=!0);let i=e.attrs.get("radius");if(i!==void 0&&i.length>0&&(o=parseFloat(i)||0,t=o>0),t&&o===0){let s=n.obj!==null?n.obj.penWidth:1;o=Math.max(12,s*8)}return t&&o>0?o:null}function O7(e,n,t){let o=e.info.spl;if(o===void 0||o.size===0)return;let r=t.obj,i=r!==null?yi(r,!1):"black";for(let s=0;s<o.size;s++){let l=o.list[s];if(l===void 0||l.size<4)continue;let a=l.list.slice(0,l.size),u=Nc(a,n);if(u.length===0)I7(l,i,t);else for(let f of u)Km(f.map(d=>K(d,t)),t)}}function Ac(e,n){let t=n.obj,o=t!==null?yi(t,!1):"black",r=t!==null?Vt(t.penColor):null,i=t!==null?t.penWidth:1,s=e.info.tailArrowOps;s?.length&&Qt(s,o,n,i,r);let l=e.info.headArrowOps;l?.length&&Qt(l,o,n,i,r)}var cl="[-+]?[0-9.]+(?:[eE][-+]?[0-9]+)?",OU=new RegExp(`^\\s*(${cl})\\s*,\\s*(${cl})(.?)`),DU=new RegExp(`^\\s*(${cl})(.?)`),D7=new RegExp(`^\\s*(${cl})\\s*,\\s*(${cl})`),B7=new RegExp(`^\\s*(${cl})`);function Gc(e){return A(e*De)}function pl(e){if(e===void 0)return null;let n=OU.exec(e);if(n){let o=Number(n[1]),r=Number(n[2]);if(o>0&&r>0)return{x:Gc(o),y:Gc(r),filled:n[3]==="!"}}let t=DU.exec(e);if(t){let o=Number(t[1]);if(o>0)return{x:Gc(o),y:Gc(o),filled:t[2]==="!"}}return null}function Mc(e){if(e!==void 0){let n=D7.exec(e);if(n)return{x:Number(n[1])*De,y:Number(n[2])*De};let t=B7.exec(e);if(t){let o=Number(t[1])*De;return{x:o,y:o}}}return{x:Wm,y:Wm}}function F7(e){if(e!==void 0){let n=D7.exec(e);if(n)return{x:Number(n[1])*De,y:Number(n[2])*De};let t=B7.exec(e);if(t){let o=Number(t[1])*De;return{x:o,y:o}}}return{x:Ym,y:Ym}}function BU(e){let n=e.toLowerCase();return n===""||n==="false"||n==="no"?!1:n==="true"||n==="yes"?!0:Number.parseInt(e,10)!==0}function z7(e){let n=e.attrs.get("rotate");if(n!==void 0)return Number.parseInt(n,10)===90;let t=e.attrs.get("orientation");if(t!==void 0)return t[0]==="l"||t[0]==="L";let o=e.attrs.get("landscape");return o!==void 0?BU(o):!1}function FU(e,n,t){let o=e.x<n||e.y<t,r=e.filled&&e.x>n&&e.y>t;return o||r}function Lc(e,n,t){if(n===null||n.x<=.001||n.y<=.001)return 1;let o=e.ur.x-e.ll.x+2*t.x,r=e.ur.y-e.ll.y+2*t.y;return o<=.001&&(o=n.x),r<=.001&&(r=n.y),FU(n,o,r)?Math.min(n.x/o,n.y/r):1}function V7(e,n){let t=e.get(n);return t!==void 0&&t!==""?t:void 0}function fu(e,n){return er(e,n)}function U7(e,n){return er(hd(e),n)}function Ic(e){return e?.text??null}function X7(e,n,t){for(let o of n){let r=V7(e,o);if(r!==void 0)return{v:t(r),explicit:!0}}return{v:void 0,explicit:!1}}function Zt(e,n){return X7(e.attrs,n,t=>fu(t,e))}function Oc(e,n){return X7(e.attrs,n,t=>U7(t,e))}function ct(e,n,t){return{v:e.v??n??t,explicit:e.explicit}}function zU(e,n){n.label=Ic(e.info.label),n.xlabel=Ic(e.info.xlabel)??n.label,n.tailLabel=Ic(e.info.tail_label)??n.label,n.headLabel=Ic(e.info.head_label)??n.label}function jU(e,n){let t=Zt(e,["href","URL"]).v;n.url=ct(Zt(e,["edgehref","edgeURL"]),t,n.url).v,n.labelUrl=ct(Zt(e,["labelhref","labelURL"]),t,n.labelUrl).v;let o=ct(Zt(e,["tailhref","tailURL"]),t,n.tailUrl);n.tailUrl=o.v,n.explicitTailUrl=o.explicit;let r=ct(Zt(e,["headhref","headURL"]),t,n.headUrl);n.headUrl=r.v,n.explicitHeadUrl=r.explicit}function HU(e,n){let t=Zt(e,["target"]).v,o=ct(Zt(e,["edgetarget"]),t,n.target);n.target=o.v,n.explicitEdgeTarget=o.explicit,n.labelTarget=ct(Zt(e,["labeltarget"]),t,n.labelTarget).v;let r=ct(Zt(e,["tailtarget"]),t,n.tailTarget);n.tailTarget=r.v,n.explicitTailTarget=r.explicit;let i=ct(Zt(e,["headtarget"]),t,n.headTarget);n.headTarget=i.v,n.explicitHeadTarget=i.explicit}function VU(e,n){let t=ct(Oc(e,["tooltip","edgetooltip"]),n.label,n.tooltip);n.tooltip=t.v,n.explicitTooltip=t.explicit;let o=ct(Oc(e,["labeltooltip"]),n.label,n.labelTooltip);n.labelTooltip=o.v,n.explicitLabelTooltip=o.explicit;let r=ct(Oc(e,["tailtooltip"]),n.tailLabel,n.tailTooltip);n.tailTooltip=r.v,n.explicitTailTooltip=r.explicit;let i=ct(Oc(e,["headtooltip"]),n.headLabel,n.headTooltip);n.headTooltip=i.v,n.explicitHeadTooltip=i.explicit}function $7(e,n,t){zU(e,t),jU(e,t),HU(e,t),VU(e,t),t.id=fu(n,e)}function Zm(e,n,t,o){o.label=n;let r=a=>{for(let u=e;u!==null;u=u.parent){let f=V7(u.attrs,a);if(f!==void 0)return f}},i=r("href")??r("URL");i!==void 0&&(o.url=fu(i,e));let s=r("tooltip");s!==void 0?(o.tooltip=U7(s,e),o.explicitTooltip=!0):n!==null&&(o.tooltip=n);let l=r("target");l!==void 0&&(o.target=fu(l,e)),o.id=fu(t,e)}function e5(e,n,t,o,r,i){e.beginAnchor?.(t??"",o??"",r??"",i,n)}function du(e,n){let t=n.obj;return t===null||t.url===null&&!t.explicitTooltip?!1:(e5(e,n,t.url,t.tooltip,t.target,t.id??""),!0)}var j7=20,Dc=2,UU=1e-10;function dr(e,n){return{x:(e.x+n.pad.x-n.bb.ll.x)*n.scale+n.marginOff.x,y:(n.bb.ur.y+n.pad.y-e.y)*n.scale+n.marginOff.y}}function XU(e){return ce(L(e,e.root,"style")).filled}function qm(e,n){let t=L(e,e.root,n);return t!==void 0&&t!==""}function $U(e){return qm(e,"href")||qm(e,"URL")||qm(e,"tooltip")}function WU(e){return e.sides===4&&Math.abs(e.orientation%90)<.5&&e.distortion===0&&e.skew===0}function YU(e){let n=e.attrs.get("samplepoints");if(n===void 0)return j7;let t=parseInt(n,10);return Number.isNaN(t)||t<4||t>60?j7:t}function JU(e,n,t){let o=2*Math.PI/t,r=[],i=0;for(let s=0;s<t;s++)r.push({x:e*Math.cos(i),y:n*Math.sin(i)}),i+=o;return r}function KU(e,n,t,o){if(e.regular)return{shape:1,pts:[n,{x:n.x+t.x,y:n.y+t.y}]};let r=JU(t.x,t.y,o).map(i=>({x:i.x+n.x,y:i.y+n.y}));return{shape:2,pts:r}}function qU(e,n,t,o,r){let i=(o-1)*e.sides,s=[];if(e.sides>=r){let l=Math.trunc(e.sides/r);for(let a=0,u=0;u<r;a+=l,u++){let f=t[a+i];s.push({x:n.x+f.x,y:n.y+f.y})}}else for(let l=0;l<e.sides;l++){let a=t[l+i];s.push({x:n.x+a.x,y:n.y+a.y})}return{shape:2,pts:s}}function QU(e,n,t,o){let r=n.peripheries<2?1:n.peripheries,i=n.vertices,s=YU(e),l=e.info;return n.peripheries===0&&!o?{shape:0,pts:[{x:t.x-l.lw,y:t.y-l.ht/2},{x:t.x+l.lw,y:t.y+l.ht/2}]}:n.sides<3&&n.skew===0&&n.distortion===0?KU(n,t,i[2*r-1],s):qU(n,t,i,r,s)}function W7(e,n,t){if(!$U(e))return;let o=e.info,r=o.coord,i=o.shape_info,s=XU(e),l=i!==void 0&&WU(i)&&(i.peripheries!==0||s),a;i!==void 0&&i.vertices!=null&&!l&&t.mapPolygon?a=QU(e,i,r,s):a={shape:0,pts:[{x:r.x-o.lw,y:r.y-o.ht/2},{x:r.x+o.rw,y:r.y+o.ht/2}]},n.urlMapShape=a.shape,n.urlMapPts=a.pts.map(u=>dr(u,t))}function Y7(e,n){let t={x:n.bb.ll.x-n.pad.x,y:n.bb.ll.y-n.pad.y},o={x:n.bb.ur.x+n.pad.x,y:n.bb.ur.y+n.pad.y};e.urlMapShape=0,e.urlMapPts=[dr(t,n),dr(o,n)]}function n5(e,n,t){n.urlMapShape=0,n.urlMapPts=[dr(e.ll,t),dr(e.ur,t)]}function J7(e,n,t){let o=e.dimen.x/2,r=e.dimen.y/2;n.urlMapShape=0,n.urlMapPts=[dr({x:e.pos.x-o,y:e.pos.y-r},t),dr({x:e.pos.x+o,y:e.pos.y+r},t)]}function H7(e,n,t){let o=n.x-e.x,r=n.y-e.y,i=(t.y-e.y)*o-(t.x-e.x)*r;return i*=i,i<UU?0:i/(o*o+r*r)}function ZU(e){return H7(e[0],e[3],e[1])<Dc*Dc&&H7(e[0],e[3],e[2])<Dc*Dc}function eX(e){let t=[e.slice(0,4)];for(let o=1;o<=3;o++){t[o]=[];for(let r=0;r<=3-o;r++){let i=t[o-1][r],s=t[o-1][r+1];t[o][r]={x:(1-.5)*i.x+.5*s.x,y:(1-.5)*i.y+.5*s.y}}}return{left:[t[0][0],t[1][0],t[2][0],t[3][0]],right:[t[3][0],t[2][1],t[1][2],t[0][3]]}}function Qm(e,n){if(ZU(e))n.length===0&&n.push(e[0]),n.push(e[3]);else{let{left:t,right:o}=eX(e);Qm(t,n),Qm(o,n)}}function nX(e,n,t,o){let r,i;e?(r=e,i=t??{x:2*(n.x-r.x),y:2*(n.y-r.y)}):(i=t,r={x:2*(n.x-i.x),y:2*(n.y-i.y)});let s=Math.atan2(i.y-n.y,i.x-n.x),l=Math.atan2(r.y-n.y,r.x-n.x),a=s-l;a>0&&(a-=2*Math.PI);let u=l+a/2,f={x:o*Math.cos(u),y:o*Math.sin(u)};return{p1:{x:n.x+f.x,y:n.y+f.y},p2:{x:n.x-f.x,y:n.y-f.y}}}function tX(e,n,t){let o=Math.trunc((e.size-1)/3),r=[];for(let a=0;a<o;a++)Qm([e.list[3*a],e.list[3*a+1],e.list[3*a+2],e.list[3*a+3]],r);let i=[],s=[],l=0;for(let a=0;a<r.length;a++){let u=a===0?null:r[a-1],f=a+1<r.length?r[a+1]:null,d=nX(u,r[a],f,n);if(i[l]=d.p1,s[l]=d.p2,l++,a+1===r.length||l===50){let c=[];for(let m=0;m<l;m++)c.push(i[m]);for(let m=0;m<l;m++)c.push(s[l-1-m]);t.push(c),i[0]=i[l-1],s[0]=s[l-1],l=1}}}function K7(e,n,t){let o=[];for(let r of e.list)tX(r,n,o);return o.map(r=>r.map(i=>dr(i,t)))}function o5(e,n){if(n==="")return e===""?[]:[e];let t="["+n.replace(/[\\\]^-]/g,"\\$&")+"]";return e.split(new RegExp(t)).filter(o=>o.length>0)}function q7(e){let n=e.attrs.get("layers"),t=e.attrs.get("layersep")||": ",o=e.attrs.get("layerlistsep")||",";if([...t].some(i=>o.includes(i))&&(o=""),n===void 0||n==="")return{layerIDs:[],numLayers:1,sep:t,listSep:o};let r=o5(n,t);return{layerIDs:[null,...r],numLayers:r.length,sep:t,listSep:o}}function oX(e){return/^[0-9]+$/.test(e)}function t5(e,n,t){if(n==="all")return t;if(oX(n))return parseInt(n,10);for(let o=1;o<=e.numLayers;o++)if(e.layerIDs[o]===n)return o;return-1}function rX(e,n,t){let o=o5(t,e.sep);if(o.length===0)return!1;if(o.length>=2){let r=t5(e,o[0],0),i=t5(e,o[1],e.numLayers);return r<0&&i<0?!1:(r>i&&([r,i]=[i,r]),r<=n&&n<=i)}return t5(e,o[0],n)===n}function Bc(e,n,t){for(let o of o5(t,e.listSep))if(rX(e,n,o))return!0;return!1}function iX(e,n){return n.edges.filter(t=>t.tail===e||t.head===e)}function Q7(e,n,t,o){if(e.numLayers<=1)return!0;let r=t.attrs.get("layer")??"";if(Bc(e,n,r))return!0;if(r!=="")return!1;let i=iX(t,o);return i.length===0?!0:i.some(s=>{let l=s.attrs.get("layer")??"";return l===""||Bc(e,n,l)})}function Z7(e,n,t){if(e.numLayers<=1)return!0;let o=t.attrs.get("layer")??"";return Bc(e,n,o)?!0:o!==""?!1:[t.tail,t.head].some(r=>{let i=r.attrs.get("layer")??"";return i===""||Bc(e,n,i)})}function Fc(e,n,t,o){return e===void 0||n.numLayers<=1||Q7(e,n.layerNum,t,o)}function r5(e,n,t){return e===void 0||n.numLayers<=1||Z7(e,n.layerNum,t)}function sX(e){let n=e.attrs.get("outputorder");return n==="nodesfirst"?"nodesfirst":n==="edgesfirst"?"edgesfirst":"default"}function lX(e,n,t,o,r){let i=new Set;for(let s of e.nodes.values())Fc(r,t,s,e)&&cu(s,n,t,i);for(let s of e.nodes.values())for(let l of o.get(s)??[])r5(r,t,l)&&zc(l,n,t)}function aX(e,n,t,o,r){let i=new Set;for(let s of e.nodes.values())for(let l of o.get(s)??[])r5(r,t,l)&&zc(l,n,t);for(let s of e.nodes.values())Fc(r,t,s,e)&&cu(s,n,t,i)}function e6(e,n,t,o){let r=Xo(e),i=sX(e);if(i==="nodesfirst"){lX(e,n,t,r,o);return}if(i==="edgesfirst"){aX(e,n,t,r,o);return}let s=new Set;for(let l of e.nodes.values()){Fc(o,t,l,e)&&cu(l,n,t,s);for(let a of r.get(l)??[])Fc(o,t,a.head,e)&&cu(a.head,n,t,s),r5(o,t,a)&&zc(a,n,t)}}function uX(e,n,t){Ro(e.info.label,n,t)}function K(e,n){if((n.flags&o3)!==0)return e;let t=n.zoom*n.devscale.x,o=n.zoom*n.devscale.y,r=n.translation.x,i=n.translation.y;return fX(e,r,i,t,o)}function fX(e,n,t,o,r){let i=(e.x+n)*o,s=(e.y+t)*r;return dX(i,s)}function dX(e,n){return{x:e,y:n}}function ml(e){return e?.text??null}function cX(e){let{coord:n,lw:t,rw:o,ht:r}=e.info;return{ll:{x:n.x-t,y:n.y-r/2},ur:{x:n.x+o,y:n.y+r/2}}}function pX(e,n){let t={ll:{x:n.bb.ll.x-n.pad.x,y:n.bb.ll.y-n.pad.y},ur:{x:n.bb.ur.x+n.pad.x,y:n.bb.ur.y+n.pad.y}};return Uf(cX(e),t)}function mX(e,n,t){wa(qr(e,t),ml(e.info.label),t.obj??void 0),s4(L(e,e.root,"imagescale")),n.beginNode(e,t);let o=e.info.shape;o?.fns?.codefn&&o.fns.codefn(t,e),PX(e,n,t),n.endNode(e,t)}function cu(e,n,t,o){if(o.has(e)||(o.add(e),!pX(e,t)))return;let r=e.attrs.get("style");if(ce(r).invis||!Rd(e)&&R0(r))return;let i=Hr(2);i.emitState=8,t.pushObj(i);try{mX(e,n,t)}finally{t.popObj()}}function xX(e,n){if(n.obj===null)return;let t=n.obj,o=ce(e.attrs.get("style"));t.penColor=Ur(e.attrs.get("colorscheme"),()=>X(Ps(e.attrs.get("color")))),t.pen=ys(o),t.penWidth=Xt(o,e.attrs.get("penwidth")),t.rawStyle=td(e.attrs.get("style"))}function zc(e,n,t){let o=e.attrs.get("style");if(ce(o).invis||R0(o))return;let r=Hr(3);r.emitState=9,t.pushObj(r),xX(e,t);try{wa(Oa(e,t),ml(e.info.label),t.obj??void 0),$7(e,Oa(e,t),r),Ur(e.attrs.get("colorscheme"),()=>{n.beginEdge(e,t),n.endEdge(e,t)})}finally{t.popObj()}}var hX=116,bX=98;function gX(e){return e.valign===hX?e.pos.y+e.space.y/2-e.fontsize:e.valign===bX?e.pos.y-e.space.y/2+e.dimen.y-e.fontsize:e.pos.y+e.dimen.y/2-e.fontsize}function yX(e,n){return n==="l"?e.pos.x-e.space.x/2:n==="r"?e.pos.x+e.space.x/2:e.pos.x}function Ro(e,n,t){if(!e?.set)return;if(e.html){if(e.u.kind==="html"){let r=e.u.html,i=e.pos;Jf(t,()=>Na(r,i,n,t))}return}if(e.u.kind!=="txt"||e.u.nspans<1)return;let o=gX(e);for(let r=0;r<e.u.nspans;r++){let i=e.u.span[r];if(!i)break;hs(n,{x:yX(e,i.just),y:o},i,t),o-=i.size.y}}function PX(e,n,t){Ro(e.info.xlabel,n,t)}function EX(e,n,t){wa(Da(e,t),ml(e.info.label),t.obj??void 0),Ro(e.info.label,n,t)}function vX(e,n,t,o){let{ll:r,ur:i}=e.info.bb;if(ce(Sd(e)).rounded){let l=[{x:r.x,y:r.y},{x:i.x,y:r.y},{x:i.x,y:i.y},{x:r.x,y:i.y}];bo(l,{x:0,y:0},n,{renderer:t,job:o});return}let s=[{x:r.x,y:r.y},{x:r.x,y:i.y},{x:i.x,y:i.y},{x:i.x,y:r.y}];t.polygon(s.map(l=>K(l,o)),n,o)}function SX(e,n,t){let o=(t.flags&xo)!==0;o&&jc(e,n,t);let r=Hr(1);r.emitState=1,t.pushObj(r);try{let i=pP(e,t);n.beginCluster?.(e,t),t.obj!==null&&(t.obj.id=Ds(e,t)),wa(Ds(e,t),ml(e.info.label),t.obj??void 0),t.obj!==null&&Zm(e,ml(e.info.label),Ds(e,t),t.obj);let s=du(n,t);(b2(e)!==0||i)&&t.obj?.pen!==0&&vX(e,i,n,t),uX(e,n,t),s&&n.endAnchor?.(t),n.endCluster?.(e,t)}finally{t.popObj()}o||jc(e,n,t)}function jc(e,n,t){let o=e.info.n_cluster??0,r=e.info.clust;if(!(o===0||!r))for(let i=0;i<o;i++){let s=r[i];s&&SX(s,n,t)}}function wX(e,n,t){let o=Hr(0);o.emitState=0,n.pushObj(o);try{let r=q7(e),i=t.beginLayer!==void 0&&r.numLayers>1;n.numLayers=i?r.numLayers:1,n.layerIDs=r.layerIDs,t.beginGraph(e,n);for(let s=1;s<=n.numLayers;s++)n.layerNum=s,i&&t.beginLayer(r.layerIDs[s],n),NX(e,t,n,r),i&&t.endLayer(n);t.endGraph(e,n)}finally{n.popObj()}return n.output.join("")}function NX(e,n,t,o){n.beginPage?.(e,t),t.obj!==null&&Zm(e,ml(e.info.label),Da(e,t),t.obj);let r=du(n,t);n.pageBackground?.(e,t),EX(e,n,t),r&&n.endAnchor?.(t);let i=(t.flags&xo)!==0;i||jc(e,n,t),e6(e,n,t,o),i&&jc(e,n,t),n.endPage?.(e,t)}function eo(e,n,t){let o=e.bestRenderer(t),r=new Wf(t,e.textMeasurer);r.bb=n.info.bb,r.pad=Mc(n.attrs.get("pad")),r.margin=F7(n.attrs.get("margin"));let i=Lc(r.bb,pl(n.attrs.get("size")),r.pad),s=V(n.attrs.get("dpi"),V(n.attrs.get("resolution"),0,0),0),l=s>0?s:De;r.dpi={x:l,y:l};let a=l/De;r.scale={x:i*a,y:i*a},r.rotation=z7(n)?90:0,r.renderer=o,a4();for(let u of n.nodes.values())fP(u,n,r.measurer);return wX(n,r,o)}var Hc;function t6(e){Hc=e}function o6(){return Hc}function RX(){return typeof process<"u"?process.env?.GV_TEXT_MEASURER:void 0}var n6=!1;function TX(){n6||typeof process>"u"||process.env?.GV_FONT_QUIET||!process.stderr?.isTTY||(n6=!0,process.stderr.write("graphviz-ts: measuring text with built-in metrics (kerning/shaping not applied). For host-faithful sizing matching the rendering font, install `canvas` and call setTextMeasurer(new CanvasTextMeasurer(createCanvas(0,0).getContext('2d'))). Silence with GV_FONT_QUIET=1.\n"))}function r6(){if(Hc)return Hc;let e=RX();if(e==="estimate")return new $r;if(e==="lut")return new Rs;if(typeof document<"u")try{let n=document.createElement("canvas").getContext("2d");if(n)return new Ts(n)}catch{}return TX(),new $r}var i6=null;function kX(e,n){let t=n.list[0].tail;for(let r=1;r<n.size;r++){let i=n.list[r],s=i.tail.info.order!==void 0?i.tail.info.order:0,l=t.info.order!==void 0?t.info.order:0;s>l&&(t=i.tail)}let o=t.info.mval!==void 0?t.info.mval:-1;return o>=0?(e.info.mval=o+1,!1):!0}function CX(e,n){let t=n.list[0].head;for(let r=1;r<n.size;r++){let i=n.list[r],s=i.head.info.order!==void 0?i.head.info.order:0,l=t.info.order!==void 0?t.info.order:0;s<l&&(t=i.head)}let o=t.info.mval!==void 0?t.info.mval:-1;return o>0?(e.info.mval=o-1,!1):!0}function _X(e){let n=e.info.flat_in;if(n!==void 0&&n.size>0)return kX(e,n);let t=e.info.flat_out;return t!==void 0&&t.size>0?CX(e,t):!0}function AX(e,n,t){let o=e.info.rank!==void 0?e.info.rank:0,r=n<o?e.info.in:e.info.out;if(r)for(let i=r.size-1;i>=0;i--){let s=r.list[i];Ct(s)<=0||(n<o?t.push(im(s.tail,s.info.tail_port.order)):t.push(im(s.head,s.info.head_port.order)))}}function GX(e){let n=e.length;if(n===0)return-1;if(e.sort((i,s)=>i-s),n===1)return e[0];if(n===2)return Math.trunc((e[0]+e[1])/2);let t=Math.floor(n/2);if(n%2!==0)return e[t];let o=e[t-1]-e[0],r=e[n-1]-e[t];return o===r?Math.trunc((e[t-1]+e[t])/2):(e[t-1]*r+e[t]*o)/(o+r)}function MX(e,n){let t=[];AX(e,n,t),e.info.mval=GX(t)}function LX(e,n,t,o){let r=n.info.rank;if(!r)return!1;let i=r[t];for(let l=0;l<i.n;l++){let a=oe(i,l);a&&MX(a,o)}let s=!1;for(let l=0;l<i.n;l++){let a=oe(i,l);if(!a)continue;let u=a.info.in!==void 0?a.info.in.size:0,f=a.info.out!==void 0?a.info.out.size:0;u===0&&f===0&&_X(a)&&(s=!0)}return s}function i5(e){let n=e.info.rank;if(!n)return;let t=e.info.minrank!==void 0?e.info.minrank:0,o=e.info.maxrank!==void 0?e.info.maxrank:0;for(let r=t;r<=o;r++){let i=n[r].vStart??0;for(let s=0;s<n[r].n;s++){let l=oe(n[r],s);l.info.coord.x=(l.info.order!==void 0?l.info.order:0)-i}}}function IX(e,n){let t=e.vStart??0;for(let r=0;r<e.n;r++)e.v[t+r].info.order=e.v[t+r].info.coord.x+t;let o=e.v.slice(t,t+e.n).sort((r,i)=>(r.info.order!==void 0?r.info.order:0)-(i.info.order!==void 0?i.info.order:0));for(let r=0;r<e.n;r++)e.v[t+r]=o[r];n.valid=!1}function s6(e,n){let t=n.info.rank,o=e.root.info.rank;if(!t||!o)return;let r=n.info.minrank!==void 0?n.info.minrank:0,i=n.info.maxrank!==void 0?n.info.maxrank:0;for(let s=r;s<=i;s++)IX(t[s],o[s])}function OX(e,n,t){for(;n<t;){let o=e[n].info.mval;if(o!==void 0&&o>=0)break;n++}return n}var To={rp:0,muststay:!1};function DX(e,n,t,o){let r=n[t],i=!1;for(let s=t+1;s<o;s++){let l=n[s],a=l.info;if(i&&a.clust)continue;if(sm(e,r,l)!==0)return To.rp=s,To.muststay=!0,To;let u=a.mval;if(u!==void 0&&u>=0)return To.rp=s,To.muststay=!1,To;a.clust&&(i=!0)}return To.rp=o,To.muststay=!1,To}function BX(e,n,t,o,r){let i=!1,s=o.ep,l=o.start;for(;l<s&&(l=OX(t,l,s),!(l>=s));){let a=DX(n,t,l,s),u=a.rp;if(u>=s)break;if(!a.muststay){let f=t[l],d=t[u],c=f.info.mval,m=d.info.mval,b=c!==void 0?c:-1,g=m!==void 0?m:-1;(b>g||b>=g&&r)&&(eu(e,f,d),i=!0)}l=u}return i}function FX(e){return{start:e.vStart??0,n:e.n}}function zX(e,n,t,o,r){let i=e.root.info.rank;if(!i)return;let s=n.info.rank;if(!s)return;let l=s[t].v,{start:a,n:u}=FX(s[t]),f=a+u,d=!1;for(let c=u-1;c>=0;c--)BX(e,n,l,{start:a,ep:f},o)&&(d=!0),!r&&!o&&f--;d&&(i[t].valid=!1,t>0&&(i[t-1].valid=!1))}function jX(e,n,t){let o=n.info.minrank!==void 0?n.info.minrank:0,r=n.info.maxrank!==void 0?n.info.maxrank:0,i=e.root.info.minrank!==void 0?e.root.info.minrank:0,s=e.root.info.maxrank!==void 0?e.root.info.maxrank:0;return t%2===0?{first:o>i?o:o+1,last:r,dir:1}:{first:r<s?r:r-1,last:o,dir:-1}}function HX(e,n,t){let o=t%4<2,r=jX(e,n,t);for(let i=r.first;i!==r.last+r.dir;i+=r.dir){let s=LX(e,n,i,i-r.dir);zX(e,n,i,o,s)}nu(e,n,!o)}function VX(e,n,t,o,r){let i=0;for(let s=0;s<t&&(i6&&i6(`mincross: pass ${r} iter ${s} trying ${i} cur_cross ${o.cur} best_cross ${o.best}`),!(i++>=e.minQuit||o.cur===0));s++)HX(e,n,s),o.cur=ci(e),o.cur<=o.best&&(i5(n),o.cur<y2*o.best&&(i=0),o.best=o.cur)}function UX(e,n,t,o){if(t<=1){let i=Math.min(4,e.maxIter);return n===W(n)&&sc(e,n,t)!==0?-1:(t===0&&tu(e,n),ou(e,n),o.cur=ci(e),o.cur<=o.best&&(i5(n),o.best=o.cur),i)}let r=e.maxIter;return o.cur>o.best&&s6(e,n),o.cur=o.best,r}function Vc(e,n,t){let o=t>1?ci(e):Number.MAX_SAFE_INTEGER,r={cur:o,best:o};t>1&&i5(n);for(let i=t;i<=2;i++){let s=UX(e,n,i,r);if(s<0)return-1;if(VX(e,n,s,r,i),r.cur===0)break}return r.cur>r.best&&s6(e,n),r.best>0&&(nu(e,n,!1),r.best=ci(e)),r.best}function XX(e,n){e.minQuit=8,e.maxIter=24;let t=n.attrs.get("mclimit");if(t){let o=parseFloat(t);o>0&&(e.minQuit=Math.max(1,il(e.minQuit,o)),e.maxIter=Math.max(1,il(e.maxIter,o)))}}function l6(e){let n=e.info.rankleader;if(!n)return;let t=e.info.rank;if(!t)return;let o=e.info.minrank!==void 0?e.info.minrank:0,r=e.info.maxrank!==void 0?e.info.maxrank:0;for(let i=o;i<=r;i++)n[i]=oe(t[i],0)}function s5(e){l6(e);let n=e.info.n_cluster!==void 0?e.info.n_cluster:0,t=e.info.clust;if(t)for(let o=1;o<=n;o++)s5(t[o-1])}function Uc(e,n){let t=n.info.n_cluster!==void 0?n.info.n_cluster:0,o=n.info.clust;if(o)for(let r=1;r<=t;r++)Uc(e,o[r-1]);$X(e,n)}function $X(e,n){let t=n.info.minrank!==void 0?n.info.minrank:0,o=n.info.maxrank!==void 0?n.info.maxrank:0;for(let r=t;r<=o;r++)WX(e,n,r)}function WX(e,n,t){let o=n.info.rankleader;if(!o)return;let r=n.info.rank;if(!r)return;let i=W(n).info.rank;if(!i)return;let s=o[t];if(!s)return;let l=Od(e,n,s,-1),a=Od(e,n,s,1);o[t]=l,r[t].vStart=l.info.order!==void 0?l.info.order:0,r[t].v=i[t].v;let u=a.info.order!==void 0?a.info.order:0,f=l.info.order!==void 0?l.info.order:0;r[t].n=u-f+1}function YX(e,n){e.reMincross=!1,rm(!1),e.root=n;let t=W(n).edges.length+1;e.teList=new Array(t).fill(null),e.tiList=new Array(t).fill(0),XX(e,n),n.info.flags&Em&&o9(n),ru(n),Va(n,1),ic(n),lc(e,n),e.globalMinRank=n.info.minrank!==void 0?n.info.minrank:0,e.globalMaxRank=n.info.maxrank!==void 0?n.info.maxrank:0}function JX(e,n){let t=e.info.comp;if(!t||(e.info.nlist=t[n],n===0))return;let o=e.info.rank;if(!o)return;let r=e.info.minrank!==void 0?e.info.minrank:0,i=e.info.maxrank!==void 0?e.info.maxrank:0;for(let s=r;s<=i;s++){let l=o[s],a=l.vStart!==void 0?l.vStart:0;l.vStart=a+l.n,l.n=0}}function KX(e,n){let t=n.info.comp;if(!t||t.length<=1)return;let o;for(let r=0;r<t.length;r++){let i=t[r];for(o&&(o.info.next=i),i.info.prev=o;i.info.next;)i=i.info.next;o=i}n.info.nlist=t[0],n.info.minrank=e.globalMinRank,n.info.maxrank=e.globalMaxRank}function qX(e,n){KX(e,n);let t=n.info.rank;if(!t)return;let o=n.info.minrank!==void 0?n.info.minrank:0,r=n.info.maxrank!==void 0?n.info.maxrank:0;for(let i=o;i<=r;i++){t[i].n=t[i].an,t[i].vStart=0;for(let s=0;s<t[i].n;s++){let l=t[i].v[s];if(!l){t[i].n=s;break}l.info.order=s}}}function QX(e,n){e.tiList=[],e.teList=[];let t=n.info.n_cluster!==void 0?n.info.n_cluster:0,o=n.info.clust;if(o)for(let r=1;r<=t;r++)Uc(e,o[r-1]);ZX(n)}function ZX(e){let n=e.info.rank;if(!n)return;let t=e.info.minrank!==void 0?e.info.minrank:0,o=e.info.maxrank!==void 0?e.info.maxrank:0;for(let r=t;r<=o;r++){for(let i=0;i<n[r].n;i++)n[r].v[i].info.order=i,e$(n[r].v[i]);n[r].flat=void 0}}function e$(e){let n=e.info.flat_out;if(!n)return;let t=0;for(;t<n.size;){let o=n.list[t];o.info.edge_type===tn&&(za(o),t--),t++}}function a6(e,n){if(xm(n)!==0)return-1;lc(e,n),tu(e,n),ou(e,n);let t=Vc(e,n,2);if(t<0)return t;let o=n.info.n_cluster!==void 0?n.info.n_cluster:0,r=n.info.clust;if(r)for(let i=1;i<=o;i++){let s=a6(e,r[i-1]);if(s<0)return s;t+=s}return l6(n),t}function n$(e){let n=e.info.clust;if(!n)return;let t=n.filter(o=>o.nodes.size>0);t.length!==n.length&&(e.info.clust=t,e.info.n_cluster=t.length)}function xl(e){let n=i$(e);YX(n,e),n$(e);let t=e.info.comp;if(!t)return 0;let o=t$(n,e,t);if(o<0)return-1;qX(n,e);let r=o$(n,e);return r<0||(o+=r,r$(n,e,o)<0)?-1:(QX(n,e),0)}function t$(e,n,t){let o=0;for(let r=0;r<t.length;r++){JX(n,r);let i=Vc(e,n,0);if(i<0)return-1;o+=i}return o}function o$(e,n){let t=n.info.n_cluster!==void 0?n.info.n_cluster:0,o=n.info.clust;if(!o)return 0;let r=0;for(let i=1;i<=t;i++){let s=a6(e,o[i-1]);if(s<0)return-1;r+=s}return r}function r$(e,n,t){if((n.info.n_cluster!==void 0?n.info.n_cluster:0)===0)return t;let r=n.attrs.get("remincross");if(!(!r||r!=="0"&&r.toLowerCase()!=="false"))return t;pi(n),e.reMincross=!0,rm(!0);let s=Vc(e,n,2);return s<0?-1:s}function i$(e){return{root:e,globalMinRank:0,globalMaxRank:0,teList:[],tiList:[],reMincross:!1,minQuit:8,maxIter:24}}function $c(e){return e.info.clusterMargin??Yd(e)}function hl(e){return e.info.minrank??0}function l5(e){return e.info.maxrank??0}function u6(e){return e.info.border?.[sr].x??0}function f6(e){return e.info.border?.[$t].x??0}function s$(e){return e.info.border?.[_n].x??0}function l$(e){return e.info.border?.[An].x??0}function Xc(e){if(e.info.ln)return;let n=W(e),t=bn(n);t.info.node_type=kt;let o=bn(n);if(o.info.node_type=kt,e.info.label&&e!==n&&!n.info.flip){let r=Math.max(s$(e),l$(e));we(t,o,r,0)}e.info.ln=t,e.info.rn=o}function a$(e,n,t,o){let r=e.info.rank[n];if(r.n===0)return;let i=oe(r,0);if(!i)return;let s=$c(e);we(t,i,si(i)+s+u6(e),0);let l=oe(r,r.n-1);we(l,o,ir(l)+s+f6(e),0)}function d6(e){Xc(e);let n=e.info.ln,t=e.info.rn;for(let o=hl(e);o<=l5(e);o++)a$(e,o,n,t)}function c6(e){if(e!==W(e)){d6(e);let t=e.info.ln,o=e.info.rn,r=St(t,o);r!==void 0?r.info.weight=(r.info.weight??0)+128:we(t,o,1,128)}let n=e.info.n_cluster??0;for(let t=1;t<=n;t++)c6(e.info.clust[t-1])}function p6(e,n){if(n.info.node_type!==U)return!1;let t=n.info.save_out?.list[0];for(;t?.info.to_orig;)t=t.info.to_orig;return!(!t||or(e,t.tail)||or(e,t.head))}function u$(e,n,t,o){let r=oe(n.info.rank[t],0);if(r)for(let i=So(r)-1;i>=0;i--){let s=e.info.rank[t].v[i];if(s.info.node_type===B||p6(n,s)){we(s,n.info.ln,o+ir(s),0);break}}}function f$(e,n,t,o){let r=n.info.rank[t];if(r.n===0)return;let i=oe(r,0);if(!i)return;let s=e.info.rank[t];for(let l=So(i)+r.n;l<s.n;l++){let a=s.v[l];if(a.info.node_type===B||p6(n,a)){we(n.info.rn,a,o+si(a),0);break}}}function m6(e){let n=W(e),t=$c(e);for(let r=hl(e);r<=l5(e);r++)(e.info.rank[r].n??0)!==0&&(u$(n,e,r,t),f$(n,e,r,t));let o=e.info.n_cluster??0;for(let r=1;r<=o;r++)m6(e.info.clust[r-1])}function x6(e){let n=$c(e);Xc(e);let t=e.info.n_cluster??0;for(let o=1;o<=t;o++){let r=e.info.clust[o-1];Xc(r),we(e.info.ln,r.info.ln,n+u6(e),0),we(r.info.rn,e.info.rn,n+f6(e),0),x6(r)}}function d$(e,n,t){if(l5(e)<hl(n))return;let o=hl(n),r=oe(e.info.rank[o],0),i=oe(n.info.rank[o],0);if(!r||!i)return;let s=So(r)<So(i)?e:n,l=s===e?n:e;we(s.info.rn,l.info.ln,t,0)}function h6(e){let n=e.info.n_cluster??0,t=$c(e);for(let o=1;o<=n;o++)Xc(e.info.clust[o-1]);for(let o=1;o<=n;o++){for(let r=o+1;r<=n;r++){let i=e.info.clust[o-1],s=e.info.clust[r-1];if(hl(i)>hl(s)){let l=i;i=s,s=l}d$(i,s,t)}h6(e.info.clust[o-1])}}function b6(e){(e.info.n_cluster??0)!==0&&(c6(e),m6(e),x6(e),h6(e))}function g6(e){if(e.info.drawing?.ratioKind!=="compress")return;let n=e.info.drawing.size;if(!n||n.x*n.y<=1)return;d6(e);let t=Math.min(e.info.flip?n.y:n.x,65535);we(e.info.ln,e.info.rn,t,1e3)}function a5(e){return e.info.clusterMargin??Yd(e)}function c$(e){let n=e.info.other;if(!n)return 0;let t=0;for(let o=0;o<n.size;o++){let r=n.list[o];if(r.tail===r.head&&r.info.label){let i=r.info.label;t=Math.max(t,(i.dimen?.y??0)/2)}}return t}function p$(e,n,t){let o=Math.max((n.info.ht??0)/2,c$(n)),r=e.info.rank[t];return r.pht2<o&&(r.pht2=o,r.ht2=o),r.pht1<o&&(r.pht1=o,r.ht1=o),o}function m$(e,n,t){let o=n.info.clust;if(!o)return;let r=o===e?0:a5(o),i=st(n);i===fe(o)&&(o.info.ht2=Math.max(o.info.ht2??0,t+r)),i===se(o)&&(o.info.ht1=Math.max(o.info.ht1??0,t+r))}function x$(e){let n=e.info.rank;for(let t=fe(e);t<=se(e);t++){let o=n[t];for(let r=0;r<o.n;r++){let i=o.v[r],s=p$(e,i,t);m$(e,i,s)}}}function h$(e,n,t,o){let r=t,i=o,s=!1,l=ai(e);for(let a=1;a<=l;a++){let u=e.info.clust[a-1];s=P6(u)||s,se(u)===se(e)&&(r=Math.max(r,Tt(u)+n)),fe(u)===fe(e)&&(i=Math.max(i,lt(u)+n))}return[r,i,s]}function b$(e,n,t){let o=W(e);if(e===o||!e.info.label)return[n,t,!1];if(o.info.flip)return[n,t,!0];let r=n+(e.info.border?.[_n].y??0),i=t+(e.info.border?.[An].y??0);return[r,i,!0]}function P6(e){let n=W(e),t=e===n,o=t?li:a5(e),r=Tt(e),i=lt(e),s;[r,i,s]=h$(e,o,r,i);let l;if([r,i,l]=b$(e,r,i),s=s||l,e.info.ht1=r,e.info.ht2=i,!t){let a=n.info.rank;a[fe(e)].ht2=Math.max(a[fe(e)].ht2,i),a[se(e)].ht1=Math.max(a[se(e)].ht1,r)}return s}function g$(e){let n=e.info.rank,t=se(e),o=0,r=n[t].v[0].info.coord.y;for(let i=t-1;i>=fe(e);i--){let s=n[i].v[0].info.coord.y;o=Math.max(o,s-r),r=s}return o}function y$(e,n){let t=e.info.rank;for(let o=se(e)-1;o>=fe(e);o--)t[o].n>0&&(t[o].v[0].info.coord.y=t[o+1].v[0].info.coord.y+n)}function P$(e,n){let t=e.info.rank,o=se(e);t[o].v[0].info.coord.y=t[o].ht1;let r=0;for(let i=o-1;i>=fe(e);i--){let s=t[i+1].pht2+t[i].pht1+Gn(e),l=t[i+1].ht2+t[i].ht1+li,a=Math.max(s,l);t[i].n>0&&(t[i].v[0].info.coord.y=t[i+1].v[0].info.coord.y+a),r=Math.max(r,a)}n&&e.info.flip&&(E6(e,0),e.info.exact_ranksep&&(r=g$(e))),e.info.exact_ranksep&&y$(e,r)}function E$(e){let n=e.info.rank;for(let t=e.info.nlist;t!==void 0;t=t.info.next)t.info.coord.y=n[st(t)].v[0].info.coord.y}function u5(e){x$(e);let n=P6(e);P$(e,n),E$(e)}function y6(e,n,t){let o=e.info.rank;for(let r=n-1;r>=fe(e);r--)o[r].n>0&&(o[r].v[0].info.coord.y+=t)}function v$(e,n,t){let o=W(e),r=o.info.rank,i=se(e),s=fe(e),l=(n+1)/2,a=Tt(e)+l-(r[i].ht1-t);if(a>0){for(let f=i;f>=s;f--)r[f].n>0&&(r[f].v[0].info.coord.y+=a);let u=lt(e)+(n-l)+a-(r[s].ht2-t);u>0&&y6(o,s,u)}else{let u=lt(e)+(n-l)-(r[s].ht2-t);u>0&&y6(o,s,u)}e.info.ht2=lt(e)+n-l,e.info.ht1=Tt(e)+l}function S$(e,n,t){let o=Math.max(e.info.border?.[sr].y??0,e.info.border?.[$t].y??0);if(!o)return;let r=n.info.rank,i=r[fe(e)].v[0].info.coord.y-r[se(e)].v[0].info.coord.y,s=o-(i+Tt(e)+lt(e));s>0&&v$(e,s,t)}function E6(e,n){let t=W(e),o=e===t,r=o?0:a5(e),i=Tt(e),s=lt(e),l=ai(e);for(let a=1;a<=l;a++){let u=e.info.clust[a-1];E6(u,r+n),se(u)===se(e)&&(i=Math.max(i,Tt(u)+r)),fe(u)===fe(e)&&(s=Math.max(s,lt(u)+r))}if(e.info.ht1=i,e.info.ht2=s,!o&&e.info.label&&S$(e,t,n),!o){let a=t.info.rank;a[fe(e)].ht2=Math.max(a[fe(e)].ht2,lt(e)),a[se(e)].ht1=Math.max(a[se(e)].ht1,Tt(e))}}function w$(e){for(let n=0;n<e.n;n++)if(e.v[n].info.node_type===B)return e.v[n]}function N$(e){for(let n=e.n-1;n>=0;n--)if(e.v[n].info.node_type===B)return e.v[n]}function R$(e){let n=w$(e);if(!n)return[2147483647,-2147483647];let t=n.info.coord.x-(n.info.lw??0),o=N$(e),r=o?o.info.coord.x+(o.info.rw??0):-2147483647;return[t,r]}function T$(e){let n=2147483647,t=-2147483647;for(let r=fe(e);r<=se(e);r++){let i=e.info.rank[r];if(i.n===0)continue;let[s,l]=R$(i);s<n&&(n=s),l>t&&(t=l)}let o=ai(e);for(let r=1;r<=o;r++){let i=e.info.clust[r-1].info.bb;i&&(n=Math.min(n,i.ll.x-li),t=Math.max(t,i.ur.x+li))}return[n,t]}function k$(e,n){let t=e===n,o,r;t?[o,r]=T$(e):(o=st(e.info.ln),r=st(e.info.rn));let i=n.info.rank,s=i[se(e)].v[0].info.coord.y-Tt(e),l=i[fe(e)].v[0].info.coord.y+lt(e);e.info.bb={ll:{x:o,y:s},ur:{x:r,y:l}}}function v6(e,n){let t=ai(e);for(let o=1;o<=t;o++)v6(e.info.clust[o-1],n);k$(e,n)}function S6(e,n,t){let o=ai(e);for(let r=1;r<=o;r++)S6(e.info.clust[r-1],n,t);e.info.bb&&(e.info.bb.ll.x*=n,e.info.bb.ll.y*=t,e.info.bb.ur.x*=n,e.info.bb.ur.y*=t)}function C$(e,n){if(e.size.x<=0)return null;let t=e.size.x/n.x,o=e.size.y/n.y;return(t<1||o<1)&&(t<o?(o/=t,t=1):(t/=o,o=1)),[t,o]}function _$(e,n){if(e.size.x<=0)return null;let t=n.info.bb,o=e.size.x/t.ur.x,r=e.size.y/t.ur.y;if(o>1&&r>1){let i=Math.min(o,r);return[i,i]}return null}function A$(e,n){let t=e.ratio??1,o=n.y/n.x;return o<t?[1,t/o]:[o/t,1]}function G$(e,n){let t=e.info.drawing;return!t||!t.ratioKind||t.ratioKind==="none"?null:t.ratioKind==="fill"?C$(t,n):t.ratioKind==="expand"?_$(t,e):t.ratioKind==="value"?A$(t,n):null}function w6(e){v6(e,e);let n=e.info.drawing;if(se(e)<=0||!n?.ratioKind)return;let t=e.info.bb,o={x:t.ur.x-t.ll.x,y:t.ur.y-t.ll.y};e.info.flip&&(o={x:o.y,y:o.x});let r=G$(e,o);if(!r)return;e.info.flip&&(r=[r[1],r[0]]);let[i,s]=r;for(let l=e.info.nlist;l!==void 0;l=l.info.next)l.info.coord.x=A(l.info.coord.x*i),l.info.coord.y=A(l.info.coord.y*s);S6(e,i,s)}function M$(e){let n=e.info.bb,t=e.info.label_pos??1,o=e.info.border,r={x:0,y:0},i=t&1?o?.[An]??r:o?.[_n]??r,s=t&1?n.ur.y-i.y/2:n.ll.y+i.y/2;return{x:t&4?n.ur.x-i.x/2:t&2?n.ll.x+i.x/2:(n.ll.x+n.ur.x)/2,y:s}}function L$(e){let n=e.info.bb,t=e.info.label_pos??1,o=e.info.border,r={x:0,y:0},i=t&1?o?.[$t]??r:o?.[sr]??r,s=t&1?n.ur.x-i.x/2:n.ll.x+i.x/2,l=t&4?n.ll.y+i.y/2:t&2?n.ur.y-i.y/2:(n.ll.y+n.ur.y)/2;return{x:s,y:l}}function qe(e){if(e!==e.root){let t=e.info.label;t&&!t.set&&(t.pos=e.root.info.flip??!1?L$(e):M$(e),t.set=!0)}let n=e.info.n_cluster??0;for(let t=0;t<n;t++)qe(e.info.clust[t])}var I$=0,R6=1;function T6(e,n){return n.defined?!e.defined||e.p.x<n.p.x?-1:e.p.x>n.p.x?1:e.p.y<n.p.y?-1:e.p.y>n.p.y?1:0:e.defined?1:0}function k6(e){return(e.info.node_type??0)===U&&(e.info.in?.size??0)===1&&(e.info.out?.size??0)===1&&e.info.label===void 0}function C6(e){return(e.info.node_type??0)===U&&(e.info.out?.size??0)===1&&(e.info.in?.size??0)===1&&e.info.label===void 0}function N6(e){let n=e;for(;n!==void 0&&(n.info.edge_type??B)!==B;)n=n.info.to_orig;return n}function _6(e,n){let t=N6(e);if(t===void 0)return!1;let o=N6(n);if(o===void 0||t.info.conc_opp_flag||o.info.conc_opp_flag)return!1;let r=(o.tail.info.rank??0)-(o.head.info.rank??0),i=(t.tail.info.rank??0)-(t.head.info.rank??0);return r*i>0}function O$(e,n){let t=e.info.in?.list[0],o=n.info.in?.list[0];return!t||!o||!k6(n)||t.tail!==o.tail?!1:_6(t,o)&&T6(t.info.tail_port,o.info.tail_port)===0}function D$(e,n){let t=e.info.out?.list[0],o=n.info.out?.list[0];return!t||!o||!C6(n)||t.head!==o.head?!1:_6(t,o)&&T6(t.info.head_port,o.info.head_port)===0}function B$(e,n,t){for(let o=0;o<(e.info.out?.size??0);o++)if(e.info.out.list[o].head===n)return e.info.out.list[o];return Be(e,n,t)}function F$(e,n,t){for(;(e.info.in?.size??0)>0;){let o=e.info.in.list[0];kn(o,n),it(o)}it(t)}function z$(e,n){let t=n.info.out.list[0],o=B$(e,t.head,t);F$(n,o,t)}function j$(e,n,t){for(let o=0;o<(e.info.in?.size??0);o++)if(e.info.in.list[o].tail===n)return e.info.in.list[o];return Be(n,e,t)}function H$(e,n,t){for(;(e.info.out?.size??0)>0;){let o=e.info.out.list[0];kn(o,n),it(o)}it(t)}function V$(e,n){let t=n.info.in.list[0],o=j$(e,t.tail,t);H$(n,o,t)}function U$(e,n,t,o){let r=e.info.rank,i=t+1;for(let s=o+1;s<r[n].n;s++){let l=r[n].v[i]=r[n].v[s];l.info.order=i,i++}r[n].n=i,r[n].v[i]=void 0}function X$(e,n,t){for(;(n.info.out?.size??0)>0;)z$(e,n);tr(t,n)}function $$(e,n,t){for(;(n.info.in?.size??0)>0;)V$(e,n);tr(t,n)}function A6(e,n,t,o,r){let i=e.info.rank,s=i[n].v[t];for(let l=t+1;l<=o;l++){let a=i[n].v[l];r===R6?X$(s,a,e):$$(s,a,e)}U$(e,n,t,o)}function G6(e,n){let t=n.info.rank??0,o=e.info.rankleader;if(!o)return;let r=o[t];(r===void 0||(r.info.order??0)>(n.info.order??0))&&(o[t]=n)}function W$(e,n){let t=n;for(;t?.info.to_virt;)t=t.info.to_virt;let o=n.head.info.rank??0;for(;t!==void 0&&(t.head.info.rank??0)<o;)G6(e,t.head),t=t.head.info.out?.list[0]}function Y$(e,n){let t=n.info.in?.list[0];for(;t?.info.to_orig;)t=t.info.to_orig;return t!==void 0&&e.nodes.has(t.tail.name)&&e.nodes.has(t.head.name)}function J$(e,n){let t=e.info.rank,o=-1;for(let r=0;r<t[n].n;r++){let i=oe(t[n],r);if(i===void 0)break;if((i.info.node_type??B)===B)if(e.nodes.has(i.name))o=r;else break;else Y$(e,i)&&(o=r)}return o}function K$(e,n,t){let o=e.info.rank,r=e.info.rankleader[n];if(r==null)return console.error(`Error: rebuild_vlists: lead is null for rank ${n}`),-1;let i=t.info.rank[n];if(i.v[r.info.order??0]!==r)return console.error(`Error: rebuild_vlists: rank lead ${r.name} not in order ${r.info.order??0} of rank ${n}`),-1;o[n].v=i.v,o[n].vStart=r.info.order??0;let s=J$(e,n);return s===-1&&console.error(`Warning: degenerate concentrated rank ${e.name},${n}`),o[n].n=s+1,0}function q$(e){let n=new Map;for(let t of e.edges){let o=n.get(t.tail);o?o.push(t):n.set(t.tail,[t])}for(let t of M(e)){G6(e,t);let o=n.get(t);if(o)for(let r of o)W$(e,r)}}function Q$(e){let n=W(e),t=fe(e),o=se(e);for(let r=t;r<=o;r++){let i=K$(e,r,n);if(i!==0)return i}return 0}function Z$(e){let n=e.info.n_cluster??0,t=e.info.clust??[];for(let o=0;o<n;o++){let r=M6(t[o]);if(r!==0)return r}return 0}function M6(e){let n=fe(e),t=se(e);e.info.rankleader||(e.info.rankleader=[]);for(let r=n;r<=t;r++)e.info.rankleader[r]=void 0;vm(e),q$(e);let o=Q$(e);return o!==0?o:Z$(e)}function eW(e,n){let t=e.info.rank;for(let o=0;o<t[n].n;o++){let r=t[n].v[o];if(!k6(r))continue;let i=o+1;for(;i<t[n].n&&O$(r,t[n].v[i]);)i++;i-o>1&&A6(e,n,o,i-1,R6)}}function nW(e,n){let t=e.info.rank;for(let o=0;o<t[n].n;o++){let r=t[n].v[o];if(!C6(r))continue;let i=o+1;for(;i<t[n].n&&D$(r,t[n].v[i]);)i++;i-o>1&&A6(e,n,o,i-1,I$)}}function tW(e){let n=e.info.rank,t=se(e),o=fe(e)+1;for(;n[o+1]?.n&&o<t;o++)eW(e,o);return o}function oW(e,n){let t=n;for(;t>0;)nW(e,t),t--}function L6(e){if(se(e)-fe(e)<=1)return 0;let n=tW(e);oW(e,n);let t=e.info.n_cluster??0,o=e.info.clust??[];for(let r=0;r<t;r++)if(M6(o[r])!==0)return console.error("concentrate=true may not work correctly."),-1;return 0}function I6(e,n){e.out.includes(n)||(e.out.push(n),n.in.push(e))}function f5(e,n,t){let o=0;e.x=1,t.push(e.idx),n.push(e);for(let r of e.out)r.idx>e.idx&&o++,r.x||(o+=f5(r,n,t));for(let r of e.in)e.idx>r.idx&&o++,r.x||(o+=f5(r,n,t));return o}function rW(e){let n=new Set(e),t=new Map;for(let r of e)t.set(r,r.in.filter(i=>n.has(i)).length);let o=[];for(;n.size>0;){let r;for(let i of e)if(n.has(i)&&t.get(i)===0){r=i;break}if(r===void 0)break;o.push(r.np),n.delete(r);for(let i of r.out)n.has(i)&&t.set(i,t.get(i)-1)}return o}function iW(e){let n=!1;for(let t=0;t<e.length;t++){let o=e[t];for(let r=t+1;r<e.length;r++){let i=e[r];i.hi<=o.lo?(n=!0,I6(i,o)):o.hi<=i.lo&&I6(o,i)}}return n}function sW(e,n){if(iW(e))for(let t of e){if(t.x!==0||t.out.length+t.in.length===0)continue;let o=[],r=[];if(f5(t,o,r)===0)continue;let s=rW(o);r.sort((l,a)=>l-a);for(let l=0;l<s.length;l++)s[l].info.order=r[l],n.v[r[l]]=s[l]}}function lW(e){let n=e.info.out.list,t=n[0].head.info.order??0,o=n[1].head.info.order??0;if(t>o){let r=t;t=o,o=r}return{lo:t,hi:o,np:e,idx:e.info.order??0,x:0,out:[],in:[]}}function aW(e){let n=[];for(let t=0;t<e.n;t++){let o=e.v[t];o.info.posAlg!==void 0&&n.push(lW(o))}return n}function O6(e){let n=e.info.rank;if(n===void 0)return;let t=e.info.minrank??0,o=e.info.maxrank??n.length-1;for(let r=t;r<=o;r++){let i=n[r];if(i===void 0)continue;let s=aW(i);s.length>1&&sW(s,i)}}function cr(e){return e.info.order!==void 0?e.info.order:0}function pr(e){return e.info.rank!==void 0?e.info.rank:0}function d5(e){return e.info.maxrank!==void 0?e.info.maxrank:0}function c5(e){return e.info.minrank!==void 0?e.info.minrank:0}function D6(e,n){let t=e.v[n].info.order;return t!==void 0?t:0}function uW(e,n){for(let t=e.n;t>n;t--){e.v[t]=e.v[t-1];let o=e.v[t],r=o.info.order;r!==void 0?o.info.order=r+1:o.info.order=1}}function fW(e,n,t){let o=e.info.rank[n];o.v.length<=o.n+1&&o.v.push(null),uW(o,t);let r=bn(e);return o.v[t]=r,r.info.order=t,r.info.rank=n,o.n++,r}var pu=0,mu=1,p5=2,m5=3;function F6(e,n){let t=cr(e),o=cr(n);return t>o?[o,t]:[t,o]}function dW(e,n,t,o){let r=e.info.out;if(r===void 0||r.size<2)return;let i=cr(e),[s,l]=F6(r.list[0].head,r.list[1].head);l<=t?n[p5]=n[pu]=i:s>=o?n[m5]=n[mu]=i:s<t&&l>o||((s<t||s===t&&l<o)&&(n[p5]=i),(l>o||l===o&&s>t)&&(n[m5]=i))}function cW(e,n,t,o){let r=e.info.out,i=r?.size??0,s=!1,l=!1;for(let u=0;u<i;u++){let f=cr(r.list[u].head);if(f<=t){s=!0;continue}if(f>=o){l=!0;continue}}let a=cr(e);s&&!l&&(n[pu]=a+1),l&&!s&&(n[mu]=a-1)}function B6(e,n,t,o){(e.info.node_type??B)===U&&((e.info.in?.size??0)===0?dW(e,n,t,o):cW(e,n,t,o))}function pW(e,n){let t=pr(n.tail)-1;if(t<0||!e.info.rank)return 0;let o=e.info.rank[t],r=0,i=o.n-1,s=[r-1,i+1,r-1,i+1],[l,a]=F6(n.tail,n.head);for(;r<=i&&(B6(o.v[r],s,l,a),r!==i&&B6(o.v[i],s,l,a),r++,i--,!(s[mu]-s[pu]<=1)););return s[pu]<=s[mu]?Math.trunc((s[pu]+s[mu]+1)/2):Math.trunc((s[p5]+s[m5]+1)/2)}function mW(e){return e.info.ranksep??0}function xW(e,n){let t=e.info.rank,o=t[n-1].v[0];return o?o.info.coord.y-t[n-1].ht1:t[n].v[0].info.coord.y+t[n].ht2+mW(e)}function hW(e,n,t){let o=t.dimen.x,r=t.dimen.y;if(e.info.flip===!0){let i=o;o=r,r=i}return n.info.ht=r,n.info.lw=n.info.rw=o/2,r/2}function bW(e,n){let t=Be(e,n.tail,n);t.info.tail_port.p.x=-e.info.lw,t.info.head_port.p.x=n.tail.info.rw,t.info.edge_type=tn;let o=Be(e,n.head,n);o.info.tail_port.p.x=e.info.rw,o.info.head_port.p.x=n.head.info.lw,o.info.edge_type=tn}function z6(e,n){let t=n.info.label;if(t===void 0)return;let o=pr(n.tail),r=pW(e,n),i=xW(e,o),s=fW(e,o-1,r),l=hW(e,s,t);s.info.label=t,s.info.coord.y=i+l,bW(s,n);let a=e.info.rank[o-1];a.ht1<l&&(a.ht1=l),a.ht2<l&&(a.ht2=l),s.info.posAlg=n}function Wc(){return{n:0,v:[],an:0,av:[],ht1:1,ht2:1,pht1:1,pht2:1,candidate:!1,valid:!1,cache_nc:0,flat:void 0,vStart:0}}function j6(e){let n=e.info.n_cluster??0;for(let t=1;t<=n;t++){let o=e.info.clust[t-1],r=c5(o),i=d5(o),s=o.info.rank;if(s){for(let a=i;a>=r;a--)s[a+1]=s[a];s[r]=Wc(),s[i+2]=Wc()}let l=o.info.rankleader;if(l)for(let a=i;a>=r;a--)l[a+1]=l[a];o.info.minrank=r+1,o.info.maxrank=i+1,j6(o)}}function gW(e){let n=d5(e),t=e.info.rank;for(let o=n;o>=0;o--)t[o+1]=t[o];t[0]=Wc(),t[n+2]=Wc();for(let o=e.info.nlist;o;o=o.info.next)o.info.rank=(o.info.rank??0)+1;e.info.maxrank=n+1,j6(e),e.info.abomShift=(e.info.abomShift??0)+1}function yW(e,n,t){for(let o=0;o<e.n;o++){let r=D6(e,o);if(r<=n||r>=t)continue;let i=e.v[o],s=i.info.node_type??B;if(s===B||s===U&&i.info.label!==void 0)return!0}return!1}function H6(e,n){let t=cr(n.tail),o=cr(n.head),r=Math.min(t,o),i=Math.max(t,o),s=i-r<=1;if(s||(s=!yW(e.info.rank[pr(n.tail)],r,i)),!!s)for(let l=n;l;l=l.info.to_virt)l.info.adjacent=1}function x5(e){return e.info.label!==void 0}function PW(e,n){if(n)for(let t=0;t<n.size;t++)H6(e,n.list[t])}function EW(e){for(let n=e.info.nlist;n;n=n.info.next)if(PW(e,n.info.flat_out),n.info.other)for(let t=0;t<n.info.other.size;t++){let o=n.info.other.list[t];pr(o.tail)===pr(o.head)&&H6(e,o)}}function vW(e){for(let n=0;n<e.n;n++){let t=e.v[n].info.flat_out;if(t){for(let o=0;o<t.size;o++)if(x5(t.list[o])&&!t.list[o].info.adjacent)return!0}}return!1}function SW(e){let n=c5(e),t=e.info.rank;return!t||t[n]===void 0?!1:vW(t[n])}function V6(e,n){let t=n.info.label;return!t||!t.dimen?0:e.info.flip===!0?t.dimen.y:t.dimen.x}function wW(e,n){n.info.dist=V6(e,n)}function NW(e){let n=e;for(;n.info.to_virt;)n=n.info.to_virt;return n}function RW(e,n,t){return x5(n)?n.info.adjacent?(wW(e,n),t):(z6(e,n),!0):t}function TW(e,n,t){if(pr(n.tail)!==pr(n.head)||n.tail===n.head)return t;let o=NW(n);return n.info.adjacent=o.info.adjacent,x5(n)?n.info.adjacent?(o.info.dist=Math.max(V6(e,n),o.info.dist??0),t):(z6(e,n),!0):t}function kW(e){let n=!1;for(let t=e.info.nlist;t;t=t.info.next){let o=t.info.flat_out;if(!o)continue;for(let i=0;i<o.size;i++)n=RW(e,o.list[i],n);let r=t.info.other;if(r)for(let i=0;i<r.size;i++)n=TW(e,r.list[i],n)}return n}function U6(e){EW(e),SW(e)&&gW(e),s5(e);let n=kW(e);return n&&(O6(e),Uc({root:W(e)},e)),n}function CW(e){let n=e.info.rank;for(let t=fe(e);t<=se(e);t++){let o=n[t];for(let r=0;r<o.n;r++){let i=o.v[r];i.info.coord.x=st(i),i.info.rank=t}}}function _W(e){CW(e),e.info.rankIsXCoord=!1}function X6(e,n){if(!e)return!1;for(let t=0;t<e.size;t++){let o=e.list[t];if((o.head.info.rank??0)>n||(o.tail.info.rank??0)>n)return!0}return!1}function AW(e,n){for(let t=0;t<e.n;t++){let o=e.v[t];if(X6(o.info.save_out,n)||X6(o.info.save_in,n))return!0}return!1}function GW(e){let n=e.info.rank;for(let t=fe(e);t<=se(e);t++){let o=n[t];if(o.n===0||AW(o,t))continue;let r=o.v[0],i=t<se(e)?n[t+1].v[0]:n[t-1].v[0];if(!i)continue;let s=bn(e);s.info.node_type=kt,we(s,r,0,0),we(s,i,0,0),s.info.rank=Math.min(st(r),st(i))}}function $6(e){return 2147483647}function MW(e,n){let t=new Array(n+1);for(let o=e.n-1;o>=0;o--){let r=e.v[o];t[r.info.order]=r}e.n=n,e.v=t}function LW(e){let n=e.info.rank;for(let t=fe(e);t<=se(e);t++){let o=n[t],r=0;for(let i=0;i<o.n;i++){let s=o.v[i];s.info.order=r,r+=s.info.ranktype===Pm?i8(s):1}r>o.n&&MW(o,r)}}function IW(e){LW(e)}function bl(e){if(e.info.nlist===void 0)return 0;if(pi(e),u5(e),e.info.concentrate){let n=L6(e);if(n!==0)return n}return IW(e),U6(e)&&u5(e),a8(e,b6,g6),e.info.rankIsXCoord=!0,qa(e,2,$6(e))&&(GW(e),qa(e,2,$6(e))),_W(e),w6(e),qe(e),u8(e),0}var h5=class e{static aeq0(n){return n<1e-7&&n>-1e-7}static solve1(n,t){return e.aeq0(n[1])?e.aeq0(n[0])?4:0:(t[0]=-n[0]/n[1],1)}static solve2(n,t){if(e.aeq0(n[2]))return e.solve1(n,t);let o=n[1]/(2*n[2]),r=o*o-n[0]/n[2];return r<0?0:r>0?(t[0]=-o+Math.sqrt(r),t[1]=-2*o-t[0],2):(t[0]=-o,1)}static solve3neg(n,t,o,r){let i=.5*Math.sqrt(-n+t*t),s=Math.atan2(Math.sqrt(-n),-t),l=2*Math.cbrt(i);return r[0]=l*Math.cos(s/3)-o,r[1]=l*Math.cos((s+2*Math.PI)/3)-o,r[2]=l*Math.cos((s-2*Math.PI)/3)-o,3}static solve3pos(n,t,o,r){let i=.5*(Math.sqrt(n)-t);return r[0]=Math.cbrt(i)+Math.cbrt(-t-i)-o,n>0?1:(r[1]=r[2]=-.5*(r[0]+o)-o,3)}static solve3(n,t){let o=n[3],r=n[2],i=n[1],s=n[0];if(e.aeq0(o))return e.solve2(n,t);let l=r/(3*o),a=l*l,u=2*l*a-l*i/o+s/o,f=i/(3*o)-a,d=u*u+4*f*f*f;return d<0?e.solve3neg(d,u,l,t):e.solve3pos(d,u,l,t)}};function xu(e,n){return h5.solve3(e,n)}var b5=.001,W6=1e-6,g5=class e{static B0(n){let t=1-n;return t*t*t}static B1(n){let t=1-n;return 3*n*t*t}static B2(n){let t=1-n;return 3*n*n*t}static B3(n){return n*n*n}static B01(n){let t=1-n;return t*t*(t+3*n)}static B23(n){let t=1-n;return n*n*(3*t+n)}static normv(n){let t=n.x*n.x+n.y*n.y;if(t>1e-6){let o=Math.sqrt(t);return{x:n.x/o,y:n.y/o}}return n}static ptAdd(n,t){return{x:n.x+t.x,y:n.y+t.y}}static ptSub(n,t){return{x:n.x-t.x,y:n.y-t.y}}static ptScale(n,t){return{x:n.x*t,y:n.y*t}}static ptDot(n,t){return n.x*t.x+n.y*t.y}static ptDist(n,t){return Math.hypot(n.x-t.x,n.y-t.y)}static distN(n){let t=0;for(let o=1;o<n.length;o++)t+=e.ptDist(n[o],n[o-1]);return t}static points2coeff(n,t,o,r,i){i[3]=r+3*t-(n+3*o),i[2]=3*n+3*o-6*t,i[1]=3*(t-n),i[0]=n}static addRoot(n,t){n>=0&&n<=1&&(t.roots[t.n]=n,t.n++)}static silBothZero(n,t,o){let r=[0,0,0,0],i=[0,0,0],s=[0,0,0];e.points2coeff(n[0].x,n[1].x,n[2].x,n[3].x,r),r[0]-=t.xc0;let l=xu(r,i);e.points2coeff(n[0].y,n[1].y,n[2].y,n[3].y,r),r[0]-=t.yc0;let a=xu(r,s);if(l===4){if(a===4)return 4;for(let u=0;u<a;u++)e.addRoot(s[u],o)}else if(a===4)for(let u=0;u<l;u++)e.addRoot(i[u],o);else for(let u=0;u<l;u++)for(let f=0;f<a;f++)i[u]===s[f]&&e.addRoot(i[u],o);return o.n}static silXzeroYnonzero(n,t,o){let r=[0,0,0,0],i=[0,0,0];e.points2coeff(n[0].x,n[1].x,n[2].x,n[3].x,r),r[0]-=t.xc0;let s=xu(r,i);if(s===4)return 4;for(let l=0;l<s;l++){let a=i[l];if(a>=0&&a<=1){e.points2coeff(n[0].y,n[1].y,n[2].y,n[3].y,r);let u=(r[0]+a*(r[1]+a*(r[2]+a*r[3]))-t.yc0)/t.yc1;u>=0&&u<=1&&e.addRoot(a,o)}}return o.n}static silGeneral(n,t,o){let r=[0,0,0,0],i=[0,0,0],s=t.yc1/t.xc1;e.points2coeff(n[0].y-s*n[0].x,n[1].y-s*n[1].x,n[2].y-s*n[2].x,n[3].y-s*n[3].x,r),r[0]+=s*t.xc0-t.yc0;let l=xu(r,i);if(l===4)return 4;for(let a=0;a<l;a++){let u=i[a];if(u>=0&&u<=1){e.points2coeff(n[0].x,n[1].x,n[2].x,n[3].x,r);let f=(r[0]+u*(r[1]+u*(r[2]+u*r[3]))-t.xc0)/t.xc1;f>=0&&f<=1&&e.addRoot(u,o)}}return o.n}static splineIntersectsLine(n,t,o){let r={xc0:t[0].x,xc1:t[1].x-t[0].x,yc0:t[0].y,yc1:t[1].y-t[0].y},i={roots:o,n:0};return r.xc1===0?r.yc1===0?e.silBothZero(n,r,i):e.silXzeroYnonzero(n,r,i):e.silGeneral(n,r,i)}static splineIsInside(n,t){let o=[0,0,0,0];for(let r=0;r<n.length;r++){let i=[n[r].a,n[r].b],s=e.splineIntersectsLine(t,i,o);if(s!==4)for(let l=0;l<s;l++){let a=o[l];if(a<W6||a>1-W6)continue;let u=(1-a)*(1-a)*(1-a),f=3*a*(1-a)*(1-a),d=3*a*a*(1-a),c=a*a*a,m=u*t[0].x+f*t[1].x+d*t[2].x+c*t[3].x,b=u*t[0].y+f*t[1].y+d*t[2].y+c*t[3].y;if(!((m-i[0].x)**2+(b-i[0].y)**2<b5)&&!((m-i[1].x)**2+(b-i[1].y)**2<b5))return!1}}return!0}static appendSps(n,t){for(let o=1;o<4;o++)n.push({x:t[o].x,y:t[o].y})}static mkspline(n,t,o,r){let i=n.length,s=0,l=0,a=0,u=0,f=0,d=0,c=0;for(let E=0;E<i;E++){a+=e.ptDot(t[E].a[0],t[E].a[0]),u+=e.ptDot(t[E].a[0],t[E].a[1]),f+=e.ptDot(t[E].a[1],t[E].a[1]);let R=e.ptSub(n[E],e.ptAdd(e.ptScale(n[0],e.B01(t[E].t)),e.ptScale(n[i-1],e.B23(t[E].t))));d+=e.ptDot(t[E].a[0],R),c+=e.ptDot(t[E].a[1],R)}let m=a*f-u*u,b=d*f-c*u,g=a*c-u*d;if(Math.abs(m)>=1e-6&&(s=b/m,l=g/m),Math.abs(m)<1e-6||s<=0||l<=0){let E=e.ptDist(n[0],n[i-1])/3;s=E,l=E}return{p0:n[0],v0:e.ptScale(o,s),p1:n[i-1],v1:e.ptScale(r,l)}}static initTnas(n,t,o){let r=n.length,i=Array.from({length:r},()=>({t:0,a:[{x:0,y:0},{x:0,y:0}]}));for(let l=1;l<r;l++)i[l].t=i[l-1].t+e.ptDist(n[l],n[l-1]);let s=i[r-1].t;for(let l=1;l<r;l++)i[l].t/=s;for(let l=0;l<r;l++)i[l].a[0]=e.ptScale(t,e.B1(i[l].t)),i[l].a[1]=e.ptScale(o,e.B2(i[l].t));return i}static findMaxDev(n,t,o){let{p0:r,v0:i,p1:s,v1:l}=o,a=e.ptAdd(r,e.ptScale(i,1/3)),u=e.ptSub(s,e.ptScale(l,1/3)),f=-1,d=-1;for(let c=1;c<n.length-1;c++){let m=t[c].t,b=e.B0(m)*r.x+e.B1(m)*a.x+e.B2(m)*u.x+e.B3(m)*s.x,g=e.B0(m)*r.y+e.B1(m)*a.y+e.B2(m)*u.y+e.B3(m)*s.y,E=e.ptDist({x:b,y:g},n[c]);E>d*(1+1e-10)+1e-10&&(d=E,f=c)}return f}static splineFits(n,t,o){let{p0:r,v0:i,p1:s,v1:l}=t,a=o.length===2,u=4,f=!0;for(;;){let d=[r,{x:r.x+u*i.x/3,y:r.y+u*i.y/3},{x:s.x-u*l.x/3,y:s.y-u*l.y/3},s];if(f&&e.distN(d)<e.distN(o)-b5)return 0;if(f=!1,e.splineIsInside(n.barriers,d))return e.appendSps(n.ops,d),1;if(u<.005){if(a)return e.appendSps(n.ops,d),1;break}u=u>.01?u/2:0}return 0}static reallyRoute(n,t,o,r){let i=e.initTnas(t,o,r),s=e.mkspline(t,i,o,r);if(e.splineFits(n,s,t))return!0;let l=e.findMaxDev(t,i,s),a=e.normv(e.ptSub(t[l],t[l-1])),u=e.normv(e.ptSub(t[l+1],t[l])),f=e.normv(e.ptAdd(a,u));return!(!e.reallyRoute(n,t.slice(0,l+1),o,f)||!e.reallyRoute(n,t.slice(l),f,r))}static run(n,t,o){let r={ops:[],barriers:n},i=e.normv(o[0]),s=e.normv(o[1]);return r.ops.push(t[0]),e.reallyRoute(r,t,i,s),r.ops}};function Wn(e,n,t){return g5.run(e,n,t)}function hu(e){let n=[];for(let t of e){let o=t.ps.length;for(let r=0;r<o;r++)n.push({a:t.ps[r],b:t.ps[(r+1)%o]})}return n}function no(e){let n=[];n.push(e[0],e[0]);for(let t=1;t+1<e.length;t++)n.push(e[t],e[t],e[t]);return n.push(e[e.length-1],e[e.length-1]),n}function OW(e,n,t){let o=134217729*e,r=o-(o-e),i=e-r,s=134217729*n,l=s-(s-n),a=n-l;return r*l-t+r*a+i*l+i*a}function DW(e,n,t){let o=e-t,r=t+o,i=o-n;return e-r+i}var y5=new DataView(new ArrayBuffer(8));function P5(e){if(e===0)return{m:0n,e:0};y5.setFloat64(0,e);let n=y5.getUint32(0),t=y5.getUint32(4),o=n>>>31?-1n:1n,r=n>>>20&2047,i=BigInt(n&1048575)<<32n|BigInt(t),s;return r===0?s=-1074:(i|=1n<<52n,s=r-1075),{m:o*i,e:s}}function BW(e,n,t){let o=P5(e),r=P5(n),i=P5(t),s=Math.min(o.e,r.e,i.e),l=(o.m<<BigInt(o.e-s))+(r.m<<BigInt(r.e-s))+(i.m<<BigInt(i.e-s));return l>0n?1:l<0n?-1:0}var Yc=class e{static ccw(n,t,o){let r=n.y-t.y,i=o.x-t.x,s=o.y-t.y,l=n.x-t.x,a=r*i,u=s*l,f=a-u,d=23e-17*(Math.abs(a)+Math.abs(u));if(f>d)return 2;if(f<-d)return 1;let c=OW(r,i,a),m=a-u,b=DW(a,u,m),g=BW(m,b,c);return g>0?2:g<0?1:3}static between(n,t,o){if(e.ccw(n,t,o)!==3)return!1;let r={x:t.x-n.x,y:t.y-n.y},i={x:o.x-n.x,y:o.y-n.y};return i.x*r.x+i.y*r.y>=0&&i.x*i.x+i.y*i.y<=r.x*r.x+r.y*r.y}static anyCollinear(n,t,o,r){let i=e.ccw;return i(n,t,o)===3||i(n,t,r)===3||i(o,r,n)===3||i(o,r,t)===3}static collinearIntersects(n,t,o,r){let i=e.between;return i(n,t,o)||i(n,t,r)||i(o,r,n)||i(o,r,t)}static crossIntersects(n,t,o,r){let i=e.ccw,s=i(n,t,o)===1?1:0,l=i(n,t,r)===1?1:0,a=i(o,r,n)===1?1:0,u=i(o,r,t)===1?1:0;return(s^l)!==0&&(a^u)!==0}static intersects(n,t,o,r){return e.anyCollinear(n,t,o,r)?e.collinearIntersects(n,t,o,r):e.crossIntersects(n,t,o,r)}static isdiagNeighborhood(n,t,o,r){let i=(n+1)%r,s=(n+r-1)%r,l=e.ccw;return l(o(s),o(n),o(i))===1?l(o(n),o(t),o(s))===1&&l(o(t),o(n),o(i))===1:l(o(n),o(t),o(i))===2}static isdiagonal(n,t,o,r){if(!e.isdiagNeighborhood(n,t,o,r))return!1;for(let i=0;i<r;i++){let s=(i+1)%r;if(i!==n&&s!==n&&i!==t&&s!==t&&e.intersects(o(n),o(t),o(i),o(s)))return!1}return!0}static triangulateInner(n,t){let o=n;for(;o.length>3;){let r=o.length,i=-1;for(let s=0;s<r;s++){let l=(s+2)%r;if(e.isdiagonal(s,l,a=>o[a],r)){t([o[s],o[(s+1)%r],o[l]]),i=(s+1)%r;break}}if(i===-1)return!1;o=o.filter((s,l)=>l!==i)}return t([o[0],o[1],o[2]]),!0}};function Pi(e,n,t){return Yc.ccw(e,n,t)}function Y6(e,n,t,o){return Yc.isdiagonal(e,n,t,o)}var ko=-1,gl=1,E5=2,v5=class e{static buildTri(n,t,o){let r=(i,s)=>({pnl0:i,pnl1:s,rightIndex:ko});return{mark:0,e:[r(n,t),r(t,o),r(o,n)]}}static triInner(n,t){let o=n;for(;o.length>3;){let r=o.length,i=-1;for(let s=0;s<r;s++){let l=(s+2)%r;if(Y6(s,l,a=>o[a].pp,r)){t.push(e.buildTri(o[s],o[(s+1)%r],o[l])),i=(s+1)%r;break}}if(i===-1)return!1;o=o.filter((s,l)=>l!==i)}return t.push(e.buildTri(o[0],o[1],o[2])),!0}static connectTri(n,t,o){let r=o[n],i=o[t];for(let s=0;s<3;s++)for(let l=0;l<3;l++){let a=r.e[s],u=i.e[l];(a.pnl0===u.pnl0&&a.pnl1===u.pnl1||a.pnl0===u.pnl1&&a.pnl1===u.pnl0)&&(a.rightIndex=t,u.rightIndex=n)}}static connectAll(n){for(let t=0;t<n.length;t++)for(let o=t+1;o<n.length;o++)e.connectTri(t,o,n)}static pointInTri(n,t){let o=0;for(let r=0;r<3;r++)Pi(n.e[r].pnl0.pp,n.e[r].pnl1.pp,t)!==2&&o++;return o===3||o===0}static markPath(n,t,o){if(n[t].mark)return!1;if(n[t].mark=1,t===o)return!0;for(let r=0;r<3;r++){let i=n[t].e[r].rightIndex;if(i!==ko&&e.markPath(n,i,o))return!0}return n[t].mark=0,!1}static findTri(n,t){for(let o=0;o<n.length;o++)if(e.pointInTri(n[o],t))return o;return ko}static findMinX(n){let t=1/0,o=0;for(let r=0;r<n.length;r++)n[r].x<t&&(t=n[r].x,o=r);return o}static isPolyCW(n,t){let o=n.length,r=n[t],i=n[t===0?o-1:t-1],s=n[(t+1)%o];return i.x===r.x&&r.x===s.x&&s.y>r.y?!0:Pi(i,r,s)!==1}static loadForward(n){let t=[];for(let o=0;o<n.length;o++)o>0&&n[o].x===n[o-1].x&&n[o].y===n[o-1].y||t.push({pp:n[o],link:null});return t}static loadReverse(n){let t=[];for(let o=n.length-1;o>=0;o--)o<n.length-1&&n[o].x===n[o+1].x&&n[o].y===n[o+1].y||t.push({pp:n[o],link:null});return t}static loadPoints(n){let t=n.ps;return e.isPolyCW(t,e.findMinX(t))?e.loadReverse(t):e.loadForward(t)}static initDeque(n){let t=n*2,o=new Array(t).fill(null),r=Math.floor(t/2);return{pnlps:o,pnlpn:t,fpnlpi:r,lpnlpi:r-1,apex:0}}static add2dq(n,t,o){t===gl?(n.lpnlpi>=n.fpnlpi&&(o.link=n.pnlps[n.fpnlpi]),n.fpnlpi--,n.pnlps[n.fpnlpi]=o):(n.lpnlpi>=n.fpnlpi&&(o.link=n.pnlps[n.lpnlpi]),n.lpnlpi++,n.pnlps[n.lpnlpi]=o)}static splitdq(n,t,o){t===gl?n.lpnlpi=o:n.fpnlpi=o}static finddqsplit(n,t){for(let o=n.fpnlpi;o<n.apex;o++)if(Pi(n.pnlps[o+1].pp,n.pnlps[o].pp,t.pp)===1)return o;for(let o=n.lpnlpi;o>n.apex;o--)if(Pi(n.pnlps[o-1].pp,n.pnlps[o].pp,t.pp)===2)return o;return n.apex}static fuFindEi(n,t){for(let o=0;o<3;o++){let r=n.e[o].rightIndex;if(r!==ko&&t[r].mark===1)return o}return 3}static fuNextTri(n,t){for(let o=0;o<3;o++){let r=n.e[o].rightIndex;if(r!==ko&&t[r].mark===1)return r}return ko}static fuGetPairLast(n,t){return Pi(n.pp,t.pnlps[t.fpnlpi].pp,t.pnlps[t.lpnlpi].pp)===1?[t.pnlps[t.lpnlpi],n]:[n,t.pnlps[t.lpnlpi]]}static fuGetPairNormal(n,t){let o=n.e[t],r=n.e[(t+1)%3].pnl1;return Pi(o.pnl0.pp,r.pp,o.pnl1.pp)===1?[o.pnl1,o.pnl0]:[o.pnl0,o.pnl1]}static fuUpdateRight(n,t){let o=e.finddqsplit(n,t);e.splitdq(n,E5,o),e.add2dq(n,gl,t),o>n.apex&&(n.apex=o)}static fuUpdateLeft(n,t){let o=e.finddqsplit(n,t);e.splitdq(n,gl,o),e.add2dq(n,E5,t),o<n.apex&&(n.apex=o)}static fuUpdate(n,t,o,r){if(r){e.add2dq(n,E5,t),e.add2dq(n,gl,o);return}n.pnlps[n.fpnlpi]!==o&&n.pnlps[n.lpnlpi]!==o?e.fuUpdateRight(n,o):e.fuUpdateLeft(n,t)}static fuLoop(n,t,o,r){let i=r;for(;i!==ko;){let s=n[i];s.mark=2;let l=e.fuFindEi(s,n),[a,u]=l===3?e.fuGetPairLast(o[1],t):e.fuGetPairNormal(s,l);e.fuUpdate(t,a,u,i===r),i=e.fuNextTri(s,n)}}static extractPath(n){let t=[];for(let o=n;o!==null;o=o.link)t.push(o.pp);return t.reverse(),t}static run(n,t){let o=e.loadPoints(n),r=[];e.triInner(o.slice(),r)||console.warn("triangulation failed"),e.connectAll(r);let i=e.findTri(r,t[0]),s=e.findTri(r,t[1]);if(i===ko||s===ko)return null;if(i===s)return[t[0],t[1]];if(!e.markPath(r,i,s))return[t[0],t[1]];let l=[{pp:t[0],link:null},{pp:t[1],link:null}],a=e.initDeque(o.length);return e.add2dq(a,gl,l[0]),a.apex=a.fpnlpi,e.fuLoop(r,a,l,i),e.extractPath(l[1])}};function to(e,n){return v5.run(e,n)}function FW(e,n){let t=e.length,o=n>0?e[n].ll.y>e[n-1].ll.y?-1:1:0,r=n+1<t?e[n+1].ll.y>e[n].ll.y?1:-1:0;return{prev:o,next:r}}function zW(e,n,t,o){n!==t?t===-1||n===1?o.push({x:e.ll.x,y:e.ur.y},{x:e.ll.x,y:e.ll.y}):o.push({x:e.ur.x,y:e.ll.y},{x:e.ur.x,y:e.ur.y}):n===0&&o.push({x:e.ll.x,y:e.ur.y},{x:e.ll.x,y:e.ll.y})}function K6(e,n){for(let t=0;t<e.length;t++){let{prev:o,next:r}=FW(e,t);zW(e[t],o,r,n)}}function jW(e,n){let t=e.length,o=n+1<t?e[n].ll.y>e[n+1].ll.y?-1:1:0,r=n>0?e[n-1].ll.y>e[n].ll.y?1:-1:0;return{prev:o,next:r}}function HW(e,n){n.push({x:e.ur.x,y:e.ll.y},{x:e.ur.x,y:e.ur.y},{x:e.ll.x,y:e.ur.y},{x:e.ll.x,y:e.ll.y})}function VW(e,n,t,o){n!==t?t===-1||n===1?o.push({x:e.ll.x,y:e.ur.y},{x:e.ll.x,y:e.ll.y}):o.push({x:e.ur.x,y:e.ll.y},{x:e.ur.x,y:e.ur.y}):n===0?o.push({x:e.ur.x,y:e.ll.y},{x:e.ur.x,y:e.ur.y}):HW(e,o)}function q6(e,n){for(let t=e.length-1;t>=0;t--){let{prev:o,next:r}=jW(e,t);VW(e[t],o,r,n)}}function Q6(e){if(e.length===0)return[];let n=[];return K6(e,n),q6(e,n),n}function Z6(e){let n=e.length;return e.map((t,o)=>({a:t,b:e[(o+1)%n]}))}function yl(e,n){return[e,{x:e.x+(n.x-e.x)/3,y:e.y+(n.y-e.y)/3},{x:e.x+2*(n.x-e.x)/3,y:e.y+2*(n.y-e.y)/3},n]}function UW(e,n){let t={x:0,y:0},o=Wn(e,n,[t,t]);return o.length<4?null:[o[0],o[1],o[2],o[3]]}function S5(e,n,t){let o=Q6(e);if(o.length<3)return yl(n,t);let r=to({ps:o},[n,t]);return r===null||r.length<2?yl(n,t):UW(Z6(o),r)??yl(n,t)}function w5(e,n){return{ll:e.ll,ur:{x:e.ur.x,y:n}}}function N5(e,n){return{ll:{x:e.ll.x,y:n},ur:e.ur}}function R5(e){return{ll:{x:e.llx,y:e.headCy+e.headHt2},ur:{x:e.urx,y:e.tailCy-e.tailHt1}}}function Kc(e,n,t){return{ll:{x:e.center.x-e.lw-2,y:e.center.y-n},ur:{x:e.center.x+e.rw+2,y:e.center.y+t}}}var eE=10,nE={tail:!0,head:!0};function tE(e,n,t,o){let r=e.center.y,i=n.center.y,s=Kc(e,t.tailHt1,t.tailHt2),l=Kc(n,t.headHt1,t.headHt2),a={llx:t.leftBound,urx:t.rightBound,tailCy:e.center.y,tailHt1:t.tailHt1,headCy:n.center.y,headHt2:t.headHt2};return{startPt:o?.tailP??{x:e.center.x,y:r-1},endPt:o?.headP??{x:n.center.x,y:i+1},boxes:[w5(s,r),R5(a),N5(l,i)]}}function oE(e=Eo){return eE+e*Math.sqrt(1+.35*.35)/(2*.35)}function qc(e){let n=(e.lw+e.rw)/2,t=e.ht/2,o=e.penwidth??Eo;return e.isEllipse?qP(n,t,o):C2(n,t,o)}function rE(e,n,t,o=Eo,r=nE){let i=r.tail?ri(e,n.center.x,n.center.y,qc(n),!0):e,s=r.head?ri(i,t.center.x,t.center.y,qc(t),!1):i,l=s[3],a=oE(o),u=$d(s,l,a),f=Us({x:u[3].x-l.x,y:u[3].y-l.y});return{clipped:u,arrowTip:l,arrowDir:f}}function T5(e,n,t,o=Eo,r){let i=r?{tailP:r.tailP,headP:r.headP}:void 0,{startPt:s,endPt:l,boxes:a}=tE(e,n,t,i),u=S5(a,s,l),f=r?{tail:r.clipTail,head:r.clipHead}:nE,{clipped:d,arrowTip:c,arrowDir:m}=rE(u,e,n,o,f);return{bezierPts:d,arrowTip:c,arrowDir:m}}function k5(e,n,t){let o=Us({x:n.center.x-e.center.x,y:n.center.y-e.center.y}),r=A2(o),i=Wd(e,o),s=Wd(n,r);return{bezierPts:t(i,G2(s,r,eE)),arrowTip:s,arrowDir:r}}function iE(e){return e.kind==="directed"||e.kind==="strict-directed"?"forward":"none"}var XW=new Set(["ellipse","oval","circle","egg","doublecircle","Mcircle","point"]);function $W(e){let n=e.info.shape_info;if(!n?.b)return;let t=(n.b.ur.x-n.b.ll.x)/2;return{lw:t,rw:t,ht:n.b.ur.y-n.b.ll.y}}function WW(e,n){let t=L(e,n,"penwidth"),o=t!==void 0?parseFloat(t):NaN;return Number.isFinite(o)&&o>=0?o:Eo}function mr(e,n){let t=L(e,n,"shape")??"ellipse",o=WW(e,n);if(t==="record"||t==="Mrecord"){let r=$W(e);if(r)return{center:e.info.coord,...r,isEllipse:!1,penwidth:o}}return{center:e.info.coord,lw:e.info.lw>0?e.info.lw:27,rw:e.info.rw>0?e.info.rw:27,ht:e.info.ht>0?e.info.ht:36,isEllipse:XW.has(t),penwidth:o}}function bu(e){return Xt(ce(e.attrs.get("style")),e.attrs.get("penwidth"))}function Pl(e){let n=parseFloat(e.attrs.get("penwidth")??"");return isNaN(n)?1:n}function sE(e,n){return{list:e,size:e.length,sflag:0,eflag:1,sp:e[0]??{x:0,y:0},ep:n}}function lE(e){return{list:[e],size:1,bb:{ll:{x:0,y:0},ur:{x:0,y:0}}}}function C5(e,n,t){e.info.spl=lE(sE(n,t));let o=e.tail.root.info.bb;if(o!=null)for(let r=0;r+3<n.length;r+=3)wt(o,[n[r],n[r+1],n[r+2],n[r+3]])}function YW(e){if(e.length<4)return!1;let n=e[0],t=e[1];return n.x!==t.x||n.y!==t.y}function aE(e,n){let t=[],o={x:0,y:0},r=Wn(t,[e,n],[o,o]);return YW(r)?[r[0],r[1],r[2],r[3]]:yl(e,n)}function _5(e,n,t,o=1,r){return t!==void 0?T5(e,n,t,o,r):k5(e,n,aE)}function fE(e,n,t){for(let o of e)if(o.id===t){o.edges.push(n);return}e.push({id:t,edges:[n]})}function JW(e,n){let t=mr(e,e.root),o=ri(n,t.center.x,t.center.y,qc(t),!0);for(let r=0;r<n.length&&r<o.length;r++)n[r]=o[r]}function KW(e,n,t,o){let r=Math.max((e.info.lw??0)+(e.info.rw??0),(e.info.ht??0)+o),i=n*r+e.info.coord.x,s=t*r+e.info.coord.y,l=[{x:e.info.coord.x,y:e.info.coord.y},{x:(2*e.info.coord.x+i)/3,y:(2*e.info.coord.y+s)/3},{x:(2*i+e.info.coord.x)/3,y:(2*s+e.info.coord.y)/3},{x:i,y:s}];return JW(e,l),{x1:l[0].x-e.info.coord.x,y1:l[0].y-e.info.coord.y}}function qW(e,n){let t=0,o=0;for(let i of n){let s=i.head===e?i.tail:i.head,l=s.info.coord.x-e.info.coord.x,a=s.info.coord.y-e.info.coord.y,u=Math.hypot(l,a);u!==0&&(t+=l/u,o+=a/u)}let r=Math.hypot(t,o);return r!==0?{x:t/r,y:o/r}:{x:0,y:0}}function QW(e,n,t){let o=qW(e,n),{x1:r,y1:i}=KW(e,o.x,o.y,t),s=A(r),l=A(i),a=e.info.lw??0,u=e.info.rw??0,f=a+u!==0?ei*(a+s)/(a+u):0;return{p:{x:s,y:l},theta:0,bp:null,defined:!0,constrained:!1,clip:!1,dyna:!1,order:f,side:0,name:null}}function dE(e,n,t){e.head===n&&(e.info.head_port=t),e.tail===n&&(e.info.tail_port=t)}function ZW(e,n,t){for(let o=e;o!==void 0;o=(o.info.edge_type??0)===U&&(o.head.info.node_type??0)===U&&(o.head.info.out?.size??0)===1?o.head.info.out.list[0]:void 0)dE(o,n,t)}function eY(e,n,t){for(let o=e;o!==void 0;o=(o.info.edge_type??0)===U&&(o.tail.info.node_type??0)===U&&(o.tail.info.in?.size??0)===1?o.tail.info.in.list[0]:void 0)dE(o,n,t)}function nY(e,n,t){for(let o=e;o!==void 0;o=o.info.to_virt)ZW(o,n,t),eY(o,n,t)}function tY(e,n,t){if(n.length<2)return;let o=QW(e,n,t);for(let r of n)nY(r,e,o);e.info.has_port=!0}function oY(e){for(let n of e.edges)if(n.info.samehead!==void 0)return!0;return!1}function rY(e){for(let n of e.edges)if(n.info.sametail!==void 0)return!0;return!1}function iY(e){let n=[];for(let t of e.root.edges){if(t.head===e&&t.tail===e)continue;let o=t.head===e?t.info.samehead:void 0;o&&o!==""&&fE(n,t,o)}return n}function sY(e){let n=[];for(let t of e.root.edges){if(t.head===e&&t.tail===e)continue;let o=t.tail===e?t.info.sametail:void 0;o&&o!==""&&fE(n,t,o)}return n}function uE(e,n,t){for(let o of n)o.edges.length>1&&tY(e,o.edges,t)}function Qc(e){let n=oY(e),t=rY(e);if(!n&&!t)return;let o=e.info.ranksep??0;for(let r of M(e))n&&uE(r,iY(r),o),t&&uE(r,sY(r),o)}function oo(e,n){let t=e.x-n.x,o=e.y-n.y;return t*t+o*o}function cE(e,n){return Math.sqrt(oo(e,n))}function lY(e,n){let t=1-n,[o,r,i,s]=e;return{x:t*t*t*o.x+3*t*t*n*r.x+3*t*n*n*i.x+n*n*n*s.x,y:t*t*t*o.y+3*t*t*n*r.y+3*t*n*n*i.y+n*n*n*s.y}}function Zc(e,n){let t=0,o=-1,r=Number.MAX_VALUE;for(let b=0;b<e.list.length;b++){let g=e.list[b],E=g.size??g.list.length;for(let R=0;R<E;R++){let N=oo(g.list[R],n);(o===-1||N<r)&&(t=b,o=R,r=N)}}let i=e.list[t],s=i.size??i.list.length,l=o===s-1?o-1:o;l=3*Math.floor(l/3);let a=[i.list[l],i.list[l+1],i.list[l+2],i.list[l+3]],u=0,f=1,d=oo(a[0],n),c=oo(a[3],n),m=a[0];for(;;){let b=(u+f)/2;if(m=lY(a,b),Math.abs(d-c)<1||Math.abs(f-u)<1e-5)break;d<c?(f=b,c=oo(m,n)):(u=b,d=oo(m,n))}return m}function pE(e){let n=0;for(let o of e.list)for(let r=0,i=3;i<o.list.length;r+=3,i+=3)n+=cE(o.list[r],o.list[i]);n/=2;for(let o of e.list)for(let r=0,i=3;i<o.list.length;r+=3,i+=3){let s=o.list[r],l=o.list[i],a=cE(s,l);if(a>=n)return{x:Y(l.x,n,s.x*(a-n))/a,y:Y(l.y,n,s.y*(a-n))/a};n-=a}let t=e.list[0];return t.sflag?t.sp:t.list[0]}function mE(e){let n=e.list[0],t=n.sflag?n.sp:n.list[0],o=e.list[e.list.length-1],r=o.eflag?o.ep:o.list[o.list.length-1];return{p:t,q:r}}function pt(e,n){n.ll.x<n.ur.x&&n.ll.y<n.ur.y&&(e.boxes[e.nbox++]=n)}function hE(e){let n=e.info.in,t=e.info.out,o=n?.size??0,r=t?.size??0,i=0,s=0;for(let d=0;d<o;d++)i+=n.list[d].tail.info.coord.x;for(let d=0;d<r;d++)s+=t.list[d].head.info.coord.x;let l=e.info.coord.x-i/o,a=e.info.coord.y-n.list[0].tail.info.coord.y,u=s/r-e.info.coord.x,f=t.list[0].head.info.coord.y-e.info.coord.y;return(Math.atan2(a,l)+Math.atan2(f,u))/2}var aY=["s","e","n","w"],uY=15;function xE(e,n){switch(n){case ft:return{x:e.x,y:-e.y};case ut:return{x:-e.y,y:e.x};case dt:return{x:e.y,y:e.x};default:return{x:e.x,y:e.y}}}function fY(e,n){let t=e.info.lw,o=e.info.ht/2;return n?{ll:{x:-o,y:-t},ur:{x:o,y:t}}:{ll:{x:-t,y:-o},ur:{x:t,y:o}}}function dY(e,n){let t=(e.ll.x+e.ur.x)/2,o=(e.ll.y+e.ur.y)/2;return n===_n?{x:t,y:e.ll.y}:n===$t?{x:e.ur.x,y:o}:n===An?{x:t,y:e.ur.y}:{x:e.ll.x,y:o}}function cY(e,n,t){let o=t.side;if(o===0||o===uY)return null;let r=(e.root.info.rankdir??0)&3,i=xE(e.info.coord,r),s=xE(n.info.coord,r),l=t.bp??fY(e,r===ut||r===dt),a=null,u=0;for(let f=0;f<4;f++){if((o&1<<f)===0)continue;let d=dY(l,f),c=oo({x:d.x+i.x,y:d.y+i.y},s);(a===null||c<u)&&(u=c,a=aY[f])}return a}function yn(e,n,t){if(!t.dyna)return t;let o=cY(e,n,t),r=ue();return r.name=t.name,bi(e,{bp:t.bp,compass:o??"",sides:t.side},r),r}function pY(e){let n=e;for(;n.info.to_orig!=null&&n.info.edge_type!==0;)n=n.info.to_orig;return n}function mt(e,n,t){let o=pY(e);t?n===o.tail?o.info.tail_port.clip=!1:o.info.head_port.clip=!1:n===o.head?o.info.head_port.clip=!1:o.info.tail_port.clip=!1}function bE(e,n,t){n===2?t.sidemask===4?t.boxes[0].ll.y=e.start.p.y:t.boxes[0].ur.y=e.start.p.y:(t.boxes[0].ur.y=e.start.p.y,t.sidemask=1,e.start.p.y-=1)}function gE(e,n,t){n===2?t.sidemask===4?t.boxes[0].ll.y=e.end.p.y:t.boxes[0].ur.y=e.end.p.y:(t.boxes[0].ll.y=e.end.p.y,t.sidemask=4,e.end.p.y+=1)}function e1(e,n,t,o,r){if(!e?.pboxfn)return 0;let i=[r.boxn],s=e.pboxfn(n,t,o,r.boxes,i);return r.boxn=i[0],s}function yE(e,n,t){t?(e.start.theta=hE(n.tail),e.start.constrained=!0):n.info.tail_port.constrained?(e.start.theta=n.info.tail_port.theta,e.start.constrained=!0):e.start.constrained=!1}function PE(e,n,t){t?(e.end.theta=hE(n.head)+Math.PI,e.end.constrained=!0):n.info.head_port.constrained?(e.end.theta=n.info.head_port.theta,e.end.constrained=!0):e.end.constrained=!1}function EE(e){let n=e.info.rank;if(n===void 0)return-32;let t=e.info.minrank??0,o=e.info.maxrank??n.length-1,r=0;for(let i=t;i<=o;i++){let s=n[i]?.v[0];s&&(r=Math.min(r,s.info.coord.x-s.info.lw)),r-=16}return r}function vE(e){let n=e.info.rank;if(n===void 0)return 60;let t=e.info.minrank??0,o=e.info.maxrank??n.length-1,r=0;for(let i=t;i<=o;i++){let s=n[i],l=s!==void 0&&s.n>0?s.v[s.n-1]:void 0;l&&(r=Math.max(r,l.info.coord.x+l.info.rw)),r+=16}return r}function Pn(e,n){return e>0?e:n/2}var A5=new WeakMap;function xr(e){let n=A5.get(e);return n===void 0&&(n={leftBound:EE(e),rightBound:vE(e)},A5.set(e,n)),n}function G5(e){A5.delete(e)}function M5(e,n,t){let o=e.info.rank;if(o===void 0)return;let r=n.info.rank,i=t.info.rank;if(r===void 0||i===void 0)return;let s=o[r],l=o[i];if(!(s===void 0||l===void 0))return{...xr(e),tailHt1:Pn(s.ht1,n.info.ht),tailHt2:Pn(s.ht2,n.info.ht),headHt1:Pn(l.ht1,t.info.ht),headHt2:Pn(l.ht2,t.info.ht)}}var L5=class e{static topLeft(n){let{P:t,n:o,endp:r,ranksep:i}=n,s=r.nb;r.boxes[0]={ll:{x:s.ll.x-1,y:t.start.p.y},ur:{x:s.ur.x,y:o.info.coord.y+o.info.ht/2+i/2}},r.boxes[1]={ll:{x:s.ll.x-1,y:o.info.coord.y-o.info.ht/2},ur:{x:o.info.coord.x-o.info.lw-0,y:t.start.p.y}}}static topRight(n){let{P:t,n:o,endp:r,ranksep:i}=n,s=r.nb;r.boxes[0]={ll:{x:s.ll.x,y:t.start.p.y},ur:{x:s.ur.x+1,y:o.info.coord.y+o.info.ht/2+i/2}},r.boxes[1]={ll:{x:o.info.coord.x+o.info.rw+0,y:o.info.coord.y-o.info.ht/2},ur:{x:s.ur.x+1,y:t.start.p.y}}}static top(n){let{P:t,n:o,e:r,endp:i}=n;t.start.p.x<o.info.coord.x?e.topLeft(n):e.topRight(n),i.sidemask=4,i.boxn=2,t.start.p.y+=1,mt(r,o,!0)}static bottom(n){let{P:t,n:o,e:r,endp:i}=n;i.boxes[0]={ll:i.nb.ll,ur:{x:i.nb.ur.x,y:Math.max(i.nb.ur.y,t.start.p.y)}},i.sidemask=1,i.boxn=1,t.start.p.y-=1,mt(r,o,!0)}static left(n){let{P:t,n:o,e:r,endp:i}=n;i.boxes[0]={ll:{x:i.nb.ll.x,y:o.info.coord.y-o.info.ht/2},ur:{x:t.start.p.x,y:t.start.p.y}},i.sidemask=8,i.boxn=1,t.start.p.x-=1,mt(r,o,!0)}static right(n){let{P:t,n:o,e:r,endp:i}=n;i.boxes[0]={ll:{x:t.start.p.x,y:o.info.coord.y-o.info.ht/2},ur:{x:i.nb.ur.x,y:t.start.p.y}},i.sidemask=2,i.boxn=1,t.start.p.x+=1,mt(r,o,!0)}static dispatch(n,t){t&4?e.top(n):t&1?e.bottom(n):t&8?e.left(n):e.right(n)}},I5=class e{static bottom(n,t){let{P:o,n:r,endp:i,ranksep:s}=n;i.sidemask===4?(i.boxes[0]={ll:{x:o.start.p.x,y:r.info.coord.y-r.info.ht/2-s/2},ur:{x:t.ur.x+1,y:r.info.coord.y-r.info.ht/2}},i.boxes[1]={ll:{x:r.info.coord.x+r.info.rw+0,y:r.info.coord.y-r.info.ht/2},ur:{x:t.ur.x+1,y:r.info.coord.y+r.info.ht/2}},i.boxn=2):(i.boxes[0]={ll:t.ll,ur:{x:t.ur.x,y:Math.max(t.ur.y,o.start.p.y)}},i.boxn=1),o.start.p.y-=1}static left(n,t){let{P:o,n:r,endp:i}=n,s=i.sidemask===4;i.boxes[0]={ll:{x:t.ll.x,y:s?o.start.p.y-1:r.info.coord.y-r.info.ht/2},ur:{x:o.start.p.x+1,y:s?r.info.coord.y+r.info.ht/2:o.start.p.y+1}},i.boxn=1,o.start.p.x-=1}static right(n,t){let{P:o,n:r,endp:i}=n,s=i.sidemask===4;i.boxes[0]={ll:{x:o.start.p.x,y:s?o.start.p.y:r.info.coord.y-r.info.ht/2},ur:{x:t.ur.x,y:s?r.info.coord.y+r.info.ht/2:o.start.p.y+1}},i.boxn=1,o.start.p.x+=1}static dispatch(n,t){let{P:o,n:r,e:i,endp:s}=n,l=s.nb;t&4?(s.boxes[0]={ll:{x:l.ll.x,y:Math.min(l.ll.y,o.start.p.y)},ur:l.ur},s.boxn=1,o.start.p.y+=1):t&1?e.bottom(n,l):t&8?e.left(n,l):e.right(n,l),mt(i,r,!0),s.sidemask=t}};function mY(e,n){let{P:t,e:o,n:r,endp:i}=e,s=n===1?1:i.sidemask,l=r.info.shape?.fns??null,a=e1(l,r,o.info.tail_port,s,i);if(a){i.sidemask=a;return}i.boxes[0]=i.nb,i.boxn=1,bE(t,n,i)}function vi(e){let{P:n,e:t,et:o,endp:r,merge:i,ranksep:s}=e,l=t.tail;t.info.tail_port.dyna&&(t.info.tail_port=yn(l,t.head,t.info.tail_port)),n.start.p={x:l.info.coord.x+t.info.tail_port.p.x,y:l.info.coord.y+t.info.tail_port.p.y},yE(n,t,i),n.nbox=0,n.data=t,r.np={x:n.start.p.x,y:n.start.p.y};let a={P:n,e:t,n:l,endp:r,ranksep:s},u=t.info.tail_port.side;if(o===1&&l.info.node_type===0&&u){L5.dispatch(a,u);return}if(o===2&&u){I5.dispatch(a,u);return}mY(a,o)}var O5=class e{static bottom(n){let{P:t,n:o,e:r,endp:i,ranksep:s}=n,l=i.nb;t.end.p.x<o.info.coord.x?(i.boxes[0]={ll:{x:l.ll.x-1,y:o.info.coord.y-o.info.ht/2-s/2},ur:{x:l.ur.x,y:t.end.p.y}},i.boxes[1]={ll:{x:l.ll.x-1,y:t.end.p.y},ur:{x:o.info.coord.x-o.info.lw-0,y:o.info.coord.y+o.info.ht/2}}):(i.boxes[0]={ll:{x:l.ll.x,y:o.info.coord.y-o.info.ht/2-s/2},ur:{x:l.ur.x+1,y:t.end.p.y}},i.boxes[1]={ll:{x:o.info.coord.x+o.info.rw+0,y:t.end.p.y},ur:{x:l.ur.x+1,y:o.info.coord.y+o.info.ht/2}}),i.boxn=2,t.end.p.y-=1,mt(r,o,!1)}static top(n){let{P:t,n:o,e:r,endp:i}=n;i.boxes[0]={ll:{x:i.nb.ll.x,y:Math.min(i.nb.ll.y,t.end.p.y)},ur:i.nb.ur},i.sidemask=4,i.boxn=1,t.end.p.y+=1,mt(r,o,!1)}static left(n){let{P:t,n:o,e:r,endp:i}=n;i.boxes[0]={ll:{x:i.nb.ll.x,y:t.end.p.y},ur:{x:t.end.p.x,y:o.info.coord.y+o.info.ht/2}},i.boxn=1,t.end.p.x-=1,mt(r,o,!1)}static right(n){let{P:t,n:o,e:r,endp:i}=n;i.boxes[0]={ll:{x:t.end.p.x,y:t.end.p.y},ur:{x:i.nb.ur.x,y:o.info.coord.y+o.info.ht/2}},i.boxn=1,t.end.p.x+=1,mt(r,o,!1)}static dispatch(n,t){let{endp:o}=n;t&4?e.top(n):t&1?e.bottom(n):t&8?e.left(n):e.right(n),o.sidemask=t}},D5=class e{static bottom(n,t){let{P:o,n:r,endp:i,ranksep:s}=n;i.sidemask===4?(i.boxes[0]={ll:{x:t.ll.x-1,y:r.info.coord.y-r.info.ht/2-s/2},ur:{x:o.end.p.x,y:r.info.coord.y-r.info.ht/2}},i.boxes[1]={ll:{x:t.ll.x-1,y:r.info.coord.y-r.info.ht/2},ur:{x:r.info.coord.x-r.info.lw-2,y:r.info.coord.y+r.info.ht/2}},i.boxn=2):(i.boxes[0]={ll:t.ll,ur:{x:t.ur.x,y:Math.max(t.ur.y,o.start.p.y)}},i.boxn=1),o.end.p.y-=1}static left(n,t){let{P:o,n:r,endp:i}=n,s=i.sidemask===4;i.boxes[0]={ll:{x:t.ll.x,y:s?o.end.p.y-1:r.info.coord.y-r.info.ht/2},ur:{x:o.end.p.x+1,y:s?r.info.coord.y+r.info.ht/2:o.end.p.y+1}},i.boxn=1,o.end.p.x-=1}static right(n,t){let{P:o,n:r,endp:i}=n,s=i.sidemask===4;i.boxes[0]={ll:{x:o.end.p.x-1,y:s?o.end.p.y-1:r.info.coord.y-r.info.ht/2},ur:{x:t.ur.x,y:s?r.info.coord.y+r.info.ht/2:o.end.p.y}},i.boxn=1,o.end.p.x+=1}static dispatch(n,t){let{P:o,n:r,e:i,endp:s}=n,l=s.nb;t&4?(s.boxes[0]={ll:{x:l.ll.x,y:Math.min(l.ll.y,o.end.p.y)},ur:l.ur},s.boxn=1,o.end.p.y+=1):t&1?e.bottom(n,l):t&8?e.left(n,l):e.right(n,l),mt(i,r,!1),s.sidemask=t}};function xY(e,n){let{P:t,e:o,n:r,endp:i}=e,s=n===1?4:i.sidemask,l=r.info.shape?.fns??null,a=e1(l,r,o.info.head_port,s,i);if(a){i.sidemask=a;return}i.boxes[0]=i.nb,i.boxn=1,gE(t,n,i)}function Si(e){let{P:n,e:t,et:o,endp:r,merge:i,ranksep:s}=e,l=t.head;t.info.head_port.dyna&&(t.info.head_port=yn(l,t.tail,t.info.head_port)),n.end.p={x:l.info.coord.x+t.info.head_port.p.x,y:l.info.coord.y+t.info.head_port.p.y},PE(n,t,i),r.np={x:n.end.p.x,y:n.end.p.y};let a={P:n,e:t,n:l,endp:r,ranksep:s},u=t.info.head_port.side;if(o===1&&l.info.node_type===0&&u){O5.dispatch(a,u);return}if(o===2&&u){D5.dispatch(a,u);return}xY(a,o)}var xt=class e{static wind(n,t,o){let r=(n.y-t.y)*(o.x-t.x)-(o.y-t.y)*(n.x-t.x);return r>1e-4?1:r<-1e-4?-1:0}static dist2(n,t){let o=n.x-t.x,r=n.y-t.y;return o*o+r*r}static dist(n,t){return Math.sqrt(e.dist2(n,t))}static inBetween(n,t,o){return n.x!==t.x?n.x<o.x&&o.x<t.x||t.x<o.x&&o.x<n.x:n.y<o.y&&o.y<t.y||t.y<o.y&&o.y<n.y}static intersect(n,t,o,r){let i=e.wind,s=i(n,t,o);if(s===0&&e.inBetween(n,t,o))return!0;let l=i(n,t,r);if(l===0&&e.inBetween(n,t,r))return!0;let a=i(o,r,n),u=i(o,r,t);return s*l<0&&a*u<0}static inCone(n,t,o,r){let i=e.wind(r,n,t),s=e.wind(r,t,o);return e.wind(n,t,o)>0?i>=0&&s>=0:i>=0||s>=0}static clear(n,t,o,r,i){let s=i.P,l=i.next,a=i.N;for(let u=0;u<o;u++)if(e.intersect(n,t,s[u],s[l[u]]))return!1;for(let u=r;u<a;u++)if(e.intersect(n,t,s[u],s[l[u]]))return!1;return!0}static compVis(n){let t=n.N,o=n.P,r=n.next,i=n.prev,s=n.vis;for(let l=0;l<t;l++){let a=i[l],u=e.dist(o[l],o[a]);s[l][a]=u,s[a][l]=u;let f=a===l-1?l-2:l-1;for(let d=f;d>=0;d--)if(e.inCone(o[i[l]],o[l],o[r[l]],o[d])&&e.inCone(o[i[d]],o[d],o[r[d]],o[l])&&e.clear(o[l],o[d],t,t,n)){let c=e.dist(o[l],o[d]);s[l][d]=c,s[d][l]=c}}}static allocVis(n){let t=[];for(let o=0;o<n;o++)t.push(new Array(n).fill(0));return t.push(null),t.push(null),t}static polyhit(n,t){for(let o=0;o<n.Npoly;o++){let r=n.start[o],i=n.start[o+1];if(SE(n.P.slice(r,i),t))return o}return-1111}static ptVisRange(n,t,o,r,i){let s=n.P,l=n.next,a=n.prev,u=n.N;for(let f=0;f<u;f++){if(f>=o&&f<r){i[f]=0;continue}let d=s[f];e.inCone(s[a[f]],d,s[l[f]],t)&&e.clear(t,d,o,r,n)?i[f]=e.dist(t,d):i[f]=0}i[u]=0,i[u+1]=0}static computeRanges(n,t,o){return n<0?t<0?[0,0,0,0]:[0,0,o.start[t],o.start[t+1]]:t<0?[0,0,o.start[n],o.start[n+1]]:n<=t?[o.start[n],o.start[n+1],o.start[t],o.start[t+1]]:[o.start[t],o.start[t+1],o.start[n],o.start[n+1]]}};function SE(e,n){let t=e.length;for(let o=0;o<t;o++){let r=(o+t-1)%t;if(xt.wind(e[r],e[o],n)===1)return!1}return!0}function ln(e,n,t){return xt.wind(e,n,t)}function wi(e,n){return SE(e,n)}function wE(e){e.vis=xt.allocVis(e.N),xt.compVis(e)}function B5(e,n,t){let o=e.N,r=new Array(o+2).fill(0),i,s;return n===-2222&&(n=xt.polyhit(e,t)),n>=0?(i=e.start[n],s=e.start[n+1]):(i=o,s=o),xt.ptVisRange(e,t,i,s,r),r}function NE(e,n,t,o,r){let[i,s,l,a]=xt.computeRanges(n,o,r),u=r.N,f=r.P,d=r.next;for(let c=0;c<i;c++)if(xt.intersect(e,t,f[c],f[d[c]]))return!1;for(let c=s;c<l;c++)if(xt.intersect(e,t,f[c],f[d[c]]))return!1;for(let c=a;c<u;c++)if(xt.intersect(e,t,f[c],f[d[c]]))return!1;return!0}var F5=Number.MAX_SAFE_INTEGER,n1=class e{static relaxNode(n,t,o,r,i){let s=-1;for(let l=0;l<t;l++)if(r[l+1]<0){let a=n>=l?i[n][l]:i[l][n],u=-(r[n+1]+a);a!==0&&r[l+1]<u&&(r[l+1]=u,o[l]=n),r[l+1]>r[s+1]&&(s=l)}return s}static dijkstra(n,t,o,r){let i=new Array(o).fill(-1),s=new Float64Array(o+1);for(let a=0;a<o;a++)s[a+1]=-F5;s[0]=-(F5+1);let l=n;for(;l!==t;){let a=l;if(s[a+1]*=-1,s[a+1]===F5&&(s[a+1]=0),l=e.relaxNode(a,o,i,s,r),l===-1)break}return i}static countPath(n,t){let o=2;for(let r=n[t];r!==void 0&&r!==-1&&r!==t+1;r=n[r])o++;return o}static extractPath(n,t,o,r,i){if(n[t]===-1)return[o,r];let s=e.countPath(n,t),l=new Array(s),a=s-1;l[a--]=r;for(let u=n[t];u!==void 0&&u!==-1&&u!==t+1;u=n[u])l[a--]=i.P[u];return l[0]=o,l}static fillArrays(n,t){let o=0;for(let r=0;r<t.length;r++){let i=o;n.start[r]=i;let s=t[r].ps,l=i+s.length-1;for(let a=0;a<s.length;a++)n.P[o]=s[a],n.next[o]=o+1,n.prev[o]=o-1,o++;n.next[l]=i,n.prev[i]=l}n.start[t.length]=o}static open(n){let t=n.reduce((r,i)=>r+i.ps.length,0),o={N:t,Npoly:n.length,P:new Array(t),start:new Array(n.length+1),next:new Array(t),prev:new Array(t),vis:[]};return e.fillArrays(o,n),wE(o),o}static path(n,t,o,r,i){let s=B5(n,o,t),l=B5(n,i,r),a=n.N,u;return NE(t,o,r,i,n)?(u=new Array(a+2).fill(-1),u[a]=a+1):(n.vis[a]=l,n.vis[a+1]=s,u=e.dijkstra(a+1,a,a+2,n.vis)),e.extractPath(u,a,t,r,n)}};function z5(e){return n1.open(e)}function j5(e,n,t,o,r){return n1.path(e,n,t,o,r)}function RE(e,n,t,o){return n<=t||e>=o?0:e<=t&&n>=o?n-e:t<=e&&o>=n?o-t:t<=e?o-e:n-t}function bY(e,n){let t=0;for(let o=0;o<n;o++)Math.abs(e[o].ll.y-e[o].ur.y)<.01||Math.abs(e[o].ll.x-e[o].ur.x)<.01||(t!==o&&(e[t]={ll:{...e[o].ll},ur:{...e[o].ur}}),t++);return t}function gY(e,n,t,o,r,i){if(t===1){let s=e.ur.x;e.ur.x=n.ll.x,n.ll.x=s,t=0}else if(o===1){let s=e.ll.x;e.ll.x=n.ur.x,n.ur.x=s,o=0}else if(r===1){let s=e.ur.y;e.ur.y=n.ll.y,n.ll.y=s,r=0}else if(i===1){let s=e.ll.y;e.ll.y=n.ur.y,n.ur.y=s,i=0}return[t,o,r,i]}function yY(e,n,t,o,r,i){if(t===1){let s=(e.ur.x+n.ll.x)/2+.5;e.ur.x=n.ll.x=s}else if(o===1){let s=(e.ll.x+n.ur.x)/2+.5;e.ll.x=n.ur.x=s}else if(r===1){let s=(e.ur.y+n.ll.y)/2+.5;e.ur.y=n.ll.y=s}else if(i===1){let s=(e.ll.y+n.ur.y)/2+.5;e.ll.y=n.ur.y=s}}function PY(e,n){let t=e.ur.x<n.ll.x?1:0,o=e.ll.x>n.ur.x?1:0,r=e.ur.y<n.ll.y?1:0,i=e.ll.y>n.ur.y?1:0,s=t+o+r+i;if(s!==0){[t,o,r,i]=gY(e,n,t,o,r,i);for(let l=0;l<s-1;l++)yY(e,n,t,o,r,i)}}function EY(e,n,t,o){t<o?e.ur.x-e.ll.x>n.ur.x-n.ll.x?e.ur.x<n.ur.x?e.ur.x=n.ll.x:e.ll.x=n.ur.x:e.ur.x<n.ur.x?n.ll.x=e.ur.x:n.ur.x=e.ll.x:e.ur.y-e.ll.y>n.ur.y-n.ll.y?e.ur.y<n.ur.y?e.ur.y=n.ll.y:e.ll.y=n.ur.y:e.ur.y<n.ur.y?n.ll.y=e.ur.y:n.ur.y=e.ll.y}function TE(e,n){(e.x<n.ll.x||e.x>n.ur.x||e.y<n.ll.y||e.y>n.ur.y)&&(e.x=Math.min(Math.max(e.x,n.ll.x),n.ur.x),e.y=Math.min(Math.max(e.y,n.ll.y),n.ur.y))}function _E(e,n,t){let o=bY(n,e);if(n[0].ll.x>n[0].ur.x||n[0].ll.y>n[0].ur.y)return!0;for(let r=0;r+1<o;r++){let i=n[r],s=n[r+1];if(s.ll.x>s.ur.x||s.ll.y>s.ur.y)return!0;PY(i,s);let l=RE(i.ll.x,i.ur.x,s.ll.x,s.ur.x),a=RE(i.ll.y,i.ur.y,s.ll.y,s.ur.y);l>0&&a>0&&EY(i,s,l,a)}return TE(t.start.p,n[0]),TE(t.end.p,n[o-1]),!1}function vY(e,n,t,o,r){let i=e.x+r*(n.x-e.x),s=e.y+r*(n.y-e.y),l=n.x+r*(t.x-n.x),a=n.y+r*(t.y-n.y),u=t.x+r*(o.x-t.x),f=t.y+r*(o.y-t.y),d=i+r*(l-i),c=s+r*(a-s),m=l+r*(u-l),b=a+r*(f-a);return{x:d+r*(m-d),y:c+r*(b-c)}}function SY(e,n,t){for(let o=0;o<n;o++)t.y<=e[o].ur.y+1e-4&&t.y>=e[o].ll.y-1e-4&&(t.x<e[o].ll.x&&(e[o].ll.x=t.x),t.x>e[o].ur.x&&(e[o].ur.x=t.x))}function wY(e,n,t,o,r){let i=t[o],s=t[o+1],l=t[o+2],a=t[o+3];for(let u=0;u<=r;u++){let f=vY(i,s,l,a,u/r);SY(e,n,f)}}function V5(e,n,t,o,r){let i=Math.round(r*n);for(let s=0;s+3<o;s+=3)wY(e,n,t,s,i)}function NY(e,n,t,o,r){if(o!==r)r===-1||o===1?(e.push({x:n[t].ll.x,y:n[t].ur.y}),e.push({x:n[t].ll.x,y:n[t].ll.y})):(e.push({x:n[t].ur.x,y:n[t].ll.y}),e.push({x:n[t].ur.x,y:n[t].ur.y}));else if(o===0)e.push({x:n[t].ll.x,y:n[t].ur.y}),e.push({x:n[t].ll.x,y:n[t].ll.y});else if(!(o===-1&&r===-1))return!1;return!0}function RY(e,n,t,o,r){if(o!==r)r===-1||o===1?(e.push({x:n[t].ll.x,y:n[t].ur.y}),e.push({x:n[t].ll.x,y:n[t].ll.y})):(e.push({x:n[t].ur.x,y:n[t].ll.y}),e.push({x:n[t].ur.x,y:n[t].ur.y}));else if(o===0)e.push({x:n[t].ur.x,y:n[t].ll.y}),e.push({x:n[t].ur.x,y:n[t].ur.y});else{if(!(o===-1&&r===-1))return!1;e.push({x:n[t].ur.x,y:n[t].ll.y}),e.push({x:n[t].ur.x,y:n[t].ur.y}),e.push({x:n[t].ll.x,y:n[t].ur.y}),e.push({x:n[t].ll.x,y:n[t].ll.y})}return!0}function TY(e,n){let t=[];for(let o=0;o<n;o++){let r=o>0?e[o].ll.y>e[o-1].ll.y?-1:1:0,i=o+1<n?e[o+1].ll.y>e[o].ll.y?1:-1:0;if(!NY(t,e,o,r,i))return null}for(let o=n-1;o>=0;o--){let r=o+1<n?e[o].ll.y>e[o+1].ll.y?-1:1:0,i=o>0?e[o-1].ll.y>e[o].ll.y?1:-1:0;if(!RY(t,e,o,r,i))return null}return t}function kE(e,n){for(let t=0;t<n;t++){let o=e[t].ur.y;e[t].ur.y=-e[t].ll.y,e[t].ll.y=-o}}function kY(e){for(let n of e)n.y*=-1}function CY(e){return e.map((n,t)=>({a:n,b:e[(t+1)%e.length]}))}function _Y(e){let n=[{x:0,y:0},{x:0,y:0}];return e.start.constrained&&(n[0]={x:Math.cos(e.start.theta),y:Math.sin(e.start.theta)}),e.end.constrained&&(n[1]={x:-Math.cos(e.end.theta),y:-Math.sin(e.end.theta)}),n}function AY(e){let n=e.every(o=>Math.abs(e[0].y-o.y)<=1e-4),t=e.every(o=>Math.abs(e[0].x-o.x)<=1e-4);return n||t}function GY(e,n,t){for(let o=0;o<n;o++)e[o].ll.x=t[0].x,e[o].ur.x=t[0].x}function MY(e,n,t,o,r){let i=10,s=!0;for(let l=0;s&&l<15;l++){V5(e,n,t,t.length,i);let a=!0;for(let u=0;u<n;u++)if(e[u].ll.x===o||e[u].ur.x===r){i*=2,a=!1;break}a&&(s=!1)}}function AE(e,n){let t=e.boxes;if(_E(e.nbox,t,e))return null;let o=e.nbox,r=!1;o>1&&t[0].ll.y>t[1].ll.y&&(r=!0,kE(t,o));let i=TY(t,o);if(i===null)return null;r&&(kE(t,o),kY(i));let s=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let m=0;m<o;m++)t[m].ll.x=s,t[m].ur.x=l;let a={ps:i},u=[{x:e.start.p.x,y:e.start.p.y},{x:e.end.p.x,y:e.end.p.y}],f=to(a,u);if(f===null)return console.warn("in routesplines, Pshortestpath failed"),null;let d;if(n)d=no(f);else{let m=CY(i),b=_Y(e);if(d=Wn(m,f,b),d.length===0)return null}if(AY(d))return GY(t,o,d),d;if(MY(t,o,d,s,l),t.slice(0,o).some(m=>m.ll.x===s||m.ur.x===l)){let m=no(f);V5(t,o,m,m.length,10)}return d}function hr(e){return AE(e,!1)}function yu(e){return AE(e,!0)}function t1(e,n){if(n===an)return hr(e);let t=yu(e);if(n===le&&t!==null&&t.length>4){let o=t[0],r=t[t.length-1];return[o,o,r,r]}return t}function Ce(){return{swapEnds:En,splineMerge:vn,ignoreSwap:!1,isOrtho:!1}}function GE(e,n){let t=e.info.other;if(t?.size){if((e.info.node_type??B)===B){let o=e.info.rw??0;e.info.rw=e.info.mval??0,e.info.mval=o}for(let o=0;o<t.size;o++){let r=t.list[o];r1(r,0,0,U5),n.push(r)}}}function o1(e,n){return e.info.rank[n].v[0].info.coord?.y??0}function LY(e,n,t){return t>0?o1(e,t-1)-(n.info.coord?.y??0):n.info.ht??0}function IY(e,n,t){return(n.info.coord?.y??0)-o1(e,t+1)}function OY(e,n,t){let o=n.info.coord?.y??0,r=o1(e,t-1)-o,i=o-o1(e,t+1);return Math.min(r,i)}function DY(e,n){let t=n.info.rank??0,o=e.info.minrank??0,r=e.info.maxrank??0;return t===r?LY(e,n,t):t===o?IY(e,n,t):OY(e,n,t)}function ME(e,n,t,o,r){let s=n[0].tail,l=DY(e,s);Ws(n,t,o,l/2,r)}function BY(e){return{g:e,sp:{...xr(e),splinesep:Math.trunc((e.info.nodesep??18)/4)}}}function FY(e){let n=[],t=e.info.to_virt;for(;t!==void 0;){for(;t.info.to_virt!==void 0;)t=t.info.to_virt;if(n.push(t),t.head===e.head)break;let o=t.head.info.out;t=o!==void 0&&o.size>0?o.list[0]:void 0}return n}function LE(e,n,t,o,r){return{P:e,e:n,et:1,endp:t,merge:o,ranksep:r}}function zY(e){return(e.info.node_type??B)===U&&!vn(e)}function jY(e){return(e.root.info.has_labels??0)&on?5:3}function HY(e,n){return{ctx:BY(e),ranks:e.info.rank,ranksep:Gn(e),et:ht(e),P:{start:ue(),end:ue(),nbox:0,boxes:[],data:null},pts:[],boxes:[],segfirst:n[0],tend:gr({ll:{x:0,y:0},ur:{x:0,y:0}})}}function IE(e,n,t,o,r){let i=t.tail;e.tend=gr(br(e.ctx,i,o,t)),vi(LE(e.P,n,e.tend,vn(n.tail),e.ranksep)),Ni(e.tend.nb,e.tend,1,i.info.coord.y-Pn(e.ranks[i.info.rank].ht1,i.info.ht)),r&&(e.P.start.theta=-Math.PI/2,e.P.start.constrained=!0)}function OE(e,n,t,o,r){let i=t.head,s=gr(br(e.ctx,i,t,o));if(Si(LE(e.P,n,s,vn(n.head),e.ranksep)),Ni(s.nb,s,4,i.info.coord.y+Pn(e.ranks[i.info.rank].ht2,i.info.ht)),r&&(e.P.end.theta=Math.PI/2,e.P.end.constrained=!0),!W5({P:e.P,first:e.segfirst,last:t,tend:e.tend,hend:s,boxes:e.boxes}))return!1;let l=t1(e.P,e.et);if(l===null)return!1;for(let a of l)e.pts.push(a);return!0}function VY(e,n,t,o,r){if(!OE(e,n[t],n[t],n[t+1],!0))return-1;zE(n[t+1],o,e.pts),BE(n.slice(r),e.P);let i=t+1+o;return e.segfirst=n[i],e.boxes=[],IE(e,n[i],n[i],n[i].tail.info.in.list[0],!0),i}function UY(e,n,t,o,r){return e.boxes.push(l1(e.ctx,t.tail.info.rank)),OE(e,n,t,void 0,!1)?(BE(r.slice(o),e.P),!0):!1}function $5(e,n,t,o){let r=HY(e,o),i=jY(e);IE(r,n,o[0],void 0,!1);let s=0,l=0,a=!1,u=!1,f=0;for(;zY(o[s].head);){if(r.boxes.push(l1(r.ctx,o[s].tail.info.rank)),a||(f=FE(o[s].head),f>=i&&(a=!0,u=!0,f-=2)),a&&!u){if(s=VY(r,o,s,f,l),s<0)return null;l=s,a=!1;continue}u=!1,r.boxes.push(br(r.ctx,o[s].head,o[s],o[s+1])),s++}return UY(r,t,o[s],l,o)?r.pts:null}function i1(e,n){let t=n.tail.info.rank,o=n.head.info.rank;if(e.info.rank===void 0||t===void 0||o===void 0||o<=t+1)return null;if(ht(e)===le){let s=jE(e,n);if(s!==null)return s}let i=FY(n);return i.length===0||i[i.length-1].head!==n.head?null:$5(e,i[0],i[i.length-1],i)}function XY(e){let n=[e],t=e.head;for(;(t.info.node_type??B)===U&&!vn(t);){let o=t.info.out?.list[0];if(o===void 0)return null;n.push(o),t=o.head}return!vn(e.tail)&&!vn(t)?null:n}function DE(e,n){let t=XY(n);if(t===null)return null;let o=t[t.length-1],r=$5(e,t[0],o,t);return r!==null&&Z(n,o.head,r,r.length,Ce()),In(n)}function $Y(e,n){e.info.label!=null?X5(e,n.ll.x,n.ur.x,n.ur.x+e.info.rw):X5(e,n.ll.x,(n.ll.x+n.ur.x)/2,n.ur.x)}function BE(e,n){let t=0;for(let o=0;o<e.length;o++){let r=e[o].head;if((r.info.node_type??B)!==U||vn(r))break;for(;t<n.nbox&&n.boxes[t].ll.y>r.info.coord.y;)t++;if(t>=n.nbox)break;n.boxes[t].ur.y>=r.info.coord.y&&$Y(r,n.boxes[t])}}function WY(e){let n=[],t=e.info.to_virt;for(;t!==void 0&&(n.push(t),t.head!==e.tail);)t=t.head.info.out?.list[0];return n}function El(e){let n=(e.head.info.rank??0)<(e.tail.info.rank??0),[t,o]=n?[e.head,e.tail]:[e.tail,e.head];return{...e,tail:t,head:o,info:{...e.info,tail_port:e.info.head_port??ue(),head_port:e.info.tail_port??ue(),to_orig:e,edge_type:U}}}function s1(e,n,t,o){let r=WY(e);if(r.length<2||r[r.length-1].head!==e.tail)return;let i=El(e),s=$5(o,r[0],r[r.length-1],r);s!==null&&(Z(i,i.head,s,s.length,Ce()),En(e)&&On(e))}function Ri(e){return e.info.out?.size??0}function Pu(e){return e.info.in?.size??0}function Jn(e){return e.info.node_type??0}function Y5(e,n){let t=Ri(e.tail),o;for(let r=0;r<t;r++){let i=e.tail.info.out.list[r];n*(je(i.head)-je(e.head))<=0||i.info.spl===void 0&&i.info.to_orig?.info.spl===void 0||(o===void 0||n*(je(o.head)-je(i.head))>0)&&(o=i)}return o}function J5(e,n){let t=Pu(e.head),o;for(let r=0;r<t;r++){let i=e.head.info.in.list[r];n*(je(i.tail)-je(e.tail))<=0||i.info.spl===void 0&&i.info.to_orig?.info.spl===void 0||(o===void 0||n*(je(o.tail)-je(i.tail))>0)&&(o=i)}return o}function YY(e,n){return Jn(e)!==U||Ri(e)!==1||Pu(e)!==1?!1:Ti(e)===Ti(n)}function JY(e){let n=e.info.out?.list[0];return n?n.head:void 0}function FE(e){let n=0,t=e;for(;t=JY(t),!(!t||!YY(t,e));)n++;return n}function zE(e,n,t){let o=e;for(let i=0;i<n;i++)o=o.head.info.out.list[0];let r=t[t.length-1];return t.push({x:r.x,y:r.y},{x:r.x,y:r.y}),o}function X5(e,n,t,o){e.info.coord.x=t,e.info.lw=t-n,e.info.rw=o-t}function UE(e,n,t){return t!==je(e)>je(n)}function KY(e,n){let t=e?.head,o=n?.head,r=t&&Ri(t)===1&&Jn(t)!==B?t.info.out?.list[0]:void 0,i=o&&Ri(o)===1&&Jn(o)!==B?o.info.out?.list[0]:void 0;return[r,i]}function qY(e,n){let t=e?.tail,o=n?.tail,r=t&&Pu(t)===1&&Jn(t)!==B?t.info.in?.list[0]:void 0,i=o&&Pu(o)===1&&Jn(o)!==B?o.info.in?.list[0]:void 0;return[r,i]}function QY(e,n,t){let o=e.head,r=n.head;return o===r?!1:UE(o,r,t)}function ZY(e,n,t){let o=e.tail,r=n.tail;return o===r?!1:UE(o,r,t)}function eJ(e,n,t){if(Ri(e)!==1||!t)return!1;let o=e.info.out.list[0],r=t;for(let i=0;i<2&&o&&r;i++){if(QY(o,r,n))return!0;if(o.head===r.head)break;[o,r]=KY(o,r)}return!1}function nJ(e,n,t){if(Pu(e)!==1||!t)return!1;let o=e.info.in.list[0],r=t;for(let i=0;i<2&&o&&r;i++){if(ZY(o,r,n))return!0;if(o.tail===r.tail)break;[o,r]=qY(o,r)}return!1}function tJ(e,n,t,o){if(Ri(e)!==1&&Ri(n)!==1)return!1;let r=je(e)>je(n);return eJ(e,r,o)||nJ(e,r,t)}function oJ(e){return Jn(e)===U&&e.info.label?!0:Jn(e)===B}function K5(e,n,t,o,r){let i=e.info.rank?.[_e(n)];if(!i)return;let s=je(n)+r;for(let l=s;l>=0&&l<i.n;l+=r){let a=i.v[l];if(!a)break;if(oJ(a)||!tJ(a,n,t,o))return a}}function HE(e,n){return e.map((t,o)=>rJ(o,e.length)?{x:t.x+n,y:t.y}:t)}function rJ(e,n){return e>0&&e<n-1}function iJ(e,n){let t=In(n),o=XE(t)?El(t):t,r=vl(e,o);return r==="lost"?null:r??i1(e,o)}function XE(e){let n=In(e);return _e(n.head)<_e(n.tail)}function sJ(e){let n=In(e);return _e(n.head)>=_e(n.tail)?n.head:n.tail}function VE(e,n){let t=n.map(i=>({x:i.x,y:i.y})),o=XE(e),r=o?El(e):e;if(Z(r,sJ(e),t,t.length,Ce()),o){let i=In(e);On(i)}}function $E(e,n,t){let o=n.length;if(o===0)return;let r=n.find(a=>{let u=In(a);return u.info.head_port?.defined||u.info.tail_port?.defined})??n[0],i=iJ(e,r);if(i===null)return;if(o===1){VE(n[0],i);return}let s=t*(o-1)/2,l=HE(i,-s);for(let a=0;a<o;a++)a>0&&(l=HE(l,t)),VE(n[a],l)}function a1(e,n){return{x:e.x+n.x,y:e.y+n.y}}function lJ(e,n,t){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)>0}function aJ(e,n,t,o){let r=e.info.flip===!0,i=r?o.dimen.y:o.dimen.x,s=r?o.dimen.x:o.dimen.y,l={x:o.pos.x,y:o.pos.y};return lJ(t,n,l)?(l.x+=i/2,l.y-=s/2):(l.x-=i/2,l.y+=s/2),[n,n,l,l,l,t,t]}function jE(e,n){let t=In(n),o=t.tail,r=t.head;if(o.info.rank===void 0||r.info.rank===void 0)return null;let i=Math.abs(r.info.rank-o.info.rank),s=((e.root.info.has_labels??0)&on)!==0;if(i===1||i===2&&s)return null;let l,a;n.tail===o?(l=a1(o.info.coord,t.info.tail_port.p),a=a1(r.info.coord,t.info.head_port.p)):(l=a1(r.info.coord,t.info.head_port.p),a=a1(o.info.coord,t.info.tail_port.p));let u=t.info.label;return u!==void 0?aJ(e,l,a,u):[l,l,a,a]}var KE=4,_o=16,WE=8;function qE(e){return Jn(e)===U&&e.info.label!=null}function uJ(e){if(Jn(e)===B)return[e.info.clust,e.info.clust];let n=e.info.out?.list[0]?.info.to_orig;return[n?.tail.info.clust,n?.head.info.clust]}function q5(e,n,t){return e!==void 0&&e!==n&&e!==t}function YE(e,n){let t=e.info.bb;if(t===void 0)return!1;let o=n.info.coord;return t.ll.x<=o.x&&o.x<=t.ur.x&&t.ll.y<=o.y&&o.y<=t.ur.y}function Q5(e,n){let t=e.info.clust;return t===n?void 0:t}function fJ(e,n,t,o){let r=e.info.out?.list[0]?.info.to_orig;if(r===void 0)return;let i=Q5(r.tail,o);if(q5(i,n,t)&&YE(i,e))return i;let s=Q5(r.head,o);if(q5(s,n,t)&&YE(s,e))return s}function QE(e,n,t){let[o,r]=uJ(e);if(Jn(n)===B){let i=Q5(n,t);return q5(i,o,r)?i:void 0}return fJ(n,o,r,t)}function dJ(e,n,t,o){let r=n.info.coord.x-n.info.lw-KE,i=K5(e.g,n,t,o,-1);if(!i)return Math.min(A(r),e.sp.leftBound);let s=QE(n,i,e.g)?.info.bb,l=s!==void 0?s.ur.x+e.sp.splinesep:i.info.coord.x+(i.info.mval??0)+(Jn(i)===B?(e.g.info.nodesep??18)/2:e.sp.splinesep);return A(Math.min(l,r))}function cJ(e,n,t,o){let r=qE(n)?n.info.coord.x+10:n.info.coord.x+n.info.rw+KE,i=K5(e.g,n,t,o,1);if(!i)return Math.max(A(r),e.sp.rightBound);let s=QE(n,i,e.g)?.info.bb,l=s!==void 0?s.ll.x-e.sp.splinesep:i.info.coord.x-i.info.lw-(Jn(i)===B?(e.g.info.nodesep??18)/2:e.sp.splinesep);return A(Math.max(l,r))}function br(e,n,t,o){let r=dJ(e,n,t,o),i=cJ(e,n,t,o);qE(n)&&(i-=n.info.rw,i<r&&(i=n.info.coord.x));let s=e.g.info.rank,l=n.info.rank;return{ll:{x:r,y:n.info.coord.y-Pn(s[l].ht1,n.info.ht)},ur:{x:i,y:n.info.coord.y+Pn(s[l].ht2,n.info.ht)}}}function pJ(e,n,t){return n===1?{ll:{x:e.ll.x,y:t},ur:{x:e.ur.x,y:e.ll.y}}:{ll:{x:e.ll.x,y:e.ur.y},ur:{x:e.ur.x,y:t}}}function Ni(e,n,t,o){let r=n.boxes[n.boxn-1],i={ll:{x:e.ll.x,y:r.ll.y},ur:{x:e.ur.x,y:r.ur.y}},s=pJ(i,t,o);s.ll.x<s.ur.x&&s.ll.y<s.ur.y&&(n.boxes[n.boxn++]=s)}function l1(e,n){let t=e.g.info.rank,o=t[n].v[0],r=t[n+1].v[0];return{ll:{x:e.sp.leftBound,y:r.info.coord.y+Pn(t[n+1].ht2,r.info.ht)},ur:{x:e.sp.rightBound,y:o.info.coord.y-Pn(t[n].ht1,o.info.ht)}}}function mJ(e){let n=e;for(;n!==void 0;){if(n.info.spl!==void 0)return!1;if((n.info.edge_type??B)===B)return!0;n=n.info.to_orig}return!0}function u1(e){return e!==void 0&&mJ(e)}function xJ(e,n){return!u1(Y5(e,-1))&&!u1(Y5(e,1))&&!u1(J5(n,-1))&&!u1(J5(n,1))}function hJ(e,n,t){for(let o=n-1;o<t+1;o++){let r=e.boxes[o];if((o-n)%2===0?r.ll.x>=r.ur.x:r.ll.x+_o>r.ur.x){let l=(r.ll.x+r.ur.x)/2;r.ll.x=l-WE,r.ur.x=l+WE}}}function bJ(e,n){e.ll.x+_o>n.ur.x&&(n.ur.x=e.ll.x+_o),e.ur.x-_o<n.ll.x&&(n.ll.x=e.ur.x-_o)}function gJ(e,n){e.ll.x+_o>n.ur.x&&(e.ll.x=n.ur.x-_o),e.ur.x-_o<n.ll.x&&(e.ur.x=n.ll.x+_o)}function yJ(e,n,t){for(let o=0;o+1<e.nbox;o++){let r=e.boxes[o],i=e.boxes[o+1];o>=n&&o<=t&&(o-n)%2===0?bJ(r,i):o+1>=n&&o<t&&(o+1-n)%2===0&&gJ(r,i)}}function PJ(e,n,t){hJ(e,n,t),yJ(e,n,t)}function W5(e){let{P:n,first:t,last:o,tend:r,hend:i,boxes:s}=e;if(!xJ(t,o))return!1;for(let u=0;u<r.boxn;u++)pt(n,r.boxes[u]);let l=n.nbox+1,a=l+s.length-3;for(let u=0;u<s.length;u++)pt(n,s[u]);for(let u=i.boxn-1;u>=0;u--)pt(n,i.boxes[u]);return PJ(n,l,a),!0}function gr(e){return{nb:e,np:{x:0,y:0},sidemask:0,boxn:0,boxes:[]}}function JE(e,n,t,o,r){return{P:e,e:n,et:1,endp:t,merge:o,ranksep:r}}function vl(e,n){let t=e.info.rank,o=n.tail.info.rank;if(t===void 0||o===void 0||n.head.info.rank!==o+1)return null;let r=n.tail,i=n.head,s={g:e,sp:{...xr(e),splinesep:Math.trunc((e.info.nodesep??18)/4)}},l=Gn(e),a={start:ue(),end:ue(),nbox:0,boxes:[],data:null},u=gr(br(s,r,void 0,n));vi(JE(a,n,u,vn(r),l)),Ni(u.nb,u,1,r.info.coord.y-Pn(t[o].ht1,r.info.ht));let f=[l1(s,o)],d=gr(br(s,i,n,void 0));if(Si(JE(a,n,d,vn(i),l)),Ni(d.nb,d,4,i.info.coord.y+Pn(t[o+1].ht2,i.info.ht)),!W5({P:a,first:n,last:n,tend:u,hend:d,boxes:f}))return null;let c=t1(a,ht(e));return c===null?"lost":c}function EJ(e){return e.tail.info.rank===e.head.info.rank?2:1}function ZE(e){return[-EJ(e),Math.abs((e.tail.info.rank??0)-(e.head.info.rank??0)),Math.abs((e.tail.info.coord?.x??0)-(e.head.info.coord?.x??0)),e.seq]}function ev(e,n){let t=ZE(e),o=ZE(n);for(let r=0;r<t.length;r++)if(t[r]!==o[r])return t[r]-o[r];return 0}function Sl(e,n,t){let o=t?{x:e.y,y:-e.x}:{x:e.x,y:e.y};return{x:o.x+n.x,y:o.y+n.y}}function Z5(e,n){let t=jr(e,n.name,!0);t.info.coord={x:n.info.coord.x,y:n.info.coord.y},t.info.lw=n.info.lw,t.info.rw=n.info.rw,t.info.ht=n.info.ht,t.info.width=n.info.width,t.info.height=n.info.height;for(let[o,r]of n.attrs)o!=="fixedsize"&&t.attrs.set(o,r);return n.nodeDefaultsSnapshot!==void 0&&(t.nodeDefaultsSnapshot=new Map(n.nodeDefaultsSnapshot)),t}function ex(e,n,t,o){let r=new Ae(n,t,o.name);r.info.tail_port={...ue(),...o.info.tail_port},r.info.head_port={...ue(),...o.info.head_port},r.info.weight=o.info.weight,r.info.minlen=o.info.minlen;for(let[i,s]of o.attrs)r.attrs.set(i,s);return r.info.stale_arrow_attrs=!0,e.edges.push(r),r}function nv(e){e.nodes.clear(),e.edges.length=0,e.subgraphs.clear()}function nx(e){return e.boundary[0]>e.boundary[2]}function tx(e){for(let n=0;n<4;n++)e.boundary[n]=0}function wl(){let e={boundary:[0,0,0,0]};return e.boundary[0]=1,e.boundary[2]=-1,e}function ro(e){if(nx(e))return 0;let n=1;for(let t=0;t<2;t++){let o=e.boundary[t+2]-e.boundary[t];if(o===0)return 0;if(Number.MAX_SAFE_INTEGER/o<n)throw new Error("label: area too large for rtree");n*=o}return n}function At(e,n){if(nx(e))return n;if(nx(n))return e;let t={boundary:[0,0,0,0]};for(let o=0;o<2;o++){t.boundary[o]=Math.min(e.boundary[o],n.boundary[o]);let r=o+2;t.boundary[r]=Math.min(e.boundary[r],n.boundary[r])}return t}function Eu(e,n){for(let t=0;t<2;t++){let o=t+2;if(e.boundary[t]>n.boundary[o]||n.boundary[t]>e.boundary[o])return!1}return!0}var vJ=2n**64n;function SJ(e,n){let t=BigInt(e)-BigInt(n);return t<0n?t+vJ:t}var ie=64,wJ=1;function NJ(){return{partition:new Array(ie+1).fill(-1),taken:new Array(ie+1).fill(!1),count:[0,0],cover:[wl(),wl()],area:[0,0]}}function tv(){return{rect:{boundary:[0,0,0,0]},child:null}}function ov(){return{branchBuf:Array.from({length:ie+1},tv),coverSplit:{boundary:[0,0,0,0]},coverSplitArea:0,partitions:Array.from({length:wJ},NJ)}}function rv(e){tx(e.rect),e.child=null}function ox(e){e.count=0,e.level=-1;for(let n=0;n<ie;n++)rv(e.branch[n])}function vu(){let n={count:0,level:-1,branch:Array.from({length:ie},tv)};return ox(n),n}function RJ(e,n,t,o){!e.set||o<e.incr?(e.idx=n,e.area=t,e.incr=o,e.set=!0):o===e.incr&&t<e.area&&(e.idx=n,e.area=t,e.incr=o)}function Su(e){let n={boundary:[0,0,0,0]};tx(n);let t=!0;for(let o=0;o<ie;o++)e.branch[o].child!==null&&(t?(n=e.branch[o].rect,t=!1):n=At(n,e.branch[o].rect));return n}function iv(e,n){let t={idx:0,area:0,incr:0n,set:!1};for(let o=0;o<ie;o++)if(n.branch[o].child!==null){let r=n.branch[o].rect,i=ro(r);RJ(t,o,i,SJ(ro(At(e,r)),i))}return t.idx}function yr(e,n,t,o){if(t.count<ie){for(let r=0;r<ie;r++)if(t.branch[r].child===null){t.branch[r]={rect:{boundary:[n.rect.boundary[0],n.rect.boundary[1],n.rect.boundary[2],n.rect.boundary[3]]},child:n.child},t.count++;break}return 0}else return TJ(e,t,n,o),1}function rx(e,n){rv(e.branch[n]),e.count--}var sv=()=>{throw new Error("splitNode not yet registered \u2014 import split-q.ts first")};function lv(e){sv=e}function TJ(e,n,t,o){sv(e,n,t,o)}var kJ=2n**64n;function ix(e,n){let t=BigInt(e)-BigInt(n);return t<0n?t+kJ:t}function CJ(e){let n=e.split.partitions[0];n.count[0]=n.count[1]=0,n.cover[0]=wl(),n.cover[1]=wl(),n.area[0]=n.area[1]=0;for(let t=0;t<ie+1;t++)n.taken[t]=!1,n.partition[t]=-1}function f1(e,n,t){let o=e.split.partitions[0];o.partition[n]=t,o.taken[n]=!0,o.count[t]===0?o.cover[t]=e.split.branchBuf[n].rect:o.cover[t]=At(e.split.branchBuf[n].rect,o.cover[t]),o.area[t]=ro(o.cover[t]),o.count[t]++}function _J(e){let n=new Array(ie+1);for(let i=0;i<ie+1;i++)n[i]=ro(e.split.branchBuf[i].rect);let t=0n,o=0,r=0;for(let i=0;i<ie;i++)for(let s=i+1;s<ie+1;s++){let l=At(e.split.branchBuf[i].rect,e.split.branchBuf[s].rect),a=ro(l),u=ix(a,n[i]+n[s]);u>t&&(t=u,o=i,r=s)}f1(e,o,0),f1(e,r,1)}function av(e){return{boundary:[e.boundary[0],e.boundary[1],e.boundary[2],e.boundary[3]]}}function AJ(e,n,t){for(let o=0;o<ie;o++)e.split.branchBuf[o]={rect:av(n.branch[o].rect),child:n.branch[o].child};e.split.branchBuf[ie]={rect:av(t.rect),child:t.child},e.split.coverSplit=e.split.branchBuf[0].rect;for(let o=1;o<ie+1;o++)e.split.coverSplit=At(e.split.coverSplit,e.split.branchBuf[o].rect);e.split.coverSplitArea=ro(e.split.coverSplit),ox(n)}function GJ(e,n,t){for(let o=0;o<ie+1;o++){let r=e.split.partitions[0].partition[o];r===0?yr(e,e.split.branchBuf[o],n,{value:null}):r===1&&yr(e,e.split.branchBuf[o],t,{value:null})}}function MJ(e){CJ(e),_J(e);let n=e.split.partitions[0];for(;n.count[0]+n.count[1]<ie+1&&n.count[0]<ie+1&&n.count[1]<ie+1;)OJ(e);DJ(e)}function LJ(e,n){return n>=e?{diff:n-e,group:0}:{diff:e-n,group:1}}function IJ(e,n,t,o,r){!e.set||t>e.diff?(e.diff=t,e.set=!0,e.chosen=n,e.group=o):t===e.diff&&r.count[o]<r.count[e.group]&&(e.chosen=n,e.group=o)}function OJ(e){let n=e.split.partitions[0],t={set:!1,diff:0n,chosen:0,group:0};for(let o=0;o<ie+1;o++)if(!n.taken[o]){let r=e.split.branchBuf[o].rect,i=ix(ro(At(r,n.cover[0])),n.area[0]),s=ix(ro(At(r,n.cover[1])),n.area[1]),{diff:l,group:a}=LJ(i,s);IJ(t,o,l,a,n)}f1(e,t.chosen,t.group)}function DJ(e){let n=e.split.partitions[0];if(n.count[0]+n.count[1]>=ie+1)return;let t=0;n.count[0]>=ie+1&&(t=1);for(let o=0;o<ie+1;o++)n.taken[o]||f1(e,o,t)}function BJ(e,n,t,o){let r=n.level;AJ(e,n,t),MJ(e),o.value=vu(),o.value.level=n.level=r,GJ(e,n,o.value)}lv(BJ);function FJ(e,n){return{leaf:n,next:e}}function zJ(e,n){if(!e)return n;if(!n)return e;let t=e;for(;t.next;)t=t.next;return t.next=n,e}function jJ(e){let n=[];for(let t=e;t!==null;t=t.next)n.push(t.leaf);return n}function fv(){return{root:HJ(),split:ov()}}function dv(e){if(e.level>0)for(let n=0;n<ie;n++)e.branch[n].child&&(dv(e.branch[n].child),rx(e,n));else for(let n=0;n<ie;n++)e.branch[n].child&&rx(e,n)}function cv(e){e.root&&(dv(e.root),e.root=null)}function HJ(){let e=vu();return e.level=0,e}function VJ(e,n){let t=null;for(let o=0;o<ie;o++)if(e.branch[o].child&&Eu(n,e.branch[o].rect)){let r=pv(e.branch[o].child,n);t=zJ(t,r)}return t}function UJ(e,n){let t=null;for(let o=0;o<ie;o++)e.branch[o].child&&Eu(n,e.branch[o].rect)&&(t=FJ(t,{rect:e.branch[o].rect,data:e.branch[o].child}));return t}function pv(e,n){return e.level>0?VJ(e,n):UJ(e,n)}function mv(e,n,t){return jJ(pv(n,t))}function XJ(e,n,t){let o={value:null},r=iv(e.r,n);if(!xv(e,n.branch[r].child,o))return n.branch[r].rect=At(e.r,n.branch[r].rect),0;n.branch[r].rect=Su(n.branch[r].child);let i={rect:Su(o.value),child:o.value};return yr(e.rtp,i,n,t)}function xv(e,n,t){return n.level>e.level?XJ(e,n,t):n.level===e.level?yr(e.rtp,{rect:e.r,child:e.data},n,t):0}function $J(e){for(let n=0;n<2;n++)if(e.boundary[n]>e.boundary[2+n])throw new Error("rTreeInsert: rect low > high")}function WJ(e,n){let t=vu();t.level=e.root.level+1,yr(e,{rect:Su(e.root),child:e.root},t,{value:null}),yr(e,{rect:Su(n),child:n},t,{value:null}),e.root=t}function hv(e,n,t){$J(n);let o={value:null};return xv({rtp:e,r:n,data:t,level:0},e.root,o)?(WJ(e,o.value),1):0}function bv(e,n){e.left=n.right,n.right=e}function gv(e,n){e.right=n.left,n.left=e}function d1(e){let n=e,t;for(;(t=n.left)!==null;)bv(n,t),n=t;return n}function c1(e){let n=e,t;for(;(t=n.right)!==null;)gv(n,t),n=t;return n}function yv(e,n,t){return t<0?(e.left=n.left,e.right=n,n.left=null):(e.right=n.right,e.left=n,n.right=null),e}function p1(e,n,t,o){let r={left:null,right:null,obj:void 0},i=r,s=r,l=e;e:for(;l!==null;){let d=o(n,t(l.obj));if(d===0)break;if(d<0){let c=l.left;if(c!==null){let m=o(n,t(c.obj));if(m<0)bv(l,c),s.left=c,s=c,l=c.left;else if(m===0){s.left=l,s=l,l=c;break e}else i.right=c,i=c,s.left=l,s=l,l=c.right;if(l===null)break}else{s.left=l,s=l,l=null;break}}else{let c=l.right;if(c!==null){let m=o(n,t(c.obj));if(m>0)gv(l,c),i.right=c,i=c,l=c.right;else if(m===0){i.right=l,i=l,l=c;break e}else s.left=c,s=c,i.right=l,i=l,l=c.left;if(l===null)break}else{i.right=l,i=l,l=null;break}}}if(l!==null)return i.right=l.left,s.left=l.right,l.left=r.right,l.right=r.left,l;s.left=null,i.right=null;let a=r.right,u=r.left;if(a===null)return d1(u);let f=c1(a);return u===null||(f.right=u),f}function YJ(e,n){return e.left=n.left,n.left=null,e.right=n,e}function JJ(e,n,t,o,r){let i=e,s=null;for(;i!==null;){if(i.obj===n)return[i,s];if(r(t,o(i.obj))!==0)return[null,null];s=i,i=i.left}return[null,null]}function KJ(e,n,t){let o=n.left,r=n.right,i;if(o===null)i=r;else{let s=c1(o);s.right=r,i=s}return t===null?i:(t.left=i,e)}var m1=class{_root=null;_size=0;_keyOf;_compare;constructor(n,t){this._keyOf=n,this._compare=t}size(){return this._size}insert(n){let t={left:null,right:null,obj:n};if(this._root===null)return this._root=t,this._size++,n;let o=this._keyOf(n);this._root=p1(this._root,o,this._keyOf,this._compare);let r=this._compare(o,this._keyOf(this._root.obj));return this._root=r===0?YJ(t,this._root):yv(t,this._root,r),this._size++,n}delete(n){if(this._root===null)return!1;let t=this._keyOf(n);if(this._root=p1(this._root,t,this._keyOf,this._compare),this._compare(t,this._keyOf(this._root.obj))!==0)return!1;let[o,r]=JJ(this._root,n,t,this._keyOf,this._compare);if(o===null)return!1;let i=KJ(this._root,o,r);return this._root=i,this._size--,!0}first(){if(this._root!==null)return this._root=d1(this._root),this._root.obj}next(n){if(this._root===null)return;let t=this._keyOf(n);if(this._root=p1(this._root,t,this._keyOf,this._compare),this._compare(t,this._keyOf(this._root.obj))<0)return this._root.obj;let r=this._root.right;if(r===null)return;let i=d1(r);return this._root.right=null,i.left=this._root,this._root=i,i.obj}last(){if(this._root!==null)return this._root=c1(this._root),this._root.obj}clear(){this._root=null,this._size=0}[Symbol.iterator](){let n=this.first(),t=this;return{next(){if(n===void 0)return{value:void 0,done:!0};let o=n;return n=t.next(o),{value:o,done:!1}}}}};function Pv(e,n,t){let o=e|0,r=n|0,i=0;for(let s=t-1;s>=0;s--){let l=o>>s&1,a=r>>s&1;i=4*i+2*l+(l^a)>>>0;let u=a-1|0,f=(-l|0)&u;o=o^r|0,r=r^o&u|0,o=o^r|0,o=o^f|0,r=r^f|0}return i}function wu(e,n){if(!Eu(e,n))return 0;let t=Math.max(e.boundary[0],n.boundary[0]),o=Math.max(e.boundary[1],n.boundary[1]),r=Math.min(e.boundary[2],n.boundary[2]),i=Math.min(e.boundary[3],n.boundary[3]);return(r-t)*(i-o)}function sx(e){return{boundary:[A(e.pos.x),A(e.pos.y),A(e.pos.x+e.sz.x),A(e.pos.y+e.sz.y)]}}function x1(e){let n=e.lbl;return{boundary:[A(n.pos.x),A(n.pos.y),A(n.pos.x+n.sz.x),A(n.pos.y+n.sz.y)]}}function Ev(e){let n=e.lbl?e.lbl.sz:{x:0,y:0};return{boundary:[Math.floor(e.pos.x-n.x),Math.floor(e.pos.y-n.y),Math.ceil(e.pos.x+e.sz.x+n.x),Math.ceil(e.pos.y+e.sz.y+n.y)]}}function vv(e,n){let t=e.lbl;return t?n.pos.x>t.pos.x&&n.pos.x<t.pos.x+t.sz.x&&n.pos.y>t.pos.y&&n.pos.y<t.pos.y+t.sz.y:!1}var qJ=8,QJ=2,ZJ=9,Nu=0,lx=1,wv=2,ax=3,Tu=5,Nv=6,ux=7,Ru=8;function Sv(e,n){return n<e?-1:n>e?1:0}function eK(e,n){return n<e?ax:n>e?Tu:-1}function nK(e){return e===-1?Nu:e===1?wv:lx}function tK(e){return e===-1?Nv:e===1?Ru:ux}function Rv(e,n){let t=e.lbl,o=n.lbl;return t.set===0||o.set===0||e.pos.x===0&&e.pos.y===0||n.pos.x===0&&n.pos.y===0?-1:n.pos.y<e.pos.y?nK(Sv(e.pos.x,n.pos.x)):n.pos.y>e.pos.y?tK(Sv(e.pos.x,n.pos.x)):eK(e.pos.x,n.pos.x)}function Tv(e,n,t){let o=0,r=wu(n,sx(e));if(r>t&&(o=r),e.lbl){let i=wu(n,x1(e));i>t&&(o=Math.max(i,o))}return{maxa:o,replace:o===0}}function oK(e,n,t,o,r){let i=Rv(e,n);if(i<0&&(i=Tu),r[i]!==null){let{maxa:s,replace:l}=Tv(r[i],t,o);return l?(r[i]=n,o):s}return r[i]=n,o}function rK(e,n,t,o,r){let i=Rv(e,n);if(i<0&&(i=Tu),r[i]!==null){let{maxa:s,replace:l}=Tv(r[i],t,o);return l?(r[i]=n,o):s}return r[i]=n,o}function iK(e,n,t,o,r){if(t===e)return;let i=wu(n,sx(t));if(i>0&&(o.n++,o.area+=oK(e,t,n,i,r)),!t.lbl||!t.lbl.set)return;let s=wu(n,x1(t));s>0&&(o.n++,o.area+=rK(e,t,n,s,r))}function kv(e,n,t){let o={n:0,area:0,pos:{...n.lbl.pos}};for(let s=0;s<e.nObjs;s++){let l=e.objs[s];l===n||l.sz.x>0&&l.sz.y>0||vv(n,l)&&o.n++}let r=x1(n),i=mv(e.spdx,e.spdx.root,r);for(let s of i)iK(n,r,s.data,o,t);return o}function ku(e,n,t,o,r,i){let s=n.lbl;s.pos.x=t,s.pos.y=o;let l=kv(e,n,i);return l.n===0?{bp:l,done:!0}:{bp:l.area<r.area?l:r,done:!1}}function sK(e,n,t,o,r){let i=n.lbl,s=n.pos.y+n.sz.y;for(let l=n.pos.x-i.sz.x;l<=n.pos.x+n.sz.x;l+=t){let a=ku(e,n,l,s,o,r);if(o=a.bp,a.done)return{bp:o,done:!0}}return{bp:o,done:!1}}function lK(e,n,t,o,r){let i=n.lbl,s=n.pos.x-i.sz.x;for(let l=n.pos.y+n.sz.y;l>=n.pos.y-i.sz.y;l-=t){let a=ku(e,n,s,l,o,r);if(o=a.bp,a.done)return{bp:o,done:!0}}return{bp:o,done:!1}}function aK(e,n,t,o,r){let i=n.lbl,s=n.pos.y-i.sz.y;for(let l=n.pos.x+n.sz.x;l>=n.pos.x-i.sz.x;l-=t){let a=ku(e,n,l,s,o,r);if(o=a.bp,a.done)return{bp:o,done:!0}}return{bp:o,done:!1}}function uK(e,n,t,o,r){let i=n.lbl,s=n.pos.x+n.sz.x;for(let l=n.pos.y-i.sz.y;l<=n.pos.y+n.sz.y;l+=t){let a=ku(e,n,s,l,o,r);if(o=a.bp,a.done)return{bp:o,done:!0}}return{bp:o,done:!1}}function fK(e,n,t,o,r,i){if(!i[ux]&&!i[Ru]){let s=sK(e,n,t,r,i);if(r=s.bp,s.done)return{bp:r,done:!0}}if(!i[ax]&&!i[Nu]){let s=lK(e,n,o,r,i);if(r=s.bp,s.done)return{bp:r,done:!0}}return{bp:r,done:!1}}function dK(e,n,t,o,r,i){if(!i[lx]&&!i[Nu]){let s=aK(e,n,t,r,i);if(r=s.bp,s.done)return{bp:r,done:!0}}if(!i[Tu]&&!i[Ru]){let s=uK(e,n,o,r,i);if(r=s.bp,s.done)return{bp:r,done:!0}}return{bp:r,done:!1}}function cK(e,n,t,o){let r=n.lbl,i=n.pos.x-r.sz.x,s=n.pos.x,l=n.pos.x+n.sz.x,a=n.pos.y+n.sz.y,u=n.pos.y,f=n.pos.y-r.sz.y,d=[[i,u],[i,f],[s,a],[s,f],[l,a],[l,u],[l,f]];for(let[c,m]of d){let b=ku(e,n,c,m,t,o);if(t=b.bp,b.done)return{bp:t,done:!0}}return{bp:t,done:!1}}function Cv(e,n){let t=n.lbl,o=(2*t.sz.x+n.sz.x)/qJ,r=(2*t.sz.y+n.sz.y)/QJ,i=new Array(ZJ).fill(null);t.pos.x=n.pos.x-t.sz.x,t.pos.y=n.pos.y+n.sz.y;let s=kv(e,n,i);if(s.n===0)return s;{let u=cK(e,n,s,i);if(s=u.bp,u.done)return s}if(i[Nv]||i[ux]||i[Ru]||i[ax]||i[Nu]){let u=fK(e,n,o,r,s,i);if(s=u.bp,u.done)return s}if(t.pos.x=n.pos.x+n.sz.x,t.pos.y=n.pos.y-t.sz.y,i[wv]||i[lx]||i[Nu]||i[Tu]||i[Ru]){let u=dK(e,n,o,r,s,i);if(s=u.bp,u.done)return s}return s}function pK(e){let n=Math.max(e.params.bb.ur.x,e.params.bb.ur.y);return Math.floor(Math.log2(A(n)))+1}function mK(e,n,t){return{objs:e,nObjs:e.length,lbls:n,nLbls:n.length,params:t,hdx:new m1(o=>o.key,(o,r)=>o-r),spdx:fv()}}function xK(e){cv(e.spdx)}function hK(e){let n=pK(e);for(let t=0;t<e.nObjs;t++){let o=e.objs[t],r=Ev(o),i=r.boundary[0]+(r.boundary[2]-r.boundary[0])/2,s=r.boundary[1]+(r.boundary[3]-r.boundary[1])/2,l=Pv(Math.trunc(i),Math.trunc(s),n)|0;e.hdx.insert({key:l,d:{rect:r,data:o}})}return 0}function bK(e){e.hdx.clear()}function gK(e){for(let n of e.hdx)hv(e.spdx,n.d.rect,n.d.data)}function yK(e){let n=hK(e);return n<0?n:(gK(e),bK(e),0)}function PK(e,n,t){return n.n===0?(e.lbl.set=1,0):n.area===0||t?(e.lbl.pos=n.pos,e.lbl.set=1,0):1}function _v(e,n,t){let o=mK(e,n,t),r=yK(o);if(r<0)return r;let i=0;for(let s=0;s<e.length;s++){if(e[s].lbl===null)continue;let l=Cv(o,e[s]);i|=PK(e[s],l,t.force)}return xK(o),i}function Av(e){let n=e;if(n&&typeof n.pos=="object"&&typeof n.dimen=="object")return n}function EK(e){let n=e;for(;n&&(n.info.edge_type??0)!==0;)n=n.info.to_orig;return n}function vK(e,n){let o=!!e.root?.info.flip?n.dimen.y:n.dimen.x;return e.info.coord.x+o/2}function Gv(e){if((e.info.in?.size??0)===0)return;let n=e.info.out?.list[0];if(!n)return;let t=EK(n);if(!t)return;let o=Av(t.info.label);o&&(o.pos.x=vK(e,o),o.pos.y=e.info.coord.y,o.set=!0)}function SK(e){let n=e.info.posAlg;if(!n)return;let t=Av(n.info.label);t&&(t.pos={x:e.info.coord.x,y:e.info.coord.y},t.set=!0)}function Mv(e){for(let n=e.info.nlist;n;n=n.info.next){if((n.info.node_type??0)!==U)continue;let t;n.info.posAlg?(SK(n),t=n.info.posAlg.info.label):n.info.label&&(Gv(n),t=n.info.label),t&&un(e,t)}}var wK=10,NK=-25;function Lv(e,n){let t=e[0],o=e[1],r=e[2],i=e[3],s=1-n,l={x:s*t.x+n*o.x,y:s*t.y+n*o.y},a={x:s*o.x+n*r.x,y:s*o.y+n*r.y},u={x:s*r.x+n*i.x,y:s*r.y+n*i.y},f={x:s*l.x+n*a.x,y:s*l.y+n*a.y},d={x:s*a.x+n*u.x,y:s*a.y+n*u.y};return{x:s*f.x+n*d.x,y:s*f.y+n*d.y}}function RK(e){if(e.sflag)return{pe:e.sp,pf:e.list[0]};let n=e.list[0],t=Lv(e.list,.1);return{pe:n,pf:t}}function TK(e){if(e.eflag)return{pe:e.ep,pf:e.list[e.size-1]};let n=e.list[e.size-1],t=e.list.slice(e.size-4,e.size),o=Lv(t,.9);return{pe:n,pf:o}}function Cu(e,n){return kK(e)||CK(e)||_K(e,n)||AK(e)?!1:GK(e,n)}function kK(e){let n=e.info.edge_type;return n===void 0?!1:n===$n}function CK(e){let n=e.attrs.get("labelangle"),t=e.attrs.get("labeldistance");return!(n!==void 0&&n!==""||t!==void 0&&t!=="")}function _K(e,n){return n?e.info.head_label===void 0:e.info.tail_label===void 0}function AK(e){return e.info.spl===void 0?!0:e.info.spl.list.length===0}function GK(e,n){let t=e.info.spl,o=n?TK(t.list[t.size-1]):RK(t.list[0]),r=n?e.info.head_label:e.info.tail_label,i=e.attrs.get("labelangle")??"",s=e.attrs.get("labeldistance")??"";return MK(r,o.pe,o.pf,i,s),!0}function MK(e,n,t,o,r){let i=V(o,NK,-180),s=Math.atan2(t.y-n.y,t.x-n.x)+Math.PI/180*i,l=V(r||void 0,1,0),a=wK*l;e.pos.x=n.x+a*Math.cos(s),e.pos.y=n.y+a*Math.sin(s),e.set=!0}function un(e,n){let t=e.info.bb,o=e.info.flip===!0,r=(o?n.dimen.y:n.dimen.x)/2,i=(o?n.dimen.x:n.dimen.y)/2;n.pos.x-r<t.ll.x&&(t.ll.x=n.pos.x-r),n.pos.y-i<t.ll.y&&(t.ll.y=n.pos.y-i),n.pos.x+r>t.ur.x&&(t.ur.x=n.pos.x+r),n.pos.y+i>t.ur.y&&(t.ur.y=n.pos.y+i)}function _u(e){for(let n=e.info.nlist;n;n=n.info.next){if((n.info.node_type??0)!==U)continue;let t=n.info.label;t&&(Gv(n),t.set&&un(e,t))}}function h1(e,...n){let t=e.root;for(let o of n)if(t.attrs.has(o))return!0;for(let o of t.edges)for(let r of n)if(o.attrs.has(r))return!0;return!1}function fx(e){h1(e,"headlabel","taillabel")&&h1(e,"labelangle","labeldistance")&&(h1(e,"headlabel")&&LK(e),h1(e,"taillabel")&&IK(e))}function LK(e){for(let n of M(e))for(let t of e.edges)t.head===n&&t.info.head_label!==void 0&&Cu(t,!0)&&un(e,t.info.head_label)}function IK(e){for(let n of M(e))for(let t of e.edges)t.tail===n&&t.info.tail_label!==void 0&&Cu(t,!1)&&un(e,t.info.tail_label)}var b1=72,Iv=.001;function OK(e){return{x:e.pos.x+e.sz.x/2,y:e.pos.y+e.sz.y/2}}function Dv(e,n){return{ll:{x:Math.min(n.ll.x,e.pos.x),y:Math.min(n.ll.y,e.pos.y)},ur:{x:Math.max(n.ur.x,e.pos.x+e.sz.x),y:Math.max(n.ur.y,e.pos.y+e.sz.y)}}}function Bv(e,n,t,o){let r=n.objs[n.oi],i=n.lbls[n.xi];t&&(r.pos={x:o.x,y:o.y},r.sz={x:0,y:0},r.lbl=null),i.sz=n.flip?{x:e.dimen.y,y:e.dimen.x}:{x:e.dimen.x,y:e.dimen.y},i.lbl=e,i.set=0,r.lbl=i,n.xi++}function dx(e,n,t,o){return n.sz=o?{x:e.dimen.y,y:e.dimen.x}:{x:e.dimen.x,y:e.dimen.y},n.pos={x:e.pos.x-n.sz.x/2,y:e.pos.y-n.sz.y/2},n.lbl=null,Dv(n,t)}function DK(e,n,t,o){let r=e.info.width??0,i=e.info.height??0;n.sz=o?{x:b1*i,y:b1*r}:{x:b1*r,y:b1*i};let s=e.info.coord??{x:0,y:0};return n.pos={x:s.x-n.sz.x/2,y:s.y-n.sz.y/2},n.lbl=null,Dv(n,t)}function Fv(e,n){let t=!n(e)&&e.info.label&&e.info.label.set?1:0,o=e.info.n_cluster??0,r=t;for(let i=1;i<=o;i++){let s=e.info.clust?.[i-1];s&&(r+=Fv(s,n))}return r}function zv(e,n,t,o,r){let i=e.info.n_cluster??0;for(let s=1;s<=i;s++){let l=e.info.clust?.[s-1];l&&(t=zv(l,n,t,o,r))}return!o(e)&&e.info.label&&e.info.label.set&&(t.bb=dx(e.info.label,n[t.objpIdx],t.bb,r),t.objpIdx++),t}function cx(e){let n=e;for(;!n.info.spl&&n.info.edge_type!==0;){let t=n.info.to_orig;if(!t)break;n=t}return n.info.spl??null}function BK(e){let n=cx(e);if(!n)return{x:0,y:0};let t=n.list[0];return t.sflag?{x:t.sp.x,y:t.sp.y}:{x:t.list[0].x,y:t.list[0].y}}function FK(e){let n=cx(e);if(!n)return{x:0,y:0};let t=n.list[n.list.length-1];if(t.eflag)return{x:t.ep.x,y:t.ep.y};let o=t.list;return{x:o[o.length-1].x,y:o[o.length-1].y}}function Ov(e,n){let t=cx(n);if(!t||t.list.length===0)return{x:0,y:0};let{p:o,q:r}=mE(t);if(oo(o,r)<Iv*Iv)return{x:o.x,y:o.y};let i=ht(e);return i===an||i===Pr?Zc(t,{x:(o.x+r.x)/2,y:(o.y+r.y)/2}):pE(t)}function jv(e,n){return e!==Kn&&n.info.spl!==void 0}function zK(e,n){un(e,n)}function jK(e,n){let t=0,o=0,r=i=>{i&&(i.set?o++:jv(n,e)&&t++)};return r(e.info.label),r(e.info.tail_label),r(e.info.head_label),r(e.info.xlabel),{nElbls:t,nSetLbls:o}}function g1(e,n,t,o,r){e&&(e.set?(o.bb=dx(e,o.objs[o.oi],o.bb,o.flip),o.oi++):jv(t,n)&&(Bv(e,o,!0,r()),o.oi++))}function HK(e,n,t,o){g1(n.info.label,n,t,o,()=>Ov(e,n)),g1(n.info.tail_label,n,t,o,()=>BK(n)),g1(n.info.head_label,n,t,o,()=>FK(n)),g1(n.info.xlabel,n,t,o,()=>Ov(e,n))}function VK(e,n){let t=0,o=0,r=0;for(let i of M(e)){let s=i.info.xlabel;s&&(s.set?r++:t++);for(let l of i.outEdges(e)){let a=jK(l,n);o+=a.nElbls,r+=a.nSetLbls}}return{nNlbls:t,nElbls:o,nSetLbls:r}}function UK(e,n,t,o,r){let i=Array.from({length:n},()=>({pos:{x:0,y:0},sz:{x:0,y:0},lbl:null})),s=Array.from({length:t},()=>({sz:{x:0,y:0},pos:{x:0,y:0},lbl:null,set:0})),l=e.info.flip??!1,a={objs:i,lbls:s,flip:l,oi:0,xi:0,bb:{ll:{x:Number.MAX_VALUE,y:Number.MAX_VALUE},ur:{x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}}};for(let u of M(e)){a.bb=DK(u,i[a.oi],a.bb,l);let f=u.info.xlabel;f&&(f.set?(a.oi++,a.bb=dx(f,i[a.oi],a.bb,l)):Bv(f,a,!1,{x:0,y:0})),a.oi++;for(let d of u.outEdges(e))HK(e,d,r,a)}if(o){let u=zv(e,i,{bb:a.bb,objpIdx:a.oi},f=>f===e,l);a.bb=u.bb}return{ctx:a}}function XK(e,n,t){for(let o=0;o<t;o++){let r=n[o];if(r.set){let i=r.lbl;i.set=!0,i.pos=OK(r),zK(e,i)}}}var $K=pc|mc|cc|dc;function WK(e){let n=e.info.has_labels??0;return n&$K?!0:!!(n&on)&&!(e.info.edgeLabelsDone??!1)}function YK(e){let n=e.info.has_labels??0,t=ht(e),{nNlbls:o,nElbls:r,nSetLbls:i}=VK(e,t),s=n&D2?Fv(e,m=>m===e):0,l=o+r;if(l===0)return;let a=e.nodes.size+i+s+r,{ctx:u}=UK(e,a,l,s,t),f=e.attrs.get("forcelabels"),d=f===void 0?!0:Ne(f),c={bb:{ll:u.bb.ll,ur:u.bb.ur},force:d};_v(u.objs,u.lbls,c),XK(e,u.lbls,l)}function Hv(e){WK(e)&&YK(e)}var JK=6,Er=0,Au={x:0,y:0};function io(e){let n=Yo(e,Er*90);return{x:n.x-Au.x,y:n.y-Au.y}}function Nl(e){let n=e;n?.pos!==void 0&&(n.pos=io(n.pos))}function KK(e){for(let n=0;n<e.list.length;n++)e.list[n]=io(e.list[n]);e.sflag&&(e.sp=io(e.sp)),e.eflag&&(e.ep=io(e.ep))}function qK(e){for(let n=0;n<e.list.length;n++)KK(e.list[n])}function Vv(e){if(!e)return e;let n=Er===ft||Er===dt;return e.map(t=>{let o=js(t,io);return n&&o.kind==="polygon"?{...o,points:[...o.points].reverse()}:o})}function QK(e){let n=e.info.spl;n!==void 0&&(qK(n),Nl(e.info.label),Nl(e.info.xlabel),Nl(e.info.head_label),Nl(e.info.tail_label),e.info.headArrowOps=Vv(e.info.headArrowOps),e.info.tailArrowOps=Vv(e.info.tailArrowOps))}function ZK(e,n){return n===ut||n===ft?{ll:io({x:e.ll.x,y:e.ur.y}),ur:io({x:e.ur.x,y:e.ll.y})}:{ll:io({x:e.ll.x,y:e.ll.y}),ur:io({x:e.ur.x,y:e.ur.y})}}function Uv(e,n){e.info.bb=ZK(e.info.bb,n),Nl(e.info.label);let t=e.info.n_cluster??0,o=e.info.clust;for(let r=1;r<=t;r++)o?.[r-1]&&Uv(o[r-1],n)}function eq(e){let n=e.info.width!==void 0?e.info.width*72:(e.info.lw??0)+(e.info.rw??0),t=e.info.height!==void 0?e.info.height*72:e.info.ht??0,o=go(n,t,!1);e.info.lw=o.lw,e.info.rw=o.rw,e.info.ht=o.ht}function nq(e){Er&&eq(e),e.info.coord=io(e.info.coord??{x:0,y:0}),Nl(e.info.xlabel)}function tq(e){if(!(!(Au.x!==0||Au.y!==0)&&!Er)){for(let t of e.nodes.values()){nq(t);for(let o of e.edges)if(o.tail===t){if(o.info.spl===void 0){!(e.info.concentrate??!1)&&(o.info.edge_type??0)!==JK&&console.warn(`lost ${o.tail.name} ${o.head.name} edge`);continue}QK(o)}}Uv(e,e.info.rankdir&3)}}function oq(e,n){switch(n){case xi:return{x:e.ll.x,y:e.ll.y};case ut:return{x:-e.ur.y,y:e.ll.x};case ft:return{x:e.ll.x,y:-e.ur.y};case dt:return{x:e.ll.y,y:e.ll.x};default:return{x:0,y:0}}}var rq=0,y1=1,Xv=2,$v=4,iq=16,sq=8;function Wv(e){let n=e.attrs.get("labelloc"),t=n&&n[0]==="t"?y1:rq,o=e.attrs.get("labeljust");return o&&(o[0]==="l"?t|=Xv:o[0]==="r"&&(t|=$v)),t}function lq(e){let n=e.info.label;if(!n||n.set)return{x:0,y:0};let t={x:n.dimen.x+iq,y:n.dimen.y+sq},o=Wv(e),r=e.info.flip??!1,i=e.info.bb;return r?aq(i,t,o):fq(i,t,o,Er),t}function aq(e,n,t){t&y1?e.ur.x+=n.y:e.ll.x-=n.y;let o=e.ur.y-e.ll.y;if(n.x>o){let r=(n.x-o)/2;e.ll.y-=r,e.ur.y+=r}}function uq(e,n,t,o){t&y1?o===xi?e.ur.y+=n:e.ll.y-=n:o===xi?e.ll.y-=n:e.ur.y+=n}function fq(e,n,t,o){uq(e,n.y,t,o);let r=e.ur.x-e.ll.x;if(n.x>r){let i=(n.x-r)/2;e.ll.x-=i,e.ur.x+=i}}function dq(e,n,t){return n&$v?e.ur.x-t/2:n&Xv?e.ll.x+t/2:(e.ll.x+e.ur.x)/2}function cq(e,n,t){return n&y1?e.ur.y-t/2:e.ll.y+t/2}function pq(e,n){let t=e.info.label;if(!t)return;let o=Wv(e),r=e.info.bb;t.pos={x:dq(r,o,n.x),y:cq(r,o,n.y)},t.set=!0}function Me(e,n=!0){Er=e.info.rankdir&3,Hv(e);let t=lq(e);n&&(Au=oq(e.info.bb,Er),tq(e));let o=e.info.label;o&&!o.set&&pq(e,t)}function mq(e){let n=new $e("auxg",e.kind);return n.info.nodesep=e.info.nodesep,n.info.ranksep=e.info.ranksep,n.info.flags=e.info.flags,e.info.flip?(n.info.rankdir=0,n.info.flip=!1):(n.info.rankdir=5,n.info.flip=!0),n.info.dotroot=n,n.info.gvc=e.info.gvc,n}function Yv(e){let n=e;for(;(n.info.edge_type??B)!==B&&n.info.to_orig!=null;)n=n.info.to_orig;return n}function xq(e){return!e.info.tail_port.defined&&!e.info.head_port.defined}function hq(e,n,t,o,r){return r.tail===n?ex(e,t,o,r):ex(e,o,t,r)}function px(e){let n=e[0].tail,t=e[0].head;return(n.info.order??0)<(t.info.order??0)?{tn:n,hn:t}:{tn:t,hn:n}}function bq(e,n,t){let{tn:o,hn:r}=px(n),i=e.info.flip??!1,s=i?r:o,l=mq(e),a=Z5(l,s),u=Z5(l,i?o:r),f=new Map,d=null;for(let c=0;c<t;c++){let m=Yv(n[c]),b=hq(l,s,a,u,m);f.set(m,b),d===null&&xq(m)&&(d=b)}return d===null&&(d=new Ae(a,u,""),l.edges.push(d)),d.info.weight=1e4,{auxg:l,auxt:a,auxh:u,alg:f}}function gq(e){if(e===null)return!1;let n=e.info.node_type??B;return n===B||n===U&&e.info.label!=null}function yq(e,n,t){for(let o=n+1;o<t;o++)if(gq(e[o]??null))return!1;return!0}function Pq(e,n,t){let{tn:o,hn:r}=px(n),i=e.info.flip??!1,s=r.info.coord.x,l=o.info.coord.x,a=i?r:o,u=i?o:r,f=(a.info.coord.x-a.info.rw+u.info.coord.x+u.info.lw)/2,d=(t.auxt.info.coord.x+t.auxh.info.coord.x)/2;for(let c=t.auxg.info.nlist;c;c=c.info.next)c===t.auxt?c.info.coord={x:d,y:s}:c===t.auxh?c.info.coord={x:d,y:l}:c.info.coord={x:c.info.coord.x,y:f}}function Eq(e,n,t,o){let r=a=>a.map(u=>js(u,f=>Sl(f,t,o))),i=n.info.spl?.list[0]?.eflag,s=n.info.headArrowOps??(i?n.info.tailArrowOps:void 0);s!==void 0&&(e.info.headArrowOps=r(s));let l=n.info.headArrowOps===void 0&&i;n.info.tailArrowOps!==void 0&&!l&&(e.info.tailArrowOps=r(n.info.tailArrowOps))}function vq(e,n,t,o,r){let i=e.info.label,s=n.info.label;i===void 0||s===void 0||!s.set||(i.pos=Sl(s.pos,t,o),i.set=!0,r.info.bb!==void 0&&un(r,i))}function Sq(e,n,t,o,r){let i=n.info.spl?.list[0];if(i===void 0)return;let s=i.size,l=Ja(e,s);l.sflag=i.sflag,l.eflag=i.eflag,l.sp=Sl(i.sp,t,o),l.ep=Sl(i.ep,t,o);for(let u=0;u<s;u++)l.list[u]=Sl(i.list[u],t,o);let a=r.info.bb;if(a!==void 0)for(let u=0;u+3<s;u+=3)wt(a,[l.list[u],l.list[u+1],l.list[u+2],l.list[u+3]]);Eq(e,n,t,o),vq(e,n,t,o,r)}function wq(e,n,t){let{tn:o,hn:r}=px(n),i=e.info.flip??!1,s=i?r:o,l=t.auxt.info.coord,a=i?{x:s.info.coord.x-l.y,y:s.info.coord.y+l.x}:{x:s.info.coord.x-l.x,y:s.info.coord.y-l.y};for(let u=0;u<n.length;u++){let f=Yv(n[u]),d=t.alg.get(f);d!==void 0&&(Sq(f,d,a,i,e),Nq(f,d))}}function Nq(e,n){e.info.spl!==void 0&&En(n)!==En(e)&&On(e)}function Jv(e,n,t,o){let r=bq(e,n,t);return au(r.auxg),ll(r.auxg),xl(r.auxg)!==0||bl(r.auxg)!==0?1:(Pq(e,n,r),Qc(r.auxg),mx(r.auxg,!1),_u(r.auxg),Me(r.auxg),wq(e,n,r),nv(r.auxg),0)}function ki(e,n){let t=n.tail.info.rank;if(t===void 0||n.head.info.rank!==t)return!1;let o=e.info.rank?.[t];if(o===void 0)return!1;let r=n.tail.info.order??0,i=n.head.info.order??0;return yq(o.v,Math.min(r,i),Math.max(r,i))}function Rl(e){let{ctx:n,P:t,e:o,n:r,side:i,ranksep:s,isBegin:l}=e,a=gr(br(n,r,void 0,o));a.sidemask=i;let u={P:t,e:o,et:2,endp:a,merge:!1,ranksep:s};l?vi(u):Si(u);let d=n.g.info.rank[r.info.rank].ht2,c=i===4?r.info.coord.y+d:r.info.coord.y-d;return Ni(a.nb,a,i,c),a}function Kv(e,n,t,o,r){let i={ll:{x:e.ll.x,y:e.ur.y},ur:{x:e.ur.x+t,y:e.ur.y+o}},s={ll:{x:e.ll.x,y:i.ur.y},ur:{x:n.ur.x,y:i.ur.y+r}},l={ll:{x:n.ll.x-t,y:n.ur.y},ur:{x:n.ur.x,y:i.ur.y}};return[i,s,l]}function qv(e,n,t,o,r){let i={ll:{x:e.ll.x,y:e.ll.y-o},ur:{x:e.ur.x+t,y:e.ll.y}},s={ll:{x:e.ll.x,y:i.ll.y-r},ur:{x:n.ur.x,y:i.ll.y}},l={ll:{x:n.ll.x-t,y:i.ll.y},ur:{x:n.ur.x,y:n.ll.y}};return[i,s,l]}function Qv(e,n,t){let o=e.info.rank,r=n.info.rank;if(t){if(r<=0)return Gn(e);let s=(e.root.info.has_labels&on)!==0?r-2:r-1,l=s>=(e.info.minrank??0)?o[s]:void 0;return l===void 0||l.n===0?Gn(e):l.v[0].info.coord.y-l.ht1-n.info.coord.y-o[r].ht2}if(r>=(e.info.maxrank??0))return Gn(e);let i=o[r+1];return n.info.coord.y-o[r].pht1-(i.v[0].info.coord.y+i.pht2)}function P1(){return{start:ue(),end:ue(),nbox:0,boxes:[],data:null}}function E1(e){return{g:e,sp:{...xr(e),splinesep:Math.trunc((e.info.nodesep??18)/4)}}}function Zv(e){let n=yn(e.tail,e.head,e.info.tail_port).side??0,t=yn(e.head,e.tail,e.info.head_port).side??0,o=n===1&&t!==4||t===1&&n!==4;return{bottom:o,side:o?1:4}}function eS(e,n,t,o){for(let r=0;r<n.boxn;r++)pt(e,n.boxes[r]);for(let r of o)pt(e,r);for(let r=t.boxn-1;r>=0;r--)pt(e,t.boxes[r])}function nS(e,n){return!e.defined&&!n.defined?!0:!e.defined||!n.defined?!1:e.p.x===n.p.x&&e.p.y===n.p.y}function oS(e,n){return e.tail===n?{loP:e.info.tail_port,hiP:e.info.head_port}:{loP:e.info.head_port,hiP:e.info.tail_port}}function Rq(e,n){return e.info.spl===void 0&&e.tail.info.rank!==void 0&&e.tail.info.rank===e.head.info.rank&&!ki(n,e)}function Tq(e,n,t){let o=oS(e,n);return nS(o.loP,t.loP)&&nS(o.hiP,t.hiP)}function xx(e,n){let t=e.tail,o=e.head,r=(t.info.order??0)<=(o.info.order??0)?t:o,i=oS(e,r),s=a=>a.tail===t&&a.head===o||a.tail===o&&a.head===t,l=n.edges.filter(a=>s(a)&&Rq(a,n)&&Tq(a,r,i)&&a.info.label===e.info.label);return l.sort((a,u)=>+(u.tail===r)-+(a.tail===r)||a.seq-u.seq),l}function tS(e){return{...e,boxes:e.boxes.map(n=>({ll:{...n.ll},ur:{...n.ur}}))}}function kq(e,n,t){t.P.nbox=0;let o=(n+1)*t.stepx,r=(n+1)*t.stepy,i=t.bottom?qv(t.tlast,t.hlast,o,r,t.stepy):Kv(t.tlast,t.hlast,o,r,t.stepy);eS(t.P,tS(t.tend),tS(t.hend),i);let s=hr(t.P);return s===null||s.length===0?!1:(e.tail!==t.leftNode&&s.reverse(),Z(e,e.head,s,s.length,{...Ce(),ignoreSwap:!0}),!0)}function hx(e,n,t){let o=n[0];if(e.info.rank===void 0||o.tail.info.rank===void 0||o.head.info.rank!==o.tail.info.rank)return!1;let r=(o.tail.info.order??0)<=(o.head.info.order??0),i=r?o.tail:o.head,s=r?o.head:o.tail,l=r?o:{...o,tail:i,head:s,info:{...o.info,tail_port:o.info.head_port,head_port:o.info.tail_port}},{bottom:a,side:u}=Zv(l),f=E1(e),d=Gn(e),c=P1(),m=Rl({ctx:f,P:c,e:l,n:i,side:u,ranksep:d,isBegin:!0}),b=Rl({ctx:f,P:c,e:l,n:s,side:u,ranksep:d,isBegin:!1}),g=(e.info.nodesep??18)/(t+1),E=Qv(e,i,!a)/(t+1),R={P:c,tend:m,hend:b,tlast:m.boxes[m.boxn-1],hlast:b.boxes[b.boxn-1],bottom:a,stepx:g,stepy:E,leftNode:i};for(let N=0;N<t;N++)if(!kq(n[N],N,R))return!1;return!0}var so=6;function Cq(e){let n=e.info.to_virt;if(n===void 0)return null;for(;n.info.to_virt!==void 0;)n=n.info.to_virt;return n.tail}function _q(e,n,t){let o=e.info.rank[t.info.rank],r=(n.info.coord.y-o.ht1-t.info.coord.y+o.ht2)/6,i=n.info.coord.y+n.info.ht/2;return{ll:{x:n.info.coord.x-n.info.lw,y:i-Math.max(5,r)},ur:{x:n.info.coord.x+n.info.rw,y:i}}}function Aq(e,n,t){return[{ll:{x:e.ll.x,y:e.ur.y},ur:{x:t.ll.x,y:t.ll.y}},{ll:{x:e.ll.x,y:t.ll.y},ur:{x:n.ur.x,y:t.ur.y}},{ll:{x:t.ur.x,y:n.ur.y},ur:{x:n.ur.x,y:t.ll.y}}]}function Gq(e,n,t){let o=t.info.label,r=e.info.coord.x+t.info.tail_port.p.x,i=e.info.coord.y+t.info.tail_port.p.y,s=n.info.coord.x+t.info.head_port.p.x,l=n.info.coord.y+t.info.head_port.p.y,a=o.pos.x,u=o.pos.y-o.dimen.y/2;return[{x:r,y:i},{x:r,y:i},{x:a,y:u},{x:a,y:u},{x:a,y:u},{x:s,y:l},{x:s,y:l}]}function Mq(e,n,t,o){let r=n.tail,i=n.head,s=_q(e,t,r),l=E1(e),a=Gn(e),u=P1(),f=Rl({ctx:l,P:u,e:n,n:r,side:4,ranksep:a,isBegin:!0}),d=Rl({ctx:l,P:u,e:n,n:i,side:4,ranksep:a,isBegin:!1}),c=Aq(f.boxes[f.boxn-1],d.boxes[d.boxn-1],s);for(let m=0;m<f.boxn;m++)pt(u,f.boxes[m]);for(let m of c)pt(u,m);for(let m=d.boxn-1;m>=0;m--)pt(u,d.boxes[m]);return o===an?hr(u):yu(u)}function Lq(e){return e.info.label===void 0||(e.info.adjacent??0)!==0||e.tail.info.rank===void 0||e.tail.info.rank!==e.head.info.rank?null:Cq(e)}function rS(e,n){let t=Lq(n);if(t===null)return!1;let o=n.info.label;o.pos={x:t.info.coord.x,y:t.info.coord.y},o.set=!0;let r=ht(e);if(r===le){let a=Gq(n.tail,n.head,n);return a!==null&&a.length!==0&&Z(n,n.head,a,a.length,Ce()),!0}let i=(n.tail.info.order??0)<=(n.head.info.order??0),s=i?n:{...n,tail:n.head,head:n.tail,info:{...n.info,tail_port:n.info.head_port,head_port:n.info.tail_port}},l=Mq(e,s,t,r);return l===null||l.length===0||(i||l.reverse(),Z(n,n.head,l,l.length,{...Ce(),ignoreSwap:!0})),!0}function iS(e){if(e.tail.info.rank===void 0||e.tail.info.rank!==e.head.info.rank||e.info.tail_port.defined||e.info.head_port.defined)return!1;let n=e;for(;n.info.to_virt!==void 0&&n.info.to_virt!==n;)n=n.info.to_virt;return((n.tail===e.tail&&n.head===e.head||n.tail===e.head&&n.head===e.tail?n.info.adjacent:e.info.adjacent)??0)!==0}function Iq(e,n){let t=Gt(n),o=[];for(let r of e.edges)(r.tail===n.tail&&r.head===n.head||r.tail===n.head&&r.head===n.tail)&&iS(r)&&Gt(r)===t&&o.push(r);return o}function sS(e){let n=e[0].tail,t=e[0].head;return(n.info.order??0)<=(t.info.order??0)?{tn:n,hn:t}:{tn:t,hn:n}}function Oq(e,n){let t=e.info.label,o=n.info.label;return t===void 0?o===void 0?0:1:o===void 0?-1:t.dimen.x!==o.dimen.x?t.dimen.x>o.dimen.x?-1:1:t.dimen.y!==o.dimen.y?t.dimen.y>o.dimen.y?-1:1:0}function Dq(e,n,t,o){let r=to({ps:t},[e,n]);return r===null?null:o?no(r):Wn(hu([{ps:t}]),r,[{x:0,y:0},{x:0,y:0}])}function Bq(e,n,t,o,r){return[{x:e.x,y:e.y},{x:e.x,y:t-so},{x:n.x,y:t-so},{x:n.x,y:n.y},{x:r,y:n.y},{x:r,y:t},{x:o,y:t},{x:o,y:e.y}]}function Fq(e,n,t,o,r){return[{x:e.x,y:e.y},{x:o,y:e.y},{x:o,y:t},{x:r,y:t},{x:r,y:n.y},{x:n.x,y:n.y},{x:n.x,y:t+so},{x:e.x,y:t+so}]}function zq(e,n,t,o){if(n%2===1)return n===1&&o&&(e.lminx=e.ctrx-t.x/2,e.lmaxx=e.ctrx+t.x/2),n===1&&!o&&(e.lminx=(2*e.leftend+e.rightend)/3,e.lmaxx=(e.leftend+2*e.rightend)/3),e.miny-=so+t.y,{box:Bq(e.tp,e.hp,e.miny,e.lminx,e.lmaxx),ctry:e.miny+t.y/2};let r=Fq(e.tp,e.hp,e.maxy,e.uminx,e.umaxx),i=e.maxy+t.y/2+so;return e.maxy+=t.y+so,{box:r,ctry:i}}function lS(e,n,t){let o=e.info.label;o.pos={x:n,y:t},o.set=!0}function bx(e,n,t){Z(e,e.head,n,n.length,Ce()),En(e)&&On(e)}function jq(e,n,t,o){for(let r=1;r<e.length;r++){let i=r<n,s=i?e[r].info.label.dimen:{x:0,y:0},{box:l,ctry:a}=zq(t,r,s,i),u=Dq(t.tp,t.hp,l,o===vr);if(u===null||u.length===0)return;i&&lS(e[r],t.ctrx,a),bx(e[r],u,t.tn)}}function Hq(e,n){let t=be([...e],Oq),{tn:o,hn:r}=sS(e),i=t[0],s={x:o.info.coord.x+i.info.tail_port.p.x,y:o.info.coord.y+i.info.tail_port.p.y},l={x:r.info.coord.x+i.info.head_port.p.x,y:r.info.coord.y+i.info.head_port.p.y},a=s.x+o.info.rw,u=l.x-r.info.lw,f=(a+u)/2,d=t.filter(b=>b.info.label!==void 0).length,c=i.info.label.dimen;bx(i,[s,{...s},l,{...l}],o),lS(i,f,s.y+(c.y+so)/2);let m={miny:s.y+so/2,maxy:s.y+so/2+c.y,uminx:f-c.x/2,umaxx:f+c.x/2,lminx:0,lmaxx:0,leftend:a,rightend:u,ctrx:f,tp:s,hp:l,tn:o};jq(t,d,m,n)}function Vq(e,n,t,o){let r=(2*e.x+n.x)/3,i=(2*n.x+e.x)/3;return o===an||o===le?[{x:e.x,y:e.y},{x:r,y:t},{x:i,y:t},{x:n.x,y:n.y}]:[{x:e.x,y:e.y},{x:e.x,y:e.y},{x:r,y:t},{x:r,y:t},{x:r,y:t},{x:i,y:t},{x:i,y:t},{x:i,y:t},{x:n.x,y:n.y},{x:n.x,y:n.y}]}function Uq(e,n){let t=e[0],{tn:o,hn:r}=sS(e),i={x:o.info.coord.x+t.info.tail_port.p.x,y:o.info.coord.y+t.info.tail_port.p.y},s={x:r.info.coord.x+t.info.head_port.p.x,y:r.info.coord.y+t.info.head_port.p.y},l=e.length,a=l>1?o.info.ht/(l-1):0,u=i.y-(l>1?o.info.ht/2:0);for(let f=0;f<l;f++){let d=Vq(i,s,u,n);u+=a,bx(e[f],d,o)}}function aS(e,n){if(!iS(n))return!1;if(n.info.spl!==void 0)return!0;let t=Iq(e,n),o=ht(e);return t.some(r=>r.info.label!==void 0)?Hq(t,o):Uq(t,o),!0}function Xq(e){return e.tail.info.coord!==void 0&&e.head.info.coord!==void 0}function $q(e){let n=e.tail.info.coord,t=e.head.info.coord;return n.x===0&&n.y===0&&t.x===0&&t.y===0}function Wq(e){return Xq(e)&&!$q(e)}function uS(e){return e.info.to_virt!==void 0&&(e.tail.info.rank??0)>(e.head.info.rank??0)}function fS(e){return e.info.to_virt!==void 0&&(e.head.info.rank??0)>(e.tail.info.rank??0)+1}function Yq(e,n,t,o){return uS(e)?(s1(e,n,t,o),!0):fS(e)?pS(e,o):!1}function Jq(e,n){if(cS(e,n))return;let t=mr(e.tail,n),o=mr(e.head,n);Yq(e,t,o,n)||e.tail.info.rank!==void 0&&e.tail.info.rank===e.head.info.rank&&xS(e,n)||dS(e,n)}function Kq(e){let n=yn(e.tail,e.head,e.info.tail_port),t=yn(e.head,e.tail,e.info.head_port);if(!n.defined&&!t.defined)return;let o=e.tail.info.coord,r=e.head.info.coord;return{tailP:n.defined?{x:o.x+n.p.x,y:o.y+n.p.y}:null,headP:t.defined?{x:r.x+t.p.x,y:r.y+t.p.y}:null,clipTail:n.defined?n.clip:!0,clipHead:t.defined?t.clip:!0}}function dS(e,n){let t=vl(n,e);return t===null?!1:t==="lost"?(e.info.lost=!0,!0):(Z(e,e.head,t,t.length,Ce()),!0)}function cS(e,n){let t=e.tail.info.rank,o=e.head.info.rank;if(t===void 0||o===void 0||t!==o+1)return!1;let r=El(e),i=vl(n,r);return i===null?!1:i==="lost"?(e.info.lost=!0,!0):(Z(r,r.head,i,i.length,Ce()),En(e)&&On(e),!0)}function qq(e,n){let t=e.attrs.get("dir")??iE(n),o=bu(e);if(t!=="forward"){Jq(e,n);return}if(cS(e,n))return;let r=mr(e.tail,n),i=mr(e.head,n);if(uS(e)){s1(e,r,i,n);return}if(fS(e)){pS(e,n);return}tQ(e,n,r,i,o)}function pS(e,n){let t=i1(n,e);return t===null?!1:(Z(e,e.head,t,t.length,Ce()),!0)}function mS(e){let n=yn(e.tail,e.head,e.info.tail_port),t=yn(e.head,e.tail,e.info.head_port);return(n.side??0)!==0||(t.side??0)!==0}function Qq(e,n){return e.info.spl===void 0&&e.tail.info.rank===e.head.info.rank&&ki(n,e)&&mS(e)}function Zq(e,n){let t=e.tail,o=e.head,r=(t.info.order??0)<=(o.info.order??0)?t:o,i=Gt(e),s=a=>a.tail===t&&a.head===o||a.tail===o&&a.head===t,l=n.edges.filter(a=>s(a)&&Qq(a,n)&&Gt(a)===i);return l.sort((a,u)=>+(u.tail===r)-+(a.tail===r)||a.seq-u.seq),l}function eQ(e,n){let t=e.tail.info.rank!==void 0&&e.tail.info.rank===e.head.info.rank;if(t&&ki(n,e)){let r=Zq(e,n);return Jv(n,r,r.length,an)===0&&e.info.spl!==void 0}if(t){let r=xx(e,n);return hx(n,r,r.length)&&e.info.spl!==void 0}let o=vl(n,e);return o===null?!1:o==="lost"?(e.info.lost=!0,!0):(Z(e,e.head,o,o.length,Ce()),!0)}function nQ(e,n){let t=n.tail.info.rank;if(t===void 0||t!==n.head.info.rank||!ki(e,n))return!1;let o=r=>r?.kind===2;return o(n.tail.info.shape)||o(n.head.info.shape)}function xS(e,n){if(nQ(n,e)||rS(n,e)||aS(n,e)||mS(e)&&eQ(e,n))return!0;if(e.tail.info.rank!==void 0&&e.tail.info.rank===e.head.info.rank&&e.info.label===void 0&&!ki(n,e)){let t=xx(e,n);if(t.length>0&&hx(n,t,t.length)&&e.info.spl!==void 0)return!0}return!1}function tQ(e,n,t,o,r){if(xS(e,n)||dS(e,n))return;let i=M5(n,e.tail,e.head),s=_5(t,o,i,Pl(e),Kq(e));C5(e,s.bezierPts,s.arrowTip),e.info.headArrowOps=$s(e,"head",s.arrowTip,s.arrowDir,r)}function oQ(e){let n=Xo(e),t=[];for(let o of e.nodes.values())for(let r of n.get(o)??[])t.push(r);return e.info.rank!==void 0&&t.sort(ev),t}function gx(e,n){if(e.info.spl!==void 0||e.info.lost===!0)return;let t=e.info.edge_type??0;t===tn||t===$n||e.tail!==e.head&&Wq(e)&&qq(e,n)}function hS(e){for(let n of oQ(e))gx(n,e)}var rQ=0x5deece66dn,iQ=0xbn,bS=(1n<<48n)-1n,sQ=2**48,v1=0x330en;function Tl(e){v1=((BigInt(Math.trunc(e))&0xffffffffn)<<16n|0x330en)&bS}function qn(){return v1=rQ*v1+iQ&bS,Number(v1)/sQ}var ae=Number.MAX_SAFE_INTEGER,Ao=0,Ci=1,yx=2,kl=1,_i=2,bt=3,Gu=1,Px=2;function H(e){return e!==Ao&&e!==ae}function He(e,n){return Math.abs(e-n)<=1e-7}function Cl(e,n){let t=e-n;return t<-1e-7?-1:t>1e-7?1:0}function fn(e,n){return He(e.y,n.y)&&He(e.x,n.x)}function Sr(e,n){return e.y>n.y+1e-7?!0:e.y<n.y-1e-7?!1:e.x>n.x}function _l(e,n){return Sr(e,n)||fn(e,n)}function gS(e,n){return!_l(e,n)}function yS(e,n){return e.y>n.y+1e-7||He(e.y,n.y)&&e.x>n.x+1e-7?e:n}function PS(e,n){return e.y<n.y-1e-7||He(e.y,n.y)&&e.x<n.x?e:n}function Ex(e,n,t){return(n.x-e.x)*(t.y-e.y)-(n.y-e.y)*(t.x-e.x)}function Qn(e){return e.push({nodetype:0,segnum:0,yval:{x:0,y:0},trnum:0,parent:0,left:0,right:0}),e.length-1}function Go(e){return e.push({lseg:0,rseg:0,hi:{x:0,y:0},lo:{x:0,y:0},u0:0,u1:0,d0:0,d1:0,sink:0,usave:0,uside:0,isValid:!1}),e.length-1}function ES(e){let n=0;for(let t=e;t>=1;n++)t=Math.log2(t);return n-1}function S1(e,n){let t=e;for(let o=0;o<n;o++)t=Math.log2(t);return Math.ceil(e/t)}function Ai(e,n,t){let o=n[e],r;return Sr(o.v1,o.v0)?He(o.v1.y,t.y)?r=t.x<o.v1.x?1:-1:He(o.v0.y,t.y)?r=t.x<o.v0.x?1:-1:r=Ex(o.v0,o.v1,t):He(o.v1.y,t.y)?r=t.x<o.v1.x?1:-1:He(o.v0.y,t.y)?r=t.x<o.v0.x?1:-1:r=Ex(o.v1,o.v0,t),r>0}function vx(e,n,t){return t===Gu?n[n[e].prev].isInserted:n[n[e].next].isInserted}function lQ(e,n,t,o,r){return fn(e,o[t.segnum].v0)||fn(e,o[t.segnum].v1)?He(e.y,n.y)?n.x<e.x?Qe(e,n,t.left,o,r):Qe(e,n,t.right,o,r):Ai(t.segnum,o,n)?Qe(e,n,t.left,o,r):Qe(e,n,t.right,o,r):Ai(t.segnum,o,e)?Qe(e,n,t.left,o,r):Qe(e,n,t.right,o,r)}function Qe(e,n,t,o,r){let i=r[t];switch(i.nodetype){case bt:return i.trnum;case _i:return Sr(e,i.yval)||fn(e,i.yval)&&Sr(n,i.yval)?Qe(e,n,i.right,o,r):Qe(e,n,i.left,o,r);case kl:return lQ(e,n,i,o,r);default:throw new Error("locateEndpoint: unreachable")}}function Sx(e,n,t,o,r,i){let s=n;for(;H(s)&&_l(r[s].lo,r[t].lo);){let l=0,a=aQ(s,e,o,r,l);l=a.tnext,a.match&&r[s].lseg===r[l].lseg&&r[s].rseg===r[l].rseg?uQ(s,l,r,i):s=l}}function aQ(e,n,t,o,r){let i=0,s=!1;return t===Ci?s=H(i=o[e].d0)&&o[i].rseg===n||H(i=o[e].d1)&&o[i].rseg===n:s=H(i=o[e].d0)&&o[i].lseg===n||H(i=o[e].d1)&&o[i].lseg===n,{match:s,tnext:i}}function uQ(e,n,t,o){let r=o[t[n].sink].parent;o[r].left===t[n].sink?o[r].left=t[e].sink:o[r].right=t[e].sink,H(t[e].d0=t[n].d0)&&(t[t[e].d0].u0===n?t[t[e].d0].u0=e:t[t[e].d0].u1===n&&(t[t[e].d0].u1=e)),H(t[e].d1=t[n].d1)&&(t[t[e].d1].u0===n?t[t[e].d1].u0=e:t[t[e].d1].u1===n&&(t[t[e].d1].u1=e)),t[e].lo=t[n].lo,t[n].isValid=!1}function w1(e,n,t,o,r){H(t[o].u0)&&H(t[o].u1)?fQ(t,o,r):cQ(e,n,t,o,r)}function fQ(e,n,t){H(e[n].usave)?dQ(e,n,t):(e[t].u0=e[n].u1,e[n].u1=ae,e[t].u1=ae,e[e[t].u0].d0=t)}function dQ(e,n,t){e[n].uside===Ci?(e[t].u0=e[n].u1,e[n].u1=ae,e[t].u1=e[n].usave,e[e[n].u0].d0=n,e[e[t].u0].d0=t,e[e[t].u1].d0=t):(e[t].u1=ae,e[t].u0=e[n].u1,e[n].u1=e[n].u0,e[n].u0=e[n].usave,e[e[n].u0].d0=n,e[e[n].u1].d0=n,e[e[t].u0].d0=t),e[n].usave=0,e[t].usave=0}function cQ(e,n,t,o,r){let i=t[o].u0,s=t[i].d0;H(s)&&H(t[i].d1)?t[s].rseg>0&&!Ai(t[s].rseg,n,e.v1)?(t[o].u0=ae,t[o].u1=ae,t[r].u1=ae,t[t[r].u0].d1=r):(t[r].u0=ae,t[r].u1=ae,t[o].u1=ae,t[t[o].u0].d0=o):(t[t[o].u0].d0=o,t[t[o].u0].d1=r)}function pQ(e,n,t,o,r){let i=Qe(e.v0,e.v1,e.root0,n,o),s=Go(t);return t[s]={...t[i]},t[i].lo=e.v0,t[s].hi=e.v0,t[i].d0=s,t[i].d1=Ao,t[s].u0=i,t[s].u1=Ao,vS(t,s,i),SS(t,o,i,s,r,e.v0),s}function vS(e,n,t){let o=e[n].d0;H(o)&&e[o].u0===t&&(e[o].u0=n),H(o)&&e[o].u1===t&&(e[o].u1=n),o=e[n].d1,H(o)&&e[o].u0===t&&(e[o].u0=n),H(o)&&e[o].u1===t&&(e[o].u1=n)}function SS(e,n,t,o,r,i){let s=Qn(n),l=Qn(n),a=e[t].sink;n[a].nodetype=_i,n[a].yval=i,n[a].segnum=r,n[a].left=l,n[a].right=s,n[s].nodetype=bt,n[s].trnum=t,n[s].parent=a,n[l].nodetype=bt,n[l].trnum=o,n[l].parent=a,e[t].sink=s,e[o].sink=l}function mQ(e,n,t,o,r){let i=Qe(e.v1,e.v0,e.root1,n,o),s=Go(t);return t[s]={...t[i]},t[i].lo=e.v1,t[s].hi=e.v1,t[i].d0=s,t[i].d1=Ao,t[s].u0=i,t[s].u1=Ao,vS(t,s,i),SS(t,o,i,s,r,e.v1),i}function xQ(e,n,t,o,r,i,s){let l=s?n[o].prev:n[o].next;l>0&&Ai(l,n,t.v0)?(e[e[r].d0].u0=r,e[i].d0=ae,e[i].d1=ae):(e[e[i].d0].u1=i,e[r].d0=ae,e[r].d1=ae)}function hQ(e,n,t,o,r,i,s){let l=s?n[o].prev:n[o].next;l>0&&Ai(l,n,t.v0)?(e[e[r].d1].u0=r,e[i].d0=ae,e[i].d1=ae):(e[e[i].d1].u1=i,e[r].d0=ae,e[r].d1=ae)}function bQ(e,n,t,o,r,i,s,l,a){w1(e,n,t,o,r),wx(t,o,i)&&a?xQ(t,n,e,s,o,r,l):(wS(t,t[o].d0,o,r),t[t[o].d0].u0=o,t[t[o].d0].u1=r)}function gQ(e,n,t,o,r,i,s,l,a){w1(e,n,t,o,r),wx(t,o,i)&&a?hQ(t,n,e,s,o,r,l):(wS(t,t[o].d1,o,r),t[t[o].d1].u0=o,t[t[o].d1].u1=r)}function wx(e,n,t){return He(e[n].lo.y,e[t].lo.y)&&He(e[n].lo.x,e[t].lo.x)}function wS(e,n,t,o){H(e[n].u0)&&H(e[n].u1)&&(e[n].u0===t?(e[n].usave=e[n].u1,e[n].uside=Ci):(e[n].usave=e[n].u0,e[n].uside=yx))}function yQ(e,n,t,o,r,i,s){let l=PQ(e,t[o].lo);return w1(e,n,t,o,r),EQ(t,o,r,i,s,l)}function PQ(e,n){if(He(n.y,e.v0.y))return n.x>e.v0.x;let t=(n.y-e.v0.y)/(e.v1.y-e.v0.y),o={y:n.y,x:e.v0.x+t*(e.v1.x-e.v0.x)};return gS(o,n)}function EQ(e,n,t,o,r,i){return wx(e,n,o)&&r?(e[e[n].d0].u0=n,e[e[n].d0].u1=ae,e[e[n].d1].u0=t,e[e[n].d1].u1=ae,e[t].d0=e[n].d1,e[n].d1=ae,e[t].d1=ae,e[n].d1):i?(e[e[n].d0].u0=n,e[e[n].d0].u1=t,e[e[n].d1].u0=t,e[e[n].d1].u1=ae,e[n].d1=ae,e[n].d0):(e[e[n].d0].u0=n,e[e[n].d0].u1=ae,e[e[n].d1].u0=n,e[e[n].d1].u1=t,e[t].d0=e[n].d1,e[t].d1=ae,e[n].d1)}function vQ(e){let n=e.v0;e.v0=e.v1,e.v1=n;let t=e.root0;e.root0=e.root1,e.root1=t}function Nx(e,n,t,o){let r={...n[e]},i=!1;_l(r.v1,r.v0)&&!fn(r.v1,r.v0)&&(vQ(r),i=!0);let s;vx(e,n,i?Px:Gu)?s=Qe(r.v0,r.v1,r.root0,n,o):s=pQ(r,n,t,o,e);let l,a=!1;vx(e,n,i?Gu:Px)?(l=Qe(r.v1,r.v0,r.root1,n,o),a=!0):l=mQ(r,n,t,o,e),SQ(r,n,t,o,e,s,l,a,i),n[e].isInserted=!0}function SQ(e,n,t,o,r,i,s,l,a){let u=Ao,f=Ao,d=i;for(;H(d)&&_l(t[d].lo,t[s].lo);){let c=t[d].sink,m=Qn(o),b=Qn(o);o[c].nodetype=kl,o[c].segnum=r,o[c].left=m,o[c].right=b,o[m].nodetype=bt,o[m].trnum=d,o[m].parent=c;let g=Go(t);t[g]={...t[d]},t[g].isValid=!0,t[d].sink=m,t[g].sink=b,o[b].nodetype=bt,o[b].trnum=g,o[b].parent=c,d===i&&(u=g),fn(t[d].lo,t[s].lo)&&(f=g);let E=d,R=g;d=wQ(e,n,t,d,g,s,r,a,l),t[E].rseg=r,t[R].lseg=r}Sx(r,i,s,Ci,t,o),Sx(r,u,f,yx,t,o)}function wQ(e,n,t,o,r,i,s,l,a){return!H(t[o].d0)&&!H(t[o].d1)?Ao:H(t[o].d0)&&!H(t[o].d1)?(bQ(e,n,t,o,r,i,s,l,a),t[o].d0):!H(t[o].d0)&&H(t[o].d1)?(gQ(e,n,t,o,r,i,s,l,a),t[o].d1):yQ(e,n,t,o,r,i,a)}function NS(e,n,t,o){let r=n[e];r.isInserted||(r.root0=t[Qe(r.v0,r.v1,r.root0,n,o)].sink,r.root1=t[Qe(r.v1,r.v0,r.root1,n,o)].sink)}function Rx(e,n,t){let o=[],r=[];r.push({lseg:0,rseg:0,hi:{x:0,y:0},lo:{x:0,y:0},u0:0,u1:0,d0:0,d1:0,sink:0,usave:0,uside:0,isValid:!1});let i=0,s=NQ(t[i++],n,r,o);for(let u=1;u<=e;u++)n[u].root0=s,n[u].root1=s;let l=ES(e);for(let u=1;u<=l;u++){let f=S1(e,u-1)+1,d=S1(e,u);for(let c=f;c<=d;c++)Nx(t[i++],n,r,o);for(let c=1;c<=e;c++)NS(c,n,r,o)}let a=S1(e,l)+1;for(let u=a;u<=e;u++)Nx(t[i++],n,r,o);return r}function NQ(e,n,t,o){let r=n[e],i=Qn(o);o[i].nodetype=_i,o[i].yval=yS(r.v0,r.v1);let s=i,l=Qn(o);o[i].right=l,o[l].nodetype=bt,o[l].parent=i;let a=Qn(o);o[i].left=a,o[a].nodetype=_i,o[a].yval=PS(r.v0,r.v1),o[a].parent=i;let u=Qn(o);o[a].left=u,o[u].nodetype=bt,o[u].parent=a;let f=Qn(o);o[a].right=f,o[f].nodetype=kl,o[f].segnum=e,o[f].parent=a;let d=Qn(o);o[f].left=d,o[d].nodetype=bt,o[d].parent=f;let c=Qn(o);o[f].right=c,o[c].nodetype=bt,o[c].parent=f;let m=Go(t),b=Go(t),g=Go(t),E=Go(t);return RQ(t,o,m,b,g,E,i,l,a,u,d,c,e),n[e].isInserted=!0,s}function RQ(e,n,t,o,r,i,s,l,a,u,f,d,c){e[t].hi=n[s].yval,e[o].hi=n[s].yval,e[i].lo=n[s].yval,e[t].lo=n[a].yval,e[o].lo=n[a].yval,e[r].hi=n[a].yval,e[i].hi={y:Number.MAX_VALUE,x:Number.MAX_VALUE},e[r].lo={y:-Number.MAX_VALUE,x:-Number.MAX_VALUE},e[t].rseg=c,e[o].lseg=c,e[t].u0=i,e[o].u0=i,e[t].d0=r,e[o].d0=r,e[i].d0=t,e[r].u0=t,e[i].d1=o,e[r].u1=o,e[t].sink=f,e[o].sink=d,e[r].sink=u,e[i].sink=l,e[t].isValid=!0,e[o].isValid=!0,e[r].isValid=!0,e[i].isValid=!0,n[l].trnum=i,n[u].trnum=r,n[f].trnum=t,n[d].trnum=o}var CS=173;var TQ=4,TS=1,kS=2,Tx=class e{static perp(n){return{x:-n.y,y:n.x}}static rectIntersect(n,t){let o=Math.max(n.LL.x,t.LL.x),r=Math.min(n.UR.x,t.UR.x),i=Math.max(n.LL.y,t.LL.y),s=Math.min(n.UR.y,t.UR.y);return o>=r||i>=s?null:{LL:{x:o,y:i},UR:{x:r,y:s}}}static convert(n,t,o){let r=[{...n.LL},o?{x:n.UR.x,y:n.LL.y}:{x:n.LL.x,y:n.UR.y},{...n.UR},o?{x:n.LL.x,y:n.UR.y}:{x:n.UR.x,y:n.LL.y}];return t?r.map(e.perp):r}static store(n,t,o){let r=t+TQ-1;for(let i=t,s=0;i<=r;i++,s++)n[i].next=i===t?t+1:i===r?t:i+1,n[i].prev=i===t?r:i-1,n[i].isInserted=!1,n[i].v0={...o[s]},n[n[i].prev].v1={...o[s]};return r+1}static genSegments(n,t,o){let r=4*(n.length+1),i=[];for(let l=0;l<=r;l++)i.push({v0:{x:0,y:0},v1:{x:0,y:0},isInserted:!1,root0:0,root1:0,next:0,prev:0});let s=1;s=e.store(i,s,e.convert(t,o,!0));for(let l of n)s=e.store(i,s,e.convert(l.bb,o,!1));return i}static generateRandomOrdering(n){let t=[];for(let o=0;o<n;o++)t.push(o+1);for(let o=0;o<n;o++){let r=Math.floor(o+qn()*(n-o));if(r!==o){let i=t[o];t[o]=t[r],t[r]=i}}return t}static mkTrapBox(n,t,o){return o?{LL:{x:n.lo.y,y:-t[n.rseg].v0.x},UR:{x:n.hi.y,y:-t[n.lseg].v0.x}}:{LL:{x:t[n.lseg].v0.x,y:n.lo.y},UR:{x:t[n.rseg].v0.x,y:n.hi.y}}}static insidePolygon(n,t){return!n.isValid||n.lseg<=0||n.rseg<=0?!1:!H(n.u0)&&!H(n.u1)||!H(n.d0)&&!H(n.d1)?Sr(t[n.rseg].v1,t[n.rseg].v0):!1}static childOrder(n,t,o,r){let i=TS,s=kS,{u0:l,u1:a,d0:u,d1:f}=n;return!H(l)&&!H(a)?H(u)&&H(f)?o===f?[[f,i],[u,i]]:[[u,i],[f,i]]:[[l,s],[a,s],[u,i],[f,i]]:!H(u)&&!H(f)?H(l)&&H(a)?o===a?[[a,s],[l,s]]:[[l,s],[a,s]]:[[l,s],[a,s],[u,i],[f,i]]:H(l)&&H(a)?H(u)&&H(f)?r===s&&f===o||r===i&&a===o?[[a,s],[f,i],[l,s],[u,i]]:[[l,s],[u,i],[a,s],[f,i]]:fn(n.lo,t[n.lseg].v1)?r===i&&l===o?[[l,s],[u,i],[a,s],[f,i]]:[[a,s],[u,i],[f,i],[l,s]]:r===i&&a===o?[[a,s],[f,i],[u,i],[l,s]]:[[l,s],[u,i],[f,i],[a,s]]:H(u)&&H(f)?fn(n.hi,t[n.lseg].v0)?r===s&&u===o?[[u,i],[l,s],[a,s],[f,i]]:[[a,s],[f,i],[l,s],[u,i]]:r===s&&f===o?[[f,i],[a,s],[l,s],[u,i]]:[[l,s],[u,i],[a,s],[f,i]]:fn(n.hi,t[n.lseg].v0)&&fn(n.lo,t[n.rseg].v0)?r===i?[[l,s],[a,s],[f,i],[u,i]]:[[f,i],[u,i],[l,s],[a,s]]:fn(n.hi,t[n.rseg].v1)&&fn(n.lo,t[n.lseg].v1)?r===i?[[l,s],[a,s],[f,i],[u,i]]:[[f,i],[u,i],[l,s],[a,s]]:[[l,s],[u,i],[a,s],[f,i]]}static monotonateTrapezoids(n,t,o){let r=[],i=-1;for(let f=0;f<n.length;f++)if(e.insidePolygon(n[f],t)){i=f;break}if(i<0)return r;let s,l;if(H(n[i].u0))s=n[i].u0,l=TS;else if(H(n[i].d0))s=n[i].d0,l=kS;else return r;let a=new Array(n.length).fill(!1),u=[[i,s,l]];for(;u.length>0;){let[f,d,c]=u.pop();if(!H(f)||a[f])continue;a[f]=!0;let m=n[f];m.hi.y>m.lo.y+1e-7&&He(t[m.lseg].v0.x,t[m.lseg].v1.x)&&He(t[m.rseg].v0.x,t[m.rseg].v1.x)&&r.push(e.mkTrapBox(m,t,o));let b=e.childOrder(m,t,d,c);for(let g=b.length-1;g>=0;g--){let[E,R]=b[g];u.push([E,f,R])}}return r}};function _S(e,n){let t=Tx,o=4*(e.length+1);Tl(CS);let r=t.genSegments(e,n,!1),i=t.generateRandomOrdering(o),s=Rx(o,r,i),l=t.monotonateTrapezoids(s,r,!1),a=t.genSegments(e,n,!0),u=t.generateRandomOrdering(o),f=Rx(o,a,u),d=t.monotonateTrapezoids(f,a,!0),c=[];for(let m of d)for(let b of l){let g=t.rectIntersect(m,b);g&&c.push(g)}return c}function kx(e){let n=[];for(let t=0;t<e;t++)n.push({color:0,topsortOrder:0,adjList:[]});return{nvs:e,vertices:n}}function Gi(e,n,t){Al(e,n,t)||e.vertices[n].adjList.push(t)}function Cx(e,n,t){e.vertices[n].adjList=e.vertices[n].adjList.filter(o=>o!==t),e.vertices[t].adjList=e.vertices[t].adjList.filter(o=>o!==n)}function Al(e,n,t){return e.vertices[n].adjList.includes(t)}function AS(e,n,t,o){let r=e.vertices[n];r.color=1;let i=r.adjList;t=t+1;for(let s=0;s<i.length;s++){let l=i[s];e.vertices[l].color===0&&(t=AS(e,l,t,o))}return r.color=2,o.push(n),t+1}function GS(e){let n=0,t=0;if(e.nvs===0)return;if(e.nvs===1){e.vertices[0].topsortOrder=t;return}let o=[];o.length=0;for(let r=0;r<e.nvs;r++)e.vertices[r].color===0&&(n=AS(e,r,n,o));for(;o.length>0;){let r=o.pop();e.vertices[r].topsortOrder=t,t++}}function _x(e,n){e.left=n.right,n.right=e}function kQ(e,n){e.right=n.left,n.left=e}var Mu=class{constructor(n,t){this.keyOf=n;this.cmp=t}keyOf;cmp;here=null;flattened=!1;unflatten(){this.flattened=!1}search(n){let t={left:null,right:null,obj:void 0},o=t,r=t,i=this.here;for(;i!==null;){let s=this.cmp(n,this.keyOf(i.obj));if(s===0)break;if(s<0){let l=i.left;if(l!==null){let a=this.cmp(n,this.keyOf(l.obj));if(a<0){if(_x(i,l),r.left=l,r=l,i=l.left,i===null)break}else if(a===0){r.left=i,r=i,i=l;break}else if(o.right=l,o=l,r.left=i,r=i,i=l.right,i===null)break}else{r.left=i,r=i,i=null;break}}else{let l=i.right;if(l!==null){let a=this.cmp(n,this.keyOf(l.obj));if(a>0){if(kQ(i,l),o.right=l,o=l,i=l.right,i===null)break}else if(a===0){o.right=i,o=i,i=l;break}else if(r.left=l,r=l,o.right=i,o=i,i=l.left,i===null)break}else{o.right=i,o=i,i=null;break}}}return{root:i,link:t,l:o,r}}match(n){if(this.unflatten(),this.here===null)return null;let{root:t,link:o,l:r,r:i}=this.search(n);return t!==null?(r.right=t.left,i.left=t.right,t.left=o.right,t.right=o.left,this.here=t,t.obj):(i.left=null,r.right=null,i.left=o.right,this.here=o.left,null)}insert(n){if(this.unflatten(),this.here===null)return this.here={left:null,right:null,obj:n},n;let t=this.keyOf(n),{root:o,link:r,l:i,r:s}=this.search(t);if(o!==null)return i.right=o.left,s.left=o.right,o.left=r.right,o.right=r.left,this.here=o,o.obj;s.left=null,i.right=null;let l={left:r.right,right:r.left,obj:n};return this.here=l,n}flatten(){if(this.flattened)return this.here;let n=this.here,t=null;if(n!==null){let o;for(;(o=n.left)!==null;)_x(n,o),n=o;let r=n;for(t=n,n=n.right;n!==null;r=n,n=n.right)if((o=n.left)!==null){do _x(n,o),n=o;while((o=n.left)!==null);r.right=n}}return this.here=t,this.flattened=!0,t}};function k1(e){return(e.flags&1)!==0}function CQ(e,n){return e<n?-1:e>n?1:0}function Ou(){return new Mu(e=>e.v,CQ)}function MS(e,n,t){let o=e.match(t);o||(o={v:t,chans:new Mu(r=>r.p,LQ)},e.insert(o)),o.chans.insert(n)}function _Q(e){let n=e;for(;;){let t=n.sides[2];if(!t)break;let o=t.cells[0];if(!o||k1(o))break;n=o}return n}function AQ(e){let n=e;for(;;){let t=n.sides[0];if(!t)break;let o=t.cells[1];if(!o||k1(o))break;n.flags|=4,n=o}return n.flags|=4,n}function GQ(e){let n=e;for(;;){let t=n.sides[3];if(!t)break;let o=t.cells[0];if(!o||k1(o))break;n=o}return n}function MQ(e){let n=e;for(;;){let t=n.sides[1];if(!t)break;let o=t.cells[1];if(!o||k1(o))break;n.flags|=2,n=o}return n.flags|=2,n}function LS(e){let n=Ou();for(let t=0;t<e.ncells;t++){let o=e.cells[t];if(o.flags&4)continue;let r=_Q(o),i={p:{p1:r.bb.LL.x,p2:0},segList:[],G:null,cp:r};r.flags|=4;let s=AQ(r);i.p.p2=s.bb.UR.x,MS(n,i,r.bb.LL.y)}return n}function IS(e){let n=Ou();for(let t=0;t<e.ncells;t++){let o=e.cells[t];if(o.flags&2)continue;let r=GQ(o),i={p:{p1:r.bb.LL.y,p2:0},segList:[],G:null,cp:r};r.flags|=2;let s=MQ(r);i.p.p2=s.bb.UR.y,MS(n,i,r.bb.LL.x)}return n}function*Ll(e){for(let n=e.flatten();n!==null;n=n.right){let t=n.obj;for(let o=t.chans.flatten();o!==null;o=o.right)yield[t.v,o.obj]}}function LQ(e,n){return e.p1>n.p1?e.p2<=n.p2?0:1:e.p1<n.p1?e.p2>=n.p2?0:-1:0}function Mt(e,n,t){let o=e.match(n);return o?o.chans.match(t):null}function OS(e){let n={nVal:0,nIdx:0,nDad:null,nEdge:null,nAdj:0,saveNAdj:0,cells:[null,null],adjEdgeList:[],index:-1,isVert:!1,x:0,y:0},t=new Array(e+1).fill(null);return t[0]=n,{pq:t,cnt:0,guard:n,size:e}}function DS(e){e.cnt=0}function BS(e,n){let t=e.pq[n],o=t.nVal,r=n,i=r>>1,s=e.pq[i];for(;s.nVal<o;)e.pq[r]=s,s.nIdx=r,r=i,i=r>>1,s=e.pq[i];e.pq[r]=t,t.nIdx=r}function Ax(e,n){return e.cnt===e.size?1:(e.cnt++,e.pq[e.cnt]=n,BS(e,e.cnt),0)}function IQ(e,n){let t=e.pq[n],o=t.nVal,r=e.cnt>>1,i=n;for(;i<=r;){let s=i+i,l=e.pq[s];if(s<e.cnt){let a=e.pq[s+1];l.nVal<a.nVal&&(s++,l=a)}if(o>=l.nVal)break;e.pq[i]=l,l.nIdx=i,i=s}e.pq[i]=t,t.nIdx=i}function FS(e){if(e.cnt>0){let n=e.pq[1];return e.pq[1]=e.pq[e.cnt],e.cnt--,e.cnt>0&&IQ(e,1),n}return null}function zS(e,n,t){n.nVal=t,BS(e,n.nIdx)}var Gx=Number.MIN_SAFE_INTEGER;function Mx(e){let n=[];for(let t=0;t<e;t++)n.push(jS(t));return{nnodes:0,nedges:0,saveNnodes:0,saveNedges:0,nodes:n,edges:[]}}function jS(e){return{nVal:Gx,nIdx:0,nDad:null,nEdge:null,nAdj:0,saveNAdj:0,cells:[null,null],adjEdgeList:[],index:e,isVert:!1,x:0,y:0}}function HS(e,n){let t=e.nnodes+2;for(;e.nodes.length<t;)e.nodes.push(jS(e.nodes.length));let o=new Int32Array(6*e.nnodes+2*n);e.adjBuf=o;let r=0;for(let i=0;i<e.nnodes;i++)e.nodes[i].adjEdgeList=o.subarray(r),r+=6;for(let i=e.nnodes;i<e.nnodes+2;i++)e.nodes[i].adjEdgeList=o.subarray(r),r+=n;e.edges=new Array(3*e.nnodes+n),e.nedges=0}function VS(e){let n=e.nodes[e.nnodes];return n.index=e.nnodes,e.nnodes++,n}function Du(e,n,t,o){let r=e.nedges++,i={weight:o,cnt:0,v1:n.index,v2:t.index};return e.edges[r]=i,n.adjEdgeList[n.nAdj]=r,n.nAdj++,t.adjEdgeList[t.nAdj]=r,t.nAdj++,i}function US(e){e.saveNnodes=e.nnodes,e.saveNedges=e.nedges;for(let n=0;n<e.nnodes;n++)e.nodes[n].saveNAdj=e.nodes[n].nAdj}function XS(e){e.nnodes=e.saveNnodes,e.nedges=e.saveNedges;for(let n=0;n<e.nnodes;n++)e.nodes[n].nAdj=e.nodes[n].saveNAdj;for(let n=e.nnodes;n<e.nnodes+2;n++)e.nodes[n]&&(e.nodes[n].nAdj=0)}function DQ(e,n,t){return n.v1===t.index?e.nodes[n.v2]:e.nodes[n.v1]}function BQ(e,n,t){for(let o=0;o<t.nAdj;o++){let r=n.edges[t.adjEdgeList[o]],i=DQ(n,r,t);if(i.nVal<0){let s=Math.trunc(-(t.nVal+r.weight));if(i.nVal===Gx){if(i.nVal=s,Ax(e,i)!==0)return!0;i.nDad=t,i.nEdge=r}else i.nVal<s&&(zS(e,i,s),i.nDad=t,i.nEdge=r)}}return!1}function $S(e,n,t,o){for(let i=0;i<n.nnodes;i++)n.nodes[i].nVal=Gx;if(DS(e),Ax(e,t)!==0)return 1;t.nDad=null,t.nVal=0;let r;for(;(r=FS(e))!==null&&(r.nVal*=-1,r!==o);)if(BQ(e,n,r))return 1;return 0}function WS(e){return OS(e.nnodes+2)}function Lx(e,n,t){for(let o=0;o<n.nsides;o++){let r=n.sides[o];r!==null&&Du(e,t,r,0)}e.nnodes++,t.cells[0]=n,t.cells[1]=n}function YS(e,n,t,o){for(let r=0;r<n.nsides;r++){let i=n.sides[r];if(i===null||i.isVert)continue;i.cells[0]===n?Du(e,o,i,0):Du(e,t,i,0)}e.nnodes+=2}var C1=36,JS=1,FQ=500,Bu=16384;function Dx(e){return(e-3)/2}function M1(e){return Dx(e)<2}function zQ(e){return(e.flags&1)!==0}function KS(e,n){return e.nodes[n.v1].isVert!==e.nodes[n.v2].isVert}function jQ(e,n){return e.nodes[n.v1].isVert}function qS(e,n){e.cnt++,e.cnt>n&&(e.cnt=0,e.weight+=Bu)}function QS(e,n,t){let o=KS(e,t),r=Dx(n.bb.UR.y-n.bb.LL.y),i=Dx(n.bb.UR.x-n.bb.LL.x),s=Math.min(r,i),l=0;for(;l<n.nedges;l++){let a=n.edges[l];if(a===null||!KS(e,a))break;qS(a,s)}for(;l<n.nedges;l++){let a=n.edges[l];a&&(o||a===t)&&qS(a,jQ(e,a)?r:i)}}function L1(e,n,t){if(!e)return;let o=e;for(o.flags|=t;;){let r=o.sides[n];if(!r)break;let i=n===0||n===1?r.cells[1]:r.cells[0];if(!i||zQ(i))break;i.flags|=t,o=i}}function HQ(e){for(let n=0;n<e.nsides;n++){let t=e.sides[n];!t||!t.isVert||(t.cells[0]===e?L1(t.cells[1],0,8):L1(t.cells[0],2,8))}}function VQ(e){for(let n=0;n<e.nsides;n++){let t=e.sides[n];!t||t.isVert||(t.cells[0]===e?L1(t.cells[1],1,16):L1(t.cells[0],3,16))}}function UQ(e){M1(e.bb.UR.y-e.bb.LL.y)&&HQ(e),M1(e.bb.UR.x-e.bb.LL.x)&&VQ(e)}function XQ(e,n){let t=e.bb,o=JS*(t.UR.x-t.LL.x),r=JS*(t.UR.y-t.LL.y),i=(o+r)/2+FQ;M1(t.UR.y-t.LL.y)&&!(e.flags&8)&&(o=Bu,i=Bu),M1(t.UR.x-t.LL.x)&&!(e.flags&16)&&(r=Bu,i=Bu);let s=e.sides[2],l=e.sides[1],a=e.sides[0],u=e.sides[3],f=[[s,l,i],[l,a,i],[s,u,i],[u,a,i],[l,u,r],[s,a,o]];for(let[d,c,m]of f)d&&c&&(e.edges[e.nedges++]=Du(n,d,c,m))}function $Q(e,n,t,o,r){if(e){let s=Cl(n,o);return s!==0?s:Cl(t,r)}let i=Cl(t,r);return i!==0?i:Cl(n,o)}function ZS(e,n,t){let o=0,r=e.nodes.length;for(;o<r;){let i=o+r>>1,s=e.nodes[i],l=$Q(e.byX,s.x,s.y,n,t);if(l===0)return{found:!0,idx:i};l<0?o=i+1:r=i}return{found:!1,idx:o}}function _1(e,n,t,o,r){let i=ZS(n,t,o);if(i.found)return n.nodes[i.idx];let s=VS(e);return s.isVert=r,s.x=t,s.y=o,n.nodes.splice(i.idx,0,s),s}function WQ(e,n,t,o,r){for(let i=0;i<e.ncells;i++){let s=e.cells[i];if(s.nsides=4,s.sides=[null,null,null,null],s.bb.UR.x<t.UR.x){let l=_1(n,o,s.bb.UR.x,s.bb.LL.y,!0);l.cells[0]=s,s.sides[0]=l}if(s.bb.UR.y<t.UR.y){let l=_1(n,r,s.bb.LL.x,s.bb.UR.y,!1);l.cells[0]=s,s.sides[1]=l}if(s.bb.LL.x>t.LL.x){let l=_1(n,o,s.bb.LL.x,s.bb.LL.y,!0);l.cells[1]=s,s.sides[2]=l}if(s.bb.LL.y>t.LL.y){let l=_1(n,r,s.bb.LL.x,s.bb.LL.y,!1);l.cells[1]=s,s.sides[3]=l}}}function A1(e,n,t,o,r){let i=[],s=ZS(e,n,t);if(!s.found)return i;for(let l=s.idx;l<e.nodes.length;l++){let a=e.nodes[l];if(o?!(a.x<r):!(a.y<r))break;i.push(a)}return i}function G1(e,n,t,o){for(let r of n)e.push(r),r.cells[o]=t}function YQ(e,n,t){let o=0;for(let r of e.gcells){let i=[];G1(i,A1(n,r.bb.LL.x,r.bb.LL.y,!0,r.bb.UR.x),r,1),G1(i,A1(t,r.bb.LL.x,r.bb.LL.y,!1,r.bb.UR.y),r,1),G1(i,A1(n,r.bb.LL.x,r.bb.UR.y,!0,r.bb.UR.x),r,0),G1(i,A1(t,r.bb.UR.x,r.bb.LL.y,!1,r.bb.UR.y),r,0),r.sides=i,r.nsides=i.length,r.nsides>o&&(o=r.nsides)}return o}function JQ(e,n){let t=4*e.ncells,o=Mx(t+2),r={nodes:[],byX:!0},i={nodes:[],byX:!1};WQ(e,o,n,r,i);let s=YQ(e,i,r);for(let l of e.gcells)UQ(l);o.nodes[o.nnodes].index=o.nnodes,o.nodes[o.nnodes+1].index=o.nnodes+1,HS(o,s);for(let l of e.cells)XQ(l,o);return US(o),o}function KQ(e){let n=Math.max(1,(e.xsize??e.bb.UR.x-e.bb.LL.x)/2),t=Math.max(1,(e.ysize??e.bb.UR.y-e.bb.LL.y)/2),o=e.coord?e.coord.x:(e.bb.LL.x+e.bb.UR.x)/2,r=e.coord?e.coord.y:(e.bb.LL.y+e.bb.UR.y)/2;return{LL:{x:o-n,y:r-t},UR:{x:o+n,y:r+t}}}function ew(e){let n=e.nodes.map(s=>({flags:1,nedges:0,edges:new Array(6).fill(null),nsides:0,sides:[],bb:KQ(s)})),t={LL:{x:Number.MAX_VALUE,y:Number.MAX_VALUE},UR:{x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}};for(let s of n)t={LL:{x:Math.min(t.LL.x,s.bb.LL.x),y:Math.min(t.LL.y,s.bb.LL.y)},UR:{x:Math.max(t.UR.x,s.bb.UR.x),y:Math.max(t.UR.y,s.bb.UR.y)}};t={LL:{x:t.LL.x-C1,y:t.LL.y-C1},UR:{x:t.UR.x+C1,y:t.UR.y+C1}};let r=_S(n,t).map(s=>({flags:0,nedges:0,edges:new Array(6).fill(null),nsides:0,sides:[],bb:s})),i={ncells:r.length,ngcells:n.length,cells:r,gcells:n,sg:Mx(0),hchans:Ou(),vchans:Ou()};return i.sg=JQ(i,t),i}function Mi(e,n){return n?e.next:e.prev}function Bx(e,n){return e.p.p1===n.p.p1&&e.p.p2===n.p.p2&&e.l1===n.l1&&e.l2===n.l2}function QQ(e,n,t,o){let r=n,i=e;for(let s=1;s<=t;s++){let l=Mi(i,o);i.isVert?l.commCoord===i.p.p1?i.l1===4&&(r*=-1):i.l2===2&&(r*=-1):l.commCoord===i.p.p1?i.l1===1&&(r*=-1):i.l2===3&&(r*=-1),i=l}return r}function nw(e,n,t,o,r){let i=0,s=0,l,a=null;for(;(l=Mi(n,o))!==null&&(a=Mi(t,r))!==null&&Bx(l,a);)s++,n=l,t=a;if(l===null)i=0;else{if(a===null)throw new Error("decide_point: np2 null (C assert(0))");{let u=zx(l,a);if(u===-2)return-1;i=QQ(l,u,s+1,1-o)}}return e.a=s,e.b=i,0}var ZQ={"h,A,dir":!0,"h,A,!dir":!1,"h,!A,dir":!1,"h,!A,!dir":!0,"v,A,dir":!1,"v,A,!dir":!0,"v,!A,dir":!0,"v,!A,!dir":!1};function eZ(e,n,t){return ZQ[`${e?"v":"h"},${n?"A":"!A"},${t?"dir":"!dir"}`]}function lo(e,n,t,o,r,i){let s=e.isVert?Mt(i.vchans,e.commCoord,e.p):Mt(i.hchans,e.commCoord,e.p);Gi(s.G,e.indNo,n.indNo);for(let l=1;l<=r;l++){let a=Mi(e,t),u=Mi(n,o),f=e.isVert?Mt(i.hchans,a.commCoord,a.p):Mt(i.vchans,a.commCoord,a.p),d=a.commCoord===e.p.p1,c=d?e.l1:e.l2,m=e.isVert?2:1,b=eZ(e.isVert,d,c===m);Al(s.G,e.indNo,n.indNo)===b?Gi(f.G,u.indNo,a.indNo):Gi(f.G,a.indNo,u.indNo),s=f,e=a,n=u}}function tw(e,n,t,o){let r=e,i=n;for(;Bx(r,i);)r=Mi(r,1),i=Mi(i,t);let s=r.isVert?Mt(o.vchans,r.commCoord,r.p):Mt(o.hchans,r.commCoord,r.p);Cx(s.G,r.indNo,i.indNo)}function nZ(e,n){return e.prev===null?n.prev===null?0:1:n.prev===null?1:e.prev.commCoord===n.prev.commCoord?0:1}function tZ(e,n,t,o,r,i,s,l){e===-1?(lo(o,t,r,0,i,l),lo(o,t,1-r,1,s,l),n===1&&tw(t,o,1-r,l)):e===0?n===-1?(lo(o,t,r,0,i,l),lo(o,t,1-r,1,s,l)):(n===0||n===1)&&(lo(t,o,0,r,i,l),lo(t,o,1,1-r,s,l)):e===1&&(lo(t,o,0,r,i,l),lo(t,o,1,1-r,s,l),n===-1&&tw(t,o,1-r,l))}function oZ(e,n){let t=e.G,o=e.segList;for(let r=0;r+1<o.length;r++)for(let i=r+1;i<o.length;i++)if(!Al(t,r,i)&&!Al(t,i,r)&&Bx(o[r],o[i])){let s=nZ(o[r],o[i]),l={a:0,b:0};if(nw(l,o[r],o[i],0,s)!==0)return-1;let a=l.a,u=l.b;if(nw(l,o[r],o[i],1,1-s)!==0)return-1;let f=l.a,d=l.b;tZ(u,d,o[r],o[i],s,a,f,n)}return 0}function Fx(e,n){for(let[,t]of Ll(e))if(oZ(t,n)!==0)return-1;return 0}function uw(e,n,t,o,r,i){return{isVert:e,commCoord:n,p:t<o?{p1:t,p2:o}:{p1:o,p2:t},l1:t<o?r:i,l2:t<o?i:r,indNo:null,trackNo:null,prev:null,next:null}}function rZ(e){return{x:(e.bb.LL.x+e.bb.UR.x)/2,y:(e.bb.LL.y+e.bb.UR.y)/2}}function ow(e,n){let t=(o,r)=>(o+r)/2;return n===e.cells[1]?e.isVert?{x:n.bb.LL.x,y:t(n.bb.LL.y,n.bb.UR.y)}:{x:t(n.bb.LL.x,n.bb.UR.x),y:n.bb.LL.y}:e.isVert?{x:n.bb.UR.x,y:t(n.bb.LL.y,n.bb.UR.y)}:{x:t(n.bb.LL.x,n.bb.UR.x),y:n.bb.UR.y}}function iZ(e,n){let t=e.cells[0];return t===n.cells[0]||t===n.cells[1]?t:e.cells[1]}function sZ(e){return(e.flags&1)!==0}function fw(e,n,t){let o=[],r=n.nDad,i=r,s=r.nDad,l=sZ(r.cells[0])?r.cells[1]:r.cells[0],a=ow(r,l),u={x:0,y:0};for(;s.nDad!==null;){let f=iZ(i,s);if(QS(e,f,r.nEdge),r.isVert!==s.isVert||s.nDad===t){let d=r.isVert!==s.isVert?rZ(f):ow(s,f),c=lZ(r,s,l,f,a,u,o.length===0,t);o.push(c),l=f,u=a,a=d,r.isVert!==s.isVert&&s.nDad===t&&o.push(aZ(s,l,f,a,u)),r=s}i=s,s=s.nDad}for(let f=0;f<o.length;f++)f>0&&(o[f].prev=o[f-1]),f<o.length-1&&(o[f].next=o[f+1]);return{segs:o}}function lZ(e,n,t,o,r,i,s,l){let a,u,f,d,c;return e.isVert?(a=s?0:i.y>r.y?1:3,e.isVert!==n.isVert?u=n.cells[0]===o?1:3:u=0,f=t.bb.LL.y,d=t.bb.LL.x,c=o.bb.LL.x):(a=s?0:i.x>r.x?4:2,e.isVert!==n.isVert?u=n.cells[0]===o?4:2:u=0,f=t.bb.LL.x,d=t.bb.LL.y,c=o.bb.LL.y),uw(!e.isVert,f,d,c,a,u)}function aZ(e,n,t,o,r){let i,s,l,a,u=0;return e.isVert?(i=r.y>o.y?1:3,s=n.bb.LL.y,l=n.bb.LL.x,a=t.bb.LL.x):(i=r.x>o.x?4:2,s=n.bb.LL.x,l=n.bb.LL.y,a=t.bb.LL.y),uw(!e.isVert,s,l,a,i,u)}function uZ(e,n){n.indNo=e.segList.length,e.segList.push(n)}function dw(e,n){for(let t of e)for(let o of t.segs){let r=o.isVert?n.vchans:n.hchans,i=Mt(r,o.commCoord,o.p);i&&uZ(i,o)}}function O1(e,n){let t=Mt(n.vchans,e.commCoord,e.p);if(!t)return e.commCoord;let o=(e.trackNo??1)/(t.segList.length+1);return t.cp.bb.LL.x+o*(t.cp.bb.UR.x-t.cp.bb.LL.x)}function D1(e,n){let t=Mt(n.hchans,e.commCoord,e.p);if(!t)return e.commCoord;let o=1-(e.trackNo??1)/(t.segList.length+1),r=t.cp.bb.LL.y,i=t.cp.bb.UR.y;return A(r+o*(i-r))}function Il(e,n,t,o){return e===o&&n!==o||e===0&&n===t?0:-1}function rw(e,n,t,o){return e.p.p2<n.p.p2?e.l2===t&&n.l1===o?-1:e.l2===o&&n.l1===t?1:0:e.p.p2>n.p.p2?n.l1===o&&n.l2===o?-1:n.l1===t&&n.l2===t?1:0:n.l1===o?Il(e.l2,n.l2,t,o):-1*Il(n.l2,e.l2,t,o)}function I1(e,n,t){return e===t?n===t?-1:0:1}function fZ(e,n,t,o){return e.p.p2<n.p.p2?e.l2===t?Il(n.l1,e.l1,t,o):-1*Il(n.l1,e.l1,t,o):e.p.p2>n.p.p2?n.l2===o?Il(e.l1,n.l1,t,o):-1*Il(e.l1,n.l1,t,o):dZ(e,n,t,o)}function dZ(e,n,t,o){return e.l1===n.l1&&e.l2===n.l2?0:n.l1===n.l2?n.l1===t?1:n.l1===o?-1:e.l1!==t&&e.l2!==t?1:e.l1!==o&&e.l2!==o?-1:0:n.l1===t&&n.l2===o?e.l1!==t&&e.l2===o?1:e.l1===t&&e.l2!==o?-1:0:n.l2===t&&n.l1===o?e.l2!==t&&e.l1===o?1:e.l2===t&&e.l1!==o?-1:0:n.l1===0&&n.l2===t?I1(e.l1,e.l2,t):n.l1===0&&n.l2===o?-1*I1(e.l1,e.l2,o):n.l1===t&&n.l2===0?I1(e.l2,e.l1,t):-1*I1(e.l2,e.l1,o)}function iw(e,n,t,o){return e.p.p2<n.p.p1||e.p.p1>n.p.p2?0:e.p.p1<n.p.p1&&n.p.p1<e.p.p2?rw(e,n,t,o):n.p.p1<e.p.p1&&e.p.p1<n.p.p2?-1*rw(n,e,t,o):e.p.p1===n.p.p1?fZ(e,n,t,o):e.p.p2===n.p.p1?e.l2===n.l1?0:e.l2===o?1:-1:e.l1===n.l2?0:e.l1===o?1:-1}function zx(e,n){return e.isVert!==n.isVert||e.commCoord!==n.commCoord?-2:e.isVert?iw(e,n,4,2):iw(e,n,3,1)}function cZ(e){let n=e.segList.length,t=e.G;for(let o=0;o+1<n;o++)for(let r=o+1;r<n;r++){let i=zx(e.segList[o],e.segList[r]);if(i===-2)return-1;i>0?Gi(t,o,r):i===-1&&Gi(t,r,o)}return 0}function sw(e){for(let[,n]of Ll(e))if(n.segList.length>0&&cZ(n)!==0)return-1;return 0}function lw(e){for(let[,n]of Ll(e))n.G=kx(n.segList.length)}function aw(e){for(let[,n]of Ll(e))if(n.segList.length>0&&n.G){GS(n.G);for(let t=0;t<n.segList.length;t++)n.segList[t].trackNo=n.G.vertices[t].topsortOrder+1}}function cw(e){return lw(e.hchans),lw(e.vchans),sw(e.hchans)!==0||sw(e.vchans)!==0||Fx(e.hchans,e)!==0||Fx(e.vchans,e)!==0?-1:(aw(e.hchans),aw(e.vchans),0)}function pZ(e){let n=e.tail.coord?e.tail.coord.x:(e.tail.bb.LL.x+e.tail.bb.UR.x)/2,t=e.tail.coord?e.tail.coord.y:(e.tail.bb.LL.y+e.tail.bb.UR.y)/2,o=e.head.coord?e.head.coord.x:(e.head.bb.LL.x+e.head.bb.UR.x)/2,r=e.head.coord?e.head.coord.y:(e.head.bb.LL.y+e.head.bb.UR.y)/2,i=n-o,s=t-r;return i*i+s*s}function mZ(e,n){return e.d<n.d?-1:e.d>n.d?1:0}function xZ(e,n,t){let o=[];if(n.segs.length===0)return o;let r=e.tailPoint??{x:(e.tail.bb.LL.x+e.tail.bb.UR.x)/2,y:(e.tail.bb.LL.y+e.tail.bb.UR.y)/2},i=e.headPoint??{x:(e.head.bb.LL.x+e.head.bb.UR.x)/2,y:(e.head.bb.LL.y+e.head.bb.UR.y)/2},s=n.segs[0],l;s.isVert?l={x:O1(s,t),y:r.y}:l={x:r.x,y:D1(s,t)},o.push({...l}),o.push({...l});for(let a=1;a<n.segs.length;a++)s=n.segs[a],s.isVert?l={x:O1(s,t),y:l.y}:l={x:l.x,y:D1(s,t)},o.push({...l}),o.push({...l}),o.push({...l});return s.isVert?l={x:O1(s,t),y:i.y}:l={x:i.x,y:D1(s,t)},o.push({...l}),o.push({...l}),o}function B1(e,n,t){n&&(console.warn(`Orthogonal edges do not currently handle edge labels. Try using xlabels.
65
- `),n=!1);let o=ew(e),r=o.sg,i=e.edges.map(c=>({e:c,d:pZ(c)}));be(i,mZ);let s=i.length,l=new Array(s).fill(null).map(()=>({segs:[]})),a=r.nnodes,u=WS(r),f=r.nodes[a],d=r.nodes[a+1];for(;r.nodes.length<a+2;)r.nodes.push({nVal:0,nIdx:0,nDad:null,nEdge:null,nAdj:0,saveNAdj:0,cells:[null,null],adjEdgeList:[],index:r.nodes.length,isVert:!1,x:0,y:0});for(let c=0;c<s;c++){let m=i[c].e,b=o.gcells[e.nodes.indexOf(m.tail)],g=o.gcells[e.nodes.indexOf(m.head)];if(b===g?YS(r,b,d,f):(Lx(r,g,d),Lx(r,b,f)),$S(u,r,d,f)!==0){return}l[c]=fw(r,f,d),XS(r)}if(o.hchans=LS(o),o.vchans=IS(o),dw(l,o),cw(o)!==0){return}if(t)for(let c=0;c<s;c++){let m=xZ(i[c].e,l[c],o);m.length>0&&t(e,i[c].e,m,!0)}}function hZ(e){return e.map(n=>({bb:{LL:{x:n.info.coord.x-n.info.lw,y:n.info.coord.y-n.info.ht/2},UR:{x:n.info.coord.x+n.info.rw,y:n.info.coord.y+n.info.ht/2}},coord:{x:n.info.coord.x,y:n.info.coord.y},xsize:n.info.lw+n.info.rw,ysize:n.info.ht}))}function bZ(e,n,t){let o=W(e).info.concentrate??!1,r=new Map;n.forEach((a,u)=>r.set(a,u));let i=Xo(e),s=new Set,l=[];for(let a of n){let u=i.get(a);if(u!==void 0){for(let f of u)if(f.tail!==f.head){if(o){let d=f.tail.id,c=f.head.id,m=d<=c?`${d},${c}`:`${c},${d}`;if(s.has(m))continue;s.add(m)}l.push({tail:t[r.get(f.tail)],head:t[r.get(f.head)],tailPoint:{x:f.tail.info.coord.x+f.info.tail_port.p.x,y:f.tail.info.coord.y+f.info.tail_port.p.y},headPoint:{x:f.head.info.coord.x+f.info.head_port.p.x,y:f.head.info.coord.y+f.info.head_port.p.y},_edge:f})}}}return l}function gZ(e){let n=M(e),t=hZ(n);return{nodes:t,edges:bZ(e,n,t)}}var yZ={...Ce(),ignoreSwap:!0,isOrtho:!0};function PZ(e,n){let t=e._edge;t&&Z(t,t.head,n,n.length,yZ)}function jx(e,n){B1(gZ(e),n,(t,o,r)=>PZ(o,r))}function Fu(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}function pw(e,n){return{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}var EZ=2,vZ=3;function F1(e,n){return{x:e.x+n.x,y:e.y+n.y}}function SZ(e){let n=e.info.bb;return{x:(n.ll.x+n.ur.x)/2,y:(n.ll.y+n.ur.y)/2}}function wZ(e,n){let t=n.tail,o=n.head,r=e.length;for(let i=0;i<r;i++){let s=e[i===0?r-1:i-1],l=e[i];if(s===t&&l===o)return!0}return!1}function NZ(e,n){let t=n.length;for(let o of e)if(o.length===t){let r=!0;for(let i of o)if(!n.includes(i)){r=!1;break}if(r)return!1}return!0}function mw(e,n,t,o,r){if(t.includes(n))n===o&&NZ(r,t)&&r.push([...t]);else{t.push(n);for(let i of n.outEdges(e))mw(e,i.head,t,o,r);t.length>0&&t.pop()}}function RZ(e){let n=[];for(let t of M(e))mw(e,t,[],t,n);return n}function TZ(e,n,t){let o=null;for(let r of e){let i=r.length;i<t||(o===null||o.length>i)&&wZ(r,n)&&(o=r)}return o}function kZ(e,n){let t=RZ(e),o=TZ(t,n,3);if(o===null)return SZ(e);let r=0,i=0,s=0;for(let l of o)r+=l.info.coord.x,i+=l.info.coord.y,s++;return{x:r/s,y:i/s}}function CZ(e,n){let t=pw(e[0],e[3]),r=Fu(e[3],e[0])/5,i=n.x-t.x,s=n.y-t.y,l=Math.hypot(i,s);if(l===0)return;let a=t.x-i/l*r,u=t.y-s/l*r;e[1].x=e[2].x=a,e[1].y=e[2].y=u}function _Z(e){if(e.attrs.has("labelangle")||e.attrs.has("labeldistance"))return!0;for(let n of e.edges)if(n.attrs.has("labelangle")||n.attrs.has("labeldistance"))return!0;return!1}function ao(e){let n=W(e.tail.root);_Z(n)&&(e.info.head_label&&!e.info.head_label.set&&Cu(e,!0)&&un(n,e.info.head_label),e.info.tail_label&&!e.info.tail_label.set&&Cu(e,!1)&&un(n,e.info.tail_label))}function AZ(e){return e.root.info.nodesep??18}function GZ(e,n,t){if(Bs(e[0],e[3],.001))return e[1]={...e[0]},e[2]={...e[3]},{x:0,y:0};let o={x:e[0].y-e[3].y,y:e[3].x-e[0].x},r=Math.hypot(o.x,o.y),i=Math.trunc(AZ(t)),s=Math.trunc(i*(n-1)/2);return e[1].x=e[0].x+s*o.x/r,e[1].y=e[0].y+s*o.y/r,e[2].x=e[3].x+s*o.x/r,e[2].y=e[3].y+s*o.y/r,{x:-i*o.x/r,y:-i*o.y/r}}function MZ(e,n,t){let o=[];if(n.head===t)for(let r=0;r<4;r++)o[r]={...e[r]};else for(let r=0;r<4;r++)o[3-r]={...e[r]};return o}function LZ(e,n,t,o){if(t===vZ){let r=no(n);Z(e,e.head,r,r.length,o);return}Z(e,e.head,n,4,o)}function wr(e,n,t,o,r){let i=o===EZ,s=n[0],l=s.head,a=F1(s.tail.info.coord,s.info.tail_port.p),u=F1(l.info.coord,s.info.head_port.p),f=[{...a},{...a},{...u},{...u}];if(t===1||(W(e).info.concentrate??!1)){i&&CZ(f,kZ(e,n[0])),Z(s,s.head,f,4,r),ao(s);return}let d=GZ(f,t,e);for(let c=0;c<t;c++){let m=n[c];LZ(m,MZ(f,m,l),o,r),ao(m),f[1]=F1(f[1],d),f[2]=F1(f[2],d)}}function IZ(e,n){let t=e[n],o=Gt(t),[r,i]=ju(t,o),s=(Nr(t)&z1)===Hu,l=1;for(;n+l<e.length;){let a=e[n+l],u=Gt(a);if(u!==o)break;if((t.info.adjacent??0)!==0){l++;continue}let[f,d]=ju(a,u);if(zu(r,f)!==0||zu(i,d)!==0||s&&t.info.label!==a.info.label||(Nr(a)&Hx)!==0)break;l++}return l}function xw(e){return In(e).seq}function hw(e){let n=new Set,t=[];for(let o of e){let r=In(o);n.has(r)||(n.add(r),t.push(r))}return t}function OZ(e,n,t){let o=n[0];if(o.tail===o.head){ME(e,n,n.length,t.multisep,Ce());for(let i of n){let s=i.info.label;s&&un(e,s)}return}if(_e(o.tail)===_e(o.head))return;let r=hw(n);if(r.length<=1){let i=DE(e,o);if(i!==null){t.runOrigs.add(i);return}let s=In(r[0]);gx(s,e);return}$E(e,r,t.multisep)}function DZ(e,n){let t=hw(n);t.sort((o,r)=>xw(o)-xw(r)),wr(e,t,t.length,Pr,Ce());for(let o of t)En(o)&&On(o)}function BZ(e,n,t,o){let r=IZ(n,t);return o.et===Pr?(DZ(e,n.slice(t,t+r)),r):(OZ(e,n.slice(t,t+r),o),r)}function bw(e,n,t,o){let r={multisep:t,et:o,runOrigs:new Set};for(let i=0;i<n.length;)i+=BZ(e,n,i,r);return r.runOrigs}var Vx=1,Hu=2,FZ=3,zZ=4,z1=7,j1=16,Ux=32,Hx=64,U5=128,gw=192,Kn=0,le=1,Pr=2,vr=3,Dl=4,an=5,jZ=6;function ht(e){return e.info.flags&15}var HZ={curved:Pr,compound:jZ,false:le,line:le,none:Kn,no:le,ortho:Dl,polyline:vr,spline:an,true:an,yes:an};function Pw(e,n){if(e==="")return n;if(e[0]==="0")return le;if(e[0]>="1"&&e[0]<="9")return an;let t=HZ[e.toLowerCase()];return t!==void 0?t:n}function _e(e){return e.info.rank??0}function je(e){return e.info.order??0}function Ti(e){return e.info.coord?.x??0}function Nr(e){return e.info.tree_index??0}function Gt(e){let n=e;for(;n.info.to_virt;)n=n.info.to_virt;for(;n.info.to_orig;)n=n.info.to_orig;return n}function In(e){let n=e;for(;n.info.to_orig;)n=n.info.to_orig;return n}function VZ(e){return _e(e.head)<_e(e.tail)}function UZ(e){return _e(e.head)>_e(e.tail)}function En(e){let n=In(e);return UZ(n)?!1:VZ(n)?!0:je(n.head)<je(n.tail)}function vn(e){return(e.info.node_type??0)===U&&((e.info.in?.size??0)>1||(e.info.out?.size??0)>1)}function XZ(e,n){return n!==0?n:e.tail===e.head?e.info.tail_port.defined||e.info.head_port.defined?zZ:FZ:_e(e.tail)===_e(e.head)?Hu:Vx}function $Z(e){return _e(e.tail)<_e(e.head)?j1:Ux}function WZ(e){return je(e.tail)<je(e.head)?j1:Ux}function YZ(e,n,t){return t!==0?t:n===Vx?$Z(e):n===Hu?WZ(e):j1}function r1(e,n,t,o){let r=XZ(e,n),i=YZ(e,r,t);e.info.tree_index=r|i|o}function Ol(e,n){return e<n?-1:e>n?1:0}function JZ(e,n){let t=Math.abs(_e(e.tail)-_e(e.head)),o=Math.abs(_e(n.tail)-_e(n.head));return Ol(t,o)}function KZ(e,n){let t=Math.abs(Ti(e.tail)-Ti(e.head)),o=Math.abs(Ti(n.tail)-Ti(n.head));return Ol(t,o)}function zu(e,n){return n.defined?!e.defined||e.p.x<n.p.x?-1:e.p.x>n.p.x?1:e.p.y<n.p.y?-1:e.p.y>n.p.y?1:0:e.defined?1:0}function ju(e,n){let t=e.info.tail_port.defined||e.info.head_port.defined?e:n;return Nr(t)&Ux?[t.info.head_port,t.info.tail_port]:[t.info.tail_port,t.info.head_port]}function qZ(e,n){let t=Ol(Nr(n)&z1,Nr(e)&z1);if(t!==0)return t;let o=Gt(e),r=Gt(n),i=JZ(o,r);if(i!==0)return i;let s=KZ(o,r);if(s!==0)return s;let l=Ol(o.seq,r.seq);if(l!==0)return l;let[a,u]=ju(e,o),[f,d]=ju(n,r),c=zu(a,f);if(c!==0)return c;let m=zu(u,d);if(m!==0)return m;let b=Ol(Nr(e)&gw,Nr(n)&gw);return b!==0?b:Ol(e.seq,n.seq)}function QZ(e){let n=e.size;for(let r=0;r<Math.floor(n/2);r++){let i=e.list[r];e.list[r]=e.list[n-1-r],e.list[n-1-r]=i}let t=e.sflag;e.sflag=e.eflag,e.eflag=t;let o=e.sp;e.sp=e.ep,e.ep=o}function ZZ(e){e.list.reverse();for(let n of e.list)QZ(n)}function On(e){if(e.info.spl===void 0)return;ZZ(e.info.spl);let n=e.info.tailArrowOps;e.info.tailArrowOps=e.info.headArrowOps,e.info.headArrowOps=n}function eee(e){for(let n of M(e))for(let t=0;t<(n.info.out?.size??0);t++){let o=n.info.out.list[t];En(o)&&On(o)}}function nee(e){let n=e.info.edge_type??0;return n===tn||n===$n}function tee(e,n){let t=e.info.out?.size??0;for(let o=0;o<t;o++){let r=e.info.out.list[o];nee(r)||(r1(r,Vx,j1,Hx),n.push(r))}}function oee(e,n){let t=e.info.flat_out?.size??0;for(let o=0;o<t;o++){let r=e.info.flat_out.list[o];r1(r,Hu,0,U5),n.push(r)}}function ree(e){return(e.info.node_type??B)===B||vn(e)}function yw(e,n){ree(e)&&(tee(e,n),oee(e,n),GE(e,n))}function iee(e,n){let t=e.info.rank;if(t===void 0||e.info.minrank===void 0||e.info.maxrank===void 0){for(let o of e.nodes.values())yw(o,n);return}for(let o=e.info.minrank;o<=e.info.maxrank;o++){let r=t[o];if(r!==void 0)for(let i=0;i<r.n;i++){let s=r.v[i];s!=null&&yw(s,n)}}}function Ew(e){for(let n of M(e))if(n.info.other&&n.info.other.list.length>0){let t=n.info.rw;n.info.rw=n.info.mval??0,n.info.mval=t}}function see(e){return Ew(e),((e.root.info.has_labels??0)&on)!==0?(Mv(e),jx(e,!0)):jx(e,!1),fx(e),e.info.edgeLabelsDone=!0,0}function lee(e){Ew(e),((e.root.info.has_labels??0)&on)!==0&&console.warn(`edge labels with splines=curved not supported in dot - use xlabels
66
- `)}function aee(e,n,t){_u(e),t&&eee(e),n!==Pr&&hS(e),fx(e),e.info.edgeLabelsDone=!0}function mx(e,n){let t=ht(e);if(t===Kn)return 0;if(t===Dl)return see(e);t===Pr&&lee(e),pi(e),G5(e);let o=[];iee(e,o),be(o,qZ),t===le&&_u(e);let r=bw(e,o,e.info.nodesep??18,t);return n&&uee(r),aee(e,t,n),0}function uee(e){for(let n of e)En(n)&&On(n)}function vw(e){return mx(e,!0)}function Uu(e,n){return e<n?-1:e>n?1:0}function Rr(e,n){return e.x>=n.ll.x&&e.x<=n.ur.x&&e.y>=n.ll.y&&e.y<=n.ur.y}function Tr(e,n){return{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}function H1(e,n){let t=1-n;return[{x:t*e[0].x+n*e[1].x,y:t*e[0].y+n*e[1].y},{x:t*e[1].x+n*e[2].x,y:t*e[1].y+n*e[2].y},{x:t*e[2].x+n*e[3].x,y:t*e[2].y+n*e[3].y},{x:0,y:0}]}function Bl(e,n,t){let o=[{...e[0]},{...e[1]},{...e[2]},{...e[3]}],r=H1(o,n),i=H1(r,n),s=H1(i,n);return t==="left"?[o[0],r[0],i[0],s[0]]:[s[0],i[1],r[2],o[3]]}function Nw(e,n){let t=Uu(e[0].x,n),o=t===0?1:0;for(let r=1;r<=3;r++){let i=t;t=Uu(e[r].x,n),t!==i&&i!==0&&o++}return o}function Rw(e,n){let t=Uu(e[0].y,n),o=t===0?1:0;for(let r=1;r<=3;r++){let i=t;t=Uu(e[r].y,n),t!==i&&i!==0&&o++}return o}function Sw(e,n){return{coord:n==="left"?e.ll.x:e.ur.x,lo:e.ll.y,hi:e.ur.y}}function ww(e,n){return{coord:n==="bottom"?e.ll.y:e.ur.y,lo:e.ll.x,hi:e.ur.x}}function fee(e,n,t){return e.y>=n.lo&&e.y<=n.hi?t:-1}function dee(e,n,t){return e.x>=n.lo&&e.x<=n.hi?t:-1}function cee(e,n,t,o){let r=(n+t)/2,i=V1(Bl(e,.5,"left"),n,r,o);return i>=0?i:V1(Bl(e,.5,"right"),r,t,o)}function V1(e,n,t,o){if(n===t)return n;let r=Nw(e,o.coord);return r===0?-1:r===1&&Math.abs(e[3].x-o.coord)<=.005?fee(e[3],o,t):cee(e,n,t,o)}function pee(e,n,t,o){let r=(n+t)/2,i=U1(Bl(e,.5,"left"),n,r,o);return i>=0?i:U1(Bl(e,.5,"right"),r,t,o)}function U1(e,n,t,o){if(n===t)return n;let r=Rw(e,o.coord);return r===0?-1:r===1&&Math.abs(e[3].y-o.coord)<=.005?dee(e[3],o,t):pee(e,n,t,o)}function Vu(e,n,t,o){if(e<0||e>=n)return n;let r=Bl(t,e,"left");for(let i=0;i<4;i++)o[i]=r[i];return e}function X1(e,n){let t=2,o=e.map(r=>({...r}));return t=Vu(V1(e,0,1,Sw(n,"left")),t,o,e),t=Vu(V1(e,0,Math.min(1,t),Sw(n,"right")),t,o,e),t=Vu(U1(e,0,Math.min(1,t),ww(n,"bottom")),t,o,e),t=Vu(U1(e,0,Math.min(1,t),ww(n,"top")),t,o,e),t<2}function Tw(e,n,t){if(n.x>=t.ll.x)return null;let o=t.ll.x,r=e.y+A((o-e.x)*(e.y-n.y)/(e.x-n.x));return r>=t.ll.y&&r<=t.ur.y?{x:o,y:r}:null}function kw(e,n,t){if(n.x<=t.ur.x)return null;let o=t.ur.x,r=e.y+A((o-e.x)*(e.y-n.y)/(e.x-n.x));return r>=t.ll.y&&r<=t.ur.y?{x:o,y:r}:null}function Cw(e,n,t){if(n.y>=t.ll.y)return null;let o=t.ll.y,r=e.x+A((o-e.y)*(e.x-n.x)/(e.y-n.y));return r>=t.ll.x&&r<=t.ur.x?{x:r,y:o}:null}function _w(e,n,t){if(n.y<=t.ur.y)return null;let o=t.ur.y,r=e.x+A((o-e.y)*(e.x-n.x)/(e.y-n.y));return r>=t.ll.x&&r<=t.ur.x?{x:r,y:o}:null}function Fl(e,n,t){return Tw(e,n,t)??kw(e,n,t)??Cw(e,n,t)??_w(e,n,t)??{x:e.x,y:e.y}}function Mw(e,n){let t=e.info.n_cluster??0;for(let o=1;o<=t;o++){let r=e.info.clust[o-1];n.has(r.name)||n.set(r.name,r),Mw(r,n)}}function mee(e){let n=new Map;return Mw(e,n),n}function Lw(e,n){let{e:t,bez:o}=e,r=rr(vo(t,"head"),Xs(t),Pl(t));o.eflag=o.eflag||1,o.ep={...o.list[n+3]},n>e.starti&&Fu(o.list[n],o.list[n+3])<r&&(n-=3);let i=[o.list[n],o.list[n+1],o.list[n+2],o.list[n+3]],s=$d(i,o.ep,r);for(let l=0;l<4;l++)o.list[n+l]=s[l];return n}function Iw(e,n,t){let{e:o,bez:r}=e,i=rr(vo(o,"tail"),Xs(o),Pl(o));r.sflag=r.sflag||1,r.sp={...r.list[n]},t>n&&Fu(r.list[n],r.list[n+3])<i&&(n+=3);let s=[r.list[n],r.list[n+1],r.list[n+2],r.list[n+3]],l=_2(s,r.sp,i);for(let a=0;a<4;a++)r.list[n+a]=l[a];return n}function xee(e,n,t){let{bez:o}=e,r=Fl(o.list[0],t,n);o.list[3]=r,o.list[1]=Tr(r,t),o.list[0]=Tr(o.list[1],t),o.list[2]=Tr(o.list[1],r);let i=o.eflag?Lw(e,0):0;e.endi=i+3}function hee(e,n){let{bez:t,size:o}=e;for(e.endi=0;e.endi<o-1;e.endi+=3){let r=[0,1,2,3].map(i=>({...t.list[e.endi+i]}));if(X1(r,n)){for(let i=0;i<4;i++)t.list[e.endi+i]=r[i];break}}e.endi===o-1&&t.eflag?t.ep=Fl(t.ep,t.list[e.endi],n):e.endi<o-1&&(t.eflag&&(e.endi=Lw(e,e.endi)),e.endi+=3)}function bee(e,n){return Rr(e.bez.list[0],n)?e.bez.sflag&&!Rr(e.bez.sp,n)?(xee(e,n,e.bez.sp),!0):!1:(hee(e,n),!0)}function gee(e,n,t){return t?bee(e,n):!1}function yee(e,n){let{bez:t}=e,o=t.ep,r=Fl(t.list[e.endi],o,n);e.starti=e.endi-3;let i=e.starti;t.list[i]=r,t.list[i+2]=Tr(r,o),t.list[i+3]=Tr(t.list[i+2],o),t.list[i+1]=Tr(t.list[i+2],r),t.sflag&&(e.starti=Iw(e,e.starti,e.endi-3))}function Pee(e,n){let{bez:t}=e;for(e.starti=e.endi;e.starti>0;e.starti-=3){let o=[0,1,2,3].map(r=>({...t.list[e.starti-r]}));if(X1(o,n)){for(let r=0;r<4;r++)t.list[e.starti-r]=o[r];break}}e.starti===0&&t.sflag?t.sp=Fl(t.sp,t.list[e.starti],n):e.starti!==0&&(e.starti-=3,t.sflag&&(e.starti=Iw(e,e.starti,e.endi-3)))}function Eee(e,n){return Rr(e.bez.list[e.endi],n)?e.bez.eflag&&!Rr(e.bez.ep,n)?(yee(e,n),!0):!1:(Pee(e,n),!0)}function vee(e,n,t){return t?Eee(e,n):!1}function Aw(e,n){return e?n.get(e)??null:null}function See(e,n){let t=e.attrs.get("lhead")??e.info.lhead,o=e.attrs.get("ltail")??e.info.ltail;return{lh:Aw(t,n),lt:Aw(o,n)}}function wee(e){return e.info.spl?e.info.spl.size<=1:!1}function Nee(e){let{bez:n,endi:t,starti:o}=e,r=[];for(let i=o;i<=t;i++)r.push({...n.list[i]});n.list=r,n.size=r.length}function Gw(e,n,t,o){let r={x:t.x-n.x,y:t.y-n.y},i=$s(e,o?"tail":"head",n,r,bu(e));o?e.info.tailArrowOps=i:e.info.headArrowOps=i}function Ree(e,n,t,o){let r=!1;t!=null&&(r=gee(n,t.info.bb,Rr(e.head.info.coord,t.info.bb))),r||(n.endi=n.size-1);let i=o!=null&&vee(n,o.info.bb,Rr(e.tail.info.coord,o.info.bb));return{headClipped:r,tailClipped:i}}function Tee(e,n){let{lh:t,lt:o}=See(e,n);if(!t&&!o||!wee(e))return;let r=e.info.spl.list[0],i={e,bez:r,size:r.size,endi:0,starti:0},{headClipped:s,tailClipped:l}=Ree(e,i,t,o);Nee(i),s&&r.eflag&&Gw(e,r.ep,r.list[r.list.length-1],!1),l&&r.sflag&&Gw(e,r.sp,r.list[0],!0)}function Ow(e){let n=mee(e);for(let t of e.edges)Tee(t,n)}var $1=.013888888888888888;function W1(e){return e*$1}function Dw(e,n){n.rowMajor?++e.col.val===n.nc&&(e.col.val=0,e.row.val++):++e.row.val===n.nr&&(e.row.val=0,e.col.val++)}function kee(e,n){let t=n.sz;if(n.flags&1){let r=t>0?t:Math.ceil(Math.sqrt(e));return{nc:Math.ceil(e/r),nr:r,rowMajor:!1}}let o=t>0?t:Math.ceil(Math.sqrt(e));return{nc:o,nr:Math.ceil(e/o),rowMajor:!0}}function Cee(e,n,t){let o=[];for(let r=0;r<e;r++){let i=n[r];i!==void 0&&o.push({width:i.ur.x-i.ll.x+t,height:i.ur.y-i.ll.y+t,index:r})}return o}function _ee(e,n,t){return(t[e.index]??0)-(t[n.index]??0)}function Aee(e,n){return n.height+n.width-(e.height+e.width)}function Gee(e,n){let t=[...e];if(n.flags&2&&n.vals!==null){let o=n.vals;be(t,(r,i)=>_ee(r,i,o))}else n.flags&64||be(t,Aee);return t}function Mee(e,n,t,o){let r={col:{val:0},row:{val:0}};for(let i of e)n[r.col.val]=Math.max(n[r.col.val]??0,i.width),t[r.row.val]=Math.max(t[r.row.val]??0,i.height),Dw(r,o)}function Lee(e){let n=0;for(let t=0;t<e.length;t++){let o=e[t]??0;e[t]=n,n+=o}}function Iee(e,n){let t=0;for(let o=n;o>0;o--){let r=e[o-1]??0;e[o]=t,t+=r}e[0]=t}function Oee(e,n,t,o){let r=n[t]??0,i=n[t+1]??0;return e&4?A(r):e&8?A(i-(o.ur.x-o.ll.x)):A((r+i-o.ur.x-o.ll.x)/2)}function Dee(e,n,t,o){let r=n[t]??0,i=n[t+1]??0;return e&16?A(r-(o.ur.y-o.ll.y)):e&32?A(i):A((r+i-o.ur.y-o.ll.y)/2)}function Bee(e,n,t,o,r){let i=new Array(n.length).fill({x:0,y:0}),s={col:{val:0},row:{val:0}};for(let l of e){let a=n[l.index];a!==void 0&&(i[l.index]={x:Oee(t,o.widths,s.col.val,a),y:Dee(t,o.heights,s.row.val,a)}),Dw(s,r)}return i}function Xu(e,n,t){let o=kee(e,t),r=Gee(Cee(e,n,t.margin),t),i=new Array(o.nc+1).fill(0),s=new Array(o.nr+1).fill(0);return Mee(r,i,s,o),Lee(i),Iee(s,o.nr),Bee(r,n,t.flags,{widths:i,heights:s},o)}function uo(e,n,t,o,r,i){for(;!o(e);){let s=Y1(e.x,e.y,r,i);if(s!==null)return s;e.x+=n,e.y+=t}return null}function Fee(e,n,t){let o={x:0,y:-e};return uo(o,1,0,r=>r.x>=e,n,t)??uo(o,0,1,r=>r.y>=e,n,t)??uo(o,-1,0,r=>r.x<=-e,n,t)??uo(o,0,-1,r=>r.y<=-e,n,t)??uo(o,1,0,r=>r.x>=0,n,t)}function zee(e,n,t){let o={x:-e,y:0};return uo(o,0,-1,r=>r.y<=-e,n,t)??uo(o,1,0,r=>r.x>=e,n,t)??uo(o,0,1,r=>r.y>=e,n,t)??uo(o,-1,0,r=>r.x<=-e,n,t)??uo(o,0,-1,r=>r.y<=0,n,t)}function jee(e,n){for(let t=1;;t++){let o=Fee(t,e,n);if(o!==null)return o}}function Hee(e,n){for(let t=1;;t++){let o=zee(t,e,n);if(o!==null)return o}}function Bw(e,n,t){return t?jee(e,n):Hee(e,n)}var Vee=100;function Fw(e,n){return`${A(e)},${A(n)}`}function Uee(e,n){return e.has(Fw(n.x,n.y))}function Xee(e,n){e.add(Fw(n.x,n.y))}function $ee(e,n,t){let o=0,r=0,i=Vee*e-1;for(let a=0;a<e;a++){let u=n[a];if(u===void 0)continue;let f=u.ur.x-u.ll.x+2*t,d=u.ur.y-u.ll.y+2*t;o-=f+d,r-=f*d}let s=o*o-4*i*r;if(s<0)return 1;let l=Math.floor((-o+Math.sqrt(s))/(2*i));return l<=0?1:l}function K1(e,n){return Math.ceil(e/n)}function J1(e,n){return e>=0?e/n:(e+1)/n-1}function Wee(e){let{bb:n,ssize:t,margin:o,idx:r}=e,i=A(n.ur.x)-A(n.ll.x),s=A(n.ur.y)-A(n.ll.y),l=A(J1(-o,t)),a=A(J1(-o,t)),u=A(J1(i+o,t)),f=A(J1(s+o,t)),d=[];for(let b=l;b<=u;b++)for(let g=a;g<=f;g++)d.push({x:b,y:g});let c=K1(n.ur.x-n.ll.x+2*o,t),m=K1(n.ur.y-n.ll.y+2*o,t);return{perim:c+m,cells:d,index:r}}function Yee(e,n,t,o){for(let r=0;r<e.length;r++){let i=e[r];if(i!==void 0&&Uee(o,{x:i.x+n,y:i.y+t}))return!0}return!1}function Jee(e,n,t,o){for(let r=0;r<e.length;r++){let i=e[r];i!==void 0&&Xee(o,{x:i.x+n,y:i.y+t})}}function Y1(e,n,t,o){if(Yee(t.cells,e,n,o.ps))return null;let r=o.bbs[t.index];if(r===void 0)return null;let i={x:o.step*e-A(r.ll.x),y:o.step*n-A(r.ll.y)};return Jee(t.cells,e,n,o.ps),i}function Kee(e,n,t){let o=n.bbs[e.index];if(o===void 0)return null;let r=K1(o.ur.x-o.ll.x+2*t,n.step),i=K1(o.ur.y-o.ll.y+2*t,n.step);return Y1(-Math.floor(r/2),-Math.floor(i/2),e,n)}function qee(e,n,t,o){if(e===0){let l=Kee(n,t,o);if(l!==null)return l}let r=Y1(0,0,n,t);if(r!==null)return r;let i=t.bbs[n.index],s=i!==void 0&&Math.ceil(i.ur.x-i.ll.x)>=Math.ceil(i.ur.y-i.ll.y);return Bw(n,t,s)}function Qee(e,n){return n.perim-e.perim}function zw(e,n,t){let o=$ee(e,n,t.margin);if(o<=0)return null;let r=[];for(let a=0;a<e;a++){let u=n[a];u!==void 0&&r.push(Wee({bb:u,ssize:o,margin:t.margin,idx:a}))}let i=be([...r],Qee),s={ps:new Set,step:o,bbs:n},l=new Array(e).fill({x:0,y:0});for(let a=0;a<i.length;a++){let u=i[a];u!==void 0&&(l[u.index]=qee(a,u,s,t.margin))}return l}var Zee=100;function zl(e,n){return Math.ceil(e/n)}function jw(e,n){return e>=0?e/n:(e+1)/n-1}function ene(e,n){return{x:jw(e.x,n),y:jw(e.y,n)}}var $u=class{m=new Map;add(n,t){this.m.set(`${n},${t}`,{x:n,y:t})}has(n){return this.m.has(`${n.x},${n.y}`)}points(){return[...this.m.values()]}get size(){return this.m.size}};function nne(e,n){let t=Zee*e.length-1,o=0,r=0;for(let l of e){let a=l.ur.x-l.ll.x+2*n,u=l.ur.y-l.ll.y+2*n;o-=a+u,r-=a*u}let i=Math.sqrt(o*o-4*t*r),s=Math.trunc((-o+i)/(2*t));return s===0?1:s}function tne(e,n){let t=e.ay-(e.ax>>1);for(;;){if(n.add(e.x,e.y),e.x===e.x2)return;t>=0&&(e.y+=e.sy,t-=e.ax),e.x+=e.sx,t+=e.ay}}function one(e,n){let t=e.ax-(e.ay>>1);for(;;){if(n.add(e.x,e.y),e.y===e.y2)return;t>=0&&(e.x+=e.sx,t-=e.ay),e.y+=e.sy,t+=e.ax}}function q1(e,n,t){let o=A(e.x),r=A(e.y),i=A(n.x),s=A(n.y),l=i-o,a=s-r,u={x:o,y:r,x2:i,y2:s,ax:Math.abs(l)<<1,ay:Math.abs(a)<<1,sx:l>0?1:-1,sy:a>0?1:-1};u.ax>u.ay?tne(u,t):one(u,t)}function Hw(e,n,t){for(let o=e.x;o<=n.x;o++)for(let r=e.y;r<=n.y;r++)t.add(o,r)}function Li(e,n){let t=ene(e,n);return{x:A(t.x),y:A(t.y)}}function rne(e,n,t,o,r,i){let s=e.info.spl;if(!i||s===void 0){let a=e.head.info.coord??{x:0,y:0},u=Li({x:a.x+o.x,y:a.y+o.y},r);q1(n,u,t);return}let l=a=>Li({x:a.x+o.x,y:a.y+o.y},r);for(let a=0;a<s.size;a++){let u=s.list[a];if(u===void 0)continue;let f,d,c;for(u.sflag?(f=l(u.sp),d=l(u.list[0]),c=1):(f=l(u.list[0]),d=l(u.list[1]),c=2),q1(f,d,t);c<u.size;c++)f=d,d=l(u.list[c]),q1(f,d,t);u.eflag&&(f=d,d=l(u.ep),q1(f,d,t))}}function ine(e,n,t,o){let r=new $u,i=A(e.ur.x)-A(e.ll.x),s=A(e.ur.y)-A(e.ll.y),l=Li({x:o.x-t,y:o.y-t},n),a=Li({x:o.x+i+t,y:o.y+s+t},n);return Hw(l,a,r),{cells:r.points(),perim:zl(e.ur.x-e.ll.x+2*t,n)+zl(e.ur.y-e.ll.y+2*t,n),index:0}}function sne(e,n){let t=e.info.coord??{x:0,y:0},o={x:A(t.x)+n.off.x,y:A(t.y)+n.off.y},r={x:A(n.margin+(e.info.lw+e.info.rw)/2),y:A(n.margin+e.info.ht/2)},i=Li({x:o.x-r.x,y:o.y-r.y},n.ssize),s=Li({x:o.x+r.x,y:o.y+r.y},n.ssize);Hw(i,s,n.ps);let l=Li(o,n.ssize);for(let a of e.outEdges(n.eg))rne(a,l,n.ps,n.off,n.ssize,n.doSplines)}function lne(e,n,t,o,r){let i=new $u,s={eg:e,ps:i,off:{x:-A(t.ll.x),y:-A(t.ll.y)},ssize:o,margin:r.margin,doSplines:r.doSplines};for(let l of n.nodes.values())sne(l,s);return{cells:i.points(),perim:zl(t.ur.x-t.ll.x+2*r.margin,o)+zl(t.ur.y-t.ll.y+2*r.margin,o),index:0}}function qx(e,n,t,o){for(let s of t.cells)if(o.ps.has({x:s.x+e,y:s.y+n}))return!1;let r=o.bbs[t.index],i={x:A(r.ll.x),y:A(r.ll.y)};o.places[t.index]={x:o.step*e-i.x,y:o.step*n-i.y};for(let s of t.cells)o.ps.add(s.x+e,s.y+n);return!0}function*ane(e){let n=0,t=-e;for(;n<e;n++)yield[n,t];for(;t<e;t++)yield[n,t];for(;n>-e;n--)yield[n,t];for(;t>-e;t--)yield[n,t];for(;n<0;n++)yield[n,t]}function*une(e){let n=0,t=-e;for(;n>-e;n--)yield[t,n];for(;t<e;t++)yield[t,n];for(;n<e;n++)yield[t,n];for(;t>-e;t--)yield[t,n];for(;n>0;n--)yield[t,n]}function fne(e,n,t){let o=t.bbs[n.index];if(e===0){let i=zl(o.ur.x-o.ll.x+2*t.margin,t.step),s=zl(o.ur.y-o.ll.y+2*t.margin,t.step);if(qx(-Math.trunc(i/2),-Math.trunc(s/2),n,t))return}if(qx(0,0,n,t))return;let r=Math.ceil(o.ur.x-o.ll.x)>=Math.ceil(o.ur.y-o.ll.y);for(let i=1;;i++){let s=r?ane(i):une(i);for(let[l,a]of s)if(qx(l,a,n,t))return}}function Q1(e,n,t,o){if(e.length===0)return null;let r=nne(o,t.margin);if(r<=0)return null;let i={x:0,y:0},s=e.map((u,f)=>{let d=t.mode===3?ine(o[f],r,t.margin,i):lne(n,u,o[f],r,t);return d.index=f,d}),l=be([...s],(u,f)=>f.perim-u.perim),a={ps:new $u,places:e.map(()=>({x:0,y:0})),step:r,margin:t.margin,bbs:o};for(let u=0;u<l.length;u++)fne(u,l[u],a);return a.places}function Vw(e,n,t){return e<=0?[]:t.mode===5||t.mode===2||t.mode===1?null:t.mode===4?Xu(e,n,t):zw(e,n,t)}function dne(e){return e.info.coord!==void 0?e.info.coord.x:0}function cne(e){return e.info.coord!==void 0?e.info.coord.y:0}function pne(e,n,t){let o=dne(n),r=cne(n),i=n.info.lw!==void 0?n.info.lw:18,s=n.info.rw!==void 0?n.info.rw:18,l=n.info.ht!==void 0?n.info.ht:18;e.llx=Math.min(e.llx,o-i-t),e.lly=Math.min(e.lly,r-l/2-t),e.urx=Math.max(e.urx,o+s+t),e.ury=Math.max(e.ury,r+l/2+t)}function mne(e,n,t,o){let r=n.info.spl;if(r!==void 0&&o){let i={ll:{x:e.llx,y:e.lly},ur:{x:e.urx,y:e.ury}};for(let s=0;s<r.size;s++){let l=r.list[s];if(l!==void 0)for(let a=0;a+3<l.size;a+=3){let u=l.list[a],f=l.list[a+1],d=l.list[a+2],c=l.list[a+3];u&&f&&d&&c&&wt(i,[u,f,d,c])}}e.llx=i.ll.x,e.lly=i.ll.y,e.urx=i.ur.x,e.ury=i.ur.y}else if(r!==void 0)for(let i=0;i<r.size;i++){let s=r.list[i];if(s!==void 0)for(let l=0;l<s.size;l++){let a=s.list[l];a!==void 0&&(e.llx=Math.min(e.llx,a.x),e.lly=Math.min(e.lly,a.y),e.urx=Math.max(e.urx,a.x),e.ury=Math.max(e.ury,a.y))}}for(let i of[n.info.label,n.info.head_label,n.info.tail_label,n.info.xlabel]){if(i===void 0||i.set!==!0)continue;let s=(t?i.dimen.y:i.dimen.x)/2,l=(t?i.dimen.x:i.dimen.y)/2;e.llx=Math.min(e.llx,i.pos.x-s),e.lly=Math.min(e.lly,i.pos.y-l),e.urx=Math.max(e.urx,i.pos.x+s),e.ury=Math.max(e.ury,i.pos.y+l)}}function Dn(e,n,t=!1){let o={llx:1/0,lly:1/0,urx:-1/0,ury:-1/0};for(let i of e.nodes.values())pne(o,i,n);let r=e.info.flip===!0;for(let i of e.edges)mne(o,i,r,t);return isFinite(o.llx)?{ll:{x:o.llx,y:o.lly},ur:{x:o.urx,y:o.ury}}:{ll:{x:0,y:0},ur:{x:0,y:0}}}function Qx(e,n,t,o){if(e<=0)return null;let r=n.map(i=>{let s=Dn(i,0);return i.info.bb=s,s});return o.mode<=3?Q1(n,t,o,r):o.mode===4?(o.flags&2&&(o.vals=n.map(i=>{let s=parseInt(i.attrs.get("sortv")??"",10);return!Number.isNaN(s)&&s>=0?s:0})),Xu(e,r,o)):null}function Zx(e,n,t,o){let r=Qx(e,n,t,o);return r?nh(e,n,r,t,o.doSplines):-1}function jl(e,n,t,o){let r=Zx(e,n,t,o);return r===0&&(t.info.bb=Dn(t,0)),r}function Z1(e,n,t){let o=e.info.bb;o!==void 0&&(e.info.bb={ll:{x:o.ll.x+n,y:o.ll.y+t},ur:{x:o.ur.x+n,y:o.ur.y+t}});let r=e.info.label;r?.set&&r.pos&&(r.pos={x:r.pos.x+n,y:r.pos.y+t});let i=e.info.n_cluster??0;for(let s=1;s<=i;s++){let l=e.info.clust?.[s-1];l&&Z1(l,n,t)}}function eh(e,n,t){let o=s=>{let l=s;l?.pos&&(l.pos={x:l.pos.x+n,y:l.pos.y+t})};o(e.info.label),o(e.info.xlabel),o(e.info.head_label),o(e.info.tail_label);let r=e.info.spl;if(!r)return;for(let s of r.list){for(let l=0;l<s.size;l++){let a=s.list[l];s.list[l]={x:a.x+n,y:a.y+t}}s.sflag&&(s.sp={x:s.sp.x+n,y:s.sp.y+t}),s.eflag&&(s.ep={x:s.ep.x+n,y:s.ep.y+t})}let i=s=>s?.map(l=>js(l,a=>({x:a.x+n,y:a.y+t})));e.info.headArrowOps=i(e.info.headArrowOps),e.info.tailArrowOps=i(e.info.tailArrowOps)}function ep(e,n,t){for(let o of e.nodes.values()){let r=o.info.coord??{x:0,y:0};o.info.coord={x:r.x+n,y:r.y+t},o.info.pos&&(o.info.pos[0]=(o.info.pos[0]??0)+n*$1,o.info.pos[1]=(o.info.pos[1]??0)+t*$1)}for(let o of e.edges)eh(o,n,t);Z1(e,n,t)}function Uw(e){let n=e.info.bb.ll;(n.x!==0||n.y!==0)&&ep(e,-n.x,-n.y)}function nh(e,n,t,o,r){for(let i=0;i<e;i++){let s=t[i].x,l=t[i].y;(s!==0||l!==0)&&ep(n[i],s,l)}return 0}function xne(e,n,t){let o=[n],r=[];for(;o.length>0;){let i=o.pop();if(!t.has(i.name)){t.add(i.name),r.push(i);for(let s of e.edges)s.tail===i&&!t.has(s.head.name)&&o.push(s.head),s.head===i&&!t.has(s.tail.name)&&o.push(s.tail)}}return r}function th(e,n,t){let o=new e.constructor(t,"directed");o.info.dotroot=e,o.parent=e,o.root=e.root;for(let i of[...n].sort((s,l)=>s.id-l.id))o.nodes.set(i.name,i);let r=new Set(n);return o.edges=e.edges.filter(i=>r.has(i.tail)&&r.has(i.head)),o}function Cr(e,n){let t=new Set,o=[],r=0;for(let i of e.nodes.values()){if(t.has(i.name))continue;let s=xne(e,i,t);o.push(th(e,s,`${n}_${r++}`))}return o}var hne={c:1,i:64,u:2,t:16,b:32,l:4,r:8};function bne(e,n){if(!e.startsWith("_"))return e;let t=1;for(;t<e.length;){let o=hne[e[t]];if(o===void 0)break;n.flags|=o,t++}return e.slice(t)}function gne(e,n,t){if(t.flags=0,t.mode=n,t.sz=0,t.vals=null,e.startsWith("array")){t.mode=4;let o=bne(e.slice(5),t),r=parseInt(o,10);!Number.isNaN(r)&&r>0&&(t.sz=r)}else if(e.startsWith("aspect")){t.mode=5;let o=parseFloat(e.slice(6));t.aspect=!Number.isNaN(o)&&o>0?o:1}else e==="cluster"?t.mode=1:e==="graph"?t.mode=3:e==="node"&&(t.mode=2);return t.mode}function Xw(e,n){return e.attrs.get(n)??(e!==e.root?e.root.attrs.get(n):void 0)}function oh(e,n,t){return gne(Xw(e,"packmode")??"",n,t)}function rh(e,n,t){let o=Xw(e,"pack");if(o===void 0)return n;let r=parseInt(o,10);return!Number.isNaN(r)&&r>=0?r:o[0]==="t"||o[0]==="T"?t:n}function Bn(e,n,t,o){return o.margin=rh(e,t,t),o.doSplines=!1,o.flags=0,o.fixed=null,o.vals=null,o.sz=0,o.aspect=1,oh(e,n,o)}function Ww(e){let n=e.attrs.get("ratio");return!n||n===""?!0:n==="auto"||n==="compress"||n==="expand"||n==="fill"?!1:!(Number.parseFloat(n)>0)}function ih(e,n){let t=n;for(;e.get(t)!==t;)t=e.get(t);let o=n;for(;e.get(o)!==t;){let r=e.get(o);e.set(o,t),o=r}return t}function $w(e,n,t){let o=ih(e,n),r=ih(e,t);o!==r&&e.set(o,r)}function Yw(e,n){for(let t of e.subgraphs.values())gn(t)&&n.push(t),Yw(t,n)}function yne(e,n,t,o){let r=null;for(let i of M(e))n.nodes.get(i.name)===i&&(r===null&&(r=$o(n,e.name,!0),r.attrs=new Map(e.attrs),r.info.dotroot=t),r.nodes.set(i.name,i));return r!==null&&gn(r)&&o.set(r,e),r}function Jw(e,n,t,o){for(let r of e.subgraphs.values()){let i=yne(r,n,t,o);i!==null&&Jw(r,i,t,o)}}function Kw(e){let n=new Map;for(let l of M(e))n.set(l.name,l.name);for(let l of e.edges)$w(n,l.tail.name,l.head.name);let t=[];Yw(e,t);for(let l of t){let a;for(let u of l.nodes.values())a!==void 0&&$w(n,a,u.name),a=u.name}let o=new Map;for(let l of M(e)){let a=ih(n,l.name),u=o.get(a);u?u.push(l):o.set(a,[l])}let r=new Map,i=[],s=0;for(let l of o.values()){let a=th(e,l,`_cc_${s++}`);Jw(e,a,a,r),i.push(a)}return{comps:i,origOf:r}}function Pne(e,n){e.info.nodesep=n.info.nodesep,e.info.ranksep=n.info.ranksep,e.info.rankdir=n.info.rankdir,e.info.flip=n.info.flip,e.info.concentrate=n.info.concentrate}function Ene(e,n){e.info.dotroot=e,sh(e),Pne(e,n),e.info.has_labels=0,ll(e),xl(e),bl(e),lh(e)}function qw(e,n){let t=n.get(e);if(t===void 0)throw new Error(`mapClust: no original for cluster ${e.name}`);return t}function Qw(e,n,t){n.info.bb=e.info.bb,n.info.label_pos=e.info.label_pos,e.info.border!==void 0&&(n.info.border=[...e.info.border]);let o=e.info.n_cluster??0;n.info.n_cluster=o,n.info.clust=[];for(let r=1;r<=o;r++){let i=e.info.clust[r-1],s=qw(i,t);n.info.clust[r-1]=s,Qw(i,s,t)}n.info.label=e.info.label,e.info.label=void 0}function vne(e,n,t){let o=0;for(let i of e)o+=i.info.n_cluster??0;n.info.n_cluster=o,n.info.clust=[];let r=0;for(let i of e){let s=i.info.n_cluster??0;for(let l=1;l<=s;l++){let a=i.info.clust[l-1],u=qw(a,t);n.info.clust[r++]=u,Qw(a,u,t)}}}function Zw(e,n){let t=e.ll.x,o=e.ll.y,r=e.ur.x,i=e.ur.y,s=n.info.n_cluster??0,l=n.info.clust;for(let a=0;a<s;a++){let u=l?.[a]?.info.bb;u&&(t=Math.min(t,u.ll.x),o=Math.min(o,u.ll.y),r=Math.max(r,u.ur.x),i=Math.max(i,u.ur.y))}return{ll:{x:t,y:o},ur:{x:r,y:i}}}function Sne(e){return Zw(Dn(e,0),e)}function wne(e){e.info.bb&&(e.info.bb=Zw(e.info.bb,e))}function Nne(e,n,t){let o=n.map(Sne);n.forEach((i,s)=>{i.info.bb=o[s]});let r=null;t.mode<=3?r=Q1(n,e,t,o):t.mode===4&&(t.flags&2&&(t.vals=n.map(i=>{let s=parseInt(i.attrs.get("sortv")??"",10);return!Number.isNaN(s)&&s>=0?s:0})),r=Xu(n.length,o,t)),r&&nh(n.length,n,r,e,t.doSplines),e.info.bb=Dn(e,0)}function eN(e,n,t,o){lu(e);for(let r of n)Ene(r,e);Nne(e,n,t),vne(n,e,o),wne(e),Me(e)}function Rne(e,n){e.info.flags=e.info.flags&-16|n&15}function dn(e,n){let t=e.attrs.get("splines");for(let r=e.parent;t===void 0&&r!==null;r=r.parent)t=r.attrs.get("splines");let o;t===void 0?o=n:t===""?o=Kn:o=Pw(t,n),Rne(e,o)}function Tne(e,n,t){let o=e.attrs.get(n);if(o===void 0||o==="")return t;let r=parseInt(o,10);return isNaN(r)?t:r}function sh(e){lu(e),dn(e,an),bc(e),au(e)}function lh(e){Tm(e),Qc(e),vw(e),Ne(e.attrs.get("compound")??e.root.attrs.get("compound"))&&Ow(e)}function kne(e){lh(e),Me(e)}function ah(e){let n=Tne(e,"maxphase",-1);sh(e),ll(e),!(n===1||xl(e)!==0||n===2||bl(e)!==0)&&n!==3&&kne(e)}var np=8;function Cne(){return{aspect:1,sz:0,margin:np,doSplines:!1,mode:2,fixed:null,vals:null,flags:0}}function _ne(e){let n=Cne(),t=rh(e,-1,np),o=oh(e,0,n);if(Bn(e,2,np,n),o===0&&t<0){ah(e);return}let r=t;o===0?n.mode=3:r<0&&(r=np),n.margin=r,n.fixed=null;let{comps:i,origOf:s}=Kw(e);i.length===1?ah(e):Ww(e)?(n.doSplines=!0,eN(e,i,n,s)):ah(e)}function Ane(e){e.nodes.size!==0&&_ne(e)}var nN={type:"dot",layout:Ane,cleanup:km};function uh(e,n,t){let o=e.length;for(e.push(t);o>0;){let r=o-1>>1;if(n[e[r]]<=n[e[o]])break;let i=e[r];e[r]=e[o],e[o]=i,o=r}}function Gne(e,n){let t=0;for(;;){let o=2*t+1,r=2*t+2,i=t;if(o<e.length&&n[e[o]]<n[e[i]]&&(i=o),r<e.length&&n[e[r]]<n[e[i]]&&(i=r),i===t)break;let s=e[i];e[i]=e[t],e[t]=s,t=i}}function tN(e,n){let t=e[0],o=e.pop();return e.length===0||(e[0]=o,Gne(e,n)),t}function oN(e,n,t){let o=[];for(let r=0;r<n;r++)r!==e&&uh(o,t,r);return o}function Mne(e,n,t,o){for(let i=0;i<t;i++)o[i]=1/0;o[e]=0;let r=n[e];for(let i=1;i<r.nedges;i++)o[r.edges[i]]=r.ewgts[i]}function Lne(e,n,t,o,r){let i=t[e];for(let s=1;s<i.nedges;s++){let l=i.edges[s],a=n+i.ewgts[s];a<o[l]&&(o[l]=a,uh(r,o,l))}}function fh(e,n,t,o){Mne(e,n,t,o);let r=oN(e,t,o);for(;r.length>0;){let i=tN(r,o),s=o[i];if(!isFinite(s))break;Lne(i,s,n,o,r)}}function Ine(e,n,t){t[n]=0;let o=e.sources[n+1];for(let r=e.sources[n];r<o;r++)t[e.targets[r]]=e.weights[r]}function One(e,n,t,o,r){let i=e.sources[n+1];for(let s=e.sources[n];s<i;s++){let l=e.targets[s],a=t+e.weights[s];a<o[l]&&(o[l]=a,uh(r,o,l))}}function rN(e,n,t){let o=e.n,r=new Float32Array(o).fill(1/0);Ine(e,n,r);let i=oN(n,o,r),s=0;for(;i.length>0;){let l=tN(i,r),a=r[l];if(!isFinite(a))break;(e.pinneds[l]||l<n)&&(t[s++]={i:n,j:l,d:a,w:1/(a*a)}),One(e,l,a,r,i)}return s}function Dne(e,n,t){for(let o=0;o<n;o++)t[o]=-1;return t[e]=0,[e]}function Bne(e,n,t){for(let o=0;o<e;o++)n[o]<0&&(n[o]=t+10)}function Fne(e,n,t,o){let r=n[e],i=t[e];for(let s=1;s<r.nedges;s++){let l=r.edges[s];t[l]<0&&(t[l]=i+1,o.push(l))}return i}function iN(e,n,t,o){let r=Dne(e,t,o),i=0,s=0;for(;s<r.length;){let l=r[s++];i=Fne(l,n,o,r)}Bne(t,o,i)}var sN=200;function lN(){return{mt:new Uint32Array(624),mti:624}}function aN(e,n){let t=e>>>0&4294967295;for(let o=0;o<624;o++)n.mt[o]=t,t=zne(t,o);n.mti=624}function zne(e,n){let t=(e^e>>>30)>>>0,o=1812433253*(t&65535)>>>0,r=1812433253*(t>>>16)>>>0;return o+(r<<16>>>0)+n+1>>>0}function jne(e){e.mti===624&&Hne(e);let n=e.mt[e.mti++];return n=Vne(n),n>>>0}function Hne(e){let n=e.mt,t=0;for(;t<227;t++){let r=(n[t]&2147483648|n[t+1]&2147483647)>>>0;n[t]=(n[t+397]^r>>>1^(r&1)*2567483615)>>>0}for(;t<623;t++){let r=(n[t]&2147483648|n[t+1]&2147483647)>>>0;n[t]=(n[t+-227]^r>>>1^(r&1)*2567483615)>>>0}let o=(n[623]&2147483648|n[0]&2147483647)>>>0;n[623]=(n[396]^o>>>1^(o&1)*2567483615)>>>0,e.mti=0}function Vne(e){let n=e>>>0;return n^=n>>>11,n^=n<<7&2636928640,n^=n<<15&4022730752,n^=n>>>18,n>>>0}function tp(e,n){let t=e>>>0;if(t===0)return 0;let o=Une(t),r;do r=(jne(n)&o)>>>0;while(r>t);return r}function Une(e){let n=e>>>0;return n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n>>>0}var uN=0,Xne=1,$ne=2,Wne=3,Yne=1e-4,fN=30;function Jne(e){let n=0,t=0;for(let[,o]of e.nodes){o.info.id=n++;for(let r of e.edges)(r.tail===o||r.head===o)&&r.tail!==r.head&&t++}return{nNodes:n,nEdges:t}}function Kne(e,n,t,o){let r=o;for(let i of n.edges)i.tail===e&&i.head!==e?(t.targets[r]=i.head.info.id??0,t.weights[r]=i.info.dist??1,r++):i.head===e&&i.tail!==e&&(t.targets[r]=i.tail.info.id??0,t.weights[r]=i.info.dist??1,r++);return r}function qne(e,n){let t=0,o=0;for(let[,r]of e.nodes)n.sources[t]=o,n.pinneds[t]=r.info.pinned===!0,o=Kne(r,e,n,o),t++;n.sources[t]=o}function Qne(e,n,t,o){let r=0,i=0;for(let s=e.sources[n];s<e.sources[n+1];s++){let l=e.targets[s];o[l]||(o[l]=1,r++,t[l]&&i++)}for(let s=e.sources[n];s<e.sources[n+1];s++)o[e.targets[s]]=0;return{degJ:r,intersect:i}}function Zne(e,n,t,o){let r=0;for(let i=e.sources[n];i<e.sources[n+1];i++)t[e.targets[i]]||(t[e.targets[i]]=1,r++);for(let i=e.sources[n];i<e.sources[n+1];i++){let s=e.targets[i],{degJ:l,intersect:a}=Qne(e,s,t,o);e.weights[i]=r+l-2*a}for(let i=e.sources[n];i<e.sources[n+1];i++)t[e.targets[i]]=0}function ete(e){let n=new Uint8Array(e.n),t=new Uint8Array(e.n);for(let o=0;o<e.n;o++)Zne(e,o,n,t)}function nte(e,n){let{nNodes:t,nEdges:o}=Jne(e),r={n:t,sources:new Array(t+1).fill(0),targets:new Array(o).fill(0),weights:new Float32Array(o).fill(1),pinneds:new Array(t).fill(!1)};return qne(e,r),n===$ne&&ete(r),r}function tte(e){let n=[];for(let t=0;t<e.n;t++){if(e.pinneds[t])continue;let o=[],r=rN(e,t,o);for(let i=0;i<r;i++)n.push(o[i])}return n}function ote(e,n){for(let t=e.length-1;t>=1;t--){let o=tp(t,n),r=e[t];e[t]=e[o],e[o]=r}}function rte(e,n){for(let[,t]of e.nodes)t.info.pinned!==!0&&t.info.pos==null&&(t.info.pos=[tp(65535,n)/65536,tp(65535,n)/65536])}function ite(e,n){let t=e[0].w,o=e[0].w;for(let l=1;l<e.length;l++)e[l].w<t&&(t=e[l].w),e[l].w>o&&(o=e[l].w);let r=1/t,i=Yne/o,s=Math.log(r/i)/(n-1);return{etaMax:r,lambda:s}}function ste(e,n,t,o){for(let r=0;r<n.length;r++){let i=n[r],s=Math.min(o*i.w,1),l=e[2*i.i]-e[2*i.j],a=e[2*i.i+1]-e[2*i.j+1],u=Math.hypot(l,a);if(u===0)continue;let f=s*(u-i.d)/(2*u),d=f*l,c=f*a;t[i.i]&&(e[2*i.i]-=d,e[2*i.i+1]-=c),t[i.j]&&(e[2*i.j]+=d,e[2*i.j+1]+=c)}}function lte(e,n){let t=new Float64Array(2*n),o=0;for(let[,r]of e.nodes){let i=r.info.pos;t[2*o]=i?i[0]:0,t[2*o+1]=i?i[1]:0,o++}return t}function ate(e,n){let t=0;for(let[,o]of e.nodes)o.info.pos||(o.info.pos=[0,0]),o.info.pos[0]=n[2*t],o.info.pos[1]=n[2*t+1],t++}function ute(e,n){let t=new Array(n),o=0;for(let[,r]of e.nodes)t[o++]=r.info.pinned!==!0;return t}function fte(e){return e===Xne?(console.warn("circuit model not yet supported in Gmode=sgd, reverting to shortpath model"),uN):e===Wne?(console.warn("mds model not yet supported in Gmode=sgd, reverting to shortpath model"),uN):e}function dte(e,n,t,o,r){for(let i=0;i<fN;i++){ote(n,r);let s=o.etaMax*Math.exp(-o.lambda*i);ste(e,n,t,s)}}function dN(e,n){let t=fte(n),o=e.nodes.size;if(o===0)return;let r=lN();aN(e.info.seed??0,r);let i=0;for(let[,c]of e.nodes)c.info.id=i++;rte(e,r);let s=nte(e,t),l=tte(s);if(l.length===0)return;let{etaMax:a,lambda:u}=ite(l,fN),f=lte(e,o),d=ute(e,o);dte(f,l,d,{etaMax:a,lambda:u},r),ate(e,f)}var Fn=Math.fround;function cN(e,n){let t=0;for(let o=0;o<e;o++)t+=n[o];t/=e;for(let o=0;o<e;o++)n[o]=n[o]-t}function _r(e,n){let t=Fn(0);for(let o=0;o<e;o++)t=Fn(t+n[o]);t=Fn(t/e);for(let o=0;o<e;o++)n[o]=n[o]-t}function Wu(e,n,t,o){for(let i=0;i<n;i++)o[i]=0;let r=0;for(let i=0;i<n;i++){let s=t[i],l=Fn(e[r++]*s);for(let a=i+1;a<n;a++,r++)l=Fn(l+Fn(e[r]*t[a])),o[a]=o[a]+Fn(e[r]*s);o[i]=o[i]+l}}function pN(e,n,t,o){for(let r=0;r<e;r++)o[r]=n[r]-t[r]}function dh(e,n,t,o){let r=Fn(t);for(let i=0;i<e;i++)n[i]=n[i]+Fn(r*o[i])}function Hl(e,n,t){let o=0;for(let r=0;r<e;r++)o+=Fn(n[r]*t[r]);return o}function ch(e,n,t){for(let o=0;o<e;o++)t[o]=n[o]}function mN(e,n){let t=Fn(-1e30);for(let o=0;o<e;o++){let r=Fn(Math.abs(n[o]));r>t&&(t=r)}return t}function xN(e,n){for(let t=0;t<e;t++)n[t]=n[t]*n[t]}function hN(e,n){for(let t=0;t<e;t++)n[t]!==0&&(n[t]=1/n[t])}function bN(e,n,t){for(let o=0;o<e;o++)n[o]>=0&&(t[o]=Fn(Math.sqrt(n[o])))}function gN(e,n){for(let t=0;t<e;t++)n[t]>0&&(n[t]=1/Fn(Math.sqrt(n[t])))}var Ar=Math.fround,yN=.001,ph=2;function EN(e,n){let t=new Float32Array(n*(n+1)/2),o=new Int32Array(n),r=0;for(let i=0;i<n;i++){iN(i,e,n,o);for(let s=i;s<n;s++)t[r++]=o[s]}return t}function vN(e,n){let t=new Float32Array(n*(n+1)/2),o=new Float32Array(n),r=0;for(let i=0;i<n;i++){fh(i,e,n,o);for(let s=i;s<n;s++)t[r++]=o[s]}return t}function cte(e){return e.info.posSet===!0||e.info.pinned===!0}function SN(e){return e.info.pinned===!0}function pte(e,n,t,o){let r=!1;for(let i=0;i<e;i++){let s=o[i];if(cte(s))t[0][i]=s.info.pos?.[0]??0,t[1][i]=s.info.pos?.[1]??0,SN(s)&&(r=!0);else{t[0][i]=qn(),t[1][i]=qn();for(let l=2;l<n;l++)t[l][i]=qn()}}for(let i=0;i<n;i++)cN(e,t[i]);return r}function mte(e,n){let{n:t}=e;_r(t,e.p),_r(t,e.x),_r(t,e.r),Wu(e.A,t,e.p,e.Ap),_r(t,e.Ap);let o=Hl(t,e.p,e.Ap);if(o===0)return!0;let r=e.rR/o;if(dh(t,e.x,r,e.p),!n){dh(t,e.r,-r,e.Ap);let i=Hl(t,e.r,e.r);if(e.rR===0)return!1;let s=Ar(i/e.rR);e.rR=i;for(let l=0;l<t;l++)e.p[l]=Ar(s*e.p[l])+e.r[l]}return!0}function PN(e,n,t,o,r,i){let s={A:e,x:n,b:t,n:o,r:new Float32Array(o),p:new Float32Array(o),Ap:new Float32Array(o),rR:0};_r(o,n),_r(o,t);let l=new Float32Array(o);Wu(e,o,n,l),_r(o,l),pN(o,t,l,s.r),ch(o,s.r,s.p),s.rR=Hl(o,s.r,s.r);for(let a=0;a<i&&mN(o,s.r)>r;a++)if(!mte(s,a>=i-1))return-1;return 0}function xte(e,n,t){let o=n*(n+1)/2;t===2&&xN(o,e),hN(o,e);let r=new Float64Array(n),i=0;for(let s=0;s<n-1;s++){let l=0;i++;for(let a=1;a<n-s;a++,i++){let u=e[i];l+=u,r[s+a]=r[s+a]-u}r[s]=r[s]-l}i=0;for(let s=0,l=n;s<n;s++,i+=l,l--)e[i]=r[s]}function hte(e,n,t,o){let{n:r,dim:i,exp:s}=o,l=r*(r+1)/2,a=new Float64Array(r),u=new Float32Array(r);s===2&&bN(l,n,e);let f=0;for(let d=0;d<r-1;d++){let c=r-d-1;for(let b=0;b<c;b++)u[b]=0;for(let b=0;b<i;b++){let g=t[b];for(let E=0;E<c;E++){let R=Ar(g[d]+Ar(-1*g[d+1+E]));u[E]=u[E]+Ar(R*R)}}gN(c,u);for(let b=0;b<c;b++){let g=u[b];(g>=34028234663852886e22||g<0)&&(u[b]=0)}f++;let m=0;if(s===2)for(let b=0;b<c;b++,f++){let g=e[f]=Ar(e[f]*u[b]);m+=g,a[d+b+1]=a[d+b+1]-g}else for(let b=0;b<c;b++,f++){let g=e[f]=u[b];m+=g,a[d+b+1]=a[d+b+1]-g}a[d]=a[d]-m}f=0;for(let d=0,c=r;d<r;d++,f+=c,c--)e[f]=a[d]}function bte(e){let n=0;for(let t=0;t<e.dim;t++)Wu(e.lap1,e.n,e.coords[t],e.b[t]),n+=Hl(e.n,e.coords[t],e.b[t]);n*=2,n+=e.constantTerm;for(let t=0;t<e.dim;t++)Wu(e.lap2,e.n,e.coords[t],e.tmpCoords),n-=Hl(e.n,e.coords[t],e.tmpCoords);return n}function gte(e,n,t,o){if(!t)return PN(e.lap2,e.coords[n],e.b[n],e.n,yN,e.n);ch(e.n,e.coords[n],e.tmpCoords);let r=PN(e.lap2,e.tmpCoords,e.b[n],e.n,yN,e.n);if(r<0)return r;for(let i=0;i<e.n;i++)SN(o[i])||(e.coords[n][i]=e.tmpCoords[i]);return 0}function wN(e,n,t,o,r){let{dim:i,maxi:s}=r,l=r.opts&ph;if(s<0)return 0;let a=pte(n,i,t,o);if(n===1||s===0)return 0;let u=[];for(let R=0;R<i;R++){let N=new Float32Array(n);for(let C=0;C<n;C++)N[C]=Ar(t[R][C]);u.push(N)}let f=Ar(n*(n-1)/2),d=e;xte(d,n,l);let c=n*(n+1)/2,m={n,dim:i,exp:l,lap2:d,lap1:new Float32Array(c),coords:u,b:Array.from({length:i},()=>new Float32Array(n)),tmpCoords:new Float32Array(n),constantTerm:f},b=Number.MAX_VALUE,g=!1,E=0;for(;E<s&&!g;E++){hte(m.lap1,d,u,{n,dim:i,exp:l});let R=bte(m);typeof process<"u"&&process.env.STRESS_DEBUG&&E%5===0&&console.error(R.toFixed(3)),g=Math.abs(b-R)/b<r.epsilon||R<r.epsilon,b=R;for(let C=0;C<i;C++)if(gte(m,C,a,o)<0)return-1}for(let R=0;R<i;R++)for(let N=0;N<n;N++)t[R][N]=u[R][N];return E}var NN=72;function yte(e){let n=e.attrs.get("ratio");if(n===void 0)return null;if(n==="auto")return{kind:"auto",ratio:0};if(n==="compress")return{kind:"compress",ratio:0};if(n==="expand")return{kind:"expand",ratio:0};if(n==="fill")return{kind:"fill",ratio:0};let t=Number.parseFloat(n);return t>0?{kind:"value",ratio:t}:null}function Pte(e){let n=pl(e);return n?{x:n.x,y:n.y}:null}function op(e){if(e.info.drawing!==void 0)return;let n=yte(e),t=Pte(e.attrs.get("size"));n===null&&t===null||(e.info.drawing=Hf({ratioKind:n?.kind??"none",ratio:n?.ratio??0,size:t?{x:t.x,y:t.y}:{x:0,y:0}}))}function RN(e,n,t){e.info.bb&&(e.info.bb={ll:{x:e.info.bb.ll.x*n,y:e.info.bb.ll.y*t},ur:{x:e.info.bb.ur.x*n,y:e.info.bb.ur.y*t}});for(let o of e.info.clust??[])RN(o,n,t)}function TN(e,n){e.info.bb&&(e.info.bb={ll:{x:e.info.bb.ll.x-n.x,y:e.info.bb.ll.y-n.y},ur:{x:e.info.bb.ur.x-n.x,y:e.info.bb.ur.y-n.y}});for(let t of e.info.clust??[])TN(t,n)}function Ete(e){let n=e.info.bb;if(!n)return;let t=n.ll,o=t.x/NN,r=t.y/NN;for(let i of e.nodes.values()){i.info.pos||(i.info.pos=[0,0]),i.info.pos[0]=(i.info.pos[0]??0)-o,i.info.pos[1]=(i.info.pos[1]??0)-r;let s=i.info.xlabel;s?.set===!0&&s.pos&&(s.pos={x:s.pos.x-t.x,y:s.pos.y-t.y})}for(let i of e.edges)i.info.spl&&eh(i,-t.x,-t.y);TN(e,t)}function vte(e){let n=e.info.drawing,t=e.info.bb;if(n.ratioKind==="fill"){if(n.size.x<=0)return null;let o=n.size.x/t.ur.x,r=n.size.y/t.ur.y;return(o<1||r<1)&&(o<r?(r/=o,o=1):(o/=r,r=1)),{xf:o,yf:r}}if(n.ratioKind==="expand"){if(n.size.x<=0)return null;let o=n.size.x/t.ur.x,r=n.size.y/t.ur.y;if(o>1&&r>1){let i=Math.min(o,r);return{xf:i,yf:i}}return null}if(n.ratioKind==="value"){let o=n.ratio,r=t.ur.y/t.ur.x;return r<o?{xf:1,yf:o/r}:{xf:r/o,yf:1}}return null}function kN(e){if(e.root!==e)return!1;let n=e.info.drawing;if(!n||n.ratioKind==="none")return!1;let t=e.info.bb;if(!t)return!1;let o=!1;(t.ll.x!==0||t.ll.y!==0)&&(o=!0,Ete(e));let r=vte(e);if(r===null)return o;let{xf:i,yf:s}=r;for(let l of e.nodes.values())l.info.pos&&(l.info.pos[0]=(l.info.pos[0]??0)*i,l.info.pos[1]=(l.info.pos[1]??0)*s);return RN(e,i,s),!0}var rp=0,Ju=1,Yu=2,ip=3,sp=4,Ku=0,mh=1,xh=2,hh=3,_N=2,CN=72;function Ii(e,n=_N){if(!e.info.pos||e.info.pos.length<n){let t=[];for(let o=0;o<n;o++)t.push(0);e.info.pos=t}e.info.UF_size===void 0&&(e.info.UF_size=1),e.info.width||(e.info.width=.75),e.info.height||(e.info.height=.5)}function AN(e){let n=e.attrs.get("pos");if(n===void 0||n.length===0)return!1;let t="(-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)",o=new RegExp(`^\\s*${t}\\s*,\\s*${t}(.?)`).exec(n);if(o===null)return!1;e.info.pos=[Number(o[1]),Number(o[2])],e.info.posSet=!0;let r=e.attrs.get("pin");return(o[3]==="!"||r!==void 0&&Ne(r))&&(e.info.pinned=!0),!0}function Ste(e){let n=[],t=0;for(let[,o]of e.nodes)o.info.id=t++,n.push(o);return n}function wte(e,n,t){let o=Ste(e),r=o.length,i=Nte(e),s=Tte(e,o,i);Rte(e);let l=n===rp?0:V(e.attrs.get("maxiter"),sN,0),a=V(e.attrs.get("epsilon"),1e-4,0),u=i?vN(s,r):EN(s,r),f=[new Float64Array(r),new Float64Array(r)];wN(u,r,f,o,{dim:_N,opts:ph,maxi:l,epsilon:a});for(let d=0;d<r;d++)o[d].info.pos=[f[0][d],f[1][d]]}function Nte(e){for(let n of e.edges)if(n.attrs.has("len"))return!0;return!1}function Rte(e){let n=e.root.attrs.get("start"),t=1;if(n!==void 0&&/^\d/.test(n)){let o=parseInt(n,10);Number.isNaN(o)||(t=o)}Tl(t)}function Tte(e,n,t){let o=n.map((r,i)=>({nedges:1,edges:[i],ewgts:t?[0]:[]}));for(let r of n){let i=r.info.id,s=o[i],l=new Map;for(let a of[...r.outEdges(e),...r.inEdges(e)]){if(a.head===a.tail)continue;let f=(a.tail===r?a.head:a.tail).info.id,d=t?V(a.attrs.get("len"),1,0):1,c=l.get(f);if(c!==void 0){t&&(s.ewgts[c]=Math.max(s.ewgts[c],d));continue}l.set(f,s.nedges),s.edges.push(f),t&&s.ewgts.push(d),s.nedges++}}return o}function lp(e,n,t){if(!(e.nodes.size<2)){if(n===sp){dN(e,t);return}(n===Yu||n===ip)&&console.warn(`neato: mode ${n===Yu?"hier":"ipsep"} not fully implemented; falling back to majorization`),wte(e,n,t)}}function Oi(e){op(e),kN(e);for(let[,n]of e.nodes){let t=n.info.pos;t&&(n.info.coord={x:(t[0]??0)*CN,y:(t[1]??0)*CN})}}function bh(e){for(let[,n]of e.nodes)n.info.pos=void 0,n.info.pinned=void 0,n.info.id=void 0,n.info.heapindex=void 0,n.info.hops=void 0,n.info.UF_size=void 0}var ap=class{id;desiredPosition;weight;offset;block;visited;in;out;constructor(n,t,o){this.id=n,this.desiredPosition=t,this.weight=o,this.offset=0,this.block=null,this.visited=!1,this.in=[],this.out=[]}position(){return this.block.posn+this.offset}};function GN(e,n){let t=-Number.MAX_VALUE,o=e.left.block.timeStamp>e.timeStamp||e.left.block===e.right.block?t:e.slack(),r=n.left.block.timeStamp>n.timeStamp||n.left.block===n.right.block?t:n.slack();return o===r?e.left.id===n.left.id?e.right.id<n.right.id:e.left.id<n.left.id:o<r}var fo=class{left;right;gap;lm;timeStamp;active;visited;constructor(n,t,o){this.left=n,this.right=t,this.gap=o,this.lm=0,this.timeStamp=0,this.active=!1,this.visited=!1,n.out.push(this),t.in.push(this)}slack(){return this.right.position()-this.gap-this.left.position()}destroy(){let n=this.left.out.indexOf(this);n!==-1&&this.left.out.splice(n,1);let t=this.right.in.indexOf(this);t!==-1&&this.right.in.splice(t,1)}};function gh(e,n){return GN(n,e)}function kte(e,n){for(;n>0;){let t=n-1>>1;if(!gh(e[t],e[n]))break;let o=e[t];e[t]=e[n],e[n]=o,n=t}}function MN(e,n){let t=e.length;for(;;){let o=n,r=2*n+1,i=2*n+2;if(r<t&&gh(e[o],e[r])&&(o=r),i<t&&gh(e[o],e[i])&&(o=i),o===n)break;let s=e[n];e[n]=e[o],e[o]=s,n=o}}function yh(e){for(let n=(e.length>>1)-1;n>=0;n--)MN(e,n)}function qu(e){return e[0]}function Vl(e){e[0]=e[e.length-1],e.pop(),e.length>0&&MN(e,0)}function LN(e,n){e.push(n),kte(e,e.length-1)}function Ph(e,n){for(let t of n)e.push(t);yh(e)}var Qu=class e{vars;posn;weight;wposn;deleted;timeStamp;in;out;timeCtr;constructor(n,t){this.timeCtr=n,this.timeStamp=0,this.posn=0,this.weight=0,this.wposn=0,this.deleted=!1,this.vars=[],this.in=[],this.out=[],t!==void 0&&(t.offset=0,this.addVariable(t))}addVariable(n){n.block=this,this.vars.push(n),this.weight+=n.weight,this.wposn+=n.weight*(n.desiredPosition-n.offset),this.posn=this.wposn/this.weight}desiredWeightedPosition(){let n=0;for(let t of this.vars)n+=(t.desiredPosition-t.offset)*t.weight;return n}setUpInConstraints(){this.in=this.setupHeap(!0)}setUpOutConstraints(){this.out=this.setupHeap(!1)}setupHeap(n){let t=[];for(let o of this.vars){let r=n?o.in:o.out;for(let i of r)i.timeStamp=this.timeCtr.value,(n?i.left.block!==this:i.right.block!==this)&&t.push(i)}return yh(t),t}mergeTwoArg(n,t){let o=t.right.offset-t.left.offset-t.gap,r=t.left.block,i=t.right.block;this.vars.length<n.vars.length?i.mergeInto(r,t,o):r.mergeInto(i,t,-o)}mergeInto(n,t,o){t.active=!0,this.wposn+=n.wposn-o*n.weight,this.weight+=n.weight,this.posn=this.wposn/this.weight;for(let r of n.vars)r.block=this,r.offset+=o,this.vars.push(r);n.deleted=!0}mergeIn(n){this.findMinInConstraint(),n.findMinInConstraint(),Ph(this.in,n.in)}mergeOut(n){this.findMinOutConstraint(),n.findMinOutConstraint(),Ph(this.out,n.out)}findMinInConstraint(){let n=[];for(;this.in.length>0;){let t=qu(this.in),o=t.left.block,r=t.right.block;if(o===r)Vl(this.in);else if(t.timeStamp<o.timeStamp)Vl(this.in),n.push(t);else break}for(let t of n)t.timeStamp=this.timeCtr.value,LN(this.in,t);return this.in.length===0?null:qu(this.in)}findMinOutConstraint(){if(this.out.length===0)return null;let n=qu(this.out);for(;n.left.block===n.right.block;){if(Vl(this.out),this.out.length===0)return null;n=qu(this.out)}return n}deleteMinInConstraint(){Vl(this.in)}deleteMinOutConstraint(){Vl(this.out)}canFollowLeft(n,t){return n.left.block===this&&n.active&&t!==n.left}canFollowRight(n,t){return n.right.block===this&&n.active&&t!==n.right}resetActiveLm(n,t){for(let o of n.out)this.canFollowRight(o,t)&&(o.lm=0,this.resetActiveLm(o.right,n));for(let o of n.in)this.canFollowLeft(o,t)&&(o.lm=0,this.resetActiveLm(o.left,n))}computeDfdv(n,t,o){let r=n.weight*(n.position()-n.desiredPosition);for(let i of n.out)this.canFollowRight(i,t)&&(i.lm=this.computeDfdv(i.right,n,o),r+=i.lm,(o.c===null||i.lm<o.c.lm)&&(o.c=i));for(let i of n.in)this.canFollowLeft(i,t)&&(i.lm=-this.computeDfdv(i.left,n,o),r-=i.lm,(o.c===null||i.lm<o.c.lm)&&(o.c=i));return r}processBetweenIn(n,t,o,r){let i=t,s=null;n.left===i&&(i=null,s=n);let[l,a]=this.computeDfdvBetween(i,n.left,o,1,r);return n.lm=-l,i!==null&&a!==null&&(s=a),[-n.lm,i,s]}processBetweenOut(n,t,o,r){let i=t,s=null;n.right===i&&(i=null,s=n);let[l,a]=this.computeDfdvBetween(i,n.right,o,2,r);return n.lm=l,i!==null&&a!==null&&(s=r&&n.lm<a.lm?n:a),[n.lm,i,s]}computeDfdvBetween(n,t,o,r=0,i=!1){let s=t.weight*(t.position()-t.desiredPosition),l=null;for(let a of t.in){if(!this.canFollowLeft(a,o))continue;let u=r===2?!0:i,[f,d,c]=this.processBetweenIn(a,n,t,u);s+=f,n=d,c!==null&&(l=c)}for(let a of t.out){if(!this.canFollowRight(a,o))continue;let u=r===1?!0:i,[f,d,c]=this.processBetweenOut(a,n,t,u);s+=f,n=d,c!==null&&(l=c)}return[s,l]}findMinLM(){let n={c:null};return this.resetActiveLm(this.vars[0],null),this.computeDfdv(this.vars[0],null,n),n.c}findMinLMBetween(n,t){this.resetActiveLm(this.vars[0],null);let[,o]=this.computeDfdvBetween(t,n,null);return o}populateSplit(n,t,o){n.addVariable(t);for(let r of t.in)this.canFollowLeft(r,o)&&this.populateSplit(n,r.left,t);for(let r of t.out)this.canFollowRight(r,o)&&this.populateSplit(n,r.right,t)}splitInto(n){n.active=!1;let t=new e(this.timeCtr);this.populateSplit(t,n.left,n.right);let o=new e(this.timeCtr);return this.populateSplit(o,n.right,n.left),[t,o]}splitBetween(n,t){let o=this.findMinLMBetween(n,t),[r,i]=this.splitInto(o);return this.deleted=!0,[o,r,i]}cost(){let n=0;for(let t of this.vars){let o=t.position()-t.desiredPosition;n+=t.weight*o*o}return n}};var up=class{_blocks;_vs;timeCtr;constructor(n){this.timeCtr={value:0},this._vs=n,this._blocks=new Set;for(let t of n)this._blocks.add(new Qu(this.timeCtr,t))}[Symbol.iterator](){return this._blocks[Symbol.iterator]()}insert(n){this._blocks.add(n)}totalOrder(){let n=[];for(let t of this._vs)t.visited=!1;for(let t of this._vs)t.in.length===0&&this.dfsVisit(t,n);return n}dfsVisit(n,t){n.visited=!0;for(let o of n.out)o.right.visited||this.dfsVisit(o.right,t);t.unshift(n)}mergeLeft(n){n.timeStamp=++this.timeCtr.value,n.setUpInConstraints();let t=n.findMinInConstraint();for(;t!==null&&t.slack()<0;){n.deleteMinInConstraint();let o=t.left.block;o.in.length===0&&o.setUpInConstraints();let r=t.right.offset-t.left.offset-t.gap;n.vars.length<o.vars.length&&(r=-r,[o,n]=[n,o]),this.timeCtr.value++,n.mergeInto(o,t,r),n.mergeIn(o),n.timeStamp=this.timeCtr.value,this.removeBlock(o),t=n.findMinInConstraint()}}mergeRight(n){n.setUpOutConstraints();let t=n.findMinOutConstraint();for(;t!==null&&t.slack()<0;){n.deleteMinOutConstraint();let o=t.right.block;o.setUpOutConstraints();let r=t.left.offset+t.gap-t.right.offset;n.vars.length>o.vars.length&&(r=-r,[n,o]=[o,n]),n.mergeInto(o,t,r),n.mergeOut(o),this.removeBlock(o),t=n.findMinOutConstraint()}}removeBlock(n){n.deleted=!0}cleanup(){for(let n of this._blocks)n.deleted&&this._blocks.delete(n)}split(n,t){let[o,r]=n.splitInto(t);r.posn=n.posn,r.wposn=r.posn*r.weight,this.mergeLeft(o);let i=t.right.block;return i.wposn=i.desiredWeightedPosition(),i.posn=i.wposn/i.weight,this.mergeRight(i),this.removeBlock(n),this._blocks.add(o),this._blocks.add(i),[o,i]}cost(){let n=0;for(let t of this._blocks)n+=t.cost();return n}};var Zu=class{minX;maxX;minY;maxY;constructor(n,t,o,r){this.minX=n,this.maxX=t,this.minY=o,this.maxY=r}getMaxX(){return this.maxX}getMaxY(){return this.maxY}getMinX(){return this.minX}getMinY(){return this.minY}getCentreX(){return this.minX+this.width()/2}getCentreY(){return this.minY+this.height()/2}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}overlapX(n){return this.getCentreX()<=n.getCentreX()&&n.getMinX()<this.maxX?this.maxX-n.getMinX():n.getCentreX()<=this.getCentreX()&&this.minX<n.getMaxX()?n.getMaxX()-this.minX:0}overlapY(n){return this.getCentreY()<=n.getCentreY()&&n.getMinY()<this.maxY?this.maxY-n.getMinY():n.getCentreY()<=this.getCentreY()&&this.minY<n.getMaxY()?n.getMaxY()-this.minY:0}},ef=class{bs;cs;constructor(n,t){this.bs=new up(n),this.cs=t}satisfy(){let n=this.bs.totalOrder();for(let t of n)t.block.deleted||this.bs.mergeLeft(t.block);this.bs.cleanup(),this.verifyConstraints()}refine(){for(let n=!1;!n;){n=!0;for(let t of this.bs)t.setUpInConstraints(),t.setUpOutConstraints();for(let t of this.bs){let o=t.findMinLM();if(o!==null&&o.lm<0){this.bs.split(t,o),this.bs.cleanup(),n=!1;break}}}this.verifyConstraints()}verifyConstraints(){for(let n of this.cs)if(n.slack()<-1e-7)throw new Error("Unsatisfied constraint")}solve(){this.satisfy(),this.refine()}};var Lo={Open:0,Close:1};function IN(e,n,t){return{v:e,r:n,pos:t,firstAbove:null,firstBelow:null,leftNeighbours:new Set,rightNeighbours:new Set}}function Cte(e,n){return e.type===Lo.Open&&n.type!==Lo.Open?-1:1}function ON(e,n){return e.node.r===n.node.r?Cte(e,n):e.pos<n.pos?-1:e.pos>n.pos?1:0}function _te(e,n){return e.pos<n.pos?!0:n.pos<e.pos?!1:e<n}function DN(e,n){let t=0,o=e.length;for(;t<o;){let r=t+o>>1;_te(e[r],n)?t=r+1:o=r}e.splice(t,0,n)}function BN(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}function Ate(e,n){let t=new Set,o=e.indexOf(n);for(let r=o-1;r>=0;r--){let i=e[r];if(i.r.overlapX(n.r)<=0)return t.add(i),t;i.r.overlapX(n.r)<=i.r.overlapY(n.r)&&t.add(i)}return t}function Gte(e,n){let t=new Set,o=e.indexOf(n);for(let r=o+1;r<e.length;r++){let i=e[r];if(i.r.overlapX(n.r)<=0)return t.add(i),t;i.r.overlapX(n.r)<=i.r.overlapY(n.r)&&t.add(i)}return t}function Mte(e,n){let t=Ate(e,n),o=Gte(e,n);n.leftNeighbours=t,n.rightNeighbours=o;for(let r of t)r.rightNeighbours.add(n);for(let r of o)r.leftNeighbours.add(n)}function FN(e,n){let t=e.indexOf(n);if(t>0){let o=e[t-1];n.firstAbove=o,o.firstBelow=n}if(t<e.length-1){let o=e[t+1];n.firstBelow=o,o.firstAbove=n}}function Lte(e,n){for(let t of e.leftNeighbours)n.push(new fo(t.v,e.v,(e.r.width()+t.r.width())/2)),t.rightNeighbours.delete(e)}function Ite(e,n){for(let t of e.rightNeighbours)n.push(new fo(e.v,t.v,(e.r.width()+t.r.width())/2)),t.leftNeighbours.delete(e)}function Ote(e,n){Lte(e,n),Ite(e,n)}function Dte(e,n){let t=e.firstAbove,o=e.firstBelow;t!==null&&(n.push(new fo(t.v,e.v,(e.r.width()+t.r.width())/2)),t.firstBelow=e.firstBelow),o!==null&&(n.push(new fo(e.v,o.v,(e.r.width()+o.r.width())/2)),o.firstAbove=e.firstAbove)}function Bte(e,n){let t=e.firstAbove,o=e.firstBelow;t!==null&&(n.push(new fo(t.v,e.v,(e.r.height()+t.r.height())/2)),t.firstBelow=e.firstBelow),o!==null&&(n.push(new fo(e.v,o.v,(e.r.height()+o.r.height())/2)),o.firstAbove=e.firstAbove)}function Fte(e,n){let t=[];for(let o=0;o<e.length;o++){let r=e[o];n[o].desiredPosition=r.getCentreX();let i=IN(n[o],r,r.getCentreX());t.push({type:Lo.Open,node:i,pos:r.getMinY()}),t.push({type:Lo.Close,node:i,pos:r.getMaxY()})}return t}function zte(e,n){let t=[];for(let o=0;o<e.length;o++){let r=e[o];n[o].desiredPosition=r.getCentreY();let i=IN(n[o],r,r.getCentreY());t.push({type:Lo.Open,node:i,pos:r.getMinX()}),t.push({type:Lo.Close,node:i,pos:r.getMaxX()})}return t}function zN(e,n,t){let o=Fte(e,n);o.sort(ON);let r=[],i=[];for(let s of o){let l=s.node;s.type===Lo.Open?(DN(r,l),t?Mte(r,l):FN(r,l)):(t?Ote(l,i):Dte(l,i),BN(r,l))}return i}function jN(e,n){let t=zte(e,n);t.sort(ON);let o=[],r=[];for(let i of t){let s=i.node;i.type===Lo.Open?(DN(o,s),FN(o,s)):(Bte(s,r),BN(o,s))}return r}function HN(e,n,t){return new ap(e,n,t)}function VN(e){for(let n of e)n.destroy()}function UN(e){e.solve()}function XN(e,n,t){return zN(e,n,t)}function $N(e,n){return jN(e,n)}function WN(e,n){return e.map(t=>{let o=t.info.pos?.[0]??0,r=t.info.pos?.[1]??0,i=t.info.width/2+n.x/2,s=t.info.height/2+n.y/2;return new Zu(o-i,o+i,r-s,r+s)})}function YN(e,n){return e.map((t,o)=>HN(o,t.info.pos?.[n]??0,1))}function jte(e,n,t){for(let o=0;o<e.length;o++){let r=e[o];r.info.pos||(r.info.pos=[0,0]),r.info.pos[t]=n[o].block!==null?n[o].position():n[o].desiredPosition}}function Hte(e,n,t){VN(n);for(let o of t);}function JN(e,n,t,o,r){let i=new ef(o,t);UN(i),jte(e,o,r),Hte(i,t,o)}function Vte(e,n){let t=WN(e,n),o=YN(e,0),r=XN(t,o,!0);JN(e,n,r,o,0)}function Ute(e,n){let t=WN(e,n),o=YN(e,1),r=$N(t,o);JN(e,n,r,o,1)}function KN(e,n){e.length<2||(Vte(e,n),Ute(e,n))}function Xte(){return{ports:null,nports:0,bb:{ll:{x:0,y:0},ur:{x:0,y:0}},flags:0,level:0,parent:null}}function ee(e){let n=e.info.alg;return n===void 0&&(n=Xte(),e.info.alg=n),n}function qN(){return{kind:"fdp-dndata",deg:0,wdeg:0,dn:null,clust:null,disp:[0,0],pinned:0}}function q(e){return e.info.alg}function Ze(e){return q(e).disp}function Gr(e){let n=q(e);return n.dn===null&&n.clust===null}function Mr(e){let n=e.info.alg;return(n===void 0||n.kind!=="fdp")&&(n={kind:"fdp",dnode:null,parent:null,pinned:0},e.info.alg=n),n}function Di(e){let n=e.info.alg;return n!==void 0&&n.kind==="fdp"?n.dnode:null}function nf(e,n){Mr(e).dnode=n}function QN(e){let n=e.info.alg;return n!==void 0&&n.kind==="fdp"?n.parent:null}function ZN(e,n){Mr(e).parent=n}function eR(e){return q(e).pinned>0}function nR(e){return e.info.alg??[]}function tR(e){return e.info.alg===void 0}function Eh(e,n){let t=e.info.alg;t===void 0?e.info.alg=[n]:t.push(n),e.info.count=(e.info.count??0)+1}function ge(e,n){let t=e;for(;t!==null;){let o=t.attrs.get(n);if(o!==void 0)return o;t=t.parent}}var tf=.8,Io=4;function fp(e,n,t){let o=e.trimStart(),r=!1;o.startsWith("+")&&(o=o.slice(1),r=!0);let i=$te(o);if(i===null)return null;let{x:s,y:l}=i;return r?Wte(s,l,n,t):{x:1+s/n,y:1+l/n,doAdd:!1}}function $te(e){let n=String.raw`-?[0-9.]+(?:[eE][-+]?[0-9]+)?`,t=new RegExp(String.raw`^\s*(${n})\s*(?:,\s*(${n}))?`).exec(e);if(t===null||t[1]===void 0)return null;let o=parseFloat(t[1]);if(Number.isNaN(o))return null;let r=t[2]!==void 0?parseFloat(t[2]):o;return{x:o,y:r}}function Wte(e,n,t,o){return t>1?{x:Math.min(o,e/t),y:Math.min(o,n/t),doAdd:!0}:t<1?{x:Math.max(o,e/t),y:Math.max(o,n/t),doAdd:!0}:{x:e,y:n,doAdd:!0}}function Lr(e){let n=ge(e,"sep");if(n!==void 0){let o=fp(n,1,0);if(o!==null)return o}let t=ge(e,"esep");if(t!==void 0){let o=fp(t,tf,Io);if(o!==null)return o}return{x:Io,y:Io,doAdd:!0}}function oR(e){let n=ge(e,"esep");if(n!==void 0){let o=fp(n,1,0);if(o!==null)return o}let t=ge(e,"sep");if(t!==void 0){let o=fp(t,1/tf,tf*Io);if(o!==null)return o}return{x:tf*Io,y:tf*Io,doAdd:!0}}var Yte=(10+96*2**-53)*2**-53;function rR(e){let n=e,t=0;for(;!Number.isInteger(n);)n*=2,t--;return t}function iR(e,n){let t=e,o=0;for(;!Number.isInteger(t);)t*=2,o--;return BigInt(t)<<BigInt(o-n)}function Jte(e,n,t,o,r,i,s,l){let a=[e,n,t,o,r,i,s,l],u=0;for(let aa of a)u=Math.min(u,rR(aa));let[f,d,c,m,b,g,E,R]=a.map(aa=>iR(aa,u)),N=f-E,C=d-R,ne=c-E,I=m-R,me=b-E,Xe=g-R,Do=N*N+C*C,Bo=ne*ne+I*I,Tf=me*me+Xe*Xe,la=Do*(ne*Xe-me*I)-Bo*(N*Xe-me*C)+Tf*(N*I-ne*C);return la>0n?1:la<0n?-1:0}function vh(e,n,t,o,r,i){let s=e[t]-e[i],l=n[t]-n[i],a=e[o]-e[i],u=n[o]-n[i],f=e[r]-e[i],d=n[r]-n[i],c=a*d,m=f*u,b=s*s+l*l,g=f*l,E=s*d,R=a*a+u*u,N=s*u,C=a*l,ne=f*f+d*d,I=b*(c-m)+R*(g-E)+ne*(N-C),me=(Math.abs(c)+Math.abs(m))*b+(Math.abs(g)+Math.abs(E))*R+(Math.abs(N)+Math.abs(C))*ne,Xe=Yte*me;return I>Xe||-I>Xe?Math.sign(I):Jte(e[t],n[t],e[o],n[o],e[r],n[r],e[i],n[i])}function Ul(e,n,t,o,r){let i=(e[t]-e[r])*(n[o]-n[r]),s=(n[t]-n[r])*(e[o]-e[r]),l=i-s,u=33306690738754716e-32*(Math.abs(i)+Math.abs(s));if(l>u||-l>u)return Math.sign(l);let f=[e[t],n[t],e[o],n[o],e[r],n[r]],d=0;for(let C of f)d=Math.min(d,rR(C));let[c,m,b,g,E,R]=f.map(C=>iR(C,d)),N=(c-E)*(g-R)-(m-R)*(b-E);return N>0n?1:N<0n?-1:0}function sR(e,n,t,o,r){return{a:t,b:o,c:r,orient:Ul(e,n,t,o,r)||1}}function Kte(e,n,t,o){let r=new Map,i=[];for(let s of t)if(vh(e,n,s.a,s.b,s.c,o)*s.orient>0)for(let[l,a]of[[s.a,s.b],[s.b,s.c],[s.c,s.a]]){let u=l<a?l*1048576+a:a*1048576+l,f=r.get(u);f?f[2]++:r.set(u,[l,a,1])}else i.push(s);for(let[s,l,a]of r.values())a===1&&Ul(e,n,s,l,o)!==0&&i.push(sR(e,n,s,l,o));t.length=0,t.push(...i)}function qte(e,n,t){let o=1/0,r=-1/0,i=1/0,s=-1/0;for(let d of t)o=Math.min(o,e[d]),r=Math.max(r,e[d]),i=Math.min(i,n[d]),s=Math.max(s,n[d]);let l=Math.max(r-o,s-i,1),a=e.length;e.push(o-100*l,r+100*l,(o+r)/2),n.push(i-100*l,i-100*l,s+100*l);let u=[sR(e,n,a,a+1,a+2)];for(let d of t)Kte(e,n,u,d);let f=u.filter(d=>d.a<a&&d.b<a&&d.c<a);return e.length=a,n.length=a,f.length===0?null:f}function lR(e,n,t){let o=new Map,r=[];for(let d=0;d<t;d++){let c=`${e[d]},${n[d]}`;o.has(c)||(o.set(c,d),r.push(d))}let i=e.slice(0,t),s=n.slice(0,t),l=r.length>=3?qte(i,s,r):null;if(l===null){let d=Array.from({length:t},(b,g)=>g),c=e[0]===e[1]?n:e;be(d,(b,g)=>{let E=c[b],R=c[g];return E<R?-1:E>R?1:0});let m=[];for(let b=1;b<t;b++)m.push(d[b-1],d[b]);return m}let a=new Set,u=[];for(let d of l)for(let[c,m]of[[d.a,d.b],[d.b,d.c],[d.c,d.a]]){let b=Math.min(c,m),g=Math.max(c,m),E=b*1048576+g;a.has(E)||(a.add(E),u.push([b,g]))}u.sort((d,c)=>d[0]-c[0]||d[1]-c[1]);let f=[];for(let[d,c]of u)f.push(d,c);return f}var Bi=(e,n)=>e<n?e*1048576+n:n*1048576+e,Sh=class{constructor(n,t){this.px=n;this.py=t}px;py;edges=new Map;surface=new Set;orient(n,t,o){return Ul(this.px,this.py,n,t,o)}inCircle(n,t,o,r){return vh(this.px,this.py,n,t,o,r)}connected(n,t){return this.edges.get(Bi(n,t))}newEdge(n,t,o=!1){let r={v1:n,v2:t,constraint:o,tris:[]};return this.edges.set(Bi(n,t),r),r}edgeOrNew(n,t){return this.connected(n,t)??this.newEdge(n,t)}destroyEdge(n){this.edges.get(Bi(n.v1,n.v2))===n&&this.edges.delete(Bi(n.v1,n.v2))}rewireVertex(n,t,o){for(let r of o){if(r.v1!==n&&r.v2!==n)continue;let i=Bi(r.v1,r.v2);this.edges.get(i)===r&&this.edges.delete(i),r.v1===n&&(r.v1=t),r.v2===n&&(r.v2=t),r.v1!==r.v2&&!this.edges.has(Bi(r.v1,r.v2))&&this.edges.set(Bi(r.v1,r.v2),r)}}addFace(n,t){let o={v:n,e:t,inSurface:!0};for(let r of t)r.tris.push(o);return this.surface.add(o),o}removeFace(n,t=!1){this.surface.delete(n),n.inSurface=!1,t||this.detachFace(n)}detachFace(n){for(let t of n.e){let o=t.tris.indexOf(n);o>=0&&t.tris.splice(o,1)}}neighbor(n,t){for(let o of t.tris)if(o!==n&&o.inSurface)return o;return null}ringFrom(n,t){let o=0;if(t!==null&&(o=n.e.indexOf(t),o<0))throw new Error("cdt: edge not in face");let r=(o+1)%3,i=(o+2)%3;return{v1:n.v[o],v2:n.v[r],v3:n.v[i],e1:n.e[o],e2:n.e[r],e3:n.e[i]}}closestFace(n,t){let o=this.surface.size;if(o===0)return null;let r=Math.floor(Math.exp(Math.log(o)/3)),i=1/0,s=null;for(let l of this.surface){if(this.orient(l.v[0],l.v[1],l.v[2])>0){let a=l.e[0].v1,u=(n-this.px[a])**2+(t-this.py[a])**2;u<i&&(i=u,s=l)}if(r--,r<=0)break}return s}orientPt(n,t,o,r,i){let s=this.px,l=this.py;s.push(n,r),l.push(t,i);let a=Ul(s,l,s.length-2,o,s.length-1);return s.length-=2,l.length-=2,a}triangleNextEdge(n,t,o,r,i){let{v1:s,v2:l,v3:a,e1:u,e2:f,e3:d}=this.ringFrom(n,null),c=this.orientPt(t,o,s,r,i);return c>0?(c=this.orientPt(t,o,l,r,i),c>0?this.orientToward(l,a,r,i)>=0?{edge:null,onSummit:!1}:{edge:f,onSummit:!1}:c<0?this.orientToward(s,l,r,i)>=0?{edge:null,onSummit:!1}:{edge:u,onSummit:!1}:{edge:null,onSummit:this.orientToward(s,l,r,i)<0}):c<0?(c=this.orientPt(t,o,a,r,i),c>0?this.orientToward(a,s,r,i)>=0?{edge:null,onSummit:!1}:{edge:d,onSummit:!1}:c<0?this.orientToward(l,a,r,i)>=0?{edge:null,onSummit:!1}:{edge:f,onSummit:!1}:{edge:null,onSummit:this.orientToward(a,s,r,i)<0}):this.orientToward(l,a,r,i)<0?{edge:f,onSummit:!1}:{edge:null,onSummit:this.orientToward(s,l,r,i)<0}}orientToward(n,t,o,r){let i=this.px,s=this.py;i.push(o),s.push(r);let l=Ul(i,s,n,t,i.length-1);return i.length-=1,s.length-=1,l}barycenter(n){return[(this.px[n.v[0]]+this.px[n.v[1]]+this.px[n.v[2]])/3,(this.py[n.v[0]]+this.py[n.v[1]]+this.py[n.v[2]])/3]}pointLocateWalk(n,t,o,r,i){let s=this.triangleNextEdge(i,n,t,o,r);if(s.edge===null){if(!s.onSummit)return i;for(let b of i.e){let g=this.neighbor(i,b);if(g!==null){let[E,R]=this.barycenter(g);return this.pointLocateWalk(E,R,o,r,g)}}return null}let l=s.edge,a=this.neighbor(i,l),u=0,f=0,d=0,c=null,m=null;if(a!==null){let b=this.ringFrom(a,l);u=b.v1,f=b.v2,d=b.v3,l=b.e1,c=b.e2,m=b.e3}for(;a!==null;){let b=this.orientPt(n,t,d,o,r);if(b<0){if(this.orientToward(f,d,o,r)>=0)return a;a=this.neighbor(a,c),l=c,u=d}else if(b>0){if(this.orientToward(d,u,o,r)>=0)return a;a=this.neighbor(a,m),l=m,f=d}else{if(this.orientToward(f,d,o,r)>=0)return a;for(let g of[c,m]){let E=this.neighbor(a,g);if(E!==null){let[R,N]=this.barycenter(E);return this.pointLocateWalk(R,N,o,r,E)}}return null}if(a!==null){let g=a.e.indexOf(l),E=a.e[(g+1)%3],R=a.e[(g+2)%3];c=E,m=R,d=E.v1===u||E.v1===f?E.v2:E.v1}}return null}pointLocate(n,t){let o=this.closestFace(n,t);if(o===null)return null;let[r,i]=this.barycenter(o);return this.pointLocateWalk(r,i,n,t,o)}swapIfInCircle(n,t,o,r,i,s,l){if(i.constraint)return;let a=this.neighbor(n,i);if(a===null)return;let u=a.e.indexOf(i),f=a.e[(u+1)%3],d=a.e[(u+2)%3],c=f.v1===i.v1||f.v1===i.v2?f.v2:f.v1;if(this.inCircle(t,o,r,c)>0){let m=this.edgeOrNew(r,c);this.removeFace(n),this.removeFace(a);let b=this.addFace([c,o,r],[d,s,m]),g=this.addFace([t,c,r],[f,m,l]);this.swapIfInCircle(b,c,o,r,d,s,m),this.swapIfInCircle(g,t,c,r,f,m,l)}}addVertexToFace(n,t){let{v1:o,v2:r,v3:i,e1:s,e2:l,e3:a}=this.ringFrom(t,null);if(n===o||n===r||n===i)return null;let{px:u,py:f}=this;if(u[n]===u[o]&&f[n]===f[o])return o;if(u[n]===u[r]&&f[n]===f[r])return r;if(u[n]===u[i]&&f[n]===f[i])return i;let d=this.edgeOrNew(n,o),c=this.edgeOrNew(n,r),m=this.edgeOrNew(n,i);this.removeFace(t);let b=this.addFace([n,o,r],[d,s,c]),g=this.addFace([n,r,i],[c,l,m]),E=this.addFace([n,i,o],[m,a,d]);return this.swapIfInCircle(b,o,r,n,s,c,d),this.swapIfInCircle(g,r,i,n,l,m,c),this.swapIfInCircle(E,i,o,n,a,d,m),null}addVertex(n){let t=this.pointLocate(this.px[n],this.py[n]);if(t===null)throw new Error("cdt: vertex outside triangulation hull");return this.addVertexToFace(n,t)}polygonInCircle(n,t,o,r){let i=-1,s=-1;for(let l of n){for(let a of[l.v1,l.v2])if(a!==i&&a!==s&&a!==t&&a!==o&&a!==r&&this.inCircle(t,o,r,a)>0)return!0;i=l.v1,s=l.v2}return!1}triangulatePolygon(n){if(n.length<2)return;let t=n[0],o=n[1],r,i;t.v1===o.v1||t.v1===o.v2?(r=t.v2,i=t.v1):(r=t.v1,i=t.v2);let s=1,l=i,a=!1;for(;s<n.length&&!a;){let b=n[s];l=b.v1===l?b.v2:b.v1,l!==r&&this.orient(r,i,l)>=0&&!this.polygonInCircle(n,r,i,l)?a=!0:s++}if(!a)return;let u=this.edgeOrNew(i,l),f=this.edgeOrNew(l,r);this.addFace([r,i,l],[t,u,f]);let d=[];for(let b=1;b<=s;b++)d.push(n[b]);u!==n[s]&&d.push(u);let c=n.slice(s+1),m=c.length>0&&f!==c[0]?[f,...c]:c;this.triangulatePolygon(d),this.triangulatePolygon(m)}removeTriangles(n){for(let t of[...n.tris])t.inSurface&&this.removeFace(t)}removeIntersectedEdge(n,t,o,r,i,s){if(o.constraint)throw new Error("cdt: constraint edges cross");let l=this.ringFrom(r,o),a=l.v1,u=l.v2,f=l.v3,d=l.e2,c=l.e3,m=(E,R,N)=>{let C=this.neighbor(r,E);if(this.removeTriangles(o),o.tris.length===0&&this.destroyEdge(o),C===null)throw new Error("cdt: constraint walk left the surface");N.push(R),this.removeIntersectedEdge(n,t,E,C,i,s)},b=this.orient(u,f,t),g=this.orient(f,a,t);b===0?(this.removeTriangles(o),o.tris.length===0&&this.destroyEdge(o),i.push(c),s.push(d)):b>0?m(c,d,s):g>=0||this.orient(n,t,f)>0?m(d,c,i):m(c,d,s)}removeIntersectedVertex(n,t,o,r){for(let i of this.surface){if(i.v[0]!==n&&i.v[1]!==n&&i.v[2]!==n)continue;let[s,l,a]=i.v;if(n===l?(l=a,a=s):n===a&&(a=l,l=s),this.orient(n,l,t)<0||this.orient(a,n,t)<0)continue;let d=this.orient(l,a,t),c=i.e.find(R=>R.v1===l&&R.v2===a||R.v1===a&&R.v2===l),m=this.neighbor(i,c),b=this.ringFrom(i,c),g=b.e2,E=b.e3;if(d>=0)return i;if(this.removeFace(i,!0),o.push(g),r.push(E),m===null)throw new Error("cdt: constraint walk left the surface");return this.removeIntersectedEdge(n,t,c,m,o,r),i}throw new Error("cdt: no wedge triangle found at constraint endpoint")}addConstraint(n){let t=[],o=[],r=this.removeIntersectedVertex(n.v1,n.v2,t,o);r.inSurface||(this.triangulatePolygon([n,...o]),this.triangulatePolygon([n,...[...t].reverse()]),this.detachFace(r))}dropEnclosing(n){for(let t of[...this.surface])(t.v[0]>=n||t.v[1]>=n||t.v[2]>=n)&&this.removeFace(t)}dropHoles(){for(let n of[...this.surface]){let t=!1;for(let o=0;o<3;o++){let r=n.e[o];if(r.constraint&&r.v1!==n.v[o]){t=!0;break}}t&&this.removeFace(n)}}toSurface(){let n=[...this.surface],t=new Map;n.forEach((i,s)=>t.set(i,s));let o=[],r=[];for(let i of n){o.push(i.v[0],i.v[1],i.v[2]);let s=[];for(let l of i.e)for(let a of l.tris)a!==i&&a.inSurface&&s.push(t.get(a));for(;s.length<3;)s.push(-1);r.push(s[0],s[1],s[2])}return{nfaces:n.length,faces:o,neigh:r}}},aR=1.7320508075688772;function uR(e,n,t,o,r){let i=e.slice(0,t),s=n.slice(0,t),l=i[0],a=i[0],u=s[0],f=s[0];for(let I=1;I<t;I++)i[I]>a?a=i[I]:i[I]<l&&(l=i[I]),s[I]>f?f=s[I]:s[I]<u&&(u=s[I]);let d=(a+l)/2,c=(f+u)/2,m=100*Math.hypot(a-d,f-c);m===0&&(m=100);let b=t;i.push(d+m*aR,d,d-m*aR),s.push(c-m,c+2*m,c-m);let g=new Sh(i,s),E=[];for(let I=0;I<r;I++)E.push(g.newEdge(o[2*I],o[2*I+1],!0));let R=g.newEdge(b,b+1),N=g.newEdge(b+1,b+2),C=g.newEdge(b+2,b);g.addFace([b,b+1,b+2],[R,N,C]);for(let I=0;I<t;I++){let me=g.addVertex(I);me!==null&&me!==I&&g.rewireVertex(I,me,E)}for(let I=0;I<r;I++){let me=E[I];me.v1!==me.v2&&g.addConstraint(me)}g.dropEnclosing(b),r>0&&g.dropHoles();let ne=g.toSurface();return i.length=t,s.length=t,ne.nfaces>0?ne:null}var dp=32,pR=(e,n)=>e<n?e*1048576+n:n*1048576+e;function Qte(e,n,t){let o=e[n[3*t]],r=e[n[3*t+1]],i=e[n[3*t+2]];return{x:(o.x+r.x+i.x)/3,y:(o.y+r.y+i.y)/3}}function Zte(e,n,t){let o=[e[n],e[n+1],e[n+2]],r=new Set([e[t],e[t+1],e[t+2]]),i=o.filter(a=>r.has(a)),s=Math.min(i[0],i[1]),l=Math.max(i[0],i[1]);return{i:s,j:l}}function mR(e,n,t,o){let r=Math.hypot(e.nodes[n].ctr.x-e.nodes[t].ctr.x,e.nodes[n].ctr.y-e.nodes[t].ctr.y),i=e.edges.length;e.edges.push({t:n,h:t,seg:o,dist:r}),e.nodes[n].edges.push(i),e.nodes[t].edges.push(i)}function eoe(e,n,t,o,r){let i={nodes:[],edges:[]};for(let s=0;s<e+2;s++)i.nodes.push({edges:[],ctr:{x:0,y:0}});for(let s=0;s<e;s++)i.nodes[s].ctr=Qte(o,r,s);for(let s=0;s<e;s++)for(let l=0;l<3;l++){let a=t[3*s+l];if(a===-1)break;s<a&&mR(i,s,a,Zte(n,3*s,3*a))}return i}function Ch(e){let n=e.length,t=1/0,o=-1/0,r=1/0,i=-1/0,s=0;for(let E of e)for(let R of E.ps)t=Math.min(t,R.x),o=Math.max(o,R.x),r=Math.min(r,R.y),i=Math.max(i,R.y),s++;t-=dp,r-=dp,o+=dp,i+=dp;let l=s+4,a=new Array(l),u=[];a[0]={x:t,y:r},a[1]={x:o,y:r},a[2]={x:o,y:i},a[3]={x:t,y:i};for(let E=1;E<=4;E++)u.push(E-1,E<4?E:0);let f=new Array(n+1),d=4;for(let E=0;E<n;E++){f[E]=d;let R=e[E];for(let N=1;N<=R.ps.length;N++)u.push(d,N<R.ps.length?d+1:f[E]),a[d++]=R.ps[N-1]}f[n]=d;let c=a.map(E=>E.x),m=a.map(E=>E.y),b=uR(c,m,l,u,l);if(b===null)throw new Error("mkRouter: constrained triangulation failed");let g=new Map;for(let E=0;E<b.nfaces;E++){let R=b.faces[3*E],N=b.faces[3*E+1],C=b.faces[3*E+2];for(let[ne,I]of[[R,N],[N,C],[C,R]])g.set(pR(ne,I),E)}return{pn:l,ps:a,obs:f,tris:b.faces.slice(),trimap:g,tn:b.nfaces,tg:eoe(b.nfaces,b.faces,b.neigh,a,b.faces)}}function noe(e,n,t){let o=e.get(pR(n,t));if(o===void 0)throw new Error("findMap: no triangle for segment");return o}var fR=-1e-10;function dR(e,n,t){return(e.y-n.y)*(t.x-n.x)-(t.y-n.y)*(e.x-n.x)}function cR(e,n,t,o){return dR(o,e,n)>=fR&&dR(o,n,t)>=fR}function toe(e,n,t,o){let r=ln(e,n,t),i=ln(e,n,o);return r===i?!1:r===0?ln(e,o,n)*ln(e,o,t)>=0:ln(e,t,n)*ln(e,t,o)>=0}var wh=1,Nh=2,Rh=4,Th=8,ve=(e,n)=>({x:e.x+n.x,y:e.y+n.y});function ooe(e,n){let t={x:0,y:1},o={x:1,y:1},r={x:1,y:0},i={x:1,y:-1},s={x:0,y:-1},l={x:-1,y:-1},a={x:-1,y:0},u={x:-1,y:1};switch(n){case Rh:return[ve(e,t),ve(e,u),ve(e,o)];case Rh|Nh:return[ve(e,o),ve(e,t),ve(e,r)];case Nh:return[ve(e,r),ve(e,o),ve(e,i)];case wh|Nh:return[ve(e,i),ve(e,r),ve(e,s)];case wh:return[ve(e,s),ve(e,i),ve(e,l)];case wh|Th:return[ve(e,l),ve(e,s),ve(e,a)];case Th:return[ve(e,a),ve(e,l),ve(e,u)];case Rh|Th:return[ve(e,u),ve(e,a),ve(e,t)];default:return[e,e,e]}}function _h(e,n,t,o,r){let i=e.obs[t],s=e.obs[t+1],l=e.ps,[a,u,f]=ooe(n,r);e.tg.nodes[o].edges.length=0,e.tg.nodes[o].ctr=n;for(let d=i;d<s;d++){let c={i:d,j:d<s-1?d+1:i},m=noe(e.trimap,c.i,c.j);r!==0&&!cR(u,n,f,l[c.i])&&!cR(u,n,f,l[c.j])&&!toe(n,a,l[c.i],l[c.j])||mR(e.tg,o,m,c)}}function Ah(e,n,t){let o=e.nodes[n];for(let r of o.edges){let i=e.edges[r];if(i.t===t||i.h===t)return i.seg}throw new Error("edgeToSeg: no edge between triangles")}var xR=-34028234663852886e22,kh=class{constructor(n){this.size=n;this.pq=new Array(n+1).fill(-1),this.vals=new Array(n).fill(xR),this.idxs=new Array(n).fill(0)}size;pq;cnt=0;vals;idxs;val(n){return n===-1?0:this.vals[n]}upheap(n){let{pq:t}=this,o=n,r=t[o],i=this.val(r),s=Math.floor(o/2),l=t[s];for(;this.val(l)<i;)t[o]=l,this.idxs[l]=o,o=s,s=Math.floor(s/2),l=t[s];t[o]=r,this.idxs[r]=o}insert(n){return this.cnt===this.size?!0:(this.cnt++,this.pq[this.cnt]=n,this.upheap(this.cnt),!1)}downheap(n){let{pq:t}=this,o=n,r=t[o],i=this.val(r),s=Math.floor(this.cnt/2);for(;o<=s;){let l=o+o,a=t[l];if(l<this.cnt&&this.val(a)<this.val(t[l+1])&&(l++,a=t[l]),i>=this.val(a))break;t[o]=a,this.idxs[a]=o,o=l}t[o]=r,this.idxs[r]=o}remove(){if(this.cnt===0)return-1;let n=this.pq[1];return this.pq[1]=this.pq[this.cnt],this.cnt--,this.cnt>0&&this.downheap(1),n}update(n,t){this.vals[n]=t,this.upheap(this.idxs[n])}};function hR(e,n,t,o){let r=new Array(n).fill(0),i=new kh(n);if(r[t]=-1,i.vals[t]=0,i.insert(t))return null;let s;for(;(s=i.remove())!==-1&&(i.vals[s]*=-1,s!==o);){let l=e.nodes[s];for(let a of l.edges){let u=e.edges[a],f=u.t===s?u.h:u.t;if(i.vals[f]<0){let d=-(i.vals[s]+u.dist);if(i.vals[f]===xR){if(i.vals[f]=d,r[f]=s,i.insert(f))return null}else i.vals[f]<d&&(i.update(f,d),r[f]=s)}}}return r}var ER={swapEnds:()=>!1,splineMerge:()=>!1,ignoreSwap:!1,isOrtho:!1},cn=(e,n,t)=>({v:{i:e,j:n},prev:t});function roe(e,n,t){let o=Math.atan2(t.y-n.y,t.x-n.x),r=Math.atan2(e.y-n.y,e.x-n.x);return(o+r)/2}function ioe(e,n,t,o){let r=ln(e,n,t),i=ln(e,n,o);return r===i?!1:r===0?ln(e,o,n)*ln(e,o,t)>=0:ln(e,t,n)*ln(e,t,o)>=0}var soe=1e-10;function loe(e,n,t,o){if(!ioe(e,n,t,o))return null;let r={x:n.x-e.x,y:n.y-e.y},i={x:o.x-t.x,y:o.y-t.y},s={x:-i.y,y:i.x},l=-(s.x*t.x+s.y*t.y),a=s.x*r.x+s.y*r.y;if(Math.abs(a)<soe)return null;let u=(s.x*e.x+s.y*e.y+l)/a;return{x:e.x-u*r.x,y:e.y-u*r.y}}function aoe(e,n,t,o){for(let r=e.triMap[n]??null;r;r=r.prev){let i=loe(t,o,e.ps[r.v.i],e.ps[r.v.j]);if(i!==null)return i}return null}function uoe(e,n){for(let t=1;t<n.length;t++){let o=n[t];if(o.x===e.x&&o.y===e.y)return t}return-1}var bR=15;function foe(e,n,t,o,r,i){let s=uoe(o,i.ps);if(s<0)return null;let l=roe(t,o,r),a=Math.sin(l),u=Math.cos(l),f={x:o.x+100*u,y:o.y+100*a};s>e?ln(t,o,f)!==1&&(a*=-1,u*=-1,f={x:o.x+100*u,y:o.y+100*a}):ln(t,o,f)!==-1&&(a*=-1,u*=-1,f={x:o.x+100*u,y:o.y+100*a});let d=aoe(i,s,o,f);if(d===null)return null;let c=Math.hypot(d.x-o.x,d.y-o.y),m=c>=n*bR?bR:c/n,b=new Array(n);if(s<e)for(let g=0;g<n;g++)b[g]={x:o.x+g*m*u,y:o.y+g*m*a};else for(let g=0;g<n;g++)b[n-g-1]={x:o.x+g*m*u,y:o.y+g*m*a};return b}function doe(e,n,t,o,r,i){let s=o,l=0;for(let N=n[s];N!==t;N=n[N])l++;let a=[],u=[],f=n[s],d=Ah(e.tg,f,s);for(a.push({ts:cn(-1,d.j,null),v:d.i}),u.push({ts:cn(-1,d.i,null),v:d.j}),s=f,f=n[s];f>=0;f=n[f]){d=Ah(e.tg,s,f);let N=a[a.length-1],C=u[u.length-1];d.i===N.v?(N.ts=cn(C.v,d.j,N.ts),C.ts=cn(N.v,d.j,C.ts),u.push({ts:cn(C.v,N.v,null),v:d.j})):d.i===C.v?(N.ts=cn(C.v,d.j,N.ts),C.ts=cn(N.v,d.j,C.ts),a.push({ts:cn(C.v,N.v,null),v:d.j})):d.j===N.v?(N.ts=cn(C.v,d.i,N.ts),C.ts=cn(N.v,d.i,C.ts),u.push({ts:cn(C.v,N.v,null),v:d.i})):(N.ts=cn(C.v,d.i,N.ts),C.ts=cn(N.v,d.i,C.ts),a.push({ts:cn(C.v,N.v,null),v:d.i})),s=f}let c=a.length,m=u.length;a[c-1].ts=cn(-2,u[m-1].v,a[c-1].ts),u[m-1].ts=cn(-2,a[c-1].v,u[m-1].ts);let b=new Map;b.set(-1,0),b.set(-2,c+1);let g=[i],E=[null],R=1;for(let N=0;N<c;N++)b.set(a[N].v,R),g.push(e.ps[a[N].v]),E[R++]=a[N].ts;g.push(r),E[R++]=null;for(let N=m-1;N>=0;N--)b.set(u[N].v,R),g.push(e.ps[u[N].v]),E[R++]=u[N].ts;for(let N of E)for(let C=N;C;C=C.prev)C.v.i=b.get(C.v.i),C.v.j=b.get(C.v.j);return{trip:{ps:g,triMap:E},sx:c+1}}function gR(e,n,t){let o=t?n.slice().reverse():n;Z(e,e.head,o,o.length,ER),ao(e)}function yR(e,n,t){let o=e[n],r=e[(n+1)%e.length],i=n===0?e[e.length-1]:e[n-1];if(t.x===r.x&&t.y===r.y||t.x===i.x&&t.y===i.y){let s=(r.x+i.x)/2-o.x,l=(r.y+i.y)/2-o.y,a=Math.hypot(s,l);return{x:o.x+.1*s/a,y:o.y+.1*l/a}}return o}function coe(e,n,t){t[0]=yR(e,0,t[1]),t[t.length-1]=yR(e,n,t[t.length-2])}function poe(e){return e.map((n,t)=>({a:n,b:e[(t+1)%e.length]}))}function PR(e,n,t,o){if(o)return no(t);coe(e,n,t);try{let r=Wn(poe(e),t,[{x:0,y:0},{x:0,y:0}]);return r.length>=4?r:null}catch{return null}}function moe(e){let n=[e],t=e;for(;t.info.to_virt!==void 0&&t.info.to_virt!==t;)t=t.info.to_virt,n.push(t);return n}function xoe(e,n,t,o,r){let i=[{x:n.ps[0].x,y:n.ps[0].y},{x:n.ps[t].x,y:n.ps[t].y}],s=e.root.info.concentrate??!1,l=o.info.count??1,a=o.head,u=to({ps:n.ps},i);if(u===null)return 1;if(u.length===2){let m=moe(o);return wr(e,m,m.length,r?1:0,ER),0}if(l===1||s){let m=PR(n.ps,t,u,r);return m===null?1:(gR(o,m,o.head!==a),0)}let f=2*(u.length-1),d=[];for(let m=0;m+2<u.length;m++){let b=foe(t,l+1,u[m],u[m+1],u[m+2],n);if(b===null)return 1;d.push(b)}let c=o;for(let m=0;m<l&&c!==void 0;m++){let b=new Array(f);b[0]=i[0];for(let R=1;R+1<u.length;R++)b[R]=d[R-1][m];b[u.length-1]=i[1];for(let R=1;R+1<u.length;R++)b[f-R]=d[R-1][m+1];let g=to({ps:b},i);if(g===null)return 1;let E=PR(b,u.length-1,g,r);if(E===null)return 1;gR(c,E,c.head!==a),c=c.info.to_virt}return 0}function vR(e,n,t,o,r){let i=o[0],s=o[o.length-1],l=t.tn,a=t.tn+1,u=t.tg.edges.length,f=t.tg.nodes.map(m=>m.edges.length);_h(t,i,n.tail.info.lim??0,l,n.info.tail_port.side),_h(t,s,n.head.info.lim??0,a,n.info.head_port.side);let d=hR(t.tg,t.tn+2,a,l),c;if(d){let{trip:m,sx:b}=doe(t,d,a,l,s,i);c=xoe(e,m,b,n,r)}else c=-1;t.tg.edges.length=u;for(let m=0;m<t.tn;m++)t.tg.nodes[m].edges.length=f[m];return c}function It(e,n){return n.idx===n.poly.finish?e[n.poly.start]:e[n.idx+1]}function hoe(e,n){return n.idx===n.poly.start?e[n.poly.finish]:e[n.idx-1]}function SR(e){return e<0?-1:e>0?1:0}var cp=(e,n)=>(e.y-n.y)/(e.x-n.x),pp=(e,n)=>e.x===n.x&&e.y===n.y;function wR(e,n,t,o){let r=n.pos.x,i=n.pos.y,s=It(e,n).pos.x-r,l=It(e,n).pos.y-i,a=t.pos.x-r,u=t.pos.y-i,f=It(e,t).pos.x-r,d=It(e,t).pos.y-i;o[0]=SR(s*u-l*a),o[1]=SR(s*d-l*f),o[2]=o[0]*o[1]}function NR(e,n,t){return e<n?n<t?1:n>t?-1:0:e>n?n>t?1:n<t?-1:0:0}function Lt(e,n,t,o){let r=n.pos,i=It(e,n).pos,s=o===0?t.pos:It(e,t).pos;return r.x===i.x?r.x===s.x&&NR(r.y,s.y,i.y)!==-1?1:0:NR(r.x,s.x,i.x)}function RR(e,n,t,o){if(o<=0)return null;let r=n.pos,i=It(e,n).pos,s=t.pos,l=It(e,t).pos,a,u;switch(o){case 3:{if(r.x===i.x)a=r.x,u=l.y+cp(s,l)*(a-l.x);else if(s.x===l.x)a=s.x,u=i.y+cp(r,i)*(a-i.x);else{let f=cp(s,l),d=cp(r,i),c=s.y-f*s.x,m=r.y-d*r.x;a=(m-c)/(f-d),u=(f*m-c*d)/(f-d)}break}case 2:{let f,d;if(Lt(e,n,t,0)===-1)f=s,d=Lt(e,t,n,1)===-1?Lt(e,t,n,0)===-1?i:r:l;else if(Lt(e,n,t,1)===-1)f=l,d=Lt(e,n,t,0)===-1?Lt(e,t,n,0)===-1?i:r:s;else{if(Lt(e,t,n,0)!==-1)return null;f=r,d=i}a=(f.x+d.x)/2,u=(f.y+d.y)/2;break}default:(r.x-i.x)*(s.y-r.y)===(r.y-i.y)*(s.x-r.x)?(a=s.x,u=s.y):(a=l.x,u=l.y)}return{x:a,y:u}}function boe(e,n,t,o){let r=n.pos,i=It(e,n).pos,s=t.pos,l=It(e,t).pos;return r.x!==i.x&&s.x!==l.x||r.x===i.x&&!pp(r,o)&&!pp(i,o)||s.x===l.x&&!pp(s,o)&&!pp(l,o)}function goe(e,n,t){let o=[0,0,0];if(wR(e,n,t,o),o[2]>0)return!1;let r;if(o[2]<0){if(wR(e,t,n,o),o[2]>0||(r=RR(e,n,t,o[2]<0?3:Lt(e,t,n,Math.abs(o[0]))),r===null))return!1}else if(r=RR(e,n,t,o[0]===o[1]?2*Math.max(Lt(e,n,t,0),Lt(e,n,t,1)):Lt(e,n,t,Math.abs(o[0]))),r===null)return!1;return boe(e,n,t,r)}function TR(e,n){return e.pos.x>n.pos.x?1:e.pos.x<n.pos.x?-1:e.pos.y>n.pos.y?1:e.pos.y<n.pos.y?-1:0}function yoe(e){let n=[],t=be(e.slice(),TR);for(let o of t){let r=hoe(e,o),i=r;for(let s=0;s<2;s++){switch(TR(o,r)){case-1:{for(let l of n)if(goe(e,l,i))return 1;n.push(i),i.active=i;break}case 1:{let l=i.active;if(l===null)return-1;let a=n.indexOf(l);a>=0&&n.splice(a,1),i.active=null;break}default:break}r=It(e,o),i=o}}return 0}var kR=(e,n)=>e.x<=n.ur.x&&e.x>=n.ll.x&&e.y<=n.ur.y&&e.y>=n.ll.y,CR=(e,n)=>kR(e.ll,n)&&kR(e.ur,n);function Poe(e,n){for(let t=0;t<e.length;t++){let o=e[t],r=o.ps[0];for(let i=t+1;i<e.length;i++){let s=e[i];if(CR(n[t].bb,n[i].bb)){if(wi(s.ps,r))return!0}else if(CR(n[i].bb,n[t].bb)&&wi(o.ps,s.ps[0]))return!0}}return!1}function _R(e){let n=[],t=[];for(let r of e){let i=t.length,s={ll:{x:1/0,y:1/0},ur:{x:-1/0,y:-1/0}},l={start:i,finish:i,bb:s};for(let a of r.ps)s.ll.x=Math.min(s.ll.x,a.x),s.ll.y=Math.min(s.ll.y,a.y),s.ur.x=Math.max(s.ur.x,a.x),s.ur.y=Math.max(s.ur.y,a.y),t.push({pos:a,poly:l,active:null,idx:t.length});l.finish=t.length-1,n.push(l)}let o=yoe(t);return o<0||o!==0?!1:!Poe(e,n)}function Eoe(e){return!1}function voe(e){return!1}var Oo={swapEnds:Eoe,splineMerge:voe,ignoreSwap:!1,isOrtho:!1},Soe={...Oo,ignoreSwap:!0,isOrtho:!0},Ih=class{static halfHeight(n,t){return n/2+t}static vertices(n,t,o,r,i){return[{x:n-o,y:t-i},{x:n-o,y:t+i},{x:n+r,y:t+i},{x:n+r,y:t-i}]}};function AR(e,n,t){return-(t.y>=0?1:-1)*(n*t.x)/(e*Math.sqrt(e*e-t.x*t.x))}function woe(e,n,t,o){let r=2*Math.PI*(t-.5)/o,i=2*Math.PI*(t+.5)/o,s={x:e*Math.cos(r),y:n*Math.sin(r)},l={x:e*Math.cos(i),y:n*Math.sin(i)},a=AR(e,n,s),u=AR(e,n,l),f=(a*s.x-s.y-u*l.x+l.y)/(a-u),d=s.y+a*(f-s.x);return{x:f,y:d}}function Noe(e,n){return e===0?{x:n.x,y:n.y}:e===1?{x:-n.x,y:n.y}:e===2?{x:-n.x,y:-n.y}:{x:n.x,y:-n.y}}function Roe(e,n,t){let o=n.sides,r=n.vertices;if(r==null)return null;let i=n.penwidth??1,s=n.peripheries>=1&&i>0?1:0,l=n.peripheries+s,a=l>=1?l-1:0,u=Math.max(n.peripheries,1),f;if(a<u)f=r.slice(a*o,(a+1)*o);else{let c=r.slice((u-1)*o,u*o);f=Aa(c,o,i)}if(f.length<o)return null;let d=new Array(o);for(let c=0;c<o;c++){let m=f[c];if(m===void 0)return null;let b;if(t.doAdd)if(o===4){let g=Noe(c,{x:t.x,y:t.y});b={x:m.x+g.x,y:m.y+g.y}}else{let g=Math.hypot(m.x,m.y);b={x:m.x*(1+t.x/g),y:m.y*(1+t.y/g)}}else b={x:m.x*t.x,y:m.y*t.y};d[o-c-1]={x:b.x+e.info.coord.x,y:b.y+e.info.coord.y}}return{ps:d}}function Toe(e,n){let o=(e.info.outline_width??0)>0?e.info.outline_width*72:e.info.lw+e.info.rw,r=(e.info.outline_height??0)>0?e.info.outline_height*72:e.info.ht,i=n.doAdd?n.x:0,s=n.doAdd?n.y:0,l=(o+i)/2,a=(r+s)/2,u=new Array(8);for(let f=0;f<8;f++){let d=woe(l,a,f,8);u[8-f-1]={x:d.x+e.info.coord.x,y:d.y+e.info.coord.y}}return{ps:u}}function Gh(e,n,t,o,r,i){let s=e.info.coord,l,a,u,f;return i.doAdd?(l=n-i.x,a=t-i.y,u=o+i.x,f=r+i.y):(l=n*i.x,a=t*i.y,u=o*i.x,f=r*i.y),{ps:[{x:l+s.x,y:a+s.y},{x:l+s.x,y:f+s.y},{x:u+s.x,y:f+s.y},{x:u+s.x,y:a+s.y}]}}function GR(e,n){let o=e.info.shape?.kind;if(o===1||o===3){let r=e.info.shape_info;return r!==void 0&&r.sides>=3?Roe(e,r,n):Toe(e,n)}if(o===2){let i=e.info.shape_info?.b;return i?Gh(e,i.ll.x,i.ll.y,i.ur.x,i.ur.y,n):Gh(e,-e.info.lw,-e.info.ht/2,e.info.rw,e.info.ht/2,n)}return Gh(e,-e.info.lw,-e.info.ht/2,e.info.rw,e.info.ht/2,n)}function koe(e){let n={ll:{x:1/0,y:1/0},ur:{x:-1/0,y:-1/0}};for(let t of e)n.ll.x=Math.min(n.ll.x,t.x),n.ll.y=Math.min(n.ll.y,t.y),n.ur.x=Math.max(n.ur.x,t.x),n.ur.y=Math.max(n.ur.y,t.y);return n}function Coe(e,n){let t=e.info,r=t.shape?.kind;if(r!==void 0&&r!==1&&r!==3)return GR(e,n);let i=t.shape_info,s,l,a,u=t.coord.x,f=t.coord.y;if(i?.option?.fixedshape===!0&&i.vertices!=null){let c=koe(i.vertices);s=-c.ll.x,l=c.ur.x,a=(c.ur.y-c.ll.y)/2,f+=(c.ur.y+c.ll.y)/2,u+=0}else{let c=t.lw+t.rw,m=(t.outline_width??0)>0?t.outline_width*72:c,b=(t.outline_height??0)>0?t.outline_height*72:t.ht,g=c>0?t.lw*m/c:m/2;s=g,l=g,a=b/2}return{ps:Ih.vertices(u,f,s,l,a)}}var zi=class{static endpoint(n,t){return{x:n.x+t.x,y:n.y+t.y}}static selfChain(n,t){let o=[],r=n;for(let i=0;i<t&&r!==void 0;i++)o.push(r),r=r.info.to_virt;return o}};function _oe(e,n){let t=zi.endpoint(e.tail.info.coord,e.info.tail_port.p),o=zi.endpoint(e.head.info.coord,e.info.head_port.p);Z(e,e.head,[t,t,o,o],4,n)}function Mh(e){let n=e.root;if(n.info.nodesep===void 0){let t=V(n.attrs.get("nodesep"),.25,.02);n.info.nodesep=A(t*72)}return n.info.nodesep}function Lh(e,n){let t=e.info.count??1,o=e.tail.root.info.concentrate??!1;if(t<=1||o){Ws([e],1,n,n,Oo),e.info.label&&un(e.tail.root,e.info.label),ao(e);return}let r=zi.selfChain(e,t);Ws(r,r.length,n,n,Oo);for(let i of r)i.info.label&&un(i.tail.root,i.info.label),ao(i)}function Aoe(e){let n=e.info.tail_port?.p??{x:0,y:0},t=e.info.head_port?.p??{x:0,y:0},o=e.tail.id,r=e.head.id,i,s,l,a;return o<r?(i=o,l=n,s=r,a=t):o>r?(s=o,a=n,i=r,l=t):(n.x<t.x?(l=n,a=t):n.x>t.x?(l=t,a=n):n.y<t.y?(l=n,a=t):n.y>t.y?(l=t,a=n):l=a=n,i=s=o),`${i}|${l.x}|${l.y}|${s}|${a.x}|${a.y}`}function Goe(e){let n=new Map;for(let t of M(e))for(let o of t.outEdges(e)){let r=Aoe(o),i=n.get(r);i===void 0?(n.set(r,o),o.info.count=1,o.info.to_virt=void 0):(i.info.count=(i.info.count??1)+1,o.info.count=0,o.info.to_virt=i.info.to_virt,i.info.to_virt=o)}}var mp=class e{static polylinePoints(n){if(n.length===0)return[];let t=[n[0],n[0]];for(let o=1;o+1<n.length;o++)t.push(n[o],n[o],n[o]);return t.push(n[n.length-1],n[n.length-1]),t}static tryRouteSpline(n,t){let o=[{x:0,y:0},{x:0,y:0}];try{let r=Wn(n,t,o);return r.length>=4?r:null}catch{return null}}static installPline(n,t){let o=e.polylinePoints(t);Z(n,n.head,o,o.length,Oo),ao(n)}static installSpline(n,t,o){let r=o[0],i=o[o.length-1],s=-1111,l=-1111;for(let f=0;f<t.length;f++)s===-1111&&wi(t[f].ps,r)&&(s=f),l===-1111&&wi(t[f].ps,i)&&(l=f);let a=t.filter((f,d)=>d!==s&&d!==l),u=e.tryRouteSpline(hu(a),o);if(u===null){_oe(n,Oo);return}Z(n,n.head,u,u.length,Oo),ao(n)}};function MR(e,n){let t=zi.endpoint(e.tail.info.coord,e.info.tail_port.p),o=e.tail.info.lim??-1111,r=e.head.info.lim??-1111,i=zi.endpoint(e.head.info.coord,e.info.head_port.p);return j5(n,t,o,i,r)}function Moe(e,n,t,o){let r=MR(e,t);if(o===vr){mp.installPline(e,r);return}mp.installSpline(e,n,r)}var xp=class e{static buildNodes(n){return n.map(t=>({bb:{LL:{x:t.info.coord.x-t.info.lw,y:t.info.coord.y-t.info.ht/2},UR:{x:t.info.coord.x+t.info.rw,y:t.info.coord.y+t.info.ht/2}},coord:{x:t.info.coord.x,y:t.info.coord.y},xsize:t.info.lw+t.info.rw,ysize:t.info.ht}))}static buildEdges(n,t,o){let r=n.root.info.concentrate??!1,i=new Set,s=[];for(let l of M(n))for(let a of l.outEdges(n)){if(r){let m=a.tail.id,b=a.head.id,g=m<=b?`${m}|${b}`:`${b}|${m}`;if(i.has(g))continue;i.add(g)}let u=a.tail.info.coord,f=a.head.info.coord,d=a.info.tail_port.p,c=a.info.head_port.p;s.push({tail:o[t.indexOf(a.tail)],head:o[t.indexOf(a.head)],tailPoint:{x:u.x+d.x,y:u.y+d.y},headPoint:{x:f.x+c.x,y:f.y+c.y},_edge:a})}return s}static buildGraph(n){let t=[...n.nodes.values()],o=e.buildNodes(t);return{nodes:o,edges:e.buildEdges(n,t,o)}}static installResult(n,t){let o=n._edge;o&&Z(o,o.head,t,t.length,Soe)}},Fi=class e{static buildObstacles(n,t,o){let r=[],i=0;for(let s of n.nodes.values())if(o>=vr){let l=o===Dl?Coe(s,t):GR(s,t);l!==null?(s.info.lim=i++,r.push(l)):s.info.lim=-1111}else s.info.lim=-1111;return r}static withVconfig(n,t,o,r){let i=Mh(n),s=n.root.info.concentrate??!1,l=null;for(let a of M(n))for(let u of a.outEdges(n)){if((u.info.count??0)===0)continue;if(u.tail===u.head){Lh(u,i);continue}let f=(u.info.tail_port.side|u.info.head_port.side)!==0;if((u.info.count??1)>1||f){let m=0,b=MR(u,o);if(b.length===2&&!f){let g=e.chainList(u);wr(n,g,g.length,r,Oo)}else l===null&&(l=Ch(t)),m=vR(n,u,l,b,r===vr);if(!m)continue}let d=u,c=u.info.count??1;s&&(c=1);for(let m=0;m<c&&d!==void 0;m++)Moe(d,t,o,r),d=d.info.to_virt}}static chainList(n){let t=[n],o=n;for(;o.info.to_virt!==void 0&&o.info.to_virt!==o;)o=o.info.to_virt,t.push(o);return t}static straight(n,t){let o=Mh(n);for(let r of M(n))for(let i of r.outEdges(n)){if((i.info.count??0)===0)continue;if(i.tail===i.head){Lh(i,o);continue}let s=e.chainList(i);wr(n,s,s.length,t,Oo)}}static ortho(n,t){let o=xp.buildGraph(n);B1(o,!1,(i,s,l)=>xp.installResult(s,l));let r=Mh(n);for(let i of M(n))for(let s of i.outEdges(n)){if(s.info.spl!=null){ao(s);continue}if((s.info.count??0)===0)continue;if(s.tail===s.head){Lh(s,r);continue}let l=e.chainList(s);wr(n,l,l.length,t,Oo)}}static routed(n,t,o){let r=z5(t);e.withVconfig(n,t,r,o)}};function Loe(e,n,t){let o=Fi.buildObstacles(e,n,t),r=_R(o);if(r&&t===Dl){Fi.ortho(e,t);return}if(o.length>0&&r){Fi.routed(e,o,t);return}Fi.straight(e,t)}function Xl(e){let n=e.info.flags&15;if(n!==Kn){e.root.info.concentrate=Ne(e.root.attrs.get("concentrate"));for(let t of M(e))for(let o of t.outEdges(e))o.info.tail_port.dyna&&(o.info.tail_port=yn(o.tail,o.head,o.info.tail_port)),o.info.head_port.dyna&&(o.info.head_port=yn(o.head,o.tail,o.info.head_port));if(Goe(e),n===le){Fi.straight(e,n);return}Loe(e,oR(e),n)}}function Ioe(e){let n={ll:{x:1/0,y:1/0},ur:{x:-1/0,y:-1/0}};for(let t of e.nodes.values()){let o=(t.info.pos?.[0]??0)*72,r=(t.info.pos?.[1]??0)*72,i=(t.info.lw+t.info.rw)/2,s=t.info.ht/2;n.ll.x=Math.min(n.ll.x,o-i),n.ll.y=Math.min(n.ll.y,r-s),n.ur.x=Math.max(n.ur.x,o+i),n.ur.y=Math.max(n.ur.y,r+s)}return Number.isFinite(n.ll.x)?n:{ll:{x:0,y:0},ur:{x:0,y:0}}}function Ooe(e,n,t){for(let o of e.nodes.values())o.info.pos||(o.info.pos=[0,0]),o.info.pos[0]=(o.info.pos[0]??0)-n,o.info.pos[1]=(o.info.pos[1]??0)-t}function Doe(e,n,t){let o=e.info.n_cluster??0;for(let r=1;r<=o;r++){let i=e.info.clust?.[r-1];i&&Z1(i,n,t)}}function Oh(e){if(typeof process>"u")return;let n=process.env?.GVTS_POS_INJECT;if(!n||typeof process.getBuiltinModule!="function")return;let t=process.getBuiltinModule("node:fs");if(!t)return;let o=new Map,r=s=>{let l=s.info.n_cluster??0,a=s.info.clust;if(a)for(let u=0;u<l;u++){let f=a[u];f&&(o.set(f.name,f),r(f))}};r(e);let i=t.readFileSync(n,"utf8");for(let s of i.split(`
67
- `)){let l=/^GVTS_POS (\S+) (\S+) (\S+)/.exec(s);if(l){let f=e.nodes.get(l[1]);f&&(f.info.pos=[Number(l[2]),Number(l[3])]);continue}let a=/^GVTS_CLUST_BB (\S+) (\S+) (\S+) (\S+) (\S+)/.exec(s);if(a){let f=o.get(a[1]);f&&(f.info.bb={ll:{x:Number(a[2]),y:Number(a[3])},ur:{x:Number(a[4]),y:Number(a[5])}});continue}let u=/^GVTS_BB (\S+) (\S+) (\S+) (\S+)/.exec(s);u&&(e.info.bb={ll:{x:Number(u[1]),y:Number(u[2])},ur:{x:Number(u[3]),y:Number(u[4])}})}}function Ot(e){Oh(e);let n=Ioe(e);typeof process<"u"&&process.env.STRESS_DEBUG&&console.error("shiftBB",JSON.stringify(n)),Ooe(e,n.ll.x/72,n.ll.y/72),Doe(e,-n.ll.x,-n.ll.y),e.info.bb={ll:{x:0,y:0},ur:{x:n.ur.x-n.ll.x,y:n.ur.y-n.ll.y}},Oi(e),Xl(e)}function co(e,n,t,o){return{m:e,n,nz:0,type:t,format:o,ia:o===0?new Array(e+1).fill(0):[],ja:[],a:t===1?[]:null,isSymmetric:!1,isPatternSymmetric:!1}}function of(e,n,t,o){e.ia.push(n),e.ja.push(t),e.a!==null&&e.a.push(o),n>=e.m&&(e.m=n+1),t>=e.n&&(e.n=t+1),e.nz++}function Dh(e){return rf(e.nz,e.m,e.n,{irn:e.ia,jcn:e.ja,val:e.a},e.type)}function rf(e,n,t,o,r){let i=co(n,t,r,0);return Boe(i,e,o),Foe(i)}function Boe(e,n,t){let{irn:o,jcn:r,val:i}=t,s=e.ia,l=e.ja,a=e.m;l.length=n,e.a!==null&&(e.a.length=n);for(let u=0;u<n;u++)s[o[u]+1]++;for(let u=0;u<a;u++)s[u+1]+=s[u];for(let u=0;u<n;u++){let f=o[u];e.a!==null&&(e.a[s[f]]=i[u]),l[s[f]]=r[u],s[f]=s[f]+1}for(let u=a;u>0;u--)s[u]=s[u-1];s[0]=0,e.nz=n}function Foe(e){let{ia:n,ja:t,n:o}=e,r=e.a,i=new Array(o).fill(-1),s=0,l=n[0];for(let a=0;a<e.m;a++){for(let u=l;u<n[a+1];u++)i[t[u]]<n[a]?(t[s]=t[u],r!==null&&(r[s]=r[u]),i[t[u]]=s++):r!==null&&(r[i[t[u]]]+=r[u]);l=n[a+1],n[a+1]=s}return e.nz=s,t.length=s,r!==null&&(r.length=s),e}function hp(e){let{ia:n,ja:t,m:o,n:r}=e,i=co(r,o,e.type,0);i.nz=e.nz;let s=i.ia,l=i.ja;l.length=e.nz,i.a!==null&&(i.a.length=e.nz);for(let a=0;a<o;a++)for(let u=n[a];u<n[a+1];u++)s[t[u]+1]++;for(let a=0;a<r;a++)s[a+1]+=s[a];for(let a=0;a<o;a++)for(let u=n[a];u<n[a+1];u++){let f=t[u];l[s[f]]=a,i.a!==null&&(i.a[s[f]]=e.a[u]),s[f]=s[f]+1}for(let a=r-1;a>=0;a--)s[a+1]=s[a];return s[0]=0,i}function bp(e){return{m:e.m,n:e.n,nz:e.nz,type:e.type,format:e.format,ia:[...e.ia],ja:[...e.ja],a:e.a===null?null:[...e.a],isSymmetric:e.isSymmetric,isPatternSymmetric:e.isPatternSymmetric}}function ji(e,n){if(e.isSymmetric||n&&e.isPatternSymmetric)return!0;if(e.m!==e.n)return!1;let t=hp(e),o=!n&&e.type===1;return zoe(e,t,o)?(n||(e.isSymmetric=!0),e.isPatternSymmetric=!0,!0):!1}function zoe(e,n,t){let{ia:o,ja:r,m:i}=e,s=n.ia,l=n.ja,a=new Array(i).fill(-1);if(t){for(let u=0;u<=i;u++)if(o[u]!==s[u])return!1}for(let u=0;u<i;u++){for(let f=o[u];f<o[u+1];f++)a[r[f]]=f;for(let f=s[u];f<s[u+1];f++)if(a[l[f]]<o[u])return!1;if(t){for(let f=s[u];f<s[u+1];f++)if(Math.abs(n.a[f]-e.a[a[l[f]]])>1e-7)return!1}}return!0}function $l(e,n){if(ji(e,n))return bp(e);let t=hp(e),o=Bh(e,t);return o.isSymmetric=!0,o.isPatternSymmetric=!0,o}function Bh(e,n){let t=co(e.m,e.n,e.type,0),o=new Array(e.n).fill(-1),r=0;t.ia[0]=0;for(let i=0;i<e.m;i++)r=joe(e,t,o,i,r),r=Hoe(n,t,o,i,r),t.ia[i+1]=r;return t.nz=r,t}function joe(e,n,t,o,r){for(let i=e.ia[o];i<e.ia[o+1];i++)t[e.ja[i]]=r,n.ja[r]=e.ja[i],n.a!==null&&(n.a[r]=e.a[i]),r++;return r}function Hoe(e,n,t,o,r){for(let i=e.ia[o];i<e.ia[o+1];i++)t[e.ja[i]]<n.ia[o]?(n.ja[r]=e.ja[i],n.a!==null&&(n.a[r]=e.a[i]),r++):n.a!==null&&(n.a[t[e.ja[i]]]+=e.a[i]);return r}function Hi(e){let{ia:n,ja:t}=e,o=e.a,r=0,i=n[0];for(let s=0;s<e.m;s++){for(let l=i;l<n[s+1];l++)t[l]!==s&&(t[r]=t[l],o!==null&&(o[r]=o[l]),r++);i=n[s+1],n[s+1]=r}return e.nz=r,t.length=r,o!==null&&(o.length=r),e}function LR(e){let n=e.ia,t=e.a;for(let o=0;o<e.m;o++){let r=n[o+1]-n[o];for(let i=n[o];i<n[o+1];i++)t[i]=t[i]/r}return e}function Wl(e){let n=co(e.m,e.n,8,0);n.ia=[...e.ia],n.ja=[...e.ja],n.nz=e.nz;let t=$l(n,!0);return Hi(t),t.a=new Array(t.nz).fill(1),t.type=1,t}function Vi(e,n,t,o){let{ia:r,ja:i}=e,s=e.a;for(let l=0;l<e.m;l++){for(let a=0;a<o;a++)t[l*o+a]=0;for(let a=r[l];a<r[l+1];a++)for(let u=0;u<o;u++)t[l*o+u]+=s[a]*n[i[a]*o+u]}}var IR=[1072049730,4277811200],OR=[1026487127,2479318832],Fh=[3219128320,0,3219477845,1431655776,1071644672,6,1072273817,2572768590,3219477845,1428792442,3220326747,2605204969,1072693291,2334539715],Ui=[1073127424,0,3218484354,4072261632,1023063076,674715264,1073119232,0,3218461117,3210217472,3172771080,3638621984,1073111040,0,3218437751,390420480,3173212836,3585495149,1073102848,0,3218414253,2267936768,3169223908,2662361045,1073094656,0,3218390623,2507634688,3171162985,2468953824,1073086464,0,3218366859,3256639488,1024710703,1212974284,1073078272,0,3218342960,2256971776,1021068019,3984722746,1073070080,0,3218318924,1432963072,1025552838,2253493344,1073061888,0,3218294749,2593685504,1025857869,3569713298,1073053696,0,3218270434,3135315968,1025932062,2578918360,1073045504,0,3218245978,333350912,1024838164,3067064383,1073045504,0,3218245978,333350912,1024838164,3067064383,1073037312,0,3218221377,4224677888,3172358692,676584054,1073029120,0,3218196632,3244922880,3172970428,1759990788,1073020928,0,3218171740,2880153600,1025449926,864200944,1073012736,0,3218146699,4188948480,3173427396,4244986470,1073004544,0,3218121508,3799224320,3171707886,2129920782,1072996352,0,3218096165,2494877696,3169859256,2666802559,1072996352,0,3218096165,2494877696,3169859256,2666802559,1072988160,0,3218061592,1834893312,1024284458,2878946439,1072979968,0,3218010285,3420217344,1026238135,2626072356,1072971776,0,3217958663,1848307712,3172413263,1413480208,1072963584,0,3217906721,1800388608,1025620625,3150604315,1072955392,0,3217854455,3348799488,1025997135,1755284532,1072955392,0,3217854455,3348799488,1025997135,1755284532,1072947200,0,3217801862,1949143040,1025068720,831240079,1072939008,0,3217748937,1317060608,1018842723,1070436454,1072930816,0,3217695676,534949888,3173354596,3695624682,1072930816,0,3217695676,534949888,3173354596,3695624682,1072922624,0,3217642074,2633256960,3173700057,79811811,1072914432,0,3217588128,1696649216,1026276799,2145122825,1072906240,0,3217533833,34660352,1026284432,1918061144,1072906240,0,3217533833,34660352,1026284432,1918061144,1072898048,0,3217479183,3877228544,3172000874,2746409574,1072889856,0,3217424176,1890029568,3172900419,2668646457,1072889856,0,3217424176,1890029568,3172900419,2668646457,1072881664,0,3217368805,3819024384,3173047947,2416401295,1072873472,0,3217313067,1825275904,1024920769,1630894140,1072873472,0,3217313067,1825275904,1024920769,1630894140,1072865280,0,3217256956,538873856,1022457990,1294423098,1072857088,0,3217200466,4162842624,3173289264,393331720,1072848896,0,3217143594,3576651776,3173941412,403809174,1072848896,0,3217143594,3576651776,3173941412,403809174,1072840704,0,3217086334,2094043136,1024092566,2296929268,1072840704,0,3217086334,2094043136,1024092566,2296929268,1072832512,0,3217026193,836493312,3173348692,1554199538,1072824320,0,3216910087,1848311808,1026176044,720371772,1072824320,0,3216910087,1848311808,1026176044,720371772,1072816128,0,3216793172,2405154816,3172797527,1482669574,1072807936,0,3216675437,977985536,1025849653,3898321608,1072807936,0,3216675437,977985536,1025849653,3898321608,1072799744,0,3216556869,3593576448,1024687145,1294947944,1072799744,0,3216556869,3593576448,1024687145,1294947944,1072791552,0,3216437458,2330288128,3173422903,3375592410,1072783360,0,3216317191,1057366016,1025442395,1640390231,1072783360,0,3216317191,1057366016,1025442395,1640390231,1072775168,0,3216196055,2518409216,1026318042,3438875615,1072775168,0,3216196055,2518409216,1026318042,3438875615,1072766976,0,3216074038,4003692544,1024752734,1989124873,1072758784,0,3215919664,3222372352,1026382238,2201390737,1072758784,0,3215919664,3222372352,1026382238,2201390737,1072750592,0,3215672029,1897496576,1025278586,3856035916,1072750592,0,3215672029,1897496576,1025278586,3856035916,1072742400,0,3215422552,4130521088,3173841990,888316398,1072742400,0,3215422552,4130521088,3173841990,888316398,1072734208,0,3215171207,3120480256,1022689975,4112973482,1072734208,0,3215171207,3120480256,1022689975,4112973482,1072726016,0,3214901915,242745344,3173613606,2088634852,1072726016,0,3214901915,242745344,3173613606,2088634852,1072717824,0,3214391579,131432448,3173551444,2482677305,1072709632,0,3213869224,2969305088,3168738940,4141065884,1072709632,0,3213869224,2969305088,3168738940,4141065884,1072701440,0,3212828714,1796210688,3172590143,232407268,1072701440,0,3212828714,1796210688,3172590143,232407268,1072693248,0,0,0,0,0,1072693248,0,0,0,0,0,1072676864,0,1065357333,1971912704,3171993451,2577214440,1072660480,0,1066410070,1486061568,3173243995,115537874,1072644096,0,1066944805,684261376,3173687482,844762164,1072627712,0,1067467101,2313633792,1023480256,1559353171,1072611328,0,1067738798,3559784448,3173783155,1975385384,1072594944,0,1068012714,346013696,3172563349,3495569021,1072578560,0,1068288883,3453861888,3172624626,1205348359,1072570368,0,1068427825,3221667840,3171815742,1338588027,1072553984,0,1068603195,3511050240,3173331549,1443733147,1072537600,0,1068744181,2815549440,1026345054,2782613207,1072521216,0,1068886362,1301782528,3173804294,1012735262,1072513024,0,1068957907,183156736,1022107277,2845699378,1072496640,0,1069101918,1566130176,1025708380,985483226,1072480256,0,1069247176,2376949760,3172176e3,737634533,1072472064,0,1069320280,29114368,1025918673,3327831251,1072455680,0,1069467449,2198478848,3173892200,2951103968,1072447488,0,1069541521,970711040,3173332182,1335954173,1072431104,0,1069619086,2183651328,1025634168,3459057650,1072422912,0,1069656619,2116284416,1026336654,1144559924,1072406528,0,1069732193,210141184,1023647084,3414275233,1072398336,0,1069770236,2954203136,1019621288,592147081,1072381952,0,1069846845,2201202688,1025868665,1425913464,1072373760,0,1069885413,3835801600,1025913832,3848895943,1072357376,0,1069963086,3196850176,1025101707,742141560,1072349184,0,1070002194,2339729408,3173323149,3852214753,1072340992,0,1070041485,2235846656,3172754960,1888568069,1072324608,0,1070120623,3946381312,3171368276,2867408081,1072316416,0,1070160474,3707174912,1023930920,1486946159,1072300032,0,1070240749,1015734272,3173544515,1347821929,1072291840,0,1070281176,1465634816,3171693965,1319952810,1072283648,0,1070321799,943448064,3173862340,1498682038,1072275456,0,1070362619,3337621504,3169971314,3314953170,1072259072,0,1070444861,2966720512,3173711658,4145393717,1072250880,0,1070486286,4293332992,1019351591,1614935088,1072242688,0,1070527917,3839688704,3167363349,1706790417,1072234496,0,1070569756,1823715328,1025231852,3389841200,1072218112,0,1070625080,1615681536,1022926043,384650897,1072209920,0,1070646317,1734434816,1025972363,373091049,1072201728,0,1070667662,2183653376,3173785870,1671819292,1072193536,0,1070689116,3417110528,1026267853,4154791553,1072185344,0,1070710681,1666869248,1026336493,1363656119,1072177152,0,1070732357,1829681152,1024100318,3125197546,1072160768,0,1070776048,2094829568,1026202874,1246758132,1072152576,0,1070798065,3788726272,3173573242,3542170808,1072144384,0,1070820199,1992167424,1024552653,2968614856,1072136192,0,1070842450,1999843328,1024998228,3053895004,1072128e3,0,1070864820,601221120,1023992886,3968917661,1072119808,0,1070887309,3262236672,3173984206,157800053,1072111616,0,1070909920,2652319744,3173916809,453695652,1072103424,0,1070932654,121151488,1026473584,2170865497,1072095232,0,1070955511,1405669376,1025486317,3999088879,1072087040,0,1070978493,3747176448,3171552042,144991708],DR=[1080497479,1697350398];var BR=[3212193346,4277796864],FR=[3171743642,3164486458],zh=[1071644671,4294966717,1069897045,1431655484,1067799893,3474402193,1065423121,1738854423,1127743488,0,1120403456,0],jh=[0,0,1072693248,0,1016806223,445169518,1072690749,2851812149,3161546771,2631457885,1072688282,1048019041,3163577978,277309137,1072685845,3899555717,1015861842,896005651,1072683440,3541402996,3163278976,603557626,1072681067,702412510,1012987726,1642514529,1072678725,410360776,1016112100,1530123161,1072676414,3402036099,1016568486,1568897901,1072674136,1828292879,1015985434,2466115580,1072671890,728909815,1010744893,1882168529,1072669676,852742562,3161064244,2307943947,1072667494,2952712987,3163903570,707771662,1072665345,3490863953,3159392495,2353982037,1072663229,3228316108,3163670819,3117806614,1072661146,2930322912,1015075811,3915142575,1072659096,3366293073,3162512149,3936719688,1072657080,1014845819,3163496432,1440625213,1072655097,948735466,1015777676,1058231231,1072653147,3949972341,3164002716,1980885798,1072651232,2214878420,1016786167,1044000608,1072649351,828946858,3163547522,3414571165,1072647504,586995997,1015705409,1151779725,1072645691,2288159958,1015052805,2967733373,1072643913,2440944790,1016499965,3819481236,1072642170,1853186616,1015504408,4067707005,1072640462,1337108031,1015039787,2552227826,1072638789,1709341917,3163994235,1064372318,1072637151,3790955393,1015216097,1829350193,1072635549,4112506593,3158122907,443531258,1072633983,3504003472,1015756674,1913391796,1072632453,2799960843,1013847186,2312031119,1072630959,2839424854,1015238005,1303423926,1072629502,171030293,1015431681,3802952780,1072628080,4232894513,1016061241,1574172746,1072626696,2992903935,3162940288,999185156,1072625349,1603444721,3163704045,3427487848,1072624039,926591435,3164145656,458304910,1072622766,1829099622,3161575912,1049900754,1072621531,887463927,3164150041,3016629013,1072620333,3272845541,1015390024,2804567149,1072619174,1276261410,3163755104,2049468810,1072618053,78413852,3159926671,1209502043,1072616970,569847338,3162254491,1732876827,1072615925,3645941911,1011049453,1623370769,1072614920,1617004845,1016489481,990274799,1072613953,3978100823,1013894369,3667985273,1072613026,3049340112,1016332174,1057952304,1072612138,4040676318,1014403278,3145379760,1072611290,3577096743,1016274365,3948208247,1072610482,2583551245,3163526196,7447438,1072609714,1990012071,3163021004,3700663113,1072608986,2731501122,3162037958,3171891295,1072608299,1453150082,3162903110,3967507702,1072607652,3395129871,1016280325,419288974,1072607047,917841882,1014732983,797612805,1072606482,3566716925,1016095713,3793507337,1072605959,3712504873,1010091909,1343866602,1072605478,2321106615,1016345318,728023093,1072605039,363667784,3163350090,1637447327,1072604641,3111574537,3163304901,1005538728,1072604286,2956612997,3162788728,2301356462,1072603974,885834528,3163803357,2018924632,1072603704,2186617381,1012338858,2155747684,1072603477,3561793907,3163796463,3210617384,1072603294,1719614413,3161068205,2268379522,1072603154,1963711167,3160631279,3094194670,1072603058,1013258799,3162561597,1424001105,1072603005,4182873220,3161988964,2119843535,1072602997,3907805044,3162959434,3230367152,1072603034,1218806132,3162904882,508946058,1072603115,1447192521,1016110283,1577702611,1072603241,1339972927,3162190556,3108873501,1072603412,1944781191,1016392957,1416085611,1072603629,19972402,1013312481,2882956373,1072603891,919555682,3163070917,800313154,1072604199,1413356050,3163777462,4047189812,1072604553,2571947539,3162529412,974782238,1072604954,1176749997,3163870288,3631372142,1072605401,2604962541,1016114535,1527679488,1072605895,3649726105,1015920431,3253791412,1072606437,1110089947,3160782432,2630215679,1072607026,380978316,1014756995,1509121860,1072607662,2568320822,3163752735,2803776899,1072608347,194117574,3160254904,2339118633,1072609079,2966275557,3161203705,2089859417,1072609860,3418903055,3163702083,586480042,1072610690,2682146384,3162884716,3613822539,1072611569,1892288442,1014083580,730975783,1072612497,2191782032,1013830197,3775558587,1072613475,434316067,3163014404,576856675,1072614502,2069751141,1015749766,3823251925,1072615579,3964284211,3163667409,3552361237,1072616707,2990417245,1016122417,2632856018,1072617886,321958744,1015310724,1853053619,1072619115,1434058175,3162693581,2542706100,1072620395,3218338682,1015814775,2462790535,1072621727,2572866477,3163585423,1255266810,1072623111,697153126,3159737305,1457303226,1072624546,3092190715,3163595790,1034352192,1072626034,2380618042,3160987380,950899508,1072627574,4076559943,3163680482,1800964661,1072629168,815859274,1014300631,174054861,1072630814,2420883922,3163667963,4203911340,1072632514,1540824585,1014197934,816778419,1072634267,3716502172,1015997234,1553989012,1072636075,1610600570,1015341199,3507050924,1072637937,777507147,1013173679,944642663,1072639853,2483480501,1013410604,1821514088,1072641824,3706687593,3162540568,2211231186,1072643851,1432208378,3163532637,1073740399,1072645933,1242007932,3163557294,947235145,1072648071,135105010,1014276997,2789017511,1072650264,3707479175,3162673566,541073935,1072652515,382305176,1015962192,3586233004,1072654822,64696965,1015298649,2885774155,1072657185,4076975200,3162690849,129252895,1072659607,863738719,3163105977,994512329,1072662086,351641897,1014281732,1614448851,1072664622,3884662774,1015268844,1369272945,1072667217,4224142467,3163551506,2413007344,1072669871,2728693978,3163401880,3793974397,1072672584,764307441,1015989180,1101668360,1072675355,3999357479,1015294868,3282692914,1072678187,929806999,1015702697,835814894,1072681078,1533953344,3163436986,3829130221,1072684029,2912730644,1014466875,1301400989,1072687041,2174652632,1012073921,1096862857,1072690114,730821105];var jR=new ArrayBuffer(8),yp=new Float64Array(jR),Xi=new Uint32Array(jR);function Vh(e){return Xi[0]=Number(e&0xffffffffn),Xi[1]=Number(e>>32n&0xffffffffn),yp[0]}function Voe(e){return yp[0]=e,BigInt(Xi[1]>>>0)<<32n|BigInt(Xi[0]>>>0)}function po(e){return Xi[1]=e[0],Xi[0]=e[1],yp[0]}function Yl(e){return yp[0]=e,Xi[1]>>>20&4095}var Uoe=po(IR),Xoe=po(OR),Ir=[];for(let e=0;e<7;e++)Ir.push(po([Fh[2*e],Fh[2*e+1]]));var $oe=po(DR),Woe=po(BR),Yoe=po(FR),sf=[];for(let e=0;e<6;e++)sf.push(po([zh[2*e],zh[2*e+1]]));var HR=7,Joe=1<<HR,VR=7,Hh=1<<VR,Koe=0x3fe6955500000000n,qoe=sf[0],Qoe=sf[1],Zoe=sf[2],ere=sf[3];function nre(e){return po([Ui[6*e],Ui[6*e+1]])}function tre(e){return po([Ui[6*e+2],Ui[6*e+3]])}function ore(e){return po([Ui[6*e+4],Ui[6*e+5]])}function zR(e){return BigInt(jh[2*e]>>>0)<<32n|BigInt(jh[2*e+1]>>>0)}var gp=(1n<<64n)-1n;function rre(e){let n=e-Koe&gp,t=Number((n>>BigInt(52-HR))%BigInt(Joe)),o=Number(BigInt.asIntN(64,n)>>52n),r=e-(n&0xfffn<<52n)&gp,i=Vh(r),s=o,l=nre(t),a=tre(t),u=ore(t),f=Y(i,l,-1),d=s*Uoe+a,c=d+f,m=s*Xoe+u,b=d-c+f,g=Ir[0]*f,E=f*g,R=f*E,N=c+E,C=Y(g,f,-E),ne=c-N+E,I=R*(Ir[1]+f*Ir[2]+E*(Ir[3]+f*Ir[4]+E*(Ir[5]+f*Ir[6]))),me=m+b+C+ne+I,Xe=N+me;return{y:Xe,tail:N-Xe+me}}function ire(e,n,t){let r=(Yl(e)&2047)-Yl(2**-54)>>>0;if(r>=Yl(512)-Yl(2**-54)>>>0){if(r>=2147483648){let R=1+e;return t?-R:R}UR()}let i=$oe*e,s=A(i),l=BigInt(s),u=e+s*Woe+s*Yoe+n,f=2*Number((l%BigInt(Hh)+BigInt(Hh))%BigInt(Hh)),d=l+BigInt(t)<<BigInt(52-VR)&gp,c=Vh(zR(f)),m=zR(f+1)+d&gp,b=u*u,g=c+u+b*(qoe+u*Qoe)+b*b*(Zoe+u*ere),E=Vh(m);return E+E*g}function UR(){throw new Error("armPow: argument outside the ported normal-finite fast path")}function XR(e,n){let t=Yl(e),o=Yl(n);(t-1>>>0>=2046||(o&2047)-958>>>0>=128)&&UR();let{y:r,tail:i}=rre(Voe(e)),s=n*r,l=n*i+Y(n,r,-s);return ire(s,l,0)}var Pp=1;function Jl(e){Pp=e}function lf(){return Pp=Pp*16807%2147483647,Pp}function Kl(){return lf()/2147483647}function sre(e){let n=2147483647-2147483648%e,t;do t=lf();while(t>n);return t%e}function $R(e){if(e<=0)return[];let n=[];for(let t=0;t<e;t++)n.push(t);for(let t=e-1;t>0;--t){let o=sre(t+1),r=n[t];n[t]=n[o],n[o]=r}return n}function Uh(e,n,t,o,r){let i=0;for(let s=0;s<r;s++){let l=e[n+s]-t[o+s];i=Y(l,l,i)}return Math.sqrt(i)}function JR(e,n,t,o){return{n:0,totalWeight:0,dim:e,center:n.slice(0,e),width:t,average:null,qts:null,l:null,maxLevel:o}}function WR(e,n,t,o){let r=0;for(let i=e-1;i>=0;i--)t[o+i]-n[i]<0?r=2*r:r=2*r+1;return r}function YR(e,n,t,o,r){let i=JR(e,n,t,o),s=i.center,l=r;for(let a=0;a<e;a++)l%2===0?s[a]-=t:s[a]+=t,l=(l-l%2)/2;return i}function lre(e,n,t,o,r){e.n=1,e.totalWeight=o,e.average=n.slice(t,t+e.dim),e.l={nodeWeight:o,coord:n.slice(t,t+e.dim),id:r,next:null}}function are(e,n,t,o,r,i){let s=e.dim;e.totalWeight+=o;for(let a=0;a<s;a++)e.average[a]=Y(e.average[a],e.n,n[t+a])/(e.n+1);e.qts===null&&(e.qts=new Array(1<<s).fill(null));let l=WR(s,e.center,n,t);if(e.qts[l]===null&&(e.qts[l]=YR(s,e.center,e.width/2,e.maxLevel,l)),Xh(e.qts[l],n,t,o,r,i+1),e.l!==null){let a=e.l;l=WR(s,e.center,a.coord,0),e.qts[l]===null&&(e.qts[l]=YR(s,e.center,e.width/2,e.maxLevel,l)),Xh(e.qts[l],a.coord,0,a.nodeWeight,a.id,i+1),e.l=null}e.n++}function ure(e,n,t,o,r){e.n++,e.totalWeight+=o;for(let s=0;s<e.dim;s++)e.average[s]=Y(e.average[s],e.n,n[t+s])/(e.n+1);let i={nodeWeight:o,coord:n.slice(t,t+e.dim),id:r,next:e.l};e.l=i}function Xh(e,n,t,o,r,i){e.n===0?lre(e,n,t,o,r):i<e.maxLevel?are(e,n,t,o,r,i):ure(e,n,t,o,r)}function fre(e,n,t,o,r){Xh(e,n,t,o,r,0)}function KR(e,n,t,o){let r=o.slice(0,e),i=o.slice(0,e),s=new Array(e).fill(0);for(let u=1;u<n;u++)for(let f=0;f<e;f++)r[f]=Math.min(r[f],o[u*e+f]),i[f]=Math.max(i[f],o[u*e+f]);let l=i[0]-r[0];for(let u=0;u<e;u++)s[u]=(r[u]+i[u])*.5,l=Math.max(l,i[u]-r[u]);l=Math.max(l,1e-5),l*=.52;let a=JR(e,s,l,t);for(let u=0;u<n;u++)fre(a,o,u*e,1,u);return a}function qR(e,n,t,o,r,i){if(i.counts++,e===null)return;let s=e.dim,l=e.l;for(;l!==null;){if(l.id!==r){for(let a=0;a<s;a++)i.center[s*i.nsuper+a]=l.coord[a];i.supernodeWgts[i.nsuper]=l.nodeWeight,i.distances[i.nsuper]=Uh(t,o,l.coord,0,s),i.nsuper++}l=l.next}if(e.qts!==null){let a=Uh(e.center,0,t,o,s);if(e.width<n*a){for(let u=0;u<s;u++)i.center[s*i.nsuper+u]=e.average[u];i.supernodeWgts[i.nsuper]=e.totalWeight,i.distances[i.nsuper]=Uh(e.average,0,t,o,s),i.nsuper++}else for(let u=0;u<1<<s;u++)qR(e.qts[u],n,t,o,r,i)}}function QR(e,n,t,o,r){let i={nsuper:0,center:[],supernodeWgts:[],distances:[],counts:0};return qR(e,n,t,o,r,i),i}var uf=-1.0001234,Ep=0,ff=1,Yh=2,dre=3,cre=.2,pre=45,mre=.6,xre=.001,$h=.9,ZR=1e-15;function eT(){return{p:uf,randomStart:!0,K:-1,multilevels:0,maxQtreeLevel:10,maxiter:500,step:.1,adaptiveCooling:!0,randomSeed:123,beautifyLeaves:!1,smoothing:0,overlap:0,doShrinking:!0,tscheme:dre,initialScaling:-4,rotation:0,edgeLabelingScheme:0}}var af=20,Wh=1,nT=-1,tT=0;function hre(e){return{i:e,work:new Array(af+1).fill(0),direction:tT}}function bre(e){e.i===af?(e.direction=nT,e.i=e.i-1):(e.direction=Wh,e.i=Math.min(af,e.i+1))}function gre(e,n){e.direction===Wh?e.work[n]<e.work[n-1]&&e.i<af?e.i=Math.min(af,e.i+1):(e.i--,e.direction=nT):e.work[n]<e.work[n+1]&&e.i>0?e.i=Math.max(0,e.i-1):(e.i++,e.direction=Wh)}function yre(e,n){let t=e.i;e.work[t]=n,e.direction===tT?bre(e):gre(e,t)}function $i(e,n,t,o){let r=0;for(let i=0;i<n;i++){let s=e[t*n+i]-e[o*n+i];r=Y(s,s,r)}return Math.sqrt(r)}function Pre(e,n,t,o){return Math.max($i(e,n,t,o),ZR)}function Ere(e,n,t,o,r){let{ia:i,ja:s}=e,l=[],a=0;for(let u=i[n];u<i[n+1];u++){let f=s[u];i[f+1]-i[f]===1&&(t[f]=!0,a+=$i(o,r,n,f),l.push(f))}return{leaves:l,avgDist:a/l.length}}function vre(e,n,t){let{ia:o,ja:r,m:i}=n,s=new Array(i).fill(!1),l=.1;for(let a=0;a<i;a++){if(o[a+1]-o[a]!==1||s[a])continue;let u=r[o[a]];if(s[u])continue;s[u]=!0;let{leaves:f,avgDist:d}=Ere(n,u,s,t,e),c=t[e*u],m=t[e*u+1],b=l,g=f.length>1?(2*Math.PI-2*l)/f.length:0;for(let E of f)t[e*E]=Y(Math.cos(b),d,c),t[e*E+1]=Y(Math.sin(b),d,m),b+=g}}function Jh(e,n,t){let o=0,{ia:r,ja:i}=e;if(r[e.m]===0)return 1;for(let s=0;s<e.m;s++)for(let l=r[s];l<r[s+1];l++){let a=0;for(let u=0;u<n;u++){let f=t[n*s+u]-t[n*i[l]];a=Y(f,f,a)}o+=Math.sqrt(a)}return o/r[e.m]}function Sre(e,n,t,o){return!e||t>=o?$h*n:t>.95*o?n:.99*n/$h}function oT(e,n){return XR(e,1-n)}function wre(e,n){let{A:t,x:o,dim:r,fp:i,f:s}=e,{ia:l,ja:a}=t;for(let u=l[n];u<l[n+1];u++){if(a[u]===n)continue;let f=$i(o,r,n,a[u]);for(let d=0;d<r;d++){let c=i.CRK*(o[n*r+d]-o[a[u]*r+d]);s[d]=Y(-c,f,s[d])}}}function Nre(e,n){let{x:t,dim:o,n:r,fp:i,f:s}=e;for(let l=0;l<r;l++){if(l===n)continue;let a=Pre(t,o,n,l);for(let u=0;u<o;u++)s[u]+=i.KP*(t[n*o+u]-t[l*o+u])/oT(a,i.p)}}function Rre(e,n,t,o){let{x:r,dim:i,fp:s,f:l}=e,{nsuper:a,center:u,supernodeWgts:f,distances:d,counts:c}=QR(n,mre,r,t*i,t);o.countsAvg+=c,o.nsuperAvg+=a;for(let m=0;m<a;m++){let b=Math.max(d[m],ZR);for(let g=0;g<i;g++)l[g]+=f[m]*s.KP*(r[t*i+g]-u[m*i+g])/oT(b,s.p)}}function Tre(e,n,t,o,r){let i=0;for(let s=0;s<n;s++)i=Y(o[s],o[s],i);if(i=Math.sqrt(i),i>0)for(let s=0;s<n;s++)o[s]=o[s]/i;for(let s=0;s<n;s++)e[t*n+s]=Y(r,o[s],e[t*n+s]);return i}function kre(e,n,t,o,r){let{x:i,dim:s,f:l}=e;for(let a=0;a<s;a++)l[a]=0;return wre(e,n),t!==null?Rre(e,t,n,o):Nre(e,n),Tre(i,s,n,l,r)}function Cre(e,n,t){n.nsuperAvg/=t,n.countsAvg/=t,yre(e,Y(n.nsuperAvg,5,n.countsAvg))}function _re(e,n,t,o){let{dim:r,n:i,x:s}=e,l=t.i,a=o.step,u=0,f=0;do{f++;let d=u;u=0;let c={nsuperAvg:0,countsAvg:0},m=null;n&&(l=t.i,m=KR(r,i,l,s));for(let b=0;b<i;b++)u+=kre(e,b,m,c,a);m!==null&&Cre(t,c,i),a=Sre(o.adaptiveCooling,a,u,d)}while(a>xre&&f<o.maxiter);return l}function rT(e,n,t,o){let r=n.n;if(r<=0||t.maxiter<=0)return;let i=r>=pre,s=hre(t.maxQtreeLevel),l=$l(n,!0);if(t.randomStart){Jl(t.randomSeed);for(let d=0;d<e*r;d++)o[d]=Kl()}t.K<0&&(t.K=Jh(l,e,o)),t.p>=0&&(t.p=-1);let a={K:t.K,p:t.p,KP:Math.pow(t.K,1-t.p),CRK:Math.pow(cre,(2-t.p)/3)/t.K},u={A:l,x:o,dim:e,n:r,fp:a,f:new Array(e).fill(0)},f=_re(u,i,s,t);t.beautifyLeaves&&vre(e,l,o),i&&(t.maxQtreeLevel=f)}var iT=0,Are=2147483647;function lT(e){dn(e,le),qt(e);for(let t of e.nodes.values())Ii(t);let n=Oe(e);if(n!==void 0)for(let t of e.nodes.values())for(let o of t.outEdges(e))Ln(o,e,n)}function sT(e,n){if(e===void 0||e==="")return n;let t=e.toLowerCase();if(t==="false"||t==="no")return!1;if(t==="true"||t==="yes")return!0;let o=parseInt(e,10);return Number.isNaN(o)?n:o!==0}var Gre={none:Ep,false:Ep,normal:ff,true:ff,yes:ff,fast:Yh};function Mre(e,n){if(e===void 0||e==="")return n;let t=e.charCodeAt(0);if(t>=48&&t<=57){let o=parseInt(e,10);return o>=Ep&&o<=Yh?o:n}return Gre[e.toLowerCase()]??n}function Lre(e,n){let t=ge(e,"start");if(t===void 0||t==="")return n;let o=t.charCodeAt(0);if(o>=48&&o<=57){let r=parseInt(t,10);return Number.isNaN(r)?n:r}if(t.startsWith("random")){let r=parseInt(t.slice(6),10);return Number.isNaN(r)?n:r}return n}function aT(e,n){n.randomSeed=Lre(e,n.randomSeed),n.K=V(ge(e,"K"),-1,0),n.p=-1*V(ge(e,"repulsiveforce"),-uf,0),n.multilevels=Te(ge(e,"levels"),Are,0);let t=ge(e,"smoothing");if(t!==void 0&&t.toLowerCase()!=="none"&&t!==String(iT))throw new Error(`sfdp smoothing="${t}": post_process_smoothing is not ported (unreachable at sfdp defaults); see mission 8 journal`);n.smoothing=iT,n.tscheme=Mre(ge(e,"quadtree"),ff),n.beautifyLeaves=sT(ge(e,"beautify"),!1),n.doShrinking=sT(ge(e,"overlap_shrink"),!0),n.rotation=V(ge(e,"rotation"),0,-Number.MAX_VALUE),n.edgeLabelingScheme=Te(ge(e,"label_scheme"),0,0),n.edgeLabelingScheme>4&&(n.edgeLabelingScheme=0)}function vp(e){let n=[...e.nodes.values()],t=0;for(let s of n)s.info.id=t++;let o=[],r=[],i=[];for(let s of n){let l=s.info.id;for(let a of s.outEdges(e)){o.push(l),r.push(a.head.info.id);let u=parseFloat(a.attrs.get("weight")??"");i.push(Number.isNaN(u)?1:u)}}return rf(o.length,n.length,n.length,{irn:o,jcn:r,val:i},1)}function Sp(e,n){let t=new Array(2*e.nodes.size).fill(0);for(let o of e.nodes.values()){let r=o.info.id;t[r*2]=(o.info.width??0)*.5+n.x,t[r*2+1]=(o.info.height??0)*.5+n.y}return t}function uT(e,n){let t=new Array(n*e.nodes.size).fill(0),o=!1;for(let r of e.nodes.values())if(r.attrs.get("pos")!==void 0){o=!0;break}if(!o)return t;for(let r of e.nodes.values()){let i=r.info.id,s=r.info.pos;if(s!==void 0)for(let l=0;l<n;l++)t[i*n+l]=s[l]??0}return t}function fT(e){for(let n of e.nodes.values())n.info.pos=void 0,n.info.id=void 0}function Ire(e,n,t){for(let o=0;o<e;o++)t[o]=n[o]-t[o];return t}function wp(e,n,t){let o=0;for(let r=0;r<e;r++)o+=n[r]*t[r];return o}function Ore(e,n,t,o){for(let r=0;r<e;r++)t[r]=n[r]+o*t[r];return t}function dT(e,n,t,o){for(let r=0;r<e;r++)n[r]=n[r]+o*t[r];return n}function Dre(e){let n=e.m,t=e.ia,o=e.ja,r=e.a,i=new Array(n).fill(1);for(let s=0;s<n;s++)for(let l=t[s];l<t[s+1];l++)s===o[l]&&Math.abs(r[l])>0&&(i[s]=1/r[l]);return i}function Bre(e,n,t,o,r,i,s){let l=0,a=1,u=0,f=new Array(t).fill(0),d=new Array(t).fill(0),c=new Array(t).fill(0),m=new Array(t).fill(0);Vi(e,o,d,1),d=Ire(t,r,d);let b=Math.sqrt(wp(t,d,d))/t,g=b;for(;u++<s&&g>i*b;){for(let R=0;R<t;R++)f[R]=d[R]*n[R];if(l=wp(t,d,f),u>1){let R=l/a;c=Ore(t,f,c,R)}else for(let R=0;R<t;R++)c[R]=f[R];Vi(e,c,m,1);let E=l/wp(t,c,m);dT(t,o,c,E),d=dT(t,d,m,-E),g=Math.sqrt(wp(t,d,d))/t,a=l}return g}function cT(e,n,t,o,r,i){let s=e.m,l=Dre(e),a=0,u=new Array(s).fill(0),f=new Array(s).fill(0);for(let d=0;d<n;d++){for(let c=0;c<s;c++)u[c]=t[c*n+d],f[c]=o[c*n+d];a+=Bre(e,l,s,u,f,r,i);for(let c=0;c<s;c++)o[c*n+d]=u[c]}return a}function Kh(){return{}}function df(e,n){let t=e.nil,o=n.right;n.right=o.left,o.left!==t&&(o.left.parent=n),o.parent=n.parent,n===n.parent.left?n.parent.left=o:n.parent.right=o,o.left=n,n.parent=o}function cf(e,n){let t=e.nil,o=n.left;n.left=o.right,o.right!==t&&(o.right.parent=n),o.parent=n.parent,n===n.parent.left?n.parent.left=o:n.parent.right=o,o.right=n,n.parent=o}function Fre(e,n){let t=e.nil;n.left=t,n.right=t;let o=e.root,r=e.root.left;for(;r!==t;)o=r,r=e.compare(r.key,n.key)===1?r.left:r.right;n.parent=o,o===e.root||e.compare(o.key,n.key)===1?o.left=n:o.right=n}function zre(e,n){let t=n,o=t.parent.parent.right;return o.red?(t.parent.red=0,o.red=0,t.parent.parent.red=1,t.parent.parent):(t===t.parent.right&&(t=t.parent,df(e,t)),t.parent.red=0,t.parent.parent.red=1,cf(e,t.parent.parent),t)}function jre(e,n){let t=n,o=t.parent.parent.left;return o.red?(t.parent.red=0,o.red=0,t.parent.parent.red=1,t.parent.parent):(t===t.parent.left&&(t=t.parent,cf(e,t)),t.parent.red=0,t.parent.parent.red=1,df(e,t.parent.parent),t)}function Hre(e,n,t){let o=n.parent.right;return o.red&&(o.red=0,n.parent.red=1,df(e,n.parent),o=n.parent.right),!o.right.red&&!o.left.red?(o.red=1,n.parent):(o.right.red||(o.left.red=0,o.red=1,cf(e,o),o=n.parent.right),o.red=n.parent.red,n.parent.red=0,o.right.red=0,df(e,n.parent),t)}function Vre(e,n,t){let o=n.parent.left;return o.red&&(o.red=0,n.parent.red=1,cf(e,n.parent),o=n.parent.left),!o.right.red&&!o.left.red?(o.red=1,n.parent):(o.left.red||(o.right.red=0,o.red=1,df(e,o),o=n.parent.left),o.red=n.parent.red,n.parent.red=0,o.left.red=0,cf(e,n.parent),t)}function pT(e,n){let t=e.root.left,o=n;for(;!o.red&&t!==o;)o===o.parent.left?o=Hre(e,o,t):o=Vre(e,o,t);o.red=0}function Ure(e,n,t,o){n.red||pT(e,o),e.destroyKey(t.key),n.left=t.left,n.right=t.right,n.parent=t.parent,n.red=t.red,t.left.parent=n,t.right.parent=n,t===t.parent.left?t.parent.left=n:t.parent.right=n}function mT(e,n){let t=Kh();t.parent=t,t.left=t,t.right=t,t.red=0,t.key=null;let o=Kh();return o.parent=t,o.left=t,o.right=t,o.key=null,o.red=0,{nil:t,root:o,compare:e,destroyKey:n}}function qh(e,n){let t=Kh();t.key=n,Fre(e,t);let o=t;for(o.red=1;o.parent.red;)o.parent===o.parent.parent.left?o=zre(e,o):o=jre(e,o);return e.root.left.red=0,t}function xT(e,n){let t=e.nil,o=e.root,r=n.left===t||n.right===t?n:Xre(e,n),i=r.left===t?r.right:r.left;i.parent=r.parent,o===r.parent?o.left=i:r===r.parent.left?r.parent.left=i:r.parent.right=i,r!==n?Ure(e,r,n,i):(e.destroyKey(r.key),r.red||pT(e,i))}function hT(e,n){let t=e.nil,o=e.root.left;if(o===t)return null;let r=e.compare(o.key,n);for(;r!==0;){if(o=r===1?o.left:o.right,o===t)return null;r=e.compare(o.key,n)}return o}function Xre(e,n){let t=e.nil,o=e.root,r;if((r=n.right)!==t){for(;r.left!==t;)r=r.left;return r}for(r=n.parent;n===r.right;)n=r,r=r.parent;return r===o?t:r}function bT(e,n){let t=e.nil,o=e.root,r;if((r=n.left)!==t){for(;r.right!==t;)r=r.right;return r}for(r=n.parent;n===r.left;){if(r===o)return t;n=r,r=r.parent}return r}var pf=1e-16;function $re(e,n){let t=new Array(e),o=new Array(e);for(let l=0;l<e;l++)t[l]=n[l*2],o[l]=n[l*2+1];let r=e>2?lR(t,o,e):[],i=co(e,e,1,1);for(let l=0;l*2<r.length;l++)of(i,r[l*2],r[l*2+1],1);e===2&&of(i,0,1,1);for(let l=0;l<e;l++)of(i,l,l,1);let s=Dh(i);return i=$l(s,!1),i}var Qh=0,gT=1;function yT(e,n){let t=e,o=n;return t.x>o.x?1:t.x<o.x?-1:t.node>o.node?1:t.node<o.node?-1:0}function Np(e,n,t,o,r){let i=co(n,n,1,1),s=new Array(2*n);for(let f=0;f<n;f++)s[2*f]={node:f,x:t[f*e]-o[f*e],status:Qh},s[2*f+1]={node:f+n,x:t[f*e]+o[f*e],status:gT};s.sort(yT);let l=new Array(2*n);for(let f=0;f<n;f++)l[f]={node:f,x:t[f*e+1]-o[f*e+1],status:Qh},l[f+n]={node:f,x:t[f*e+1]+o[f*e+1],status:gT};let a=mT(yT,()=>{});e:for(let f=0;f<2*n;f++){let d=s[f].node%n;if(s[f].status===Qh)qh(a,l[d]),qh(a,l[d+n]);else{let c=hT(a,l[d+n]),m=c,b=m.key.node,g=l[b].x,E=l[b+n].x;for(;m&&(m=bT(a,m))!==a.nil;){let R=m.key.node%n,N=l[R].x,C=l[R+n].x;if(R!==d&&Math.abs(.5*(g+E)-.5*(N+C))<.5*(E-g)+.5*(C-N)&&(of(i,R,d,1),r))break e}c&&xT(a,c)}}let u=Dh(i);return i=$l(u,!1),i}function Wre(e,n,t,o,r){let i=n.ia,s=n.ja,l=1.5,a=1,u=0,f=1e10;for(let d=0;d<n.m;d++)for(let c=i[d];c<i[d+1];c++){let m=s[c];if(m===d)continue;let b=$i(t,e,d,m),g=Math.abs(t[d*e]-t[m*e]),E=Math.abs(t[d*e+1]-t[m*e+1]),R=o[d*e]+o[m*e],N=o[d*e+1]+o[m*e+1];if(g<pf*R&&E<pf*N)r[c]=Math.hypot(R,N),u=2;else{let C;g<pf*R?C=N/E:E<pf*N?C=R/g:C=Math.min(R/g,N/E),C>1&&(C=Math.max(C,1.001)),u=Math.max(u,C),f=Math.min(f,C),C=Math.min(l,C),C=Math.max(a,C),C>1?r[c]=C*b:r[c]=-C*b}}return{tmax:u,tmin:f}}function Or(e,n,t,o){for(let r=0;r<e*n;r++)t[r]*=o}function Yre(e,n,t,o,r,i,s,l){let a=r,u=i,f=0;if(a<=0)a=0;else{if(Or(e,n,t,a),Np(e,n,t,o,!0).nz===0)return;Or(e,n,t,1/a)}if(u<0){a===0?u=s:u=a,Or(e,n,t,u);let c;do u*=2,Or(e,n,t,2),c=Np(e,n,t,o,!0).nz>0;while(c);Or(e,n,t,1/u)}let d=u;for(;f++<l&&u-a>s;){let c=.5*(a+u);Or(e,n,t,c);let m=Np(e,n,t,o,!0);Or(e,n,t,1/c),m.nz>0?a=c:d=u=c}Or(e,n,t,d)}function Jre(e,n,t,o,r,i){let s={Lw:null,Lwd:null,lambda:new Array(e).fill(0),tolCg:.01,maxitCg:Math.floor(Math.sqrt(e))},l=$re(e,t);if(!r){let b=Np(n,e,t,o,!1);l=Bh(l,b)}s.Lw=l,s.Lwd=bp(s.Lw);let{tmax:a,tmin:u}=Wre(n,s.Lwd,t,o,s.Lwd.a);if(a<1&&i){let b=Math.min(1,a*1.0001);return Yre(n,e,t,o,b,1,1e-4,15),{sm:s,maxOverlap:1,minOverlap:u}}let f=s.Lw.ia,d=s.Lw.ja,c=s.Lw.a,m=s.Lwd.a;for(let b=0;b<e;b++){let g=0,E=0,R=-1;for(let N=f[b];N<f[b+1];N++){if(d[N]===b){R=N;continue}m[N]>0?c[N]=-100/m[N]/m[N]:(c[N]=-1/m[N]/m[N],m[N]=-m[N]);let ne=m[N];E+=c[N],m[N]=c[N]*ne,g+=m[N]}c[R]=-E,m[R]=-g}return{sm:s,maxOverlap:a,minOverlap:u}}function Kre(e,n,t,o){let r=0;for(let i=0;i<e;i++){let s=0;for(let l=0;l<n;l++)s+=(o[i*n+l]-t[i*n+l])*(o[i*n+l]-t[i*n+l]);r+=Math.sqrt(s)}return r}function qre(e,n,t){let o=0;for(let r=0;r<e;r++)o+=n[r]*t[r];return o}function Qre(e,n,t,o){let r=e.Lw,i=e.Lwd,s=bp(i),l=r.m,a=0,u=1,f=.001,d=t.slice(0,n*l),c=new Array(n*l).fill(0),m=i.ia,b=i.ja,g=i.a,E=s.a,R=e.lambda;for(;a++<o&&u>f;){for(let N=0;N<l;N++){let C=-1,ne=0;for(let I=m[N];I<m[N+1];I++){if(N===b[I]){C=I;continue}let me=$i(t,n,N,b[I]);if(g[I]===0)E[I]=0;else{if(me===0){let Xe=g[I]/r.a[I];for(let Do=0;Do<n;Do++)t[b[I]*n+Do]+=1e-4*(Kl()+1e-4)*Xe;me=$i(t,n,N,b[I])}E[I]=g[I]/me}ne+=E[I]}E[C]=-ne}Vi(s,t,c,n);for(let N=0;N<l;N++)for(let C=0;C<n;C++)c[N*n+C]+=R[N]*d[N*n+C];cT(r,n,t,c,e.tolCg,e.maxitCg),u=Kre(l,n,t,c)/Math.sqrt(qre(l*n,t,t));for(let N=0;N<l*n;N++)t[N]=c[N]}return u}function PT(e,n,t,o){let r=Jh(n,e,t);r=o/Math.max(r,pf);for(let i=0;i<e*n.m;i++)t[i]*=r}function Rp(e,n,t,o,r,i,s){if(!o)return;if(i<0){let u=0;for(let f=0;f<n.m;f++)u+=o[f*e]+o[f*e+1];u/=n.m,PT(e,n,t,-i*u)}else i>0&&PT(e,n,t,i);if(!r)return;let l=!0,a=!1;for(let u=0;u<r;u++){let{sm:f,maxOverlap:d}=Jre(n.m,e,t,o,l,a);if(d<=1){if(!l)break;l=!1,s&&(a=!0);continue}Qre(f,e,t,1)}}function vT(e,n){return e.ur.x>=n.ll.x&&n.ur.x>=e.ll.x&&e.ur.y>=n.ll.y&&n.ur.y>=e.ll.y}function Zre(e,n){return e.x<n.x?-1:e.x>n.x?1:e.y<n.y?-1:e.y>n.y?1:0}function eie(e){let n=[{x:0,y:0}];for(let t=0;t<e.length;t++){let o=e[t];for(let r=t+1;r<e.length;r++){let i=e[r];if(!vT(o,i))continue;let s={x:0,y:0};o.pos.x===i.pos.x?s.x=Number.POSITIVE_INFINITY:(s.x=(o.wd2+i.wd2)/Math.abs(o.pos.x-i.pos.x),s.x<1&&(s.x=1)),o.pos.y===i.pos.y?s.y=Number.POSITIVE_INFINITY:(s.y=(o.ht2+i.ht2)/Math.abs(o.pos.y-i.pos.y),s.y<1&&(s.y=1)),n.push(s)}}return n}function nie(e){let n=0;for(let t=1;t<e.length;t++){let o=e[t],r=Math.min(o.x,o.y);r>n&&(n=r)}return n}function tie(e){let n=e.length;e[0]={x:1,y:Number.POSITIVE_INFINITY};let t=e.slice(1);be(t,Zre);for(let s=1;s<n;s++)e[s]=t[s-1];let o=new Array(n).fill(null).map(()=>({x:0,y:0}));o[n-1]={x:e[n-1].x,y:1};for(let s=n-2;o[s]={x:e[s].x,y:Math.max(e[s+1].y,o[s+1].y)},s!==0;s--);let r=0,i=Number.POSITIVE_INFINITY;for(let s=0;s<n;s++){let l=o[s].x*o[s].y;l<i&&(i=l,r=s)}return{x:o[r].x,y:o[r].y}}function oie(e){let n=0;for(let t=0;t<e.length;t++){let o=e[t];for(let r=t+1;r<e.length;r++){let i=e[r];if(vT(o,i))return 0;let s=o.pos.x===i.pos.x?Number.POSITIVE_INFINITY:(o.wd2+i.wd2)/Math.abs(o.pos.x-i.pos.x),l=o.pos.y===i.pos.y?Number.POSITIVE_INFINITY:(o.ht2+i.ht2)/Math.abs(o.pos.y-i.pos.y),a=l<s?l:s;a>n&&(n=a)}}return n}function Wi(e,n){let t=Lr(e),o=t.x,r=t.y;t.doAdd&&(o=o/72,r=r/72);let i=[];for(let l of M(e)){let a=t.doAdd?(l.info.width??0)/2+o:o*(l.info.width??0)/2,u=t.doAdd?(l.info.height??0)/2+r:r*(l.info.height??0)/2,f={x:l.info.pos?.[0]??0,y:l.info.pos?.[1]??0};i.push({pos:f,ll:{x:f.x-a,y:f.y-u},ur:{x:f.x+a,y:f.y+u},wd2:a,ht2:u,np:l})}let s;if(n<0){let l=oie(i);if(l===0)return 0;s={x:l,y:l}}else{let l=eie(i);if(l.length===1)return 0;if(n){let a=nie(l);s={x:a,y:a}}else s=tie(l)}for(let l of i)l.np.info.pos||(l.np.info.pos=[0,0]),l.np.info.pos[0]=s.x*l.pos.x,l.np.info.pos[1]=s.y*l.pos.y;return 1}function mf(e){let n=(e.attrs.get("overlap")??e.root.attrs.get("overlap")??"").toLowerCase();return n==="scale"?Wi(e,1):n==="scalexy"?Wi(e,0):n==="compress"?Wi(e,-1):0}var ST=4,ql=2;function Zh(e,n){if(e===void 0||e==="")return n;let t=e.toLowerCase();return t==="false"||t==="no"?!1:t==="true"||t==="yes"?!0:e[0]>="0"&&e[0]<="9"?parseInt(e,10)!==0:n}function rie(e){let n=parseInt(e,10);return Number.isInteger(n)&&n>=0?n:1e3}var iie=new Set(["voronoi","scale","compress","vpsc","ipsep","oscale","scalexy","ortho","ortho_yx","orthoxy","orthoyx","portho","portho_yx","porthoxy","porthoyx"]);function xf(e){if(e===void 0||e==="")return null;let n=e.toLowerCase();if(n.startsWith("prism"))return rie(e.slice(5));if(iie.has(n))return null;let t=Zh(e,!1);return t!==Zh(e,!0)||!t?1e3:null}function eb(e,n){let t=vp(e),o=new Array(ql*e.nodes.size).fill(0),r=Lr(e),i=r.doAdd?{x:r.x/72,y:r.y/72}:{x:ST/72,y:ST/72},s=Sp(e,i);for(let f of e.nodes.values()){let d=f.info.id;o[d*ql]=f.info.pos?.[0]??0,o[d*ql+1]=f.info.pos?.[1]??0}let l=!ji(t,!1)||t.type!==1?Wl(t):Hi(t),a=V(e.root.attrs.get("overlap_scaling"),-4,-1e10),u=Zh(e.attrs.get("overlap_shrink")??e.root.attrs.get("overlap_shrink"),!0);Rp(ql,l,o,s,n,a,u);for(let f of e.nodes.values()){let d=f.info.id;f.info.pos||(f.info.pos=[0,0]),f.info.pos[0]=o[d*ql],f.info.pos[1]=o[d*ql+1]}}function Ql(e){let n=e.attrs.get("overlap")??e.root.attrs.get("overlap"),t=xf(n);return t!==null&&e.nodes.size>=2?(eb(e,t),1):mf(e)}var wT=72;function sie(e){return{kind:"twopi",nStepsToLeaf:e,subtreeSize:0,nChildren:0,nStepsToCenter:e,parent:null,span:0,theta:10}}function lie(e){(!e.info.pos||e.info.pos.length<2)&&(e.info.pos=[0,0]),e.info.width||(e.info.width=.75),e.info.height||(e.info.height=.5)}function aie(e){let n=e.attrs.get("weight"),t=n!==void 0?Math.max(0,parseFloat(n)):1;e.info.factor=isFinite(t)?t:1}function uie(e){let n=e.nodes.size*e.nodes.size,t=[];for(let o of e.nodes.values())lie(o),o.info.alg=sie(n),t.push(o);e.info.neato_nlist=t;for(let o of e.edges)aie(o)}function nb(e){dn(e,le),e.info.ndim=2,uie(e)}function tb(e){for(let n of e.nodes.values()){let t=n.attrs.get("root");if(t==="1"||t==="true"||t==="yes")return n}return null}function hf(e){for(let n of e.nodes.values()){let t=n.info.pos;t&&(n.info.coord={x:(t[0]??0)*wT,y:(t[1]??0)*wT})}}function ob(e){Ql(e)}function Zl(e){let n=e.nodes.values().next().value;n!==void 0&&n.info.alg?.kind==="twopi"&&(n.info.alg=void 0),e.info.neato_nlist=void 0}var fie=1,die=.02;function Le(e){let n=e.info.alg;if(!n||n.kind!=="twopi")throw new Error(`twopi: missing rdata on node ${e.name}`);return n}function bf(e,n){return e.tail===n?e.head:e.head===n?e.tail:null}function gf(e,n){return[...n.outEdges(e),...n.inEdges(e)]}function NT(e,n){let t=null;for(let o of gf(e,n)){let r=bf(o,n);if(!(r===null||r===n)){if(t===null)t=r;else if(t!==r)return!1}}return!0}function RT(e){let n=e.nodes.size*e.nodes.size;for(let t of e.nodes.values())t.info.alg={kind:"twopi",nStepsToLeaf:NT(e,t)?0:n,subtreeSize:0,nChildren:0,nStepsToCenter:n,parent:null,span:0,theta:10}}function cie(e,n,t,o){let r=Le(n);o<r.nStepsToLeaf&&(r.nStepsToLeaf=o,TT(e,n,t))}function TT(e,n,t){let o=Le(n).nStepsToLeaf+1;for(let r of gf(e,n)){let i=bf(r,n);i!==null&&i!==t&&cie(e,i,n,o)}}function pie(e,n,t,o){let r=Le(n);t<r.nStepsToCenter&&(r.nStepsToCenter=t,r.parent=e,Le(e).nChildren++,o.push(n))}function mie(e){for(let o of e.nodes.values())Le(o).nStepsToLeaf===0&&TT(e,o,null);let n=null,t=0;for(let o of e.nodes.values()){let r=Le(o).nStepsToLeaf;(n===null||r>t)&&(t=r,n=o)}return n}function xie(e,n){let t=[n],o=0;for(;o<t.length;){let r=t[o++],i=Le(r).nStepsToCenter+1;for(let s of gf(e,r)){if(s.attrs.get("weight")==="0")continue;let l=bf(s,r);l!==null&&pie(r,l,i,t)}}}function hie(e,n){let t=Le(n),o=t.nStepsToCenter;t.nStepsToCenter=0,t.parent=null,xie(e,n);let r=0;for(let i of e.nodes.values()){let s=Le(i).nStepsToCenter;if(s===o)return Number.MAX_SAFE_INTEGER;s>r&&(r=s)}return r}function bie(e){let n=Le(e).parent;for(;n!==null;)Le(n).subtreeSize++,n=Le(n).parent}function gie(e){for(let n of e.nodes.values()){let t=Le(n);t.nChildren>0||(t.subtreeSize++,bie(n))}}function yie(e,n,t,o,r){let i=Le(t);i.parent!==n||i.span!==0||r.has(t)||(r.add(t),i.span=o*i.subtreeSize,i.nChildren>0&&kT(e,t))}function kT(e,n){let t=Le(n),o=t.span/t.subtreeSize,r=new Set;for(let i of gf(e,n)){let s=bf(i,n);s!==null&&yie(e,n,s,o,r)}}function Pie(e,n){Le(n).span=2*Math.PI,kT(e,n)}function Eie(e,n,t,o){let r=Le(t);return r.parent!==n||r.theta!==10||(r.theta=o+r.span/2,o+=r.span,r.nChildren>0&&CT(e,t)),o}function CT(e,n){let t=Le(n),o=t.parent===null?0:t.theta-t.span/2;for(let r of gf(e,n)){let i=bf(r,n);i!==null&&(o=Eie(e,n,i,o))}}function vie(e,n){Le(n).theta=0,CT(e,n)}function Sie(e,n,t){let o=0,r=0,i=1;for(let s of e){if(i>t)break;let l=parseFloat(s.trim());if(!isFinite(l)||l<=0)break;r=Math.max(l,die),o+=r,n[i++]=o}return{delx:r,rk:i,xf:o}}function wie(e,n){let t=new Array(n+1).fill(0),o=e.root.attrs.get("ranksep")??e.attrs.get("ranksep"),r=fie,i=1,s=0;if(o!==void 0&&o.length>0){let l=Sie(o.split(":"),t,n);r=l.delx,i=l.rk,s=l.xf}for(let l=i;l<=n;l++)s+=r,t[l]=s;return t}function Nie(e,n){let t=wie(e,n);for(let o of e.nodes.values()){let r=Le(o),i=t[r.nStepsToCenter]??0;(!o.info.pos||o.info.pos.length<2)&&(o.info.pos=[0,0]),o.info.pos[0]=i*Math.cos(r.theta),o.info.pos[1]=i*Math.sin(r.theta)}}function rb(e,n){if(e.nodes.size===1){let o=e.nodes.values().next().value;return(!o.info.pos||o.info.pos.length<2)&&(o.info.pos=[0,0]),o.info.pos[0]=0,o.info.pos[1]=0,n}if(RT(e),n===null&&(n=mie(e)),n===null)return null;let t=hie(e,n);return t===Number.MAX_SAFE_INTEGER||(gie(e),Pie(e,n),vie(e,n),Nie(e,t)),n}var Bt=8;function Rie(e,n){n.edges=e.edges.filter(t=>n.nodes.has(t.tail.name)&&n.nodes.has(t.head.name))}function Tie(e,n){return n!==null&&e.nodes.has(n.name)?n:tb(e)}function _T(e,n,t){Rie(e,n);let o=Tie(n,t),r=rb(n,o);return ob(n),r}function AT(e){let n={aspect:1,sz:0,margin:Bt,doSplines:!1,mode:2,fixed:null,vals:null,flags:0};return Bn(e,2,Bt,n),n.doSplines=!1,n}function GT(e,n,t,o){let r=n[0],i=_T(e,r,t);o&&t===null&&i!==null&&e.attrs.set("root",i.name),Zl(e),Ot(e),hf(e)}function MT(e,n,t,o){for(let r of n)_T(e,r,t),hf(r);Zl(e),jl(n.length,n,e,o),Ot(e),hf(e)}var kie={KK:rp,major:Ju,hier:Yu,ipsep:ip,sgd:sp};function Cie(e){let n=e.info.mode;return n?kie[n]??Ju:Ju}var _ie={shortpath:Ku,circuit:mh,subset:xh,mds:hh};function Aie(e){let n=e.attrs.get("model");return n?_ie[n]??Ku:Ku}function LT(e){let n=e.attrs.get("overlap");if(n===void 0||n==="true")return;if(n!=="vpsc"){Ql(e);return}let t=Array.from(e.nodes.values()),o=X9/72;KN(t,{x:o/2,y:o/2})}function Gie(e){sn(e,!1),dn(e,le),qt(e);for(let[,i]of e.nodes)Ii(i),AN(i);let n=Oe(e);if(n!==void 0)for(let i of e.edges)Ln(i,e,n);let t=Cie(e),o=Aie(e),r=Cr(e,"_neato_cc");r.length>1?Lie(e,r,t,o):(lp(e,t,o),LT(e),Ot(e)),Mie(e),e.info.bb=Dn(e,0),qe(e),Me(e)}function Mie(e){let n=[];for(let t of e.subgraphs.values())!gn(t)||t===e.root||(Wt(t,Oe(e)),t.info.bb=Dn(t,0),n.push(t));n.length!==0&&(e.info.clust=n,e.info.n_cluster=n.length)}function Lie(e,n,t,o){for(let i of n)dn(i,le),lp(i,t,o),LT(i),Ot(i);let r={aspect:1,sz:0,margin:Bt,doSplines:!1,mode:2,fixed:null,vals:null,flags:0};Bn(e,2,Bt,r),r.doSplines=!0,Zx(n.length,n,e,r),e.info.bb=Dn(e,0)}var IT={type:"neato",layout:Gie,cleanup:bh};var Tp=1.2,Iie=600,Oie=.3,Die=0,Bie=1,ib=0,DT=1,Yi=2,OT=Yi,Zn={useGrid:1,useNew:1,numIters:-1,unscaled:50,C:0,Tfact:1,K:-1,T0:-1},_={useGrid:0,useNew:0,seed:0,numIters:0,maxIters:0,unscaled:0,C:0,Tfact:0,K:0,T0:0,smode:0,Cell:0,Wd:0,Ht:0,pass1:0,loopcnt:0};function kp(e){return _.T0*(_.maxIters-e)/_.maxIters}function BT(){_.T0=-1}function FT(e,n,t){let o=ge(e,"start");if(o===void 0||o==="")return n;let{init:r,rest:i}=Fie(o,n);if(r===Yi){let s=/^-?[0-9]+/.exec(i);s===null?t.value=Math.floor(Date.now()/1e3):t.value=parseInt(s[0],10)}return r}function Fie(e,n){return/^[0-9]/.test(e)?{init:Yi,rest:e}:/^[a-zA-Z]/.test(e)?e.startsWith("self")?{init:ib,rest:e.slice(4)}:e.startsWith("regular")?{init:DT,rest:e.slice(7)}:e.startsWith("random")?{init:Yi,rest:e.slice(6)}:{init:n,rest:e}:{init:n,rest:e}}function Cp(e){_.useGrid=Zn.useGrid,_.useNew=Zn.useNew,_.numIters=Zn.numIters,_.unscaled=Zn.unscaled,_.Cell=Die,_.C=Zn.C,_.Tfact=Zn.Tfact,_.maxIters=Te(e.attrs.get("maxiter"),Iie,0),Zn.K=_.K=V(e.attrs.get("K"),Oie,0),Zn.T0===-1?_.T0=V(e.attrs.get("T0"),-1,0):_.T0=Zn.T0,zie(e),_.pass1=Math.trunc(_.unscaled*_.maxIters/100),_.useGrid&&_.Cell<=0&&(_.Cell=3*_.K)}function zie(e){_.seed=Bie;let n={value:_.seed};_.smode=FT(e,OT,n),_.seed=n.value,_.smode===ib&&(_.seed=OT)}function zT(e,n){let t=!1;if(_.T0===-1){let o=e.nodes.size;_.T0=_.Tfact*_.K*Math.sqrt(o)/5,t=!0}return n.T0=kp(_.pass1),n.K=_.K,n.C=_.C,n.numIters=_.maxIters-_.pass1,_.numIters>=0?_.numIters<=_.pass1?(_.loopcnt=_.numIters,n.loopcnt=0):_.numIters<=_.maxIters&&(_.loopcnt=_.pass1,n.loopcnt=_.numIters-_.pass1):(_.loopcnt=_.pass1,n.loopcnt=n.numIters),t}function jie(e){for(let n of e.nodes.values()){let t=n.attrs.get("pos");t===void 0||t===""||Hie(n,t)}}function Hie(e,n){let t=/^(-?[\d.]+),(-?[\d.]+)\s*(!)?/.exec(n);if(t===null)return;e.info.pos[0]=parseFloat(t[1]),e.info.pos[1]=parseFloat(t[2]);let o=e.attrs.get("pin"),r=t[3]==="!"||o!==void 0&&/^(true|yes|1)$/i.test(o);Mr(e).pinned=r?3:1}function Vie(e,n,t){e.info.factor=V(e.attrs.get("weight"),1,0),e.info.dist=V(e.attrs.get("len"),Zn.K,0),t!==void 0&&Ln(e,n,t)}function Uie(e,n){e.info.pos=[0,0],e.info.id=n,Mr(e),e.info.width||(e.info.width=.75),e.info.height||(e.info.height=.5)}function sb(e){qt(e);let n=0;for(let o of e.nodes.values())Uie(o,n++);let t=Oe(e);for(let o of e.nodes.values())for(let r of o.outEdges(e))Vie(r,e,t);jie(e)}function lb(e){for(let n of e.nodes.values())n.info.alg=void 0,n.info.pos=void 0,n.info.pinned=void 0;for(let n of e.edges)n.info.alg=void 0;e.info.alg=void 0}var _p=class{cells=new Map;clear(){this.cells.clear()}add(n,t,o){let r=`${n},${t}`,i=this.cells.get(r);i===void 0&&(i={i:n,j:t,nodes:[]},this.cells.set(r,i)),i.nodes.unshift(o)}find(n,t){return this.cells.get(`${n},${t}`)}walk(n){let t=[...this.cells.values()].sort((o,r)=>o.i-r.i||o.j-r.j);for(let o of t)n(o,this)}};function Xie(e,n){return[...n.outEdges(e),...n.inEdges(e)]}function $ie(e,n,t){let o={x:0,y:0},r=Wie(e,n,o);if(r>1)n.info.pos[0]=o.x,n.info.pos[1]=o.y;else if(r===1)n.info.pos[0]=.98*o.x+.1*t.x,n.info.pos[1]=.9*o.y+.1*t.y;else{let i=Math.PI*2*qn(),s=.9*qn();n.info.pos[0]=s*_.Wd*Math.cos(i),n.info.pos[1]=s*_.Ht*Math.sin(i)}q(n).pinned=1}function Wie(e,n,t){let o=0;for(let r of Xie(e,n)){if(r.head===r.tail)continue;let i=r.head===n?r.tail:r.head;eR(i)&&(o?(t.x=(t.x*o+i.info.pos[0])/(o+1),t.y=(t.y*o+i.info.pos[1])/(o+1)):(t.x=i.info.pos[0],t.y=i.info.pos[1]),o++)}return o}function Yie(e){let n={llx:0,lly:0,urx:0,ury:0},t=0;for(let o of e.nodes.values())q(o).pinned&&(t?(n.llx=Math.min(o.info.pos[0],n.llx),n.lly=Math.min(o.info.pos[1],n.lly),n.urx=Math.max(o.info.pos[0],n.urx),n.ury=Math.max(o.info.pos[1],n.ury)):(n.urx=n.llx=o.info.pos[0],n.ury=n.lly=o.info.pos[1]),t++);return{bb:n,nPos:t}}function Jie(e){let n={x:(e.llx+e.urx)/2,y:(e.lly+e.ury)/2},t=Tp*(e.urx-e.llx),o=Tp*(e.ury-e.lly);Kie(t,o);let r=Math.atan2(_.Ht,_.Wd);return _.Wd=_.Wd/Math.cos(r),_.Ht=_.Ht/Math.sin(r),n}function Kie(e,n){let t=4*_.Wd*_.Ht,o=e*n/t;o>=1?(_.Wd=e/2,_.Ht=n/2):o>0?(o=2*Math.sqrt(o),_.Wd=e/o,_.Ht=n/o):e>0?(_.Wd=e/2,_.Ht=t/e/2):n>0&&(_.Wd=t/n/2,_.Ht=n/2)}function qie(e,n,t){for(let o of n){let r=o.n;r.info.pos[0]=_.Wd*Math.cos(o.alpha)+t.x,r.info.pos[1]=_.Ht*Math.sin(o.alpha)+t.y,q(r).pinned=1}for(let o of e.nodes.values())Gr(o)||(q(o).pinned?(o.info.pos[0]-=t.x,o.info.pos[1]-=t.y):$ie(e,o,t))}function Qie(e,n,t){if(n)for(let o of e.nodes.values())q(o).pinned?(o.info.pos[0]-=t.x,o.info.pos[1]-=t.y):(o.info.pos[0]=_.Wd*(2*qn()-1),o.info.pos[1]=_.Ht*(2*qn()-1));else for(let o of e.nodes.values())o.info.pos[0]=_.Wd*(2*qn()-1),o.info.pos[1]=_.Ht*(2*qn()-1)}function jT(e,n){let t=e.nodes.size-ee(e).nports,{bb:o,nPos:r}=Yie(e),i={x:0,y:0},s=_.K*(Math.sqrt(t)+1);_.Wd=_.Ht=Tp*(s/2),r===1?i={x:o.llx,y:o.lly}:r>1&&(i=Jie(o));let l=_.smode===Yi?_.seed:Math.floor(Date.now()/1e3);return Tl(l),n?qie(e,n,i):Qie(e,r,i),i}function Ap(){let e=0,n=0;do e=5-lf()%10,n=5-lf()%10;while(e===0&&n===0);return{xdelta:e,ydelta:n}}function VT(e,n,t,o,r){let i;if(r===0){let a=Ap();t=a.xdelta,o=a.ydelta,r=Y(t,t,o*o)}if(_.useNew){let a=Math.sqrt(r);i=_.K*_.K/(a*r)}else i=_.K*_.K/r;Gr(e)&&Gr(n)&&(i*=10);let s=Ze(n),l=Ze(e);s[0]=Y(t,i,s[0]),s[1]=Y(o,i,s[1]),l[0]=_a(t,i,l[0]),l[1]=_a(o,i,l[1])}function UT(e,n){let t=n.info.pos[0]-e.info.pos[0],o=n.info.pos[1]-e.info.pos[1];VT(e,n,t,o,Y(t,t,o*o))}function Dr(e,n,t,o){let r=e.find(n,t);if(r!==void 0)for(let i of o)for(let s of r.nodes){let l=s.info.pos[0]-i.info.pos[0],a=s.info.pos[1]-i.info.pos[1],u=Y(l,l,a*a);u<_.Cell*_.Cell&&VT(i,s,l,a,u)}}function Zie(e,n){let t=e.nodes,o=e.i,r=e.j;for(let i of t)for(let s of t)i!==s&&UT(i,s);Dr(n,o-1,r-1,t),Dr(n,o-1,r,t),Dr(n,o-1,r+1,t),Dr(n,o,r-1,t),Dr(n,o,r+1,t),Dr(n,o+1,r-1,t),Dr(n,o+1,r,t),Dr(n,o+1,r+1,t)}function XT(e,n,t){let o=n.info.pos[0]-e.info.pos[0],r=n.info.pos[1]-e.info.pos[1],i=Y(o,o,r*r);if(i===0){let f=Ap();o=f.xdelta,r=f.ydelta,i=Y(o,o,r*r)}let s=Math.sqrt(i),l;_.useNew?l=(t.info.factor??1)*(s-(t.info.dist??1))/s:l=(t.info.factor??1)*s/(t.info.dist??1);let a=Ze(n),u=Ze(e);a[0]=_a(o,l,a[0]),a[1]=_a(r,l,a[1]),u[0]=Y(o,l,u[0]),u[1]=Y(r,l,u[1])}function ese(e,n){let t=Ze(e)[0],o=Ze(e)[1],r=Y(t,t,o*o),i=n*n;if(r<i)return{x:e.info.pos[0]+t,y:e.info.pos[1]+o};let s=n/Math.sqrt(r);return{x:Y(t,s,e.info.pos[0]),y:Y(o,s,e.info.pos[1])}}function nse(e,n,t){let o=Math.sqrt(n*n/(_.Wd*_.Wd)+t*t/(_.Ht*_.Ht));Gr(e)?(e.info.pos[0]=n/o,e.info.pos[1]=t/o):o>=1?(e.info.pos[0]=.95*n/o,e.info.pos[1]=.95*t/o):(e.info.pos[0]=n,e.info.pos[1]=t)}function $T(e,n,t){for(let o of e.nodes.values()){if(q(o).pinned&2)continue;let{x:r,y:i}=ese(o,n);t?nse(o,r,i):(o.info.pos[0]=r,o.info.pos[1]=i)}}var HT=Math.floor;function tse(e,n,t,o){if(!(n<=0)){o.clear();for(let r of e.nodes.values()){let i=Ze(r);i[0]=i[1]=0,o.add(HT(r.info.pos[0]/_.Cell),HT(r.info.pos[1]/_.Cell),r)}for(let r of e.nodes.values())for(let i of r.outEdges(e))r!==i.head&&XT(r,i.head,i);o.walk(Zie),$T(e,n,t)}}function ose(e,n){for(let t=0;t<n.length;t++){let o=n[t];for(let r=t+1;r<n.length;r++)UT(o,n[r]);for(let r of o.outEdges(e))o!==r.head&&XT(o,r.head,r)}}function rse(e,n,t){if(n<=0)return;let o=[...e.nodes.values()];for(let r of o){let i=Ze(r);i[0]=i[1]=0}ose(e,o),$T(e,n,t)}function ub(e,n){let t=ee(e).ports,o=zT(e,n),r=jT(e,t);if(_.useGrid){let i=new _p;for(let s=0;s<_.loopcnt;s++){let l=kp(s);tse(e,l,t,i)}}else for(let i=0;i<_.loopcnt;i++){let s=kp(i);rse(e,s,t)}if(r.x!==0||r.y!==0)for(let i of e.nodes.values())i.info.pos[0]+=r.x,i.info.pos[1]+=r.y;o&&BT()}function ise(e){let n=e.toLowerCase();if(n==="false"||n==="no")return!1;if(n==="true"||n==="yes")return!0;let t=parseInt(e,10);return!Number.isNaN(t)&&t!==0}function sse(e){let n=ge(e,"normalize");if(n===void 0||n==="")return null;let t=lse(n);return t===null?null:ase(t)*(Math.PI/180)}function lse(e){let n=/^-?[\d.]+(?:[eE][-+]?\d+)?/.exec(e);return n!==null?parseFloat(n[0]):ise(e)?0:null}function ase(e){for(;e>180;)e-=360;for(;e<=-180;)e+=360;return e}function Gp(e){let n=sse(e);if(n===null)return;let t=[...e.nodes.values()],o=t[0];if(o===void 0)return;let r=o.info.pos[0],i=o.info.pos[1];for(let a of t)a.info.pos[0]-=r,a.info.pos[1]-=i;let s=null;for(let a of t){let u=a.outEdges(e);if(u.length>0){s=u[0];break}}if(s===null)return;let l=n-Math.atan2(s.head.info.pos[1]-s.tail.info.pos[1],s.head.info.pos[0]-s.tail.info.pos[0]);l&&use(t,s.tail,l)}function use(e,n,t){let o=n.info.pos[0],r=n.info.pos[1],i=Math.cos(t),s=Math.sin(t);for(let l of e){let a=l.info.pos[0]-o,u=l.info.pos[1]-r;l.info.pos[0]=a*i-u*s+o,l.info.pos[1]=a*s+u*i+r}}var fse="9:prism",WT=e=>e/72,pn={numIters:60,T0:0,K:.3,C:1.5,loopcnt:0},Ft={x:0,y:0,doAdd:!1};function fb(e){return Ft.doAdd?e.info.width/2+Ft.x:e.info.width*Ft.x/2}function db(e){return Ft.doAdd?e.info.height/2+Ft.y:e.info.height*Ft.y/2}function YT(e){return Math.hypot(fb(e),db(e))}function dse(e,n){pn.K=n.K,pn.numIters=n.numIters,pn.T0=n.T0,pn.loopcnt=n.loopcnt,n.C>0&&(pn.C=n.C);let t=pn.K*pn.K;return pn.T0===0&&(pn.T0=pn.K*Math.sqrt(e)/5),t}function cse(e){return pn.T0*(pn.numIters-e)/pn.numIters}function cb(e,n){let t=Math.abs(n.info.pos[0]-e.info.pos[0]),o=Math.abs(n.info.pos[1]-e.info.pos[1]);return t<=fb(e)+fb(n)&&o<=db(e)+db(n)}function pse(e){let n=0,t=[...e.nodes.values()];for(let o=0;o<t.length;o++)for(let r=o+1;r<t.length;r++)n+=cb(t[o],t[r])?1:0;return n}function mse(e,n,t){let o=n.info.pos[0]-e.info.pos[0],r=n.info.pos[1]-e.info.pos[1],i=o*o+r*r;if(i===0){let f=Ap();o=f.xdelta,r=f.ydelta,i=o*o+r*r}let s=cb(e,n)?1:0,l=s?t.ov/i:t.nonov/i,a=Ze(n),u=Ze(e);return a[0]+=o*l,a[1]+=r*l,u[0]-=o*l,u[1]-=r*l,s}function xse(e,n){if(cb(e,n))return;let t=n.info.pos[0]-e.info.pos[0],o=n.info.pos[1]-e.info.pos[1],r=Math.hypot(t,o),i=YT(e)+YT(n),s=r-i,l=s*s/((pn.K+i)*r),a=Ze(n),u=Ze(e);a[0]-=t*l,a[1]-=o*l,u[0]+=t*l,u[1]+=o*l}function hse(e,n){let t=0,o=[...e.nodes.values()];for(let r=0;r<o.length;r++){let i=o[r];for(let s=r+1;s<o.length;s++)t+=mse(i,o[s],n);for(let s of i.outEdges(e))xse(i,s.head)}return t}function bse(e,n){let t=n*n;for(let o of e.nodes.values()){if(q(o).pinned===3)continue;let r=Ze(o)[0],i=Ze(o)[1],s=r*r+i*i;if(s<t)o.info.pos[0]+=r,o.info.pos[1]+=i;else{let l=Math.sqrt(s);o.info.pos[0]+=r*n/l,o.info.pos[1]+=i*n/l}}}function gse(e,n,t){for(let r of e.nodes.values()){let i=Ze(r);i[0]=i[1]=0}let o=hse(e,t);return o===0?0:(bse(e,n),o)}function yse(e,n,t){Ft=Lr(e),Ft.doAdd&&(Ft={x:WT(Ft.x),y:WT(Ft.y),doAdd:!0});let o=pse(e);if(o===0)return 0;let r={...n},i=r.K;for(let s=0;o&&s<t;++s)o=Pse(e,r,o),r.K+=i;return o}function Pse(e,n,t){let o=e.nodes.size,r=e.edges.length,i=dse(o,n),s=pn.C*i,l={ov:s,nonov:r*s*2/(o*(o-1))};for(let a=0;a<pn.loopcnt;a++){let u=cse(a);if(u<=0||(t=gse(e,u,l),t===0))break}return t}function Ese(e){let n=e.indexOf(":");return n>=0&&(n===0||/^[0-9]/.test(e))?{tries:Math.max(0,parseInt(e,10)||0),rest:e.slice(n+1)}:{tries:0,rest:e}}function pb(e,n){let t=ge(e,"overlap");(t===void 0||t==="")&&(t=fse);let{tries:o,rest:r}=Ese(t);o&&!yse(e,n,o)||vse(e,r)}function vse(e,n){if(e.nodes.size<2)return;Gp(e);let t=xf(n);if(t!==null){eb(e,t);return}let o=n.toLowerCase();if(o==="scale")return void Wi(e,1);if(o==="scalexy")return void Wi(e,0);if(o==="compress")return void Wi(e,-1);if(Sse.has(o))throw new Error(`fdp: removeOverlapAs mode "${o}" reached for graph "${e.name}" \u2014 that adjust algorithm (voronoi/oscale/vpsc/ortho/ipsep) is not ported`)}var Sse=new Set(["voronoi","oscale","vpsc","ipsep","ortho","ortho_yx","orthoxy","orthoyx","portho","portho_yx","porthoxy","porthoyx"]);function wse(e,n){return[...n.outEdges(e),...n.inEdges(e)]}function Mp(e,n,t,o){o[n.id]=!0,t.push(n);for(let r of wse(e,n)){let i=r.tail===n?r.head:r.tail;o[i.id]||Mp(e,i,t,o)}}function KT(e,n,t){let o=new $e(n,e.kind);o.parent=e,ee(o);let r=[...t].sort((i,s)=>i.id-s.id);for(let i of r)o.nodes.set(i.name,i);for(let i of e.edges)o.nodes.has(i.tail.name)&&o.nodes.has(i.head.name)&&o.edges.push(i);return o}function mb(e,n){let t={dg:e,marks:new Array(e.nodes.size).fill(!1),comps:[],cCnt:0,counter:n},o=Nse(t);return Tse(t),n.value+=t.cCnt,{comps:t.comps,pinned:o}}function Nse(e){let{dg:n,marks:t}=e,o=null,r=ee(n).ports;if(r!==null){o=JT(e);for(let s of r)t[s.n.id]||Mp(n,s.n,o.nodes,t)}let i=!1;for(let s of n.nodes.values())t[s.id]||q(s).pinned===3&&(o===null&&(o=JT(e)),i=!0,Mp(n,s,o.nodes,t));return o!==null&&Rse(e,o,r),i}function JT(e){return{name:`cc${e.dg.name}_${e.cCnt+++e.counter.value}`,nodes:[]}}function Rse(e,n,t){let o=KT(e.dg,n.name,n.nodes);t!==null&&(ee(o).ports=t,ee(o).nports=ee(e.dg).nports),e.comps.push(o)}function Tse(e){let{dg:n,marks:t}=e;for(let o of n.nodes.values()){if(t[o.id])continue;let r=[];Mp(n,o,r,t),e.comps.push(KT(n,`cc${n.name}+${e.cCnt+++e.counter.value}`,r))}}function hb(e,n){let t=new We(e.nodes.size,n,e);return t.info.alg=qN(),t.info.pos=[0,0],e.nodes.set(n,t),t}function xb(e,n,t){let o=ge(e,t);o!==void 0&&n.attrs.set(t,o)}function kse(e,n,t,o){let r=e.attrs.get("coords");if(r===void 0||r==="")return;if(e!==t.rootg){let s=e.parent!==null?e.parent.attrs.get("coords"):void 0;if(r===s)return}let i=Cse(r);i!==null&&(o.ll.x=i.box.ll.x,o.ll.y=i.box.ll.y,o.ur.x=i.box.ur.x,o.ur.y=i.box.ur.y,q(n).pinned=i.pinned)}function Cse(e){let n=String.raw`(-?[\d.]+)`,t=new RegExp(`^${n},${n},${n},${n}\\s*([!?])?`).exec(e);if(t===null)return null;let o={ll:{x:parseFloat(t[1]),y:parseFloat(t[2])},ur:{x:parseFloat(t[3]),y:parseFloat(t[4])}},r=t[5];return{box:o,pinned:r==="!"?3:r==="?"?2:1}}function _se(e,n,t){let o=e.info.n_cluster??0;for(let r=0;r<o;r++){let i=e.info.clust[r],s={ll:{x:Number.MAX_VALUE,y:Number.MAX_VALUE},ur:{x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}};Wt(i,Oe(t.rootg));let l=hb(n,i.name);q(l).clust=i,t.hasCoords&&kse(i,l,t,s);for(let a of i.nodes.values())nf(a,l);q(l).pinned&&(l.info.pos[0]=(s.ll.x+s.ur.x)/2,l.info.pos[1]=(s.ll.y+s.ur.y)/2)}}function Ase(e,n){for(let t of e.nodes.values()){if(Di(t)!==null)continue;let o=QN(t);if(o!==null&&o!==ee(e).parent)return!1;ZN(t,e),!t.info.clustnode&&nf(t,Gse(n,t))}return!0}function Gse(e,n){let t=hb(e,n.name);return t.info.width=n.info.width,t.info.height=n.info.height,t.info.lw=n.info.lw,t.info.rw=n.info.rw,t.info.ht=n.info.ht,t.info.shape=n.info.shape,t.info.shape_info=n.info.shape_info,Mr(n).pinned&&(t.info.pos[0]=n.info.pos[0],t.info.pos[1]=n.info.pos[1],q(t).pinned=Mr(n).pinned),q(t).dn=n,t}function qT(e,n,t,o){let[r,i]=o.id>t.id?[t,o]:[o,t],s=`${r.id}:${i.id}`,l=n.get(s);return l===void 0&&(l=new Ae(r,i,""),l.info.count=0,n.set(s,l),e.edges.push(l)),l}function Mse(e,n,t){for(let o of e.nodes.values()){let r=Di(o);for(let i of o.outEdges(e)){let s=Di(i.head);if(s===r)continue;let l=qT(n,t,r,s);l.info.dist=i.info.dist,l.info.factor=i.info.factor,q(s).wdeg++,q(r).wdeg++,tR(l)&&(q(s).deg++,q(r).deg++),Eh(l,i)}}}function Lse(e,n,t){let o=ee(e).ports;if(o===null)return;let r=[];for(let i of o){let s=Di(i.n);s!==null&&r.push(Ise(e,n,t,i,s))}ee(n).ports=r,ee(n).nports=r.length}function Ise(e,n,t,o,r){let i=`_port_${e.name}_(${o.e.tail.id})_(${o.e.head.id})_${o.e.seq}`,s=hb(n,i),l=qT(n,t,r,s);return l.info.dist=o.e.info.dist,l.info.factor=o.e.info.factor,Eh(l,o.e),q(s).wdeg++,q(r).wdeg++,q(s).deg++,q(r).deg++,{n:s,alpha:o.alpha,e:l}}function bb(e,n){let t=new $e("derived","strict-directed");if(t.parent=null,ee(t),n.gid++,xb(e,t,"overlap"),xb(e,t,"sep"),xb(e,t,"K"),_se(e,t,n),!Ase(e,t))return null;let o=new Map;return Mse(e,t,o),Lse(e,t,o),t}var QT=Math.PI/90;function Ose(e,n){return e.alpha>n.alpha?1:e.alpha<n.alpha?-1:e.dist2>n.dist2?1:e.dist2<n.dist2?-1:0}function Dse(e,n){let t=0;for(;t<n-1;){let o=e[t].alpha,r=t+1;for(;r<n&&e[r].alpha===o;)r++;if(r===t+1)t=r;else{let i=r===n?Math.PI:e[r].alpha,s=Math.min((i-o)/(r-t),QT),l=0;for(;t<r;t++)e[t].alpha+=l,l+=s}}}function Bse(e,n){let t=q(e).deg,o=[];for(let r of[...e.outEdges(n),...e.inEdges(n)]){let i=r.head===e?r.tail:r.head,s=i.info.pos[0]-e.info.pos[0],l=i.info.pos[1]-e.info.pos[1];o.push({e:r,alpha:Math.atan2(l,s),dist2:s*s+l*l})}if(o.length!==t)throw new Error(`fdp getEdgeList: ${o.length} edges vs deg ${t}`);return o.sort(Ose),t>=2&&Dse(o,t),o}function Fse(e,n,t,o,r){let i=n.e,s=i.info.count??0,l=i.head===e?i.tail:i.head,a=Math.min((r-n.alpha)/s,QT),f=e.id<l.id?{i:o,inc:1,angle:n.alpha,delta:a}:{i:o+s-1,inc:-1,angle:n.alpha+a*(s-1),delta:-a};return zse(e,i,t,f),o+s}function zse(e,n,t,o){for(let r of nR(n))t[o.i]={e:r,n:Di(r.tail)===e?r.tail:r.head,alpha:o.angle},o.i+=o.inc,o.angle+=o.delta}function ZT(e,n){let t=q(e).clust,o=q(e).wdeg;if(o!==0){let r=[],i=Bse(e,n),s=0;for(let l=0;l<i.length;l++){let a=i[l+1],u=a!==void 0?a.alpha:2*Math.PI+i[0].alpha;s=Fse(e,i[l],r,s,u)}if(s!==o)throw new Error(`fdp expandCluster: ${s} ports vs wdeg ${o}`);ee(t).ports=r,ee(t).nports=o}return t}var zn=72,jse=54,Hse=36;function Vse(e){let n={aspect:1,sz:0,margin:0,doSplines:!1,mode:0,fixed:null,vals:null,flags:0};return Bn(e,2,Bt/2,n),{rootg:e,hasCoords:e.attrs.has("coords"),gid:0,pack:n}}function yf(e,n,t){let o=[],r=n??o;for(let i of e.subgraphs.values())gn(i)?Use(i,t,r):yf(i,r,t);n===null&&(e.info.n_cluster=o.length,o.length>0&&(e.info.clust=o))}function Use(e,n,t){let o=ee(e);o.level=ee(n).level+1,o.parent=n,t.push(e),yf(e,null,e)}function Xse(e,n){let t=e[0].info.bb,o={ll:{x:t.ll.x,y:t.ll.y},ur:{x:t.ur.x,y:t.ur.y}};if(e.length>1){let r=n[0];o.ll.x+=r.x,o.ll.y+=r.y,o.ur.x+=r.x,o.ur.y+=r.y;for(let i=1;i<e.length;i++){let s=e[i].info.bb;r=n[i],o.ll.x=Math.min(o.ll.x,s.ll.x+r.x),o.ll.y=Math.min(o.ll.y,s.ll.y+r.y),o.ur.x=Math.max(o.ur.x,s.ur.x+r.x),o.ur.y=Math.max(o.ur.y,s.ur.y+r.y)}}return o}function $se(e){return{ll:{x:0,y:0},ur:{x:Te(e.attrs.get("width"),jse,3),y:Te(e.attrs.get("height"),Hse,3)}}}function Wse(e,n){let t=e.info.label;if(!t)return!1;let o=A(t.dimen.x)-(n.ur.x-n.ll.x);return o>0&&(o/=2,n.ll.x-=o,n.ur.x+=o),!0}function Yse(e,n,t){for(let o=0;o<e.length;o++){let r;n?r={x:n[o].x+t.x,y:n[o].y+t.y}:r=t;let i={x:r.x/zn,y:r.y/zn};for(let s of e[o].nodes.values())s.info.pos[0]+=i.x,s.info.pos[1]+=i.y}}function Jse(e,n,t,o,r){let i=o===r.rootg,s=n.length>0?Xse(n,t):$se(o),l=n.length===0;Wse(o,s)&&(l=!1);let a=i||l?0:Te(o.attrs.get("margin"),Bt,0),u=Kse(o,s,a);n.length>0&&Yse(n,t,u),ee(e).bb={ll:{x:s.ll.x/zn,y:s.ll.y/zn},ur:{x:s.ur.x/zn,y:s.ur.y/zn}}}function Kse(e,n,t){let o=e.info.border??[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],r={x:-n.ll.x+t,y:-n.ll.y+t+o[_n].y};return n.ll.x=0,n.ll.y=0,n.ur.x+=r.x+t,n.ur.y+=r.y+t+o[An].y,r}function gb(e,n){let t=ee(e).bb;e!==n&&qse(e,t);let o=e.info.n_cluster??0;for(let r=0;r<o;r++){let i=e.info.clust[r];if(e!==n){let s=ee(i).bb;s.ll.x+=t.ll.x,s.ll.y+=t.ll.y,s.ur.x+=t.ll.x,s.ur.y+=t.ll.y}gb(i,n)}}function qse(e,n){for(let t of e.nodes.values())t.info.alg?.parent===e&&(t.info.pos[0]+=n.ll.x,t.info.pos[1]+=n.ll.y)}function yb(e){let n=ee(e).bb;e.info.bb={ll:{x:zn*n.ll.x,y:zn*n.ll.y},ur:{x:zn*n.ur.x,y:zn*n.ur.y}};let t=e.info.n_cluster??0;for(let o=0;o<t;o++)yb(e.info.clust[o])}function Qse(e){for(let n of e.nodes.values())if(n.info.clustnode)throw new Error("fdp setClustNodes: cluster-endpoint edges (compound) are not ported \u2014 see mission 7 journal")}function Zse(e){for(let n of e.nodes.values())n.info.coord={x:zn*n.info.pos[0],y:zn*n.info.pos[1]}}function ele(e,n,t){for(let o of[...e.nodes.values()])if(q(o).clust!==null){let r=ZT(o,e),i=ek(r,n,t);if(i!==0)return i;o.info.width=ee(r).bb.ur.x,o.info.height=ee(r).bb.ur.y;let s=zn*ee(r).bb.ur.x,l=zn*ee(r).bb.ur.y;o.info.rw=o.info.lw=s/2,o.info.ht=l}else Gr(o)&&nle(e,o);return 0}function nle(e,n){e.nodes.delete(n.name),e.edges=e.edges.filter(t=>t.tail!==n&&t.head!==n)}function tle(e,n,t,o){for(let r of e)Zse(r);if(e.length>1){let r=null;t&&(r=new Array(e.length).fill(!1),r[0]=!0),o.pack.fixed=r;let i=Qx(e.length,e,n,o.pack);return o.pack.fixed=null,i}return e.length===1&&(e[0].info.bb=Dn(e[0],0)),null}function ole(e,n){for(let t of e.nodes.values()){let o=q(t),r=o.clust;if(r!==null){let i=t.info.pos[0]-t.info.width/2,s=t.info.pos[1]-t.info.height/2;ee(r).bb={ll:{x:i,y:s},ur:{x:i+t.info.width,y:s+t.info.height}}}else if(o.dn!==null){let i=o.dn;i.info.pos[0]=t.info.pos[0],i.info.pos[1]=t.info.pos[1]}}ee(n).bb=ee(e).bb}function ek(e,n,t){for(let a of e.nodes.values())nf(a,null);let o=bb(e,n);if(o===null)return-1;let{comps:r,pinned:i}=mb(o,t),s=rle(e,r,n,t);if(s!==0)return s;let l=tle(r,o,i,n);return Jse(o,r,l,e,n),ole(o,e),0}function rle(e,n,t,o){let r={numIters:0,T0:0,K:0,C:0,loopcnt:0};for(let i of n){ub(i,r);let s=ele(i,t,o);if(s!==0)return s;i.nodes.size>=2&&(e===t.rootg&&Gp(i),pb(i,r))}return 0}function Pb(e){let n=Vse(e),t=ek(e,n,{value:0});return t!==0?t:(Qse(e),gb(e,e),yb(e),0)}function ile(e){dn(e,le),ee(e),yf(e,null,e),Cp(e),sb(e)}function sle(e){Xl(e)}function lle(e){if(sn(e,!1),Jl(1),ile(e),Pb(e)!==0)return;Oh(e),Oi(e),(e.info.flags&15)!==Kn&&sle(e),qe(e),Me(e,!1)}var nk={type:"fdp",layout(e){lle(e)},cleanup(e){lb(e)}};function Eb(e,n){let t=co(e.m,n.n,e.type,0),o=new Array(n.n).fill(-1),r=0;t.ia[0]=0;for(let i=0;i<e.m;i++){for(let s=e.ia[i];s<e.ia[i+1];s++)r=ok(e.a[s],n,e.ja[s],t,o,i,r);t.ia[i+1]=r}return t.nz=r,t}function ok(e,n,t,o,r,i,s){let l=n.a,a=o.a;for(let u=n.ia[t];u<n.ia[t+1];u++){let f=n.ja[u];r[f]<o.ia[i]?(r[f]=s,o.ja[s]=f,a[s]=e*l[u],s++):a[r[f]]+=e*l[u]}return s}function rk(e,n,t){let o=co(e.m,t.n,e.type,0),r=new Array(t.n).fill(-1),i=0;o.ia[0]=0;for(let s=0;s<e.m;s++){for(let l=e.ia[s];l<e.ia[s+1];l++){let a=e.ja[l];for(let u=n.ia[a];u<n.ia[a+1];u++)i=ok(e.a[l]*n.a[u],t,n.ja[u],o,r,s,i)}o.ia[s+1]=i}return o.nz=i,o}function ik(e){let n={superOf:new Array(e.n).fill(0),ns:new Array(e.n+1).fill(0),mask:new Array(e.n).fill(-1),newmap:new Array(e.n).fill(0),isup:1};n.ns[1]=e.n;for(let t=0;t<e.m;t++)ale(e,n,t);return ule(e.n,n)}function ale(e,n,t){let{ia:o,ja:r}=e,{superOf:i,ns:s,mask:l,newmap:a}=n;for(let u=o[t];u<o[t+1];u++)s[1+i[r[u]]]--;for(let u=o[t];u<o[t+1];u++){let f=i[r[u]];l[f]<t?(l[f]=t,s[1+f]===0?(s[1+f]=1,a[f]=f):(a[f]=n.isup,s[1+n.isup]=1,i[r[u]]=n.isup++)):(i[r[u]]=a[f],s[1+a[f]]++)}}function ule(e,n){let{superOf:t,ns:o,newmap:r,isup:i}=n;o[0]=0;for(let l=0;l<i;l++)o[l+1]+=o[l];let s=r;for(let l=0;l<e;l++){let a=t[l];s[o[a]]=l,o[a]=o[a]+1}for(let l=i;l>0;l--)o[l]=o[l-1];return o[0]=0,{ncluster:i,cluster:s,clusterp:o}}var fle=4,dle=.75,cle=4;function sk(e){return{level:0,n:e.n,A:e,P:null,R:null,next:null,prev:null}}var na=-1;function ple(e){let n=e.m,t={cluster:new Array(n).fill(0),clusterp:new Array(n+1).fill(0),ncluster:0},o=[];for(let i=0;i<n;i++)o.push(i);let r=mle(e,t,o);r=xle(e,t,o,r);for(let i=0;i<n;i++)o[i]===i&&(t.cluster[r++]=i,t.clusterp[++t.ncluster]=r);return t}function mle(e,n,t){let{ncluster:o,cluster:r,clusterp:i}=ik(e),s=0;for(let l=0;l<o;l++){if(i[l+1]-i[l]<=1)continue;let a=n.clusterp[n.ncluster];for(let u=i[l];u<i[l+1];u++)t[r[u]]=na,n.cluster[s++]=r[u],s-a>=cle&&(n.clusterp[++n.ncluster]=s,a=s);s>a&&(n.clusterp[++n.ncluster]=s)}return s}function xle(e,n,t,o){let{ia:r,ja:i,m:s}=e,l=e.a,a=o,u=$R(s);for(let f=0;f<s;f++){let d=u[f],c=!0,m=0,b=0;if(t[d]!==na){for(let g=r[d];g<r[d+1];g++)d!==i[g]&&t[i[g]]!==na&&t[d]!==na&&(c?(m=l[g],b=i[g],c=!1):l[g]>m&&(m=l[g],b=i[g]));c||(t[b]=na,t[d]=na,n.cluster[a++]=d,n.cluster[a++]=b,n.clusterp[++n.ncluster]=a)}}return a}function hle(e){let n=e.m,{cluster:t,clusterp:o,ncluster:r}=ple(e),i=r;if(i===n||i<fle)return null;let s=new Array(n).fill(0),l=new Array(n).fill(0),a=new Array(n).fill(0),u=0;for(let m=0;m<r;m++)for(let b=o[m];b<o[m+1];b++)s[u]=t[b],l[u]=m,a[u++]=1;let f=rf(u,n,i,{irn:s,jcn:l,val:a},1),d=hp(f),c=rk(d,e,f);return d=LR(d),c.isSymmetric=!0,c.isPatternSymmetric=!0,Hi(c),{cA:c,P:f,R:d}}function ble(e){let n=e,t=e.n,o=null,r=null,i=null,s=0;do{let l=hle(n);if(l===null)return i===null?null:{cA:i,P:o,R:r};s=l.cA.n,o!==null?(o=Eb(o,l.P),r=Eb(l.R,r)):(o=l.P,r=l.R),i=l.cA,n=i}while(s>dle*t);return{cA:i,P:o,R:r}}function lk(e,n){if(e.level>=n-1)return;let t=ble(e.A);if(t===null)return;let o=sk(t.cA);e.next=o,o.level=e.level+1,o.n=t.cA.m,o.P=t.P,e.R=t.R,o.prev=e,lk(o,n)}function ak(e,n){let t=e;(!ji(t,!1)||t.type!==1)&&(t=Wl(t));let o=sk(t);return lk(o,n),o}function uk(e){let n=e;for(;n.next!==null;)n=n.next;return n}function Lp(e){return e.prev===null}function gle(e){let{ia:n,ja:t,m:o}=e,r=new Array(o+1).fill(0),i=0;for(let s=0;s<o;s++){let l=0;for(let a=n[s];a<n[s+1];a++)s!==t[a]&&l++;r[l]++,i=Math.max(i,r[l])}return r[1]>.8*i&&r[1]>.3*o}function yle(e,n,t){let o=[0,0,0,0],r=[0,0];for(let l=0;l<e;l++)for(let a=0;a<n;a++)r[a]+=t[l*n+a];for(let l=0;l<n;l++)r[l]/=e;for(let l=0;l<e;l++)for(let a=0;a<n;a++)t[n*l+a]-=r[a];for(let l=0;l<e;l++)for(let a=0;a<n;a++)for(let u=0;u<n;u++)o[n*a+u]=Y(t[l*n+a],t[l*n+u],o[n*a+u]);let i=[0,1];o[1]!==0&&(i[0]=-(-o[0]+o[3]-Math.sqrt(o[0]*o[0]+4*o[1]*o[1]-2*o[0]*o[3]+o[3]*o[3]))/(2*o[1]),i[1]=1);let s=Math.sqrt(1+i[0]*i[0]);i[0]=i[0]/s,i[1]=i[1]/s;for(let l=0;l<e;l++){let a=t[n*l]*i[0]+t[n*l+1]*i[1],u=-t[n*l]*i[1]+t[n*l+1]*i[0];t[n*l]=a,t[n*l+1]=u}}function Ple(e,n,t){let{ia:o,ja:r}=n,i=.5,s=new Array(e).fill(0);for(let l=0;l<n.m;l++){for(let u=0;u<e;u++)s[u]=0;let a=0;for(let u=o[l];u<o[l+1];u++)if(r[u]!==l){a++;for(let f=0;f<e;f++)s[f]+=t[r[u]*e+f]}if(a>0){let u=(1-i)/a;for(let f=0;f<e;f++)t[l*e+f]=Y(i,t[l*e+f],u*s[f])}}}function Ele(e,n,t,o,r,i,s){Vi(t,r,i,e),Ple(e,n,i);let l=o.m,{ia:a,ja:u}=o;for(let f=0;f<l;f++)for(let d=a[f]+1;d<a[f+1];d++)for(let c=0;c<e;c++)i[u[d]*e+c]=Y(s,Kl()-.5,i[u[d]*e+c])}function fk(e,n,t,o,r){let i={...t},s=n.n;if(s<=0||e<=0)return;let l=n;!ji(l,!1)||l.type!==1?l=Wl(l):l=Hi(l);let a=ak(l,t.multilevels),u=uk(a),f=Lp(u)?r:new Array(u.n*e).fill(0),d=gle(l);for(t.p===uf&&(t.p=-1,d&&(t.p=-1.8));rT(e,u.A,t,f),!Lp(u);){let c=u.P;u=u.prev;let m=Lp(u)?r:new Array(u.n*e).fill(0);Ele(e,u.A,c,u.R,f,m,t.K*.001),f=m,t.randomStart=!1,t.K=t.K*.75,t.adaptiveCooling=!1,t.step=.1}e===2&&yle(s,e,r),Rp(e,l,r,o,t.overlap,t.initialScaling,t.doShrinking),Object.assign(t,i)}var Ip=2;function dk(e,n,t){let o=vp(e),r=n.overlap>=0?Sp(e,t):null,i=uT(e,Ip);fk(Ip,o,n,r,i);for(let s of e.nodes.values()){let l=s.info.id;s.info.pos=[i[l*Ip],i[l*Ip+1]]}}function vle(e){let n=eT();aT(e,n);let t={x:Io/72,y:Io/72},o=ge(e,"overlap"),i=xf(o===void 0?"prism0":o);if(i!==null){n.overlap=i,n.initialScaling=V(e.root.attrs.get("overlap_scaling"),-4,-1e10);let s=Lr(e);return s.doAdd&&(t.x=s.x/72,t.y=s.y/72),{ctrl:n,pad:t,doAdjust:!1}}return n.overlap=-1,{ctrl:n,pad:t,doAdjust:!0}}function Sle(e,n,t,o,r){let i={aspect:1,sz:0,margin:Bt,doSplines:!1,mode:2,fixed:null,vals:null,flags:0};Bn(e,2,Bt,i),i.doSplines=!0;for(let s of n)dk(s,t,o),r&&mf(s),dn(s,le),Ot(s);jl(n.length,n,e,i)}function wle(e,n){let t=Dn(e,0,n);(t.ll.x!==0||t.ll.y!==0)&&ep(e,-t.ll.x,-t.ll.y),e.info.bb=Dn(e,0,n),qe(e),Me(e)}function Nle(e){sn(e,!1),lT(e),Jl(1);let n=!0;if(e.nodes.size>0){let{ctrl:t,pad:o,doAdjust:r}=vle(e),i=Cr(e,"_sfdp_cc");n=i.length===1,n?(dk(e,t,o),r&&mf(e),Ot(e)):Sle(e,i,t,o,r)}wle(e,n)}var ck={type:"sfdp",layout:Nle,cleanup:fT};function vb(e){dn(e,le),e.info.ndim=2;let n=[];for(let t of e.nodes.values()){let o={kind:"circo-ndata",dnode:null};t.info.alg=o,t.info.pos=[0,0],n.push(t)}e.info.neato_nlist=n}function Sb(e){let n=e.info.neato_nlist?.[0];n&&(n.info.alg=void 0)}function wb(e){return{subGraph:e,radius:0,rad0:0,circleList:[],children:[],parentPos:-1,flags:0,child:null}}function pk(e){return e.subGraph.nodes.length}function mk(e,n){e.push(n)}function Nb(e,n){e.unshift(n)}function xk(e){e.flags|=1}function hk(e){return(e.flags&1)!==0}function Op(e){if(!e.child)return null;let n=e.child.info.alg;return n?.kind!=="circo-cdata"?null:n.parent?.orig??null}var Rle=1;function bk(e){return{bl:[],orderCount:1,blockCount:e,graphCopyCount:0,spanningTreeCount:0,minDist:Rle,rootname:""}}function gk(e){return{kind:"circo-cdata",flags:0,parent:null,block:null,bc:{val:0,lowVal:0},clone:null,tparent:null,leafone:null,leaftwo:null,fdist:0,sdist:0,pos:0,psi:0,degree:0,derivedNode:e}}function Tle(e,n){let t=new Set(n.subGraph.nodes);for(let o of n.subGraph.nodes)for(let r of e)r.tail===o&&t.has(r.head)&&!n.subGraph.edges.includes(r)&&n.subGraph.edges.push(r)}function Pk(e){return e.info.alg?.derivedNode??null}function kle(e,n,t){let o=0;for(let r of t)r.order>e.order&&r.tail!==n&&r.head!==n&&o++;return o}function Cle(e,n,t,o){for(let r of n)r.order===0&&(r.tail===e||r.head===e)&&(r.order=o,t.push(r))}function Ek(e,n){for(let i of n)i.order=0;let t=[],o=0,r=1;for(let i of e){let s=Pk(i);if(s){for(let l of n)l.order>0&&(l.tail===s||l.head===s)&&(o+=kle(l,s,t));Cle(s,n,t,r++)}}return o}function _le(e,n,t,o){let r=e.indexOf(n);r!==-1&&e.splice(r,1);let i=e.indexOf(t);if(i===-1){e.push(n);return}e.splice(o===0?i:i+1,0,n)}function Ale(e,n,t,o){let r=new Map;o.forEach((s,l)=>r.set(s,l));let i=new Map;n.forEach((s,l)=>i.set(s,l));for(let s of o)for(let l of Dp(s,n,r,i)){let a=l.tail;a===s&&(a=l.head);for(let u of[0,1]){let f=[...e];_le(e,s.orig,a.orig,u);let d=Ek(e,n);if(d<t.v){if(t.v=d,t.v===0)return}else e.length=0,e.push(...f)}}}var Gle=10;function Mle(e,n,t){let o={v:Ek(e,n)};for(let r=0;r<Gle&&o.v>0;r++){let i=o.v;if(Ale(e,n,o,t),i===o.v)break}return e}function Dp(e,n,t,o){let r=n.filter(s=>s.tail===e).sort((s,l)=>(t.get(s.head)??0)-(t.get(l.head)??0)||(o.get(s)??0)-(o.get(l)??0)),i=n.filter(s=>s.head===e).sort((s,l)=>(t.get(s.tail)??0)-(t.get(l.tail)??0)||(o.get(s)??0)-(o.get(l)??0));return[...r,...i]}function vk(e,n,t,o,r){e.visited=!0;for(let i of Dp(e.dn,t,o,r)){let s=i.tail===e.dn?i.head:i.tail,l=n.get(s);l&&!l.visited&&(l.tparent=e,vk(l,n,t,o,r))}}function Lle(e,n){let t=new Map;for(let i of e)t.set(i,{dn:i,tparent:null,visited:!1,distone:0,disttwo:0,leafone:null,leaftwo:null,onpath:!1});let o=new Map;e.forEach((i,s)=>o.set(i,s));let r=new Map;n.forEach((i,s)=>r.set(i,s));for(let i of e){let s=t.get(i);s.visited||(s.tparent=null,vk(s,t,n,o,r))}return t}function Sk(e,n,t,o){let r=n.tparent;if(!r)return;let i=t+1;if(r.distone===0)r.leafone=e,r.distone=i;else if(i>r.distone)r.leafone!==o&&((!r.disttwo||r.leaftwo!==o)&&(o=r.leafone),r.leaftwo=r.leafone,r.disttwo=r.distone),r.leafone=e,r.distone=i;else if(i>r.disttwo){r.leaftwo=e,r.disttwo=i;return}else return;Sk(e,r,i,o)}function yk(e,n){let t=[];for(let o=e;o&&o!==n;o=o.tparent)t.push(o),o.onpath=!0;return t}function Ile(e,n){return n.filter(t=>t.tparent===e||e.tparent===t).length}function Ole(e){let n=null,t=0;for(let o of e){let r=o.distone+o.disttwo;r>t&&(n=o,t=r)}return n}function Dle(e){if(e.length===1)return e[0].onpath=!0,[e[0]];for(let o of e)Ile(o,e)===1&&Sk(o,o,0,null);let n=Ole(e);if(!n)return[];let t=yk(n.leafone??n,n);if(t.push(n),n.onpath=!0,n.disttwo>0&&n.leaftwo){let o=yk(n.leaftwo,n);o.reverse();for(let r of o)t.push(r)}return t}function Ble(e){let n=0;for(let t of e)n=Math.max(n,t.info.width||0,t.info.height||0);return n}function Fle(e,n){let t=new Set;for(let o of n)o.tail===e?t.add(o.head):o.head===e&&t.add(o.tail);return t}function kb(e,n){let t=Pk(e);return t!==null&&n.has(t)}function zle(e,n,t){for(let o=0;o<e.length;o++)if(kb(e[o],t)&&kb(e[(o+1)%e.length],t))return e.splice(o+1,0,n.orig),!0;return!1}function jle(e,n,t){for(let o=0;o<e.length;o++)if(kb(e[o],t))return e.splice(o+1,0,n.orig),!0;return!1}function Hle(e,n,t){let o=Fle(e,n);o.size>=2&&zle(t,e,o)||o.size>0&&jle(t,e,o)||t.push(e.orig)}function Vle(e,n,t){for(let o of e.subGraph.nodes)o.cdata.flags&8||Hle(o,n,t)}function Ule(e){for(let n=0;n<e.length;n++)if((e[n].info.alg?.flags??0)&4){let o=e.splice(0,n);e.push(...o);break}}function Xle(e,n){let t=e.length;for(let o=0;o<t;o++){let r=o*(2*Math.PI/t),i=e[o];i.info.pos=i.info.pos??[0,0],i.info.pos[0]=n*Math.cos(r),i.info.pos[1]=n*Math.sin(r);let s=i.info.alg;s&&(s.pos=o,s.psi=0)}}function Cb(e){let n=e.out.filter(o=>o.alive).sort((o,r)=>o.head.idx-r.head.idx||o.seq-r.seq),t=e.in.filter(o=>o.alive).sort((o,r)=>o.tail.idx-r.tail.idx||o.seq-r.seq);return[...n,...t]}function $le(e,n){for(let t of e.out)if(t.alive&&t.head===n)return t;for(let t of e.in)if(t.alive&&t.tail===n)return t;return null}function Rb(e,n,t){let o={tail:e,head:n,orige:null,seq:t,alive:!0};e.out.push(o),n.in.push(o)}function Wle(e){e.alive=!1;for(let n of e.out)n.alive=!1;for(let n of e.in)n.alive=!1}function Yle(e,n){let t=0,o=e.degree,r=[],i=[],s=Cb(e);for(let a of s){let u=a.head===e?a.tail:a.head,f=!1;for(let d of s){if(d===a)continue;let c=d.head===e?d.tail:d.head,m=$le(u,c);m&&(f=!0,u.idx<c.idx&&(t++,m.orige!==null&&(n.pruned.add(m.orige),m.orige=null)))}f?r.push(u):i.push(u)}let l=o-1-t;if(l>0){if(l<i.length){for(let a=0;a+1<i.length;a+=2)Rb(i[a],i[a+1],n.nextSeq.v++),i[a].degree++,i[a+1].degree++,l--;for(let a=2;l>0;a++,l--)Rb(i[0],i[a],n.nextSeq.v++),i[0].degree++,i[a].degree++}else if(l===i.length){let a=r.length===0?null:r[0];for(let u of i)a!==null&&(Rb(a,u,n.nextSeq.v++),a.degree++),u.degree++}}}function Jle(e,n){let t=new Map;e.forEach((a,u)=>{t.set(a,{dn:a,idx:u,degree:0,out:[],in:[],alive:!0})});let o=0;for(let a of e){let u=t.get(a);for(let f of n){if(f.tail!==a)continue;let d=t.get(f.head);if(!d)continue;let c={tail:u,head:d,orige:f,seq:o++,alive:!0};u.out.push(c),d.in.push(c),u.degree+=1,d.degree+=1}}let r={pruned:new Set,nextSeq:{v:o}},i=(a,u)=>a.degree<u.degree?1:a.degree>u.degree?-1:0,s=be([...t.values()],i),l=e.length;for(let a=0;a<l-3;a++){let u=s.length===0?null:s.pop();if(u===null)continue;let f=Cb(u).map(d=>d.head===u?d.tail:d.head);for(let d of f){let c=s.indexOf(d);c>=0&&s.splice(c,1)}Yle(u,r);for(let d of Cb(u).map(c=>c.head===u?c.tail:c.head))d.degree--,s.push(d);be(s,i),Wle(u)}return n.filter(a=>!r.pruned.has(a))}function _b(e,n,t,o){n.subGraph.nodes.sort((c,m)=>c.orig.id-m.orig.id),Tle(e.edges,n);let r=n.subGraph.edges;for(let c of n.subGraph.nodes)c.cdata.flags&=-9;let i=Jle(n.subGraph.nodes,r),s=Lle(n.subGraph.nodes,i),l=Dle([...s.values()]),a=l.map(c=>c.dn.orig);for(let c of l)c.dn.cdata.flags|=8;Vle(n,r,a),Mle(a,r,n.subGraph.nodes),Ule(a);let u=a.length,f=Ble(a),d=u<=1?0:u*(t+f)/(2*Math.PI);return Xle(a,d),n.radius=u<=1?f/2:d,n.rad0=n.radius,n.parentPos=-1,a}function Kle(e,n){let o={name:`_block_${n.blockCount++}`,nodes:[],edges:[],parent:e};return e.subgraphs.push(o),o}function wk(e,n){return wb(Kle(e,n))}function Ab(e,n){e.subGraph.nodes.push(n),n.cdata.block=e}function qle(e,n){let t=[],o;do o=e[e.length-1],e.pop(),t.push(o);while(o!==n);return t}function Qle(e,n,t,o){let r=null;for(let i of t){let s=i.order===1?i.head:i.tail;s.cdata.block===null&&(r===null&&(r=wk(e,n)),Ab(r,s))}return r!==null&&o.cdata.block===null&&pk(r)>1&&Ab(r,o),r}function Zle(e,n,t,o){o&&t.cdata.block===n?Nb(e.bl,n):mk(e.bl,n)}function eae(e,n,t,o,r){if(t.cdata.bc.lowVal<n.cdata.bc.val)return;let i=qle(e.stk,o),s=Qle(e.g.parent,e.state,i,n);s!==null&&Zle(e.state,s,n,r)}function nae(e,n,t,o){let r=t.head===n?t.tail:t.head;t.order===0&&(t.order=t.head===n?-1:1),r.cdata.bc.val===0?(r.cdata.parent=n,e.stk.push(t),Nk(e,r,!1),n.cdata.bc.lowVal=Math.min(n.cdata.bc.lowVal,r.cdata.bc.lowVal),eae(e,n,r,t,o)):r!==n.cdata.parent&&(n.cdata.bc.lowVal=Math.min(n.cdata.bc.lowVal,r.cdata.bc.val))}function Nk(e,n,t){n.cdata.bc.val=e.state.orderCount,n.cdata.bc.lowVal=e.state.orderCount,e.state.orderCount++;let o=Dp(n,e.allEdges,e.ord,e.seq);for(let r of o)nae(e,n,r,t);if(t&&n.cdata.block===null){let r=wk(e.g.parent,e.state);Ab(r,n),Nb(e.state.bl,r)}}function tae(e,n,t){let o=null;if(n.rootname&&(o=e.parent.nodes.get(n.rootname)??null),!o&&e.nodes.length>0&&(o=e.nodes[0]),!o)return;let r=new Map;e.nodes.forEach((s,l)=>r.set(s,l));let i=new Map;t.forEach((s,l)=>i.set(s,l)),Nk({g:e,state:n,allEdges:t,stk:[],ord:r,seq:i},o,!0)}function oae(e){let n=e.subGraph.nodes[0],t=n.cdata.bc.val,o=n.cdata.parent;for(let r=1;r<e.subGraph.nodes.length;r++){let i=e.subGraph.nodes[r];i.cdata.bc.val<t&&(n=i,t=i.cdata.bc.val,o=i.cdata.parent)}return{child:n,parentNode:o}}function rae(e){if(e.subGraph.nodes.length===0)return;let{child:n,parentNode:t}=oae(e);if(e.child=n.orig,t===null)return;t.cdata.flags|=4;let o=t.cdata.block;o!==null&&o.children.push(e)}function Gb(e,n,t){tae(e,n,t);let o=n.bl[0];for(let r=1;r<n.bl.length;r++)rae(n.bl[r]);return n.bl=[],o}function Rk(e,n){let o={name:`_block_${n.blockCount++}`,nodes:[...e.nodes],edges:[],parent:e.parent};e.parent.subgraphs.push(o);let r=wb(o);for(let i of o.nodes)i.cdata.block=r;return r}function Bp(e){for(let n of e.children)Bp(n);e.circleList=[],e.children=[]}function iae(e,n,t,o){return[e*t-n*o,e*o+n*t]}function Tk(e){return e.info.alg?.psi??0}function sae(e,n){let t=n+Math.PI-e.parentPos;return t<0&&(t+=2*Math.PI),t}function lae(e,n,t,o){let r=o,i=Math.hypot(o.info.pos[0]+n,o.info.pos[1]+t);for(let s of e.subGraph.nodes){if(s.orig===o)continue;let l=Math.hypot(s.orig.info.pos[0]+n,s.orig.info.pos[1]+t);l<i&&(i=l,r=s.orig)}return r}function aae(e,n,t,o,r){let i=e.rad0,s=e.radius-i,l=o.info.pos[0],a=o.info.pos[1];if(-s>=l){let c=Math.atan2(a,l);return r+Math.PI-c-Tk(o)}let u=Math.hypot(n,t),f=Math.atan2(a,l+s),d=s-i/Math.cos(f);return r+Math.PI/2-f-Math.asin(d/u*Math.cos(f))}function uae(e,n,t,o,r){if(lae(e,n,t,o)===o)return 0;if(hk(e))return aae(e,n,t,o,r);let i=Math.atan2(o.info.pos[1],o.info.pos[0]),s=r+Math.PI-i-Tk(o);return s>2*Math.PI&&(s-=2*Math.PI),s}function Fp(e,n,t,o){let r=Math.cos(o),i=Math.sin(o);for(let s of e.subGraph.nodes){let l=s.orig.info.pos,[a,u]=iae(l[0],l[1],r,i);l[0]=a+n,l[1]=u+t}for(let s of e.children)Fp(s,n,t,o)}function kk(e,n,t,o){if(e.parentPos>=0)return sae(e,o);if(e.circleList.length===2)return o-Math.PI/2;let r=e.child;return r?uae(e,n,t,r,o):0}function fae(e,n){return e.cp.filter(t=>Op(t)===n&&t.circleList.length>0)}function dae(e,n,t){let o=0,r=0,i=0;for(let s of n.cp)Op(s)===e.n&&(i++,o=Math.max(o,s.radius),r+=2*s.radius+t);return e.diameter=r,e.childCount=i,e.minRadius=n.radius+t+o,e.maxRadius=o,o}function Ck(e,n,t){let o=Math.max((e.diameter*n.minRadius+n.diameter*e.minRadius)/(2*t*e.minRadius*n.minRadius),1);e.scale=Math.max(e.scale,o),n.scale=Math.max(n.scale,o)}function cae(e,n,t){let o=t.childRadius*Math.cos(n),r=t.childRadius*Math.sin(n);return Fp(e,o,r,kk(e,o,r,n)),t.length===1?n+t.incAngle+t.mindistAngle:n+t.incAngle+t.mindistAngle/2}function pae(e,n,t,o,r){let i=o===0?0:t===2?Math.PI:e+n;return r.firstAngle<0&&(r.firstAngle=i),r.lastAngle=i,i}function mae(e,n,t,o,r){return o===1?r:e+n+t/2}function xae(e,n,t,o){if(o&&e===n.neighbor){let r=e.info.alg;r&&(r.psi=t)}}function hae(e,n,t,o){let r=fae(n,e.n);if(r.length===0)return;let i=e.scale*e.minRadius,s=o;if(t===1){i=Math.max(i,e.diameter/(2*Math.PI));let c=2*Math.PI*i-e.diameter;c>0&&(s+=c/e.childCount)}n.subtreeR=Math.max(n.subtreeR,i+e.maxRadius);let l=s/i,a=t===1?0:e.theta-e.diameter/(2*i),u=Math.floor((e.childCount+1)/2),f={childRadius:i,incAngle:0,mindistAngle:l,length:t},d=0;for(let c of r)f.incAngle=c.radius/i,a=t===1?pae(a,f.incAngle,e.childCount,d,n):mae(a,f.incAngle,l,e.childCount,e.theta),a=cae(c,a,f),d++,xae(e.n,n,a,d===u&&t>1)}function bae(e,n,t){let o=[];for(let r=0;r<e.length;r++){let i=e[r];if(!((i.info.alg?.flags??0)&4))continue;let l={n:i,theta:r*n.nodeAngle,minRadius:0,maxRadius:0,diameter:0,scale:1,childCount:0};dae(l,n,t),o.push(l)}return o}function gae(e){if(!(e.length<2)){if(e.length===2){let n=e[1].theta-e[0].theta;n>Math.PI&&(n=2*Math.PI-n),Ck(e[0],e[1],n);return}for(let n=0;n<e.length;n++){let t=e[(n+1)%e.length],o=t.theta-e[n].theta;o<=0&&(o+=2*Math.PI),Ck(e[n],t,o)}}}function yae(e,n,t,o,r){r===1?(Fp(e,-(n+t/2),0,0),e.radius+=t/2+n,xk(e)):e.radius=o.subtreeR}function Pae(e,n,t,o,r){let i={cp:o.children,subtreeR:o.radius,radius:o.radius,neighbor:o.child,nodeAngle:2*Math.PI/n,firstAngle:-1,lastAngle:-1},s=bae(t,i,r);gae(s);let l=0;for(let a of s)l=Math.max(l,a.maxRadius),hae(a,i,n,r);return yae(o,l,r,i,e),(i.firstAngle+i.lastAngle)/2-Math.PI}function _k(e,n,t,o){let r=0;for(let l of n.children)_k(e,l,t,o),r++;let i=_b(e,n,t,o);n.circleList=i;let s=Math.PI;r>0&&(s=Pae(r,i.length,i,n,t)),i.length===1&&Op(n)&&(n.parentPos=s<0?s+2*Math.PI:s)}function Mb(e,n,t){_k(e,n,t.minDist,t)}function Eae(e){let n={name:e.name,orig:e,pos:[0,0],cdata:null,lw:e.info.lw,rw:e.info.rw,ht:e.info.ht};return n.cdata=gk(n),n}function vae(e){let n={nodes:new Map,subgraphs:[],components:[]};for(let t of M(e)){let o=Eae(t);n.nodes.set(t.name,o),t.info.alg=o.cdata}return n}function Sae(e,n){let t=[],o=new Set;for(let r of M(e))for(let i of r.outEdges(e)){if(i.tail===i.head)continue;let s=n.nodes.get(i.tail.name),l=n.nodes.get(i.head.name);if(!s||!l)continue;let a=[s.name,l.name].sort().join("\0");o.has(a)||(o.add(a),t.push({tail:s,head:l,order:0,origEdge:i}))}return t}function wae(e,n,t){return Cr(e,"_cc").map((r,i)=>{let s=[];for(let u of r.nodes.values()){let f=n.nodes.get(u.name);f&&s.push(f)}s.sort((u,f)=>u.orig.id-f.orig.id);let l=new Set(s),a=t.filter(u=>l.has(u.tail)&&l.has(u.head));return{name:`_cc_${i}`,nodes:s,edges:a,parent:n}})}function Nae(e){let n=e.nodes[0];n&&(n.orig.info.pos=[0,0])}function Rae(e){return e.attrs.get("oneblock")==="true"}function Tae(e){let n=parseFloat(e.attrs.get("mindist")??"");return isNaN(n)||n<0?1:n}function Ak(e,n,t,o){if(e.nodes.length===1)return Nae(e),t;let r=bk(t);r.minDist=Tae(n),r.rootname=n.attrs.get("root")??"";let i;return Rae(n)?i=Rk(e,r):i=Gb(e,r,o),Mb(e,i,r),Bp(i),r.blockCount}function Lb(e){if(e.nodes.size===0)return;let n=vae(e),t=Sae(e,n),o=wae(e,n,t);n.components=o;let r=0;o.length===1?(r=Ak(o[0],e,r,t),o[0],Ql(e)):kae(e,n,o,t,r)}function kae(e,n,t,o,r){let i=r;for(let a of t)i=Ak(a,e,i,o);let s={aspect:1,sz:0,margin:8,doSplines:!1,mode:2,fixed:null,vals:null,flags:0};Bn(e,2,8,s);let l=t.map(a=>Cae(a,e));jl(t.length,l,e,s);for(let a=0;a<t.length;a++)t[a]}function Cae(e,n){let t=new n.constructor("_proxy","undirected");t.info.dotroot=n;for(let o of e.nodes){let r=o.orig.info.pos??[0,0];o.orig.info.coord={x:(r[0]??0)*72,y:(r[1]??0)*72},t.nodes.set(o.name,o.orig)}return t}function _ae(e){sn(e,!1),qt(e);let n=Oe(e);if(n!==void 0)for(let t of e.edges)Ln(t,e,n);vb(e),Lb(e),Sb(e),Ot(e),qe(e),Me(e)}function Aae(e){e.info.alg=void 0,e.info.neato_nlist=void 0}var Gk={type:"circo",layout:_ae,cleanup:Aae};function Gae(e){if(e.nodes.size===0)return;sn(e,!1),qt(e);let n=Oe(e);if(n!==void 0)for(let s of e.edges)Ln(s,e,n);nb(e);let t=e.attrs.get("root"),o=t!==void 0,r=o&&t!==""?e.nodes.get(t)??null:null,i=Cr(e,"_twopi");i.length===1?GT(e,i,r,o):MT(e,i,r,AT(e)),Uw(e),qe(e),Me(e)}var Mk={type:"twopi",layout:Gae,cleanup:Zl};var Lk=18,Ik=4;function Mae(e){return e.info.alg?.kind==="osage"?e.info.alg.ownerCluster:null}function Lae(e){return e===e.root||e.name.toLowerCase().startsWith("cluster")?!0:Ne(e.attrs.get("cluster"))}function Iae(e){sn(e,!1),dn(e,le),e.info.ndim=2;let n=Oe(e);for(let t of e.nodes.values()){if(Ii(t,2),n!==void 0){hi(t,e);continue}let o=(t.info.width||.75)*72,r=(t.info.height||.5)*72;t.info.lw=o/2,t.info.rw=o/2,t.info.ht=r}if(n!==void 0)for(let t of e.edges)Ln(t,e,n)}function Ok(e,n,t){for(let o of e.subgraphs.values())Lae(o)?(o.info.bb=o.info.bb??{ll:{x:0,y:0},ur:{x:0,y:0}},Wt(o,Oe(o)),n.push(o),Ib(o,null,o)):Ib(o,n,t)}function Ib(e,n,t){if(n===null){let o=[null];Ok(e,o,t);let r=o.filter(i=>i!==null);e.info.n_cluster=r.length,r.length>0&&(e.info.clust=r)}else Ok(e,n,t)}function Oae(e){return{ll:{x:e.ll.x,y:e.ll.y},ur:{x:e.ur.x,y:e.ur.y}}}function Dae(e){let n={aspect:1,sz:0,margin:Ik,doSplines:!1,mode:4,fixed:null,vals:null,flags:0};return Bn(e,4,Ik,n),n.mode<3&&(n.mode=3),n}function Bae(e,n,t){e.gs.push(Oae(n.info.bb)),e.childGraphs.push(n),t&&e.vals.push(Te(n.attrs.get("sortv"),0,0))}function Fae(e,n,t,o){n.info.alg={kind:"osage",ownerCluster:t},e.gs.push({ll:{x:0,y:0},ur:{x:n.info.lw+n.info.rw,y:n.info.ht}}),e.childNodes.push(n),o&&e.vals.push(Te(L(n,t,"sortv"),0,0))}function zae(e,n,t,o){let r={gs:[],childGraphs:[],childNodes:[],vals:[]};for(let i=1;i<=n;i++)Bae(r,e.info.clust[i-1],o);if(e.nodes.size-t>0){let i=[...e.nodes.values()].sort((s,l)=>s.id-l.id);for(let s of i)s.info.alg===void 0&&Fae(r,s,e,o)}return r}function jae(e,n){let t=1/0,o=1/0,r=-1/0,i=-1/0,s=e.childGraphs.length;for(let l=0;l<e.gs.length;l++){let a=n[l],u=e.gs[l],f=u.ll.x+a.x,d=u.ll.y+a.y,c=u.ur.x+a.x,m=u.ur.y+a.y;if(f<t&&(t=f),d<o&&(o=d),c>r&&(r=c),m>i&&(i=m),l<s)e.childGraphs[l].info.bb={ll:{x:f,y:d},ur:{x:c,y:m}};else{let b=e.childNodes[l-s];b.info.coord={x:(f+c)/2,y:(d+m)/2}}}return{llx:t,lly:o,urx:r,ury:i}}function Hae(e,n,t){let o=e.info.label?.dimen;if(!o)return t;let{llx:r,lly:i,urx:s,ury:l}=t;if(n===0)return{llx:0,lly:0,urx:o.x,ury:o.y};let a=o.x-(s-r);return a>0&&(r-=a/2,s+=a/2),{llx:r,lly:i,urx:s,ury:l}}function Vae(e,n,t){let{llx:o,lly:r,urx:i,ury:s}=t,l=e.info.border,a=l?l[_n].y:0,u=l?l[An].y:0;return o-=n,i+=n,r-=n+a,s+=n+u,{llx:o,lly:r,urx:i,ury:s}}function Uae(e,n){let{llx:t,lly:o}=n;for(let r of e){let i=r.info.bb;r.info.bb={ll:{x:i.ll.x-t,y:i.ll.y-o},ur:{x:i.ur.x-t,y:i.ur.y-o}}}}function Xae(e,n){let{llx:t,lly:o}=n;for(let r of e)r.info.coord={x:r.info.coord.x-t,y:r.info.coord.y-o}}function $ae(e,n){Uae(e.childGraphs,n),Xae(e.childNodes,n)}function Wae(e,n,t){let o=0;for(let r=1;r<=n;r++){let i=e.info.clust[r-1];Dk(i,t+1),o+=i.nodes.size}return o}function Yae(e,n,t,o,r){let i=Dae(e),s=i.mode===4&&(i.flags&2)!==0,l=zae(e,n,t,s);s&&l.vals.length>0&&(i.vals=l.vals);let a=Vw(l.gs.length,l.gs,i);if(!a)return;let u=jae(l,a);u=Hae(e,o,u),u=Vae(e,r>0?i.margin/2:0,u),$ae(l,u),e.info.bb={ll:{x:0,y:0},ur:{x:u.urx-u.llx,y:u.ury-u.lly}}}function Dk(e,n){let t=e.info.n_cluster??0,o=Wae(e,t,n),r=e.nodes.size-o+t;if(r===0&&!e.info.label){e.info.bb={ll:{x:0,y:0},ur:{x:Lk,y:Lk}};return}Yae(e,t,o,r,n)}function Jae(e,n){for(let t of e.nodes.values())Mae(t)===e&&(t.info.coord={x:t.info.coord.x+n.ll.x,y:t.info.coord.y+n.ll.y})}function Kae(e,n){let t=e.info.bb;e.info.bb={ll:{x:t.ll.x+n.ll.x,y:t.ll.y+n.ll.y},ur:{x:t.ur.x+n.ll.x,y:t.ur.y+n.ll.y}}}function Bk(e,n){let t=e.info.bb,o=e.info.n_cluster??0;n>0&&Jae(e,t);for(let r=1;r<=o;r++){let i=e.info.clust[r-1];n>0&&Kae(i,t),Bk(i,n+1)}}function qae(e){if(Iae(e),Ib(e,null,e),Dk(e,0),Bk(e,0),op(e),(e.info.drawing?.ratioKind??"none")!=="none"){for(let n of e.nodes.values())n.info.pos=[n.info.coord.x/72,n.info.coord.y/72];Oi(e),Xl(e)}else(e.info.flags&15)!==Kn&&Xl(e);qe(e),Me(e)}function Fk(e){let n=e.info.n_cluster??0;for(let t=1;t<=n;t++)Fk(e.info.clust[t-1]);e.info.clust=void 0,e.info.n_cluster=void 0}function Qae(e){for(let n of e.nodes.values())n.info.alg?.kind==="osage"&&(n.info.alg=void 0);Fk(e)}var zk={type:"osage",layout:qae,cleanup:Qae};var Ob=class{area;recs;nadded=0;maxarea=0;minarea=1;totalarea=0;asp=1;offset=0;constructor(n,t){this.area=n,this.recs=t}placeTall(n,t,o){let r=Math.min(o.size[0],o.size[1]),i=t/r,s=o.x[1]+.5*o.size[1]-i/2,l=o.x[0]-o.size[0]/2;for(let a=0;a<n;a++){let u=this.area[this.offset+a]/i;this.recs[this.offset+a]={x:[l+u/2,s],size:[u,i]},l+=u}}placeWide(n,t,o){let r=Math.min(o.size[0],o.size[1]),i=t/r,s=o.x[0]-.5*o.size[0]+i/2,l=o.x[1]+o.size[1]/2;for(let a=0;a<n;a++){let u=this.area[this.offset+a]/i;this.recs[this.offset+a]={x:[s,l-u/2],size:[i,u]},l-=u}}commit(n,t,o){let r=Math.min(o.size[0],o.size[1]);if(o.size[0]<=o.size[1]){this.placeTall(n,t,o);let s=t/r;return{x:[o.x[0],o.x[1]-s/2],size:[o.size[0],o.size[1]-s]}}this.placeWide(n,t,o);let i=t/r;return{x:[o.x[0]+i/2,o.x[1]],size:[o.size[0]-i,o.size[1]]}}tryAdd(n,t){if(this.nadded>=n)return!1;let o=Math.min(t.size[0],t.size[1]),r=this.area[this.offset+this.nadded],i=Math.max(this.maxarea,r),s=Math.min(this.minarea,r),l=this.totalarea+r,a=l/o,u=Math.max(a/(s/a),i/a/a);return u>this.asp?!1:(this.nadded++,this.maxarea=i,this.minarea=s,this.totalarea=l,this.asp=u,!0)}run(n,t){if(n===0)return;let o=Math.min(t.size[0],t.size[1]),r=this.area[this.offset];for(this.nadded=1,this.maxarea=r,this.minarea=r,this.totalarea=r,this.asp=Math.max(r/(o*o),o*o/r);this.tryAdd(n,t););let i=this.nadded,s=this.totalarea,l=this.commit(i,s,t);this.offset+=i,this.nadded=0,this.maxarea=0,this.minarea=1,this.totalarea=0,this.asp=1,this.run(n-i,l)}};function jk(e,n,t){let o=0;for(let i=0;i<e;i++)o+=n[i];if(o>t.size[0]*t.size[1]+.001)return null;let r=Array.from({length:e},()=>({x:[0,0],size:[0,0]}));return new Ob(n,r).run(e,t),r}var Hk=1,Zae=1e3;function Vk(e){let n=e.get("area"),t=n!==void 0?parseFloat(n):Hk;return(!isFinite(t)||t===0)&&(t=Hk),t*Zae}function eue(e){let n=e.get("inset");if(n===void 0)return 0;let t=parseFloat(n);return isFinite(t)?t:0}function nue(e,n){let t=2*n+Math.sqrt(e);return t*t}function tue(e){return{area:0,childArea:0,r:{x:[0,0],size:[0,0]},leftChild:null,rightSib:null,kind:"graph",ref:e,nChildren:0}}function oue(e){return{area:Vk(e.attrs),childArea:0,r:{x:[0,0],size:[0,0]},leftChild:null,rightSib:null,kind:"node",ref:e,nChildren:0}}function Uk(e,n){e.nChildren++,e.area+=n.area,e.first||(e.first=n),e.prev&&(e.prev.rightSib=n),e.prev=n}function rue(e,n,t){for(let o of e.info.clust??[])Uk(t,Xk(o,n))}function iue(e,n,t){let o=[...e.nodes.values()].sort((r,i)=>r.id-i.id);for(let r of o)n.has(r)||(Uk(t,oue(r)),n.set(r,e))}function sue(e,n,t){e.nChildren=t.nChildren,t.nChildren>0?(e.childArea=t.area,e.area=nue(t.area,eue(n.attrs))):e.area=Vk(n.attrs),e.leftChild=t.first}function Xk(e,n){let t=tue(e),o={first:null,prev:null,area:0,nChildren:0};return rue(e,n,o),iue(e,n,o),sue(t,e,o),t}function lue(e,n,t){let o=e-n,r=Math.sqrt(o*o+4*t);return(e+n-r)/2}function aue(e){let n=[],t=e.leftChild;for(;t!==null;)n.push(t),t=t.rightSib;return be(n,(o,r)=>o.area<r.area?1:o.area>r.area?-1:0),n}function uue(e){let n=e.r.size[1],t=e.r.size[0],o=lue(n,t,e.childArea);return{x:[e.r.x[0],e.r.x[1]],size:[t-o,n-o]}}function fue(e,n){for(let t=0;t<e.length;t++)e[t].r=n[t]}function due(e){let n=e.leftChild;for(;n!==null;)n.kind==="graph"&&$k(n),n=n.rightSib}function cue(e,n){let t=uue(e),o=jk(n.length,n.map(r=>r.area),t);o!==null&&(fue(n,o),due(e))}function $k(e){e.nChildren!==0&&cue(e,aue(e))}function pue(e){let n=e.leftChild;for(;n!==null;)Wk(n),n=n.rightSib;let t=e.ref,[o,r]=e.r.x,[i,s]=e.r.size;t.info.bb={ll:{x:o-i/2,y:r-s/2},ur:{x:o+i/2,y:r+s/2}}}function mue(e){let n=e.ref;n.info.coord={x:e.r.x[0],y:e.r.x[1]},n.info.width=W1(e.r.size[0]),n.info.height=W1(e.r.size[1]),n.info.ht=e.r.size[1],n.info.lw=e.r.size[0]/2,n.info.rw=e.r.size[0]/2}function Wk(e){e.kind==="graph"?pue(e):mue(e)}function xue(e){return e===e.root||e.name.toLowerCase().startsWith("cluster")?!0:Ne(e.attrs.get("cluster"))}function Yk(e,n){for(let t of e.subgraphs.values())xue(t)?(n.push(t),Jk(t)):Yk(t,n)}function Jk(e){let n=[];Yk(e,n),e.info.clust=n,e.info.n_cluster=n.length}function hue(e){let t=Xk(e,new Map),o=Math.sqrt(t.area+.1);t.r={x:[0,0],size:[o,o]},$k(t),Wk(t)}function bue(e){let n=e.nodeDefaults.has("fontsize");if(!n){for(let t of e.nodes.values())if(t.attrs.has("fontsize")||t.nodeDefaultsSnapshot?.has("fontsize")===!0){n=!0;break}}for(let t of e.nodes.values()){if(n){let s=L(t,e,"fontsize");(s===void 0||s==="")&&t.attrs.set("fontsize",(t.info.ht*.7).toFixed(3))}let{lw:o,rw:r,ht:i}=t.info;hi(t,e),t.info.lw=o,t.info.rw=r,t.info.ht=i}}function gue(e){if(!(e.nodes.size===0&&(e.info.n_cluster??0)===0)){sn(e,!1),e.nodeDefaults.set("shape","box");for(let n of e.nodes.values())n.attrs.set("shape","box"),n.nodeDefaultsSnapshot!==void 0&&n.nodeDefaultsSnapshot.set("shape","box");Jk(e),hue(e),bue(e),qe(e),Me(e)}}function yue(e){e.info.clust=void 0,e.info.n_cluster=void 0;for(let n of e.nodes.values())n.info.alg=void 0}var Kk={type:"patchwork",layout:gue,cleanup:yue};function jp(e,n,t){let o=t.obj,r=Ne(e.attrs.get("decorate")??"false")?e.info.spl:void 0;if(o===null){Ro(e.info.label,n,t),r&&Db(e.info.label,r,n,t),Ro(e.info.xlabel,n,t),r&&Db(e.info.xlabel,r,n,t),Ro(e.info.head_label,n,t),Ro(e.info.tail_label,n,t);return}let i=o.id??"",s={url:o.labelUrl,tooltip:o.labelTooltip,target:o.labelTarget,explicit:o.explicitLabelTooltip};zp(e.info.label,`${i}-label`,s,n,t,r),zp(e.info.xlabel,`${i}-label`,s,n,t,r),zp(e.info.head_label,`${i}-headlabel`,{url:o.headUrl,tooltip:o.headTooltip,target:o.headTarget,explicit:o.explicitHeadTooltip},n,t,void 0,7),zp(e.info.tail_label,`${i}-taillabel`,{url:o.tailUrl,tooltip:o.tailTooltip,target:o.tailTarget,explicit:o.explicitTailTooltip},n,t,void 0,6)}function zp(e,n,t,o,r,i,s){if(!e?.set)return;let l=t.url!==null||t.explicit;l&&e5(o,r,t.url,t.tooltip,t.target,n);let a=r.labelEmitOverride;s!==void 0&&(r.labelEmitOverride=s);try{Ro(e,o,r)}finally{r.labelEmitOverride=a}i&&Db(e,i,o,r),l&&o.endAnchor?.(r)}function Db(e,n,t,o){if(!e?.set||!/\S/.test(e.text??""))return;let r=e.dimen,i={x:e.pos.x+r.x/2,y:e.pos.y-r.y/2},s={x:i.x-r.x,y:i.y},l=Zc(n,e.pos),a=[i,s,l].map(u=>K(u,o));t.attachmentPolyline?.(a,e.fontcolor||"black",o)}function qk(e,n){n.write('<g id="'+Ke(n.idLayerPrefix()+Ds(e,n))+'" '+hP(e)+`>
68
- `),n.write("<title>"+Ke(e.name)+`</title>
69
- `)}function Qk(e){e.write(`</g>
70
- `)}var zb="black",Pue=1,Eue=.005,Bb=1e-5;function Fb(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}function vue(e,n){return Fb(e[n],e[n+1])+Fb(e[n+1],e[n+2])+Fb(e[n+2],e[n+3])}function Zk(e,n){let t=1-n,o=[e[0],e[1],e[2],e[3]],r=[o[0]],i=new Array(4);i[3]=o[3];for(let s=1;s<=3;s++){for(let l=0;l<=3-s;l++)o[l]={x:t*o[l].x+n*o[l+1].x,y:t*o[l].y+n*o[l+1].y};r.push(o[0]),i[3-s]=o[3-s]}return{left:r,right:i}}function eC(e,n){let t=(e.length-1)/3;if(t===1)return Zk(e,n);let o=[],r=0;for(let f=0;f<t;f++)o.push(vue(e,3*f)),r+=o[f];let i=n*r;r=0;let s=0;for(;s<t&&(r+=o[s],!(r>=i));s++);let l=o[s],a=(i-(r-l))/l,u=Zk(e.slice(3*s,3*s+4),a);return{left:e.slice(0,3*s).concat(u.left),right:u.right.concat(e.slice(3*s+4))}}function Sue(e,n,t){let o=t.obj,r=e.map(i=>K(i,t));t.write('<path fill="none" stroke="'+Ht(X(n))+'"'),o!==null&&Math.abs(o.penWidth-Pue)>=Eue&&ur(t,o.penWidth),o!==null&&dl(t,o.pen),t.write(' d="'),fr(t,r),t.write(`"/>
71
- `)}function wue(e,n,t,o){if(Math.abs(n.t)<Bb)return;let r=n.color??zb;if(t.left-=n.t,t.endColor=r,t.first){t.first=!1;let i=eC(e,n.t);o.push({color:r,points:i.left}),t.bzR=i.right,Math.abs(t.left)<Bb&&(t.done=!0)}else if(Math.abs(t.left)<Bb)o.push({color:r,points:t.bzR}),t.done=!0;else{let i=eC(t.bzR,n.t/(t.left+n.t));o.push({color:r,points:i.left}),t.bzR=i.right}}function jb(e,n){let t={left:1,first:!0,bzR:e,done:!1,endColor:zb},o=[];for(let r of n)if(wue(e,r,t,o),t.done)break;return{curves:o,endColor:t.endColor}}function Nue(e,n,t){let{curves:o,endColor:r}=jb(e,n);for(let i of o)Sue(i.points,i.color,t);return r}function nC(e,n,t){let o=nt(t).segs,r=o[0]?.color??zb,i=e.info.spl,s=r;if(i===void 0)return{firstColor:r,endColor:s};for(let l=0;l<i.size;l++){let a=i.list[l];a===void 0||a.size<4||(s=Nue(a.list,o,n))}return{firstColor:r,endColor:s}}var gt=e=>Math.PI*e/180,tC=(e,n,t)=>(1-e/n)*t/2,Rue=(e,n,t)=>e/n*t/2,oC=(e,n,t)=>t/2,Tue=(e,n,t)=>{let o=e/n;return o<=.5?o*t:(1-o)*t};function Hp(e,n){return e==="forward"?tC:e==="back"?Rue:e==="both"?Tue:e==="none"?oC:n?tC:oC}function rC(e,n){if(n===0&&e===0)return 0;let t=Math.atan2(e,n);return t>=0?t:t+2*Math.PI}function iC(e,n){return e<0||e>=n?-Math.floor(e/n)*n+e:e}function kue(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}function Cue(e,n){let t=[e[0].x,e[1].x,e[2].x,e[3].x],o=[e[0].y,e[1].y,e[2].y,e[3].y];for(let r=1;r<=3;r++)for(let i=0;i<=3-r;i++)t[i]=(1-n)*t[i]+n*t[i+1],o[i]=(1-n)*o[i]+n*o[i+1];return{x:t[0],y:o[0]}}function _ue(e){let n=[],t=e.list,o=e.size,r=(l,a)=>{n.push({x:l.x,y:l.y,lengthsofar:a,dir:0,lout:0,bevel:!1,dir2:0})};r(t[0],0);let i=[t[0],t[0],t[0],t[0]],s=0;for(let l=0;l+3<o;l+=3){i[0]=i[3];for(let u=1;u<=3;u++)i[u]=t[l+u];let a=i[0];for(let u=1;u<=20;u++){let f=Cue(i,u/20);s+=kue(a,f),r(f,s),a=f}}return n}function Aue(e,n,t,o,r){let i=t-o;i<0&&(i+=gt(360));let s=gt(90)-i/2,l=Math.cos(s)===0?0:r/Math.cos(s),a=t+gt(90)+s,u=a,f=!1;l>10*r&&(f=n!==e.length-1,l=r,a=iC(o-gt(90),gt(360)),u=iC(t+gt(90),gt(360))),e[n].dir=a,e[n].lout=l,e[n].bevel=f,e[n].dir2=u}function Gue(e,n,t,o){let r=e.length;for(let i=0;i<r;i++){let s=i===0?r-1:i-1,l=(i+1)%r,{x:a,y:u,lengthsofar:f}=e[i],d=rC(e[l].y-u,e[l].x-a),c=rC(e[s].y-u,e[s].x-a),m=t(f,n,o);if(i===0||i===r-1){let b=i===0?d+gt(90):c-gt(90);e[i].dir=b,e[i].lout=m,e[i].dir2=b}else Aue(e,i,d,c,m)}}function sC(e,n,t,o){e.push({x:n+t*Math.cos(o),y:n+t*Math.sin(o)})}function Mue(e){let n=[],t=e.length,o=0,r=0,i=0,s=0;for(let l=0;l<t;l++)({x:o,y:r,dir:i,lout:s}=e[l]),n.push({x:o+Math.cos(i)*s,y:r+Math.sin(i)*s}),e[l].bevel&&sC(n,o,s,e[l].dir2);i+=gt(180),n.push({x:o+Math.cos(i)*s,y:r+Math.sin(i)*s});for(let l=t-2;l>=0;l--){let a=e[l];o=a.x,r=a.y,i=a.dir+gt(180);let u=a.dir2+gt(180);s=a.lout,n.push({x:o+Math.cos(u)*s,y:r+Math.sin(u)*s}),a.bevel&&sC(n,o,s,i)}return n}function Vp(e,n,t){let o=_ue(e),r=o[o.length-1].lengthsofar;return Gue(o,r,n,t),Mue(o)}var Lue="1.7",Hb=1e15,Iue=.005,Oue=8,Due=new Set(["filled","bold","rounded","diagonals","striped","wedged","invis","invisible","radial"]);function Bue(e){let n=e.indexOf(".");if(n<0)return e;let t=e.length;for(;t>n+1&&e[t-1]==="0";)t--;e[t-1]==="."&&t--;let o=e.slice(0,t);return o.startsWith("0.")?o.slice(1):o.startsWith("-0.")?"-"+o.slice(2):o}function et(e){return Math.abs(e)>Hb?e<0?String(-Hb):String(Hb):Math.abs(e)<Iue?"0":Bue(e.toFixed(3))}function lC(){let e=Array.from({length:Oue+4},()=>[]);return e[8]=e[1],e[9]=e[1],e[10]=e[5],e[11]=e[5],e}function Ve(e){let n=g0(e);if(n.indexOf(".")>=0){let t=n.length;for(;t>0&&n[t-1]==="0";)t--;n[t-1]==="."&&t--,n=n.slice(0,t)}return n==="-0"?"0":n}function Up(e){return Ve(e.x)+" "+Ve(e.y)+" "}function yt(e,n){let t=e+" "+String(n.length)+" ";for(let o of n)t+=Up(o);return t}function wf(e){let n=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);o<128?n+=1:o<2048?n+=2:o>=55296&&o<=56319?(n+=4,t++):n+=3}return n}function Br(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Xp(e){if(e.type==="rgba")return[Br(e.r),Br(e.g),Br(e.b),Br(e.a)];if(e.type==="none")return[255,255,254,0];let n={type:"rgba",r:0,g:0,b:0,a:0};return Qf(e.type==="string"?e.s:"",n,"rgba"),n.type==="rgba"?[Br(n.r),Br(n.g),Br(n.b),Br(n.a)]:[0,0,0,255]}function cC(e){let n=o=>o.toString(16).padStart(2,"0"),t="#"+n(e[0])+n(e[1])+n(e[2]);return e[3]===255?"7 -"+t:"9 -"+t+n(e[3])}function pC(e,n){return e+cC(n)+" "}function aC(e,n,t,o,r){let{g0:i,g1:s}=Ec(e,r*Math.PI/180,!1,!0),l="["+Ve(i.x)+" "+Ve(i.y)+" "+Ve(s.x)+" "+Ve(s.y)+" 2 "+mC(n,t,o)+"]";return"C "+String(wf(l))+" -"+l+" "}function mC(e,n,t){let o=Xp(e),r=Xp(n);return(t>0?[[t,o],[t,r]]:[[0,o],[1,r]]).map(([s,l])=>Xb(s)+" "+cC(l)).join(" ")}function uC(e,n,t,o,r){let i=r*Math.PI/180,s=Ec(e,i,!0,!0),l=s.g0.x,a=s.g0.y,u=s.g1.x,f=s.g1.y,d=r===0?l:l+u*Math.cos(i),c=r===0?a:a+u*Math.sin(i),m="("+Ve(d)+" "+Ve(c)+" "+Ve(u)+" "+Ve(l)+" "+Ve(a)+" "+Ve(f)+" 2 "+mC(n,t,o)+")";return"C "+String(wf(m))+" -"+m+" "}function Ki(e){return pC("c ",Xp(e))}function Ef(e){return pC("C ",Xp(e))}function Fue(e,n){return"F "+Ve(e>0?e:0)+" "+String(wf(n))+" -"+n+" "}function ta(e,n){return e+String(wf(n))+" -"+n+" "}function oa(e){return/^[A-Za-z_][A-Za-z_0-9]*$/.test(e)||/^-?(\.[0-9]+|[0-9]+(\.[0-9]*)?)$/.test(e)?e:'"'+e.replace(/"/g,'\\"')+'"'}function de(e){if(!Number.isFinite(e))return String(e);if(e===0)return"0";let n=t3(e,5),t=n.indexOf("e");if(t>=0){let o=n.slice(0,t);o.indexOf(".")>=0&&(o=o.replace(/0+$/,"").replace(/\.$/,""));let r=parseInt(n.slice(t+1),10);return o+"e"+(r<0?"-":"+")+String(Math.abs(r)).padStart(2,"0")}return n.indexOf(".")>=0&&(n=n.replace(/0+$/,"").replace(/\.$/,"")),n}function fC(e){return $f(e,2)}function ra(e){return de(e.x)+","+de(e.y)}function zue(e){return e.info.edge_type!==$n&&e.info.spl!=null}function xC(e,n,t){let o=e.info.coord;n.n_flds===0&&t.push(de(n.b.ll.x+o.x)+","+de(n.b.ll.y+o.y)+","+de(n.b.ur.x+o.x)+","+de(n.b.ur.y+o.y));for(let r=0;r<n.n_flds;r++)xC(e,n.fld[r],t)}function zt(e,n){let t=e.get(n);return t===void 0||t.length===0?[]:[n+'="'+gC(t)+'"']}function dC(e){return e.length===0?"":" "+e.join(" ")}function Vb(e){let n=e.info.label;return!n||n.text.length===0?[...zt(e.attrs,"lp"),...zt(e.attrs,"lwidth"),...zt(e.attrs,"lheight")]:['lp="'+ra(n.pos)+'"',"lwidth="+fC(n.dimen.x/De),"lheight="+fC(n.dimen.y/De)]}function jue(e){let n=e.info,t=et(n.coord.x),o=et(n.coord.y),r=et(n.width),i=et(n.height),s=[`pos="${t},${o}"`,`width=${r}`,`height=${i}`];return e.attrs.forEach((l,a)=>{a!=="pos"&&a!=="width"&&a!=="height"&&s.push(`${a}="${l}"`)}),s.join(" ")}function hC(e){let n=e.info.spl;if(!n||n.list.length===0||e.info.edge_type===$n)return"";let t=[];for(let o of n.list){o.sflag&&t.push("s,"+de(o.sp.x)+","+de(o.sp.y)),o.eflag&&t.push("e,"+de(o.ep.x)+","+de(o.ep.y));let r=o.list.slice(0,o.size);for(let i of r)t.push(de(i.x)+","+de(i.y))}return'pos="'+t.join(" ")+'"'}function bC(e){return e?"->":"--"}function qi(e){return e.kind==="directed"||e.kind==="strict-directed"}function Hue(e,n){let t=qi(e)?"digraph":"graph";n.write(t+" "+e.name+` {
72
- `);let o=e.info.bb,r=et(o.ll.x)+","+et(o.ll.y)+","+et(o.ur.x)+","+et(o.ur.y);n.write(' graph [bb="'+r+`"];
73
- `)}var Ub=class{type="dot";quality=0;beginGraph(n,t){Hue(n,t)}endGraph(n,t){t.write(`}
74
- `)}beginNode(n,t){}endNode(n,t){let o=jue(n);t.write(" "+n.name+" ["+o+`];
75
- `)}beginEdge(n,t){}endEdge(n,t){let o=qi(n.tail.root),r=bC(o),i=hC(n),s=i?" ["+i+"]":"";t.write(" "+n.tail.name+" "+r+" "+n.head.name+s+`;
76
- `)}textspan(n,t,o){}ellipse(n,t,o,r,i){}polygon(n,t,o){}bezier(n,t,o){}polyline(n,t){}};function vf(e){return e.replace(/\\/g,"\\\\")}function Vue(e,n){if(e[n]!=="\\")return!1;let t=e[n+1];return t==="E"||t==="G"||t==="H"||t==="L"||t==="N"||t==="T"||t==="l"||t==="n"||t==="r"||t==="\\"||t==='"'}function gC(e){let n="",t=!1;for(let o=0;o<e.length;o++){let r=e[o];r==='"'&&!t?n+="\\":!t&&Vue(e,o)?t=!0:t=!1,n+=r}return n}function Xb(e){let n=e.toFixed(3);if(n.indexOf(".")<0)return n;let t=n.length;for(;t>0&&n[t-1]==="0";)t--;return n[t-1]==="."&&t--,n.slice(0,t)}var Sf=class{type="xdot";quality=0;bufs=lC();penwidth=new Array(12).fill(1);textflags=new Array(12).fill(0);draws=new Map;clusters=[];edgeDrawable=!0;beginGraph(n,t){this.bufs=lC(),this.penwidth=new Array(12).fill(1),this.textflags=new Array(12).fill(0),this.draws=new Map,this.clusters=[]}drawStringsByObject(){return this.draws}endGraph(n,t){let o=this.flush(0),r=this.flush(4);if(o||r){let i=this.drawsFor(n);o&&(i.draw=o),r&&(i.ldraw=vf(r))}t.write(this.serialize(n))}pageBackground(n,t){let o=n.attrs.get("bgcolor"),r=o!==void 0&&o!==""?o:"white";r==="transparent"&&(r="white");let i=n.attrs.get("pad"),s=i!==void 0&&i!==""?Mc(i):{x:0,y:0},l=t.bb,a=[{x:l.ll.x-s.x,y:l.ll.y-s.y},{x:l.ll.x-s.x,y:l.ur.y+s.y},{x:l.ur.x+s.x,y:l.ur.y+s.y},{x:l.ur.x+s.x,y:l.ll.y-s.y}],u=this.bufs[0];u.push(Ki(X("transparent")));let f=r.includes(":")?ba(r):null;if(f!==null){let d=Number(n.attrs.get("gradientangle")??0)||0,m=ce(n.attrs.get("style")).radial?uC:aC;u.push(m(a,X(f.fillColor),X(f.stopColor),f.frac,d))}else u.push(Ef(X(r)));u.push(yt("P",a))}beginNode(n,t){}endNode(n,t){let o=this.flush(8),r=this.flush(10);if(o||r){let i=this.drawsFor(n);o&&(i.draw=o),r&&(i.ldraw=vf(r))}this.resetState(8,10)}beginEdge(n,t){this.edgeDrawable=$b(n,t.bb);let o=n.info.spl;if(!this.edgeDrawable||o===void 0)return;let r=this.bufs[9],i=n.attrs.get("color")??"",s=(i.match(/:/g)??[]).length,l=(i.match(/;/g)??[]).length,a,u;if(l>0&&s>0){let f=this.emitSplitSpline(o.list,i,r,t);a=f.firstColor,u=f.endColor}else if($p(n))this.emitTaperedSpline(n,o.list[0],r,t);else if(s>0)this.emitParallelSpline(o.list,i,s,r,t);else{let f=_c(n,t),d=t.obj,c=d!==null?[...d.rawStyle]:[],m=o.list.length>1;for(let b of o.list){let g=b.list.slice(0,b.size),E=f!==null&&b.size>=4?Nc(g,f):[];if(E.length>0)for(let R of E)r.push(this.styleOp(t),this.penOp(t),yt("L",R));else r.push(this.styleOp(t),this.penOp(t),yt("B",g));d!==null&&m&&(b.sflag||b.eflag)&&(d.rawStyle=c.length>0?c:["solid"])}d!==null&&(d.rawStyle=c)}this.emitArrows(this.bufs[2],n.info.tailArrowOps,t,2,a),this.emitArrows(this.bufs[3],n.info.headArrowOps,t,3,u)}emitTaperedSpline(n,t,o,r){if(t===void 0)return;let i=Hp(n.attrs.get("dir"),qi(n.tail.root)),s=Vp(t,i,r.obj?.penWidth??1),l=r.obj?.penColor??{type:"string",s:"black"};o.push(this.styleOp(r)),o.push(Ki(X("transparent"))),o.push(Ef(l)),o.push(yt("P",s))}emitSplitSpline(n,t,o,r){let i=nt(t).segs,s=i[0]?.color??"black",l=s;for(let a of n){if(a===void 0||a.size<4)continue;let u=jb(a.list.slice(0,a.size),i);l=u.endColor;for(let f of u.curves)o.push(this.styleOp(r),Ki(X(f.color)),yt("B",f.points))}return{firstColor:s,endColor:l}}emitParallelSpline(n,t,o,r,i){let s=n.map(a=>a!==void 0&&a.size>=4?Rc(a.list,(2+o)/2):{offlist:[],tmplist:[]}),l=nt(t).segs.map(a=>a.color??"black");for(let a of l){let u=Ki(X(a));for(let f of s)f.offlist.length!==0&&(Tc(f.tmplist,f.offlist),r.push(this.styleOp(i),u,yt("B",f.tmplist)))}}emitArrows(n,t,o,r,i){if(t===void 0)return;let s=i!==void 0?X(i):o.obj?.penColor??{type:"string",s:"black"},l=o.obj?.penWidth??1;for(let a of t)switch(Math.abs(l-this.penwidth[r])>=5e-4&&(this.penwidth[r]=l,n.push(ta("S ","setlinewidth("+Xb(l)+")"))),n.push(ta("S ","solid")),n.push(Ki(s)),a.kind){case"polygon":a.filled&&n.push(Ef(s)),n.push(yt(a.filled?"P":"p",a.points));break;case"ellipse":a.filled&&n.push(Ef(s)),n.push((a.filled?"E ":"e ")+Up(a.center)+Ve(a.rx)+" "+Ve(a.ry)+" ");break;case"polyline":n.push(yt("L",a.points));break;case"bezier":n.push(yt("B",a.points));break}}endEdge(n,t){if(!this.edgeDrawable){this.resetState(9,11),this.resetState(3,2),this.penwidth[7]=1,this.penwidth[6]=1;return}jp(n,this,t);let o=this.flush(9),r=this.flush(3),i=this.flush(2),s=this.flush(11),l=this.flush(7),a=this.flush(6);if(o||r||i||s||l||a){let u=this.drawsFor(n);o&&(u.draw=o),r&&(u.hdraw=r),i&&(u.tdraw=i),s&&(u.ldraw=vf(s)),l&&(u.hldraw=vf(l)),a&&(u.tldraw=vf(a))}this.resetState(9,11),this.resetState(3,2),this.penwidth[7]=1,this.penwidth[6]=1,this.textflags[7]=0,this.textflags[6]=0}beginCluster(n,t){}endCluster(n,t){let o=this.flush(1),r=this.flush(5);if(o||r){let i=this.drawsFor(n);o&&(i.draw=o),r&&(i.ldraw=r)}this.clusters.push(n),this.resetState(1,5)}textspan(n,t,o){let r=this.getBuf(o),i=o.obj!==null?o.obj.emitState:0,s=t.just==="l"?-1:t.just==="r"?1:0,l={x:n.x,y:n.y+t.yoffset_centerline};r.push(Fue(t.fontSize,t.fontName??"")),r.push(Ki(X(t.fontColor??"black")));let a=(t.fontFlags??0)&127;this.textflags[i]!==a&&(r.push("t "+String(a)+" "),this.textflags[i]=a),r.push("T "+Up(l)+String(s)+" "+Ve(t.size.x)+" "+String(wf(t.str))+" -"+t.str+" ")}ellipse(n,t,o,r,i){let s=this.getBuf(i);s.push(this.styleOp(i),this.penOp(i)),r&&s.push(this.fillOp(i,[n,{x:n.x+t,y:n.y+o}])),s.push(r?"E ":"e ",Up(n),Ve(t)+" "+Ve(o)+" ")}polygon(n,t,o){let r=this.getBuf(o);r.push(this.styleOp(o),this.penOp(o)),t&&r.push(this.fillOp(o,n)),r.push(yt(t?"P":"p",n))}bezier(n,t,o){let r=this.getBuf(o);r.push(this.styleOp(o),this.penOp(o)),t&&r.push(this.fillOp(o,n)),r.push(yt(t?"b":"B",n))}polyline(n,t){this.getBuf(t).push(this.styleOp(t),this.penOp(t),yt("L",n))}penOp(n){return Ki(n.obj?.penColor??{type:"string",s:"black"})}fillOp(n,t){let o=n.obj;return o&&o.fill===2?aC(t,o.fillColor,o.stopColor,o.gradientFrac,o.gradientAngle):o&&o.fill===3?uC(t,o.fillColor,o.stopColor,o.gradientFrac,o.gradientAngle):Ef(o?.fillColor??{type:"string",s:"black"})}styleOp(n){let t=n.obj;if(t===null)return"";let o="",r=t.emitState;if(Math.abs(t.penWidth-this.penwidth[r])>=5e-4&&(this.penwidth[r]=t.penWidth,o+=ta("S ","setlinewidth("+Xb(t.penWidth)+")")),t.rawStyle.length>0)for(let i of t.rawStyle)Due.has(i)||i.startsWith("setlinewidth")||(o+=ta("S ",i));else t.pen===1?o+=ta("S ","dashed"):t.pen===2&&(o+=ta("S ","dotted"));return o}getBuf(n){let t=n.obj;return this.bufs[t!==null?t.emitState:0]}flush(n){let t=this.bufs[n],o=t.join("");return t.length=0,o}resetState(n,t){this.penwidth[n]=1,this.penwidth[t]=1,this.textflags[n]=0,this.textflags[t]=0}drawsFor(n){let t=this.draws.get(n);return t===void 0&&(t={},this.draws.set(n,t)),t}drawAttr(n,t){return n+'="'+gC(t)+'"'}bbStr(n){let t=n.info.bb;return de(t.ll.x)+","+de(t.ll.y)+","+de(t.ur.x)+","+de(t.ur.y)}serialize(n){let t={out:[],preorder:new Map,nodeLW:new Map,edgeLW:new Map,attrsWritten:new Set,level:0};return this.subgdfs(n,1,t.preorder),this.writeHdr(n,!0,t),this.writeBody(n,t),this.writeTrl(t),t.out.join("")}subgdfs(n,t,o){let r=t;o.set(n,r);for(let i of n.subgraphs.values())r=this.subgdfs(i,r,o);return r+1}isAnonymous(n){return n.name.length===0||n.name.charCodeAt(0)===37}hasBb(n){return n===n.root||this.clusters.includes(n)}irrelevantSubgraph(n){if(!this.isAnonymous(n)||this.clusters.includes(n)||n.nodeDefaults.size>0||n.edgeDefaults.size>0)return!1;if(n.parent){if(this.hasBb(n)!==this.hasBb(n.parent))return!1;for(let[t,o]of n.attrs)if(n.parent.attrs.get(t)!==o)return!1}else if(n.attrs.size>0)return!1;return!0}subgGraphAttrs(n){if(this.clusters.includes(n))return this.clusterAttrs(n);let t=[],o=n.attrs.get("rank");return o!==void 0&&t.push("rank="+oa(o)),t.push(...zt(n.attrs,"bb")),t.push(...Vb(n)),t.join(" ")}indent(n){return" ".repeat(n.level)}writeHdr(n,t,o){if(t){let r=n.kind==="strict-directed"||n.kind==="strict-undirected"?"strict ":"",i=qi(n)?"digraph":"graph",s=n.name.length>0&&!this.isAnonymous(n)?oa(n.name)+" ":"";o.out.push(r+i+" "+s+`{
77
- `),o.level++,o.out.push(this.indent(o)+"graph ["+this.graphAttrs(n)+`];
78
- `),o.out.push(this.indent(o)+`node [label="\\N"];
79
- `)}else{let r=this.isAnonymous(n)?"":"subgraph "+oa(n.name)+" ";o.out.push(this.indent(o)+r+`{
80
- `),o.level++;let i=this.subgGraphAttrs(n);i&&o.out.push(this.indent(o)+"graph ["+i+`];
81
- `)}}writeTrl(n){n.level--,n.out.push(this.indent(n)+`}
82
- `)}writeSubgs(n,t){for(let o of n.subgraphs.values())this.irrelevantSubgraph(o)?this.writeSubgs(o,t):(this.writeHdr(o,!1,t),this.writeBody(o,t),this.writeTrl(t))}writeBody(n,t){this.writeSubgs(n,t);for(let o of n.nodes.values()){this.writeNodeTest(n,o,t)&&this.writeNode(n,o,t);let r=o;for(let i of o.outEdges(n))r!==i.head&&this.writeNodeTest(n,i.head,t)&&(this.writeNode(n,i.head,t),r=i.head),this.writeEdgeTest(n,i,t)&&this.writeEdge(n,i,t)}}writeNodeTest(n,t,o){return(o.nodeLW.get(t)??0)<o.preorder.get(n)}writeEdgeTest(n,t,o){return(o.edgeLW.get(t)??0)<o.preorder.get(n)}writeNode(n,t,o){let r=this.indent(o)+oa(t.name);o.attrsWritten.has(t)||(r+=" ["+this.nodeAttrs(t)+"]",o.attrsWritten.add(t)),o.out.push(r+`;
83
- `),o.nodeLW.set(t,o.preorder.get(n))}writeEdge(n,t,o){let r=bC(qi(n)),i=this.indent(o)+oa(t.tail.name)+" "+r+" "+oa(t.head.name);if(!o.attrsWritten.has(t)){let s=this.edgeAttrStr(t);s&&(i+=" ["+s+"]"),o.attrsWritten.add(t)}o.out.push(i+`;
84
- `),o.edgeLW.set(t,o.preorder.get(n))}graphAttrs(n){let t=this.draws.get(n),o=[];return t?.draw&&o.push(this.drawAttr("_draw_",t.draw)),t?.ldraw&&o.push(this.drawAttr("_ldraw_",t.ldraw)),o.push('bb="'+this.bbStr(n)+'"'),o.push(...Vb(n)),o.push('xdotversion="'+Lue+'"'),o.join(" ")}clusterAttrs(n){let t=this.draws.get(n),o=[this.drawAttr("_draw_",t?.draw??"")];return t?.ldraw&&o.push(this.drawAttr("_ldraw_",t.ldraw)),n.info.bb&&o.push('bb="'+this.bbStr(n)+'"'),o.push(...Vb(n)),o.join(" ")}nodeAttrs(n){let t=n.info,o='pos="'+de(t.coord.x)+","+de(t.coord.y)+'" width='+de((t.lw+t.rw)/72)+" height="+de(t.ht/72),r=t.xlabel;if(r&&r.set?o+=' xlp="'+ra(r.pos)+'"':o+=dC(zt(n.attrs,"xlp")),t.shape?.name==="record"){let l=[];xC(n,t.shape_info,l),o+=' rects="'+l.join(" ")+'"'}else o+=dC(zt(n.attrs,"rects"));let s=this.draws.get(n);return s?.draw&&(o+=" "+this.drawAttr("_draw_",s.draw)),s?.ldraw&&(o+=" "+this.drawAttr("_ldraw_",s.ldraw)),o}edgeAttrStr(n){let t=this.draws.get(n),o=[];t?.draw&&o.push(this.drawAttr("_draw_",t.draw)),t?.ldraw&&o.push(this.drawAttr("_ldraw_",t.ldraw)),t?.hdraw&&o.push(this.drawAttr("_hdraw_",t.hdraw)),t?.tdraw&&o.push(this.drawAttr("_tdraw_",t.tdraw)),t?.hldraw&&o.push(this.drawAttr("_hldraw_",t.hldraw)),t?.tldraw&&o.push(this.drawAttr("_tldraw_",t.tldraw));let r=hC(n);r?o.push(r):o.push(...zt(n.attrs,"pos"));let i=zue(n),s=n.info;return i&&s.label?o.push('lp="'+ra(s.label.pos)+'"'):o.push(...zt(n.attrs,"lp")),i&&s.xlabel&&s.xlabel.set?o.push('xlp="'+ra(s.xlabel.pos)+'"'):o.push(...zt(n.attrs,"xlp")),i&&s.head_label?o.push('head_lp="'+ra(s.head_label.pos)+'"'):o.push(...zt(n.attrs,"head_lp")),i&&s.tail_label?o.push('tail_lp="'+ra(s.tail_label.pos)+'"'):o.push(...zt(n.attrs,"tail_lp")),o.join(" ")}};function yC(){return new Ub}function PC(){return new Sf}function $p(e){let n=e.attrs.get("style");return n===void 0||n===""?!1:n.split(",").some(t=>t.trim()==="tapered")}function EC(e,n){let t=e.info.spl,o=n.obj;if(t===void 0||t.list.length===0||o===null)return;let r=t.list[0],i=Hp(e.attrs.get("dir"),qi(e.tail.root)),s=Vp(r,i,o.penWidth).map(u=>K(u,n)),l=o.penColor,a=o.fillColor;o.fillColor=l,o.penColor={type:"string",s:"transparent"},Cc(s,!0,n),o.penColor=l,o.fillColor=a,Ac(e,n)}function vC(e,n,t,o){let r=n.obj,i=r!==null?r.penWidth:1,s=e.info.tailArrowOps;s?.length&&Qt(s,o,n,i,Vt(X(o)));let l=e.info.headArrowOps;l?.length&&Qt(l,t,n,i,Vt(X(t)))}function Uue(e,n){let t=e.dimen.x/2,o=e.dimen.y/2,r={ll:{x:e.pos.x-t,y:e.pos.y-o},ur:{x:e.pos.x+t,y:e.pos.y+o}};return Uf(n,r)}function $b(e,n){let t=e.info;return t.spl!==void 0||t.label!==void 0&&t.label.set&&Uue(t.label,n)||t.xlabel!==void 0||t.head_label!==void 0||t.tail_label!==void 0}var Wb=class{type="svg";quality=0;edgeGroupOpen=!1;beginGraph(n,t){Im(n,t)}endGraph(n,t){jm(t)}beginPage(n,t){Om(n,t)}pageBackground(n,t){Dm(n,t)}endPage(n,t){Bm(t)}beginLayer(n,t){Fm(n,t)}endLayer(n){zm(n)}beginNode(n,t){w7(n,t)}endNode(n,t){N7(t)}beginEdge(n,t){this.edgeGroupOpen=$b(n,t.bb),this.edgeGroupOpen&&R7(n,t)}endEdge(n,t){if(!this.edgeGroupOpen)return;this.edgeGroupOpen=!1;let o=du(this,t),r=n.attrs.get("color")??"",i=(r.match(/:/g)??[]).length;if((r.match(/;/g)??[]).length>0&&i>0){let{firstColor:l,endColor:a}=nC(n,t,r);vC(n,t,a,l)}else if($p(n))EC(n,t);else if(i>0){let{headColor:l,tailColor:a}=Um(n,t,r);vC(n,t,l,a)}else{let l=_c(n,t);l!==null?(O7(n,l,t),Ac(n,t)):L7(n,t)}o&&this.endAnchor(t),jp(n,this,t),T7(t)}beginAnchor(n,t,o,r,i){k7(n,t,o,r,i)}endAnchor(n){C7(n)}textspan(n,t,o){_7(n,t,o)}ellipse(n,t,o,r,i){A7(n,t,o,r,i)}polygon(n,t,o){Cc(n,t,o)}bezier(n,t,o){G7(n,t,o)}polyline(n,t){Km(n,t)}attachmentPolyline(n,t,o){o.write('<polyline fill="none" stroke="'+Ht(X(t))+'" points="'),gi(o,n),o.write(`"/>
85
- `)}usershape(n,t,o){let r=u=>String(parseFloat(u.toPrecision(6))),i=t.ur.x-t.ll.x,s=t.ur.y-t.ll.y,l=(t.ur.x+t.ll.x-i)/2,a=(t.ur.y+t.ll.y+s)/2;o.write('<image xlink:href="'+Je(n)+'" width="'+r(i)+'px" height="'+r(s)+'px" preserveAspectRatio="xMinYMin meet" x="'+r(l)+'" y="'+r(-a)+`"/>
86
- `)}comment(n,t){M7(n,t)}beginLabel(n,t){}endLabel(n){}beginCluster(n,t){qk(n,t)}endCluster(n,t){Qk(t)}};function SC(){return new Wb}var Yb=class e{static isWs(n){return n===" "||n===" "||n===`
87
- `||n==="\r"}static skipWs(n,t){for(;t<n.length&&e.isWs(n[t]);)t++;return t}static consumeDigits(n,t){for(;t<n.length&&n[t]>="0"&&n[t]<="9";)t++;return t}static consumeExponent(n,t){return t<n.length&&(n[t]==="e"||n[t]==="E")&&(t++,t<n.length&&(n[t]==="+"||n[t]==="-")&&t++,t=e.consumeDigits(n,t)),t}static parseReal(n,t){let o=e.skipWs(n,t),r=o;o<n.length&&(n[o]==="-"||n[o]==="+")&&o++;let i=o;return o=e.consumeDigits(n,o),o<n.length&&n[o]==="."&&(o++,o=e.consumeDigits(n,o)),o=e.consumeExponent(n,o),o===r||o===i?null:{val:parseFloat(n.slice(r,o)),pos:o}}static parseInt_(n,t){let o=e.skipWs(n,t),r=o;o<n.length&&(n[o]==="-"||n[o]==="+")&&o++;let i=o;return o=e.consumeDigits(n,o),o===i?null:{val:parseInt(n.slice(r,o),10),pos:o}}static parseUInt_(n,t){let o=e.skipWs(n,t),r=o,i=e.consumeDigits(n,o);return i===r?null:{val:parseInt(n.slice(r,i),10),pos:i}}static parseRect(n,t){let o=e.parseReal(n,t);if(!o)return null;let r=e.parseReal(n,o.pos);if(!r)return null;let i=e.parseReal(n,r.pos);if(!i)return null;let s=e.parseReal(n,i.pos);return s?{val:{x:o.val,y:r.val,w:i.val,h:s.val},pos:s.pos}:null}static parsePoint(n,t){let o=e.parseReal(n,t);if(!o)return null;let r=e.parseReal(n,o.pos);return r?{val:{x:o.val,y:r.val,z:0},pos:r.pos}:null}static parsePolyline(n,t){let o=e.parseUInt_(n,t);if(!o)return null;let r=o.pos,i=[];for(let s=0;s<o.val;s++){let l=e.parsePoint(n,r);if(!l)return null;i.push(l.val),r=l.pos}return{val:{pts:i},pos:r}}static cpByteLen(n){return n<128?1:n<2048?2:n<65536?3:4}static parseString(n,t){let o=e.parseInt_(n,t);if(!o||o.val<=0)return null;let r=o.val,i=e.skipWs(n,o.pos);if(n[i]!=="-")return null;i++;let s="",l=0,a=0;for(;l<r&&!(i+a>=n.length);){let u=n[i+a],f=a>0?n[i+a-1]:"";if(s+=u,u==="\\"&&f!=="\\"){a++;continue}let d=n.codePointAt(i+a);l+=e.cpByteLen(d),d>65535&&(s+=n[i+a+1],a++),a++}return{val:s,pos:i+a}}static parseAlign(n,t){let o=e.parseInt_(n,t);return o?{val:o.val<0?"left":o.val>0?"right":"center",pos:o.pos}:null}static parseStops(n,t,o){let r=t,i=[];for(let s=0;s<o;s++){let l=e.parseReal(n,r);if(!l)return null;let a=e.parseString(n,l.pos);if(!a)return null;i.push({frac:l.val,color:a.val}),r=a.pos}return{stops:i,pos:r}}static linGradient(n,t){let o=e.parseReal(n,t);if(!o)return null;let r=e.parseReal(n,o.pos);if(!r)return null;let i=e.parseReal(n,r.pos);if(!i)return null;let s=e.parseReal(n,i.pos);if(!s)return null;let l=e.parseInt_(n,s.pos);if(!l)return null;let a=e.parseStops(n,l.pos,l.val);return a?{x0:o.val,y0:r.val,x1:i.val,y1:s.val,stops:a.stops}:null}static radGradient(n,t){let o=e.parseReal(n,t);if(!o)return null;let r=e.parseReal(n,o.pos);if(!r)return null;let i=e.parseReal(n,r.pos);if(!i)return null;let s=e.parseReal(n,i.pos);if(!s)return null;let l=e.parseReal(n,s.pos);if(!l)return null;let a=e.parseReal(n,l.pos);if(!a)return null;let u=e.parseInt_(n,a.pos);if(!u)return null;let f=e.parseStops(n,u.pos,u.val);return f?{x0:o.val,y0:r.val,r0:i.val,x1:s.val,y1:l.val,r1:a.val,stops:f.stops}:null}static isAlnum(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"}static parseXDotColorAt(n,t){let o=t<n.length?n[t]:"";if(o==="["){let r=e.linGradient(n,t+1);return r?{val:{type:"linear",ling:r},pos:t}:null}if(o==="("){let r=e.radGradient(n,t+1);return r?{val:{type:"radial",ring:r},pos:t}:null}return o==="#"||o==="/"||e.isAlnum(o)?{val:{type:"none",clr:n.slice(t)},pos:t}:null}static parseEllipseOp(n,t,o,r){let i=e.parseRect(t,o);if(!i)return"error";let s={kind:n==="E"?"filled_ellipse":"unfilled_ellipse",ellipse:i.val};return r.ellipse?.(s,0),{op:s,pos:i.pos}}static parsePolygonOp(n,t,o,r){let i=e.parsePolyline(t,o);if(!i)return"error";let s={kind:n==="P"?"filled_polygon":"unfilled_polygon",polygon:i.val};return r.polygon?.(s,0),{op:s,pos:i.pos}}static parseBezierOp(n,t,o,r){let i=e.parsePolyline(t,o);if(!i)return"error";let s={kind:n==="b"?"filled_bezier":"unfilled_bezier",bezier:i.val};return r.bezier?.(s,0),{op:s,pos:i.pos}}static parsePolylineOp(n,t,o){let r=e.parsePolyline(n,t);if(!r)return"error";let i={kind:"polyline",polyline:r.val};return o.polyline?.(i,0),{op:i,pos:r.pos}}static parseTextOp(n,t,o){let r=e.parseReal(n,t);if(!r)return"error";let i=e.parseReal(n,r.pos);if(!i)return"error";let s=e.parseAlign(n,i.pos);if(!s)return"error";let l=e.parseReal(n,s.pos);if(!l)return"error";let a=e.parseString(n,l.pos);if(!a)return"error";let f={kind:"text",text:{x:r.val,y:i.val,align:s.val,width:l.val,text:a.val}};return o.text?.(f,0),{op:f,pos:a.pos}}static parseColorOp(n,t,o,r){let i=e.parseString(t,o);if(!i)return"error";let s=e.parseXDotColorAt(i.val,0);if(!s)return"error";let l=s.val;if(l.type==="none"){let u={kind:n==="C"?"fill_color":"pen_color",color:l.clr};return(n==="C"?r.fill_color:r.pen_color)?.(u,0),{op:u,pos:i.pos}}let a={kind:n==="C"?"grad_fill_color":"grad_pen_color",gradColor:l};return r.grad_color?.(a,0),{op:a,pos:i.pos}}static parseFontOp(n,t,o){let r=e.parseReal(n,t);if(!r)return"error";let i=e.parseString(n,r.pos);if(!i)return"error";let s={kind:"font",font:{size:r.val,name:i.val}};return o.font?.(s,0),{op:s,pos:i.pos}}static parseStyleOp(n,t,o){let r=e.parseString(n,t);if(!r)return"error";let i={kind:"style",style:r.val};return o.style?.(i,0),{op:i,pos:r.pos}}static parseImageOp(n,t,o){let r=e.parseRect(n,t);if(!r)return"error";let i=e.parseString(n,r.pos);if(!i)return"error";let s={kind:"image",image:{pos:r.val,name:i.val}};return o.image?.(s,0),{op:s,pos:i.pos}}static parseFontcharOp(n,t,o){let r=e.parseUInt_(n,t);if(!r)return"error";let i={kind:"fontchar",fontchar:r.val};return o.fontchar?.(i,0),{op:i,pos:r.pos}}static parseShapeOp(n,t,o,r){return n==="E"||n==="e"?e.parseEllipseOp(n,t,o,r):n==="P"||n==="p"?e.parsePolygonOp(n,t,o,r):n==="b"||n==="B"?e.parseBezierOp(n,t,o,r):n==="L"?e.parsePolylineOp(t,o,r):null}static parseMetaOp(n,t,o,r){return n==="T"?e.parseTextOp(t,o,r):n==="C"||n==="c"?e.parseColorOp(n,t,o,r):n==="F"?e.parseFontOp(t,o,r):n==="S"?e.parseStyleOp(t,o,r):n==="I"?e.parseImageOp(t,o,r):n==="t"?e.parseFontcharOp(t,o,r):n==="\0"?null:"error"}static parseOp(n,t,o){if(t=e.skipWs(n,t),t>=n.length)return null;let r=n[t++],i=e.parseShapeOp(r,n,t,o);return i!==null?i:e.parseMetaOp(r,n,t,o)}static parseXDotFOn(n,t,o,r){if(!n)return r;let i=r??{ops:[],flags:0},s=0;for(;s<n.length;){let l=e.parseOp(n,s,t);if(l===null)break;if(l==="error"){i.flags|=1;break}i.ops.push(l.op),s=l.pos}return i.ops.length===0?null:i}static parseXDotF(n,t,o){return e.parseXDotFOn(n,t,o,null)}static parseXDot(n){return e.parseXDotF(n,{},0)}static parseXDotColor(n){let t=e.parseXDotColorAt(n,0);return t?t.val:null}};function Nf(e){return Yb.parseXDot(e)}var Xue={filled_ellipse:"E",unfilled_ellipse:"e",filled_polygon:"P",unfilled_polygon:"p",filled_bezier:"b",unfilled_bezier:"B",polyline:"L"};var eRe=new Set(Object.keys(Xue));var $ue=new Set(["_draw_","_ldraw_","_hdraw_","_tdraw_","_hldraw_","_tldraw_"]),Wue="\\N";function NC(e){return $ue.has(e)}function Jb(e){return e.map(n=>[n.x,n.y])}function RC(e){return e.map(n=>({frac:n.frac,color:n.color}))}function Yue(e,n){if(n.type==="none")return{op:e,grad:"none",color:n.clr};if(n.type==="linear"){let o=n.ling;return{op:e,grad:"linear",p0:[o.x0,o.y0],p1:[o.x1,o.y1],stops:RC(o.stops)}}let t=n.ring;return{op:e,grad:"radial",p0:[t.x0,t.y0,t.r0],p1:[t.x1,t.y1,t.r1],stops:RC(t.stops)}}function Jue(e,n){switch(e.kind){case"filled_ellipse":case"unfilled_ellipse":{let t=e.ellipse;return{op:e.kind==="filled_ellipse"?"E":"e",rect:[t.x,t.y,t.w,t.h]}}case"filled_polygon":case"unfilled_polygon":return{op:e.kind==="filled_polygon"?"P":"p",points:Jb(e.polygon.pts)};case"filled_bezier":case"unfilled_bezier":return{op:e.kind==="filled_bezier"?"B":"b",points:Jb(e.bezier.pts)};case"polyline":return{op:"L",points:Jb(e.polyline.pts)};case"text":{let t=e.text,o=t.align==="left"?"l":t.align==="center"?"c":"r";return{op:"T",pt:[t.x,t.y],align:o,width:t.width,text:n?dfe(t.text):t.text}}case"fill_color":case"pen_color":return{op:e.kind==="fill_color"?"C":"c",grad:"none",color:e.color};case"grad_fill_color":case"grad_pen_color":return Yue(e.kind==="grad_fill_color"?"C":"c",e.gradColor);case"font":return{op:"F",size:e.font.size,face:e.font.name};case"style":return{op:"S",style:e.style};case"fontchar":return{op:"t",fontchar:e.fontchar};case"image":return{}}}function Kue(e,n){if(e==="")return[];let t=Nf(e);return t===null?[]:t.ops.map(o=>Jue(o,n))}function Yp(e){let n=[],t=new Map;for(let[,o]of e.nodes)for(let r of o.outEdges(e)){let i=r.tail.name+"\0"+r.head.name,s=t.get(i)??0;t.set(i,s+1),n.push({e:r,key:i+"\0"+s})}return n}var que=[["draw","_draw_"],["ldraw","_ldraw_"],["hdraw","_hdraw_"],["tdraw","_tdraw_"],["hldraw","_hldraw_"],["tldraw","_tldraw_"]];function Wp(e,n){if(!(e===void 0||n===void 0))for(let[t,o]of que){let r=n[t];r!==void 0&&e.set(o,r)}}function Que(e){let n,t=new Sf;try{let f=Fr();f.register(t);let d=eo(f,e,"xdot");n=Wo(d)}catch{return}let o=t.drawStringsByObject(),r=new Map;for(let[f,d]of n.nodes)r.set(f,new Map(d.attrs));let i=new Map,s=(f,d)=>{for(let[c,m]of f.subgraphs){let b=d.subgraphs.get(c);b!==void 0?(i.set(m,new Map(b.attrs)),s(m,b)):s(m,d)}};s(e,n);let l=new Map;for(let{e:f,key:d}of Yp(n))l.set(d,new Map(f.attrs));let a=new Map;for(let{e:f,key:d}of Yp(e)){let c=l.get(d);c!==void 0&&a.set(f,c)}let u=new Map(n.attrs);Wp(u,o.get(e));for(let[f,d]of e.nodes)Wp(r.get(f),o.get(d));for(let[f,d]of i)Wp(d,o.get(f));for(let[f,d]of a)Wp(d,o.get(f));return{graph:u,node:r,cluster:i,edge:a}}function TC(e){if(e.attrs.has("label"))return!0;let n=CC(e.info);if(n!==void 0&&n.text!=="")return!0;for(let[,t]of e.subgraphs)if(TC(t))return!0;return!1}function Zue(e,n){if(n)return e.attrs;let t=new Map(e.graphDefaultsSnapshot??[]);for(let[o,r]of e.attrs)t.set(o,r);return t}function efe(e){for(let t of e.edges)if(t.attrs.has("label"))return!0;let n=t=>{if(t.edgeDefaults.has("label"))return!0;for(let[,o]of t.subgraphs)if(n(o))return!0;return!1};return n(e)}function kC(e,n){for(let[,t]of e.subgraphs)n.push(t),kC(t,n)}function nfe(e,n,t){let o=[];kC(e,o);let r=new Map;o.forEach((f,d)=>r.set(f,d));let i=o.length,s=new Map,l=0;for(let[,f]of e.nodes)s.set(f,i+l++);let a=new Map,u=0;for(let{e:f}of Yp(e))a.set(f,u++);return{doXDot:n,draws:t,sgcnt:i,subgGid:r,nodeGid:s,edgeGid:a,dfsSubs:o,edgeLabelDeclared:efe(e),graphLabelDeclared:TC(e),isLatin:e.info.charset===Rm}}function Qb(e,n,t,o){let r=new Map(n);if(t!==void 0)for(let[i,s]of t)r.set(i,s);for(let[i,s]of r){let l=Sn(s)?wn(s):s;l===""&&i!=="label"||(o.doXDot&&NC(i)?e[i]=Kue(l,o.isLatin):NC(i)||(e[i]=l))}}function CC(e){let n=e.label;if(n!=null&&typeof n=="object"&&"pos"in n)return n}function Rf(e){return de(e.pos.x)+","+de(e.pos.y)}function tfe(e,n){if(!n.info.spl)return;n.info.label!==void 0&&(e.lp=Rf(n.info.label)),n.info.head_label!==void 0&&(e.head_lp=Rf(n.info.head_label)),n.info.tail_label!==void 0&&(e.tail_lp=Rf(n.info.tail_label));let t=n.info.xlabel;t!==void 0&&t.set&&(e.xlp=Rf(t))}function ofe(e,n){let t=n.info.xlabel;t!==void 0&&t.set&&(e.xlp=Rf(t))}function rfe(e,n){let t=CC(n.info);t!==void 0&&t.text!==""&&(e.lp=de(t.pos.x)+","+de(t.pos.y),e.lwidth=(t.dimen.x/72).toFixed(2),e.lheight=(t.dimen.y/72).toFixed(2))}function _C(e,n,t){if(e.n_flds===0)t.push(de(e.b.ll.x+n.x)+","+de(e.b.ll.y+n.y)+","+de(e.b.ur.x+n.x)+","+de(e.b.ur.y+n.y));else if(e.fld!==null)for(let o of e.fld)_C(o,n,t)}function ife(e,n){if(n.info.shape?.name!=="record")return;let o=n.info.shape_info;if(o===void 0)return;let r=[];_C(o,n.info.coord,r),r.length>0&&(e.rects=r.join(" "))}function sfe(e){let n=new Map(e.nodeDefaultsSnapshot??[]);for(let[t,o]of e.attrs)n.set(t,o);return n.has("label")||n.set("label",Wue),n}function lfe(e,n){let t={_gvid:n.nodeGid.get(e),name:e.name},o=sfe(e),r=n.draws?.node.get(e.name);return r===void 0&&(o.set("pos",et(e.info.coord.x)+","+et(e.info.coord.y)),o.set("width",et(e.info.width)),o.set("height",et(e.info.height))),Qb(t,o,r,n),ife(t,e),ofe(t,e),n.doXDot&&n.draws===void 0&&!("_draw_"in t)&&(t._draw_=[]),t}function afe(e,n){let t={_gvid:n.edgeGid.get(e),tail:n.nodeGid.get(e.tail),head:n.nodeGid.get(e.head)};return Qb(t,e.attrs,n.draws?.edge.get(e),n),n.edgeLabelDeclared&&!("label"in t)&&(t.label=""),tfe(t,e),n.doXDot&&n.draws===void 0&&!("_draw_"in t)&&(t._draw_=[]),t}function ufe(e,n){let t=[];for(let[,o]of e.nodes)for(let r of o.outEdges(e))n.edgeGid.has(r)&&t.push(r);return t.sort((o,r)=>o.seq-r.seq),t.map(o=>n.edgeGid.get(o))}function ffe(e,n){let t=Yp(e).map(({e:o})=>o);return t.sort((o,r)=>o.seq-r.seq),t.map(o=>afe(o,n))}function AC(e,n,t){let o={};o.name=e.name,n&&(o.directed=e.kind==="directed"||e.kind==="strict-directed",o.strict=e.kind==="strict-directed"||e.kind==="strict-undirected");let r=n?t.draws?.graph:t.draws?.cluster.get(e);if(Qb(o,Zue(e,n),r,t),rfe(o,e),t.graphLabelDeclared&&!("label"in o)&&(o.label=""),n?o._subgraph_cnt=t.sgcnt:o._gvid=t.subgGid.get(e),n){if(t.dfsSubs.length>0||e.nodes.size>0){let i=[];for(let s of t.dfsSubs)i.push(AC(s,!1,t));for(let[,s]of e.nodes)i.push(lfe(s,t));o.objects=i}}else{let i=[];for(let[,a]of e.subgraphs)i.push(t.subgGid.get(a));i.length>0&&(o.subgraphs=i);let s=[];for(let[,a]of e.nodes){let u=t.nodeGid.get(a);u!==void 0&&s.push(u)}s.length>0&&(o.nodes=s);let l=ufe(e,t);l.length>0&&(o.edges=l)}if(n){let i=ffe(e,t);i.length>0&&(o.edges=i)}return o}function dfe(e){let n=new TextEncoder().encode(e),t="";for(let o of n)t+=String.fromCharCode(o);return t}function GC(e,n){let t=n?Que(e):void 0,o=nfe(e,n,t),r=AC(e,!0,o);return JSON.stringify(r,null,2)+`
88
- `}var Kb=class{type="json0";quality=0;beginGraph(n,t){}endGraph(n,t){t.write(GC(n,!1))}beginNode(n,t){}endNode(n,t){}beginEdge(n,t){}endEdge(n,t){}textspan(n,t,o){}ellipse(n,t,o,r,i){}polygon(n,t,o){}bezier(n,t,o){}polyline(n,t){}},qb=class{type="json";quality=0;beginGraph(n,t){}endGraph(n,t){t.write(GC(n,!0))}beginNode(n,t){}endNode(n,t){}beginEdge(n,t){}endEdge(n,t){}textspan(n,t,o){}ellipse(n,t,o,r,i){}polygon(n,t,o){}bezier(n,t,o){}polyline(n,t){}};function MC(){return new Kb}function LC(){return new qb}var Ue='"';function Jp(e){let n=e.toPrecision(5);return n.includes(".")&&!n.includes("e")?n.replace(/\.?0+$/,""):n}function ia(e){return Jp(e/72)}function cfe(e){let n=e.attrs.get("color")??"black";return e.attrs.get("fillcolor")||n||"lightgrey"}function pfe(e){return{label:e.attrs.get("label")??e.name,style:e.attrs.get("style")??"solid",shape:e.attrs.get("shape")??"ellipse",color:e.attrs.get("color")??"black",fill:cfe(e)}}function mfe(e,n){let t=ia(e.info.coord.x),o=ia(e.info.coord.y),r=Jp(e.info.width),i=Jp(e.info.height),s=pfe(e);n.push("node "+e.name+" "+t+" "+o+" "+r+" "+i+" "+s.label+" "+s.style+" "+s.shape+" "+s.color+" "+s.fill+`
89
- `)}function xfe(e){if(!e.info.spl)return[];let n=[];for(let t of e.info.spl.list)for(let o of t.list)n.push(o);return n}function IC(e){return e?":"+e:""}function hfe(e,n,t,o,r){r.push("edge "+e.tail.name+n+" "+e.head.name+t+" "+String(o.length));for(let i of o)r.push(" "+ia(i.x)+" "+ia(i.y))}function bfe(e,n,t){let o=n?IC(e.info.tail_port.name):"",r=n?IC(e.info.head_port.name):"",i=xfe(e);i.length>0&&hfe(e,o,r,i,t);let s=e.attrs.get("style")??"solid",l=e.attrs.get("color")??"black";t.push(" "+s+" "+l+`
90
- `)}function BC(e,n,t){let o=ia(e.info.bb.ur.x),r=ia(e.info.bb.ur.y);n.write("graph "+Jp(n.zoom)+" "+o+" "+r+`
91
- `);for(let[,i]of e.nodes){let s=[];mfe(i,s),n.write(s.join(""))}for(let[,i]of e.nodes)for(let s of i.outEdges(e)){let l=[];bfe(s,t,l),n.write(l.join(""))}n.write(`stop
92
- `)}function gfe(e){return{url:e.url??"",tooltip:e.tooltip??"",target:e.target??"",id:e.id??""}}function yfe(e,n){let t=e.obj;!t||!t.urlMapPts.length||FC(t.urlMapShape,t.urlMapPts,gfe(t),!0,n)}function Pfe(e){return e===1?"circle":e===0?"rect":"poly"}function Efe(e){return String(Math.round(e[0].x))+","+String(Math.round(e[1].y))+","+String(Math.round(e[1].x))+","+String(Math.round(e[0].y))}function vfe(e){let n=Math.round(e[0].x),t=Math.round(e[0].y),o=Math.round(e[1].x-e[0].x);return String(n)+","+String(t)+","+String(o)}function Sfe(e){return e.map(n=>String(Math.round(n.x))+","+String(Math.round(n.y))).join(",")}function wfe(e,n){return e===1?vfe(n):e===0?Efe(n):Sfe(n)}function Nfe(e,n){e.id&&n.push(" id="+Ue+Je(e.id)+Ue),e.url&&n.push(" href="+Ue+Je(e.url)+Ue),e.target&&n.push(" target="+Ue+Ke(e.target)+Ue),e.tooltip&&n.push(" title="+Ue+Ke(e.tooltip)+Ue)}function FC(e,n,t,o,r){r.push("<area shape="+Ue+Pfe(e)+Ue),Nfe(t,r),r.push(" alt="+Ue+Ue),r.push(" coords="+Ue+wfe(e,n)+Ue),r.push(o?`/>
93
- `:`>
94
- `)}function Rfe(e,n,t,o){if(t)if(e===0)o.push("rect "+t+" "+Math.round(n[0].x)+","+Math.round(n[1].y)+" "+Math.round(n[1].x)+","+Math.round(n[0].y)+`
95
- `);else if(e===1){let r=Math.round(n[1].x-n[0].x);o.push("circle "+t+" "+Math.round(n[0].x)+","+Math.round(n[0].y)+","+String(r)+`
96
- `)}else{let r=n.map(i=>Math.round(i.x)+","+Math.round(i.y)).join(" ");o.push("poly "+t+" "+r+`
97
- `)}}var Zb=class{type="plain";quality=0;beginGraph(n,t){}endGraph(n,t){BC(n,t,!1)}beginNode(n,t){}endNode(n,t){}beginEdge(n,t){}endEdge(n,t){}textspan(n,t,o){}ellipse(n,t,o,r,i){}polygon(n,t,o){}bezier(n,t,o){}polyline(n,t){}},eg=class{type="plain-ext";quality=0;beginGraph(n,t){}endGraph(n,t){BC(n,t,!0)}beginNode(n,t){}endNode(n,t){}beginEdge(n,t){}endEdge(n,t){}textspan(n,t,o){}ellipse(n,t,o,r,i){}polygon(n,t,o){}bezier(n,t,o){}polyline(n,t){}};function Tfe(e){return e.anonymous?"%1":e.name}function OC(e,n){for(let t=e;t!==null;t=t.parent){let o=t.attrs.get(n);if(o!==void 0&&o!=="")return o}}function kfe(e){let n=OC(e,"href")??OC(e,"URL");return n===void 0?null:er(n,e)}function Cfe(e,n,t){let o=V(e.attrs.get("dpi"),V(e.attrs.get("resolution"),0,0),0),i=(o>0?o:96)/De,s=Lc(n.bb,pl(e.attrs.get("size")),n.pad),l={x:n.margin.x*i,y:n.margin.y*i};return{bb:n.bb,pad:n.pad,scale:s*i,marginOff:l,mapPolygon:t}}function DC(e,n,t,o){return{url:e??"",tooltip:n??"",target:t??"",id:o??""}}var sa=class{quality=0;mapCtx=null;beginGraph(n,t){if(t.flags|=xo,this.mapCtx=Cfe(n,t,this.mapPolygon),this.isCmapx){let r=Je(Tfe(n));t.write("<map id="+Ue+r+Ue+" name="+Ue+r+Ue+`>
98
- `);return}t.write(`base referer
99
- `);let o=kfe(n);o&&t.write("default "+o+`
100
- `)}endGraph(n,t){if(!this.isCmapx)return;let o=t.obj;o!==null&&this.mapCtx!==null&&(o.url!==null||o.explicitTooltip)&&Y7(o,this.mapCtx);let r=[];yfe(t,r),t.write(r.join("")),t.write(`</map>
101
- `)}beginNode(n,t){this.mapCtx!==null&&t.obj!==null&&W7(n,t.obj,this.mapCtx)}beginCluster(n,t){let o=n.info.bb;this.mapCtx!==null&&t.obj!==null&&o!==void 0&&n5(o,t.obj,this.mapCtx)}endEdge(n,t){this.mapCtx!==null&&t.obj!==null&&this.emitEdge(n,t.obj,t)}emitMapRect(n,t){this.mapCtx!==null&&t.obj!==null&&n5(n,t.obj,this.mapCtx)}beginAnchor(n,t,o,r,i){let s=i.obj;s===null||s.urlMapPts.length===0||this.emitShape(s.urlMapShape,s.urlMapPts,{url:n,tooltip:t,target:o,id:r},i)}endNode(n,t){}beginEdge(n,t){}endCluster(n,t){}textspan(n,t,o){}ellipse(n,t,o,r,i){}polygon(n,t,o){}bezier(n,t,o){}polyline(n,t){}emitShape(n,t,o,r){let i=[];this.isCmapx?FC(n,t,o,!0,i):Rfe(n,t,o.url,i),r.write(i.join(""))}emitEdge(n,t,o){let r=n.info.spl,i=t.url!==null||t.explicitTooltip;if(r!==void 0&&this.mapPolygon&&i){let l=Math.max(t.penWidth/2,2),a=DC(t.url,t.tooltip,t.target,t.id);for(let u of K7(r,l,this.mapCtx))this.emitShape(2,u,a,o)}let s={url:t.labelUrl,tooltip:t.labelTooltip,target:t.labelTarget,explicit:t.explicitLabelTooltip};this.emitEdgeLabel(n.info.label,s,t,o),this.emitEdgeLabel(n.info.xlabel,s,t,o),this.emitEdgeLabel(n.info.head_label,{url:t.headUrl,tooltip:t.headTooltip,target:t.headTarget,explicit:t.explicitHeadTooltip},t,o),this.emitEdgeLabel(n.info.tail_label,{url:t.tailUrl,tooltip:t.tailTooltip,target:t.tailTarget,explicit:t.explicitTailTooltip},t,o)}emitEdgeLabel(n,t,o,r){!(n!==void 0&&n.set&&this.mapCtx!==null)||t.url===null&&!t.explicit||(J7(n,o,this.mapCtx),this.emitShape(0,o.urlMapPts,DC(t.url,t.tooltip,t.target,o.id),r))}},ng=class extends sa{type="imap";isCmapx=!1;mapPolygon=!0},tg=class extends sa{type="imap-np";isCmapx=!1;mapPolygon=!1},og=class extends sa{type="cmapx";isCmapx=!0;mapPolygon=!0},rg=class extends sa{type="cmapx-np";isCmapx=!0;mapPolygon=!1};function zC(){return new Zb}function jC(){return new eg}function HC(){return new ng}function VC(){return new tg}function UC(){return new og}function XC(){return new rg}function Fr(){let e=new ps(r6());return e.register(nN),e.register(IT),e.register(nk),e.register(ck),e.register(Gk),e.register(Mk),e.register(zk),e.register(Kk),e.register(SC()),e.register(yC()),e.register(PC()),e.register(MC()),e.register(LC()),e.register(zC()),e.register(jC()),e.register(HC()),e.register(VC()),e.register(UC()),e.register(XC()),e}function _fe(e){let n=e.root.kind;return n==="undirected"||n==="strict-undirected"}function Afe(e){let n=e.root.kind;return n==="strict-directed"||n==="strict-undirected"}function Gfe(e,n,t,o){for(let r of e.edges)if(r.tail===n&&r.head===t||o&&r.tail===t&&r.head===n)return r;return null}function Mfe(e,n,t){n.edges.push(t),t.graphSeq=n.edges.length;for(let o=e;o!==null&&o!==n;o=o.parent)o.nodes.set(t.tail.name,t.tail),o.nodes.set(t.head.name,t.head),o.edges.push(t)}function Kp(e,n,t,o){let r=e.root,i=_fe(e);if(Afe(e)){let l=Gfe(r,n,t,i);if(l!==null)return l}let s=new Ae(n,t,o??"");return Mfe(e,r,s),s}var ig=class{_node;constructor(n){this._node=n}get name(){return this._node.name}setAttr(n,t){this._node.attrs.set(n,t)}getAttr(n){return this._node.attrs.get(n)}},sg=class{_edge;constructor(n){this._edge=n}get tail(){return this._edge.tail.name}get head(){return this._edge.head.name}setAttr(n,t){this._edge.attrs.set(n,t)}getAttr(n){return this._edge.attrs.get(n)}};function $C(e,n){if(typeof n=="string"){let t=jr(e,n,!0);if(t===null)throw new Ye(`Failed to resolve node '${n}' in graph '${e.name}'`,"GENERIC_ERROR");return t}return n._node}function lg(e,n){if(n!==void 0)for(let[t,o]of Object.entries(n))e.set(t,o)}var ag=class e{_graph;_context;constructor(n,t){this._graph=n,this._context=t}get graph(){return this._graph}addNode(n,t){return Lfe(this._graph,this._context,n,t)}addEdge(n,t,o){let r=$C(this._graph,n),i=$C(this._graph,t),s=Kp(this._graph,r,i);return lg(s.attrs,o),new sg(s)}addSubgraph(n,t){let o=$o(this._context,n,!0);if(o===null)throw new Ye(`Failed to create subgraph '${n}'`,"GENERIC_ERROR");return lg(o.attrs,t),new e(this._graph,o)}setAttr(n,t){this._context.attrs.set(n,t)}getAttr(n){return this._context.attrs.get(n)}};function Lfe(e,n,t,o){let r=jr(e,t,!0);if(r===null)throw new Ye(`Failed to create node '${t}'`,"GENERIC_ERROR");return lg(r.attrs,o),n!==e&&ds(n,r,!0),new ig(r)}var Ife={"true:true":"strict-directed","true:false":"directed","false:true":"strict-undirected","false:false":"undirected"};function Ofe(e){let n=String(e?.directed??!0),t=String(e?.strict??!1);return Ife[`${n}:${t}`]??"directed"}function WC(e){let n=new $e(e?.name??"",Ofe(e));return new ag(n,n)}var YC=72;function Dfe(e,n){return n==="up"?t=>t:t=>e-t}function Bfe(e,n){let t=e.info.coord;return{name:e.name,x:t.x,y:n(t.y),width:e.info.width*YC,height:e.info.height*YC}}function Ffe(e,n){let t=e.info.spl;if(t===void 0)return[];let o=[];for(let r of t.list)for(let i=0;i<r.size;i++){let s=r.list[i];o.push({x:s.x,y:n(s.y)})}return o}function zfe(e,n){let t={tail:e.tail.name,head:e.head.name,points:Ffe(e,n)},o=e.info.label;return o!==void 0&&(t.label={x:o.pos.x,y:n(o.pos.y)}),t}function JC(e,n){if(e.info?.laidOut!==!0)throw new Ye("getLayout requires a laid-out graph; run ctx.layout(g, engine) or render() first","GENERIC_ERROR");let t=n?.yAxis??"down",o=e.info.bb,r=o.ur.x-o.ll.x,i=o.ur.y-o.ll.y,s=Dfe(i,t),l=t==="down"?{x:0,y:0,width:r,height:i}:{x:o.ll.x,y:o.ll.y,width:r,height:i},a=Array.from(e.nodes.values()).map(f=>Bfe(f,s)),u=e.edges.map(f=>zfe(f,s));return{bounds:l,nodes:a,edges:u}}function jfe(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.code=="string"}function Hfe(e){return e instanceof Error?e.message:String(e)}function KC(e,n,t){let o=t?.engine??"dot",r=Fr();try{r.layout(e,o);let i=eo(r,e,n);return r.freeLayout(e,o),i}catch(i){throw jfe(i)?i:new Ye(Hfe(i),"RENDER_ERROR")}}var fg="dot",Vfe=["_draw_","_ldraw_","_hdraw_","_tdraw_","_hldraw_","_tldraw_"];function Ufe(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.code=="string"}function Xfe(e){if(Ufe(e))throw e;let n=e instanceof Error?e.message:String(e);throw new Ye(n,"RENDER_ERROR")}function ug(e,n){for(let t of Vfe){let o=e.get(t);if(o===void 0)continue;let r=Nf(o);r!==null&&n.push(...r.ops)}}function $fe(e){let n=[];ug(e.attrs,n);for(let t of e.nodes.values())ug(t.attrs,n);for(let t of e.edges)ug(t.attrs,n);return n}function Wfe(e,n){let t=Fr();try{t.layout(e,n);let o=eo(t,e,"xdot");return t.freeLayout(e,n),o}catch(o){Xfe(o)}}function qC(e,n){let t=n?.engine??fg;return $fe(Wo(Wfe(e,t)))}function QC(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.code=="string"}function ZC(e){return e instanceof Error?e.message:String(e)}function Yfe(e){return new Ye(ZC(e),"GENERIC_ERROR")}function Jfe(e){let n=QC(e)?e:Yfe(e),t={type:n.type,code:n.code,message:n.message,friendlyMessage:n.friendlyMessage};return n.location!==void 0&&(t.location=n.location),n.expected!==void 0&&(t.expected=n.expected),t}function e_(e,n){let t=Fr();try{let o=Wo(e);t.layout(o,n);let r=eo(t,o,"svg");return t.freeLayout(o,n),r}catch(o){throw QC(o)?o:new Ye(ZC(o),"RENDER_ERROR")}}function Kfe(e,n){try{return{svg:e_(e,n)}}catch(t){return{errors:[Jfe(t)]}}}0&&(module.exports={CanvasTextMeasurer,DEFAULT_DRAW_ENGINE,EstimateTextMeasurer,GvcContext,LutTextMeasurer,ParseError,RenderError,addEdge,createGraph,getDrawOps,getLayout,getTextMeasurer,parse,render,renderSvg,renderWithContext,setImageSizer,setTextMeasurer,tryRenderSvg});