@reventlessdev/reventless-host-shell 3.0.0-alpha.51 → 3.0.0-alpha.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/assets/{Geocoder.res-Dm3-2yhE.js → Geocoder.res-DKcg156E.js} +1 -1
- package/dist/assets/{GraphMode.res-DEnv8B0Y.js → GraphMode.res-D7PtRXnc.js} +2 -2
- package/dist/assets/{MapMode.res-BWRtOfiH.js → MapMode.res-CEVJnyF7.js} +14 -14
- package/dist/assets/index-B708Gr2B.js +127 -0
- package/dist/assets/{index-BegL3iwB.js → index-D8ZZdUvf.js} +1 -1
- package/dist/config.json +0 -1
- package/dist/mf-entry-bootstrap-0.js +1 -1
- package/package.json +5 -5
- package/vite.config.mjs +4 -4
- package/dist/assets/index-C8Huy8vm.js +0 -117
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as xh,t as bu,g as Th,h as wu,r as Ch,f as Sh,a as td,c as rd,b as ad,d as nd,e as Dh,i as id,j as od,m as sd,s as ud,k as ld,u as fd,l as Ah,n as Eu,v as xu,o as hd,C as Vr,R as cd,S as vd,T as dd,q as gd,w as pd,x as yd}from"./index-
|
|
1
|
+
import{p as xh,t as bu,g as Th,h as wu,r as Ch,f as Sh,a as td,c as rd,b as ad,d as nd,e as Dh,i as id,j as od,m as sd,s as ud,k as ld,u as fd,l as Ah,n as Eu,v as xu,o as hd,C as Vr,R as cd,S as vd,T as dd,q as gd,w as pd,x as yd}from"./index-B708Gr2B.js";import{a as da,_ as md}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import{h as Oa,b as Oi}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";function bd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-TJtk2Lkb.js";import"./preload-helper-BlTxHScW.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Df1FMNLk.js";function Lh(t){return Sh(ad(t),e=>{let r=e[1],a=e[0],n=td(r),i=rd(a,r,n);if(typeof i=="object")switch(i.TAG){case"KEntityId":return[a,i._0,!1];case"KArrayOfEntityIds":return[a,i._0,!0];default:return}})}function wd(t){return Lh(t).length!==0}function Tu(t,e,r){return r?Sh(Dh(id(Th(t.dict,e),od),[]),nd):sd(ud(t.dict,e),[],a=>[a])}function Ed(t){let e=Lh(t.schema),r=xh(t),a={};r.forEach(l=>{a[l.key]=bu(t,l)});let n=l=>l.length>8?l.slice(0,8)+"…":l,i=r.map(l=>({id:l.key,label:bu(t,l),group:t.readModelName})),o=r.flatMap(l=>e.flatMap(f=>{let h=f[1];return Tu(l,f[0],f[2]).map(v=>{let c=Th(a,v);return c!==void 0?{id:v,label:c,group:t.readModelName}:{id:v,label:n(v),group:wu(h)}})})),s=Ch(i.concat(o),[],(l,f)=>l.some(h=>h.id===f.id)?l:l.concat([f])),u=r.flatMap(l=>e.flatMap(f=>{let h=f[0];return Tu(l,h,f[2]).map(v=>({from:l.key,to_:v,label:wu(h)}))}));return{nodes:s,edges:u}}function Pi(t){return Ch(t,[],(e,r)=>{let a=r.group;return a!==void 0&&!e.includes(a)?e.concat([a]):e})}function ws(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function xd(t){if(Array.isArray(t))return t}function Td(t){if(Array.isArray(t))return ws(t)}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cd(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Mh(a.key),a)}}function Ar(t,e,r){return e&&Cd(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Hs(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,i=u},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw i}}}}function Nh(t,e,r){return(e=Mh(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sd(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Dd(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a,n,i,o,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(a=i.call(r)).done)&&(s.push(a.value),s.length!==e);u=!0);}catch(f){l=!0,n=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw n}}return s}}function Ad(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ld(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(t,e){return xd(t)||Dd(t,e)||Hs(t,e)||Ad()}function $n(t){return Td(t)||Sd(t)||Hs(t)||Ld()}function Nd(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Mh(t){var e=Nd(t,"string");return typeof e=="symbol"?e:e+""}function dt(t){"@babel/helpers - typeof";return dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dt(t)}function Hs(t,e){if(t){if(typeof t=="string")return ws(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ws(t,e):void 0}}var ct=typeof window>"u"?null:window,Cu=ct?ct.navigator:null;ct&&ct.document;var Md=dt(""),Rh=dt({}),Rd=dt(function(){}),Od=typeof HTMLElement>"u"?"undefined":dt(HTMLElement),nn=function(e){return e&&e.instanceString&&it(e.instanceString)?e.instanceString():null},Me=function(e){return e!=null&&dt(e)==Md},it=function(e){return e!=null&&dt(e)===Rd},Je=function(e){return!Bt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},_e=function(e){return e!=null&&dt(e)===Rh&&!Je(e)&&e.constructor===Object},Pd=function(e){return e!=null&&dt(e)===Rh},be=function(e){return e!=null&&dt(e)===dt(1)&&!isNaN(e)},Id=function(e){return be(e)&&Math.floor(e)===e},Kn=function(e){if(Od!=="undefined")return e!=null&&e instanceof HTMLElement},Bt=function(e){return on(e)||Oh(e)},on=function(e){return nn(e)==="collection"&&e._private.single},Oh=function(e){return nn(e)==="collection"&&!e._private.single},Ys=function(e){return nn(e)==="core"},Ph=function(e){return nn(e)==="stylesheet"},kd=function(e){return nn(e)==="event"},br=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Bd=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Fd=function(e){return _e(e)&&be(e.x1)&&be(e.x2)&&be(e.y1)&&be(e.y2)},zd=function(e){return Pd(e)&&it(e.then)},Vd=function(){return Cu&&Cu.userAgent.match(/msie|trident|edge/i)},ga=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var a=function(){var i=this,o=arguments,s,u=r.apply(i,o),l=a.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s};return a.cache={},a},qs=ga(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),hi=ga(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Ih=ga(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Su=function(e){return br(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},dr=function(e,r){return e.slice(-1*r.length)===r},vt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Gd="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",Ud="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",Hd="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",Yd="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",qd="\\#[0-9a-fA-F]{3}",_d="\\#[0-9a-fA-F]{6}",kh=function(e,r){return e<r?-1:e>r?1:0},Wd=function(e,r){return-1*kh(e,r)},Ie=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var o=n[i];t[o]=a[o]}}return t},Xd=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,o=16;return r?(a=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(a=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[a,n,i]}},$d=function(e){var r,a,n,i,o,s,u,l;function f(d,p,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?d+(p-d)*6*y:y<1/2?p:y<2/3?d+(p-d)*(2/3-y)*6:d}var h=new RegExp("^"+Hd+"$").exec(e);if(h){if(a=parseInt(h[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(h[2]),n<0||n>100||(n=n/100,i=parseFloat(h[3]),i<0||i>100)||(i=i/100,o=h[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(n===0)s=u=l=Math.round(i*255);else{var v=i<.5?i*(1+n):i+n-i*n,c=2*i-v;s=Math.round(255*f(c,v,a+1/3)),u=Math.round(255*f(c,v,a)),l=Math.round(255*f(c,v,a-1/3))}r=[s,u,l,o]}return r},Kd=function(e){var r,a=new RegExp("^"+Gd+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"&&(n[i]=!0),o=parseFloat(o),n[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(s&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;r.push(l)}}return r},Zd=function(e){return Qd[e.toLowerCase()]},Bh=function(e){return(Je(e)?e:null)||Zd(e)||Xd(e)||Kd(e)||$d(e)},Qd={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Fh=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(_e(o))throw Error("Tried to set map with object key");i<a.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},zh=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(_e(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r},wn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ii,Du;function un(){if(Du)return Ii;Du=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Ii=t,Ii}var ki,Au;function Jd(){if(Au)return ki;Au=1;var t=typeof wn=="object"&&wn&&wn.Object===Object&&wn;return ki=t,ki}var Bi,Lu;function ci(){if(Lu)return Bi;Lu=1;var t=Jd(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Bi=r,Bi}var Fi,Nu;function jd(){if(Nu)return Fi;Nu=1;var t=ci(),e=function(){return t.Date.now()};return Fi=e,Fi}var zi,Mu;function eg(){if(Mu)return zi;Mu=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return zi=e,zi}var Vi,Ru;function tg(){if(Ru)return Vi;Ru=1;var t=eg(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return Vi=r,Vi}var Gi,Ou;function _s(){if(Ou)return Gi;Ou=1;var t=ci(),e=t.Symbol;return Gi=e,Gi}var Ui,Pu;function rg(){if(Pu)return Ui;Pu=1;var t=_s(),e=Object.prototype,r=e.hasOwnProperty,a=e.toString,n=t?t.toStringTag:void 0;function i(o){var s=r.call(o,n),u=o[n];try{o[n]=void 0;var l=!0}catch{}var f=a.call(o);return l&&(s?o[n]=u:delete o[n]),f}return Ui=i,Ui}var Hi,Iu;function ag(){if(Iu)return Hi;Iu=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return Hi=r,Hi}var Yi,ku;function Vh(){if(ku)return Yi;ku=1;var t=_s(),e=rg(),r=ag(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function o(s){return s==null?s===void 0?n:a:i&&i in Object(s)?e(s):r(s)}return Yi=o,Yi}var qi,Bu;function ng(){if(Bu)return qi;Bu=1;function t(e){return e!=null&&typeof e=="object"}return qi=t,qi}var _i,Fu;function ln(){if(Fu)return _i;Fu=1;var t=Vh(),e=ng(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return _i=a,_i}var Wi,zu;function ig(){if(zu)return Wi;zu=1;var t=tg(),e=un(),r=ln(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(r(l))return a;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=t(l);var h=i.test(l);return h||o.test(l)?s(l.slice(2),h?2:8):n.test(l)?a:+l}return Wi=u,Wi}var Xi,Vu;function og(){if(Vu)return Xi;Vu=1;var t=un(),e=jd(),r=ig(),a="Expected a function",n=Math.max,i=Math.min;function o(s,u,l){var f,h,v,c,d,p,y=0,g=!1,b=!1,m=!0;if(typeof s!="function")throw new TypeError(a);u=r(u)||0,t(l)&&(g=!!l.leading,b="maxWait"in l,v=b?n(r(l.maxWait)||0,u):v,m="trailing"in l?!!l.trailing:m);function w(I){var E=f,A=h;return f=h=void 0,y=I,c=s.apply(A,E),c}function T(I){return y=I,d=setTimeout(N,u),g?w(I):c}function D(I){var E=I-p,A=I-y,C=u-E;return b?i(C,v-A):C}function x(I){var E=I-p,A=I-y;return p===void 0||E>=u||E<0||b&&A>=v}function N(){var I=e();if(x(I))return O(I);d=setTimeout(N,D(I))}function O(I){return d=void 0,m&&f?w(I):(f=h=void 0,c)}function R(){d!==void 0&&clearTimeout(d),y=0,f=p=h=d=void 0}function P(){return d===void 0?c:O(e())}function M(){var I=e(),E=x(I);if(f=arguments,h=this,p=I,E){if(d===void 0)return T(p);if(b)return clearTimeout(d),d=setTimeout(N,u),w(p)}return d===void 0&&(d=setTimeout(N,u)),c}return M.cancel=R,M.flush=P,M}return Xi=o,Xi}var sg=og(),fn=sn(sg),$i=ct?ct.performance:null,Gh=$i&&$i.now?function(){return $i.now()}:function(){return Date.now()},ug=(function(){if(ct){if(ct.requestAnimationFrame)return function(t){ct.requestAnimationFrame(t)};if(ct.mozRequestAnimationFrame)return function(t){ct.mozRequestAnimationFrame(t)};if(ct.webkitRequestAnimationFrame)return function(t){ct.webkitRequestAnimationFrame(t)};if(ct.msRequestAnimationFrame)return function(t){ct.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Gh())},1e3/60)}})(),Zn=function(e){return ug(e)},ir=Gh,Fr=9261,Uh=65599,ia=5381,Hh=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr,a=r,n;n=e.next(),!n.done;)a=a*Uh+n.value|0;return a},Xa=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr;return r*Uh+e|0},$a=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ia;return(r<<5)+r+e|0},lg=function(e,r){return e*2097152+r},hr=function(e){return e[0]*2097152+e[1]},En=function(e,r){return[Xa(e[0],r[0]),$a(e[1],r[1])]},Gu=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return Hh(o,r)},Ur=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return Hh(o,r)},Yh=function(){return fg(arguments)},fg=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=Ur(n):r=Ur(n,r)}return r};function hg(t,e,r,a,n){var i=n*Math.PI/180,o=Math.cos(i)*(t-r)-Math.sin(i)*(e-a)+r,s=Math.sin(i)*(t-r)+Math.cos(i)*(e-a)+a;return{x:o,y:s}}var cg=function(e,r,a,n,i,o){return{x:(e-a)*i+a,y:(r-n)*o+n}};function vg(t,e,r){if(r===0)return t;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=hg(t.x,t.y,a,n,r),u=cg(s.x,s.y,a,n,i,o);return{x:u.x,y:u.y}}var Uu=!0,dg=console.warn!=null,gg=console.trace!=null,Ws=Number.MAX_SAFE_INTEGER||9007199254740991,qh=function(){return!0},Qn=function(){return!1},Hu=function(){return 0},Xs=function(){},nt=function(e){throw new Error(e)},_h=function(e){if(e!==void 0)Uu=!!e;else return Uu},Ke=function(e){_h()&&(dg?console.warn(e):(console.log(e),gg&&console.trace()))},pg=function(e){return Ie({},e)},Qt=function(e){return e==null?e:Je(e)?e.slice():_e(e)?pg(e):e},yg=function(e){return e.slice()},Wh=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},mg={},Xh=function(){return mg},Tt=function(e){var r=Object.keys(e);return function(a){for(var n={},i=0;i<r.length;i++){var o=r[i],s=a?.[o];n[o]=s===void 0?e[o]:s}return n}},wr=function(e,r,a){for(var n=e.length-1;n>=0;n--)e[n]===r&&e.splice(n,1)},$s=function(e){e.splice(0,e.length)},bg=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Mt=function(e,r,a){return a&&(r=Ih(a,r)),e[r]},Zt=function(e,r,a,n){a&&(r=Ih(a,r)),e[r]=n},wg=(function(){function t(){Dr(this,t),this._obj={}}return Ar(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])})(),nr=typeof Map<"u"?Map:wg,Eg="undefined",xg=(function(){function t(e){if(Dr(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return Ar(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)}},{key:"delete",value:function(r){var a=this._obj;a[r]===1&&(a[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}])})(),xa=(typeof Set>"u"?"undefined":dt(Set))!==Eg?Set:xg,vi=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ys(e)){nt("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){nt("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new xa,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var o=r.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];Je(r.classes)?l=r.classes:Me(r.classes)&&(l=r.classes.split(/\s+/));for(var f=0,h=l.length;f<h;f++){var v=l[f];!v||v===""||i.classes.add(v)}this.createEmitter(),(a===void 0||a)&&this.restore();var c=r.style||r.css;c&&(Ke("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(c))},Yu=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var o;_e(a)&&!Bt(a)&&(o=a,a=o.roots||o.root,n=o.visit,i=o.directed),i=arguments.length===2&&!it(n)?n:i,n=it(n)?n:function(){};for(var s=this._private.cy,u=a=Me(a)?this.filter(a):a,l=[],f=[],h={},v={},c={},d=0,p,y=this.byGroup(),g=y.nodes,b=y.edges,m=0;m<u.length;m++){var w=u[m],T=w.id();w.isNode()&&(l.unshift(w),e.bfs&&(c[T]=!0,f.push(w)),v[T]=0)}for(var D=function(){var I=e.bfs?l.shift():l.pop(),E=I.id();if(e.dfs){if(c[E])return 0;c[E]=!0,f.push(I)}var A=v[E],C=h[E],S=C!=null?C.source():null,L=C!=null?C.target():null,V=C==null?void 0:I.same(S)?L[0]:S[0],F;if(F=n(I,C,V,d++,A),F===!0)return p=I,1;if(F===!1)return 1;for(var B=I.connectedEdges().filter(function(K){return(!i||K.source().same(I))&&b.has(K)}),Y=0;Y<B.length;Y++){var q=B[Y],Q=q.connectedNodes().filter(function(K){return!K.same(I)&&g.has(K)}),$=Q.id();Q.length!==0&&!c[$]&&(Q=Q[0],l.push(Q),e.bfs&&(c[$]=!0,f.push(Q)),h[$]=q,v[$]=v[E]+1)}},x;l.length!==0&&(x=D(),!(x!==0&&x===1)););for(var N=s.collection(),O=0;O<f.length;O++){var R=f[O],P=h[R.id()];P!=null&&N.push(P),N.push(R)}return{path:s.collection(N),found:s.collection(p)}}},Ka={breadthFirstSearch:Yu({bfs:!0}),depthFirstSearch:Yu({dfs:!0})};Ka.bfs=Ka.breadthFirstSearch;Ka.dfs=Ka.depthFirstSearch;var kn={exports:{}},Tg=kn.exports,qu;function Cg(){return qu||(qu=1,(function(t,e){(function(){var r,a,n,i,o,s,u,l,f,h,v,c,d,p,y;n=Math.floor,h=Math.min,a=function(g,b){return g<b?-1:g>b?1:0},f=function(g,b,m,w,T){var D;if(m==null&&(m=0),T==null&&(T=a),m<0)throw new Error("lo must be non-negative");for(w==null&&(w=g.length);m<w;)D=n((m+w)/2),T(b,g[D])<0?w=D:m=D+1;return[].splice.apply(g,[m,m-m].concat(b)),b},s=function(g,b,m){return m==null&&(m=a),g.push(b),p(g,0,g.length-1,m)},o=function(g,b){var m,w;return b==null&&(b=a),m=g.pop(),g.length?(w=g[0],g[0]=m,y(g,0,b)):w=m,w},l=function(g,b,m){var w;return m==null&&(m=a),w=g[0],g[0]=b,y(g,0,m),w},u=function(g,b,m){var w;return m==null&&(m=a),g.length&&m(g[0],b)<0&&(w=[g[0],b],b=w[0],g[0]=w[1],y(g,0,m)),b},i=function(g,b){var m,w,T,D,x,N;for(b==null&&(b=a),D=(function(){N=[];for(var O=0,R=n(g.length/2);0<=R?O<R:O>R;0<=R?O++:O--)N.push(O);return N}).apply(this).reverse(),x=[],w=0,T=D.length;w<T;w++)m=D[w],x.push(y(g,m,b));return x},d=function(g,b,m){var w;if(m==null&&(m=a),w=g.indexOf(b),w!==-1)return p(g,0,w,m),y(g,w,m)},v=function(g,b,m){var w,T,D,x,N;if(m==null&&(m=a),T=g.slice(0,b),!T.length)return T;for(i(T,m),N=g.slice(b),D=0,x=N.length;D<x;D++)w=N[D],u(T,w,m);return T.sort(m).reverse()},c=function(g,b,m){var w,T,D,x,N,O,R,P,M;if(m==null&&(m=a),b*10<=g.length){if(D=g.slice(0,b).sort(m),!D.length)return D;for(T=D[D.length-1],R=g.slice(b),x=0,O=R.length;x<O;x++)w=R[x],m(w,T)<0&&(f(D,w,0,null,m),D.pop(),T=D[D.length-1]);return D}for(i(g,m),M=[],N=0,P=h(b,g.length);0<=P?N<P:N>P;0<=P?++N:--N)M.push(o(g,m));return M},p=function(g,b,m,w){var T,D,x;for(w==null&&(w=a),T=g[m];m>b;){if(x=m-1>>1,D=g[x],w(T,D)<0){g[m]=D,m=x;continue}break}return g[m]=T},y=function(g,b,m){var w,T,D,x,N;for(m==null&&(m=a),T=g.length,N=b,D=g[b],w=2*b+1;w<T;)x=w+1,x<T&&!(m(g[w],g[x])<0)&&(w=x),g[b]=g[w],b=w,w=2*b+1;return g[b]=D,p(g,N,b,m)},r=(function(){g.push=s,g.pop=o,g.replace=l,g.pushpop=u,g.heapify=i,g.updateItem=d,g.nlargest=v,g.nsmallest=c;function g(b){this.cmp=b??a,this.nodes=[]}return g.prototype.push=function(b){return s(this.nodes,b,this.cmp)},g.prototype.pop=function(){return o(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},g.prototype.replace=function(b){return l(this.nodes,b,this.cmp)},g.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(b){return d(this.nodes,b,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var b;return b=new g,b.nodes=this.nodes.slice(0),b},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g})(),(function(g,b){return t.exports=b()})(this,function(){return r})}).call(Tg)})(kn)),kn.exports}var Ki,_u;function Sg(){return _u||(_u=1,Ki=Cg()),Ki}var Dg=Sg(),hn=sn(Dg),Ag=Tt({root:null,weight:function(e){return 1},directed:!1}),Lg={dijkstra:function(e){if(!_e(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=Ag(e),n=a.root,i=a.weight,o=a.directed,s=this,u=i,l=Me(n)?this.filter(n)[0]:n[0],f={},h={},v={},c=this.byGroup(),d=c.nodes,p=c.edges;p.unmergeBy(function(A){return A.isLoop()});for(var y=function(C){return f[C.id()]},g=function(C,S){f[C.id()]=S,b.updateItem(C)},b=new hn(function(A,C){return y(A)-y(C)}),m=0;m<d.length;m++){var w=d[m];f[w.id()]=w.same(l)?0:1/0,b.push(w)}for(var T=function(C,S){for(var L=(o?C.edgesTo(S):C.edgesWith(S)).intersect(p),V=1/0,F,B=0;B<L.length;B++){var Y=L[B],q=u(Y);(q<V||!F)&&(V=q,F=Y)}return{edge:F,dist:V}};b.size()>0;){var D=b.pop(),x=y(D),N=D.id();if(v[N]=x,x!==1/0)for(var O=D.neighborhood().intersect(d),R=0;R<O.length;R++){var P=O[R],M=P.id(),I=T(D,P),E=x+I.dist;E<y(P)&&(g(P,E),h[M]={node:D,edge:I.edge})}}return{distanceTo:function(C){var S=Me(C)?d.filter(C)[0]:C[0];return v[S.id()]},pathTo:function(C){var S=Me(C)?d.filter(C)[0]:C[0],L=[],V=S,F=V.id();if(S.length>0)for(L.unshift(S);h[F];){var B=h[F];L.unshift(B.edge),L.unshift(B.node),V=B.node,F=V.id()}return s.spawn(L)}}}},Ng={kruskal:function(e){e=e||function(m){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,o=new Array(i),s=a,u=function(w){for(var T=0;T<o.length;T++){var D=o[T];if(D.has(w))return T}},l=0;l<i;l++)o[l]=this.spawn(a[l]);for(var f=n.sort(function(m,w){return e(m)-e(w)}),h=0;h<f.length;h++){var v=f[h],c=v.source()[0],d=v.target()[0],p=u(c),y=u(d),g=o[p],b=o[y];p!==y&&(s.merge(v),g.merge(b),o.splice(y,1))}return s}},Mg=Tt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Rg={aStar:function(e){var r=this.cy(),a=Mg(e),n=a.root,i=a.goal,o=a.heuristic,s=a.directed,u=a.weight;n=r.collection(n)[0],i=r.collection(i)[0];var l=n.id(),f=i.id(),h={},v={},c={},d=new hn(function(F,B){return v[F.id()]-v[B.id()]}),p=new xa,y={},g={},b=function(B,Y){d.push(B),p.add(Y)},m,w,T=function(){m=d.pop(),w=m.id(),p.delete(w)},D=function(B){return p.has(B)};b(n,l),h[l]=0,v[l]=o(n);for(var x=0;d.size()>0;){if(T(),x++,w===f){for(var N=[],O=i,R=f,P=g[R];N.unshift(O),P!=null&&N.unshift(P),O=y[R],O!=null;)R=O.id(),P=g[R];return{found:!0,distance:h[w],path:this.spawn(N),steps:x}}c[w]=!0;for(var M=m._private.edges,I=0;I<M.length;I++){var E=M[I];if(this.hasElementWithId(E.id())&&!(s&&E.data("source")!==w)){var A=E.source(),C=E.target(),S=A.id()!==w?A:C,L=S.id();if(this.hasElementWithId(L)&&!c[L]){var V=h[w]+u(E);if(!D(L)){h[L]=V,v[L]=V+o(S),b(S,L),y[L]=m,g[L]=E;continue}V<h[L]&&(h[L]=V,v[L]=V+o(S),y[L]=m,g[L]=E)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},Og=Tt({weight:function(e){return 1},directed:!1}),Pg={floydWarshall:function(e){for(var r=this.cy(),a=Og(e),n=a.weight,i=a.directed,o=n,s=this.byGroup(),u=s.nodes,l=s.edges,f=u.length,h=f*f,v=function(q){return u.indexOf(q)},c=function(q){return u[q]},d=new Array(h),p=0;p<h;p++){var y=p%f,g=(p-y)/f;g===y?d[p]=0:d[p]=1/0}for(var b=new Array(h),m=new Array(h),w=0;w<l.length;w++){var T=l[w],D=T.source()[0],x=T.target()[0];if(D!==x){var N=v(D),O=v(x),R=N*f+O,P=o(T);if(d[R]>P&&(d[R]=P,b[R]=O,m[R]=T),!i){var M=O*f+N;!i&&d[M]>P&&(d[M]=P,b[M]=N,m[M]=T)}}}for(var I=0;I<f;I++)for(var E=0;E<f;E++)for(var A=E*f+I,C=0;C<f;C++){var S=E*f+C,L=I*f+C;d[A]+d[L]<d[S]&&(d[S]=d[A]+d[L],b[S]=b[A])}var V=function(q){return(Me(q)?r.filter(q):q)[0]},F=function(q){return v(V(q))},B={distance:function(q,Q){var $=F(q),K=F(Q);return d[$*f+K]},path:function(q,Q){var $=F(q),K=F(Q),j=c($);if($===K)return j.collection();if(b[$*f+K]==null)return r.collection();var re=r.collection(),U=$,H;for(re.merge(j);$!==K;)U=$,$=b[$*f+K],H=m[U*f+$],re.merge(H),re.merge(c($));return re}};return B}},Ig=Tt({weight:function(e){return 1},directed:!1,root:null}),kg={bellmanFord:function(e){var r=this,a=Ig(e),n=a.weight,i=a.directed,o=a.root,s=n,u=this,l=this.cy(),f=this.byGroup(),h=f.edges,v=f.nodes,c=v.length,d=new nr,p=!1,y=[];o=l.collection(o)[0],h.unmergeBy(function(ge){return ge.isLoop()});for(var g=h.length,b=function(le){var he=d.get(le.id());return he||(he={},d.set(le.id(),he)),he},m=function(le){return(Me(le)?l.$(le):le)[0]},w=function(le){return b(m(le)).dist},T=function(le){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,fe=m(le),ve=[],ye=fe;;){if(ye==null)return r.spawn();var me=b(ye),xe=me.edge,Le=me.pred;if(ve.unshift(ye[0]),ye.same(he)&&ve.length>0)break;xe!=null&&ve.unshift(xe),ye=Le}return u.spawn(ve)},D=0;D<c;D++){var x=v[D],N=b(x);x.same(o)?N.dist=0:N.dist=1/0,N.pred=null,N.edge=null}for(var O=!1,R=function(le,he,fe,ve,ye,me){var xe=ve.dist+me;xe<ye.dist&&!fe.same(ve.edge)&&(ye.dist=xe,ye.pred=le,ye.edge=fe,O=!0)},P=1;P<c;P++){O=!1;for(var M=0;M<g;M++){var I=h[M],E=I.source(),A=I.target(),C=s(I),S=b(E),L=b(A);R(E,A,I,S,L,C),i||R(A,E,I,L,S,C)}if(!O)break}if(O)for(var V=[],F=0;F<g;F++){var B=h[F],Y=B.source(),q=B.target(),Q=s(B),$=b(Y).dist,K=b(q).dist;if($+Q<K||!i&&K+Q<$)if(p||(Ke("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var j=[];$+Q<K&&j.push(Y),!i&&K+Q<$&&j.push(q);for(var re=j.length,U=0;U<re;U++){var H=j[U],_=[H];_.push(b(H).edge);for(var W=b(H).pred;_.indexOf(W)===-1;)_.push(W),_.push(b(W).edge),W=b(W).pred;_=_.slice(_.indexOf(W));for(var J=_[0].id(),te=0,de=2;de<_.length;de+=2)_[de].id()<J&&(J=_[de].id(),te=de);_=_.slice(te).concat(_.slice(0,te)),_.push(_[0]);var Te=_.map(function(ge){return ge.id()}).join(",");V.indexOf(Te)===-1&&(y.push(u.spawn(_)),V.push(Te))}}else break}return{distanceTo:w,pathTo:T,hasNegativeWeightCycle:p,negativeWeightCycles:y}}},Bg=Math.sqrt(2),Fg=function(e,r,a){a.length===0&&nt("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],o=n[2],s=r[i],u=r[o],l=a,f=l.length-1;f>=0;f--){var h=l[f],v=h[1],c=h[2];(r[v]===s&&r[c]===u||r[v]===u&&r[c]===s)&&l.splice(f,1)}for(var d=0;d<l.length;d++){var p=l[d];p[1]===u?(l[d]=p.slice(),l[d][1]=s):p[2]===u&&(l[d]=p.slice(),l[d][2]=s)}for(var y=0;y<r.length;y++)r[y]===u&&(r[y]=s);return l},Zi=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=Fg(i,e,r),a--}return r},zg={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(L){return L.isLoop()});var i=a.length,o=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/Bg);if(i<2){nt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<o;f++){var h=n[f];l.push([f,a.indexOf(h.source()),a.indexOf(h.target())])}for(var v=1/0,c=[],d=new Array(i),p=new Array(i),y=new Array(i),g=function(V,F){for(var B=0;B<i;B++)F[B]=V[B]},b=0;b<=s;b++){for(var m=0;m<i;m++)p[m]=m;var w=Zi(p,l.slice(),i,u),T=w.slice();g(p,y);var D=Zi(p,w,u,2),x=Zi(y,T,u,2);D.length<=x.length&&D.length<v?(v=D.length,c=D,g(p,d)):x.length<=D.length&&x.length<v&&(v=x.length,c=x,g(y,d))}for(var N=this.spawn(c.map(function(L){return n[L[0]]})),O=this.spawn(),R=this.spawn(),P=d[0],M=0;M<d.length;M++){var I=d[M],E=a[M];I===P?O.merge(E):R.merge(E)}var A=function(V){var F=e.spawn();return V.forEach(function(B){F.merge(B),B.connectedEdges().forEach(function(Y){e.contains(Y)&&!N.contains(Y)&&F.merge(Y)})}),F},C=[A(O),A(R)],S={cut:N,components:C,partition1:O,partition2:R};return S}},Qi,Vg=function(e){return{x:e.x,y:e.y}},di=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},$h=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},oa=function(e){return{x:e[0],y:e[1]}},Gg=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.min(o,n))}return n},Ug=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},Hg=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,o=r;o<a;o++){var s=e[o];isFinite(s)&&(n+=s,i++)}return n/i},Yg=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));for(var s=0,u=e.length-1;u>=0;u--){var l=e[u];o?isFinite(l)||(e[u]=-1/0,s++):e.splice(u,1)}i&&e.sort(function(v,c){return v-c});var f=e.length,h=Math.floor(f/2);return f%2!==0?e[h+1+s]:(e[h-1+s]+e[h+s])/2},qg=function(e){return Math.PI*e/180},xn=function(e,r){return Math.atan2(r,e)-Math.PI/2},Ks=Math.log2||function(t){return Math.log(t)/Math.log(2)},Zs=function(e){return e>0?1:e<0?-1:0},Hr=function(e,r){return Math.sqrt(kr(e,r))},kr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},_g=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},mt=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},la=function(e,r,a,n){return{x:mt(e.x,r.x,a.x,n),y:mt(e.y,r.y,a.y,n)}},Wg=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=Hr(e,r),s={x:i.x/o,y:i.y/o};return a=a??0,n=n??a*o,{x:e.x+s.x*n,y:e.y+s.y*n}},Za=function(e,r,a){return Math.max(e,Math.min(a,r))},Rt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Xg=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},$g=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Kg=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},Kh=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},Bn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Fn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,o;if(r.length===1)a=n=i=o=r[0];else if(r.length===2)a=i=r[0],o=n=r[1];else if(r.length===4){var s=ft(r,4);a=s[0],n=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Wu=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Qs=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},gr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},Xu=function(e,r){return gr(e,r.x,r.y)},Zh=function(e,r){return gr(e,r.x1,r.y1)&&gr(e,r.x2,r.y2)},Zg=(Qi=Math.hypot)!==null&&Qi!==void 0?Qi:function(t,e){return Math.sqrt(t*t+e*e)};function Qg(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(N,O){return{x:N.x+O.x,y:N.y+O.y}},a=function(N,O){return{x:N.x-O.x,y:N.y-O.y}},n=function(N,O){return{x:N.x*O,y:N.y*O}},i=function(N,O){return N.x*O.y-N.y*O.x},o=function(N){var O=Zg(N.x,N.y);return O===0?{x:0,y:0}:{x:N.x/O,y:N.y/O}},s=function(N){for(var O=0,R=0;R<N.length;R++){var P=N[R],M=N[(R+1)%N.length];O+=P.x*M.y-M.x*P.y}return O/2},u=function(N,O,R,P){var M=a(O,N),I=a(P,R),E=i(M,I);if(Math.abs(E)<1e-9)return r(N,n(M,.5));var A=i(a(R,N),I)/E;return r(N,n(M,A))},l=t.map(function(x){return{x:x.x,y:x.y}});s(l)<0&&l.reverse();for(var f=l.length,h=[],v=0;v<f;v++){var c=l[v],d=l[(v+1)%f],p=a(d,c),y=o({x:p.y,y:-p.x});h.push(y)}for(var g=h.map(function(x,N){var O=r(l[N],n(x,e)),R=r(l[(N+1)%f],n(x,e));return{p1:O,p2:R}}),b=[],m=0;m<f;m++){var w=g[(m-1+f)%f],T=g[m],D=u(w.p1,w.p2,T.p1,T.p2);b.push(D)}return b}function Jg(t,e,r,a,n,i){var o=sp(t,e,r,a,n),s=Qg(o,i),u=Rt();return s.forEach(function(l){return Kh(u,l.x,l.y)}),u}var Qh=function(e,r,a,n,i,o,s){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?Er(i,o):u,f=i/2,h=o/2;l=Math.min(l,f,h);var v=l!==f,c=l!==h,d;if(v){var p=a-f+l-s,y=n-h-s,g=a+f-l+s,b=y;if(d=pr(e,r,a,n,p,y,g,b,!1),d.length>0)return d}if(c){var m=a+f+s,w=n-h+l-s,T=m,D=n+h-l+s;if(d=pr(e,r,a,n,m,w,T,D,!1),d.length>0)return d}if(v){var x=a-f+l-s,N=n+h+s,O=a+f-l+s,R=N;if(d=pr(e,r,a,n,x,N,O,R,!1),d.length>0)return d}if(c){var P=a-f-s,M=n-h+l-s,I=P,E=n+h-l+s;if(d=pr(e,r,a,n,P,M,I,E,!1),d.length>0)return d}var A;{var C=a-f+l,S=n-h+l;if(A=Ga(e,r,a,n,C,S,l+s),A.length>0&&A[0]<=C&&A[1]<=S)return[A[0],A[1]]}{var L=a+f-l,V=n-h+l;if(A=Ga(e,r,a,n,L,V,l+s),A.length>0&&A[0]>=L&&A[1]<=V)return[A[0],A[1]]}{var F=a+f-l,B=n+h-l;if(A=Ga(e,r,a,n,F,B,l+s),A.length>0&&A[0]>=F&&A[1]>=B)return[A[0],A[1]]}{var Y=a-f+l,q=n+h-l;if(A=Ga(e,r,a,n,Y,q,l+s),A.length>0&&A[0]<=Y&&A[1]>=q)return[A[0],A[1]]}return[]},jg=function(e,r,a,n,i,o,s){var u=s,l=Math.min(a,i),f=Math.max(a,i),h=Math.min(n,o),v=Math.max(n,o);return l-u<=e&&e<=f+u&&h-u<=r&&r<=v+u},ep=function(e,r,a,n,i,o,s,u,l){var f={x1:Math.min(a,s,i)-l,x2:Math.max(a,s,i)+l,y1:Math.min(n,u,o)-l,y2:Math.max(n,u,o)+l};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},tp=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var o=Math.sqrt(i),s=2*e,u=(-r+o)/s,l=(-r-o)/s;return[u,l]},rp=function(e,r,a,n,i){var o=1e-5;e===0&&(e=o),r/=e,a/=e,n/=e;var s,u,l,f,h,v,c,d;if(u=(3*a-r*r)/9,l=-(27*n)+r*(9*a-2*(r*r)),l/=54,s=u*u*u+l*l,i[1]=0,c=r/3,s>0){h=l+Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),v=l-Math.sqrt(s),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),i[0]=-c+h+v,c+=(h+v)/2,i[4]=i[2]=-c,c=Math.sqrt(3)*(-v+h)/2,i[3]=c,i[5]=-c;return}if(i[5]=i[3]=0,s===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-c+2*d,i[4]=i[2]=-(d+c);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),d=2*Math.sqrt(u),i[0]=-c+d*Math.cos(f/3),i[2]=-c+d*Math.cos((f+2*Math.PI)/3),i[4]=-c+d*Math.cos((f+4*Math.PI)/3)},ap=function(e,r,a,n,i,o,s,u){var l=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*u+4*o*o-4*o*u+u*u,f=9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*u-6*o*o+3*o*u,h=3*a*a-6*a*i+a*s-a*e+2*i*i+2*i*e-s*e+3*n*n-6*n*o+n*u-n*r+2*o*o+2*o*r-u*r,v=1*a*i-a*a+a*e-i*e+n*o-n*n+n*r-o*r,c=[];rp(l,f,h,v,c);for(var d=1e-7,p=[],y=0;y<6;y+=2)Math.abs(c[y+1])<d&&c[y]>=0&&c[y]<=1&&p.push(c[y]);p.push(1),p.push(0);for(var g=-1,b,m,w,T=0;T<p.length;T++)b=Math.pow(1-p[T],2)*a+2*(1-p[T])*p[T]*i+p[T]*p[T]*s,m=Math.pow(1-p[T],2)*n+2*(1-p[T])*p[T]*o+p[T]*p[T]*u,w=Math.pow(b-e,2)+Math.pow(m-r,2),g>=0?w<g&&(g=w):g=w;return g},np=function(e,r,a,n,i,o){var s=[e-a,r-n],u=[i-a,o-n],l=u[0]*u[0]+u[1]*u[1],f=s[0]*s[0]+s[1]*s[1],h=s[0]*u[0]+s[1]*u[1],v=h*h/l;return h<0?f:v>l?(e-i)*(e-i)+(r-o)*(r-o):f-v},It=function(e,r,a){for(var n,i,o,s,u,l=0,f=0;f<a.length/2;f++)if(n=a[f*2],i=a[f*2+1],f+1<a.length/2?(o=a[(f+1)*2],s=a[(f+1)*2+1]):(o=a[(f+1-a.length/2)*2],s=a[(f+1-a.length/2)*2+1]),!(n==e&&o==e))if(n>=e&&e>=o||n<=e&&e<=o)u=(e-n)/(o-n)*(s-i)+i,u>r&&l++;else continue;return l%2!==0},or=function(e,r,a,n,i,o,s,u,l){var f=new Array(a.length),h;u[0]!=null?(h=Math.atan(u[1]/u[0]),u[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=u;for(var v=Math.cos(-h),c=Math.sin(-h),d=0;d<f.length/2;d++)f[d*2]=o/2*(a[d*2]*v-a[d*2+1]*c),f[d*2+1]=s/2*(a[d*2+1]*v+a[d*2]*c),f[d*2]+=n,f[d*2+1]+=i;var p;if(l>0){var y=jn(f,-l);p=Jn(y)}else p=f;return It(e,r,p)},ip=function(e,r,a,n,i,o,s,u){for(var l=new Array(a.length*2),f=0;f<u.length;f++){var h=u[f];l[f*4+0]=h.startX,l[f*4+1]=h.startY,l[f*4+2]=h.stopX,l[f*4+3]=h.stopY;var v=Math.pow(h.cx-e,2)+Math.pow(h.cy-r,2);if(v<=Math.pow(h.radius,2))return!0}return It(e,r,l)},Jn=function(e){for(var r=new Array(e.length/2),a,n,i,o,s,u,l,f,h=0;h<e.length/4;h++){a=e[h*4],n=e[h*4+1],i=e[h*4+2],o=e[h*4+3],h<e.length/4-1?(s=e[(h+1)*4],u=e[(h+1)*4+1],l=e[(h+1)*4+2],f=e[(h+1)*4+3]):(s=e[0],u=e[1],l=e[2],f=e[3]);var v=pr(a,n,i,o,s,u,l,f,!0);r[h*2]=v[0],r[h*2+1]=v[1]}return r},jn=function(e,r){for(var a=new Array(e.length*2),n,i,o,s,u=0;u<e.length/2;u++){n=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],s=e[(u+1)*2+1]):(o=e[0],s=e[1]);var l=s-i,f=-(o-n),h=Math.sqrt(l*l+f*f),v=l/h,c=f/h;a[u*4]=n+v*r,a[u*4+1]=i+c*r,a[u*4+2]=o+v*r,a[u*4+3]=s+c*r}return a},op=function(e,r,a,n,i,o){var s=a-e,u=n-r;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),f=l-1;if(f<0)return[];var h=f/l;return[(a-e)*h+e,(n-r)*h+r]},Gr=function(e,r,a,n,i,o,s){return e-=i,r-=o,e/=a/2+s,r/=n/2+s,e*e+r*r<=1},Ga=function(e,r,a,n,i,o,s){var u=[a-e,n-r],l=[e-i,r-o],f=u[0]*u[0]+u[1]*u[1],h=2*(l[0]*u[0]+l[1]*u[1]),v=l[0]*l[0]+l[1]*l[1]-s*s,c=h*h-4*f*v;if(c<0)return[];var d=(-h+Math.sqrt(c))/(2*f),p=(-h-Math.sqrt(c))/(2*f),y=Math.min(d,p),g=Math.max(d,p),b=[];if(y>=0&&y<=1&&b.push(y),g>=0&&g<=1&&b.push(g),b.length===0)return[];var m=b[0]*u[0]+e,w=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[m,w];var T=b[1]*u[0]+e,D=b[1]*u[1]+r;return[m,w,T,D]}else return[m,w]},Ji=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},pr=function(e,r,a,n,i,o,s,u,l){var f=e-i,h=a-e,v=s-i,c=r-o,d=n-r,p=u-o,y=v*c-p*f,g=h*c-d*f,b=p*h-v*d;if(b!==0){var m=y/b,w=g/b,T=.001,D=0-T,x=1+T;return D<=m&&m<=x&&D<=w&&w<=x?[e+m*h,r+m*d]:l?[e+m*h,r+m*d]:[]}else return y===0||g===0?Ji(e,a,s)===s?[s,u]:Ji(e,a,i)===i?[i,o]:Ji(i,s,a)===a?[a,n]:[]:[]},sp=function(e,r,a,n,i){var o=[],s=n/2,u=i/2,l=r,f=a;o.push({x:l+s*e[0],y:f+u*e[1]});for(var h=1;h<e.length/2;h++)o.push({x:l+s*e[h*2],y:f+u*e[h*2+1]});return o},Qa=function(e,r,a,n,i,o,s,u){var l=[],f,h=new Array(a.length),v=!0;o==null&&(v=!1);var c;if(v){for(var d=0;d<h.length/2;d++)h[d*2]=a[d*2]*o+n,h[d*2+1]=a[d*2+1]*s+i;if(u>0){var p=jn(h,-u);c=Jn(p)}else c=h}else c=a;for(var y,g,b,m,w=0;w<c.length/2;w++)y=c[w*2],g=c[w*2+1],w<c.length/2-1?(b=c[(w+1)*2],m=c[(w+1)*2+1]):(b=c[0],m=c[1]),f=pr(e,r,n,i,y,g,b,m),f.length!==0&&l.push(f[0],f[1]);return l},up=function(e,r,a,n,i,o,s,u,l){var f=[],h,v=new Array(a.length*2);l.forEach(function(b,m){m===0?(v[v.length-2]=b.startX,v[v.length-1]=b.startY):(v[m*4-2]=b.startX,v[m*4-1]=b.startY),v[m*4]=b.stopX,v[m*4+1]=b.stopY,h=Ga(e,r,n,i,b.cx,b.cy,b.radius),h.length!==0&&f.push(h[0],h[1])});for(var c=0;c<v.length/4;c++)h=pr(e,r,n,i,v[c*4],v[c*4+1],v[c*4+2],v[c*4+3],!1),h.length!==0&&f.push(h[0],h[1]);if(f.length>2){for(var d=[f[0],f[1]],p=Math.pow(d[0]-e,2)+Math.pow(d[1]-r,2),y=1;y<f.length/2;y++){var g=Math.pow(f[y*2]-e,2)+Math.pow(f[y*2+1]-r,2);g<=p&&(d[0]=f[y*2],d[1]=f[y*2+1],p=g)}return d}return f},Tn=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),o=(i-a)/i;return o<0&&(o=1e-5),[r[0]+o*n[0],r[1]+o*n[1]]},Nt=function(e,r){var a=Es(e,r);return a=Jh(a),a},Jh=function(e){for(var r,a,n=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<n;l++)r=e[2*l],a=e[2*l+1],i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);for(var f=2/(s-i),h=2/(u-o),v=0;v<n;v++)r=e[2*v]=e[2*v]*f,a=e[2*v+1]=e[2*v+1]*h,i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);if(o<-1)for(var c=0;c<n;c++)a=e[2*c+1]=e[2*c+1]+(-1-o);return e},Es=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*a+n,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Er=function(e,r){return Math.min(e/4,r/4,8)},jh=function(e,r){return Math.min(e/10,r/10,8)},Js=function(){return 8},lp=function(e,r,a){return[e-2*r+a,2*(r-e),e]},xs=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function ji(t,e){function r(h){for(var v=[],c=0;c<h.length;c++){var d=h[c],p=h[(c+1)%h.length],y={x:p.x-d.x,y:p.y-d.y},g={x:-y.y,y:y.x},b=Math.sqrt(g.x*g.x+g.y*g.y);v.push({x:g.x/b,y:g.y/b})}return v}function a(h,v){var c=1/0,d=-1/0,p=kt(h),y;try{for(p.s();!(y=p.n()).done;){var g=y.value,b=g.x*v.x+g.y*v.y;c=Math.min(c,b),d=Math.max(d,b)}}catch(m){p.e(m)}finally{p.f()}return{min:c,max:d}}function n(h,v){return!(h.max<v.min||v.max<h.min)}var i=[].concat($n(r(t)),$n(r(e))),o=kt(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=a(t,u),f=a(e,u);if(!n(l,f))return!1}}catch(h){o.e(h)}finally{o.f()}return!0}var fp=Tt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),hp={pageRank:function(e){for(var r=fp(e),a=r.dampingFactor,n=r.precision,i=r.iterations,o=r.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,h=l.length,v=h*h,c=f.length,d=new Array(v),p=new Array(h),y=(1-a)/h,g=0;g<h;g++){for(var b=0;b<h;b++){var m=g*h+b;d[m]=0}p[g]=0}for(var w=0;w<c;w++){var T=f[w],D=T.data("source"),x=T.data("target");if(D!==x){var N=l.indexOfId(D),O=l.indexOfId(x),R=o(T),P=O*h+N;d[P]+=R,p[N]+=R}}for(var M=1/h+y,I=0;I<h;I++)if(p[I]===0)for(var E=0;E<h;E++){var A=E*h+I;d[A]=M}else for(var C=0;C<h;C++){var S=C*h+I;d[S]=d[S]/p[I]+y}for(var L=new Array(h),V=new Array(h),F,B=0;B<h;B++)L[B]=1;for(var Y=0;Y<i;Y++){for(var q=0;q<h;q++)V[q]=0;for(var Q=0;Q<h;Q++)for(var $=0;$<h;$++){var K=Q*h+$;V[Q]+=d[K]*L[$]}_g(V),F=L,L=V,V=F;for(var j=0,re=0;re<h;re++){var U=F[re]-L[re];j+=U*U}if(j<n)break}var H={rank:function(W){return W=s.collection(W)[0],L[l.indexOf(W)]}};return H}},$u=Tt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),fa={degreeCentralityNormalized:function(e){e=$u(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},h={},v=0,c=0,d=0;d<n;d++){var p=a[d],y=p.id();e.root=p;var g=this.degreeCentrality(e);v<g.indegree&&(v=g.indegree),c<g.outdegree&&(c=g.outdegree),f[y]=g.indegree,h[y]=g.outdegree}return{indegree:function(m){return v==0?0:(Me(m)&&(m=r.filter(m)),f[m.id()]/v)},outdegree:function(m){return c===0?0:(Me(m)&&(m=r.filter(m)),h[m.id()]/c)}}}else{for(var i={},o=0,s=0;s<n;s++){var u=a[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:function(m){return o===0?0:(Me(m)&&(m=r.filter(m)),i[m.id()]/o)}}}},degreeCentrality:function(e){e=$u(e);var r=this.cy(),a=this,n=e,i=n.root,o=n.weight,s=n.directed,u=n.alpha;if(i=r.collection(i)[0],s){for(var c=i.connectedEdges(),d=c.filter(function(D){return D.target().same(i)&&a.has(D)}),p=c.filter(function(D){return D.source().same(i)&&a.has(D)}),y=d.length,g=p.length,b=0,m=0,w=0;w<d.length;w++)b+=o(d[w]);for(var T=0;T<p.length;T++)m+=o(p[T]);return{indegree:Math.pow(y,1-u)*Math.pow(b,u),outdegree:Math.pow(g,1-u)*Math.pow(m,u)}}else{for(var l=i.connectedEdges().intersection(a),f=l.length,h=0,v=0;v<l.length;v++)h+=o(l[v]);return{degree:Math.pow(f,1-u)*Math.pow(h,u)}}}};fa.dc=fa.degreeCentrality;fa.dcn=fa.degreeCentralityNormalised=fa.degreeCentralityNormalized;var Ku=Tt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),ha={closenessCentralityNormalized:function(e){for(var r=Ku(e),a=r.harmonic,n=r.weight,i=r.directed,o=this.cy(),s={},u=0,l=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),h=0;h<l.length;h++){for(var v=0,c=l[h],d=0;d<l.length;d++)if(h!==d){var p=f.distance(c,l[d]);a?v+=1/p:v+=p}a||(v=1/v),u<v&&(u=v),s[c.id()]=v}return{closeness:function(g){return u==0?0:(Me(g)?g=o.filter(g)[0].id():g=g.id(),s[g]/u)}}},closenessCentrality:function(e){var r=Ku(e),a=r.root,n=r.weight,i=r.directed,o=r.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:i}),u=0,l=this.nodes(),f=0;f<l.length;f++){var h=l[f];if(!h.same(a)){var v=s.distanceTo(h);o?u+=1/v:u+=v}}return o?u:1/u}};ha.cc=ha.closenessCentrality;ha.ccn=ha.closenessCentralityNormalised=ha.closenessCentralityNormalized;var cp=Tt({weight:null,directed:!1}),Ts={betweennessCentrality:function(e){for(var r=cp(e),a=r.directed,n=r.weight,i=n!=null,o=this.cy(),s=this.nodes(),u={},l={},f=0,h={set:function(m,w){l[m]=w,w>f&&(f=w)},get:function(m){return l[m]}},v=0;v<s.length;v++){var c=s[v],d=c.id();a?u[d]=c.outgoers().nodes():u[d]=c.openNeighborhood().nodes(),h.set(d,0)}for(var p=function(){for(var m=s[y].id(),w=[],T={},D={},x={},N=new hn(function(Q,$){return x[Q]-x[$]}),O=0;O<s.length;O++){var R=s[O].id();T[R]=[],D[R]=0,x[R]=1/0}for(D[m]=1,x[m]=0,N.push(m);!N.empty();){var P=N.pop();if(w.push(P),i)for(var M=0;M<u[P].length;M++){var I=u[P][M],E=o.getElementById(P),A=void 0;E.edgesTo(I).length>0?A=E.edgesTo(I)[0]:A=I.edgesTo(E)[0];var C=n(A);I=I.id(),x[I]>x[P]+C&&(x[I]=x[P]+C,N.nodes.indexOf(I)<0?N.push(I):N.updateItem(I),D[I]=0,T[I]=[]),x[I]==x[P]+C&&(D[I]=D[I]+D[P],T[I].push(P))}else for(var S=0;S<u[P].length;S++){var L=u[P][S].id();x[L]==1/0&&(N.push(L),x[L]=x[P]+1),x[L]==x[P]+1&&(D[L]=D[L]+D[P],T[L].push(P))}}for(var V={},F=0;F<s.length;F++)V[s[F].id()]=0;for(;w.length>0;){for(var B=w.pop(),Y=0;Y<T[B].length;Y++){var q=T[B][Y];V[q]=V[q]+D[q]/D[B]*(1+V[B])}B!=s[y].id()&&h.set(B,h.get(B)+V[B])}},y=0;y<s.length;y++)p();var g={betweenness:function(m){var w=o.collection(m).id();return h.get(w)},betweennessNormalized:function(m){if(f==0)return 0;var w=o.collection(m).id();return h.get(w)/f}};return g.betweennessNormalised=g.betweennessNormalized,g}};Ts.bc=Ts.betweennessCentrality;var vp=Tt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),dp=function(e){return vp(e)},gp=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},pp=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},ec=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var o=0;o<r;o++)e[o*r+n]=e[o*r+n]/a}},yp=function(e,r,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var o=0;o<a;o++)n[i*a+o]=0;for(var s=0;s<a;s++)for(var u=0;u<a;u++)n[i*a+u]+=e[i*a+s]*r[s*a+u]}return n},mp=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=yp(e,n,r);return e},bp=function(e,r,a){for(var n=new Array(r*r),i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return ec(n,r),n},wp=function(e,r,a,n){for(var i=0;i<a;i++){var o=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),s=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(o!==s)return!1}return!0},Ep=function(e,r,a,n){for(var i=[],o=0;o<r;o++){for(var s=[],u=0;u<r;u++)Math.round(e[o*r+u]*1e3)/1e3>0&&s.push(a[u]);s.length!==0&&i.push(n.collection(s))}return i},xp=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},Tp=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&xp(e[r],e[a])&&e.splice(a,1);return e},Zu=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=dp(e),o={},s=0;s<r.length;s++)o[r[s].id()]=s;for(var u=r.length,l=u*u,f=new Array(l),h,v=0;v<l;v++)f[v]=0;for(var c=0;c<a.length;c++){var d=a[c],p=o[d.source().id()],y=o[d.target().id()],g=gp(d,i.attributes);f[p*u+y]+=g,f[y*u+p]+=g}pp(f,u,i.multFactor),ec(f,u);for(var b=!0,m=0;b&&m<i.maxIterations;)b=!1,h=mp(f,u,i.expandFactor),f=bp(h,u,i.inflateFactor),wp(f,h,l,4)||(b=!0),m++;var w=Ep(f,u,r,n);return w=Tp(w),w},Cp={markovClustering:Zu,mcl:Zu},Sp=function(e){return e},tc=function(e,r){return Math.abs(r-e)},Qu=function(e,r,a){return e+tc(r,a)},Ju=function(e,r,a){return e+Math.pow(a-r,2)},Dp=function(e){return Math.sqrt(e)},Ap=function(e,r,a){return Math.max(e,tc(r,a))},Pa=function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Sp,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},pa={euclidean:function(e,r,a){return e>=2?Pa(e,r,a,0,Ju,Dp):Pa(e,r,a,0,Qu)},squaredEuclidean:function(e,r,a){return Pa(e,r,a,0,Ju)},manhattan:function(e,r,a){return Pa(e,r,a,0,Qu)},max:function(e,r,a){return Pa(e,r,a,-1/0,Ap)}};pa["squared-euclidean"]=pa.squaredEuclidean;pa.squaredeuclidean=pa.squaredEuclidean;function gi(t,e,r,a,n,i){var o;return it(t)?o=t:o=pa[t]||pa.euclidean,e===0&&it(t)?o(n,i):o(e,r,a,n,i)}var Lp=Tt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),js=function(e){return Lp(e)},ei=function(e,r,a,n,i){var o=i!=="kMedoids",s=o?function(h){return a[h]}:function(h){return n[h](a)},u=function(v){return n[v](r)},l=a,f=r;return gi(e,n.length,s,u,l,f)},eo=function(e,r,a){for(var n=a.length,i=new Array(n),o=new Array(n),s=new Array(r),u=null,l=0;l<n;l++)i[l]=e.min(a[l]).value,o[l]=e.max(a[l]).value;for(var f=0;f<r;f++){u=[];for(var h=0;h<n;h++)u[h]=Math.random()*(o[h]-i[h])+i[h];s[f]=u}return s},rc=function(e,r,a,n,i){for(var o=1/0,s=0,u=0;u<r.length;u++){var l=ei(a,e,r[u],n,i);l<o&&(o=l,s=u)}return s},ac=function(e,r,a){for(var n=[],i=null,o=0;o<r.length;o++)i=r[o],a[i.id()]===e&&n.push(i);return n},Np=function(e,r,a){return Math.abs(r-e)<=a},Mp=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var o=Math.abs(e[n][i]-r[n][i]);if(o>a)return!1}return!0},Rp=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},ju=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var i=e[Math.floor(Math.random()*e.length)];Rp(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var o=0;o<r;o++)a[o]=e[Math.floor(Math.random()*e.length)];return a},el=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=ei("manhattan",r[i],e,a,"kMedoids");return n},Op=function(e){var r=this.cy(),a=this.nodes(),n=null,i=js(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=eo(a,i.k,i.attributes)):dt(i.testCentroids)==="object"?u=i.testCentroids:u=eo(a,i.k,i.attributes):u=eo(a,i.k,i.attributes);for(var l=!0,f=0;l&&f<i.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],s[n.id()]=rc(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var v=0;v<i.k;v++){var c=ac(v,a,s);if(c.length!==0){for(var d=i.attributes.length,p=u[v],y=new Array(d),g=new Array(d),b=0;b<d;b++){g[b]=0;for(var m=0;m<c.length;m++)n=c[m],g[b]+=i.attributes[b](n);y[b]=g[b]/c.length,Np(y[b],p[b],i.sensitivityThreshold)||(l=!0)}u[v]=y,o[v]=r.collection(c)}}f++}return o},Pp=function(e){var r=this.cy(),a=this.nodes(),n=null,i=js(e),o=new Array(i.k),s,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(dt(i.testCentroids)==="object"?s=i.testCentroids:s=ju(a,i.k)):s=ju(a,i.k);for(var h=!0,v=0;h&&v<i.maxIterations;){for(var c=0;c<a.length;c++)n=a[c],u[n.id()]=rc(n,s,i.distance,i.attributes,"kMedoids");h=!1;for(var d=0;d<s.length;d++){var p=ac(d,a,u);if(p.length!==0){f[d]=el(s[d],p,i.attributes);for(var y=0;y<p.length;y++)l=el(p[y],p,i.attributes),l<f[d]&&(f[d]=l,s[d]=p[y],h=!0);o[d]=r.collection(p)}}v++}return o},Ip=function(e,r,a,n,i){for(var o,s,u=0;u<r.length;u++)for(var l=0;l<e.length;l++)n[u][l]=Math.pow(a[u][l],i.m);for(var f=0;f<e.length;f++)for(var h=0;h<i.attributes.length;h++){o=0,s=0;for(var v=0;v<r.length;v++)o+=n[v][f]*i.attributes[h](r[v]),s+=n[v][f];e[f][h]=o/s}},kp=function(e,r,a,n,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var s,u,l,f=2/(i.m-1),h=0;h<a.length;h++)for(var v=0;v<n.length;v++){s=0;for(var c=0;c<a.length;c++)u=ei(i.distance,n[v],a[h],i.attributes,"cmeans"),l=ei(i.distance,n[v],a[c],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[v][h]=1/s}},Bp=function(e,r,a,n){for(var i=new Array(a.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<r.length;l++){s=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[l][f]>s&&(s=r[l][f],u=f);i[u].push(e[l])}for(var h=0;h<i.length;h++)i[h]=n.collection(i[h]);return i},tl=function(e){var r=this.cy(),a=this.nodes(),n=js(e),i,o,s,u,l;u=new Array(a.length);for(var f=0;f<a.length;f++)u[f]=new Array(n.k);s=new Array(a.length);for(var h=0;h<a.length;h++)s[h]=new Array(n.k);for(var v=0;v<a.length;v++){for(var c=0,d=0;d<n.k;d++)s[v][d]=Math.random(),c+=s[v][d];for(var p=0;p<n.k;p++)s[v][p]=s[v][p]/c}o=new Array(n.k);for(var y=0;y<n.k;y++)o[y]=new Array(n.attributes.length);l=new Array(a.length);for(var g=0;g<a.length;g++)l[g]=new Array(n.k);for(var b=!0,m=0;b&&m<n.maxIterations;)b=!1,Ip(o,a,s,l,n),kp(s,u,o,a,n),Mp(s,u,n.sensitivityThreshold)||(b=!0),m++;return i=Bp(a,s,n,r),{clusters:i,degreeOfMembership:s}},Fp={kMeans:Op,kMedoids:Pp,fuzzyCMeans:tl,fcm:tl},zp=Tt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Vp={single:"min",complete:"max"},Gp=function(e){var r=zp(e),a=Vp[r.linkage];return a!=null&&(r.linkage=a),r},rl=function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(O,R){return gi(i.distance,l.length,function(P){return l[P](O)},function(P){return l[P](R)},O,R)},h=0;h<e.length;h++){var v=e[h].key,c=a[v][n[v]];c<s&&(o=v,s=c)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[o],p=r[n[o]],y;i.mode==="dendrogram"?y={left:d,right:p,key:d.key}:y={value:d.value.concat(p.value),key:d.key},e[d.index]=y,e.splice(p.index,1),r[d.key]=y;for(var g=0;g<e.length;g++){var b=e[g];d.key===b.key?u=1/0:i.linkage==="min"?(u=a[d.key][b.key],a[d.key][b.key]>a[p.key][b.key]&&(u=a[p.key][b.key])):i.linkage==="max"?(u=a[d.key][b.key],a[d.key][b.key]<a[p.key][b.key]&&(u=a[p.key][b.key])):i.linkage==="mean"?u=(a[d.key][b.key]*d.size+a[p.key][b.key]*p.size)/(d.size+p.size):i.mode==="dendrogram"?u=f(b.value,d.value):u=f(b.value[0],d.value[0]),a[d.key][b.key]=a[b.key][d.key]=u}for(var m=0;m<e.length;m++){var w=e[m].key;if(n[w]===d.key||n[w]===p.key){for(var T=w,D=0;D<e.length;D++){var x=e[D].key;a[w][x]<a[w][T]&&(T=x)}n[w]=T}e[m].index=m}return d.key=p.key=d.index=p.index=null,!0},sa=function(e,r,a){e&&(e.value?r.push(e.value):(e.left&&sa(e.left,r),e.right&&sa(e.right,r)))},Cs=function(e,r){if(!e)return"";if(e.left&&e.right){var a=Cs(e.left,r),n=Cs(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},Ss=function(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&sa(e.left,n),e.right&&sa(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&sa(e.left,n),e.right&&sa(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=Ss(e.left,r-1,a)),e.right&&(i=Ss(e.right,r-1,a)),n.concat(i))},al=function(e){for(var r=this.cy(),a=this.nodes(),n=Gp(e),i=n.attributes,o=function(m,w){return gi(n.distance,i.length,function(T){return i[T](m)},function(T){return i[T](w)},m,w)},s=[],u=[],l=[],f=[],h=0;h<a.length;h++){var v={value:n.mode==="dendrogram"?a[h]:[a[h]],key:h,index:h};s[h]=v,f[h]=v,u[h]=[],l[h]=0}for(var c=0;c<s.length;c++)for(var d=0;d<=c;d++){var p=void 0;n.mode==="dendrogram"?p=c===d?1/0:o(s[c].value,s[d].value):p=c===d?1/0:o(s[c].value[0],s[d].value[0]),u[c][d]=p,u[d][c]=p,p<u[c][l[c]]&&(l[c]=d)}for(var y=rl(s,f,u,l,n);y;)y=rl(s,f,u,l,n);var g;return n.mode==="dendrogram"?(g=Ss(s[0],n.dendrogramDepth,r),n.addDendrogram&&Cs(s[0],r)):(g=new Array(s.length),s.forEach(function(b,m){b.key=b.index=null,g[m]=r.collection(b.value)})),g},Up={hierarchicalClustering:al,hca:al},Hp=Tt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Yp=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||nt("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||be(a)||nt("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),Hp(e)},qp=function(e,r,a,n){var i=function(s,u){return n[u](s)};return-gi(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},_p=function(e,r){var a=null;return r==="median"?a=Yg(e):r==="mean"?a=Hg(e):r==="min"?a=Gg(e):r==="max"?a=Ug(e):a=r,a},Wp=function(e,r,a){for(var n=[],i=0;i<e;i++)r[i*e+i]+a[i*e+i]>0&&n.push(i);return n},nl=function(e,r,a){for(var n=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<a.length;u++){var l=a[u];r[i*e+l]>s&&(o=l,s=r[i*e+l])}o>0&&n.push(o)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},Xp=function(e,r,a){for(var n=nl(e,r,a),i=0;i<a.length;i++){for(var o=[],s=0;s<n.length;s++)n[s]===a[i]&&o.push(s);for(var u=-1,l=-1/0,f=0;f<o.length;f++){for(var h=0,v=0;v<o.length;v++)h+=r[o[v]*e+o[f]];h>l&&(u=f,l=h)}a[i]=o[u]}return n=nl(e,r,a),n},il=function(e){for(var r=this.cy(),a=this.nodes(),n=Yp(e),i={},o=0;o<a.length;o++)i[a[o].id()]=o;var s,u,l,f,h,v;s=a.length,u=s*s,l=new Array(u);for(var c=0;c<u;c++)l[c]=-1/0;for(var d=0;d<s;d++)for(var p=0;p<s;p++)d!==p&&(l[d*s+p]=qp(n.distance,a[d],a[p],n.attributes));f=_p(l,n.preference);for(var y=0;y<s;y++)l[y*s+y]=f;h=new Array(u);for(var g=0;g<u;g++)h[g]=0;v=new Array(u);for(var b=0;b<u;b++)v[b]=0;for(var m=new Array(s),w=new Array(s),T=new Array(s),D=0;D<s;D++)m[D]=0,w[D]=0,T[D]=0;for(var x=new Array(s*n.minIterations),N=0;N<x.length;N++)x[N]=0;var O;for(O=0;O<n.maxIterations;O++){for(var R=0;R<s;R++){for(var P=-1/0,M=-1/0,I=-1,E=0,A=0;A<s;A++)m[A]=h[R*s+A],E=v[R*s+A]+l[R*s+A],E>=P?(M=P,P=E,I=A):E>M&&(M=E);for(var C=0;C<s;C++)h[R*s+C]=(1-n.damping)*(l[R*s+C]-P)+n.damping*m[C];h[R*s+I]=(1-n.damping)*(l[R*s+I]-M)+n.damping*m[I]}for(var S=0;S<s;S++){for(var L=0,V=0;V<s;V++)m[V]=v[V*s+S],w[V]=Math.max(0,h[V*s+S]),L+=w[V];L-=w[S],w[S]=h[S*s+S],L+=w[S];for(var F=0;F<s;F++)v[F*s+S]=(1-n.damping)*Math.min(0,L-w[F])+n.damping*m[F];v[S*s+S]=(1-n.damping)*(L-w[S])+n.damping*m[S]}for(var B=0,Y=0;Y<s;Y++){var q=v[Y*s+Y]+h[Y*s+Y]>0?1:0;x[O%n.minIterations*s+Y]=q,B+=q}if(B>0&&(O>=n.minIterations-1||O==n.maxIterations-1)){for(var Q=0,$=0;$<s;$++){T[$]=0;for(var K=0;K<n.minIterations;K++)T[$]+=x[K*s+$];(T[$]===0||T[$]===n.minIterations)&&Q++}if(Q===s)break}}for(var j=Wp(s,h,v),re=Xp(s,l,j),U={},H=0;H<j.length;H++)U[j[H]]=[];for(var _=0;_<a.length;_++){var W=i[a[_].id()],J=re[W];J!=null&&U[J].push(a[_])}for(var te=new Array(j.length),de=0;de<j.length;de++)te[de]=r.collection(U[j[de]]);return te},$p={affinityPropagation:il,ap:il},Kp=Tt({root:void 0,directed:!1}),Zp={hierholzer:function(e){if(!_e(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Kp(e),n=a.root,i=a.directed,o=this,s=!1,u,l,f;n&&(f=Me(n)?this.filter(n)[0].id():n[0].id());var h={},v={};i?o.forEach(function(b){var m=b.id();if(b.isNode()){var w=b.indegree(!0),T=b.outdegree(!0),D=w-T,x=T-w;D==1?u?s=!0:u=m:x==1?l?s=!0:l=m:(x>1||D>1)&&(s=!0),h[m]=[],b.outgoers().forEach(function(N){N.isEdge()&&h[m].push(N.id())})}else v[m]=[void 0,b.target().id()]}):o.forEach(function(b){var m=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(u?l?s=!0:l=m:u=m),h[m]=[],b.connectedEdges().forEach(function(T){return h[m].push(T.id())})}else v[m]=[b.source().id(),b.target().id()]});var c={found:!1,trail:void 0};if(s)return c;if(l&&u)if(i){if(f&&l!=f)return c;f=l}else{if(f&&l!=f&&u!=f)return c;f||(f=l)}else f||(f=o[0].id());var d=function(m){for(var w=m,T=[m],D,x,N;h[w].length;)D=h[w].shift(),x=v[D][0],N=v[D][1],w!=N?(h[N]=h[N].filter(function(O){return O!=D}),w=N):!i&&w!=x&&(h[x]=h[x].filter(function(O){return O!=D}),w=x),T.unshift(D),T.unshift(w);return T},p=[],y=[];for(y=d(f);y.length!=1;)h[y[0]].length==0?(p.unshift(o.getElementById(y.shift())),p.unshift(o.getElementById(y.shift()))):y=d(y.shift()).concat(y);p.unshift(o.getElementById(y.shift()));for(var g in h)if(h[g].length)return c;return c.found=!0,c.trail=this.spawn(p,!0),c}},Cn=function(){var e=this,r={},a=0,n=0,i=[],o=[],s={},u=function(v,c){for(var d=o.length-1,p=[],y=e.spawn();o[d].x!=v||o[d].y!=c;)p.push(o.pop().edge),d--;p.push(o.pop().edge),p.forEach(function(g){var b=g.connectedNodes().intersection(e);y.merge(g),b.forEach(function(m){var w=m.id(),T=m.connectedEdges().intersection(e);y.merge(m),r[w].cutVertex?y.merge(T.filter(function(D){return D.isLoop()})):y.merge(T)})}),i.push(y)},l=function(v,c,d){v===d&&(n+=1),r[c]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(c).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(c)));else{var y,g,b,m;p.forEach(function(w){y=w.source().id(),g=w.target().id(),b=y===c?g:y,b!==d&&(m=w.id(),s[m]||(s[m]=!0,o.push({x:c,y:b,edge:w})),b in r?r[c].low=Math.min(r[c].low,r[b].id):(l(v,b,c),r[c].low=Math.min(r[c].low,r[b].low),r[c].id<=r[b].low&&(r[c].cutVertex=!0,u(c,b))))})}};e.forEach(function(h){if(h.isNode()){var v=h.id();v in r||(n=0,l(v,v),r[v].cutVertex=n>1)}});var f=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(f),components:i}},Qp={hopcroftTarjanBiconnected:Cn,htbc:Cn,htb:Cn,hopcroftTarjanBiconnectedComponents:Cn},Sn=function(){var e=this,r={},a=0,n=[],i=[],o=e.spawn(e),s=function(l){i.push(l),r[l]={index:a,low:a++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(p){var y=p.target().id();y!==l&&(y in r||s(y),r[y].explored||(r[l].low=Math.min(r[l].low,r[y].low)))}),r[l].index===r[l].low){for(var h=e.spawn();;){var v=i.pop();if(h.merge(e.getElementById(v)),r[v].low=r[l].index,r[v].explored=!0,v===l)break}var c=h.edgesWith(h),d=h.merge(c);n.push(d),o=o.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in r||s(l)}}),{cut:o,components:n}},Jp={tarjanStronglyConnected:Sn,tsc:Sn,tscc:Sn,tarjanStronglyConnectedComponents:Sn},nc={};[Ka,Lg,Ng,Rg,Pg,kg,zg,hp,fa,ha,Ts,Cp,Fp,Up,$p,Zp,Qp,Jp].forEach(function(t){Ie(nc,t)});/*!
|
|
@@ -333,4 +333,4 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
333
333
|
* https://github.com/cytoscape/cytoscape.js-dagre
|
|
334
334
|
* License: MIT
|
|
335
335
|
*/function jf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function tw(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=rw(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
336
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,i=u},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw i}}}}function Gs(t){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gs(t)}function rw(t,e){if(t){if(typeof t=="string")return jf(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jf(t,e):void 0}}var aw={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,useDagreEdgeControlPoints:!1,automaticDagreEdgeStyle:!1,dagreEdgeStyle:{"curve-style":"unbundled-bezier","control-point-weights":function(e){return e.scratch("controlPointWeights")},"control-point-distances":function(e){return e.scratch("controlPointDistances")},"edge-distances":"intersection","edge-ends-overlap":!1},animate:!1,animateFilter:function(e,r){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,r){return r},ready:function(){},sort:void 0,stop:function(){}},nw=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];return r.forEach(function(n){Object.keys(n).forEach(function(i){return t[i]=n[i]})}),t},Ev=Object.defineProperty,iw=(t,e,r)=>e in t?Ev(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ow=(t,e)=>{for(var r in e)Ev(t,r,{get:e[r],enumerable:!0})},sw=(t,e,r)=>iw(t,e+"",r),xv={};ow(xv,{Graph:()=>Ut,alg:()=>vu,json:()=>Cv,version:()=>fw});var uw=Object.defineProperty,Tv=(t,e)=>{for(var r in e)uw(t,r,{get:e[r],enumerable:!0})},Ut=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,e){return t.forEach(r=>{e!==void 0?this.setNode(r,e):this.setNode(r)}),this}setNode(t,e){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let e=r=>this.removeEdge(this._edgeObjs[r]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(r=>{this.setParent(r)}),delete this._children[t]),Object.keys(this._in[t]).forEach(e),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e===void 0)e="\0";else{e+="";for(let r=e;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}parent(t){if(this._isCompound){let e=this._parent[t];if(e!=="\0")return e}}children(t="\0"){if(this._isCompound){let e=this._children[t];if(e)return Object.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let e=this._preds[t];if(e)return Object.keys(e)}successors(t){let e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){let e=this.predecessors(t);if(e){let r=new Set(e);for(let a of this.successors(t))r.add(a);return Array.from(r.values())}}isLeaf(t){let e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0}filterNodes(t){let e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,i])=>{t(n)&&e.setNode(n,i)}),Object.values(this._edgeObjs).forEach(n=>{e.hasNode(n.v)&&e.hasNode(n.w)&&e.setEdge(n,this.edge(n))});let r={},a=n=>{let i=this.parent(n);return!i||e.hasNode(i)?(r[n]=i??void 0,i??void 0):i in r?r[i]:a(i)};return this._isCompound&&e.nodes().forEach(n=>e.setParent(n,a(n))),e}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){return t.reduce((r,a)=>(e!==void 0?this.setEdge(r,a,e):this.setEdge(r,a),a)),this}setEdge(t,e,r,a){let n,i,o,s,u=!1;typeof t=="object"&&t!==null&&"v"in t?(n=t.v,i=t.w,o=t.name,arguments.length===2&&(s=e,u=!0)):(n=t,i=e,o=a,arguments.length>2&&(s=r,u=!0)),n=""+n,i=""+i,o!==void 0&&(o=""+o);let l=Ya(this._isDirected,n,i,o);if(l in this._edgeLabels)return u&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(n),this.setNode(i),this._edgeLabels[l]=u?s:this._defaultEdgeLabelFn(n,i,o);let f=lw(this._isDirected,n,i,o);return n=f.v,i=f.w,Object.freeze(f),this._edgeObjs[l]=f,eh(this._preds[i],n),eh(this._sucs[n],i),this._in[i][l]=f,this._out[n][l]=f,this._edgeCount++,this}edge(t,e,r){let a=arguments.length===1?hs(this._isDirected,t):Ya(this._isDirected,t,e,r);return this._edgeLabels[a]}edgeAsObj(t,e,r){let a=arguments.length===1?this.edge(t):this.edge(t,e,r);return typeof a!="object"?{label:a}:a}hasEdge(t,e,r){return(arguments.length===1?hs(this._isDirected,t):Ya(this._isDirected,t,e,r))in this._edgeLabels}removeEdge(t,e,r){let a=arguments.length===1?hs(this._isDirected,t):Ya(this._isDirected,t,e,r),n=this._edgeObjs[a];if(n){let i=n.v,o=n.w;delete this._edgeLabels[a],delete this._edgeObjs[a],th(this._preds[o],i),th(this._sucs[i],o),delete this._in[o][a],delete this._out[i][a],this._edgeCount--}return this}inEdges(t,e){return this.isDirected()?this.filterEdges(this._in[t],t,e):this.nodeEdges(t,e)}outEdges(t,e){return this.isDirected()?this.filterEdges(this._out[t],t,e):this.nodeEdges(t,e)}nodeEdges(t,e){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,e)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,e,r){if(!t)return;let a=Object.values(t);return r?a.filter(n=>n.v===e&&n.w===r||n.v===r&&n.w===e):a}};function eh(t,e){t[e]?t[e]++:t[e]=1}function th(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function Ya(t,e,r,a){let n=""+e,i=""+r;if(!t&&n>i){let o=n;n=i,i=o}return n+""+i+""+(a===void 0?"\0":a)}function lw(t,e,r,a){let n=""+e,i=""+r;if(!t&&n>i){let s=n;n=i,i=s}let o={v:n,w:i};return a&&(o.name=a),o}function hs(t,e){return Ya(t,e.v,e.w,e.name)}var fw="4.0.1",Cv={};Tv(Cv,{read:()=>dw,write:()=>hw});function hw(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:cw(t),edges:vw(t)},r=t.graph();return r!==void 0&&(e.value=structuredClone(r)),e}function cw(t){return t.nodes().map(e=>{let r=t.node(e),a=t.parent(e),n={v:e};return r!==void 0&&(n.value=r),a!==void 0&&(n.parent=a),n})}function vw(t){return t.edges().map(e=>{let r=t.edge(e),a={v:e.v,w:e.w};return e.name!==void 0&&(a.name=e.name),r!==void 0&&(a.value=r),a})}function dw(t){let e=new Ut(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(r=>{e.setNode(r.v,r.value),r.parent&&e.setParent(r.v,r.parent)}),t.edges.forEach(r=>{e.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),e}var vu={};Tv(vu,{CycleException:()=>li,bellmanFord:()=>Sv,components:()=>yw,dijkstra:()=>ui,dijkstraAll:()=>ww,findCycles:()=>Ew,floydWarshall:()=>Tw,isAcyclic:()=>Sw,postorder:()=>Aw,preorder:()=>Lw,prim:()=>Nw,shortestPaths:()=>Mw,tarjan:()=>Av,topsort:()=>Lv});var gw=()=>1;function Sv(t,e,r,a){return pw(t,String(e),r||gw,a||function(n){return t.outEdges(n)})}function pw(t,e,r,a){let n={},i,o=0,s=t.nodes(),u=function(h){let v=r(h);n[h.v].distance+v<n[h.w].distance&&(n[h.w]={distance:n[h.v].distance+v,predecessor:h.v},i=!0)},l=function(){s.forEach(function(h){a(h).forEach(function(v){let c=v.v===h?v.v:v.w,d=c===v.v?v.w:v.v;u({v:c,w:d})})})};s.forEach(function(h){let v=h===e?0:Number.POSITIVE_INFINITY;n[h]={distance:v,predecessor:""}});let f=s.length;for(let h=1;h<f&&(i=!1,o++,l(),!!i);h++);if(o===f-1&&(i=!1,l(),i))throw new Error("The graph contains a negative weight cycle");return n}function yw(t){let e={},r=[],a;function n(i){i in e||(e[i]=!0,a.push(i),t.successors(i).forEach(n),t.predecessors(i).forEach(n))}return t.nodes().forEach(function(i){a=[],n(i),a.length&&r.push(a)}),r}var Dv=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(t=>t.key)}has(t){return t in this._keyIndices}priority(t){let e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){let r=this._keyIndices,a=String(t);if(!(a in r)){let n=this._arr,i=n.length;return r[a]=i,n.push({key:a,priority:e}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){let r=this._keyIndices[t];if(r===void 0)throw new Error(`Key not found: ${t}`);let a=this._arr[r].priority;if(e>a)throw new Error(`New priority is greater than current priority. Key: ${t} Old: ${a} New: ${e}`);this._arr[r].priority=e,this._decrease(r)}_heapify(t){let e=this._arr,r=2*t,a=r+1,n=t;r<e.length&&(n=e[r].priority<e[n].priority?r:n,a<e.length&&(n=e[a].priority<e[n].priority?a:n),n!==t&&(this._swap(t,n),this._heapify(n)))}_decrease(t){let e=this._arr,r=e[t].priority,a;for(;t!==0&&(a=t>>1,!(e[a].priority<r));)this._swap(t,a),t=a}_swap(t,e){let r=this._arr,a=this._keyIndices,n=r[t],i=r[e];r[t]=i,r[e]=n,a[i.key]=t,a[n.key]=e}},mw=()=>1;function ui(t,e,r,a){let n=function(i){return t.outEdges(i)};return bw(t,String(e),r||mw,a||n)}function bw(t,e,r,a){let n={},i=new Dv,o,s,u=function(l){let f=l.v!==o?l.v:l.w,h=n[f],v=r(l),c=s.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+l+" Weight: "+v);c<h.distance&&(h.distance=c,h.predecessor=o,i.decrease(f,c))};for(t.nodes().forEach(function(l){let f=l===e?0:Number.POSITIVE_INFINITY;n[l]={distance:f,predecessor:""},i.add(l,f)});i.size()>0&&(o=i.removeMin(),s=n[o],s.distance!==Number.POSITIVE_INFINITY);)a(o).forEach(u);return n}function ww(t,e,r){return t.nodes().reduce(function(a,n){return a[n]=ui(t,n,e,r),a},{})}function Av(t){let e=0,r=[],a={},n=[];function i(o){let s=a[o]={onStack:!0,lowlink:e,index:e++};if(r.push(o),t.successors(o).forEach(function(u){u in a?a[u].onStack&&(s.lowlink=Math.min(s.lowlink,a[u].index)):(i(u),s.lowlink=Math.min(s.lowlink,a[u].lowlink))}),s.lowlink===s.index){let u=[],l;do l=r.pop(),a[l].onStack=!1,u.push(l);while(o!==l);n.push(u)}}return t.nodes().forEach(function(o){o in a||i(o)}),n}function Ew(t){return Av(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}var xw=()=>1;function Tw(t,e,r){return Cw(t,e||xw,r||function(a){return t.outEdges(a)})}function Cw(t,e,r){let a={},n=t.nodes();return n.forEach(function(i){a[i]={},a[i][i]={distance:0,predecessor:""},n.forEach(function(o){i!==o&&(a[i][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),r(i).forEach(function(o){let s=o.v===i?o.w:o.v,u=e(o);a[i][s]={distance:u,predecessor:i}})}),n.forEach(function(i){let o=a[i];n.forEach(function(s){let u=a[s];n.forEach(function(l){let f=u[i],h=o[l],v=u[l],c=f.distance+h.distance;c<v.distance&&(v.distance=c,v.predecessor=h.predecessor)})})}),a}var li=class extends Error{constructor(...t){super(...t)}};function Lv(t){let e={},r={},a=[];function n(i){if(i in r)throw new li;i in e||(r[i]=!0,e[i]=!0,t.predecessors(i).forEach(n),delete r[i],a.push(i))}if(t.sinks().forEach(n),Object.keys(e).length!==t.nodeCount())throw new li;return a}function Sw(t){try{Lv(t)}catch(e){if(e instanceof li)return!1;throw e}return!0}function Dw(t,e,r,a,n){Array.isArray(e)||(e=[e]);let i=(s=>{var u;return(u=t.isDirected()?t.successors(s):t.neighbors(s))!=null?u:[]}),o={};return e.forEach(function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);n=Nv(t,s,r==="post",o,i,a,n)}),n}function Nv(t,e,r,a,n,i,o){return e in a||(a[e]=!0,r||(o=i(o,e)),n(e).forEach(function(s){o=Nv(t,s,r,a,n,i,o)}),r&&(o=i(o,e))),o}function Mv(t,e,r){return Dw(t,e,r,function(a,n){return a.push(n),a},[])}function Aw(t,e){return Mv(t,e,"post")}function Lw(t,e){return Mv(t,e,"pre")}function Nw(t,e){let r=new Ut,a={},n=new Dv,i;function o(u){let l=u.v===i?u.w:u.v,f=n.priority(l);if(f!==void 0){let h=e(u);h<f&&(a[l]=i,n.decrease(l,h))}}if(t.nodeCount()===0)return r;t.nodes().forEach(function(u){n.add(u,Number.POSITIVE_INFINITY),r.setNode(u)}),n.decrease(t.nodes()[0],0);let s=!1;for(;n.size()>0;){if(i=n.removeMin(),i in a)r.setEdge(i,a[i]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(i).forEach(o)}return r}function Mw(t,e,r,a){return Rw(t,e,r,a??(n=>{let i=t.outEdges(n);return i??[]}))}function Rw(t,e,r,a){if(r===void 0)return ui(t,e,r,a);let n=!1,i=t.nodes();for(let o=0;o<i.length;o++){let s=a(i[o]);for(let u=0;u<s.length;u++){let l=s[u],f=l.v===i[o]?l.v:l.w,h=f===l.v?l.w:l.v;r({v:f,w:h})<0&&(n=!0)}if(n)return Sv(t,e,r,a)}return ui(t,e,r,a)}function La(t,e,r,a){let n=a;for(;t.hasNode(n);)n=du(a);return r.dummy=e,t.setNode(n,r),n}function Ow(t){let e=new Ut().setGraph(t.graph());return t.nodes().forEach(r=>e.setNode(r,t.node(r))),t.edges().forEach(r=>{let a=e.edge(r.v,r.w)||{weight:0,minlen:1},n=t.edge(r);e.setEdge(r.v,r.w,{weight:a.weight+n.weight,minlen:Math.max(a.minlen,n.minlen)})}),e}function Rv(t){let e=new Ut({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(r=>{t.children(r).length||e.setNode(r,t.node(r))}),t.edges().forEach(r=>{e.setEdge(r,t.edge(r))}),e}function rh(t,e){let r=t.x,a=t.y,n=e.x-r,i=e.y-a,o=t.width/2,s=t.height/2;if(!n&&!i)throw new Error("Not possible to find intersection inside of the rectangle");let u,l;return Math.abs(i)*o>Math.abs(n)*s?(i<0&&(s=-s),u=s*n/i,l=s):(n<0&&(o=-o),u=o,l=o*i/n),{x:r+u,y:a+l}}function yn(t){let e=an(Pv(t)+1).map(()=>[]);return t.nodes().forEach(r=>{let a=t.node(r),n=a.rank;n!==void 0&&(e[n]||(e[n]=[]),e[n][a.order]=r)}),e}function Pw(t){let e=t.nodes().map(a=>{let n=t.node(a).rank;return n===void 0?Number.MAX_VALUE:n}),r=Jt(Math.min,e);t.nodes().forEach(a=>{let n=t.node(a);Object.hasOwn(n,"rank")&&(n.rank-=r)})}function Iw(t){let e=t.nodes().map(o=>t.node(o).rank).filter(o=>o!==void 0),r=Jt(Math.min,e),a=[];t.nodes().forEach(o=>{let s=t.node(o).rank-r;a[s]||(a[s]=[]),a[s].push(o)});let n=0,i=t.graph().nodeRankFactor;Array.from(a).forEach((o,s)=>{o===void 0&&s%i!==0?--n:o!==void 0&&n&&o.forEach(u=>t.node(u).rank+=n)})}function ah(t,e,r,a){let n={width:0,height:0};return arguments.length>=4&&(n.rank=r,n.order=a),La(t,"border",n,e)}function kw(t,e=Ov){let r=[];for(let a=0;a<t.length;a+=e){let n=t.slice(a,a+e);r.push(n)}return r}var Ov=65535;function Jt(t,e){if(e.length>Ov){let r=kw(e);return t(...r.map(a=>t(...a)))}else return t(...e)}function Pv(t){let e=t.nodes().map(r=>{let a=t.node(r).rank;return a===void 0?Number.MIN_VALUE:a});return Jt(Math.max,e)}function Bw(t,e){let r={lhs:[],rhs:[]};return t.forEach(a=>{e(a)?r.lhs.push(a):r.rhs.push(a)}),r}function Iv(t,e){let r=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-r)+"ms")}}function kv(t,e){return e()}var Fw=0;function du(t){let e=++Fw;return t+(""+e)}function an(t,e,r=1){e==null&&(e=t,t=0);let a=i=>i<e;r<0&&(a=i=>e<i);let n=[];for(let i=t;a(i);i+=r)n.push(i);return n}function fi(t,e){let r={};for(let a of e)t[a]!==void 0&&(r[a]=t[a]);return r}function Ni(t,e){let r;return typeof e=="string"?r=a=>a[e]:r=e,Object.entries(t).reduce((a,[n,i])=>(a[n]=r(i,n),a),{})}function zw(t,e){return t.reduce((r,a,n)=>(r[a]=e[n],r),{})}var Mi="\0",Vw="3.0.0",Gw=class{constructor(){sw(this,"_sentinel");let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return nh(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&nh(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,r=e._prev;for(;r!==e;)t.push(JSON.stringify(r,Uw)),r=r._prev;return"["+t.join(", ")+"]"}};function nh(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Uw(t,e){if(t!=="_next"&&t!=="_prev")return e}var Hw=Gw,Yw=()=>1;function qw(t,e){if(t.nodeCount()<=1)return[];let r=Ww(t,e||Yw);return _w(r.graph,r.buckets,r.zeroIdx).flatMap(a=>t.outEdges(a.v,a.w)||[])}function _w(t,e,r){var a;let n=[],i=e[e.length-1],o=e[0],s;for(;t.nodeCount();){for(;s=o.dequeue();)cs(t,e,r,s);for(;s=i.dequeue();)cs(t,e,r,s);if(t.nodeCount()){for(let u=e.length-2;u>0;--u)if(s=(a=e[u])==null?void 0:a.dequeue(),s){n=n.concat(cs(t,e,r,s,!0)||[]);break}}}return n}function cs(t,e,r,a,n){let i=[],o=n?i:void 0;return(t.inEdges(a.v)||[]).forEach(s=>{let u=t.edge(s),l=t.node(s.v);n&&i.push({v:s.v,w:s.w}),l.out-=u,Us(e,r,l)}),(t.outEdges(a.v)||[]).forEach(s=>{let u=t.edge(s),l=s.w,f=t.node(l);f.in-=u,Us(e,r,f)}),t.removeNode(a.v),o}function Ww(t,e){let r=new Ut,a=0,n=0;t.nodes().forEach(s=>{r.setNode(s,{v:s,in:0,out:0})}),t.edges().forEach(s=>{let u=r.edge(s.v,s.w)||0,l=e(s),f=u+l;r.setEdge(s.v,s.w,f);let h=r.node(s.v),v=r.node(s.w);n=Math.max(n,h.out+=l),a=Math.max(a,v.in+=l)});let i=Xw(n+a+3).map(()=>new Hw),o=a+1;return r.nodes().forEach(s=>{Us(i,o,r.node(s))}),{graph:r,buckets:i,zeroIdx:o}}function Us(t,e,r){var a,n,i;r.out?r.in?(i=t[r.out-r.in+e])==null||i.enqueue(r):(n=t[t.length-1])==null||n.enqueue(r):(a=t[0])==null||a.enqueue(r)}function Xw(t){let e=[];for(let r=0;r<t;r++)e.push(r);return e}function $w(t){(t.graph().acyclicer==="greedy"?qw(t,e(t)):Kw(t)).forEach(r=>{let a=t.edge(r);t.removeEdge(r),a.forwardName=r.name,a.reversed=!0,t.setEdge(r.w,r.v,a,du("rev"))});function e(r){return a=>r.edge(a).weight}}function Kw(t){let e=[],r={},a={};function n(i){Object.hasOwn(a,i)||(a[i]=!0,r[i]=!0,t.outEdges(i).forEach(o=>{Object.hasOwn(r,o.w)?e.push(o):n(o.w)}),delete r[i])}return t.nodes().forEach(n),e}function Zw(t){t.edges().forEach(e=>{let r=t.edge(e);if(r.reversed){t.removeEdge(e);let a=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,a)}})}function Qw(t){t.graph().dummyChains=[],t.edges().forEach(e=>Jw(t,e))}function Jw(t,e){let r=e.v,a=t.node(r).rank,n=e.w,i=t.node(n).rank,o=e.name,s=t.edge(e),u=s.labelRank;if(i===a+1)return;t.removeEdge(e);let l,f,h;for(h=0,++a;a<i;++h,++a)s.points=[],f={width:0,height:0,edgeLabel:s,edgeObj:e,rank:a},l=La(t,"edge",f,"_d"),a===u&&(f.width=s.width,f.height=s.height,f.dummy="edge-label",f.labelpos=s.labelpos),t.setEdge(r,l,{weight:s.weight},o),h===0&&t.graph().dummyChains.push(l),r=l;t.setEdge(r,n,{weight:s.weight},o)}function jw(t){t.graph().dummyChains.forEach(e=>{let r=t.node(e),a=r.edgeLabel,n;for(t.setEdge(r.edgeObj,a);r.dummy;)n=t.successors(e)[0],t.removeNode(e),a.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(a.x=r.x,a.y=r.y,a.width=r.width,a.height=r.height),e=n,r=t.node(e)})}function gu(t){let e={};function r(a){let n=t.node(a);if(Object.hasOwn(e,a))return n.rank;e[a]=!0;let i=t.outEdges(a),o=i?i.map(u=>u==null?Number.POSITIVE_INFINITY:r(u.w)-t.edge(u).minlen):[],s=Jt(Math.min,o);return s===Number.POSITIVE_INFINITY&&(s=0),n.rank=s}t.sources().forEach(r)}function wa(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var Bv=eE;function eE(t){let e=new Ut({directed:!1}),r=t.nodes();if(r.length===0)throw new Error("Graph must have at least one node");let a=r[0],n=t.nodeCount();e.setNode(a,{});let i,o;for(;tE(e,t)<n&&(i=rE(e,t),!!i);)o=e.hasNode(i.v)?wa(t,i):-wa(t,i),aE(e,t,o);return e}function tE(t,e){function r(a){let n=e.nodeEdges(a);n&&n.forEach(i=>{let o=i.v,s=a===o?i.w:o;!t.hasNode(s)&&!wa(e,i)&&(t.setNode(s,{}),t.setEdge(a,s,{}),r(s))})}return t.nodes().forEach(r),t.nodeCount()}function rE(t,e){return e.edges().reduce((r,a)=>{let n=Number.POSITIVE_INFINITY;return t.hasNode(a.v)!==t.hasNode(a.w)&&(n=wa(e,a)),n<r[0]?[n,a]:r},[Number.POSITIVE_INFINITY,null])[1]}function aE(t,e,r){t.nodes().forEach(a=>e.node(a).rank+=r)}var{preorder:nE,postorder:iE}=vu,oE=$r;$r.initLowLimValues=yu;$r.initCutValues=pu;$r.calcCutValue=Fv;$r.leaveEdge=Vv;$r.enterEdge=Gv;$r.exchangeEdges=Uv;function $r(t){t=Ow(t),gu(t);let e=Bv(t);yu(e),pu(e,t);let r,a;for(;r=Vv(e);)a=Gv(e,t,r),Uv(e,t,r,a)}function pu(t,e){let r=iE(t,t.nodes());r=r.slice(0,r.length-1),r.forEach(a=>sE(t,e,a))}function sE(t,e,r){let a=t.node(r).parent,n=t.edge(r,a);n.cutvalue=Fv(t,e,r)}function Fv(t,e,r){let a=t.node(r).parent,n=!0,i=e.edge(r,a),o=0;i||(n=!1,i=e.edge(a,r)),o=i.weight;let s=e.nodeEdges(r);return s&&s.forEach(u=>{let l=u.v===r,f=l?u.w:u.v;if(f!==a){let h=l===n,v=e.edge(u).weight;if(o+=h?v:-v,lE(t,r,f)){let c=t.edge(r,f).cutvalue;o+=h?-c:c}}}),o}function yu(t,e){arguments.length<2&&(e=t.nodes()[0]),zv(t,{},1,e)}function zv(t,e,r,a,n){let i=r,o=t.node(a);e[a]=!0;let s=t.neighbors(a);return s&&s.forEach(u=>{Object.hasOwn(e,u)||(r=zv(t,e,r,u,a))}),o.low=i,o.lim=r++,n?o.parent=n:delete o.parent,r}function Vv(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function Gv(t,e,r){let a=r.v,n=r.w;e.hasEdge(a,n)||(a=r.w,n=r.v);let i=t.node(a),o=t.node(n),s=i,u=!1;return i.lim>o.lim&&(s=o,u=!0),e.edges().filter(l=>u===ih(t,t.node(l.v),s)&&u!==ih(t,t.node(l.w),s)).reduce((l,f)=>wa(e,f)<wa(e,l)?f:l)}function Uv(t,e,r,a){let n=r.v,i=r.w;t.removeEdge(n,i),t.setEdge(a.v,a.w,{}),yu(t),pu(t,e),uE(t,e)}function uE(t,e){let r=t.nodes().find(n=>!t.node(n).parent);if(!r)return;let a=nE(t,[r]);a=a.slice(1),a.forEach(n=>{let i=t.node(n).parent,o=e.edge(n,i),s=!1;o||(o=e.edge(i,n),s=!0),e.node(n).rank=e.node(i).rank+(s?o.minlen:-o.minlen)})}function lE(t,e,r){return t.hasEdge(e,r)}function ih(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}var fE=hE;function hE(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":oh(t);break;case"tight-tree":vE(t);break;case"longest-path":cE(t);break;case"none":break;default:oh(t)}}var cE=gu;function vE(t){gu(t),Bv(t)}function oh(t){oE(t)}var dE=gE;function gE(t){let e=yE(t);t.graph().dummyChains.forEach(r=>{let a=t.node(r),n=a.edgeObj,i=pE(t,e,n.v,n.w),o=i.path,s=i.lca,u=0,l=o[u],f=!0;for(;r!==n.w;){if(a=t.node(r),f){for(;(l=o[u])!==s&&t.node(l).maxRank<a.rank;)u++;l===s&&(f=!1)}if(!f){for(;u<o.length-1&&t.node(o[u+1]).minRank<=a.rank;)u++;l=o[u]}l!==void 0&&t.setParent(r,l),r=t.successors(r)[0]}})}function pE(t,e,r,a){let n=[],i=[],o=Math.min(e[r].low,e[a].low),s=Math.max(e[r].lim,e[a].lim),u;u=r;do u=t.parent(u),n.push(u);while(u&&(e[u].low>o||s>e[u].lim));let l=u,f=a;for(;(f=t.parent(f))!==l;)i.push(f);return{path:n.concat(i.reverse()),lca:l}}function yE(t){let e={},r=0;function a(n){let i=r;t.children(n).forEach(a),e[n]={low:i,lim:r++}}return t.children(Mi).forEach(a),e}function mE(t){let e=La(t,"root",{},"_root"),r=bE(t),a=Object.values(r),n=Jt(Math.max,a)-1,i=2*n+1;t.graph().nestingRoot=e,t.edges().forEach(s=>t.edge(s).minlen*=i);let o=wE(t)+1;t.children(Mi).forEach(s=>Hv(t,e,i,o,n,r,s)),t.graph().nodeRankFactor=i}function Hv(t,e,r,a,n,i,o){var s;let u=t.children(o);if(!u.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:r});return}let l=ah(t,"_bt"),f=ah(t,"_bb"),h=t.node(o);t.setParent(l,o),h.borderTop=l,t.setParent(f,o),h.borderBottom=f,u.forEach(v=>{var c;Hv(t,e,r,a,n,i,v);let d=t.node(v),p=d.borderTop?d.borderTop:v,y=d.borderBottom?d.borderBottom:v,g=d.borderTop?a:2*a,b=p!==y?1:n-((c=i[o])!=null?c:0)+1;t.setEdge(l,p,{weight:g,minlen:b,nestingEdge:!0}),t.setEdge(y,f,{weight:g,minlen:b,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,l,{weight:0,minlen:n+((s=i[o])!=null?s:0)})}function bE(t){let e={};function r(a,n){let i=t.children(a);i&&i.length&&i.forEach(o=>r(o,n+1)),e[a]=n}return t.children(Mi).forEach(a=>r(a,1)),e}function wE(t){return t.edges().reduce((e,r)=>e+t.edge(r).weight,0)}function EE(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(r=>{t.edge(r).nestingEdge&&t.removeEdge(r)})}var xE=TE;function TE(t){function e(r){let a=t.children(r),n=t.node(r);if(a.length&&a.forEach(e),Object.hasOwn(n,"minRank")){n.borderLeft=[],n.borderRight=[];for(let i=n.minRank,o=n.maxRank+1;i<o;++i)sh(t,"borderLeft","_bl",r,n,i),sh(t,"borderRight","_br",r,n,i)}}t.children(Mi).forEach(e)}function sh(t,e,r,a,n,i){let o={width:0,height:0,rank:i,borderType:e},s=n[e][i-1],u=La(t,"border",o,r);n[e][i]=u,t.setParent(u,a),s&&t.setEdge(s,u,{weight:1})}function CE(t){var e;let r=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(r==="lr"||r==="rl")&&Yv(t)}function SE(t){var e;let r=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(r==="bt"||r==="rl")&&DE(t),(r==="lr"||r==="rl")&&(AE(t),Yv(t))}function Yv(t){t.nodes().forEach(e=>uh(t.node(e))),t.edges().forEach(e=>uh(t.edge(e)))}function uh(t){let e=t.width;t.width=t.height,t.height=e}function DE(t){t.nodes().forEach(e=>vs(t.node(e))),t.edges().forEach(e=>{var r;let a=t.edge(e);(r=a.points)==null||r.forEach(vs),Object.hasOwn(a,"y")&&vs(a)})}function vs(t){t.y=-t.y}function AE(t){t.nodes().forEach(e=>ds(t.node(e))),t.edges().forEach(e=>{var r;let a=t.edge(e);(r=a.points)==null||r.forEach(ds),Object.hasOwn(a,"x")&&ds(a)})}function ds(t){let e=t.x;t.x=t.y,t.y=e}function LE(t){let e={},r=t.nodes().filter(s=>!t.children(s).length),a=r.map(s=>t.node(s).rank),n=Jt(Math.max,a),i=an(n+1).map(()=>[]);function o(s){if(e[s])return;e[s]=!0;let u=t.node(s);i[u.rank].push(s);let l=t.successors(s);l&&l.forEach(o)}return r.sort((s,u)=>t.node(s).rank-t.node(u).rank).forEach(o),i}function NE(t,e){let r=0;for(let a=1;a<e.length;++a)r+=ME(t,e[a-1],e[a]);return r}function ME(t,e,r){let a=zw(r,r.map((l,f)=>f)),n=e.flatMap(l=>{let f=t.outEdges(l);return f?f.map(h=>({pos:a[h.w],weight:t.edge(h).weight})).sort((h,v)=>h.pos-v.pos):[]}),i=1;for(;i<r.length;)i<<=1;let o=2*i-1;i-=1;let s=new Array(o).fill(0),u=0;return n.forEach(l=>{let f=l.pos+i;s[f]+=l.weight;let h=0;for(;f>0;)f%2&&(h+=s[f+1]),f=f-1>>1,s[f]+=l.weight;u+=l.weight*h}),u}function RE(t,e=[]){return e.map(r=>{let a=t.inEdges(r);if(!a||!a.length)return{v:r};{let n=a.reduce((i,o)=>{let s=t.edge(o),u=t.node(o.v);return{sum:i.sum+s.weight*u.order,weight:i.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:n.sum/n.weight,weight:n.weight}}})}function OE(t,e){let r={};t.forEach((n,i)=>{let o={indegree:0,in:[],out:[],vs:[n.v],i};n.barycenter!==void 0&&(o.barycenter=n.barycenter,o.weight=n.weight),r[n.v]=o}),e.edges().forEach(n=>{let i=r[n.v],o=r[n.w];i!==void 0&&o!==void 0&&(o.indegree++,i.out.push(o))});let a=Object.values(r).filter(n=>!n.indegree);return PE(a)}function PE(t){let e=[];function r(n){return i=>{i.merged||(i.barycenter===void 0||n.barycenter===void 0||i.barycenter>=n.barycenter)&&IE(n,i)}}function a(n){return i=>{i.in.push(n),--i.indegree===0&&t.push(i)}}for(;t.length;){let n=t.pop();e.push(n),n.in.reverse().forEach(r(n)),n.out.forEach(a(n))}return e.filter(n=>!n.merged).map(n=>fi(n,["vs","i","barycenter","weight"]))}function IE(t,e){let r=0,a=0;t.weight&&(r+=t.barycenter*t.weight,a+=t.weight),e.weight&&(r+=e.barycenter*e.weight,a+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/a,t.weight=a,t.i=Math.min(e.i,t.i),e.merged=!0}function kE(t,e){let r=Bw(t,f=>Object.hasOwn(f,"barycenter")),a=r.lhs,n=r.rhs.sort((f,h)=>h.i-f.i),i=[],o=0,s=0,u=0;a.sort(BE(!!e)),u=lh(i,n,u),a.forEach(f=>{u+=f.vs.length,i.push(f.vs),o+=f.barycenter*f.weight,s+=f.weight,u=lh(i,n,u)});let l={vs:i.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function lh(t,e,r){let a;for(;e.length&&(a=e[e.length-1]).i<=r;)e.pop(),t.push(a.vs),r++;return r}function BE(t){return(e,r)=>e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}function qv(t,e,r,a){let n=t.children(e),i=t.node(e),o=i?i.borderLeft:void 0,s=i?i.borderRight:void 0,u={};o&&(n=n.filter(v=>v!==o&&v!==s));let l=RE(t,n);l.forEach(v=>{if(t.children(v.v).length){let c=qv(t,v.v,r,a);u[v.v]=c,Object.hasOwn(c,"barycenter")&&zE(v,c)}});let f=OE(l,r);FE(f,u);let h=kE(f,a);if(o&&s){h.vs=[o,h.vs,s].flat(1);let v=t.predecessors(o);if(v&&v.length){let c=t.node(v[0]),d=t.predecessors(s),p=t.node(d[0]);Object.hasOwn(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+c.order+p.order)/(h.weight+2),h.weight+=2}}return h}function FE(t,e){t.forEach(r=>{r.vs=r.vs.flatMap(a=>e[a]?e[a].vs:a)})}function zE(t,e){t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)}function VE(t,e,r,a){a||(a=t.nodes());let n=GE(t),i=new Ut({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(o=>t.node(o));return a.forEach(o=>{let s=t.node(o),u=t.parent(o);if(s.rank===e||s.minRank<=e&&e<=s.maxRank){i.setNode(o),i.setParent(o,u||n);let l=t[r](o);l&&l.forEach(f=>{let h=f.v===o?f.w:f.v,v=i.edge(h,o),c=v!==void 0?v.weight:0;i.setEdge(h,o,{weight:t.edge(f).weight+c})}),Object.hasOwn(s,"minRank")&&i.setNode(o,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]})}}),i}function GE(t){let e;for(;t.hasNode(e=du("_root")););return e}function UE(t,e,r){let a={},n;r.forEach(i=>{let o=t.parent(i),s,u;for(;o;){if(s=t.parent(o),s?(u=a[s],a[s]=o):(u=n,n=o),u&&u!==o){e.setEdge(u,o);return}o=s}})}function _v(t,e={}){if(typeof e.customOrder=="function"){e.customOrder(t,_v);return}let r=Pv(t),a=fh(t,an(1,r+1),"inEdges"),n=fh(t,an(r-1,-1,-1),"outEdges"),i=LE(t);if(hh(t,i),e.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,s,u=e.constraints||[];for(let l=0,f=0;f<4;++l,++f){HE(l%2?a:n,l%4>=2,u),i=yn(t);let h=NE(t,i);h<o?(f=0,s=Object.assign({},i),o=h):h===o&&(s=structuredClone(i))}hh(t,s)}function fh(t,e,r){let a=new Map,n=(i,o)=>{a.has(i)||a.set(i,[]),a.get(i).push(o)};for(let i of t.nodes()){let o=t.node(i);if(typeof o.rank=="number"&&n(o.rank,i),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let s=o.minRank;s<=o.maxRank;s++)s!==o.rank&&n(s,i)}return e.map(function(i){return VE(t,i,r,a.get(i)||[])})}function HE(t,e,r){let a=new Ut;t.forEach(function(n){r.forEach(s=>a.setEdge(s.left,s.right));let i=n.graph().root,o=qv(n,i,a,e);o.vs.forEach((s,u)=>n.node(s).order=u),UE(n,a,o.vs)})}function hh(t,e){Object.values(e).forEach(r=>r.forEach((a,n)=>t.node(a).order=n))}function YE(t,e){let r={};function a(n,i){let o=0,s=0,u=n.length,l=i[i.length-1];return i.forEach((f,h)=>{let v=_E(t,f),c=v?t.node(v).order:u;(v||f===l)&&(i.slice(s,h+1).forEach(d=>{let p=t.predecessors(d);p&&p.forEach(y=>{let g=t.node(y),b=g.order;(b<o||c<b)&&!(g.dummy&&t.node(d).dummy)&&Wv(r,y,d)})}),s=h+1,o=c)}),i}return e.length&&e.reduce(a),r}function qE(t,e){let r={};function a(i,o,s,u,l){an(o,s).forEach(f=>{let h=i[f];if(h!==void 0&&t.node(h).dummy){let v=t.predecessors(h);v&&v.forEach(c=>{if(c===void 0)return;let d=t.node(c);d.dummy&&(d.order<u||d.order>l)&&Wv(r,c,h)})}})}function n(i,o){let s=-1,u=-1,l=0;return o.forEach((f,h)=>{if(t.node(f).dummy==="border"){let v=t.predecessors(f);if(v&&v.length){let c=v[0];if(c===void 0)return;u=t.node(c).order,a(o,l,h,s,u),l=h,s=u}}a(o,l,o.length,u,i.length)}),o}return e.length&&e.reduce(n),r}function _E(t,e){if(t.node(e).dummy){let r=t.predecessors(e);if(r)return r.find(a=>t.node(a).dummy)}}function Wv(t,e,r){if(e>r){let n=e;e=r,r=n}let a=t[e];a||(t[e]=a={}),a[r]=!0}function WE(t,e,r){if(e>r){let n=e;e=r,r=n}let a=t[e];return a!==void 0&&Object.hasOwn(a,r)}function XE(t,e,r,a){let n={},i={},o={};return e.forEach(s=>{s.forEach((u,l)=>{n[u]=u,i[u]=u,o[u]=l})}),e.forEach(s=>{let u=-1;s.forEach(l=>{let f=a(l);if(f&&f.length){let h=f.sort((c,d)=>{let p=o[c],y=o[d];return(p!==void 0?p:0)-(y!==void 0?y:0)}),v=(h.length-1)/2;for(let c=Math.floor(v),d=Math.ceil(v);c<=d;++c){let p=h[c];if(p===void 0)continue;let y=o[p];if(y!==void 0&&i[l]===l&&u<y&&!WE(r,l,p)){let g=n[p];g!==void 0&&(i[p]=l,i[l]=n[l]=g,u=y)}}}})}),{root:n,align:i}}function $E(t,e,r,a,n=!1){let i={},o=KE(t,e,r,n),s=n?"borderLeft":"borderRight";function u(c,d){let p=o.nodes().slice(),y={},g=p.pop();for(;g;){if(y[g])c(g);else{y[g]=!0,p.push(g);for(let b of d(g))p.push(b)}g=p.pop()}}function l(c){let d=o.inEdges(c);d?i[c]=d.reduce((p,y)=>{var g;let b=(g=i[y.v])!=null?g:0,m=o.edge(y);return Math.max(p,b+(m!==void 0?m:0))},0):i[c]=0}function f(c){let d=o.outEdges(c),p=Number.POSITIVE_INFINITY;d&&(p=d.reduce((g,b)=>{let m=i[b.w],w=o.edge(b);return Math.min(g,(m!==void 0?m:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let y=t.node(c);p!==Number.POSITIVE_INFINITY&&y.borderType!==s&&(i[c]=Math.max(i[c]!==void 0?i[c]:0,p))}function h(c){return o.predecessors(c)||[]}function v(c){return o.successors(c)||[]}return u(l,h),u(f,v),Object.keys(a).forEach(c=>{var d;let p=r[c];p!==void 0&&(i[c]=(d=i[p])!=null?d:0)}),i}function KE(t,e,r,a){let n=new Ut,i=t.graph(),o=e1(i.nodesep,i.edgesep,a);return e.forEach(s=>{let u;s.forEach(l=>{let f=r[l];if(f!==void 0){if(n.setNode(f),u!==void 0){let h=r[u];if(h!==void 0){let v=n.edge(h,f);n.setEdge(h,f,Math.max(o(t,l,u),v||0))}}u=l}})}),n}function ZE(t,e){return Object.values(e).reduce((r,a)=>{let n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(a).forEach(([s,u])=>{let l=t1(t,s)/2;n=Math.max(u+l,n),i=Math.min(u-l,i)});let o=n-i;return o<r[0]&&(r=[o,a]),r},[Number.POSITIVE_INFINITY,null])[1]}function QE(t,e){let r=Object.values(e),a=Jt(Math.min,r),n=Jt(Math.max,r);["u","d"].forEach(i=>{["l","r"].forEach(o=>{let s=i+o,u=t[s];if(!u||u===e)return;let l=Object.values(u),f=a-Jt(Math.min,l);o!=="l"&&(f=n-Jt(Math.max,l)),f&&(t[s]=Ni(u,h=>h+f))})})}function JE(t,e=void 0){let r=t.ul;return r?Ni(r,(a,n)=>{var i,o;if(e){let u=e.toLowerCase(),l=t[u];if(l&&l[n]!==void 0)return l[n]}let s=Object.values(t).map(u=>{let l=u[n];return l!==void 0?l:0}).sort((u,l)=>u-l);return(((i=s[1])!=null?i:0)+((o=s[2])!=null?o:0))/2}):{}}function jE(t){let e=yn(t),r=Object.assign(YE(t,e),qE(t,e)),a={},n;["u","d"].forEach(o=>{n=o==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(n=n.map(f=>Object.values(f).reverse()));let u=XE(t,n,r,f=>(o==="u"?t.predecessors(f):t.successors(f))||[]),l=$E(t,n,u.root,u.align,s==="r");s==="r"&&(l=Ni(l,f=>-f)),a[o+s]=l})});let i=ZE(t,a);return QE(a,i),JE(a,t.graph().align)}function e1(t,e,r){return(a,n,i)=>{let o=a.node(n),s=a.node(i),u=0,l;if(u+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":l=-o.width/2;break;case"r":l=o.width/2;break}if(l&&(u+=r?l:-l),l=void 0,u+=(o.dummy?e:t)/2,u+=(s.dummy?e:t)/2,u+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":l=s.width/2;break;case"r":l=-s.width/2;break}return l&&(u+=r?l:-l),u}}function t1(t,e){return t.node(e).width}function r1(t){t=Rv(t),a1(t),Object.entries(jE(t)).forEach(([e,r])=>t.node(e).x=r)}function a1(t){let e=yn(t),r=t.graph(),a=r.ranksep,n=r.rankalign,i=0;e.forEach(o=>{let s=o.reduce((u,l)=>{var f;let h=(f=t.node(l).height)!=null?f:0;return u>h?u:h},0);o.forEach(u=>{let l=t.node(u);n==="top"?l.y=i+l.height/2:n==="bottom"?l.y=i+s-l.height/2:l.y=i+s/2}),i+=s+a})}function n1(t,e={}){let r=e.debugTiming?Iv:kv;return r("layout",()=>{let a=r(" buildLayoutGraph",()=>d1(t));return r(" runLayout",()=>i1(a,r,e)),r(" updateInputGraph",()=>o1(t,a)),a})}function i1(t,e,r){e(" makeSpaceForEdgeLabels",()=>g1(t)),e(" removeSelfEdges",()=>C1(t)),e(" acyclic",()=>$w(t)),e(" nestingGraph.run",()=>mE(t)),e(" rank",()=>fE(Rv(t))),e(" injectEdgeLabelProxies",()=>p1(t)),e(" removeEmptyRanks",()=>Iw(t)),e(" nestingGraph.cleanup",()=>EE(t)),e(" normalizeRanks",()=>Pw(t)),e(" assignRankMinMax",()=>y1(t)),e(" removeEdgeLabelProxies",()=>m1(t)),e(" normalize.run",()=>Qw(t)),e(" parentDummyChains",()=>dE(t)),e(" addBorderSegments",()=>xE(t)),e(" order",()=>_v(t,r)),e(" insertSelfEdges",()=>S1(t)),e(" adjustCoordinateSystem",()=>CE(t)),e(" position",()=>r1(t)),e(" positionSelfEdges",()=>D1(t)),e(" removeBorderNodes",()=>T1(t)),e(" normalize.undo",()=>jw(t)),e(" fixupEdgeLabelCoords",()=>E1(t)),e(" undoCoordinateSystem",()=>SE(t)),e(" translateGraph",()=>b1(t)),e(" assignNodeIntersects",()=>w1(t)),e(" reversePoints",()=>x1(t)),e(" acyclic.undo",()=>Zw(t))}function o1(t,e){t.nodes().forEach(r=>{let a=t.node(r),n=e.node(r);a&&(a.x=n.x,a.y=n.y,a.order=n.order,a.rank=n.rank,e.children(r).length&&(a.width=n.width,a.height=n.height))}),t.edges().forEach(r=>{let a=t.edge(r),n=e.edge(r);a.points=n.points,Object.hasOwn(n,"x")&&(a.x=n.x,a.y=n.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var s1=["nodesep","edgesep","ranksep","marginx","marginy"],u1={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},l1=["acyclicer","ranker","rankdir","align","rankalign"],f1=["width","height","rank"],ch={width:0,height:0},h1=["minlen","weight","width","height","labeloffset"],c1={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},v1=["labelpos"];function d1(t){let e=new Ut({multigraph:!0,compound:!0}),r=ps(t.graph());return e.setGraph(Object.assign({},u1,gs(r,s1),fi(r,l1))),t.nodes().forEach(a=>{let n=ps(t.node(a)),i=gs(n,f1);Object.keys(ch).forEach(s=>{i[s]===void 0&&(i[s]=ch[s])}),e.setNode(a,i);let o=t.parent(a);o!==void 0&&e.setParent(a,o)}),t.edges().forEach(a=>{let n=ps(t.edge(a));e.setEdge(a,Object.assign({},c1,gs(n,h1),fi(n,v1)))}),e}function g1(t){let e=t.graph();e.ranksep/=2,t.edges().forEach(r=>{let a=t.edge(r);a.minlen*=2,a.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?a.width+=a.labeloffset:a.height+=a.labeloffset)})}function p1(t){t.edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let a=t.node(e.v),n={rank:(t.node(e.w).rank-a.rank)/2+a.rank,e};La(t,"edge-proxy",n,"_ep")}})}function y1(t){let e=0;t.nodes().forEach(r=>{let a=t.node(r);a.borderTop&&(a.minRank=t.node(a.borderTop).rank,a.maxRank=t.node(a.borderBottom).rank,e=Math.max(e,a.maxRank))}),t.graph().maxRank=e}function m1(t){t.nodes().forEach(e=>{let r=t.node(e);if(r.dummy==="edge-proxy"){let a=r;t.edge(a.e).labelRank=r.rank,t.removeNode(e)}})}function b1(t){let e=Number.POSITIVE_INFINITY,r=0,a=Number.POSITIVE_INFINITY,n=0,i=t.graph(),o=i.marginx||0,s=i.marginy||0;function u(l){let f=l.x,h=l.y,v=l.width,c=l.height;e=Math.min(e,f-v/2),r=Math.max(r,f+v/2),a=Math.min(a,h-c/2),n=Math.max(n,h+c/2)}t.nodes().forEach(l=>u(t.node(l))),t.edges().forEach(l=>{let f=t.edge(l);Object.hasOwn(f,"x")&&u(f)}),e-=o,a-=s,t.nodes().forEach(l=>{let f=t.node(l);f.x-=e,f.y-=a}),t.edges().forEach(l=>{let f=t.edge(l);f.points.forEach(h=>{h.x-=e,h.y-=a}),Object.hasOwn(f,"x")&&(f.x-=e),Object.hasOwn(f,"y")&&(f.y-=a)}),i.width=r-e+o,i.height=n-a+s}function w1(t){t.edges().forEach(e=>{let r=t.edge(e),a=t.node(e.v),n=t.node(e.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=n,o=a),r.points.unshift(rh(a,i)),r.points.push(rh(n,o))})}function E1(t){t.edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function x1(t){t.edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}function T1(t){t.nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),a=t.node(r.borderTop),n=t.node(r.borderBottom),i=t.node(r.borderLeft[r.borderLeft.length-1]),o=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(o.x-i.x),r.height=Math.abs(n.y-a.y),r.x=i.x+r.width/2,r.y=a.y+r.height/2}}),t.nodes().forEach(e=>{t.node(e).dummy==="border"&&t.removeNode(e)})}function C1(t){t.edges().forEach(e=>{if(e.v===e.w){let r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function S1(t){yn(t).forEach(e=>{let r=0;e.forEach((a,n)=>{let i=t.node(a);i.order=n+r,(i.selfEdges||[]).forEach(o=>{La(t,"selfedge",{width:o.label.width,height:o.label.height,rank:i.rank,order:n+ ++r,e:o.e,label:o.label},"_se")}),delete i.selfEdges})})}function D1(t){t.nodes().forEach(e=>{let r=t.node(e);if(r.dummy==="selfedge"){let a=r,n=t.node(a.e.v),i=n.x+n.width/2,o=n.y,s=r.x-i,u=n.height/2;t.setEdge(a.e,a.label),t.removeNode(e),a.label.points=[{x:i+2*s/3,y:o-u},{x:i+5*s/6,y:o-u},{x:i+s,y:o},{x:i+5*s/6,y:o+u},{x:i+2*s/3,y:o+u}],a.label.x=r.x,a.label.y=r.y}})}function gs(t,e){return Ni(fi(t,e),Number)}function ps(t){let e={};return t&&Object.entries(t).forEach(([r,a])=>{typeof r=="string"&&(r=r.toLowerCase()),e[r]=a}),e}function A1(t){let e=yn(t),r=new Ut({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach(a=>{r.setNode(a,{label:a}),r.setParent(a,"layer"+t.node(a).rank)}),t.edges().forEach(a=>r.setEdge(a.v,a.w,{},a.name)),e.forEach((a,n)=>{let i="layer"+n;r.setNode(i,{rank:"same"}),a.reduce((o,s)=>(r.setEdge(o,s,{style:"invis"}),s))}),r}var L1={graphlib:xv,version:Vw,layout:n1,debug:A1,util:{time:Iv,notime:kv}},vh=L1;/*! For license information please see dagre.esm.js.LEGAL.txt */var ys=function(e){return typeof e=="function"},ms=.001;function Xv(t){this.options=nw({},aw,t)}function $v(t,e){return{x:Ea(t.x-e.x),y:Ea(t.y-e.y)}}function dh(t,e){return Ea(t.x*e.x)+Ea(t.y*e.y)}function N1(t){var e=Math.hypot(t.x,t.y)||1;return{x:t.x/e,y:t.y/e,len:e}}function M1(t){return{x:-t.y,y:t.x}}function R1(t,e){var r=$v(e,t),a=N1(r),n=a.x,i=a.y,o=a.len,s={x:n,y:i},u=M1(s);return{src:t,tgt:e,dir:s,normal:u,len:o}}function Ea(t){return Math.abs(t)<ms?t<0?-ms:ms:t}function O1(t,e){var r=$v(t,e.src),a=Ea(dh(r,e.dir)/e.len),n=Ea(dh(r,e.normal));return{weight:a,distance:n}}function P1(t){var e=1/0,r=-1/0,a=tw(t),n;try{for(a.s();!(n=a.n()).done;){var i=n.value;i.weight<e&&(e=i.weight),i.weight>r&&(r=i.weight)}}catch(s){a.e(s)}finally{a.f()}var o=r-e||1;return t.map(function(s){return{distance:s.distance,weight:(s.weight-e)/o}})}function I1(t,e){var r=e.source().position(),a=e.target().position(),n=R1(r,a),i=P1(t.points.map(function(l){return O1(l,n)})),o=i.slice(1,-1).map(function(l){return l.weight}),s=i.slice(1,-1).map(function(l){return l.distance}),u={controlPointWeights:o,controlPointDistances:s};return u}Xv.prototype.run=function(){var t=this.options,e=this,r=t.cy,a=t.eles,n=function(O,R){return ys(R)?R.apply(O,[O]):R},i=t.boundingBox||{x1:0,y1:0,w:r.width(),h:r.height()};i.x2===void 0&&(i.x2=i.x1+i.w),i.w===void 0&&(i.w=i.x2-i.x1),i.y2===void 0&&(i.y2=i.y1+i.h),i.h===void 0&&(i.h=i.y2-i.y1);var o=new vh.graphlib.Graph({multigraph:!0,compound:!0}),s={},u=function(O,R){R!=null&&(s[O]=R)};u("nodesep",t.nodeSep),u("edgesep",t.edgeSep),u("ranksep",t.rankSep),u("rankdir",t.rankDir),u("align",t.align),u("ranker",t.ranker),u("acyclicer",t.acyclicer),o.setGraph(s),o.setDefaultEdgeLabel(function(){return{}}),o.setDefaultNodeLabel(function(){return{}});var l=a.nodes();ys(t.sort)&&(l=l.sort(t.sort));for(var f=0;f<l.length;f++){var h=l[f],v=h.layoutDimensions(t);o.setNode(h.id(),{width:v.w,height:v.h,shape:"ellipse",name:h.id()})}for(var c=0;c<l.length;c++){var d=l[c];d.isChild()&&o.setParent(d.id(),d.parent().id())}var p=a.edges().stdFilter(function(N){return!N.source().isParent()&&!N.target().isParent()});ys(t.sort)&&(p=p.sort(t.sort));for(var y=0;y<p.length;y++){var g=p[y];o.setEdge(g.source().id(),g.target().id(),{minlen:n(g,t.minLen),weight:n(g,t.edgeWeight),name:g.id()},g.id())}vh.layout(o);for(var b=o.nodes(),m=0;m<b.length;m++){var w=b[m],T=o.node(w);r.getElementById(w).scratch().dagre=T}var D;t.boundingBox?(D={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},l.forEach(function(N){var O=N.scratch().dagre;D.x1=Math.min(D.x1,O.x),D.x2=Math.max(D.x2,O.x),D.y1=Math.min(D.y1,O.y),D.y2=Math.max(D.y2,O.y)}),D.w=D.x2-D.x1,D.h=D.y2-D.y1):D=i;var x=function(O){if(t.boundingBox){var R=D.w===0?0:(O.x-D.x1)/D.w,P=D.h===0?0:(O.y-D.y1)/D.h;return{x:i.x1+R*i.w,y:i.y1+P*i.h}}else return O};return l.layoutPositions(e,t,function(N){N=Gs(N)==="object"?N:this;var O=N.scratch().dagre;return x({x:O.x,y:O.y})}),t.useDagreEdgeControlPoints&&(t.automaticDagreEdgeStyle&&(r.edges().addClass("useDagreEdgeControlPoints"),r.style().selector("edge.useDagreEdgeControlPoints").style(t.dagreEdgeStyle).update()),o.edges().forEach(function(N){var O=r.getElementById(N.name),R=o.edge(N);R&&R.points&&O.scratch(I1(R,O))})),this};var Kv=function(e){e&&e("layout","dagre",Xv)};typeof window<"u"&&typeof window.cytoscape<"u"&&Kv(window.cytoscape);var mu={exports:{}},Wn={exports:{}},Xn={exports:{}},k1=Xn.exports,gh;function B1(){return gh||(gh=1,(function(t,e){(function(a,n){t.exports=n()})(k1,function(){return(function(r){var a={};function n(i){if(a[i])return a[i].exports;var o=a[i]={i,l:!1,exports:{}};return r[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=r,n.c=a,n.i=function(i){return i},n.d=function(i,o,s){n.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:s})},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=28)})([(function(r,a,n){function i(){}i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,r.exports=i}),(function(r,a,n){var i=n(2),o=n(8),s=n(9);function u(f,h,v){i.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=h}u.prototype=Object.create(i.prototype);for(var l in i)u[l]=i[l];u.prototype.getSource=function(){return this.source},u.prototype.getTarget=function(){return this.target},u.prototype.isInterGraph=function(){return this.isInterGraph},u.prototype.getLength=function(){return this.length},u.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},u.prototype.getBendpoints=function(){return this.bendpoints},u.prototype.getLca=function(){return this.lca},u.prototype.getSourceInLca=function(){return this.sourceInLca},u.prototype.getTargetInLca=function(){return this.targetInLca},u.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},u.prototype.getOtherEndInGraph=function(f,h){for(var v=this.getOtherEnd(f),c=h.getGraphManager().getRoot();;){if(v.getOwner()==h)return v;if(v.getOwner()==c)break;v=v.getOwner().getParent()}return null},u.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},u.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=u}),(function(r,a,n){function i(o){this.vGraphObject=o}r.exports=i}),(function(r,a,n){var i=n(2),o=n(10),s=n(13),u=n(0),l=n(16),f=n(5);function h(c,d,p,y){p==null&&y==null&&(y=d),i.call(this,y),c.graphManager!=null&&(c=c.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=c,p!=null&&d!=null?this.rect=new s(d.x,d.y,p.width,p.height):this.rect=new s}h.prototype=Object.create(i.prototype);for(var v in i)h[v]=i[v];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(c){this.rect.width=c},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(c){this.rect.height=c},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(c,d){this.rect.x=c.x,this.rect.y=c.y,this.rect.width=d.width,this.rect.height=d.height},h.prototype.setCenter=function(c,d){this.rect.x=c-this.rect.width/2,this.rect.y=d-this.rect.height/2},h.prototype.setLocation=function(c,d){this.rect.x=c,this.rect.y=d},h.prototype.moveBy=function(c,d){this.rect.x+=c,this.rect.y+=d},h.prototype.getEdgeListToNode=function(c){var d=[],p=this;return p.edges.forEach(function(y){if(y.target==c){if(y.source!=p)throw"Incorrect edge source!";d.push(y)}}),d},h.prototype.getEdgesBetween=function(c){var d=[],p=this;return p.edges.forEach(function(y){if(!(y.source==p||y.target==p))throw"Incorrect edge source and/or target";(y.target==c||y.source==c)&&d.push(y)}),d},h.prototype.getNeighborsList=function(){var c=new Set,d=this;return d.edges.forEach(function(p){if(p.source==d)c.add(p.target);else{if(p.target!=d)throw"Incorrect incidency!";c.add(p.source)}}),c},h.prototype.withChildren=function(){var c=new Set,d,p;if(c.add(this),this.child!=null)for(var y=this.child.getNodes(),g=0;g<y.length;g++)d=y[g],p=d.withChildren(),p.forEach(function(b){c.add(b)});return c},h.prototype.getNoOfChildren=function(){var c=0,d;if(this.child==null)c=1;else for(var p=this.child.getNodes(),y=0;y<p.length;y++)d=p[y],c+=d.getNoOfChildren();return c==0&&(c=1),c},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},h.prototype.scatter=function(){var c,d,p=-u.INITIAL_WORLD_BOUNDARY,y=u.INITIAL_WORLD_BOUNDARY;c=u.WORLD_CENTER_X+l.nextDouble()*(y-p)+p;var g=-u.INITIAL_WORLD_BOUNDARY,b=u.INITIAL_WORLD_BOUNDARY;d=u.WORLD_CENTER_Y+l.nextDouble()*(b-g)+g,this.rect.x=c,this.rect.y=d},h.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var c=this.getChild();if(c.updateBounds(!0),this.rect.x=c.getLeft(),this.rect.y=c.getTop(),this.setWidth(c.getRight()-c.getLeft()),this.setHeight(c.getBottom()-c.getTop()),u.NODE_DIMENSIONS_INCLUDE_LABELS){var d=c.getRight()-c.getLeft(),p=c.getBottom()-c.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(d+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>d?(this.rect.x-=(this.labelWidth-d)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(d+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(p+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>p?(this.rect.y-=(this.labelHeight-p)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(p+this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(c){var d=this.rect.x;d>u.WORLD_BOUNDARY?d=u.WORLD_BOUNDARY:d<-u.WORLD_BOUNDARY&&(d=-u.WORLD_BOUNDARY);var p=this.rect.y;p>u.WORLD_BOUNDARY?p=u.WORLD_BOUNDARY:p<-u.WORLD_BOUNDARY&&(p=-u.WORLD_BOUNDARY);var y=new f(d,p),g=c.inverseTransformPoint(y);this.setLocation(g.x,g.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=h}),(function(r,a,n){var i=n(0);function o(){}for(var s in i)o[s]=i[s];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=o}),(function(r,a,n){function i(o,s){o==null&&s==null?(this.x=0,this.y=0):(this.x=o,this.y=s)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(o){this.x=o},i.prototype.setY=function(o){this.y=o},i.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},r.exports=i}),(function(r,a,n){var i=n(2),o=n(10),s=n(0),u=n(7),l=n(3),f=n(1),h=n(13),v=n(12),c=n(11);function d(y,g,b){i.call(this,b),this.estimatedSize=o.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,g!=null&&g instanceof u?this.graphManager=g:g!=null&&g instanceof Layout&&(this.graphManager=g.graphManager)}d.prototype=Object.create(i.prototype);for(var p in i)d[p]=i[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(y,g,b){if(g==null&&b==null){var m=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(m)>-1)throw"Node already in graph!";return m.owner=this,this.getNodes().push(m),m}else{var w=y;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(g.owner==b.owner&&g.owner==this))throw"Both owners must be this graph!";return g.owner!=b.owner?null:(w.source=g,w.target=b,w.isInterGraph=!1,this.getEdges().push(w),g.edges.push(w),b!=g&&b.edges.push(w),w)}},d.prototype.remove=function(y){var g=y;if(y instanceof l){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=g.edges.slice(),m,w=b.length,T=0;T<w;T++)m=b[T],m.isInterGraph?this.graphManager.remove(m):m.source.owner.remove(m);var D=this.nodes.indexOf(g);if(D==-1)throw"Node not in owner node list!";this.nodes.splice(D,1)}else if(y instanceof f){var m=y;if(m==null)throw"Edge is null!";if(!(m.source!=null&&m.target!=null))throw"Source and/or target is null!";if(!(m.source.owner!=null&&m.target.owner!=null&&m.source.owner==this&&m.target.owner==this))throw"Source and/or target owner is invalid!";var x=m.source.edges.indexOf(m),N=m.target.edges.indexOf(m);if(!(x>-1&&N>-1))throw"Source and/or target doesn't know this edge!";m.source.edges.splice(x,1),m.target!=m.source&&m.target.edges.splice(N,1);var D=m.source.owner.getEdges().indexOf(m);if(D==-1)throw"Not in owner's edge list!";m.source.owner.getEdges().splice(D,1)}},d.prototype.updateLeftTop=function(){for(var y=o.MAX_VALUE,g=o.MAX_VALUE,b,m,w,T=this.getNodes(),D=T.length,x=0;x<D;x++){var N=T[x];b=N.getTop(),m=N.getLeft(),y>b&&(y=b),g>m&&(g=m)}return y==o.MAX_VALUE?null:(T[0].getParent().paddingLeft!=null?w=T[0].getParent().paddingLeft:w=this.margin,this.left=g-w,this.top=y-w,new v(this.left,this.top))},d.prototype.updateBounds=function(y){for(var g=o.MAX_VALUE,b=-o.MAX_VALUE,m=o.MAX_VALUE,w=-o.MAX_VALUE,T,D,x,N,O,R=this.nodes,P=R.length,M=0;M<P;M++){var I=R[M];y&&I.child!=null&&I.updateBounds(),T=I.getLeft(),D=I.getRight(),x=I.getTop(),N=I.getBottom(),g>T&&(g=T),b<D&&(b=D),m>x&&(m=x),w<N&&(w=N)}var E=new h(g,m,b-g,w-m);g==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),R[0].getParent().paddingLeft!=null?O=R[0].getParent().paddingLeft:O=this.margin,this.left=E.x-O,this.right=E.x+E.width+O,this.top=E.y-O,this.bottom=E.y+E.height+O},d.calculateBounds=function(y){for(var g=o.MAX_VALUE,b=-o.MAX_VALUE,m=o.MAX_VALUE,w=-o.MAX_VALUE,T,D,x,N,O=y.length,R=0;R<O;R++){var P=y[R];T=P.getLeft(),D=P.getRight(),x=P.getTop(),N=P.getBottom(),g>T&&(g=T),b<D&&(b=D),m>x&&(m=x),w<N&&(w=N)}var M=new h(g,m,b-g,w-m);return M},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var y=0,g=this.nodes,b=g.length,m=0;m<b;m++){var w=g[m];y+=w.calcEstimatedSize()}return y==0?this.estimatedSize=s.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=y/Math.sqrt(this.nodes.length),this.estimatedSize},d.prototype.updateConnected=function(){var y=this;if(this.nodes.length==0){this.isConnected=!0;return}var g=new c,b=new Set,m=this.nodes[0],w,T,D=m.withChildren();for(D.forEach(function(M){g.push(M),b.add(M)});g.length!==0;){m=g.shift(),w=m.getEdges();for(var x=w.length,N=0;N<x;N++){var O=w[N];if(T=O.getOtherEndInGraph(m,this),T!=null&&!b.has(T)){var R=T.withChildren();R.forEach(function(M){g.push(M),b.add(M)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var P=0;b.forEach(function(M){M.owner==y&&P++}),P==this.nodes.length&&(this.isConnected=!0)}},r.exports=d}),(function(r,a,n){var i,o=n(1);function s(u){i=n(6),this.layout=u,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var u=this.layout.newGraph(),l=this.layout.newNode(null),f=this.add(u,l);return this.setRootGraph(f),this.rootGraph},s.prototype.add=function(u,l,f,h,v){if(f==null&&h==null&&v==null){if(u==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(u)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(u),u.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return u.parent=l,l.child=u,u}else{v=f,h=l,f=u;var c=h.getOwner(),d=v.getOwner();if(!(c!=null&&c.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(d!=null&&d.getGraphManager()==this))throw"Target not in this graph mgr!";if(c==d)return f.isInterGraph=!1,c.add(f,h,v);if(f.isInterGraph=!0,f.source=h,f.target=v,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},s.prototype.remove=function(u){if(u instanceof i){var l=u;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(l.getEdges());for(var h,v=f.length,c=0;c<v;c++)h=f[c],l.remove(h);var d=[];d=d.concat(l.getNodes());var p;v=d.length;for(var c=0;c<v;c++)p=d[c],l.remove(p);l==this.rootGraph&&this.setRootGraph(null);var y=this.graphs.indexOf(l);this.graphs.splice(y,1),l.parent=null}else if(u instanceof o){if(h=u,h==null)throw"Edge is null!";if(!h.isInterGraph)throw"Not an inter-graph edge!";if(!(h.source!=null&&h.target!=null))throw"Source and/or target is null!";if(!(h.source.edges.indexOf(h)!=-1&&h.target.edges.indexOf(h)!=-1))throw"Source and/or target doesn't know this edge!";var y=h.source.edges.indexOf(h);if(h.source.edges.splice(y,1),y=h.target.edges.indexOf(h),h.target.edges.splice(y,1),!(h.source.owner!=null&&h.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(h.source.owner.getGraphManager().edges.indexOf(h)==-1)throw"Not in owner graph manager's edge list!";var y=h.source.owner.getGraphManager().edges.indexOf(h);h.source.owner.getGraphManager().edges.splice(y,1)}},s.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},s.prototype.getGraphs=function(){return this.graphs},s.prototype.getAllNodes=function(){if(this.allNodes==null){for(var u=[],l=this.getGraphs(),f=l.length,h=0;h<f;h++)u=u.concat(l[h].getNodes());this.allNodes=u}return this.allNodes},s.prototype.resetAllNodes=function(){this.allNodes=null},s.prototype.resetAllEdges=function(){this.allEdges=null},s.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},s.prototype.getAllEdges=function(){if(this.allEdges==null){var u=[],l=this.getGraphs();l.length;for(var f=0;f<l.length;f++)u=u.concat(l[f].getEdges());u=u.concat(this.edges),this.allEdges=u}return this.allEdges},s.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},s.prototype.setAllNodesToApplyGravitation=function(u){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=u},s.prototype.getRoot=function(){return this.rootGraph},s.prototype.setRootGraph=function(u){if(u.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=u,u.parent==null&&(u.parent=this.layout.newNode("Root node"))},s.prototype.getLayout=function(){return this.layout},s.prototype.isOneAncestorOfOther=function(u,l){if(!(u!=null&&l!=null))throw"assert failed";if(u==l)return!0;var f=u.getOwner(),h;do{if(h=f.getParent(),h==null)break;if(h==l)return!0;if(f=h.getOwner(),f==null)break}while(!0);f=l.getOwner();do{if(h=f.getParent(),h==null)break;if(h==u)return!0;if(f=h.getOwner(),f==null)break}while(!0);return!1},s.prototype.calcLowestCommonAncestors=function(){for(var u,l,f,h,v,c=this.getAllEdges(),d=c.length,p=0;p<d;p++){if(u=c[p],l=u.source,f=u.target,u.lca=null,u.sourceInLca=l,u.targetInLca=f,l==f){u.lca=l.getOwner();continue}for(h=l.getOwner();u.lca==null;){for(u.targetInLca=f,v=f.getOwner();u.lca==null;){if(v==h){u.lca=v;break}if(v==this.rootGraph)break;if(u.lca!=null)throw"assert failed";u.targetInLca=v.getParent(),v=u.targetInLca.getOwner()}if(h==this.rootGraph)break;u.lca==null&&(u.sourceInLca=h.getParent(),h=u.sourceInLca.getOwner())}if(u.lca==null)throw"assert failed"}},s.prototype.calcLowestCommonAncestor=function(u,l){if(u==l)return u.getOwner();var f=u.getOwner();do{if(f==null)break;var h=l.getOwner();do{if(h==null)break;if(h==f)return h;h=h.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},s.prototype.calcInclusionTreeDepths=function(u,l){u==null&&l==null&&(u=this.rootGraph,l=1);for(var f,h=u.getNodes(),v=h.length,c=0;c<v;c++)f=h[c],f.inclusionTreeDepth=l,f.child!=null&&this.calcInclusionTreeDepths(f.child,l+1)},s.prototype.includesInvalidEdge=function(){for(var u,l=[],f=this.edges.length,h=0;h<f;h++)u=this.edges[h],this.isOneAncestorOfOther(u.source,u.target)&&l.push(u);for(var h=0;h<l.length;h++)this.remove(l[h]);return!1},r.exports=s}),(function(r,a,n){var i=n(12);function o(){}o.calcSeparationAmount=function(s,u,l,f){if(!s.intersects(u))throw"assert failed";var h=new Array(2);this.decideDirectionsForOverlappingNodes(s,u,h),l[0]=Math.min(s.getRight(),u.getRight())-Math.max(s.x,u.x),l[1]=Math.min(s.getBottom(),u.getBottom())-Math.max(s.y,u.y),s.getX()<=u.getX()&&s.getRight()>=u.getRight()?l[0]+=Math.min(u.getX()-s.getX(),s.getRight()-u.getRight()):u.getX()<=s.getX()&&u.getRight()>=s.getRight()&&(l[0]+=Math.min(s.getX()-u.getX(),u.getRight()-s.getRight())),s.getY()<=u.getY()&&s.getBottom()>=u.getBottom()?l[1]+=Math.min(u.getY()-s.getY(),s.getBottom()-u.getBottom()):u.getY()<=s.getY()&&u.getBottom()>=s.getBottom()&&(l[1]+=Math.min(s.getY()-u.getY(),u.getBottom()-s.getBottom()));var v=Math.abs((u.getCenterY()-s.getCenterY())/(u.getCenterX()-s.getCenterX()));u.getCenterY()===s.getCenterY()&&u.getCenterX()===s.getCenterX()&&(v=1);var c=v*l[0],d=l[1]/v;l[0]<d?d=l[0]:c=l[1],l[0]=-1*h[0]*(d/2+f),l[1]=-1*h[1]*(c/2+f)},o.decideDirectionsForOverlappingNodes=function(s,u,l){s.getCenterX()<u.getCenterX()?l[0]=-1:l[0]=1,s.getCenterY()<u.getCenterY()?l[1]=-1:l[1]=1},o.getIntersection2=function(s,u,l){var f=s.getCenterX(),h=s.getCenterY(),v=u.getCenterX(),c=u.getCenterY();if(s.intersects(u))return l[0]=f,l[1]=h,l[2]=v,l[3]=c,!0;var d=s.getX(),p=s.getY(),y=s.getRight(),g=s.getX(),b=s.getBottom(),m=s.getRight(),w=s.getWidthHalf(),T=s.getHeightHalf(),D=u.getX(),x=u.getY(),N=u.getRight(),O=u.getX(),R=u.getBottom(),P=u.getRight(),M=u.getWidthHalf(),I=u.getHeightHalf(),E=!1,A=!1;if(f===v){if(h>c)return l[0]=f,l[1]=p,l[2]=v,l[3]=R,!1;if(h<c)return l[0]=f,l[1]=b,l[2]=v,l[3]=x,!1}else if(h===c){if(f>v)return l[0]=d,l[1]=h,l[2]=N,l[3]=c,!1;if(f<v)return l[0]=y,l[1]=h,l[2]=D,l[3]=c,!1}else{var C=s.height/s.width,S=u.height/u.width,L=(c-h)/(v-f),V=void 0,F=void 0,B=void 0,Y=void 0,q=void 0,Q=void 0;if(-C===L?f>v?(l[0]=g,l[1]=b,E=!0):(l[0]=y,l[1]=p,E=!0):C===L&&(f>v?(l[0]=d,l[1]=p,E=!0):(l[0]=m,l[1]=b,E=!0)),-S===L?v>f?(l[2]=O,l[3]=R,A=!0):(l[2]=N,l[3]=x,A=!0):S===L&&(v>f?(l[2]=D,l[3]=x,A=!0):(l[2]=P,l[3]=R,A=!0)),E&&A)return!1;if(f>v?h>c?(V=this.getCardinalDirection(C,L,4),F=this.getCardinalDirection(S,L,2)):(V=this.getCardinalDirection(-C,L,3),F=this.getCardinalDirection(-S,L,1)):h>c?(V=this.getCardinalDirection(-C,L,1),F=this.getCardinalDirection(-S,L,3)):(V=this.getCardinalDirection(C,L,2),F=this.getCardinalDirection(S,L,4)),!E)switch(V){case 1:Y=p,B=f+-T/L,l[0]=B,l[1]=Y;break;case 2:B=m,Y=h+w*L,l[0]=B,l[1]=Y;break;case 3:Y=b,B=f+T/L,l[0]=B,l[1]=Y;break;case 4:B=g,Y=h+-w*L,l[0]=B,l[1]=Y;break}if(!A)switch(F){case 1:Q=x,q=v+-I/L,l[2]=q,l[3]=Q;break;case 2:q=P,Q=c+M*L,l[2]=q,l[3]=Q;break;case 3:Q=R,q=v+I/L,l[2]=q,l[3]=Q;break;case 4:q=O,Q=c+-M*L,l[2]=q,l[3]=Q;break}}return!1},o.getCardinalDirection=function(s,u,l){return s>u?l:1+l%4},o.getIntersection=function(s,u,l,f){if(f==null)return this.getIntersection2(s,u,l);var h=s.x,v=s.y,c=u.x,d=u.y,p=l.x,y=l.y,g=f.x,b=f.y,m=void 0,w=void 0,T=void 0,D=void 0,x=void 0,N=void 0,O=void 0,R=void 0,P=void 0;return T=d-v,x=h-c,O=c*v-h*d,D=b-y,N=p-g,R=g*y-p*b,P=T*N-D*x,P===0?null:(m=(x*R-N*O)/P,w=(D*O-T*R)/P,new i(m,w))},o.angleOfVector=function(s,u,l,f){var h=void 0;return s!==l?(h=Math.atan((f-u)/(l-s)),l<s?h+=Math.PI:f<u&&(h+=this.TWO_PI)):f<u?h=this.ONE_AND_HALF_PI:h=this.HALF_PI,h},o.doIntersect=function(s,u,l,f){var h=s.x,v=s.y,c=u.x,d=u.y,p=l.x,y=l.y,g=f.x,b=f.y,m=(c-h)*(b-y)-(g-p)*(d-v);if(m===0)return!1;var w=((b-y)*(g-h)+(p-g)*(b-v))/m,T=((v-d)*(g-h)+(c-h)*(b-v))/m;return 0<w&&w<1&&0<T&&T<1},o.findCircleLineIntersections=function(s,u,l,f,h,v,c){var d=(l-s)*(l-s)+(f-u)*(f-u),p=2*((s-h)*(l-s)+(u-v)*(f-u)),y=(s-h)*(s-h)+(u-v)*(u-v)-c*c,g=p*p-4*d*y;if(g>=0){var b=(-p+Math.sqrt(p*p-4*d*y))/(2*d),m=(-p-Math.sqrt(p*p-4*d*y))/(2*d),w=null;return b>=0&&b<=1?[b]:m>=0&&m<=1?[m]:w}else return null},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,r.exports=o}),(function(r,a,n){function i(){}i.sign=function(o){return o>0?1:o<0?-1:0},i.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},i.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},r.exports=i}),(function(r,a,n){function i(){}i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,r.exports=i}),(function(r,a,n){var i=(function(){function h(v,c){for(var d=0;d<c.length;d++){var p=c[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(v,p.key,p)}}return function(v,c,d){return c&&h(v.prototype,c),d&&h(v,d),v}})();function o(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}var s=function(v){return{value:v,next:null,prev:null}},u=function(v,c,d,p){return v!==null?v.next=c:p.head=c,d!==null?d.prev=c:p.tail=c,c.prev=v,c.next=d,p.length++,c},l=function(v,c){var d=v.prev,p=v.next;return d!==null?d.next=p:c.head=p,p!==null?p.prev=d:c.tail=d,v.prev=v.next=null,c.length--,v},f=(function(){function h(v){var c=this;o(this,h),this.length=0,this.head=null,this.tail=null,v?.forEach(function(d){return c.push(d)})}return i(h,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(c,d){return u(d.prev,s(c),d,this)}},{key:"insertAfter",value:function(c,d){return u(d,s(c),d.next,this)}},{key:"insertNodeBefore",value:function(c,d){return u(d.prev,c,d,this)}},{key:"insertNodeAfter",value:function(c,d){return u(d,c,d.next,this)}},{key:"push",value:function(c){return u(this.tail,s(c),null,this)}},{key:"unshift",value:function(c){return u(null,s(c),this.head,this)}},{key:"remove",value:function(c){return l(c,this)}},{key:"pop",value:function(){return l(this.tail,this).value}},{key:"popNode",value:function(){return l(this.tail,this)}},{key:"shift",value:function(){return l(this.head,this).value}},{key:"shiftNode",value:function(){return l(this.head,this)}},{key:"get_object_at",value:function(c){if(c<=this.length()){for(var d=1,p=this.head;d<c;)p=p.next,d++;return p.value}}},{key:"set_object_at",value:function(c,d){if(c<=this.length()){for(var p=1,y=this.head;p<c;)y=y.next,p++;y.value=d}}}]),h})();r.exports=f}),(function(r,a,n){function i(o,s,u){this.x=null,this.y=null,o==null&&s==null&&u==null?(this.x=0,this.y=0):typeof o=="number"&&typeof s=="number"&&u==null?(this.x=o,this.y=s):o.constructor.name=="Point"&&s==null&&u==null&&(u=o,this.x=u.x,this.y=u.y)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(o,s,u){o.constructor.name=="Point"&&s==null&&u==null?(u=o,this.setLocation(u.x,u.y)):typeof o=="number"&&typeof s=="number"&&u==null&&(parseInt(o)==o&&parseInt(s)==s?this.move(o,s):(this.x=Math.floor(o+.5),this.y=Math.floor(s+.5)))},i.prototype.move=function(o,s){this.x=o,this.y=s},i.prototype.translate=function(o,s){this.x+=o,this.y+=s},i.prototype.equals=function(o){if(o.constructor.name=="Point"){var s=o;return this.x==s.x&&this.y==s.y}return this==o},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=i}),(function(r,a,n){function i(o,s,u,l){this.x=0,this.y=0,this.width=0,this.height=0,o!=null&&s!=null&&u!=null&&l!=null&&(this.x=o,this.y=s,this.width=u,this.height=l)}i.prototype.getX=function(){return this.x},i.prototype.setX=function(o){this.x=o},i.prototype.getY=function(){return this.y},i.prototype.setY=function(o){this.y=o},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(o){this.width=o},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(o){this.height=o},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(o){return!(this.getRight()<o.x||this.getBottom()<o.y||o.getRight()<this.x||o.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},r.exports=i}),(function(r,a,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function o(){}o.lastID=0,o.createID=function(s){return o.isPrimitive(s)?s:(s.uniqueID!=null||(s.uniqueID=o.getString(),o.lastID++),s.uniqueID)},o.getString=function(s){return s==null&&(s=o.lastID),"Object#"+s},o.isPrimitive=function(s){var u=typeof s>"u"?"undefined":i(s);return s==null||u!="object"&&u!="function"},r.exports=o}),(function(r,a,n){function i(p){if(Array.isArray(p)){for(var y=0,g=Array(p.length);y<p.length;y++)g[y]=p[y];return g}else return Array.from(p)}var o=n(0),s=n(7),u=n(3),l=n(1),f=n(6),h=n(5),v=n(17),c=n(29);function d(p){c.call(this),this.layoutQuality=o.QUALITY,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=o.DEFAULT_INCREMENTAL,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new s(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,p!=null&&(this.isRemoteUse=p)}d.RANDOM_SEED=1,d.prototype=Object.create(c.prototype),d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},d.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},d.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},d.prototype.newGraphManager=function(){var p=new s(this);return this.graphManager=p,p},d.prototype.newGraph=function(p){return new f(null,this.graphManager,p)},d.prototype.newNode=function(p){return new u(this.graphManager,p)},d.prototype.newEdge=function(p){return new l(null,null,p)},d.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},d.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var p;return this.checkLayoutSuccess()?p=!1:p=this.layout(),o.ANIMATE==="during"?!1:(p&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,p)},d.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},d.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var p=this.graphManager.getAllEdges(),y=0;y<p.length;y++)p[y];for(var g=this.graphManager.getRoot().getNodes(),y=0;y<g.length;y++)g[y];this.update(this.graphManager.getRoot())}},d.prototype.update=function(p){if(p==null)this.update2();else if(p instanceof u){var y=p;if(y.getChild()!=null)for(var g=y.getChild().getNodes(),b=0;b<g.length;b++)update(g[b]);if(y.vGraphObject!=null){var m=y.vGraphObject;m.update(y)}}else if(p instanceof l){var w=p;if(w.vGraphObject!=null){var T=w.vGraphObject;T.update(w)}}else if(p instanceof f){var D=p;if(D.vGraphObject!=null){var x=D.vGraphObject;x.update(D)}}},d.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=o.QUALITY,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=o.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},d.prototype.transform=function(p){if(p==null)this.transform(new h(0,0));else{var y=new v,g=this.graphManager.getRoot().updateLeftTop();if(g!=null){y.setWorldOrgX(p.x),y.setWorldOrgY(p.y),y.setDeviceOrgX(g.x),y.setDeviceOrgY(g.y);for(var b=this.getAllNodes(),m,w=0;w<b.length;w++)m=b[w],m.transform(y)}}},d.prototype.positionNodesRandomly=function(p){if(p==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var y,g,b=p.getNodes(),m=0;m<b.length;m++)y=b[m],g=y.getChild(),g==null||g.getNodes().length==0?y.scatter():(this.positionNodesRandomly(g),y.updateBounds())},d.prototype.getFlatForest=function(){for(var p=[],y=!0,g=this.graphManager.getRoot().getNodes(),b=!0,m=0;m<g.length;m++)g[m].getChild()!=null&&(b=!1);if(!b)return p;var w=new Set,T=[],D=new Map,x=[];for(x=x.concat(g);x.length>0&&y;){for(T.push(x[0]);T.length>0&&y;){var N=T[0];T.splice(0,1),w.add(N);for(var O=N.getEdges(),m=0;m<O.length;m++){var R=O[m].getOtherEnd(N);if(D.get(N)!=R)if(!w.has(R))T.push(R),D.set(R,N);else{y=!1;break}}}if(!y)p=[];else{var P=[].concat(i(w));p.push(P);for(var m=0;m<P.length;m++){var M=P[m],I=x.indexOf(M);I>-1&&x.splice(I,1)}w=new Set,D=new Map}}return p},d.prototype.createDummyNodesForBendpoints=function(p){for(var y=[],g=p.source,b=this.graphManager.calcLowestCommonAncestor(p.source,p.target),m=0;m<p.bendpoints.length;m++){var w=this.newNode(null);w.setRect(new Point(0,0),new Dimension(1,1)),b.add(w);var T=this.newEdge(null);this.graphManager.add(T,g,w),y.add(w),g=w}var T=this.newEdge(null);return this.graphManager.add(T,g,p.target),this.edgeToDummyNodes.set(p,y),p.isInterGraph()?this.graphManager.remove(p):b.remove(p),y},d.prototype.createBendpointsFromDummyNodes=function(){var p=[];p=p.concat(this.graphManager.getAllEdges()),p=[].concat(i(this.edgeToDummyNodes.keys())).concat(p);for(var y=0;y<p.length;y++){var g=p[y];if(g.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(g),m=0;m<b.length;m++){var w=b[m],T=new h(w.getCenterX(),w.getCenterY()),D=g.bendpoints.get(m);D.x=T.x,D.y=T.y,w.getOwner().remove(w)}this.graphManager.add(g,g.source,g.target)}}},d.transform=function(p,y,g,b){if(g!=null&&b!=null){var m=y;if(p<=50){var w=y/g;m-=(y-w)/50*(50-p)}else{var T=y*b;m+=(T-y)/50*(p-50)}return m}else{var D,x;return p<=50?(D=9*y/500,x=y/10):(D=9*y/50,x=-8*y),D*p+x}},d.findCenterOfTree=function(p){var y=[];y=y.concat(p);var g=[],b=new Map,m=!1,w=null;(y.length==1||y.length==2)&&(m=!0,w=y[0]);for(var T=0;T<y.length;T++){var D=y[T],x=D.getNeighborsList().size;b.set(D,D.getNeighborsList().size),x==1&&g.push(D)}var N=[];for(N=N.concat(g);!m;){var O=[];O=O.concat(N),N=[];for(var T=0;T<y.length;T++){var D=y[T],R=y.indexOf(D);R>=0&&y.splice(R,1);var P=D.getNeighborsList();P.forEach(function(E){if(g.indexOf(E)<0){var A=b.get(E),C=A-1;C==1&&N.push(E),b.set(E,C)}})}g=g.concat(N),(y.length==1||y.length==2)&&(m=!0,w=y[0])}return w},d.prototype.setGraphManager=function(p){this.graphManager=p},r.exports=d}),(function(r,a,n){function i(){}i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},r.exports=i}),(function(r,a,n){var i=n(5);function o(s,u){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(s){this.lworldExtX=s},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(s){this.lworldExtY=s},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},o.prototype.transformX=function(s){var u=0,l=this.lworldExtX;return l!=0&&(u=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/l),u},o.prototype.transformY=function(s){var u=0,l=this.lworldExtY;return l!=0&&(u=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/l),u},o.prototype.inverseTransformX=function(s){var u=0,l=this.ldeviceExtX;return l!=0&&(u=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/l),u},o.prototype.inverseTransformY=function(s){var u=0,l=this.ldeviceExtY;return l!=0&&(u=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/l),u},o.prototype.inverseTransformPoint=function(s){var u=new i(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return u},r.exports=o}),(function(r,a,n){function i(c){if(Array.isArray(c)){for(var d=0,p=Array(c.length);d<c.length;d++)p[d]=c[d];return p}else return Array.from(c)}var o=n(15),s=n(4),u=n(0),l=n(8),f=n(9);function h(){o.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}h.prototype=Object.create(o.prototype);for(var v in o)h[v]=o[v];h.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var c,d,p,y,g,b,m,w=this.getGraphManager().getAllEdges(),T=0;T<w.length;T++)c=w[T],d=c.idealLength,c.isInterGraph&&(y=c.getSource(),g=c.getTarget(),b=c.getSourceInLca().getEstimatedSize(),m=c.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(c.idealLength+=b+m-2*u.SIMPLE_NODE_SIZE),p=c.getLca().getInclusionTreeDepth(),c.idealLength+=d*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(y.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*p))},h.prototype.initSpringEmbedder=function(){var c=this.getAllNodes().length;this.incremental?(c>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(c-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(c>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(c-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var c=this.getAllEdges(),d,p=0;p<c.length;p++)d=c[p],this.calcSpringForce(d,d.idealLength)},h.prototype.calcRepulsionForces=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p,y,g,b,m=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&c&&this.updateGrid(),w=new Set,p=0;p<m.length;p++)g=m[p],this.calculateRepulsionForceOfANode(g,w,c,d),w.add(g);else for(p=0;p<m.length;p++)for(g=m[p],y=p+1;y<m.length;y++)b=m[y],g.getOwner()==b.getOwner()&&this.calcRepulsionForce(g,b)},h.prototype.calcGravitationalForces=function(){for(var c,d=this.getAllNodesToApplyGravitation(),p=0;p<d.length;p++)c=d[p],this.calcGravitationalForce(c)},h.prototype.moveNodes=function(){for(var c=this.getAllNodes(),d,p=0;p<c.length;p++)d=c[p],d.move()},h.prototype.calcSpringForce=function(c,d){var p=c.getSource(),y=c.getTarget(),g,b,m,w;if(this.uniformLeafNodeSizes&&p.getChild()==null&&y.getChild()==null)c.updateLengthSimple();else if(c.updateLength(),c.isOverlapingSourceAndTarget)return;g=c.getLength(),g!=0&&(b=c.edgeElasticity*(g-d),m=b*(c.lengthX/g),w=b*(c.lengthY/g),p.springForceX+=m,p.springForceY+=w,y.springForceX-=m,y.springForceY-=w)},h.prototype.calcRepulsionForce=function(c,d){var p=c.getRect(),y=d.getRect(),g=new Array(2),b=new Array(4),m,w,T,D,x,N,O;if(p.intersects(y)){l.calcSeparationAmount(p,y,g,s.DEFAULT_EDGE_LENGTH/2),N=2*g[0],O=2*g[1];var R=c.noOfChildren*d.noOfChildren/(c.noOfChildren+d.noOfChildren);c.repulsionForceX-=R*N,c.repulsionForceY-=R*O,d.repulsionForceX+=R*N,d.repulsionForceY+=R*O}else this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null?(m=y.getCenterX()-p.getCenterX(),w=y.getCenterY()-p.getCenterY()):(l.getIntersection(p,y,b),m=b[2]-b[0],w=b[3]-b[1]),Math.abs(m)<s.MIN_REPULSION_DIST&&(m=f.sign(m)*s.MIN_REPULSION_DIST),Math.abs(w)<s.MIN_REPULSION_DIST&&(w=f.sign(w)*s.MIN_REPULSION_DIST),T=m*m+w*w,D=Math.sqrt(T),x=(c.nodeRepulsion/2+d.nodeRepulsion/2)*c.noOfChildren*d.noOfChildren/T,N=x*m/D,O=x*w/D,c.repulsionForceX-=N,c.repulsionForceY-=O,d.repulsionForceX+=N,d.repulsionForceY+=O},h.prototype.calcGravitationalForce=function(c){var d,p,y,g,b,m,w,T;d=c.getOwner(),p=(d.getRight()+d.getLeft())/2,y=(d.getTop()+d.getBottom())/2,g=c.getCenterX()-p,b=c.getCenterY()-y,m=Math.abs(g)+c.getWidth()/2,w=Math.abs(b)+c.getHeight()/2,c.getOwner()==this.graphManager.getRoot()?(T=d.getEstimatedSize()*this.gravityRangeFactor,(m>T||w>T)&&(c.gravitationForceX=-this.gravityConstant*g,c.gravitationForceY=-this.gravityConstant*b)):(T=d.getEstimatedSize()*this.compoundGravityRangeFactor,(m>T||w>T)&&(c.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,c.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},h.prototype.isConverged=function(){var c,d=!1;return this.totalIterations>this.maxIterations/3&&(d=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),c=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,c||d},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var c,d=this.graphManager.getAllNodes(),p=0;p<d.length;p++)c=d[p],c.noOfChildren=c.getNoOfChildren()},h.prototype.calcGrid=function(c){var d=0,p=0;d=parseInt(Math.ceil((c.getRight()-c.getLeft())/this.repulsionRange)),p=parseInt(Math.ceil((c.getBottom()-c.getTop())/this.repulsionRange));for(var y=new Array(d),g=0;g<d;g++)y[g]=new Array(p);for(var g=0;g<d;g++)for(var b=0;b<p;b++)y[g][b]=new Array;return y},h.prototype.addNodeToGrid=function(c,d,p){var y=0,g=0,b=0,m=0;y=parseInt(Math.floor((c.getRect().x-d)/this.repulsionRange)),g=parseInt(Math.floor((c.getRect().width+c.getRect().x-d)/this.repulsionRange)),b=parseInt(Math.floor((c.getRect().y-p)/this.repulsionRange)),m=parseInt(Math.floor((c.getRect().height+c.getRect().y-p)/this.repulsionRange));for(var w=y;w<=g;w++)for(var T=b;T<=m;T++)this.grid[w][T].push(c),c.setGridCoordinates(y,g,b,m)},h.prototype.updateGrid=function(){var c,d,p=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),c=0;c<p.length;c++)d=p[c],this.addNodeToGrid(d,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(c,d,p,y){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&p||y){var g=new Set;c.surrounding=new Array;for(var b,m=this.grid,w=c.startX-1;w<c.finishX+2;w++)for(var T=c.startY-1;T<c.finishY+2;T++)if(!(w<0||T<0||w>=m.length||T>=m[0].length)){for(var D=0;D<m[w][T].length;D++)if(b=m[w][T][D],!(c.getOwner()!=b.getOwner()||c==b)&&!d.has(b)&&!g.has(b)){var x=Math.abs(c.getCenterX()-b.getCenterX())-(c.getWidth()/2+b.getWidth()/2),N=Math.abs(c.getCenterY()-b.getCenterY())-(c.getHeight()/2+b.getHeight()/2);x<=this.repulsionRange&&N<=this.repulsionRange&&g.add(b)}}c.surrounding=[].concat(i(g))}for(w=0;w<c.surrounding.length;w++)this.calcRepulsionForce(c,c.surrounding[w])},h.prototype.calcRepulsionRange=function(){return 0},r.exports=h}),(function(r,a,n){var i=n(1),o=n(4);function s(l,f,h){i.call(this,l,f,h),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];r.exports=s}),(function(r,a,n){var i=n(3),o=n(4);function s(l,f,h,v){i.call(this,l,f,h,v),this.nodeRepulsion=o.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];s.prototype.setGridCoordinates=function(l,f,h,v){this.startX=l,this.finishX=f,this.startY=h,this.finishY=v},r.exports=s}),(function(r,a,n){function i(o,s){this.width=0,this.height=0,o!==null&&s!==null&&(this.height=s,this.width=o)}i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(o){this.width=o},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(o){this.height=o},r.exports=i}),(function(r,a,n){var i=n(14);function o(){this.map={},this.keys=[]}o.prototype.put=function(s,u){var l=i.createID(s);this.contains(l)||(this.map[l]=u,this.keys.push(s))},o.prototype.contains=function(s){return i.createID(s),this.map[s]!=null},o.prototype.get=function(s){var u=i.createID(s);return this.map[u]},o.prototype.keySet=function(){return this.keys},r.exports=o}),(function(r,a,n){var i=n(14);function o(){this.set={}}o.prototype.add=function(s){var u=i.createID(s);this.contains(u)||(this.set[u]=s)},o.prototype.remove=function(s){delete this.set[i.createID(s)]},o.prototype.clear=function(){this.set={}},o.prototype.contains=function(s){return this.set[i.createID(s)]==s},o.prototype.isEmpty=function(){return this.size()===0},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAllTo=function(s){for(var u=Object.keys(this.set),l=u.length,f=0;f<l;f++)s.push(this.set[u[f]])},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAll=function(s){for(var u=s.length,l=0;l<u;l++){var f=s[l];this.add(f)}},r.exports=o}),(function(r,a,n){function i(){}i.multMat=function(o,s){for(var u=[],l=0;l<o.length;l++){u[l]=[];for(var f=0;f<s[0].length;f++){u[l][f]=0;for(var h=0;h<o[0].length;h++)u[l][f]+=o[l][h]*s[h][f]}}return u},i.transpose=function(o){for(var s=[],u=0;u<o[0].length;u++){s[u]=[];for(var l=0;l<o.length;l++)s[u][l]=o[l][u]}return s},i.multCons=function(o,s){for(var u=[],l=0;l<o.length;l++)u[l]=o[l]*s;return u},i.minusOp=function(o,s){for(var u=[],l=0;l<o.length;l++)u[l]=o[l]-s[l];return u},i.dotProduct=function(o,s){for(var u=0,l=0;l<o.length;l++)u+=o[l]*s[l];return u},i.mag=function(o){return Math.sqrt(this.dotProduct(o,o))},i.normalize=function(o){for(var s=[],u=this.mag(o),l=0;l<o.length;l++)s[l]=o[l]/u;return s},i.multGamma=function(o){for(var s=[],u=0,l=0;l<o.length;l++)u+=o[l];u*=-1/o.length;for(var f=0;f<o.length;f++)s[f]=u+o[f];return s},i.multL=function(o,s,u){for(var l=[],f=[],h=[],v=0;v<s[0].length;v++){for(var c=0,d=0;d<s.length;d++)c+=-.5*s[d][v]*o[d];f[v]=c}for(var p=0;p<u.length;p++){for(var y=0,g=0;g<u.length;g++)y+=u[p][g]*f[g];h[p]=y}for(var b=0;b<s.length;b++){for(var m=0,w=0;w<s[0].length;w++)m+=s[b][w]*h[w];l[b]=m}return l},r.exports=i}),(function(r,a,n){var i=(function(){function l(f,h){for(var v=0;v<h.length;v++){var c=h[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(f,c.key,c)}}return function(f,h,v){return h&&l(f.prototype,h),v&&l(f,v),f}})();function o(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}var s=n(11),u=(function(){function l(f,h){o(this,l),(h!==null||h!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var v=void 0;f instanceof s?v=f.size():v=f.length,this._quicksort(f,0,v-1)}return i(l,[{key:"_quicksort",value:function(h,v,c){if(v<c){var d=this._partition(h,v,c);this._quicksort(h,v,d),this._quicksort(h,d+1,c)}}},{key:"_partition",value:function(h,v,c){for(var d=this._get(h,v),p=v,y=c;;){for(;this.compareFunction(d,this._get(h,y));)y--;for(;this.compareFunction(this._get(h,p),d);)p++;if(p<y)this._swap(h,p,y),p++,y--;else return y}}},{key:"_get",value:function(h,v){return h instanceof s?h.get_object_at(v):h[v]}},{key:"_set",value:function(h,v,c){h instanceof s?h.set_object_at(v,c):h[v]=c}},{key:"_swap",value:function(h,v,c){var d=this._get(h,v);this._set(h,v,this._get(h,c)),this._set(h,c,d)}},{key:"_defaultCompareFunction",value:function(h,v){return v>h}}]),l})();r.exports=u}),(function(r,a,n){function i(){}i.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var s=Math.min(this.m,this.n);this.s=(function(Re){for(var Ve=[];Re-- >0;)Ve.push(0);return Ve})(Math.min(this.m+1,this.n)),this.U=(function(Re){var Ve=function He(Ze){if(Ze.length==0)return 0;for(var tt=[],Xe=0;Xe<Ze[0];Xe++)tt.push(He(Ze.slice(1)));return tt};return Ve(Re)})([this.m,s]),this.V=(function(Re){var Ve=function He(Ze){if(Ze.length==0)return 0;for(var tt=[],Xe=0;Xe<Ze[0];Xe++)tt.push(He(Ze.slice(1)));return tt};return Ve(Re)})([this.n,this.n]);for(var u=(function(Re){for(var Ve=[];Re-- >0;)Ve.push(0);return Ve})(this.n),l=(function(Re){for(var Ve=[];Re-- >0;)Ve.push(0);return Ve})(this.m),f=!0,h=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m)),c=0;c<Math.max(h,v);c++){if(c<h){this.s[c]=0;for(var d=c;d<this.m;d++)this.s[c]=i.hypot(this.s[c],o[d][c]);if(this.s[c]!==0){o[c][c]<0&&(this.s[c]=-this.s[c]);for(var p=c;p<this.m;p++)o[p][c]/=this.s[c];o[c][c]+=1}this.s[c]=-this.s[c]}for(var y=c+1;y<this.n;y++){if((function(Re,Ve){return Re&&Ve})(c<h,this.s[c]!==0)){for(var g=0,b=c;b<this.m;b++)g+=o[b][c]*o[b][y];g=-g/o[c][c];for(var m=c;m<this.m;m++)o[m][y]+=g*o[m][c]}u[y]=o[c][y]}if((function(Re,Ve){return Ve})(f,c<h))for(var w=c;w<this.m;w++)this.U[w][c]=o[w][c];if(c<v){u[c]=0;for(var T=c+1;T<this.n;T++)u[c]=i.hypot(u[c],u[T]);if(u[c]!==0){u[c+1]<0&&(u[c]=-u[c]);for(var D=c+1;D<this.n;D++)u[D]/=u[c];u[c+1]+=1}if(u[c]=-u[c],(function(Re,Ve){return Re&&Ve})(c+1<this.m,u[c]!==0)){for(var x=c+1;x<this.m;x++)l[x]=0;for(var N=c+1;N<this.n;N++)for(var O=c+1;O<this.m;O++)l[O]+=u[N]*o[O][N];for(var R=c+1;R<this.n;R++)for(var P=-u[R]/u[c+1],M=c+1;M<this.m;M++)o[M][R]+=P*l[M]}for(var I=c+1;I<this.n;I++)this.V[I][c]=u[I]}}var E=Math.min(this.n,this.m+1);h<this.n&&(this.s[h]=o[h][h]),this.m<E&&(this.s[E-1]=0),v+1<E&&(u[v]=o[v][E-1]),u[E-1]=0;{for(var A=h;A<s;A++){for(var C=0;C<this.m;C++)this.U[C][A]=0;this.U[A][A]=1}for(var S=h-1;S>=0;S--)if(this.s[S]!==0){for(var L=S+1;L<s;L++){for(var V=0,F=S;F<this.m;F++)V+=this.U[F][S]*this.U[F][L];V=-V/this.U[S][S];for(var B=S;B<this.m;B++)this.U[B][L]+=V*this.U[B][S]}for(var Y=S;Y<this.m;Y++)this.U[Y][S]=-this.U[Y][S];this.U[S][S]=1+this.U[S][S];for(var q=0;q<S-1;q++)this.U[q][S]=0}else{for(var Q=0;Q<this.m;Q++)this.U[Q][S]=0;this.U[S][S]=1}}for(var $=this.n-1;$>=0;$--){if((function(Re,Ve){return Re&&Ve})($<v,u[$]!==0))for(var K=$+1;K<s;K++){for(var j=0,re=$+1;re<this.n;re++)j+=this.V[re][$]*this.V[re][K];j=-j/this.V[$+1][$];for(var U=$+1;U<this.n;U++)this.V[U][K]+=j*this.V[U][$]}for(var H=0;H<this.n;H++)this.V[H][$]=0;this.V[$][$]=1}for(var _=E-1,W=Math.pow(2,-52),J=Math.pow(2,-966);E>0;){var te=void 0,de=void 0;for(te=E-2;te>=-1&&te!==-1;te--)if(Math.abs(u[te])<=J+W*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){u[te]=0;break}if(te===E-2)de=4;else{var Te=void 0;for(Te=E-1;Te>=te&&Te!==te;Te--){var ge=(Te!==E?Math.abs(u[Te]):0)+(Te!==te+1?Math.abs(u[Te-1]):0);if(Math.abs(this.s[Te])<=J+W*ge){this.s[Te]=0;break}}Te===te?de=3:Te===E-1?de=1:(de=2,te=Te)}switch(te++,de){case 1:{var le=u[E-2];u[E-2]=0;for(var he=E-2;he>=te;he--){var fe=i.hypot(this.s[he],le),ve=this.s[he]/fe,ye=le/fe;this.s[he]=fe,he!==te&&(le=-ye*u[he-1],u[he-1]=ve*u[he-1]);for(var me=0;me<this.n;me++)fe=ve*this.V[me][he]+ye*this.V[me][E-1],this.V[me][E-1]=-ye*this.V[me][he]+ve*this.V[me][E-1],this.V[me][he]=fe}}break;case 2:{var xe=u[te-1];u[te-1]=0;for(var Le=te;Le<E;Le++){var ke=i.hypot(this.s[Le],xe),Fe=this.s[Le]/ke,Be=xe/ke;this.s[Le]=ke,xe=-Be*u[Le],u[Le]=Fe*u[Le];for(var Oe=0;Oe<this.m;Oe++)ke=Fe*this.U[Oe][Le]+Be*this.U[Oe][te-1],this.U[Oe][te-1]=-Be*this.U[Oe][Le]+Fe*this.U[Oe][te-1],this.U[Oe][Le]=ke}}break;case 3:{var ne=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[E-1]),Math.abs(this.s[E-2])),Math.abs(u[E-2])),Math.abs(this.s[te])),Math.abs(u[te])),k=this.s[E-1]/ne,z=this.s[E-2]/ne,G=u[E-2]/ne,X=this.s[te]/ne,Z=u[te]/ne,ae=((z+k)*(z-k)+G*G)/2,ee=k*G*(k*G),ie=0;(function(Re,Ve){return Re||Ve})(ae!==0,ee!==0)&&(ie=Math.sqrt(ae*ae+ee),ae<0&&(ie=-ie),ie=ee/(ae+ie));for(var se=(X+k)*(X-k)+ie,oe=X*Z,ue=te;ue<E-1;ue++){var pe=i.hypot(se,oe),ce=se/pe,we=oe/pe;ue!==te&&(u[ue-1]=pe),se=ce*this.s[ue]+we*u[ue],u[ue]=ce*u[ue]-we*this.s[ue],oe=we*this.s[ue+1],this.s[ue+1]=ce*this.s[ue+1];for(var Ne=0;Ne<this.n;Ne++)pe=ce*this.V[Ne][ue]+we*this.V[Ne][ue+1],this.V[Ne][ue+1]=-we*this.V[Ne][ue]+ce*this.V[Ne][ue+1],this.V[Ne][ue]=pe;if(pe=i.hypot(se,oe),ce=se/pe,we=oe/pe,this.s[ue]=pe,se=ce*u[ue]+we*this.s[ue+1],this.s[ue+1]=-we*u[ue]+ce*this.s[ue+1],oe=we*u[ue+1],u[ue+1]=ce*u[ue+1],ue<this.m-1)for(var De=0;De<this.m;De++)pe=ce*this.U[De][ue]+we*this.U[De][ue+1],this.U[De][ue+1]=-we*this.U[De][ue]+ce*this.U[De][ue+1],this.U[De][ue]=pe}u[E-2]=se}break;case 4:{if(this.s[te]<=0){this.s[te]=this.s[te]<0?-this.s[te]:0;for(var Ee=0;Ee<=_;Ee++)this.V[Ee][te]=-this.V[Ee][te]}for(;te<_&&!(this.s[te]>=this.s[te+1]);){var ze=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=ze,te<this.n-1)for(var Ce=0;Ce<this.n;Ce++)ze=this.V[Ce][te+1],this.V[Ce][te+1]=this.V[Ce][te],this.V[Ce][te]=ze;if(te<this.m-1)for(var Se=0;Se<this.m;Se++)ze=this.U[Se][te+1],this.U[Se][te+1]=this.U[Se][te],this.U[Se][te]=ze;te++}E--}break}}var Ue={U:this.U,V:this.V,S:this.s};return Ue},i.hypot=function(o,s){var u=void 0;return Math.abs(o)>Math.abs(s)?(u=s/o,u=Math.abs(o)*Math.sqrt(1+u*u)):s!=0?(u=o/s,u=Math.abs(s)*Math.sqrt(1+u*u)):u=0,u},r.exports=i}),(function(r,a,n){var i=(function(){function u(l,f){for(var h=0;h<f.length;h++){var v=f[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(l,v.key,v)}}return function(l,f,h){return f&&u(l.prototype,f),h&&u(l,h),l}})();function o(u,l){if(!(u instanceof l))throw new TypeError("Cannot call a class as a function")}var s=(function(){function u(l,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,u),this.sequence1=l,this.sequence2=f,this.match_score=h,this.mismatch_penalty=v,this.gap_penalty=c,this.iMax=l.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var d=0;d<this.iMax;d++){this.grid[d]=new Array(this.jMax);for(var p=0;p<this.jMax;p++)this.grid[d][p]=0}this.tracebackGrid=new Array(this.iMax);for(var y=0;y<this.iMax;y++){this.tracebackGrid[y]=new Array(this.jMax);for(var g=0;g<this.jMax;g++)this.tracebackGrid[y][g]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return i(u,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var h=1;h<this.iMax;h++)this.grid[h][0]=this.grid[h-1][0]+this.gap_penalty,this.tracebackGrid[h][0]=[!1,!0,!1];for(var v=1;v<this.iMax;v++)for(var c=1;c<this.jMax;c++){var d=void 0;this.sequence1[v-1]===this.sequence2[c-1]?d=this.grid[v-1][c-1]+this.match_score:d=this.grid[v-1][c-1]+this.mismatch_penalty;var p=this.grid[v-1][c]+this.gap_penalty,y=this.grid[v][c-1]+this.gap_penalty,g=[d,p,y],b=this.arrayAllMaxIndexes(g);this.grid[v][c]=g[b[0]],this.tracebackGrid[v][c]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var h=f[0],v=this.tracebackGrid[h.pos[0]][h.pos[1]];v[0]&&f.push({pos:[h.pos[0]-1,h.pos[1]-1],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),v[1]&&f.push({pos:[h.pos[0]-1,h.pos[1]],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:"-"+h.seq2}),v[2]&&f.push({pos:[h.pos[0],h.pos[1]-1],seq1:"-"+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),h.pos[0]===0&&h.pos[1]===0&&this.alignments.push({sequence1:h.seq1,sequence2:h.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,h){for(var v=[],c=-1;(c=f.indexOf(h,c+1))!==-1;)v.push(c);return v}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),u})();r.exports=s}),(function(r,a,n){var i=function(){};i.FDLayout=n(18),i.FDLayoutConstants=n(4),i.FDLayoutEdge=n(19),i.FDLayoutNode=n(20),i.DimensionD=n(21),i.HashMap=n(22),i.HashSet=n(23),i.IGeometry=n(8),i.IMath=n(9),i.Integer=n(10),i.Point=n(12),i.PointD=n(5),i.RandomSeed=n(16),i.RectangleD=n(13),i.Transform=n(17),i.UniqueIDGeneretor=n(14),i.Quicksort=n(25),i.LinkedList=n(11),i.LGraphObject=n(2),i.LGraph=n(6),i.LEdge=n(1),i.LGraphManager=n(7),i.LNode=n(3),i.Layout=n(15),i.LayoutConstants=n(0),i.NeedlemanWunsch=n(27),i.Matrix=n(24),i.SVD=n(26),r.exports=i}),(function(r,a,n){function i(){this.listeners=[]}var o=i.prototype;o.addListener=function(s,u){this.listeners.push({event:s,callback:u})},o.removeListener=function(s,u){for(var l=this.listeners.length;l>=0;l--){var f=this.listeners[l];f.event===s&&f.callback===u&&this.listeners.splice(l,1)}},o.emit=function(s,u){for(var l=0;l<this.listeners.length;l++){var f=this.listeners[l];s===f.event&&f.callback(u)}},r.exports=i})])})})(Xn)),Xn.exports}var F1=Wn.exports,ph;function z1(){return ph||(ph=1,(function(t,e){(function(a,n){t.exports=n(B1())})(F1,function(r){return(()=>{var a={45:((s,u,l)=>{var f={};f.layoutBase=l(551),f.CoSEConstants=l(806),f.CoSEEdge=l(767),f.CoSEGraph=l(880),f.CoSEGraphManager=l(578),f.CoSELayout=l(765),f.CoSENode=l(991),f.ConstraintHandler=l(902),s.exports=f}),806:((s,u,l)=>{var f=l(551).FDLayoutConstants;function h(){}for(var v in f)h[v]=f[v];h.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,h.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,h.DEFAULT_COMPONENT_SEPERATION=60,h.TILE=!0,h.TILING_PADDING_VERTICAL=10,h.TILING_PADDING_HORIZONTAL=10,h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0,h.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,h.TREE_REDUCTION_ON_INCREMENTAL=!0,h.PURE_INCREMENTAL=h.DEFAULT_INCREMENTAL,s.exports=h}),767:((s,u,l)=>{var f=l(551).FDLayoutEdge;function h(c,d,p){f.call(this,c,d,p)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),880:((s,u,l)=>{var f=l(551).LGraph;function h(c,d,p){f.call(this,c,d,p)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),578:((s,u,l)=>{var f=l(551).LGraphManager;function h(c){f.call(this,c)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),765:((s,u,l)=>{var f=l(551).FDLayout,h=l(578),v=l(880),c=l(991),d=l(767),p=l(806),y=l(902),g=l(551).FDLayoutConstants,b=l(551).LayoutConstants,m=l(551).Point,w=l(551).PointD,T=l(551).DimensionD,D=l(551).Layout,x=l(551).Integer,N=l(551).IGeometry,O=l(551).LGraph,R=l(551).Transform,P=l(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var I in f)M[I]=f[I];M.prototype.newGraphManager=function(){var E=new h(this);return this.graphManager=E,E},M.prototype.newGraph=function(E){return new v(null,this.graphManager,E)},M.prototype.newNode=function(E){return new c(this.graphManager,E)},M.prototype.newEdge=function(E){return new d(null,null,E)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(p.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=p.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=p.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var E=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return E&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(p.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(V){return A.has(V)});this.graphManager.setAllNodesToApplyGravitation(C)}}else{var E=this.getFlatForest();if(E.length>0)this.positionNodesRadially(E);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(S){return A.has(S)});this.graphManager.setAllNodesToApplyGravitation(C),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),p.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(L){return E.has(L)});this.graphManager.setAllNodesToApplyGravitation(A),this.graphManager.updateBounds(),this.updateGrid(),p.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),p.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var C=!this.isTreeGrowing&&!this.isGrowthFinished,S=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(C,S),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var E=this.graphManager.getAllNodes(),A={},C=0;C<E.length;C++){var S=E[C].rect,L=E[C].id;A[L]={id:L,x:S.getCenterX(),y:S.getCenterY(),w:S.width,h:S.height}}return A},M.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var E=!1;if(g.ANIMATE==="during")this.emit("layoutstarted");else{for(;!E;)E=this.tick();this.graphManager.updateBounds()}},M.prototype.moveNodes=function(){for(var E=this.getAllNodes(),A,C=0;C<E.length;C++)A=E[C],A.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var C=0;C<E.length;C++)A=E[C],A.move()},M.prototype.initConstraintVariables=function(){var E=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var A=this.graphManager.getAllNodes(),C=0;C<A.length;C++){var S=A[C];this.idToNodeMap.set(S.id,S)}var L=function U(H){for(var _=H.getChild().getNodes(),W,J=0,te=0;te<_.length;te++)W=_[te],W.getChild()==null?E.fixedNodeSet.has(W.id)&&(J+=100):J+=U(W);return J};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(_){E.fixedNodeSet.add(_.nodeId)});for(var A=this.graphManager.getAllNodes(),S,C=0;C<A.length;C++)if(S=A[C],S.getChild()!=null){var V=L(S);V>0&&(S.fixedNodeWeight=V)}}if(this.constraints.relativePlacementConstraint){var F=new Map,B=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(U){E.fixedNodesOnHorizontal.add(U),E.fixedNodesOnVertical.add(U)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var Y=this.constraints.alignmentConstraint.vertical,C=0;C<Y.length;C++)this.dummyToNodeForVerticalAlignment.set("dummy"+C,[]),Y[C].forEach(function(H){F.set(H,"dummy"+C),E.dummyToNodeForVerticalAlignment.get("dummy"+C).push(H),E.fixedNodeSet.has(H)&&E.fixedNodesOnHorizontal.add("dummy"+C)});if(this.constraints.alignmentConstraint.horizontal)for(var q=this.constraints.alignmentConstraint.horizontal,C=0;C<q.length;C++)this.dummyToNodeForHorizontalAlignment.set("dummy"+C,[]),q[C].forEach(function(H){B.set(H,"dummy"+C),E.dummyToNodeForHorizontalAlignment.get("dummy"+C).push(H),E.fixedNodeSet.has(H)&&E.fixedNodesOnVertical.add("dummy"+C)})}if(p.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(U){var H,_,W;for(W=U.length-1;W>=2*U.length/3;W--)H=Math.floor(Math.random()*(W+1)),_=U[W],U[W]=U[H],U[H]=_;return U},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(U){if(U.left){var H=F.has(U.left)?F.get(U.left):U.left,_=F.has(U.right)?F.get(U.right):U.right;E.nodesInRelativeHorizontal.includes(H)||(E.nodesInRelativeHorizontal.push(H),E.nodeToRelativeConstraintMapHorizontal.set(H,[]),E.dummyToNodeForVerticalAlignment.has(H)?E.nodeToTempPositionMapHorizontal.set(H,E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):E.nodeToTempPositionMapHorizontal.set(H,E.idToNodeMap.get(H).getCenterX())),E.nodesInRelativeHorizontal.includes(_)||(E.nodesInRelativeHorizontal.push(_),E.nodeToRelativeConstraintMapHorizontal.set(_,[]),E.dummyToNodeForVerticalAlignment.has(_)?E.nodeToTempPositionMapHorizontal.set(_,E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get(_)[0]).getCenterX()):E.nodeToTempPositionMapHorizontal.set(_,E.idToNodeMap.get(_).getCenterX())),E.nodeToRelativeConstraintMapHorizontal.get(H).push({right:_,gap:U.gap}),E.nodeToRelativeConstraintMapHorizontal.get(_).push({left:H,gap:U.gap})}else{var W=B.has(U.top)?B.get(U.top):U.top,J=B.has(U.bottom)?B.get(U.bottom):U.bottom;E.nodesInRelativeVertical.includes(W)||(E.nodesInRelativeVertical.push(W),E.nodeToRelativeConstraintMapVertical.set(W,[]),E.dummyToNodeForHorizontalAlignment.has(W)?E.nodeToTempPositionMapVertical.set(W,E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(W)[0]).getCenterY()):E.nodeToTempPositionMapVertical.set(W,E.idToNodeMap.get(W).getCenterY())),E.nodesInRelativeVertical.includes(J)||(E.nodesInRelativeVertical.push(J),E.nodeToRelativeConstraintMapVertical.set(J,[]),E.dummyToNodeForHorizontalAlignment.has(J)?E.nodeToTempPositionMapVertical.set(J,E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):E.nodeToTempPositionMapVertical.set(J,E.idToNodeMap.get(J).getCenterY())),E.nodeToRelativeConstraintMapVertical.get(W).push({bottom:J,gap:U.gap}),E.nodeToRelativeConstraintMapVertical.get(J).push({top:W,gap:U.gap})}});else{var Q=new Map,$=new Map;this.constraints.relativePlacementConstraint.forEach(function(U){if(U.left){var H=F.has(U.left)?F.get(U.left):U.left,_=F.has(U.right)?F.get(U.right):U.right;Q.has(H)?Q.get(H).push(_):Q.set(H,[_]),Q.has(_)?Q.get(_).push(H):Q.set(_,[H])}else{var W=B.has(U.top)?B.get(U.top):U.top,J=B.has(U.bottom)?B.get(U.bottom):U.bottom;$.has(W)?$.get(W).push(J):$.set(W,[J]),$.has(J)?$.get(J).push(W):$.set(J,[W])}});var K=function(H,_){var W=[],J=[],te=new P,de=new Set,Te=0;return H.forEach(function(ge,le){if(!de.has(le)){W[Te]=[],J[Te]=!1;var he=le;for(te.push(he),de.add(he),W[Te].push(he);te.length!=0;){he=te.shift(),_.has(he)&&(J[Te]=!0);var fe=H.get(he);fe.forEach(function(ve){de.has(ve)||(te.push(ve),de.add(ve),W[Te].push(ve))})}Te++}}),{components:W,isFixed:J}},j=K(Q,E.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var re=K($,E.fixedNodesOnVertical);this.componentsOnVertical=re.components,this.fixedComponentsOnVertical=re.isFixed}}},M.prototype.updateDisplacements=function(){var E=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(re){var U=E.idToNodeMap.get(re.nodeId);U.displacementX=0,U.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var A=this.constraints.alignmentConstraint.vertical,C=0;C<A.length;C++){for(var S=0,L=0;L<A[C].length;L++){if(this.fixedNodeSet.has(A[C][L])){S=0;break}S+=this.idToNodeMap.get(A[C][L]).displacementX}for(var V=S/A[C].length,L=0;L<A[C].length;L++)this.idToNodeMap.get(A[C][L]).displacementX=V}if(this.constraints.alignmentConstraint.horizontal)for(var F=this.constraints.alignmentConstraint.horizontal,C=0;C<F.length;C++){for(var B=0,L=0;L<F[C].length;L++){if(this.fixedNodeSet.has(F[C][L])){B=0;break}B+=this.idToNodeMap.get(F[C][L]).displacementY}for(var Y=B/F[C].length,L=0;L<F[C].length;L++)this.idToNodeMap.get(F[C][L]).displacementY=Y}}if(this.constraints.relativePlacementConstraint)if(p.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(re){if(!E.fixedNodesOnHorizontal.has(re)){var U=0;E.dummyToNodeForVerticalAlignment.has(re)?U=E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get(re)[0]).displacementX:U=E.idToNodeMap.get(re).displacementX,E.nodeToRelativeConstraintMapHorizontal.get(re).forEach(function(H){if(H.right){var _=E.nodeToTempPositionMapHorizontal.get(H.right)-E.nodeToTempPositionMapHorizontal.get(re)-U;_<H.gap&&(U-=H.gap-_)}else{var _=E.nodeToTempPositionMapHorizontal.get(re)-E.nodeToTempPositionMapHorizontal.get(H.left)+U;_<H.gap&&(U+=H.gap-_)}}),E.nodeToTempPositionMapHorizontal.set(re,E.nodeToTempPositionMapHorizontal.get(re)+U),E.dummyToNodeForVerticalAlignment.has(re)?E.dummyToNodeForVerticalAlignment.get(re).forEach(function(H){E.idToNodeMap.get(H).displacementX=U}):E.idToNodeMap.get(re).displacementX=U}}),this.nodesInRelativeVertical.forEach(function(re){if(!E.fixedNodesOnHorizontal.has(re)){var U=0;E.dummyToNodeForHorizontalAlignment.has(re)?U=E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(re)[0]).displacementY:U=E.idToNodeMap.get(re).displacementY,E.nodeToRelativeConstraintMapVertical.get(re).forEach(function(H){if(H.bottom){var _=E.nodeToTempPositionMapVertical.get(H.bottom)-E.nodeToTempPositionMapVertical.get(re)-U;_<H.gap&&(U-=H.gap-_)}else{var _=E.nodeToTempPositionMapVertical.get(re)-E.nodeToTempPositionMapVertical.get(H.top)+U;_<H.gap&&(U+=H.gap-_)}}),E.nodeToTempPositionMapVertical.set(re,E.nodeToTempPositionMapVertical.get(re)+U),E.dummyToNodeForHorizontalAlignment.has(re)?E.dummyToNodeForHorizontalAlignment.get(re).forEach(function(H){E.idToNodeMap.get(H).displacementY=U}):E.idToNodeMap.get(re).displacementY=U}});else{for(var C=0;C<this.componentsOnHorizontal.length;C++){var q=this.componentsOnHorizontal[C];if(this.fixedComponentsOnHorizontal[C])for(var L=0;L<q.length;L++)this.dummyToNodeForVerticalAlignment.has(q[L])?this.dummyToNodeForVerticalAlignment.get(q[L]).forEach(function(H){E.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(q[L]).displacementX=0;else{for(var Q=0,$=0,L=0;L<q.length;L++)if(this.dummyToNodeForVerticalAlignment.has(q[L])){var K=this.dummyToNodeForVerticalAlignment.get(q[L]);Q+=K.length*this.idToNodeMap.get(K[0]).displacementX,$+=K.length}else Q+=this.idToNodeMap.get(q[L]).displacementX,$++;for(var j=Q/$,L=0;L<q.length;L++)this.dummyToNodeForVerticalAlignment.has(q[L])?this.dummyToNodeForVerticalAlignment.get(q[L]).forEach(function(H){E.idToNodeMap.get(H).displacementX=j}):this.idToNodeMap.get(q[L]).displacementX=j}}for(var C=0;C<this.componentsOnVertical.length;C++){var q=this.componentsOnVertical[C];if(this.fixedComponentsOnVertical[C])for(var L=0;L<q.length;L++)this.dummyToNodeForHorizontalAlignment.has(q[L])?this.dummyToNodeForHorizontalAlignment.get(q[L]).forEach(function(_){E.idToNodeMap.get(_).displacementY=0}):this.idToNodeMap.get(q[L]).displacementY=0;else{for(var Q=0,$=0,L=0;L<q.length;L++)if(this.dummyToNodeForHorizontalAlignment.has(q[L])){var K=this.dummyToNodeForHorizontalAlignment.get(q[L]);Q+=K.length*this.idToNodeMap.get(K[0]).displacementY,$+=K.length}else Q+=this.idToNodeMap.get(q[L]).displacementY,$++;for(var j=Q/$,L=0;L<q.length;L++)this.dummyToNodeForHorizontalAlignment.has(q[L])?this.dummyToNodeForHorizontalAlignment.get(q[L]).forEach(function(te){E.idToNodeMap.get(te).displacementY=j}):this.idToNodeMap.get(q[L]).displacementY=j}}}},M.prototype.calculateNodesToApplyGravitationTo=function(){var E=[],A,C=this.graphManager.getGraphs(),S=C.length,L;for(L=0;L<S;L++)A=C[L],A.updateConnected(),A.isConnected||(E=E.concat(A.getNodes()));return E},M.prototype.createBendpoints=function(){var E=[];E=E.concat(this.graphManager.getAllEdges());var A=new Set,C;for(C=0;C<E.length;C++){var S=E[C];if(!A.has(S)){var L=S.getSource(),V=S.getTarget();if(L==V)S.getBendpoints().push(new w),S.getBendpoints().push(new w),this.createDummyNodesForBendpoints(S),A.add(S);else{var F=[];if(F=F.concat(L.getEdgeListToNode(V)),F=F.concat(V.getEdgeListToNode(L)),!A.has(F[0])){if(F.length>1){var B;for(B=0;B<F.length;B++){var Y=F[B];Y.getBendpoints().push(new w),this.createDummyNodesForBendpoints(Y)}}F.forEach(function(q){A.add(q)})}}}if(A.size==E.length)break}},M.prototype.positionNodesRadially=function(E){for(var A=new m(0,0),C=Math.ceil(Math.sqrt(E.length)),S=0,L=0,V=0,F=new w(0,0),B=0;B<E.length;B++){B%C==0&&(V=0,L=S,B!=0&&(L+=p.DEFAULT_COMPONENT_SEPERATION),S=0);var Y=E[B],q=D.findCenterOfTree(Y);A.x=V,A.y=L,F=M.radialLayout(Y,q,A),F.y>S&&(S=Math.floor(F.y)),V=Math.floor(F.x+p.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(b.WORLD_CENTER_X-F.x/2,b.WORLD_CENTER_Y-F.y/2))},M.radialLayout=function(E,A,C){var S=Math.max(this.maxDiagonalInTree(E),p.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(A,null,0,359,0,S);var L=O.calculateBounds(E),V=new R;V.setDeviceOrgX(L.getMinX()),V.setDeviceOrgY(L.getMinY()),V.setWorldOrgX(C.x),V.setWorldOrgY(C.y);for(var F=0;F<E.length;F++){var B=E[F];B.transform(V)}var Y=new w(L.getMaxX(),L.getMaxY());return V.inverseTransformPoint(Y)},M.branchRadialLayout=function(E,A,C,S,L,V){var F=(S-C+1)/2;F<0&&(F+=180);var B=(F+C)%360,Y=B*N.TWO_PI/360,q=L*Math.cos(Y),Q=L*Math.sin(Y);E.setCenter(q,Q);var $=[];$=$.concat(E.getEdges());var K=$.length;A!=null&&K--;for(var j=0,re=$.length,U,H=E.getEdgesBetween(A);H.length>1;){var _=H[0];H.splice(0,1);var W=$.indexOf(_);W>=0&&$.splice(W,1),re--,K--}A!=null?U=($.indexOf(H[0])+1)%re:U=0;for(var J=Math.abs(S-C)/K,te=U;j!=K;te=++te%re){var de=$[te].getOtherEnd(E);if(de!=A){var Te=(C+j*J)%360,ge=(Te+J)%360;M.branchRadialLayout(de,E,Te,ge,L+V,V),j++}}},M.maxDiagonalInTree=function(E){for(var A=x.MIN_VALUE,C=0;C<E.length;C++){var S=E[C],L=S.getDiagonal();L>A&&(A=L)}return A},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var E=this,A={};this.memberGroups={},this.idToDummyNode={};for(var C=[],S=this.graphManager.getAllNodes(),L=0;L<S.length;L++){var V=S[L],F=V.getParent();this.getNodeDegreeWithChildren(V)===0&&(F.id==null||!this.getToBeTiled(F))&&C.push(V)}for(var L=0;L<C.length;L++){var V=C[L],B=V.getParent().id;typeof A[B]>"u"&&(A[B]=[]),A[B]=A[B].concat(V)}Object.keys(A).forEach(function(Y){if(A[Y].length>1){var q="DummyCompound_"+Y;E.memberGroups[q]=A[Y];var Q=A[Y][0].getParent(),$=new c(E.graphManager);$.id=q,$.paddingLeft=Q.paddingLeft||0,$.paddingRight=Q.paddingRight||0,$.paddingBottom=Q.paddingBottom||0,$.paddingTop=Q.paddingTop||0,E.idToDummyNode[q]=$;var K=E.getGraphManager().add(E.newGraph(),$),j=Q.getChild();j.add($);for(var re=0;re<A[Y].length;re++){var U=A[Y][re];j.remove(U),K.add(U)}}})},M.prototype.clearCompounds=function(){var E={},A={};this.performDFSOnCompounds();for(var C=0;C<this.compoundOrder.length;C++)A[this.compoundOrder[C].id]=this.compoundOrder[C],E[this.compoundOrder[C].id]=[].concat(this.compoundOrder[C].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[C].getChild()),this.compoundOrder[C].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(E,A)},M.prototype.clearZeroDegreeMembers=function(){var E=this,A=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(C){var S=E.idToDummyNode[C];if(A[C]=E.tileNodes(E.memberGroups[C],S.paddingLeft+S.paddingRight),S.rect.width=A[C].width,S.rect.height=A[C].height,S.setCenter(A[C].centerX,A[C].centerY),S.labelMarginLeft=0,S.labelMarginTop=0,p.NODE_DIMENSIONS_INCLUDE_LABELS){var L=S.rect.width,V=S.rect.height;S.labelWidth&&(S.labelPosHorizontal=="left"?(S.rect.x-=S.labelWidth,S.setWidth(L+S.labelWidth),S.labelMarginLeft=S.labelWidth):S.labelPosHorizontal=="center"&&S.labelWidth>L?(S.rect.x-=(S.labelWidth-L)/2,S.setWidth(S.labelWidth),S.labelMarginLeft=(S.labelWidth-L)/2):S.labelPosHorizontal=="right"&&S.setWidth(L+S.labelWidth)),S.labelHeight&&(S.labelPosVertical=="top"?(S.rect.y-=S.labelHeight,S.setHeight(V+S.labelHeight),S.labelMarginTop=S.labelHeight):S.labelPosVertical=="center"&&S.labelHeight>V?(S.rect.y-=(S.labelHeight-V)/2,S.setHeight(S.labelHeight),S.labelMarginTop=(S.labelHeight-V)/2):S.labelPosVertical=="bottom"&&S.setHeight(V+S.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var E=this.compoundOrder.length-1;E>=0;E--){var A=this.compoundOrder[E],C=A.id,S=A.paddingLeft,L=A.paddingTop,V=A.labelMarginLeft,F=A.labelMarginTop;this.adjustLocations(this.tiledMemberPack[C],A.rect.x,A.rect.y,S,L,V,F)}},M.prototype.repopulateZeroDegreeMembers=function(){var E=this,A=this.tiledZeroDegreePack;Object.keys(A).forEach(function(C){var S=E.idToDummyNode[C],L=S.paddingLeft,V=S.paddingTop,F=S.labelMarginLeft,B=S.labelMarginTop;E.adjustLocations(A[C],S.rect.x,S.rect.y,L,V,F,B)})},M.prototype.getToBeTiled=function(E){var A=E.id;if(this.toBeTiled[A]!=null)return this.toBeTiled[A];var C=E.getChild();if(C==null)return this.toBeTiled[A]=!1,!1;for(var S=C.getNodes(),L=0;L<S.length;L++){var V=S[L];if(this.getNodeDegree(V)>0)return this.toBeTiled[A]=!1,!1;if(V.getChild()==null){this.toBeTiled[V.id]=!1;continue}if(!this.getToBeTiled(V))return this.toBeTiled[A]=!1,!1}return this.toBeTiled[A]=!0,!0},M.prototype.getNodeDegree=function(E){E.id;for(var A=E.getEdges(),C=0,S=0;S<A.length;S++){var L=A[S];L.getSource().id!==L.getTarget().id&&(C=C+1)}return C},M.prototype.getNodeDegreeWithChildren=function(E){var A=this.getNodeDegree(E);if(E.getChild()==null)return A;for(var C=E.getChild().getNodes(),S=0;S<C.length;S++){var L=C[S];A+=this.getNodeDegreeWithChildren(L)}return A},M.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},M.prototype.fillCompexOrderByDFS=function(E){for(var A=0;A<E.length;A++){var C=E[A];C.getChild()!=null&&this.fillCompexOrderByDFS(C.getChild().getNodes()),this.getToBeTiled(C)&&this.compoundOrder.push(C)}},M.prototype.adjustLocations=function(E,A,C,S,L,V,F){A+=S+V,C+=L+F;for(var B=A,Y=0;Y<E.rows.length;Y++){var q=E.rows[Y];A=B;for(var Q=0,$=0;$<q.length;$++){var K=q[$];K.rect.x=A,K.rect.y=C,A+=K.rect.width+E.horizontalPadding,K.rect.height>Q&&(Q=K.rect.height)}C+=Q+E.verticalPadding}},M.prototype.tileCompoundMembers=function(E,A){var C=this;this.tiledMemberPack=[],Object.keys(E).forEach(function(S){var L=A[S];if(C.tiledMemberPack[S]=C.tileNodes(E[S],L.paddingLeft+L.paddingRight),L.rect.width=C.tiledMemberPack[S].width,L.rect.height=C.tiledMemberPack[S].height,L.setCenter(C.tiledMemberPack[S].centerX,C.tiledMemberPack[S].centerY),L.labelMarginLeft=0,L.labelMarginTop=0,p.NODE_DIMENSIONS_INCLUDE_LABELS){var V=L.rect.width,F=L.rect.height;L.labelWidth&&(L.labelPosHorizontal=="left"?(L.rect.x-=L.labelWidth,L.setWidth(V+L.labelWidth),L.labelMarginLeft=L.labelWidth):L.labelPosHorizontal=="center"&&L.labelWidth>V?(L.rect.x-=(L.labelWidth-V)/2,L.setWidth(L.labelWidth),L.labelMarginLeft=(L.labelWidth-V)/2):L.labelPosHorizontal=="right"&&L.setWidth(V+L.labelWidth)),L.labelHeight&&(L.labelPosVertical=="top"?(L.rect.y-=L.labelHeight,L.setHeight(F+L.labelHeight),L.labelMarginTop=L.labelHeight):L.labelPosVertical=="center"&&L.labelHeight>F?(L.rect.y-=(L.labelHeight-F)/2,L.setHeight(L.labelHeight),L.labelMarginTop=(L.labelHeight-F)/2):L.labelPosVertical=="bottom"&&L.setHeight(F+L.labelHeight))}})},M.prototype.tileNodes=function(E,A){var C=this.tileNodesByFavoringDim(E,A,!0),S=this.tileNodesByFavoringDim(E,A,!1),L=this.getOrgRatio(C),V=this.getOrgRatio(S),F;return V<L?F=S:F=C,F},M.prototype.getOrgRatio=function(E){var A=E.width,C=E.height,S=A/C;return S<1&&(S=1/S),S},M.prototype.calcIdealRowWidth=function(E,A){var C=p.TILING_PADDING_VERTICAL,S=p.TILING_PADDING_HORIZONTAL,L=E.length,V=0,F=0,B=0;E.forEach(function(re){V+=re.getWidth(),F+=re.getHeight(),re.getWidth()>B&&(B=re.getWidth())});var Y=V/L,q=F/L,Q=Math.pow(C-S,2)+4*(Y+S)*(q+C)*L,$=(S-C+Math.sqrt(Q))/(2*(Y+S)),K;A?(K=Math.ceil($),K==$&&K++):K=Math.floor($);var j=K*(Y+S)-S;return B>j&&(j=B),j+=S*2,j},M.prototype.tileNodesByFavoringDim=function(E,A,C){var S=p.TILING_PADDING_VERTICAL,L=p.TILING_PADDING_HORIZONTAL,V=p.TILING_COMPARE_BY,F={rows:[],rowWidth:[],rowHeight:[],width:0,height:A,verticalPadding:S,horizontalPadding:L,centerX:0,centerY:0};V&&(F.idealRowWidth=this.calcIdealRowWidth(E,C));var B=function(U){return U.rect.width*U.rect.height},Y=function(U,H){return B(H)-B(U)};E.sort(function(re,U){var H=Y;return F.idealRowWidth?(H=V,H(re.id,U.id)):H(re,U)});for(var q=0,Q=0,$=0;$<E.length;$++){var K=E[$];q+=K.getCenterX(),Q+=K.getCenterY()}F.centerX=q/E.length,F.centerY=Q/E.length;for(var $=0;$<E.length;$++){var K=E[$];if(F.rows.length==0)this.insertNodeToRow(F,K,0,A);else if(this.canAddHorizontal(F,K.rect.width,K.rect.height)){var j=F.rows.length-1;F.idealRowWidth||(j=this.getShortestRowIndex(F)),this.insertNodeToRow(F,K,j,A)}else this.insertNodeToRow(F,K,F.rows.length,A);this.shiftToLastRow(F)}return F},M.prototype.insertNodeToRow=function(E,A,C,S){var L=S;if(C==E.rows.length){var V=[];E.rows.push(V),E.rowWidth.push(L),E.rowHeight.push(0)}var F=E.rowWidth[C]+A.rect.width;E.rows[C].length>0&&(F+=E.horizontalPadding),E.rowWidth[C]=F,E.width<F&&(E.width=F);var B=A.rect.height;C>0&&(B+=E.verticalPadding);var Y=0;B>E.rowHeight[C]&&(Y=E.rowHeight[C],E.rowHeight[C]=B,Y=E.rowHeight[C]-Y),E.height+=Y,E.rows[C].push(A)},M.prototype.getShortestRowIndex=function(E){for(var A=-1,C=Number.MAX_VALUE,S=0;S<E.rows.length;S++)E.rowWidth[S]<C&&(A=S,C=E.rowWidth[S]);return A},M.prototype.getLongestRowIndex=function(E){for(var A=-1,C=Number.MIN_VALUE,S=0;S<E.rows.length;S++)E.rowWidth[S]>C&&(A=S,C=E.rowWidth[S]);return A},M.prototype.canAddHorizontal=function(E,A,C){if(E.idealRowWidth){var S=E.rows.length-1,L=E.rowWidth[S];return L+A+E.horizontalPadding<=E.idealRowWidth}var V=this.getShortestRowIndex(E);if(V<0)return!0;var F=E.rowWidth[V];if(F+E.horizontalPadding+A<=E.width)return!0;var B=0;E.rowHeight[V]<C&&V>0&&(B=C+E.verticalPadding-E.rowHeight[V]);var Y;E.width-F>=A+E.horizontalPadding?Y=(E.height+B)/(F+A+E.horizontalPadding):Y=(E.height+B)/E.width,B=C+E.verticalPadding;var q;return E.width<A?q=(E.height+B)/A:q=(E.height+B)/E.width,q<1&&(q=1/q),Y<1&&(Y=1/Y),Y<q},M.prototype.shiftToLastRow=function(E){var A=this.getLongestRowIndex(E),C=E.rowWidth.length-1,S=E.rows[A],L=S[S.length-1],V=L.width+E.horizontalPadding;if(E.width-E.rowWidth[C]>V&&A!=C){S.splice(-1,1),E.rows[C].push(L),E.rowWidth[A]=E.rowWidth[A]-V,E.rowWidth[C]=E.rowWidth[C]+V,E.width=E.rowWidth[instance.getLongestRowIndex(E)];for(var F=Number.MIN_VALUE,B=0;B<S.length;B++)S[B].height>F&&(F=S[B].height);A>0&&(F+=E.verticalPadding);var Y=E.rowHeight[A]+E.rowHeight[C];E.rowHeight[A]=F,E.rowHeight[C]<L.height+E.verticalPadding&&(E.rowHeight[C]=L.height+E.verticalPadding);var q=E.rowHeight[A]+E.rowHeight[C];E.height+=q-Y,this.shiftToLastRow(E)}},M.prototype.tilingPreLayout=function(){p.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},M.prototype.tilingPostLayout=function(){p.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},M.prototype.reduceTrees=function(){for(var E=[],A=!0,C;A;){var S=this.graphManager.getAllNodes(),L=[];A=!1;for(var V=0;V<S.length;V++)if(C=S[V],C.getEdges().length==1&&!C.getEdges()[0].isInterGraph&&C.getChild()==null){if(p.PURE_INCREMENTAL){var F=C.getEdges()[0].getOtherEnd(C),B=new T(C.getCenterX()-F.getCenterX(),C.getCenterY()-F.getCenterY());L.push([C,C.getEdges()[0],C.getOwner(),B])}else L.push([C,C.getEdges()[0],C.getOwner()]);A=!0}if(A==!0){for(var Y=[],q=0;q<L.length;q++)L[q][0].getEdges().length==1&&(Y.push(L[q]),L[q][0].getOwner().remove(L[q][0]));E.push(Y),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=E},M.prototype.growTree=function(E){for(var A=E.length,C=E[A-1],S,L=0;L<C.length;L++)S=C[L],this.findPlaceforPrunedNode(S),S[2].add(S[0]),S[2].add(S[1],S[1].source,S[1].target);E.splice(E.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},M.prototype.findPlaceforPrunedNode=function(E){var A,C,S=E[0];if(S==E[1].source?C=E[1].target:C=E[1].source,p.PURE_INCREMENTAL)S.setCenter(C.getCenterX()+E[3].getWidth(),C.getCenterY()+E[3].getHeight());else{var L=C.startX,V=C.finishX,F=C.startY,B=C.finishY,Y=0,q=0,Q=0,$=0,K=[Y,Q,q,$];if(F>0)for(var j=L;j<=V;j++)K[0]+=this.grid[j][F-1].length+this.grid[j][F].length-1;if(V<this.grid.length-1)for(var j=F;j<=B;j++)K[1]+=this.grid[V+1][j].length+this.grid[V][j].length-1;if(B<this.grid[0].length-1)for(var j=L;j<=V;j++)K[2]+=this.grid[j][B+1].length+this.grid[j][B].length-1;if(L>0)for(var j=F;j<=B;j++)K[3]+=this.grid[L-1][j].length+this.grid[L][j].length-1;for(var re=x.MAX_VALUE,U,H,_=0;_<K.length;_++)K[_]<re?(re=K[_],U=1,H=_):K[_]==re&&U++;if(U==3&&re==0)K[0]==0&&K[1]==0&&K[2]==0?A=1:K[0]==0&&K[1]==0&&K[3]==0?A=0:K[0]==0&&K[2]==0&&K[3]==0?A=3:K[1]==0&&K[2]==0&&K[3]==0&&(A=2);else if(U==2&&re==0){var W=Math.floor(Math.random()*2);K[0]==0&&K[1]==0?W==0?A=0:A=1:K[0]==0&&K[2]==0?W==0?A=0:A=2:K[0]==0&&K[3]==0?W==0?A=0:A=3:K[1]==0&&K[2]==0?W==0?A=1:A=2:K[1]==0&&K[3]==0?W==0?A=1:A=3:W==0?A=2:A=3}else if(U==4&&re==0){var W=Math.floor(Math.random()*4);A=W}else A=H;A==0?S.setCenter(C.getCenterX(),C.getCenterY()-C.getHeight()/2-g.DEFAULT_EDGE_LENGTH-S.getHeight()/2):A==1?S.setCenter(C.getCenterX()+C.getWidth()/2+g.DEFAULT_EDGE_LENGTH+S.getWidth()/2,C.getCenterY()):A==2?S.setCenter(C.getCenterX(),C.getCenterY()+C.getHeight()/2+g.DEFAULT_EDGE_LENGTH+S.getHeight()/2):S.setCenter(C.getCenterX()-C.getWidth()/2-g.DEFAULT_EDGE_LENGTH-S.getWidth()/2,C.getCenterY())}},s.exports=M}),991:((s,u,l)=>{var f=l(551).FDLayoutNode,h=l(551).IMath;function v(d,p,y,g){f.call(this,d,p,y,g)}v.prototype=Object.create(f.prototype);for(var c in f)v[c]=f[c];v.prototype.calculateDisplacement=function(){var d=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=d.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=d.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=d.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=d.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>d.coolingFactor*d.maxNodeDisplacement&&(this.displacementX=d.coolingFactor*d.maxNodeDisplacement*h.sign(this.displacementX)),Math.abs(this.displacementY)>d.coolingFactor*d.maxNodeDisplacement&&(this.displacementY=d.coolingFactor*d.maxNodeDisplacement*h.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},v.prototype.propogateDisplacementToChildren=function(d,p){for(var y=this.getChild().getNodes(),g,b=0;b<y.length;b++)g=y[b],g.getChild()==null?(g.displacementX+=d,g.displacementY+=p):g.propogateDisplacementToChildren(d,p)},v.prototype.move=function(){var d=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),d.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},v.prototype.setPred1=function(d){this.pred1=d},v.prototype.getPred1=function(){return pred1},v.prototype.getPred2=function(){return pred2},v.prototype.setNext=function(d){this.next=d},v.prototype.getNext=function(){return next},v.prototype.setProcessed=function(d){this.processed=d},v.prototype.isProcessed=function(){return processed},s.exports=v}),902:((s,u,l)=>{function f(y){if(Array.isArray(y)){for(var g=0,b=Array(y.length);g<y.length;g++)b[g]=y[g];return b}else return Array.from(y)}var h=l(806),v=l(551).LinkedList,c=l(551).Matrix,d=l(551).SVD;function p(){}p.handleConstraints=function(y){var g={};g.fixedNodeConstraint=y.constraints.fixedNodeConstraint,g.alignmentConstraint=y.constraints.alignmentConstraint,g.relativePlacementConstraint=y.constraints.relativePlacementConstraint;for(var b=new Map,m=new Map,w=[],T=[],D=y.getAllNodes(),x=0,N=0;N<D.length;N++){var O=D[N];O.getChild()==null&&(m.set(O.id,x++),w.push(O.getCenterX()),T.push(O.getCenterY()),b.set(O.id,O))}g.relativePlacementConstraint&&g.relativePlacementConstraint.forEach(function(z){!z.gap&&z.gap!=0&&(z.left?z.gap=h.DEFAULT_EDGE_LENGTH+b.get(z.left).getWidth()/2+b.get(z.right).getWidth()/2:z.gap=h.DEFAULT_EDGE_LENGTH+b.get(z.top).getHeight()/2+b.get(z.bottom).getHeight()/2)});var R=function(G,X){return{x:G.x-X.x,y:G.y-X.y}},P=function(G){var X=0,Z=0;return G.forEach(function(ae){X+=w[m.get(ae)],Z+=T[m.get(ae)]}),{x:X/G.size,y:Z/G.size}},M=function(G,X,Z,ae,ee){function ie(De,Ee){var ze=new Set(De),Ce=!0,Se=!1,Ue=void 0;try{for(var Re=Ee[Symbol.iterator](),Ve;!(Ce=(Ve=Re.next()).done);Ce=!0){var He=Ve.value;ze.add(He)}}catch(Ze){Se=!0,Ue=Ze}finally{try{!Ce&&Re.return&&Re.return()}finally{if(Se)throw Ue}}return ze}var se=new Map;G.forEach(function(De,Ee){se.set(Ee,0)}),G.forEach(function(De,Ee){De.forEach(function(ze){se.set(ze.id,se.get(ze.id)+1)})});var oe=new Map,ue=new Map,pe=new v;se.forEach(function(De,Ee){De==0?(pe.push(Ee),Z||(X=="horizontal"?oe.set(Ee,m.has(Ee)?w[m.get(Ee)]:ae.get(Ee)):oe.set(Ee,m.has(Ee)?T[m.get(Ee)]:ae.get(Ee)))):oe.set(Ee,Number.NEGATIVE_INFINITY),Z&&ue.set(Ee,new Set([Ee]))}),Z&&ee.forEach(function(De){var Ee=[];if(De.forEach(function(Se){Z.has(Se)&&Ee.push(Se)}),Ee.length>0){var ze=0;Ee.forEach(function(Se){X=="horizontal"?(oe.set(Se,m.has(Se)?w[m.get(Se)]:ae.get(Se)),ze+=oe.get(Se)):(oe.set(Se,m.has(Se)?T[m.get(Se)]:ae.get(Se)),ze+=oe.get(Se))}),ze=ze/Ee.length,De.forEach(function(Se){Z.has(Se)||oe.set(Se,ze)})}else{var Ce=0;De.forEach(function(Se){X=="horizontal"?Ce+=m.has(Se)?w[m.get(Se)]:ae.get(Se):Ce+=m.has(Se)?T[m.get(Se)]:ae.get(Se)}),Ce=Ce/De.length,De.forEach(function(Se){oe.set(Se,Ce)})}});for(var ce=function(){var Ee=pe.shift(),ze=G.get(Ee);ze.forEach(function(Ce){if(oe.get(Ce.id)<oe.get(Ee)+Ce.gap)if(Z&&Z.has(Ce.id)){var Se=void 0;if(X=="horizontal"?Se=m.has(Ce.id)?w[m.get(Ce.id)]:ae.get(Ce.id):Se=m.has(Ce.id)?T[m.get(Ce.id)]:ae.get(Ce.id),oe.set(Ce.id,Se),Se<oe.get(Ee)+Ce.gap){var Ue=oe.get(Ee)+Ce.gap-Se;ue.get(Ee).forEach(function(Re){oe.set(Re,oe.get(Re)-Ue)})}}else oe.set(Ce.id,oe.get(Ee)+Ce.gap);se.set(Ce.id,se.get(Ce.id)-1),se.get(Ce.id)==0&&pe.push(Ce.id),Z&&ue.set(Ce.id,ie(ue.get(Ee),ue.get(Ce.id)))})};pe.length!=0;)ce();if(Z){var we=new Set;G.forEach(function(De,Ee){De.length==0&&we.add(Ee)});var Ne=[];ue.forEach(function(De,Ee){if(we.has(Ee)){var ze=!1,Ce=!0,Se=!1,Ue=void 0;try{for(var Re=De[Symbol.iterator](),Ve;!(Ce=(Ve=Re.next()).done);Ce=!0){var He=Ve.value;Z.has(He)&&(ze=!0)}}catch(Xe){Se=!0,Ue=Xe}finally{try{!Ce&&Re.return&&Re.return()}finally{if(Se)throw Ue}}if(!ze){var Ze=!1,tt=void 0;Ne.forEach(function(Xe,Lt){Xe.has([].concat(f(De))[0])&&(Ze=!0,tt=Lt)}),Ze?De.forEach(function(Xe){Ne[tt].add(Xe)}):Ne.push(new Set(De))}}}),Ne.forEach(function(De,Ee){var ze=Number.POSITIVE_INFINITY,Ce=Number.POSITIVE_INFINITY,Se=Number.NEGATIVE_INFINITY,Ue=Number.NEGATIVE_INFINITY,Re=!0,Ve=!1,He=void 0;try{for(var Ze=De[Symbol.iterator](),tt;!(Re=(tt=Ze.next()).done);Re=!0){var Xe=tt.value,Lt=void 0;X=="horizontal"?Lt=m.has(Xe)?w[m.get(Xe)]:ae.get(Xe):Lt=m.has(Xe)?T[m.get(Xe)]:ae.get(Xe);var Pt=oe.get(Xe);Lt<ze&&(ze=Lt),Lt>Se&&(Se=Lt),Pt<Ce&&(Ce=Pt),Pt>Ue&&(Ue=Pt)}}catch(fr){Ve=!0,He=fr}finally{try{!Re&&Ze.return&&Ze.return()}finally{if(Ve)throw He}}var pt=(ze+Se)/2-(Ce+Ue)/2,at=!0,st=!1,Ft=void 0;try{for(var ut=De[Symbol.iterator](),Rr;!(at=(Rr=ut.next()).done);at=!0){var lr=Rr.value;oe.set(lr,oe.get(lr)+pt)}}catch(fr){st=!0,Ft=fr}finally{try{!at&&ut.return&&ut.return()}finally{if(st)throw Ft}}})}return oe},I=function(G){var X=0,Z=0,ae=0,ee=0;if(G.forEach(function(ue){ue.left?w[m.get(ue.left)]-w[m.get(ue.right)]>=0?X++:Z++:T[m.get(ue.top)]-T[m.get(ue.bottom)]>=0?ae++:ee++}),X>Z&&ae>ee)for(var ie=0;ie<m.size;ie++)w[ie]=-1*w[ie],T[ie]=-1*T[ie];else if(X>Z)for(var se=0;se<m.size;se++)w[se]=-1*w[se];else if(ae>ee)for(var oe=0;oe<m.size;oe++)T[oe]=-1*T[oe]},E=function(G){var X=[],Z=new v,ae=new Set,ee=0;return G.forEach(function(ie,se){if(!ae.has(se)){X[ee]=[];var oe=se;for(Z.push(oe),ae.add(oe),X[ee].push(oe);Z.length!=0;){oe=Z.shift();var ue=G.get(oe);ue.forEach(function(pe){ae.has(pe.id)||(Z.push(pe.id),ae.add(pe.id),X[ee].push(pe.id))})}ee++}}),X},A=function(G){var X=new Map;return G.forEach(function(Z,ae){X.set(ae,[])}),G.forEach(function(Z,ae){Z.forEach(function(ee){X.get(ae).push(ee),X.get(ee.id).push({id:ae,gap:ee.gap,direction:ee.direction})})}),X},C=function(G){var X=new Map;return G.forEach(function(Z,ae){X.set(ae,[])}),G.forEach(function(Z,ae){Z.forEach(function(ee){X.get(ee.id).push({id:ae,gap:ee.gap,direction:ee.direction})})}),X},S=[],L=[],V=!1,F=!1,B=new Set,Y=new Map,q=new Map,Q=[];if(g.fixedNodeConstraint&&g.fixedNodeConstraint.forEach(function(z){B.add(z.nodeId)}),g.relativePlacementConstraint&&(g.relativePlacementConstraint.forEach(function(z){z.left?(Y.has(z.left)?Y.get(z.left).push({id:z.right,gap:z.gap,direction:"horizontal"}):Y.set(z.left,[{id:z.right,gap:z.gap,direction:"horizontal"}]),Y.has(z.right)||Y.set(z.right,[])):(Y.has(z.top)?Y.get(z.top).push({id:z.bottom,gap:z.gap,direction:"vertical"}):Y.set(z.top,[{id:z.bottom,gap:z.gap,direction:"vertical"}]),Y.has(z.bottom)||Y.set(z.bottom,[]))}),q=A(Y),Q=E(q)),h.TRANSFORM_ON_CONSTRAINT_HANDLING){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>1)g.fixedNodeConstraint.forEach(function(z,G){S[G]=[z.position.x,z.position.y],L[G]=[w[m.get(z.nodeId)],T[m.get(z.nodeId)]]}),V=!0;else if(g.alignmentConstraint)(function(){var z=0;if(g.alignmentConstraint.vertical){for(var G=g.alignmentConstraint.vertical,X=function(oe){var ue=new Set;G[oe].forEach(function(we){ue.add(we)});var pe=new Set([].concat(f(ue)).filter(function(we){return B.has(we)})),ce=void 0;pe.size>0?ce=w[m.get(pe.values().next().value)]:ce=P(ue).x,G[oe].forEach(function(we){S[z]=[ce,T[m.get(we)]],L[z]=[w[m.get(we)],T[m.get(we)]],z++})},Z=0;Z<G.length;Z++)X(Z);V=!0}if(g.alignmentConstraint.horizontal){for(var ae=g.alignmentConstraint.horizontal,ee=function(oe){var ue=new Set;ae[oe].forEach(function(we){ue.add(we)});var pe=new Set([].concat(f(ue)).filter(function(we){return B.has(we)})),ce=void 0;pe.size>0?ce=w[m.get(pe.values().next().value)]:ce=P(ue).y,ae[oe].forEach(function(we){S[z]=[w[m.get(we)],ce],L[z]=[w[m.get(we)],T[m.get(we)]],z++})},ie=0;ie<ae.length;ie++)ee(ie);V=!0}g.relativePlacementConstraint&&(F=!0)})();else if(g.relativePlacementConstraint){for(var $=0,K=0,j=0;j<Q.length;j++)Q[j].length>$&&($=Q[j].length,K=j);if($<q.size/2)I(g.relativePlacementConstraint),V=!1,F=!1;else{var re=new Map,U=new Map,H=[];Q[K].forEach(function(z){Y.get(z).forEach(function(G){G.direction=="horizontal"?(re.has(z)?re.get(z).push(G):re.set(z,[G]),re.has(G.id)||re.set(G.id,[]),H.push({left:z,right:G.id})):(U.has(z)?U.get(z).push(G):U.set(z,[G]),U.has(G.id)||U.set(G.id,[]),H.push({top:z,bottom:G.id}))})}),I(H),F=!1;var _=M(re,"horizontal"),W=M(U,"vertical");Q[K].forEach(function(z,G){L[G]=[w[m.get(z)],T[m.get(z)]],S[G]=[],_.has(z)?S[G][0]=_.get(z):S[G][0]=w[m.get(z)],W.has(z)?S[G][1]=W.get(z):S[G][1]=T[m.get(z)]}),V=!0}}if(V){for(var J=void 0,te=c.transpose(S),de=c.transpose(L),Te=0;Te<te.length;Te++)te[Te]=c.multGamma(te[Te]),de[Te]=c.multGamma(de[Te]);var ge=c.multMat(te,c.transpose(de)),le=d.svd(ge);J=c.multMat(le.V,c.transpose(le.U));for(var he=0;he<m.size;he++){var fe=[w[he],T[he]],ve=[J[0][0],J[1][0]],ye=[J[0][1],J[1][1]];w[he]=c.dotProduct(fe,ve),T[he]=c.dotProduct(fe,ye)}F&&I(g.relativePlacementConstraint)}}if(h.ENFORCE_CONSTRAINTS){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>0){var me={x:0,y:0};g.fixedNodeConstraint.forEach(function(z,G){var X={x:w[m.get(z.nodeId)],y:T[m.get(z.nodeId)]},Z=z.position,ae=R(Z,X);me.x+=ae.x,me.y+=ae.y}),me.x/=g.fixedNodeConstraint.length,me.y/=g.fixedNodeConstraint.length,w.forEach(function(z,G){w[G]+=me.x}),T.forEach(function(z,G){T[G]+=me.y}),g.fixedNodeConstraint.forEach(function(z){w[m.get(z.nodeId)]=z.position.x,T[m.get(z.nodeId)]=z.position.y})}if(g.alignmentConstraint){if(g.alignmentConstraint.vertical)for(var xe=g.alignmentConstraint.vertical,Le=function(G){var X=new Set;xe[G].forEach(function(ee){X.add(ee)});var Z=new Set([].concat(f(X)).filter(function(ee){return B.has(ee)})),ae=void 0;Z.size>0?ae=w[m.get(Z.values().next().value)]:ae=P(X).x,X.forEach(function(ee){B.has(ee)||(w[m.get(ee)]=ae)})},ke=0;ke<xe.length;ke++)Le(ke);if(g.alignmentConstraint.horizontal)for(var Fe=g.alignmentConstraint.horizontal,Be=function(G){var X=new Set;Fe[G].forEach(function(ee){X.add(ee)});var Z=new Set([].concat(f(X)).filter(function(ee){return B.has(ee)})),ae=void 0;Z.size>0?ae=T[m.get(Z.values().next().value)]:ae=P(X).y,X.forEach(function(ee){B.has(ee)||(T[m.get(ee)]=ae)})},Oe=0;Oe<Fe.length;Oe++)Be(Oe)}g.relativePlacementConstraint&&(function(){var z=new Map,G=new Map,X=new Map,Z=new Map,ae=new Map,ee=new Map,ie=new Set,se=new Set;if(B.forEach(function(ht){ie.add(ht),se.add(ht)}),g.alignmentConstraint){if(g.alignmentConstraint.vertical)for(var oe=g.alignmentConstraint.vertical,ue=function(Pe){X.set("dummy"+Pe,[]),oe[Pe].forEach(function(Ye){z.set(Ye,"dummy"+Pe),X.get("dummy"+Pe).push(Ye),B.has(Ye)&&ie.add("dummy"+Pe)}),ae.set("dummy"+Pe,w[m.get(oe[Pe][0])])},pe=0;pe<oe.length;pe++)ue(pe);if(g.alignmentConstraint.horizontal)for(var ce=g.alignmentConstraint.horizontal,we=function(Pe){Z.set("dummy"+Pe,[]),ce[Pe].forEach(function(Ye){G.set(Ye,"dummy"+Pe),Z.get("dummy"+Pe).push(Ye),B.has(Ye)&&se.add("dummy"+Pe)}),ee.set("dummy"+Pe,T[m.get(ce[Pe][0])])},Ne=0;Ne<ce.length;Ne++)we(Ne)}var De=new Map,Ee=new Map,ze=function(Pe){Y.get(Pe).forEach(function(Ye){var Ht=void 0,yt=void 0;Ye.direction=="horizontal"?(Ht=z.get(Pe)?z.get(Pe):Pe,z.get(Ye.id)?yt={id:z.get(Ye.id),gap:Ye.gap,direction:Ye.direction}:yt=Ye,De.has(Ht)?De.get(Ht).push(yt):De.set(Ht,[yt]),De.has(yt.id)||De.set(yt.id,[])):(Ht=G.get(Pe)?G.get(Pe):Pe,G.get(Ye.id)?yt={id:G.get(Ye.id),gap:Ye.gap,direction:Ye.direction}:yt=Ye,Ee.has(Ht)?Ee.get(Ht).push(yt):Ee.set(Ht,[yt]),Ee.has(yt.id)||Ee.set(yt.id,[]))})},Ce=!0,Se=!1,Ue=void 0;try{for(var Re=Y.keys()[Symbol.iterator](),Ve;!(Ce=(Ve=Re.next()).done);Ce=!0){var He=Ve.value;ze(He)}}catch(ht){Se=!0,Ue=ht}finally{try{!Ce&&Re.return&&Re.return()}finally{if(Se)throw Ue}}var Ze=A(De),tt=A(Ee),Xe=E(Ze),Lt=E(tt),Pt=C(De),pt=C(Ee),at=[],st=[];Xe.forEach(function(ht,Pe){at[Pe]=[],ht.forEach(function(Ye){Pt.get(Ye).length==0&&at[Pe].push(Ye)})}),Lt.forEach(function(ht,Pe){st[Pe]=[],ht.forEach(function(Ye){pt.get(Ye).length==0&&st[Pe].push(Ye)})});var Ft=M(De,"horizontal",ie,ae,at),ut=M(Ee,"vertical",se,ee,st),Rr=function(Pe){X.get(Pe)?X.get(Pe).forEach(function(Ye){w[m.get(Ye)]=Ft.get(Pe)}):w[m.get(Pe)]=Ft.get(Pe)},lr=!0,fr=!1,mn=void 0;try{for(var Na=Ft.keys()[Symbol.iterator](),bn;!(lr=(bn=Na.next()).done);lr=!0){var Ma=bn.value;Rr(Ma)}}catch(ht){fr=!0,mn=ht}finally{try{!lr&&Na.return&&Na.return()}finally{if(fr)throw mn}}var Ri=function(Pe){Z.get(Pe)?Z.get(Pe).forEach(function(Ye){T[m.get(Ye)]=ut.get(Pe)}):T[m.get(Pe)]=ut.get(Pe)},rr=!0,Kr=!1,Or=void 0;try{for(var Zr=ut.keys()[Symbol.iterator](),Ra;!(rr=(Ra=Zr.next()).done);rr=!0){var Ma=Ra.value;Ri(Ma)}}catch(ht){Kr=!0,Or=ht}finally{try{!rr&&Zr.return&&Zr.return()}finally{if(Kr)throw Or}}})()}for(var ne=0;ne<D.length;ne++){var k=D[ne];k.getChild()==null&&k.setCenter(w[m.get(k.id)],T[m.get(k.id)])}},s.exports=p}),551:(s=>{s.exports=r})},n={};function i(s){var u=n[s];if(u!==void 0)return u.exports;var l=n[s]={exports:{}};return a[s](l,l.exports,i),l.exports}var o=i(45);return o})()})})(Wn)),Wn.exports}var V1=mu.exports;(function(t,e){(function(a,n){t.exports=n(z1())})(V1,function(r){return(()=>{var a={658:(s=>{s.exports=Object.assign!=null?Object.assign.bind(Object):function(u){for(var l=arguments.length,f=Array(l>1?l-1:0),h=1;h<l;h++)f[h-1]=arguments[h];return f.forEach(function(v){Object.keys(v).forEach(function(c){return u[c]=v[c]})}),u}}),548:((s,u,l)=>{var f=(function(){function c(d,p){var y=[],g=!0,b=!1,m=void 0;try{for(var w=d[Symbol.iterator](),T;!(g=(T=w.next()).done)&&(y.push(T.value),!(p&&y.length===p));g=!0);}catch(D){b=!0,m=D}finally{try{!g&&w.return&&w.return()}finally{if(b)throw m}}return y}return function(d,p){if(Array.isArray(d))return d;if(Symbol.iterator in Object(d))return c(d,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),h=l(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(c){for(var d={},p=0;p<c.length;p++)d[c[p].id()]=!0;var y=c.filter(function(g,b){typeof g=="number"&&(g=b);for(var m=g.parent()[0];m!=null;){if(d[m.id()])return!1;m=m.parent()[0]}return!0});return y},v.connectComponents=function(c,d,p,y){var g=new h,b=new Set,m=[],w=void 0,T=void 0,D=void 0,x=!1,N=1,O=[],R=[],P=function(){var I=c.collection();R.push(I);var E=p[0],A=c.collection();A.merge(E).merge(E.descendants().intersection(d)),m.push(E),A.forEach(function(L){g.push(L),b.add(L),I.merge(L)});for(var C=function(){E=g.shift();var V=c.collection();E.neighborhood().nodes().forEach(function(q){d.intersection(E.edgesWith(q)).length>0&&V.merge(q)});for(var F=0;F<V.length;F++){var B=V[F];if(w=p.intersection(B.union(B.ancestors())),w!=null&&!b.has(w[0])){var Y=w.union(w.descendants());Y.forEach(function(q){g.push(q),b.add(q),I.merge(q),p.has(q)&&m.push(q)})}}};g.length!=0;)C();if(I.forEach(function(L){d.intersection(L.connectedEdges()).forEach(function(V){I.has(V.source())&&I.has(V.target())&&I.merge(V)})}),m.length==p.length&&(x=!0),!x||x&&N>1){T=m[0],D=T.connectedEdges().length,m.forEach(function(L){L.connectedEdges().length<D&&(D=L.connectedEdges().length,T=L)}),O.push(T.id());var S=c.collection();S.merge(m[0]),m.forEach(function(L){S.merge(L)}),m=[],p=p.difference(S),N++}};do P();while(!x);return y&&O.length>0&&y.set("dummy"+(y.size+1),O),R},v.relocateComponent=function(c,d,p){if(!p.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;if(p.quality=="draft"){var w=!0,T=!1,D=void 0;try{for(var x=d.nodeIndexes[Symbol.iterator](),N;!(w=(N=x.next()).done);w=!0){var O=N.value,R=f(O,2),P=R[0],M=R[1],I=p.cy.getElementById(P);if(I){var E=I.boundingBox(),A=d.xCoords[M]-E.w/2,C=d.xCoords[M]+E.w/2,S=d.yCoords[M]-E.h/2,L=d.yCoords[M]+E.h/2;A<y&&(y=A),C>g&&(g=C),S<b&&(b=S),L>m&&(m=L)}}}catch(q){T=!0,D=q}finally{try{!w&&x.return&&x.return()}finally{if(T)throw D}}var V=c.x-(g+y)/2,F=c.y-(m+b)/2;d.xCoords=d.xCoords.map(function(q){return q+V}),d.yCoords=d.yCoords.map(function(q){return q+F})}else{Object.keys(d).forEach(function(q){var Q=d[q],$=Q.getRect().x,K=Q.getRect().x+Q.getRect().width,j=Q.getRect().y,re=Q.getRect().y+Q.getRect().height;$<y&&(y=$),K>g&&(g=K),j<b&&(b=j),re>m&&(m=re)});var B=c.x-(g+y)/2,Y=c.y-(m+b)/2;Object.keys(d).forEach(function(q){var Q=d[q];Q.setCenter(Q.getCenterX()+B,Q.getCenterY()+Y)})}}},v.calcBoundingBox=function(c,d,p,y){for(var g=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,m=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,T=void 0,D=void 0,x=void 0,N=void 0,O=c.descendants().not(":parent"),R=O.length,P=0;P<R;P++){var M=O[P];T=d[y.get(M.id())]-M.width()/2,D=d[y.get(M.id())]+M.width()/2,x=p[y.get(M.id())]-M.height()/2,N=p[y.get(M.id())]+M.height()/2,g>T&&(g=T),b<D&&(b=D),m>x&&(m=x),w<N&&(w=N)}var I={};return I.topLeftX=g,I.topLeftY=m,I.width=b-g,I.height=w-m,I},v.calcParentsWithoutChildren=function(c,d){var p=c.collection();return d.nodes(":parent").forEach(function(y){var g=!1;y.children().forEach(function(b){b.css("display")!="none"&&(g=!0)}),g||p.merge(y)}),p},s.exports=v}),816:((s,u,l)=>{var f=l(548),h=l(140).CoSELayout,v=l(140).CoSENode,c=l(140).layoutBase.PointD,d=l(140).layoutBase.DimensionD,p=l(140).layoutBase.LayoutConstants,y=l(140).layoutBase.FDLayoutConstants,g=l(140).CoSEConstants,b=function(w,T){var D=w.cy,x=w.eles,N=x.nodes(),O=x.edges(),R=void 0,P=void 0,M=void 0,I={};w.randomize&&(R=T.nodeIndexes,P=T.xCoords,M=T.yCoords);var E=function(q){return typeof q=="function"},A=function(q,Q){return E(q)?q(Q):q},C=f.calcParentsWithoutChildren(D,x),S=function Y(q,Q,$,K){for(var j=Q.length,re=0;re<j;re++){var U=Q[re],H=null;U.intersection(C).length==0&&(H=U.children());var _=void 0,W=U.layoutDimensions({nodeDimensionsIncludeLabels:K.nodeDimensionsIncludeLabels});if(U.outerWidth()!=null&&U.outerHeight()!=null)if(K.randomize)if(!U.isParent())_=q.add(new v($.graphManager,new c(P[R.get(U.id())]-W.w/2,M[R.get(U.id())]-W.h/2),new d(parseFloat(W.w),parseFloat(W.h))));else{var J=f.calcBoundingBox(U,P,M,R);U.intersection(C).length==0?_=q.add(new v($.graphManager,new c(J.topLeftX,J.topLeftY),new d(J.width,J.height))):_=q.add(new v($.graphManager,new c(J.topLeftX,J.topLeftY),new d(parseFloat(W.w),parseFloat(W.h))))}else _=q.add(new v($.graphManager,new c(U.position("x")-W.w/2,U.position("y")-W.h/2),new d(parseFloat(W.w),parseFloat(W.h))));else _=q.add(new v(this.graphManager));if(_.id=U.data("id"),_.nodeRepulsion=A(K.nodeRepulsion,U),_.paddingLeft=parseInt(U.css("padding")),_.paddingTop=parseInt(U.css("padding")),_.paddingRight=parseInt(U.css("padding")),_.paddingBottom=parseInt(U.css("padding")),K.nodeDimensionsIncludeLabels&&(_.labelWidth=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,_.labelHeight=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,_.labelPosVertical=U.css("text-valign"),_.labelPosHorizontal=U.css("text-halign")),I[U.data("id")]=_,isNaN(_.rect.x)&&(_.rect.x=0),isNaN(_.rect.y)&&(_.rect.y=0),H!=null&&H.length>0){var te=void 0;te=$.getGraphManager().add($.newGraph(),_),Y(te,H,$,K)}}},L=function(q,Q,$){for(var K=0,j=0,re=0;re<$.length;re++){var U=$[re],H=I[U.data("source")],_=I[U.data("target")];if(H&&_&&H!==_&&H.getEdgesBetween(_).length==0){var W=Q.add(q.newEdge(),H,_);W.id=U.id(),W.idealLength=A(w.idealEdgeLength,U),W.edgeElasticity=A(w.edgeElasticity,U),K+=W.idealLength,j++}}w.idealEdgeLength!=null&&(j>0?g.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=K/j:E(w.idealEdgeLength)?g.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:g.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,g.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,g.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},V=function(q,Q){Q.fixedNodeConstraint&&(q.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(q.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(q.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};w.nestingFactor!=null&&(g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(g.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(g.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(g.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(g.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(g.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?p.QUALITY=2:p.QUALITY=0,g.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=p.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,g.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=!w.randomize,g.ANIMATE=y.ANIMATE=p.ANIMATE=w.animate,g.TILE=w.tile,g.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,g.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,g.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=!0,g.PURE_INCREMENTAL=!w.randomize,p.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!1),w.step=="enforced"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!1),w.step=="cose"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?g.TREE_REDUCTION_ON_INCREMENTAL=!1:g.TREE_REDUCTION_ON_INCREMENTAL=!0;var F=new h,B=F.newGraphManager();return S(B.addRoot(),f.getTopMostNodes(N),F,w),L(F,B,O),V(F,w),F.runLayout(),I};s.exports={coseLayout:b}}),212:((s,u,l)=>{var f=(function(){function w(T,D){for(var x=0;x<D.length;x++){var N=D[x];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(T,N.key,N)}}return function(T,D,x){return D&&w(T.prototype,D),x&&w(T,x),T}})();function h(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}var v=l(658),c=l(548),d=l(657),p=d.spectralLayout,y=l(816),g=y.coseLayout,b=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(T){return 4500},idealEdgeLength:function(T){return 50},edgeElasticity:function(T){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),m=(function(){function w(T){h(this,w),this.options=v({},b,T)}return f(w,[{key:"run",value:function(){var D=this,x=this.options,N=x.cy,O=x.eles,R=[],P=[],M=void 0,I=[];x.fixedNodeConstraint&&(!Array.isArray(x.fixedNodeConstraint)||x.fixedNodeConstraint.length==0)&&(x.fixedNodeConstraint=void 0),x.alignmentConstraint&&(x.alignmentConstraint.vertical&&(!Array.isArray(x.alignmentConstraint.vertical)||x.alignmentConstraint.vertical.length==0)&&(x.alignmentConstraint.vertical=void 0),x.alignmentConstraint.horizontal&&(!Array.isArray(x.alignmentConstraint.horizontal)||x.alignmentConstraint.horizontal.length==0)&&(x.alignmentConstraint.horizontal=void 0)),x.relativePlacementConstraint&&(!Array.isArray(x.relativePlacementConstraint)||x.relativePlacementConstraint.length==0)&&(x.relativePlacementConstraint=void 0);var E=x.fixedNodeConstraint||x.alignmentConstraint||x.relativePlacementConstraint;E&&(x.tile=!1,x.packComponents=!1);var A=void 0,C=!1;if(N.layoutUtilities&&x.packComponents&&(A=N.layoutUtilities("get"),A||(A=N.layoutUtilities()),C=!0),O.nodes().length>0)if(C){var V=c.getTopMostNodes(x.eles.nodes());if(M=c.connectComponents(N,x.eles,V),M.forEach(function(ge){var le=ge.boundingBox();I.push({x:le.x1+le.w/2,y:le.y1+le.h/2})}),x.randomize&&M.forEach(function(ge){x.eles=ge,R.push(p(x))}),x.quality=="default"||x.quality=="proof"){var F=N.collection();if(x.tile){var B=new Map,Y=[],q=[],Q=0,$={nodeIndexes:B,xCoords:Y,yCoords:q},K=[];if(M.forEach(function(ge,le){ge.edges().length==0&&(ge.nodes().forEach(function(he,fe){F.merge(ge.nodes()[fe]),he.isParent()||($.nodeIndexes.set(ge.nodes()[fe].id(),Q++),$.xCoords.push(ge.nodes()[0].position().x),$.yCoords.push(ge.nodes()[0].position().y))}),K.push(le))}),F.length>1){var j=F.boundingBox();I.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),M.push(F),R.push($);for(var re=K.length-1;re>=0;re--)M.splice(K[re],1),R.splice(K[re],1),I.splice(K[re],1)}}M.forEach(function(ge,le){x.eles=ge,P.push(g(x,R[le])),c.relocateComponent(I[le],P[le],x)})}else M.forEach(function(ge,le){c.relocateComponent(I[le],R[le],x)});var U=new Set;if(M.length>1){var H=[],_=O.filter(function(ge){return ge.css("display")=="none"});M.forEach(function(ge,le){var he=void 0;if(x.quality=="draft"&&(he=R[le].nodeIndexes),ge.nodes().not(_).length>0){var fe={};fe.edges=[],fe.nodes=[];var ve=void 0;ge.nodes().not(_).forEach(function(ye){if(x.quality=="draft")if(!ye.isParent())ve=he.get(ye.id()),fe.nodes.push({x:R[le].xCoords[ve]-ye.boundingbox().w/2,y:R[le].yCoords[ve]-ye.boundingbox().h/2,width:ye.boundingbox().w,height:ye.boundingbox().h});else{var me=c.calcBoundingBox(ye,R[le].xCoords,R[le].yCoords,he);fe.nodes.push({x:me.topLeftX,y:me.topLeftY,width:me.width,height:me.height})}else P[le][ye.id()]&&fe.nodes.push({x:P[le][ye.id()].getLeft(),y:P[le][ye.id()].getTop(),width:P[le][ye.id()].getWidth(),height:P[le][ye.id()].getHeight()})}),ge.edges().forEach(function(ye){var me=ye.source(),xe=ye.target();if(me.css("display")!="none"&&xe.css("display")!="none")if(x.quality=="draft"){var Le=he.get(me.id()),ke=he.get(xe.id()),Fe=[],Be=[];if(me.isParent()){var Oe=c.calcBoundingBox(me,R[le].xCoords,R[le].yCoords,he);Fe.push(Oe.topLeftX+Oe.width/2),Fe.push(Oe.topLeftY+Oe.height/2)}else Fe.push(R[le].xCoords[Le]),Fe.push(R[le].yCoords[Le]);if(xe.isParent()){var ne=c.calcBoundingBox(xe,R[le].xCoords,R[le].yCoords,he);Be.push(ne.topLeftX+ne.width/2),Be.push(ne.topLeftY+ne.height/2)}else Be.push(R[le].xCoords[ke]),Be.push(R[le].yCoords[ke]);fe.edges.push({startX:Fe[0],startY:Fe[1],endX:Be[0],endY:Be[1]})}else P[le][me.id()]&&P[le][xe.id()]&&fe.edges.push({startX:P[le][me.id()].getCenterX(),startY:P[le][me.id()].getCenterY(),endX:P[le][xe.id()].getCenterX(),endY:P[le][xe.id()].getCenterY()})}),fe.nodes.length>0&&(H.push(fe),U.add(le))}});var W=A.packComponents(H,x.randomize).shifts;if(x.quality=="draft")R.forEach(function(ge,le){var he=ge.xCoords.map(function(ve){return ve+W[le].dx}),fe=ge.yCoords.map(function(ve){return ve+W[le].dy});ge.xCoords=he,ge.yCoords=fe});else{var J=0;U.forEach(function(ge){Object.keys(P[ge]).forEach(function(le){var he=P[ge][le];he.setCenter(he.getCenterX()+W[J].dx,he.getCenterY()+W[J].dy)}),J++})}}}else{var S=x.eles.boundingBox();if(I.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),x.randomize){var L=p(x);R.push(L)}x.quality=="default"||x.quality=="proof"?(P.push(g(x,R[0])),c.relocateComponent(I[0],P[0],x)):c.relocateComponent(I[0],R[0],x)}var te=function(le,he){if(x.quality=="default"||x.quality=="proof"){typeof le=="number"&&(le=he);var fe=void 0,ve=void 0,ye=le.data("id");return P.forEach(function(xe){ye in xe&&(fe={x:xe[ye].getRect().getCenterX(),y:xe[ye].getRect().getCenterY()},ve=xe[ye])}),x.nodeDimensionsIncludeLabels&&(ve.labelWidth&&(ve.labelPosHorizontal=="left"?fe.x+=ve.labelWidth/2:ve.labelPosHorizontal=="right"&&(fe.x-=ve.labelWidth/2)),ve.labelHeight&&(ve.labelPosVertical=="top"?fe.y+=ve.labelHeight/2:ve.labelPosVertical=="bottom"&&(fe.y-=ve.labelHeight/2))),fe==null&&(fe={x:le.position("x"),y:le.position("y")}),{x:fe.x,y:fe.y}}else{var me=void 0;return R.forEach(function(xe){var Le=xe.nodeIndexes.get(le.id());Le!=null&&(me={x:xe.xCoords[Le],y:xe.yCoords[Le]})}),me==null&&(me={x:le.position("x"),y:le.position("y")}),{x:me.x,y:me.y}}};if(x.quality=="default"||x.quality=="proof"||x.randomize){var de=c.calcParentsWithoutChildren(N,O),Te=O.filter(function(ge){return ge.css("display")=="none"});x.eles=O.not(Te),O.nodes().not(":parent").not(Te).layoutPositions(D,x,te),de.length>0&&de.forEach(function(ge){ge.position(te(ge))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();s.exports=m}),657:((s,u,l)=>{var f=l(548),h=l(140).layoutBase.Matrix,v=l(140).layoutBase.SVD,c=function(p){var y=p.cy,g=p.eles,b=g.nodes(),m=g.nodes(":parent"),w=new Map,T=new Map,D=new Map,x=[],N=[],O=[],R=[],P=[],M=[],I=[],E=[],A=void 0,C=1e8,S=1e-9,L=p.piTol,V=p.samplingType,F=p.nodeSeparation,B=void 0,Y=function(){for(var G=0,X=0,Z=!1;X<B;){G=Math.floor(Math.random()*A),Z=!1;for(var ae=0;ae<X;ae++)if(R[ae]==G){Z=!0;break}if(!Z)R[X]=G,X++;else continue}},q=function(G,X,Z){for(var ae=[],ee=0,ie=0,se=0,oe=void 0,ue=[],pe=0,ce=1,we=0;we<A;we++)ue[we]=C;for(ae[ie]=G,ue[G]=0;ie>=ee;){se=ae[ee++];for(var Ne=x[se],De=0;De<Ne.length;De++)oe=T.get(Ne[De]),ue[oe]==C&&(ue[oe]=ue[se]+1,ae[++ie]=oe);M[se][X]=ue[se]*F}if(Z){for(var Ee=0;Ee<A;Ee++)M[Ee][X]<P[Ee]&&(P[Ee]=M[Ee][X]);for(var ze=0;ze<A;ze++)P[ze]>pe&&(pe=P[ze],ce=ze)}return ce},Q=function(G){var X=void 0;if(G){X=Math.floor(Math.random()*A);for(var ae=0;ae<A;ae++)P[ae]=C;for(var ee=0;ee<B;ee++)R[ee]=X,X=q(X,ee,G)}else{Y();for(var Z=0;Z<B;Z++)q(R[Z],Z,G)}for(var ie=0;ie<A;ie++)for(var se=0;se<B;se++)M[ie][se]*=M[ie][se];for(var oe=0;oe<B;oe++)I[oe]=[];for(var ue=0;ue<B;ue++)for(var pe=0;pe<B;pe++)I[ue][pe]=M[R[pe]][ue]},$=function(){for(var G=v.svd(I),X=G.S,Z=G.U,ae=G.V,ee=X[0]*X[0]*X[0],ie=[],se=0;se<B;se++){ie[se]=[];for(var oe=0;oe<B;oe++)ie[se][oe]=0,se==oe&&(ie[se][oe]=X[se]/(X[se]*X[se]+ee/(X[se]*X[se])))}E=h.multMat(h.multMat(ae,ie),h.transpose(Z))},K=function(){for(var G=void 0,X=void 0,Z=[],ae=[],ee=[],ie=[],se=0;se<A;se++)Z[se]=Math.random(),ae[se]=Math.random();Z=h.normalize(Z),ae=h.normalize(ae);for(var oe=S,ue=S,pe=void 0;;){for(var ce=0;ce<A;ce++)ee[ce]=Z[ce];if(Z=h.multGamma(h.multL(h.multGamma(ee),M,E)),G=h.dotProduct(ee,Z),Z=h.normalize(Z),oe=h.dotProduct(ee,Z),pe=Math.abs(oe/ue),pe<=1+L&&pe>=1)break;ue=oe}for(var we=0;we<A;we++)ee[we]=Z[we];for(ue=S;;){for(var Ne=0;Ne<A;Ne++)ie[Ne]=ae[Ne];if(ie=h.minusOp(ie,h.multCons(ee,h.dotProduct(ee,ie))),ae=h.multGamma(h.multL(h.multGamma(ie),M,E)),X=h.dotProduct(ie,ae),ae=h.normalize(ae),oe=h.dotProduct(ie,ae),pe=Math.abs(oe/ue),pe<=1+L&&pe>=1)break;ue=oe}for(var De=0;De<A;De++)ie[De]=ae[De];N=h.multCons(ee,Math.sqrt(Math.abs(G))),O=h.multCons(ie,Math.sqrt(Math.abs(X)))};f.connectComponents(y,g,f.getTopMostNodes(b),w),m.forEach(function(z){f.connectComponents(y,g,f.getTopMostNodes(z.descendants().intersection(g)),w)});for(var j=0,re=0;re<b.length;re++)b[re].isParent()||T.set(b[re].id(),j++);var U=!0,H=!1,_=void 0;try{for(var W=w.keys()[Symbol.iterator](),J;!(U=(J=W.next()).done);U=!0){var te=J.value;T.set(te,j++)}}catch(z){H=!0,_=z}finally{try{!U&&W.return&&W.return()}finally{if(H)throw _}}for(var de=0;de<T.size;de++)x[de]=[];m.forEach(function(z){for(var G=z.children().intersection(g);G.nodes(":childless").length==0;)G=G.nodes()[0].children().intersection(g);var X=0,Z=G.nodes(":childless")[0].connectedEdges().length;G.nodes(":childless").forEach(function(ae,ee){ae.connectedEdges().length<Z&&(Z=ae.connectedEdges().length,X=ee)}),D.set(z.id(),G.nodes(":childless")[X].id())}),b.forEach(function(z){var G=void 0;z.isParent()?G=T.get(D.get(z.id())):G=T.get(z.id()),z.neighborhood().nodes().forEach(function(X){g.intersection(z.edgesWith(X)).length>0&&(X.isParent()?x[G].push(D.get(X.id())):x[G].push(X.id()))})});var Te=function(G){var X=T.get(G),Z=void 0;w.get(G).forEach(function(ae){y.getElementById(ae).isParent()?Z=D.get(ae):Z=ae,x[X].push(Z),x[T.get(Z)].push(G)})},ge=!0,le=!1,he=void 0;try{for(var fe=w.keys()[Symbol.iterator](),ve;!(ge=(ve=fe.next()).done);ge=!0){var ye=ve.value;Te(ye)}}catch(z){le=!0,he=z}finally{try{!ge&&fe.return&&fe.return()}finally{if(le)throw he}}A=T.size;var me=void 0;if(A>2){B=A<p.sampleSize?A:p.sampleSize;for(var xe=0;xe<A;xe++)M[xe]=[];for(var Le=0;Le<B;Le++)E[Le]=[];return p.quality=="draft"||p.step=="all"?(Q(V),$(),K(),me={nodeIndexes:T,xCoords:N,yCoords:O}):(T.forEach(function(z,G){N.push(y.getElementById(G).position("x")),O.push(y.getElementById(G).position("y"))}),me={nodeIndexes:T,xCoords:N,yCoords:O}),me}else{var ke=T.keys(),Fe=y.getElementById(ke.next().value),Be=Fe.position(),Oe=Fe.outerWidth();if(N.push(Be.x),O.push(Be.y),A==2){var ne=y.getElementById(ke.next().value),k=ne.outerWidth();N.push(Be.x+Oe/2+k/2+p.idealEdgeLength),O.push(Be.y)}return me={nodeIndexes:T,xCoords:N,yCoords:O},me}};s.exports={spectralLayout:c}}),579:((s,u,l)=>{var f=l(212),h=function(c){c&&c("layout","fcose",f)};typeof cytoscape<"u"&&h(cytoscape),s.exports=h}),140:(s=>{s.exports=r})},n={};function i(s){var u=n[s];if(u!==void 0)return u.exports;var l=n[s]={exports:{}};return a[s](l,l.exports,i),l.exports}var o=i(579);return o})()})})(mu);var G1=mu.exports;const U1=bd(G1);function Pn(t,e){return{selector:t,style:ld(e)}}function yh(t){Sr.use(t)}function H1(t){return t.target.id()}let Y1={targetId:H1},mh={contents:!1};function q1(){if(!mh.contents)return mh.contents=!0,yh(Kv),yh(U1)}function In(t,e,r){let a=getComputedStyle(t).getPropertyValue(e).trim();return a===""?r:a}let bh=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function Zv(t){return"grp-"+t.replace(/[^a-zA-Z0-9_-]+/g,"-")}function wh(t,e){let r=t.map(i=>i.id),a=t.map(i=>{let o=i.group;return{data:{id:i.id,label:i.label},classes:o!==void 0?Zv(o):""}}),n=e.filter(i=>r.includes(i.from)?r.includes(i.to_):!1).map((i,o)=>({data:{id:"__edge__"+o.toString(),source:i.from,target:i.to_,label:i.label}}));return a.concat(n)}function bs(t,e){let r=In(t,Vr.brand,"#3b6ea5"),a=In(t,Vr.textPrimary,"#1a1a1a"),n=In(t,Vr.border,"#d4d4d4"),i=In(t,Vr.surface,"#ffffff"),o=l=>l===0?r:bh[hd(l-1|0,bh.length)],s=[Pn("node",[["background-color",r],["border-width","2"],["border-color",i],["width","18"],["height","18"],["label","data(label)"],["color",a],["font-size","11px"],["text-valign","center"],["text-halign","right"],["text-margin-x","6"],["text-wrap","ellipsis"],["text-max-width","150"],["min-zoomed-font-size","7"]]),Pn("node:parent",[["background-color",n],["background-opacity","0.12"],["border-width","1"],["border-color",n],["text-valign","top"],["text-halign","center"],["font-size","12px"],["color",a],["padding","12"]]),Pn("edge",[["width","1.5"],["line-color",n],["target-arrow-color",n],["target-arrow-shape","triangle"],["arrow-scale","0.9"],["curve-style","bezier"]])],u=e.map((l,f)=>Pn("."+Zv(l),[["background-color",o(f)]]));return s.concat(u)}function Eh(t){switch(t){case"breadthfirst":return{name:"breadthfirst",fit:!0,padding:24,animate:!1,spacingFactor:1.1,nodeDimensionsIncludeLabels:!0,directed:!0};case"concentric":return{name:"concentric",fit:!0,padding:24,animate:!1,nodeDimensionsIncludeLabels:!0,minNodeSpacing:40};case"cose":return{name:"cose",fit:!0,padding:24,animate:!1,idealEdgeLength:90,nodeRepulsion:9e3,numIter:800,randomize:!0,componentSpacing:80};case"dagre":return{name:"dagre",fit:!0,padding:24,animate:!1,nodeDimensionsIncludeLabels:!0,rankDir:"BT",nodeSep:28,rankSep:56};case"fcose":return{name:"fcose",fit:!0,padding:24,animate:!1,nodeDimensionsIncludeLabels:!0,idealEdgeLength:80,nodeRepulsion:6e3,randomize:!0,quality:"proof",nodeSeparation:90,gravityCompound:1.5};default:return{name:t,fit:!0,padding:24,animate:!1}}}function va(t){return"var("+t+")"}function _1(t){return{background:va(Vr.surface),border:"1px solid "+va(Vr.border),height:t,overflow:"hidden",width:"100%",borderRadius:va(cd.md)}}let W1={color:va(Vr.textSecondary),fontSize:va(dd.sizeSm),padding:va(vd.lg)};function X1(t,e){return t.map(r=>r.id+"|"+r.label+"|"+Dh(r.group,"")).join(",")+"//"+e.map(r=>r.from+">"+r.to_).join(",")}function $1(t){let e=t.height,r=t.layout,a=t.onOpenNode,n=t.edges,i=t.nodes,o=r!==void 0?r:"dagre",s=e!==void 0?e:"520px",u=Oa(null),l=Oa(void 0),f=Oa(a);f.current=a;let h=Oa([i,n]);h.current=[i,n];let v=fd(),c=X1(i,n),d=Oa(!0);return Oi(()=>{let p=u.current;if(p==null)return;q1();let y=Sr({container:p,elements:wh(i,n),style:bs(p,Pi(i)),layout:Eh(o),minZoom:.2,maxZoom:3});y.on("tap","node",b=>Ah(f.current,m=>m(Y1.targetId(b)))),l.current=Eu(y);let g=new ResizeObserver(()=>{y.resize(),y.fit(24)});return g.observe(p),()=>{l.current=void 0,g.disconnect(),y.destroy()}},[]),Oi(()=>{if(d.current)d.current=!1;else{let p=l.current,y=u.current;if(p!==void 0&&y!=null){let g=xu(p),b=h.current,m=b[0];g.remove(g.elements()),g.add(wh(m,b[1])),g.style(bs(y,Pi(m))),g.layout(Eh(o)).run()}}},[c,o]),Oi(()=>{let p=l.current,y=u.current;if(p!==void 0&&y!=null){let g=h.current;xu(p).style(bs(y,Pi(g[0])))}},[v.preset]),i.length===0?da("div",{children:"No relationships to graph.",style:W1}):da("div",{ref:Eu(u),style:_1(s)})}let K1=$1,Z1="dagre",Qv={contents:Z1},Q1=da("span",{children:"◈","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});function Jv(t){let e=t.source,r=xh(e),a=Ed(e);return md("div",{children:[da(K1,{nodes:a.nodes,edges:a.edges,onOpenNode:n=>gd(e,r,n),layout:Qv.contents}),da("span",{children:pd([e],void 0,"row"),style:{fontSize:"11px",opacity:"0.7"}})],style:{display:"flex",flexDirection:"column",gap:"8px"}})}let lx={make:Jv};function fx(t,e){Ah(t,r=>{Qv.contents=r}),yd({id:"graph",label:"Graph",icon:Q1,arity:"Single",isCapable:wd,render:r=>{let a=r[0];return a!==void 0?da(Jv,{source:a}):null},capability:"entity-ref fields — one or more *Id/*Ids foreign keys drawn as a node-link diagram (self-referential fields form trees)"})}export{lx as ModeView,Z1 as defaultLayout,Q1 as graphIcon,fx as init,Qv as layoutRef};
|
|
336
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,i=u},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw i}}}}function Gs(t){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gs(t)}function rw(t,e){if(t){if(typeof t=="string")return jf(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jf(t,e):void 0}}var aw={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,useDagreEdgeControlPoints:!1,automaticDagreEdgeStyle:!1,dagreEdgeStyle:{"curve-style":"unbundled-bezier","control-point-weights":function(e){return e.scratch("controlPointWeights")},"control-point-distances":function(e){return e.scratch("controlPointDistances")},"edge-distances":"intersection","edge-ends-overlap":!1},animate:!1,animateFilter:function(e,r){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,r){return r},ready:function(){},sort:void 0,stop:function(){}},nw=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];return r.forEach(function(n){Object.keys(n).forEach(function(i){return t[i]=n[i]})}),t},Ev=Object.defineProperty,iw=(t,e,r)=>e in t?Ev(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ow=(t,e)=>{for(var r in e)Ev(t,r,{get:e[r],enumerable:!0})},sw=(t,e,r)=>iw(t,e+"",r),xv={};ow(xv,{Graph:()=>Ut,alg:()=>vu,json:()=>Cv,version:()=>fw});var uw=Object.defineProperty,Tv=(t,e)=>{for(var r in e)uw(t,r,{get:e[r],enumerable:!0})},Ut=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,e){return t.forEach(r=>{e!==void 0?this.setNode(r,e):this.setNode(r)}),this}setNode(t,e){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let e=r=>this.removeEdge(this._edgeObjs[r]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(r=>{this.setParent(r)}),delete this._children[t]),Object.keys(this._in[t]).forEach(e),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e===void 0)e="\0";else{e+="";for(let r=e;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}parent(t){if(this._isCompound){let e=this._parent[t];if(e!=="\0")return e}}children(t="\0"){if(this._isCompound){let e=this._children[t];if(e)return Object.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let e=this._preds[t];if(e)return Object.keys(e)}successors(t){let e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){let e=this.predecessors(t);if(e){let r=new Set(e);for(let a of this.successors(t))r.add(a);return Array.from(r.values())}}isLeaf(t){let e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0}filterNodes(t){let e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,i])=>{t(n)&&e.setNode(n,i)}),Object.values(this._edgeObjs).forEach(n=>{e.hasNode(n.v)&&e.hasNode(n.w)&&e.setEdge(n,this.edge(n))});let r={},a=n=>{let i=this.parent(n);return!i||e.hasNode(i)?(r[n]=i??void 0,i??void 0):i in r?r[i]:a(i)};return this._isCompound&&e.nodes().forEach(n=>e.setParent(n,a(n))),e}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){return t.reduce((r,a)=>(e!==void 0?this.setEdge(r,a,e):this.setEdge(r,a),a)),this}setEdge(t,e,r,a){let n,i,o,s,u=!1;typeof t=="object"&&t!==null&&"v"in t?(n=t.v,i=t.w,o=t.name,arguments.length===2&&(s=e,u=!0)):(n=t,i=e,o=a,arguments.length>2&&(s=r,u=!0)),n=""+n,i=""+i,o!==void 0&&(o=""+o);let l=Ya(this._isDirected,n,i,o);if(l in this._edgeLabels)return u&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(n),this.setNode(i),this._edgeLabels[l]=u?s:this._defaultEdgeLabelFn(n,i,o);let f=lw(this._isDirected,n,i,o);return n=f.v,i=f.w,Object.freeze(f),this._edgeObjs[l]=f,eh(this._preds[i],n),eh(this._sucs[n],i),this._in[i][l]=f,this._out[n][l]=f,this._edgeCount++,this}edge(t,e,r){let a=arguments.length===1?hs(this._isDirected,t):Ya(this._isDirected,t,e,r);return this._edgeLabels[a]}edgeAsObj(t,e,r){let a=arguments.length===1?this.edge(t):this.edge(t,e,r);return typeof a!="object"?{label:a}:a}hasEdge(t,e,r){return(arguments.length===1?hs(this._isDirected,t):Ya(this._isDirected,t,e,r))in this._edgeLabels}removeEdge(t,e,r){let a=arguments.length===1?hs(this._isDirected,t):Ya(this._isDirected,t,e,r),n=this._edgeObjs[a];if(n){let i=n.v,o=n.w;delete this._edgeLabels[a],delete this._edgeObjs[a],th(this._preds[o],i),th(this._sucs[i],o),delete this._in[o][a],delete this._out[i][a],this._edgeCount--}return this}inEdges(t,e){return this.isDirected()?this.filterEdges(this._in[t],t,e):this.nodeEdges(t,e)}outEdges(t,e){return this.isDirected()?this.filterEdges(this._out[t],t,e):this.nodeEdges(t,e)}nodeEdges(t,e){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,e)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,e,r){if(!t)return;let a=Object.values(t);return r?a.filter(n=>n.v===e&&n.w===r||n.v===r&&n.w===e):a}};function eh(t,e){t[e]?t[e]++:t[e]=1}function th(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function Ya(t,e,r,a){let n=""+e,i=""+r;if(!t&&n>i){let o=n;n=i,i=o}return n+""+i+""+(a===void 0?"\0":a)}function lw(t,e,r,a){let n=""+e,i=""+r;if(!t&&n>i){let s=n;n=i,i=s}let o={v:n,w:i};return a&&(o.name=a),o}function hs(t,e){return Ya(t,e.v,e.w,e.name)}var fw="4.0.1",Cv={};Tv(Cv,{read:()=>dw,write:()=>hw});function hw(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:cw(t),edges:vw(t)},r=t.graph();return r!==void 0&&(e.value=structuredClone(r)),e}function cw(t){return t.nodes().map(e=>{let r=t.node(e),a=t.parent(e),n={v:e};return r!==void 0&&(n.value=r),a!==void 0&&(n.parent=a),n})}function vw(t){return t.edges().map(e=>{let r=t.edge(e),a={v:e.v,w:e.w};return e.name!==void 0&&(a.name=e.name),r!==void 0&&(a.value=r),a})}function dw(t){let e=new Ut(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(r=>{e.setNode(r.v,r.value),r.parent&&e.setParent(r.v,r.parent)}),t.edges.forEach(r=>{e.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),e}var vu={};Tv(vu,{CycleException:()=>li,bellmanFord:()=>Sv,components:()=>yw,dijkstra:()=>ui,dijkstraAll:()=>ww,findCycles:()=>Ew,floydWarshall:()=>Tw,isAcyclic:()=>Sw,postorder:()=>Aw,preorder:()=>Lw,prim:()=>Nw,shortestPaths:()=>Mw,tarjan:()=>Av,topsort:()=>Lv});var gw=()=>1;function Sv(t,e,r,a){return pw(t,String(e),r||gw,a||function(n){return t.outEdges(n)})}function pw(t,e,r,a){let n={},i,o=0,s=t.nodes(),u=function(h){let v=r(h);n[h.v].distance+v<n[h.w].distance&&(n[h.w]={distance:n[h.v].distance+v,predecessor:h.v},i=!0)},l=function(){s.forEach(function(h){a(h).forEach(function(v){let c=v.v===h?v.v:v.w,d=c===v.v?v.w:v.v;u({v:c,w:d})})})};s.forEach(function(h){let v=h===e?0:Number.POSITIVE_INFINITY;n[h]={distance:v,predecessor:""}});let f=s.length;for(let h=1;h<f&&(i=!1,o++,l(),!!i);h++);if(o===f-1&&(i=!1,l(),i))throw new Error("The graph contains a negative weight cycle");return n}function yw(t){let e={},r=[],a;function n(i){i in e||(e[i]=!0,a.push(i),t.successors(i).forEach(n),t.predecessors(i).forEach(n))}return t.nodes().forEach(function(i){a=[],n(i),a.length&&r.push(a)}),r}var Dv=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(t=>t.key)}has(t){return t in this._keyIndices}priority(t){let e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){let r=this._keyIndices,a=String(t);if(!(a in r)){let n=this._arr,i=n.length;return r[a]=i,n.push({key:a,priority:e}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){let r=this._keyIndices[t];if(r===void 0)throw new Error(`Key not found: ${t}`);let a=this._arr[r].priority;if(e>a)throw new Error(`New priority is greater than current priority. Key: ${t} Old: ${a} New: ${e}`);this._arr[r].priority=e,this._decrease(r)}_heapify(t){let e=this._arr,r=2*t,a=r+1,n=t;r<e.length&&(n=e[r].priority<e[n].priority?r:n,a<e.length&&(n=e[a].priority<e[n].priority?a:n),n!==t&&(this._swap(t,n),this._heapify(n)))}_decrease(t){let e=this._arr,r=e[t].priority,a;for(;t!==0&&(a=t>>1,!(e[a].priority<r));)this._swap(t,a),t=a}_swap(t,e){let r=this._arr,a=this._keyIndices,n=r[t],i=r[e];r[t]=i,r[e]=n,a[i.key]=t,a[n.key]=e}},mw=()=>1;function ui(t,e,r,a){let n=function(i){return t.outEdges(i)};return bw(t,String(e),r||mw,a||n)}function bw(t,e,r,a){let n={},i=new Dv,o,s,u=function(l){let f=l.v!==o?l.v:l.w,h=n[f],v=r(l),c=s.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+l+" Weight: "+v);c<h.distance&&(h.distance=c,h.predecessor=o,i.decrease(f,c))};for(t.nodes().forEach(function(l){let f=l===e?0:Number.POSITIVE_INFINITY;n[l]={distance:f,predecessor:""},i.add(l,f)});i.size()>0&&(o=i.removeMin(),s=n[o],s.distance!==Number.POSITIVE_INFINITY);)a(o).forEach(u);return n}function ww(t,e,r){return t.nodes().reduce(function(a,n){return a[n]=ui(t,n,e,r),a},{})}function Av(t){let e=0,r=[],a={},n=[];function i(o){let s=a[o]={onStack:!0,lowlink:e,index:e++};if(r.push(o),t.successors(o).forEach(function(u){u in a?a[u].onStack&&(s.lowlink=Math.min(s.lowlink,a[u].index)):(i(u),s.lowlink=Math.min(s.lowlink,a[u].lowlink))}),s.lowlink===s.index){let u=[],l;do l=r.pop(),a[l].onStack=!1,u.push(l);while(o!==l);n.push(u)}}return t.nodes().forEach(function(o){o in a||i(o)}),n}function Ew(t){return Av(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}var xw=()=>1;function Tw(t,e,r){return Cw(t,e||xw,r||function(a){return t.outEdges(a)})}function Cw(t,e,r){let a={},n=t.nodes();return n.forEach(function(i){a[i]={},a[i][i]={distance:0,predecessor:""},n.forEach(function(o){i!==o&&(a[i][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),r(i).forEach(function(o){let s=o.v===i?o.w:o.v,u=e(o);a[i][s]={distance:u,predecessor:i}})}),n.forEach(function(i){let o=a[i];n.forEach(function(s){let u=a[s];n.forEach(function(l){let f=u[i],h=o[l],v=u[l],c=f.distance+h.distance;c<v.distance&&(v.distance=c,v.predecessor=h.predecessor)})})}),a}var li=class extends Error{constructor(...t){super(...t)}};function Lv(t){let e={},r={},a=[];function n(i){if(i in r)throw new li;i in e||(r[i]=!0,e[i]=!0,t.predecessors(i).forEach(n),delete r[i],a.push(i))}if(t.sinks().forEach(n),Object.keys(e).length!==t.nodeCount())throw new li;return a}function Sw(t){try{Lv(t)}catch(e){if(e instanceof li)return!1;throw e}return!0}function Dw(t,e,r,a,n){Array.isArray(e)||(e=[e]);let i=(s=>{var u;return(u=t.isDirected()?t.successors(s):t.neighbors(s))!=null?u:[]}),o={};return e.forEach(function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);n=Nv(t,s,r==="post",o,i,a,n)}),n}function Nv(t,e,r,a,n,i,o){return e in a||(a[e]=!0,r||(o=i(o,e)),n(e).forEach(function(s){o=Nv(t,s,r,a,n,i,o)}),r&&(o=i(o,e))),o}function Mv(t,e,r){return Dw(t,e,r,function(a,n){return a.push(n),a},[])}function Aw(t,e){return Mv(t,e,"post")}function Lw(t,e){return Mv(t,e,"pre")}function Nw(t,e){let r=new Ut,a={},n=new Dv,i;function o(u){let l=u.v===i?u.w:u.v,f=n.priority(l);if(f!==void 0){let h=e(u);h<f&&(a[l]=i,n.decrease(l,h))}}if(t.nodeCount()===0)return r;t.nodes().forEach(function(u){n.add(u,Number.POSITIVE_INFINITY),r.setNode(u)}),n.decrease(t.nodes()[0],0);let s=!1;for(;n.size()>0;){if(i=n.removeMin(),i in a)r.setEdge(i,a[i]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(i).forEach(o)}return r}function Mw(t,e,r,a){return Rw(t,e,r,a??(n=>{let i=t.outEdges(n);return i??[]}))}function Rw(t,e,r,a){if(r===void 0)return ui(t,e,r,a);let n=!1,i=t.nodes();for(let o=0;o<i.length;o++){let s=a(i[o]);for(let u=0;u<s.length;u++){let l=s[u],f=l.v===i[o]?l.v:l.w,h=f===l.v?l.w:l.v;r({v:f,w:h})<0&&(n=!0)}if(n)return Sv(t,e,r,a)}return ui(t,e,r,a)}function La(t,e,r,a){let n=a;for(;t.hasNode(n);)n=du(a);return r.dummy=e,t.setNode(n,r),n}function Ow(t){let e=new Ut().setGraph(t.graph());return t.nodes().forEach(r=>e.setNode(r,t.node(r))),t.edges().forEach(r=>{let a=e.edge(r.v,r.w)||{weight:0,minlen:1},n=t.edge(r);e.setEdge(r.v,r.w,{weight:a.weight+n.weight,minlen:Math.max(a.minlen,n.minlen)})}),e}function Rv(t){let e=new Ut({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(r=>{t.children(r).length||e.setNode(r,t.node(r))}),t.edges().forEach(r=>{e.setEdge(r,t.edge(r))}),e}function rh(t,e){let r=t.x,a=t.y,n=e.x-r,i=e.y-a,o=t.width/2,s=t.height/2;if(!n&&!i)throw new Error("Not possible to find intersection inside of the rectangle");let u,l;return Math.abs(i)*o>Math.abs(n)*s?(i<0&&(s=-s),u=s*n/i,l=s):(n<0&&(o=-o),u=o,l=o*i/n),{x:r+u,y:a+l}}function yn(t){let e=an(Pv(t)+1).map(()=>[]);return t.nodes().forEach(r=>{let a=t.node(r),n=a.rank;n!==void 0&&(e[n]||(e[n]=[]),e[n][a.order]=r)}),e}function Pw(t){let e=t.nodes().map(a=>{let n=t.node(a).rank;return n===void 0?Number.MAX_VALUE:n}),r=Jt(Math.min,e);t.nodes().forEach(a=>{let n=t.node(a);Object.hasOwn(n,"rank")&&(n.rank-=r)})}function Iw(t){let e=t.nodes().map(o=>t.node(o).rank).filter(o=>o!==void 0),r=Jt(Math.min,e),a=[];t.nodes().forEach(o=>{let s=t.node(o).rank-r;a[s]||(a[s]=[]),a[s].push(o)});let n=0,i=t.graph().nodeRankFactor;Array.from(a).forEach((o,s)=>{o===void 0&&s%i!==0?--n:o!==void 0&&n&&o.forEach(u=>t.node(u).rank+=n)})}function ah(t,e,r,a){let n={width:0,height:0};return arguments.length>=4&&(n.rank=r,n.order=a),La(t,"border",n,e)}function kw(t,e=Ov){let r=[];for(let a=0;a<t.length;a+=e){let n=t.slice(a,a+e);r.push(n)}return r}var Ov=65535;function Jt(t,e){if(e.length>Ov){let r=kw(e);return t(...r.map(a=>t(...a)))}else return t(...e)}function Pv(t){let e=t.nodes().map(r=>{let a=t.node(r).rank;return a===void 0?Number.MIN_VALUE:a});return Jt(Math.max,e)}function Bw(t,e){let r={lhs:[],rhs:[]};return t.forEach(a=>{e(a)?r.lhs.push(a):r.rhs.push(a)}),r}function Iv(t,e){let r=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-r)+"ms")}}function kv(t,e){return e()}var Fw=0;function du(t){let e=++Fw;return t+(""+e)}function an(t,e,r=1){e==null&&(e=t,t=0);let a=i=>i<e;r<0&&(a=i=>e<i);let n=[];for(let i=t;a(i);i+=r)n.push(i);return n}function fi(t,e){let r={};for(let a of e)t[a]!==void 0&&(r[a]=t[a]);return r}function Ni(t,e){let r;return typeof e=="string"?r=a=>a[e]:r=e,Object.entries(t).reduce((a,[n,i])=>(a[n]=r(i,n),a),{})}function zw(t,e){return t.reduce((r,a,n)=>(r[a]=e[n],r),{})}var Mi="\0",Vw="3.0.0",Gw=class{constructor(){sw(this,"_sentinel");let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return nh(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&nh(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,r=e._prev;for(;r!==e;)t.push(JSON.stringify(r,Uw)),r=r._prev;return"["+t.join(", ")+"]"}};function nh(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Uw(t,e){if(t!=="_next"&&t!=="_prev")return e}var Hw=Gw,Yw=()=>1;function qw(t,e){if(t.nodeCount()<=1)return[];let r=Ww(t,e||Yw);return _w(r.graph,r.buckets,r.zeroIdx).flatMap(a=>t.outEdges(a.v,a.w)||[])}function _w(t,e,r){var a;let n=[],i=e[e.length-1],o=e[0],s;for(;t.nodeCount();){for(;s=o.dequeue();)cs(t,e,r,s);for(;s=i.dequeue();)cs(t,e,r,s);if(t.nodeCount()){for(let u=e.length-2;u>0;--u)if(s=(a=e[u])==null?void 0:a.dequeue(),s){n=n.concat(cs(t,e,r,s,!0)||[]);break}}}return n}function cs(t,e,r,a,n){let i=[],o=n?i:void 0;return(t.inEdges(a.v)||[]).forEach(s=>{let u=t.edge(s),l=t.node(s.v);n&&i.push({v:s.v,w:s.w}),l.out-=u,Us(e,r,l)}),(t.outEdges(a.v)||[]).forEach(s=>{let u=t.edge(s),l=s.w,f=t.node(l);f.in-=u,Us(e,r,f)}),t.removeNode(a.v),o}function Ww(t,e){let r=new Ut,a=0,n=0;t.nodes().forEach(s=>{r.setNode(s,{v:s,in:0,out:0})}),t.edges().forEach(s=>{let u=r.edge(s.v,s.w)||0,l=e(s),f=u+l;r.setEdge(s.v,s.w,f);let h=r.node(s.v),v=r.node(s.w);n=Math.max(n,h.out+=l),a=Math.max(a,v.in+=l)});let i=Xw(n+a+3).map(()=>new Hw),o=a+1;return r.nodes().forEach(s=>{Us(i,o,r.node(s))}),{graph:r,buckets:i,zeroIdx:o}}function Us(t,e,r){var a,n,i;r.out?r.in?(i=t[r.out-r.in+e])==null||i.enqueue(r):(n=t[t.length-1])==null||n.enqueue(r):(a=t[0])==null||a.enqueue(r)}function Xw(t){let e=[];for(let r=0;r<t;r++)e.push(r);return e}function $w(t){(t.graph().acyclicer==="greedy"?qw(t,e(t)):Kw(t)).forEach(r=>{let a=t.edge(r);t.removeEdge(r),a.forwardName=r.name,a.reversed=!0,t.setEdge(r.w,r.v,a,du("rev"))});function e(r){return a=>r.edge(a).weight}}function Kw(t){let e=[],r={},a={};function n(i){Object.hasOwn(a,i)||(a[i]=!0,r[i]=!0,t.outEdges(i).forEach(o=>{Object.hasOwn(r,o.w)?e.push(o):n(o.w)}),delete r[i])}return t.nodes().forEach(n),e}function Zw(t){t.edges().forEach(e=>{let r=t.edge(e);if(r.reversed){t.removeEdge(e);let a=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,a)}})}function Qw(t){t.graph().dummyChains=[],t.edges().forEach(e=>Jw(t,e))}function Jw(t,e){let r=e.v,a=t.node(r).rank,n=e.w,i=t.node(n).rank,o=e.name,s=t.edge(e),u=s.labelRank;if(i===a+1)return;t.removeEdge(e);let l,f,h;for(h=0,++a;a<i;++h,++a)s.points=[],f={width:0,height:0,edgeLabel:s,edgeObj:e,rank:a},l=La(t,"edge",f,"_d"),a===u&&(f.width=s.width,f.height=s.height,f.dummy="edge-label",f.labelpos=s.labelpos),t.setEdge(r,l,{weight:s.weight},o),h===0&&t.graph().dummyChains.push(l),r=l;t.setEdge(r,n,{weight:s.weight},o)}function jw(t){t.graph().dummyChains.forEach(e=>{let r=t.node(e),a=r.edgeLabel,n;for(t.setEdge(r.edgeObj,a);r.dummy;)n=t.successors(e)[0],t.removeNode(e),a.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(a.x=r.x,a.y=r.y,a.width=r.width,a.height=r.height),e=n,r=t.node(e)})}function gu(t){let e={};function r(a){let n=t.node(a);if(Object.hasOwn(e,a))return n.rank;e[a]=!0;let i=t.outEdges(a),o=i?i.map(u=>u==null?Number.POSITIVE_INFINITY:r(u.w)-t.edge(u).minlen):[],s=Jt(Math.min,o);return s===Number.POSITIVE_INFINITY&&(s=0),n.rank=s}t.sources().forEach(r)}function wa(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var Bv=eE;function eE(t){let e=new Ut({directed:!1}),r=t.nodes();if(r.length===0)throw new Error("Graph must have at least one node");let a=r[0],n=t.nodeCount();e.setNode(a,{});let i,o;for(;tE(e,t)<n&&(i=rE(e,t),!!i);)o=e.hasNode(i.v)?wa(t,i):-wa(t,i),aE(e,t,o);return e}function tE(t,e){function r(a){let n=e.nodeEdges(a);n&&n.forEach(i=>{let o=i.v,s=a===o?i.w:o;!t.hasNode(s)&&!wa(e,i)&&(t.setNode(s,{}),t.setEdge(a,s,{}),r(s))})}return t.nodes().forEach(r),t.nodeCount()}function rE(t,e){return e.edges().reduce((r,a)=>{let n=Number.POSITIVE_INFINITY;return t.hasNode(a.v)!==t.hasNode(a.w)&&(n=wa(e,a)),n<r[0]?[n,a]:r},[Number.POSITIVE_INFINITY,null])[1]}function aE(t,e,r){t.nodes().forEach(a=>e.node(a).rank+=r)}var{preorder:nE,postorder:iE}=vu,oE=$r;$r.initLowLimValues=yu;$r.initCutValues=pu;$r.calcCutValue=Fv;$r.leaveEdge=Vv;$r.enterEdge=Gv;$r.exchangeEdges=Uv;function $r(t){t=Ow(t),gu(t);let e=Bv(t);yu(e),pu(e,t);let r,a;for(;r=Vv(e);)a=Gv(e,t,r),Uv(e,t,r,a)}function pu(t,e){let r=iE(t,t.nodes());r=r.slice(0,r.length-1),r.forEach(a=>sE(t,e,a))}function sE(t,e,r){let a=t.node(r).parent,n=t.edge(r,a);n.cutvalue=Fv(t,e,r)}function Fv(t,e,r){let a=t.node(r).parent,n=!0,i=e.edge(r,a),o=0;i||(n=!1,i=e.edge(a,r)),o=i.weight;let s=e.nodeEdges(r);return s&&s.forEach(u=>{let l=u.v===r,f=l?u.w:u.v;if(f!==a){let h=l===n,v=e.edge(u).weight;if(o+=h?v:-v,lE(t,r,f)){let c=t.edge(r,f).cutvalue;o+=h?-c:c}}}),o}function yu(t,e){arguments.length<2&&(e=t.nodes()[0]),zv(t,{},1,e)}function zv(t,e,r,a,n){let i=r,o=t.node(a);e[a]=!0;let s=t.neighbors(a);return s&&s.forEach(u=>{Object.hasOwn(e,u)||(r=zv(t,e,r,u,a))}),o.low=i,o.lim=r++,n?o.parent=n:delete o.parent,r}function Vv(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function Gv(t,e,r){let a=r.v,n=r.w;e.hasEdge(a,n)||(a=r.w,n=r.v);let i=t.node(a),o=t.node(n),s=i,u=!1;return i.lim>o.lim&&(s=o,u=!0),e.edges().filter(l=>u===ih(t,t.node(l.v),s)&&u!==ih(t,t.node(l.w),s)).reduce((l,f)=>wa(e,f)<wa(e,l)?f:l)}function Uv(t,e,r,a){let n=r.v,i=r.w;t.removeEdge(n,i),t.setEdge(a.v,a.w,{}),yu(t),pu(t,e),uE(t,e)}function uE(t,e){let r=t.nodes().find(n=>!t.node(n).parent);if(!r)return;let a=nE(t,[r]);a=a.slice(1),a.forEach(n=>{let i=t.node(n).parent,o=e.edge(n,i),s=!1;o||(o=e.edge(i,n),s=!0),e.node(n).rank=e.node(i).rank+(s?o.minlen:-o.minlen)})}function lE(t,e,r){return t.hasEdge(e,r)}function ih(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}var fE=hE;function hE(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":oh(t);break;case"tight-tree":vE(t);break;case"longest-path":cE(t);break;case"none":break;default:oh(t)}}var cE=gu;function vE(t){gu(t),Bv(t)}function oh(t){oE(t)}var dE=gE;function gE(t){let e=yE(t);t.graph().dummyChains.forEach(r=>{let a=t.node(r),n=a.edgeObj,i=pE(t,e,n.v,n.w),o=i.path,s=i.lca,u=0,l=o[u],f=!0;for(;r!==n.w;){if(a=t.node(r),f){for(;(l=o[u])!==s&&t.node(l).maxRank<a.rank;)u++;l===s&&(f=!1)}if(!f){for(;u<o.length-1&&t.node(o[u+1]).minRank<=a.rank;)u++;l=o[u]}l!==void 0&&t.setParent(r,l),r=t.successors(r)[0]}})}function pE(t,e,r,a){let n=[],i=[],o=Math.min(e[r].low,e[a].low),s=Math.max(e[r].lim,e[a].lim),u;u=r;do u=t.parent(u),n.push(u);while(u&&(e[u].low>o||s>e[u].lim));let l=u,f=a;for(;(f=t.parent(f))!==l;)i.push(f);return{path:n.concat(i.reverse()),lca:l}}function yE(t){let e={},r=0;function a(n){let i=r;t.children(n).forEach(a),e[n]={low:i,lim:r++}}return t.children(Mi).forEach(a),e}function mE(t){let e=La(t,"root",{},"_root"),r=bE(t),a=Object.values(r),n=Jt(Math.max,a)-1,i=2*n+1;t.graph().nestingRoot=e,t.edges().forEach(s=>t.edge(s).minlen*=i);let o=wE(t)+1;t.children(Mi).forEach(s=>Hv(t,e,i,o,n,r,s)),t.graph().nodeRankFactor=i}function Hv(t,e,r,a,n,i,o){var s;let u=t.children(o);if(!u.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:r});return}let l=ah(t,"_bt"),f=ah(t,"_bb"),h=t.node(o);t.setParent(l,o),h.borderTop=l,t.setParent(f,o),h.borderBottom=f,u.forEach(v=>{var c;Hv(t,e,r,a,n,i,v);let d=t.node(v),p=d.borderTop?d.borderTop:v,y=d.borderBottom?d.borderBottom:v,g=d.borderTop?a:2*a,b=p!==y?1:n-((c=i[o])!=null?c:0)+1;t.setEdge(l,p,{weight:g,minlen:b,nestingEdge:!0}),t.setEdge(y,f,{weight:g,minlen:b,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,l,{weight:0,minlen:n+((s=i[o])!=null?s:0)})}function bE(t){let e={};function r(a,n){let i=t.children(a);i&&i.length&&i.forEach(o=>r(o,n+1)),e[a]=n}return t.children(Mi).forEach(a=>r(a,1)),e}function wE(t){return t.edges().reduce((e,r)=>e+t.edge(r).weight,0)}function EE(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(r=>{t.edge(r).nestingEdge&&t.removeEdge(r)})}var xE=TE;function TE(t){function e(r){let a=t.children(r),n=t.node(r);if(a.length&&a.forEach(e),Object.hasOwn(n,"minRank")){n.borderLeft=[],n.borderRight=[];for(let i=n.minRank,o=n.maxRank+1;i<o;++i)sh(t,"borderLeft","_bl",r,n,i),sh(t,"borderRight","_br",r,n,i)}}t.children(Mi).forEach(e)}function sh(t,e,r,a,n,i){let o={width:0,height:0,rank:i,borderType:e},s=n[e][i-1],u=La(t,"border",o,r);n[e][i]=u,t.setParent(u,a),s&&t.setEdge(s,u,{weight:1})}function CE(t){var e;let r=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(r==="lr"||r==="rl")&&Yv(t)}function SE(t){var e;let r=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(r==="bt"||r==="rl")&&DE(t),(r==="lr"||r==="rl")&&(AE(t),Yv(t))}function Yv(t){t.nodes().forEach(e=>uh(t.node(e))),t.edges().forEach(e=>uh(t.edge(e)))}function uh(t){let e=t.width;t.width=t.height,t.height=e}function DE(t){t.nodes().forEach(e=>vs(t.node(e))),t.edges().forEach(e=>{var r;let a=t.edge(e);(r=a.points)==null||r.forEach(vs),Object.hasOwn(a,"y")&&vs(a)})}function vs(t){t.y=-t.y}function AE(t){t.nodes().forEach(e=>ds(t.node(e))),t.edges().forEach(e=>{var r;let a=t.edge(e);(r=a.points)==null||r.forEach(ds),Object.hasOwn(a,"x")&&ds(a)})}function ds(t){let e=t.x;t.x=t.y,t.y=e}function LE(t){let e={},r=t.nodes().filter(s=>!t.children(s).length),a=r.map(s=>t.node(s).rank),n=Jt(Math.max,a),i=an(n+1).map(()=>[]);function o(s){if(e[s])return;e[s]=!0;let u=t.node(s);i[u.rank].push(s);let l=t.successors(s);l&&l.forEach(o)}return r.sort((s,u)=>t.node(s).rank-t.node(u).rank).forEach(o),i}function NE(t,e){let r=0;for(let a=1;a<e.length;++a)r+=ME(t,e[a-1],e[a]);return r}function ME(t,e,r){let a=zw(r,r.map((l,f)=>f)),n=e.flatMap(l=>{let f=t.outEdges(l);return f?f.map(h=>({pos:a[h.w],weight:t.edge(h).weight})).sort((h,v)=>h.pos-v.pos):[]}),i=1;for(;i<r.length;)i<<=1;let o=2*i-1;i-=1;let s=new Array(o).fill(0),u=0;return n.forEach(l=>{let f=l.pos+i;s[f]+=l.weight;let h=0;for(;f>0;)f%2&&(h+=s[f+1]),f=f-1>>1,s[f]+=l.weight;u+=l.weight*h}),u}function RE(t,e=[]){return e.map(r=>{let a=t.inEdges(r);if(!a||!a.length)return{v:r};{let n=a.reduce((i,o)=>{let s=t.edge(o),u=t.node(o.v);return{sum:i.sum+s.weight*u.order,weight:i.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:n.sum/n.weight,weight:n.weight}}})}function OE(t,e){let r={};t.forEach((n,i)=>{let o={indegree:0,in:[],out:[],vs:[n.v],i};n.barycenter!==void 0&&(o.barycenter=n.barycenter,o.weight=n.weight),r[n.v]=o}),e.edges().forEach(n=>{let i=r[n.v],o=r[n.w];i!==void 0&&o!==void 0&&(o.indegree++,i.out.push(o))});let a=Object.values(r).filter(n=>!n.indegree);return PE(a)}function PE(t){let e=[];function r(n){return i=>{i.merged||(i.barycenter===void 0||n.barycenter===void 0||i.barycenter>=n.barycenter)&&IE(n,i)}}function a(n){return i=>{i.in.push(n),--i.indegree===0&&t.push(i)}}for(;t.length;){let n=t.pop();e.push(n),n.in.reverse().forEach(r(n)),n.out.forEach(a(n))}return e.filter(n=>!n.merged).map(n=>fi(n,["vs","i","barycenter","weight"]))}function IE(t,e){let r=0,a=0;t.weight&&(r+=t.barycenter*t.weight,a+=t.weight),e.weight&&(r+=e.barycenter*e.weight,a+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/a,t.weight=a,t.i=Math.min(e.i,t.i),e.merged=!0}function kE(t,e){let r=Bw(t,f=>Object.hasOwn(f,"barycenter")),a=r.lhs,n=r.rhs.sort((f,h)=>h.i-f.i),i=[],o=0,s=0,u=0;a.sort(BE(!!e)),u=lh(i,n,u),a.forEach(f=>{u+=f.vs.length,i.push(f.vs),o+=f.barycenter*f.weight,s+=f.weight,u=lh(i,n,u)});let l={vs:i.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function lh(t,e,r){let a;for(;e.length&&(a=e[e.length-1]).i<=r;)e.pop(),t.push(a.vs),r++;return r}function BE(t){return(e,r)=>e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}function qv(t,e,r,a){let n=t.children(e),i=t.node(e),o=i?i.borderLeft:void 0,s=i?i.borderRight:void 0,u={};o&&(n=n.filter(v=>v!==o&&v!==s));let l=RE(t,n);l.forEach(v=>{if(t.children(v.v).length){let c=qv(t,v.v,r,a);u[v.v]=c,Object.hasOwn(c,"barycenter")&&zE(v,c)}});let f=OE(l,r);FE(f,u);let h=kE(f,a);if(o&&s){h.vs=[o,h.vs,s].flat(1);let v=t.predecessors(o);if(v&&v.length){let c=t.node(v[0]),d=t.predecessors(s),p=t.node(d[0]);Object.hasOwn(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+c.order+p.order)/(h.weight+2),h.weight+=2}}return h}function FE(t,e){t.forEach(r=>{r.vs=r.vs.flatMap(a=>e[a]?e[a].vs:a)})}function zE(t,e){t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)}function VE(t,e,r,a){a||(a=t.nodes());let n=GE(t),i=new Ut({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(o=>t.node(o));return a.forEach(o=>{let s=t.node(o),u=t.parent(o);if(s.rank===e||s.minRank<=e&&e<=s.maxRank){i.setNode(o),i.setParent(o,u||n);let l=t[r](o);l&&l.forEach(f=>{let h=f.v===o?f.w:f.v,v=i.edge(h,o),c=v!==void 0?v.weight:0;i.setEdge(h,o,{weight:t.edge(f).weight+c})}),Object.hasOwn(s,"minRank")&&i.setNode(o,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]})}}),i}function GE(t){let e;for(;t.hasNode(e=du("_root")););return e}function UE(t,e,r){let a={},n;r.forEach(i=>{let o=t.parent(i),s,u;for(;o;){if(s=t.parent(o),s?(u=a[s],a[s]=o):(u=n,n=o),u&&u!==o){e.setEdge(u,o);return}o=s}})}function _v(t,e={}){if(typeof e.customOrder=="function"){e.customOrder(t,_v);return}let r=Pv(t),a=fh(t,an(1,r+1),"inEdges"),n=fh(t,an(r-1,-1,-1),"outEdges"),i=LE(t);if(hh(t,i),e.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,s,u=e.constraints||[];for(let l=0,f=0;f<4;++l,++f){HE(l%2?a:n,l%4>=2,u),i=yn(t);let h=NE(t,i);h<o?(f=0,s=Object.assign({},i),o=h):h===o&&(s=structuredClone(i))}hh(t,s)}function fh(t,e,r){let a=new Map,n=(i,o)=>{a.has(i)||a.set(i,[]),a.get(i).push(o)};for(let i of t.nodes()){let o=t.node(i);if(typeof o.rank=="number"&&n(o.rank,i),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let s=o.minRank;s<=o.maxRank;s++)s!==o.rank&&n(s,i)}return e.map(function(i){return VE(t,i,r,a.get(i)||[])})}function HE(t,e,r){let a=new Ut;t.forEach(function(n){r.forEach(s=>a.setEdge(s.left,s.right));let i=n.graph().root,o=qv(n,i,a,e);o.vs.forEach((s,u)=>n.node(s).order=u),UE(n,a,o.vs)})}function hh(t,e){Object.values(e).forEach(r=>r.forEach((a,n)=>t.node(a).order=n))}function YE(t,e){let r={};function a(n,i){let o=0,s=0,u=n.length,l=i[i.length-1];return i.forEach((f,h)=>{let v=_E(t,f),c=v?t.node(v).order:u;(v||f===l)&&(i.slice(s,h+1).forEach(d=>{let p=t.predecessors(d);p&&p.forEach(y=>{let g=t.node(y),b=g.order;(b<o||c<b)&&!(g.dummy&&t.node(d).dummy)&&Wv(r,y,d)})}),s=h+1,o=c)}),i}return e.length&&e.reduce(a),r}function qE(t,e){let r={};function a(i,o,s,u,l){an(o,s).forEach(f=>{let h=i[f];if(h!==void 0&&t.node(h).dummy){let v=t.predecessors(h);v&&v.forEach(c=>{if(c===void 0)return;let d=t.node(c);d.dummy&&(d.order<u||d.order>l)&&Wv(r,c,h)})}})}function n(i,o){let s=-1,u=-1,l=0;return o.forEach((f,h)=>{if(t.node(f).dummy==="border"){let v=t.predecessors(f);if(v&&v.length){let c=v[0];if(c===void 0)return;u=t.node(c).order,a(o,l,h,s,u),l=h,s=u}}a(o,l,o.length,u,i.length)}),o}return e.length&&e.reduce(n),r}function _E(t,e){if(t.node(e).dummy){let r=t.predecessors(e);if(r)return r.find(a=>t.node(a).dummy)}}function Wv(t,e,r){if(e>r){let n=e;e=r,r=n}let a=t[e];a||(t[e]=a={}),a[r]=!0}function WE(t,e,r){if(e>r){let n=e;e=r,r=n}let a=t[e];return a!==void 0&&Object.hasOwn(a,r)}function XE(t,e,r,a){let n={},i={},o={};return e.forEach(s=>{s.forEach((u,l)=>{n[u]=u,i[u]=u,o[u]=l})}),e.forEach(s=>{let u=-1;s.forEach(l=>{let f=a(l);if(f&&f.length){let h=f.sort((c,d)=>{let p=o[c],y=o[d];return(p!==void 0?p:0)-(y!==void 0?y:0)}),v=(h.length-1)/2;for(let c=Math.floor(v),d=Math.ceil(v);c<=d;++c){let p=h[c];if(p===void 0)continue;let y=o[p];if(y!==void 0&&i[l]===l&&u<y&&!WE(r,l,p)){let g=n[p];g!==void 0&&(i[p]=l,i[l]=n[l]=g,u=y)}}}})}),{root:n,align:i}}function $E(t,e,r,a,n=!1){let i={},o=KE(t,e,r,n),s=n?"borderLeft":"borderRight";function u(c,d){let p=o.nodes().slice(),y={},g=p.pop();for(;g;){if(y[g])c(g);else{y[g]=!0,p.push(g);for(let b of d(g))p.push(b)}g=p.pop()}}function l(c){let d=o.inEdges(c);d?i[c]=d.reduce((p,y)=>{var g;let b=(g=i[y.v])!=null?g:0,m=o.edge(y);return Math.max(p,b+(m!==void 0?m:0))},0):i[c]=0}function f(c){let d=o.outEdges(c),p=Number.POSITIVE_INFINITY;d&&(p=d.reduce((g,b)=>{let m=i[b.w],w=o.edge(b);return Math.min(g,(m!==void 0?m:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let y=t.node(c);p!==Number.POSITIVE_INFINITY&&y.borderType!==s&&(i[c]=Math.max(i[c]!==void 0?i[c]:0,p))}function h(c){return o.predecessors(c)||[]}function v(c){return o.successors(c)||[]}return u(l,h),u(f,v),Object.keys(a).forEach(c=>{var d;let p=r[c];p!==void 0&&(i[c]=(d=i[p])!=null?d:0)}),i}function KE(t,e,r,a){let n=new Ut,i=t.graph(),o=e1(i.nodesep,i.edgesep,a);return e.forEach(s=>{let u;s.forEach(l=>{let f=r[l];if(f!==void 0){if(n.setNode(f),u!==void 0){let h=r[u];if(h!==void 0){let v=n.edge(h,f);n.setEdge(h,f,Math.max(o(t,l,u),v||0))}}u=l}})}),n}function ZE(t,e){return Object.values(e).reduce((r,a)=>{let n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(a).forEach(([s,u])=>{let l=t1(t,s)/2;n=Math.max(u+l,n),i=Math.min(u-l,i)});let o=n-i;return o<r[0]&&(r=[o,a]),r},[Number.POSITIVE_INFINITY,null])[1]}function QE(t,e){let r=Object.values(e),a=Jt(Math.min,r),n=Jt(Math.max,r);["u","d"].forEach(i=>{["l","r"].forEach(o=>{let s=i+o,u=t[s];if(!u||u===e)return;let l=Object.values(u),f=a-Jt(Math.min,l);o!=="l"&&(f=n-Jt(Math.max,l)),f&&(t[s]=Ni(u,h=>h+f))})})}function JE(t,e=void 0){let r=t.ul;return r?Ni(r,(a,n)=>{var i,o;if(e){let u=e.toLowerCase(),l=t[u];if(l&&l[n]!==void 0)return l[n]}let s=Object.values(t).map(u=>{let l=u[n];return l!==void 0?l:0}).sort((u,l)=>u-l);return(((i=s[1])!=null?i:0)+((o=s[2])!=null?o:0))/2}):{}}function jE(t){let e=yn(t),r=Object.assign(YE(t,e),qE(t,e)),a={},n;["u","d"].forEach(o=>{n=o==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(n=n.map(f=>Object.values(f).reverse()));let u=XE(t,n,r,f=>(o==="u"?t.predecessors(f):t.successors(f))||[]),l=$E(t,n,u.root,u.align,s==="r");s==="r"&&(l=Ni(l,f=>-f)),a[o+s]=l})});let i=ZE(t,a);return QE(a,i),JE(a,t.graph().align)}function e1(t,e,r){return(a,n,i)=>{let o=a.node(n),s=a.node(i),u=0,l;if(u+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":l=-o.width/2;break;case"r":l=o.width/2;break}if(l&&(u+=r?l:-l),l=void 0,u+=(o.dummy?e:t)/2,u+=(s.dummy?e:t)/2,u+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":l=s.width/2;break;case"r":l=-s.width/2;break}return l&&(u+=r?l:-l),u}}function t1(t,e){return t.node(e).width}function r1(t){t=Rv(t),a1(t),Object.entries(jE(t)).forEach(([e,r])=>t.node(e).x=r)}function a1(t){let e=yn(t),r=t.graph(),a=r.ranksep,n=r.rankalign,i=0;e.forEach(o=>{let s=o.reduce((u,l)=>{var f;let h=(f=t.node(l).height)!=null?f:0;return u>h?u:h},0);o.forEach(u=>{let l=t.node(u);n==="top"?l.y=i+l.height/2:n==="bottom"?l.y=i+s-l.height/2:l.y=i+s/2}),i+=s+a})}function n1(t,e={}){let r=e.debugTiming?Iv:kv;return r("layout",()=>{let a=r(" buildLayoutGraph",()=>d1(t));return r(" runLayout",()=>i1(a,r,e)),r(" updateInputGraph",()=>o1(t,a)),a})}function i1(t,e,r){e(" makeSpaceForEdgeLabels",()=>g1(t)),e(" removeSelfEdges",()=>C1(t)),e(" acyclic",()=>$w(t)),e(" nestingGraph.run",()=>mE(t)),e(" rank",()=>fE(Rv(t))),e(" injectEdgeLabelProxies",()=>p1(t)),e(" removeEmptyRanks",()=>Iw(t)),e(" nestingGraph.cleanup",()=>EE(t)),e(" normalizeRanks",()=>Pw(t)),e(" assignRankMinMax",()=>y1(t)),e(" removeEdgeLabelProxies",()=>m1(t)),e(" normalize.run",()=>Qw(t)),e(" parentDummyChains",()=>dE(t)),e(" addBorderSegments",()=>xE(t)),e(" order",()=>_v(t,r)),e(" insertSelfEdges",()=>S1(t)),e(" adjustCoordinateSystem",()=>CE(t)),e(" position",()=>r1(t)),e(" positionSelfEdges",()=>D1(t)),e(" removeBorderNodes",()=>T1(t)),e(" normalize.undo",()=>jw(t)),e(" fixupEdgeLabelCoords",()=>E1(t)),e(" undoCoordinateSystem",()=>SE(t)),e(" translateGraph",()=>b1(t)),e(" assignNodeIntersects",()=>w1(t)),e(" reversePoints",()=>x1(t)),e(" acyclic.undo",()=>Zw(t))}function o1(t,e){t.nodes().forEach(r=>{let a=t.node(r),n=e.node(r);a&&(a.x=n.x,a.y=n.y,a.order=n.order,a.rank=n.rank,e.children(r).length&&(a.width=n.width,a.height=n.height))}),t.edges().forEach(r=>{let a=t.edge(r),n=e.edge(r);a.points=n.points,Object.hasOwn(n,"x")&&(a.x=n.x,a.y=n.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var s1=["nodesep","edgesep","ranksep","marginx","marginy"],u1={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},l1=["acyclicer","ranker","rankdir","align","rankalign"],f1=["width","height","rank"],ch={width:0,height:0},h1=["minlen","weight","width","height","labeloffset"],c1={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},v1=["labelpos"];function d1(t){let e=new Ut({multigraph:!0,compound:!0}),r=ps(t.graph());return e.setGraph(Object.assign({},u1,gs(r,s1),fi(r,l1))),t.nodes().forEach(a=>{let n=ps(t.node(a)),i=gs(n,f1);Object.keys(ch).forEach(s=>{i[s]===void 0&&(i[s]=ch[s])}),e.setNode(a,i);let o=t.parent(a);o!==void 0&&e.setParent(a,o)}),t.edges().forEach(a=>{let n=ps(t.edge(a));e.setEdge(a,Object.assign({},c1,gs(n,h1),fi(n,v1)))}),e}function g1(t){let e=t.graph();e.ranksep/=2,t.edges().forEach(r=>{let a=t.edge(r);a.minlen*=2,a.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?a.width+=a.labeloffset:a.height+=a.labeloffset)})}function p1(t){t.edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let a=t.node(e.v),n={rank:(t.node(e.w).rank-a.rank)/2+a.rank,e};La(t,"edge-proxy",n,"_ep")}})}function y1(t){let e=0;t.nodes().forEach(r=>{let a=t.node(r);a.borderTop&&(a.minRank=t.node(a.borderTop).rank,a.maxRank=t.node(a.borderBottom).rank,e=Math.max(e,a.maxRank))}),t.graph().maxRank=e}function m1(t){t.nodes().forEach(e=>{let r=t.node(e);if(r.dummy==="edge-proxy"){let a=r;t.edge(a.e).labelRank=r.rank,t.removeNode(e)}})}function b1(t){let e=Number.POSITIVE_INFINITY,r=0,a=Number.POSITIVE_INFINITY,n=0,i=t.graph(),o=i.marginx||0,s=i.marginy||0;function u(l){let f=l.x,h=l.y,v=l.width,c=l.height;e=Math.min(e,f-v/2),r=Math.max(r,f+v/2),a=Math.min(a,h-c/2),n=Math.max(n,h+c/2)}t.nodes().forEach(l=>u(t.node(l))),t.edges().forEach(l=>{let f=t.edge(l);Object.hasOwn(f,"x")&&u(f)}),e-=o,a-=s,t.nodes().forEach(l=>{let f=t.node(l);f.x-=e,f.y-=a}),t.edges().forEach(l=>{let f=t.edge(l);f.points.forEach(h=>{h.x-=e,h.y-=a}),Object.hasOwn(f,"x")&&(f.x-=e),Object.hasOwn(f,"y")&&(f.y-=a)}),i.width=r-e+o,i.height=n-a+s}function w1(t){t.edges().forEach(e=>{let r=t.edge(e),a=t.node(e.v),n=t.node(e.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=n,o=a),r.points.unshift(rh(a,i)),r.points.push(rh(n,o))})}function E1(t){t.edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function x1(t){t.edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}function T1(t){t.nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),a=t.node(r.borderTop),n=t.node(r.borderBottom),i=t.node(r.borderLeft[r.borderLeft.length-1]),o=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(o.x-i.x),r.height=Math.abs(n.y-a.y),r.x=i.x+r.width/2,r.y=a.y+r.height/2}}),t.nodes().forEach(e=>{t.node(e).dummy==="border"&&t.removeNode(e)})}function C1(t){t.edges().forEach(e=>{if(e.v===e.w){let r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function S1(t){yn(t).forEach(e=>{let r=0;e.forEach((a,n)=>{let i=t.node(a);i.order=n+r,(i.selfEdges||[]).forEach(o=>{La(t,"selfedge",{width:o.label.width,height:o.label.height,rank:i.rank,order:n+ ++r,e:o.e,label:o.label},"_se")}),delete i.selfEdges})})}function D1(t){t.nodes().forEach(e=>{let r=t.node(e);if(r.dummy==="selfedge"){let a=r,n=t.node(a.e.v),i=n.x+n.width/2,o=n.y,s=r.x-i,u=n.height/2;t.setEdge(a.e,a.label),t.removeNode(e),a.label.points=[{x:i+2*s/3,y:o-u},{x:i+5*s/6,y:o-u},{x:i+s,y:o},{x:i+5*s/6,y:o+u},{x:i+2*s/3,y:o+u}],a.label.x=r.x,a.label.y=r.y}})}function gs(t,e){return Ni(fi(t,e),Number)}function ps(t){let e={};return t&&Object.entries(t).forEach(([r,a])=>{typeof r=="string"&&(r=r.toLowerCase()),e[r]=a}),e}function A1(t){let e=yn(t),r=new Ut({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach(a=>{r.setNode(a,{label:a}),r.setParent(a,"layer"+t.node(a).rank)}),t.edges().forEach(a=>r.setEdge(a.v,a.w,{},a.name)),e.forEach((a,n)=>{let i="layer"+n;r.setNode(i,{rank:"same"}),a.reduce((o,s)=>(r.setEdge(o,s,{style:"invis"}),s))}),r}var L1={graphlib:xv,version:Vw,layout:n1,debug:A1,util:{time:Iv,notime:kv}},vh=L1;/*! For license information please see dagre.esm.js.LEGAL.txt */var ys=function(e){return typeof e=="function"},ms=.001;function Xv(t){this.options=nw({},aw,t)}function $v(t,e){return{x:Ea(t.x-e.x),y:Ea(t.y-e.y)}}function dh(t,e){return Ea(t.x*e.x)+Ea(t.y*e.y)}function N1(t){var e=Math.hypot(t.x,t.y)||1;return{x:t.x/e,y:t.y/e,len:e}}function M1(t){return{x:-t.y,y:t.x}}function R1(t,e){var r=$v(e,t),a=N1(r),n=a.x,i=a.y,o=a.len,s={x:n,y:i},u=M1(s);return{src:t,tgt:e,dir:s,normal:u,len:o}}function Ea(t){return Math.abs(t)<ms?t<0?-ms:ms:t}function O1(t,e){var r=$v(t,e.src),a=Ea(dh(r,e.dir)/e.len),n=Ea(dh(r,e.normal));return{weight:a,distance:n}}function P1(t){var e=1/0,r=-1/0,a=tw(t),n;try{for(a.s();!(n=a.n()).done;){var i=n.value;i.weight<e&&(e=i.weight),i.weight>r&&(r=i.weight)}}catch(s){a.e(s)}finally{a.f()}var o=r-e||1;return t.map(function(s){return{distance:s.distance,weight:(s.weight-e)/o}})}function I1(t,e){var r=e.source().position(),a=e.target().position(),n=R1(r,a),i=P1(t.points.map(function(l){return O1(l,n)})),o=i.slice(1,-1).map(function(l){return l.weight}),s=i.slice(1,-1).map(function(l){return l.distance}),u={controlPointWeights:o,controlPointDistances:s};return u}Xv.prototype.run=function(){var t=this.options,e=this,r=t.cy,a=t.eles,n=function(O,R){return ys(R)?R.apply(O,[O]):R},i=t.boundingBox||{x1:0,y1:0,w:r.width(),h:r.height()};i.x2===void 0&&(i.x2=i.x1+i.w),i.w===void 0&&(i.w=i.x2-i.x1),i.y2===void 0&&(i.y2=i.y1+i.h),i.h===void 0&&(i.h=i.y2-i.y1);var o=new vh.graphlib.Graph({multigraph:!0,compound:!0}),s={},u=function(O,R){R!=null&&(s[O]=R)};u("nodesep",t.nodeSep),u("edgesep",t.edgeSep),u("ranksep",t.rankSep),u("rankdir",t.rankDir),u("align",t.align),u("ranker",t.ranker),u("acyclicer",t.acyclicer),o.setGraph(s),o.setDefaultEdgeLabel(function(){return{}}),o.setDefaultNodeLabel(function(){return{}});var l=a.nodes();ys(t.sort)&&(l=l.sort(t.sort));for(var f=0;f<l.length;f++){var h=l[f],v=h.layoutDimensions(t);o.setNode(h.id(),{width:v.w,height:v.h,shape:"ellipse",name:h.id()})}for(var c=0;c<l.length;c++){var d=l[c];d.isChild()&&o.setParent(d.id(),d.parent().id())}var p=a.edges().stdFilter(function(N){return!N.source().isParent()&&!N.target().isParent()});ys(t.sort)&&(p=p.sort(t.sort));for(var y=0;y<p.length;y++){var g=p[y];o.setEdge(g.source().id(),g.target().id(),{minlen:n(g,t.minLen),weight:n(g,t.edgeWeight),name:g.id()},g.id())}vh.layout(o);for(var b=o.nodes(),m=0;m<b.length;m++){var w=b[m],T=o.node(w);r.getElementById(w).scratch().dagre=T}var D;t.boundingBox?(D={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},l.forEach(function(N){var O=N.scratch().dagre;D.x1=Math.min(D.x1,O.x),D.x2=Math.max(D.x2,O.x),D.y1=Math.min(D.y1,O.y),D.y2=Math.max(D.y2,O.y)}),D.w=D.x2-D.x1,D.h=D.y2-D.y1):D=i;var x=function(O){if(t.boundingBox){var R=D.w===0?0:(O.x-D.x1)/D.w,P=D.h===0?0:(O.y-D.y1)/D.h;return{x:i.x1+R*i.w,y:i.y1+P*i.h}}else return O};return l.layoutPositions(e,t,function(N){N=Gs(N)==="object"?N:this;var O=N.scratch().dagre;return x({x:O.x,y:O.y})}),t.useDagreEdgeControlPoints&&(t.automaticDagreEdgeStyle&&(r.edges().addClass("useDagreEdgeControlPoints"),r.style().selector("edge.useDagreEdgeControlPoints").style(t.dagreEdgeStyle).update()),o.edges().forEach(function(N){var O=r.getElementById(N.name),R=o.edge(N);R&&R.points&&O.scratch(I1(R,O))})),this};var Kv=function(e){e&&e("layout","dagre",Xv)};typeof window<"u"&&typeof window.cytoscape<"u"&&Kv(window.cytoscape);var mu={exports:{}},Wn={exports:{}},Xn={exports:{}},k1=Xn.exports,gh;function B1(){return gh||(gh=1,(function(t,e){(function(a,n){t.exports=n()})(k1,function(){return(function(r){var a={};function n(i){if(a[i])return a[i].exports;var o=a[i]={i,l:!1,exports:{}};return r[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=r,n.c=a,n.i=function(i){return i},n.d=function(i,o,s){n.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:s})},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=28)})([(function(r,a,n){function i(){}i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,r.exports=i}),(function(r,a,n){var i=n(2),o=n(8),s=n(9);function u(f,h,v){i.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=h}u.prototype=Object.create(i.prototype);for(var l in i)u[l]=i[l];u.prototype.getSource=function(){return this.source},u.prototype.getTarget=function(){return this.target},u.prototype.isInterGraph=function(){return this.isInterGraph},u.prototype.getLength=function(){return this.length},u.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},u.prototype.getBendpoints=function(){return this.bendpoints},u.prototype.getLca=function(){return this.lca},u.prototype.getSourceInLca=function(){return this.sourceInLca},u.prototype.getTargetInLca=function(){return this.targetInLca},u.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},u.prototype.getOtherEndInGraph=function(f,h){for(var v=this.getOtherEnd(f),c=h.getGraphManager().getRoot();;){if(v.getOwner()==h)return v;if(v.getOwner()==c)break;v=v.getOwner().getParent()}return null},u.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},u.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=u}),(function(r,a,n){function i(o){this.vGraphObject=o}r.exports=i}),(function(r,a,n){var i=n(2),o=n(10),s=n(13),u=n(0),l=n(16),f=n(5);function h(c,d,p,y){p==null&&y==null&&(y=d),i.call(this,y),c.graphManager!=null&&(c=c.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=c,p!=null&&d!=null?this.rect=new s(d.x,d.y,p.width,p.height):this.rect=new s}h.prototype=Object.create(i.prototype);for(var v in i)h[v]=i[v];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(c){this.rect.width=c},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(c){this.rect.height=c},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(c,d){this.rect.x=c.x,this.rect.y=c.y,this.rect.width=d.width,this.rect.height=d.height},h.prototype.setCenter=function(c,d){this.rect.x=c-this.rect.width/2,this.rect.y=d-this.rect.height/2},h.prototype.setLocation=function(c,d){this.rect.x=c,this.rect.y=d},h.prototype.moveBy=function(c,d){this.rect.x+=c,this.rect.y+=d},h.prototype.getEdgeListToNode=function(c){var d=[],p=this;return p.edges.forEach(function(y){if(y.target==c){if(y.source!=p)throw"Incorrect edge source!";d.push(y)}}),d},h.prototype.getEdgesBetween=function(c){var d=[],p=this;return p.edges.forEach(function(y){if(!(y.source==p||y.target==p))throw"Incorrect edge source and/or target";(y.target==c||y.source==c)&&d.push(y)}),d},h.prototype.getNeighborsList=function(){var c=new Set,d=this;return d.edges.forEach(function(p){if(p.source==d)c.add(p.target);else{if(p.target!=d)throw"Incorrect incidency!";c.add(p.source)}}),c},h.prototype.withChildren=function(){var c=new Set,d,p;if(c.add(this),this.child!=null)for(var y=this.child.getNodes(),g=0;g<y.length;g++)d=y[g],p=d.withChildren(),p.forEach(function(b){c.add(b)});return c},h.prototype.getNoOfChildren=function(){var c=0,d;if(this.child==null)c=1;else for(var p=this.child.getNodes(),y=0;y<p.length;y++)d=p[y],c+=d.getNoOfChildren();return c==0&&(c=1),c},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},h.prototype.scatter=function(){var c,d,p=-u.INITIAL_WORLD_BOUNDARY,y=u.INITIAL_WORLD_BOUNDARY;c=u.WORLD_CENTER_X+l.nextDouble()*(y-p)+p;var g=-u.INITIAL_WORLD_BOUNDARY,b=u.INITIAL_WORLD_BOUNDARY;d=u.WORLD_CENTER_Y+l.nextDouble()*(b-g)+g,this.rect.x=c,this.rect.y=d},h.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var c=this.getChild();if(c.updateBounds(!0),this.rect.x=c.getLeft(),this.rect.y=c.getTop(),this.setWidth(c.getRight()-c.getLeft()),this.setHeight(c.getBottom()-c.getTop()),u.NODE_DIMENSIONS_INCLUDE_LABELS){var d=c.getRight()-c.getLeft(),p=c.getBottom()-c.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(d+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>d?(this.rect.x-=(this.labelWidth-d)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(d+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(p+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>p?(this.rect.y-=(this.labelHeight-p)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(p+this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(c){var d=this.rect.x;d>u.WORLD_BOUNDARY?d=u.WORLD_BOUNDARY:d<-u.WORLD_BOUNDARY&&(d=-u.WORLD_BOUNDARY);var p=this.rect.y;p>u.WORLD_BOUNDARY?p=u.WORLD_BOUNDARY:p<-u.WORLD_BOUNDARY&&(p=-u.WORLD_BOUNDARY);var y=new f(d,p),g=c.inverseTransformPoint(y);this.setLocation(g.x,g.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=h}),(function(r,a,n){var i=n(0);function o(){}for(var s in i)o[s]=i[s];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=o}),(function(r,a,n){function i(o,s){o==null&&s==null?(this.x=0,this.y=0):(this.x=o,this.y=s)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(o){this.x=o},i.prototype.setY=function(o){this.y=o},i.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},r.exports=i}),(function(r,a,n){var i=n(2),o=n(10),s=n(0),u=n(7),l=n(3),f=n(1),h=n(13),v=n(12),c=n(11);function d(y,g,b){i.call(this,b),this.estimatedSize=o.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,g!=null&&g instanceof u?this.graphManager=g:g!=null&&g instanceof Layout&&(this.graphManager=g.graphManager)}d.prototype=Object.create(i.prototype);for(var p in i)d[p]=i[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(y,g,b){if(g==null&&b==null){var m=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(m)>-1)throw"Node already in graph!";return m.owner=this,this.getNodes().push(m),m}else{var w=y;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(g.owner==b.owner&&g.owner==this))throw"Both owners must be this graph!";return g.owner!=b.owner?null:(w.source=g,w.target=b,w.isInterGraph=!1,this.getEdges().push(w),g.edges.push(w),b!=g&&b.edges.push(w),w)}},d.prototype.remove=function(y){var g=y;if(y instanceof l){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=g.edges.slice(),m,w=b.length,T=0;T<w;T++)m=b[T],m.isInterGraph?this.graphManager.remove(m):m.source.owner.remove(m);var D=this.nodes.indexOf(g);if(D==-1)throw"Node not in owner node list!";this.nodes.splice(D,1)}else if(y instanceof f){var m=y;if(m==null)throw"Edge is null!";if(!(m.source!=null&&m.target!=null))throw"Source and/or target is null!";if(!(m.source.owner!=null&&m.target.owner!=null&&m.source.owner==this&&m.target.owner==this))throw"Source and/or target owner is invalid!";var x=m.source.edges.indexOf(m),N=m.target.edges.indexOf(m);if(!(x>-1&&N>-1))throw"Source and/or target doesn't know this edge!";m.source.edges.splice(x,1),m.target!=m.source&&m.target.edges.splice(N,1);var D=m.source.owner.getEdges().indexOf(m);if(D==-1)throw"Not in owner's edge list!";m.source.owner.getEdges().splice(D,1)}},d.prototype.updateLeftTop=function(){for(var y=o.MAX_VALUE,g=o.MAX_VALUE,b,m,w,T=this.getNodes(),D=T.length,x=0;x<D;x++){var N=T[x];b=N.getTop(),m=N.getLeft(),y>b&&(y=b),g>m&&(g=m)}return y==o.MAX_VALUE?null:(T[0].getParent().paddingLeft!=null?w=T[0].getParent().paddingLeft:w=this.margin,this.left=g-w,this.top=y-w,new v(this.left,this.top))},d.prototype.updateBounds=function(y){for(var g=o.MAX_VALUE,b=-o.MAX_VALUE,m=o.MAX_VALUE,w=-o.MAX_VALUE,T,D,x,N,O,R=this.nodes,P=R.length,M=0;M<P;M++){var I=R[M];y&&I.child!=null&&I.updateBounds(),T=I.getLeft(),D=I.getRight(),x=I.getTop(),N=I.getBottom(),g>T&&(g=T),b<D&&(b=D),m>x&&(m=x),w<N&&(w=N)}var E=new h(g,m,b-g,w-m);g==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),R[0].getParent().paddingLeft!=null?O=R[0].getParent().paddingLeft:O=this.margin,this.left=E.x-O,this.right=E.x+E.width+O,this.top=E.y-O,this.bottom=E.y+E.height+O},d.calculateBounds=function(y){for(var g=o.MAX_VALUE,b=-o.MAX_VALUE,m=o.MAX_VALUE,w=-o.MAX_VALUE,T,D,x,N,O=y.length,R=0;R<O;R++){var P=y[R];T=P.getLeft(),D=P.getRight(),x=P.getTop(),N=P.getBottom(),g>T&&(g=T),b<D&&(b=D),m>x&&(m=x),w<N&&(w=N)}var M=new h(g,m,b-g,w-m);return M},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var y=0,g=this.nodes,b=g.length,m=0;m<b;m++){var w=g[m];y+=w.calcEstimatedSize()}return y==0?this.estimatedSize=s.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=y/Math.sqrt(this.nodes.length),this.estimatedSize},d.prototype.updateConnected=function(){var y=this;if(this.nodes.length==0){this.isConnected=!0;return}var g=new c,b=new Set,m=this.nodes[0],w,T,D=m.withChildren();for(D.forEach(function(M){g.push(M),b.add(M)});g.length!==0;){m=g.shift(),w=m.getEdges();for(var x=w.length,N=0;N<x;N++){var O=w[N];if(T=O.getOtherEndInGraph(m,this),T!=null&&!b.has(T)){var R=T.withChildren();R.forEach(function(M){g.push(M),b.add(M)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var P=0;b.forEach(function(M){M.owner==y&&P++}),P==this.nodes.length&&(this.isConnected=!0)}},r.exports=d}),(function(r,a,n){var i,o=n(1);function s(u){i=n(6),this.layout=u,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var u=this.layout.newGraph(),l=this.layout.newNode(null),f=this.add(u,l);return this.setRootGraph(f),this.rootGraph},s.prototype.add=function(u,l,f,h,v){if(f==null&&h==null&&v==null){if(u==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(u)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(u),u.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return u.parent=l,l.child=u,u}else{v=f,h=l,f=u;var c=h.getOwner(),d=v.getOwner();if(!(c!=null&&c.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(d!=null&&d.getGraphManager()==this))throw"Target not in this graph mgr!";if(c==d)return f.isInterGraph=!1,c.add(f,h,v);if(f.isInterGraph=!0,f.source=h,f.target=v,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},s.prototype.remove=function(u){if(u instanceof i){var l=u;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(l.getEdges());for(var h,v=f.length,c=0;c<v;c++)h=f[c],l.remove(h);var d=[];d=d.concat(l.getNodes());var p;v=d.length;for(var c=0;c<v;c++)p=d[c],l.remove(p);l==this.rootGraph&&this.setRootGraph(null);var y=this.graphs.indexOf(l);this.graphs.splice(y,1),l.parent=null}else if(u instanceof o){if(h=u,h==null)throw"Edge is null!";if(!h.isInterGraph)throw"Not an inter-graph edge!";if(!(h.source!=null&&h.target!=null))throw"Source and/or target is null!";if(!(h.source.edges.indexOf(h)!=-1&&h.target.edges.indexOf(h)!=-1))throw"Source and/or target doesn't know this edge!";var y=h.source.edges.indexOf(h);if(h.source.edges.splice(y,1),y=h.target.edges.indexOf(h),h.target.edges.splice(y,1),!(h.source.owner!=null&&h.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(h.source.owner.getGraphManager().edges.indexOf(h)==-1)throw"Not in owner graph manager's edge list!";var y=h.source.owner.getGraphManager().edges.indexOf(h);h.source.owner.getGraphManager().edges.splice(y,1)}},s.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},s.prototype.getGraphs=function(){return this.graphs},s.prototype.getAllNodes=function(){if(this.allNodes==null){for(var u=[],l=this.getGraphs(),f=l.length,h=0;h<f;h++)u=u.concat(l[h].getNodes());this.allNodes=u}return this.allNodes},s.prototype.resetAllNodes=function(){this.allNodes=null},s.prototype.resetAllEdges=function(){this.allEdges=null},s.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},s.prototype.getAllEdges=function(){if(this.allEdges==null){var u=[],l=this.getGraphs();l.length;for(var f=0;f<l.length;f++)u=u.concat(l[f].getEdges());u=u.concat(this.edges),this.allEdges=u}return this.allEdges},s.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},s.prototype.setAllNodesToApplyGravitation=function(u){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=u},s.prototype.getRoot=function(){return this.rootGraph},s.prototype.setRootGraph=function(u){if(u.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=u,u.parent==null&&(u.parent=this.layout.newNode("Root node"))},s.prototype.getLayout=function(){return this.layout},s.prototype.isOneAncestorOfOther=function(u,l){if(!(u!=null&&l!=null))throw"assert failed";if(u==l)return!0;var f=u.getOwner(),h;do{if(h=f.getParent(),h==null)break;if(h==l)return!0;if(f=h.getOwner(),f==null)break}while(!0);f=l.getOwner();do{if(h=f.getParent(),h==null)break;if(h==u)return!0;if(f=h.getOwner(),f==null)break}while(!0);return!1},s.prototype.calcLowestCommonAncestors=function(){for(var u,l,f,h,v,c=this.getAllEdges(),d=c.length,p=0;p<d;p++){if(u=c[p],l=u.source,f=u.target,u.lca=null,u.sourceInLca=l,u.targetInLca=f,l==f){u.lca=l.getOwner();continue}for(h=l.getOwner();u.lca==null;){for(u.targetInLca=f,v=f.getOwner();u.lca==null;){if(v==h){u.lca=v;break}if(v==this.rootGraph)break;if(u.lca!=null)throw"assert failed";u.targetInLca=v.getParent(),v=u.targetInLca.getOwner()}if(h==this.rootGraph)break;u.lca==null&&(u.sourceInLca=h.getParent(),h=u.sourceInLca.getOwner())}if(u.lca==null)throw"assert failed"}},s.prototype.calcLowestCommonAncestor=function(u,l){if(u==l)return u.getOwner();var f=u.getOwner();do{if(f==null)break;var h=l.getOwner();do{if(h==null)break;if(h==f)return h;h=h.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},s.prototype.calcInclusionTreeDepths=function(u,l){u==null&&l==null&&(u=this.rootGraph,l=1);for(var f,h=u.getNodes(),v=h.length,c=0;c<v;c++)f=h[c],f.inclusionTreeDepth=l,f.child!=null&&this.calcInclusionTreeDepths(f.child,l+1)},s.prototype.includesInvalidEdge=function(){for(var u,l=[],f=this.edges.length,h=0;h<f;h++)u=this.edges[h],this.isOneAncestorOfOther(u.source,u.target)&&l.push(u);for(var h=0;h<l.length;h++)this.remove(l[h]);return!1},r.exports=s}),(function(r,a,n){var i=n(12);function o(){}o.calcSeparationAmount=function(s,u,l,f){if(!s.intersects(u))throw"assert failed";var h=new Array(2);this.decideDirectionsForOverlappingNodes(s,u,h),l[0]=Math.min(s.getRight(),u.getRight())-Math.max(s.x,u.x),l[1]=Math.min(s.getBottom(),u.getBottom())-Math.max(s.y,u.y),s.getX()<=u.getX()&&s.getRight()>=u.getRight()?l[0]+=Math.min(u.getX()-s.getX(),s.getRight()-u.getRight()):u.getX()<=s.getX()&&u.getRight()>=s.getRight()&&(l[0]+=Math.min(s.getX()-u.getX(),u.getRight()-s.getRight())),s.getY()<=u.getY()&&s.getBottom()>=u.getBottom()?l[1]+=Math.min(u.getY()-s.getY(),s.getBottom()-u.getBottom()):u.getY()<=s.getY()&&u.getBottom()>=s.getBottom()&&(l[1]+=Math.min(s.getY()-u.getY(),u.getBottom()-s.getBottom()));var v=Math.abs((u.getCenterY()-s.getCenterY())/(u.getCenterX()-s.getCenterX()));u.getCenterY()===s.getCenterY()&&u.getCenterX()===s.getCenterX()&&(v=1);var c=v*l[0],d=l[1]/v;l[0]<d?d=l[0]:c=l[1],l[0]=-1*h[0]*(d/2+f),l[1]=-1*h[1]*(c/2+f)},o.decideDirectionsForOverlappingNodes=function(s,u,l){s.getCenterX()<u.getCenterX()?l[0]=-1:l[0]=1,s.getCenterY()<u.getCenterY()?l[1]=-1:l[1]=1},o.getIntersection2=function(s,u,l){var f=s.getCenterX(),h=s.getCenterY(),v=u.getCenterX(),c=u.getCenterY();if(s.intersects(u))return l[0]=f,l[1]=h,l[2]=v,l[3]=c,!0;var d=s.getX(),p=s.getY(),y=s.getRight(),g=s.getX(),b=s.getBottom(),m=s.getRight(),w=s.getWidthHalf(),T=s.getHeightHalf(),D=u.getX(),x=u.getY(),N=u.getRight(),O=u.getX(),R=u.getBottom(),P=u.getRight(),M=u.getWidthHalf(),I=u.getHeightHalf(),E=!1,A=!1;if(f===v){if(h>c)return l[0]=f,l[1]=p,l[2]=v,l[3]=R,!1;if(h<c)return l[0]=f,l[1]=b,l[2]=v,l[3]=x,!1}else if(h===c){if(f>v)return l[0]=d,l[1]=h,l[2]=N,l[3]=c,!1;if(f<v)return l[0]=y,l[1]=h,l[2]=D,l[3]=c,!1}else{var C=s.height/s.width,S=u.height/u.width,L=(c-h)/(v-f),V=void 0,F=void 0,B=void 0,Y=void 0,q=void 0,Q=void 0;if(-C===L?f>v?(l[0]=g,l[1]=b,E=!0):(l[0]=y,l[1]=p,E=!0):C===L&&(f>v?(l[0]=d,l[1]=p,E=!0):(l[0]=m,l[1]=b,E=!0)),-S===L?v>f?(l[2]=O,l[3]=R,A=!0):(l[2]=N,l[3]=x,A=!0):S===L&&(v>f?(l[2]=D,l[3]=x,A=!0):(l[2]=P,l[3]=R,A=!0)),E&&A)return!1;if(f>v?h>c?(V=this.getCardinalDirection(C,L,4),F=this.getCardinalDirection(S,L,2)):(V=this.getCardinalDirection(-C,L,3),F=this.getCardinalDirection(-S,L,1)):h>c?(V=this.getCardinalDirection(-C,L,1),F=this.getCardinalDirection(-S,L,3)):(V=this.getCardinalDirection(C,L,2),F=this.getCardinalDirection(S,L,4)),!E)switch(V){case 1:Y=p,B=f+-T/L,l[0]=B,l[1]=Y;break;case 2:B=m,Y=h+w*L,l[0]=B,l[1]=Y;break;case 3:Y=b,B=f+T/L,l[0]=B,l[1]=Y;break;case 4:B=g,Y=h+-w*L,l[0]=B,l[1]=Y;break}if(!A)switch(F){case 1:Q=x,q=v+-I/L,l[2]=q,l[3]=Q;break;case 2:q=P,Q=c+M*L,l[2]=q,l[3]=Q;break;case 3:Q=R,q=v+I/L,l[2]=q,l[3]=Q;break;case 4:q=O,Q=c+-M*L,l[2]=q,l[3]=Q;break}}return!1},o.getCardinalDirection=function(s,u,l){return s>u?l:1+l%4},o.getIntersection=function(s,u,l,f){if(f==null)return this.getIntersection2(s,u,l);var h=s.x,v=s.y,c=u.x,d=u.y,p=l.x,y=l.y,g=f.x,b=f.y,m=void 0,w=void 0,T=void 0,D=void 0,x=void 0,N=void 0,O=void 0,R=void 0,P=void 0;return T=d-v,x=h-c,O=c*v-h*d,D=b-y,N=p-g,R=g*y-p*b,P=T*N-D*x,P===0?null:(m=(x*R-N*O)/P,w=(D*O-T*R)/P,new i(m,w))},o.angleOfVector=function(s,u,l,f){var h=void 0;return s!==l?(h=Math.atan((f-u)/(l-s)),l<s?h+=Math.PI:f<u&&(h+=this.TWO_PI)):f<u?h=this.ONE_AND_HALF_PI:h=this.HALF_PI,h},o.doIntersect=function(s,u,l,f){var h=s.x,v=s.y,c=u.x,d=u.y,p=l.x,y=l.y,g=f.x,b=f.y,m=(c-h)*(b-y)-(g-p)*(d-v);if(m===0)return!1;var w=((b-y)*(g-h)+(p-g)*(b-v))/m,T=((v-d)*(g-h)+(c-h)*(b-v))/m;return 0<w&&w<1&&0<T&&T<1},o.findCircleLineIntersections=function(s,u,l,f,h,v,c){var d=(l-s)*(l-s)+(f-u)*(f-u),p=2*((s-h)*(l-s)+(u-v)*(f-u)),y=(s-h)*(s-h)+(u-v)*(u-v)-c*c,g=p*p-4*d*y;if(g>=0){var b=(-p+Math.sqrt(p*p-4*d*y))/(2*d),m=(-p-Math.sqrt(p*p-4*d*y))/(2*d),w=null;return b>=0&&b<=1?[b]:m>=0&&m<=1?[m]:w}else return null},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,r.exports=o}),(function(r,a,n){function i(){}i.sign=function(o){return o>0?1:o<0?-1:0},i.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},i.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},r.exports=i}),(function(r,a,n){function i(){}i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,r.exports=i}),(function(r,a,n){var i=(function(){function h(v,c){for(var d=0;d<c.length;d++){var p=c[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(v,p.key,p)}}return function(v,c,d){return c&&h(v.prototype,c),d&&h(v,d),v}})();function o(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}var s=function(v){return{value:v,next:null,prev:null}},u=function(v,c,d,p){return v!==null?v.next=c:p.head=c,d!==null?d.prev=c:p.tail=c,c.prev=v,c.next=d,p.length++,c},l=function(v,c){var d=v.prev,p=v.next;return d!==null?d.next=p:c.head=p,p!==null?p.prev=d:c.tail=d,v.prev=v.next=null,c.length--,v},f=(function(){function h(v){var c=this;o(this,h),this.length=0,this.head=null,this.tail=null,v?.forEach(function(d){return c.push(d)})}return i(h,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(c,d){return u(d.prev,s(c),d,this)}},{key:"insertAfter",value:function(c,d){return u(d,s(c),d.next,this)}},{key:"insertNodeBefore",value:function(c,d){return u(d.prev,c,d,this)}},{key:"insertNodeAfter",value:function(c,d){return u(d,c,d.next,this)}},{key:"push",value:function(c){return u(this.tail,s(c),null,this)}},{key:"unshift",value:function(c){return u(null,s(c),this.head,this)}},{key:"remove",value:function(c){return l(c,this)}},{key:"pop",value:function(){return l(this.tail,this).value}},{key:"popNode",value:function(){return l(this.tail,this)}},{key:"shift",value:function(){return l(this.head,this).value}},{key:"shiftNode",value:function(){return l(this.head,this)}},{key:"get_object_at",value:function(c){if(c<=this.length()){for(var d=1,p=this.head;d<c;)p=p.next,d++;return p.value}}},{key:"set_object_at",value:function(c,d){if(c<=this.length()){for(var p=1,y=this.head;p<c;)y=y.next,p++;y.value=d}}}]),h})();r.exports=f}),(function(r,a,n){function i(o,s,u){this.x=null,this.y=null,o==null&&s==null&&u==null?(this.x=0,this.y=0):typeof o=="number"&&typeof s=="number"&&u==null?(this.x=o,this.y=s):o.constructor.name=="Point"&&s==null&&u==null&&(u=o,this.x=u.x,this.y=u.y)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(o,s,u){o.constructor.name=="Point"&&s==null&&u==null?(u=o,this.setLocation(u.x,u.y)):typeof o=="number"&&typeof s=="number"&&u==null&&(parseInt(o)==o&&parseInt(s)==s?this.move(o,s):(this.x=Math.floor(o+.5),this.y=Math.floor(s+.5)))},i.prototype.move=function(o,s){this.x=o,this.y=s},i.prototype.translate=function(o,s){this.x+=o,this.y+=s},i.prototype.equals=function(o){if(o.constructor.name=="Point"){var s=o;return this.x==s.x&&this.y==s.y}return this==o},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=i}),(function(r,a,n){function i(o,s,u,l){this.x=0,this.y=0,this.width=0,this.height=0,o!=null&&s!=null&&u!=null&&l!=null&&(this.x=o,this.y=s,this.width=u,this.height=l)}i.prototype.getX=function(){return this.x},i.prototype.setX=function(o){this.x=o},i.prototype.getY=function(){return this.y},i.prototype.setY=function(o){this.y=o},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(o){this.width=o},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(o){this.height=o},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(o){return!(this.getRight()<o.x||this.getBottom()<o.y||o.getRight()<this.x||o.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},r.exports=i}),(function(r,a,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function o(){}o.lastID=0,o.createID=function(s){return o.isPrimitive(s)?s:(s.uniqueID!=null||(s.uniqueID=o.getString(),o.lastID++),s.uniqueID)},o.getString=function(s){return s==null&&(s=o.lastID),"Object#"+s},o.isPrimitive=function(s){var u=typeof s>"u"?"undefined":i(s);return s==null||u!="object"&&u!="function"},r.exports=o}),(function(r,a,n){function i(p){if(Array.isArray(p)){for(var y=0,g=Array(p.length);y<p.length;y++)g[y]=p[y];return g}else return Array.from(p)}var o=n(0),s=n(7),u=n(3),l=n(1),f=n(6),h=n(5),v=n(17),c=n(29);function d(p){c.call(this),this.layoutQuality=o.QUALITY,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=o.DEFAULT_INCREMENTAL,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new s(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,p!=null&&(this.isRemoteUse=p)}d.RANDOM_SEED=1,d.prototype=Object.create(c.prototype),d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},d.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},d.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},d.prototype.newGraphManager=function(){var p=new s(this);return this.graphManager=p,p},d.prototype.newGraph=function(p){return new f(null,this.graphManager,p)},d.prototype.newNode=function(p){return new u(this.graphManager,p)},d.prototype.newEdge=function(p){return new l(null,null,p)},d.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},d.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var p;return this.checkLayoutSuccess()?p=!1:p=this.layout(),o.ANIMATE==="during"?!1:(p&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,p)},d.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},d.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var p=this.graphManager.getAllEdges(),y=0;y<p.length;y++)p[y];for(var g=this.graphManager.getRoot().getNodes(),y=0;y<g.length;y++)g[y];this.update(this.graphManager.getRoot())}},d.prototype.update=function(p){if(p==null)this.update2();else if(p instanceof u){var y=p;if(y.getChild()!=null)for(var g=y.getChild().getNodes(),b=0;b<g.length;b++)update(g[b]);if(y.vGraphObject!=null){var m=y.vGraphObject;m.update(y)}}else if(p instanceof l){var w=p;if(w.vGraphObject!=null){var T=w.vGraphObject;T.update(w)}}else if(p instanceof f){var D=p;if(D.vGraphObject!=null){var x=D.vGraphObject;x.update(D)}}},d.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=o.QUALITY,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=o.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},d.prototype.transform=function(p){if(p==null)this.transform(new h(0,0));else{var y=new v,g=this.graphManager.getRoot().updateLeftTop();if(g!=null){y.setWorldOrgX(p.x),y.setWorldOrgY(p.y),y.setDeviceOrgX(g.x),y.setDeviceOrgY(g.y);for(var b=this.getAllNodes(),m,w=0;w<b.length;w++)m=b[w],m.transform(y)}}},d.prototype.positionNodesRandomly=function(p){if(p==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var y,g,b=p.getNodes(),m=0;m<b.length;m++)y=b[m],g=y.getChild(),g==null||g.getNodes().length==0?y.scatter():(this.positionNodesRandomly(g),y.updateBounds())},d.prototype.getFlatForest=function(){for(var p=[],y=!0,g=this.graphManager.getRoot().getNodes(),b=!0,m=0;m<g.length;m++)g[m].getChild()!=null&&(b=!1);if(!b)return p;var w=new Set,T=[],D=new Map,x=[];for(x=x.concat(g);x.length>0&&y;){for(T.push(x[0]);T.length>0&&y;){var N=T[0];T.splice(0,1),w.add(N);for(var O=N.getEdges(),m=0;m<O.length;m++){var R=O[m].getOtherEnd(N);if(D.get(N)!=R)if(!w.has(R))T.push(R),D.set(R,N);else{y=!1;break}}}if(!y)p=[];else{var P=[].concat(i(w));p.push(P);for(var m=0;m<P.length;m++){var M=P[m],I=x.indexOf(M);I>-1&&x.splice(I,1)}w=new Set,D=new Map}}return p},d.prototype.createDummyNodesForBendpoints=function(p){for(var y=[],g=p.source,b=this.graphManager.calcLowestCommonAncestor(p.source,p.target),m=0;m<p.bendpoints.length;m++){var w=this.newNode(null);w.setRect(new Point(0,0),new Dimension(1,1)),b.add(w);var T=this.newEdge(null);this.graphManager.add(T,g,w),y.add(w),g=w}var T=this.newEdge(null);return this.graphManager.add(T,g,p.target),this.edgeToDummyNodes.set(p,y),p.isInterGraph()?this.graphManager.remove(p):b.remove(p),y},d.prototype.createBendpointsFromDummyNodes=function(){var p=[];p=p.concat(this.graphManager.getAllEdges()),p=[].concat(i(this.edgeToDummyNodes.keys())).concat(p);for(var y=0;y<p.length;y++){var g=p[y];if(g.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(g),m=0;m<b.length;m++){var w=b[m],T=new h(w.getCenterX(),w.getCenterY()),D=g.bendpoints.get(m);D.x=T.x,D.y=T.y,w.getOwner().remove(w)}this.graphManager.add(g,g.source,g.target)}}},d.transform=function(p,y,g,b){if(g!=null&&b!=null){var m=y;if(p<=50){var w=y/g;m-=(y-w)/50*(50-p)}else{var T=y*b;m+=(T-y)/50*(p-50)}return m}else{var D,x;return p<=50?(D=9*y/500,x=y/10):(D=9*y/50,x=-8*y),D*p+x}},d.findCenterOfTree=function(p){var y=[];y=y.concat(p);var g=[],b=new Map,m=!1,w=null;(y.length==1||y.length==2)&&(m=!0,w=y[0]);for(var T=0;T<y.length;T++){var D=y[T],x=D.getNeighborsList().size;b.set(D,D.getNeighborsList().size),x==1&&g.push(D)}var N=[];for(N=N.concat(g);!m;){var O=[];O=O.concat(N),N=[];for(var T=0;T<y.length;T++){var D=y[T],R=y.indexOf(D);R>=0&&y.splice(R,1);var P=D.getNeighborsList();P.forEach(function(E){if(g.indexOf(E)<0){var A=b.get(E),C=A-1;C==1&&N.push(E),b.set(E,C)}})}g=g.concat(N),(y.length==1||y.length==2)&&(m=!0,w=y[0])}return w},d.prototype.setGraphManager=function(p){this.graphManager=p},r.exports=d}),(function(r,a,n){function i(){}i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},r.exports=i}),(function(r,a,n){var i=n(5);function o(s,u){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(s){this.lworldExtX=s},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(s){this.lworldExtY=s},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},o.prototype.transformX=function(s){var u=0,l=this.lworldExtX;return l!=0&&(u=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/l),u},o.prototype.transformY=function(s){var u=0,l=this.lworldExtY;return l!=0&&(u=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/l),u},o.prototype.inverseTransformX=function(s){var u=0,l=this.ldeviceExtX;return l!=0&&(u=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/l),u},o.prototype.inverseTransformY=function(s){var u=0,l=this.ldeviceExtY;return l!=0&&(u=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/l),u},o.prototype.inverseTransformPoint=function(s){var u=new i(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return u},r.exports=o}),(function(r,a,n){function i(c){if(Array.isArray(c)){for(var d=0,p=Array(c.length);d<c.length;d++)p[d]=c[d];return p}else return Array.from(c)}var o=n(15),s=n(4),u=n(0),l=n(8),f=n(9);function h(){o.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}h.prototype=Object.create(o.prototype);for(var v in o)h[v]=o[v];h.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var c,d,p,y,g,b,m,w=this.getGraphManager().getAllEdges(),T=0;T<w.length;T++)c=w[T],d=c.idealLength,c.isInterGraph&&(y=c.getSource(),g=c.getTarget(),b=c.getSourceInLca().getEstimatedSize(),m=c.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(c.idealLength+=b+m-2*u.SIMPLE_NODE_SIZE),p=c.getLca().getInclusionTreeDepth(),c.idealLength+=d*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(y.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*p))},h.prototype.initSpringEmbedder=function(){var c=this.getAllNodes().length;this.incremental?(c>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(c-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(c>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(c-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var c=this.getAllEdges(),d,p=0;p<c.length;p++)d=c[p],this.calcSpringForce(d,d.idealLength)},h.prototype.calcRepulsionForces=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p,y,g,b,m=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&c&&this.updateGrid(),w=new Set,p=0;p<m.length;p++)g=m[p],this.calculateRepulsionForceOfANode(g,w,c,d),w.add(g);else for(p=0;p<m.length;p++)for(g=m[p],y=p+1;y<m.length;y++)b=m[y],g.getOwner()==b.getOwner()&&this.calcRepulsionForce(g,b)},h.prototype.calcGravitationalForces=function(){for(var c,d=this.getAllNodesToApplyGravitation(),p=0;p<d.length;p++)c=d[p],this.calcGravitationalForce(c)},h.prototype.moveNodes=function(){for(var c=this.getAllNodes(),d,p=0;p<c.length;p++)d=c[p],d.move()},h.prototype.calcSpringForce=function(c,d){var p=c.getSource(),y=c.getTarget(),g,b,m,w;if(this.uniformLeafNodeSizes&&p.getChild()==null&&y.getChild()==null)c.updateLengthSimple();else if(c.updateLength(),c.isOverlapingSourceAndTarget)return;g=c.getLength(),g!=0&&(b=c.edgeElasticity*(g-d),m=b*(c.lengthX/g),w=b*(c.lengthY/g),p.springForceX+=m,p.springForceY+=w,y.springForceX-=m,y.springForceY-=w)},h.prototype.calcRepulsionForce=function(c,d){var p=c.getRect(),y=d.getRect(),g=new Array(2),b=new Array(4),m,w,T,D,x,N,O;if(p.intersects(y)){l.calcSeparationAmount(p,y,g,s.DEFAULT_EDGE_LENGTH/2),N=2*g[0],O=2*g[1];var R=c.noOfChildren*d.noOfChildren/(c.noOfChildren+d.noOfChildren);c.repulsionForceX-=R*N,c.repulsionForceY-=R*O,d.repulsionForceX+=R*N,d.repulsionForceY+=R*O}else this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null?(m=y.getCenterX()-p.getCenterX(),w=y.getCenterY()-p.getCenterY()):(l.getIntersection(p,y,b),m=b[2]-b[0],w=b[3]-b[1]),Math.abs(m)<s.MIN_REPULSION_DIST&&(m=f.sign(m)*s.MIN_REPULSION_DIST),Math.abs(w)<s.MIN_REPULSION_DIST&&(w=f.sign(w)*s.MIN_REPULSION_DIST),T=m*m+w*w,D=Math.sqrt(T),x=(c.nodeRepulsion/2+d.nodeRepulsion/2)*c.noOfChildren*d.noOfChildren/T,N=x*m/D,O=x*w/D,c.repulsionForceX-=N,c.repulsionForceY-=O,d.repulsionForceX+=N,d.repulsionForceY+=O},h.prototype.calcGravitationalForce=function(c){var d,p,y,g,b,m,w,T;d=c.getOwner(),p=(d.getRight()+d.getLeft())/2,y=(d.getTop()+d.getBottom())/2,g=c.getCenterX()-p,b=c.getCenterY()-y,m=Math.abs(g)+c.getWidth()/2,w=Math.abs(b)+c.getHeight()/2,c.getOwner()==this.graphManager.getRoot()?(T=d.getEstimatedSize()*this.gravityRangeFactor,(m>T||w>T)&&(c.gravitationForceX=-this.gravityConstant*g,c.gravitationForceY=-this.gravityConstant*b)):(T=d.getEstimatedSize()*this.compoundGravityRangeFactor,(m>T||w>T)&&(c.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,c.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},h.prototype.isConverged=function(){var c,d=!1;return this.totalIterations>this.maxIterations/3&&(d=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),c=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,c||d},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var c,d=this.graphManager.getAllNodes(),p=0;p<d.length;p++)c=d[p],c.noOfChildren=c.getNoOfChildren()},h.prototype.calcGrid=function(c){var d=0,p=0;d=parseInt(Math.ceil((c.getRight()-c.getLeft())/this.repulsionRange)),p=parseInt(Math.ceil((c.getBottom()-c.getTop())/this.repulsionRange));for(var y=new Array(d),g=0;g<d;g++)y[g]=new Array(p);for(var g=0;g<d;g++)for(var b=0;b<p;b++)y[g][b]=new Array;return y},h.prototype.addNodeToGrid=function(c,d,p){var y=0,g=0,b=0,m=0;y=parseInt(Math.floor((c.getRect().x-d)/this.repulsionRange)),g=parseInt(Math.floor((c.getRect().width+c.getRect().x-d)/this.repulsionRange)),b=parseInt(Math.floor((c.getRect().y-p)/this.repulsionRange)),m=parseInt(Math.floor((c.getRect().height+c.getRect().y-p)/this.repulsionRange));for(var w=y;w<=g;w++)for(var T=b;T<=m;T++)this.grid[w][T].push(c),c.setGridCoordinates(y,g,b,m)},h.prototype.updateGrid=function(){var c,d,p=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),c=0;c<p.length;c++)d=p[c],this.addNodeToGrid(d,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(c,d,p,y){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&p||y){var g=new Set;c.surrounding=new Array;for(var b,m=this.grid,w=c.startX-1;w<c.finishX+2;w++)for(var T=c.startY-1;T<c.finishY+2;T++)if(!(w<0||T<0||w>=m.length||T>=m[0].length)){for(var D=0;D<m[w][T].length;D++)if(b=m[w][T][D],!(c.getOwner()!=b.getOwner()||c==b)&&!d.has(b)&&!g.has(b)){var x=Math.abs(c.getCenterX()-b.getCenterX())-(c.getWidth()/2+b.getWidth()/2),N=Math.abs(c.getCenterY()-b.getCenterY())-(c.getHeight()/2+b.getHeight()/2);x<=this.repulsionRange&&N<=this.repulsionRange&&g.add(b)}}c.surrounding=[].concat(i(g))}for(w=0;w<c.surrounding.length;w++)this.calcRepulsionForce(c,c.surrounding[w])},h.prototype.calcRepulsionRange=function(){return 0},r.exports=h}),(function(r,a,n){var i=n(1),o=n(4);function s(l,f,h){i.call(this,l,f,h),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];r.exports=s}),(function(r,a,n){var i=n(3),o=n(4);function s(l,f,h,v){i.call(this,l,f,h,v),this.nodeRepulsion=o.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];s.prototype.setGridCoordinates=function(l,f,h,v){this.startX=l,this.finishX=f,this.startY=h,this.finishY=v},r.exports=s}),(function(r,a,n){function i(o,s){this.width=0,this.height=0,o!==null&&s!==null&&(this.height=s,this.width=o)}i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(o){this.width=o},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(o){this.height=o},r.exports=i}),(function(r,a,n){var i=n(14);function o(){this.map={},this.keys=[]}o.prototype.put=function(s,u){var l=i.createID(s);this.contains(l)||(this.map[l]=u,this.keys.push(s))},o.prototype.contains=function(s){return i.createID(s),this.map[s]!=null},o.prototype.get=function(s){var u=i.createID(s);return this.map[u]},o.prototype.keySet=function(){return this.keys},r.exports=o}),(function(r,a,n){var i=n(14);function o(){this.set={}}o.prototype.add=function(s){var u=i.createID(s);this.contains(u)||(this.set[u]=s)},o.prototype.remove=function(s){delete this.set[i.createID(s)]},o.prototype.clear=function(){this.set={}},o.prototype.contains=function(s){return this.set[i.createID(s)]==s},o.prototype.isEmpty=function(){return this.size()===0},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAllTo=function(s){for(var u=Object.keys(this.set),l=u.length,f=0;f<l;f++)s.push(this.set[u[f]])},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAll=function(s){for(var u=s.length,l=0;l<u;l++){var f=s[l];this.add(f)}},r.exports=o}),(function(r,a,n){function i(){}i.multMat=function(o,s){for(var u=[],l=0;l<o.length;l++){u[l]=[];for(var f=0;f<s[0].length;f++){u[l][f]=0;for(var h=0;h<o[0].length;h++)u[l][f]+=o[l][h]*s[h][f]}}return u},i.transpose=function(o){for(var s=[],u=0;u<o[0].length;u++){s[u]=[];for(var l=0;l<o.length;l++)s[u][l]=o[l][u]}return s},i.multCons=function(o,s){for(var u=[],l=0;l<o.length;l++)u[l]=o[l]*s;return u},i.minusOp=function(o,s){for(var u=[],l=0;l<o.length;l++)u[l]=o[l]-s[l];return u},i.dotProduct=function(o,s){for(var u=0,l=0;l<o.length;l++)u+=o[l]*s[l];return u},i.mag=function(o){return Math.sqrt(this.dotProduct(o,o))},i.normalize=function(o){for(var s=[],u=this.mag(o),l=0;l<o.length;l++)s[l]=o[l]/u;return s},i.multGamma=function(o){for(var s=[],u=0,l=0;l<o.length;l++)u+=o[l];u*=-1/o.length;for(var f=0;f<o.length;f++)s[f]=u+o[f];return s},i.multL=function(o,s,u){for(var l=[],f=[],h=[],v=0;v<s[0].length;v++){for(var c=0,d=0;d<s.length;d++)c+=-.5*s[d][v]*o[d];f[v]=c}for(var p=0;p<u.length;p++){for(var y=0,g=0;g<u.length;g++)y+=u[p][g]*f[g];h[p]=y}for(var b=0;b<s.length;b++){for(var m=0,w=0;w<s[0].length;w++)m+=s[b][w]*h[w];l[b]=m}return l},r.exports=i}),(function(r,a,n){var i=(function(){function l(f,h){for(var v=0;v<h.length;v++){var c=h[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(f,c.key,c)}}return function(f,h,v){return h&&l(f.prototype,h),v&&l(f,v),f}})();function o(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}var s=n(11),u=(function(){function l(f,h){o(this,l),(h!==null||h!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var v=void 0;f instanceof s?v=f.size():v=f.length,this._quicksort(f,0,v-1)}return i(l,[{key:"_quicksort",value:function(h,v,c){if(v<c){var d=this._partition(h,v,c);this._quicksort(h,v,d),this._quicksort(h,d+1,c)}}},{key:"_partition",value:function(h,v,c){for(var d=this._get(h,v),p=v,y=c;;){for(;this.compareFunction(d,this._get(h,y));)y--;for(;this.compareFunction(this._get(h,p),d);)p++;if(p<y)this._swap(h,p,y),p++,y--;else return y}}},{key:"_get",value:function(h,v){return h instanceof s?h.get_object_at(v):h[v]}},{key:"_set",value:function(h,v,c){h instanceof s?h.set_object_at(v,c):h[v]=c}},{key:"_swap",value:function(h,v,c){var d=this._get(h,v);this._set(h,v,this._get(h,c)),this._set(h,c,d)}},{key:"_defaultCompareFunction",value:function(h,v){return v>h}}]),l})();r.exports=u}),(function(r,a,n){function i(){}i.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var s=Math.min(this.m,this.n);this.s=(function(Re){for(var Ve=[];Re-- >0;)Ve.push(0);return Ve})(Math.min(this.m+1,this.n)),this.U=(function(Re){var Ve=function He(Ze){if(Ze.length==0)return 0;for(var tt=[],Xe=0;Xe<Ze[0];Xe++)tt.push(He(Ze.slice(1)));return tt};return Ve(Re)})([this.m,s]),this.V=(function(Re){var Ve=function He(Ze){if(Ze.length==0)return 0;for(var tt=[],Xe=0;Xe<Ze[0];Xe++)tt.push(He(Ze.slice(1)));return tt};return Ve(Re)})([this.n,this.n]);for(var u=(function(Re){for(var Ve=[];Re-- >0;)Ve.push(0);return Ve})(this.n),l=(function(Re){for(var Ve=[];Re-- >0;)Ve.push(0);return Ve})(this.m),f=!0,h=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m)),c=0;c<Math.max(h,v);c++){if(c<h){this.s[c]=0;for(var d=c;d<this.m;d++)this.s[c]=i.hypot(this.s[c],o[d][c]);if(this.s[c]!==0){o[c][c]<0&&(this.s[c]=-this.s[c]);for(var p=c;p<this.m;p++)o[p][c]/=this.s[c];o[c][c]+=1}this.s[c]=-this.s[c]}for(var y=c+1;y<this.n;y++){if((function(Re,Ve){return Re&&Ve})(c<h,this.s[c]!==0)){for(var g=0,b=c;b<this.m;b++)g+=o[b][c]*o[b][y];g=-g/o[c][c];for(var m=c;m<this.m;m++)o[m][y]+=g*o[m][c]}u[y]=o[c][y]}if((function(Re,Ve){return Ve})(f,c<h))for(var w=c;w<this.m;w++)this.U[w][c]=o[w][c];if(c<v){u[c]=0;for(var T=c+1;T<this.n;T++)u[c]=i.hypot(u[c],u[T]);if(u[c]!==0){u[c+1]<0&&(u[c]=-u[c]);for(var D=c+1;D<this.n;D++)u[D]/=u[c];u[c+1]+=1}if(u[c]=-u[c],(function(Re,Ve){return Re&&Ve})(c+1<this.m,u[c]!==0)){for(var x=c+1;x<this.m;x++)l[x]=0;for(var N=c+1;N<this.n;N++)for(var O=c+1;O<this.m;O++)l[O]+=u[N]*o[O][N];for(var R=c+1;R<this.n;R++)for(var P=-u[R]/u[c+1],M=c+1;M<this.m;M++)o[M][R]+=P*l[M]}for(var I=c+1;I<this.n;I++)this.V[I][c]=u[I]}}var E=Math.min(this.n,this.m+1);h<this.n&&(this.s[h]=o[h][h]),this.m<E&&(this.s[E-1]=0),v+1<E&&(u[v]=o[v][E-1]),u[E-1]=0;{for(var A=h;A<s;A++){for(var C=0;C<this.m;C++)this.U[C][A]=0;this.U[A][A]=1}for(var S=h-1;S>=0;S--)if(this.s[S]!==0){for(var L=S+1;L<s;L++){for(var V=0,F=S;F<this.m;F++)V+=this.U[F][S]*this.U[F][L];V=-V/this.U[S][S];for(var B=S;B<this.m;B++)this.U[B][L]+=V*this.U[B][S]}for(var Y=S;Y<this.m;Y++)this.U[Y][S]=-this.U[Y][S];this.U[S][S]=1+this.U[S][S];for(var q=0;q<S-1;q++)this.U[q][S]=0}else{for(var Q=0;Q<this.m;Q++)this.U[Q][S]=0;this.U[S][S]=1}}for(var $=this.n-1;$>=0;$--){if((function(Re,Ve){return Re&&Ve})($<v,u[$]!==0))for(var K=$+1;K<s;K++){for(var j=0,re=$+1;re<this.n;re++)j+=this.V[re][$]*this.V[re][K];j=-j/this.V[$+1][$];for(var U=$+1;U<this.n;U++)this.V[U][K]+=j*this.V[U][$]}for(var H=0;H<this.n;H++)this.V[H][$]=0;this.V[$][$]=1}for(var _=E-1,W=Math.pow(2,-52),J=Math.pow(2,-966);E>0;){var te=void 0,de=void 0;for(te=E-2;te>=-1&&te!==-1;te--)if(Math.abs(u[te])<=J+W*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){u[te]=0;break}if(te===E-2)de=4;else{var Te=void 0;for(Te=E-1;Te>=te&&Te!==te;Te--){var ge=(Te!==E?Math.abs(u[Te]):0)+(Te!==te+1?Math.abs(u[Te-1]):0);if(Math.abs(this.s[Te])<=J+W*ge){this.s[Te]=0;break}}Te===te?de=3:Te===E-1?de=1:(de=2,te=Te)}switch(te++,de){case 1:{var le=u[E-2];u[E-2]=0;for(var he=E-2;he>=te;he--){var fe=i.hypot(this.s[he],le),ve=this.s[he]/fe,ye=le/fe;this.s[he]=fe,he!==te&&(le=-ye*u[he-1],u[he-1]=ve*u[he-1]);for(var me=0;me<this.n;me++)fe=ve*this.V[me][he]+ye*this.V[me][E-1],this.V[me][E-1]=-ye*this.V[me][he]+ve*this.V[me][E-1],this.V[me][he]=fe}}break;case 2:{var xe=u[te-1];u[te-1]=0;for(var Le=te;Le<E;Le++){var ke=i.hypot(this.s[Le],xe),Fe=this.s[Le]/ke,Be=xe/ke;this.s[Le]=ke,xe=-Be*u[Le],u[Le]=Fe*u[Le];for(var Oe=0;Oe<this.m;Oe++)ke=Fe*this.U[Oe][Le]+Be*this.U[Oe][te-1],this.U[Oe][te-1]=-Be*this.U[Oe][Le]+Fe*this.U[Oe][te-1],this.U[Oe][Le]=ke}}break;case 3:{var ne=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[E-1]),Math.abs(this.s[E-2])),Math.abs(u[E-2])),Math.abs(this.s[te])),Math.abs(u[te])),k=this.s[E-1]/ne,z=this.s[E-2]/ne,G=u[E-2]/ne,X=this.s[te]/ne,Z=u[te]/ne,ae=((z+k)*(z-k)+G*G)/2,ee=k*G*(k*G),ie=0;(function(Re,Ve){return Re||Ve})(ae!==0,ee!==0)&&(ie=Math.sqrt(ae*ae+ee),ae<0&&(ie=-ie),ie=ee/(ae+ie));for(var se=(X+k)*(X-k)+ie,oe=X*Z,ue=te;ue<E-1;ue++){var pe=i.hypot(se,oe),ce=se/pe,we=oe/pe;ue!==te&&(u[ue-1]=pe),se=ce*this.s[ue]+we*u[ue],u[ue]=ce*u[ue]-we*this.s[ue],oe=we*this.s[ue+1],this.s[ue+1]=ce*this.s[ue+1];for(var Ne=0;Ne<this.n;Ne++)pe=ce*this.V[Ne][ue]+we*this.V[Ne][ue+1],this.V[Ne][ue+1]=-we*this.V[Ne][ue]+ce*this.V[Ne][ue+1],this.V[Ne][ue]=pe;if(pe=i.hypot(se,oe),ce=se/pe,we=oe/pe,this.s[ue]=pe,se=ce*u[ue]+we*this.s[ue+1],this.s[ue+1]=-we*u[ue]+ce*this.s[ue+1],oe=we*u[ue+1],u[ue+1]=ce*u[ue+1],ue<this.m-1)for(var De=0;De<this.m;De++)pe=ce*this.U[De][ue]+we*this.U[De][ue+1],this.U[De][ue+1]=-we*this.U[De][ue]+ce*this.U[De][ue+1],this.U[De][ue]=pe}u[E-2]=se}break;case 4:{if(this.s[te]<=0){this.s[te]=this.s[te]<0?-this.s[te]:0;for(var Ee=0;Ee<=_;Ee++)this.V[Ee][te]=-this.V[Ee][te]}for(;te<_&&!(this.s[te]>=this.s[te+1]);){var ze=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=ze,te<this.n-1)for(var Ce=0;Ce<this.n;Ce++)ze=this.V[Ce][te+1],this.V[Ce][te+1]=this.V[Ce][te],this.V[Ce][te]=ze;if(te<this.m-1)for(var Se=0;Se<this.m;Se++)ze=this.U[Se][te+1],this.U[Se][te+1]=this.U[Se][te],this.U[Se][te]=ze;te++}E--}break}}var Ue={U:this.U,V:this.V,S:this.s};return Ue},i.hypot=function(o,s){var u=void 0;return Math.abs(o)>Math.abs(s)?(u=s/o,u=Math.abs(o)*Math.sqrt(1+u*u)):s!=0?(u=o/s,u=Math.abs(s)*Math.sqrt(1+u*u)):u=0,u},r.exports=i}),(function(r,a,n){var i=(function(){function u(l,f){for(var h=0;h<f.length;h++){var v=f[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(l,v.key,v)}}return function(l,f,h){return f&&u(l.prototype,f),h&&u(l,h),l}})();function o(u,l){if(!(u instanceof l))throw new TypeError("Cannot call a class as a function")}var s=(function(){function u(l,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,u),this.sequence1=l,this.sequence2=f,this.match_score=h,this.mismatch_penalty=v,this.gap_penalty=c,this.iMax=l.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var d=0;d<this.iMax;d++){this.grid[d]=new Array(this.jMax);for(var p=0;p<this.jMax;p++)this.grid[d][p]=0}this.tracebackGrid=new Array(this.iMax);for(var y=0;y<this.iMax;y++){this.tracebackGrid[y]=new Array(this.jMax);for(var g=0;g<this.jMax;g++)this.tracebackGrid[y][g]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return i(u,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var h=1;h<this.iMax;h++)this.grid[h][0]=this.grid[h-1][0]+this.gap_penalty,this.tracebackGrid[h][0]=[!1,!0,!1];for(var v=1;v<this.iMax;v++)for(var c=1;c<this.jMax;c++){var d=void 0;this.sequence1[v-1]===this.sequence2[c-1]?d=this.grid[v-1][c-1]+this.match_score:d=this.grid[v-1][c-1]+this.mismatch_penalty;var p=this.grid[v-1][c]+this.gap_penalty,y=this.grid[v][c-1]+this.gap_penalty,g=[d,p,y],b=this.arrayAllMaxIndexes(g);this.grid[v][c]=g[b[0]],this.tracebackGrid[v][c]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var h=f[0],v=this.tracebackGrid[h.pos[0]][h.pos[1]];v[0]&&f.push({pos:[h.pos[0]-1,h.pos[1]-1],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),v[1]&&f.push({pos:[h.pos[0]-1,h.pos[1]],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:"-"+h.seq2}),v[2]&&f.push({pos:[h.pos[0],h.pos[1]-1],seq1:"-"+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),h.pos[0]===0&&h.pos[1]===0&&this.alignments.push({sequence1:h.seq1,sequence2:h.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,h){for(var v=[],c=-1;(c=f.indexOf(h,c+1))!==-1;)v.push(c);return v}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),u})();r.exports=s}),(function(r,a,n){var i=function(){};i.FDLayout=n(18),i.FDLayoutConstants=n(4),i.FDLayoutEdge=n(19),i.FDLayoutNode=n(20),i.DimensionD=n(21),i.HashMap=n(22),i.HashSet=n(23),i.IGeometry=n(8),i.IMath=n(9),i.Integer=n(10),i.Point=n(12),i.PointD=n(5),i.RandomSeed=n(16),i.RectangleD=n(13),i.Transform=n(17),i.UniqueIDGeneretor=n(14),i.Quicksort=n(25),i.LinkedList=n(11),i.LGraphObject=n(2),i.LGraph=n(6),i.LEdge=n(1),i.LGraphManager=n(7),i.LNode=n(3),i.Layout=n(15),i.LayoutConstants=n(0),i.NeedlemanWunsch=n(27),i.Matrix=n(24),i.SVD=n(26),r.exports=i}),(function(r,a,n){function i(){this.listeners=[]}var o=i.prototype;o.addListener=function(s,u){this.listeners.push({event:s,callback:u})},o.removeListener=function(s,u){for(var l=this.listeners.length;l>=0;l--){var f=this.listeners[l];f.event===s&&f.callback===u&&this.listeners.splice(l,1)}},o.emit=function(s,u){for(var l=0;l<this.listeners.length;l++){var f=this.listeners[l];s===f.event&&f.callback(u)}},r.exports=i})])})})(Xn)),Xn.exports}var F1=Wn.exports,ph;function z1(){return ph||(ph=1,(function(t,e){(function(a,n){t.exports=n(B1())})(F1,function(r){return(()=>{var a={45:((s,u,l)=>{var f={};f.layoutBase=l(551),f.CoSEConstants=l(806),f.CoSEEdge=l(767),f.CoSEGraph=l(880),f.CoSEGraphManager=l(578),f.CoSELayout=l(765),f.CoSENode=l(991),f.ConstraintHandler=l(902),s.exports=f}),806:((s,u,l)=>{var f=l(551).FDLayoutConstants;function h(){}for(var v in f)h[v]=f[v];h.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,h.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,h.DEFAULT_COMPONENT_SEPERATION=60,h.TILE=!0,h.TILING_PADDING_VERTICAL=10,h.TILING_PADDING_HORIZONTAL=10,h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0,h.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,h.TREE_REDUCTION_ON_INCREMENTAL=!0,h.PURE_INCREMENTAL=h.DEFAULT_INCREMENTAL,s.exports=h}),767:((s,u,l)=>{var f=l(551).FDLayoutEdge;function h(c,d,p){f.call(this,c,d,p)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),880:((s,u,l)=>{var f=l(551).LGraph;function h(c,d,p){f.call(this,c,d,p)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),578:((s,u,l)=>{var f=l(551).LGraphManager;function h(c){f.call(this,c)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),765:((s,u,l)=>{var f=l(551).FDLayout,h=l(578),v=l(880),c=l(991),d=l(767),p=l(806),y=l(902),g=l(551).FDLayoutConstants,b=l(551).LayoutConstants,m=l(551).Point,w=l(551).PointD,T=l(551).DimensionD,D=l(551).Layout,x=l(551).Integer,N=l(551).IGeometry,O=l(551).LGraph,R=l(551).Transform,P=l(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var I in f)M[I]=f[I];M.prototype.newGraphManager=function(){var E=new h(this);return this.graphManager=E,E},M.prototype.newGraph=function(E){return new v(null,this.graphManager,E)},M.prototype.newNode=function(E){return new c(this.graphManager,E)},M.prototype.newEdge=function(E){return new d(null,null,E)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(p.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=p.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=p.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var E=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return E&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(p.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(V){return A.has(V)});this.graphManager.setAllNodesToApplyGravitation(C)}}else{var E=this.getFlatForest();if(E.length>0)this.positionNodesRadially(E);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(S){return A.has(S)});this.graphManager.setAllNodesToApplyGravitation(C),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),p.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(L){return E.has(L)});this.graphManager.setAllNodesToApplyGravitation(A),this.graphManager.updateBounds(),this.updateGrid(),p.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),p.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var C=!this.isTreeGrowing&&!this.isGrowthFinished,S=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(C,S),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var E=this.graphManager.getAllNodes(),A={},C=0;C<E.length;C++){var S=E[C].rect,L=E[C].id;A[L]={id:L,x:S.getCenterX(),y:S.getCenterY(),w:S.width,h:S.height}}return A},M.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var E=!1;if(g.ANIMATE==="during")this.emit("layoutstarted");else{for(;!E;)E=this.tick();this.graphManager.updateBounds()}},M.prototype.moveNodes=function(){for(var E=this.getAllNodes(),A,C=0;C<E.length;C++)A=E[C],A.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var C=0;C<E.length;C++)A=E[C],A.move()},M.prototype.initConstraintVariables=function(){var E=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var A=this.graphManager.getAllNodes(),C=0;C<A.length;C++){var S=A[C];this.idToNodeMap.set(S.id,S)}var L=function U(H){for(var _=H.getChild().getNodes(),W,J=0,te=0;te<_.length;te++)W=_[te],W.getChild()==null?E.fixedNodeSet.has(W.id)&&(J+=100):J+=U(W);return J};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(_){E.fixedNodeSet.add(_.nodeId)});for(var A=this.graphManager.getAllNodes(),S,C=0;C<A.length;C++)if(S=A[C],S.getChild()!=null){var V=L(S);V>0&&(S.fixedNodeWeight=V)}}if(this.constraints.relativePlacementConstraint){var F=new Map,B=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(U){E.fixedNodesOnHorizontal.add(U),E.fixedNodesOnVertical.add(U)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var Y=this.constraints.alignmentConstraint.vertical,C=0;C<Y.length;C++)this.dummyToNodeForVerticalAlignment.set("dummy"+C,[]),Y[C].forEach(function(H){F.set(H,"dummy"+C),E.dummyToNodeForVerticalAlignment.get("dummy"+C).push(H),E.fixedNodeSet.has(H)&&E.fixedNodesOnHorizontal.add("dummy"+C)});if(this.constraints.alignmentConstraint.horizontal)for(var q=this.constraints.alignmentConstraint.horizontal,C=0;C<q.length;C++)this.dummyToNodeForHorizontalAlignment.set("dummy"+C,[]),q[C].forEach(function(H){B.set(H,"dummy"+C),E.dummyToNodeForHorizontalAlignment.get("dummy"+C).push(H),E.fixedNodeSet.has(H)&&E.fixedNodesOnVertical.add("dummy"+C)})}if(p.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(U){var H,_,W;for(W=U.length-1;W>=2*U.length/3;W--)H=Math.floor(Math.random()*(W+1)),_=U[W],U[W]=U[H],U[H]=_;return U},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(U){if(U.left){var H=F.has(U.left)?F.get(U.left):U.left,_=F.has(U.right)?F.get(U.right):U.right;E.nodesInRelativeHorizontal.includes(H)||(E.nodesInRelativeHorizontal.push(H),E.nodeToRelativeConstraintMapHorizontal.set(H,[]),E.dummyToNodeForVerticalAlignment.has(H)?E.nodeToTempPositionMapHorizontal.set(H,E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):E.nodeToTempPositionMapHorizontal.set(H,E.idToNodeMap.get(H).getCenterX())),E.nodesInRelativeHorizontal.includes(_)||(E.nodesInRelativeHorizontal.push(_),E.nodeToRelativeConstraintMapHorizontal.set(_,[]),E.dummyToNodeForVerticalAlignment.has(_)?E.nodeToTempPositionMapHorizontal.set(_,E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get(_)[0]).getCenterX()):E.nodeToTempPositionMapHorizontal.set(_,E.idToNodeMap.get(_).getCenterX())),E.nodeToRelativeConstraintMapHorizontal.get(H).push({right:_,gap:U.gap}),E.nodeToRelativeConstraintMapHorizontal.get(_).push({left:H,gap:U.gap})}else{var W=B.has(U.top)?B.get(U.top):U.top,J=B.has(U.bottom)?B.get(U.bottom):U.bottom;E.nodesInRelativeVertical.includes(W)||(E.nodesInRelativeVertical.push(W),E.nodeToRelativeConstraintMapVertical.set(W,[]),E.dummyToNodeForHorizontalAlignment.has(W)?E.nodeToTempPositionMapVertical.set(W,E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(W)[0]).getCenterY()):E.nodeToTempPositionMapVertical.set(W,E.idToNodeMap.get(W).getCenterY())),E.nodesInRelativeVertical.includes(J)||(E.nodesInRelativeVertical.push(J),E.nodeToRelativeConstraintMapVertical.set(J,[]),E.dummyToNodeForHorizontalAlignment.has(J)?E.nodeToTempPositionMapVertical.set(J,E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):E.nodeToTempPositionMapVertical.set(J,E.idToNodeMap.get(J).getCenterY())),E.nodeToRelativeConstraintMapVertical.get(W).push({bottom:J,gap:U.gap}),E.nodeToRelativeConstraintMapVertical.get(J).push({top:W,gap:U.gap})}});else{var Q=new Map,$=new Map;this.constraints.relativePlacementConstraint.forEach(function(U){if(U.left){var H=F.has(U.left)?F.get(U.left):U.left,_=F.has(U.right)?F.get(U.right):U.right;Q.has(H)?Q.get(H).push(_):Q.set(H,[_]),Q.has(_)?Q.get(_).push(H):Q.set(_,[H])}else{var W=B.has(U.top)?B.get(U.top):U.top,J=B.has(U.bottom)?B.get(U.bottom):U.bottom;$.has(W)?$.get(W).push(J):$.set(W,[J]),$.has(J)?$.get(J).push(W):$.set(J,[W])}});var K=function(H,_){var W=[],J=[],te=new P,de=new Set,Te=0;return H.forEach(function(ge,le){if(!de.has(le)){W[Te]=[],J[Te]=!1;var he=le;for(te.push(he),de.add(he),W[Te].push(he);te.length!=0;){he=te.shift(),_.has(he)&&(J[Te]=!0);var fe=H.get(he);fe.forEach(function(ve){de.has(ve)||(te.push(ve),de.add(ve),W[Te].push(ve))})}Te++}}),{components:W,isFixed:J}},j=K(Q,E.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var re=K($,E.fixedNodesOnVertical);this.componentsOnVertical=re.components,this.fixedComponentsOnVertical=re.isFixed}}},M.prototype.updateDisplacements=function(){var E=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(re){var U=E.idToNodeMap.get(re.nodeId);U.displacementX=0,U.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var A=this.constraints.alignmentConstraint.vertical,C=0;C<A.length;C++){for(var S=0,L=0;L<A[C].length;L++){if(this.fixedNodeSet.has(A[C][L])){S=0;break}S+=this.idToNodeMap.get(A[C][L]).displacementX}for(var V=S/A[C].length,L=0;L<A[C].length;L++)this.idToNodeMap.get(A[C][L]).displacementX=V}if(this.constraints.alignmentConstraint.horizontal)for(var F=this.constraints.alignmentConstraint.horizontal,C=0;C<F.length;C++){for(var B=0,L=0;L<F[C].length;L++){if(this.fixedNodeSet.has(F[C][L])){B=0;break}B+=this.idToNodeMap.get(F[C][L]).displacementY}for(var Y=B/F[C].length,L=0;L<F[C].length;L++)this.idToNodeMap.get(F[C][L]).displacementY=Y}}if(this.constraints.relativePlacementConstraint)if(p.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(re){if(!E.fixedNodesOnHorizontal.has(re)){var U=0;E.dummyToNodeForVerticalAlignment.has(re)?U=E.idToNodeMap.get(E.dummyToNodeForVerticalAlignment.get(re)[0]).displacementX:U=E.idToNodeMap.get(re).displacementX,E.nodeToRelativeConstraintMapHorizontal.get(re).forEach(function(H){if(H.right){var _=E.nodeToTempPositionMapHorizontal.get(H.right)-E.nodeToTempPositionMapHorizontal.get(re)-U;_<H.gap&&(U-=H.gap-_)}else{var _=E.nodeToTempPositionMapHorizontal.get(re)-E.nodeToTempPositionMapHorizontal.get(H.left)+U;_<H.gap&&(U+=H.gap-_)}}),E.nodeToTempPositionMapHorizontal.set(re,E.nodeToTempPositionMapHorizontal.get(re)+U),E.dummyToNodeForVerticalAlignment.has(re)?E.dummyToNodeForVerticalAlignment.get(re).forEach(function(H){E.idToNodeMap.get(H).displacementX=U}):E.idToNodeMap.get(re).displacementX=U}}),this.nodesInRelativeVertical.forEach(function(re){if(!E.fixedNodesOnHorizontal.has(re)){var U=0;E.dummyToNodeForHorizontalAlignment.has(re)?U=E.idToNodeMap.get(E.dummyToNodeForHorizontalAlignment.get(re)[0]).displacementY:U=E.idToNodeMap.get(re).displacementY,E.nodeToRelativeConstraintMapVertical.get(re).forEach(function(H){if(H.bottom){var _=E.nodeToTempPositionMapVertical.get(H.bottom)-E.nodeToTempPositionMapVertical.get(re)-U;_<H.gap&&(U-=H.gap-_)}else{var _=E.nodeToTempPositionMapVertical.get(re)-E.nodeToTempPositionMapVertical.get(H.top)+U;_<H.gap&&(U+=H.gap-_)}}),E.nodeToTempPositionMapVertical.set(re,E.nodeToTempPositionMapVertical.get(re)+U),E.dummyToNodeForHorizontalAlignment.has(re)?E.dummyToNodeForHorizontalAlignment.get(re).forEach(function(H){E.idToNodeMap.get(H).displacementY=U}):E.idToNodeMap.get(re).displacementY=U}});else{for(var C=0;C<this.componentsOnHorizontal.length;C++){var q=this.componentsOnHorizontal[C];if(this.fixedComponentsOnHorizontal[C])for(var L=0;L<q.length;L++)this.dummyToNodeForVerticalAlignment.has(q[L])?this.dummyToNodeForVerticalAlignment.get(q[L]).forEach(function(H){E.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(q[L]).displacementX=0;else{for(var Q=0,$=0,L=0;L<q.length;L++)if(this.dummyToNodeForVerticalAlignment.has(q[L])){var K=this.dummyToNodeForVerticalAlignment.get(q[L]);Q+=K.length*this.idToNodeMap.get(K[0]).displacementX,$+=K.length}else Q+=this.idToNodeMap.get(q[L]).displacementX,$++;for(var j=Q/$,L=0;L<q.length;L++)this.dummyToNodeForVerticalAlignment.has(q[L])?this.dummyToNodeForVerticalAlignment.get(q[L]).forEach(function(H){E.idToNodeMap.get(H).displacementX=j}):this.idToNodeMap.get(q[L]).displacementX=j}}for(var C=0;C<this.componentsOnVertical.length;C++){var q=this.componentsOnVertical[C];if(this.fixedComponentsOnVertical[C])for(var L=0;L<q.length;L++)this.dummyToNodeForHorizontalAlignment.has(q[L])?this.dummyToNodeForHorizontalAlignment.get(q[L]).forEach(function(_){E.idToNodeMap.get(_).displacementY=0}):this.idToNodeMap.get(q[L]).displacementY=0;else{for(var Q=0,$=0,L=0;L<q.length;L++)if(this.dummyToNodeForHorizontalAlignment.has(q[L])){var K=this.dummyToNodeForHorizontalAlignment.get(q[L]);Q+=K.length*this.idToNodeMap.get(K[0]).displacementY,$+=K.length}else Q+=this.idToNodeMap.get(q[L]).displacementY,$++;for(var j=Q/$,L=0;L<q.length;L++)this.dummyToNodeForHorizontalAlignment.has(q[L])?this.dummyToNodeForHorizontalAlignment.get(q[L]).forEach(function(te){E.idToNodeMap.get(te).displacementY=j}):this.idToNodeMap.get(q[L]).displacementY=j}}}},M.prototype.calculateNodesToApplyGravitationTo=function(){var E=[],A,C=this.graphManager.getGraphs(),S=C.length,L;for(L=0;L<S;L++)A=C[L],A.updateConnected(),A.isConnected||(E=E.concat(A.getNodes()));return E},M.prototype.createBendpoints=function(){var E=[];E=E.concat(this.graphManager.getAllEdges());var A=new Set,C;for(C=0;C<E.length;C++){var S=E[C];if(!A.has(S)){var L=S.getSource(),V=S.getTarget();if(L==V)S.getBendpoints().push(new w),S.getBendpoints().push(new w),this.createDummyNodesForBendpoints(S),A.add(S);else{var F=[];if(F=F.concat(L.getEdgeListToNode(V)),F=F.concat(V.getEdgeListToNode(L)),!A.has(F[0])){if(F.length>1){var B;for(B=0;B<F.length;B++){var Y=F[B];Y.getBendpoints().push(new w),this.createDummyNodesForBendpoints(Y)}}F.forEach(function(q){A.add(q)})}}}if(A.size==E.length)break}},M.prototype.positionNodesRadially=function(E){for(var A=new m(0,0),C=Math.ceil(Math.sqrt(E.length)),S=0,L=0,V=0,F=new w(0,0),B=0;B<E.length;B++){B%C==0&&(V=0,L=S,B!=0&&(L+=p.DEFAULT_COMPONENT_SEPERATION),S=0);var Y=E[B],q=D.findCenterOfTree(Y);A.x=V,A.y=L,F=M.radialLayout(Y,q,A),F.y>S&&(S=Math.floor(F.y)),V=Math.floor(F.x+p.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(b.WORLD_CENTER_X-F.x/2,b.WORLD_CENTER_Y-F.y/2))},M.radialLayout=function(E,A,C){var S=Math.max(this.maxDiagonalInTree(E),p.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(A,null,0,359,0,S);var L=O.calculateBounds(E),V=new R;V.setDeviceOrgX(L.getMinX()),V.setDeviceOrgY(L.getMinY()),V.setWorldOrgX(C.x),V.setWorldOrgY(C.y);for(var F=0;F<E.length;F++){var B=E[F];B.transform(V)}var Y=new w(L.getMaxX(),L.getMaxY());return V.inverseTransformPoint(Y)},M.branchRadialLayout=function(E,A,C,S,L,V){var F=(S-C+1)/2;F<0&&(F+=180);var B=(F+C)%360,Y=B*N.TWO_PI/360,q=L*Math.cos(Y),Q=L*Math.sin(Y);E.setCenter(q,Q);var $=[];$=$.concat(E.getEdges());var K=$.length;A!=null&&K--;for(var j=0,re=$.length,U,H=E.getEdgesBetween(A);H.length>1;){var _=H[0];H.splice(0,1);var W=$.indexOf(_);W>=0&&$.splice(W,1),re--,K--}A!=null?U=($.indexOf(H[0])+1)%re:U=0;for(var J=Math.abs(S-C)/K,te=U;j!=K;te=++te%re){var de=$[te].getOtherEnd(E);if(de!=A){var Te=(C+j*J)%360,ge=(Te+J)%360;M.branchRadialLayout(de,E,Te,ge,L+V,V),j++}}},M.maxDiagonalInTree=function(E){for(var A=x.MIN_VALUE,C=0;C<E.length;C++){var S=E[C],L=S.getDiagonal();L>A&&(A=L)}return A},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var E=this,A={};this.memberGroups={},this.idToDummyNode={};for(var C=[],S=this.graphManager.getAllNodes(),L=0;L<S.length;L++){var V=S[L],F=V.getParent();this.getNodeDegreeWithChildren(V)===0&&(F.id==null||!this.getToBeTiled(F))&&C.push(V)}for(var L=0;L<C.length;L++){var V=C[L],B=V.getParent().id;typeof A[B]>"u"&&(A[B]=[]),A[B]=A[B].concat(V)}Object.keys(A).forEach(function(Y){if(A[Y].length>1){var q="DummyCompound_"+Y;E.memberGroups[q]=A[Y];var Q=A[Y][0].getParent(),$=new c(E.graphManager);$.id=q,$.paddingLeft=Q.paddingLeft||0,$.paddingRight=Q.paddingRight||0,$.paddingBottom=Q.paddingBottom||0,$.paddingTop=Q.paddingTop||0,E.idToDummyNode[q]=$;var K=E.getGraphManager().add(E.newGraph(),$),j=Q.getChild();j.add($);for(var re=0;re<A[Y].length;re++){var U=A[Y][re];j.remove(U),K.add(U)}}})},M.prototype.clearCompounds=function(){var E={},A={};this.performDFSOnCompounds();for(var C=0;C<this.compoundOrder.length;C++)A[this.compoundOrder[C].id]=this.compoundOrder[C],E[this.compoundOrder[C].id]=[].concat(this.compoundOrder[C].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[C].getChild()),this.compoundOrder[C].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(E,A)},M.prototype.clearZeroDegreeMembers=function(){var E=this,A=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(C){var S=E.idToDummyNode[C];if(A[C]=E.tileNodes(E.memberGroups[C],S.paddingLeft+S.paddingRight),S.rect.width=A[C].width,S.rect.height=A[C].height,S.setCenter(A[C].centerX,A[C].centerY),S.labelMarginLeft=0,S.labelMarginTop=0,p.NODE_DIMENSIONS_INCLUDE_LABELS){var L=S.rect.width,V=S.rect.height;S.labelWidth&&(S.labelPosHorizontal=="left"?(S.rect.x-=S.labelWidth,S.setWidth(L+S.labelWidth),S.labelMarginLeft=S.labelWidth):S.labelPosHorizontal=="center"&&S.labelWidth>L?(S.rect.x-=(S.labelWidth-L)/2,S.setWidth(S.labelWidth),S.labelMarginLeft=(S.labelWidth-L)/2):S.labelPosHorizontal=="right"&&S.setWidth(L+S.labelWidth)),S.labelHeight&&(S.labelPosVertical=="top"?(S.rect.y-=S.labelHeight,S.setHeight(V+S.labelHeight),S.labelMarginTop=S.labelHeight):S.labelPosVertical=="center"&&S.labelHeight>V?(S.rect.y-=(S.labelHeight-V)/2,S.setHeight(S.labelHeight),S.labelMarginTop=(S.labelHeight-V)/2):S.labelPosVertical=="bottom"&&S.setHeight(V+S.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var E=this.compoundOrder.length-1;E>=0;E--){var A=this.compoundOrder[E],C=A.id,S=A.paddingLeft,L=A.paddingTop,V=A.labelMarginLeft,F=A.labelMarginTop;this.adjustLocations(this.tiledMemberPack[C],A.rect.x,A.rect.y,S,L,V,F)}},M.prototype.repopulateZeroDegreeMembers=function(){var E=this,A=this.tiledZeroDegreePack;Object.keys(A).forEach(function(C){var S=E.idToDummyNode[C],L=S.paddingLeft,V=S.paddingTop,F=S.labelMarginLeft,B=S.labelMarginTop;E.adjustLocations(A[C],S.rect.x,S.rect.y,L,V,F,B)})},M.prototype.getToBeTiled=function(E){var A=E.id;if(this.toBeTiled[A]!=null)return this.toBeTiled[A];var C=E.getChild();if(C==null)return this.toBeTiled[A]=!1,!1;for(var S=C.getNodes(),L=0;L<S.length;L++){var V=S[L];if(this.getNodeDegree(V)>0)return this.toBeTiled[A]=!1,!1;if(V.getChild()==null){this.toBeTiled[V.id]=!1;continue}if(!this.getToBeTiled(V))return this.toBeTiled[A]=!1,!1}return this.toBeTiled[A]=!0,!0},M.prototype.getNodeDegree=function(E){E.id;for(var A=E.getEdges(),C=0,S=0;S<A.length;S++){var L=A[S];L.getSource().id!==L.getTarget().id&&(C=C+1)}return C},M.prototype.getNodeDegreeWithChildren=function(E){var A=this.getNodeDegree(E);if(E.getChild()==null)return A;for(var C=E.getChild().getNodes(),S=0;S<C.length;S++){var L=C[S];A+=this.getNodeDegreeWithChildren(L)}return A},M.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},M.prototype.fillCompexOrderByDFS=function(E){for(var A=0;A<E.length;A++){var C=E[A];C.getChild()!=null&&this.fillCompexOrderByDFS(C.getChild().getNodes()),this.getToBeTiled(C)&&this.compoundOrder.push(C)}},M.prototype.adjustLocations=function(E,A,C,S,L,V,F){A+=S+V,C+=L+F;for(var B=A,Y=0;Y<E.rows.length;Y++){var q=E.rows[Y];A=B;for(var Q=0,$=0;$<q.length;$++){var K=q[$];K.rect.x=A,K.rect.y=C,A+=K.rect.width+E.horizontalPadding,K.rect.height>Q&&(Q=K.rect.height)}C+=Q+E.verticalPadding}},M.prototype.tileCompoundMembers=function(E,A){var C=this;this.tiledMemberPack=[],Object.keys(E).forEach(function(S){var L=A[S];if(C.tiledMemberPack[S]=C.tileNodes(E[S],L.paddingLeft+L.paddingRight),L.rect.width=C.tiledMemberPack[S].width,L.rect.height=C.tiledMemberPack[S].height,L.setCenter(C.tiledMemberPack[S].centerX,C.tiledMemberPack[S].centerY),L.labelMarginLeft=0,L.labelMarginTop=0,p.NODE_DIMENSIONS_INCLUDE_LABELS){var V=L.rect.width,F=L.rect.height;L.labelWidth&&(L.labelPosHorizontal=="left"?(L.rect.x-=L.labelWidth,L.setWidth(V+L.labelWidth),L.labelMarginLeft=L.labelWidth):L.labelPosHorizontal=="center"&&L.labelWidth>V?(L.rect.x-=(L.labelWidth-V)/2,L.setWidth(L.labelWidth),L.labelMarginLeft=(L.labelWidth-V)/2):L.labelPosHorizontal=="right"&&L.setWidth(V+L.labelWidth)),L.labelHeight&&(L.labelPosVertical=="top"?(L.rect.y-=L.labelHeight,L.setHeight(F+L.labelHeight),L.labelMarginTop=L.labelHeight):L.labelPosVertical=="center"&&L.labelHeight>F?(L.rect.y-=(L.labelHeight-F)/2,L.setHeight(L.labelHeight),L.labelMarginTop=(L.labelHeight-F)/2):L.labelPosVertical=="bottom"&&L.setHeight(F+L.labelHeight))}})},M.prototype.tileNodes=function(E,A){var C=this.tileNodesByFavoringDim(E,A,!0),S=this.tileNodesByFavoringDim(E,A,!1),L=this.getOrgRatio(C),V=this.getOrgRatio(S),F;return V<L?F=S:F=C,F},M.prototype.getOrgRatio=function(E){var A=E.width,C=E.height,S=A/C;return S<1&&(S=1/S),S},M.prototype.calcIdealRowWidth=function(E,A){var C=p.TILING_PADDING_VERTICAL,S=p.TILING_PADDING_HORIZONTAL,L=E.length,V=0,F=0,B=0;E.forEach(function(re){V+=re.getWidth(),F+=re.getHeight(),re.getWidth()>B&&(B=re.getWidth())});var Y=V/L,q=F/L,Q=Math.pow(C-S,2)+4*(Y+S)*(q+C)*L,$=(S-C+Math.sqrt(Q))/(2*(Y+S)),K;A?(K=Math.ceil($),K==$&&K++):K=Math.floor($);var j=K*(Y+S)-S;return B>j&&(j=B),j+=S*2,j},M.prototype.tileNodesByFavoringDim=function(E,A,C){var S=p.TILING_PADDING_VERTICAL,L=p.TILING_PADDING_HORIZONTAL,V=p.TILING_COMPARE_BY,F={rows:[],rowWidth:[],rowHeight:[],width:0,height:A,verticalPadding:S,horizontalPadding:L,centerX:0,centerY:0};V&&(F.idealRowWidth=this.calcIdealRowWidth(E,C));var B=function(U){return U.rect.width*U.rect.height},Y=function(U,H){return B(H)-B(U)};E.sort(function(re,U){var H=Y;return F.idealRowWidth?(H=V,H(re.id,U.id)):H(re,U)});for(var q=0,Q=0,$=0;$<E.length;$++){var K=E[$];q+=K.getCenterX(),Q+=K.getCenterY()}F.centerX=q/E.length,F.centerY=Q/E.length;for(var $=0;$<E.length;$++){var K=E[$];if(F.rows.length==0)this.insertNodeToRow(F,K,0,A);else if(this.canAddHorizontal(F,K.rect.width,K.rect.height)){var j=F.rows.length-1;F.idealRowWidth||(j=this.getShortestRowIndex(F)),this.insertNodeToRow(F,K,j,A)}else this.insertNodeToRow(F,K,F.rows.length,A);this.shiftToLastRow(F)}return F},M.prototype.insertNodeToRow=function(E,A,C,S){var L=S;if(C==E.rows.length){var V=[];E.rows.push(V),E.rowWidth.push(L),E.rowHeight.push(0)}var F=E.rowWidth[C]+A.rect.width;E.rows[C].length>0&&(F+=E.horizontalPadding),E.rowWidth[C]=F,E.width<F&&(E.width=F);var B=A.rect.height;C>0&&(B+=E.verticalPadding);var Y=0;B>E.rowHeight[C]&&(Y=E.rowHeight[C],E.rowHeight[C]=B,Y=E.rowHeight[C]-Y),E.height+=Y,E.rows[C].push(A)},M.prototype.getShortestRowIndex=function(E){for(var A=-1,C=Number.MAX_VALUE,S=0;S<E.rows.length;S++)E.rowWidth[S]<C&&(A=S,C=E.rowWidth[S]);return A},M.prototype.getLongestRowIndex=function(E){for(var A=-1,C=Number.MIN_VALUE,S=0;S<E.rows.length;S++)E.rowWidth[S]>C&&(A=S,C=E.rowWidth[S]);return A},M.prototype.canAddHorizontal=function(E,A,C){if(E.idealRowWidth){var S=E.rows.length-1,L=E.rowWidth[S];return L+A+E.horizontalPadding<=E.idealRowWidth}var V=this.getShortestRowIndex(E);if(V<0)return!0;var F=E.rowWidth[V];if(F+E.horizontalPadding+A<=E.width)return!0;var B=0;E.rowHeight[V]<C&&V>0&&(B=C+E.verticalPadding-E.rowHeight[V]);var Y;E.width-F>=A+E.horizontalPadding?Y=(E.height+B)/(F+A+E.horizontalPadding):Y=(E.height+B)/E.width,B=C+E.verticalPadding;var q;return E.width<A?q=(E.height+B)/A:q=(E.height+B)/E.width,q<1&&(q=1/q),Y<1&&(Y=1/Y),Y<q},M.prototype.shiftToLastRow=function(E){var A=this.getLongestRowIndex(E),C=E.rowWidth.length-1,S=E.rows[A],L=S[S.length-1],V=L.width+E.horizontalPadding;if(E.width-E.rowWidth[C]>V&&A!=C){S.splice(-1,1),E.rows[C].push(L),E.rowWidth[A]=E.rowWidth[A]-V,E.rowWidth[C]=E.rowWidth[C]+V,E.width=E.rowWidth[instance.getLongestRowIndex(E)];for(var F=Number.MIN_VALUE,B=0;B<S.length;B++)S[B].height>F&&(F=S[B].height);A>0&&(F+=E.verticalPadding);var Y=E.rowHeight[A]+E.rowHeight[C];E.rowHeight[A]=F,E.rowHeight[C]<L.height+E.verticalPadding&&(E.rowHeight[C]=L.height+E.verticalPadding);var q=E.rowHeight[A]+E.rowHeight[C];E.height+=q-Y,this.shiftToLastRow(E)}},M.prototype.tilingPreLayout=function(){p.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},M.prototype.tilingPostLayout=function(){p.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},M.prototype.reduceTrees=function(){for(var E=[],A=!0,C;A;){var S=this.graphManager.getAllNodes(),L=[];A=!1;for(var V=0;V<S.length;V++)if(C=S[V],C.getEdges().length==1&&!C.getEdges()[0].isInterGraph&&C.getChild()==null){if(p.PURE_INCREMENTAL){var F=C.getEdges()[0].getOtherEnd(C),B=new T(C.getCenterX()-F.getCenterX(),C.getCenterY()-F.getCenterY());L.push([C,C.getEdges()[0],C.getOwner(),B])}else L.push([C,C.getEdges()[0],C.getOwner()]);A=!0}if(A==!0){for(var Y=[],q=0;q<L.length;q++)L[q][0].getEdges().length==1&&(Y.push(L[q]),L[q][0].getOwner().remove(L[q][0]));E.push(Y),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=E},M.prototype.growTree=function(E){for(var A=E.length,C=E[A-1],S,L=0;L<C.length;L++)S=C[L],this.findPlaceforPrunedNode(S),S[2].add(S[0]),S[2].add(S[1],S[1].source,S[1].target);E.splice(E.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},M.prototype.findPlaceforPrunedNode=function(E){var A,C,S=E[0];if(S==E[1].source?C=E[1].target:C=E[1].source,p.PURE_INCREMENTAL)S.setCenter(C.getCenterX()+E[3].getWidth(),C.getCenterY()+E[3].getHeight());else{var L=C.startX,V=C.finishX,F=C.startY,B=C.finishY,Y=0,q=0,Q=0,$=0,K=[Y,Q,q,$];if(F>0)for(var j=L;j<=V;j++)K[0]+=this.grid[j][F-1].length+this.grid[j][F].length-1;if(V<this.grid.length-1)for(var j=F;j<=B;j++)K[1]+=this.grid[V+1][j].length+this.grid[V][j].length-1;if(B<this.grid[0].length-1)for(var j=L;j<=V;j++)K[2]+=this.grid[j][B+1].length+this.grid[j][B].length-1;if(L>0)for(var j=F;j<=B;j++)K[3]+=this.grid[L-1][j].length+this.grid[L][j].length-1;for(var re=x.MAX_VALUE,U,H,_=0;_<K.length;_++)K[_]<re?(re=K[_],U=1,H=_):K[_]==re&&U++;if(U==3&&re==0)K[0]==0&&K[1]==0&&K[2]==0?A=1:K[0]==0&&K[1]==0&&K[3]==0?A=0:K[0]==0&&K[2]==0&&K[3]==0?A=3:K[1]==0&&K[2]==0&&K[3]==0&&(A=2);else if(U==2&&re==0){var W=Math.floor(Math.random()*2);K[0]==0&&K[1]==0?W==0?A=0:A=1:K[0]==0&&K[2]==0?W==0?A=0:A=2:K[0]==0&&K[3]==0?W==0?A=0:A=3:K[1]==0&&K[2]==0?W==0?A=1:A=2:K[1]==0&&K[3]==0?W==0?A=1:A=3:W==0?A=2:A=3}else if(U==4&&re==0){var W=Math.floor(Math.random()*4);A=W}else A=H;A==0?S.setCenter(C.getCenterX(),C.getCenterY()-C.getHeight()/2-g.DEFAULT_EDGE_LENGTH-S.getHeight()/2):A==1?S.setCenter(C.getCenterX()+C.getWidth()/2+g.DEFAULT_EDGE_LENGTH+S.getWidth()/2,C.getCenterY()):A==2?S.setCenter(C.getCenterX(),C.getCenterY()+C.getHeight()/2+g.DEFAULT_EDGE_LENGTH+S.getHeight()/2):S.setCenter(C.getCenterX()-C.getWidth()/2-g.DEFAULT_EDGE_LENGTH-S.getWidth()/2,C.getCenterY())}},s.exports=M}),991:((s,u,l)=>{var f=l(551).FDLayoutNode,h=l(551).IMath;function v(d,p,y,g){f.call(this,d,p,y,g)}v.prototype=Object.create(f.prototype);for(var c in f)v[c]=f[c];v.prototype.calculateDisplacement=function(){var d=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=d.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=d.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=d.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=d.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>d.coolingFactor*d.maxNodeDisplacement&&(this.displacementX=d.coolingFactor*d.maxNodeDisplacement*h.sign(this.displacementX)),Math.abs(this.displacementY)>d.coolingFactor*d.maxNodeDisplacement&&(this.displacementY=d.coolingFactor*d.maxNodeDisplacement*h.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},v.prototype.propogateDisplacementToChildren=function(d,p){for(var y=this.getChild().getNodes(),g,b=0;b<y.length;b++)g=y[b],g.getChild()==null?(g.displacementX+=d,g.displacementY+=p):g.propogateDisplacementToChildren(d,p)},v.prototype.move=function(){var d=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),d.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},v.prototype.setPred1=function(d){this.pred1=d},v.prototype.getPred1=function(){return pred1},v.prototype.getPred2=function(){return pred2},v.prototype.setNext=function(d){this.next=d},v.prototype.getNext=function(){return next},v.prototype.setProcessed=function(d){this.processed=d},v.prototype.isProcessed=function(){return processed},s.exports=v}),902:((s,u,l)=>{function f(y){if(Array.isArray(y)){for(var g=0,b=Array(y.length);g<y.length;g++)b[g]=y[g];return b}else return Array.from(y)}var h=l(806),v=l(551).LinkedList,c=l(551).Matrix,d=l(551).SVD;function p(){}p.handleConstraints=function(y){var g={};g.fixedNodeConstraint=y.constraints.fixedNodeConstraint,g.alignmentConstraint=y.constraints.alignmentConstraint,g.relativePlacementConstraint=y.constraints.relativePlacementConstraint;for(var b=new Map,m=new Map,w=[],T=[],D=y.getAllNodes(),x=0,N=0;N<D.length;N++){var O=D[N];O.getChild()==null&&(m.set(O.id,x++),w.push(O.getCenterX()),T.push(O.getCenterY()),b.set(O.id,O))}g.relativePlacementConstraint&&g.relativePlacementConstraint.forEach(function(z){!z.gap&&z.gap!=0&&(z.left?z.gap=h.DEFAULT_EDGE_LENGTH+b.get(z.left).getWidth()/2+b.get(z.right).getWidth()/2:z.gap=h.DEFAULT_EDGE_LENGTH+b.get(z.top).getHeight()/2+b.get(z.bottom).getHeight()/2)});var R=function(G,X){return{x:G.x-X.x,y:G.y-X.y}},P=function(G){var X=0,Z=0;return G.forEach(function(ae){X+=w[m.get(ae)],Z+=T[m.get(ae)]}),{x:X/G.size,y:Z/G.size}},M=function(G,X,Z,ae,ee){function ie(De,Ee){var ze=new Set(De),Ce=!0,Se=!1,Ue=void 0;try{for(var Re=Ee[Symbol.iterator](),Ve;!(Ce=(Ve=Re.next()).done);Ce=!0){var He=Ve.value;ze.add(He)}}catch(Ze){Se=!0,Ue=Ze}finally{try{!Ce&&Re.return&&Re.return()}finally{if(Se)throw Ue}}return ze}var se=new Map;G.forEach(function(De,Ee){se.set(Ee,0)}),G.forEach(function(De,Ee){De.forEach(function(ze){se.set(ze.id,se.get(ze.id)+1)})});var oe=new Map,ue=new Map,pe=new v;se.forEach(function(De,Ee){De==0?(pe.push(Ee),Z||(X=="horizontal"?oe.set(Ee,m.has(Ee)?w[m.get(Ee)]:ae.get(Ee)):oe.set(Ee,m.has(Ee)?T[m.get(Ee)]:ae.get(Ee)))):oe.set(Ee,Number.NEGATIVE_INFINITY),Z&&ue.set(Ee,new Set([Ee]))}),Z&&ee.forEach(function(De){var Ee=[];if(De.forEach(function(Se){Z.has(Se)&&Ee.push(Se)}),Ee.length>0){var ze=0;Ee.forEach(function(Se){X=="horizontal"?(oe.set(Se,m.has(Se)?w[m.get(Se)]:ae.get(Se)),ze+=oe.get(Se)):(oe.set(Se,m.has(Se)?T[m.get(Se)]:ae.get(Se)),ze+=oe.get(Se))}),ze=ze/Ee.length,De.forEach(function(Se){Z.has(Se)||oe.set(Se,ze)})}else{var Ce=0;De.forEach(function(Se){X=="horizontal"?Ce+=m.has(Se)?w[m.get(Se)]:ae.get(Se):Ce+=m.has(Se)?T[m.get(Se)]:ae.get(Se)}),Ce=Ce/De.length,De.forEach(function(Se){oe.set(Se,Ce)})}});for(var ce=function(){var Ee=pe.shift(),ze=G.get(Ee);ze.forEach(function(Ce){if(oe.get(Ce.id)<oe.get(Ee)+Ce.gap)if(Z&&Z.has(Ce.id)){var Se=void 0;if(X=="horizontal"?Se=m.has(Ce.id)?w[m.get(Ce.id)]:ae.get(Ce.id):Se=m.has(Ce.id)?T[m.get(Ce.id)]:ae.get(Ce.id),oe.set(Ce.id,Se),Se<oe.get(Ee)+Ce.gap){var Ue=oe.get(Ee)+Ce.gap-Se;ue.get(Ee).forEach(function(Re){oe.set(Re,oe.get(Re)-Ue)})}}else oe.set(Ce.id,oe.get(Ee)+Ce.gap);se.set(Ce.id,se.get(Ce.id)-1),se.get(Ce.id)==0&&pe.push(Ce.id),Z&&ue.set(Ce.id,ie(ue.get(Ee),ue.get(Ce.id)))})};pe.length!=0;)ce();if(Z){var we=new Set;G.forEach(function(De,Ee){De.length==0&&we.add(Ee)});var Ne=[];ue.forEach(function(De,Ee){if(we.has(Ee)){var ze=!1,Ce=!0,Se=!1,Ue=void 0;try{for(var Re=De[Symbol.iterator](),Ve;!(Ce=(Ve=Re.next()).done);Ce=!0){var He=Ve.value;Z.has(He)&&(ze=!0)}}catch(Xe){Se=!0,Ue=Xe}finally{try{!Ce&&Re.return&&Re.return()}finally{if(Se)throw Ue}}if(!ze){var Ze=!1,tt=void 0;Ne.forEach(function(Xe,Lt){Xe.has([].concat(f(De))[0])&&(Ze=!0,tt=Lt)}),Ze?De.forEach(function(Xe){Ne[tt].add(Xe)}):Ne.push(new Set(De))}}}),Ne.forEach(function(De,Ee){var ze=Number.POSITIVE_INFINITY,Ce=Number.POSITIVE_INFINITY,Se=Number.NEGATIVE_INFINITY,Ue=Number.NEGATIVE_INFINITY,Re=!0,Ve=!1,He=void 0;try{for(var Ze=De[Symbol.iterator](),tt;!(Re=(tt=Ze.next()).done);Re=!0){var Xe=tt.value,Lt=void 0;X=="horizontal"?Lt=m.has(Xe)?w[m.get(Xe)]:ae.get(Xe):Lt=m.has(Xe)?T[m.get(Xe)]:ae.get(Xe);var Pt=oe.get(Xe);Lt<ze&&(ze=Lt),Lt>Se&&(Se=Lt),Pt<Ce&&(Ce=Pt),Pt>Ue&&(Ue=Pt)}}catch(fr){Ve=!0,He=fr}finally{try{!Re&&Ze.return&&Ze.return()}finally{if(Ve)throw He}}var pt=(ze+Se)/2-(Ce+Ue)/2,at=!0,st=!1,Ft=void 0;try{for(var ut=De[Symbol.iterator](),Rr;!(at=(Rr=ut.next()).done);at=!0){var lr=Rr.value;oe.set(lr,oe.get(lr)+pt)}}catch(fr){st=!0,Ft=fr}finally{try{!at&&ut.return&&ut.return()}finally{if(st)throw Ft}}})}return oe},I=function(G){var X=0,Z=0,ae=0,ee=0;if(G.forEach(function(ue){ue.left?w[m.get(ue.left)]-w[m.get(ue.right)]>=0?X++:Z++:T[m.get(ue.top)]-T[m.get(ue.bottom)]>=0?ae++:ee++}),X>Z&&ae>ee)for(var ie=0;ie<m.size;ie++)w[ie]=-1*w[ie],T[ie]=-1*T[ie];else if(X>Z)for(var se=0;se<m.size;se++)w[se]=-1*w[se];else if(ae>ee)for(var oe=0;oe<m.size;oe++)T[oe]=-1*T[oe]},E=function(G){var X=[],Z=new v,ae=new Set,ee=0;return G.forEach(function(ie,se){if(!ae.has(se)){X[ee]=[];var oe=se;for(Z.push(oe),ae.add(oe),X[ee].push(oe);Z.length!=0;){oe=Z.shift();var ue=G.get(oe);ue.forEach(function(pe){ae.has(pe.id)||(Z.push(pe.id),ae.add(pe.id),X[ee].push(pe.id))})}ee++}}),X},A=function(G){var X=new Map;return G.forEach(function(Z,ae){X.set(ae,[])}),G.forEach(function(Z,ae){Z.forEach(function(ee){X.get(ae).push(ee),X.get(ee.id).push({id:ae,gap:ee.gap,direction:ee.direction})})}),X},C=function(G){var X=new Map;return G.forEach(function(Z,ae){X.set(ae,[])}),G.forEach(function(Z,ae){Z.forEach(function(ee){X.get(ee.id).push({id:ae,gap:ee.gap,direction:ee.direction})})}),X},S=[],L=[],V=!1,F=!1,B=new Set,Y=new Map,q=new Map,Q=[];if(g.fixedNodeConstraint&&g.fixedNodeConstraint.forEach(function(z){B.add(z.nodeId)}),g.relativePlacementConstraint&&(g.relativePlacementConstraint.forEach(function(z){z.left?(Y.has(z.left)?Y.get(z.left).push({id:z.right,gap:z.gap,direction:"horizontal"}):Y.set(z.left,[{id:z.right,gap:z.gap,direction:"horizontal"}]),Y.has(z.right)||Y.set(z.right,[])):(Y.has(z.top)?Y.get(z.top).push({id:z.bottom,gap:z.gap,direction:"vertical"}):Y.set(z.top,[{id:z.bottom,gap:z.gap,direction:"vertical"}]),Y.has(z.bottom)||Y.set(z.bottom,[]))}),q=A(Y),Q=E(q)),h.TRANSFORM_ON_CONSTRAINT_HANDLING){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>1)g.fixedNodeConstraint.forEach(function(z,G){S[G]=[z.position.x,z.position.y],L[G]=[w[m.get(z.nodeId)],T[m.get(z.nodeId)]]}),V=!0;else if(g.alignmentConstraint)(function(){var z=0;if(g.alignmentConstraint.vertical){for(var G=g.alignmentConstraint.vertical,X=function(oe){var ue=new Set;G[oe].forEach(function(we){ue.add(we)});var pe=new Set([].concat(f(ue)).filter(function(we){return B.has(we)})),ce=void 0;pe.size>0?ce=w[m.get(pe.values().next().value)]:ce=P(ue).x,G[oe].forEach(function(we){S[z]=[ce,T[m.get(we)]],L[z]=[w[m.get(we)],T[m.get(we)]],z++})},Z=0;Z<G.length;Z++)X(Z);V=!0}if(g.alignmentConstraint.horizontal){for(var ae=g.alignmentConstraint.horizontal,ee=function(oe){var ue=new Set;ae[oe].forEach(function(we){ue.add(we)});var pe=new Set([].concat(f(ue)).filter(function(we){return B.has(we)})),ce=void 0;pe.size>0?ce=w[m.get(pe.values().next().value)]:ce=P(ue).y,ae[oe].forEach(function(we){S[z]=[w[m.get(we)],ce],L[z]=[w[m.get(we)],T[m.get(we)]],z++})},ie=0;ie<ae.length;ie++)ee(ie);V=!0}g.relativePlacementConstraint&&(F=!0)})();else if(g.relativePlacementConstraint){for(var $=0,K=0,j=0;j<Q.length;j++)Q[j].length>$&&($=Q[j].length,K=j);if($<q.size/2)I(g.relativePlacementConstraint),V=!1,F=!1;else{var re=new Map,U=new Map,H=[];Q[K].forEach(function(z){Y.get(z).forEach(function(G){G.direction=="horizontal"?(re.has(z)?re.get(z).push(G):re.set(z,[G]),re.has(G.id)||re.set(G.id,[]),H.push({left:z,right:G.id})):(U.has(z)?U.get(z).push(G):U.set(z,[G]),U.has(G.id)||U.set(G.id,[]),H.push({top:z,bottom:G.id}))})}),I(H),F=!1;var _=M(re,"horizontal"),W=M(U,"vertical");Q[K].forEach(function(z,G){L[G]=[w[m.get(z)],T[m.get(z)]],S[G]=[],_.has(z)?S[G][0]=_.get(z):S[G][0]=w[m.get(z)],W.has(z)?S[G][1]=W.get(z):S[G][1]=T[m.get(z)]}),V=!0}}if(V){for(var J=void 0,te=c.transpose(S),de=c.transpose(L),Te=0;Te<te.length;Te++)te[Te]=c.multGamma(te[Te]),de[Te]=c.multGamma(de[Te]);var ge=c.multMat(te,c.transpose(de)),le=d.svd(ge);J=c.multMat(le.V,c.transpose(le.U));for(var he=0;he<m.size;he++){var fe=[w[he],T[he]],ve=[J[0][0],J[1][0]],ye=[J[0][1],J[1][1]];w[he]=c.dotProduct(fe,ve),T[he]=c.dotProduct(fe,ye)}F&&I(g.relativePlacementConstraint)}}if(h.ENFORCE_CONSTRAINTS){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>0){var me={x:0,y:0};g.fixedNodeConstraint.forEach(function(z,G){var X={x:w[m.get(z.nodeId)],y:T[m.get(z.nodeId)]},Z=z.position,ae=R(Z,X);me.x+=ae.x,me.y+=ae.y}),me.x/=g.fixedNodeConstraint.length,me.y/=g.fixedNodeConstraint.length,w.forEach(function(z,G){w[G]+=me.x}),T.forEach(function(z,G){T[G]+=me.y}),g.fixedNodeConstraint.forEach(function(z){w[m.get(z.nodeId)]=z.position.x,T[m.get(z.nodeId)]=z.position.y})}if(g.alignmentConstraint){if(g.alignmentConstraint.vertical)for(var xe=g.alignmentConstraint.vertical,Le=function(G){var X=new Set;xe[G].forEach(function(ee){X.add(ee)});var Z=new Set([].concat(f(X)).filter(function(ee){return B.has(ee)})),ae=void 0;Z.size>0?ae=w[m.get(Z.values().next().value)]:ae=P(X).x,X.forEach(function(ee){B.has(ee)||(w[m.get(ee)]=ae)})},ke=0;ke<xe.length;ke++)Le(ke);if(g.alignmentConstraint.horizontal)for(var Fe=g.alignmentConstraint.horizontal,Be=function(G){var X=new Set;Fe[G].forEach(function(ee){X.add(ee)});var Z=new Set([].concat(f(X)).filter(function(ee){return B.has(ee)})),ae=void 0;Z.size>0?ae=T[m.get(Z.values().next().value)]:ae=P(X).y,X.forEach(function(ee){B.has(ee)||(T[m.get(ee)]=ae)})},Oe=0;Oe<Fe.length;Oe++)Be(Oe)}g.relativePlacementConstraint&&(function(){var z=new Map,G=new Map,X=new Map,Z=new Map,ae=new Map,ee=new Map,ie=new Set,se=new Set;if(B.forEach(function(ht){ie.add(ht),se.add(ht)}),g.alignmentConstraint){if(g.alignmentConstraint.vertical)for(var oe=g.alignmentConstraint.vertical,ue=function(Pe){X.set("dummy"+Pe,[]),oe[Pe].forEach(function(Ye){z.set(Ye,"dummy"+Pe),X.get("dummy"+Pe).push(Ye),B.has(Ye)&&ie.add("dummy"+Pe)}),ae.set("dummy"+Pe,w[m.get(oe[Pe][0])])},pe=0;pe<oe.length;pe++)ue(pe);if(g.alignmentConstraint.horizontal)for(var ce=g.alignmentConstraint.horizontal,we=function(Pe){Z.set("dummy"+Pe,[]),ce[Pe].forEach(function(Ye){G.set(Ye,"dummy"+Pe),Z.get("dummy"+Pe).push(Ye),B.has(Ye)&&se.add("dummy"+Pe)}),ee.set("dummy"+Pe,T[m.get(ce[Pe][0])])},Ne=0;Ne<ce.length;Ne++)we(Ne)}var De=new Map,Ee=new Map,ze=function(Pe){Y.get(Pe).forEach(function(Ye){var Ht=void 0,yt=void 0;Ye.direction=="horizontal"?(Ht=z.get(Pe)?z.get(Pe):Pe,z.get(Ye.id)?yt={id:z.get(Ye.id),gap:Ye.gap,direction:Ye.direction}:yt=Ye,De.has(Ht)?De.get(Ht).push(yt):De.set(Ht,[yt]),De.has(yt.id)||De.set(yt.id,[])):(Ht=G.get(Pe)?G.get(Pe):Pe,G.get(Ye.id)?yt={id:G.get(Ye.id),gap:Ye.gap,direction:Ye.direction}:yt=Ye,Ee.has(Ht)?Ee.get(Ht).push(yt):Ee.set(Ht,[yt]),Ee.has(yt.id)||Ee.set(yt.id,[]))})},Ce=!0,Se=!1,Ue=void 0;try{for(var Re=Y.keys()[Symbol.iterator](),Ve;!(Ce=(Ve=Re.next()).done);Ce=!0){var He=Ve.value;ze(He)}}catch(ht){Se=!0,Ue=ht}finally{try{!Ce&&Re.return&&Re.return()}finally{if(Se)throw Ue}}var Ze=A(De),tt=A(Ee),Xe=E(Ze),Lt=E(tt),Pt=C(De),pt=C(Ee),at=[],st=[];Xe.forEach(function(ht,Pe){at[Pe]=[],ht.forEach(function(Ye){Pt.get(Ye).length==0&&at[Pe].push(Ye)})}),Lt.forEach(function(ht,Pe){st[Pe]=[],ht.forEach(function(Ye){pt.get(Ye).length==0&&st[Pe].push(Ye)})});var Ft=M(De,"horizontal",ie,ae,at),ut=M(Ee,"vertical",se,ee,st),Rr=function(Pe){X.get(Pe)?X.get(Pe).forEach(function(Ye){w[m.get(Ye)]=Ft.get(Pe)}):w[m.get(Pe)]=Ft.get(Pe)},lr=!0,fr=!1,mn=void 0;try{for(var Na=Ft.keys()[Symbol.iterator](),bn;!(lr=(bn=Na.next()).done);lr=!0){var Ma=bn.value;Rr(Ma)}}catch(ht){fr=!0,mn=ht}finally{try{!lr&&Na.return&&Na.return()}finally{if(fr)throw mn}}var Ri=function(Pe){Z.get(Pe)?Z.get(Pe).forEach(function(Ye){T[m.get(Ye)]=ut.get(Pe)}):T[m.get(Pe)]=ut.get(Pe)},rr=!0,Kr=!1,Or=void 0;try{for(var Zr=ut.keys()[Symbol.iterator](),Ra;!(rr=(Ra=Zr.next()).done);rr=!0){var Ma=Ra.value;Ri(Ma)}}catch(ht){Kr=!0,Or=ht}finally{try{!rr&&Zr.return&&Zr.return()}finally{if(Kr)throw Or}}})()}for(var ne=0;ne<D.length;ne++){var k=D[ne];k.getChild()==null&&k.setCenter(w[m.get(k.id)],T[m.get(k.id)])}},s.exports=p}),551:(s=>{s.exports=r})},n={};function i(s){var u=n[s];if(u!==void 0)return u.exports;var l=n[s]={exports:{}};return a[s](l,l.exports,i),l.exports}var o=i(45);return o})()})})(Wn)),Wn.exports}var V1=mu.exports;(function(t,e){(function(a,n){t.exports=n(z1())})(V1,function(r){return(()=>{var a={658:(s=>{s.exports=Object.assign!=null?Object.assign.bind(Object):function(u){for(var l=arguments.length,f=Array(l>1?l-1:0),h=1;h<l;h++)f[h-1]=arguments[h];return f.forEach(function(v){Object.keys(v).forEach(function(c){return u[c]=v[c]})}),u}}),548:((s,u,l)=>{var f=(function(){function c(d,p){var y=[],g=!0,b=!1,m=void 0;try{for(var w=d[Symbol.iterator](),T;!(g=(T=w.next()).done)&&(y.push(T.value),!(p&&y.length===p));g=!0);}catch(D){b=!0,m=D}finally{try{!g&&w.return&&w.return()}finally{if(b)throw m}}return y}return function(d,p){if(Array.isArray(d))return d;if(Symbol.iterator in Object(d))return c(d,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),h=l(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(c){for(var d={},p=0;p<c.length;p++)d[c[p].id()]=!0;var y=c.filter(function(g,b){typeof g=="number"&&(g=b);for(var m=g.parent()[0];m!=null;){if(d[m.id()])return!1;m=m.parent()[0]}return!0});return y},v.connectComponents=function(c,d,p,y){var g=new h,b=new Set,m=[],w=void 0,T=void 0,D=void 0,x=!1,N=1,O=[],R=[],P=function(){var I=c.collection();R.push(I);var E=p[0],A=c.collection();A.merge(E).merge(E.descendants().intersection(d)),m.push(E),A.forEach(function(L){g.push(L),b.add(L),I.merge(L)});for(var C=function(){E=g.shift();var V=c.collection();E.neighborhood().nodes().forEach(function(q){d.intersection(E.edgesWith(q)).length>0&&V.merge(q)});for(var F=0;F<V.length;F++){var B=V[F];if(w=p.intersection(B.union(B.ancestors())),w!=null&&!b.has(w[0])){var Y=w.union(w.descendants());Y.forEach(function(q){g.push(q),b.add(q),I.merge(q),p.has(q)&&m.push(q)})}}};g.length!=0;)C();if(I.forEach(function(L){d.intersection(L.connectedEdges()).forEach(function(V){I.has(V.source())&&I.has(V.target())&&I.merge(V)})}),m.length==p.length&&(x=!0),!x||x&&N>1){T=m[0],D=T.connectedEdges().length,m.forEach(function(L){L.connectedEdges().length<D&&(D=L.connectedEdges().length,T=L)}),O.push(T.id());var S=c.collection();S.merge(m[0]),m.forEach(function(L){S.merge(L)}),m=[],p=p.difference(S),N++}};do P();while(!x);return y&&O.length>0&&y.set("dummy"+(y.size+1),O),R},v.relocateComponent=function(c,d,p){if(!p.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;if(p.quality=="draft"){var w=!0,T=!1,D=void 0;try{for(var x=d.nodeIndexes[Symbol.iterator](),N;!(w=(N=x.next()).done);w=!0){var O=N.value,R=f(O,2),P=R[0],M=R[1],I=p.cy.getElementById(P);if(I){var E=I.boundingBox(),A=d.xCoords[M]-E.w/2,C=d.xCoords[M]+E.w/2,S=d.yCoords[M]-E.h/2,L=d.yCoords[M]+E.h/2;A<y&&(y=A),C>g&&(g=C),S<b&&(b=S),L>m&&(m=L)}}}catch(q){T=!0,D=q}finally{try{!w&&x.return&&x.return()}finally{if(T)throw D}}var V=c.x-(g+y)/2,F=c.y-(m+b)/2;d.xCoords=d.xCoords.map(function(q){return q+V}),d.yCoords=d.yCoords.map(function(q){return q+F})}else{Object.keys(d).forEach(function(q){var Q=d[q],$=Q.getRect().x,K=Q.getRect().x+Q.getRect().width,j=Q.getRect().y,re=Q.getRect().y+Q.getRect().height;$<y&&(y=$),K>g&&(g=K),j<b&&(b=j),re>m&&(m=re)});var B=c.x-(g+y)/2,Y=c.y-(m+b)/2;Object.keys(d).forEach(function(q){var Q=d[q];Q.setCenter(Q.getCenterX()+B,Q.getCenterY()+Y)})}}},v.calcBoundingBox=function(c,d,p,y){for(var g=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,m=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,T=void 0,D=void 0,x=void 0,N=void 0,O=c.descendants().not(":parent"),R=O.length,P=0;P<R;P++){var M=O[P];T=d[y.get(M.id())]-M.width()/2,D=d[y.get(M.id())]+M.width()/2,x=p[y.get(M.id())]-M.height()/2,N=p[y.get(M.id())]+M.height()/2,g>T&&(g=T),b<D&&(b=D),m>x&&(m=x),w<N&&(w=N)}var I={};return I.topLeftX=g,I.topLeftY=m,I.width=b-g,I.height=w-m,I},v.calcParentsWithoutChildren=function(c,d){var p=c.collection();return d.nodes(":parent").forEach(function(y){var g=!1;y.children().forEach(function(b){b.css("display")!="none"&&(g=!0)}),g||p.merge(y)}),p},s.exports=v}),816:((s,u,l)=>{var f=l(548),h=l(140).CoSELayout,v=l(140).CoSENode,c=l(140).layoutBase.PointD,d=l(140).layoutBase.DimensionD,p=l(140).layoutBase.LayoutConstants,y=l(140).layoutBase.FDLayoutConstants,g=l(140).CoSEConstants,b=function(w,T){var D=w.cy,x=w.eles,N=x.nodes(),O=x.edges(),R=void 0,P=void 0,M=void 0,I={};w.randomize&&(R=T.nodeIndexes,P=T.xCoords,M=T.yCoords);var E=function(q){return typeof q=="function"},A=function(q,Q){return E(q)?q(Q):q},C=f.calcParentsWithoutChildren(D,x),S=function Y(q,Q,$,K){for(var j=Q.length,re=0;re<j;re++){var U=Q[re],H=null;U.intersection(C).length==0&&(H=U.children());var _=void 0,W=U.layoutDimensions({nodeDimensionsIncludeLabels:K.nodeDimensionsIncludeLabels});if(U.outerWidth()!=null&&U.outerHeight()!=null)if(K.randomize)if(!U.isParent())_=q.add(new v($.graphManager,new c(P[R.get(U.id())]-W.w/2,M[R.get(U.id())]-W.h/2),new d(parseFloat(W.w),parseFloat(W.h))));else{var J=f.calcBoundingBox(U,P,M,R);U.intersection(C).length==0?_=q.add(new v($.graphManager,new c(J.topLeftX,J.topLeftY),new d(J.width,J.height))):_=q.add(new v($.graphManager,new c(J.topLeftX,J.topLeftY),new d(parseFloat(W.w),parseFloat(W.h))))}else _=q.add(new v($.graphManager,new c(U.position("x")-W.w/2,U.position("y")-W.h/2),new d(parseFloat(W.w),parseFloat(W.h))));else _=q.add(new v(this.graphManager));if(_.id=U.data("id"),_.nodeRepulsion=A(K.nodeRepulsion,U),_.paddingLeft=parseInt(U.css("padding")),_.paddingTop=parseInt(U.css("padding")),_.paddingRight=parseInt(U.css("padding")),_.paddingBottom=parseInt(U.css("padding")),K.nodeDimensionsIncludeLabels&&(_.labelWidth=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,_.labelHeight=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,_.labelPosVertical=U.css("text-valign"),_.labelPosHorizontal=U.css("text-halign")),I[U.data("id")]=_,isNaN(_.rect.x)&&(_.rect.x=0),isNaN(_.rect.y)&&(_.rect.y=0),H!=null&&H.length>0){var te=void 0;te=$.getGraphManager().add($.newGraph(),_),Y(te,H,$,K)}}},L=function(q,Q,$){for(var K=0,j=0,re=0;re<$.length;re++){var U=$[re],H=I[U.data("source")],_=I[U.data("target")];if(H&&_&&H!==_&&H.getEdgesBetween(_).length==0){var W=Q.add(q.newEdge(),H,_);W.id=U.id(),W.idealLength=A(w.idealEdgeLength,U),W.edgeElasticity=A(w.edgeElasticity,U),K+=W.idealLength,j++}}w.idealEdgeLength!=null&&(j>0?g.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=K/j:E(w.idealEdgeLength)?g.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:g.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,g.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,g.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},V=function(q,Q){Q.fixedNodeConstraint&&(q.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(q.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(q.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};w.nestingFactor!=null&&(g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(g.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(g.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(g.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(g.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(g.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?p.QUALITY=2:p.QUALITY=0,g.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=p.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,g.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=!w.randomize,g.ANIMATE=y.ANIMATE=p.ANIMATE=w.animate,g.TILE=w.tile,g.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,g.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,g.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=!0,g.PURE_INCREMENTAL=!w.randomize,p.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!1),w.step=="enforced"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!1),w.step=="cose"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?g.TREE_REDUCTION_ON_INCREMENTAL=!1:g.TREE_REDUCTION_ON_INCREMENTAL=!0;var F=new h,B=F.newGraphManager();return S(B.addRoot(),f.getTopMostNodes(N),F,w),L(F,B,O),V(F,w),F.runLayout(),I};s.exports={coseLayout:b}}),212:((s,u,l)=>{var f=(function(){function w(T,D){for(var x=0;x<D.length;x++){var N=D[x];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(T,N.key,N)}}return function(T,D,x){return D&&w(T.prototype,D),x&&w(T,x),T}})();function h(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}var v=l(658),c=l(548),d=l(657),p=d.spectralLayout,y=l(816),g=y.coseLayout,b=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(T){return 4500},idealEdgeLength:function(T){return 50},edgeElasticity:function(T){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),m=(function(){function w(T){h(this,w),this.options=v({},b,T)}return f(w,[{key:"run",value:function(){var D=this,x=this.options,N=x.cy,O=x.eles,R=[],P=[],M=void 0,I=[];x.fixedNodeConstraint&&(!Array.isArray(x.fixedNodeConstraint)||x.fixedNodeConstraint.length==0)&&(x.fixedNodeConstraint=void 0),x.alignmentConstraint&&(x.alignmentConstraint.vertical&&(!Array.isArray(x.alignmentConstraint.vertical)||x.alignmentConstraint.vertical.length==0)&&(x.alignmentConstraint.vertical=void 0),x.alignmentConstraint.horizontal&&(!Array.isArray(x.alignmentConstraint.horizontal)||x.alignmentConstraint.horizontal.length==0)&&(x.alignmentConstraint.horizontal=void 0)),x.relativePlacementConstraint&&(!Array.isArray(x.relativePlacementConstraint)||x.relativePlacementConstraint.length==0)&&(x.relativePlacementConstraint=void 0);var E=x.fixedNodeConstraint||x.alignmentConstraint||x.relativePlacementConstraint;E&&(x.tile=!1,x.packComponents=!1);var A=void 0,C=!1;if(N.layoutUtilities&&x.packComponents&&(A=N.layoutUtilities("get"),A||(A=N.layoutUtilities()),C=!0),O.nodes().length>0)if(C){var V=c.getTopMostNodes(x.eles.nodes());if(M=c.connectComponents(N,x.eles,V),M.forEach(function(ge){var le=ge.boundingBox();I.push({x:le.x1+le.w/2,y:le.y1+le.h/2})}),x.randomize&&M.forEach(function(ge){x.eles=ge,R.push(p(x))}),x.quality=="default"||x.quality=="proof"){var F=N.collection();if(x.tile){var B=new Map,Y=[],q=[],Q=0,$={nodeIndexes:B,xCoords:Y,yCoords:q},K=[];if(M.forEach(function(ge,le){ge.edges().length==0&&(ge.nodes().forEach(function(he,fe){F.merge(ge.nodes()[fe]),he.isParent()||($.nodeIndexes.set(ge.nodes()[fe].id(),Q++),$.xCoords.push(ge.nodes()[0].position().x),$.yCoords.push(ge.nodes()[0].position().y))}),K.push(le))}),F.length>1){var j=F.boundingBox();I.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),M.push(F),R.push($);for(var re=K.length-1;re>=0;re--)M.splice(K[re],1),R.splice(K[re],1),I.splice(K[re],1)}}M.forEach(function(ge,le){x.eles=ge,P.push(g(x,R[le])),c.relocateComponent(I[le],P[le],x)})}else M.forEach(function(ge,le){c.relocateComponent(I[le],R[le],x)});var U=new Set;if(M.length>1){var H=[],_=O.filter(function(ge){return ge.css("display")=="none"});M.forEach(function(ge,le){var he=void 0;if(x.quality=="draft"&&(he=R[le].nodeIndexes),ge.nodes().not(_).length>0){var fe={};fe.edges=[],fe.nodes=[];var ve=void 0;ge.nodes().not(_).forEach(function(ye){if(x.quality=="draft")if(!ye.isParent())ve=he.get(ye.id()),fe.nodes.push({x:R[le].xCoords[ve]-ye.boundingbox().w/2,y:R[le].yCoords[ve]-ye.boundingbox().h/2,width:ye.boundingbox().w,height:ye.boundingbox().h});else{var me=c.calcBoundingBox(ye,R[le].xCoords,R[le].yCoords,he);fe.nodes.push({x:me.topLeftX,y:me.topLeftY,width:me.width,height:me.height})}else P[le][ye.id()]&&fe.nodes.push({x:P[le][ye.id()].getLeft(),y:P[le][ye.id()].getTop(),width:P[le][ye.id()].getWidth(),height:P[le][ye.id()].getHeight()})}),ge.edges().forEach(function(ye){var me=ye.source(),xe=ye.target();if(me.css("display")!="none"&&xe.css("display")!="none")if(x.quality=="draft"){var Le=he.get(me.id()),ke=he.get(xe.id()),Fe=[],Be=[];if(me.isParent()){var Oe=c.calcBoundingBox(me,R[le].xCoords,R[le].yCoords,he);Fe.push(Oe.topLeftX+Oe.width/2),Fe.push(Oe.topLeftY+Oe.height/2)}else Fe.push(R[le].xCoords[Le]),Fe.push(R[le].yCoords[Le]);if(xe.isParent()){var ne=c.calcBoundingBox(xe,R[le].xCoords,R[le].yCoords,he);Be.push(ne.topLeftX+ne.width/2),Be.push(ne.topLeftY+ne.height/2)}else Be.push(R[le].xCoords[ke]),Be.push(R[le].yCoords[ke]);fe.edges.push({startX:Fe[0],startY:Fe[1],endX:Be[0],endY:Be[1]})}else P[le][me.id()]&&P[le][xe.id()]&&fe.edges.push({startX:P[le][me.id()].getCenterX(),startY:P[le][me.id()].getCenterY(),endX:P[le][xe.id()].getCenterX(),endY:P[le][xe.id()].getCenterY()})}),fe.nodes.length>0&&(H.push(fe),U.add(le))}});var W=A.packComponents(H,x.randomize).shifts;if(x.quality=="draft")R.forEach(function(ge,le){var he=ge.xCoords.map(function(ve){return ve+W[le].dx}),fe=ge.yCoords.map(function(ve){return ve+W[le].dy});ge.xCoords=he,ge.yCoords=fe});else{var J=0;U.forEach(function(ge){Object.keys(P[ge]).forEach(function(le){var he=P[ge][le];he.setCenter(he.getCenterX()+W[J].dx,he.getCenterY()+W[J].dy)}),J++})}}}else{var S=x.eles.boundingBox();if(I.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),x.randomize){var L=p(x);R.push(L)}x.quality=="default"||x.quality=="proof"?(P.push(g(x,R[0])),c.relocateComponent(I[0],P[0],x)):c.relocateComponent(I[0],R[0],x)}var te=function(le,he){if(x.quality=="default"||x.quality=="proof"){typeof le=="number"&&(le=he);var fe=void 0,ve=void 0,ye=le.data("id");return P.forEach(function(xe){ye in xe&&(fe={x:xe[ye].getRect().getCenterX(),y:xe[ye].getRect().getCenterY()},ve=xe[ye])}),x.nodeDimensionsIncludeLabels&&(ve.labelWidth&&(ve.labelPosHorizontal=="left"?fe.x+=ve.labelWidth/2:ve.labelPosHorizontal=="right"&&(fe.x-=ve.labelWidth/2)),ve.labelHeight&&(ve.labelPosVertical=="top"?fe.y+=ve.labelHeight/2:ve.labelPosVertical=="bottom"&&(fe.y-=ve.labelHeight/2))),fe==null&&(fe={x:le.position("x"),y:le.position("y")}),{x:fe.x,y:fe.y}}else{var me=void 0;return R.forEach(function(xe){var Le=xe.nodeIndexes.get(le.id());Le!=null&&(me={x:xe.xCoords[Le],y:xe.yCoords[Le]})}),me==null&&(me={x:le.position("x"),y:le.position("y")}),{x:me.x,y:me.y}}};if(x.quality=="default"||x.quality=="proof"||x.randomize){var de=c.calcParentsWithoutChildren(N,O),Te=O.filter(function(ge){return ge.css("display")=="none"});x.eles=O.not(Te),O.nodes().not(":parent").not(Te).layoutPositions(D,x,te),de.length>0&&de.forEach(function(ge){ge.position(te(ge))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();s.exports=m}),657:((s,u,l)=>{var f=l(548),h=l(140).layoutBase.Matrix,v=l(140).layoutBase.SVD,c=function(p){var y=p.cy,g=p.eles,b=g.nodes(),m=g.nodes(":parent"),w=new Map,T=new Map,D=new Map,x=[],N=[],O=[],R=[],P=[],M=[],I=[],E=[],A=void 0,C=1e8,S=1e-9,L=p.piTol,V=p.samplingType,F=p.nodeSeparation,B=void 0,Y=function(){for(var G=0,X=0,Z=!1;X<B;){G=Math.floor(Math.random()*A),Z=!1;for(var ae=0;ae<X;ae++)if(R[ae]==G){Z=!0;break}if(!Z)R[X]=G,X++;else continue}},q=function(G,X,Z){for(var ae=[],ee=0,ie=0,se=0,oe=void 0,ue=[],pe=0,ce=1,we=0;we<A;we++)ue[we]=C;for(ae[ie]=G,ue[G]=0;ie>=ee;){se=ae[ee++];for(var Ne=x[se],De=0;De<Ne.length;De++)oe=T.get(Ne[De]),ue[oe]==C&&(ue[oe]=ue[se]+1,ae[++ie]=oe);M[se][X]=ue[se]*F}if(Z){for(var Ee=0;Ee<A;Ee++)M[Ee][X]<P[Ee]&&(P[Ee]=M[Ee][X]);for(var ze=0;ze<A;ze++)P[ze]>pe&&(pe=P[ze],ce=ze)}return ce},Q=function(G){var X=void 0;if(G){X=Math.floor(Math.random()*A);for(var ae=0;ae<A;ae++)P[ae]=C;for(var ee=0;ee<B;ee++)R[ee]=X,X=q(X,ee,G)}else{Y();for(var Z=0;Z<B;Z++)q(R[Z],Z,G)}for(var ie=0;ie<A;ie++)for(var se=0;se<B;se++)M[ie][se]*=M[ie][se];for(var oe=0;oe<B;oe++)I[oe]=[];for(var ue=0;ue<B;ue++)for(var pe=0;pe<B;pe++)I[ue][pe]=M[R[pe]][ue]},$=function(){for(var G=v.svd(I),X=G.S,Z=G.U,ae=G.V,ee=X[0]*X[0]*X[0],ie=[],se=0;se<B;se++){ie[se]=[];for(var oe=0;oe<B;oe++)ie[se][oe]=0,se==oe&&(ie[se][oe]=X[se]/(X[se]*X[se]+ee/(X[se]*X[se])))}E=h.multMat(h.multMat(ae,ie),h.transpose(Z))},K=function(){for(var G=void 0,X=void 0,Z=[],ae=[],ee=[],ie=[],se=0;se<A;se++)Z[se]=Math.random(),ae[se]=Math.random();Z=h.normalize(Z),ae=h.normalize(ae);for(var oe=S,ue=S,pe=void 0;;){for(var ce=0;ce<A;ce++)ee[ce]=Z[ce];if(Z=h.multGamma(h.multL(h.multGamma(ee),M,E)),G=h.dotProduct(ee,Z),Z=h.normalize(Z),oe=h.dotProduct(ee,Z),pe=Math.abs(oe/ue),pe<=1+L&&pe>=1)break;ue=oe}for(var we=0;we<A;we++)ee[we]=Z[we];for(ue=S;;){for(var Ne=0;Ne<A;Ne++)ie[Ne]=ae[Ne];if(ie=h.minusOp(ie,h.multCons(ee,h.dotProduct(ee,ie))),ae=h.multGamma(h.multL(h.multGamma(ie),M,E)),X=h.dotProduct(ie,ae),ae=h.normalize(ae),oe=h.dotProduct(ie,ae),pe=Math.abs(oe/ue),pe<=1+L&&pe>=1)break;ue=oe}for(var De=0;De<A;De++)ie[De]=ae[De];N=h.multCons(ee,Math.sqrt(Math.abs(G))),O=h.multCons(ie,Math.sqrt(Math.abs(X)))};f.connectComponents(y,g,f.getTopMostNodes(b),w),m.forEach(function(z){f.connectComponents(y,g,f.getTopMostNodes(z.descendants().intersection(g)),w)});for(var j=0,re=0;re<b.length;re++)b[re].isParent()||T.set(b[re].id(),j++);var U=!0,H=!1,_=void 0;try{for(var W=w.keys()[Symbol.iterator](),J;!(U=(J=W.next()).done);U=!0){var te=J.value;T.set(te,j++)}}catch(z){H=!0,_=z}finally{try{!U&&W.return&&W.return()}finally{if(H)throw _}}for(var de=0;de<T.size;de++)x[de]=[];m.forEach(function(z){for(var G=z.children().intersection(g);G.nodes(":childless").length==0;)G=G.nodes()[0].children().intersection(g);var X=0,Z=G.nodes(":childless")[0].connectedEdges().length;G.nodes(":childless").forEach(function(ae,ee){ae.connectedEdges().length<Z&&(Z=ae.connectedEdges().length,X=ee)}),D.set(z.id(),G.nodes(":childless")[X].id())}),b.forEach(function(z){var G=void 0;z.isParent()?G=T.get(D.get(z.id())):G=T.get(z.id()),z.neighborhood().nodes().forEach(function(X){g.intersection(z.edgesWith(X)).length>0&&(X.isParent()?x[G].push(D.get(X.id())):x[G].push(X.id()))})});var Te=function(G){var X=T.get(G),Z=void 0;w.get(G).forEach(function(ae){y.getElementById(ae).isParent()?Z=D.get(ae):Z=ae,x[X].push(Z),x[T.get(Z)].push(G)})},ge=!0,le=!1,he=void 0;try{for(var fe=w.keys()[Symbol.iterator](),ve;!(ge=(ve=fe.next()).done);ge=!0){var ye=ve.value;Te(ye)}}catch(z){le=!0,he=z}finally{try{!ge&&fe.return&&fe.return()}finally{if(le)throw he}}A=T.size;var me=void 0;if(A>2){B=A<p.sampleSize?A:p.sampleSize;for(var xe=0;xe<A;xe++)M[xe]=[];for(var Le=0;Le<B;Le++)E[Le]=[];return p.quality=="draft"||p.step=="all"?(Q(V),$(),K(),me={nodeIndexes:T,xCoords:N,yCoords:O}):(T.forEach(function(z,G){N.push(y.getElementById(G).position("x")),O.push(y.getElementById(G).position("y"))}),me={nodeIndexes:T,xCoords:N,yCoords:O}),me}else{var ke=T.keys(),Fe=y.getElementById(ke.next().value),Be=Fe.position(),Oe=Fe.outerWidth();if(N.push(Be.x),O.push(Be.y),A==2){var ne=y.getElementById(ke.next().value),k=ne.outerWidth();N.push(Be.x+Oe/2+k/2+p.idealEdgeLength),O.push(Be.y)}return me={nodeIndexes:T,xCoords:N,yCoords:O},me}};s.exports={spectralLayout:c}}),579:((s,u,l)=>{var f=l(212),h=function(c){c&&c("layout","fcose",f)};typeof cytoscape<"u"&&h(cytoscape),s.exports=h}),140:(s=>{s.exports=r})},n={};function i(s){var u=n[s];if(u!==void 0)return u.exports;var l=n[s]={exports:{}};return a[s](l,l.exports,i),l.exports}var o=i(579);return o})()})})(mu);var G1=mu.exports;const U1=bd(G1);function Pn(t,e){return{selector:t,style:ld(e)}}function yh(t){Sr.use(t)}function H1(t){return t.target.id()}let Y1={targetId:H1},mh={contents:!1};function q1(){if(!mh.contents)return mh.contents=!0,yh(Kv),yh(U1)}function In(t,e,r){let a=getComputedStyle(t).getPropertyValue(e).trim();return a===""?r:a}let bh=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function Zv(t){return"grp-"+t.replace(/[^a-zA-Z0-9_-]+/g,"-")}function wh(t,e){let r=t.map(i=>i.id),a=t.map(i=>{let o=i.group;return{data:{id:i.id,label:i.label},classes:o!==void 0?Zv(o):""}}),n=e.filter(i=>r.includes(i.from)?r.includes(i.to_):!1).map((i,o)=>({data:{id:"__edge__"+o.toString(),source:i.from,target:i.to_,label:i.label}}));return a.concat(n)}function bs(t,e){let r=In(t,Vr.brand,"#3b6ea5"),a=In(t,Vr.textPrimary,"#1a1a1a"),n=In(t,Vr.border,"#d4d4d4"),i=In(t,Vr.surface,"#ffffff"),o=l=>l===0?r:bh[hd(l-1|0,bh.length)],s=[Pn("node",[["background-color",r],["border-width","2"],["border-color",i],["width","18"],["height","18"],["label","data(label)"],["color",a],["font-size","11px"],["text-valign","center"],["text-halign","right"],["text-margin-x","6"],["text-wrap","ellipsis"],["text-max-width","150"],["min-zoomed-font-size","7"]]),Pn("node:parent",[["background-color",n],["background-opacity","0.12"],["border-width","1"],["border-color",n],["text-valign","top"],["text-halign","center"],["font-size","12px"],["color",a],["padding","12"]]),Pn("edge",[["width","1.5"],["line-color",n],["target-arrow-color",n],["target-arrow-shape","triangle"],["arrow-scale","0.9"],["curve-style","bezier"]])],u=e.map((l,f)=>Pn("."+Zv(l),[["background-color",o(f)]]));return s.concat(u)}function Eh(t){switch(t){case"breadthfirst":return{name:"breadthfirst",fit:!0,padding:24,animate:!1,spacingFactor:1.1,nodeDimensionsIncludeLabels:!0,directed:!0};case"concentric":return{name:"concentric",fit:!0,padding:24,animate:!1,nodeDimensionsIncludeLabels:!0,minNodeSpacing:40};case"cose":return{name:"cose",fit:!0,padding:24,animate:!1,idealEdgeLength:90,nodeRepulsion:9e3,numIter:800,randomize:!0,componentSpacing:80};case"dagre":return{name:"dagre",fit:!0,padding:24,animate:!1,nodeDimensionsIncludeLabels:!0,rankDir:"BT",nodeSep:28,rankSep:56};case"fcose":return{name:"fcose",fit:!0,padding:24,animate:!1,nodeDimensionsIncludeLabels:!0,idealEdgeLength:80,nodeRepulsion:6e3,randomize:!0,quality:"proof",nodeSeparation:90,gravityCompound:1.5};default:return{name:t,fit:!0,padding:24,animate:!1}}}function va(t){return"var("+t+")"}function _1(t){return{background:va(Vr.surface),border:"1px solid "+va(Vr.border),height:t,overflow:"hidden",width:"100%",borderRadius:va(cd.md)}}let W1={color:va(Vr.textSecondary),fontSize:va(dd.sizeSm),padding:va(vd.lg)};function X1(t,e){return t.map(r=>r.id+"|"+r.label+"|"+Dh(r.group,"")).join(",")+"//"+e.map(r=>r.from+">"+r.to_).join(",")}function $1(t){let e=t.height,r=t.layout,a=t.onOpenNode,n=t.edges,i=t.nodes,o=r!==void 0?r:"dagre",s=e!==void 0?e:"520px",u=Oa(null),l=Oa(void 0),f=Oa(a);f.current=a;let h=Oa([i,n]);h.current=[i,n];let v=fd(),c=X1(i,n),d=Oa(!0);return Oi(()=>{let p=u.current;if(p==null)return;q1();let y=Sr({container:p,elements:wh(i,n),style:bs(p,Pi(i)),layout:Eh(o),minZoom:.2,maxZoom:3});y.on("tap","node",b=>Ah(f.current,m=>m(Y1.targetId(b)))),l.current=Eu(y);let g=new ResizeObserver(()=>{y.resize(),y.fit(24)});return g.observe(p),()=>{l.current=void 0,g.disconnect(),y.destroy()}},[]),Oi(()=>{if(d.current)d.current=!1;else{let p=l.current,y=u.current;if(p!==void 0&&y!=null){let g=xu(p),b=h.current,m=b[0];g.remove(g.elements()),g.add(wh(m,b[1])),g.style(bs(y,Pi(m))),g.layout(Eh(o)).run()}}},[c,o]),Oi(()=>{let p=l.current,y=u.current;if(p!==void 0&&y!=null){let g=h.current;xu(p).style(bs(y,Pi(g[0])))}},[v.preset]),i.length===0?da("div",{children:"No relationships to graph.",style:W1}):da("div",{ref:Eu(u),style:_1(s)})}let K1=$1,Z1="dagre",Qv={contents:Z1},Q1=da("span",{children:"◈","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});function Jv(t){let e=t.source,r=xh(e),a=Ed(e);return md("div",{children:[da(K1,{nodes:a.nodes,edges:a.edges,onOpenNode:n=>gd(e,r,n),layout:Qv.contents}),da("span",{children:pd([e],void 0,"row"),style:{fontSize:"11px",opacity:"0.7"}})],style:{display:"flex",flexDirection:"column",gap:"8px"}})}let lx={make:Jv};function fx(t,e){Ah(t,r=>{Qv.contents=r}),yd({id:"graph",label:"Graph",icon:Q1,arity:"Single",isCapable:(r,a)=>wd(r),render:r=>{let a=r[0];return a!==void 0?da(Jv,{source:a}):null},capability:"entity-ref fields — one or more *Id/*Ids foreign keys drawn as a node-link diagram (self-referential fields form trees)"})}export{lx as ModeView,Z1 as defaultLayout,Q1 as graphIcon,fx as init,Qv as layoutRef};
|