@reventlessdev/reventless-host-shell 3.0.0-alpha.78 → 3.0.0-alpha.80

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.
@@ -1,20 +1,20 @@
1
- import{h as Pa,b as ki}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import{p as td,t as Tu,g as Nh,h as Cu,b as vi,d as on,e as rd,i as ad,j as nd,k as id,l as ga,m as od,n as sd,q as ud,u as ld,v as fd,x as hd,f as cd,y as Su,z as Du,A as xn,B as vd,D as Gr,R as dd,S as gd,T as pd}from"./index-BXv7HRot.js";function yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{a as Au}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";function Mh(t){return on(nd(t),e=>{let r=e[1],a=e[0],n=rd(r),i=ad(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 ex(t){return Mh(t).length!==0}function Lu(t,e,r){return r?on(ga(od(Nh(t.dict,e),sd),[]),id):ud(ld(t.dict,e),[],a=>[a])}function tx(t){let e=Mh(t.schema),r=td(t),a={};r.forEach(l=>{a[l.key]=Tu(t,l)});let n=l=>l.length>8?l.slice(0,8)+"…":l,i=r.map(l=>({id:l.key,label:Tu(t,l),group:t.readModelName})),o=r.flatMap(l=>e.flatMap(f=>{let h=f[1];return Lu(l,f[0],f[2]).map(v=>{let c=Nh(a,v);return c!==void 0?{id:v,label:c,group:t.readModelName}:{id:v,label:n(v),group:Cu(h)}})})),s=vi(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 Lu(l,h,f[2]).map(v=>({from:l.key,to_:v,label:Cu(h)}))}));return{nodes:s,edges:u}}function md(t){return vi(t,[],(e,r)=>{let a=r.group;return a!==void 0&&!e.includes(a)?e.concat([a]):e})}function xs(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 bd(t){if(Array.isArray(t))return t}function wd(t){if(Array.isArray(t))return xs(t)}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ed(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,Oh(a.key),a)}}function Ar(t,e,r){return e&&Ed(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=_s(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.
1
+ import{h as Pa,b as ki}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import{p as td,t as Tu,b as Nh,h as Cu,d as vi,e as on,i as rd,j as ad,k as nd,l as id,g as Hr,m as od,n as sd,q as ud,u as ld,v as fd,x as hd,f as cd,y as Su,z as Du,A as xn,B as vd,D as Gr,R as dd,E as gd,F as pd}from"./index-pVLf0Xc0.js";function yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{a as Au}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";function Mh(t){return on(nd(t),e=>{let r=e[1],a=e[0],n=rd(r),i=ad(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 ex(t){return Mh(t).length!==0}function Lu(t,e,r){return r?on(Hr(od(Nh(t.dict,e),sd),[]),id):ud(ld(t.dict,e),[],a=>[a])}function tx(t){let e=Mh(t.schema),r=td(t),a={};r.forEach(l=>{a[l.key]=Tu(t,l)});let n=l=>l.length>8?l.slice(0,8)+"…":l,i=r.map(l=>({id:l.key,label:Tu(t,l),group:t.readModelName})),o=r.flatMap(l=>e.flatMap(f=>{let h=f[1];return Lu(l,f[0],f[2]).map(v=>{let c=Nh(a,v);return c!==void 0?{id:v,label:c,group:t.readModelName}:{id:v,label:n(v),group:Cu(h)}})})),s=vi(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 Lu(l,h,f[2]).map(v=>({from:l.key,to_:v,label:Cu(h)}))}));return{nodes:s,edges:u}}function md(t){return vi(t,[],(e,r)=>{let a=r.group;return a!==void 0&&!e.includes(a)?e.concat([a]):e})}function xs(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 bd(t){if(Array.isArray(t))return t}function wd(t){if(Array.isArray(t))return xs(t)}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ed(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,Oh(a.key),a)}}function Ar(t,e,r){return e&&Ed(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=_s(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 Rh(t,e,r){return(e=Oh(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xd(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Td(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 Cd(){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 Sd(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(t,e){return bd(t)||Td(t,e)||_s(t,e)||Cd()}function Zn(t){return wd(t)||xd(t)||_s(t)||Sd()}function Dd(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 Oh(t){var e=Dd(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 _s(t,e){if(t){if(typeof t=="string")return xs(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)?xs(t,e):void 0}}var ct=typeof window>"u"?null:window,Nu=ct?ct.navigator:null;ct&&ct.document;var Ad=dt(""),Ph=dt({}),Ld=dt(function(){}),Nd=typeof HTMLElement>"u"?"undefined":dt(HTMLElement),sn=function(e){return e&&e.instanceString&&it(e.instanceString)?e.instanceString():null},Me=function(e){return e!=null&&dt(e)==Ad},it=function(e){return e!=null&&dt(e)===Ld},Je=function(e){return!Bt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},_e=function(e){return e!=null&&dt(e)===Ph&&!Je(e)&&e.constructor===Object},Md=function(e){return e!=null&&dt(e)===Ph},be=function(e){return e!=null&&dt(e)===dt(1)&&!isNaN(e)},Rd=function(e){return be(e)&&Math.floor(e)===e},Qn=function(e){if(Nd!=="undefined")return e!=null&&e instanceof HTMLElement},Bt=function(e){return un(e)||Ih(e)},un=function(e){return sn(e)==="collection"&&e._private.single},Ih=function(e){return sn(e)==="collection"&&!e._private.single},Ws=function(e){return sn(e)==="core"},kh=function(e){return sn(e)==="stylesheet"},Od=function(e){return sn(e)==="event"},br=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Pd=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Id=function(e){return _e(e)&&be(e.x1)&&be(e.x2)&&be(e.y1)&&be(e.y2)},kd=function(e){return Md(e)&&it(e.then)},Bd=function(){return Nu&&Nu.userAgent.match(/msie|trident|edge/i)},pa=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},Xs=pa(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),di=pa(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Bh=pa(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Mu=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+)?))",Fd="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",zd="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",Vd="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",Gd="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",Ud="\\#[0-9a-fA-F]{3}",Hd="\\#[0-9a-fA-F]{6}",Fh=function(e,r){return e<r?-1:e>r?1:0},Yd=function(e,r){return-1*Fh(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},qd=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("^"+Vd+"$").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},Wd=function(e){var r,a=new RegExp("^"+Fd+"$").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},Xd=function(e){return $d[e.toLowerCase()]},zh=function(e){return(Je(e)?e:null)||Xd(e)||qd(e)||Wd(e)||_d(e)},$d={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]},Vh=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}},Gh=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},Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bi,Ru;function fn(){if(Ru)return Bi;Ru=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Bi=t,Bi}var Fi,Ou;function Kd(){if(Ou)return Fi;Ou=1;var t=typeof Tn=="object"&&Tn&&Tn.Object===Object&&Tn;return Fi=t,Fi}var zi,Pu;function gi(){if(Pu)return zi;Pu=1;var t=Kd(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return zi=r,zi}var Vi,Iu;function Zd(){if(Iu)return Vi;Iu=1;var t=gi(),e=function(){return t.Date.now()};return Vi=e,Vi}var Gi,ku;function Qd(){if(ku)return Gi;ku=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return Gi=e,Gi}var Ui,Bu;function Jd(){if(Bu)return Ui;Bu=1;var t=Qd(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return Ui=r,Ui}var Hi,Fu;function $s(){if(Fu)return Hi;Fu=1;var t=gi(),e=t.Symbol;return Hi=e,Hi}var Yi,zu;function jd(){if(zu)return Yi;zu=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 Yi=i,Yi}var qi,Vu;function eg(){if(Vu)return qi;Vu=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return qi=r,qi}var _i,Gu;function Uh(){if(Gu)return _i;Gu=1;var t=$s(),e=jd(),r=eg(),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 _i=o,_i}var Wi,Uu;function tg(){if(Uu)return Wi;Uu=1;function t(e){return e!=null&&typeof e=="object"}return Wi=t,Wi}var Xi,Hu;function hn(){if(Hu)return Xi;Hu=1;var t=Uh(),e=tg(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return Xi=a,Xi}var $i,Yu;function rg(){if(Yu)return $i;Yu=1;var t=Jd(),e=fn(),r=hn(),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 $i=u,$i}var Ki,qu;function ag(){if(qu)return Ki;qu=1;var t=fn(),e=Zd(),r=rg(),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 Ki=o,Ki}var ng=ag(),cn=ln(ng),Zi=ct?ct.performance:null,Hh=Zi&&Zi.now?function(){return Zi.now()}:function(){return Date.now()},ig=(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(Hh())},1e3/60)}})(),Jn=function(e){return ig(e)},ir=Hh,Fr=9261,Yh=65599,oa=5381,qh=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*Yh+n.value|0;return a},$a=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr;return r*Yh+e|0},Ka=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oa;return(r<<5)+r+e|0},og=function(e,r){return e*2097152+r},hr=function(e){return e[0]*2097152+e[1]},Cn=function(e,r){return[$a(e[0],r[0]),Ka(e[1],r[1])]},_u=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 qh(o,r)},Hr=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 qh(o,r)},_h=function(){return sg(arguments)},sg=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=Hr(n):r=Hr(n,r)}return r};function ug(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 lg=function(e,r,a,n,i,o){return{x:(e-a)*i+a,y:(r-n)*o+n}};function fg(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=ug(t.x,t.y,a,n,r),u=lg(s.x,s.y,a,n,i,o);return{x:u.x,y:u.y}}var Wu=!0,hg=console.warn!=null,cg=console.trace!=null,Ks=Number.MAX_SAFE_INTEGER||9007199254740991,Wh=function(){return!0},jn=function(){return!1},Xu=function(){return 0},Zs=function(){},nt=function(e){throw new Error(e)},Xh=function(e){if(e!==void 0)Wu=!!e;else return Wu},Ke=function(e){Xh()&&(hg?console.warn(e):(console.log(e),cg&&console.trace()))},vg=function(e){return Ie({},e)},Qt=function(e){return e==null?e:Je(e)?e.slice():_e(e)?vg(e):e},dg=function(e){return e.slice()},$h=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},gg={},Kh=function(){return gg},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)},Qs=function(e){e.splice(0,e.length)},pg=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=Bh(a,r)),e[r]},Zt=function(e,r,a,n){a&&(r=Bh(a,r)),e[r]=n},yg=(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:yg,mg="undefined",bg=(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)}}])})(),Ta=(typeof Set>"u"?"undefined":dt(Set))!==mg?Set:bg,pi=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ws(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 Ta,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))},$u=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)}}},Za={breadthFirstSearch:$u({bfs:!0}),depthFirstSearch:$u({dfs:!0})};Za.bfs=Za.breadthFirstSearch;Za.dfs=Za.depthFirstSearch;var Fn={exports:{}},wg=Fn.exports,Ku;function Eg(){return Ku||(Ku=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(wg)})(Fn)),Fn.exports}var Qi,Zu;function xg(){return Zu||(Zu=1,Qi=Eg()),Qi}var Tg=xg(),vn=ln(Tg),Cg=Tt({root:null,weight:function(e){return 1},directed:!1}),Sg={dijkstra:function(e){if(!_e(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=Cg(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 vn(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)}}}},Dg={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}},Ag=Tt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Lg={aStar:function(e){var r=this.cy(),a=Ag(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 vn(function(F,B){return v[F.id()]-v[B.id()]}),p=new Ta,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}}},Ng=Tt({weight:function(e){return 1},directed:!1}),Mg={floydWarshall:function(e){for(var r=this.cy(),a=Ng(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}},Rg=Tt({weight:function(e){return 1},directed:!1,root:null}),Og={bellmanFord:function(e){var r=this,a=Rg(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}}},Pg=Math.sqrt(2),Ig=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},Ji=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=Ig(i,e,r),a--}return r},kg={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/Pg);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=Ji(p,l.slice(),i,u),T=w.slice();g(p,y);var D=Ji(p,w,u,2),x=Ji(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}},ji,Bg=function(e){return{x:e.x,y:e.y}},yi=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},Zh=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},sa=function(e){return{x:e[0],y:e[1]}},Fg=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},zg=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},Vg=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},Gg=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},Ug=function(e){return Math.PI*e/180},Sn=function(e,r){return Math.atan2(r,e)-Math.PI/2},Js=Math.log2||function(t){return Math.log(t)/Math.log(2)},js=function(e){return e>0?1:e<0?-1:0},Yr=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},Hg=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},fa=function(e,r,a,n){return{x:mt(e.x,r.x,a.x,n),y:mt(e.y,r.y,a.y,n)}},Yg=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=Yr(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}},Qa=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}}},qg=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},Wg=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},Qh=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},zn=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},Vn=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},Qu=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},eu=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},Ju=function(e,r){return gr(e,r.x,r.y)},Jh=function(e,r){return gr(e,r.x1,r.y1)&&gr(e,r.x2,r.y2)},Xg=(ji=Math.hypot)!==null&&ji!==void 0?ji:function(t,e){return Math.sqrt(t*t+e*e)};function $g(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=Xg(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 Kg(t,e,r,a,n,i){var o=np(t,e,r,a,n),s=$g(o,i),u=Rt();return s.forEach(function(l){return Qh(u,l.x,l.y)}),u}var jh=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=Ua(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=Ua(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=Ua(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=Ua(e,r,a,n,Y,q,l+s),A.length>0&&A[0]<=Y&&A[1]>=q)return[A[0],A[1]]}return[]},Zg=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},Qg=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)},Jg=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]},jg=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)},ep=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=[];jg(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},tp=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=ti(f,-l);p=ei(y)}else p=f;return It(e,r,p)},rp=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)},ei=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},ti=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},ap=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]},Ur=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},Ua=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]},eo=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?eo(e,a,s)===s?[s,u]:eo(e,a,i)===i?[i,o]:eo(i,s,a)===a?[a,n]:[]:[]},np=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},Ja=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=ti(h,-u);c=ei(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},ip=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=Ua(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},Dn=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=Ts(e,r);return a=ec(a),a},ec=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},Ts=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)},tc=function(e,r){return Math.min(e/10,r/10,8)},tu=function(){return 8},op=function(e,r,a){return[e-2*r+a,2*(r-e),e]},Cs=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function to(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(Zn(r(t)),Zn(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 sp=Tt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),up={pageRank:function(e){for(var r=sp(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[$]}Hg(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}},ju=Tt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ha={degreeCentralityNormalized:function(e){e=ju(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=ju(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)}}}};ha.dc=ha.degreeCentrality;ha.dcn=ha.degreeCentralityNormalised=ha.degreeCentralityNormalized;var el=Tt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),ca={closenessCentralityNormalized:function(e){for(var r=el(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=el(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}};ca.cc=ca.closenessCentrality;ca.ccn=ca.closenessCentralityNormalised=ca.closenessCentralityNormalized;var lp=Tt({weight:null,directed:!1}),Ss={betweennessCentrality:function(e){for(var r=lp(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 vn(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}};Ss.bc=Ss.betweennessCentrality;var fp=Tt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),hp=function(e){return fp(e)},cp=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},vp=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},rc=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}},dp=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},gp=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=dp(e,n,r);return e},pp=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 rc(n,r),n},yp=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},mp=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},bp=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},wp=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&bp(e[r],e[a])&&e.splice(a,1);return e},tl=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=hp(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=cp(d,i.attributes);f[p*u+y]+=g,f[y*u+p]+=g}vp(f,u,i.multFactor),rc(f,u);for(var b=!0,m=0;b&&m<i.maxIterations;)b=!1,h=gp(f,u,i.expandFactor),f=pp(h,u,i.inflateFactor),yp(f,h,l,4)||(b=!0),m++;var w=mp(f,u,r,n);return w=wp(w),w},Ep={markovClustering:tl,mcl:tl},xp=function(e){return e},ac=function(e,r){return Math.abs(r-e)},rl=function(e,r,a){return e+ac(r,a)},al=function(e,r,a){return e+Math.pow(a-r,2)},Tp=function(e){return Math.sqrt(e)},Cp=function(e,r,a){return Math.max(e,ac(r,a))},Ia=function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:xp,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},ya={euclidean:function(e,r,a){return e>=2?Ia(e,r,a,0,al,Tp):Ia(e,r,a,0,rl)},squaredEuclidean:function(e,r,a){return Ia(e,r,a,0,al)},manhattan:function(e,r,a){return Ia(e,r,a,0,rl)},max:function(e,r,a){return Ia(e,r,a,-1/0,Cp)}};ya["squared-euclidean"]=ya.squaredEuclidean;ya.squaredeuclidean=ya.squaredEuclidean;function mi(t,e,r,a,n,i){var o;return it(t)?o=t:o=ya[t]||ya.euclidean,e===0&&it(t)?o(n,i):o(e,r,a,n,i)}var Sp=Tt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ru=function(e){return Sp(e)},ri=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 mi(e,n.length,s,u,l,f)},ro=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},nc=function(e,r,a,n,i){for(var o=1/0,s=0,u=0;u<r.length;u++){var l=ri(a,e,r[u],n,i);l<o&&(o=l,s=u)}return s},ic=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},Dp=function(e,r,a){return Math.abs(r-e)<=a},Ap=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},Lp=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},nl=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)];Lp(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},il=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=ri("manhattan",r[i],e,a,"kMedoids");return n},Np=function(e){var r=this.cy(),a=this.nodes(),n=null,i=ru(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=ro(a,i.k,i.attributes)):dt(i.testCentroids)==="object"?u=i.testCentroids:u=ro(a,i.k,i.attributes):u=ro(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()]=nc(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var v=0;v<i.k;v++){var c=ic(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,Dp(y[b],p[b],i.sensitivityThreshold)||(l=!0)}u[v]=y,o[v]=r.collection(c)}}f++}return o},Mp=function(e){var r=this.cy(),a=this.nodes(),n=null,i=ru(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=nl(a,i.k)):s=nl(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()]=nc(n,s,i.distance,i.attributes,"kMedoids");h=!1;for(var d=0;d<s.length;d++){var p=ic(d,a,u);if(p.length!==0){f[d]=il(s[d],p,i.attributes);for(var y=0;y<p.length;y++)l=il(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},Rp=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}},Op=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=ri(i.distance,n[v],a[h],i.attributes,"cmeans"),l=ri(i.distance,n[v],a[c],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[v][h]=1/s}},Pp=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},ol=function(e){var r=this.cy(),a=this.nodes(),n=ru(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,Rp(o,a,s,l,n),Op(s,u,o,a,n),Ap(s,u,n.sensitivityThreshold)||(b=!0),m++;return i=Pp(a,s,n,r),{clusters:i,degreeOfMembership:s}},Ip={kMeans:Np,kMedoids:Mp,fuzzyCMeans:ol,fcm:ol},kp=Tt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Bp={single:"min",complete:"max"},Fp=function(e){var r=kp(e),a=Bp[r.linkage];return a!=null&&(r.linkage=a),r},sl=function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(O,R){return mi(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},ua=function(e,r,a){e&&(e.value?r.push(e.value):(e.left&&ua(e.left,r),e.right&&ua(e.right,r)))},Ds=function(e,r){if(!e)return"";if(e.left&&e.right){var a=Ds(e.left,r),n=Ds(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()},As=function(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&ua(e.left,n),e.right&&ua(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&ua(e.left,n),e.right&&ua(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=As(e.left,r-1,a)),e.right&&(i=As(e.right,r-1,a)),n.concat(i))},ul=function(e){for(var r=this.cy(),a=this.nodes(),n=Fp(e),i=n.attributes,o=function(m,w){return mi(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=sl(s,f,u,l,n);y;)y=sl(s,f,u,l,n);var g;return n.mode==="dendrogram"?(g=As(s[0],n.dendrogramDepth,r),n.addDendrogram&&Ds(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},zp={hierarchicalClustering:ul,hca:ul},Vp=Tt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Gp=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)),Vp(e)},Up=function(e,r,a,n){var i=function(s,u){return n[u](s)};return-mi(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},Hp=function(e,r){var a=null;return r==="median"?a=Gg(e):r==="mean"?a=Vg(e):r==="min"?a=Fg(e):r==="max"?a=zg(e):a=r,a},Yp=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},ll=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},qp=function(e,r,a){for(var n=ll(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=ll(e,r,a),n},fl=function(e){for(var r=this.cy(),a=this.nodes(),n=Gp(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]=Up(n.distance,a[d],a[p],n.attributes));f=Hp(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=Yp(s,h,v),re=qp(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:fl,ap:fl},Wp=Tt({root:void 0,directed:!1}),Xp={hierholzer:function(e){if(!_e(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Wp(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}},An=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}},$p={hopcroftTarjanBiconnected:An,htbc:An,htb:An,hopcroftTarjanBiconnectedComponents:An},Ln=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}},Kp={tarjanStronglyConnected:Ln,tsc:Ln,tscc:Ln,tarjanStronglyConnectedComponents:Ln},oc={};[Za,Sg,Dg,Lg,Mg,Og,kg,up,ha,ca,Ss,Ep,Ip,zp,_p,Xp,$p,Kp].forEach(function(t){Ie(oc,t)});/*!
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(t,e){return bd(t)||Td(t,e)||_s(t,e)||Cd()}function Zn(t){return wd(t)||xd(t)||_s(t)||Sd()}function Dd(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 Oh(t){var e=Dd(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 _s(t,e){if(t){if(typeof t=="string")return xs(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)?xs(t,e):void 0}}var ct=typeof window>"u"?null:window,Nu=ct?ct.navigator:null;ct&&ct.document;var Ad=dt(""),Ph=dt({}),Ld=dt(function(){}),Nd=typeof HTMLElement>"u"?"undefined":dt(HTMLElement),sn=function(e){return e&&e.instanceString&&it(e.instanceString)?e.instanceString():null},Me=function(e){return e!=null&&dt(e)==Ad},it=function(e){return e!=null&&dt(e)===Ld},Je=function(e){return!Bt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},_e=function(e){return e!=null&&dt(e)===Ph&&!Je(e)&&e.constructor===Object},Md=function(e){return e!=null&&dt(e)===Ph},be=function(e){return e!=null&&dt(e)===dt(1)&&!isNaN(e)},Rd=function(e){return be(e)&&Math.floor(e)===e},Qn=function(e){if(Nd!=="undefined")return e!=null&&e instanceof HTMLElement},Bt=function(e){return un(e)||Ih(e)},un=function(e){return sn(e)==="collection"&&e._private.single},Ih=function(e){return sn(e)==="collection"&&!e._private.single},Ws=function(e){return sn(e)==="core"},kh=function(e){return sn(e)==="stylesheet"},Od=function(e){return sn(e)==="event"},br=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Pd=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Id=function(e){return _e(e)&&be(e.x1)&&be(e.x2)&&be(e.y1)&&be(e.y2)},kd=function(e){return Md(e)&&it(e.then)},Bd=function(){return Nu&&Nu.userAgent.match(/msie|trident|edge/i)},pa=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},Xs=pa(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),di=pa(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Bh=pa(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Mu=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+)?))",Fd="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",zd="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",Vd="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",Gd="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",Ud="\\#[0-9a-fA-F]{3}",Hd="\\#[0-9a-fA-F]{6}",Fh=function(e,r){return e<r?-1:e>r?1:0},Yd=function(e,r){return-1*Fh(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},qd=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("^"+Vd+"$").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},Wd=function(e){var r,a=new RegExp("^"+Fd+"$").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},Xd=function(e){return $d[e.toLowerCase()]},zh=function(e){return(Je(e)?e:null)||Xd(e)||qd(e)||Wd(e)||_d(e)},$d={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]},Vh=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}},Gh=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},Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bi,Ru;function fn(){if(Ru)return Bi;Ru=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Bi=t,Bi}var Fi,Ou;function Kd(){if(Ou)return Fi;Ou=1;var t=typeof Tn=="object"&&Tn&&Tn.Object===Object&&Tn;return Fi=t,Fi}var zi,Pu;function gi(){if(Pu)return zi;Pu=1;var t=Kd(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return zi=r,zi}var Vi,Iu;function Zd(){if(Iu)return Vi;Iu=1;var t=gi(),e=function(){return t.Date.now()};return Vi=e,Vi}var Gi,ku;function Qd(){if(ku)return Gi;ku=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return Gi=e,Gi}var Ui,Bu;function Jd(){if(Bu)return Ui;Bu=1;var t=Qd(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return Ui=r,Ui}var Hi,Fu;function $s(){if(Fu)return Hi;Fu=1;var t=gi(),e=t.Symbol;return Hi=e,Hi}var Yi,zu;function jd(){if(zu)return Yi;zu=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 Yi=i,Yi}var qi,Vu;function eg(){if(Vu)return qi;Vu=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return qi=r,qi}var _i,Gu;function Uh(){if(Gu)return _i;Gu=1;var t=$s(),e=jd(),r=eg(),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 _i=o,_i}var Wi,Uu;function tg(){if(Uu)return Wi;Uu=1;function t(e){return e!=null&&typeof e=="object"}return Wi=t,Wi}var Xi,Hu;function hn(){if(Hu)return Xi;Hu=1;var t=Uh(),e=tg(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return Xi=a,Xi}var $i,Yu;function rg(){if(Yu)return $i;Yu=1;var t=Jd(),e=fn(),r=hn(),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 $i=u,$i}var Ki,qu;function ag(){if(qu)return Ki;qu=1;var t=fn(),e=Zd(),r=rg(),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 Ki=o,Ki}var ng=ag(),cn=ln(ng),Zi=ct?ct.performance:null,Hh=Zi&&Zi.now?function(){return Zi.now()}:function(){return Date.now()},ig=(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(Hh())},1e3/60)}})(),Jn=function(e){return ig(e)},ir=Hh,Fr=9261,Yh=65599,sa=5381,qh=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*Yh+n.value|0;return a},$a=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr;return r*Yh+e|0},Ka=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sa;return(r<<5)+r+e|0},og=function(e,r){return e*2097152+r},hr=function(e){return e[0]*2097152+e[1]},Cn=function(e,r){return[$a(e[0],r[0]),Ka(e[1],r[1])]},_u=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 qh(o,r)},Yr=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 qh(o,r)},_h=function(){return sg(arguments)},sg=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=Yr(n):r=Yr(n,r)}return r};function ug(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 lg=function(e,r,a,n,i,o){return{x:(e-a)*i+a,y:(r-n)*o+n}};function fg(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=ug(t.x,t.y,a,n,r),u=lg(s.x,s.y,a,n,i,o);return{x:u.x,y:u.y}}var Wu=!0,hg=console.warn!=null,cg=console.trace!=null,Ks=Number.MAX_SAFE_INTEGER||9007199254740991,Wh=function(){return!0},jn=function(){return!1},Xu=function(){return 0},Zs=function(){},nt=function(e){throw new Error(e)},Xh=function(e){if(e!==void 0)Wu=!!e;else return Wu},Ke=function(e){Xh()&&(hg?console.warn(e):(console.log(e),cg&&console.trace()))},vg=function(e){return Ie({},e)},Qt=function(e){return e==null?e:Je(e)?e.slice():_e(e)?vg(e):e},dg=function(e){return e.slice()},$h=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},gg={},Kh=function(){return gg},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)},Qs=function(e){e.splice(0,e.length)},pg=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=Bh(a,r)),e[r]},Zt=function(e,r,a,n){a&&(r=Bh(a,r)),e[r]=n},yg=(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:yg,mg="undefined",bg=(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)}}])})(),Ta=(typeof Set>"u"?"undefined":dt(Set))!==mg?Set:bg,pi=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ws(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 Ta,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))},$u=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)}}},Za={breadthFirstSearch:$u({bfs:!0}),depthFirstSearch:$u({dfs:!0})};Za.bfs=Za.breadthFirstSearch;Za.dfs=Za.depthFirstSearch;var Fn={exports:{}},wg=Fn.exports,Ku;function Eg(){return Ku||(Ku=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(wg)})(Fn)),Fn.exports}var Qi,Zu;function xg(){return Zu||(Zu=1,Qi=Eg()),Qi}var Tg=xg(),vn=ln(Tg),Cg=Tt({root:null,weight:function(e){return 1},directed:!1}),Sg={dijkstra:function(e){if(!_e(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=Cg(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 vn(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)}}}},Dg={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}},Ag=Tt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Lg={aStar:function(e){var r=this.cy(),a=Ag(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 vn(function(F,B){return v[F.id()]-v[B.id()]}),p=new Ta,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}}},Ng=Tt({weight:function(e){return 1},directed:!1}),Mg={floydWarshall:function(e){for(var r=this.cy(),a=Ng(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}},Rg=Tt({weight:function(e){return 1},directed:!1,root:null}),Og={bellmanFord:function(e){var r=this,a=Rg(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}}},Pg=Math.sqrt(2),Ig=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},Ji=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=Ig(i,e,r),a--}return r},kg={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/Pg);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=Ji(p,l.slice(),i,u),T=w.slice();g(p,y);var D=Ji(p,w,u,2),x=Ji(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}},ji,Bg=function(e){return{x:e.x,y:e.y}},yi=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},Zh=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},ua=function(e){return{x:e[0],y:e[1]}},Fg=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},zg=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},Vg=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},Gg=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},Ug=function(e){return Math.PI*e/180},Sn=function(e,r){return Math.atan2(r,e)-Math.PI/2},Js=Math.log2||function(t){return Math.log(t)/Math.log(2)},js=function(e){return e>0?1:e<0?-1:0},qr=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},Hg=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},ha=function(e,r,a,n){return{x:mt(e.x,r.x,a.x,n),y:mt(e.y,r.y,a.y,n)}},Yg=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=qr(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}},Qa=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}}},qg=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},Wg=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},Qh=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},zn=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},Vn=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},Qu=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},eu=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},Ju=function(e,r){return gr(e,r.x,r.y)},Jh=function(e,r){return gr(e,r.x1,r.y1)&&gr(e,r.x2,r.y2)},Xg=(ji=Math.hypot)!==null&&ji!==void 0?ji:function(t,e){return Math.sqrt(t*t+e*e)};function $g(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=Xg(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 Kg(t,e,r,a,n,i){var o=np(t,e,r,a,n),s=$g(o,i),u=Rt();return s.forEach(function(l){return Qh(u,l.x,l.y)}),u}var jh=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=Ua(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=Ua(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=Ua(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=Ua(e,r,a,n,Y,q,l+s),A.length>0&&A[0]<=Y&&A[1]>=q)return[A[0],A[1]]}return[]},Zg=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},Qg=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)},Jg=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]},jg=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)},ep=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=[];jg(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},tp=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=ti(f,-l);p=ei(y)}else p=f;return It(e,r,p)},rp=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)},ei=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},ti=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},ap=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]},Ur=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},Ua=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]},eo=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?eo(e,a,s)===s?[s,u]:eo(e,a,i)===i?[i,o]:eo(i,s,a)===a?[a,n]:[]:[]},np=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},Ja=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=ti(h,-u);c=ei(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},ip=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=Ua(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},Dn=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=Ts(e,r);return a=ec(a),a},ec=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},Ts=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)},tc=function(e,r){return Math.min(e/10,r/10,8)},tu=function(){return 8},op=function(e,r,a){return[e-2*r+a,2*(r-e),e]},Cs=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function to(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(Zn(r(t)),Zn(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 sp=Tt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),up={pageRank:function(e){for(var r=sp(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[$]}Hg(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}},ju=Tt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ca={degreeCentralityNormalized:function(e){e=ju(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=ju(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)}}}};ca.dc=ca.degreeCentrality;ca.dcn=ca.degreeCentralityNormalised=ca.degreeCentralityNormalized;var el=Tt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),va={closenessCentralityNormalized:function(e){for(var r=el(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=el(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}};va.cc=va.closenessCentrality;va.ccn=va.closenessCentralityNormalised=va.closenessCentralityNormalized;var lp=Tt({weight:null,directed:!1}),Ss={betweennessCentrality:function(e){for(var r=lp(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 vn(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}};Ss.bc=Ss.betweennessCentrality;var fp=Tt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),hp=function(e){return fp(e)},cp=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},vp=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},rc=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}},dp=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},gp=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=dp(e,n,r);return e},pp=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 rc(n,r),n},yp=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},mp=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},bp=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},wp=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&bp(e[r],e[a])&&e.splice(a,1);return e},tl=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=hp(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=cp(d,i.attributes);f[p*u+y]+=g,f[y*u+p]+=g}vp(f,u,i.multFactor),rc(f,u);for(var b=!0,m=0;b&&m<i.maxIterations;)b=!1,h=gp(f,u,i.expandFactor),f=pp(h,u,i.inflateFactor),yp(f,h,l,4)||(b=!0),m++;var w=mp(f,u,r,n);return w=wp(w),w},Ep={markovClustering:tl,mcl:tl},xp=function(e){return e},ac=function(e,r){return Math.abs(r-e)},rl=function(e,r,a){return e+ac(r,a)},al=function(e,r,a){return e+Math.pow(a-r,2)},Tp=function(e){return Math.sqrt(e)},Cp=function(e,r,a){return Math.max(e,ac(r,a))},Ia=function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:xp,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},ya={euclidean:function(e,r,a){return e>=2?Ia(e,r,a,0,al,Tp):Ia(e,r,a,0,rl)},squaredEuclidean:function(e,r,a){return Ia(e,r,a,0,al)},manhattan:function(e,r,a){return Ia(e,r,a,0,rl)},max:function(e,r,a){return Ia(e,r,a,-1/0,Cp)}};ya["squared-euclidean"]=ya.squaredEuclidean;ya.squaredeuclidean=ya.squaredEuclidean;function mi(t,e,r,a,n,i){var o;return it(t)?o=t:o=ya[t]||ya.euclidean,e===0&&it(t)?o(n,i):o(e,r,a,n,i)}var Sp=Tt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ru=function(e){return Sp(e)},ri=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 mi(e,n.length,s,u,l,f)},ro=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},nc=function(e,r,a,n,i){for(var o=1/0,s=0,u=0;u<r.length;u++){var l=ri(a,e,r[u],n,i);l<o&&(o=l,s=u)}return s},ic=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},Dp=function(e,r,a){return Math.abs(r-e)<=a},Ap=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},Lp=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},nl=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)];Lp(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},il=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=ri("manhattan",r[i],e,a,"kMedoids");return n},Np=function(e){var r=this.cy(),a=this.nodes(),n=null,i=ru(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=ro(a,i.k,i.attributes)):dt(i.testCentroids)==="object"?u=i.testCentroids:u=ro(a,i.k,i.attributes):u=ro(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()]=nc(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var v=0;v<i.k;v++){var c=ic(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,Dp(y[b],p[b],i.sensitivityThreshold)||(l=!0)}u[v]=y,o[v]=r.collection(c)}}f++}return o},Mp=function(e){var r=this.cy(),a=this.nodes(),n=null,i=ru(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=nl(a,i.k)):s=nl(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()]=nc(n,s,i.distance,i.attributes,"kMedoids");h=!1;for(var d=0;d<s.length;d++){var p=ic(d,a,u);if(p.length!==0){f[d]=il(s[d],p,i.attributes);for(var y=0;y<p.length;y++)l=il(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},Rp=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}},Op=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=ri(i.distance,n[v],a[h],i.attributes,"cmeans"),l=ri(i.distance,n[v],a[c],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[v][h]=1/s}},Pp=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},ol=function(e){var r=this.cy(),a=this.nodes(),n=ru(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,Rp(o,a,s,l,n),Op(s,u,o,a,n),Ap(s,u,n.sensitivityThreshold)||(b=!0),m++;return i=Pp(a,s,n,r),{clusters:i,degreeOfMembership:s}},Ip={kMeans:Np,kMedoids:Mp,fuzzyCMeans:ol,fcm:ol},kp=Tt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Bp={single:"min",complete:"max"},Fp=function(e){var r=kp(e),a=Bp[r.linkage];return a!=null&&(r.linkage=a),r},sl=function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(O,R){return mi(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},la=function(e,r,a){e&&(e.value?r.push(e.value):(e.left&&la(e.left,r),e.right&&la(e.right,r)))},Ds=function(e,r){if(!e)return"";if(e.left&&e.right){var a=Ds(e.left,r),n=Ds(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()},As=function(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&la(e.left,n),e.right&&la(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&la(e.left,n),e.right&&la(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=As(e.left,r-1,a)),e.right&&(i=As(e.right,r-1,a)),n.concat(i))},ul=function(e){for(var r=this.cy(),a=this.nodes(),n=Fp(e),i=n.attributes,o=function(m,w){return mi(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=sl(s,f,u,l,n);y;)y=sl(s,f,u,l,n);var g;return n.mode==="dendrogram"?(g=As(s[0],n.dendrogramDepth,r),n.addDendrogram&&Ds(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},zp={hierarchicalClustering:ul,hca:ul},Vp=Tt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Gp=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)),Vp(e)},Up=function(e,r,a,n){var i=function(s,u){return n[u](s)};return-mi(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},Hp=function(e,r){var a=null;return r==="median"?a=Gg(e):r==="mean"?a=Vg(e):r==="min"?a=Fg(e):r==="max"?a=zg(e):a=r,a},Yp=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},ll=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},qp=function(e,r,a){for(var n=ll(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=ll(e,r,a),n},fl=function(e){for(var r=this.cy(),a=this.nodes(),n=Gp(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]=Up(n.distance,a[d],a[p],n.attributes));f=Hp(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=Yp(s,h,v),re=qp(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:fl,ap:fl},Wp=Tt({root:void 0,directed:!1}),Xp={hierholzer:function(e){if(!_e(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Wp(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}},An=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}},$p={hopcroftTarjanBiconnected:An,htbc:An,htb:An,hopcroftTarjanBiconnectedComponents:An},Ln=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}},Kp={tarjanStronglyConnected:Ln,tsc:Ln,tscc:Ln,tarjanStronglyConnectedComponents:Ln},oc={};[Za,Sg,Dg,Lg,Mg,Og,kg,up,ca,va,Ss,Ep,Ip,zp,_p,Xp,$p,Kp].forEach(function(t){Ie(oc,t)});/*!
5
5
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
6
6
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
7
7
  Licensed under The MIT License (http://opensource.org/licenses/MIT)
8
- */var sc=0,uc=1,lc=2,Wt=function(e){if(!(this instanceof Wt))return new Wt(e);this.id="Thenable/1.0.7",this.state=sc,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Wt.prototype={fulfill:function(e){return hl(this,uc,"fulfillValue",e)},reject:function(e){return hl(this,lc,"rejectReason",e)},then:function(e,r){var a=this,n=new Wt;return a.onFulfilled.push(vl(e,n,"fulfill")),a.onRejected.push(vl(r,n,"reject")),fc(a),n.proxy}};var hl=function(e,r,a,n){return e.state===sc&&(e.state=r,e[a]=n,fc(e)),e},fc=function(e){e.state===uc?cl(e,"onFulfilled",e.fulfillValue):e.state===lc&&cl(e,"onRejected",e.rejectReason)},cl=function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var i=function(){for(var s=0;s<n.length;s++)n[s](a)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},vl=function(e,r,a){return function(n){if(typeof e!="function")r[a].call(r,n);else{var i;try{i=e(n)}catch(o){r.reject(o);return}hc(r,i)}}},hc=function(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(dt(r)==="object"&&r!==null||typeof r=="function")try{a=r.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(r,function(i){n||(n=!0,i===r?e.reject(new TypeError("circular thenable chain")):hc(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(r)};Wt.all=function(t){return new Wt(function(e,r){for(var a=new Array(t.length),n=0,i=function(u,l){a[u]=l,n++,n===t.length&&e(a)},o=0;o<t.length;o++)(function(s){var u=t[s],l=u!=null&&u.then!=null;if(l)u.then(function(h){i(s,h)},function(h){r(h)});else{var f=u;i(s,f)}})(o)})};Wt.resolve=function(t){return new Wt(function(e,r){e(t)})};Wt.reject=function(t){return new Wt(function(e,r){r(t)})};var Ca=typeof Promise<"u"?Promise:Wt,Ls=function(e,r,a){var n=Ws(e),i=!n,o=this._private=Ie({duration:1e3},r,a);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&it(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(n){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},qr=Ls.prototype;Ie(qr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;e.queue?r=a.queue:r=a.current,r.push(this),Bt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,a=r.playing;return e===void 0?r.progress:(a&&this.pause(),r.progress=e,r.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=function(l,f){var h=e[l];h!=null&&(e[l]=e[f],e[f]=h)};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[n]=s}return r&&this.play(),this},promise:function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new Ca(function(n,i){a.push(function(){n()})})}});qr.complete=qr.completed;qr.run=qr.play;qr.running=qr.playing;var Zp={animated:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=n[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<n.length;o++){var s=n[o];s._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:r,duration:r,complete:a}):this}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:r,duration:r,complete:a}):this}},animation:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this,u=!i,l=!u;if(!s.styleEnabled())return this;var f=s.style();r=Ie({},r,a);var h=Object.keys(r).length===0;if(h)return new Ls(o[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(l&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),l&&r.renderedPosition!=null){var v=r.renderedPosition,c=s.pan(),d=s.zoom();r.position=Zh(v,d,c)}if(u&&r.panBy!=null){var p=r.panBy,y=s.pan();r.pan={x:y.x+p.x,y:y.y+p.y}}var g=r.center||r.centre;if(u&&g!=null){var b=s.getCenterPan(g.eles,r.zoom);b!=null&&(r.pan=b)}if(u&&r.fit!=null){var m=r.fit,w=s.getFitViewport(m.eles||m.boundingBox,m.padding);w!=null&&(r.pan=w.pan,r.zoom=w.zoom)}if(u&&_e(r.zoom)){var T=s.getZoomedViewport(r.zoom);T!=null?(T.zoomed&&(r.zoom=T.zoom),T.panned&&(r.pan=T.pan)):r.zoom=null}return new Ls(o[0],r)}},animate:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;a&&(r=Ie({},r,a));for(var u=0;u<o.length;u++){var l=o[u],f=l.animated()&&(r.queue===void 0||r.queue),h=l.animation(r,f?{queue:!0}:void 0);h.play()}return this}},stop:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var u=0;u<o.length;u++){for(var l=o[u],f=l._private,h=f.animation.current,v=0;v<h.length;v++){var c=h[v],d=c._private;a&&(d.duration=0)}r&&(f.animation.queue=[]),a||(f.animation.current=[])}return s.notify("draw"),this}}},ao,dl;function bi(){if(dl)return ao;dl=1;var t=Array.isArray;return ao=t,ao}var no,gl;function Qp(){if(gl)return no;gl=1;var t=bi(),e=hn(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function n(i,o){if(t(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:a.test(i)||!r.test(i)||o!=null&&i in Object(o)}return no=n,no}var io,pl;function Jp(){if(pl)return io;pl=1;var t=Uh(),e=fn(),r="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=t(s);return u==a||u==n||u==r||u==i}return io=o,io}var oo,yl;function jp(){if(yl)return oo;yl=1;var t=gi(),e=t["__core-js_shared__"];return oo=e,oo}var so,ml;function ey(){if(ml)return so;ml=1;var t=jp(),e=(function(){var a=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function r(a){return!!e&&e in a}return so=r,so}var uo,bl;function ty(){if(bl)return uo;bl=1;var t=Function.prototype,e=t.toString;function r(a){if(a!=null){try{return e.call(a)}catch{}try{return a+""}catch{}}return""}return uo=r,uo}var lo,wl;function ry(){if(wl)return lo;wl=1;var t=Jp(),e=ey(),r=fn(),a=ty(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,f=RegExp("^"+u.call(l).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(v){if(!r(v)||e(v))return!1;var c=t(v)?f:i;return c.test(a(v))}return lo=h,lo}var fo,El;function ay(){if(El)return fo;El=1;function t(e,r){return e?.[r]}return fo=t,fo}var ho,xl;function au(){if(xl)return ho;xl=1;var t=ry(),e=ay();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return ho=r,ho}var co,Tl;function wi(){if(Tl)return co;Tl=1;var t=au(),e=t(Object,"create");return co=e,co}var vo,Cl;function ny(){if(Cl)return vo;Cl=1;var t=wi();function e(){this.__data__=t?t(null):{},this.size=0}return vo=e,vo}var go,Sl;function iy(){if(Sl)return go;Sl=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return go=t,go}var po,Dl;function oy(){if(Dl)return po;Dl=1;var t=wi(),e="__lodash_hash_undefined__",r=Object.prototype,a=r.hasOwnProperty;function n(i){var o=this.__data__;if(t){var s=o[i];return s===e?void 0:s}return a.call(o,i)?o[i]:void 0}return po=n,po}var yo,Al;function sy(){if(Al)return yo;Al=1;var t=wi(),e=Object.prototype,r=e.hasOwnProperty;function a(n){var i=this.__data__;return t?i[n]!==void 0:r.call(i,n)}return yo=a,yo}var mo,Ll;function uy(){if(Ll)return mo;Ll=1;var t=wi(),e="__lodash_hash_undefined__";function r(a,n){var i=this.__data__;return this.size+=this.has(a)?0:1,i[a]=t&&n===void 0?e:n,this}return mo=r,mo}var bo,Nl;function ly(){if(Nl)return bo;Nl=1;var t=ny(),e=iy(),r=oy(),a=sy(),n=uy();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,bo=i,bo}var wo,Ml;function fy(){if(Ml)return wo;Ml=1;function t(){this.__data__=[],this.size=0}return wo=t,wo}var Eo,Rl;function cc(){if(Rl)return Eo;Rl=1;function t(e,r){return e===r||e!==e&&r!==r}return Eo=t,Eo}var xo,Ol;function Ei(){if(Ol)return xo;Ol=1;var t=cc();function e(r,a){for(var n=r.length;n--;)if(t(r[n][0],a))return n;return-1}return xo=e,xo}var To,Pl;function hy(){if(Pl)return To;Pl=1;var t=Ei(),e=Array.prototype,r=e.splice;function a(n){var i=this.__data__,o=t(i,n);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():r.call(i,o,1),--this.size,!0}return To=a,To}var Co,Il;function cy(){if(Il)return Co;Il=1;var t=Ei();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return Co=e,Co}var So,kl;function vy(){if(kl)return So;kl=1;var t=Ei();function e(r){return t(this.__data__,r)>-1}return So=e,So}var Do,Bl;function dy(){if(Bl)return Do;Bl=1;var t=Ei();function e(r,a){var n=this.__data__,i=t(n,r);return i<0?(++this.size,n.push([r,a])):n[i][1]=a,this}return Do=e,Do}var Ao,Fl;function gy(){if(Fl)return Ao;Fl=1;var t=fy(),e=hy(),r=cy(),a=vy(),n=dy();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Ao=i,Ao}var Lo,zl;function py(){if(zl)return Lo;zl=1;var t=au(),e=gi(),r=t(e,"Map");return Lo=r,Lo}var No,Vl;function yy(){if(Vl)return No;Vl=1;var t=ly(),e=gy(),r=py();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return No=a,No}var Mo,Gl;function my(){if(Gl)return Mo;Gl=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return Mo=t,Mo}var Ro,Ul;function xi(){if(Ul)return Ro;Ul=1;var t=my();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return Ro=e,Ro}var Oo,Hl;function by(){if(Hl)return Oo;Hl=1;var t=xi();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return Oo=e,Oo}var Po,Yl;function wy(){if(Yl)return Po;Yl=1;var t=xi();function e(r){return t(this,r).get(r)}return Po=e,Po}var Io,ql;function Ey(){if(ql)return Io;ql=1;var t=xi();function e(r){return t(this,r).has(r)}return Io=e,Io}var ko,_l;function xy(){if(_l)return ko;_l=1;var t=xi();function e(r,a){var n=t(this,r),i=n.size;return n.set(r,a),this.size+=n.size==i?0:1,this}return ko=e,ko}var Bo,Wl;function Ty(){if(Wl)return Bo;Wl=1;var t=yy(),e=by(),r=wy(),a=Ey(),n=xy();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Bo=i,Bo}var Fo,Xl;function Cy(){if(Xl)return Fo;Xl=1;var t=Ty(),e="Expected a function";function r(a,n){if(typeof a!="function"||n!=null&&typeof n!="function")throw new TypeError(e);var i=function(){var o=arguments,s=n?n.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=a.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(r.Cache||t),i}return r.Cache=t,Fo=r,Fo}var zo,$l;function Sy(){if($l)return zo;$l=1;var t=Cy(),e=500;function r(a){var n=t(a,function(o){return i.size===e&&i.clear(),o}),i=n.cache;return n}return zo=r,zo}var Vo,Kl;function vc(){if(Kl)return Vo;Kl=1;var t=Sy(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=t(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(e,function(o,s,u,l){i.push(u?l.replace(r,"$1"):s||o)}),i});return Vo=a,Vo}var Go,Zl;function dc(){if(Zl)return Go;Zl=1;function t(e,r){for(var a=-1,n=e==null?0:e.length,i=Array(n);++a<n;)i[a]=r(e[a],a,e);return i}return Go=t,Go}var Uo,Ql;function Dy(){if(Ql)return Uo;Ql=1;var t=$s(),e=dc(),r=bi(),a=hn(),n=t?t.prototype:void 0,i=n?n.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return e(s,o)+"";if(a(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Uo=o,Uo}var Ho,Jl;function gc(){if(Jl)return Ho;Jl=1;var t=Dy();function e(r){return r==null?"":t(r)}return Ho=e,Ho}var Yo,jl;function pc(){if(jl)return Yo;jl=1;var t=bi(),e=Qp(),r=vc(),a=gc();function n(i,o){return t(i)?i:e(i,o)?[i]:r(a(i))}return Yo=n,Yo}var qo,ef;function nu(){if(ef)return qo;ef=1;var t=hn();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return qo=e,qo}var _o,tf;function Ay(){if(tf)return _o;tf=1;var t=pc(),e=nu();function r(a,n){n=t(n,a);for(var i=0,o=n.length;a!=null&&i<o;)a=a[e(n[i++])];return i&&i==o?a:void 0}return _o=r,_o}var Wo,rf;function Ly(){if(rf)return Wo;rf=1;var t=Ay();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return Wo=e,Wo}var Ny=Ly(),My=ln(Ny),Xo,af;function Ry(){if(af)return Xo;af=1;var t=au(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Xo=e,Xo}var $o,nf;function Oy(){if(nf)return $o;nf=1;var t=Ry();function e(r,a,n){a=="__proto__"&&t?t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[a]=n}return $o=e,$o}var Ko,of;function Py(){if(of)return Ko;of=1;var t=Oy(),e=cc(),r=Object.prototype,a=r.hasOwnProperty;function n(i,o,s){var u=i[o];(!(a.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&t(i,o,s)}return Ko=n,Ko}var Zo,sf;function Iy(){if(sf)return Zo;sf=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(a,n){var i=typeof a;return n=n??t,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&a>-1&&a%1==0&&a<n}return Zo=r,Zo}var Qo,uf;function ky(){if(uf)return Qo;uf=1;var t=Py(),e=pc(),r=Iy(),a=fn(),n=nu();function i(o,s,u,l){if(!a(o))return o;s=e(s,o);for(var f=-1,h=s.length,v=h-1,c=o;c!=null&&++f<h;){var d=n(s[f]),p=u;if(d==="__proto__"||d==="constructor"||d==="prototype")return o;if(f!=v){var y=c[d];p=l?l(y,d,c):void 0,p===void 0&&(p=a(y)?y:r(s[f+1])?[]:{})}t(c,d,p),c=c[d]}return o}return Qo=i,Qo}var Jo,lf;function By(){if(lf)return Jo;lf=1;var t=ky();function e(r,a,n){return r==null?r:t(r,a,n)}return Jo=e,Jo}var Fy=By(),zy=ln(Fy),jo,ff;function Vy(){if(ff)return jo;ff=1;function t(e,r){var a=-1,n=e.length;for(r||(r=Array(n));++a<n;)r[a]=e[a];return r}return jo=t,jo}var es,hf;function Gy(){if(hf)return es;hf=1;var t=dc(),e=Vy(),r=bi(),a=hn(),n=vc(),i=nu(),o=gc();function s(u){return r(u)?t(u,i):a(u)?[u]:e(n(o(u)))}return es=s,es}var Uy=Gy(),Hy=ln(Uy),Yy={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(n){},beforeSet:function(n,i){},onSet:function(n){},canSet:function(n){return!0}};return e=Ie({},r,e),function(n,i){var o=e,s=this,u=s.length!==void 0,l=u?s:[s],f=u?s[0]:s;if(Me(n)){var h=n.indexOf(".")!==-1,v=h&&Hy(n);if(o.allowGetting&&i===void 0){var c;return f&&(o.beforeGet(f),v&&f._private[o.field][n]===void 0?c=My(f._private[o.field],v):c=f._private[o.field][n]),c}else if(o.allowSetting&&i!==void 0){var d=!o.immutableKeys[n];if(d){var p=Rh({},n,i);o.beforeSet(s,p);for(var y=0,g=l.length;y<g;y++){var b=l[y];o.canSet(b)&&(v&&f._private[o.field][n]===void 0?zy(b._private[o.field],v,i):b._private[o.field][n]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&_e(n)){var m=n,w,T,D=Object.keys(m);o.beforeSet(s,m);for(var x=0;x<D.length;x++){w=D[x],T=m[w];var N=!o.immutableKeys[w];if(N)for(var O=0;O<l.length;O++){var R=l[O];o.canSet(R)&&(R._private[o.field][w]=T)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&it(n)){var P=n;s.on(o.bindingEvent,P)}else if(o.allowGetting&&n===void 0){var M;return f&&(o.beforeGet(f),M=f._private[o.field]),M}return s}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ie({},r,e),function(n){var i=e,o=this,s=o.length!==void 0,u=s?o:[o];if(Me(n)){for(var l=n.split(/\s+/),f=l.length,h=0;h<f;h++){var v=l[h];if(!br(v)){var c=!i.immutableKeys[v];if(c)for(var d=0,p=u.length;d<p;d++)u[d]._private[i.field][v]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(n===void 0){for(var y=0,g=u.length;y<g;y++)for(var b=u[y]._private[i.field],m=Object.keys(b),w=0;w<m.length;w++){var T=m[w],D=!i.immutableKeys[T];D&&(b[T]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},qy={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(a,n){var i=this,o=Array.prototype.slice.call(arguments,0);return new Ca(function(s,u){var l=function(c){i.off.apply(i,h),s(c)},f=o.concat([l]),h=f.concat([]);i.on.apply(i,f)})}}},$e={};[Zp,Yy,qy].forEach(function(t){Ie($e,t)});var _y={animate:$e.animate(),animation:$e.animation(),animated:$e.animated(),clearQueue:$e.clearQueue(),delay:$e.delay(),delayAnimation:$e.delayAnimation(),stop:$e.stop()},Gn={classes:function(e){var r=this;if(e===void 0){var a=[];return r[0]._private.classes.forEach(function(d){return a.push(d)}),a}else Je(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new Ta(e),o=0;o<r.length;o++){for(var s=r[o],u=s._private,l=u.classes,f=!1,h=0;h<e.length;h++){var v=e[h],c=l.has(v);if(!c){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=i,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Je(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,i=[],o=0,s=a.length;o<s;o++)for(var u=a[o],l=u._private.classes,f=!1,h=0;h<e.length;h++){var v=e[h],c=l.has(v),d=!1;r||n&&!c?(l.add(v),d=!0):(!r||n&&c)&&(l.delete(v),d=!0),!f&&d&&(i.push(u),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var a=this;if(r==null)r=250;else if(r===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},r),a}};Gn.className=Gn.classNames=Gn.classes;var qe={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:vt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};qe.variable="(?:[\\w-.]|(?:\\\\"+qe.metaChar+"))+";qe.className="(?:[\\w-]|(?:\\\\"+qe.metaChar+"))+";qe.value=qe.string+"|"+qe.number;qe.id=qe.variable;(function(){var t,e,r;for(t=qe.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],qe.comparatorOp+="|@"+e;for(t=qe.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(qe.comparatorOp+="|\\!"+e)})();var Qe=function(){return{checks:[]}},Ae={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Ns=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Yd(t.selector,e.selector)}),Wy=(function(){for(var t={},e,r=0;r<Ns.length;r++)e=Ns[r],t[e.selector]=e.matches;return t})(),Xy=function(e,r){return Wy[e](r)},$y="("+Ns.map(function(t){return t.selector}).join("|")+")",Jr=function(e){return e.replace(new RegExp("\\\\("+qe.metaChar+")","g"),function(r,a){return a})},cr=function(e,r,a){e[e.length-1]=a},Ms=[{name:"group",query:!0,regex:"("+qe.group+")",populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:$y,populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+qe.id+")",populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.ID,value:Jr(i)})}},{name:"className",query:!0,regex:"\\.("+qe.className+")",populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.CLASS,value:Jr(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+qe.variable+")\\s*\\]",populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.DATA_EXIST,field:Jr(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+qe.variable+")\\s*("+qe.comparatorOp+")\\s*("+qe.value+")\\s*\\]",populate:function(e,r,a){var n=ft(a,3),i=n[0],o=n[1],s=n[2],u=new RegExp("^"+qe.string+"$").exec(s)!=null;u?s=s.substring(1,s.length-1):s=parseFloat(s),r.checks.push({type:Ae.DATA_COMPARE,field:Jr(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+qe.boolOp+")\\s*("+qe.variable+")\\s*\\]",populate:function(e,r,a){var n=ft(a,2),i=n[0],o=n[1];r.checks.push({type:Ae.DATA_BOOL,field:Jr(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+qe.meta+")\\s*("+qe.comparatorOp+")\\s*("+qe.number+")\\s*\\]\\]",populate:function(e,r,a){var n=ft(a,3),i=n[0],o=n[1],s=n[2];r.checks.push({type:Ae.META_COMPARE,field:Jr(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:qe.separator,populate:function(e,r){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,o=e[e.length-1];a!=null&&(o.subject=a,e.currentSubject=null),o.edgeCount=n,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Qe();return s}},{name:"directedEdge",separator:!0,regex:qe.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:Ae.DIRECTED_EDGE,source:n,target:i}),cr(e,r,a),e.edgeCount++,i}else{var o=Qe(),s=r,u=Qe();return o.checks.push({type:Ae.NODE_SOURCE,source:s,target:u}),cr(e,r,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:qe.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:Ae.UNDIRECTED_EDGE,nodes:[n,i]}),cr(e,r,a),e.edgeCount++,i}else{var o=Qe(),s=r,u=Qe();return o.checks.push({type:Ae.NODE_NEIGHBOR,node:s,neighbor:u}),cr(e,r,o),u}}},{name:"child",separator:!0,regex:qe.child,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:Ae.CHILD,parent:i,child:n}),cr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=Qe(),s=e[e.length-1],u=Qe(),l=Qe(),f=Qe(),h=Qe();return o.checks.push({type:Ae.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:Ae.TRUE}],h.checks.push({type:Ae.TRUE}),u.checks.push({type:Ae.PARENT,parent:h,child:f}),cr(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var v=Qe(),c=Qe(),d=[{type:Ae.PARENT,parent:v,child:c}];return v.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"descendant",separator:!0,regex:qe.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:Ae.DESCENDANT,ancestor:i,descendant:n}),cr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=Qe(),s=e[e.length-1],u=Qe(),l=Qe(),f=Qe(),h=Qe();return o.checks.push({type:Ae.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:Ae.TRUE}],h.checks.push({type:Ae.TRUE}),u.checks.push({type:Ae.ANCESTOR,ancestor:h,descendant:f}),cr(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var v=Qe(),c=Qe(),d=[{type:Ae.ANCESTOR,ancestor:v,descendant:c}];return v.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"subject",modifier:!0,regex:qe.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Ke("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;i===Ae.DIRECTED_EDGE?n.type=Ae.NODE_TARGET:i===Ae.UNDIRECTED_EDGE&&(n.type=Ae.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Ms.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Ky=function(e){for(var r,a,n,i=0;i<Ms.length;i++){var o=Ms[i],s=o.name,u=e.match(o.regexObj);if(u!=null){a=u,r=o,n=s;var l=u[0];e=e.substring(l.length);break}}return{expr:r,match:a,name:n,remaining:e}},Zy=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},Qy=function(e){var r=this,a=r.inputText=e,n=r[0]=Qe();for(r.length=1,a=Zy(a);;){var i=Ky(a);if(i.expr==null)return Ke("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(r,n,o);if(s===!1)return!1;if(s!=null&&(n=s),a=i.remaining,a.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0)return Ke("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Ke("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Ke("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Jy=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return Me(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,h){var v=f.type,c=f.value;switch(v){case Ae.GROUP:{var d=e(c);return d.substring(0,d.length-1)}case Ae.DATA_COMPARE:{var p=f.field,y=f.operator;return"["+p+a(e(y))+r(c)+"]"}case Ae.DATA_BOOL:{var g=f.operator,b=f.field;return"["+e(g)+b+"]"}case Ae.DATA_EXIST:{var m=f.field;return"["+m+"]"}case Ae.META_COMPARE:{var w=f.operator,T=f.field;return"[["+T+a(e(w))+r(c)+"]]"}case Ae.STATE:return c;case Ae.ID:return"#"+c;case Ae.CLASS:return"."+c;case Ae.PARENT:case Ae.CHILD:return i(f.parent,h)+a(">")+i(f.child,h);case Ae.ANCESTOR:case Ae.DESCENDANT:return i(f.ancestor,h)+" "+i(f.descendant,h);case Ae.COMPOUND_SPLIT:{var D=i(f.left,h),x=i(f.subject,h),N=i(f.right,h);return D+(D.length>0?" ":"")+x+N}case Ae.TRUE:return""}},i=function(f,h){return f.checks.reduce(function(v,c,d){return v+(h===f&&d===0?"$":"")+n(c,h)},"")},o="",s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},jy={parse:Qy,toString:Jy},yc=function(e,r,a){var n,i=Me(e),o=be(e),s=Me(a),u,l,f=!1,h=!1,v=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),h=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||s||f)&&(u=!i&&!o?"":""+e,l=""+a),f&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),r){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":v=!0,n=e>a;break;case">=":v=!0,n=e>=a;break;case"<":v=!0,n=e<a;break;case"<=":v=!0,n=e<=a;break;default:n=!1;break}return h&&(e!=null||!v)&&(n=!n),n},em=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},tm=function(e){return e!==void 0},iu=function(e,r){return e.data(r)},rm=function(e,r){return e[r]()},ot=[],rt=function(e,r){return e.checks.every(function(a){return ot[a.type](a,r)})};ot[Ae.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};ot[Ae.STATE]=function(t,e){var r=t.value;return Xy(r,e)};ot[Ae.ID]=function(t,e){var r=t.value;return e.id()===r};ot[Ae.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};ot[Ae.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return yc(rm(e,r),a,n)};ot[Ae.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return yc(iu(e,r),a,n)};ot[Ae.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return em(iu(e,r),a)};ot[Ae.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,tm(iu(e,r))};ot[Ae.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),i=e.target();return rt(r,n)&&rt(a,i)||rt(a,n)&&rt(r,i)};ot[Ae.NODE_NEIGHBOR]=function(t,e){return rt(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&rt(t.neighbor,r)})};ot[Ae.DIRECTED_EDGE]=function(t,e){return rt(t.source,e.source())&&rt(t.target,e.target())};ot[Ae.NODE_SOURCE]=function(t,e){return rt(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&rt(t.target,r)})};ot[Ae.NODE_TARGET]=function(t,e){return rt(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&rt(t.source,r)})};ot[Ae.CHILD]=function(t,e){return rt(t.child,e)&&rt(t.parent,e.parent())};ot[Ae.PARENT]=function(t,e){return rt(t.parent,e)&&e.children().some(function(r){return rt(t.child,r)})};ot[Ae.DESCENDANT]=function(t,e){return rt(t.descendant,e)&&e.ancestors().some(function(r){return rt(t.ancestor,r)})};ot[Ae.ANCESTOR]=function(t,e){return rt(t.ancestor,e)&&e.descendants().some(function(r){return rt(t.descendant,r)})};ot[Ae.COMPOUND_SPLIT]=function(t,e){return rt(t.subject,e)&&rt(t.left,e)&&rt(t.right,e)};ot[Ae.TRUE]=function(){return!0};ot[Ae.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};ot[Ae.FILTER]=function(t,e){var r=t.value;return r(e)};var am=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Ae.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(i){for(var o=0;o<r.length;o++){var s=r[o];if(rt(s,i))return!0}return!1};return r.text()==null&&(a=function(){return!0}),e.filter(a)},nm=function(e){for(var r=this,a=0;a<r.length;a++){var n=r[a];if(rt(n,e))return!0}return!1},im={matches:nm,filter:am},xr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Me(e)&&e.match(/^\s*$/)||(Bt(e)?this.addQuery({checks:[{type:Ae.COLLECTION,value:e.collection()}]}):it(e)?this.addQuery({checks:[{type:Ae.FILTER,value:e}]}):Me(e)?this.parse(e)||(this.invalid=!0):nt("A selector must be created from a string; found "))},Tr=xr.prototype;[jy,im].forEach(function(t){return Ie(Tr,t)});Tr.text=function(){return this.inputText};Tr.size=function(){return this.length};Tr.eq=function(t){return this[t]};Tr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Tr.addQuery=function(t){this[this.length++]=t};Tr.selector=Tr.toString;var yr={allAre:function(e){var r=new xr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new xr(e);return this.some(function(a){return r.matches(a)})},some:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(n)return!0}return!1},every:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(!n)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,a=e.length;return r!==a?!1:r===1?this[0]===e[0]:this.every(function(n){return e.hasElementWithId(n.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(a){return r.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(a){return r.hasElementWithId(a.id())})}};yr.allAreNeighbours=yr.allAreNeighbors;yr.has=yr.contains;yr.equal=yr.equals=yr.same;var Gt=function(e,r){return function(n,i,o,s){var u=n,l=this,f;if(u==null?f="":Bt(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var h=l[0]._private,v=h.traversalCache=h.traversalCache||{},c=v[r]=v[r]||[],d=Hr(f),p=c[d];return p||(c[d]=e.call(l,n,i,o,s))}else return e.call(l,n,i,o,s)}},ma={parent:function(e){var r=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var i=this[n],o=i._private.parent;o&&r.push(o)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var i=a[n];r.push(i)}a=a.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,a=0;a<this.length;a++){var n=this[a],i=n.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Gt(function(t){for(var e=[],r=0;r<this.length;r++)for(var a=this[r],n=a._private.children,i=0;i<n.length;i++)e.push(n[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function a(n){for(var i=0;i<n.length;i++){var o=n[i];r.push(o),o.children().nonempty()&&a(o.children())}}return a(this.children()),this.spawn(r,!0).filter(e)}};function ou(t,e,r,a){for(var n=[],i=new Ta,o=t.cy(),s=o.hasCompoundNodes(),u=0;u<t.length;u++){var l=t[u];r?n.push(l):s&&a(n,i,l)}for(;n.length>0;){var f=n.shift();e(f),i.add(f.id()),s&&a(n,i,f)}return t}function mc(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||t.push(i)}}ma.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ou(this,t,e,mc)};function bc(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}ma.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ou(this,t,e,bc)};function om(t,e,r){bc(t,e,r),mc(t,e,r)}ma.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ou(this,t,e,om)};ma.ancestors=ma.parents;var ja,wc;ja=wc={data:$e.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:$e.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:$e.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:$e.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:$e.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:$e.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ja.attr=ja.data;ja.removeAttr=ja.removeData;var sm=wc,Ti={};function ts(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var a=0,n=r[0],i=n._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(a+=t(n,s))}return a}else return}}Ie(Ti,{degree:ts(function(t,e){return e.source().same(e.target())?2:1}),indegree:ts(function(t,e){return e.target().same(t)?1:0}),outdegree:ts(function(t,e){return e.source().same(t)?1:0})});function jr(t,e){return function(r){for(var a,n=this.nodes(),i=0;i<n.length;i++){var o=n[i],s=o[t](r);s!==void 0&&(a===void 0||e(s,a))&&(a=s)}return a}}Ie(Ti,{minDegree:jr("degree",function(t,e){return t<e}),maxDegree:jr("degree",function(t,e){return t>e}),minIndegree:jr("indegree",function(t,e){return t<e}),maxIndegree:jr("indegree",function(t,e){return t>e}),minOutdegree:jr("outdegree",function(t,e){return t<e}),maxOutdegree:jr("outdegree",function(t,e){return t>e})});Ie(Ti,{totalDegree:function(e){for(var r=0,a=this.nodes(),n=0;n<a.length;n++)r+=a[n].degree(e);return r}});var _t,Ec,xc=function(e,r,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var o=i._private.position,s={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,a),i.dirtyBoundingBoxCache()}}},cf={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){xc(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};_t=Ec={position:$e.data(cf),silentPosition:$e.data(Ie({},cf,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){xc(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(_e(e))r?this.silentPosition(e):this.position(e);else if(it(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=a(o,i))&&(r?o.silentPosition(s):o.position(s))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(_e(e)?(n={x:be(e.x)?e.x:0,y:be(e.y)?e.y:0},a=r):Me(e)&&be(r)&&(n={x:0,y:0},n[e]=r),n!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var u=s.position(),l={x:u.x+n.x,y:u.y+n.y};a?s.silentPosition(l):s.position(l)}}i.endBatch()}return this},silentShift:function(e,r){return _e(e)?this.shift(e,!0):Me(e)&&be(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),i=n.zoom(),o=n.pan(),s=_e(e)?e:void 0,u=s!==void 0||r!==void 0&&Me(e);if(a&&a.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];r!==void 0?f.position(e,(r-o[e])/i):s!==void 0&&f.position(Zh(s,i,o))}else{var h=a.position();return s=yi(h,i,o),e===void 0?s:s[e]}else if(!u)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),i=_e(e)?e:void 0,o=i!==void 0||r!==void 0&&Me(e),s=n.hasCompoundNodes();if(a&&a.isNode())if(o)for(var u=0;u<this.length;u++){var l=this[u],f=s?l.parent():null,h=f&&f.length>0,v=h;h&&(f=f[0]);var c=v?f.position():{x:0,y:0};r!==void 0?l.position(e,r+c[e]):i!==void 0&&l.position({x:i.x+c.x,y:i.y+c.y})}else{var d=a.position(),p=s?a.parent():null,y=p&&p.length>0,g=y;y&&(p=p[0]);var b=g?p.position():{x:0,y:0};return i={x:d.x-b.x,y:d.y-b.y},e===void 0?i:i[e]}else if(!o)return;return this}};_t.modelPosition=_t.point=_t.position;_t.modelPositions=_t.points=_t.positions;_t.renderedPoint=_t.renderedPosition;_t.relativePoint=_t.relativePosition;var um=Ec,ba=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},wa=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},lm=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},va,Lr;va=Lr={};Lr.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,o=e.x2*a+n.x,s=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};Lr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var a=r._private;a.compoundBoundsClean=!1,a.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};Lr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(o){if(!o.isParent())return;var s=o._private,u=o.children(),l=o.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},h=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),v=s.position;(h.w===0||h.h===0)&&(h={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},h.x1=v.x-h.w/2,h.x2=v.x+h.w/2,h.y1=v.y-h.h/2,h.y2=v.y+h.h/2);function c(O,R,P){var M=0,I=0,E=R+P;return O>0&&E>0&&(M=R/E*O,I=P/E*O),{biasDiff:M,biasComplementDiff:I}}function d(O,R,P,M){if(P.units==="%")switch(M){case"width":return O>0?P.pfValue*O:0;case"height":return R>0?P.pfValue*R:0;case"average":return O>0&&R>0?P.pfValue*(O+R)/2:0;case"min":return O>0&&R>0?O>R?P.pfValue*R:P.pfValue*O:0;case"max":return O>0&&R>0?O>R?P.pfValue*O:P.pfValue*R:0;default:return 0}else return P.units==="px"?P.pfValue:0}var p=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var y=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(y=y*100/f.width.val);var g=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(g=g*100/f.height.val);var b=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(b=b*100/f.height.val);var m=c(f.width.val-h.w,p,y),w=m.biasDiff,T=m.biasComplementDiff,D=c(f.height.val-h.h,g,b),x=D.biasDiff,N=D.biasComplementDiff;s.autoPadding=d(h.w,h.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(h.w,f.width.val),v.x=(-w+h.x1+h.x2+T)/2,s.autoHeight=Math.max(h.h,f.height.val),v.y=(-x+h.y1+h.y2+N)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||t)&&(r(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var Vt=function(e){return e===1/0||e===-1/0?0:e},qt=function(e,r,a,n,i){n-r===0||i-a===0||r==null||a==null||n==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},vr=function(e,r){return r==null?e:qt(e,r.x1,r.y1,r.x2,r.y2)},ka=function(e,r,a){return Mt(e,r,a)},Nn=function(e,r,a){if(!r.cy().headless()){var n=r._private,i=n.rstyle,o=i.arrowWidth/2,s=r.pstyle(a+"-arrow-shape").value,u,l;if(s!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var f=n.arrowBounds=n.arrowBounds||{},h=f[a]=f[a]||{};h.x1=u-o,h.y1=l-o,h.x2=u+o,h.y2=l+o,h.w=h.x2-h.x1,h.h=h.y2-h.y1,zn(h,1),qt(e,h.x1,h.y1,h.x2,h.y2)}}},rs=function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var i=r._private,o=i.rstyle,s=r.pstyle(n+"label").strValue;if(s){var u=r.pstyle("text-halign"),l=r.pstyle("text-valign"),f=ka(o,"labelWidth",a),h=ka(o,"labelHeight",a),v=ka(o,"labelX",a),c=ka(o,"labelY",a),d=r.pstyle(n+"text-margin-x").pfValue,p=r.pstyle(n+"text-margin-y").pfValue,y=r.isEdge(),g=r.pstyle(n+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,m=r.pstyle("text-border-width").pfValue,w=m/2,T=r.pstyle("text-background-padding").pfValue,D=2,x=h,N=f,O=N/2,R=x/2,P,M,I,E;if(y)P=v-O,M=v+O,I=c-R,E=c+R;else{switch(ba(u.value)){case"left":P=v-N,M=v;break;case"center":P=v-O,M=v+O;break;case"right":P=v,M=v+N;break}switch(wa(l.value)){case"top":I=c-x,E=c;break;case"center":I=c-R,E=c+R;break;case"bottom":I=c,E=c+x;break}}var A=d-Math.max(b,w)-T-D,C=d+Math.max(b,w)+T+D,S=p-Math.max(b,w)-T-D,L=p+Math.max(b,w)+T+D;P+=A,M+=C,I+=S,E+=L;var V=a||"main",F=i.labelBounds,B=F[V]=F[V]||{};B.x1=P,B.y1=I,B.x2=M,B.y2=E,B.w=M-P,B.h=E-I,B.leftPad=A,B.rightPad=C,B.topPad=S,B.botPad=L;var Y=y&&g.strValue==="autorotate",q=g.pfValue!=null&&g.pfValue!==0;if(Y||q){var Q=Y?ka(i.rstyle,"labelAngle",a):g.pfValue,$=Math.cos(Q),K=Math.sin(Q),j=(P+M)/2,re=(I+E)/2;if(!y){switch(ba(u.value)){case"left":j=M;break;case"right":j=P;break}switch(wa(l.value)){case"top":re=E;break;case"bottom":re=I;break}}var U=function(ge,le){return ge=ge-j,le=le-re,{x:ge*$-le*K+j,y:ge*K+le*$+re}},H=U(P,I),_=U(P,E),W=U(M,I),J=U(M,E);P=Math.min(H.x,_.x,W.x,J.x),M=Math.max(H.x,_.x,W.x,J.x),I=Math.min(H.y,_.y,W.y,J.y),E=Math.max(H.y,_.y,W.y,J.y)}var te=V+"Rot",de=F[te]=F[te]||{};de.x1=P,de.y1=I,de.x2=M,de.y2=E,de.w=M-P,de.h=E-I,qt(e,P,I,M,E),qt(i.labelBounds.all,P,I,M,E)}return e}},vf=function(e,r){if(!r.cy().headless()){var a=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value,i=r.pstyle("outline-offset").value,o=n+i;Tc(e,r,a,o,"outside",o/2)}},Tc=function(e,r,a,n,i,o){if(!(a===0||n<=0||i==="inside")){var s=r.cy(),u=s.renderer(),l=u.nodeShapes[u.getNodeShape(r)];if(l){var f=r.position(),h=f.x,v=f.y,c=r.width(),d=r.height();if(l.hasMiterBounds){i==="center"&&(n/=2);var p=l.miterBounds(h,v,c,d,n);vr(e,p)}else o!=null&&o>0&&Vn(e,[o,o,o,o])}}},fm=function(e,r){if(!r.cy().headless()){var a=r.pstyle("border-opacity").value,n=r.pstyle("border-width").pfValue,i=r.pstyle("border-position").value;Tc(e,r,a,n,i)}},hm=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),o=Rt(),s=e._private,u=e.isNode(),l=e.isEdge(),f,h,v,c,d,p,y=s.rstyle,g=u&&n?e.pstyle("bounds-expansion").pfValue:[0],b=function(Te){return Te.pstyle("display").value!=="none"},m=!n||b(e)&&(!l||b(e.source())&&b(e.target()));if(m){var w=0,T=0;n&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(T=e.pstyle("overlay-padding").value));var D=0,x=0;n&&r.includeUnderlays&&(D=e.pstyle("underlay-opacity").value,D!==0&&(x=e.pstyle("underlay-padding").value));var N=Math.max(T,x),O=0,R=0;if(n&&(O=e.pstyle("width").pfValue,R=O/2),u&&r.includeNodes){var P=e.position();d=P.x,p=P.y;var M=e.outerWidth(),I=M/2,E=e.outerHeight(),A=E/2;f=d-I,h=d+I,v=p-A,c=p+A,qt(o,f,v,h,c),n&&vf(o,e),n&&r.includeOutlines&&!i&&vf(o,e),n&&fm(o,e)}else if(l&&r.includeEdges)if(n&&!i){var C=e.pstyle("curve-style").strValue;if(f=Math.min(y.srcX,y.midX,y.tgtX),h=Math.max(y.srcX,y.midX,y.tgtX),v=Math.min(y.srcY,y.midY,y.tgtY),c=Math.max(y.srcY,y.midY,y.tgtY),f-=R,h+=R,v-=R,c+=R,qt(o,f,v,h,c),C==="haystack"){var S=y.haystackPts;if(S&&S.length===2){if(f=S[0].x,v=S[0].y,h=S[1].x,c=S[1].y,f>h){var L=f;f=h,h=L}if(v>c){var V=v;v=c,c=V}qt(o,f-R,v-R,h+R,c+R)}}else if(C==="bezier"||C==="unbundled-bezier"||dr(C,"segments")||dr(C,"taxi")){var F;switch(C){case"bezier":case"unbundled-bezier":F=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=y.linePts;break}if(F!=null)for(var B=0;B<F.length;B++){var Y=F[B];f=Y.x-R,h=Y.x+R,v=Y.y-R,c=Y.y+R,qt(o,f,v,h,c)}}}else{var q=e.source(),Q=q.position(),$=e.target(),K=$.position();if(f=Q.x,h=K.x,v=Q.y,c=K.y,f>h){var j=f;f=h,h=j}if(v>c){var re=v;v=c,c=re}f-=R,h+=R,v-=R,c+=R,qt(o,f,v,h,c)}if(n&&r.includeEdges&&l&&(Nn(o,e,"mid-source"),Nn(o,e,"mid-target"),Nn(o,e,"source"),Nn(o,e,"target")),n){var U=e.pstyle("ghost").value==="yes";if(U){var H=e.pstyle("ghost-offset-x").pfValue,_=e.pstyle("ghost-offset-y").pfValue;qt(o,o.x1+H,o.y1+_,o.x2+H,o.y2+_)}}var W=s.bodyBounds=s.bodyBounds||{};Qu(W,o),Vn(W,g),zn(W,1),n&&(f=o.x1,h=o.x2,v=o.y1,c=o.y2,qt(o,f-N,v-N,h+N,c+N));var J=s.overlayBounds=s.overlayBounds||{};Qu(J,o),Vn(J,g),zn(J,1);var te=s.labelBounds=s.labelBounds||{};te.all!=null?_g(te.all):te.all=Rt(),n&&r.includeLabels&&(r.includeMainLabels&&rs(o,e,null),l&&(r.includeSourceLabels&&rs(o,e,"source"),r.includeTargetLabels&&rs(o,e,"target")))}return o.x1=Vt(o.x1),o.y1=Vt(o.y1),o.x2=Vt(o.x2),o.y2=Vt(o.y2),o.w=Vt(o.x2-o.x1),o.h=Vt(o.y2-o.y1),o.w>0&&o.h>0&&m&&(Vn(o,g),zn(o,1)),o},Cc=function(e){var r=0,a=function(o){return(o?1:0)<<r++},n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n+=a(e.includeOutlines),n},Sc=function(e){var r=function(s){return Math.round(s)};if(e.isEdge()){var a=e.source().position(),n=e.target().position();return _u([r(a.x),r(a.y),r(n.x),r(n.y)])}else{var i=e.position();return _u([r(i.x),r(i.y)])}},df=function(e,r){var a=e._private,n,i=e.isEdge(),o=r==null?gf:Cc(r),s=o===gf;if(a.bbCache==null?(n=hm(e,en),a.bbCache=n,a.bbCachePosKey=Sc(e)):n=a.bbCache,!s){var u=e.isNode();n=Rt(),(r.includeNodes&&u||r.includeEdges&&!u)&&(r.includeOverlays?vr(n,a.overlayBounds):vr(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?vr(n,a.labelBounds.all):(r.includeMainLabels&&vr(n,a.labelBounds.mainRot),r.includeSourceLabels&&vr(n,a.labelBounds.sourceRot),r.includeTargetLabels&&vr(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},en={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},gf=Cc(en),pf=Tt(en);Lr.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,a=pa(function(f){var h=f._private;return h.bbCache==null||h.styleDirty||h.bbCachePosKey!==Sc(f)},function(f){return f.id()});if(r&&this.length===1&&!a(this[0]))t===void 0?t=en:t=pf(t),e=df(this[0],t);else{e=Rt(),t=t||en;var n=pf(t),i=this,o=i.cy(),s=o.styleEnabled();this.edges().forEach(a),this.nodes().forEach(a),s&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var u=0;u<i.length;u++){var l=i[u];a(l)&&l.dirtyBoundingBoxCache(),vr(e,df(l,n))}}return e.x1=Vt(e.x1),e.y1=Vt(e.y1),e.x2=Vt(e.x2),e.y2=Vt(e.y2),e.w=Vt(e.x2-e.x1),e.h=Vt(e.y2-e.y1),e};Lr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Lr.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a&&(n=e.filter(function(l){return l.isParent()}),e=e.not(n)),_e(t)){var i=t;t=function(){return i}}var o=function(f,h){return f._private.bbAtOldPos=t(f,h)},s=function(f){return f._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=qg(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),u};va.boundingbox=va.bb=va.boundingBox;va.renderedBoundingbox=va.renderedBoundingBox;var cm=Lr,Ha,dn;Ha=dn={};var Dc=function(e){e.uppercaseName=Mu(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Mu(e.outerName),Ha[e.name]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var s=a.pstyle(e.name);switch(s.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},Ha["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){var s=a[e.name](),u=a.pstyle("border-position").value,l;u==="center"?l=a.pstyle("border-width").pfValue:u==="outside"?l=2*a.pstyle("border-width").pfValue:l=0;var f=2*a.padding();return s+l+f}else return 1},Ha["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Ha["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};Dc({name:"width"});Dc({name:"height"});dn.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};dn.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};dn.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var vm=dn,dm=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},gm=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy();return yi(r(e),a.zoom(),a.pan())}},pm=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy(),n=a.pan(),i=a.zoom();return r(e).map(function(o){return yi(o,i,n)})}},ym=function(e){return e.renderer().getControlPoints(e)},mm=function(e){return e.renderer().getSegmentPoints(e)},bm=function(e){return e.renderer().getSourceEndpoint(e)},wm=function(e){return e.renderer().getTargetEndpoint(e)},Em=function(e){return e.renderer().getEdgeMidpoint(e)},yf={controlPoints:{get:ym,mult:!0},segmentPoints:{get:mm,mult:!0},sourceEndpoint:{get:bm},targetEndpoint:{get:wm},midpoint:{get:Em}},xm=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Tm=Object.keys(yf).reduce(function(t,e){var r=yf[e],a=xm(e);return t[e]=function(){return dm(this,r.get)},r.mult?t[a]=function(){return pm(this,r.get)}:t[a]=function(){return gm(this,r.get)},t},{}),Cm=Ie({},um,cm,vm,Tm);/*!
8
+ */var sc=0,uc=1,lc=2,Wt=function(e){if(!(this instanceof Wt))return new Wt(e);this.id="Thenable/1.0.7",this.state=sc,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Wt.prototype={fulfill:function(e){return hl(this,uc,"fulfillValue",e)},reject:function(e){return hl(this,lc,"rejectReason",e)},then:function(e,r){var a=this,n=new Wt;return a.onFulfilled.push(vl(e,n,"fulfill")),a.onRejected.push(vl(r,n,"reject")),fc(a),n.proxy}};var hl=function(e,r,a,n){return e.state===sc&&(e.state=r,e[a]=n,fc(e)),e},fc=function(e){e.state===uc?cl(e,"onFulfilled",e.fulfillValue):e.state===lc&&cl(e,"onRejected",e.rejectReason)},cl=function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var i=function(){for(var s=0;s<n.length;s++)n[s](a)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},vl=function(e,r,a){return function(n){if(typeof e!="function")r[a].call(r,n);else{var i;try{i=e(n)}catch(o){r.reject(o);return}hc(r,i)}}},hc=function(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(dt(r)==="object"&&r!==null||typeof r=="function")try{a=r.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(r,function(i){n||(n=!0,i===r?e.reject(new TypeError("circular thenable chain")):hc(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(r)};Wt.all=function(t){return new Wt(function(e,r){for(var a=new Array(t.length),n=0,i=function(u,l){a[u]=l,n++,n===t.length&&e(a)},o=0;o<t.length;o++)(function(s){var u=t[s],l=u!=null&&u.then!=null;if(l)u.then(function(h){i(s,h)},function(h){r(h)});else{var f=u;i(s,f)}})(o)})};Wt.resolve=function(t){return new Wt(function(e,r){e(t)})};Wt.reject=function(t){return new Wt(function(e,r){r(t)})};var Ca=typeof Promise<"u"?Promise:Wt,Ls=function(e,r,a){var n=Ws(e),i=!n,o=this._private=Ie({duration:1e3},r,a);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&it(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(n){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},_r=Ls.prototype;Ie(_r,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;e.queue?r=a.queue:r=a.current,r.push(this),Bt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,a=r.playing;return e===void 0?r.progress:(a&&this.pause(),r.progress=e,r.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=function(l,f){var h=e[l];h!=null&&(e[l]=e[f],e[f]=h)};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[n]=s}return r&&this.play(),this},promise:function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new Ca(function(n,i){a.push(function(){n()})})}});_r.complete=_r.completed;_r.run=_r.play;_r.running=_r.playing;var Zp={animated:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=n[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<n.length;o++){var s=n[o];s._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:r,duration:r,complete:a}):this}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:r,duration:r,complete:a}):this}},animation:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this,u=!i,l=!u;if(!s.styleEnabled())return this;var f=s.style();r=Ie({},r,a);var h=Object.keys(r).length===0;if(h)return new Ls(o[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(l&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),l&&r.renderedPosition!=null){var v=r.renderedPosition,c=s.pan(),d=s.zoom();r.position=Zh(v,d,c)}if(u&&r.panBy!=null){var p=r.panBy,y=s.pan();r.pan={x:y.x+p.x,y:y.y+p.y}}var g=r.center||r.centre;if(u&&g!=null){var b=s.getCenterPan(g.eles,r.zoom);b!=null&&(r.pan=b)}if(u&&r.fit!=null){var m=r.fit,w=s.getFitViewport(m.eles||m.boundingBox,m.padding);w!=null&&(r.pan=w.pan,r.zoom=w.zoom)}if(u&&_e(r.zoom)){var T=s.getZoomedViewport(r.zoom);T!=null?(T.zoomed&&(r.zoom=T.zoom),T.panned&&(r.pan=T.pan)):r.zoom=null}return new Ls(o[0],r)}},animate:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;a&&(r=Ie({},r,a));for(var u=0;u<o.length;u++){var l=o[u],f=l.animated()&&(r.queue===void 0||r.queue),h=l.animation(r,f?{queue:!0}:void 0);h.play()}return this}},stop:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var u=0;u<o.length;u++){for(var l=o[u],f=l._private,h=f.animation.current,v=0;v<h.length;v++){var c=h[v],d=c._private;a&&(d.duration=0)}r&&(f.animation.queue=[]),a||(f.animation.current=[])}return s.notify("draw"),this}}},ao,dl;function bi(){if(dl)return ao;dl=1;var t=Array.isArray;return ao=t,ao}var no,gl;function Qp(){if(gl)return no;gl=1;var t=bi(),e=hn(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function n(i,o){if(t(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:a.test(i)||!r.test(i)||o!=null&&i in Object(o)}return no=n,no}var io,pl;function Jp(){if(pl)return io;pl=1;var t=Uh(),e=fn(),r="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=t(s);return u==a||u==n||u==r||u==i}return io=o,io}var oo,yl;function jp(){if(yl)return oo;yl=1;var t=gi(),e=t["__core-js_shared__"];return oo=e,oo}var so,ml;function ey(){if(ml)return so;ml=1;var t=jp(),e=(function(){var a=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function r(a){return!!e&&e in a}return so=r,so}var uo,bl;function ty(){if(bl)return uo;bl=1;var t=Function.prototype,e=t.toString;function r(a){if(a!=null){try{return e.call(a)}catch{}try{return a+""}catch{}}return""}return uo=r,uo}var lo,wl;function ry(){if(wl)return lo;wl=1;var t=Jp(),e=ey(),r=fn(),a=ty(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,f=RegExp("^"+u.call(l).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(v){if(!r(v)||e(v))return!1;var c=t(v)?f:i;return c.test(a(v))}return lo=h,lo}var fo,El;function ay(){if(El)return fo;El=1;function t(e,r){return e?.[r]}return fo=t,fo}var ho,xl;function au(){if(xl)return ho;xl=1;var t=ry(),e=ay();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return ho=r,ho}var co,Tl;function wi(){if(Tl)return co;Tl=1;var t=au(),e=t(Object,"create");return co=e,co}var vo,Cl;function ny(){if(Cl)return vo;Cl=1;var t=wi();function e(){this.__data__=t?t(null):{},this.size=0}return vo=e,vo}var go,Sl;function iy(){if(Sl)return go;Sl=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return go=t,go}var po,Dl;function oy(){if(Dl)return po;Dl=1;var t=wi(),e="__lodash_hash_undefined__",r=Object.prototype,a=r.hasOwnProperty;function n(i){var o=this.__data__;if(t){var s=o[i];return s===e?void 0:s}return a.call(o,i)?o[i]:void 0}return po=n,po}var yo,Al;function sy(){if(Al)return yo;Al=1;var t=wi(),e=Object.prototype,r=e.hasOwnProperty;function a(n){var i=this.__data__;return t?i[n]!==void 0:r.call(i,n)}return yo=a,yo}var mo,Ll;function uy(){if(Ll)return mo;Ll=1;var t=wi(),e="__lodash_hash_undefined__";function r(a,n){var i=this.__data__;return this.size+=this.has(a)?0:1,i[a]=t&&n===void 0?e:n,this}return mo=r,mo}var bo,Nl;function ly(){if(Nl)return bo;Nl=1;var t=ny(),e=iy(),r=oy(),a=sy(),n=uy();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,bo=i,bo}var wo,Ml;function fy(){if(Ml)return wo;Ml=1;function t(){this.__data__=[],this.size=0}return wo=t,wo}var Eo,Rl;function cc(){if(Rl)return Eo;Rl=1;function t(e,r){return e===r||e!==e&&r!==r}return Eo=t,Eo}var xo,Ol;function Ei(){if(Ol)return xo;Ol=1;var t=cc();function e(r,a){for(var n=r.length;n--;)if(t(r[n][0],a))return n;return-1}return xo=e,xo}var To,Pl;function hy(){if(Pl)return To;Pl=1;var t=Ei(),e=Array.prototype,r=e.splice;function a(n){var i=this.__data__,o=t(i,n);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():r.call(i,o,1),--this.size,!0}return To=a,To}var Co,Il;function cy(){if(Il)return Co;Il=1;var t=Ei();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return Co=e,Co}var So,kl;function vy(){if(kl)return So;kl=1;var t=Ei();function e(r){return t(this.__data__,r)>-1}return So=e,So}var Do,Bl;function dy(){if(Bl)return Do;Bl=1;var t=Ei();function e(r,a){var n=this.__data__,i=t(n,r);return i<0?(++this.size,n.push([r,a])):n[i][1]=a,this}return Do=e,Do}var Ao,Fl;function gy(){if(Fl)return Ao;Fl=1;var t=fy(),e=hy(),r=cy(),a=vy(),n=dy();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Ao=i,Ao}var Lo,zl;function py(){if(zl)return Lo;zl=1;var t=au(),e=gi(),r=t(e,"Map");return Lo=r,Lo}var No,Vl;function yy(){if(Vl)return No;Vl=1;var t=ly(),e=gy(),r=py();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return No=a,No}var Mo,Gl;function my(){if(Gl)return Mo;Gl=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return Mo=t,Mo}var Ro,Ul;function xi(){if(Ul)return Ro;Ul=1;var t=my();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return Ro=e,Ro}var Oo,Hl;function by(){if(Hl)return Oo;Hl=1;var t=xi();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return Oo=e,Oo}var Po,Yl;function wy(){if(Yl)return Po;Yl=1;var t=xi();function e(r){return t(this,r).get(r)}return Po=e,Po}var Io,ql;function Ey(){if(ql)return Io;ql=1;var t=xi();function e(r){return t(this,r).has(r)}return Io=e,Io}var ko,_l;function xy(){if(_l)return ko;_l=1;var t=xi();function e(r,a){var n=t(this,r),i=n.size;return n.set(r,a),this.size+=n.size==i?0:1,this}return ko=e,ko}var Bo,Wl;function Ty(){if(Wl)return Bo;Wl=1;var t=yy(),e=by(),r=wy(),a=Ey(),n=xy();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Bo=i,Bo}var Fo,Xl;function Cy(){if(Xl)return Fo;Xl=1;var t=Ty(),e="Expected a function";function r(a,n){if(typeof a!="function"||n!=null&&typeof n!="function")throw new TypeError(e);var i=function(){var o=arguments,s=n?n.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=a.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(r.Cache||t),i}return r.Cache=t,Fo=r,Fo}var zo,$l;function Sy(){if($l)return zo;$l=1;var t=Cy(),e=500;function r(a){var n=t(a,function(o){return i.size===e&&i.clear(),o}),i=n.cache;return n}return zo=r,zo}var Vo,Kl;function vc(){if(Kl)return Vo;Kl=1;var t=Sy(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=t(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(e,function(o,s,u,l){i.push(u?l.replace(r,"$1"):s||o)}),i});return Vo=a,Vo}var Go,Zl;function dc(){if(Zl)return Go;Zl=1;function t(e,r){for(var a=-1,n=e==null?0:e.length,i=Array(n);++a<n;)i[a]=r(e[a],a,e);return i}return Go=t,Go}var Uo,Ql;function Dy(){if(Ql)return Uo;Ql=1;var t=$s(),e=dc(),r=bi(),a=hn(),n=t?t.prototype:void 0,i=n?n.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return e(s,o)+"";if(a(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Uo=o,Uo}var Ho,Jl;function gc(){if(Jl)return Ho;Jl=1;var t=Dy();function e(r){return r==null?"":t(r)}return Ho=e,Ho}var Yo,jl;function pc(){if(jl)return Yo;jl=1;var t=bi(),e=Qp(),r=vc(),a=gc();function n(i,o){return t(i)?i:e(i,o)?[i]:r(a(i))}return Yo=n,Yo}var qo,ef;function nu(){if(ef)return qo;ef=1;var t=hn();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return qo=e,qo}var _o,tf;function Ay(){if(tf)return _o;tf=1;var t=pc(),e=nu();function r(a,n){n=t(n,a);for(var i=0,o=n.length;a!=null&&i<o;)a=a[e(n[i++])];return i&&i==o?a:void 0}return _o=r,_o}var Wo,rf;function Ly(){if(rf)return Wo;rf=1;var t=Ay();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return Wo=e,Wo}var Ny=Ly(),My=ln(Ny),Xo,af;function Ry(){if(af)return Xo;af=1;var t=au(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Xo=e,Xo}var $o,nf;function Oy(){if(nf)return $o;nf=1;var t=Ry();function e(r,a,n){a=="__proto__"&&t?t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[a]=n}return $o=e,$o}var Ko,of;function Py(){if(of)return Ko;of=1;var t=Oy(),e=cc(),r=Object.prototype,a=r.hasOwnProperty;function n(i,o,s){var u=i[o];(!(a.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&t(i,o,s)}return Ko=n,Ko}var Zo,sf;function Iy(){if(sf)return Zo;sf=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(a,n){var i=typeof a;return n=n??t,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&a>-1&&a%1==0&&a<n}return Zo=r,Zo}var Qo,uf;function ky(){if(uf)return Qo;uf=1;var t=Py(),e=pc(),r=Iy(),a=fn(),n=nu();function i(o,s,u,l){if(!a(o))return o;s=e(s,o);for(var f=-1,h=s.length,v=h-1,c=o;c!=null&&++f<h;){var d=n(s[f]),p=u;if(d==="__proto__"||d==="constructor"||d==="prototype")return o;if(f!=v){var y=c[d];p=l?l(y,d,c):void 0,p===void 0&&(p=a(y)?y:r(s[f+1])?[]:{})}t(c,d,p),c=c[d]}return o}return Qo=i,Qo}var Jo,lf;function By(){if(lf)return Jo;lf=1;var t=ky();function e(r,a,n){return r==null?r:t(r,a,n)}return Jo=e,Jo}var Fy=By(),zy=ln(Fy),jo,ff;function Vy(){if(ff)return jo;ff=1;function t(e,r){var a=-1,n=e.length;for(r||(r=Array(n));++a<n;)r[a]=e[a];return r}return jo=t,jo}var es,hf;function Gy(){if(hf)return es;hf=1;var t=dc(),e=Vy(),r=bi(),a=hn(),n=vc(),i=nu(),o=gc();function s(u){return r(u)?t(u,i):a(u)?[u]:e(n(o(u)))}return es=s,es}var Uy=Gy(),Hy=ln(Uy),Yy={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(n){},beforeSet:function(n,i){},onSet:function(n){},canSet:function(n){return!0}};return e=Ie({},r,e),function(n,i){var o=e,s=this,u=s.length!==void 0,l=u?s:[s],f=u?s[0]:s;if(Me(n)){var h=n.indexOf(".")!==-1,v=h&&Hy(n);if(o.allowGetting&&i===void 0){var c;return f&&(o.beforeGet(f),v&&f._private[o.field][n]===void 0?c=My(f._private[o.field],v):c=f._private[o.field][n]),c}else if(o.allowSetting&&i!==void 0){var d=!o.immutableKeys[n];if(d){var p=Rh({},n,i);o.beforeSet(s,p);for(var y=0,g=l.length;y<g;y++){var b=l[y];o.canSet(b)&&(v&&f._private[o.field][n]===void 0?zy(b._private[o.field],v,i):b._private[o.field][n]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&_e(n)){var m=n,w,T,D=Object.keys(m);o.beforeSet(s,m);for(var x=0;x<D.length;x++){w=D[x],T=m[w];var N=!o.immutableKeys[w];if(N)for(var O=0;O<l.length;O++){var R=l[O];o.canSet(R)&&(R._private[o.field][w]=T)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&it(n)){var P=n;s.on(o.bindingEvent,P)}else if(o.allowGetting&&n===void 0){var M;return f&&(o.beforeGet(f),M=f._private[o.field]),M}return s}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ie({},r,e),function(n){var i=e,o=this,s=o.length!==void 0,u=s?o:[o];if(Me(n)){for(var l=n.split(/\s+/),f=l.length,h=0;h<f;h++){var v=l[h];if(!br(v)){var c=!i.immutableKeys[v];if(c)for(var d=0,p=u.length;d<p;d++)u[d]._private[i.field][v]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(n===void 0){for(var y=0,g=u.length;y<g;y++)for(var b=u[y]._private[i.field],m=Object.keys(b),w=0;w<m.length;w++){var T=m[w],D=!i.immutableKeys[T];D&&(b[T]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},qy={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(a,n){var i=this,o=Array.prototype.slice.call(arguments,0);return new Ca(function(s,u){var l=function(c){i.off.apply(i,h),s(c)},f=o.concat([l]),h=f.concat([]);i.on.apply(i,f)})}}},$e={};[Zp,Yy,qy].forEach(function(t){Ie($e,t)});var _y={animate:$e.animate(),animation:$e.animation(),animated:$e.animated(),clearQueue:$e.clearQueue(),delay:$e.delay(),delayAnimation:$e.delayAnimation(),stop:$e.stop()},Gn={classes:function(e){var r=this;if(e===void 0){var a=[];return r[0]._private.classes.forEach(function(d){return a.push(d)}),a}else Je(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new Ta(e),o=0;o<r.length;o++){for(var s=r[o],u=s._private,l=u.classes,f=!1,h=0;h<e.length;h++){var v=e[h],c=l.has(v);if(!c){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=i,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Je(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,i=[],o=0,s=a.length;o<s;o++)for(var u=a[o],l=u._private.classes,f=!1,h=0;h<e.length;h++){var v=e[h],c=l.has(v),d=!1;r||n&&!c?(l.add(v),d=!0):(!r||n&&c)&&(l.delete(v),d=!0),!f&&d&&(i.push(u),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var a=this;if(r==null)r=250;else if(r===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},r),a}};Gn.className=Gn.classNames=Gn.classes;var qe={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:vt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};qe.variable="(?:[\\w-.]|(?:\\\\"+qe.metaChar+"))+";qe.className="(?:[\\w-]|(?:\\\\"+qe.metaChar+"))+";qe.value=qe.string+"|"+qe.number;qe.id=qe.variable;(function(){var t,e,r;for(t=qe.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],qe.comparatorOp+="|@"+e;for(t=qe.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(qe.comparatorOp+="|\\!"+e)})();var Qe=function(){return{checks:[]}},Ae={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Ns=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Yd(t.selector,e.selector)}),Wy=(function(){for(var t={},e,r=0;r<Ns.length;r++)e=Ns[r],t[e.selector]=e.matches;return t})(),Xy=function(e,r){return Wy[e](r)},$y="("+Ns.map(function(t){return t.selector}).join("|")+")",jr=function(e){return e.replace(new RegExp("\\\\("+qe.metaChar+")","g"),function(r,a){return a})},cr=function(e,r,a){e[e.length-1]=a},Ms=[{name:"group",query:!0,regex:"("+qe.group+")",populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:$y,populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+qe.id+")",populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.ID,value:jr(i)})}},{name:"className",query:!0,regex:"\\.("+qe.className+")",populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.CLASS,value:jr(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+qe.variable+")\\s*\\]",populate:function(e,r,a){var n=ft(a,1),i=n[0];r.checks.push({type:Ae.DATA_EXIST,field:jr(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+qe.variable+")\\s*("+qe.comparatorOp+")\\s*("+qe.value+")\\s*\\]",populate:function(e,r,a){var n=ft(a,3),i=n[0],o=n[1],s=n[2],u=new RegExp("^"+qe.string+"$").exec(s)!=null;u?s=s.substring(1,s.length-1):s=parseFloat(s),r.checks.push({type:Ae.DATA_COMPARE,field:jr(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+qe.boolOp+")\\s*("+qe.variable+")\\s*\\]",populate:function(e,r,a){var n=ft(a,2),i=n[0],o=n[1];r.checks.push({type:Ae.DATA_BOOL,field:jr(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+qe.meta+")\\s*("+qe.comparatorOp+")\\s*("+qe.number+")\\s*\\]\\]",populate:function(e,r,a){var n=ft(a,3),i=n[0],o=n[1],s=n[2];r.checks.push({type:Ae.META_COMPARE,field:jr(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:qe.separator,populate:function(e,r){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,o=e[e.length-1];a!=null&&(o.subject=a,e.currentSubject=null),o.edgeCount=n,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Qe();return s}},{name:"directedEdge",separator:!0,regex:qe.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:Ae.DIRECTED_EDGE,source:n,target:i}),cr(e,r,a),e.edgeCount++,i}else{var o=Qe(),s=r,u=Qe();return o.checks.push({type:Ae.NODE_SOURCE,source:s,target:u}),cr(e,r,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:qe.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:Ae.UNDIRECTED_EDGE,nodes:[n,i]}),cr(e,r,a),e.edgeCount++,i}else{var o=Qe(),s=r,u=Qe();return o.checks.push({type:Ae.NODE_NEIGHBOR,node:s,neighbor:u}),cr(e,r,o),u}}},{name:"child",separator:!0,regex:qe.child,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:Ae.CHILD,parent:i,child:n}),cr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=Qe(),s=e[e.length-1],u=Qe(),l=Qe(),f=Qe(),h=Qe();return o.checks.push({type:Ae.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:Ae.TRUE}],h.checks.push({type:Ae.TRUE}),u.checks.push({type:Ae.PARENT,parent:h,child:f}),cr(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var v=Qe(),c=Qe(),d=[{type:Ae.PARENT,parent:v,child:c}];return v.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"descendant",separator:!0,regex:qe.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:Ae.DESCENDANT,ancestor:i,descendant:n}),cr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=Qe(),s=e[e.length-1],u=Qe(),l=Qe(),f=Qe(),h=Qe();return o.checks.push({type:Ae.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:Ae.TRUE}],h.checks.push({type:Ae.TRUE}),u.checks.push({type:Ae.ANCESTOR,ancestor:h,descendant:f}),cr(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var v=Qe(),c=Qe(),d=[{type:Ae.ANCESTOR,ancestor:v,descendant:c}];return v.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"subject",modifier:!0,regex:qe.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Ke("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;i===Ae.DIRECTED_EDGE?n.type=Ae.NODE_TARGET:i===Ae.UNDIRECTED_EDGE&&(n.type=Ae.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Ms.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Ky=function(e){for(var r,a,n,i=0;i<Ms.length;i++){var o=Ms[i],s=o.name,u=e.match(o.regexObj);if(u!=null){a=u,r=o,n=s;var l=u[0];e=e.substring(l.length);break}}return{expr:r,match:a,name:n,remaining:e}},Zy=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},Qy=function(e){var r=this,a=r.inputText=e,n=r[0]=Qe();for(r.length=1,a=Zy(a);;){var i=Ky(a);if(i.expr==null)return Ke("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(r,n,o);if(s===!1)return!1;if(s!=null&&(n=s),a=i.remaining,a.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0)return Ke("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Ke("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Ke("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Jy=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return Me(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,h){var v=f.type,c=f.value;switch(v){case Ae.GROUP:{var d=e(c);return d.substring(0,d.length-1)}case Ae.DATA_COMPARE:{var p=f.field,y=f.operator;return"["+p+a(e(y))+r(c)+"]"}case Ae.DATA_BOOL:{var g=f.operator,b=f.field;return"["+e(g)+b+"]"}case Ae.DATA_EXIST:{var m=f.field;return"["+m+"]"}case Ae.META_COMPARE:{var w=f.operator,T=f.field;return"[["+T+a(e(w))+r(c)+"]]"}case Ae.STATE:return c;case Ae.ID:return"#"+c;case Ae.CLASS:return"."+c;case Ae.PARENT:case Ae.CHILD:return i(f.parent,h)+a(">")+i(f.child,h);case Ae.ANCESTOR:case Ae.DESCENDANT:return i(f.ancestor,h)+" "+i(f.descendant,h);case Ae.COMPOUND_SPLIT:{var D=i(f.left,h),x=i(f.subject,h),N=i(f.right,h);return D+(D.length>0?" ":"")+x+N}case Ae.TRUE:return""}},i=function(f,h){return f.checks.reduce(function(v,c,d){return v+(h===f&&d===0?"$":"")+n(c,h)},"")},o="",s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},jy={parse:Qy,toString:Jy},yc=function(e,r,a){var n,i=Me(e),o=be(e),s=Me(a),u,l,f=!1,h=!1,v=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),h=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||s||f)&&(u=!i&&!o?"":""+e,l=""+a),f&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),r){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":v=!0,n=e>a;break;case">=":v=!0,n=e>=a;break;case"<":v=!0,n=e<a;break;case"<=":v=!0,n=e<=a;break;default:n=!1;break}return h&&(e!=null||!v)&&(n=!n),n},em=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},tm=function(e){return e!==void 0},iu=function(e,r){return e.data(r)},rm=function(e,r){return e[r]()},ot=[],rt=function(e,r){return e.checks.every(function(a){return ot[a.type](a,r)})};ot[Ae.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};ot[Ae.STATE]=function(t,e){var r=t.value;return Xy(r,e)};ot[Ae.ID]=function(t,e){var r=t.value;return e.id()===r};ot[Ae.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};ot[Ae.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return yc(rm(e,r),a,n)};ot[Ae.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return yc(iu(e,r),a,n)};ot[Ae.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return em(iu(e,r),a)};ot[Ae.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,tm(iu(e,r))};ot[Ae.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),i=e.target();return rt(r,n)&&rt(a,i)||rt(a,n)&&rt(r,i)};ot[Ae.NODE_NEIGHBOR]=function(t,e){return rt(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&rt(t.neighbor,r)})};ot[Ae.DIRECTED_EDGE]=function(t,e){return rt(t.source,e.source())&&rt(t.target,e.target())};ot[Ae.NODE_SOURCE]=function(t,e){return rt(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&rt(t.target,r)})};ot[Ae.NODE_TARGET]=function(t,e){return rt(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&rt(t.source,r)})};ot[Ae.CHILD]=function(t,e){return rt(t.child,e)&&rt(t.parent,e.parent())};ot[Ae.PARENT]=function(t,e){return rt(t.parent,e)&&e.children().some(function(r){return rt(t.child,r)})};ot[Ae.DESCENDANT]=function(t,e){return rt(t.descendant,e)&&e.ancestors().some(function(r){return rt(t.ancestor,r)})};ot[Ae.ANCESTOR]=function(t,e){return rt(t.ancestor,e)&&e.descendants().some(function(r){return rt(t.descendant,r)})};ot[Ae.COMPOUND_SPLIT]=function(t,e){return rt(t.subject,e)&&rt(t.left,e)&&rt(t.right,e)};ot[Ae.TRUE]=function(){return!0};ot[Ae.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};ot[Ae.FILTER]=function(t,e){var r=t.value;return r(e)};var am=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Ae.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(i){for(var o=0;o<r.length;o++){var s=r[o];if(rt(s,i))return!0}return!1};return r.text()==null&&(a=function(){return!0}),e.filter(a)},nm=function(e){for(var r=this,a=0;a<r.length;a++){var n=r[a];if(rt(n,e))return!0}return!1},im={matches:nm,filter:am},xr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Me(e)&&e.match(/^\s*$/)||(Bt(e)?this.addQuery({checks:[{type:Ae.COLLECTION,value:e.collection()}]}):it(e)?this.addQuery({checks:[{type:Ae.FILTER,value:e}]}):Me(e)?this.parse(e)||(this.invalid=!0):nt("A selector must be created from a string; found "))},Tr=xr.prototype;[jy,im].forEach(function(t){return Ie(Tr,t)});Tr.text=function(){return this.inputText};Tr.size=function(){return this.length};Tr.eq=function(t){return this[t]};Tr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Tr.addQuery=function(t){this[this.length++]=t};Tr.selector=Tr.toString;var yr={allAre:function(e){var r=new xr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new xr(e);return this.some(function(a){return r.matches(a)})},some:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(n)return!0}return!1},every:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(!n)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,a=e.length;return r!==a?!1:r===1?this[0]===e[0]:this.every(function(n){return e.hasElementWithId(n.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(a){return r.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(a){return r.hasElementWithId(a.id())})}};yr.allAreNeighbours=yr.allAreNeighbors;yr.has=yr.contains;yr.equal=yr.equals=yr.same;var Gt=function(e,r){return function(n,i,o,s){var u=n,l=this,f;if(u==null?f="":Bt(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var h=l[0]._private,v=h.traversalCache=h.traversalCache||{},c=v[r]=v[r]||[],d=Yr(f),p=c[d];return p||(c[d]=e.call(l,n,i,o,s))}else return e.call(l,n,i,o,s)}},ma={parent:function(e){var r=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var i=this[n],o=i._private.parent;o&&r.push(o)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var i=a[n];r.push(i)}a=a.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,a=0;a<this.length;a++){var n=this[a],i=n.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Gt(function(t){for(var e=[],r=0;r<this.length;r++)for(var a=this[r],n=a._private.children,i=0;i<n.length;i++)e.push(n[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function a(n){for(var i=0;i<n.length;i++){var o=n[i];r.push(o),o.children().nonempty()&&a(o.children())}}return a(this.children()),this.spawn(r,!0).filter(e)}};function ou(t,e,r,a){for(var n=[],i=new Ta,o=t.cy(),s=o.hasCompoundNodes(),u=0;u<t.length;u++){var l=t[u];r?n.push(l):s&&a(n,i,l)}for(;n.length>0;){var f=n.shift();e(f),i.add(f.id()),s&&a(n,i,f)}return t}function mc(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||t.push(i)}}ma.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ou(this,t,e,mc)};function bc(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}ma.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ou(this,t,e,bc)};function om(t,e,r){bc(t,e,r),mc(t,e,r)}ma.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ou(this,t,e,om)};ma.ancestors=ma.parents;var ja,wc;ja=wc={data:$e.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:$e.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:$e.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:$e.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:$e.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:$e.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ja.attr=ja.data;ja.removeAttr=ja.removeData;var sm=wc,Ti={};function ts(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var a=0,n=r[0],i=n._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(a+=t(n,s))}return a}else return}}Ie(Ti,{degree:ts(function(t,e){return e.source().same(e.target())?2:1}),indegree:ts(function(t,e){return e.target().same(t)?1:0}),outdegree:ts(function(t,e){return e.source().same(t)?1:0})});function ea(t,e){return function(r){for(var a,n=this.nodes(),i=0;i<n.length;i++){var o=n[i],s=o[t](r);s!==void 0&&(a===void 0||e(s,a))&&(a=s)}return a}}Ie(Ti,{minDegree:ea("degree",function(t,e){return t<e}),maxDegree:ea("degree",function(t,e){return t>e}),minIndegree:ea("indegree",function(t,e){return t<e}),maxIndegree:ea("indegree",function(t,e){return t>e}),minOutdegree:ea("outdegree",function(t,e){return t<e}),maxOutdegree:ea("outdegree",function(t,e){return t>e})});Ie(Ti,{totalDegree:function(e){for(var r=0,a=this.nodes(),n=0;n<a.length;n++)r+=a[n].degree(e);return r}});var _t,Ec,xc=function(e,r,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var o=i._private.position,s={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,a),i.dirtyBoundingBoxCache()}}},cf={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){xc(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};_t=Ec={position:$e.data(cf),silentPosition:$e.data(Ie({},cf,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){xc(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(_e(e))r?this.silentPosition(e):this.position(e);else if(it(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=a(o,i))&&(r?o.silentPosition(s):o.position(s))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(_e(e)?(n={x:be(e.x)?e.x:0,y:be(e.y)?e.y:0},a=r):Me(e)&&be(r)&&(n={x:0,y:0},n[e]=r),n!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var u=s.position(),l={x:u.x+n.x,y:u.y+n.y};a?s.silentPosition(l):s.position(l)}}i.endBatch()}return this},silentShift:function(e,r){return _e(e)?this.shift(e,!0):Me(e)&&be(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),i=n.zoom(),o=n.pan(),s=_e(e)?e:void 0,u=s!==void 0||r!==void 0&&Me(e);if(a&&a.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];r!==void 0?f.position(e,(r-o[e])/i):s!==void 0&&f.position(Zh(s,i,o))}else{var h=a.position();return s=yi(h,i,o),e===void 0?s:s[e]}else if(!u)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),i=_e(e)?e:void 0,o=i!==void 0||r!==void 0&&Me(e),s=n.hasCompoundNodes();if(a&&a.isNode())if(o)for(var u=0;u<this.length;u++){var l=this[u],f=s?l.parent():null,h=f&&f.length>0,v=h;h&&(f=f[0]);var c=v?f.position():{x:0,y:0};r!==void 0?l.position(e,r+c[e]):i!==void 0&&l.position({x:i.x+c.x,y:i.y+c.y})}else{var d=a.position(),p=s?a.parent():null,y=p&&p.length>0,g=y;y&&(p=p[0]);var b=g?p.position():{x:0,y:0};return i={x:d.x-b.x,y:d.y-b.y},e===void 0?i:i[e]}else if(!o)return;return this}};_t.modelPosition=_t.point=_t.position;_t.modelPositions=_t.points=_t.positions;_t.renderedPoint=_t.renderedPosition;_t.relativePoint=_t.relativePosition;var um=Ec,ba=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},wa=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},lm=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},da,Lr;da=Lr={};Lr.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,o=e.x2*a+n.x,s=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};Lr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var a=r._private;a.compoundBoundsClean=!1,a.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};Lr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(o){if(!o.isParent())return;var s=o._private,u=o.children(),l=o.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},h=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),v=s.position;(h.w===0||h.h===0)&&(h={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},h.x1=v.x-h.w/2,h.x2=v.x+h.w/2,h.y1=v.y-h.h/2,h.y2=v.y+h.h/2);function c(O,R,P){var M=0,I=0,E=R+P;return O>0&&E>0&&(M=R/E*O,I=P/E*O),{biasDiff:M,biasComplementDiff:I}}function d(O,R,P,M){if(P.units==="%")switch(M){case"width":return O>0?P.pfValue*O:0;case"height":return R>0?P.pfValue*R:0;case"average":return O>0&&R>0?P.pfValue*(O+R)/2:0;case"min":return O>0&&R>0?O>R?P.pfValue*R:P.pfValue*O:0;case"max":return O>0&&R>0?O>R?P.pfValue*O:P.pfValue*R:0;default:return 0}else return P.units==="px"?P.pfValue:0}var p=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var y=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(y=y*100/f.width.val);var g=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(g=g*100/f.height.val);var b=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(b=b*100/f.height.val);var m=c(f.width.val-h.w,p,y),w=m.biasDiff,T=m.biasComplementDiff,D=c(f.height.val-h.h,g,b),x=D.biasDiff,N=D.biasComplementDiff;s.autoPadding=d(h.w,h.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(h.w,f.width.val),v.x=(-w+h.x1+h.x2+T)/2,s.autoHeight=Math.max(h.h,f.height.val),v.y=(-x+h.y1+h.y2+N)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||t)&&(r(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var Vt=function(e){return e===1/0||e===-1/0?0:e},qt=function(e,r,a,n,i){n-r===0||i-a===0||r==null||a==null||n==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},vr=function(e,r){return r==null?e:qt(e,r.x1,r.y1,r.x2,r.y2)},ka=function(e,r,a){return Mt(e,r,a)},Nn=function(e,r,a){if(!r.cy().headless()){var n=r._private,i=n.rstyle,o=i.arrowWidth/2,s=r.pstyle(a+"-arrow-shape").value,u,l;if(s!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var f=n.arrowBounds=n.arrowBounds||{},h=f[a]=f[a]||{};h.x1=u-o,h.y1=l-o,h.x2=u+o,h.y2=l+o,h.w=h.x2-h.x1,h.h=h.y2-h.y1,zn(h,1),qt(e,h.x1,h.y1,h.x2,h.y2)}}},rs=function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var i=r._private,o=i.rstyle,s=r.pstyle(n+"label").strValue;if(s){var u=r.pstyle("text-halign"),l=r.pstyle("text-valign"),f=ka(o,"labelWidth",a),h=ka(o,"labelHeight",a),v=ka(o,"labelX",a),c=ka(o,"labelY",a),d=r.pstyle(n+"text-margin-x").pfValue,p=r.pstyle(n+"text-margin-y").pfValue,y=r.isEdge(),g=r.pstyle(n+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,m=r.pstyle("text-border-width").pfValue,w=m/2,T=r.pstyle("text-background-padding").pfValue,D=2,x=h,N=f,O=N/2,R=x/2,P,M,I,E;if(y)P=v-O,M=v+O,I=c-R,E=c+R;else{switch(ba(u.value)){case"left":P=v-N,M=v;break;case"center":P=v-O,M=v+O;break;case"right":P=v,M=v+N;break}switch(wa(l.value)){case"top":I=c-x,E=c;break;case"center":I=c-R,E=c+R;break;case"bottom":I=c,E=c+x;break}}var A=d-Math.max(b,w)-T-D,C=d+Math.max(b,w)+T+D,S=p-Math.max(b,w)-T-D,L=p+Math.max(b,w)+T+D;P+=A,M+=C,I+=S,E+=L;var V=a||"main",F=i.labelBounds,B=F[V]=F[V]||{};B.x1=P,B.y1=I,B.x2=M,B.y2=E,B.w=M-P,B.h=E-I,B.leftPad=A,B.rightPad=C,B.topPad=S,B.botPad=L;var Y=y&&g.strValue==="autorotate",q=g.pfValue!=null&&g.pfValue!==0;if(Y||q){var Q=Y?ka(i.rstyle,"labelAngle",a):g.pfValue,$=Math.cos(Q),K=Math.sin(Q),j=(P+M)/2,re=(I+E)/2;if(!y){switch(ba(u.value)){case"left":j=M;break;case"right":j=P;break}switch(wa(l.value)){case"top":re=E;break;case"bottom":re=I;break}}var U=function(ge,le){return ge=ge-j,le=le-re,{x:ge*$-le*K+j,y:ge*K+le*$+re}},H=U(P,I),_=U(P,E),W=U(M,I),J=U(M,E);P=Math.min(H.x,_.x,W.x,J.x),M=Math.max(H.x,_.x,W.x,J.x),I=Math.min(H.y,_.y,W.y,J.y),E=Math.max(H.y,_.y,W.y,J.y)}var te=V+"Rot",de=F[te]=F[te]||{};de.x1=P,de.y1=I,de.x2=M,de.y2=E,de.w=M-P,de.h=E-I,qt(e,P,I,M,E),qt(i.labelBounds.all,P,I,M,E)}return e}},vf=function(e,r){if(!r.cy().headless()){var a=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value,i=r.pstyle("outline-offset").value,o=n+i;Tc(e,r,a,o,"outside",o/2)}},Tc=function(e,r,a,n,i,o){if(!(a===0||n<=0||i==="inside")){var s=r.cy(),u=s.renderer(),l=u.nodeShapes[u.getNodeShape(r)];if(l){var f=r.position(),h=f.x,v=f.y,c=r.width(),d=r.height();if(l.hasMiterBounds){i==="center"&&(n/=2);var p=l.miterBounds(h,v,c,d,n);vr(e,p)}else o!=null&&o>0&&Vn(e,[o,o,o,o])}}},fm=function(e,r){if(!r.cy().headless()){var a=r.pstyle("border-opacity").value,n=r.pstyle("border-width").pfValue,i=r.pstyle("border-position").value;Tc(e,r,a,n,i)}},hm=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),o=Rt(),s=e._private,u=e.isNode(),l=e.isEdge(),f,h,v,c,d,p,y=s.rstyle,g=u&&n?e.pstyle("bounds-expansion").pfValue:[0],b=function(Te){return Te.pstyle("display").value!=="none"},m=!n||b(e)&&(!l||b(e.source())&&b(e.target()));if(m){var w=0,T=0;n&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(T=e.pstyle("overlay-padding").value));var D=0,x=0;n&&r.includeUnderlays&&(D=e.pstyle("underlay-opacity").value,D!==0&&(x=e.pstyle("underlay-padding").value));var N=Math.max(T,x),O=0,R=0;if(n&&(O=e.pstyle("width").pfValue,R=O/2),u&&r.includeNodes){var P=e.position();d=P.x,p=P.y;var M=e.outerWidth(),I=M/2,E=e.outerHeight(),A=E/2;f=d-I,h=d+I,v=p-A,c=p+A,qt(o,f,v,h,c),n&&vf(o,e),n&&r.includeOutlines&&!i&&vf(o,e),n&&fm(o,e)}else if(l&&r.includeEdges)if(n&&!i){var C=e.pstyle("curve-style").strValue;if(f=Math.min(y.srcX,y.midX,y.tgtX),h=Math.max(y.srcX,y.midX,y.tgtX),v=Math.min(y.srcY,y.midY,y.tgtY),c=Math.max(y.srcY,y.midY,y.tgtY),f-=R,h+=R,v-=R,c+=R,qt(o,f,v,h,c),C==="haystack"){var S=y.haystackPts;if(S&&S.length===2){if(f=S[0].x,v=S[0].y,h=S[1].x,c=S[1].y,f>h){var L=f;f=h,h=L}if(v>c){var V=v;v=c,c=V}qt(o,f-R,v-R,h+R,c+R)}}else if(C==="bezier"||C==="unbundled-bezier"||dr(C,"segments")||dr(C,"taxi")){var F;switch(C){case"bezier":case"unbundled-bezier":F=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=y.linePts;break}if(F!=null)for(var B=0;B<F.length;B++){var Y=F[B];f=Y.x-R,h=Y.x+R,v=Y.y-R,c=Y.y+R,qt(o,f,v,h,c)}}}else{var q=e.source(),Q=q.position(),$=e.target(),K=$.position();if(f=Q.x,h=K.x,v=Q.y,c=K.y,f>h){var j=f;f=h,h=j}if(v>c){var re=v;v=c,c=re}f-=R,h+=R,v-=R,c+=R,qt(o,f,v,h,c)}if(n&&r.includeEdges&&l&&(Nn(o,e,"mid-source"),Nn(o,e,"mid-target"),Nn(o,e,"source"),Nn(o,e,"target")),n){var U=e.pstyle("ghost").value==="yes";if(U){var H=e.pstyle("ghost-offset-x").pfValue,_=e.pstyle("ghost-offset-y").pfValue;qt(o,o.x1+H,o.y1+_,o.x2+H,o.y2+_)}}var W=s.bodyBounds=s.bodyBounds||{};Qu(W,o),Vn(W,g),zn(W,1),n&&(f=o.x1,h=o.x2,v=o.y1,c=o.y2,qt(o,f-N,v-N,h+N,c+N));var J=s.overlayBounds=s.overlayBounds||{};Qu(J,o),Vn(J,g),zn(J,1);var te=s.labelBounds=s.labelBounds||{};te.all!=null?_g(te.all):te.all=Rt(),n&&r.includeLabels&&(r.includeMainLabels&&rs(o,e,null),l&&(r.includeSourceLabels&&rs(o,e,"source"),r.includeTargetLabels&&rs(o,e,"target")))}return o.x1=Vt(o.x1),o.y1=Vt(o.y1),o.x2=Vt(o.x2),o.y2=Vt(o.y2),o.w=Vt(o.x2-o.x1),o.h=Vt(o.y2-o.y1),o.w>0&&o.h>0&&m&&(Vn(o,g),zn(o,1)),o},Cc=function(e){var r=0,a=function(o){return(o?1:0)<<r++},n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n+=a(e.includeOutlines),n},Sc=function(e){var r=function(s){return Math.round(s)};if(e.isEdge()){var a=e.source().position(),n=e.target().position();return _u([r(a.x),r(a.y),r(n.x),r(n.y)])}else{var i=e.position();return _u([r(i.x),r(i.y)])}},df=function(e,r){var a=e._private,n,i=e.isEdge(),o=r==null?gf:Cc(r),s=o===gf;if(a.bbCache==null?(n=hm(e,en),a.bbCache=n,a.bbCachePosKey=Sc(e)):n=a.bbCache,!s){var u=e.isNode();n=Rt(),(r.includeNodes&&u||r.includeEdges&&!u)&&(r.includeOverlays?vr(n,a.overlayBounds):vr(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?vr(n,a.labelBounds.all):(r.includeMainLabels&&vr(n,a.labelBounds.mainRot),r.includeSourceLabels&&vr(n,a.labelBounds.sourceRot),r.includeTargetLabels&&vr(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},en={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},gf=Cc(en),pf=Tt(en);Lr.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,a=pa(function(f){var h=f._private;return h.bbCache==null||h.styleDirty||h.bbCachePosKey!==Sc(f)},function(f){return f.id()});if(r&&this.length===1&&!a(this[0]))t===void 0?t=en:t=pf(t),e=df(this[0],t);else{e=Rt(),t=t||en;var n=pf(t),i=this,o=i.cy(),s=o.styleEnabled();this.edges().forEach(a),this.nodes().forEach(a),s&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var u=0;u<i.length;u++){var l=i[u];a(l)&&l.dirtyBoundingBoxCache(),vr(e,df(l,n))}}return e.x1=Vt(e.x1),e.y1=Vt(e.y1),e.x2=Vt(e.x2),e.y2=Vt(e.y2),e.w=Vt(e.x2-e.x1),e.h=Vt(e.y2-e.y1),e};Lr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Lr.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a&&(n=e.filter(function(l){return l.isParent()}),e=e.not(n)),_e(t)){var i=t;t=function(){return i}}var o=function(f,h){return f._private.bbAtOldPos=t(f,h)},s=function(f){return f._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=qg(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),u};da.boundingbox=da.bb=da.boundingBox;da.renderedBoundingbox=da.renderedBoundingBox;var cm=Lr,Ha,dn;Ha=dn={};var Dc=function(e){e.uppercaseName=Mu(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Mu(e.outerName),Ha[e.name]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var s=a.pstyle(e.name);switch(s.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},Ha["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){var s=a[e.name](),u=a.pstyle("border-position").value,l;u==="center"?l=a.pstyle("border-width").pfValue:u==="outside"?l=2*a.pstyle("border-width").pfValue:l=0;var f=2*a.padding();return s+l+f}else return 1},Ha["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Ha["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};Dc({name:"width"});Dc({name:"height"});dn.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};dn.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};dn.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var vm=dn,dm=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},gm=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy();return yi(r(e),a.zoom(),a.pan())}},pm=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy(),n=a.pan(),i=a.zoom();return r(e).map(function(o){return yi(o,i,n)})}},ym=function(e){return e.renderer().getControlPoints(e)},mm=function(e){return e.renderer().getSegmentPoints(e)},bm=function(e){return e.renderer().getSourceEndpoint(e)},wm=function(e){return e.renderer().getTargetEndpoint(e)},Em=function(e){return e.renderer().getEdgeMidpoint(e)},yf={controlPoints:{get:ym,mult:!0},segmentPoints:{get:mm,mult:!0},sourceEndpoint:{get:bm},targetEndpoint:{get:wm},midpoint:{get:Em}},xm=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Tm=Object.keys(yf).reduce(function(t,e){var r=yf[e],a=xm(e);return t[e]=function(){return dm(this,r.get)},r.mult?t[a]=function(){return pm(this,r.get)}:t[a]=function(){return gm(this,r.get)},t},{}),Cm=Ie({},um,cm,vm,Tm);/*!
9
9
  Event object based on jQuery events, MIT license
10
10
 
11
11
  https://jquery.org/license/
12
12
  https://tldrlegal.com/license/mit-license
13
13
  https://github.com/jquery/jquery/blob/master/src/event.js
14
- */var Ac=function(e,r){this.recycle(e,r)};function Ba(){return!1}function Mn(){return!0}Ac.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ba,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Mn:Ba):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:a.x*n+i.x,y:a.y*n+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Mn;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Mn;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Mn,this.stopPropagation()},isDefaultPrevented:Ba,isPropagationStopped:Ba,isImmediatePropagationStopped:Ba};var Lc=/^([^.]+)(\.(?:[^.]+))?$/,Sm=".*",Nc={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},mf=Object.keys(Nc),Dm={};function Ci(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Dm,e=arguments.length>1?arguments[1]:void 0,r=0;r<mf.length;r++){var a=mf[r];this[a]=t[a]||Nc[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Cr=Ci.prototype,Mc=function(e,r,a,n,i,o,s){it(n)&&(i=n,n=null),s&&(o==null?o=s:o=Ie({},o,s));for(var u=Je(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!br(f)){var h=f.match(Lc);if(h){var v=h[1],c=h[2]?h[2]:null,d=r(e,f,v,c,n,i,o);if(d===!1)break}}}},bf=function(e,r){return e.addEventFields(e.context,r),new Ac(r.type,r)},Am=function(e,r,a){if(Od(a)){r(e,a);return}else if(_e(a)){r(e,bf(e,a));return}for(var n=Je(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var o=n[i];if(!br(o)){var s=o.match(Lc);if(s){var u=s[1],l=s[2]?s[2]:null,f=bf(e,{type:u,namespace:l,target:e.context});r(e,f)}}}};Cr.on=Cr.addListener=function(t,e,r,a,n){return Mc(this,function(i,o,s,u,l,f,h){it(f)&&i.listeners.push({event:o,callback:f,type:s,namespace:u,qualifier:l,conf:h})},t,e,r,a,n),this};Cr.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};Cr.removeListener=Cr.off=function(t,e,r,a){var n=this;this.emitting!==0&&(this.listeners=dg(this.listeners));for(var i=this.listeners,o=function(l){var f=i[l];Mc(n,function(h,v,c,d,p,y){if((f.type===c||t==="*")&&(!d&&f.namespace!==".*"||f.namespace===d)&&(!p||h.qualifierCompare(f.qualifier,p))&&(!y||f.callback===y))return i.splice(l,1),!1},t,e,r,a)},s=i.length-1;s>=0;s--)o(s);return this};Cr.removeAllListeners=function(){return this.removeListener("*")};Cr.emit=Cr.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,Je(e)||(e=[e]),Am(this,function(i,o){r!=null&&(a=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],n=a.length);for(var s=function(){var f=a[u];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===Sm)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&pg(h,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==f}));var v=i.callbackContext(i.context,f,o),c=f.callback.apply(v,h);i.afterEmit(i.context,f,o),c===!1&&(o.stopPropagation(),o.preventDefault())}},u=0;u<n;u++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var Lm={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&un(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Rn=function(e){return Me(e)?new xr(e):e},Rc={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;a.emitter||(a.emitter=new Ci(Lm,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){for(var n=Rn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){for(var n=Rn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,a){for(var n=Rn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,n,a)}return this},once:function(e,r,a){for(var n=Rn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,r){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};$e.eventAliasesOn(Rc);var Oc={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):r.push(n)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Me(e)||Bt(e))return new xr(e).filter(this);if(it(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);s&&a.push(o)}return a}return this.spawn()},not:function(e){if(e){Me(e)&&(e=this.filter(e));for(var r=this.spawn(),a=0;a<this.length;a++){var n=this[a],i=e.has(n);i||r.push(n)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Me(e)){var r=e;return this.filter(r)}for(var a=this.spawn(),n=this,i=e,o=this.length<e.length,s=o?n:i,u=o?i:n,l=0;l<s.length;l++){var f=s[l];u.has(f)&&a.push(f)}return a},xor:function(e){var r=this._private.cy;Me(e)&&(e=r.$(e));var a=this.spawn(),n=this,i=e,o=function(u,l){for(var f=0;f<u.length;f++){var h=u[f],v=h._private.data.id,c=l.hasElementWithId(v);c||a.push(h)}};return o(n,i),o(i,n),a},diff:function(e){var r=this._private.cy;Me(e)&&(e=r.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),o=this,s=e,u=function(f,h,v){for(var c=0;c<f.length;c++){var d=f[c],p=d._private.data.id,y=h.hasElementWithId(p);y?i.merge(d):v.push(d)}};return u(o,s,a),u(s,o,n),{left:a,right:n,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Me(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&n.push(o)}return n},merge:function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&Me(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=r.map,o=0;o<e.length;o++){var s=e[o],u=s._private.data.id,l=!i.has(u);if(l){var f=this.length++;this[f]=s,i.set(u,{ele:s,index:f})}}return this},unmergeAt:function(e){var r=this[e],a=r.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,u=this[s],l=u._private.data.id;this[s]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,i=n.get(a);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Me(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var a=this[r];e(a)&&this.unmergeAt(r)}return this},map:function(e,r){for(var a=[],n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);a.push(s)}return a},reduce:function(e,r){for(var a=r,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,r){for(var a=-1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u>a&&(a=u,n=s)}return{value:a,ele:n}},min:function(e,r){for(var a=1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u<a&&(a=u,n=s)}return{value:a,ele:n}}},We=Oc;We.u=We["|"]=We["+"]=We.union=We.or=We.add;We["\\"]=We["!"]=We["-"]=We.difference=We.relativeComplement=We.subtract=We.not;We.n=We["&"]=We["."]=We.and=We.intersection=We.intersect;We["^"]=We["(+)"]=We["(-)"]=We.symmetricDifference=We.symdiff=We.xor;We.fnFilter=We.filterFn=We.stdFilter=We.filter;We.complement=We.abscomp=We.absoluteComplement;var Nm={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Pc=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function i(f){var h=f.pstyle("z-compound-depth");return h.value==="auto"?n?f.zDepth():0:h.value==="bottom"?-1:h.value==="top"?Ks:0}var o=i(e)-i(r);if(o!==0)return o;function s(f){var h=f.pstyle("z-index-compare");return h.value==="auto"&&f.isNode()?1:0}var u=s(e)-s(r);if(u!==0)return u;var l=e.pstyle("z-index").value-r.pstyle("z-index").value;return l!==0?l:e.poolIndex()-r.poolIndex()},ai={forEach:function(e,r){if(it(e))for(var a=this.length,n=0;n<a;n++){var i=this[n],o=r?e.apply(r,[i,n,this]):e(i,n,this);if(o===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var a=[],n=this.length;r==null&&(r=n),e==null&&(e=0),e<0&&(e=n+e),r<0&&(r=n+r);for(var i=e;i>=0&&i<r&&i<n;i++)a.push(this[i]);return this.spawn(a)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!it(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(Pc)},zDepth:function(){var e=this[0];if(e){var r=e._private,a=r.group;if(a==="nodes"){var n=r.data.parent?e.parents().size():0;return e.isParent()?n:Ks-1}else{var i=r.source,o=r.target,s=i.zDepth(),u=o.zDepth();return Math.max(s,u,0)}}}};ai.each=ai.forEach;var Mm=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":dt(Symbol))!=e&&dt(Symbol.iterator)!=e;r&&(ai[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,o=this.length;return Rh({next:function(){return i<o?n.value=a[i++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};Mm();var Rm=Tt({nodeDimensionsIncludeLabels:!1}),Un={layoutDimensions:function(e){e=Rm(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();r={w:a.w,h:a.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,a){var n=this.nodes().filter(function(T){return!T.isParent()}),i=this.cy(),o=r.eles,s=function(D){return D.id()},u=pa(a,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(D,x,N){var O={x:x.x1+x.w/2,y:x.y1+x.h/2},R={x:(N.x-O.x)*D,y:(N.y-O.y)*D};return{x:O.x+R.x,y:O.y+R.y}},f=r.spacingFactor&&r.spacingFactor!==1,h=function(){if(!f)return null;for(var D=Rt(),x=0;x<n.length;x++){var N=n[x],O=u(N,x);Qh(D,O.x,O.y)}return D},v=h(),c=pa(function(T,D){var x=u(T,D);if(f){var N=Math.abs(r.spacingFactor);x=l(N,v,x)}return r.transform!=null&&(x=r.transform(T,x)),x},s);if(r.animate){for(var d=0;d<n.length;d++){var p=n[d],y=c(p,d),g=r.animateFilter==null||r.animateFilter(p,d);if(g){var b=p.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else p.position(y)}if(r.fit){var m=i.animation({fit:{boundingBox:o.boundingBoxAt(c),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(m)}else if(r.zoom!==void 0&&r.pan!==void 0){var w=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}e.animations.forEach(function(T){return T.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Ca.all(e.animations.map(function(T){return T.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(c),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Ie({},e,{eles:this}))}};Un.createLayout=Un.makeLayout=Un.layout;function Ic(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],i;return(i=n[t])!=null||(i=n[t]=e(r)),i}function Si(t,e){return t=Hr(t),function(a){return Ic(t,e,a)}}function Di(t,e){t=Hr(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return Ic(t,r,n)}}var Et={recalculateRenderedStyle:function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var a;a=this.spawnSelf().merge(this.descendants()).merge(this.parents()),a.merge(a.connectedEdges()),a.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var a=r._private.batchStyleEles;return a.merge(this),this}var n=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),n&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var a=this[r];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(r?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var a=r.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=this[0];if(a)return r.style().getRenderedStyle(a,e)},style:function(e,r){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(_e(e)){var o=e;i.applyBypass(this,o,n),this.emitAndNotify("style")}else if(Me(e))if(r===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];n.removeAllBypasses(s,a)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];n.removeBypasses(l,e,a)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!r)return i;var o=n.data.parent?a.parents():null;if(o)for(var s=0;s<o.length;s++){var u=o[s],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],a=r.cy().hasCompoundNodes();if(r)return a?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function as(t,e){var r=t._private,a=r.data.parent?t.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function su(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,a=t.parentOk||t.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],o=n.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||as(i,a);var u=s.source,l=s.target;return r(u)&&(!o||as(u,r))&&(u===l||r(l)&&(!o||as(l,r)))}}}var Sa=Si("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Et.takesUpSpace=Di("takesUpSpace",su({ok:Sa}));var Om=Si("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Sa(t)}),Pm=Si("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Sa(t)});Et.interactive=Di("interactive",su({ok:Om,parentOk:Pm,edgeOkViaNode:Sa}));Et.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var Im=Si("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Sa(t)}),km=Sa;Et.visible=Di("visible",su({ok:Im,edgeOkViaNode:km}));Et.hidden=function(){var t=this[0];if(t)return!t.visible()};Et.isBundledBezier=Di("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Et.bypass=Et.css=Et.style;Et.renderedCss=Et.renderedStyle;Et.removeBypass=Et.removeCss=Et.removeStyle;Et.pstyle=Et.parsedStyle;var mr={};function wf(t){return function(){var e=arguments,r=[];if(e.length===2){var a=e[0],n=e[1];this.on(t.event,a,n)}else if(e.length===1&&it(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Je(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var u=this[s],l=!t.ableField||u._private[t.ableField],f=u._private[t.field]!=t.value;if(t.overrideAble){var h=t.overrideAble(u);if(h!==void 0&&(l=h,!h))return this}l&&(u._private[t.field]=t.value,f&&r.push(u))}var v=this.spawn(r);v.updateStyle(),v.emit(t.event),o&&v.emit(o)}return this}}function Da(t){mr[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},mr[t.on]=wf({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),mr[t.off]=wf({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Da({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Da({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Da({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Da({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});mr.deselect=mr.unselect;mr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Da({field:"active",on:"activate",off:"unactivate"});Da({field:"pannable",on:"panify",off:"unpanify"});mr.inactive=function(){var t=this[0];if(t)return!t._private.active};var St={},Ef=function(e){return function(a){for(var n=this,i=[],o=0;o<n.length;o++){var s=n[o];if(s.isNode()){for(var u=!1,l=s.connectedEdges(),f=0;f<l.length;f++){var h=l[f],v=h.source(),c=h.target();if(e.noIncomingEdges&&c===s&&v!==s||e.noOutgoingEdges&&v===s&&c!==s){u=!0;break}}u||i.push(s)}}return this.spawn(i,!0).filter(a)}},xf=function(e){return function(r){for(var a=this,n=[],i=0;i<a.length;i++){var o=a[i];if(o.isNode())for(var s=o.connectedEdges(),u=0;u<s.length;u++){var l=s[u],f=l.source(),h=l.target();e.outgoing&&f===o?(n.push(l),n.push(h)):e.incoming&&h===o&&(n.push(l),n.push(f))}}return this.spawn(n,!0).filter(r)}},Tf=function(e){return function(r){for(var a=this,n=[],i={};;){var o=e.outgoing?a.outgoers():a.incomers();if(o.length===0)break;for(var s=!1,u=0;u<o.length;u++){var l=o[u],f=l.id();i[f]||(i[f]=!0,n.push(l),s=!0)}if(!s)break;a=o}return this.spawn(n,!0).filter(r)}};St.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Ie(St,{roots:Ef({noIncomingEdges:!0}),leaves:Ef({noOutgoingEdges:!0}),outgoers:Gt(xf({outgoing:!0}),"outgoers"),successors:Tf({outgoing:!0}),incomers:Gt(xf({incoming:!0}),"incomers"),predecessors:Tf({})});Ie(St,{neighborhood:Gt(function(t){for(var e=[],r=this.nodes(),a=0;a<r.length;a++)for(var n=r[a],i=n.connectedEdges(),o=0;o<i.length;o++){var s=i[o],u=s.source(),l=s.target(),f=n===u?l:u;f.length>0&&e.push(f[0]),e.push(s[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});St.neighbourhood=St.neighborhood;St.closedNeighbourhood=St.closedNeighborhood;St.openNeighbourhood=St.openNeighborhood;Ie(St,{source:Gt(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"source"),target:Gt(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"target"),sources:Cf({attr:"source"}),targets:Cf({attr:"target"})});function Cf(t){return function(r){for(var a=[],n=0;n<this.length;n++){var i=this[n],o=i._private[t.attr];o&&a.push(o)}return this.spawn(a,!0).filter(r)}}Ie(St,{edgesWith:Gt(Sf(),"edgesWith"),edgesTo:Gt(Sf({thisIsSrc:!0}),"edgesTo")});function Sf(t){return function(r){var a=[],n=this._private.cy,i=t||{};Me(r)&&(r=n.$(r));for(var o=0;o<r.length;o++)for(var s=r[o]._private.edges,u=0;u<s.length;u++){var l=s[u],f=l._private.data,h=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),v=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),c=h||v;c&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!h||i.thisIsTgt&&!v)||a.push(l))}return this.spawn(a,!0)}}Ie(St,{connectedEdges:Gt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];if(n.isNode())for(var i=n._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Gt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Gt(Df(),"parallelEdges"),codirectedEdges:Gt(Df({codirected:!0}),"codirectedEdges")});function Df(t){var e={codirected:!1};return t=Ie({},e,t),function(a){for(var n=[],i=this.edges(),o=t,s=0;s<i.length;s++)for(var u=i[s],l=u._private,f=l.source,h=f._private.data.id,v=l.data.target,c=f._private.edges,d=0;d<c.length;d++){var p=c[d],y=p._private.data,g=y.target,b=y.source,m=g===v&&b===h,w=h===g&&v===b;(o.codirected&&m||!o.codirected&&(m||w))&&n.push(p)}return this.spawn(n,!0).filter(a)}}Ie(St,{components:function(e){var r=this,a=r.cy(),n=a.collection(),i=e==null?r.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(f,h){n.merge(f),i.unmerge(f),h.merge(f)};if(i.empty())return r.spawn();var u=function(){var f=a.collection();o.push(f);var h=i[0];s(h,f),r.bfs({directed:!1,roots:h,visit:function(c){return s(c,f)}}),f.forEach(function(v){v.connectedEdges().forEach(function(c){r.has(c)&&f.has(c.source())&&f.has(c.target())&&f.merge(c)})})};do u();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});St.componentsOf=St.components;var xt=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){nt("A collection must have a reference to the core");return}var i=new nr,o=!1;if(!r)r=[];else if(r.length>0&&_e(r[0])&&!un(r[0])){o=!0;for(var s=[],u=new Ta,l=0,f=r.length;l<f;l++){var h=r[l];h.data==null&&(h.data={});var v=h.data;if(v.id==null)v.id=$h();else if(e.hasElementWithId(v.id)||u.has(v.id))continue;var c=new pi(e,h,!1);s.push(c),u.add(v.id)}r=s}this.length=0;for(var d=0,p=r.length;d<p;d++){var y=r[d][0];if(y!=null){var g=y._private.data.id;(!a||!i.has(g))&&(a&&i.set(g,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var m=this.lazyMap=new nr,w=this.eles,T=0;T<w.length;T++){var D=w[T];m.set(D.id(),{index:T,ele:D})}}},a&&(this._private.map=i),o&&!n&&this.restore()},et=pi.prototype=xt.prototype=Object.create(Array.prototype);et.instanceString=function(){return"collection"};et.spawn=function(t,e){return new xt(this.cy(),t,e)};et.spawnSelf=function(){return this.spawn(this)};et.cy=function(){return this._private.cy};et.renderer=function(){return this._private.cy.renderer()};et.element=function(){return this[0]};et.collection=function(){return Ih(this)?this:new xt(this._private.cy,[this])};et.unique=function(){return new xt(this._private.cy,this,!0)};et.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};et.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new xt(e)};et.$id=et.getElementById;et.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};et.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};et.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};et.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var a=e._private;if(_e(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var i=!1,o={},s=t.data.source,u=t.data.target;s!=null&&s!=n.source&&(o.source=""+s,i=!0),u!=null&&u!=n.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var l="parent"in t.data,f=t.data.parent;l&&(f!=null||n.parent!=null)&&f!=n.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var h=function(p,y,g){var b=t[p];b!=null&&b!==a[p]&&(b?e[y]():e[g]())};return h("removed","remove","restore"),h("selected","select","unselect"),h("selectable","selectify","unselectify"),h("locked","lock","unlock"),h("grabbable","grabify","ungrabify"),h("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var v={data:Qt(a.data),position:Qt(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};v.classes="";var c=0;return a.classes.forEach(function(d){return v.classes+=c++===0?d:" "+d}),v}}};et.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t};et.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var a=this[r],n=a.json(),i=new pi(t,n,!1);e.push(i)}return new xt(t,e)};et.copy=et.clone;et.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,i=[],o=[],s,u=0,l=r.length;u<l;u++){var f=r[u];e&&!f.removed()||(f.isNode()?i.push(f):o.push(f))}s=i.concat(o);var h,v=function(){s.splice(h,1),h--};for(h=0;h<s.length;h++){var c=s[h],d=c._private,p=d.data;if(c.clearTraversalCache(),!(!e&&!d.removed)){if(p.id===void 0)p.id=$h();else if(be(p.id))p.id=""+p.id;else if(br(p.id)||!Me(p.id)){nt("Can not create element with invalid string ID `"+p.id+"`"),v();continue}else if(a.hasElementWithId(p.id)){nt("Can not create second element with ID `"+p.id+"`"),v();continue}}var y=p.id;if(c.isNode()){var g=d.position;g.x==null&&(g.x=0),g.y==null&&(g.y=0)}if(c.isEdge()){for(var b=c,m=["source","target"],w=m.length,T=!1,D=0;D<w;D++){var x=m[D],N=p[x];be(N)&&(N=p[x]=""+p[x]),N==null||N===""?(nt("Can not create edge `"+y+"` with unspecified "+x),T=!0):a.hasElementWithId(N)||(nt("Can not create edge `"+y+"` with nonexistent "+x+" `"+N+"`"),T=!0)}if(T){v();continue}var O=a.getElementById(p.source),R=a.getElementById(p.target);O.same(R)?O._private.edges.push(b):(O._private.edges.push(b),R._private.edges.push(b)),b._private.source=O,b._private.target=R}d.map=new nr,d.map.set(y,{ele:c,index:0}),d.removed=!1,e&&a.addToPool(c)}for(var P=0;P<i.length;P++){var M=i[P],I=M._private.data;be(I.parent)&&(I.parent=""+I.parent);var E=I.parent,A=E!=null;if(A||M._private.parent){var C=M._private.parent?a.collection().merge(M._private.parent):a.getElementById(E);if(C.empty())I.parent=void 0;else if(C[0].removed())Ke("Node added with missing parent, reference to parent removed"),I.parent=void 0,M._private.parent=null;else{for(var S=!1,L=C;!L.empty();){if(M.same(L)){S=!0,I.parent=void 0;break}L=L.parent()}S||(C[0]._private.children.push(M),M._private.parent=C[0],n.hasCompoundNodes=!0)}}}if(s.length>0){for(var V=s.length===r.length?r:new xt(a,s),F=0;F<V.length;F++){var B=V[F];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}var Y;n.hasCompoundNodes?Y=a.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()):Y=V,Y.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?V.emitAndNotify("add"):e&&V.emit("add")}return r};et.removed=function(){var t=this[0];return t&&t._private.removed};et.inside=function(){var t=this[0];return t&&!t._private.removed};et.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function o(E){for(var A=E._private.edges,C=0;C<A.length;C++)u(A[C])}function s(E){for(var A=E._private.children,C=0;C<A.length;C++)u(A[C])}function u(E){var A=n[E.id()];e&&E.removed()||A||(n[E.id()]=!0,E.isNode()?(a.push(E),o(E),s(E)):a.unshift(E))}for(var l=0,f=r.length;l<f;l++){var h=r[l];u(h)}function v(E,A){var C=E._private.edges;wr(C,A),E.clearTraversalCache()}function c(E){E.clearTraversalCache()}var d=[];d.ids={};function p(E,A){A=A[0],E=E[0];var C=E._private.children,S=E.id();wr(C,A),A._private.parent=null,d.ids[S]||(d.ids[S]=!0,d.push(E))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var y=0;y<a.length;y++){var g=a[y];if(g.isEdge()){var b=g.source()[0],m=g.target()[0];v(b,g),v(m,g);for(var w=g.parallelEdges(),T=0;T<w.length;T++){var D=w[T];c(D),D.isBundledBezier()&&D.dirtyBoundingBoxCache()}}else{var x=g.parent();x.length!==0&&p(x,g)}e&&(g._private.removed=!0)}var N=i._private.elements;i._private.hasCompoundNodes=!1;for(var O=0;O<N.length;O++){var R=N[O];if(R.isParent()){i._private.hasCompoundNodes=!0;break}}var P=new xt(this.cy(),a);P.size()>0&&(t?P.emitAndNotify("remove"):e&&P.emit("remove"));for(var M=0;M<d.length;M++){var I=d[M];(!e||!I.removed())&&I.updateStyle()}return P};et.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,i=function(d){return d==null?d:""+d};if(t.source!==void 0||t.target!==void 0){var o=i(t.source),s=i(t.target),u=o!=null&&e.hasElementWithId(o),l=s!=null&&e.hasElementWithId(s);(u||l)&&(e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var c=0;c<r.length;c++){var d=r[c],p=d._private.data;d.isEdge()&&(u&&(p.source=o),l&&(p.target=s))}r.restore(a,n)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=i(t.parent),h=f===null||e.hasElementWithId(f);if(h){var v=f===null?void 0:f;e.batch(function(){var c=r.remove(a,n);c.emitAndNotify("moveout");for(var d=0;d<r.length;d++){var p=r[d],y=p._private.data;p.isNode()&&(y.parent=v)}c.restore(a,n)}),r.emitAndNotify("move")}}return this};[oc,_y,Gn,yr,ma,sm,Ti,Cm,Rc,Oc,Nm,ai,Un,Et,mr,St].forEach(function(t){Ie(et,t)});var Bm={add:function(e){var r,a=this;if(Bt(e)){var n=e;if(n._private.cy===a)r=n.restore();else{for(var i=[],o=0;o<n.length;o++){var s=n[o];i.push(s.json())}r=new xt(a,i)}}else if(Je(e)){var u=e;r=new xt(a,u)}else if(_e(e)&&(Je(e.nodes)||Je(e.edges))){for(var l=e,f=[],h=["nodes","edges"],v=0,c=h.length;v<c;v++){var d=h[v],p=l[d];if(Je(p))for(var y=0,g=p.length;y<g;y++){var b=Ie({group:d},p[y]);f.push(b)}}r=new xt(a,f)}else{var m=e;r=new pi(a,m).collection()}return r},remove:function(e){if(!Bt(e)){if(Me(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Fm(t,e,r,a){var n=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var h=0;h<4;++h)if(typeof arguments[h]!="number"||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var v=f?new Float32Array(u):new Array(u);function c(R,P){return 1-3*P+3*R}function d(R,P){return 3*P-6*R}function p(R){return 3*R}function y(R,P,M){return((c(P,M)*R+d(P,M))*R+p(P))*R}function g(R,P,M){return 3*c(P,M)*R*R+2*d(P,M)*R+p(P)}function b(R,P){for(var M=0;M<n;++M){var I=g(P,t,r);if(I===0)return P;var E=y(P,t,r)-R;P-=E/I}return P}function m(){for(var R=0;R<u;++R)v[R]=y(R*l,t,r)}function w(R,P,M){var I,E,A=0;do E=P+(M-P)/2,I=y(E,t,r)-R,I>0?M=E:P=E;while(Math.abs(I)>o&&++A<s);return E}function T(R){for(var P=0,M=1,I=u-1;M!==I&&v[M]<=R;++M)P+=l;--M;var E=(R-v[M])/(v[M+1]-v[M]),A=P+E*l,C=g(A,t,r);return C>=i?b(R,A):C===0?A:w(R,P,P+l)}var D=!1;function x(){D=!0,(t!==e||r!==a)&&m()}var N=function(P){return D||x(),t===e&&r===a?P:P===0?0:P===1?1:y(T(P),e,a)};N.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var O="generateBezier("+[t,e,r,a]+")";return N.toString=function(){return O},N}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var zm=(function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var o={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:o.v,dv:t(o)}}function r(a,n){var i={dx:a.v,dv:t(a)},o=e(a,n*.5,i),s=e(a,n*.5,o),u=e(a,n,s),l=1/6*(i.dx+2*(o.dx+s.dx)+u.dx),f=1/6*(i.dv+2*(o.dv+s.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+f*n,a}return function a(n,i,o){var s={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,h=16/1e3,v,c,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,o=o||null,s.tension=n,s.friction=i,v=o!==null,v?(l=a(n,i),c=l/o*h):c=h;d=r(d||s,c),u.push(1+d.x),l+=16,Math.abs(d.x)>f&&Math.abs(d.v)>f;);return v?function(p){return u[p*(u.length-1)|0]}:l}})(),je=function(e,r,a,n){var i=Fm(e,r,a,n);return function(o,s,u){return o+(s-o)*i(u)}},Hn={linear:function(e,r,a){return e+(r-e)*a},ease:je(.25,.1,.25,1),"ease-in":je(.42,0,1,1),"ease-out":je(0,0,.58,1),"ease-in-out":je(.42,0,.58,1),"ease-in-sine":je(.47,0,.745,.715),"ease-out-sine":je(.39,.575,.565,1),"ease-in-out-sine":je(.445,.05,.55,.95),"ease-in-quad":je(.55,.085,.68,.53),"ease-out-quad":je(.25,.46,.45,.94),"ease-in-out-quad":je(.455,.03,.515,.955),"ease-in-cubic":je(.55,.055,.675,.19),"ease-out-cubic":je(.215,.61,.355,1),"ease-in-out-cubic":je(.645,.045,.355,1),"ease-in-quart":je(.895,.03,.685,.22),"ease-out-quart":je(.165,.84,.44,1),"ease-in-out-quart":je(.77,0,.175,1),"ease-in-quint":je(.755,.05,.855,.06),"ease-out-quint":je(.23,1,.32,1),"ease-in-out-quint":je(.86,0,.07,1),"ease-in-expo":je(.95,.05,.795,.035),"ease-out-expo":je(.19,1,.22,1),"ease-in-out-expo":je(1,0,0,1),"ease-in-circ":je(.6,.04,.98,.335),"ease-out-circ":je(.075,.82,.165,1),"ease-in-out-circ":je(.785,.135,.15,.86),spring:function(e,r,a){if(a===0)return Hn.linear;var n=zm(e,r,a);return function(i,o,s){return i+(o-i)*n(s)}},"cubic-bezier":je};function Af(t,e,r,a,n){if(a===1||e===r)return r;var i=n(e,r,a);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function Lf(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ea(t,e,r,a,n){var i=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var o=Lf(t,n),s=Lf(e,n);if(be(o)&&be(s))return Af(i,o,s,r,a);if(Je(o)&&Je(s)){for(var u=[],l=0;l<s.length;l++){var f=o[l],h=s[l];if(f!=null&&h!=null){var v=Af(i,f,h,r,a);u.push(v)}else u.push(h)}return u}}function Vm(t,e,r,a){var n=!a,i=t._private,o=e._private,s=o.easing,u=o.startTime,l=a?t:t.cy(),f=l.style();if(!o.easingImpl)if(s==null)o.easingImpl=Hn.linear;else{var h;if(Me(s)){var v=f.parse("transition-timing-function",s);h=v.value}else h=s;var c,d;Me(h)?(c=h,d=[]):(c=h[1],d=h.slice(2).map(function(V){return+V})),d.length>0?(c==="spring"&&d.push(o.duration),o.easingImpl=Hn[c].apply(null,d)):o.easingImpl=Hn[c]}var p=o.easingImpl,y;if(o.duration===0?y=1:y=(r-u)/o.duration,o.applying&&(y=o.progress),y<0?y=0:y>1&&(y=1),o.delay==null){var g=o.startPosition,b=o.position;if(b&&n&&!t.locked()){var m={};Fa(g.x,b.x)&&(m.x=ea(g.x,b.x,y,p)),Fa(g.y,b.y)&&(m.y=ea(g.y,b.y,y,p)),t.position(m)}var w=o.startPan,T=o.pan,D=i.pan,x=T!=null&&a;x&&(Fa(w.x,T.x)&&(D.x=ea(w.x,T.x,y,p)),Fa(w.y,T.y)&&(D.y=ea(w.y,T.y,y,p)),t.emit("pan"));var N=o.startZoom,O=o.zoom,R=O!=null&&a;R&&(Fa(N,O)&&(i.zoom=Qa(i.minZoom,ea(N,O,y,p),i.maxZoom)),t.emit("zoom")),(x||R)&&t.emit("viewport");var P=o.style;if(P&&P.length>0&&n){for(var M=0;M<P.length;M++){var I=P[M],E=I.name,A=I,C=o.startStyle[E],S=f.properties[C.name],L=ea(C,A,y,p,S);f.overrideBypass(t,E,L)}t.emit("style")}}return o.progress=y,y}function Fa(t,e){return t==null||e==null?!1:be(t)&&be(e)?!0:!!(t&&e)}function Gm(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function Nf(t,e){var r=e._private.aniEles,a=[];function n(f,h){var v=f._private,c=v.animation.current,d=v.animation.queue,p=!1;if(c.length===0){var y=d.shift();y&&c.push(y)}for(var g=function(D){for(var x=D.length-1;x>=0;x--){var N=D[x];N()}D.splice(0,D.length)},b=c.length-1;b>=0;b--){var m=c[b],w=m._private;if(w.stopped){c.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||Gm(f,m,t),Vm(f,m,t,h),w.applying&&(w.applying=!1),g(w.frames),w.step!=null&&w.step(t),m.completed()&&(c.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.completes)),p=!0)}return!h&&c.length===0&&d.length===0&&a.push(f),p}for(var i=!1,o=0;o<r.length;o++){var s=r[o],u=n(s);i=i||u}var l=n(e,!0);(i||l)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}var Um={animate:$e.animate(),animation:$e.animation(),animated:$e.animated(),clearQueue:$e.clearQueue(),delay:$e.delay(),delayAnimation:$e.delayAnimation(),stop:$e.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Jn(function(i){Nf(i,e),r()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,o){Nf(o,e)},a.beforeRenderPriorities.animations):r()}},Hm={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&un(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e}},On=function(e){return Me(e)?new xr(e):e},kc={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ci(Hm,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,On(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,On(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,On(r),a),this},once:function(e,r,a){return this.emitter().one(e,On(r),a),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};$e.eventAliasesOn(kc);var Rs={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};Rs.jpeg=Rs.jpg;var Yn={layout:function(e){var r=this;if(e==null){nt("Layout options must be specified to make a layout");return}if(e.name==null){nt("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){nt("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Me(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new n(Ie({},e,{cy:r,eles:i}));return o}};Yn.createLayout=Yn.makeLayout=Yn.layout;var Ym={notify:function(e,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();r!=null&&n.merge(r);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?r.notify(a):r.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],o=e[i],s=r.getElementById(i);s.data(o)}})}},qm=Tt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),Os={renderTo:function(e,r,a,n){var i=this._private.renderer;return i.renderTo(e,r,a,n),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,a=r.extension("renderer",e.name);if(a==null){nt("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Ke("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=qm(e);n.cy=r,r._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Os.invalidateDimensions=Os.resize;var qn={collection:function(e,r){return Me(e)?this.$(e):Bt(e)?e.collection():Je(e)?(r||(r={}),new xt(this,e,r.unique,r.removed)):new xt(this)},nodes:function(e){var r=this.$(function(a){return a.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(a){return a.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};qn.elements=qn.filter=qn.$;var wt={},_a="t",_m="f";wt.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),i=0;i<t.length;i++){var o=t[i],s=e.getContextMeta(o);if(!s.empty){var u=e.getContextStyle(s),l=e.applyContextStyle(s,u,o);o._private.appliedInitStyle?e.updateTransitions(o,l.diffProps):o._private.appliedInitStyle=!0;var f=e.updateStyleHints(o);f&&n.push(o)}}return n};wt.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,i=a[n];if(i)return i;for(var o=[],s={},u=0;u<r.length;u++){var l=r[u],f=t[u]===_a,h=e[u]===_a,v=f!==h,c=l.mappedProperties.length>0;if(v||h&&c){var d=void 0;v&&c||v?d=l.properties:c&&(d=l.mappedProperties);for(var p=0;p<d.length;p++){for(var y=d[p],g=y.name,b=!1,m=u+1;m<r.length;m++){var w=r[m],T=e[m]===_a;if(T&&(b=w.properties[y.name]!=null,b))break}!s[g]&&!b&&(s[g]=!0,o.push(g))}}}return a[n]=o,o};wt.getContextMeta=function(t){for(var e=this,r="",a,n=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(t);s?r+=_a:r+=_m}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};wt.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<r.length;i++){var o=r[i],s=e[i]===_a;if(s)for(var u=0;u<o.properties.length;u++){var l=o.properties[u];n[l.name]=l}}return a[e]=n,n};wt.applyContextStyle=function(t,e,r){for(var a=this,n=t.diffPropNames,i={},o=a.types,s=0;s<n.length;s++){var u=n[s],l=e[u],f=r.pstyle(u);if(!l)if(f)f.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(f!==l){if(l.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var h=f.mapping,v=h.fnValue=l.value(r);if(v===h.prevFnValue)continue}var c=i[u]={prev:f};a.applyParsedProperty(r,l),c.next=r.pstyle(u),c.next&&c.next.bypass&&(c.next=c.next.bypassed)}}return{diffProps:i}};wt.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,i=function(W,J,te){return r.getPropertiesHash(W,J,te)},o=e.styleKey;if(t.removed())return!1;var s=e.group==="nodes",u=t._private.style;a=Object.keys(u);for(var l=0;l<n.length;l++){var f=n[l];e.styleKeys[f]=[Fr,oa]}for(var h=function(W,J){return e.styleKeys[J][0]=$a(W,e.styleKeys[J][0])},v=function(W,J){return e.styleKeys[J][1]=Ka(W,e.styleKeys[J][1])},c=function(W,J){h(W,J),v(W,J)},d=function(W,J){for(var te=0;te<W.length;te++){var de=W.charCodeAt(te);h(de,J),v(de,J)}},p=2e9,y=function(W){return-128<W&&W<128&&Math.floor(W)!==W?p-(W*1024|0):W},g=0;g<a.length;g++){var b=a[g],m=u[b];if(m!=null){var w=this.properties[b],T=w.type,D=w.groupKey,x=void 0;w.hashOverride!=null?x=w.hashOverride(t,m):m.pfValue!=null&&(x=m.pfValue);var N=w.enums==null?m.value:null,O=x!=null,R=N!=null,P=O||R,M=m.units;if(T.number&&P&&!T.multiple){var I=O?x:N;c(y(I),D),!O&&M!=null&&d(M,D)}else d(m.strValue,D)}}for(var E=[Fr,oa],A=0;A<n.length;A++){var C=n[A],S=e.styleKeys[C];E[0]=$a(S[0],E[0]),E[1]=Ka(S[1],E[1])}e.styleKey=og(E[0],E[1]);var L=e.styleKeys;e.labelDimsKey=hr(L.labelDimensions);var V=i(t,["label"],L.labelDimensions);if(e.labelKey=hr(V),e.labelStyleKey=hr(Cn(L.commonLabel,V)),!s){var F=i(t,["source-label"],L.labelDimensions);e.sourceLabelKey=hr(F),e.sourceLabelStyleKey=hr(Cn(L.commonLabel,F));var B=i(t,["target-label"],L.labelDimensions);e.targetLabelKey=hr(B),e.targetLabelStyleKey=hr(Cn(L.commonLabel,B))}if(s){var Y=e.styleKeys,q=Y.nodeBody,Q=Y.nodeBorder,$=Y.nodeOutline,K=Y.backgroundImage,j=Y.compound,re=Y.pie,U=Y.stripe,H=[q,Q,$,K,j,re,U].filter(function(_){return _!=null}).reduce(Cn,[Fr,oa]);e.nodeKey=hr(H),e.hasPie=re!=null&&re[0]!==Fr&&re[1]!==oa,e.hasStripe=U!=null&&U[0]!==Fr&&U[1]!==oa}return o!==e.styleKey};wt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};wt.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,i,o=r.types,s=r.properties[a.name].type,u=a.bypass,l=n[a.name],f=l&&l.bypass,h=t._private,v="mapping",c=function(q){return q==null?null:q.pfValue!=null?q.pfValue:q.value},d=function(){var q=c(l),Q=c(a);r.checkTriggers(t,a.name,q,Q)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(a=e=this.parse(e.name,"bezier",u)),a.delete)return n[a.name]=void 0,d(),!0;if(a.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,d(),!0):!1:(d(),!0);if(a.deleteBypass)return l?l.bypass?(n[a.name]=l.bypassed,d(),!0):!1:(d(),!0);var p=function(){Ke("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case o.mapData:{for(var y=a.field.split("."),g=h.data,b=0;b<y.length&&g;b++){var m=y[b];g=g[m]}if(g==null)return p(),!1;var w;if(be(g)){var T=a.fieldMax-a.fieldMin;T===0?w=0:w=(g-a.fieldMin)/T}else return Ke("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+g+"` for `"+t.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),s.color){var D=a.valueMin[0],x=a.valueMax[0],N=a.valueMin[1],O=a.valueMax[1],R=a.valueMin[2],P=a.valueMax[2],M=a.valueMin[3]==null?1:a.valueMin[3],I=a.valueMax[3]==null?1:a.valueMax[3],E=[Math.round(D+(x-D)*w),Math.round(N+(O-N)*w),Math.round(R+(P-R)*w),Math.round(M+(I-M)*w)];i={bypass:a.bypass,name:a.name,value:E,strValue:"rgb("+E[0]+", "+E[1]+", "+E[2]+")"}}else if(s.number){var A=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,A,a.bypass,v)}else return!1;if(!i)return p(),!1;i.mapping=a,a=i;break}case o.data:{for(var C=a.field.split("."),S=h.data,L=0;L<C.length&&S;L++){var V=C[L];S=S[V]}if(S!=null&&(i=this.parse(a.name,S,a.bypass,v)),!i)return p(),!1;i.mapping=a,a=i;break}case o.fn:{var F=a.value,B=a.fnValue!=null?a.fnValue:F(t);if(a.prevFnValue=B,B==null)return Ke("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,B,a.bypass,v),!i)return Ke("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Qt(a),a=i;break}case void 0:break;default:return!1}return u?(f?a.bypassed=l.bypassed:a.bypassed=l,n[a.name]=a):f?l.bypassed=a:n[a.name]=a,d(),!0};wt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],u=n[s];u!=null&&(u.bypass?u.bypassed=null:n[s]=null)}}};wt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};wt.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var s={},u=!1,l=0;l<n.length;l++){var f=n[l],h=t.pstyle(f),v=e[f];if(v){var c=v.prev,d=c,p=v.next!=null?v.next:h,y=!1,g=void 0,b=1e-6;d&&(be(d.pfValue)&&be(p.pfValue)?(y=p.pfValue-d.pfValue,g=d.pfValue+b*y):be(d.value)&&be(p.value)?(y=p.value-d.value,g=d.value+b*y):Je(d.value)&&Je(p.value)&&(y=d.value[0]!==p.value[0]||d.value[1]!==p.value[1]||d.value[2]!==p.value[2],g=d.strValue),y&&(s[f]=p.strValue,this.applyBypass(t,f,g),u=!0))}}if(!u)return;a.transitioning=!0,new Ca(function(m){o>0?t.delayAnimation(o).play().promise().then(m):m()}).then(function(){return t.animation({style:s,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1)};wt.checkTrigger=function(t,e,r,a,n,i){var o=this.properties[e],s=n(o);t.removed()||s!=null&&s(r,a,t)&&i(o)};wt.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};wt.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};wt.checkConnectedEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};wt.checkParallelEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};wt.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a),this.checkConnectedEdgesBoundsTrigger(t,e,r,a),this.checkParallelEdgesBoundsTrigger(t,e,r,a)};var gn={};gn.applyBypass=function(t,e,r,a){var n=this,i=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;s<n.properties.length;s++){var u=n.properties[s],l=u.name,f=this.parse(l,r,!0);f&&i.push(f)}}else if(Me(e)){var h=this.parse(e,r,!0);h&&i.push(h)}else if(_e(e)){var v=e;a=r;for(var c=Object.keys(v),d=0;d<c.length;d++){var p=c[d],y=v[p];if(y===void 0&&(y=v[di(p)]),y!==void 0){var g=this.parse(p,y,!0);g&&i.push(g)}}}else return!1;if(i.length===0)return!1;for(var b=!1,m=0;m<t.length;m++){for(var w=t[m],T={},D=void 0,x=0;x<i.length;x++){var N=i[x];if(a){var O=w.pstyle(N.name);D=T[N.name]={prev:O}}b=this.applyParsedProperty(w,Qt(N))||b,a&&(D.next=w.pstyle(N.name))}b&&this.updateStyleHints(w),a&&this.updateTransitions(w,T,o)}return b};gn.overrideBypass=function(t,e,r){e=Xs(e);for(var a=0;a<t.length;a++){var n=t[a],i=n._private.style[e],o=this.properties[e].type,s=o.color,u=o.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),s?i.strValue="rgb("+r.join(",")+")":u?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,e,l,r)}};gn.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};gn.removeBypasses=function(t,e,r){for(var a=!0,n=0;n<t.length;n++){for(var i=t[n],o={},s=0;s<e.length;s++){var u=e[s],l=this.properties[u],f=i.pstyle(l.name);if(!(!f||!f.bypass)){var h="",v=this.parse(u,h,!0),c=o[l.name]={prev:f};this.applyParsedProperty(i,v),c.next=i.pstyle(l.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,a)}};var uu={};uu.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};uu.containerCss=function(t){var e=this._private.cy,r=e.container(),a=e.window();if(a&&r&&a.getComputedStyle)return a.getComputedStyle(r).getPropertyValue(t)};var jt={};jt.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};jt.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var a={},n=0;n<r.properties.length;n++){var i=r.properties[n],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(a[i.name]=o,a[di(i.name)]=o)}return a}};jt.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n??t.cy().style().getDefaultProperty(e)[r][0]};jt.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,o=t.pstyle(n.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(r&&i.number&&s!=null&&be(s)){var f=t.cy().zoom(),h=function(y){return y*f},v=function(y,g){return h(y)+g},c=Je(s),d=c?u.every(function(p){return p!=null}):u!=null;return d?c?s.map(function(p,y){return v(p,u[y])}).join(" "):v(s,u):c?s.map(function(p){return Me(p)?p:""+h(p)}).join(" "):""+h(s)}else if(l!=null)return l}return null}};jt.getAnimationStartStyle=function(t,e){for(var r={},a=0;a<e.length;a++){var n=e[a],i=n.name,o=t.pstyle(i);o!==void 0&&(_e(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r};jt.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a)for(var i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],u=a[s],l=n[s]||n[Xs(s)],f=this.parse(l.name,u);f&&r.push(f)}return r};jt.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,i,o,s,u,l;for(u=0;u<e.length;u++)if(n=e[u],i=t.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=$a(s,a[0]),a[1]=Ka(s,a[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),a[0]=$a(s,a[0]),a[1]=Ka(s,a[1]);return a};jt.getPropertiesHash=jt.getNonDefaultPropertiesHash;var Ai={};Ai.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var a=t[r],n=a.selector,i=a.style||a.css,o=Object.keys(i);e.selector(n);for(var s=0;s<o.length;s++){var u=o[s],l=i[u];e.css(u,l)}}return e};Ai.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Ai.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],a=r.selector,n=r.properties,i={},o=0;o<n.length;o++){var s=n[o];i[s.name]=s.strValue}t.push({selector:a?a.toString():"core",style:i})}return t};var lu={};lu.appendFromString=function(t){var e=this,r=this,a=""+t,n,i,o;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){a.length>n.length?a=a.substr(n.length):a=""}function u(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){Ke("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=f[0];var h=f[1];if(h!=="core"){var v=new xr(h);if(v.invalid){Ke("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),s();continue}}var c=f[2],d=!1;i=c;for(var p=[];;){var y=i.match(/^\s*$/);if(y)break;var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Ke("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}o=g[0];var b=g[1],m=g[2],w=e.properties[b];if(!w){Ke("Skipping property: Invalid property name in: "+o),u();continue}var T=r.parse(b,m);if(!T){Ke("Skipping property: Invalid property definition in: "+o),u();continue}p.push({name:b,val:m}),u()}if(d){s();break}r.selector(h);for(var D=0;D<p.length;D++){var x=p[D];r.css(x.name,x.val)}s()}return r};lu.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var lt={};(function(){var t=vt,e=zd,r=Gd,a=Ud,n=Hd,i=function(_){return"^"+_+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(_){var W=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+_+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+W+")\\s*\\,\\s*("+W+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];lt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(_,W){switch(_.length){case 2:return W[0]!=="deg"&&W[0]!=="rad"&&W[1]!=="deg"&&W[1]!=="rad";case 1:return Me(_[0])||W[0]==="deg"||W[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(_){var W=_.length;return W===1||W===2||W===4}}};var u={zeroNonZero:function(_,W){return(_==null||W==null)&&_!==W||_==0&&W!=0?!0:_!=0&&W==0},any:function(_,W){return _!=W},emptyNonEmpty:function(_,W){var J=br(_),te=br(W);return J&&!te||!J&&te}},l=lt.types,f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],h=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],v=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],c=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],d=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification},{name:"text-metrics",type:l.textMetrics},{name:"box-select-labels",type:l.bool,triggersBounds:u.any}],p=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any},{name:"box-selection",type:l.boxSelection,triggersZOrder:u.any}],y=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:u.any,triggersBoundsOfParallelEdges:function(_,W,J){return _===W?!1:J.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],g=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],b=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],m=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],w=function(_,W){return W.value==="label"?-_.poolIndex():W.pfValue},T=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],D=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],x=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],N=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],O=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],R=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelEdges:function(_,W){return _===W?!1:_==="bezier"||W==="bezier"}},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],P=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],M=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],I=[];lt.pieBackgroundN=16,I.push({name:"pie-size",type:l.sizeMaybePercent}),I.push({name:"pie-hole",type:l.sizeMaybePercent}),I.push({name:"pie-start-angle",type:l.angle});for(var E=1;E<=lt.pieBackgroundN;E++)I.push({name:"pie-"+E+"-background-color",type:l.color}),I.push({name:"pie-"+E+"-background-size",type:l.percent}),I.push({name:"pie-"+E+"-background-opacity",type:l.zeroOneNumber});var A=[];lt.stripeBackgroundN=16,A.push({name:"stripe-size",type:l.sizeMaybePercent}),A.push({name:"stripe-direction",type:l.axisDirectionPrimary});for(var C=1;C<=lt.stripeBackgroundN;C++)A.push({name:"stripe-"+C+"-background-color",type:l.color}),A.push({name:"stripe-"+C+"-background-size",type:l.percent}),A.push({name:"stripe-"+C+"-background-opacity",type:l.zeroOneNumber});var S=[],L=lt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach(function(H){L.forEach(function(_){var W=_+"-"+H.name,J=H.type,te=H.triggersBounds;S.push({name:W,type:J,triggersBounds:te})})},{});var V=lt.properties=[].concat(p,m,y,g,b,P,d,c,f,h,v,T,D,x,N,I,A,O,R,S,M),F=lt.propertyGroups={behavior:p,transition:m,visibility:y,overlay:g,underlay:b,ghost:P,commonLabel:d,labelDimensions:c,mainLabel:f,sourceLabel:h,targetLabel:v,nodeBody:T,nodeBorder:D,nodeOutline:x,backgroundImage:N,pie:I,stripe:A,compound:O,edgeLine:R,edgeArrow:S,core:M},B=lt.propertyGroupNames={},Y=lt.propertyGroupKeys=Object.keys(F);Y.forEach(function(H){B[H]=F[H].map(function(_){return _.name}),F[H].forEach(function(_){return _.groupKey=H})});var q=lt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];lt.propertyNames=V.map(function(H){return H.name});for(var Q=0;Q<V.length;Q++){var $=V[Q];V[$.name]=$}for(var K=0;K<q.length;K++){var j=q[K],re=V[j.pointsTo],U={name:j.name,alias:!0,pointsTo:re};V.push(U),V[j.name]=U}})();lt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};lt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Ie({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var f=1;f<=lt.pieBackgroundN;f++){var h=l.name.replace("{{i}}",f),v=l.value;u[h]=v}return u},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var f=1;f<=lt.stripeBackgroundN;f++){var h=l.name.replace("{{i}}",f),v=l.value;u[h]=v}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,l){return lt.arrowPrefixes.forEach(function(f){var h=f+"-"+l.name,v=l.value;u[h]=v}),u},{})),r={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,o=e[i],s=this.parse(i,o);r[i]=s}}return t.defaultProperties=r,t.defaultProperties};lt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Li={};Li.parse=function(t,e,r,a){var n=this;if(it(e))return n.parseImplWarn(t,e,r,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,o=r?"t":"f",s=""+e,u=_h(t,s,o,i),l=n.propCache=n.propCache||[],f;return(f=l[u])||(f=l[u]=n.parseImplWarn(t,e,r,a)),(r||a==="mapping")&&(f=Qt(f),f&&(f.value=Qt(f.value))),f};Li.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);return!n&&e!=null&&Ke("The style property `".concat(t,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Ke("The style value of `label` is deprecated for `"+n.name+"`"),n};Li.parseImpl=function(t,e,r,a){var n=this;t=Xs(t);var i=n.properties[t],o=e,s=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=Me(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(it(e))return{name:t,value:e,strValue:"fn",mapped:s.fn,bypass:r};var f,h;if(!(!u||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(s.data.regex).exec(e))){if(r)return!1;var v=s.data;return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(h=new RegExp(s.mapData.regex).exec(e))){if(r||l.multiple)return!1;var c=s.mapData;if(!(l.color||l.number))return!1;var d=this.parse(t,h[4]);if(!d||d.mapped)return!1;var p=this.parse(t,h[5]);if(!p||p.mapped)return!1;if(d.pfValue===p.pfValue||d.strValue===p.strValue)return Ke("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+d.strValue+"`"),this.parse(t,d.strValue);if(l.color){var y=d.value,g=p.value,b=y[0]===g[0]&&y[1]===g[1]&&y[2]===g[2]&&(y[3]===g[3]||(y[3]==null||y[3]===1)&&(g[3]==null||g[3]===1));if(b)return!1}return{name:t,value:h,strValue:""+e,mapped:c,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:d.value,valueMax:p.value,bypass:r}}}if(l.multiple&&a!=="multiple"){var m;if(u?m=e.split(/\s+/):Je(e)?m=e:m=[e],l.evenMultiple&&m.length%2!==0)return null;for(var w=[],T=[],D=[],x="",N=!1,O=0;O<m.length;O++){var R=n.parse(t,m[O],r,"multiple");N=N||Me(R.value),w.push(R.value),D.push(R.pfValue!=null?R.pfValue:R.value),T.push(R.units),x+=(O>0?" ":"")+R.strValue}return l.validate&&!l.validate(w,T)?null:l.singleEnum&&N?w.length===1&&Me(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:D,strValue:x,bypass:r,units:T}}var P=function(){for(var U=0;U<l.enums.length;U++){var H=l.enums[U];if(H===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(l.number){var M,I="px";if(l.units&&(M=l.units),l.implicitUnits&&(I=l.implicitUnits),!l.unitless)if(u){var E="px|em"+(l.allowPercent?"|\\%":"");M&&(E=M);var A=e.match("^("+vt+")("+E+")?$");A&&(e=A[1],M=A[2]||I)}else(!M||l.implicitUnits)&&(M=I);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=o,P();if(l.integer&&!Rd(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var C={name:t,value:e,strValue:""+e+(M||""),units:M,bypass:r};return l.unitless||M!=="px"&&M!=="em"?C.pfValue=e:C.pfValue=M==="px"||!M?e:this.getEmSizeInPixels()*e,(M==="ms"||M==="s")&&(C.pfValue=M==="ms"?e:1e3*e),(M==="deg"||M==="rad")&&(C.pfValue=M==="rad"?e:Ug(e)),M==="%"&&(C.pfValue=e/100),C}else if(l.propList){var S=[],L=""+e;if(L!=="none"){for(var V=L.split(/\s*,\s*|\s+/),F=0;F<V.length;F++){var B=V[F].trim();n.properties[B]?S.push(B):Ke("`"+B+"` is not a valid property name")}if(S.length===0)return null}return{name:t,value:S,strValue:S.length===0?"none":S.join(" "),bypass:r}}else if(l.color){var Y=zh(e);return Y?{name:t,value:Y,pfValue:Y,strValue:"rgb("+Y[0]+","+Y[1]+","+Y[2]+")",bypass:r}:null}else if(l.regex||l.regexes){if(l.enums){var q=P();if(q)return q}for(var Q=l.regexes?l.regexes:[l.regex],$=0;$<Q.length;$++){var K=new RegExp(Q[$]),j=K.exec(e);if(j)return{name:t,value:l.singleRegexMatchValue?j[1]:j,strValue:""+e,bypass:r}}return null}else return l.string?{name:t,value:""+e,strValue:""+e,bypass:r}:l.enums?P():null};var bt=function(e){if(!(this instanceof bt))return new bt(e);if(!Ws(e)){nt("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Dt=bt.prototype;Dt.instanceString=function(){return"style"};Dt.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),a=0;a<this.length;a++)this[a]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};Dt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Dt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Dt.selector=function(t){var e=t==="core"?null:new xr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],a=0;a<t.properties.length;a++){var n=t.properties[a],i=r[n.name];i===void 0&&(i=r[di(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Dt.style=Dt.css;Dt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[a].mappedProperties.push(r);var n=!this[a].selector;n&&(this._private.coreStyle[r.name]=r)}return this};Dt.append=function(t){return kh(t)?t.appendToStyle(this):Je(t)?this.appendFromJson(t):Me(t)&&this.appendFromString(t),this};bt.fromJson=function(t,e){var r=new bt(t);return r.fromJson(e),r};bt.fromString=function(t,e){return new bt(t).fromString(e)};[wt,gn,uu,jt,Ai,lu,lt,Li].forEach(function(t){Ie(Dt,t)});bt.types=Dt.types;bt.properties=Dt.properties;bt.propertyGroups=Dt.propertyGroups;bt.propertyGroupNames=Dt.propertyGroupNames;bt.propertyGroupKeys=Dt.propertyGroupKeys;var Wm={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return kh(e)?r.style=e.generateStyle(this):Je(e)?r.style=bt.fromJson(this,e):Me(e)?r.style=bt.fromString(this,e):r.style=bt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},Xm="single",_r={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=Xm),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,a,n,i,o,s;switch(e.length){case 0:return r;case 1:if(Me(e[0]))return a=e[0],r[a];if(_e(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,be(o)&&(r.x=o),be(s)&&(r.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&be(n)&&(r[a]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var a=arguments,n=this._private.pan,i,o,s,u,l;if(!this._private.panningEnabled)return this;switch(a.length){case 1:_e(e)&&(s=a[0],u=s.x,l=s.y,be(u)&&(n.x+=u),be(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&be(o)&&(n[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var a=this.getFitViewport(e,r);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(be(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(Me(e)){var n=e;e=this.$(n)}else if(Id(e)){var i=e;a={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else Bt(e)||(e=this.mutableElements());if(!(Bt(e)&&e.empty())){a=a||e.boundingBox();var o=this.width(),s=this.height(),u;if(r=be(r)?r:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((o-2*r)/a.w,(s-2*r)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(a.x1+a.x2))/2,y:(s-u*(a.y1+a.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}return be(e)&&be(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):be(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:be(r)&&e===void 0&&r>=a.minZoom&&(a.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,a=r.pan,n=r.zoom,i,o,s=!1;if(r.zoomingEnabled||(s=!0),be(e)?o=e:_e(e)&&(o=e.level,e.position!=null?i=yi(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,s||!be(o)||o===n||i!=null&&(!be(i.x)||!be(i.y)))return null;if(i!=null){var u=a,l=n,f=o,h={x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:h}}else return{zoomed:!0,panned:!1,zoom:o,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),a=this._private;return r==null||!r.zoomed?this:(a.zoom=r.zoom,r.panned&&(a.pan.x=r.pan.x,a.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,a=!0,n=!0,i=[],o=!1,s=!1;if(!e)return this;if(be(e.zoom)||(a=!1),_e(e.pan)||(n=!1),!a&&!n)return this;if(a){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=u,i.push("zoom"))}if(n&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var l=e.pan;be(l.x)&&(r.pan.x=l.x,s=!1),be(l.y)&&(r.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Me(e)){var a=e;e=this.mutableElements().filter(a)}else Bt(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(i-r*(n.x1+n.x2))/2,y:(o-r*(n.y1+n.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?(function(){var n=a.window().getComputedStyle(r),i=function(s){return parseFloat(n.getPropertyValue(s))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/r,x2:(a.x2-e.x)/r,y1:(a.y1-e.y)/r,y2:(a.y2-e.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};_r.centre=_r.center;_r.autolockNodes=_r.autolock;_r.autoungrabifyNodes=_r.autoungrabify;var tn={data:$e.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:$e.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:$e.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:$e.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};tn.attr=tn.data;tn.removeAttr=tn.removeData;var rn=function(e){var r=this;e=Ie({},e);var a=e.container;a&&!Qn(a)&&Qn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var o=ct!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=Ie({name:o?"grid":"null"},s.layout),s.renderer=Ie({name:o?"canvas":"null"},s.renderer);var u=function(d,p,y){return p!==void 0?p:y!==void 0?y:d},l=this._private={container:a,ready:!1,options:s,elements:new xt(this),listeners:[],aniEles:new xt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,s.zoomingEnabled),userZoomingEnabled:u(!0,s.userZoomingEnabled),panningEnabled:u(!0,s.panningEnabled),userPanningEnabled:u(!0,s.userPanningEnabled),boxSelectionEnabled:u(!0,s.boxSelectionEnabled),autolock:u(!1,s.autolock,s.autolockNodes),autoungrabify:u(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:be(s.zoom)?s.zoom:1,pan:{x:_e(s.pan)&&be(s.pan.x)?s.pan.x:0,y:_e(s.pan)&&be(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=function(d,p){var y=d.some(kd);if(y)return Ca.all(d).then(p);p(d)};l.styleEnabled&&r.setStyle([]);var h=Ie({},s,s.renderer);r.initRenderer(h);var v=function(d,p,y){r.notifications(!1);var g=r.mutableElements();g.length>0&&g.remove(),d!=null&&(_e(d)||Je(d))&&r.add(d),r.one("layoutready",function(m){r.notifications(!0),r.emit(m),r.one("load",p),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=Ie({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};f([s.style,s.elements],function(c){var d=c[0],p=c[1];l.styleEnabled&&r.style().append(d),v(p,function(){r.startAnimationLoop(),l.ready=!0,it(s.ready)&&r.on("ready",s.ready);for(var y=0;y<i.length;y++){var g=i[y];r.on("ready",g)}n&&(n.readies=[]),r.emit("ready")},s.done)})},ni=rn.prototype;Ie(ni,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return ct;var r=this._private.container.ownerDocument;return r===void 0||r==null?ct:r.defaultView||ct},mount:function(e){if(e!=null){var r=this,a=r._private,n=a.options;return!Qn(e)&&Qn(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Ie({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Qt(this._private.options)},json:function(e){var r=this,a=r._private,n=r.mutableElements(),i=function(w){return r.getElementById(w.id())};if(_e(e)){if(r.startBatch(),e.elements){var o={},s=function(w,T){for(var D=[],x=[],N=0;N<w.length;N++){var O=w[N];if(!O.data.id){Ke("cy.json() cannot handle elements without an ID attribute");continue}var R=""+O.data.id,P=r.getElementById(R);o[R]=!0,P.length!==0?x.push({ele:P,json:O}):(T&&(O.group=T),D.push(O))}r.add(D);for(var M=0;M<x.length;M++){var I=x[M],E=I.ele,A=I.json;E.json(A)}};if(Je(e.elements))s(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],h=e.elements[f];Je(h)&&s(h,f)}var v=r.collection();n.filter(function(m){return!o[m.id()]}).forEach(function(m){m.isParent()?v.merge(m):m.remove()}),v.forEach(function(m){return m.children().move({parent:null})}),v.forEach(function(m){return i(m).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var c=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<c.length;d++){var p=c[d];e[p]!=null&&r[p](e[p])}return r.endBatch(),this}else{var y=!!e,g={};y?g.elements=this.elements().map(function(m){return m.json()}):(g.elements={},n.forEach(function(m){var w=m.group();g.elements[w]||(g.elements[w]=[]),g.elements[w].push(m.json())})),this._private.styleEnabled&&(g.style=r.style().json()),g.data=Qt(r.data());var b=a.options;return g.zoomingEnabled=a.zoomingEnabled,g.userZoomingEnabled=a.userZoomingEnabled,g.zoom=a.zoom,g.minZoom=a.minZoom,g.maxZoom=a.maxZoom,g.panningEnabled=a.panningEnabled,g.userPanningEnabled=a.userPanningEnabled,g.pan=Qt(a.pan),g.boxSelectionEnabled=a.boxSelectionEnabled,g.renderer=Qt(b.renderer),g.hideEdgesOnViewport=b.hideEdgesOnViewport,g.textureOnViewport=b.textureOnViewport,g.wheelSensitivity=b.wheelSensitivity,g.motionBlur=b.motionBlur,g.multiClickDebounceTime=b.multiClickDebounceTime,g}}});ni.$id=ni.getElementById;[Bm,Um,kc,Rs,Yn,Ym,Os,qn,Wm,_r,tn].forEach(function(t){Ie(ni,t)});var $m={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Km={maximal:!1,acyclic:!1},ta=function(e){return e.scratch("breadthfirst")},Mf=function(e,r){return e.scratch("breadthfirst",r)};function Bc(t){this.options=Ie({},$m,Km,t)}Bc.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=r.nodes().filter(function(he){return he.isChildless()}),n=r,i=t.directed,o=t.acyclic||t.maximal||t.maximalAdjustments>0,s=!!t.boundingBox,u=Rt(s?t.boundingBox:structuredClone(e.extent())),l;if(Bt(t.roots))l=t.roots;else if(Je(t.roots)){for(var f=[],h=0;h<t.roots.length;h++){var v=t.roots[h],c=e.getElementById(v);f.push(c)}l=e.collection(f)}else if(Me(t.roots))l=e.$(t.roots);else if(i)l=a.roots();else{var d=r.components();l=e.collection();for(var p=function(){var fe=d[y],ve=fe.maxDegree(!1),ye=fe.filter(function(me){return me.degree(!1)===ve});l=l.add(ye)},y=0;y<d.length;y++)p()}var g=[],b={},m=function(fe,ve){g[ve]==null&&(g[ve]=[]);var ye=g[ve].length;g[ve].push(fe),Mf(fe,{index:ye,depth:ve})},w=function(fe,ve){var ye=ta(fe),me=ye.depth,xe=ye.index;g[me][xe]=null,fe.isChildless()&&m(fe,ve)};n.bfs({roots:l,directed:t.directed,visit:function(fe,ve,ye,me,xe){var Le=fe[0],ke=Le.id();Le.isChildless()&&m(Le,xe),b[ke]=!0}});for(var T=[],D=0;D<a.length;D++){var x=a[D];b[x.id()]||T.push(x)}var N=function(fe){for(var ve=g[fe],ye=0;ye<ve.length;ye++){var me=ve[ye];if(me==null){ve.splice(ye,1),ye--;continue}Mf(me,{depth:fe,index:ye})}},O=function(fe,ve){for(var ye=ta(fe),me=fe.incomers().filter(function(ne){return ne.isNode()&&r.has(ne)}),xe=-1,Le=fe.id(),ke=0;ke<me.length;ke++){var Fe=me[ke],Be=ta(Fe);xe=Math.max(xe,Be.depth)}if(ye.depth<=xe){if(!t.acyclic&&ve[Le])return null;var Oe=xe+1;return w(fe,Oe),ve[Le]=Oe,!0}return!1};if(i&&o){var R=[],P={},M=function(fe){return R.push(fe)},I=function(){return R.shift()};for(a.forEach(function(he){return R.push(he)});R.length>0;){var E=I(),A=O(E,P);if(A)E.outgoers().filter(function(he){return he.isNode()&&r.has(he)}).forEach(M);else if(A===null){Ke("Detected double maximal shift for node `"+E.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var C=0;if(t.avoidOverlap)for(var S=0;S<a.length;S++){var L=a[S],V=L.layoutDimensions(t),F=V.w,B=V.h;C=Math.max(C,F,B)}var Y={},q=function(fe){if(Y[fe.id()])return Y[fe.id()];for(var ve=ta(fe).depth,ye=fe.neighborhood(),me=0,xe=0,Le=0;Le<ye.length;Le++){var ke=ye[Le];if(!(ke.isEdge()||ke.isParent()||!a.has(ke))){var Fe=ta(ke);if(Fe!=null){var Be=Fe.index,Oe=Fe.depth;if(!(Be==null||Oe==null)){var ne=g[Oe].length;Oe<ve&&(me+=Be/ne,xe++)}}}}return xe=Math.max(1,xe),me=me/xe,xe===0&&(me=0),Y[fe.id()]=me,me},Q=function(fe,ve){var ye=q(fe),me=q(ve),xe=ye-me;return xe===0?Fh(fe.id(),ve.id()):xe};t.depthSort!==void 0&&(Q=t.depthSort);for(var $=g.length,K=0;K<$;K++)g[K].sort(Q),N(K);for(var j=[],re=0;re<T.length;re++)j.push(T[re]);var U=function(){for(var fe=0;fe<$;fe++)N(fe)};j.length&&(g.unshift(j),$=g.length,U());for(var H=0,_=0;_<$;_++)H=Math.max(g[_].length,H);var W={x:u.x1+u.w/2,y:u.y1+u.h/2},J=a.reduce(function(he,fe){return(function(ve){return{w:he.w===-1?ve.w:(he.w+ve.w)/2,h:he.h===-1?ve.h:(he.h+ve.h)/2}})(fe.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),te=Math.max($===1?0:s?(u.h-t.padding*2-J.h)/($-1):(u.h-t.padding*2-J.h)/($+1),C),de=g.reduce(function(he,fe){return Math.max(he,fe.length)},0),Te=function(fe){var ve=ta(fe),ye=ve.depth,me=ve.index;if(t.circle){var xe=Math.min(u.w/2/$,u.h/2/$);xe=Math.max(xe,C);var Le=xe*ye+xe-($>0&&g[0].length<=3?xe/2:0),ke=2*Math.PI/g[ye].length*me;return ye===0&&g[0].length===1&&(Le=1),{x:W.x+Le*Math.cos(ke),y:W.y+Le*Math.sin(ke)}}else{var Fe=g[ye].length,Be=Math.max(Fe===1?0:s?(u.w-t.padding*2-J.w)/((t.grid?de:Fe)-1):(u.w-t.padding*2-J.w)/((t.grid?de:Fe)+1),C),Oe={x:W.x+(me+1-(Fe+1)/2)*Be,y:W.y+(ye+1-($+1)/2)*te};return Oe}},ge={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(ge).indexOf(t.direction)===-1&&nt("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(ge).join(", ")));var le=function(fe){return fg(Te(fe),u,ge[t.direction])};return r.nodes().layoutPositions(this,t,le),this};var Zm={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Fc(t){this.options=Ie({},Zm,t)}Fc.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Rt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),f,h=0,v=0;v<i.length;v++){var c=i[v],d=c.layoutDimensions(e),p=d.w,y=d.h;h=Math.max(h,p,y)}if(be(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(o.h,o.w)/2-h,i.length>1&&e.avoidOverlap){h*=1.75;var g=Math.cos(l)-Math.cos(0),b=Math.sin(l)-Math.sin(0),m=Math.sqrt(h*h/(g*g+b*b));f=Math.max(m,f)}var w=function(D,x){var N=e.startAngle+x*l*(n?1:-1),O=f*Math.cos(N),R=f*Math.sin(N),P={x:s.x+O,y:s.y+R};return P};return a.nodes().layoutPositions(this,e,w),this};var Qm={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function zc(t){this.options=Ie({},Qm,t)}zc.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=t.cy,n=e.eles,i=n.nodes().not(":parent"),o=Rt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],l=0,f=0;f<i.length;f++){var h=i[f],v=void 0;v=e.concentric(h),u.push({value:v,node:h}),h._private.scratch.concentric=v}i.updateStyle();for(var c=0;c<i.length;c++){var d=i[c],p=d.layoutDimensions(e);l=Math.max(l,p.w,p.h)}u.sort(function(te,de){return de.value-te.value});for(var y=e.levelWidth(i),g=[[]],b=g[0],m=0;m<u.length;m++){var w=u[m];if(b.length>0){var T=Math.abs(b[0].value-w.value);T>=y&&(b=[],g.push(b))}b.push(w)}var D=l+e.minNodeSpacing;if(!e.avoidOverlap){var x=g.length>0&&g[0].length>1,N=Math.min(o.w,o.h)/2-D,O=N/(g.length+x?1:0);D=Math.min(D,O)}for(var R=0,P=0;P<g.length;P++){var M=g[P],I=e.sweep===void 0?2*Math.PI-2*Math.PI/M.length:e.sweep,E=M.dTheta=I/Math.max(1,M.length-1);if(M.length>1&&e.avoidOverlap){var A=Math.cos(E)-Math.cos(0),C=Math.sin(E)-Math.sin(0),S=Math.sqrt(D*D/(A*A+C*C));R=Math.max(S,R)}M.r=R,R+=D}if(e.equidistant){for(var L=0,V=0,F=0;F<g.length;F++){var B=g[F],Y=B.r-V;L=Math.max(L,Y)}V=0;for(var q=0;q<g.length;q++){var Q=g[q];q===0&&(V=Q.r),Q.r=V,V+=L}}for(var $={},K=0;K<g.length;K++)for(var j=g[K],re=j.dTheta,U=j.r,H=0;H<j.length;H++){var _=j[H],W=e.startAngle+(r?1:-1)*re*H,J={x:s.x+U*Math.cos(W),y:s.y+U*Math.sin(W)};$[_.node.id()]=J}return n.nodes().layoutPositions(this,e,function(te){var de=te.id();return $[de]}),this};var ns,Jm={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Ni(t){this.options=Ie({},Jm,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),a=r.filter(function(n){var i=n.source().data("id"),o=n.target().data("id"),s=e.some(function(l){return l.data("id")===i}),u=e.some(function(l){return l.data("id")===o});return!s||!u});this.options.eles=this.options.eles.not(a)}Ni.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?ns=!0:ns=!1;var a=jm(e,r,t);ns&&t0(a),t.randomize&&r0(a);var n=ir(),i=function(){a0(a,e,t),t.fit===!0&&e.fit(t.padding)},o=function(v){return!(r.stopped||v>=t.numIter||(n0(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp))},s=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var v=t.eles.nodes(),c=Gc(a,t,v);v.layoutPositions(r,t,c)}},u=0,l=!0;if(t.animate===!0){var f=function(){for(var v=0;l&&v<t.refresh;)l=o(u),u++,v++;if(!l)Of(a,t),s();else{var c=ir();c-n>=t.animationThreshold&&i(),Jn(f)}};f()}else{for(;l;)l=o(u),u++;Of(a,t),s()}return this};Ni.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Ni.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var jm=function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),o=Rt(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=a.eles.components(),l={},f=0;f<u.length;f++)for(var h=u[f],v=0;v<h.length;v++){var c=h[v];l[c.id()]=f}for(var f=0;f<s.nodeSize;f++){var d=i[f],p=d.layoutDimensions(a),y={};y.isLocked=d.locked(),y.id=d.data("id"),y.parentId=d.data("parent"),y.cmptId=l[d.id()],y.children=[],y.positionX=d.position("x"),y.positionY=d.position("y"),y.offsetX=0,y.offsetY=0,y.height=p.w,y.width=p.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(d.style("padding")),y.padRight=parseFloat(d.style("padding")),y.padTop=parseFloat(d.style("padding")),y.padBottom=parseFloat(d.style("padding")),y.nodeRepulsion=it(a.nodeRepulsion)?a.nodeRepulsion(d):a.nodeRepulsion,s.layoutNodes.push(y),s.idToIndex[y.id]=f}for(var g=[],b=0,m=-1,w=[],f=0;f<s.nodeSize;f++){var d=s.layoutNodes[f],T=d.parentId;T!=null?s.layoutNodes[s.idToIndex[T]].children.push(d.id):(g[++m]=d.id,w.push(d.id))}for(s.graphSet.push(w);b<=m;){var D=g[b++],x=s.idToIndex[D],c=s.layoutNodes[x],N=c.children;if(N.length>0){s.graphSet.push(N);for(var f=0;f<N.length;f++)g[++m]=N[f]}}for(var f=0;f<s.graphSet.length;f++)for(var O=s.graphSet[f],v=0;v<O.length;v++){var R=s.idToIndex[O[v]];s.indexToGraph[R]=f}for(var f=0;f<s.edgeSize;f++){var P=n[f],M={};M.id=P.data("id"),M.sourceId=P.data("source"),M.targetId=P.data("target");var I=it(a.idealEdgeLength)?a.idealEdgeLength(P):a.idealEdgeLength,E=it(a.edgeElasticity)?a.edgeElasticity(P):a.edgeElasticity,A=s.idToIndex[M.sourceId],C=s.idToIndex[M.targetId],S=s.indexToGraph[A],L=s.indexToGraph[C];if(S!=L){for(var V=e0(M.sourceId,M.targetId,s),F=s.graphSet[V],B=0,y=s.layoutNodes[A];F.indexOf(y.id)===-1;)y=s.layoutNodes[s.idToIndex[y.parentId]],B++;for(y=s.layoutNodes[C];F.indexOf(y.id)===-1;)y=s.layoutNodes[s.idToIndex[y.parentId]],B++;I*=B*a.nestingFactor}M.idealLength=I,M.elasticity=E,s.layoutEdges.push(M)}return s},e0=function(e,r,a){var n=Vc(e,r,0,a);return 2>n.count?0:n.graph},Vc=function(e,r,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:a};for(var o=0,s=0;s<i.length;s++){var u=i[s],l=n.idToIndex[u],f=n.layoutNodes[l].children;if(f.length!==0){var h=n.indexToGraph[n.idToIndex[f[0]]],v=Vc(e,r,h,n);if(v.count!==0)if(v.count===1){if(o++,o===2)break}else return v}}return{count:o,graph:a}},t0,r0=function(e,r){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*a,o.positionY=Math.random()*n)}},Gc=function(e,r,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(a.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(r.boundingBox){var l=i.w===0?.5:(u.positionX-i.x1)/i.w,f=i.h===0?.5:(u.positionY-i.y1)/i.h;return{x:n.x1+l*n.w,y:n.y1+f*n.h}}else return{x:u.positionX,y:u.positionY}}},a0=function(e,r,a){var n=a.layout,i=a.eles.nodes(),o=Gc(e,a,i);i.positions(o),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},n0=function(e,r,a){i0(e,r),u0(e),l0(e,r),f0(e),h0(e)},i0=function(e,r){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],u=o+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[n[u]]];o0(s,l,e,r)}},Rf=function(e){return-e+2*e*Math.random()},o0=function(e,r,a,n){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!a.isCompound)){var s=r.positionX-e.positionX,u=r.positionY-e.positionY,l=1;s===0&&u===0&&(s=Rf(l),u=Rf(l));var f=s0(e,r,s,u);if(f>0)var h=n.nodeOverlap*f,v=Math.sqrt(s*s+u*u),c=h*s/v,d=h*u/v;else var p=ii(e,s,u),y=ii(r,-1*s,-1*u),g=y.x-p.x,b=y.y-p.y,m=g*g+b*b,v=Math.sqrt(m),h=(e.nodeRepulsion+r.nodeRepulsion)/m,c=h*g/v,d=h*b/v;e.isLocked||(e.offsetX-=c,e.offsetY-=d),r.isLocked||(r.offsetX+=c,r.offsetY+=d)}},s0=function(e,r,a,n){if(a>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(n>0)var o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},ii=function(e,r,a){var n=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,u=a/r,l=o/s,f={};return r===0&&0<a||r===0&&0>a?(f.x=n,f.y=i+o/2,f):0<r&&-1*l<=u&&u<=l?(f.x=n+s/2,f.y=i+s*a/2/r,f):0>r&&-1*l<=u&&u<=l?(f.x=n-s/2,f.y=i-s*a/2/r,f):0<a&&(u<=-1*l||u>=l)?(f.x=n+o*r/2/a,f.y=i+o/2,f):(0>a&&(u<=-1*l||u>=l)&&(f.x=n-o*r/2/a,f.y=i-o/2),f)},u0=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],o=e.layoutNodes[i],s=e.idToIndex[n.targetId],u=e.layoutNodes[s],l=u.positionX-o.positionX,f=u.positionY-o.positionY;if(!(l===0&&f===0)){var h=ii(o,l,f),v=ii(u,-1*l,-1*f),c=v.x-h.x,d=v.y-h.y,p=Math.sqrt(c*c+d*d),y=Math.pow(n.idealLength-p,2)/n.elasticity;if(p!==0)var g=y*c/p,b=y*d/p;else var g=0,b=0;o.isLocked||(o.offsetX+=g,o.offsetY+=b),u.isLocked||(u.offsetX-=g,u.offsetY-=b)}}},l0=function(e,r){if(r.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],o=i.length;if(n===0)var s=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],s=f.positionX,u=f.positionY;for(var h=0;h<o;h++){var v=e.layoutNodes[e.idToIndex[i[h]]];if(!v.isLocked){var c=s-v.positionX,d=u-v.positionY,p=Math.sqrt(c*c+d*d);if(p>a){var y=r.gravity*c/p,g=r.gravity*d/p;v.offsetX+=y,v.offsetY+=g}}}}},f0=function(e,r){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var o=a[n++],s=e.idToIndex[o],u=e.layoutNodes[s],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,h=u.offsetY,v=0;v<l.length;v++){var c=e.layoutNodes[e.idToIndex[l[v]]];c.offsetX+=f,c.offsetY+=h,a[++i]=l[v]}u.offsetX=0,u.offsetY=0}}},h0=function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(!(0<n.children.length||n.isLocked)){var i=c0(n.offsetX,n.offsetY,e.temperature);n.positionX+=i.x,n.positionY+=i.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,Uc(n,e)}}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&!n.isLocked&&(n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY)}},c0=function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},Uc=function(e,r){var a=e.parentId;if(a!=null){var n=r.layoutNodes[r.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,i=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,i=!0),i)return Uc(n,r)}},Of=function(e,r){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var o=a[i],s=o.cmptId,u=n[s]=n[s]||[];u.push(o)}for(var l=0,i=0;i<n.length;i++){var f=n[i];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var h=0;h<f.length;h++){var v=f[h];f.x1=Math.min(f.x1,v.positionX-v.width/2),f.x2=Math.max(f.x2,v.positionX+v.width/2),f.y1=Math.min(f.y1,v.positionY-v.height/2),f.y2=Math.max(f.y2,v.positionY+v.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,l+=f.w*f.h}}n.sort(function(b,m){return m.w*m.h-b.w*b.h});for(var c=0,d=0,p=0,y=0,g=Math.sqrt(l)*e.clientWidth/e.clientHeight,i=0;i<n.length;i++){var f=n[i];if(f){for(var h=0;h<f.length;h++){var v=f[h];v.isLocked||(v.positionX+=c-f.x1,v.positionY+=d-f.y1)}c+=f.w+r.componentSpacing,p+=f.w+r.componentSpacing,y=Math.max(y,f.h),p>g&&(d+=y+r.componentSpacing,c=0,p=0,y=0)}}},v0={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Hc(t){this.options=Ie({},v0,t)}Hc.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=Rt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(q){return{x:i.x1,y:i.y1}});else{var o=n.size(),s=Math.sqrt(o*i.h/i.w),u=Math.round(s),l=Math.round(i.w/i.h*s),f=function(Q){if(Q==null)return Math.min(u,l);var $=Math.min(u,l);$==u?u=Q:l=Q},h=function(Q){if(Q==null)return Math.max(u,l);var $=Math.max(u,l);$==u?u=Q:l=Q},v=e.rows,c=e.cols!=null?e.cols:e.columns;if(v!=null&&c!=null)u=v,l=c;else if(v!=null&&c==null)u=v,l=Math.ceil(o/u);else if(v==null&&c!=null)l=c,u=Math.ceil(o/l);else if(l*u>o){var d=f(),p=h();(d-1)*p>=o?f(d-1):(p-1)*d>=o&&h(p-1)}else for(;l*u<o;){var y=f(),g=h();(g+1)*y>=o?h(g+1):f(y+1)}var b=i.w/l,m=i.h/u;if(e.condense&&(b=0,m=0),e.avoidOverlap)for(var w=0;w<n.length;w++){var T=n[w],D=T._private.position;(D.x==null||D.y==null)&&(D.x=0,D.y=0);var x=T.layoutDimensions(e),N=e.avoidOverlapPadding,O=x.w+N,R=x.h+N;b=Math.max(b,O),m=Math.max(m,R)}for(var P={},M=function(Q,$){return!!P["c-"+Q+"-"+$]},I=function(Q,$){P["c-"+Q+"-"+$]=!0},E=0,A=0,C=function(){A++,A>=l&&(A=0,E++)},S={},L=0;L<n.length;L++){var V=n[L],F=e.position(V);if(F&&(F.row!==void 0||F.col!==void 0)){var B={row:F.row,col:F.col};if(B.col===void 0)for(B.col=0;M(B.row,B.col);)B.col++;else if(B.row===void 0)for(B.row=0;M(B.row,B.col);)B.row++;S[V.id()]=B,I(B.row,B.col)}}var Y=function(Q,$){var K,j;if(Q.locked()||Q.isParent())return!1;var re=S[Q.id()];if(re)K=re.col*b+b/2+i.x1,j=re.row*m+m/2+i.y1;else{for(;M(E,A);)C();K=A*b+b/2+i.x1,j=E*m+m/2+i.y1,I(E,A),C()}return{x:K,y:j}};n.layoutPositions(this,e,Y)}return this};var d0={ready:function(){},stop:function(){}};function fu(t){this.options=Ie({},d0,t)}fu.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};fu.prototype.stop=function(){return this};var g0={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Yc(t){this.options=Ie({},g0,t)}Yc.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=it(t.positions);function n(i){if(t.positions==null)return Bg(i.position());if(a)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var s=n(i);return i.locked()||s==null?!1:s}),this};var p0={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function qc(t){this.options=Ie({},p0,t)}qc.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=Rt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(o,s){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return r.nodes().layoutPositions(this,t,n),this};var y0=[{name:"breadthfirst",impl:Bc},{name:"circle",impl:Fc},{name:"concentric",impl:zc},{name:"cose",impl:Ni},{name:"grid",impl:Hc},{name:"null",impl:fu},{name:"preset",impl:Yc},{name:"random",impl:qc}];function _c(t){this.options=t,this.notifications=0}var Pf=function(){},If=function(){throw new Error("A headless instance can not render images")};_c.prototype={recalculateRenderedStyle:Pf,notify:function(){this.notifications++},init:Pf,isHeadless:function(){return!0},png:If,jpg:If};var hu={};hu.arrowShapeWidth=.3;hu.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(l,f,h,v,c,d,p){var y=c.x-h/2-p,g=c.x+h/2+p,b=c.y-h/2-p,m=c.y+h/2+p,w=y<=l&&l<=g&&b<=f&&f<=m;return w},a=function(l,f,h,v,c){var d=l*Math.cos(v)-f*Math.sin(v),p=l*Math.sin(v)+f*Math.cos(v),y=d*h,g=p*h,b=y+c.x,m=g+c.y;return{x:b,y:m}},n=function(l,f,h,v){for(var c=[],d=0;d<l.length;d+=2){var p=l[d],y=l[d+1];c.push(a(p,y,f,h,v))}return c},i=function(l){for(var f=[],h=0;h<l.length;h++){var v=l[h];f.push(v.x,v.y)}return f},o=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},s=function(l,f){Me(f)&&(f=t[f]),t[l]=Ie({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(v,c,d,p,y,g){var b=i(n(this.points,d+2*g,p,y)),m=It(v,c,b);return m},roughCollide:r,draw:function(v,c,d,p){var y=n(this.points,c,d,p);e.arrowShapeImpl("polygon")(v,y)},spacing:function(v){return 0},gap:o},f)};s("none",{collide:jn,roughCollide:jn,draw:Zs,spacing:Xu,gap:Xu}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),p=this.controlPoint,y=a(p[0],p[1],f,h,v);e.arrowShapeImpl(this.name)(l,d,y)},gap:function(l){return o(l)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,f,h,v,c,d,p){var y=i(n(this.points,h+2*p,v,c)),g=i(n(this.pointsTee,h+2*p,v,c)),b=It(l,f,y)||It(l,f,g);return b},draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),p=n(this.pointsTee,f,h,v);e.arrowShapeImpl(this.name)(l,d,p)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,f,h,v,c,d,p){var y=c,g=Math.pow(y.x-l,2)+Math.pow(y.y-f,2)<=Math.pow((h+2*p)*this.radius,2),b=i(n(this.points,h+2*p,v,c));return It(l,f,b)||g},draw:function(l,f,h,v,c){var d=n(this.pointsTr,f,h,v);e.arrowShapeImpl(this.name)(l,d,v.x,v.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,f){var h=this.baseCrossLinePts.slice(),v=f/l,c=3,d=5;return h[c]=h[c]-v,h[d]=h[d]-v,h},collide:function(l,f,h,v,c,d,p){var y=i(n(this.points,h+2*p,v,c)),g=i(n(this.crossLinePts(h,d),h+2*p,v,c)),b=It(l,f,y)||It(l,f,g);return b},draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),p=n(this.crossLinePts(f,c),f,h,v);e.arrowShapeImpl(this.name)(l,d,p)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return o(l)*.525}}),s("circle",{radius:.15,collide:function(l,f,h,v,c,d,p){var y=c,g=Math.pow(y.x-l,2)+Math.pow(y.y-f,2)<=Math.pow((h+2*p)*this.radius,2);return g},draw:function(l,f,h,v,c){e.arrowShapeImpl(this.name)(l,v.x,v.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}})};var Xr={};Xr.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],o=a[4],s=r.pan(),u=r.zoom(),l=((t-n)/o-s.x)/u,f=((e-i)/o-s.y)/u;return[l,f]};Xr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=function(g){return parseFloat(r.getPropertyValue(g))},n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},i={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},o=t.clientWidth,s=t.clientHeight,u=n.left+n.right,l=n.top+n.bottom,f=i.left+i.right,h=e.width/(o+f),v=o-u,c=s-l,d=e.left+n.left+i.left,p=e.top+n.top+i.top;return this.containerBB=[d,p,v,c,h]};Xr.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Xr.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};Xr.findNearestElements=function(t,e,r,a){var n=this,i=this,o=i.getCachedZSortedEles(),s=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),f=(a?24:8)/u,h=(a?8:2)/u,v=(a?8:2)/u,c=1/0,d,p;r&&(o=o.interactive);function y(x,N){if(x.isNode()){if(p)return;p=x,s.push(x)}if(x.isEdge()&&(N==null||N<c))if(d){if(d.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value){for(var O=0;O<s.length;O++)if(s[O].isEdge()){s[O]=x,d=x,c=N??c;break}}}else s.push(x),d=x,c=N??c}function g(x){var N=x.outerWidth()+2*h,O=x.outerHeight()+2*h,R=N/2,P=O/2,M=x.position(),I=x.pstyle("corner-radius").value==="auto"?"auto":x.pstyle("corner-radius").pfValue,E=x._private.rscratch;if(M.x-R<=t&&t<=M.x+R&&M.y-P<=e&&e<=M.y+P){var A=i.nodeShapes[n.getNodeShape(x)];if(A.checkPoint(t,e,0,N,O,M.x,M.y,I,E))return y(x,0),!0}}function b(x){var N=x._private,O=N.rscratch,R=x.pstyle("width").pfValue,P=x.pstyle("arrow-scale").value,M=R/2+f,I=M*M,E=M*2,L=N.source,V=N.target,A;if(O.edgeType==="segments"||O.edgeType==="straight"||O.edgeType==="haystack"){for(var C=O.allpts,S=0;S+3<C.length;S+=2)if(Zg(t,e,C[S],C[S+1],C[S+2],C[S+3],E)&&I>(A=tp(t,e,C[S],C[S+1],C[S+2],C[S+3])))return y(x,A),!0}else if(O.edgeType==="bezier"||O.edgeType==="multibezier"||O.edgeType==="self"||O.edgeType==="compound"){for(var C=O.allpts,S=0;S+5<O.allpts.length;S+=4)if(Qg(t,e,C[S],C[S+1],C[S+2],C[S+3],C[S+4],C[S+5],E)&&I>(A=ep(t,e,C[S],C[S+1],C[S+2],C[S+3],C[S+4],C[S+5])))return y(x,A),!0}for(var L=L||N.source,V=V||N.target,F=n.getArrowWidth(R,P),B=[{name:"source",x:O.arrowStartX,y:O.arrowStartY,angle:O.srcArrowAngle},{name:"target",x:O.arrowEndX,y:O.arrowEndY,angle:O.tgtArrowAngle},{name:"mid-source",x:O.midX,y:O.midY,angle:O.midsrcArrowAngle},{name:"mid-target",x:O.midX,y:O.midY,angle:O.midtgtArrowAngle}],S=0;S<B.length;S++){var Y=B[S],q=i.arrowShapes[x.pstyle(Y.name+"-arrow-shape").value],Q=x.pstyle("width").pfValue;if(q.roughCollide(t,e,F,Y.angle,{x:Y.x,y:Y.y},Q,f)&&q.collide(t,e,F,Y.angle,{x:Y.x,y:Y.y},Q,f))return y(x),!0}l&&s.length>0&&(g(L),g(V))}function m(x,N,O){return Mt(x,N,O)}function w(x,N){var O=x._private,R=v,P;N?P=N+"-":P="",x.boundingBox();var M=O.labelBounds[N||"main"],I=x.pstyle(P+"label").value,E=x.pstyle("text-events").strValue==="yes";if(!(!E||!I)){var A=m(O.rscratch,"labelX",N),C=m(O.rscratch,"labelY",N),S=m(O.rscratch,"labelAngle",N),L=x.pstyle(P+"text-margin-x").pfValue,V=x.pstyle(P+"text-margin-y").pfValue,F=M.x1-R-L,B=M.x2+R-L,Y=M.y1-R-V,q=M.y2+R-V;if(S){var Q=Math.cos(S),$=Math.sin(S),K=function(J,te){return J=J-A,te=te-C,{x:J*Q-te*$+A,y:J*$+te*Q+C}},j=K(F,Y),re=K(F,q),U=K(B,Y),H=K(B,q),_=[j.x+L,j.y+V,U.x+L,U.y+V,H.x+L,H.y+V,re.x+L,re.y+V];if(It(t,e,_))return y(x),!0}else if(gr(M,t,e))return y(x),!0}}for(var T=o.length-1;T>=0;T--){var D=o[T];D.isNode()?g(D)||w(D):b(D)||w(D)||w(D,"source")||w(D,"target")}return s};Xr.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),o=2/i,s=[],u=Math.min(t,r),l=Math.max(t,r),f=Math.min(e,a),h=Math.max(e,a);t=u,r=l,e=f,a=h;var v=Rt({x1:t,y1:e,x2:r,y2:a}),c=[{x:v.x1,y:v.y1},{x:v.x2,y:v.y1},{x:v.x2,y:v.y2},{x:v.x1,y:v.y2}],d=[[c[0],c[1]],[c[1],c[2]],[c[2],c[3]],[c[3],c[0]]];function p(J,te,de){return Mt(J,te,de)}function y(J,te){var de=J._private,Te=o,ge="";J.boundingBox();var le=de.labelBounds.main;if(!le)return null;var he=p(de.rscratch,"labelX",te),fe=p(de.rscratch,"labelY",te),ve=p(de.rscratch,"labelAngle",te),ye=J.pstyle(ge+"text-margin-x").pfValue,me=J.pstyle(ge+"text-margin-y").pfValue,xe=le.x1-Te-ye,Le=le.x2+Te-ye,ke=le.y1-Te-me,Fe=le.y2+Te-me;if(ve){var Be=Math.cos(ve),Oe=Math.sin(ve),ne=function(z,G){return z=z-he,G=G-fe,{x:z*Be-G*Oe+he,y:z*Oe+G*Be+fe}};return[ne(xe,ke),ne(Le,ke),ne(Le,Fe),ne(xe,Fe)]}else return[{x:xe,y:ke},{x:Le,y:ke},{x:Le,y:Fe},{x:xe,y:Fe}]}function g(J,te,de,Te){function ge(le,he,fe){return(fe.y-le.y)*(he.x-le.x)>(he.y-le.y)*(fe.x-le.x)}return ge(J,de,Te)!==ge(te,de,Te)&&ge(J,te,de)!==ge(J,te,Te)}for(var b=0;b<n.length;b++){var m=n[b];if(m.isNode()){var w=m,T=w.pstyle("text-events").strValue==="yes",D=w.pstyle("box-selection").strValue,x=w.pstyle("box-select-labels").strValue==="yes";if(D==="none")continue;var N=(D==="overlap"||x)&&T,O=w.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:N});if(D==="contain"){var R=!1;if(x&&T){var P=y(w);P&&to(P,c)&&(s.push(w),R=!0)}!R&&Jh(v,O)&&s.push(w)}else if(D==="overlap"&&eu(v,O)){var M=w.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),I=[{x:M.x1,y:M.y1},{x:M.x2,y:M.y1},{x:M.x2,y:M.y2},{x:M.x1,y:M.y2}];if(to(I,c))s.push(w);else{var E=y(w);E&&to(E,c)&&s.push(w)}}}else{var A=m,C=A._private,S=C.rscratch,L=A.pstyle("box-selection").strValue;if(L==="none")continue;if(L==="contain"){if(S.startX!=null&&S.startY!=null&&!gr(v,S.startX,S.startY)||S.endX!=null&&S.endY!=null&&!gr(v,S.endX,S.endY))continue;if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"||S.edgeType==="segments"||S.edgeType==="haystack"){for(var V=C.rstyle.bezierPts||C.rstyle.linePts||C.rstyle.haystackPts,F=!0,B=0;B<V.length;B++)if(!Ju(v,V[B])){F=!1;break}F&&s.push(A)}else S.edgeType==="straight"&&s.push(A)}else if(L==="overlap"){var Y=!1;if(S.startX!=null&&S.startY!=null&&S.endX!=null&&S.endY!=null&&(gr(v,S.startX,S.startY)||gr(v,S.endX,S.endY)))s.push(A),Y=!0;else if(!Y&&S.edgeType==="haystack"){for(var q=C.rstyle.haystackPts,Q=0;Q<q.length;Q++)if(Ju(v,q[Q])){s.push(A),Y=!0;break}}if(!Y){var $=C.rstyle.bezierPts||C.rstyle.linePts||C.rstyle.haystackPts;if((!$||$.length<2)&&S.edgeType==="straight"&&S.startX!=null&&S.startY!=null&&S.endX!=null&&S.endY!=null&&($=[{x:S.startX,y:S.startY},{x:S.endX,y:S.endY}]),!$||$.length<2)continue;for(var K=0;K<$.length-1;K++){for(var j=$[K],re=$[K+1],U=0;U<d.length;U++){var H=ft(d[U],2),_=H[0],W=H[1];if(g(j,re,_,W)){s.push(A),Y=!0;break}}if(Y)break}}}}}return s};var oi={};oi.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",u,l,f,h,v,c,g,b;if(r?(f=e.haystackPts[0],h=e.haystackPts[1],v=e.haystackPts[2],c=e.haystackPts[3]):(f=e.arrowStartX,h=e.arrowStartY,v=e.arrowEndX,c=e.arrowEndY),g=e.midX,b=e.midY,i)u=f-e.segpts[0],l=h-e.segpts[1];else if(n||o||s||a){var d=e.allpts,p=mt(d[0],d[2],d[4],.1),y=mt(d[1],d[3],d[5],.1);u=f-p,l=h-y}else u=f-g,l=h-b;e.srcArrowAngle=Sn(u,l);var g=e.midX,b=e.midY;if(r&&(g=(f+v)/2,b=(h+c)/2),u=v-f,l=c-h,i){var d=e.allpts;if(d.length/2%2===0){var m=d.length/2,w=m-2;u=d[m]-d[w],l=d[m+1]-d[w+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var m=d.length/2-1,w=m-2;u=d[m]-d[w],l=d[m+1]-d[w+1]}}else if(n||o||s){var d=e.allpts,T=e.ctrlpts,D,x,N,O;if(T.length/2%2===0){var R=d.length/2-1,P=R+2,M=P+2;D=mt(d[R],d[P],d[M],0),x=mt(d[R+1],d[P+1],d[M+1],0),N=mt(d[R],d[P],d[M],1e-4),O=mt(d[R+1],d[P+1],d[M+1],1e-4)}else{var P=d.length/2-1,R=P-2,M=P+2;D=mt(d[R],d[P],d[M],.4999),x=mt(d[R+1],d[P+1],d[M+1],.4999),N=mt(d[R],d[P],d[M],.5),O=mt(d[R+1],d[P+1],d[M+1],.5)}u=N-D,l=O-x}if(e.midtgtArrowAngle=Sn(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var d=e.allpts;if(d.length/2%2!==0){if(!e.isRound){var m=d.length/2-1,I=m+2;u=-(d[I]-d[m]),l=-(d[I+1]-d[m+1])}}}if(e.midsrcArrowAngle=Sn(u,l),i)u=v-e.segpts[e.segpts.length-2],l=c-e.segpts[e.segpts.length-1];else if(n||o||s||a){var d=e.allpts,E=d.length,p=mt(d[E-6],d[E-4],d[E-2],.9),y=mt(d[E-5],d[E-3],d[E-1],.9);u=v-p,l=c-y}else u=v-g,l=c-b;e.tgtArrowAngle=Sn(u,l)};oi.getArrowWidth=oi.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];return a||(a=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=a,a)};var Ps,Is,Kt={},zt={},kf,Bf,zr,_n,ar,Pr,Br,Xt,ra,Pn,Wc,Xc,ks,Bs,Ff,zf=function(e,r,a){a.x=r.x-e.x,a.y=r.y-e.y,a.len=Math.sqrt(a.x*a.x+a.y*a.y),a.nx=a.x/a.len,a.ny=a.y/a.len,a.ang=Math.atan2(a.ny,a.nx)},m0=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},b0=function(e,r,a,n,i){if(e!==Ff?zf(r,e,Kt):m0(zt,Kt),zf(r,a,zt),kf=Kt.nx*zt.ny-Kt.ny*zt.nx,Bf=Kt.nx*zt.nx-Kt.ny*-zt.ny,ar=Math.asin(Math.max(-1,Math.min(1,kf))),Math.abs(ar)<1e-6){Ps=r.x,Is=r.y,Br=ra=0;return}zr=1,_n=!1,Bf<0?ar<0?ar=Math.PI+ar:(ar=Math.PI-ar,zr=-1,_n=!0):ar>0&&(zr=-1,_n=!0),r.radius!==void 0?ra=r.radius:ra=n,Pr=ar/2,Pn=Math.min(Kt.len/2,zt.len/2),i?(Xt=Math.abs(Math.cos(Pr)*ra/Math.sin(Pr)),Xt>Pn?(Xt=Pn,Br=Math.abs(Xt*Math.sin(Pr)/Math.cos(Pr))):Br=ra):(Xt=Math.min(Pn,ra),Br=Math.abs(Xt*Math.sin(Pr)/Math.cos(Pr))),ks=r.x+zt.nx*Xt,Bs=r.y+zt.ny*Xt,Ps=ks-zt.ny*Br*zr,Is=Bs+zt.nx*Br*zr,Wc=r.x+Kt.nx*Xt,Xc=r.y+Kt.ny*Xt,Ff=r};function $c(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function cu(t,e,r,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(b0(t,e,r,a,n),{cx:Ps,cy:Is,radius:Br,startX:Wc,startY:Xc,stopX:ks,stopY:Bs,startAngle:Kt.ang+Math.PI/2*zr,endAngle:zt.ang-Math.PI/2*zr,counterClockwise:_n})}var an=.01,w0=Math.sqrt(2*an),At={};At.findMidptPtsEtc=function(t,e){var r=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),u=o.units!=null&&s.units!=null,l=function(T,D,x,N){var O=N-D,R=x-T,P=Math.sqrt(R*R+O*O);return{x:-O/P,y:R/P}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":{if(u){var h=this.manualEndptToPx(t.source()[0],o),v=ft(h,2),c=v[0],d=v[1],p=this.manualEndptToPx(t.target()[0],s),y=ft(p,2),g=y[0],b=y[1],m={x1:c,y1:d,x2:g,y2:b};n=l(c,d,g,b),i=m}else Ke("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};At.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var i=Math.random()*2*Math.PI;n.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,n.target={x:Math.cos(i),y:Math.sin(i)}}var o=a.source,s=a.target,u=o.position(),l=s.position(),f=o.width(),h=s.width(),v=o.height(),c=s.height(),d=r.pstyle("haystack-radius").value,p=d/2;n.haystackPts=n.allpts=[n.source.x*f*p+u.x,n.source.y*v*p+u.y,n.target.x*h*p+l.x,n.target.y*c*p+l.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};At.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),s=Math.min(a.pfValue.length,n.pfValue.length),u=i.pfValue[i.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<s;f++){var h=a.pfValue[f],v=n.pfValue[f],c=1-h,d=h,p=this.findMidptPtsEtc(t,e),y=p.midptPts,g=p.vectorNormInverse,b={x:y.x1*c+y.x2*d,y:y.y1*c+y.y2*d};r.segpts.push(b.x+g.x*v,b.y+g.y*v),r.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:u),r.isArcRadius.push((o.pfValue[f]!==void 0?o.pfValue[f]:l)==="arc-radius")}};At.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,i=e.dirCounts,o=e.srcPos,s=t.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,h=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var v=r,c=h;a&&(v=0,c=u);var d=l-Math.PI/2,p=d-f/2,y=d+f/2,g=l+"_"+f;v=i[g]===void 0?i[g]=0:++i[g],n.ctrlpts=[o.x+Math.cos(p)*1.4*c*(v/3+1),o.y+Math.sin(p)*1.4*c*(v/3+1),o.x+Math.cos(y)*1.4*c*(v/3+1),o.y+Math.sin(y)*1.4*c*(v/3+1)]};At.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,h=t.pstyle("control-point-step-size").pfValue,v=t.pstyle("control-point-distances"),c=v?v.pfValue[0]:void 0,d=r,p=h;a&&(d=0,p=c);var y=50,g={x:i.x-s/2,y:i.y-u/2},b={x:o.x-l/2,y:o.y-f/2},m={x:Math.min(g.x,b.x),y:Math.min(g.y,b.y)},w=.5,T=Math.max(w,Math.log(s*an)),D=Math.max(w,Math.log(l*an));n.ctrlpts=[m.x,m.y-(1+Math.pow(y,1.12)/100)*p*(d/3+1)*T,m.x-(1+Math.pow(y,1.12)/100)*p*(d/3+1)*D,m.y]};At.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};At.findBezierPoints=function(t,e,r,a,n){var i=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,s=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),l=s&&u?Math.min(s.value.length,u.value.length):1,f=s?s.pfValue[0]:void 0,h=u.value[0],v=a;i.edgeType=v?"multibezier":"bezier",i.ctrlpts=[];for(var c=0;c<l;c++){var d=(.5-e.eles.length/2+r)*o*(n?-1:1),p=void 0,y=js(d);v&&(f=s?s.pfValue[c]:o,h=u.value[c]),a?p=f:p=f!==void 0?y*f:void 0;var g=p!==void 0?p:d,b=1-h,m=h,w=this.findMidptPtsEtc(t,e),T=w.midptPts,D=w.vectorNormInverse,x={x:T.x1*b+T.x2*m,y:T.y1*b+T.y2*m};i.ctrlpts.push(x.x+D.x*g,x.y+D.y*g)}};At.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",i="leftward",o="rightward",s="downward",u="upward",l="auto",f=e.posPts,h=e.srcW,v=e.srcH,c=e.tgtW,d=e.tgtH,p=t.pstyle("edge-distances").value,y=p!=="node-position",g=t.pstyle("taxi-direction").value,b=g,m=t.pstyle("taxi-turn"),w=m.units==="%",T=m.pfValue,D=T<0,x=t.pstyle("taxi-turn-min-distance").pfValue,N=y?(h+c)/2:0,O=y?(v+d)/2:0,R=f.x2-f.x1,P=f.y2-f.y1,M=function(G,X){return G>0?Math.max(G-X,0):Math.min(G+X,0)},I=M(R,N),E=M(P,O),A=!1;b===l?g=Math.abs(I)>Math.abs(E)?n:a:b===u||b===s?(g=a,A=!0):(b===i||b===o)&&(g=n,A=!0);var C=g===a,S=C?E:I,L=C?P:R,V=js(L),F=!1;!(A&&(w||D))&&(b===s&&L<0||b===u&&L>0||b===i&&L>0||b===o&&L<0)&&(V*=-1,S=V*Math.abs(S),F=!0);var B;if(w){var Y=T<0?1+T:T;B=Y*S}else{var q=T<0?S:0;B=q+T*V}var Q=function(G){return Math.abs(G)<x||Math.abs(G)>=Math.abs(S)},$=Q(B),K=Q(Math.abs(S)-Math.abs(B)),j=$||K;if(j&&!F)if(C){var re=Math.abs(L)<=v/2,U=Math.abs(R)<=c/2;if(re){var H=(f.x1+f.x2)/2,_=f.y1,W=f.y2;r.segpts=[H,_,H,W]}else if(U){var J=(f.y1+f.y2)/2,te=f.x1,de=f.x2;r.segpts=[te,J,de,J]}else r.segpts=[f.x1,f.y2]}else{var Te=Math.abs(L)<=h/2,ge=Math.abs(P)<=d/2;if(Te){var le=(f.y1+f.y2)/2,he=f.x1,fe=f.x2;r.segpts=[he,le,fe,le]}else if(ge){var ve=(f.x1+f.x2)/2,ye=f.y1,me=f.y2;r.segpts=[ve,ye,ve,me]}else r.segpts=[f.x2,f.y1]}else if(C){var xe=f.y1+B+(y?v/2*V:0),Le=f.x1,ke=f.x2;r.segpts=[Le,xe,ke,xe]}else{var Fe=f.x1+B+(y?h/2*V:0),Be=f.y1,Oe=f.y2;r.segpts=[Fe,Be,Fe,Oe]}if(r.isRound){var ne=t.pstyle("taxi-radius").value,k=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ne),r.isArcRadius=new Array(r.segpts.length/2).fill(k)}};At.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,h=e.srcCornerRadius,v=e.tgtCornerRadius,c=e.srcRs,d=e.tgtRs,p=!be(r.startX)||!be(r.startY),y=!be(r.arrowStartX)||!be(r.arrowStartY),g=!be(r.endX)||!be(r.endY),b=!be(r.arrowEndX)||!be(r.arrowEndY),m=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=m*w,D=Yr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),x=D<T,N=Yr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),O=N<T,R=!1;if(p||y||x){R=!0;var P={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},M=Math.sqrt(P.x*P.x+P.y*P.y),I={x:P.x/M,y:P.y/M},E=Math.max(i,o),A={x:r.ctrlpts[0]+I.x*2*E,y:r.ctrlpts[1]+I.y*2*E},C=l.intersectLine(a.x,a.y,i,o,A.x,A.y,0,h,c);x?(r.ctrlpts[0]=r.ctrlpts[0]+I.x*(T-D),r.ctrlpts[1]=r.ctrlpts[1]+I.y*(T-D)):(r.ctrlpts[0]=C[0]+I.x*T,r.ctrlpts[1]=C[1]+I.y*T)}if(g||b||O){R=!0;var S={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},L=Math.sqrt(S.x*S.x+S.y*S.y),V={x:S.x/L,y:S.y/L},F=Math.max(i,o),B={x:r.ctrlpts[0]+V.x*2*F,y:r.ctrlpts[1]+V.y*2*F},Y=f.intersectLine(n.x,n.y,s,u,B.x,B.y,0,v,d);O?(r.ctrlpts[0]=r.ctrlpts[0]+V.x*(T-N),r.ctrlpts[1]=r.ctrlpts[1]+V.y*(T-N)):(r.ctrlpts[0]=Y[0]+V.x*T,r.ctrlpts[1]=Y[1]+V.y*T)}R&&this.findEndpoints(t)}};At.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=mt(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=mt(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(cu({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var h={x:e.segpts[f],y:e.segpts[f+1]},v=e.roundCorners[f/2];if(v.radius===0){var c={x:e.segpts[f+2],y:e.segpts[f+3]};e.midX=h.x,e.midY=h.y,e.midVector=[h.y-c.y,c.x-h.x]}else{var d=[h.x-v.cx,h.y-v.cy],p=v.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map(function(y){return y*p}),e.midX=v.cx+d[0],e.midY=v.cy+d[1],e.midVector=d}}}}};At.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||be(e.startX)&&be(e.startY)&&be(e.endX)&&be(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ke("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};At.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy,n=a.hasCompoundNodes(),i=new nr,o=function(O,R){return[].concat(Zn(O),[R?1:0]).join("-")},s=[],u=[],l=0;l<t.length;l++){var f=t[l],h=f._private,v=f.pstyle("curve-style").value;if(!(f.removed()||!f.takesUpSpace())){if(v==="haystack"){u.push(f);continue}var c=v==="unbundled-bezier"||dr(v,"segments")||v==="straight"||v==="straight-triangle"||dr(v,"taxi"),d=v==="unbundled-bezier"||v==="bezier",p=h.source,y=h.target,g=p.poolIndex(),b=y.poolIndex(),m=[g,b].sort(),w=o(m,c),T=i.get(w);T==null&&(T={eles:[]},s.push({pairId:m,edgeIsUnbundled:c}),i.set(w,T)),T.eles.push(f),c&&(T.hasUnbundled=!0),d&&(T.hasBezier=!0)}}for(var D=function(){var O=s[x],R=O.pairId,P=O.edgeIsUnbundled,M=o(R,P),I=i.get(M),E;if(!I.hasUnbundled){var A=I.eles[0].parallelEdges().filter(function(k){return k.isBundledBezier()});Qs(I.eles),A.forEach(function(k){return I.eles.push(k)}),I.eles.sort(function(k,z){return k.poolIndex()-z.poolIndex()})}var C=I.eles[0],S=C.source(),L=C.target();if(S.poolIndex()>L.poolIndex()){var V=S;S=L,L=V}var F=I.srcPos=S.position(),B=I.tgtPos=L.position(),Y=I.srcW=S.outerWidth(),q=I.srcH=S.outerHeight(),Q=I.tgtW=L.outerWidth(),$=I.tgtH=L.outerHeight(),K=I.srcShape=r.nodeShapes[e.getNodeShape(S)],j=I.tgtShape=r.nodeShapes[e.getNodeShape(L)],re=I.srcCornerRadius=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,U=I.tgtCornerRadius=L.pstyle("corner-radius").value==="auto"?"auto":L.pstyle("corner-radius").pfValue,H=I.tgtRs=L._private.rscratch,_=I.srcRs=S._private.rscratch;I.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var W=0;W<I.eles.length;W++){var J=I.eles[W],te=J[0]._private.rscratch,de=J.pstyle("curve-style").value,Te=de==="unbundled-bezier"||dr(de,"segments")||dr(de,"taxi"),ge=!S.same(J.source());if(!I.calculatedIntersection&&S!==L&&(I.hasBezier||I.hasUnbundled)){I.calculatedIntersection=!0;var le=K.intersectLine(F.x,F.y,Y,q,B.x,B.y,0,re,_),he=I.srcIntn=le,fe=j.intersectLine(B.x,B.y,Q,$,F.x,F.y,0,U,H),ve=I.tgtIntn=fe,ye=I.intersectionPts={x1:le[0],x2:fe[0],y1:le[1],y2:fe[1]},me=I.posPts={x1:F.x,x2:B.x,y1:F.y,y2:B.y},xe=fe[1]-le[1],Le=fe[0]-le[0],ke=Math.sqrt(Le*Le+xe*xe);be(ke)&&ke>=w0||(ke=Math.sqrt(Math.max(Le*Le,an)+Math.max(xe*xe,an)));var Fe=I.vector={x:Le,y:xe},Be=I.vectorNorm={x:Fe.x/ke,y:Fe.y/ke},Oe={x:-Be.y,y:Be.x};I.nodesOverlap=!be(ke)||j.checkPoint(le[0],le[1],0,Q,$,B.x,B.y,U,H)||K.checkPoint(fe[0],fe[1],0,Y,q,F.x,F.y,re,_),I.vectorNormInverse=Oe,E={nodesOverlap:I.nodesOverlap,dirCounts:I.dirCounts,calculatedIntersection:!0,hasBezier:I.hasBezier,hasUnbundled:I.hasUnbundled,eles:I.eles,srcPos:B,srcRs:H,tgtPos:F,tgtRs:_,srcW:Q,srcH:$,tgtW:Y,tgtH:q,srcIntn:ve,tgtIntn:he,srcShape:j,tgtShape:K,posPts:{x1:me.x2,y1:me.y2,x2:me.x1,y2:me.y1},intersectionPts:{x1:ye.x2,y1:ye.y2,x2:ye.x1,y2:ye.y1},vector:{x:-Fe.x,y:-Fe.y},vectorNorm:{x:-Be.x,y:-Be.y},vectorNormInverse:{x:-Oe.x,y:-Oe.y}}}var ne=ge?E:I;te.nodesOverlap=ne.nodesOverlap,te.srcIntn=ne.srcIntn,te.tgtIntn=ne.tgtIntn,te.isRound=de.startsWith("round"),n&&(S.isParent()||S.isChild()||L.isParent()||L.isChild())&&(S.parents().anySame(L)||L.parents().anySame(S)||S.same(L)&&S.isParent())?e.findCompoundLoopPoints(J,ne,W,Te):S===L?e.findLoopPoints(J,ne,W,Te):de.endsWith("segments")?e.findSegmentsPoints(J,ne):de.endsWith("taxi")?e.findTaxiPoints(J,ne):de==="straight"||!Te&&I.eles.length%2===1&&W===Math.floor(I.eles.length/2)?e.findStraightEdgePoints(J):e.findBezierPoints(J,ne,W,Te,ge),e.findEndpoints(J),e.tryToCorrectInvalidPoints(J,ne),e.checkForInvalidEdgeWarning(J),e.storeAllpts(J),e.storeEdgeProjections(J),e.calculateArrowAngles(J),e.recalculateEdgeLabelProjections(J),e.calculateLabelAngles(J)}},x=0;x<s.length;x++)D();this.findHaystackPoints(u)}};function Kc(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}}At.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return Kc(e.segpts)};At.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return Kc(e.ctrlpts)};At.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var pn={};pn.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight(),o=t._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*n),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=a.x,s[1]+=a.y,s}else{var u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(n,i),f=[a.x+Math.cos(u)*l,a.y+Math.sin(u)*l];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,i,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,o)}};pn.findEndpoints=function(t){var e,r,a,n,i=this,o,s=t.source()[0],u=t.target()[0],l=s.position(),f=u.position(),h=t.pstyle("target-arrow-shape").value,v=t.pstyle("source-arrow-shape").value,c=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,p=s._private.rscratch,y=u._private.rscratch,g=t.pstyle("curve-style").value,b=t._private.rscratch,m=b.edgeType,w=dr(g,"taxi"),T=m==="self"||m==="compound",D=m==="bezier"||m==="multibezier"||T,x=m!=="bezier",N=m==="straight"||m==="segments",O=m==="segments",R=D||x||N,P=T||w,M=t.pstyle("source-endpoint"),I=P?"outside-to-node":M.value,E=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,A=t.pstyle("target-endpoint"),C=P?"outside-to-node":A.value,S=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue;b.srcManEndpt=M,b.tgtManEndpt=A;var L,V,F,B,Y=(e=(A==null||(r=A.pfValue)===null||r===void 0?void 0:r.length)===2?A.pfValue:null)!==null&&e!==void 0?e:[0,0],q=(a=(M==null||(n=M.pfValue)===null||n===void 0?void 0:n.length)===2?M.pfValue:null)!==null&&a!==void 0?a:[0,0];if(D){var Q=[b.ctrlpts[0],b.ctrlpts[1]],$=x?[b.ctrlpts[b.ctrlpts.length-2],b.ctrlpts[b.ctrlpts.length-1]]:Q;L=$,V=Q}else if(N){var K=O?b.segpts.slice(0,2):[f.x+Y[0],f.y+Y[1]],j=O?b.segpts.slice(b.segpts.length-2):[l.x+q[0],l.y+q[1]];L=j,V=K}if(C==="inside-to-node")o=[f.x,f.y];else if(A.units)o=this.manualEndptToPx(u,A);else if(C==="outside-to-line")o=b.tgtIntn;else if(C==="outside-to-node"||C==="outside-to-node-or-label"?F=L:(C==="outside-to-line"||C==="outside-to-line-or-label")&&(F=[l.x,l.y]),o=i.nodeShapes[this.getNodeShape(u)].intersectLine(f.x,f.y,u.outerWidth(),u.outerHeight(),F[0],F[1],0,S,y),C==="outside-to-node-or-label"||C==="outside-to-line-or-label"){var re=u._private.rscratch,U=re.labelWidth,H=re.labelHeight,_=re.labelX,W=re.labelY,J=U/2,te=H/2,de=u.pstyle("text-valign").value;de=wa(de),de==="top"?W-=te:de==="bottom"&&(W+=te);var Te=u.pstyle("text-halign").value;Te=ba(Te),Te==="left"?_-=J:Te==="right"&&(_+=J);var ge=Ja(F[0],F[1],[_-J,W-te,_+J,W-te,_+J,W+te,_-J,W+te],f.x,f.y);if(ge.length>0){var le=l,he=kr(le,sa(o)),fe=kr(le,sa(ge)),ve=he;if(fe<he&&(o=ge,ve=fe),ge.length>2){var ye=kr(le,{x:ge[2],y:ge[3]});ye<ve&&(o=[ge[2],ge[3]])}}}var me=Dn(o,L,i.arrowShapes[h].spacing(t)+c),xe=Dn(o,L,i.arrowShapes[h].gap(t)+c);if(b.endX=xe[0],b.endY=xe[1],b.arrowEndX=me[0],b.arrowEndY=me[1],I==="inside-to-node")o=[l.x,l.y];else if(M.units)o=this.manualEndptToPx(s,M);else if(I==="outside-to-line")o=b.srcIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?B=V:(I==="outside-to-line"||I==="outside-to-line-or-label")&&(B=[f.x,f.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),B[0],B[1],0,E,p),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var Le=s._private.rscratch,ke=Le.labelWidth,Fe=Le.labelHeight,Be=Le.labelX,Oe=Le.labelY,ne=ke/2,k=Fe/2,z=s.pstyle("text-valign").value;z=wa(z),z==="top"?Oe-=k:z==="bottom"&&(Oe+=k);var G=s.pstyle("text-halign").value;G=ba(G),G==="left"?Be-=ne:G==="right"&&(Be+=ne);var X=Ja(B[0],B[1],[Be-ne,Oe-k,Be+ne,Oe-k,Be+ne,Oe+k,Be-ne,Oe+k],l.x,l.y);if(X.length>0){var Z=f,ae=kr(Z,sa(o)),ee=kr(Z,sa(X)),ie=ae;if(ee<ae&&(o=[X[0],X[1]],ie=ee),X.length>2){var se=kr(Z,{x:X[2],y:X[3]});se<ie&&(o=[X[2],X[3]])}}}var oe=Dn(o,V,i.arrowShapes[v].spacing(t)+d),ue=Dn(o,V,i.arrowShapes[v].gap(t)+d);b.startX=ue[0],b.startY=ue[1],b.arrowStartX=oe[0],b.arrowStartY=oe[1],R&&(!be(b.startX)||!be(b.startY)||!be(b.endX)||!be(b.endY)?b.badLine=!0:b.badLine=!1)};pn.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};pn.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var vu={};function E0(t,e,r){for(var a=function(l,f,h,v){return mt(l,f,h,v)},n=e._private,i=n.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var s=t.bezierProjPcts[o];i.push({x:a(r[0],r[2],r[4],s),y:a(r[1],r[3],r[5],s)})}}vu.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,a=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)E0(this,t,r.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],n=0;n+1<r.allpts.length;n+=2)i.push({x:r.allpts[n],y:r.allpts[n+1]});else if(a==="haystack"){var o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};vu.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var er={};er.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!br(e)){var r,a,n=t._private,i=t.width(),o=t.height(),s=t.padding(),u=t.position(),l=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,h=n.rscratch,v=n.rstyle;switch(l){case"left":r=u.x-i/2-s;break;case"left-inside":r=u.x-i/2+s;break;case"right":r=u.x+i/2+s;break;case"right-inside":r=u.x+i/2-s;break;default:r=u.x}switch(f){case"top":a=u.y-o/2-s;break;case"top-inside":a=u.y-o/2+s;break;case"bottom":a=u.y+o/2+s;break;case"bottom-inside":a=u.y+o/2-s;break;default:a=u.y}h.labelX=r,h.labelY=a,v.labelX=r,v.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var Zc=function(e,r){var a=Math.atan(r/e);return e===0&&a<0&&(a=a*-1),a},Qc=function(e,r){var a=r.x-e.x,n=r.y-e.y;return Zc(a,n)},x0=function(e,r,a,n){var i=Qa(0,n-.001,1),o=Qa(0,n+.001,1),s=fa(e,r,a,i),u=fa(e,r,a,o);return Qc(s,u)};er.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:a.midX,y:a.midY};var o=function(h,v,c){Zt(r.rscratch,h,v,c),Zt(r.rstyle,h,v,c)};o("labelX",null,e.x),o("labelY",null,e.y);var s=Zc(a.midDispX,a.midDispY);o("labelAutoAngle",null,s);var u=function(){if(u.cache)return u.cache;for(var h=[],v=0;v+5<a.allpts.length;v+=4){var c={x:a.allpts[v],y:a.allpts[v+1]},d={x:a.allpts[v+2],y:a.allpts[v+3]},p={x:a.allpts[v+4],y:a.allpts[v+5]};h.push({p0:c,p1:d,p2:p,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,g=n.bezierProjPcts.length;function b(x,N,O,R,P){var M=Yr(N,O),I=x.segments[x.segments.length-1],E={p0:N,p1:O,t0:R,t1:P,startDist:I?I.startDist+I.length:0,length:M};x.segments.push(E),x.length+=M}for(var m=0;m<h.length;m++){var w=h[m],T=h[m-1];T&&(w.startDist=T.startDist+T.length),b(w,w.p0,y[m*g],0,n.bezierProjPcts[0]);for(var D=0;D<g-1;D++)b(w,y[m*g+D],y[m*g+D+1],n.bezierProjPcts[D],n.bezierProjPcts[D+1]);b(w,y[m*g+g-1],w.p2,n.bezierProjPcts[g-1],1)}return u.cache=h},l=function(h){var v,c=h==="source";if(i[h]){var d=t.pstyle(h+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=u(),y,g=0,b=0,m=0;m<p.length;m++){for(var w=p[c?m:p.length-1-m],T=0;T<w.segments.length;T++){var D=w.segments[c?T:w.segments.length-1-T],x=m===p.length-1&&T===w.segments.length-1;if(g=b,b+=D.length,b>=d||x){y={cp:w,segment:D};break}}if(y)break}var N=y.cp,O=y.segment,R=(d-g)/O.length,P=O.t1-O.t0,M=c?O.t0+P*R:O.t1-P*R;M=Qa(0,M,1),e=fa(N.p0,N.p1,N.p2,M),v=x0(N.p0,N.p1,N.p2,M);break}case"straight":case"segments":case"haystack":{for(var I=0,E,A,C,S,L=a.allpts.length,V=0;V+3<L&&(c?(C={x:a.allpts[V],y:a.allpts[V+1]},S={x:a.allpts[V+2],y:a.allpts[V+3]}):(C={x:a.allpts[L-2-V],y:a.allpts[L-1-V]},S={x:a.allpts[L-4-V],y:a.allpts[L-3-V]}),E=Yr(C,S),A=I,I+=E,!(I>=d));V+=2);var F=d-A,B=F/E;B=Qa(0,B,1),e=Yg(C,S,B),v=Qc(C,S);break}}o("labelX",h,e.x),o("labelY",h,e.y),o("labelAutoAngle",h,v)}};l("source"),l("target"),this.applyLabelDimensions(t)}};er.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};er.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=Hr(a,t._private.labelDimsKey);if(Mt(r.rscratch,"prefixedLabelDimsKey",e)!==n){Zt(r.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(t,a),o=t.pstyle("line-height").pfValue,s=t.pstyle("font-size").pfValue,u=t.pstyle("text-wrap").strValue,l=Mt(r.rscratch,"labelWrapCachedLines",e)||[],f=u!=="wrap"?1:Math.max(l.length,1),h=s*o,v=i.width,c=i.height+(f-1)*(o-1)*s;Zt(r.rstyle,"labelWidth",e,v),Zt(r.rscratch,"labelWidth",e,v),Zt(r.rstyle,"labelHeight",e,c),Zt(r.rscratch,"labelHeight",e,c),Zt(r.rscratch,"labelLineHeight",e,h),Zt(r.rscratch,"labelActualDescent",e,i.labelActualDescent)}};er.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,o=function(q,Q){return Q?(Zt(r.rscratch,q,e,Q),Q):Mt(r.rscratch,q,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l="​",f=n.split(`
14
+ */var Ac=function(e,r){this.recycle(e,r)};function Ba(){return!1}function Mn(){return!0}Ac.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ba,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Mn:Ba):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:a.x*n+i.x,y:a.y*n+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Mn;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Mn;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Mn,this.stopPropagation()},isDefaultPrevented:Ba,isPropagationStopped:Ba,isImmediatePropagationStopped:Ba};var Lc=/^([^.]+)(\.(?:[^.]+))?$/,Sm=".*",Nc={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},mf=Object.keys(Nc),Dm={};function Ci(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Dm,e=arguments.length>1?arguments[1]:void 0,r=0;r<mf.length;r++){var a=mf[r];this[a]=t[a]||Nc[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Cr=Ci.prototype,Mc=function(e,r,a,n,i,o,s){it(n)&&(i=n,n=null),s&&(o==null?o=s:o=Ie({},o,s));for(var u=Je(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!br(f)){var h=f.match(Lc);if(h){var v=h[1],c=h[2]?h[2]:null,d=r(e,f,v,c,n,i,o);if(d===!1)break}}}},bf=function(e,r){return e.addEventFields(e.context,r),new Ac(r.type,r)},Am=function(e,r,a){if(Od(a)){r(e,a);return}else if(_e(a)){r(e,bf(e,a));return}for(var n=Je(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var o=n[i];if(!br(o)){var s=o.match(Lc);if(s){var u=s[1],l=s[2]?s[2]:null,f=bf(e,{type:u,namespace:l,target:e.context});r(e,f)}}}};Cr.on=Cr.addListener=function(t,e,r,a,n){return Mc(this,function(i,o,s,u,l,f,h){it(f)&&i.listeners.push({event:o,callback:f,type:s,namespace:u,qualifier:l,conf:h})},t,e,r,a,n),this};Cr.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};Cr.removeListener=Cr.off=function(t,e,r,a){var n=this;this.emitting!==0&&(this.listeners=dg(this.listeners));for(var i=this.listeners,o=function(l){var f=i[l];Mc(n,function(h,v,c,d,p,y){if((f.type===c||t==="*")&&(!d&&f.namespace!==".*"||f.namespace===d)&&(!p||h.qualifierCompare(f.qualifier,p))&&(!y||f.callback===y))return i.splice(l,1),!1},t,e,r,a)},s=i.length-1;s>=0;s--)o(s);return this};Cr.removeAllListeners=function(){return this.removeListener("*")};Cr.emit=Cr.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,Je(e)||(e=[e]),Am(this,function(i,o){r!=null&&(a=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],n=a.length);for(var s=function(){var f=a[u];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===Sm)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&pg(h,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==f}));var v=i.callbackContext(i.context,f,o),c=f.callback.apply(v,h);i.afterEmit(i.context,f,o),c===!1&&(o.stopPropagation(),o.preventDefault())}},u=0;u<n;u++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var Lm={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&un(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Rn=function(e){return Me(e)?new xr(e):e},Rc={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;a.emitter||(a.emitter=new Ci(Lm,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){for(var n=Rn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){for(var n=Rn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,a){for(var n=Rn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,n,a)}return this},once:function(e,r,a){for(var n=Rn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,r){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};$e.eventAliasesOn(Rc);var Oc={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):r.push(n)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Me(e)||Bt(e))return new xr(e).filter(this);if(it(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);s&&a.push(o)}return a}return this.spawn()},not:function(e){if(e){Me(e)&&(e=this.filter(e));for(var r=this.spawn(),a=0;a<this.length;a++){var n=this[a],i=e.has(n);i||r.push(n)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Me(e)){var r=e;return this.filter(r)}for(var a=this.spawn(),n=this,i=e,o=this.length<e.length,s=o?n:i,u=o?i:n,l=0;l<s.length;l++){var f=s[l];u.has(f)&&a.push(f)}return a},xor:function(e){var r=this._private.cy;Me(e)&&(e=r.$(e));var a=this.spawn(),n=this,i=e,o=function(u,l){for(var f=0;f<u.length;f++){var h=u[f],v=h._private.data.id,c=l.hasElementWithId(v);c||a.push(h)}};return o(n,i),o(i,n),a},diff:function(e){var r=this._private.cy;Me(e)&&(e=r.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),o=this,s=e,u=function(f,h,v){for(var c=0;c<f.length;c++){var d=f[c],p=d._private.data.id,y=h.hasElementWithId(p);y?i.merge(d):v.push(d)}};return u(o,s,a),u(s,o,n),{left:a,right:n,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Me(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&n.push(o)}return n},merge:function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&Me(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=r.map,o=0;o<e.length;o++){var s=e[o],u=s._private.data.id,l=!i.has(u);if(l){var f=this.length++;this[f]=s,i.set(u,{ele:s,index:f})}}return this},unmergeAt:function(e){var r=this[e],a=r.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,u=this[s],l=u._private.data.id;this[s]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,i=n.get(a);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Me(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var a=this[r];e(a)&&this.unmergeAt(r)}return this},map:function(e,r){for(var a=[],n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);a.push(s)}return a},reduce:function(e,r){for(var a=r,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,r){for(var a=-1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u>a&&(a=u,n=s)}return{value:a,ele:n}},min:function(e,r){for(var a=1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u<a&&(a=u,n=s)}return{value:a,ele:n}}},We=Oc;We.u=We["|"]=We["+"]=We.union=We.or=We.add;We["\\"]=We["!"]=We["-"]=We.difference=We.relativeComplement=We.subtract=We.not;We.n=We["&"]=We["."]=We.and=We.intersection=We.intersect;We["^"]=We["(+)"]=We["(-)"]=We.symmetricDifference=We.symdiff=We.xor;We.fnFilter=We.filterFn=We.stdFilter=We.filter;We.complement=We.abscomp=We.absoluteComplement;var Nm={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Pc=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function i(f){var h=f.pstyle("z-compound-depth");return h.value==="auto"?n?f.zDepth():0:h.value==="bottom"?-1:h.value==="top"?Ks:0}var o=i(e)-i(r);if(o!==0)return o;function s(f){var h=f.pstyle("z-index-compare");return h.value==="auto"&&f.isNode()?1:0}var u=s(e)-s(r);if(u!==0)return u;var l=e.pstyle("z-index").value-r.pstyle("z-index").value;return l!==0?l:e.poolIndex()-r.poolIndex()},ai={forEach:function(e,r){if(it(e))for(var a=this.length,n=0;n<a;n++){var i=this[n],o=r?e.apply(r,[i,n,this]):e(i,n,this);if(o===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var a=[],n=this.length;r==null&&(r=n),e==null&&(e=0),e<0&&(e=n+e),r<0&&(r=n+r);for(var i=e;i>=0&&i<r&&i<n;i++)a.push(this[i]);return this.spawn(a)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!it(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(Pc)},zDepth:function(){var e=this[0];if(e){var r=e._private,a=r.group;if(a==="nodes"){var n=r.data.parent?e.parents().size():0;return e.isParent()?n:Ks-1}else{var i=r.source,o=r.target,s=i.zDepth(),u=o.zDepth();return Math.max(s,u,0)}}}};ai.each=ai.forEach;var Mm=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":dt(Symbol))!=e&&dt(Symbol.iterator)!=e;r&&(ai[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,o=this.length;return Rh({next:function(){return i<o?n.value=a[i++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};Mm();var Rm=Tt({nodeDimensionsIncludeLabels:!1}),Un={layoutDimensions:function(e){e=Rm(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();r={w:a.w,h:a.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,a){var n=this.nodes().filter(function(T){return!T.isParent()}),i=this.cy(),o=r.eles,s=function(D){return D.id()},u=pa(a,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(D,x,N){var O={x:x.x1+x.w/2,y:x.y1+x.h/2},R={x:(N.x-O.x)*D,y:(N.y-O.y)*D};return{x:O.x+R.x,y:O.y+R.y}},f=r.spacingFactor&&r.spacingFactor!==1,h=function(){if(!f)return null;for(var D=Rt(),x=0;x<n.length;x++){var N=n[x],O=u(N,x);Qh(D,O.x,O.y)}return D},v=h(),c=pa(function(T,D){var x=u(T,D);if(f){var N=Math.abs(r.spacingFactor);x=l(N,v,x)}return r.transform!=null&&(x=r.transform(T,x)),x},s);if(r.animate){for(var d=0;d<n.length;d++){var p=n[d],y=c(p,d),g=r.animateFilter==null||r.animateFilter(p,d);if(g){var b=p.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else p.position(y)}if(r.fit){var m=i.animation({fit:{boundingBox:o.boundingBoxAt(c),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(m)}else if(r.zoom!==void 0&&r.pan!==void 0){var w=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}e.animations.forEach(function(T){return T.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Ca.all(e.animations.map(function(T){return T.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(c),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Ie({},e,{eles:this}))}};Un.createLayout=Un.makeLayout=Un.layout;function Ic(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],i;return(i=n[t])!=null||(i=n[t]=e(r)),i}function Si(t,e){return t=Yr(t),function(a){return Ic(t,e,a)}}function Di(t,e){t=Yr(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return Ic(t,r,n)}}var Et={recalculateRenderedStyle:function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var a;a=this.spawnSelf().merge(this.descendants()).merge(this.parents()),a.merge(a.connectedEdges()),a.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var a=r._private.batchStyleEles;return a.merge(this),this}var n=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),n&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var a=this[r];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(r?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var a=r.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=this[0];if(a)return r.style().getRenderedStyle(a,e)},style:function(e,r){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(_e(e)){var o=e;i.applyBypass(this,o,n),this.emitAndNotify("style")}else if(Me(e))if(r===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];n.removeAllBypasses(s,a)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];n.removeBypasses(l,e,a)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!r)return i;var o=n.data.parent?a.parents():null;if(o)for(var s=0;s<o.length;s++){var u=o[s],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],a=r.cy().hasCompoundNodes();if(r)return a?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function as(t,e){var r=t._private,a=r.data.parent?t.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function su(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,a=t.parentOk||t.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],o=n.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||as(i,a);var u=s.source,l=s.target;return r(u)&&(!o||as(u,r))&&(u===l||r(l)&&(!o||as(l,r)))}}}var Sa=Si("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Et.takesUpSpace=Di("takesUpSpace",su({ok:Sa}));var Om=Si("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Sa(t)}),Pm=Si("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Sa(t)});Et.interactive=Di("interactive",su({ok:Om,parentOk:Pm,edgeOkViaNode:Sa}));Et.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var Im=Si("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Sa(t)}),km=Sa;Et.visible=Di("visible",su({ok:Im,edgeOkViaNode:km}));Et.hidden=function(){var t=this[0];if(t)return!t.visible()};Et.isBundledBezier=Di("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Et.bypass=Et.css=Et.style;Et.renderedCss=Et.renderedStyle;Et.removeBypass=Et.removeCss=Et.removeStyle;Et.pstyle=Et.parsedStyle;var mr={};function wf(t){return function(){var e=arguments,r=[];if(e.length===2){var a=e[0],n=e[1];this.on(t.event,a,n)}else if(e.length===1&&it(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Je(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var u=this[s],l=!t.ableField||u._private[t.ableField],f=u._private[t.field]!=t.value;if(t.overrideAble){var h=t.overrideAble(u);if(h!==void 0&&(l=h,!h))return this}l&&(u._private[t.field]=t.value,f&&r.push(u))}var v=this.spawn(r);v.updateStyle(),v.emit(t.event),o&&v.emit(o)}return this}}function Da(t){mr[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},mr[t.on]=wf({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),mr[t.off]=wf({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Da({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Da({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Da({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Da({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});mr.deselect=mr.unselect;mr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Da({field:"active",on:"activate",off:"unactivate"});Da({field:"pannable",on:"panify",off:"unpanify"});mr.inactive=function(){var t=this[0];if(t)return!t._private.active};var St={},Ef=function(e){return function(a){for(var n=this,i=[],o=0;o<n.length;o++){var s=n[o];if(s.isNode()){for(var u=!1,l=s.connectedEdges(),f=0;f<l.length;f++){var h=l[f],v=h.source(),c=h.target();if(e.noIncomingEdges&&c===s&&v!==s||e.noOutgoingEdges&&v===s&&c!==s){u=!0;break}}u||i.push(s)}}return this.spawn(i,!0).filter(a)}},xf=function(e){return function(r){for(var a=this,n=[],i=0;i<a.length;i++){var o=a[i];if(o.isNode())for(var s=o.connectedEdges(),u=0;u<s.length;u++){var l=s[u],f=l.source(),h=l.target();e.outgoing&&f===o?(n.push(l),n.push(h)):e.incoming&&h===o&&(n.push(l),n.push(f))}}return this.spawn(n,!0).filter(r)}},Tf=function(e){return function(r){for(var a=this,n=[],i={};;){var o=e.outgoing?a.outgoers():a.incomers();if(o.length===0)break;for(var s=!1,u=0;u<o.length;u++){var l=o[u],f=l.id();i[f]||(i[f]=!0,n.push(l),s=!0)}if(!s)break;a=o}return this.spawn(n,!0).filter(r)}};St.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Ie(St,{roots:Ef({noIncomingEdges:!0}),leaves:Ef({noOutgoingEdges:!0}),outgoers:Gt(xf({outgoing:!0}),"outgoers"),successors:Tf({outgoing:!0}),incomers:Gt(xf({incoming:!0}),"incomers"),predecessors:Tf({})});Ie(St,{neighborhood:Gt(function(t){for(var e=[],r=this.nodes(),a=0;a<r.length;a++)for(var n=r[a],i=n.connectedEdges(),o=0;o<i.length;o++){var s=i[o],u=s.source(),l=s.target(),f=n===u?l:u;f.length>0&&e.push(f[0]),e.push(s[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});St.neighbourhood=St.neighborhood;St.closedNeighbourhood=St.closedNeighborhood;St.openNeighbourhood=St.openNeighborhood;Ie(St,{source:Gt(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"source"),target:Gt(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"target"),sources:Cf({attr:"source"}),targets:Cf({attr:"target"})});function Cf(t){return function(r){for(var a=[],n=0;n<this.length;n++){var i=this[n],o=i._private[t.attr];o&&a.push(o)}return this.spawn(a,!0).filter(r)}}Ie(St,{edgesWith:Gt(Sf(),"edgesWith"),edgesTo:Gt(Sf({thisIsSrc:!0}),"edgesTo")});function Sf(t){return function(r){var a=[],n=this._private.cy,i=t||{};Me(r)&&(r=n.$(r));for(var o=0;o<r.length;o++)for(var s=r[o]._private.edges,u=0;u<s.length;u++){var l=s[u],f=l._private.data,h=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),v=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),c=h||v;c&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!h||i.thisIsTgt&&!v)||a.push(l))}return this.spawn(a,!0)}}Ie(St,{connectedEdges:Gt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];if(n.isNode())for(var i=n._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Gt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Gt(Df(),"parallelEdges"),codirectedEdges:Gt(Df({codirected:!0}),"codirectedEdges")});function Df(t){var e={codirected:!1};return t=Ie({},e,t),function(a){for(var n=[],i=this.edges(),o=t,s=0;s<i.length;s++)for(var u=i[s],l=u._private,f=l.source,h=f._private.data.id,v=l.data.target,c=f._private.edges,d=0;d<c.length;d++){var p=c[d],y=p._private.data,g=y.target,b=y.source,m=g===v&&b===h,w=h===g&&v===b;(o.codirected&&m||!o.codirected&&(m||w))&&n.push(p)}return this.spawn(n,!0).filter(a)}}Ie(St,{components:function(e){var r=this,a=r.cy(),n=a.collection(),i=e==null?r.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(f,h){n.merge(f),i.unmerge(f),h.merge(f)};if(i.empty())return r.spawn();var u=function(){var f=a.collection();o.push(f);var h=i[0];s(h,f),r.bfs({directed:!1,roots:h,visit:function(c){return s(c,f)}}),f.forEach(function(v){v.connectedEdges().forEach(function(c){r.has(c)&&f.has(c.source())&&f.has(c.target())&&f.merge(c)})})};do u();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});St.componentsOf=St.components;var xt=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){nt("A collection must have a reference to the core");return}var i=new nr,o=!1;if(!r)r=[];else if(r.length>0&&_e(r[0])&&!un(r[0])){o=!0;for(var s=[],u=new Ta,l=0,f=r.length;l<f;l++){var h=r[l];h.data==null&&(h.data={});var v=h.data;if(v.id==null)v.id=$h();else if(e.hasElementWithId(v.id)||u.has(v.id))continue;var c=new pi(e,h,!1);s.push(c),u.add(v.id)}r=s}this.length=0;for(var d=0,p=r.length;d<p;d++){var y=r[d][0];if(y!=null){var g=y._private.data.id;(!a||!i.has(g))&&(a&&i.set(g,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var m=this.lazyMap=new nr,w=this.eles,T=0;T<w.length;T++){var D=w[T];m.set(D.id(),{index:T,ele:D})}}},a&&(this._private.map=i),o&&!n&&this.restore()},et=pi.prototype=xt.prototype=Object.create(Array.prototype);et.instanceString=function(){return"collection"};et.spawn=function(t,e){return new xt(this.cy(),t,e)};et.spawnSelf=function(){return this.spawn(this)};et.cy=function(){return this._private.cy};et.renderer=function(){return this._private.cy.renderer()};et.element=function(){return this[0]};et.collection=function(){return Ih(this)?this:new xt(this._private.cy,[this])};et.unique=function(){return new xt(this._private.cy,this,!0)};et.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};et.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new xt(e)};et.$id=et.getElementById;et.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};et.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};et.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};et.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var a=e._private;if(_e(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var i=!1,o={},s=t.data.source,u=t.data.target;s!=null&&s!=n.source&&(o.source=""+s,i=!0),u!=null&&u!=n.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var l="parent"in t.data,f=t.data.parent;l&&(f!=null||n.parent!=null)&&f!=n.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var h=function(p,y,g){var b=t[p];b!=null&&b!==a[p]&&(b?e[y]():e[g]())};return h("removed","remove","restore"),h("selected","select","unselect"),h("selectable","selectify","unselectify"),h("locked","lock","unlock"),h("grabbable","grabify","ungrabify"),h("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var v={data:Qt(a.data),position:Qt(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};v.classes="";var c=0;return a.classes.forEach(function(d){return v.classes+=c++===0?d:" "+d}),v}}};et.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t};et.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var a=this[r],n=a.json(),i=new pi(t,n,!1);e.push(i)}return new xt(t,e)};et.copy=et.clone;et.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,i=[],o=[],s,u=0,l=r.length;u<l;u++){var f=r[u];e&&!f.removed()||(f.isNode()?i.push(f):o.push(f))}s=i.concat(o);var h,v=function(){s.splice(h,1),h--};for(h=0;h<s.length;h++){var c=s[h],d=c._private,p=d.data;if(c.clearTraversalCache(),!(!e&&!d.removed)){if(p.id===void 0)p.id=$h();else if(be(p.id))p.id=""+p.id;else if(br(p.id)||!Me(p.id)){nt("Can not create element with invalid string ID `"+p.id+"`"),v();continue}else if(a.hasElementWithId(p.id)){nt("Can not create second element with ID `"+p.id+"`"),v();continue}}var y=p.id;if(c.isNode()){var g=d.position;g.x==null&&(g.x=0),g.y==null&&(g.y=0)}if(c.isEdge()){for(var b=c,m=["source","target"],w=m.length,T=!1,D=0;D<w;D++){var x=m[D],N=p[x];be(N)&&(N=p[x]=""+p[x]),N==null||N===""?(nt("Can not create edge `"+y+"` with unspecified "+x),T=!0):a.hasElementWithId(N)||(nt("Can not create edge `"+y+"` with nonexistent "+x+" `"+N+"`"),T=!0)}if(T){v();continue}var O=a.getElementById(p.source),R=a.getElementById(p.target);O.same(R)?O._private.edges.push(b):(O._private.edges.push(b),R._private.edges.push(b)),b._private.source=O,b._private.target=R}d.map=new nr,d.map.set(y,{ele:c,index:0}),d.removed=!1,e&&a.addToPool(c)}for(var P=0;P<i.length;P++){var M=i[P],I=M._private.data;be(I.parent)&&(I.parent=""+I.parent);var E=I.parent,A=E!=null;if(A||M._private.parent){var C=M._private.parent?a.collection().merge(M._private.parent):a.getElementById(E);if(C.empty())I.parent=void 0;else if(C[0].removed())Ke("Node added with missing parent, reference to parent removed"),I.parent=void 0,M._private.parent=null;else{for(var S=!1,L=C;!L.empty();){if(M.same(L)){S=!0,I.parent=void 0;break}L=L.parent()}S||(C[0]._private.children.push(M),M._private.parent=C[0],n.hasCompoundNodes=!0)}}}if(s.length>0){for(var V=s.length===r.length?r:new xt(a,s),F=0;F<V.length;F++){var B=V[F];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}var Y;n.hasCompoundNodes?Y=a.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()):Y=V,Y.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?V.emitAndNotify("add"):e&&V.emit("add")}return r};et.removed=function(){var t=this[0];return t&&t._private.removed};et.inside=function(){var t=this[0];return t&&!t._private.removed};et.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function o(E){for(var A=E._private.edges,C=0;C<A.length;C++)u(A[C])}function s(E){for(var A=E._private.children,C=0;C<A.length;C++)u(A[C])}function u(E){var A=n[E.id()];e&&E.removed()||A||(n[E.id()]=!0,E.isNode()?(a.push(E),o(E),s(E)):a.unshift(E))}for(var l=0,f=r.length;l<f;l++){var h=r[l];u(h)}function v(E,A){var C=E._private.edges;wr(C,A),E.clearTraversalCache()}function c(E){E.clearTraversalCache()}var d=[];d.ids={};function p(E,A){A=A[0],E=E[0];var C=E._private.children,S=E.id();wr(C,A),A._private.parent=null,d.ids[S]||(d.ids[S]=!0,d.push(E))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var y=0;y<a.length;y++){var g=a[y];if(g.isEdge()){var b=g.source()[0],m=g.target()[0];v(b,g),v(m,g);for(var w=g.parallelEdges(),T=0;T<w.length;T++){var D=w[T];c(D),D.isBundledBezier()&&D.dirtyBoundingBoxCache()}}else{var x=g.parent();x.length!==0&&p(x,g)}e&&(g._private.removed=!0)}var N=i._private.elements;i._private.hasCompoundNodes=!1;for(var O=0;O<N.length;O++){var R=N[O];if(R.isParent()){i._private.hasCompoundNodes=!0;break}}var P=new xt(this.cy(),a);P.size()>0&&(t?P.emitAndNotify("remove"):e&&P.emit("remove"));for(var M=0;M<d.length;M++){var I=d[M];(!e||!I.removed())&&I.updateStyle()}return P};et.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,i=function(d){return d==null?d:""+d};if(t.source!==void 0||t.target!==void 0){var o=i(t.source),s=i(t.target),u=o!=null&&e.hasElementWithId(o),l=s!=null&&e.hasElementWithId(s);(u||l)&&(e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var c=0;c<r.length;c++){var d=r[c],p=d._private.data;d.isEdge()&&(u&&(p.source=o),l&&(p.target=s))}r.restore(a,n)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=i(t.parent),h=f===null||e.hasElementWithId(f);if(h){var v=f===null?void 0:f;e.batch(function(){var c=r.remove(a,n);c.emitAndNotify("moveout");for(var d=0;d<r.length;d++){var p=r[d],y=p._private.data;p.isNode()&&(y.parent=v)}c.restore(a,n)}),r.emitAndNotify("move")}}return this};[oc,_y,Gn,yr,ma,sm,Ti,Cm,Rc,Oc,Nm,ai,Un,Et,mr,St].forEach(function(t){Ie(et,t)});var Bm={add:function(e){var r,a=this;if(Bt(e)){var n=e;if(n._private.cy===a)r=n.restore();else{for(var i=[],o=0;o<n.length;o++){var s=n[o];i.push(s.json())}r=new xt(a,i)}}else if(Je(e)){var u=e;r=new xt(a,u)}else if(_e(e)&&(Je(e.nodes)||Je(e.edges))){for(var l=e,f=[],h=["nodes","edges"],v=0,c=h.length;v<c;v++){var d=h[v],p=l[d];if(Je(p))for(var y=0,g=p.length;y<g;y++){var b=Ie({group:d},p[y]);f.push(b)}}r=new xt(a,f)}else{var m=e;r=new pi(a,m).collection()}return r},remove:function(e){if(!Bt(e)){if(Me(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Fm(t,e,r,a){var n=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var h=0;h<4;++h)if(typeof arguments[h]!="number"||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var v=f?new Float32Array(u):new Array(u);function c(R,P){return 1-3*P+3*R}function d(R,P){return 3*P-6*R}function p(R){return 3*R}function y(R,P,M){return((c(P,M)*R+d(P,M))*R+p(P))*R}function g(R,P,M){return 3*c(P,M)*R*R+2*d(P,M)*R+p(P)}function b(R,P){for(var M=0;M<n;++M){var I=g(P,t,r);if(I===0)return P;var E=y(P,t,r)-R;P-=E/I}return P}function m(){for(var R=0;R<u;++R)v[R]=y(R*l,t,r)}function w(R,P,M){var I,E,A=0;do E=P+(M-P)/2,I=y(E,t,r)-R,I>0?M=E:P=E;while(Math.abs(I)>o&&++A<s);return E}function T(R){for(var P=0,M=1,I=u-1;M!==I&&v[M]<=R;++M)P+=l;--M;var E=(R-v[M])/(v[M+1]-v[M]),A=P+E*l,C=g(A,t,r);return C>=i?b(R,A):C===0?A:w(R,P,P+l)}var D=!1;function x(){D=!0,(t!==e||r!==a)&&m()}var N=function(P){return D||x(),t===e&&r===a?P:P===0?0:P===1?1:y(T(P),e,a)};N.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var O="generateBezier("+[t,e,r,a]+")";return N.toString=function(){return O},N}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var zm=(function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var o={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:o.v,dv:t(o)}}function r(a,n){var i={dx:a.v,dv:t(a)},o=e(a,n*.5,i),s=e(a,n*.5,o),u=e(a,n,s),l=1/6*(i.dx+2*(o.dx+s.dx)+u.dx),f=1/6*(i.dv+2*(o.dv+s.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+f*n,a}return function a(n,i,o){var s={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,h=16/1e3,v,c,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,o=o||null,s.tension=n,s.friction=i,v=o!==null,v?(l=a(n,i),c=l/o*h):c=h;d=r(d||s,c),u.push(1+d.x),l+=16,Math.abs(d.x)>f&&Math.abs(d.v)>f;);return v?function(p){return u[p*(u.length-1)|0]}:l}})(),je=function(e,r,a,n){var i=Fm(e,r,a,n);return function(o,s,u){return o+(s-o)*i(u)}},Hn={linear:function(e,r,a){return e+(r-e)*a},ease:je(.25,.1,.25,1),"ease-in":je(.42,0,1,1),"ease-out":je(0,0,.58,1),"ease-in-out":je(.42,0,.58,1),"ease-in-sine":je(.47,0,.745,.715),"ease-out-sine":je(.39,.575,.565,1),"ease-in-out-sine":je(.445,.05,.55,.95),"ease-in-quad":je(.55,.085,.68,.53),"ease-out-quad":je(.25,.46,.45,.94),"ease-in-out-quad":je(.455,.03,.515,.955),"ease-in-cubic":je(.55,.055,.675,.19),"ease-out-cubic":je(.215,.61,.355,1),"ease-in-out-cubic":je(.645,.045,.355,1),"ease-in-quart":je(.895,.03,.685,.22),"ease-out-quart":je(.165,.84,.44,1),"ease-in-out-quart":je(.77,0,.175,1),"ease-in-quint":je(.755,.05,.855,.06),"ease-out-quint":je(.23,1,.32,1),"ease-in-out-quint":je(.86,0,.07,1),"ease-in-expo":je(.95,.05,.795,.035),"ease-out-expo":je(.19,1,.22,1),"ease-in-out-expo":je(1,0,0,1),"ease-in-circ":je(.6,.04,.98,.335),"ease-out-circ":je(.075,.82,.165,1),"ease-in-out-circ":je(.785,.135,.15,.86),spring:function(e,r,a){if(a===0)return Hn.linear;var n=zm(e,r,a);return function(i,o,s){return i+(o-i)*n(s)}},"cubic-bezier":je};function Af(t,e,r,a,n){if(a===1||e===r)return r;var i=n(e,r,a);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function Lf(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ta(t,e,r,a,n){var i=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var o=Lf(t,n),s=Lf(e,n);if(be(o)&&be(s))return Af(i,o,s,r,a);if(Je(o)&&Je(s)){for(var u=[],l=0;l<s.length;l++){var f=o[l],h=s[l];if(f!=null&&h!=null){var v=Af(i,f,h,r,a);u.push(v)}else u.push(h)}return u}}function Vm(t,e,r,a){var n=!a,i=t._private,o=e._private,s=o.easing,u=o.startTime,l=a?t:t.cy(),f=l.style();if(!o.easingImpl)if(s==null)o.easingImpl=Hn.linear;else{var h;if(Me(s)){var v=f.parse("transition-timing-function",s);h=v.value}else h=s;var c,d;Me(h)?(c=h,d=[]):(c=h[1],d=h.slice(2).map(function(V){return+V})),d.length>0?(c==="spring"&&d.push(o.duration),o.easingImpl=Hn[c].apply(null,d)):o.easingImpl=Hn[c]}var p=o.easingImpl,y;if(o.duration===0?y=1:y=(r-u)/o.duration,o.applying&&(y=o.progress),y<0?y=0:y>1&&(y=1),o.delay==null){var g=o.startPosition,b=o.position;if(b&&n&&!t.locked()){var m={};Fa(g.x,b.x)&&(m.x=ta(g.x,b.x,y,p)),Fa(g.y,b.y)&&(m.y=ta(g.y,b.y,y,p)),t.position(m)}var w=o.startPan,T=o.pan,D=i.pan,x=T!=null&&a;x&&(Fa(w.x,T.x)&&(D.x=ta(w.x,T.x,y,p)),Fa(w.y,T.y)&&(D.y=ta(w.y,T.y,y,p)),t.emit("pan"));var N=o.startZoom,O=o.zoom,R=O!=null&&a;R&&(Fa(N,O)&&(i.zoom=Qa(i.minZoom,ta(N,O,y,p),i.maxZoom)),t.emit("zoom")),(x||R)&&t.emit("viewport");var P=o.style;if(P&&P.length>0&&n){for(var M=0;M<P.length;M++){var I=P[M],E=I.name,A=I,C=o.startStyle[E],S=f.properties[C.name],L=ta(C,A,y,p,S);f.overrideBypass(t,E,L)}t.emit("style")}}return o.progress=y,y}function Fa(t,e){return t==null||e==null?!1:be(t)&&be(e)?!0:!!(t&&e)}function Gm(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function Nf(t,e){var r=e._private.aniEles,a=[];function n(f,h){var v=f._private,c=v.animation.current,d=v.animation.queue,p=!1;if(c.length===0){var y=d.shift();y&&c.push(y)}for(var g=function(D){for(var x=D.length-1;x>=0;x--){var N=D[x];N()}D.splice(0,D.length)},b=c.length-1;b>=0;b--){var m=c[b],w=m._private;if(w.stopped){c.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||Gm(f,m,t),Vm(f,m,t,h),w.applying&&(w.applying=!1),g(w.frames),w.step!=null&&w.step(t),m.completed()&&(c.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.completes)),p=!0)}return!h&&c.length===0&&d.length===0&&a.push(f),p}for(var i=!1,o=0;o<r.length;o++){var s=r[o],u=n(s);i=i||u}var l=n(e,!0);(i||l)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}var Um={animate:$e.animate(),animation:$e.animation(),animated:$e.animated(),clearQueue:$e.clearQueue(),delay:$e.delay(),delayAnimation:$e.delayAnimation(),stop:$e.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Jn(function(i){Nf(i,e),r()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,o){Nf(o,e)},a.beforeRenderPriorities.animations):r()}},Hm={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&un(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e}},On=function(e){return Me(e)?new xr(e):e},kc={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ci(Hm,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,On(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,On(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,On(r),a),this},once:function(e,r,a){return this.emitter().one(e,On(r),a),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};$e.eventAliasesOn(kc);var Rs={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};Rs.jpeg=Rs.jpg;var Yn={layout:function(e){var r=this;if(e==null){nt("Layout options must be specified to make a layout");return}if(e.name==null){nt("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){nt("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Me(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new n(Ie({},e,{cy:r,eles:i}));return o}};Yn.createLayout=Yn.makeLayout=Yn.layout;var Ym={notify:function(e,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();r!=null&&n.merge(r);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?r.notify(a):r.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],o=e[i],s=r.getElementById(i);s.data(o)}})}},qm=Tt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),Os={renderTo:function(e,r,a,n){var i=this._private.renderer;return i.renderTo(e,r,a,n),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,a=r.extension("renderer",e.name);if(a==null){nt("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Ke("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=qm(e);n.cy=r,r._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Os.invalidateDimensions=Os.resize;var qn={collection:function(e,r){return Me(e)?this.$(e):Bt(e)?e.collection():Je(e)?(r||(r={}),new xt(this,e,r.unique,r.removed)):new xt(this)},nodes:function(e){var r=this.$(function(a){return a.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(a){return a.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};qn.elements=qn.filter=qn.$;var wt={},_a="t",_m="f";wt.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),i=0;i<t.length;i++){var o=t[i],s=e.getContextMeta(o);if(!s.empty){var u=e.getContextStyle(s),l=e.applyContextStyle(s,u,o);o._private.appliedInitStyle?e.updateTransitions(o,l.diffProps):o._private.appliedInitStyle=!0;var f=e.updateStyleHints(o);f&&n.push(o)}}return n};wt.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,i=a[n];if(i)return i;for(var o=[],s={},u=0;u<r.length;u++){var l=r[u],f=t[u]===_a,h=e[u]===_a,v=f!==h,c=l.mappedProperties.length>0;if(v||h&&c){var d=void 0;v&&c||v?d=l.properties:c&&(d=l.mappedProperties);for(var p=0;p<d.length;p++){for(var y=d[p],g=y.name,b=!1,m=u+1;m<r.length;m++){var w=r[m],T=e[m]===_a;if(T&&(b=w.properties[y.name]!=null,b))break}!s[g]&&!b&&(s[g]=!0,o.push(g))}}}return a[n]=o,o};wt.getContextMeta=function(t){for(var e=this,r="",a,n=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(t);s?r+=_a:r+=_m}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};wt.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<r.length;i++){var o=r[i],s=e[i]===_a;if(s)for(var u=0;u<o.properties.length;u++){var l=o.properties[u];n[l.name]=l}}return a[e]=n,n};wt.applyContextStyle=function(t,e,r){for(var a=this,n=t.diffPropNames,i={},o=a.types,s=0;s<n.length;s++){var u=n[s],l=e[u],f=r.pstyle(u);if(!l)if(f)f.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(f!==l){if(l.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var h=f.mapping,v=h.fnValue=l.value(r);if(v===h.prevFnValue)continue}var c=i[u]={prev:f};a.applyParsedProperty(r,l),c.next=r.pstyle(u),c.next&&c.next.bypass&&(c.next=c.next.bypassed)}}return{diffProps:i}};wt.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,i=function(W,J,te){return r.getPropertiesHash(W,J,te)},o=e.styleKey;if(t.removed())return!1;var s=e.group==="nodes",u=t._private.style;a=Object.keys(u);for(var l=0;l<n.length;l++){var f=n[l];e.styleKeys[f]=[Fr,sa]}for(var h=function(W,J){return e.styleKeys[J][0]=$a(W,e.styleKeys[J][0])},v=function(W,J){return e.styleKeys[J][1]=Ka(W,e.styleKeys[J][1])},c=function(W,J){h(W,J),v(W,J)},d=function(W,J){for(var te=0;te<W.length;te++){var de=W.charCodeAt(te);h(de,J),v(de,J)}},p=2e9,y=function(W){return-128<W&&W<128&&Math.floor(W)!==W?p-(W*1024|0):W},g=0;g<a.length;g++){var b=a[g],m=u[b];if(m!=null){var w=this.properties[b],T=w.type,D=w.groupKey,x=void 0;w.hashOverride!=null?x=w.hashOverride(t,m):m.pfValue!=null&&(x=m.pfValue);var N=w.enums==null?m.value:null,O=x!=null,R=N!=null,P=O||R,M=m.units;if(T.number&&P&&!T.multiple){var I=O?x:N;c(y(I),D),!O&&M!=null&&d(M,D)}else d(m.strValue,D)}}for(var E=[Fr,sa],A=0;A<n.length;A++){var C=n[A],S=e.styleKeys[C];E[0]=$a(S[0],E[0]),E[1]=Ka(S[1],E[1])}e.styleKey=og(E[0],E[1]);var L=e.styleKeys;e.labelDimsKey=hr(L.labelDimensions);var V=i(t,["label"],L.labelDimensions);if(e.labelKey=hr(V),e.labelStyleKey=hr(Cn(L.commonLabel,V)),!s){var F=i(t,["source-label"],L.labelDimensions);e.sourceLabelKey=hr(F),e.sourceLabelStyleKey=hr(Cn(L.commonLabel,F));var B=i(t,["target-label"],L.labelDimensions);e.targetLabelKey=hr(B),e.targetLabelStyleKey=hr(Cn(L.commonLabel,B))}if(s){var Y=e.styleKeys,q=Y.nodeBody,Q=Y.nodeBorder,$=Y.nodeOutline,K=Y.backgroundImage,j=Y.compound,re=Y.pie,U=Y.stripe,H=[q,Q,$,K,j,re,U].filter(function(_){return _!=null}).reduce(Cn,[Fr,sa]);e.nodeKey=hr(H),e.hasPie=re!=null&&re[0]!==Fr&&re[1]!==sa,e.hasStripe=U!=null&&U[0]!==Fr&&U[1]!==sa}return o!==e.styleKey};wt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};wt.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,i,o=r.types,s=r.properties[a.name].type,u=a.bypass,l=n[a.name],f=l&&l.bypass,h=t._private,v="mapping",c=function(q){return q==null?null:q.pfValue!=null?q.pfValue:q.value},d=function(){var q=c(l),Q=c(a);r.checkTriggers(t,a.name,q,Q)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(a=e=this.parse(e.name,"bezier",u)),a.delete)return n[a.name]=void 0,d(),!0;if(a.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,d(),!0):!1:(d(),!0);if(a.deleteBypass)return l?l.bypass?(n[a.name]=l.bypassed,d(),!0):!1:(d(),!0);var p=function(){Ke("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case o.mapData:{for(var y=a.field.split("."),g=h.data,b=0;b<y.length&&g;b++){var m=y[b];g=g[m]}if(g==null)return p(),!1;var w;if(be(g)){var T=a.fieldMax-a.fieldMin;T===0?w=0:w=(g-a.fieldMin)/T}else return Ke("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+g+"` for `"+t.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),s.color){var D=a.valueMin[0],x=a.valueMax[0],N=a.valueMin[1],O=a.valueMax[1],R=a.valueMin[2],P=a.valueMax[2],M=a.valueMin[3]==null?1:a.valueMin[3],I=a.valueMax[3]==null?1:a.valueMax[3],E=[Math.round(D+(x-D)*w),Math.round(N+(O-N)*w),Math.round(R+(P-R)*w),Math.round(M+(I-M)*w)];i={bypass:a.bypass,name:a.name,value:E,strValue:"rgb("+E[0]+", "+E[1]+", "+E[2]+")"}}else if(s.number){var A=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,A,a.bypass,v)}else return!1;if(!i)return p(),!1;i.mapping=a,a=i;break}case o.data:{for(var C=a.field.split("."),S=h.data,L=0;L<C.length&&S;L++){var V=C[L];S=S[V]}if(S!=null&&(i=this.parse(a.name,S,a.bypass,v)),!i)return p(),!1;i.mapping=a,a=i;break}case o.fn:{var F=a.value,B=a.fnValue!=null?a.fnValue:F(t);if(a.prevFnValue=B,B==null)return Ke("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,B,a.bypass,v),!i)return Ke("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Qt(a),a=i;break}case void 0:break;default:return!1}return u?(f?a.bypassed=l.bypassed:a.bypassed=l,n[a.name]=a):f?l.bypassed=a:n[a.name]=a,d(),!0};wt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],u=n[s];u!=null&&(u.bypass?u.bypassed=null:n[s]=null)}}};wt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};wt.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var s={},u=!1,l=0;l<n.length;l++){var f=n[l],h=t.pstyle(f),v=e[f];if(v){var c=v.prev,d=c,p=v.next!=null?v.next:h,y=!1,g=void 0,b=1e-6;d&&(be(d.pfValue)&&be(p.pfValue)?(y=p.pfValue-d.pfValue,g=d.pfValue+b*y):be(d.value)&&be(p.value)?(y=p.value-d.value,g=d.value+b*y):Je(d.value)&&Je(p.value)&&(y=d.value[0]!==p.value[0]||d.value[1]!==p.value[1]||d.value[2]!==p.value[2],g=d.strValue),y&&(s[f]=p.strValue,this.applyBypass(t,f,g),u=!0))}}if(!u)return;a.transitioning=!0,new Ca(function(m){o>0?t.delayAnimation(o).play().promise().then(m):m()}).then(function(){return t.animation({style:s,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1)};wt.checkTrigger=function(t,e,r,a,n,i){var o=this.properties[e],s=n(o);t.removed()||s!=null&&s(r,a,t)&&i(o)};wt.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};wt.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};wt.checkConnectedEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};wt.checkParallelEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};wt.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a),this.checkConnectedEdgesBoundsTrigger(t,e,r,a),this.checkParallelEdgesBoundsTrigger(t,e,r,a)};var gn={};gn.applyBypass=function(t,e,r,a){var n=this,i=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;s<n.properties.length;s++){var u=n.properties[s],l=u.name,f=this.parse(l,r,!0);f&&i.push(f)}}else if(Me(e)){var h=this.parse(e,r,!0);h&&i.push(h)}else if(_e(e)){var v=e;a=r;for(var c=Object.keys(v),d=0;d<c.length;d++){var p=c[d],y=v[p];if(y===void 0&&(y=v[di(p)]),y!==void 0){var g=this.parse(p,y,!0);g&&i.push(g)}}}else return!1;if(i.length===0)return!1;for(var b=!1,m=0;m<t.length;m++){for(var w=t[m],T={},D=void 0,x=0;x<i.length;x++){var N=i[x];if(a){var O=w.pstyle(N.name);D=T[N.name]={prev:O}}b=this.applyParsedProperty(w,Qt(N))||b,a&&(D.next=w.pstyle(N.name))}b&&this.updateStyleHints(w),a&&this.updateTransitions(w,T,o)}return b};gn.overrideBypass=function(t,e,r){e=Xs(e);for(var a=0;a<t.length;a++){var n=t[a],i=n._private.style[e],o=this.properties[e].type,s=o.color,u=o.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),s?i.strValue="rgb("+r.join(",")+")":u?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,e,l,r)}};gn.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};gn.removeBypasses=function(t,e,r){for(var a=!0,n=0;n<t.length;n++){for(var i=t[n],o={},s=0;s<e.length;s++){var u=e[s],l=this.properties[u],f=i.pstyle(l.name);if(!(!f||!f.bypass)){var h="",v=this.parse(u,h,!0),c=o[l.name]={prev:f};this.applyParsedProperty(i,v),c.next=i.pstyle(l.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,a)}};var uu={};uu.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};uu.containerCss=function(t){var e=this._private.cy,r=e.container(),a=e.window();if(a&&r&&a.getComputedStyle)return a.getComputedStyle(r).getPropertyValue(t)};var jt={};jt.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};jt.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var a={},n=0;n<r.properties.length;n++){var i=r.properties[n],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(a[i.name]=o,a[di(i.name)]=o)}return a}};jt.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n??t.cy().style().getDefaultProperty(e)[r][0]};jt.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,o=t.pstyle(n.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(r&&i.number&&s!=null&&be(s)){var f=t.cy().zoom(),h=function(y){return y*f},v=function(y,g){return h(y)+g},c=Je(s),d=c?u.every(function(p){return p!=null}):u!=null;return d?c?s.map(function(p,y){return v(p,u[y])}).join(" "):v(s,u):c?s.map(function(p){return Me(p)?p:""+h(p)}).join(" "):""+h(s)}else if(l!=null)return l}return null}};jt.getAnimationStartStyle=function(t,e){for(var r={},a=0;a<e.length;a++){var n=e[a],i=n.name,o=t.pstyle(i);o!==void 0&&(_e(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r};jt.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a)for(var i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],u=a[s],l=n[s]||n[Xs(s)],f=this.parse(l.name,u);f&&r.push(f)}return r};jt.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,i,o,s,u,l;for(u=0;u<e.length;u++)if(n=e[u],i=t.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=$a(s,a[0]),a[1]=Ka(s,a[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),a[0]=$a(s,a[0]),a[1]=Ka(s,a[1]);return a};jt.getPropertiesHash=jt.getNonDefaultPropertiesHash;var Ai={};Ai.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var a=t[r],n=a.selector,i=a.style||a.css,o=Object.keys(i);e.selector(n);for(var s=0;s<o.length;s++){var u=o[s],l=i[u];e.css(u,l)}}return e};Ai.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Ai.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],a=r.selector,n=r.properties,i={},o=0;o<n.length;o++){var s=n[o];i[s.name]=s.strValue}t.push({selector:a?a.toString():"core",style:i})}return t};var lu={};lu.appendFromString=function(t){var e=this,r=this,a=""+t,n,i,o;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){a.length>n.length?a=a.substr(n.length):a=""}function u(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){Ke("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=f[0];var h=f[1];if(h!=="core"){var v=new xr(h);if(v.invalid){Ke("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),s();continue}}var c=f[2],d=!1;i=c;for(var p=[];;){var y=i.match(/^\s*$/);if(y)break;var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Ke("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}o=g[0];var b=g[1],m=g[2],w=e.properties[b];if(!w){Ke("Skipping property: Invalid property name in: "+o),u();continue}var T=r.parse(b,m);if(!T){Ke("Skipping property: Invalid property definition in: "+o),u();continue}p.push({name:b,val:m}),u()}if(d){s();break}r.selector(h);for(var D=0;D<p.length;D++){var x=p[D];r.css(x.name,x.val)}s()}return r};lu.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var lt={};(function(){var t=vt,e=zd,r=Gd,a=Ud,n=Hd,i=function(_){return"^"+_+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(_){var W=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+_+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+W+")\\s*\\,\\s*("+W+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];lt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(_,W){switch(_.length){case 2:return W[0]!=="deg"&&W[0]!=="rad"&&W[1]!=="deg"&&W[1]!=="rad";case 1:return Me(_[0])||W[0]==="deg"||W[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(_){var W=_.length;return W===1||W===2||W===4}}};var u={zeroNonZero:function(_,W){return(_==null||W==null)&&_!==W||_==0&&W!=0?!0:_!=0&&W==0},any:function(_,W){return _!=W},emptyNonEmpty:function(_,W){var J=br(_),te=br(W);return J&&!te||!J&&te}},l=lt.types,f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],h=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],v=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],c=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],d=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification},{name:"text-metrics",type:l.textMetrics},{name:"box-select-labels",type:l.bool,triggersBounds:u.any}],p=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any},{name:"box-selection",type:l.boxSelection,triggersZOrder:u.any}],y=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:u.any,triggersBoundsOfParallelEdges:function(_,W,J){return _===W?!1:J.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],g=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],b=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],m=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],w=function(_,W){return W.value==="label"?-_.poolIndex():W.pfValue},T=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],D=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],x=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],N=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],O=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],R=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelEdges:function(_,W){return _===W?!1:_==="bezier"||W==="bezier"}},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],P=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],M=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],I=[];lt.pieBackgroundN=16,I.push({name:"pie-size",type:l.sizeMaybePercent}),I.push({name:"pie-hole",type:l.sizeMaybePercent}),I.push({name:"pie-start-angle",type:l.angle});for(var E=1;E<=lt.pieBackgroundN;E++)I.push({name:"pie-"+E+"-background-color",type:l.color}),I.push({name:"pie-"+E+"-background-size",type:l.percent}),I.push({name:"pie-"+E+"-background-opacity",type:l.zeroOneNumber});var A=[];lt.stripeBackgroundN=16,A.push({name:"stripe-size",type:l.sizeMaybePercent}),A.push({name:"stripe-direction",type:l.axisDirectionPrimary});for(var C=1;C<=lt.stripeBackgroundN;C++)A.push({name:"stripe-"+C+"-background-color",type:l.color}),A.push({name:"stripe-"+C+"-background-size",type:l.percent}),A.push({name:"stripe-"+C+"-background-opacity",type:l.zeroOneNumber});var S=[],L=lt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach(function(H){L.forEach(function(_){var W=_+"-"+H.name,J=H.type,te=H.triggersBounds;S.push({name:W,type:J,triggersBounds:te})})},{});var V=lt.properties=[].concat(p,m,y,g,b,P,d,c,f,h,v,T,D,x,N,I,A,O,R,S,M),F=lt.propertyGroups={behavior:p,transition:m,visibility:y,overlay:g,underlay:b,ghost:P,commonLabel:d,labelDimensions:c,mainLabel:f,sourceLabel:h,targetLabel:v,nodeBody:T,nodeBorder:D,nodeOutline:x,backgroundImage:N,pie:I,stripe:A,compound:O,edgeLine:R,edgeArrow:S,core:M},B=lt.propertyGroupNames={},Y=lt.propertyGroupKeys=Object.keys(F);Y.forEach(function(H){B[H]=F[H].map(function(_){return _.name}),F[H].forEach(function(_){return _.groupKey=H})});var q=lt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];lt.propertyNames=V.map(function(H){return H.name});for(var Q=0;Q<V.length;Q++){var $=V[Q];V[$.name]=$}for(var K=0;K<q.length;K++){var j=q[K],re=V[j.pointsTo],U={name:j.name,alias:!0,pointsTo:re};V.push(U),V[j.name]=U}})();lt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};lt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Ie({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var f=1;f<=lt.pieBackgroundN;f++){var h=l.name.replace("{{i}}",f),v=l.value;u[h]=v}return u},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var f=1;f<=lt.stripeBackgroundN;f++){var h=l.name.replace("{{i}}",f),v=l.value;u[h]=v}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,l){return lt.arrowPrefixes.forEach(function(f){var h=f+"-"+l.name,v=l.value;u[h]=v}),u},{})),r={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,o=e[i],s=this.parse(i,o);r[i]=s}}return t.defaultProperties=r,t.defaultProperties};lt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Li={};Li.parse=function(t,e,r,a){var n=this;if(it(e))return n.parseImplWarn(t,e,r,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,o=r?"t":"f",s=""+e,u=_h(t,s,o,i),l=n.propCache=n.propCache||[],f;return(f=l[u])||(f=l[u]=n.parseImplWarn(t,e,r,a)),(r||a==="mapping")&&(f=Qt(f),f&&(f.value=Qt(f.value))),f};Li.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);return!n&&e!=null&&Ke("The style property `".concat(t,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Ke("The style value of `label` is deprecated for `"+n.name+"`"),n};Li.parseImpl=function(t,e,r,a){var n=this;t=Xs(t);var i=n.properties[t],o=e,s=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=Me(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(it(e))return{name:t,value:e,strValue:"fn",mapped:s.fn,bypass:r};var f,h;if(!(!u||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(s.data.regex).exec(e))){if(r)return!1;var v=s.data;return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(h=new RegExp(s.mapData.regex).exec(e))){if(r||l.multiple)return!1;var c=s.mapData;if(!(l.color||l.number))return!1;var d=this.parse(t,h[4]);if(!d||d.mapped)return!1;var p=this.parse(t,h[5]);if(!p||p.mapped)return!1;if(d.pfValue===p.pfValue||d.strValue===p.strValue)return Ke("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+d.strValue+"`"),this.parse(t,d.strValue);if(l.color){var y=d.value,g=p.value,b=y[0]===g[0]&&y[1]===g[1]&&y[2]===g[2]&&(y[3]===g[3]||(y[3]==null||y[3]===1)&&(g[3]==null||g[3]===1));if(b)return!1}return{name:t,value:h,strValue:""+e,mapped:c,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:d.value,valueMax:p.value,bypass:r}}}if(l.multiple&&a!=="multiple"){var m;if(u?m=e.split(/\s+/):Je(e)?m=e:m=[e],l.evenMultiple&&m.length%2!==0)return null;for(var w=[],T=[],D=[],x="",N=!1,O=0;O<m.length;O++){var R=n.parse(t,m[O],r,"multiple");N=N||Me(R.value),w.push(R.value),D.push(R.pfValue!=null?R.pfValue:R.value),T.push(R.units),x+=(O>0?" ":"")+R.strValue}return l.validate&&!l.validate(w,T)?null:l.singleEnum&&N?w.length===1&&Me(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:D,strValue:x,bypass:r,units:T}}var P=function(){for(var U=0;U<l.enums.length;U++){var H=l.enums[U];if(H===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(l.number){var M,I="px";if(l.units&&(M=l.units),l.implicitUnits&&(I=l.implicitUnits),!l.unitless)if(u){var E="px|em"+(l.allowPercent?"|\\%":"");M&&(E=M);var A=e.match("^("+vt+")("+E+")?$");A&&(e=A[1],M=A[2]||I)}else(!M||l.implicitUnits)&&(M=I);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=o,P();if(l.integer&&!Rd(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var C={name:t,value:e,strValue:""+e+(M||""),units:M,bypass:r};return l.unitless||M!=="px"&&M!=="em"?C.pfValue=e:C.pfValue=M==="px"||!M?e:this.getEmSizeInPixels()*e,(M==="ms"||M==="s")&&(C.pfValue=M==="ms"?e:1e3*e),(M==="deg"||M==="rad")&&(C.pfValue=M==="rad"?e:Ug(e)),M==="%"&&(C.pfValue=e/100),C}else if(l.propList){var S=[],L=""+e;if(L!=="none"){for(var V=L.split(/\s*,\s*|\s+/),F=0;F<V.length;F++){var B=V[F].trim();n.properties[B]?S.push(B):Ke("`"+B+"` is not a valid property name")}if(S.length===0)return null}return{name:t,value:S,strValue:S.length===0?"none":S.join(" "),bypass:r}}else if(l.color){var Y=zh(e);return Y?{name:t,value:Y,pfValue:Y,strValue:"rgb("+Y[0]+","+Y[1]+","+Y[2]+")",bypass:r}:null}else if(l.regex||l.regexes){if(l.enums){var q=P();if(q)return q}for(var Q=l.regexes?l.regexes:[l.regex],$=0;$<Q.length;$++){var K=new RegExp(Q[$]),j=K.exec(e);if(j)return{name:t,value:l.singleRegexMatchValue?j[1]:j,strValue:""+e,bypass:r}}return null}else return l.string?{name:t,value:""+e,strValue:""+e,bypass:r}:l.enums?P():null};var bt=function(e){if(!(this instanceof bt))return new bt(e);if(!Ws(e)){nt("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Dt=bt.prototype;Dt.instanceString=function(){return"style"};Dt.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),a=0;a<this.length;a++)this[a]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};Dt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Dt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Dt.selector=function(t){var e=t==="core"?null:new xr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],a=0;a<t.properties.length;a++){var n=t.properties[a],i=r[n.name];i===void 0&&(i=r[di(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Dt.style=Dt.css;Dt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[a].mappedProperties.push(r);var n=!this[a].selector;n&&(this._private.coreStyle[r.name]=r)}return this};Dt.append=function(t){return kh(t)?t.appendToStyle(this):Je(t)?this.appendFromJson(t):Me(t)&&this.appendFromString(t),this};bt.fromJson=function(t,e){var r=new bt(t);return r.fromJson(e),r};bt.fromString=function(t,e){return new bt(t).fromString(e)};[wt,gn,uu,jt,Ai,lu,lt,Li].forEach(function(t){Ie(Dt,t)});bt.types=Dt.types;bt.properties=Dt.properties;bt.propertyGroups=Dt.propertyGroups;bt.propertyGroupNames=Dt.propertyGroupNames;bt.propertyGroupKeys=Dt.propertyGroupKeys;var Wm={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return kh(e)?r.style=e.generateStyle(this):Je(e)?r.style=bt.fromJson(this,e):Me(e)?r.style=bt.fromString(this,e):r.style=bt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},Xm="single",Wr={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=Xm),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,a,n,i,o,s;switch(e.length){case 0:return r;case 1:if(Me(e[0]))return a=e[0],r[a];if(_e(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,be(o)&&(r.x=o),be(s)&&(r.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&be(n)&&(r[a]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var a=arguments,n=this._private.pan,i,o,s,u,l;if(!this._private.panningEnabled)return this;switch(a.length){case 1:_e(e)&&(s=a[0],u=s.x,l=s.y,be(u)&&(n.x+=u),be(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&be(o)&&(n[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var a=this.getFitViewport(e,r);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(be(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(Me(e)){var n=e;e=this.$(n)}else if(Id(e)){var i=e;a={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else Bt(e)||(e=this.mutableElements());if(!(Bt(e)&&e.empty())){a=a||e.boundingBox();var o=this.width(),s=this.height(),u;if(r=be(r)?r:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((o-2*r)/a.w,(s-2*r)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(a.x1+a.x2))/2,y:(s-u*(a.y1+a.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}return be(e)&&be(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):be(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:be(r)&&e===void 0&&r>=a.minZoom&&(a.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,a=r.pan,n=r.zoom,i,o,s=!1;if(r.zoomingEnabled||(s=!0),be(e)?o=e:_e(e)&&(o=e.level,e.position!=null?i=yi(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,s||!be(o)||o===n||i!=null&&(!be(i.x)||!be(i.y)))return null;if(i!=null){var u=a,l=n,f=o,h={x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:h}}else return{zoomed:!0,panned:!1,zoom:o,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),a=this._private;return r==null||!r.zoomed?this:(a.zoom=r.zoom,r.panned&&(a.pan.x=r.pan.x,a.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,a=!0,n=!0,i=[],o=!1,s=!1;if(!e)return this;if(be(e.zoom)||(a=!1),_e(e.pan)||(n=!1),!a&&!n)return this;if(a){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=u,i.push("zoom"))}if(n&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var l=e.pan;be(l.x)&&(r.pan.x=l.x,s=!1),be(l.y)&&(r.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Me(e)){var a=e;e=this.mutableElements().filter(a)}else Bt(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(i-r*(n.x1+n.x2))/2,y:(o-r*(n.y1+n.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?(function(){var n=a.window().getComputedStyle(r),i=function(s){return parseFloat(n.getPropertyValue(s))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/r,x2:(a.x2-e.x)/r,y1:(a.y1-e.y)/r,y2:(a.y2-e.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Wr.centre=Wr.center;Wr.autolockNodes=Wr.autolock;Wr.autoungrabifyNodes=Wr.autoungrabify;var tn={data:$e.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:$e.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:$e.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:$e.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};tn.attr=tn.data;tn.removeAttr=tn.removeData;var rn=function(e){var r=this;e=Ie({},e);var a=e.container;a&&!Qn(a)&&Qn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var o=ct!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=Ie({name:o?"grid":"null"},s.layout),s.renderer=Ie({name:o?"canvas":"null"},s.renderer);var u=function(d,p,y){return p!==void 0?p:y!==void 0?y:d},l=this._private={container:a,ready:!1,options:s,elements:new xt(this),listeners:[],aniEles:new xt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,s.zoomingEnabled),userZoomingEnabled:u(!0,s.userZoomingEnabled),panningEnabled:u(!0,s.panningEnabled),userPanningEnabled:u(!0,s.userPanningEnabled),boxSelectionEnabled:u(!0,s.boxSelectionEnabled),autolock:u(!1,s.autolock,s.autolockNodes),autoungrabify:u(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:be(s.zoom)?s.zoom:1,pan:{x:_e(s.pan)&&be(s.pan.x)?s.pan.x:0,y:_e(s.pan)&&be(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=function(d,p){var y=d.some(kd);if(y)return Ca.all(d).then(p);p(d)};l.styleEnabled&&r.setStyle([]);var h=Ie({},s,s.renderer);r.initRenderer(h);var v=function(d,p,y){r.notifications(!1);var g=r.mutableElements();g.length>0&&g.remove(),d!=null&&(_e(d)||Je(d))&&r.add(d),r.one("layoutready",function(m){r.notifications(!0),r.emit(m),r.one("load",p),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=Ie({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};f([s.style,s.elements],function(c){var d=c[0],p=c[1];l.styleEnabled&&r.style().append(d),v(p,function(){r.startAnimationLoop(),l.ready=!0,it(s.ready)&&r.on("ready",s.ready);for(var y=0;y<i.length;y++){var g=i[y];r.on("ready",g)}n&&(n.readies=[]),r.emit("ready")},s.done)})},ni=rn.prototype;Ie(ni,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return ct;var r=this._private.container.ownerDocument;return r===void 0||r==null?ct:r.defaultView||ct},mount:function(e){if(e!=null){var r=this,a=r._private,n=a.options;return!Qn(e)&&Qn(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Ie({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Qt(this._private.options)},json:function(e){var r=this,a=r._private,n=r.mutableElements(),i=function(w){return r.getElementById(w.id())};if(_e(e)){if(r.startBatch(),e.elements){var o={},s=function(w,T){for(var D=[],x=[],N=0;N<w.length;N++){var O=w[N];if(!O.data.id){Ke("cy.json() cannot handle elements without an ID attribute");continue}var R=""+O.data.id,P=r.getElementById(R);o[R]=!0,P.length!==0?x.push({ele:P,json:O}):(T&&(O.group=T),D.push(O))}r.add(D);for(var M=0;M<x.length;M++){var I=x[M],E=I.ele,A=I.json;E.json(A)}};if(Je(e.elements))s(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],h=e.elements[f];Je(h)&&s(h,f)}var v=r.collection();n.filter(function(m){return!o[m.id()]}).forEach(function(m){m.isParent()?v.merge(m):m.remove()}),v.forEach(function(m){return m.children().move({parent:null})}),v.forEach(function(m){return i(m).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var c=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<c.length;d++){var p=c[d];e[p]!=null&&r[p](e[p])}return r.endBatch(),this}else{var y=!!e,g={};y?g.elements=this.elements().map(function(m){return m.json()}):(g.elements={},n.forEach(function(m){var w=m.group();g.elements[w]||(g.elements[w]=[]),g.elements[w].push(m.json())})),this._private.styleEnabled&&(g.style=r.style().json()),g.data=Qt(r.data());var b=a.options;return g.zoomingEnabled=a.zoomingEnabled,g.userZoomingEnabled=a.userZoomingEnabled,g.zoom=a.zoom,g.minZoom=a.minZoom,g.maxZoom=a.maxZoom,g.panningEnabled=a.panningEnabled,g.userPanningEnabled=a.userPanningEnabled,g.pan=Qt(a.pan),g.boxSelectionEnabled=a.boxSelectionEnabled,g.renderer=Qt(b.renderer),g.hideEdgesOnViewport=b.hideEdgesOnViewport,g.textureOnViewport=b.textureOnViewport,g.wheelSensitivity=b.wheelSensitivity,g.motionBlur=b.motionBlur,g.multiClickDebounceTime=b.multiClickDebounceTime,g}}});ni.$id=ni.getElementById;[Bm,Um,kc,Rs,Yn,Ym,Os,qn,Wm,Wr,tn].forEach(function(t){Ie(ni,t)});var $m={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Km={maximal:!1,acyclic:!1},ra=function(e){return e.scratch("breadthfirst")},Mf=function(e,r){return e.scratch("breadthfirst",r)};function Bc(t){this.options=Ie({},$m,Km,t)}Bc.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=r.nodes().filter(function(he){return he.isChildless()}),n=r,i=t.directed,o=t.acyclic||t.maximal||t.maximalAdjustments>0,s=!!t.boundingBox,u=Rt(s?t.boundingBox:structuredClone(e.extent())),l;if(Bt(t.roots))l=t.roots;else if(Je(t.roots)){for(var f=[],h=0;h<t.roots.length;h++){var v=t.roots[h],c=e.getElementById(v);f.push(c)}l=e.collection(f)}else if(Me(t.roots))l=e.$(t.roots);else if(i)l=a.roots();else{var d=r.components();l=e.collection();for(var p=function(){var fe=d[y],ve=fe.maxDegree(!1),ye=fe.filter(function(me){return me.degree(!1)===ve});l=l.add(ye)},y=0;y<d.length;y++)p()}var g=[],b={},m=function(fe,ve){g[ve]==null&&(g[ve]=[]);var ye=g[ve].length;g[ve].push(fe),Mf(fe,{index:ye,depth:ve})},w=function(fe,ve){var ye=ra(fe),me=ye.depth,xe=ye.index;g[me][xe]=null,fe.isChildless()&&m(fe,ve)};n.bfs({roots:l,directed:t.directed,visit:function(fe,ve,ye,me,xe){var Le=fe[0],ke=Le.id();Le.isChildless()&&m(Le,xe),b[ke]=!0}});for(var T=[],D=0;D<a.length;D++){var x=a[D];b[x.id()]||T.push(x)}var N=function(fe){for(var ve=g[fe],ye=0;ye<ve.length;ye++){var me=ve[ye];if(me==null){ve.splice(ye,1),ye--;continue}Mf(me,{depth:fe,index:ye})}},O=function(fe,ve){for(var ye=ra(fe),me=fe.incomers().filter(function(ne){return ne.isNode()&&r.has(ne)}),xe=-1,Le=fe.id(),ke=0;ke<me.length;ke++){var Fe=me[ke],Be=ra(Fe);xe=Math.max(xe,Be.depth)}if(ye.depth<=xe){if(!t.acyclic&&ve[Le])return null;var Oe=xe+1;return w(fe,Oe),ve[Le]=Oe,!0}return!1};if(i&&o){var R=[],P={},M=function(fe){return R.push(fe)},I=function(){return R.shift()};for(a.forEach(function(he){return R.push(he)});R.length>0;){var E=I(),A=O(E,P);if(A)E.outgoers().filter(function(he){return he.isNode()&&r.has(he)}).forEach(M);else if(A===null){Ke("Detected double maximal shift for node `"+E.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var C=0;if(t.avoidOverlap)for(var S=0;S<a.length;S++){var L=a[S],V=L.layoutDimensions(t),F=V.w,B=V.h;C=Math.max(C,F,B)}var Y={},q=function(fe){if(Y[fe.id()])return Y[fe.id()];for(var ve=ra(fe).depth,ye=fe.neighborhood(),me=0,xe=0,Le=0;Le<ye.length;Le++){var ke=ye[Le];if(!(ke.isEdge()||ke.isParent()||!a.has(ke))){var Fe=ra(ke);if(Fe!=null){var Be=Fe.index,Oe=Fe.depth;if(!(Be==null||Oe==null)){var ne=g[Oe].length;Oe<ve&&(me+=Be/ne,xe++)}}}}return xe=Math.max(1,xe),me=me/xe,xe===0&&(me=0),Y[fe.id()]=me,me},Q=function(fe,ve){var ye=q(fe),me=q(ve),xe=ye-me;return xe===0?Fh(fe.id(),ve.id()):xe};t.depthSort!==void 0&&(Q=t.depthSort);for(var $=g.length,K=0;K<$;K++)g[K].sort(Q),N(K);for(var j=[],re=0;re<T.length;re++)j.push(T[re]);var U=function(){for(var fe=0;fe<$;fe++)N(fe)};j.length&&(g.unshift(j),$=g.length,U());for(var H=0,_=0;_<$;_++)H=Math.max(g[_].length,H);var W={x:u.x1+u.w/2,y:u.y1+u.h/2},J=a.reduce(function(he,fe){return(function(ve){return{w:he.w===-1?ve.w:(he.w+ve.w)/2,h:he.h===-1?ve.h:(he.h+ve.h)/2}})(fe.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),te=Math.max($===1?0:s?(u.h-t.padding*2-J.h)/($-1):(u.h-t.padding*2-J.h)/($+1),C),de=g.reduce(function(he,fe){return Math.max(he,fe.length)},0),Te=function(fe){var ve=ra(fe),ye=ve.depth,me=ve.index;if(t.circle){var xe=Math.min(u.w/2/$,u.h/2/$);xe=Math.max(xe,C);var Le=xe*ye+xe-($>0&&g[0].length<=3?xe/2:0),ke=2*Math.PI/g[ye].length*me;return ye===0&&g[0].length===1&&(Le=1),{x:W.x+Le*Math.cos(ke),y:W.y+Le*Math.sin(ke)}}else{var Fe=g[ye].length,Be=Math.max(Fe===1?0:s?(u.w-t.padding*2-J.w)/((t.grid?de:Fe)-1):(u.w-t.padding*2-J.w)/((t.grid?de:Fe)+1),C),Oe={x:W.x+(me+1-(Fe+1)/2)*Be,y:W.y+(ye+1-($+1)/2)*te};return Oe}},ge={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(ge).indexOf(t.direction)===-1&&nt("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(ge).join(", ")));var le=function(fe){return fg(Te(fe),u,ge[t.direction])};return r.nodes().layoutPositions(this,t,le),this};var Zm={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Fc(t){this.options=Ie({},Zm,t)}Fc.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Rt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),f,h=0,v=0;v<i.length;v++){var c=i[v],d=c.layoutDimensions(e),p=d.w,y=d.h;h=Math.max(h,p,y)}if(be(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(o.h,o.w)/2-h,i.length>1&&e.avoidOverlap){h*=1.75;var g=Math.cos(l)-Math.cos(0),b=Math.sin(l)-Math.sin(0),m=Math.sqrt(h*h/(g*g+b*b));f=Math.max(m,f)}var w=function(D,x){var N=e.startAngle+x*l*(n?1:-1),O=f*Math.cos(N),R=f*Math.sin(N),P={x:s.x+O,y:s.y+R};return P};return a.nodes().layoutPositions(this,e,w),this};var Qm={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function zc(t){this.options=Ie({},Qm,t)}zc.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=t.cy,n=e.eles,i=n.nodes().not(":parent"),o=Rt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],l=0,f=0;f<i.length;f++){var h=i[f],v=void 0;v=e.concentric(h),u.push({value:v,node:h}),h._private.scratch.concentric=v}i.updateStyle();for(var c=0;c<i.length;c++){var d=i[c],p=d.layoutDimensions(e);l=Math.max(l,p.w,p.h)}u.sort(function(te,de){return de.value-te.value});for(var y=e.levelWidth(i),g=[[]],b=g[0],m=0;m<u.length;m++){var w=u[m];if(b.length>0){var T=Math.abs(b[0].value-w.value);T>=y&&(b=[],g.push(b))}b.push(w)}var D=l+e.minNodeSpacing;if(!e.avoidOverlap){var x=g.length>0&&g[0].length>1,N=Math.min(o.w,o.h)/2-D,O=N/(g.length+x?1:0);D=Math.min(D,O)}for(var R=0,P=0;P<g.length;P++){var M=g[P],I=e.sweep===void 0?2*Math.PI-2*Math.PI/M.length:e.sweep,E=M.dTheta=I/Math.max(1,M.length-1);if(M.length>1&&e.avoidOverlap){var A=Math.cos(E)-Math.cos(0),C=Math.sin(E)-Math.sin(0),S=Math.sqrt(D*D/(A*A+C*C));R=Math.max(S,R)}M.r=R,R+=D}if(e.equidistant){for(var L=0,V=0,F=0;F<g.length;F++){var B=g[F],Y=B.r-V;L=Math.max(L,Y)}V=0;for(var q=0;q<g.length;q++){var Q=g[q];q===0&&(V=Q.r),Q.r=V,V+=L}}for(var $={},K=0;K<g.length;K++)for(var j=g[K],re=j.dTheta,U=j.r,H=0;H<j.length;H++){var _=j[H],W=e.startAngle+(r?1:-1)*re*H,J={x:s.x+U*Math.cos(W),y:s.y+U*Math.sin(W)};$[_.node.id()]=J}return n.nodes().layoutPositions(this,e,function(te){var de=te.id();return $[de]}),this};var ns,Jm={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Ni(t){this.options=Ie({},Jm,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),a=r.filter(function(n){var i=n.source().data("id"),o=n.target().data("id"),s=e.some(function(l){return l.data("id")===i}),u=e.some(function(l){return l.data("id")===o});return!s||!u});this.options.eles=this.options.eles.not(a)}Ni.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?ns=!0:ns=!1;var a=jm(e,r,t);ns&&t0(a),t.randomize&&r0(a);var n=ir(),i=function(){a0(a,e,t),t.fit===!0&&e.fit(t.padding)},o=function(v){return!(r.stopped||v>=t.numIter||(n0(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp))},s=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var v=t.eles.nodes(),c=Gc(a,t,v);v.layoutPositions(r,t,c)}},u=0,l=!0;if(t.animate===!0){var f=function(){for(var v=0;l&&v<t.refresh;)l=o(u),u++,v++;if(!l)Of(a,t),s();else{var c=ir();c-n>=t.animationThreshold&&i(),Jn(f)}};f()}else{for(;l;)l=o(u),u++;Of(a,t),s()}return this};Ni.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Ni.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var jm=function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),o=Rt(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=a.eles.components(),l={},f=0;f<u.length;f++)for(var h=u[f],v=0;v<h.length;v++){var c=h[v];l[c.id()]=f}for(var f=0;f<s.nodeSize;f++){var d=i[f],p=d.layoutDimensions(a),y={};y.isLocked=d.locked(),y.id=d.data("id"),y.parentId=d.data("parent"),y.cmptId=l[d.id()],y.children=[],y.positionX=d.position("x"),y.positionY=d.position("y"),y.offsetX=0,y.offsetY=0,y.height=p.w,y.width=p.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(d.style("padding")),y.padRight=parseFloat(d.style("padding")),y.padTop=parseFloat(d.style("padding")),y.padBottom=parseFloat(d.style("padding")),y.nodeRepulsion=it(a.nodeRepulsion)?a.nodeRepulsion(d):a.nodeRepulsion,s.layoutNodes.push(y),s.idToIndex[y.id]=f}for(var g=[],b=0,m=-1,w=[],f=0;f<s.nodeSize;f++){var d=s.layoutNodes[f],T=d.parentId;T!=null?s.layoutNodes[s.idToIndex[T]].children.push(d.id):(g[++m]=d.id,w.push(d.id))}for(s.graphSet.push(w);b<=m;){var D=g[b++],x=s.idToIndex[D],c=s.layoutNodes[x],N=c.children;if(N.length>0){s.graphSet.push(N);for(var f=0;f<N.length;f++)g[++m]=N[f]}}for(var f=0;f<s.graphSet.length;f++)for(var O=s.graphSet[f],v=0;v<O.length;v++){var R=s.idToIndex[O[v]];s.indexToGraph[R]=f}for(var f=0;f<s.edgeSize;f++){var P=n[f],M={};M.id=P.data("id"),M.sourceId=P.data("source"),M.targetId=P.data("target");var I=it(a.idealEdgeLength)?a.idealEdgeLength(P):a.idealEdgeLength,E=it(a.edgeElasticity)?a.edgeElasticity(P):a.edgeElasticity,A=s.idToIndex[M.sourceId],C=s.idToIndex[M.targetId],S=s.indexToGraph[A],L=s.indexToGraph[C];if(S!=L){for(var V=e0(M.sourceId,M.targetId,s),F=s.graphSet[V],B=0,y=s.layoutNodes[A];F.indexOf(y.id)===-1;)y=s.layoutNodes[s.idToIndex[y.parentId]],B++;for(y=s.layoutNodes[C];F.indexOf(y.id)===-1;)y=s.layoutNodes[s.idToIndex[y.parentId]],B++;I*=B*a.nestingFactor}M.idealLength=I,M.elasticity=E,s.layoutEdges.push(M)}return s},e0=function(e,r,a){var n=Vc(e,r,0,a);return 2>n.count?0:n.graph},Vc=function(e,r,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:a};for(var o=0,s=0;s<i.length;s++){var u=i[s],l=n.idToIndex[u],f=n.layoutNodes[l].children;if(f.length!==0){var h=n.indexToGraph[n.idToIndex[f[0]]],v=Vc(e,r,h,n);if(v.count!==0)if(v.count===1){if(o++,o===2)break}else return v}}return{count:o,graph:a}},t0,r0=function(e,r){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*a,o.positionY=Math.random()*n)}},Gc=function(e,r,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(a.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(r.boundingBox){var l=i.w===0?.5:(u.positionX-i.x1)/i.w,f=i.h===0?.5:(u.positionY-i.y1)/i.h;return{x:n.x1+l*n.w,y:n.y1+f*n.h}}else return{x:u.positionX,y:u.positionY}}},a0=function(e,r,a){var n=a.layout,i=a.eles.nodes(),o=Gc(e,a,i);i.positions(o),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},n0=function(e,r,a){i0(e,r),u0(e),l0(e,r),f0(e),h0(e)},i0=function(e,r){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],u=o+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[n[u]]];o0(s,l,e,r)}},Rf=function(e){return-e+2*e*Math.random()},o0=function(e,r,a,n){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!a.isCompound)){var s=r.positionX-e.positionX,u=r.positionY-e.positionY,l=1;s===0&&u===0&&(s=Rf(l),u=Rf(l));var f=s0(e,r,s,u);if(f>0)var h=n.nodeOverlap*f,v=Math.sqrt(s*s+u*u),c=h*s/v,d=h*u/v;else var p=ii(e,s,u),y=ii(r,-1*s,-1*u),g=y.x-p.x,b=y.y-p.y,m=g*g+b*b,v=Math.sqrt(m),h=(e.nodeRepulsion+r.nodeRepulsion)/m,c=h*g/v,d=h*b/v;e.isLocked||(e.offsetX-=c,e.offsetY-=d),r.isLocked||(r.offsetX+=c,r.offsetY+=d)}},s0=function(e,r,a,n){if(a>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(n>0)var o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},ii=function(e,r,a){var n=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,u=a/r,l=o/s,f={};return r===0&&0<a||r===0&&0>a?(f.x=n,f.y=i+o/2,f):0<r&&-1*l<=u&&u<=l?(f.x=n+s/2,f.y=i+s*a/2/r,f):0>r&&-1*l<=u&&u<=l?(f.x=n-s/2,f.y=i-s*a/2/r,f):0<a&&(u<=-1*l||u>=l)?(f.x=n+o*r/2/a,f.y=i+o/2,f):(0>a&&(u<=-1*l||u>=l)&&(f.x=n-o*r/2/a,f.y=i-o/2),f)},u0=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],o=e.layoutNodes[i],s=e.idToIndex[n.targetId],u=e.layoutNodes[s],l=u.positionX-o.positionX,f=u.positionY-o.positionY;if(!(l===0&&f===0)){var h=ii(o,l,f),v=ii(u,-1*l,-1*f),c=v.x-h.x,d=v.y-h.y,p=Math.sqrt(c*c+d*d),y=Math.pow(n.idealLength-p,2)/n.elasticity;if(p!==0)var g=y*c/p,b=y*d/p;else var g=0,b=0;o.isLocked||(o.offsetX+=g,o.offsetY+=b),u.isLocked||(u.offsetX-=g,u.offsetY-=b)}}},l0=function(e,r){if(r.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],o=i.length;if(n===0)var s=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],s=f.positionX,u=f.positionY;for(var h=0;h<o;h++){var v=e.layoutNodes[e.idToIndex[i[h]]];if(!v.isLocked){var c=s-v.positionX,d=u-v.positionY,p=Math.sqrt(c*c+d*d);if(p>a){var y=r.gravity*c/p,g=r.gravity*d/p;v.offsetX+=y,v.offsetY+=g}}}}},f0=function(e,r){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var o=a[n++],s=e.idToIndex[o],u=e.layoutNodes[s],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,h=u.offsetY,v=0;v<l.length;v++){var c=e.layoutNodes[e.idToIndex[l[v]]];c.offsetX+=f,c.offsetY+=h,a[++i]=l[v]}u.offsetX=0,u.offsetY=0}}},h0=function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(!(0<n.children.length||n.isLocked)){var i=c0(n.offsetX,n.offsetY,e.temperature);n.positionX+=i.x,n.positionY+=i.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,Uc(n,e)}}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&!n.isLocked&&(n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY)}},c0=function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},Uc=function(e,r){var a=e.parentId;if(a!=null){var n=r.layoutNodes[r.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,i=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,i=!0),i)return Uc(n,r)}},Of=function(e,r){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var o=a[i],s=o.cmptId,u=n[s]=n[s]||[];u.push(o)}for(var l=0,i=0;i<n.length;i++){var f=n[i];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var h=0;h<f.length;h++){var v=f[h];f.x1=Math.min(f.x1,v.positionX-v.width/2),f.x2=Math.max(f.x2,v.positionX+v.width/2),f.y1=Math.min(f.y1,v.positionY-v.height/2),f.y2=Math.max(f.y2,v.positionY+v.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,l+=f.w*f.h}}n.sort(function(b,m){return m.w*m.h-b.w*b.h});for(var c=0,d=0,p=0,y=0,g=Math.sqrt(l)*e.clientWidth/e.clientHeight,i=0;i<n.length;i++){var f=n[i];if(f){for(var h=0;h<f.length;h++){var v=f[h];v.isLocked||(v.positionX+=c-f.x1,v.positionY+=d-f.y1)}c+=f.w+r.componentSpacing,p+=f.w+r.componentSpacing,y=Math.max(y,f.h),p>g&&(d+=y+r.componentSpacing,c=0,p=0,y=0)}}},v0={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Hc(t){this.options=Ie({},v0,t)}Hc.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=Rt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(q){return{x:i.x1,y:i.y1}});else{var o=n.size(),s=Math.sqrt(o*i.h/i.w),u=Math.round(s),l=Math.round(i.w/i.h*s),f=function(Q){if(Q==null)return Math.min(u,l);var $=Math.min(u,l);$==u?u=Q:l=Q},h=function(Q){if(Q==null)return Math.max(u,l);var $=Math.max(u,l);$==u?u=Q:l=Q},v=e.rows,c=e.cols!=null?e.cols:e.columns;if(v!=null&&c!=null)u=v,l=c;else if(v!=null&&c==null)u=v,l=Math.ceil(o/u);else if(v==null&&c!=null)l=c,u=Math.ceil(o/l);else if(l*u>o){var d=f(),p=h();(d-1)*p>=o?f(d-1):(p-1)*d>=o&&h(p-1)}else for(;l*u<o;){var y=f(),g=h();(g+1)*y>=o?h(g+1):f(y+1)}var b=i.w/l,m=i.h/u;if(e.condense&&(b=0,m=0),e.avoidOverlap)for(var w=0;w<n.length;w++){var T=n[w],D=T._private.position;(D.x==null||D.y==null)&&(D.x=0,D.y=0);var x=T.layoutDimensions(e),N=e.avoidOverlapPadding,O=x.w+N,R=x.h+N;b=Math.max(b,O),m=Math.max(m,R)}for(var P={},M=function(Q,$){return!!P["c-"+Q+"-"+$]},I=function(Q,$){P["c-"+Q+"-"+$]=!0},E=0,A=0,C=function(){A++,A>=l&&(A=0,E++)},S={},L=0;L<n.length;L++){var V=n[L],F=e.position(V);if(F&&(F.row!==void 0||F.col!==void 0)){var B={row:F.row,col:F.col};if(B.col===void 0)for(B.col=0;M(B.row,B.col);)B.col++;else if(B.row===void 0)for(B.row=0;M(B.row,B.col);)B.row++;S[V.id()]=B,I(B.row,B.col)}}var Y=function(Q,$){var K,j;if(Q.locked()||Q.isParent())return!1;var re=S[Q.id()];if(re)K=re.col*b+b/2+i.x1,j=re.row*m+m/2+i.y1;else{for(;M(E,A);)C();K=A*b+b/2+i.x1,j=E*m+m/2+i.y1,I(E,A),C()}return{x:K,y:j}};n.layoutPositions(this,e,Y)}return this};var d0={ready:function(){},stop:function(){}};function fu(t){this.options=Ie({},d0,t)}fu.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};fu.prototype.stop=function(){return this};var g0={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Yc(t){this.options=Ie({},g0,t)}Yc.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=it(t.positions);function n(i){if(t.positions==null)return Bg(i.position());if(a)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var s=n(i);return i.locked()||s==null?!1:s}),this};var p0={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function qc(t){this.options=Ie({},p0,t)}qc.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=Rt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(o,s){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return r.nodes().layoutPositions(this,t,n),this};var y0=[{name:"breadthfirst",impl:Bc},{name:"circle",impl:Fc},{name:"concentric",impl:zc},{name:"cose",impl:Ni},{name:"grid",impl:Hc},{name:"null",impl:fu},{name:"preset",impl:Yc},{name:"random",impl:qc}];function _c(t){this.options=t,this.notifications=0}var Pf=function(){},If=function(){throw new Error("A headless instance can not render images")};_c.prototype={recalculateRenderedStyle:Pf,notify:function(){this.notifications++},init:Pf,isHeadless:function(){return!0},png:If,jpg:If};var hu={};hu.arrowShapeWidth=.3;hu.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(l,f,h,v,c,d,p){var y=c.x-h/2-p,g=c.x+h/2+p,b=c.y-h/2-p,m=c.y+h/2+p,w=y<=l&&l<=g&&b<=f&&f<=m;return w},a=function(l,f,h,v,c){var d=l*Math.cos(v)-f*Math.sin(v),p=l*Math.sin(v)+f*Math.cos(v),y=d*h,g=p*h,b=y+c.x,m=g+c.y;return{x:b,y:m}},n=function(l,f,h,v){for(var c=[],d=0;d<l.length;d+=2){var p=l[d],y=l[d+1];c.push(a(p,y,f,h,v))}return c},i=function(l){for(var f=[],h=0;h<l.length;h++){var v=l[h];f.push(v.x,v.y)}return f},o=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},s=function(l,f){Me(f)&&(f=t[f]),t[l]=Ie({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(v,c,d,p,y,g){var b=i(n(this.points,d+2*g,p,y)),m=It(v,c,b);return m},roughCollide:r,draw:function(v,c,d,p){var y=n(this.points,c,d,p);e.arrowShapeImpl("polygon")(v,y)},spacing:function(v){return 0},gap:o},f)};s("none",{collide:jn,roughCollide:jn,draw:Zs,spacing:Xu,gap:Xu}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),p=this.controlPoint,y=a(p[0],p[1],f,h,v);e.arrowShapeImpl(this.name)(l,d,y)},gap:function(l){return o(l)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,f,h,v,c,d,p){var y=i(n(this.points,h+2*p,v,c)),g=i(n(this.pointsTee,h+2*p,v,c)),b=It(l,f,y)||It(l,f,g);return b},draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),p=n(this.pointsTee,f,h,v);e.arrowShapeImpl(this.name)(l,d,p)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,f,h,v,c,d,p){var y=c,g=Math.pow(y.x-l,2)+Math.pow(y.y-f,2)<=Math.pow((h+2*p)*this.radius,2),b=i(n(this.points,h+2*p,v,c));return It(l,f,b)||g},draw:function(l,f,h,v,c){var d=n(this.pointsTr,f,h,v);e.arrowShapeImpl(this.name)(l,d,v.x,v.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,f){var h=this.baseCrossLinePts.slice(),v=f/l,c=3,d=5;return h[c]=h[c]-v,h[d]=h[d]-v,h},collide:function(l,f,h,v,c,d,p){var y=i(n(this.points,h+2*p,v,c)),g=i(n(this.crossLinePts(h,d),h+2*p,v,c)),b=It(l,f,y)||It(l,f,g);return b},draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),p=n(this.crossLinePts(f,c),f,h,v);e.arrowShapeImpl(this.name)(l,d,p)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return o(l)*.525}}),s("circle",{radius:.15,collide:function(l,f,h,v,c,d,p){var y=c,g=Math.pow(y.x-l,2)+Math.pow(y.y-f,2)<=Math.pow((h+2*p)*this.radius,2);return g},draw:function(l,f,h,v,c){e.arrowShapeImpl(this.name)(l,v.x,v.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}})};var $r={};$r.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],o=a[4],s=r.pan(),u=r.zoom(),l=((t-n)/o-s.x)/u,f=((e-i)/o-s.y)/u;return[l,f]};$r.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=function(g){return parseFloat(r.getPropertyValue(g))},n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},i={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},o=t.clientWidth,s=t.clientHeight,u=n.left+n.right,l=n.top+n.bottom,f=i.left+i.right,h=e.width/(o+f),v=o-u,c=s-l,d=e.left+n.left+i.left,p=e.top+n.top+i.top;return this.containerBB=[d,p,v,c,h]};$r.invalidateContainerClientCoordsCache=function(){this.containerBB=null};$r.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};$r.findNearestElements=function(t,e,r,a){var n=this,i=this,o=i.getCachedZSortedEles(),s=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),f=(a?24:8)/u,h=(a?8:2)/u,v=(a?8:2)/u,c=1/0,d,p;r&&(o=o.interactive);function y(x,N){if(x.isNode()){if(p)return;p=x,s.push(x)}if(x.isEdge()&&(N==null||N<c))if(d){if(d.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value){for(var O=0;O<s.length;O++)if(s[O].isEdge()){s[O]=x,d=x,c=N??c;break}}}else s.push(x),d=x,c=N??c}function g(x){var N=x.outerWidth()+2*h,O=x.outerHeight()+2*h,R=N/2,P=O/2,M=x.position(),I=x.pstyle("corner-radius").value==="auto"?"auto":x.pstyle("corner-radius").pfValue,E=x._private.rscratch;if(M.x-R<=t&&t<=M.x+R&&M.y-P<=e&&e<=M.y+P){var A=i.nodeShapes[n.getNodeShape(x)];if(A.checkPoint(t,e,0,N,O,M.x,M.y,I,E))return y(x,0),!0}}function b(x){var N=x._private,O=N.rscratch,R=x.pstyle("width").pfValue,P=x.pstyle("arrow-scale").value,M=R/2+f,I=M*M,E=M*2,L=N.source,V=N.target,A;if(O.edgeType==="segments"||O.edgeType==="straight"||O.edgeType==="haystack"){for(var C=O.allpts,S=0;S+3<C.length;S+=2)if(Zg(t,e,C[S],C[S+1],C[S+2],C[S+3],E)&&I>(A=tp(t,e,C[S],C[S+1],C[S+2],C[S+3])))return y(x,A),!0}else if(O.edgeType==="bezier"||O.edgeType==="multibezier"||O.edgeType==="self"||O.edgeType==="compound"){for(var C=O.allpts,S=0;S+5<O.allpts.length;S+=4)if(Qg(t,e,C[S],C[S+1],C[S+2],C[S+3],C[S+4],C[S+5],E)&&I>(A=ep(t,e,C[S],C[S+1],C[S+2],C[S+3],C[S+4],C[S+5])))return y(x,A),!0}for(var L=L||N.source,V=V||N.target,F=n.getArrowWidth(R,P),B=[{name:"source",x:O.arrowStartX,y:O.arrowStartY,angle:O.srcArrowAngle},{name:"target",x:O.arrowEndX,y:O.arrowEndY,angle:O.tgtArrowAngle},{name:"mid-source",x:O.midX,y:O.midY,angle:O.midsrcArrowAngle},{name:"mid-target",x:O.midX,y:O.midY,angle:O.midtgtArrowAngle}],S=0;S<B.length;S++){var Y=B[S],q=i.arrowShapes[x.pstyle(Y.name+"-arrow-shape").value],Q=x.pstyle("width").pfValue;if(q.roughCollide(t,e,F,Y.angle,{x:Y.x,y:Y.y},Q,f)&&q.collide(t,e,F,Y.angle,{x:Y.x,y:Y.y},Q,f))return y(x),!0}l&&s.length>0&&(g(L),g(V))}function m(x,N,O){return Mt(x,N,O)}function w(x,N){var O=x._private,R=v,P;N?P=N+"-":P="",x.boundingBox();var M=O.labelBounds[N||"main"],I=x.pstyle(P+"label").value,E=x.pstyle("text-events").strValue==="yes";if(!(!E||!I)){var A=m(O.rscratch,"labelX",N),C=m(O.rscratch,"labelY",N),S=m(O.rscratch,"labelAngle",N),L=x.pstyle(P+"text-margin-x").pfValue,V=x.pstyle(P+"text-margin-y").pfValue,F=M.x1-R-L,B=M.x2+R-L,Y=M.y1-R-V,q=M.y2+R-V;if(S){var Q=Math.cos(S),$=Math.sin(S),K=function(J,te){return J=J-A,te=te-C,{x:J*Q-te*$+A,y:J*$+te*Q+C}},j=K(F,Y),re=K(F,q),U=K(B,Y),H=K(B,q),_=[j.x+L,j.y+V,U.x+L,U.y+V,H.x+L,H.y+V,re.x+L,re.y+V];if(It(t,e,_))return y(x),!0}else if(gr(M,t,e))return y(x),!0}}for(var T=o.length-1;T>=0;T--){var D=o[T];D.isNode()?g(D)||w(D):b(D)||w(D)||w(D,"source")||w(D,"target")}return s};$r.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),o=2/i,s=[],u=Math.min(t,r),l=Math.max(t,r),f=Math.min(e,a),h=Math.max(e,a);t=u,r=l,e=f,a=h;var v=Rt({x1:t,y1:e,x2:r,y2:a}),c=[{x:v.x1,y:v.y1},{x:v.x2,y:v.y1},{x:v.x2,y:v.y2},{x:v.x1,y:v.y2}],d=[[c[0],c[1]],[c[1],c[2]],[c[2],c[3]],[c[3],c[0]]];function p(J,te,de){return Mt(J,te,de)}function y(J,te){var de=J._private,Te=o,ge="";J.boundingBox();var le=de.labelBounds.main;if(!le)return null;var he=p(de.rscratch,"labelX",te),fe=p(de.rscratch,"labelY",te),ve=p(de.rscratch,"labelAngle",te),ye=J.pstyle(ge+"text-margin-x").pfValue,me=J.pstyle(ge+"text-margin-y").pfValue,xe=le.x1-Te-ye,Le=le.x2+Te-ye,ke=le.y1-Te-me,Fe=le.y2+Te-me;if(ve){var Be=Math.cos(ve),Oe=Math.sin(ve),ne=function(z,G){return z=z-he,G=G-fe,{x:z*Be-G*Oe+he,y:z*Oe+G*Be+fe}};return[ne(xe,ke),ne(Le,ke),ne(Le,Fe),ne(xe,Fe)]}else return[{x:xe,y:ke},{x:Le,y:ke},{x:Le,y:Fe},{x:xe,y:Fe}]}function g(J,te,de,Te){function ge(le,he,fe){return(fe.y-le.y)*(he.x-le.x)>(he.y-le.y)*(fe.x-le.x)}return ge(J,de,Te)!==ge(te,de,Te)&&ge(J,te,de)!==ge(J,te,Te)}for(var b=0;b<n.length;b++){var m=n[b];if(m.isNode()){var w=m,T=w.pstyle("text-events").strValue==="yes",D=w.pstyle("box-selection").strValue,x=w.pstyle("box-select-labels").strValue==="yes";if(D==="none")continue;var N=(D==="overlap"||x)&&T,O=w.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:N});if(D==="contain"){var R=!1;if(x&&T){var P=y(w);P&&to(P,c)&&(s.push(w),R=!0)}!R&&Jh(v,O)&&s.push(w)}else if(D==="overlap"&&eu(v,O)){var M=w.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),I=[{x:M.x1,y:M.y1},{x:M.x2,y:M.y1},{x:M.x2,y:M.y2},{x:M.x1,y:M.y2}];if(to(I,c))s.push(w);else{var E=y(w);E&&to(E,c)&&s.push(w)}}}else{var A=m,C=A._private,S=C.rscratch,L=A.pstyle("box-selection").strValue;if(L==="none")continue;if(L==="contain"){if(S.startX!=null&&S.startY!=null&&!gr(v,S.startX,S.startY)||S.endX!=null&&S.endY!=null&&!gr(v,S.endX,S.endY))continue;if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"||S.edgeType==="segments"||S.edgeType==="haystack"){for(var V=C.rstyle.bezierPts||C.rstyle.linePts||C.rstyle.haystackPts,F=!0,B=0;B<V.length;B++)if(!Ju(v,V[B])){F=!1;break}F&&s.push(A)}else S.edgeType==="straight"&&s.push(A)}else if(L==="overlap"){var Y=!1;if(S.startX!=null&&S.startY!=null&&S.endX!=null&&S.endY!=null&&(gr(v,S.startX,S.startY)||gr(v,S.endX,S.endY)))s.push(A),Y=!0;else if(!Y&&S.edgeType==="haystack"){for(var q=C.rstyle.haystackPts,Q=0;Q<q.length;Q++)if(Ju(v,q[Q])){s.push(A),Y=!0;break}}if(!Y){var $=C.rstyle.bezierPts||C.rstyle.linePts||C.rstyle.haystackPts;if((!$||$.length<2)&&S.edgeType==="straight"&&S.startX!=null&&S.startY!=null&&S.endX!=null&&S.endY!=null&&($=[{x:S.startX,y:S.startY},{x:S.endX,y:S.endY}]),!$||$.length<2)continue;for(var K=0;K<$.length-1;K++){for(var j=$[K],re=$[K+1],U=0;U<d.length;U++){var H=ft(d[U],2),_=H[0],W=H[1];if(g(j,re,_,W)){s.push(A),Y=!0;break}}if(Y)break}}}}}return s};var oi={};oi.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",u,l,f,h,v,c,g,b;if(r?(f=e.haystackPts[0],h=e.haystackPts[1],v=e.haystackPts[2],c=e.haystackPts[3]):(f=e.arrowStartX,h=e.arrowStartY,v=e.arrowEndX,c=e.arrowEndY),g=e.midX,b=e.midY,i)u=f-e.segpts[0],l=h-e.segpts[1];else if(n||o||s||a){var d=e.allpts,p=mt(d[0],d[2],d[4],.1),y=mt(d[1],d[3],d[5],.1);u=f-p,l=h-y}else u=f-g,l=h-b;e.srcArrowAngle=Sn(u,l);var g=e.midX,b=e.midY;if(r&&(g=(f+v)/2,b=(h+c)/2),u=v-f,l=c-h,i){var d=e.allpts;if(d.length/2%2===0){var m=d.length/2,w=m-2;u=d[m]-d[w],l=d[m+1]-d[w+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var m=d.length/2-1,w=m-2;u=d[m]-d[w],l=d[m+1]-d[w+1]}}else if(n||o||s){var d=e.allpts,T=e.ctrlpts,D,x,N,O;if(T.length/2%2===0){var R=d.length/2-1,P=R+2,M=P+2;D=mt(d[R],d[P],d[M],0),x=mt(d[R+1],d[P+1],d[M+1],0),N=mt(d[R],d[P],d[M],1e-4),O=mt(d[R+1],d[P+1],d[M+1],1e-4)}else{var P=d.length/2-1,R=P-2,M=P+2;D=mt(d[R],d[P],d[M],.4999),x=mt(d[R+1],d[P+1],d[M+1],.4999),N=mt(d[R],d[P],d[M],.5),O=mt(d[R+1],d[P+1],d[M+1],.5)}u=N-D,l=O-x}if(e.midtgtArrowAngle=Sn(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var d=e.allpts;if(d.length/2%2!==0){if(!e.isRound){var m=d.length/2-1,I=m+2;u=-(d[I]-d[m]),l=-(d[I+1]-d[m+1])}}}if(e.midsrcArrowAngle=Sn(u,l),i)u=v-e.segpts[e.segpts.length-2],l=c-e.segpts[e.segpts.length-1];else if(n||o||s||a){var d=e.allpts,E=d.length,p=mt(d[E-6],d[E-4],d[E-2],.9),y=mt(d[E-5],d[E-3],d[E-1],.9);u=v-p,l=c-y}else u=v-g,l=c-b;e.tgtArrowAngle=Sn(u,l)};oi.getArrowWidth=oi.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];return a||(a=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=a,a)};var Ps,Is,Kt={},zt={},kf,Bf,zr,_n,ar,Pr,Br,Xt,aa,Pn,Wc,Xc,ks,Bs,Ff,zf=function(e,r,a){a.x=r.x-e.x,a.y=r.y-e.y,a.len=Math.sqrt(a.x*a.x+a.y*a.y),a.nx=a.x/a.len,a.ny=a.y/a.len,a.ang=Math.atan2(a.ny,a.nx)},m0=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},b0=function(e,r,a,n,i){if(e!==Ff?zf(r,e,Kt):m0(zt,Kt),zf(r,a,zt),kf=Kt.nx*zt.ny-Kt.ny*zt.nx,Bf=Kt.nx*zt.nx-Kt.ny*-zt.ny,ar=Math.asin(Math.max(-1,Math.min(1,kf))),Math.abs(ar)<1e-6){Ps=r.x,Is=r.y,Br=aa=0;return}zr=1,_n=!1,Bf<0?ar<0?ar=Math.PI+ar:(ar=Math.PI-ar,zr=-1,_n=!0):ar>0&&(zr=-1,_n=!0),r.radius!==void 0?aa=r.radius:aa=n,Pr=ar/2,Pn=Math.min(Kt.len/2,zt.len/2),i?(Xt=Math.abs(Math.cos(Pr)*aa/Math.sin(Pr)),Xt>Pn?(Xt=Pn,Br=Math.abs(Xt*Math.sin(Pr)/Math.cos(Pr))):Br=aa):(Xt=Math.min(Pn,aa),Br=Math.abs(Xt*Math.sin(Pr)/Math.cos(Pr))),ks=r.x+zt.nx*Xt,Bs=r.y+zt.ny*Xt,Ps=ks-zt.ny*Br*zr,Is=Bs+zt.nx*Br*zr,Wc=r.x+Kt.nx*Xt,Xc=r.y+Kt.ny*Xt,Ff=r};function $c(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function cu(t,e,r,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(b0(t,e,r,a,n),{cx:Ps,cy:Is,radius:Br,startX:Wc,startY:Xc,stopX:ks,stopY:Bs,startAngle:Kt.ang+Math.PI/2*zr,endAngle:zt.ang-Math.PI/2*zr,counterClockwise:_n})}var an=.01,w0=Math.sqrt(2*an),At={};At.findMidptPtsEtc=function(t,e){var r=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),u=o.units!=null&&s.units!=null,l=function(T,D,x,N){var O=N-D,R=x-T,P=Math.sqrt(R*R+O*O);return{x:-O/P,y:R/P}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":{if(u){var h=this.manualEndptToPx(t.source()[0],o),v=ft(h,2),c=v[0],d=v[1],p=this.manualEndptToPx(t.target()[0],s),y=ft(p,2),g=y[0],b=y[1],m={x1:c,y1:d,x2:g,y2:b};n=l(c,d,g,b),i=m}else Ke("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};At.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var i=Math.random()*2*Math.PI;n.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,n.target={x:Math.cos(i),y:Math.sin(i)}}var o=a.source,s=a.target,u=o.position(),l=s.position(),f=o.width(),h=s.width(),v=o.height(),c=s.height(),d=r.pstyle("haystack-radius").value,p=d/2;n.haystackPts=n.allpts=[n.source.x*f*p+u.x,n.source.y*v*p+u.y,n.target.x*h*p+l.x,n.target.y*c*p+l.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};At.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),s=Math.min(a.pfValue.length,n.pfValue.length),u=i.pfValue[i.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<s;f++){var h=a.pfValue[f],v=n.pfValue[f],c=1-h,d=h,p=this.findMidptPtsEtc(t,e),y=p.midptPts,g=p.vectorNormInverse,b={x:y.x1*c+y.x2*d,y:y.y1*c+y.y2*d};r.segpts.push(b.x+g.x*v,b.y+g.y*v),r.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:u),r.isArcRadius.push((o.pfValue[f]!==void 0?o.pfValue[f]:l)==="arc-radius")}};At.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,i=e.dirCounts,o=e.srcPos,s=t.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,h=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var v=r,c=h;a&&(v=0,c=u);var d=l-Math.PI/2,p=d-f/2,y=d+f/2,g=l+"_"+f;v=i[g]===void 0?i[g]=0:++i[g],n.ctrlpts=[o.x+Math.cos(p)*1.4*c*(v/3+1),o.y+Math.sin(p)*1.4*c*(v/3+1),o.x+Math.cos(y)*1.4*c*(v/3+1),o.y+Math.sin(y)*1.4*c*(v/3+1)]};At.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,h=t.pstyle("control-point-step-size").pfValue,v=t.pstyle("control-point-distances"),c=v?v.pfValue[0]:void 0,d=r,p=h;a&&(d=0,p=c);var y=50,g={x:i.x-s/2,y:i.y-u/2},b={x:o.x-l/2,y:o.y-f/2},m={x:Math.min(g.x,b.x),y:Math.min(g.y,b.y)},w=.5,T=Math.max(w,Math.log(s*an)),D=Math.max(w,Math.log(l*an));n.ctrlpts=[m.x,m.y-(1+Math.pow(y,1.12)/100)*p*(d/3+1)*T,m.x-(1+Math.pow(y,1.12)/100)*p*(d/3+1)*D,m.y]};At.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};At.findBezierPoints=function(t,e,r,a,n){var i=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,s=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),l=s&&u?Math.min(s.value.length,u.value.length):1,f=s?s.pfValue[0]:void 0,h=u.value[0],v=a;i.edgeType=v?"multibezier":"bezier",i.ctrlpts=[];for(var c=0;c<l;c++){var d=(.5-e.eles.length/2+r)*o*(n?-1:1),p=void 0,y=js(d);v&&(f=s?s.pfValue[c]:o,h=u.value[c]),a?p=f:p=f!==void 0?y*f:void 0;var g=p!==void 0?p:d,b=1-h,m=h,w=this.findMidptPtsEtc(t,e),T=w.midptPts,D=w.vectorNormInverse,x={x:T.x1*b+T.x2*m,y:T.y1*b+T.y2*m};i.ctrlpts.push(x.x+D.x*g,x.y+D.y*g)}};At.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",i="leftward",o="rightward",s="downward",u="upward",l="auto",f=e.posPts,h=e.srcW,v=e.srcH,c=e.tgtW,d=e.tgtH,p=t.pstyle("edge-distances").value,y=p!=="node-position",g=t.pstyle("taxi-direction").value,b=g,m=t.pstyle("taxi-turn"),w=m.units==="%",T=m.pfValue,D=T<0,x=t.pstyle("taxi-turn-min-distance").pfValue,N=y?(h+c)/2:0,O=y?(v+d)/2:0,R=f.x2-f.x1,P=f.y2-f.y1,M=function(G,X){return G>0?Math.max(G-X,0):Math.min(G+X,0)},I=M(R,N),E=M(P,O),A=!1;b===l?g=Math.abs(I)>Math.abs(E)?n:a:b===u||b===s?(g=a,A=!0):(b===i||b===o)&&(g=n,A=!0);var C=g===a,S=C?E:I,L=C?P:R,V=js(L),F=!1;!(A&&(w||D))&&(b===s&&L<0||b===u&&L>0||b===i&&L>0||b===o&&L<0)&&(V*=-1,S=V*Math.abs(S),F=!0);var B;if(w){var Y=T<0?1+T:T;B=Y*S}else{var q=T<0?S:0;B=q+T*V}var Q=function(G){return Math.abs(G)<x||Math.abs(G)>=Math.abs(S)},$=Q(B),K=Q(Math.abs(S)-Math.abs(B)),j=$||K;if(j&&!F)if(C){var re=Math.abs(L)<=v/2,U=Math.abs(R)<=c/2;if(re){var H=(f.x1+f.x2)/2,_=f.y1,W=f.y2;r.segpts=[H,_,H,W]}else if(U){var J=(f.y1+f.y2)/2,te=f.x1,de=f.x2;r.segpts=[te,J,de,J]}else r.segpts=[f.x1,f.y2]}else{var Te=Math.abs(L)<=h/2,ge=Math.abs(P)<=d/2;if(Te){var le=(f.y1+f.y2)/2,he=f.x1,fe=f.x2;r.segpts=[he,le,fe,le]}else if(ge){var ve=(f.x1+f.x2)/2,ye=f.y1,me=f.y2;r.segpts=[ve,ye,ve,me]}else r.segpts=[f.x2,f.y1]}else if(C){var xe=f.y1+B+(y?v/2*V:0),Le=f.x1,ke=f.x2;r.segpts=[Le,xe,ke,xe]}else{var Fe=f.x1+B+(y?h/2*V:0),Be=f.y1,Oe=f.y2;r.segpts=[Fe,Be,Fe,Oe]}if(r.isRound){var ne=t.pstyle("taxi-radius").value,k=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ne),r.isArcRadius=new Array(r.segpts.length/2).fill(k)}};At.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,h=e.srcCornerRadius,v=e.tgtCornerRadius,c=e.srcRs,d=e.tgtRs,p=!be(r.startX)||!be(r.startY),y=!be(r.arrowStartX)||!be(r.arrowStartY),g=!be(r.endX)||!be(r.endY),b=!be(r.arrowEndX)||!be(r.arrowEndY),m=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=m*w,D=qr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),x=D<T,N=qr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),O=N<T,R=!1;if(p||y||x){R=!0;var P={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},M=Math.sqrt(P.x*P.x+P.y*P.y),I={x:P.x/M,y:P.y/M},E=Math.max(i,o),A={x:r.ctrlpts[0]+I.x*2*E,y:r.ctrlpts[1]+I.y*2*E},C=l.intersectLine(a.x,a.y,i,o,A.x,A.y,0,h,c);x?(r.ctrlpts[0]=r.ctrlpts[0]+I.x*(T-D),r.ctrlpts[1]=r.ctrlpts[1]+I.y*(T-D)):(r.ctrlpts[0]=C[0]+I.x*T,r.ctrlpts[1]=C[1]+I.y*T)}if(g||b||O){R=!0;var S={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},L=Math.sqrt(S.x*S.x+S.y*S.y),V={x:S.x/L,y:S.y/L},F=Math.max(i,o),B={x:r.ctrlpts[0]+V.x*2*F,y:r.ctrlpts[1]+V.y*2*F},Y=f.intersectLine(n.x,n.y,s,u,B.x,B.y,0,v,d);O?(r.ctrlpts[0]=r.ctrlpts[0]+V.x*(T-N),r.ctrlpts[1]=r.ctrlpts[1]+V.y*(T-N)):(r.ctrlpts[0]=Y[0]+V.x*T,r.ctrlpts[1]=Y[1]+V.y*T)}R&&this.findEndpoints(t)}};At.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=mt(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=mt(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(cu({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var h={x:e.segpts[f],y:e.segpts[f+1]},v=e.roundCorners[f/2];if(v.radius===0){var c={x:e.segpts[f+2],y:e.segpts[f+3]};e.midX=h.x,e.midY=h.y,e.midVector=[h.y-c.y,c.x-h.x]}else{var d=[h.x-v.cx,h.y-v.cy],p=v.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map(function(y){return y*p}),e.midX=v.cx+d[0],e.midY=v.cy+d[1],e.midVector=d}}}}};At.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||be(e.startX)&&be(e.startY)&&be(e.endX)&&be(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ke("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};At.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy,n=a.hasCompoundNodes(),i=new nr,o=function(O,R){return[].concat(Zn(O),[R?1:0]).join("-")},s=[],u=[],l=0;l<t.length;l++){var f=t[l],h=f._private,v=f.pstyle("curve-style").value;if(!(f.removed()||!f.takesUpSpace())){if(v==="haystack"){u.push(f);continue}var c=v==="unbundled-bezier"||dr(v,"segments")||v==="straight"||v==="straight-triangle"||dr(v,"taxi"),d=v==="unbundled-bezier"||v==="bezier",p=h.source,y=h.target,g=p.poolIndex(),b=y.poolIndex(),m=[g,b].sort(),w=o(m,c),T=i.get(w);T==null&&(T={eles:[]},s.push({pairId:m,edgeIsUnbundled:c}),i.set(w,T)),T.eles.push(f),c&&(T.hasUnbundled=!0),d&&(T.hasBezier=!0)}}for(var D=function(){var O=s[x],R=O.pairId,P=O.edgeIsUnbundled,M=o(R,P),I=i.get(M),E;if(!I.hasUnbundled){var A=I.eles[0].parallelEdges().filter(function(k){return k.isBundledBezier()});Qs(I.eles),A.forEach(function(k){return I.eles.push(k)}),I.eles.sort(function(k,z){return k.poolIndex()-z.poolIndex()})}var C=I.eles[0],S=C.source(),L=C.target();if(S.poolIndex()>L.poolIndex()){var V=S;S=L,L=V}var F=I.srcPos=S.position(),B=I.tgtPos=L.position(),Y=I.srcW=S.outerWidth(),q=I.srcH=S.outerHeight(),Q=I.tgtW=L.outerWidth(),$=I.tgtH=L.outerHeight(),K=I.srcShape=r.nodeShapes[e.getNodeShape(S)],j=I.tgtShape=r.nodeShapes[e.getNodeShape(L)],re=I.srcCornerRadius=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,U=I.tgtCornerRadius=L.pstyle("corner-radius").value==="auto"?"auto":L.pstyle("corner-radius").pfValue,H=I.tgtRs=L._private.rscratch,_=I.srcRs=S._private.rscratch;I.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var W=0;W<I.eles.length;W++){var J=I.eles[W],te=J[0]._private.rscratch,de=J.pstyle("curve-style").value,Te=de==="unbundled-bezier"||dr(de,"segments")||dr(de,"taxi"),ge=!S.same(J.source());if(!I.calculatedIntersection&&S!==L&&(I.hasBezier||I.hasUnbundled)){I.calculatedIntersection=!0;var le=K.intersectLine(F.x,F.y,Y,q,B.x,B.y,0,re,_),he=I.srcIntn=le,fe=j.intersectLine(B.x,B.y,Q,$,F.x,F.y,0,U,H),ve=I.tgtIntn=fe,ye=I.intersectionPts={x1:le[0],x2:fe[0],y1:le[1],y2:fe[1]},me=I.posPts={x1:F.x,x2:B.x,y1:F.y,y2:B.y},xe=fe[1]-le[1],Le=fe[0]-le[0],ke=Math.sqrt(Le*Le+xe*xe);be(ke)&&ke>=w0||(ke=Math.sqrt(Math.max(Le*Le,an)+Math.max(xe*xe,an)));var Fe=I.vector={x:Le,y:xe},Be=I.vectorNorm={x:Fe.x/ke,y:Fe.y/ke},Oe={x:-Be.y,y:Be.x};I.nodesOverlap=!be(ke)||j.checkPoint(le[0],le[1],0,Q,$,B.x,B.y,U,H)||K.checkPoint(fe[0],fe[1],0,Y,q,F.x,F.y,re,_),I.vectorNormInverse=Oe,E={nodesOverlap:I.nodesOverlap,dirCounts:I.dirCounts,calculatedIntersection:!0,hasBezier:I.hasBezier,hasUnbundled:I.hasUnbundled,eles:I.eles,srcPos:B,srcRs:H,tgtPos:F,tgtRs:_,srcW:Q,srcH:$,tgtW:Y,tgtH:q,srcIntn:ve,tgtIntn:he,srcShape:j,tgtShape:K,posPts:{x1:me.x2,y1:me.y2,x2:me.x1,y2:me.y1},intersectionPts:{x1:ye.x2,y1:ye.y2,x2:ye.x1,y2:ye.y1},vector:{x:-Fe.x,y:-Fe.y},vectorNorm:{x:-Be.x,y:-Be.y},vectorNormInverse:{x:-Oe.x,y:-Oe.y}}}var ne=ge?E:I;te.nodesOverlap=ne.nodesOverlap,te.srcIntn=ne.srcIntn,te.tgtIntn=ne.tgtIntn,te.isRound=de.startsWith("round"),n&&(S.isParent()||S.isChild()||L.isParent()||L.isChild())&&(S.parents().anySame(L)||L.parents().anySame(S)||S.same(L)&&S.isParent())?e.findCompoundLoopPoints(J,ne,W,Te):S===L?e.findLoopPoints(J,ne,W,Te):de.endsWith("segments")?e.findSegmentsPoints(J,ne):de.endsWith("taxi")?e.findTaxiPoints(J,ne):de==="straight"||!Te&&I.eles.length%2===1&&W===Math.floor(I.eles.length/2)?e.findStraightEdgePoints(J):e.findBezierPoints(J,ne,W,Te,ge),e.findEndpoints(J),e.tryToCorrectInvalidPoints(J,ne),e.checkForInvalidEdgeWarning(J),e.storeAllpts(J),e.storeEdgeProjections(J),e.calculateArrowAngles(J),e.recalculateEdgeLabelProjections(J),e.calculateLabelAngles(J)}},x=0;x<s.length;x++)D();this.findHaystackPoints(u)}};function Kc(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}}At.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return Kc(e.segpts)};At.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return Kc(e.ctrlpts)};At.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var pn={};pn.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight(),o=t._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*n),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=a.x,s[1]+=a.y,s}else{var u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(n,i),f=[a.x+Math.cos(u)*l,a.y+Math.sin(u)*l];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,i,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,o)}};pn.findEndpoints=function(t){var e,r,a,n,i=this,o,s=t.source()[0],u=t.target()[0],l=s.position(),f=u.position(),h=t.pstyle("target-arrow-shape").value,v=t.pstyle("source-arrow-shape").value,c=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,p=s._private.rscratch,y=u._private.rscratch,g=t.pstyle("curve-style").value,b=t._private.rscratch,m=b.edgeType,w=dr(g,"taxi"),T=m==="self"||m==="compound",D=m==="bezier"||m==="multibezier"||T,x=m!=="bezier",N=m==="straight"||m==="segments",O=m==="segments",R=D||x||N,P=T||w,M=t.pstyle("source-endpoint"),I=P?"outside-to-node":M.value,E=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,A=t.pstyle("target-endpoint"),C=P?"outside-to-node":A.value,S=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue;b.srcManEndpt=M,b.tgtManEndpt=A;var L,V,F,B,Y=(e=(A==null||(r=A.pfValue)===null||r===void 0?void 0:r.length)===2?A.pfValue:null)!==null&&e!==void 0?e:[0,0],q=(a=(M==null||(n=M.pfValue)===null||n===void 0?void 0:n.length)===2?M.pfValue:null)!==null&&a!==void 0?a:[0,0];if(D){var Q=[b.ctrlpts[0],b.ctrlpts[1]],$=x?[b.ctrlpts[b.ctrlpts.length-2],b.ctrlpts[b.ctrlpts.length-1]]:Q;L=$,V=Q}else if(N){var K=O?b.segpts.slice(0,2):[f.x+Y[0],f.y+Y[1]],j=O?b.segpts.slice(b.segpts.length-2):[l.x+q[0],l.y+q[1]];L=j,V=K}if(C==="inside-to-node")o=[f.x,f.y];else if(A.units)o=this.manualEndptToPx(u,A);else if(C==="outside-to-line")o=b.tgtIntn;else if(C==="outside-to-node"||C==="outside-to-node-or-label"?F=L:(C==="outside-to-line"||C==="outside-to-line-or-label")&&(F=[l.x,l.y]),o=i.nodeShapes[this.getNodeShape(u)].intersectLine(f.x,f.y,u.outerWidth(),u.outerHeight(),F[0],F[1],0,S,y),C==="outside-to-node-or-label"||C==="outside-to-line-or-label"){var re=u._private.rscratch,U=re.labelWidth,H=re.labelHeight,_=re.labelX,W=re.labelY,J=U/2,te=H/2,de=u.pstyle("text-valign").value;de=wa(de),de==="top"?W-=te:de==="bottom"&&(W+=te);var Te=u.pstyle("text-halign").value;Te=ba(Te),Te==="left"?_-=J:Te==="right"&&(_+=J);var ge=Ja(F[0],F[1],[_-J,W-te,_+J,W-te,_+J,W+te,_-J,W+te],f.x,f.y);if(ge.length>0){var le=l,he=kr(le,ua(o)),fe=kr(le,ua(ge)),ve=he;if(fe<he&&(o=ge,ve=fe),ge.length>2){var ye=kr(le,{x:ge[2],y:ge[3]});ye<ve&&(o=[ge[2],ge[3]])}}}var me=Dn(o,L,i.arrowShapes[h].spacing(t)+c),xe=Dn(o,L,i.arrowShapes[h].gap(t)+c);if(b.endX=xe[0],b.endY=xe[1],b.arrowEndX=me[0],b.arrowEndY=me[1],I==="inside-to-node")o=[l.x,l.y];else if(M.units)o=this.manualEndptToPx(s,M);else if(I==="outside-to-line")o=b.srcIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?B=V:(I==="outside-to-line"||I==="outside-to-line-or-label")&&(B=[f.x,f.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),B[0],B[1],0,E,p),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var Le=s._private.rscratch,ke=Le.labelWidth,Fe=Le.labelHeight,Be=Le.labelX,Oe=Le.labelY,ne=ke/2,k=Fe/2,z=s.pstyle("text-valign").value;z=wa(z),z==="top"?Oe-=k:z==="bottom"&&(Oe+=k);var G=s.pstyle("text-halign").value;G=ba(G),G==="left"?Be-=ne:G==="right"&&(Be+=ne);var X=Ja(B[0],B[1],[Be-ne,Oe-k,Be+ne,Oe-k,Be+ne,Oe+k,Be-ne,Oe+k],l.x,l.y);if(X.length>0){var Z=f,ae=kr(Z,ua(o)),ee=kr(Z,ua(X)),ie=ae;if(ee<ae&&(o=[X[0],X[1]],ie=ee),X.length>2){var se=kr(Z,{x:X[2],y:X[3]});se<ie&&(o=[X[2],X[3]])}}}var oe=Dn(o,V,i.arrowShapes[v].spacing(t)+d),ue=Dn(o,V,i.arrowShapes[v].gap(t)+d);b.startX=ue[0],b.startY=ue[1],b.arrowStartX=oe[0],b.arrowStartY=oe[1],R&&(!be(b.startX)||!be(b.startY)||!be(b.endX)||!be(b.endY)?b.badLine=!0:b.badLine=!1)};pn.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};pn.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var vu={};function E0(t,e,r){for(var a=function(l,f,h,v){return mt(l,f,h,v)},n=e._private,i=n.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var s=t.bezierProjPcts[o];i.push({x:a(r[0],r[2],r[4],s),y:a(r[1],r[3],r[5],s)})}}vu.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,a=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)E0(this,t,r.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],n=0;n+1<r.allpts.length;n+=2)i.push({x:r.allpts[n],y:r.allpts[n+1]});else if(a==="haystack"){var o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};vu.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var er={};er.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!br(e)){var r,a,n=t._private,i=t.width(),o=t.height(),s=t.padding(),u=t.position(),l=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,h=n.rscratch,v=n.rstyle;switch(l){case"left":r=u.x-i/2-s;break;case"left-inside":r=u.x-i/2+s;break;case"right":r=u.x+i/2+s;break;case"right-inside":r=u.x+i/2-s;break;default:r=u.x}switch(f){case"top":a=u.y-o/2-s;break;case"top-inside":a=u.y-o/2+s;break;case"bottom":a=u.y+o/2+s;break;case"bottom-inside":a=u.y+o/2-s;break;default:a=u.y}h.labelX=r,h.labelY=a,v.labelX=r,v.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var Zc=function(e,r){var a=Math.atan(r/e);return e===0&&a<0&&(a=a*-1),a},Qc=function(e,r){var a=r.x-e.x,n=r.y-e.y;return Zc(a,n)},x0=function(e,r,a,n){var i=Qa(0,n-.001,1),o=Qa(0,n+.001,1),s=ha(e,r,a,i),u=ha(e,r,a,o);return Qc(s,u)};er.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:a.midX,y:a.midY};var o=function(h,v,c){Zt(r.rscratch,h,v,c),Zt(r.rstyle,h,v,c)};o("labelX",null,e.x),o("labelY",null,e.y);var s=Zc(a.midDispX,a.midDispY);o("labelAutoAngle",null,s);var u=function(){if(u.cache)return u.cache;for(var h=[],v=0;v+5<a.allpts.length;v+=4){var c={x:a.allpts[v],y:a.allpts[v+1]},d={x:a.allpts[v+2],y:a.allpts[v+3]},p={x:a.allpts[v+4],y:a.allpts[v+5]};h.push({p0:c,p1:d,p2:p,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,g=n.bezierProjPcts.length;function b(x,N,O,R,P){var M=qr(N,O),I=x.segments[x.segments.length-1],E={p0:N,p1:O,t0:R,t1:P,startDist:I?I.startDist+I.length:0,length:M};x.segments.push(E),x.length+=M}for(var m=0;m<h.length;m++){var w=h[m],T=h[m-1];T&&(w.startDist=T.startDist+T.length),b(w,w.p0,y[m*g],0,n.bezierProjPcts[0]);for(var D=0;D<g-1;D++)b(w,y[m*g+D],y[m*g+D+1],n.bezierProjPcts[D],n.bezierProjPcts[D+1]);b(w,y[m*g+g-1],w.p2,n.bezierProjPcts[g-1],1)}return u.cache=h},l=function(h){var v,c=h==="source";if(i[h]){var d=t.pstyle(h+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=u(),y,g=0,b=0,m=0;m<p.length;m++){for(var w=p[c?m:p.length-1-m],T=0;T<w.segments.length;T++){var D=w.segments[c?T:w.segments.length-1-T],x=m===p.length-1&&T===w.segments.length-1;if(g=b,b+=D.length,b>=d||x){y={cp:w,segment:D};break}}if(y)break}var N=y.cp,O=y.segment,R=(d-g)/O.length,P=O.t1-O.t0,M=c?O.t0+P*R:O.t1-P*R;M=Qa(0,M,1),e=ha(N.p0,N.p1,N.p2,M),v=x0(N.p0,N.p1,N.p2,M);break}case"straight":case"segments":case"haystack":{for(var I=0,E,A,C,S,L=a.allpts.length,V=0;V+3<L&&(c?(C={x:a.allpts[V],y:a.allpts[V+1]},S={x:a.allpts[V+2],y:a.allpts[V+3]}):(C={x:a.allpts[L-2-V],y:a.allpts[L-1-V]},S={x:a.allpts[L-4-V],y:a.allpts[L-3-V]}),E=qr(C,S),A=I,I+=E,!(I>=d));V+=2);var F=d-A,B=F/E;B=Qa(0,B,1),e=Yg(C,S,B),v=Qc(C,S);break}}o("labelX",h,e.x),o("labelY",h,e.y),o("labelAutoAngle",h,v)}};l("source"),l("target"),this.applyLabelDimensions(t)}};er.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};er.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=Yr(a,t._private.labelDimsKey);if(Mt(r.rscratch,"prefixedLabelDimsKey",e)!==n){Zt(r.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(t,a),o=t.pstyle("line-height").pfValue,s=t.pstyle("font-size").pfValue,u=t.pstyle("text-wrap").strValue,l=Mt(r.rscratch,"labelWrapCachedLines",e)||[],f=u!=="wrap"?1:Math.max(l.length,1),h=s*o,v=i.width,c=i.height+(f-1)*(o-1)*s;Zt(r.rstyle,"labelWidth",e,v),Zt(r.rscratch,"labelWidth",e,v),Zt(r.rstyle,"labelHeight",e,c),Zt(r.rscratch,"labelHeight",e,c),Zt(r.rscratch,"labelLineHeight",e,h),Zt(r.rscratch,"labelActualDescent",e,i.labelActualDescent)}};er.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,o=function(q,Q){return Q?(Zt(r.rscratch,q,e,Q),Q):Mt(r.rscratch,q,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l="​",f=n.split(`
15
15
  `),h=t.pstyle("text-max-width").pfValue,v=t.pstyle("text-overflow-wrap").value,c=v==="anywhere",d=[],p=/[\s\u200b]+|$/g,y=0;y<f.length;y++){var g=f[y],b=this.calculateLabelDimensions(t,g),m=b.width;if(c){var w=g.split("").join(l);g=w}if(m>h){var T=g.matchAll(p),D="",x=0,N=kt(T),O;try{for(N.s();!(O=N.n()).done;){var R=O.value,P=R[0],M=g.substring(x,R.index);x=R.index+P.length;var I=D.length===0?M:D+M+P,E=this.calculateLabelDimensions(t,I),A=E.width;A<=h?D+=M+P:(D&&d.push(D),D=M+P)}}catch(Y){N.e(Y)}finally{N.f()}D.match(/^[\s\u200b]+$/)||d.push(D)}else d.push(g)}o("labelWrapCachedLines",d),n=o("labelWrapCachedText",d.join(`
16
16
  `)),o("labelWrapKey",u)}else if(s==="ellipsis"){var C=t.pstyle("text-max-width").pfValue,S="",L="…",V=!1;if(this.calculateLabelDimensions(t,n).width<C)return n;for(var F=0;F<n.length;F++){var B=this.calculateLabelDimensions(t,S+n[F]+L).width;if(B>C)break;S+=n[F],F===n.length-1&&(V=!0)}return V||(S+=L),S}return n};er.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?lm(r):"center":e};er.calculateLabelDimensions=function(t,e){var r=this,a=r.cy.window(),n=a.document,i=0,o=t.pstyle("font-style").strValue,s=t.pstyle("font-size").pfValue,u=t.pstyle("font-family").strValue,l=t.pstyle("font-weight").strValue,f=t.pstyle("text-metrics").strValue||"font",h=this.labelCalcCanvas,v=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=n.createElement("canvas"),v=this.labelCalcCanvasContext=h.getContext("2d");var c=h.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}v.font="".concat(o," ").concat(l," ").concat(s,"px ").concat(u);for(var d=0,p=0,y=e.split(`
17
- `),g=y.length,b=0,m=0,w=0;w<g;w++){var T=y[w],D=v.measureText(T),x=Math.ceil(D.width),N=s;f==="glyph"&&(w===0&&(m=D.actualBoundingBoxAscent),w===g-1&&(b=D.actualBoundingBoxDescent)),d=Math.max(x,d),p+=N}return f==="glyph"&&(p-=s-m-b),d+=i,p+=i,{width:d,height:p,labelActualAscent:m,labelActualDescent:b}};er.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:n&&s==="autorotate"?a.labelAutoAngle:s==="autorotate"?0:o.pfValue};er.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(t),r&&(n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var Jc={},Vf=28,Gf=!1;Jc.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Vf||t.height()<Vf))return Gf||(Ke("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Gf=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var a=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return r};var Mi={};Mi.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,a=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var u=0;u<o.length;u++){var l=o[u],f=l._private,h=f.rstyle;h.clean=!1,h.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var s=o.target;a(s)}).on("style.* background.*",function(o){var s=o.target;a(s,!1)});var n=function(o){if(o){var s=r.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],f=l._private.rstyle;l.isNode()&&!f.cleanConnected&&(a(l.connectedEdges()),f.cleanConnected=!0)}if(s)for(var h=0;h<s.length;h++){var v=s[h];v(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)};Mi.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};Mi.recalculateRenderedStyle=function(t,e){var r=function(w){return w._private.rstyle.cleanConnected};if(t.length!==0){var a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var o=t[i],s=o._private,u=s.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(u.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(m){return!m._private.rstyle.clean&&m.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?n.push(o):a.push(o),u.clean=!0)}for(var l=0;l<n.length;l++){var f=n[l],h=f._private,v=h.rstyle,c=f.position();this.recalculateNodeLabelProjection(f),v.nodeX=c.x,v.nodeY=c.y,v.nodeW=f.pstyle("width").pfValue,v.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var p=a[d],y=p._private,g=y.rstyle,b=y.rscratch;g.srcX=b.arrowStartX,g.srcY=b.arrowStartY,g.tgtX=b.arrowEndX,g.tgtY=b.arrowEndY,g.midX=b.midX,g.midY=b.midY,g.labelAngle=b.labelAngle,g.sourceLabelAngle=b.sourceLabelAngle,g.targetLabelAngle=b.targetLabelAngle}}}};var Ri={};Ri.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?t.drag.push(a):t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}}};Ri.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Ri.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Pc),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var jc={};[Xr,oi,At,pn,vu,er,Jc,Mi,Ri].forEach(function(t){Ie(jc,t)});var ev={};ev.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},i=n[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=n[t]=n[t]||{};var o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var s="data:",u=t.substring(0,s.length).toLowerCase()===s;return u||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var tv=function(e,r){var a=e[0];!a||a._private.grabbed===r||(a._private.grabbed=r,e.updateStyle(!1))},T0=function(e){tv(e,!0)},C0=function(e){tv(e,!1)},Aa={};Aa.registerBinding=function(t,e,r,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var s=t[o];if(s!==void 0){var u=this.binder(s);i.push(u.on.apply(u,n))}}return i}var u=this.binder(t);return u.on.apply(u,n)};Aa.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||Pd(t);if(e.supportsPassiveEvents==null){var n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=n}var o=function(u,l,f){var h=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(h[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:h}),(t.addEventListener||t.on).apply(t,h),this};return{on:o,addEventListener:o,addListener:o,bind:o}};Aa.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Aa.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Aa.load=function(){var t=this,e=t.cy.window(),r=function(k){return k.selected()},a=function(k){var z=k.getRootNode();if(z&&z.nodeType===11&&z.host!==void 0)return z},n=function(k,z,G,X){k==null&&(k=t.cy);for(var Z=0;Z<z.length;Z++){var ae=z[Z];k.emit({originalEvent:G,type:ae,position:X})}},i=function(k){return k.shiftKey||k.metaKey||k.ctrlKey},o=function(k,z){var G=!0;if(t.cy.hasCompoundNodes()&&k&&k.pannable())for(var X=0;z&&X<z.length;X++){var k=z[X];if(k.isNode()&&k.isParent()&&!k.pannable()){G=!1;break}}else G=!0;return G},s=function(k){k[0]._private.rscratch.inDragLayer=!0},u=function(k){k[0]._private.rscratch.inDragLayer=!1},l=function(k){k[0]._private.rscratch.isGrabTarget=!0},f=function(k){k[0]._private.rscratch.isGrabTarget=!1},h=function(k,z){var G=z.addToList,X=G.has(k);!X&&k.grabbable()&&!k.locked()&&(G.merge(k),T0(k))},v=function(k,z){if(k.cy().hasCompoundNodes()&&!(z.inDragLayer==null&&z.addToList==null)){var G=k.descendants();z.inDragLayer&&(G.forEach(s),G.connectedEdges().forEach(s)),z.addToList&&h(G,z)}},c=function(k,z){z=z||{};var G=k.cy().hasCompoundNodes();z.inDragLayer&&(k.forEach(s),k.neighborhood().stdFilter(function(X){return!G||X.isEdge()}).forEach(s)),z.addToList&&k.forEach(function(X){h(X,z)}),v(k,z),y(k,{inDragLayer:z.inDragLayer}),t.updateCachedGrabbedEles()},d=c,p=function(k){k&&(t.getCachedZSortedEles().forEach(function(z){C0(z),u(z),f(z)}),t.updateCachedGrabbedEles())},y=function(k,z){if(!(z.inDragLayer==null&&z.addToList==null)&&k.cy().hasCompoundNodes()){var G=k.ancestors().orphans();if(!G.same(k)){var X=G.descendants().spawnSelf().merge(G).unmerge(k).unmerge(k.descendants()),Z=X.connectedEdges();z.inDragLayer&&(Z.forEach(s),X.forEach(s)),z.addToList&&X.forEach(function(ae){h(ae,z)})}}},g=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},b=typeof MutationObserver<"u",m=typeof ResizeObserver<"u";b?(t.removeObserver=new MutationObserver(function(ne){for(var k=0;k<ne.length;k++){var z=ne[k],G=z.removedNodes;if(G)for(var X=0;X<G.length;X++){var Z=G[X];if(Z===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(ne){t.destroy()});var w=cn(function(){t.cy.resize()},100);b&&(t.styleObserver=new MutationObserver(w),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",w),m&&(t.resizeObserver=new ResizeObserver(w),t.resizeObserver.observe(t.container));var T=function(k,z){for(;k!=null;)z(k),k=k.parentNode},D=function(){t.invalidateContainerClientCoordsCache()};T(t.container,function(ne){t.registerBinding(ne,"transitionend",D),t.registerBinding(ne,"animationend",D),t.registerBinding(ne,"scroll",D)}),t.registerBinding(t.container,"contextmenu",function(ne){ne.preventDefault()});var x=function(){return t.selection[4]!==0},N=function(k){for(var z=t.findContainerClientCoords(),G=z[0],X=z[1],Z=z[2],ae=z[3],ee=k.touches?k.touches:[k],ie=!1,se=0;se<ee.length;se++){var oe=ee[se];if(G<=oe.clientX&&oe.clientX<=G+Z&&X<=oe.clientY&&oe.clientY<=X+ae){ie=!0;break}}if(!ie)return!1;for(var ue=t.container,pe=k.target,ce=pe.parentNode,we=!1;ce;){if(ce===ue){we=!0;break}ce=ce.parentNode}return!!we};t.registerBinding(t.container,"mousedown",function(k){if(N(k)&&!(t.hoverData.which===1&&k.which!==1)){k.preventDefault(),g(),t.hoverData.capture=!0,t.hoverData.which=k.which;var z=t.cy,G=[k.clientX,k.clientY],X=t.projectIntoViewport(G[0],G[1]),Z=t.selection,ae=t.findNearestElements(X[0],X[1],!0,!1),ee=ae[0],ie=t.dragData.possibleDragElements;t.hoverData.mdownPos=X,t.hoverData.mdownGPos=G;var se=function(Ne){return{originalEvent:k,type:Ne,position:{x:X[0],y:X[1]}}},oe=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Ne=t.hoverData.down;Ne?Ne.emit(se("taphold")):z.emit(se("taphold"))}},t.tapholdDuration)};if(k.which==3){t.hoverData.cxtStarted=!0;var ue={originalEvent:k,type:"cxttapstart",position:{x:X[0],y:X[1]}};ee?(ee.activate(),ee.emit(ue),t.hoverData.down=ee):z.emit(ue),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(k.which==1){ee&&ee.activate();{if(ee!=null&&t.nodeIsGrabbable(ee)){var pe=function(Ne){Ne.emit(se("grab"))};if(l(ee),!ee.selected())ie=t.dragData.possibleDragElements=z.collection(),d(ee,{addToList:ie}),ee.emit(se("grabon")).emit(se("grab"));else{ie=t.dragData.possibleDragElements=z.collection();var ce=z.$(function(we){return we.isNode()&&we.selected()&&t.nodeIsGrabbable(we)});c(ce,{addToList:ie}),ee.emit(se("grabon")),ce.forEach(pe)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ee,t.hoverData.downs=ae,t.hoverData.downTime=new Date().getTime()}n(ee,["mousedown","tapstart","vmousedown"],k,{x:X[0],y:X[1]}),ee==null?(Z[4]=1,t.data.bgActivePosistion={x:X[0],y:X[1]},t.redrawHint("select",!0),t.redraw()):ee.pannable()&&(Z[4]=1),oe()}Z[0]=Z[2]=X[0],Z[1]=Z[3]=X[1]}},!1);var O=a(t.container);t.registerBinding([e,O],"mousemove",function(k){var z=t.hoverData.capture;if(!(!z&&!N(k))){var G=!1,X=t.cy,Z=X.zoom(),ae=[k.clientX,k.clientY],ee=t.projectIntoViewport(ae[0],ae[1]),ie=t.hoverData.mdownPos,se=t.hoverData.mdownGPos,oe=t.selection,ue=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ue=t.findNearestElement(ee[0],ee[1],!0,!1));var pe=t.hoverData.last,ce=t.hoverData.down,we=[ee[0]-oe[2],ee[1]-oe[3]],Ne=t.dragData.possibleDragElements,De;if(se){var Ee=ae[0]-se[0],ze=Ee*Ee,Ce=ae[1]-se[1],Se=Ce*Ce,Ue=ze+Se;t.hoverData.isOverThresholdDrag=De=Ue>=t.desktopTapThreshold2}var Re=i(k);De&&(t.hoverData.tapholdCancelled=!0);var Ve=function(){var ut=t.hoverData.dragDelta=t.hoverData.dragDelta||[];ut.length===0?(ut.push(we[0]),ut.push(we[1])):(ut[0]+=we[0],ut[1]+=we[1])};G=!0,n(ue,["mousemove","vmousemove","tapdrag"],k,{x:ee[0],y:ee[1]});var He=function(ut){return{originalEvent:k,type:ut,position:{x:ee[0],y:ee[1]}}},Ze=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit(He("boxstart")),oe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(De){var tt=He("cxtdrag");ce?ce.emit(tt):X.emit(tt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ue!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(He("cxtdragout")),t.hoverData.cxtOver=ue,ue&&ue.emit(He("cxtdragover")))}}else if(t.hoverData.dragging){if(G=!0,X.panningEnabled()&&X.userPanningEnabled()){var Xe;if(t.hoverData.justStartedPan){var Lt=t.hoverData.mdownPos;Xe={x:(ee[0]-Lt[0])*Z,y:(ee[1]-Lt[1])*Z},t.hoverData.justStartedPan=!1}else Xe={x:we[0]*Z,y:we[1]*Z};X.panBy(Xe),X.emit(He("dragpan")),t.hoverData.dragged=!0}ee=t.projectIntoViewport(k.clientX,k.clientY)}else if(oe[4]==1&&(ce==null||ce.pannable())){if(De){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(Re||!X.panningEnabled()||!X.userPanningEnabled()))Ze();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Pt=o(ce,t.hoverData.downs);Pt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,oe[4]=0,t.data.bgActivePosistion=sa(ie),t.redrawHint("select",!0),t.redraw())}ce&&ce.pannable()&&ce.active()&&ce.unactivate()}}else{if(ce&&ce.pannable()&&ce.active()&&ce.unactivate(),(!ce||!ce.grabbed())&&ue!=pe&&(pe&&n(pe,["mouseout","tapdragout"],k,{x:ee[0],y:ee[1]}),ue&&n(ue,["mouseover","tapdragover"],k,{x:ee[0],y:ee[1]}),t.hoverData.last=ue),ce)if(De){if(X.boxSelectionEnabled()&&Re)ce&&ce.grabbed()&&(p(Ne),ce.emit(He("freeon")),Ne.emit(He("free")),t.dragData.didDrag&&(ce.emit(He("dragfreeon")),Ne.emit(He("dragfree")))),Ze();else if(ce&&ce.grabbed()&&t.nodeIsDraggable(ce)){var pt=!t.dragData.didDrag;pt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||c(Ne,{inDragLayer:!0});var at={x:0,y:0};if(be(we[0])&&be(we[1])&&(at.x+=we[0],at.y+=we[1],pt)){var st=t.hoverData.dragDelta;st&&be(st[0])&&be(st[1])&&(at.x+=st[0],at.y+=st[1])}t.hoverData.draggingEles=!0,Ne.silentShift(at).emit(He("position")).emit(He("drag")),t.redrawHint("drag",!0),t.redraw()}}else Ve();G=!0}if(oe[2]=ee[0],oe[3]=ee[1],G)return k.stopPropagation&&k.stopPropagation(),k.preventDefault&&k.preventDefault(),!1}},!1);var R,P,M;t.registerBinding(e,"mouseup",function(k){if(!(t.hoverData.which===1&&k.which!==1&&t.hoverData.capture)){var z=t.hoverData.capture;if(z){t.hoverData.capture=!1;var G=t.cy,X=t.projectIntoViewport(k.clientX,k.clientY),Z=t.selection,ae=t.findNearestElement(X[0],X[1],!0,!1),ee=t.dragData.possibleDragElements,ie=t.hoverData.down,se=i(k);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ie&&ie.unactivate();var oe=function(Ee){return{originalEvent:k,type:Ee,position:{x:X[0],y:X[1]}}};if(t.hoverData.which===3){var ue=oe("cxttapend");if(ie?ie.emit(ue):G.emit(ue),!t.hoverData.cxtDragged){var pe=oe("cxttap");ie?ie.emit(pe):G.emit(pe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(ae,["mouseup","tapend","vmouseup"],k,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(ie,["click","tap","vclick"],k,{x:X[0],y:X[1]}),P=!1,k.timeStamp-M<=G.multiClickDebounceTime()?(R&&clearTimeout(R),P=!0,M=null,n(ie,["dblclick","dbltap","vdblclick"],k,{x:X[0],y:X[1]})):(R=setTimeout(function(){P||n(ie,["oneclick","onetap","voneclick"],k,{x:X[0],y:X[1]})},G.multiClickDebounceTime()),M=k.timeStamp)),ie==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(k)&&(G.$(r).unselect(["tapunselect"]),ee.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ee=G.collection()),ae==ie&&!t.dragData.didDrag&&!t.hoverData.selecting&&ae!=null&&ae._private.selectable&&(t.hoverData.dragging||(G.selectionType()==="additive"||se?ae.selected()?ae.unselect(["tapunselect"]):ae.select(["tapselect"]):se||(G.$(r).unmerge(ae).unselect(["tapunselect"]),ae.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var ce=G.collection(t.getAllInBox(Z[0],Z[1],Z[2],Z[3]));t.redrawHint("select",!0),ce.length>0&&t.redrawHint("eles",!0),G.emit(oe("boxend"));var we=function(Ee){return Ee.selectable()&&!Ee.selected()};G.selectionType()==="additive"||se||G.$(r).unmerge(ce).unselect(),ce.emit(oe("box")).stdFilter(we).select().emit(oe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!Z[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ne=ie&&ie.grabbed();p(ee),Ne&&(ie.emit(oe("freeon")),ee.emit(oe("free")),t.dragData.didDrag&&(ie.emit(oe("dragfreeon")),ee.emit(oe("dragfree"))))}}Z[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var I=[],E=4,A,C=1e5,S=function(k,z){for(var G=0;G<k.length;G++)if(k[G]%z!==0)return!1;return!0},L=function(k){for(var z=Math.abs(k[0]),G=1;G<k.length;G++)if(Math.abs(k[G])!==z)return!1;return!0},V=function(k){var z=!1,G=k.deltaY;if(G==null&&(k.wheelDeltaY!=null?G=k.wheelDeltaY/4:k.wheelDelta!=null&&(G=k.wheelDelta/4)),G!==0){if(A==null)if(I.length>=E){var X=I;if(A=S(X,5),!A){var Z=Math.abs(X[0]);A=L(X)&&Z>5}if(A)for(var ae=0;ae<X.length;ae++)C=Math.min(Math.abs(X[ae]),C)}else I.push(G),z=!0;else A&&(C=Math.min(Math.abs(G),C));if(!t.scrollingPage){var ee=t.cy,ie=ee.zoom(),se=ee.pan(),oe=t.projectIntoViewport(k.clientX,k.clientY),ue=[oe[0]*ie+se.x,oe[1]*ie+se.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||x()){k.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){k.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var pe;z&&Math.abs(G)>5&&(G=js(G)*5),pe=G/-250,A&&(pe/=C,pe*=3),pe=pe*t.wheelSensitivity;var ce=k.deltaMode===1;ce&&(pe*=33);var we=ee.zoom()*Math.pow(10,pe);k.type==="gesturechange"&&(we=t.gestureStartZoom*k.scale),ee.zoom({level:we,renderedPosition:{x:ue[0],y:ue[1]}}),ee.emit({type:k.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:k,position:{x:oe[0],y:oe[1]}})}}}};t.registerBinding(t.container,"wheel",V,!0),t.registerBinding(e,"scroll",function(k){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(k){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||k.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ne){t.hasTouchStarted||V(ne)},!0),t.registerBinding(t.container,"mouseout",function(k){var z=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseout",position:{x:z[0],y:z[1]}})},!1),t.registerBinding(t.container,"mouseover",function(k){var z=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseover",position:{x:z[0],y:z[1]}})},!1);var F,B,Y,q,Q,$,K,j,re,U,H,_,W,J=function(k,z,G,X){return Math.sqrt((G-k)*(G-k)+(X-z)*(X-z))},te=function(k,z,G,X){return(G-k)*(G-k)+(X-z)*(X-z)},de;t.registerBinding(t.container,"touchstart",de=function(k){if(t.hasTouchStarted=!0,!!N(k)){g(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var z=t.cy,G=t.touchData.now,X=t.touchData.earlier;if(k.touches[0]){var Z=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);G[0]=Z[0],G[1]=Z[1]}if(k.touches[1]){var Z=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);G[2]=Z[0],G[3]=Z[1]}if(k.touches[2]){var Z=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);G[4]=Z[0],G[5]=Z[1]}var ae=function(Re){return{originalEvent:k,type:Re,position:{x:G[0],y:G[1]}}};if(k.touches[1]){t.touchData.singleTouchMoved=!0,p(t.dragData.touchDragEles);var ee=t.findContainerClientCoords();re=ee[0],U=ee[1],H=ee[2],_=ee[3],F=k.touches[0].clientX-re,B=k.touches[0].clientY-U,Y=k.touches[1].clientX-re,q=k.touches[1].clientY-U,W=0<=F&&F<=H&&0<=Y&&Y<=H&&0<=B&&B<=_&&0<=q&&q<=_;var ie=z.pan(),se=z.zoom();Q=J(F,B,Y,q),$=te(F,B,Y,q),K=[(F+Y)/2,(B+q)/2],j=[(K[0]-ie.x)/se,(K[1]-ie.y)/se];var oe=200,ue=oe*oe;if($<ue&&!k.touches[2]){var pe=t.findNearestElement(G[0],G[1],!0,!0),ce=t.findNearestElement(G[2],G[3],!0,!0);pe&&pe.isNode()?(pe.activate().emit(ae("cxttapstart")),t.touchData.start=pe):ce&&ce.isNode()?(ce.activate().emit(ae("cxttapstart")),t.touchData.start=ce):z.emit(ae("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(k.touches[2])z.boxSelectionEnabled()&&k.preventDefault();else if(!k.touches[1]){if(k.touches[0]){var we=t.findNearestElements(G[0],G[1],!0,!0),Ne=we[0];if(Ne!=null&&(Ne.activate(),t.touchData.start=Ne,t.touchData.starts=we,t.nodeIsGrabbable(Ne))){var De=t.dragData.touchDragEles=z.collection(),Ee=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ne.selected()?(Ee=z.$(function(Ue){return Ue.selected()&&t.nodeIsGrabbable(Ue)}),c(Ee,{addToList:De})):d(Ne,{addToList:De}),l(Ne),Ne.emit(ae("grabon")),Ee?Ee.forEach(function(Ue){Ue.emit(ae("grab"))}):Ne.emit(ae("grab"))}n(Ne,["touchstart","tapstart","vmousedown"],k,{x:G[0],y:G[1]}),Ne==null&&(t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&n(t.touchData.start,["taphold"],k,{x:G[0],y:G[1]})},t.tapholdDuration)}}if(k.touches.length>=1){for(var ze=t.touchData.startPosition=[null,null,null,null,null,null],Ce=0;Ce<G.length;Ce++)ze[Ce]=X[Ce]=G[Ce];var Se=k.touches[0];t.touchData.startGPosition=[Se.clientX,Se.clientY]}}},!1);var Te;t.registerBinding(e,"touchmove",Te=function(k){var z=t.touchData.capture;if(!(!z&&!N(k))){var G=t.selection,X=t.cy,Z=t.touchData.now,ae=t.touchData.earlier,ee=X.zoom();if(k.touches[0]){var ie=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Z[0]=ie[0],Z[1]=ie[1]}if(k.touches[1]){var ie=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);Z[2]=ie[0],Z[3]=ie[1]}if(k.touches[2]){var ie=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);Z[4]=ie[0],Z[5]=ie[1]}var se=function(ed){return{originalEvent:k,type:ed,position:{x:Z[0],y:Z[1]}}},oe=t.touchData.startGPosition,ue;if(z&&k.touches[0]&&oe){for(var pe=[],ce=0;ce<Z.length;ce++)pe[ce]=Z[ce]-ae[ce];var we=k.touches[0].clientX-oe[0],Ne=we*we,De=k.touches[0].clientY-oe[1],Ee=De*De,ze=Ne+Ee;ue=ze>=t.touchTapThreshold2}if(z&&t.touchData.cxt){k.preventDefault();var Ce=k.touches[0].clientX-re,Se=k.touches[0].clientY-U,Ue=k.touches[1].clientX-re,Re=k.touches[1].clientY-U,Ve=te(Ce,Se,Ue,Re),He=Ve/$,Ze=150,tt=Ze*Ze,Xe=1.5,Lt=Xe*Xe;if(He>=Lt||Ve>=tt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Pt=se("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Pt),t.touchData.start=null):X.emit(Pt)}}if(z&&t.touchData.cxt){var Pt=se("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Pt):X.emit(Pt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var pt=t.findNearestElement(Z[0],Z[1],!0,!0);(!t.touchData.cxtOver||pt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(se("cxtdragout")),t.touchData.cxtOver=pt,pt&&pt.emit(se("cxtdragover")))}else if(z&&k.touches[2]&&X.boxSelectionEnabled())k.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit(se("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,G[4]=1,!G||G.length===0||G[0]===void 0?(G[0]=(Z[0]+Z[2]+Z[4])/3,G[1]=(Z[1]+Z[3]+Z[5])/3,G[2]=(Z[0]+Z[2]+Z[4])/3+1,G[3]=(Z[1]+Z[3]+Z[5])/3+1):(G[2]=(Z[0]+Z[2]+Z[4])/3,G[3]=(Z[1]+Z[3]+Z[5])/3),t.redrawHint("select",!0),t.redraw();else if(z&&k.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){k.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var at=t.dragData.touchDragEles;if(at){t.redrawHint("drag",!0);for(var st=0;st<at.length;st++){var Ft=at[st]._private;Ft.grabbed=!1,Ft.rscratch.inDragLayer=!1}}var ut=t.touchData.start,Ce=k.touches[0].clientX-re,Se=k.touches[0].clientY-U,Ue=k.touches[1].clientX-re,Re=k.touches[1].clientY-U,Rr=J(Ce,Se,Ue,Re),lr=Rr/Q;if(W){var fr=Ce-F,wn=Se-B,Ma=Ue-Y,En=Re-q,Ra=(fr+Ma)/2,Ii=(wn+En)/2,rr=X.zoom(),Zr=rr*lr,Or=X.pan(),Qr=j[0]*rr+Or.x,Oa=j[1]*rr+Or.y,ht={x:-Zr/rr*(Qr-Or.x-Ra)+Qr,y:-Zr/rr*(Oa-Or.y-Ii)+Oa};if(ut&&ut.active()){var at=t.dragData.touchDragEles;p(at),t.redrawHint("drag",!0),t.redrawHint("eles",!0),ut.unactivate().emit(se("freeon")),at.emit(se("free")),t.dragData.didDrag&&(ut.emit(se("dragfreeon")),at.emit(se("dragfree")))}X.viewport({zoom:Zr,pan:ht,cancelOnFailedZoom:!0}),X.emit(se("pinchzoom")),Q=Rr,F=Ce,B=Se,Y=Ue,q=Re,t.pinching=!0}if(k.touches[0]){var ie=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Z[0]=ie[0],Z[1]=ie[1]}if(k.touches[1]){var ie=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);Z[2]=ie[0],Z[3]=ie[1]}if(k.touches[2]){var ie=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);Z[4]=ie[0],Z[5]=ie[1]}}else if(k.touches[0]&&!t.touchData.didSelect){var Pe=t.touchData.start,Ye=t.touchData.last,pt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(pt=t.findNearestElement(Z[0],Z[1],!0,!0)),z&&Pe!=null&&k.preventDefault(),z&&Pe!=null&&t.nodeIsDraggable(Pe))if(ue){var at=t.dragData.touchDragEles,Ht=!t.dragData.didDrag;Ht&&c(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var yt={x:0,y:0};if(be(pe[0])&&be(pe[1])&&(yt.x+=pe[0],yt.y+=pe[1],Ht)){t.redrawHint("eles",!0);var Yt=t.touchData.dragDelta;Yt&&be(Yt[0])&&be(Yt[1])&&(yt.x+=Yt[0],yt.y+=Yt[1])}t.hoverData.draggingEles=!0,at.silentShift(yt).emit(se("position")).emit(se("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ae[0]&&t.touchData.startPosition[1]==ae[1]&&t.redrawHint("eles",!0),t.redraw()}else{var Yt=t.touchData.dragDelta=t.touchData.dragDelta||[];Yt.length===0?(Yt.push(pe[0]),Yt.push(pe[1])):(Yt[0]+=pe[0],Yt[1]+=pe[1])}if(n(Pe||pt,["touchmove","tapdrag","vmousemove"],k,{x:Z[0],y:Z[1]}),(!Pe||!Pe.grabbed())&&pt!=Ye&&(Ye&&Ye.emit(se("tapdragout")),pt&&pt.emit(se("tapdragover"))),t.touchData.last=pt,z)for(var st=0;st<Z.length;st++)Z[st]&&t.touchData.startPosition[st]&&ue&&(t.touchData.singleTouchMoved=!0);if(z&&(Pe==null||Pe.pannable())&&X.panningEnabled()&&X.userPanningEnabled()){var jv=o(Pe,t.touchData.starts);jv&&(k.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=sa(t.touchData.startPosition)),t.swipePanning?(X.panBy({x:pe[0]*ee,y:pe[1]*ee}),X.emit(se("dragpan"))):ue&&(t.swipePanning=!0,X.panBy({x:we*ee,y:De*ee}),X.emit(se("dragpan")),Pe&&(Pe.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ie=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Z[0]=ie[0],Z[1]=ie[1]}}for(var ce=0;ce<Z.length;ce++)ae[ce]=Z[ce];z&&k.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var ge;t.registerBinding(e,"touchcancel",ge=function(k){var z=t.touchData.start;t.touchData.capture=!1,z&&z.unactivate()});var le,he,fe,ve;if(t.registerBinding(e,"touchend",le=function(k){var z=t.touchData.start,G=t.touchData.capture;if(G)k.touches.length===0&&(t.touchData.capture=!1),k.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var Z=t.cy,ae=Z.zoom(),ee=t.touchData.now,ie=t.touchData.earlier;if(k.touches[0]){var se=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);ee[0]=se[0],ee[1]=se[1]}if(k.touches[1]){var se=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);ee[2]=se[0],ee[3]=se[1]}if(k.touches[2]){var se=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);ee[4]=se[0],ee[5]=se[1]}var oe=function(tt){return{originalEvent:k,type:tt,position:{x:ee[0],y:ee[1]}}};z&&z.unactivate();var ue;if(t.touchData.cxt){if(ue=oe("cxttapend"),z?z.emit(ue):Z.emit(ue),!t.touchData.cxtDragged){var pe=oe("cxttap");z?z.emit(pe):Z.emit(pe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!k.touches[2]&&Z.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var ce=Z.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),Z.emit(oe("boxend"));var we=function(tt){return tt.selectable()&&!tt.selected()};ce.emit(oe("box")).stdFilter(we).select().emit(oe("boxselect")),ce.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(z?.unactivate(),k.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!k.touches[1]){if(!k.touches[0]){if(!k.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ne=t.dragData.touchDragEles;if(z!=null){var De=z._private.grabbed;p(Ne),t.redrawHint("drag",!0),t.redrawHint("eles",!0),De&&(z.emit(oe("freeon")),Ne.emit(oe("free")),t.dragData.didDrag&&(z.emit(oe("dragfreeon")),Ne.emit(oe("dragfree")))),n(z,["touchend","tapend","vmouseup","tapdragout"],k,{x:ee[0],y:ee[1]}),z.unactivate(),t.touchData.start=null}else{var Ee=t.findNearestElement(ee[0],ee[1],!0,!0);n(Ee,["touchend","tapend","vmouseup","tapdragout"],k,{x:ee[0],y:ee[1]})}var ze=t.touchData.startPosition[0]-ee[0],Ce=ze*ze,Se=t.touchData.startPosition[1]-ee[1],Ue=Se*Se,Re=Ce+Ue,Ve=Re*ae*ae;t.touchData.singleTouchMoved||(z||Z.$(":selected").unselect(["tapunselect"]),n(z,["tap","vclick"],k,{x:ee[0],y:ee[1]}),he=!1,k.timeStamp-ve<=Z.multiClickDebounceTime()?(fe&&clearTimeout(fe),he=!0,ve=null,n(z,["dbltap","vdblclick"],k,{x:ee[0],y:ee[1]})):(fe=setTimeout(function(){he||n(z,["onetap","voneclick"],k,{x:ee[0],y:ee[1]})},Z.multiClickDebounceTime()),ve=k.timeStamp)),z!=null&&!t.dragData.didDrag&&z._private.selectable&&Ve<t.touchTapThreshold2&&!t.pinching&&(Z.selectionType()==="single"?(Z.$(r).unmerge(z).unselect(["tapunselect"]),z.select(["tapselect"])):z.selected()?z.unselect(["tapunselect"]):z.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var He=0;He<ee.length;He++)ie[He]=ee[He];t.dragData.didDrag=!1,k.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),k.touches.length<2&&(k.touches.length===1&&(t.touchData.startGPosition=[k.touches[0].clientX,k.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ye=[],me=function(k){return{clientX:k.clientX,clientY:k.clientY,force:1,identifier:k.pointerId,pageX:k.pageX,pageY:k.pageY,radiusX:k.width/2,radiusY:k.height/2,screenX:k.screenX,screenY:k.screenY,target:k.target}},xe=function(k){return{event:k,touch:me(k)}},Le=function(k){ye.push(xe(k))},ke=function(k){for(var z=0;z<ye.length;z++){var G=ye[z];if(G.event.pointerId===k.pointerId){ye.splice(z,1);return}}},Fe=function(k){var z=ye.filter(function(G){return G.event.pointerId===k.pointerId})[0];z.event=k,z.touch=me(k)},Be=function(k){k.touches=ye.map(function(z){return z.touch})},Oe=function(k){return k.pointerType==="mouse"||k.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ne){Oe(ne)||(ne.preventDefault(),Le(ne),Be(ne),de(ne))}),t.registerBinding(t.container,"pointerup",function(ne){Oe(ne)||(ke(ne),Be(ne),le(ne))}),t.registerBinding(t.container,"pointercancel",function(ne){Oe(ne)||(ke(ne),Be(ne),ge(ne))}),t.registerBinding(t.container,"pointermove",function(ne){Oe(ne)||(ne.preventDefault(),Fe(ne),Be(ne),Te(ne))})}};var sr={};sr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(a,n,i,o,s,u){this.renderer.nodeShapeImpl("polygon",a,n,i,o,s,this.points)},intersectLine:function(a,n,i,o,s,u,l,f){return Ja(s,u,this.points,a,n,i/2,o/2,l)},checkPoint:function(a,n,i,o,s,u,l,f){return or(a,n,this.points,u,l,o,s,[0,-1],i)},hasMiterBounds:t!=="rectangle",miterBounds:function(a,n,i,o,s,u){return Kg(this.points,a,n,i,o,s)}}};sr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s,u){return ap(i,o,e,r,a/2+s,n/2+s)},checkPoint:function(e,r,a,n,i,o,s,u){return Ur(e,r,n,i,o,s,a)}}};sr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(a,n,i,o,s,u,l){if(u[l]!==void 0&&u[l+"-cx"]===a&&u[l+"-cy"]===n)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=a,u[l+"-cy"]=n;var f=i/2,h=o/2;s=s==="auto"?tc(i,o):s;for(var v=new Array(e.length/2),c=0;c<e.length/2;c++)v[c]={x:a+f*e[c*2],y:n+h*e[c*2+1]};var d,p,y,g,b=v.length;for(p=v[b-1],d=0;d<b;d++)y=v[d%b],g=v[(d+1)%b],u[l][d]=cu(p,y,g,s),p=y,y=g;return u[l]},draw:function(a,n,i,o,s,u,l){this.renderer.nodeShapeImpl("round-polygon",a,n,i,o,s,this.points,this.getOrCreateCorners(n,i,o,s,u,l,"drawCorners"))},intersectLine:function(a,n,i,o,s,u,l,f,h){return ip(s,u,this.points,a,n,i,o,l,this.getOrCreateCorners(a,n,i,o,f,h,"corners"))},checkPoint:function(a,n,i,o,s,u,l,f,h){return rp(a,n,this.points,u,l,o,s,this.getOrCreateCorners(u,l,o,s,f,h,"corners"))}}};sr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Nt(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,o)},intersectLine:function(e,r,a,n,i,o,s,u){return jh(i,o,e,r,a,n,s,u)},checkPoint:function(e,r,a,n,i,o,s,u){var l=n/2,f=i/2;u=u==="auto"?Er(n,i):u,u=Math.min(l,f,u);var h=u*2;return!!(or(e,r,this.points,o,s,n,i-h,[0,-1],a)||or(e,r,this.points,o,s,n-h,i,[0,-1],a)||Ur(e,r,h,h,o-l+u,s-f+u,a)||Ur(e,r,h,h,o+l-u,s-f+u,a)||Ur(e,r,h,h,o+l-u,s+f-u,a)||Ur(e,r,h,h,o-l+u,s+f-u,a))}}};sr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:tu(),points:Nt(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,null,o)},generateCutTrianglePts:function(e,r,a,n,i){var o=i==="auto"?this.cornerLength:i,s=r/2,u=e/2,l=a-u,f=a+u,h=n-s,v=n+s;return{topLeft:[l,h+o,l+o,h,l+o,h+o],topRight:[f-o,h,f,h+o,f-o,h+o],bottomRight:[f,v-o,f-o,v,f-o,v-o],bottomLeft:[l+o,v,l,v-o,l+o,v-o]}},intersectLine:function(e,r,a,n,i,o,s,u){var l=this.generateCutTrianglePts(a+2*s,n+2*s,e,r,u),f=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return Ja(i,o,f,e,r)},checkPoint:function(e,r,a,n,i,o,s,u){var l=u==="auto"?this.cornerLength:u;if(or(e,r,this.points,o,s,n,i-2*l,[0,-1],a)||or(e,r,this.points,o,s,n-2*l,i,[0,-1],a))return!0;var f=this.generateCutTrianglePts(n,i,o,s);return It(e,r,f.topLeft)||It(e,r,f.topRight)||It(e,r,f.bottomRight)||It(e,r,f.bottomLeft)}}};sr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Nt(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s,u){var l=.15,f=.5,h=.85,v=this.generateBarrelBezierPts(a+2*s,n+2*s,e,r),c=function(y){var g=fa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},l),b=fa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f),m=fa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},h);return[y[0],y[1],g.x,g.y,b.x,b.y,m.x,m.y,y[4],y[5]]},d=[].concat(c(v.topLeft),c(v.topRight),c(v.bottomRight),c(v.bottomLeft));return Ja(i,o,d,e,r)},generateBarrelBezierPts:function(e,r,a,n){var i=r/2,o=e/2,s=a-o,u=a+o,l=n-i,f=n+i,h=Cs(e,r),v=h.heightOffset,c=h.widthOffset,d=h.ctrlPtOffsetPct*e,p={topLeft:[s,l+v,s+d,l,s+c,l],topRight:[u-c,l,u-d,l,u,l+v],bottomRight:[u,f-v,u-d,f,u-c,f],bottomLeft:[s+c,f,s+d,f,s,f-v]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,r,a,n,i,o,s,u){var l=Cs(n,i),f=l.heightOffset,h=l.widthOffset;if(or(e,r,this.points,o,s,n,i-2*f,[0,-1],a)||or(e,r,this.points,o,s,n-2*h,i,[0,-1],a))return!0;for(var v=this.generateBarrelBezierPts(n,i,o,s),c=function(N,O,R){var P=R[4],M=R[2],I=R[0],E=R[5],A=R[1],C=Math.min(P,I),S=Math.max(P,I),L=Math.min(E,A),V=Math.max(E,A);if(C<=N&&N<=S&&L<=O&&O<=V){var F=op(P,M,I),B=Jg(F[0],F[1],F[2],N),Y=B.filter(function(q){return 0<=q&&q<=1});if(Y.length>0)return Y[0]}return null},d=Object.keys(v),p=0;p<d.length;p++){var y=d[p],g=v[y],b=c(e,r,g);if(b!=null){var m=g[5],w=g[3],T=g[1],D=mt(m,w,T,b);if(g.isTop&&D<=r||g.isBottom&&r<=D)return!0}}return!1}}};sr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Nt(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,o)},intersectLine:function(e,r,a,n,i,o,s,u){var l=e-(a/2+s),f=r-(n/2+s),h=f,v=e+(a/2+s),c=pr(i,o,e,r,l,f,v,h,!1);return c.length>0?c:jh(i,o,e,r,a,n,s,u)},checkPoint:function(e,r,a,n,i,o,s,u){u=u==="auto"?Er(n,i):u;var l=2*u;if(or(e,r,this.points,o,s,n,i-l,[0,-1],a)||or(e,r,this.points,o,s,n-l,i,[0,-1],a))return!0;var f=n/2+2*a,h=i/2+2*a,v=[o-f,s-h,o-f,s,o+f,s,o+f,s-h];return!!(It(e,r,v)||Ur(e,r,l,l,o+n/2-u,s+i/2-u,a)||Ur(e,r,l,l,o-n/2+u,s+i/2-u,a))}}};sr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Nt(3,0)),this.generateRoundPolygon("round-triangle",Nt(3,0)),this.generatePolygon("rectangle",Nt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Nt(5,0)),this.generateRoundPolygon("round-pentagon",Nt(5,0)),this.generatePolygon("hexagon",Nt(6,0)),this.generateRoundPolygon("round-hexagon",Nt(6,0)),this.generatePolygon("heptagon",Nt(7,0)),this.generateRoundPolygon("round-heptagon",Nt(7,0)),this.generatePolygon("octagon",Nt(8,0)),this.generateRoundPolygon("round-octagon",Nt(8,0));var a=new Array(20);{var n=Ts(5,0),i=Ts(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)a[s*4]=n[s*2],a[s*4+1]=n[s*2+1],a[s*4+2]=i[s*2],a[s*4+3]=i[s*2+1]}a=ec(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(l){var f=l.join("$"),h="polygon-"+f,v;return(v=this[h])?v:e.generatePolygon(h,l)}};var yn={};yn.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};yn.redraw=function(t){t=t||Kh();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};yn.beforeRender=function(t,e){if(!this.destroyed){e==null&&nt("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(a,n){return n.priority-a.priority})}};var Uf=function(e,r,a){for(var n=e.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(r,a)};yn.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(n){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){Uf(t,!0,n);var i=ir();t.render(t.renderOptions);var o=t.lastDrawTime=ir();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var s=o-i;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else Uf(t,!1,n);t.skipFrame=!1,Jn(r)}};Jn(r)}};var S0=function(e){this.init(e)},rv=S0,La=rv.prototype;La.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];La.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),a=e.cy.window();if(a){var n=a.document,i=n.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",u=n.getElementById(o)!=null;if(r.className.indexOf(s)<0&&(r.className=(r.className||"")+" "+s),!u){var l=n.createElement("style");l.id=o,l.textContent="."+s+" { position: relative; }",i.insertBefore(l,i.children[0])}var f=a.getComputedStyle(r),h=f.getPropertyValue("position");h==="static"&&Ke("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=be(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};La.notify=function(t,e){var r=this,a=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&a.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};La.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],a=r,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};La.isHeadless=function(){return!1};[hu,jc,ev,Aa,sr,yn].forEach(function(t){Ie(La,t)});var is=1e3/60,av={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=cn(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(l,f){var h=ir(),v=n.averageRedrawTime,c=n.lastRedrawTime,d=[],p=n.cy.extent(),y=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var g=ir(),b=g-h,m=g-f;if(c<is){var w=is-(l?v:0);if(m>=e.deqFastCost*w)break}else if(l){if(b>=e.deqCost*c||b>=e.deqAvgCost*v)break}else if(m>=e.deqNoDrawCost*is)break;var T=e.deq(a,y,p);if(T.length>0)for(var D=0;D<T.length;D++)d.push(T[D]);else break}d.length>0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,y,p)&&i())},s=e.priority||Zs;n.beforeRender(o,s(a))}}}},D0=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jn;Dr(this,t),this.idsByKey=new nr,this.keyForId=new nr,this.cachesByLvl=new nr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Ar(t,[{key:"getIdsFor",value:function(r){r==null&&nt("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new Ta,a.set(r,n)),n}},{key:"addIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).add(a)}},{key:"deleteIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).delete(a)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);return n!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);return i||(i=new nr,a.set(r,i),n.push(r)),i}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(r,a){return this.getCachesAt(a).has(r)}},{key:"has",value:function(r,a){var n=this.getKey(r);return this.hasCache(n,a)}},{key:"setCache",value:function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)}},{key:"set",value:function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,a){this.getCachesAt(a).delete(r)}},{key:"delete",value:function(r,a){var n=this.getKey(r);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})}},{key:"invalidate",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Hf=25,In=50,Wn=-4,Fs=3,nv=7.99,A0=8,L0=1024,N0=1024,M0=1024,R0=.2,O0=.8,P0=10,I0=.15,k0=.1,B0=.9,F0=.9,z0=100,V0=1,la={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},G0=Tt({getKey:null,doesEleInvalidateKey:jn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Wh,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ya=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=G0(r);Ie(a,n),a.lookup=new D0(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},gt=Ya.prototype;gt.reasons=la;gt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};gt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};gt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new vn(function(r,a){return a.reqs-r.reqs});return e};gt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};gt.getElement=function(t,e,r,a,n){var i=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(Js(s*r))),a<Wn)a=Wn;else if(s>=nv||a>Fs)return null;var l=Math.pow(2,a),f=e.h*l,h=e.w*l,v=o.eleTextBiggerThanMin(t,l);if(!this.isVisible(t,v))return null;var c=u.get(t,a);if(c&&c.invalidated&&(c.invalidated=!1,c.texture.invalidatedWidth-=c.width),c)return c;var d;if(f<=Hf?d=Hf:f<=In?d=In:d=Math.ceil(f/In)*In,f>M0||h>N0)return null;var p=i.getTextureQueue(d),y=p[p.length-2],g=function(){return i.recycleTexture(d,h)||i.addTexture(d,h)};y||(y=p[p.length-1]),y||(y=g()),y.width-y.usedWidth<h&&(y=g());for(var b=function(C){return C&&C.scaledLabelShown===v},m=n&&n===la.dequeue,w=n&&n===la.highQuality,T=n&&n===la.downscale,D,x=a+1;x<=Fs;x++){var N=u.get(t,x);if(N){D=N;break}}var O=D&&D.level===a+1?D:null,R=function(){y.context.drawImage(O.texture.canvas,O.x,0,O.width,O.height,y.usedWidth,0,h,f)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,h,d),b(O))R();else if(b(D))if(w){for(var P=D.level;P>a;P--)O=i.getElement(t,e,r,P,la.downscale);R()}else return i.queueElement(t,D.level-1),D;else{var M;if(!m&&!w&&!T)for(var I=a-1;I>=Wn;I--){var E=u.get(t,I);if(E){M=E;break}}if(b(M))return i.queueElement(t,a),M;y.context.translate(y.usedWidth,0),y.context.scale(l,l),this.drawElement(y.context,t,e,v,!1),y.context.scale(1/l,1/l),y.context.translate(-y.usedWidth,0)}return c={x:y.usedWidth,texture:y,level:a,scale:l,width:h,height:f,scaledLabelShown:v},y.usedWidth+=Math.ceil(h+A0),y.eleCaches.push(c),u.set(t,a,c),i.checkTextureFullness(y),c};gt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};gt.invalidateElement=function(t){var e=this,r=e.lookup,a=[],n=r.isInvalid(t);if(n){for(var i=Wn;i<=Fs;i++){var o=r.getForCachedKey(t,i);o&&a.push(o)}var s=r.invalidate(t);if(s)for(var u=0;u<a.length;u++){var l=a[u],f=l.texture;f.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)}};gt.checkTextureUtility=function(t){t.invalidatedWidth>=R0*t.width&&this.retireTexture(t)};gt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>O0&&t.fullnessChecks>=P0?wr(r,t):t.fullnessChecks++};gt.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;wr(a,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var s=i[o];n.deleteCache(s.key,s.level)}Qs(i);var u=e.getRetiredTextureQueue(r);u.push(t)};gt.addTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n={};return a.push(n),n.eleCaches=[],n.height=t,n.width=Math.max(L0,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};gt.recycleTexture=function(t,e){for(var r=this,a=r.getTextureQueue(t),n=r.getRetiredTextureQueue(t),i=0;i<n.length;i++){var o=n[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Qs(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),wr(n,o),a.push(o),o}};gt.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),o=n[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,a.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(s),n[i]=s}};gt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,o=0;o<V0&&r.size()>0;o++){var s=r.pop(),u=s.key,l=s.eles[0],f=i.hasCache(l,s.level);if(a[u]=null,f)continue;n.push(s);var h=e.getBoundingBox(l);e.getElement(l,h,t,s.level,la.dequeue)}return n};gt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Ks,r.updateItem(i),r.pop(),a[n]=null):i.eles.unmerge(t))};gt.onDequeue=function(t){this.onDequeues.push(t)};gt.offDequeue=function(t){wr(this.onDequeues,t)};gt.setupDequeueing=av.setupDequeueing({deqRedrawThreshold:z0,deqCost:I0,deqAvgCost:k0,deqNoDrawCost:B0,deqFastCost:F0,deq:function(e,r,a){return e.dequeue(r,a)},onDeqd:function(e,r){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(r)}},shouldRedraw:function(e,r,a,n){for(var i=0;i<r.length;i++)for(var o=r[i].eles,s=0;s<o.length;s++){var u=o[s].boundingBox();if(eu(u,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var U0=1,Wa=-4,si=2,H0=3.99,Y0=50,q0=50,_0=.15,W0=.1,X0=.9,$0=.9,K0=1,Yf=250,Z0=4e3*4e3,qf=32767,Q0=!0,iv=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=ir()-2*Yf,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=cn(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},q0),a.beforeRender(function(o,s){s-r.lastInvalidationTime<=Yf?r.skipping=!0:r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(s,u){return u.reqs-s.reqs};r.layersQueue=new vn(i),r.setupDequeueing()},Ct=iv.prototype,_f=0,J0=Math.pow(2,53)-1;Ct.makeLayer=function(t,e){var r=Math.pow(2,e),a=Math.ceil(t.w*r),n=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(a,n),o={id:_f=++_f%J0,bb:t,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(r,r),s.translate(u,l),o};Ct.getLayers=function(t,e,r){var a=this,n=a.renderer,i=n.cy,o=i.zoom(),s=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(Js(o*e)),r<Wa)r=Wa;else if(o>=H0||r>si)return null}a.validateLayersElesOrdering(r,t);var u=a.layersByLevel,l=Math.pow(2,r),f=u[r]=u[r]||[],h,v=a.levelIsComplete(r,t),c,d=function(){var R=function(A){if(a.validateLayersElesOrdering(A,t),a.levelIsComplete(A,t))return c=u[A],!0},P=function(A){if(!c)for(var C=r+A;Wa<=C&&C<=si&&!R(C);C+=A);};P(1),P(-1);for(var M=f.length-1;M>=0;M--){var I=f[M];I.invalid&&wr(f,I)}};if(!v)d();else return f;var p=function(){if(!h){h=Rt();for(var R=0;R<t.length;R++)Wg(h,t[R].boundingBox())}return h},y=function(R){R=R||{};var P=R.after;p();var M=Math.ceil(h.w*l),I=Math.ceil(h.h*l);if(M>qf||I>qf)return null;var E=M*I;if(E>Z0)return null;var A=a.makeLayer(h,r);if(P!=null){var C=f.indexOf(P)+1;f.splice(C,0,A)}else(R.insert===void 0||R.insert)&&f.unshift(A);return A};if(a.skipping&&!s)return null;for(var g=null,b=t.length/U0,m=!s,w=0;w<t.length;w++){var T=t[w],D=T._private.rscratch,x=D.imgLayerCaches=D.imgLayerCaches||{},N=x[r];if(N){g=N;continue}if((!g||g.eles.length>=b||!Jh(g.bb,T.boundingBox()))&&(g=y({insert:!0,after:g}),!g))return null;c||m?a.queueLayer(g,T):a.drawEleInLayer(g,T,r,e),g.eles.push(T),x[r]=g}return c||(m?null:f)};Ct.getEleLevelForLayerLevel=function(t,e){return t};Ct.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,Q0),i.setImgSmoothing(o,!0))};Ct.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;for(var n=0,i=0;i<a.length;i++){var o=a[i];if(o.reqs>0||o.invalid)return!1;n+=o.eles.length}return n===e.length};Ct.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a<r.length;a++){for(var n=r[a],i=-1,o=0;o<e.length;o++)if(n.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(n);continue}for(var s=i,o=0;o<n.eles.length;o++)if(n.eles[o]!==e[s+o]){this.invalidateLayer(n);break}}};Ct.updateElementsInLayers=function(t,e){for(var r=this,a=un(t[0]),n=0;n<t.length;n++)for(var i=a?null:t[n],o=a?t[n]:t[n].ele,s=o._private.rscratch,u=s.imgLayerCaches=s.imgLayerCaches||{},l=Wa;l<=si;l++){var f=u[l];f&&(i&&r.getEleLevelForLayerLevel(f.level)!==i.level||e(f,o,i))}};Ct.haveLayers=function(){for(var t=this,e=!1,r=Wa;r<=si;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};Ct.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=ir(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)}))};Ct.invalidateLayer=function(t){if(this.lastInvalidationTime=ir(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];wr(a,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var n=0;n<r.length;n++){var i=r[n]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};Ct.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(a,n,i){var o=a.replacement;if(o||(o=a.replacement=e.makeLayer(a.bb,a.level),o.replaces=a,o.eles=a.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};Ct.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Ct.queueLayer=function(t,e){var r=this,a=r.layersQueue,n=t.elesQueue,i=n.hasId=n.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,a.updateItem(t)):(t.reqs=1,a.push(t))}};Ct.dequeue=function(t){for(var e=this,r=e.layersQueue,a=[],n=0;n<K0&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,t),n++),a.length===0&&a.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return a};Ct.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],a=t.replaces,n=r.indexOf(a);if(!(n<0||a.invalid)){r[n]=t;for(var i=0;i<t.eles.length;i++){var o=t.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[t.level]=t)}e.requestRedraw()}};Ct.requestRedraw=cn(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Ct.setupDequeueing=av.setupDequeueing({deqRedrawThreshold:Y0,deqCost:_0,deqAvgCost:W0,deqNoDrawCost:X0,deqFastCost:$0,deq:function(e,r){return e.dequeue(r)},onDeqd:Zs,shouldRedraw:Wh,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var ov={},Wf;function j0(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function eb(t,e,r){for(var a,n=0;n<e.length;n++){var i=e[n];n===0&&(a=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}function Xf(t,e,r){t.beginPath&&t.beginPath();for(var a=e,n=0;n<a.length;n++){var i=a[n];t.lineTo(i.x,i.y)}var o=r,s=r[0];t.moveTo(s.x,s.y);for(var n=1;n<o.length;n++){var i=o[n];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function tb(t,e,r,a,n){t.beginPath&&t.beginPath(),t.arc(r,a,n,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function rb(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}ov.arrowShapeImpl=function(t){return(Wf||(Wf={polygon:j0,"triangle-backcurve":eb,"triangle-tee":Xf,"circle-triangle":tb,"triangle-cross":Xf,circle:rb}))[t]};var tr={};tr.drawElement=function(t,e,r,a,n,i){var o=this;e.isNode()?o.drawNode(t,e,r,a,n,i):o.drawEdge(t,e,r,a,n,i)};tr.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};tr.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};tr.drawCachedElementPortion=function(t,e,r,a,n,i,o,s){var u=this,l=r.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=r.getElement(e,l,a,n,i);if(f!=null){var h=s(u,e);if(h===0)return;var v=o(u,e),c=l.x1,d=l.y1,p=l.w,y=l.h,g,b,m,w,T;if(v!==0){var D=r.getRotationPoint(e);m=D.x,w=D.y,t.translate(m,w),t.rotate(v),T=u.getImgSmoothing(t),T||u.setImgSmoothing(t,!0);var x=r.getRotationOffset(e);g=x.x,b=x.y}else g=c,b=d;var N;h!==1&&(N=t.globalAlpha,t.globalAlpha=N*h),t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,g,b,p,y),h!==1&&(t.globalAlpha=N),v!==0&&(t.rotate(-v),t.translate(-m,-w),T||u.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var ab=function(){return 0},nb=function(e,r){return e.getTextAngle(r,null)},ib=function(e,r){return e.getTextAngle(r,"source")},ob=function(e,r){return e.getTextAngle(r,"target")},sb=function(e,r){return r.effectiveOpacity()},os=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};tr.drawCachedElement=function(t,e,r,a,n,i){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,f=s.slbTxrCache,h=s.tlbTxrCache,v=e.boundingBox(),c=i===!0?u.reasons.highQuality:null;if(!(v.w===0||v.h===0||!e.visible())&&(!a||eu(v,a))){var d=e.isEdge(),p=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,u,r,n,c,ab,sb),(!d||!p)&&o.drawCachedElementPortion(t,e,l,r,n,c,nb,os),d&&!p&&(o.drawCachedElementPortion(t,e,f,r,n,c,ib,os),o.drawCachedElementPortion(t,e,h,r,n,c,ob,os)),o.drawElementOverlay(t,e)}};tr.drawElements=function(t,e){for(var r=this,a=0;a<e.length;a++){var n=e[a];r.drawElement(t,n)}};tr.drawCachedElements=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];n.drawCachedElement(t,o,r,a)}};tr.drawCachedNodes=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&n.drawCachedElement(t,o,r,a)}};tr.drawLayeredElements=function(t,e,r,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var s=i[o],u=s.bb;u.w===0||u.h===0||t.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(t,e,r,a)};var ur={};ur.drawEdge=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,h=e.pstyle("curve-style").value,v=e.pstyle("line-style").value,c=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,p=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,g=l*f,b=l*f,m=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;h==="straight-triangle"?(o.eleStrokeStyle(t,e,A),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=c,t.lineCap=d,o.eleStrokeStyle(t,e,A),o.drawEdgePath(e,t,s.allpts,v),t.lineCap="butt")},w=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;if(t.lineWidth=c+p,t.lineCap=d,p>0)o.colorStrokeStyle(t,y[0],y[1],y[2],A);else{t.lineCap="butt";return}h==="straight-triangle"?o.drawEdgeTrianglePath(e,t,s.allpts):(o.drawEdgePath(e,t,s.allpts,v),t.lineCap="butt")},T=function(){n&&o.drawEdgeOverlay(t,e)},D=function(){n&&o.drawEdgeUnderlay(t,e)},x=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,A)},N=function(){o.drawElementText(t,e,null,a)};t.lineJoin="round";var O=e.pstyle("ghost").value==="yes";if(O){var R=e.pstyle("ghost-offset-x").pfValue,P=e.pstyle("ghost-offset-y").pfValue,M=e.pstyle("ghost-opacity").value,I=g*M;t.translate(R,P),m(I),x(I),t.translate(-R,-P)}else w();D(),m(),x(),T(),N(),r&&t.translate(u.x1,u.y1)}};var sv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,o=i.usePaths(),s=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,f=a.pstyle("".concat(e,"-color")).value;r.lineWidth=l,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,f[0],f[1],f[2],n),i.drawEdgePath(a,r,s.allpts,"solid")}}}};ur.drawEdgeOverlay=sv("overlay");ur.drawEdgeUnderlay=sv("underlay");ur.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,o,s=!1,u=this.usePaths(),l=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(u){var h=r.join("$"),v=n.pathCacheKey&&n.pathCacheKey===h;v?(o=e=n.pathCache,s=!0):(o=e=new Path2D,n.pathCacheKey=h,n.pathCache=o)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!s&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var c=2;c+3<r.length;c+=4)e.quadraticCurveTo(r[c],r[c+1],r[c+2],r[c+3]);break;case"straight":case"haystack":for(var d=2;d+1<r.length;d+=2)e.lineTo(r[d],r[d+1]);break;case"segments":if(n.isRound){var p=kt(n.roundCorners),y;try{for(p.s();!(y=p.n()).done;){var g=y.value;$c(e,g)}}catch(m){p.e(m)}finally{p.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};ur.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var a=t.pstyle("width").pfValue,n=0;n+1<r.length;n+=2){var i=[r[n+2]-r[n],r[n+3]-r[n+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],u=[s[0]*a/2,s[1]*a/2];e.beginPath(),e.moveTo(r[n]-u[0],r[n+1]-u[1]),e.lineTo(r[n]+u[0],r[n+1]+u[1]),e.lineTo(r[n+2],r[n+3]),e.closePath(),e.fill()}};ur.drawArrowheads=function(t,e,r){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(t,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,r),n||this.drawArrowhead(t,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,r)};ur.drawArrowhead=function(t,e,r,a,n,i,o){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)){var s=this,u=e.pstyle(r+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,h=e.pstyle("width").pfValue,v=e.pstyle(r+"-arrow-width"),c=v.value==="match-line"?h:v.pfValue;v.units==="%"&&(c*=h);var d=e.pstyle("opacity").value;o===void 0&&(o=d);var p=t.globalCompositeOperation;(o!==1||f==="hollow")&&(t.globalCompositeOperation="destination-out",s.colorFillStyle(t,255,255,255,1),s.colorStrokeStyle(t,255,255,255,1),s.drawArrowShape(e,t,l,h,u,c,a,n,i),t.globalCompositeOperation=p);var y=e.pstyle(r+"-arrow-color").value;s.colorFillStyle(t,y[0],y[1],y[2],o),s.colorStrokeStyle(t,y[0],y[1],y[2],o),s.drawArrowShape(e,t,f,h,u,c,a,n,i)}}};ur.drawArrowShape=function(t,e,r,a,n,i,o,s,u){var l=this,f=this.usePaths()&&n!=="triangle-cross",h=!1,v,c=e,d={x:o,y:s},p=t.pstyle("arrow-scale").value,y=this.getArrowWidth(a,p),g=l.arrowShapes[n];if(f){var b=l.arrowPathCache=l.arrowPathCache||[],m=Hr(n),w=b[m];w!=null?(v=e=w,h=!0):(v=e=new Path2D,b[m]=v)}h||(e.beginPath&&e.beginPath(),f?g.draw(e,1,0,{x:0,y:0},1):g.draw(e,y,u,d,a),e.closePath&&e.closePath()),e=c,f&&(e.translate(o,s),e.rotate(u),e.scale(y,y)),(r==="filled"||r==="both")&&(f?e.fill(v):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(f?y:1),e.lineJoin="miter",f?e.stroke(v):e.stroke()),f&&(e.scale(1/y,1/y),e.rotate(-u),e.translate(-o,-s))};var du={};du.safeDrawImage=function(t,e,r,a,n,i,o,s,u,l){if(!(n<=0||i<=0||u<=0||l<=0))try{t.drawImage(e,r,a,n,i,o,s,u,l)}catch(f){Ke(f)}};du.drawInscribedImage=function(t,e,r,a,n){var i=this,o=r.position(),s=o.x,u=o.y,l=r.cy().style(),f=l.getIndexedStyle.bind(l),h=f(r,"background-fit","value",a),v=f(r,"background-repeat","value",a),c=r.width(),d=r.height(),p=r.padding()*2,y=c+(f(r,"background-width-relative-to","value",a)==="inner"?0:p),g=d+(f(r,"background-height-relative-to","value",a)==="inner"?0:p),b=r._private.rscratch,m=f(r,"background-clip","value",a),w=m==="node",T=f(r,"background-image-opacity","value",a)*n,D=f(r,"background-image-smoothing","value",a),x=r.pstyle("corner-radius").value;x!=="auto"&&(x=r.pstyle("corner-radius").pfValue);var N=e.width||e.cachedW,O=e.height||e.cachedH;(N==null||O==null)&&(document.body.appendChild(e),N=e.cachedW=e.width||e.offsetWidth,O=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var R=N,P=O;if(f(r,"background-width","value",a)!=="auto"&&(f(r,"background-width","units",a)==="%"?R=f(r,"background-width","pfValue",a)*y:R=f(r,"background-width","pfValue",a)),f(r,"background-height","value",a)!=="auto"&&(f(r,"background-height","units",a)==="%"?P=f(r,"background-height","pfValue",a)*g:P=f(r,"background-height","pfValue",a)),!(R===0||P===0)){if(h==="contain"){var M=Math.min(y/R,g/P);R*=M,P*=M}else if(h==="cover"){var M=Math.max(y/R,g/P);R*=M,P*=M}var I=s-y/2,E=f(r,"background-position-x","units",a),A=f(r,"background-position-x","pfValue",a);E==="%"?I+=(y-R)*A:I+=A;var C=f(r,"background-offset-x","units",a),S=f(r,"background-offset-x","pfValue",a);C==="%"?I+=(y-R)*S:I+=S;var L=u-g/2,V=f(r,"background-position-y","units",a),F=f(r,"background-position-y","pfValue",a);V==="%"?L+=(g-P)*F:L+=F;var B=f(r,"background-offset-y","units",a),Y=f(r,"background-offset-y","pfValue",a);B==="%"?L+=(g-P)*Y:L+=Y,b.pathCache&&(I-=s,L-=u,s=0,u=0);var q=t.globalAlpha;t.globalAlpha=T;var Q=i.getImgSmoothing(t),$=!1;if(D==="no"&&Q?(i.setImgSmoothing(t,!1),$=!0):D==="yes"&&!Q&&(i.setImgSmoothing(t,!0),$=!0),v==="no-repeat")w&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,y,g,x,b),t.clip())),i.safeDrawImage(t,e,0,0,N,O,I,L,R,P),w&&t.restore();else{var K=t.createPattern(e,v);t.fillStyle=K,i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,y,g,x,b),t.translate(I,L),t.fill(),t.translate(-I,-L)}t.globalAlpha=q,$&&i.setImgSmoothing(t,Q)}};var $r={};$r.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(Js(r*a));e=Math.pow(2,n)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};$r.drawElementText=function(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(a==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(e),l=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=u,t.textBaseline=l?"alphabetic":"bottom"}else{var f=e.element()._private.rscratch.badLine,h=e.pstyle("label"),v=e.pstyle("source-label"),c=e.pstyle("target-label");if(f||(!h||!h.value)&&(!v||!v.value)&&(!c||!c.value))return;t.textAlign="center",t.textBaseline="bottom"}var d=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),n==null?(o.drawText(t,e,null,d,i),e.isEdge()&&(o.drawText(t,e,"source",d,i),o.drawText(t,e,"target",d,i))):o.drawText(t,e,n,d,i),r&&t.translate(p.x1,p.y1)};$r.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};$r.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*s,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+o+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,l[0],l[1],l[2],s),this.colorStrokeStyle(t,f[0],f[1],f[2],u)};function ub(t,e,r,a,n){var i=Math.min(a,n),o=i/2,s=e+a/2,u=r+n/2;t.beginPath(),t.arc(s,u,o,0,Math.PI*2),t.closePath()}function $f(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,a/2,n/2);t.beginPath(),t.moveTo(e+o,r),t.lineTo(e+a-o,r),t.quadraticCurveTo(e+a,r,e+a,r+o),t.lineTo(e+a,r+n-o),t.quadraticCurveTo(e+a,r+n,e+a-o,r+n),t.lineTo(e+o,r+n),t.quadraticCurveTo(e,r+n,e,r+n-o),t.lineTo(e,r+o),t.quadraticCurveTo(e,r,e+o,r),t.closePath()}$r.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=Mt(n,"labelAngle",e);r=t.isEdge()?s:0}else o.strValue==="none"?r=0:r=o.pfValue;return r};$r.drawText=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=n?e.effectiveOpacity():1;if(!(n&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=Mt(o,"labelX",r),l=Mt(o,"labelY",r),f,h,v=this.getLabelText(e,r);if(v!=null&&v!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(t,e,n);var c=r?r+"-":"",d=Mt(o,"labelWidth",r),p=Mt(o,"labelHeight",r),y=Mt(o,"labelActualDescent",r),g=e.pstyle(c+"text-margin-x").pfValue,b=e.pstyle(c+"text-margin-y").pfValue,m=e.isEdge(),w=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;m&&(w="center",T="center"),u+=g,l+=b;var D;a?D=this.getTextAngle(e,r):D=0,D!==0&&(f=u,h=l,t.translate(f,h),t.rotate(D),u=0,l=0);var x=ba(w),N=wa(T);switch(N){case"top":break;case"center":l+=p/2;break;case"bottom":l+=p;break}var O=e.pstyle("text-background-opacity").value,R=e.pstyle("text-border-opacity").value,P=e.pstyle("text-border-width").pfValue,M=e.pstyle("text-background-padding").pfValue,I=e.pstyle("text-background-shape").strValue,E=I==="round-rectangle"||I==="roundrectangle",A=I==="circle",C=2;if(O>0||P>0&&R>0){var S=t.fillStyle,L=t.strokeStyle,V=t.lineWidth,F=e.pstyle("text-background-color").value,B=e.pstyle("text-border-color").value,Y=e.pstyle("text-border-style").value,q=O>0,Q=P>0&&R>0,$=u-M;switch(x){case"left":$-=d;break;case"center":$-=d/2;break}var K=l-p-M,j=d+2*M,re=p+2*M;if(q&&(t.fillStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(O*s,")")),Q&&(t.strokeStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(R*s,")"),t.lineWidth=P,t.setLineDash))switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=P/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(E?(t.beginPath(),$f(t,$,K,j,re,C)):A?(t.beginPath(),ub(t,$,K,j,re)):(t.beginPath(),t.rect($,K,j,re)),q&&t.fill(),Q&&t.stroke(),Q&&Y==="double"){var U=P/2;t.beginPath(),E?$f(t,$+U,K+U,j-2*U,re-2*U,C):t.rect($+U,K+U,j-2*U,re-2*U),t.stroke()}t.fillStyle=S,t.strokeStyle=L,t.lineWidth=V,t.setLineDash&&t.setLineDash([])}var H=2*e.pstyle("text-outline-width").pfValue;if(H>0&&(t.lineWidth=H),l-=y,e.pstyle("text-wrap").value==="wrap"){var _=Mt(o,"labelWrapCachedLines",r),W=Mt(o,"labelLineHeight",r),J=d/2,te=this.getLabelJustification(e);switch(te==="auto"||(x==="left"?te==="left"?u+=-d:te==="center"&&(u+=-J):x==="center"?te==="left"?u+=-J:te==="right"&&(u+=J):x==="right"&&(te==="center"?u+=J:te==="right"&&(u+=d))),N){case"top":l-=(_.length-1)*W;break;case"center":case"bottom":l-=(_.length-1)*W;break}for(var de=0;de<_.length;de++)H>0&&t.strokeText(_[de],u,l),t.fillText(_[de],u,l),l+=W}else H>0&&t.strokeText(v,u,l),t.fillText(v,u,l);D!==0&&(t.rotate(-D),t.translate(-f,-h))}}};var Nr={};Nr.drawNode=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,u,l=e._private,f=l.rscratch,h=e.position();if(!(!be(h.x)||!be(h.y))&&!(i&&!e.visible())){var v=i?e.effectiveOpacity():1,c=o.usePaths(),d,p=!1,y=e.padding();s=e.width()+2*y,u=e.height()+2*y;var g;r&&(g=r,t.translate(-g.x1,-g.y1));for(var b=e.pstyle("background-image"),m=b.value,w=new Array(m.length),T=new Array(m.length),D=0,x=0;x<m.length;x++){var N=m[x],O=w[x]=N!=null&&N!=="none";if(O){var R=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",x);D++,T[x]=o.getCachedImage(N,R,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var P=e.pstyle("background-blacken").value,M=e.pstyle("border-width").pfValue,I=e.pstyle("background-opacity").value*v,E=e.pstyle("border-color").value,A=e.pstyle("border-style").value,C=e.pstyle("border-join").value,S=e.pstyle("border-cap").value,L=e.pstyle("border-position").value,V=e.pstyle("border-dash-pattern").pfValue,F=e.pstyle("border-dash-offset").pfValue,B=e.pstyle("border-opacity").value*v,Y=e.pstyle("outline-width").pfValue,q=e.pstyle("outline-color").value,Q=e.pstyle("outline-style").value,$=e.pstyle("outline-opacity").value*v,K=e.pstyle("outline-offset").value,j=e.pstyle("corner-radius").value;j!=="auto"&&(j=e.pstyle("corner-radius").pfValue);var re=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;o.eleFillStyle(t,e,k)},U=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B;o.colorStrokeStyle(t,E[0],E[1],E[2],k)},H=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;o.colorStrokeStyle(t,q[0],q[1],q[2],k)},_=function(k,z,G,X){var Z=o.nodePathCache=o.nodePathCache||[],ae=_h(G==="polygon"?G+","+X.join(","):G,""+z,""+k,""+j),ee=Z[ae],ie,se=!1;return ee!=null?(ie=ee,se=!0,f.pathCache=ie):(ie=new Path2D,Z[ae]=f.pathCache=ie),{path:ie,cacheHit:se}},W=e.pstyle("shape").strValue,J=e.pstyle("shape-polygon-points").pfValue;if(c){t.translate(h.x,h.y);var te=_(s,u,W,J);d=te.path,p=te.cacheHit}var de=function(){if(!p){var k=h;c&&(k={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(d||t,k.x,k.y,s,u,j,f)}c?t.fill(d):t.fill()},Te=function(){for(var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=l.backgrounding,X=0,Z=0;Z<T.length;Z++){var ae=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Z);if(z&&ae==="over"||!z&&ae==="inside"){X++;continue}w[Z]&&T[Z].complete&&!T[Z].error&&(X++,o.drawInscribedImage(t,T[Z],e,Z,k))}l.backgrounding=X!==D,G!==l.backgrounding&&e.updateStyle(!1)},ge=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;o.hasPie(e)&&(o.drawPie(t,e,z),k&&(c||o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,j,f)))},le=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;o.hasStripe(e)&&(t.save(),c?t.clip(f.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,j,f),t.clip()),o.drawStripe(t,e,z),t.restore(),k&&(c||o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,j,f)))},he=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,z=(P>0?P:-P)*k,G=P>0?0:255;P!==0&&(o.colorFillStyle(t,G,G,G,z),c?t.fill(d):t.fill())},fe=function(){if(M>0){if(t.lineWidth=M,t.lineCap=S,t.lineJoin=C,t.setLineDash)switch(A){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(V),t.lineDashOffset=F;break;case"solid":case"double":t.setLineDash([]);break}if(L!=="center"){if(t.save(),t.lineWidth*=2,L==="inside")c?t.clip(d):t.clip();else{var k=new Path2D;k.rect(-s/2-M,-u/2-M,s+2*M,u+2*M),k.addPath(d),t.clip(k,"evenodd")}c?t.stroke(d):t.stroke(),t.restore()}else c?t.stroke(d):t.stroke();if(A==="double"){t.lineWidth=M/3;var z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",c?t.stroke(d):t.stroke(),t.globalCompositeOperation=z}t.setLineDash&&t.setLineDash([])}},ve=function(){if(Y>0){if(t.lineWidth=Y,t.lineCap="butt",t.setLineDash)switch(Q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var k=h;c&&(k={x:0,y:0});var z=o.getNodeShape(e),G=M;L==="inside"&&(G=0),L==="outside"&&(G*=2);var X=(s+G+(Y+K))/s,Z=(u+G+(Y+K))/u,ae=s*X,ee=u*Z,ie=o.nodeShapes[z].points,se;if(c){var oe=_(ae,ee,z,ie);se=oe.path}if(z==="ellipse")o.drawEllipsePath(se||t,k.x,k.y,ae,ee);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(z)){var ue=0,pe=0,ce=0;z==="round-diamond"?ue=(G+K+Y)*1.4:z==="round-heptagon"?(ue=(G+K+Y)*1.075,ce=-(G/2+K+Y)/35):z==="round-hexagon"?ue=(G+K+Y)*1.12:z==="round-pentagon"?(ue=(G+K+Y)*1.13,ce=-(G/2+K+Y)/15):z==="round-tag"?(ue=(G+K+Y)*1.12,pe=(G/2+Y+K)*.07):z==="round-triangle"&&(ue=(G+K+Y)*(Math.PI/2),ce=-(G+K/2+Y)/Math.PI),ue!==0&&(X=(s+ue)/s,ae=s*X,["round-hexagon","round-tag"].includes(z)||(Z=(u+ue)/u,ee=u*Z)),j=j==="auto"?tc(ae,ee):j;for(var we=ae/2,Ne=ee/2,De=j+(G+Y+K)/2,Ee=new Array(ie.length/2),ze=new Array(ie.length/2),Ce=0;Ce<ie.length/2;Ce++)Ee[Ce]={x:k.x+pe+we*ie[Ce*2],y:k.y+ce+Ne*ie[Ce*2+1]};var Se,Ue,Re,Ve,He=Ee.length;for(Ue=Ee[He-1],Se=0;Se<He;Se++)Re=Ee[Se%He],Ve=Ee[(Se+1)%He],ze[Se]=cu(Ue,Re,Ve,De),Ue=Re,Re=Ve;o.drawRoundPolygonPath(se||t,k.x+pe,k.y+ce,s*X,u*Z,ie,ze)}else if(["roundrectangle","round-rectangle"].includes(z))j=j==="auto"?Er(ae,ee):j,o.drawRoundRectanglePath(se||t,k.x,k.y,ae,ee,j+(G+Y+K)/2);else if(["cutrectangle","cut-rectangle"].includes(z))j=j==="auto"?tu():j,o.drawCutRectanglePath(se||t,k.x,k.y,ae,ee,null,j+(G+Y+K)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(z))j=j==="auto"?Er(ae,ee):j,o.drawBottomRoundRectanglePath(se||t,k.x,k.y,ae,ee,j+(G+Y+K)/2);else if(z==="barrel")o.drawBarrelPath(se||t,k.x,k.y,ae,ee);else if(z.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(z)){var Ze=(G+Y+K)/s;ie=ei(ti(ie,Ze)),o.drawPolygonPath(se||t,k.x,k.y,s,u,ie)}else{var tt=(G+Y+K)/s;ie=ei(ti(ie,-tt)),o.drawPolygonPath(se||t,k.x,k.y,s,u,ie)}if(c?t.stroke(se):t.stroke(),Q==="double"){t.lineWidth=G/3;var Xe=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",c?t.stroke(se):t.stroke(),t.globalCompositeOperation=Xe}t.setLineDash&&t.setLineDash([])}},ye=function(){n&&o.drawNodeOverlay(t,e,h,s,u)},me=function(){n&&o.drawNodeUnderlay(t,e,h,s,u)},xe=function(){o.drawElementText(t,e,null,a)},Le=e.pstyle("ghost").value==="yes";if(Le){var ke=e.pstyle("ghost-offset-x").pfValue,Fe=e.pstyle("ghost-offset-y").pfValue,Be=e.pstyle("ghost-opacity").value,Oe=Be*v;t.translate(ke,Fe),H(),ve(),re(Be*I),de(),Te(Oe,!0),U(Be*B),fe(),ge(P!==0||M!==0),le(P!==0||M!==0),Te(Oe,!1),he(Oe),t.translate(-ke,-Fe)}c&&t.translate(-h.x,-h.y),me(),c&&t.translate(h.x,h.y),H(),ve(),re(),de(),Te(v,!0),U(),fe(),ge(P!==0||M!==0),le(P!==0||M!==0),Te(v,!1),he(),c&&t.translate(-h.x,-h.y),xe(),ye(),r&&t.translate(g.x1,g.y1)}};var uv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a,n,i,o){var s=this;if(a.visible()){var u=a.pstyle("".concat(e,"-padding")).pfValue,l=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,h=a.pstyle("".concat(e,"-shape")).value,v=a.pstyle("".concat(e,"-corner-radius")).value;if(l>0){if(n=n||a.position(),i==null||o==null){var c=a.padding();i=a.width()+2*c,o=a.height()+2*c}s.colorFillStyle(r,f[0],f[1],f[2],l),s.nodeShapes[h].draw(r,n.x,n.y,i+u*2,o+u*2,v),r.fill()}}}};Nr.drawNodeOverlay=uv("overlay");Nr.drawNodeUnderlay=uv("underlay");Nr.hasPie=function(t){return t=t[0],t._private.hasPie};Nr.hasStripe=function(t){return t=t[0],t._private.hasStripe};Nr.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,f=e.width(),h=e.height(),v=Math.min(f,h)/2,c,d=0,p=this.usePaths();if(p&&(u=0,l=0),i.units==="%"?v=v*i.pfValue:i.pfValue!==void 0&&(v=i.pfValue/2),o.units==="%"?c=v*o.pfValue:o.pfValue!==void 0&&(c=o.pfValue/2),!(c>=v))for(var y=1;y<=n.pieBackgroundN;y++){var g=e.pstyle("pie-"+y+"-background-size").value,b=e.pstyle("pie-"+y+"-background-color").value,m=e.pstyle("pie-"+y+"-background-opacity").value*r,w=g/100;w+d>1&&(w=1-d);var T=1.5*Math.PI+2*Math.PI*d;T+=s;var D=2*Math.PI*w,x=T+D;g===0||d>=1||d+w>1||(c===0?(t.beginPath(),t.moveTo(u,l),t.arc(u,l,v,T,x),t.closePath()):(t.beginPath(),t.arc(u,l,v,T,x),t.arc(u,l,c,x,T,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],m),t.fill(),d+=w)}};Nr.drawStripe=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,o=a.y,s=e.width(),u=e.height(),l=0,f=this.usePaths();t.save();var h=e.pstyle("stripe-direction").value,v=e.pstyle("stripe-size");switch(h){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var c=s,d=u;v.units==="%"?(c=c*v.pfValue,d=d*v.pfValue):v.pfValue!==void 0&&(c=v.pfValue,d=v.pfValue),f&&(i=0,o=0),o-=c/2,i-=d/2;for(var p=1;p<=n.stripeBackgroundN;p++){var y=e.pstyle("stripe-"+p+"-background-size").value,g=e.pstyle("stripe-"+p+"-background-color").value,b=e.pstyle("stripe-"+p+"-background-opacity").value*r,m=y/100;m+l>1&&(m=1-l),!(y===0||l>=1||l+m>1)&&(t.beginPath(),t.rect(i,o+d*l,c,d*m),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],b),t.fill(),l+=m)}t.restore()};var Ot={},lb=100;Ot.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Ot.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===t){r=!1;break}return r&&(a={context:t},e.push(a)),a};Ot.createGradientStyleFor=function(t,e,r,a,n){var i,o=this.usePaths(),s=r.pstyle(e+"-gradient-stop-colors").value,u=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),h=r.midpoint(),v=Yr(l,h),c=Yr(f,h);i=t.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(v,c))}else{var d=o?{x:0,y:0}:r.position(),p=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(p,y))}else if(r.isEdge()){var g=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(g.x,g.y,b.x,b.y)}else{var m=o?{x:0,y:0}:r.position(),w=r.paddedWidth(),T=r.paddedHeight(),D=w/2,x=T/2,N=r.pstyle("background-gradient-direction").value;switch(N){case"to-bottom":i=t.createLinearGradient(m.x,m.y-x,m.x,m.y+x);break;case"to-top":i=t.createLinearGradient(m.x,m.y+x,m.x,m.y-x);break;case"to-left":i=t.createLinearGradient(m.x+D,m.y,m.x-D,m.y);break;case"to-right":i=t.createLinearGradient(m.x-D,m.y,m.x+D,m.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(m.x-D,m.y-x,m.x+D,m.y+x);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(m.x-D,m.y+x,m.x+D,m.y-x);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(m.x+D,m.y-x,m.x-D,m.y+x);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(m.x+D,m.y+x,m.x-D,m.y-x);break}}if(!i)return null;for(var O=u.length===s.length,R=s.length,P=0;P<R;P++)i.addColorStop(O?u[P]:P/(R-1),"rgba("+s[P][0]+","+s[P][1]+","+s[P][2]+","+n+")");return i};Ot.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};Ot.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};Ot.eleFillStyle=function(t,e,r){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(t,e,a,r);else{var n=e.pstyle("background-color").value;this.colorFillStyle(t,n[0],n[1],n[2],r)}};Ot.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};Ot.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};Ot.eleStrokeStyle=function(t,e,r){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(t,e,a,r);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(t,n[0],n[1],n[2],r)}};Ot.matchCanvasSize=function(t){var e=this,r=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var u=n*o,l=i*o,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var h=r.canvasContainer;h.style.width=n+"px",h.style.height=i+"px";for(var v=0;v<e.CANVAS_LAYERS;v++)f=r.canvases[v],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";for(var v=0;v<e.BUFFER_COUNT;v++)f=r.bufferCanvases[v],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";e.textureMult=1,o<=1&&(f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l,e.pixelRatio=o}};Ot.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};Ot.clearCanvas=function(){var t=this,e=t.data;function r(a){a.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};Ot.render=function(t){var e=this;t=t||Kh();var r=e.cy,a=t.forcedContext,n=t.drawAllLayers,i=t.drawOnlyNodeLayer,o=t.forcedZoom,s=t.forcedPan,u=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,l=e.data,f=l.canvasNeedsRedraw,h=e.textureOnViewport&&!a&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),v=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,c=e.motionBlurPxRatio,d=r.hasCompoundNodes(),p=e.hoverData.draggingEles,y=!!(e.hoverData.selecting||e.touchData.selecting);v=v&&!a&&e.motionBlurEnabled&&!y;var g=v;a||(e.prevPxRatio!==u&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=u),!a&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),v&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(g=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!h&&(f[e.NODE]=!0,f[e.SELECT_BOX]=!0);var b=r.style(),m=r.zoom(),w=o!==void 0?o:m,T=r.pan(),D={x:T.x,y:T.y},x={zoom:m,pan:{x:T.x,y:T.y}},N=e.prevViewport,O=N===void 0||x.zoom!==N.zoom||x.pan.x!==N.pan.x||x.pan.y!==N.pan.y;!O&&!(p&&!d)&&(e.motionBlurPxRatio=1),s&&(D=s),w*=u,D.x*=u,D.y*=u;var R=e.getCachedZSortedEles();function P(U,H,_,W,J){var te=U.globalCompositeOperation;U.globalCompositeOperation="destination-out",e.colorFillStyle(U,255,255,255,e.motionBlurTransparency),U.fillRect(H,_,W,J),U.globalCompositeOperation=te}function M(U,H){var _,W,J,te;!e.clearingMotionBlur&&(U===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||U===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(_={x:T.x*c,y:T.y*c},W=m*c,J=e.canvasWidth*c,te=e.canvasHeight*c):(_=D,W=w,J=e.canvasWidth,te=e.canvasHeight),U.setTransform(1,0,0,1,0,0),H==="motionBlur"?P(U,0,0,J,te):!a&&(H===void 0||H)&&U.clearRect(0,0,J,te),n||(U.translate(_.x,_.y),U.scale(W,W)),s&&U.translate(s.x,s.y),o&&U.scale(o,o)}if(h||(e.textureDrawLastFrame=!1),h){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var I=e.data.bufferContexts[e.TEXTURE_BUFFER];I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:I,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var x=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}f[e.DRAG]=!1,f[e.NODE]=!1;var E=l.contexts[e.NODE],A=e.textureCache.texture,x=e.textureCache.viewport;E.setTransform(1,0,0,1,0,0),v?P(E,0,0,x.width,x.height):E.clearRect(0,0,x.width,x.height);var C=b.core("outside-texture-bg-color").value,S=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(E,C[0],C[1],C[2],S),E.fillRect(0,0,x.width,x.height);var m=r.zoom();M(E,!1),E.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u),E.drawImage(A,x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var L=r.extent(),V=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),F=e.hideEdgesOnViewport&&V,B=[];if(B[e.NODE]=!f[e.NODE]&&v&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,B[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),B[e.DRAG]=!f[e.DRAG]&&v&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,B[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),f[e.NODE]||n||i||B[e.NODE]){var Y=v&&!B[e.NODE]&&c!==1,E=a||(Y?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),q=v&&!Y?"motionBlur":void 0;M(E,q),F?e.drawCachedNodes(E,R.nondrag,u,L):e.drawLayeredElements(E,R.nondrag,u,L),e.debug&&e.drawDebugPoints(E,R.nondrag),!n&&!v&&(f[e.NODE]=!1)}if(!i&&(f[e.DRAG]||n||B[e.DRAG])){var Y=v&&!B[e.DRAG]&&c!==1,E=a||(Y?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);M(E,v&&!Y?"motionBlur":void 0),F?e.drawCachedNodes(E,R.drag,u,L):e.drawCachedElements(E,R.drag,u,L),e.debug&&e.drawDebugPoints(E,R.drag),!n&&!v&&(f[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,M),v&&c!==1){var Q=l.contexts[e.NODE],$=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],K=l.contexts[e.DRAG],j=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],re=function(H,_,W){H.setTransform(1,0,0,1,0,0),W||!g?H.clearRect(0,0,e.canvasWidth,e.canvasHeight):P(H,0,0,e.canvasWidth,e.canvasHeight);var J=c;H.drawImage(_,0,0,e.canvasWidth*J,e.canvasHeight*J,0,0,e.canvasWidth,e.canvasHeight)};(f[e.NODE]||B[e.NODE])&&(re(Q,$,B[e.NODE]),f[e.NODE]=!1),(f[e.DRAG]||B[e.DRAG])&&(re(K,j,B[e.DRAG]),f[e.DRAG]=!1)}e.prevViewport=x,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),v&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!h,e.mbFrames=0,f[e.NODE]=!0,f[e.DRAG]=!0,e.redraw()},lb)),a||r.emit("render")};var za;Ot.drawSelectionRectangle=function(t,e){var r=this,a=r.cy,n=r.data,i=a.style(),o=t.drawOnlyNodeLayer,s=t.drawAllLayers,u=n.canvasNeedsRedraw,l=t.forcedContext;if(r.showFps||!o&&u[r.SELECT_BOX]&&!s){var f=l||n.contexts[r.SELECT_BOX];if(e(f),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var h=r.cy.zoom(),v=i.core("selection-box-border-width").value/h;f.lineWidth=v,f.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",f.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),v>0&&(f.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",f.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(n.bgActivePosistion&&!r.hoverData.selecting){var h=r.cy.zoom(),c=n.bgActivePosistion;f.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",f.beginPath(),f.arc(c.x,c.y,i.core("active-bg-size").pfValue/h,0,2*Math.PI),f.fill()}var d=r.lastRedrawTime;if(r.showFps&&d){d=Math.round(d);var p=Math.round(1e3/d),y="1 frame = "+d+" ms = "+p+" fps";if(f.setTransform(1,0,0,1,0,0),f.fillStyle="rgba(255, 0, 0, 0.75)",f.strokeStyle="rgba(255, 0, 0, 0.75)",f.font="30px Arial",!za){var g=f.measureText(y);za=g.actualBoundingBoxAscent}f.fillText(y,0,za);var b=60;f.strokeRect(0,za+10,250,20),f.fillRect(0,za+10,250*Math.min(p/b,1),20)}s||(u[r.SELECT_BOX]=!1)}};function Kf(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(a));return a}function fb(t,e,r){var a=Kf(t,t.VERTEX_SHADER,e),n=Kf(t,t.FRAGMENT_SHADER,r),i=t.createProgram();if(t.attachShader(i,a),t.attachShader(i,n),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function hb(t,e,r){r===void 0&&(r=e);var a=t.makeOffscreenCanvas(e,r),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function gu(t){var e=t.pixelRatio,r=t.cy.zoom(),a=t.cy.pan();return{zoom:r*e,pan:{x:a.x*e,y:a.y*e}}}function cb(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function vb(t,e,r,a,n){var i=a*r+e.x,o=n*r+e.y;return o=Math.round(t.canvasHeight-o),[i,o]}function db(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function gb(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Ir(t,e,r){var a=t[0]/255,n=t[1]/255,i=t[2]/255,o=e,s=r||new Array(4);return s[0]=a*o,s[1]=n*o,s[2]=i*o,s[3]=o,s}function aa(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function pb(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function yb(t,e){var r=t.createTexture();return r.buffer=function(a){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function lv(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function fv(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function mb(t,e,r,a,n,i){switch(e){case t.FLOAT:return new Float32Array(r.buffer,i*a,n);case t.INT:return new Int32Array(r.buffer,i*a,n)}}function bb(t,e,r,a){var n=lv(t,e),i=ft(n,2),o=i[0],s=i[1],u=fv(t,s,a),l=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,u,t.STATIC_DRAW),s===t.FLOAT?t.vertexAttribPointer(r,o,s,!1,0,0):s===t.INT&&t.vertexAttribIPointer(r,o,s,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),l}function $t(t,e,r,a){var n=lv(t,r),i=ft(n,3),o=i[0],s=i[1],u=i[2],l=fv(t,s,e*o),f=o*u,h=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,h),t.bufferData(t.ARRAY_BUFFER,e*f,t.DYNAMIC_DRAW),t.enableVertexAttribArray(a),s===t.FLOAT?t.vertexAttribPointer(a,o,s,!1,f,0):s===t.INT&&t.vertexAttribIPointer(a,o,s,f,0),t.vertexAttribDivisor(a,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var v=new Array(e),c=0;c<e;c++)v[c]=mb(t,s,l,f,o,c);return h.dataArray=l,h.stride=f,h.size=o,h.getView=function(d){return v[d]},h.setPoint=function(d,p,y){var g=v[d];g[0]=p,g[1]=y},h.bufferSubData=function(d){t.bindBuffer(t.ARRAY_BUFFER,h),d?t.bufferSubData(t.ARRAY_BUFFER,0,l,0,d*o):t.bufferSubData(t.ARRAY_BUFFER,0,l)},h}function wb(t,e,r){for(var a=9,n=new Float32Array(e*a),i=new Array(e),o=0;o<e;o++){var s=o*a*4;i[o]=new Float32Array(n.buffer,s,a)}var u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,n.byteLength,t.DYNAMIC_DRAW);for(var l=0;l<3;l++){var f=r+l;t.enableVertexAttribArray(f),t.vertexAttribPointer(f,3,t.FLOAT,!1,36,l*12),t.vertexAttribDivisor(f,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),u.getMatrixView=function(h){return i[h]},u.setData=function(h,v){i[v].set(h,0)},u.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferSubData(t.ARRAY_BUFFER,0,n)},u}function Eb(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(a,n){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,a,n,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var Zf=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function ss(){var t=new Zf(9);return Zf!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Qf(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function xb(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=r[0],c=r[1],d=r[2],p=r[3],y=r[4],g=r[5],b=r[6],m=r[7],w=r[8];return t[0]=v*a+c*o+d*l,t[1]=v*n+c*s+d*f,t[2]=v*i+c*u+d*h,t[3]=p*a+y*o+g*l,t[4]=p*n+y*s+g*f,t[5]=p*i+y*u+g*h,t[6]=b*a+m*o+w*l,t[7]=b*n+m*s+w*f,t[8]=b*i+m*u+w*h,t}function Xn(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=r[0],c=r[1];return t[0]=a,t[1]=n,t[2]=i,t[3]=o,t[4]=s,t[5]=u,t[6]=v*a+c*o+l,t[7]=v*n+c*s+f,t[8]=v*i+c*u+h,t}function Jf(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=Math.sin(r),c=Math.cos(r);return t[0]=c*a+v*o,t[1]=c*n+v*s,t[2]=c*i+v*u,t[3]=c*o-v*a,t[4]=c*s-v*n,t[5]=c*u-v*i,t[6]=l,t[7]=f,t[8]=h,t}function zs(t,e,r){var a=r[0],n=r[1];return t[0]=a*e[0],t[1]=a*e[1],t[2]=a*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Tb(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var Cb=(function(){function t(e,r,a,n){Dr(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=a,this.texHeight=Math.floor(r/a),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=n(e,r,r),this.scratch=n(e,r,this.texHeight,"scratch")}return Ar(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var a=r.w,n=r.h,i=this.texHeight,o=this.texSize,s=i/n,u=a*s,l=n*s;return u>o&&(s=o/a,u=a*s,l=n*s),{scale:s,texW:u,texH:l}}},{key:"draw",value:function(r,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,u=this.texHeight,l=this.getScale(a),f=l.scale,h=l.texW,v=l.texH,c=function(m,w){if(n&&w){var T=w.context,D=m.x,x=m.row,N=D,O=u*x;T.save(),T.translate(N,O),T.scale(f,f),n(T,a),T.restore()}},d=[null,null],p=function(){c(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:h,h:v},d[1]={x:i.freePointer.x+h,y:i.freePointer.row*u,w:0,h:v},i.freePointer.x+=h,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},y=function(){var m=i.scratch,w=i.canvas;m.clear(),c({x:0,row:0},m);var T=o-i.freePointer.x,D=h-T,x=u;{var N=i.freePointer.x,O=i.freePointer.row*u,R=T;w.context.drawImage(m,0,0,R,x,N,O,R,x),d[0]={x:N,y:O,w:R,h:v}}{var P=T,M=(i.freePointer.row+1)*u,I=D;w&&w.context.drawImage(m,P,0,I,x,0,M,I,x),d[1]={x:0,y:M,w:I,h:v}}i.freePointer.x=D,i.freePointer.row++},g=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+h<=o)p();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(g(),p()):this.enableWrapping?y():(g(),p())}return this.keyToLocation.set(r,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(r),o=i.texW;return this.freePointer.x+o>a?this.freePointer.row<n-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=yb(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),Sb=(function(){function t(e,r,a,n){Dr(this,t),this.r=e,this.texSize=r,this.texRows=a,this.createTextureCanvas=n,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Ar(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas;return new Cb(r,a,n,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas,o=Math.floor(a/n);this.scratch=i(r,a,o,"scratch")}return this.scratch}},{key:"draw",value:function(r,a,n){var i=this.styleKeyToAtlas.get(r);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(a))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(r,a,n),this.styleKeyToAtlas.set(r,i)),i}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,a=this.markedKeys;if(a.size===0){console.log("nothing to garbage collect");return}var n=[],i=new Map,o=null,s=kt(this.atlases),u;try{var l=function(){var h=u.value,v=h.getKeys(),c=Db(a,v);if(c.size===0)return n.push(h),v.forEach(function(T){return i.set(T,h)}),1;o||(o=r._createAtlas(),n.push(o));var d=kt(v),p;try{for(d.s();!(p=d.n()).done;){var y=p.value;if(!c.has(y)){var g=h.getOffsets(y),b=ft(g,2),m=b[0],w=b[1];o.canFit({w:m.w+w.w,h:m.h})||(o.lock(),o=r._createAtlas(),n.push(o)),h.canvas&&(r._copyTextureToNewAtlas(y,h,o),i.set(y,o))}}}catch(T){d.e(T)}finally{d.f()}h.dispose()};for(s.s();!(u=s.n()).done;)l()}catch(f){s.e(f)}finally{s.f()}this.atlases=n,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,a,n){var i=a.getOffsets(r),o=ft(i,2),s=o[0],u=o[1];if(u.w===0)n.draw(r,s,function(v){v.drawImage(a.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var l=this._getScratchCanvas();l.clear(),l.context.drawImage(a.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),l.context.drawImage(a.canvas,u.x,u.y,u.w,u.h,s.w,0,u.w,u.h);var f=s.w+u.w,h=s.h;n.draw(r,{w:f,h},function(v){v.drawImage(l,0,0,f,h,0,0,f,h)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function Db(t,e){return t.intersection?t.intersection(e):new Set(Zn(t).filter(function(r){return e.has(r)}))}var Ab=(function(){function t(e,r){Dr(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Ar(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,a){var n=this.globalOptions,i=n.webglTexSize,o=n.createTextureCanvas,s=a.texRows,u=this._cacheScratchCanvas(o),l=new Sb(this.r,i,s,u);this.collections.set(r,l)}},{key:"addRenderType",value:function(r,a){var n=a.collection;if(!this.collections.has(n))throw new Error("invalid atlas collection name '".concat(n,"'"));var i=this.collections.get(n),o=Ie({type:r,atlasCollection:i},a);this.renderTypes.set(r,o)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var a=-1,n=-1,i=null;return function(o,s,u,l){return l?((!i||s!=a||u!=n)&&(a=s,n=u,i=r(o,s,u)),i):r(o,s,u)}}},{key:"_key",value:function(r,a){return"".concat(r,"-").concat(a)}},{key:"invalidate",value:function(r){var a=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,o=i===void 0?!1:i,s=n.filterEle,u=s===void 0?function(){return!0}:s,l=n.filterType,f=l===void 0?function(){return!0}:l,h=!1,v=!1,c=kt(r),d;try{for(c.s();!(d=c.n()).done;){var p=d.value;if(u(p)){var y=kt(this.renderTypes.values()),g;try{var b=function(){var w=g.value,T=w.type;if(f(T)){var D=a.collections.get(w.collection),x=w.getKey(p),N=Array.isArray(x)?x:[x];if(o)N.forEach(function(M){return D.markKeyForGC(M)}),v=!0;else{var O=w.getID?w.getID(p):p.id(),R=a._key(T,O),P=a.typeAndIdToKey.get(R);P!==void 0&&!gb(N,P)&&(h=!0,a.typeAndIdToKey.delete(R),P.forEach(function(M){return D.markKeyForGC(M)}))}}};for(y.s();!(g=y.n()).done;)b()}catch(m){y.e(m)}finally{y.f()}}}}catch(m){c.e(m)}finally{c.f()}return v&&(this.gc(),h=!1),h}},{key:"gc",value:function(){var r=kt(this.collections.values()),a;try{for(r.s();!(a=r.n()).done;){var n=a.value;n.gc()}}catch(i){r.e(i)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,a,n,i){var o=this.renderTypes.get(a),s=this.collections.get(o.collection),u=!1,l=s.draw(i,n,function(v){o.drawClipped?(v.save(),v.beginPath(),v.rect(0,0,n.w,n.h),v.clip(),o.drawElement(v,r,n,!0,!0),v.restore()):o.drawElement(v,r,n,!0,!0),u=!0});if(u){var f=o.getID?o.getID(r):r.id(),h=this._key(a,f);this.typeAndIdToKey.has(h)?this.typeAndIdToKey.get(h).push(i):this.typeAndIdToKey.set(h,[i])}return l}},{key:"getAtlasInfo",value:function(r,a){var n=this,i=this.renderTypes.get(a),o=i.getKey(r),s=Array.isArray(o)?o:[o];return s.map(function(u){var l=i.getBoundingBox(r,u),f=n.getOrCreateAtlas(r,a,l,u),h=f.getOffsets(u),v=ft(h,2),c=v[0],d=v[1];return{atlas:f,tex:c,tex1:c,tex2:d,bb:l}})}},{key:"getDebugInfo",value:function(){var r=[],a=kt(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=ft(n.value,2),o=i[0],s=i[1],u=s.getCounts(),l=u.keyCount,f=u.atlasCount;r.push({type:o,keyCount:l,atlasCount:f})}}catch(h){a.e(h)}finally{a.f()}return r}}])})(),Lb=(function(){function t(e){Dr(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Ar(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var a=this.batchAtlases.indexOf(r);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),a=this.batchAtlases.length-1}return a}}])})(),Nb=`
17
+ `),g=y.length,b=0,m=0,w=0;w<g;w++){var T=y[w],D=v.measureText(T),x=Math.ceil(D.width),N=s;f==="glyph"&&(w===0&&(m=D.actualBoundingBoxAscent),w===g-1&&(b=D.actualBoundingBoxDescent)),d=Math.max(x,d),p+=N}return f==="glyph"&&(p-=s-m-b),d+=i,p+=i,{width:d,height:p,labelActualAscent:m,labelActualDescent:b}};er.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:n&&s==="autorotate"?a.labelAutoAngle:s==="autorotate"?0:o.pfValue};er.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(t),r&&(n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var Jc={},Vf=28,Gf=!1;Jc.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Vf||t.height()<Vf))return Gf||(Ke("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Gf=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var a=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return r};var Mi={};Mi.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,a=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var u=0;u<o.length;u++){var l=o[u],f=l._private,h=f.rstyle;h.clean=!1,h.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var s=o.target;a(s)}).on("style.* background.*",function(o){var s=o.target;a(s,!1)});var n=function(o){if(o){var s=r.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],f=l._private.rstyle;l.isNode()&&!f.cleanConnected&&(a(l.connectedEdges()),f.cleanConnected=!0)}if(s)for(var h=0;h<s.length;h++){var v=s[h];v(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)};Mi.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};Mi.recalculateRenderedStyle=function(t,e){var r=function(w){return w._private.rstyle.cleanConnected};if(t.length!==0){var a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var o=t[i],s=o._private,u=s.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(u.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(m){return!m._private.rstyle.clean&&m.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?n.push(o):a.push(o),u.clean=!0)}for(var l=0;l<n.length;l++){var f=n[l],h=f._private,v=h.rstyle,c=f.position();this.recalculateNodeLabelProjection(f),v.nodeX=c.x,v.nodeY=c.y,v.nodeW=f.pstyle("width").pfValue,v.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var p=a[d],y=p._private,g=y.rstyle,b=y.rscratch;g.srcX=b.arrowStartX,g.srcY=b.arrowStartY,g.tgtX=b.arrowEndX,g.tgtY=b.arrowEndY,g.midX=b.midX,g.midY=b.midY,g.labelAngle=b.labelAngle,g.sourceLabelAngle=b.sourceLabelAngle,g.targetLabelAngle=b.targetLabelAngle}}}};var Ri={};Ri.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?t.drag.push(a):t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}}};Ri.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Ri.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Pc),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var jc={};[$r,oi,At,pn,vu,er,Jc,Mi,Ri].forEach(function(t){Ie(jc,t)});var ev={};ev.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},i=n[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=n[t]=n[t]||{};var o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var s="data:",u=t.substring(0,s.length).toLowerCase()===s;return u||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var tv=function(e,r){var a=e[0];!a||a._private.grabbed===r||(a._private.grabbed=r,e.updateStyle(!1))},T0=function(e){tv(e,!0)},C0=function(e){tv(e,!1)},Aa={};Aa.registerBinding=function(t,e,r,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var s=t[o];if(s!==void 0){var u=this.binder(s);i.push(u.on.apply(u,n))}}return i}var u=this.binder(t);return u.on.apply(u,n)};Aa.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||Pd(t);if(e.supportsPassiveEvents==null){var n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=n}var o=function(u,l,f){var h=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(h[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:h}),(t.addEventListener||t.on).apply(t,h),this};return{on:o,addEventListener:o,addListener:o,bind:o}};Aa.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Aa.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Aa.load=function(){var t=this,e=t.cy.window(),r=function(k){return k.selected()},a=function(k){var z=k.getRootNode();if(z&&z.nodeType===11&&z.host!==void 0)return z},n=function(k,z,G,X){k==null&&(k=t.cy);for(var Z=0;Z<z.length;Z++){var ae=z[Z];k.emit({originalEvent:G,type:ae,position:X})}},i=function(k){return k.shiftKey||k.metaKey||k.ctrlKey},o=function(k,z){var G=!0;if(t.cy.hasCompoundNodes()&&k&&k.pannable())for(var X=0;z&&X<z.length;X++){var k=z[X];if(k.isNode()&&k.isParent()&&!k.pannable()){G=!1;break}}else G=!0;return G},s=function(k){k[0]._private.rscratch.inDragLayer=!0},u=function(k){k[0]._private.rscratch.inDragLayer=!1},l=function(k){k[0]._private.rscratch.isGrabTarget=!0},f=function(k){k[0]._private.rscratch.isGrabTarget=!1},h=function(k,z){var G=z.addToList,X=G.has(k);!X&&k.grabbable()&&!k.locked()&&(G.merge(k),T0(k))},v=function(k,z){if(k.cy().hasCompoundNodes()&&!(z.inDragLayer==null&&z.addToList==null)){var G=k.descendants();z.inDragLayer&&(G.forEach(s),G.connectedEdges().forEach(s)),z.addToList&&h(G,z)}},c=function(k,z){z=z||{};var G=k.cy().hasCompoundNodes();z.inDragLayer&&(k.forEach(s),k.neighborhood().stdFilter(function(X){return!G||X.isEdge()}).forEach(s)),z.addToList&&k.forEach(function(X){h(X,z)}),v(k,z),y(k,{inDragLayer:z.inDragLayer}),t.updateCachedGrabbedEles()},d=c,p=function(k){k&&(t.getCachedZSortedEles().forEach(function(z){C0(z),u(z),f(z)}),t.updateCachedGrabbedEles())},y=function(k,z){if(!(z.inDragLayer==null&&z.addToList==null)&&k.cy().hasCompoundNodes()){var G=k.ancestors().orphans();if(!G.same(k)){var X=G.descendants().spawnSelf().merge(G).unmerge(k).unmerge(k.descendants()),Z=X.connectedEdges();z.inDragLayer&&(Z.forEach(s),X.forEach(s)),z.addToList&&X.forEach(function(ae){h(ae,z)})}}},g=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},b=typeof MutationObserver<"u",m=typeof ResizeObserver<"u";b?(t.removeObserver=new MutationObserver(function(ne){for(var k=0;k<ne.length;k++){var z=ne[k],G=z.removedNodes;if(G)for(var X=0;X<G.length;X++){var Z=G[X];if(Z===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(ne){t.destroy()});var w=cn(function(){t.cy.resize()},100);b&&(t.styleObserver=new MutationObserver(w),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",w),m&&(t.resizeObserver=new ResizeObserver(w),t.resizeObserver.observe(t.container));var T=function(k,z){for(;k!=null;)z(k),k=k.parentNode},D=function(){t.invalidateContainerClientCoordsCache()};T(t.container,function(ne){t.registerBinding(ne,"transitionend",D),t.registerBinding(ne,"animationend",D),t.registerBinding(ne,"scroll",D)}),t.registerBinding(t.container,"contextmenu",function(ne){ne.preventDefault()});var x=function(){return t.selection[4]!==0},N=function(k){for(var z=t.findContainerClientCoords(),G=z[0],X=z[1],Z=z[2],ae=z[3],ee=k.touches?k.touches:[k],ie=!1,se=0;se<ee.length;se++){var oe=ee[se];if(G<=oe.clientX&&oe.clientX<=G+Z&&X<=oe.clientY&&oe.clientY<=X+ae){ie=!0;break}}if(!ie)return!1;for(var ue=t.container,pe=k.target,ce=pe.parentNode,we=!1;ce;){if(ce===ue){we=!0;break}ce=ce.parentNode}return!!we};t.registerBinding(t.container,"mousedown",function(k){if(N(k)&&!(t.hoverData.which===1&&k.which!==1)){k.preventDefault(),g(),t.hoverData.capture=!0,t.hoverData.which=k.which;var z=t.cy,G=[k.clientX,k.clientY],X=t.projectIntoViewport(G[0],G[1]),Z=t.selection,ae=t.findNearestElements(X[0],X[1],!0,!1),ee=ae[0],ie=t.dragData.possibleDragElements;t.hoverData.mdownPos=X,t.hoverData.mdownGPos=G;var se=function(Ne){return{originalEvent:k,type:Ne,position:{x:X[0],y:X[1]}}},oe=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Ne=t.hoverData.down;Ne?Ne.emit(se("taphold")):z.emit(se("taphold"))}},t.tapholdDuration)};if(k.which==3){t.hoverData.cxtStarted=!0;var ue={originalEvent:k,type:"cxttapstart",position:{x:X[0],y:X[1]}};ee?(ee.activate(),ee.emit(ue),t.hoverData.down=ee):z.emit(ue),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(k.which==1){ee&&ee.activate();{if(ee!=null&&t.nodeIsGrabbable(ee)){var pe=function(Ne){Ne.emit(se("grab"))};if(l(ee),!ee.selected())ie=t.dragData.possibleDragElements=z.collection(),d(ee,{addToList:ie}),ee.emit(se("grabon")).emit(se("grab"));else{ie=t.dragData.possibleDragElements=z.collection();var ce=z.$(function(we){return we.isNode()&&we.selected()&&t.nodeIsGrabbable(we)});c(ce,{addToList:ie}),ee.emit(se("grabon")),ce.forEach(pe)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ee,t.hoverData.downs=ae,t.hoverData.downTime=new Date().getTime()}n(ee,["mousedown","tapstart","vmousedown"],k,{x:X[0],y:X[1]}),ee==null?(Z[4]=1,t.data.bgActivePosistion={x:X[0],y:X[1]},t.redrawHint("select",!0),t.redraw()):ee.pannable()&&(Z[4]=1),oe()}Z[0]=Z[2]=X[0],Z[1]=Z[3]=X[1]}},!1);var O=a(t.container);t.registerBinding([e,O],"mousemove",function(k){var z=t.hoverData.capture;if(!(!z&&!N(k))){var G=!1,X=t.cy,Z=X.zoom(),ae=[k.clientX,k.clientY],ee=t.projectIntoViewport(ae[0],ae[1]),ie=t.hoverData.mdownPos,se=t.hoverData.mdownGPos,oe=t.selection,ue=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ue=t.findNearestElement(ee[0],ee[1],!0,!1));var pe=t.hoverData.last,ce=t.hoverData.down,we=[ee[0]-oe[2],ee[1]-oe[3]],Ne=t.dragData.possibleDragElements,De;if(se){var Ee=ae[0]-se[0],ze=Ee*Ee,Ce=ae[1]-se[1],Se=Ce*Ce,Ue=ze+Se;t.hoverData.isOverThresholdDrag=De=Ue>=t.desktopTapThreshold2}var Re=i(k);De&&(t.hoverData.tapholdCancelled=!0);var Ve=function(){var ut=t.hoverData.dragDelta=t.hoverData.dragDelta||[];ut.length===0?(ut.push(we[0]),ut.push(we[1])):(ut[0]+=we[0],ut[1]+=we[1])};G=!0,n(ue,["mousemove","vmousemove","tapdrag"],k,{x:ee[0],y:ee[1]});var He=function(ut){return{originalEvent:k,type:ut,position:{x:ee[0],y:ee[1]}}},Ze=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit(He("boxstart")),oe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(De){var tt=He("cxtdrag");ce?ce.emit(tt):X.emit(tt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ue!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(He("cxtdragout")),t.hoverData.cxtOver=ue,ue&&ue.emit(He("cxtdragover")))}}else if(t.hoverData.dragging){if(G=!0,X.panningEnabled()&&X.userPanningEnabled()){var Xe;if(t.hoverData.justStartedPan){var Lt=t.hoverData.mdownPos;Xe={x:(ee[0]-Lt[0])*Z,y:(ee[1]-Lt[1])*Z},t.hoverData.justStartedPan=!1}else Xe={x:we[0]*Z,y:we[1]*Z};X.panBy(Xe),X.emit(He("dragpan")),t.hoverData.dragged=!0}ee=t.projectIntoViewport(k.clientX,k.clientY)}else if(oe[4]==1&&(ce==null||ce.pannable())){if(De){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(Re||!X.panningEnabled()||!X.userPanningEnabled()))Ze();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Pt=o(ce,t.hoverData.downs);Pt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,oe[4]=0,t.data.bgActivePosistion=ua(ie),t.redrawHint("select",!0),t.redraw())}ce&&ce.pannable()&&ce.active()&&ce.unactivate()}}else{if(ce&&ce.pannable()&&ce.active()&&ce.unactivate(),(!ce||!ce.grabbed())&&ue!=pe&&(pe&&n(pe,["mouseout","tapdragout"],k,{x:ee[0],y:ee[1]}),ue&&n(ue,["mouseover","tapdragover"],k,{x:ee[0],y:ee[1]}),t.hoverData.last=ue),ce)if(De){if(X.boxSelectionEnabled()&&Re)ce&&ce.grabbed()&&(p(Ne),ce.emit(He("freeon")),Ne.emit(He("free")),t.dragData.didDrag&&(ce.emit(He("dragfreeon")),Ne.emit(He("dragfree")))),Ze();else if(ce&&ce.grabbed()&&t.nodeIsDraggable(ce)){var pt=!t.dragData.didDrag;pt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||c(Ne,{inDragLayer:!0});var at={x:0,y:0};if(be(we[0])&&be(we[1])&&(at.x+=we[0],at.y+=we[1],pt)){var st=t.hoverData.dragDelta;st&&be(st[0])&&be(st[1])&&(at.x+=st[0],at.y+=st[1])}t.hoverData.draggingEles=!0,Ne.silentShift(at).emit(He("position")).emit(He("drag")),t.redrawHint("drag",!0),t.redraw()}}else Ve();G=!0}if(oe[2]=ee[0],oe[3]=ee[1],G)return k.stopPropagation&&k.stopPropagation(),k.preventDefault&&k.preventDefault(),!1}},!1);var R,P,M;t.registerBinding(e,"mouseup",function(k){if(!(t.hoverData.which===1&&k.which!==1&&t.hoverData.capture)){var z=t.hoverData.capture;if(z){t.hoverData.capture=!1;var G=t.cy,X=t.projectIntoViewport(k.clientX,k.clientY),Z=t.selection,ae=t.findNearestElement(X[0],X[1],!0,!1),ee=t.dragData.possibleDragElements,ie=t.hoverData.down,se=i(k);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ie&&ie.unactivate();var oe=function(Ee){return{originalEvent:k,type:Ee,position:{x:X[0],y:X[1]}}};if(t.hoverData.which===3){var ue=oe("cxttapend");if(ie?ie.emit(ue):G.emit(ue),!t.hoverData.cxtDragged){var pe=oe("cxttap");ie?ie.emit(pe):G.emit(pe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(ae,["mouseup","tapend","vmouseup"],k,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(ie,["click","tap","vclick"],k,{x:X[0],y:X[1]}),P=!1,k.timeStamp-M<=G.multiClickDebounceTime()?(R&&clearTimeout(R),P=!0,M=null,n(ie,["dblclick","dbltap","vdblclick"],k,{x:X[0],y:X[1]})):(R=setTimeout(function(){P||n(ie,["oneclick","onetap","voneclick"],k,{x:X[0],y:X[1]})},G.multiClickDebounceTime()),M=k.timeStamp)),ie==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(k)&&(G.$(r).unselect(["tapunselect"]),ee.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ee=G.collection()),ae==ie&&!t.dragData.didDrag&&!t.hoverData.selecting&&ae!=null&&ae._private.selectable&&(t.hoverData.dragging||(G.selectionType()==="additive"||se?ae.selected()?ae.unselect(["tapunselect"]):ae.select(["tapselect"]):se||(G.$(r).unmerge(ae).unselect(["tapunselect"]),ae.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var ce=G.collection(t.getAllInBox(Z[0],Z[1],Z[2],Z[3]));t.redrawHint("select",!0),ce.length>0&&t.redrawHint("eles",!0),G.emit(oe("boxend"));var we=function(Ee){return Ee.selectable()&&!Ee.selected()};G.selectionType()==="additive"||se||G.$(r).unmerge(ce).unselect(),ce.emit(oe("box")).stdFilter(we).select().emit(oe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!Z[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ne=ie&&ie.grabbed();p(ee),Ne&&(ie.emit(oe("freeon")),ee.emit(oe("free")),t.dragData.didDrag&&(ie.emit(oe("dragfreeon")),ee.emit(oe("dragfree"))))}}Z[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var I=[],E=4,A,C=1e5,S=function(k,z){for(var G=0;G<k.length;G++)if(k[G]%z!==0)return!1;return!0},L=function(k){for(var z=Math.abs(k[0]),G=1;G<k.length;G++)if(Math.abs(k[G])!==z)return!1;return!0},V=function(k){var z=!1,G=k.deltaY;if(G==null&&(k.wheelDeltaY!=null?G=k.wheelDeltaY/4:k.wheelDelta!=null&&(G=k.wheelDelta/4)),G!==0){if(A==null)if(I.length>=E){var X=I;if(A=S(X,5),!A){var Z=Math.abs(X[0]);A=L(X)&&Z>5}if(A)for(var ae=0;ae<X.length;ae++)C=Math.min(Math.abs(X[ae]),C)}else I.push(G),z=!0;else A&&(C=Math.min(Math.abs(G),C));if(!t.scrollingPage){var ee=t.cy,ie=ee.zoom(),se=ee.pan(),oe=t.projectIntoViewport(k.clientX,k.clientY),ue=[oe[0]*ie+se.x,oe[1]*ie+se.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||x()){k.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){k.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var pe;z&&Math.abs(G)>5&&(G=js(G)*5),pe=G/-250,A&&(pe/=C,pe*=3),pe=pe*t.wheelSensitivity;var ce=k.deltaMode===1;ce&&(pe*=33);var we=ee.zoom()*Math.pow(10,pe);k.type==="gesturechange"&&(we=t.gestureStartZoom*k.scale),ee.zoom({level:we,renderedPosition:{x:ue[0],y:ue[1]}}),ee.emit({type:k.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:k,position:{x:oe[0],y:oe[1]}})}}}};t.registerBinding(t.container,"wheel",V,!0),t.registerBinding(e,"scroll",function(k){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(k){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||k.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ne){t.hasTouchStarted||V(ne)},!0),t.registerBinding(t.container,"mouseout",function(k){var z=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseout",position:{x:z[0],y:z[1]}})},!1),t.registerBinding(t.container,"mouseover",function(k){var z=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseover",position:{x:z[0],y:z[1]}})},!1);var F,B,Y,q,Q,$,K,j,re,U,H,_,W,J=function(k,z,G,X){return Math.sqrt((G-k)*(G-k)+(X-z)*(X-z))},te=function(k,z,G,X){return(G-k)*(G-k)+(X-z)*(X-z)},de;t.registerBinding(t.container,"touchstart",de=function(k){if(t.hasTouchStarted=!0,!!N(k)){g(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var z=t.cy,G=t.touchData.now,X=t.touchData.earlier;if(k.touches[0]){var Z=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);G[0]=Z[0],G[1]=Z[1]}if(k.touches[1]){var Z=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);G[2]=Z[0],G[3]=Z[1]}if(k.touches[2]){var Z=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);G[4]=Z[0],G[5]=Z[1]}var ae=function(Re){return{originalEvent:k,type:Re,position:{x:G[0],y:G[1]}}};if(k.touches[1]){t.touchData.singleTouchMoved=!0,p(t.dragData.touchDragEles);var ee=t.findContainerClientCoords();re=ee[0],U=ee[1],H=ee[2],_=ee[3],F=k.touches[0].clientX-re,B=k.touches[0].clientY-U,Y=k.touches[1].clientX-re,q=k.touches[1].clientY-U,W=0<=F&&F<=H&&0<=Y&&Y<=H&&0<=B&&B<=_&&0<=q&&q<=_;var ie=z.pan(),se=z.zoom();Q=J(F,B,Y,q),$=te(F,B,Y,q),K=[(F+Y)/2,(B+q)/2],j=[(K[0]-ie.x)/se,(K[1]-ie.y)/se];var oe=200,ue=oe*oe;if($<ue&&!k.touches[2]){var pe=t.findNearestElement(G[0],G[1],!0,!0),ce=t.findNearestElement(G[2],G[3],!0,!0);pe&&pe.isNode()?(pe.activate().emit(ae("cxttapstart")),t.touchData.start=pe):ce&&ce.isNode()?(ce.activate().emit(ae("cxttapstart")),t.touchData.start=ce):z.emit(ae("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(k.touches[2])z.boxSelectionEnabled()&&k.preventDefault();else if(!k.touches[1]){if(k.touches[0]){var we=t.findNearestElements(G[0],G[1],!0,!0),Ne=we[0];if(Ne!=null&&(Ne.activate(),t.touchData.start=Ne,t.touchData.starts=we,t.nodeIsGrabbable(Ne))){var De=t.dragData.touchDragEles=z.collection(),Ee=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ne.selected()?(Ee=z.$(function(Ue){return Ue.selected()&&t.nodeIsGrabbable(Ue)}),c(Ee,{addToList:De})):d(Ne,{addToList:De}),l(Ne),Ne.emit(ae("grabon")),Ee?Ee.forEach(function(Ue){Ue.emit(ae("grab"))}):Ne.emit(ae("grab"))}n(Ne,["touchstart","tapstart","vmousedown"],k,{x:G[0],y:G[1]}),Ne==null&&(t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&n(t.touchData.start,["taphold"],k,{x:G[0],y:G[1]})},t.tapholdDuration)}}if(k.touches.length>=1){for(var ze=t.touchData.startPosition=[null,null,null,null,null,null],Ce=0;Ce<G.length;Ce++)ze[Ce]=X[Ce]=G[Ce];var Se=k.touches[0];t.touchData.startGPosition=[Se.clientX,Se.clientY]}}},!1);var Te;t.registerBinding(e,"touchmove",Te=function(k){var z=t.touchData.capture;if(!(!z&&!N(k))){var G=t.selection,X=t.cy,Z=t.touchData.now,ae=t.touchData.earlier,ee=X.zoom();if(k.touches[0]){var ie=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Z[0]=ie[0],Z[1]=ie[1]}if(k.touches[1]){var ie=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);Z[2]=ie[0],Z[3]=ie[1]}if(k.touches[2]){var ie=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);Z[4]=ie[0],Z[5]=ie[1]}var se=function(ed){return{originalEvent:k,type:ed,position:{x:Z[0],y:Z[1]}}},oe=t.touchData.startGPosition,ue;if(z&&k.touches[0]&&oe){for(var pe=[],ce=0;ce<Z.length;ce++)pe[ce]=Z[ce]-ae[ce];var we=k.touches[0].clientX-oe[0],Ne=we*we,De=k.touches[0].clientY-oe[1],Ee=De*De,ze=Ne+Ee;ue=ze>=t.touchTapThreshold2}if(z&&t.touchData.cxt){k.preventDefault();var Ce=k.touches[0].clientX-re,Se=k.touches[0].clientY-U,Ue=k.touches[1].clientX-re,Re=k.touches[1].clientY-U,Ve=te(Ce,Se,Ue,Re),He=Ve/$,Ze=150,tt=Ze*Ze,Xe=1.5,Lt=Xe*Xe;if(He>=Lt||Ve>=tt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Pt=se("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Pt),t.touchData.start=null):X.emit(Pt)}}if(z&&t.touchData.cxt){var Pt=se("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Pt):X.emit(Pt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var pt=t.findNearestElement(Z[0],Z[1],!0,!0);(!t.touchData.cxtOver||pt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(se("cxtdragout")),t.touchData.cxtOver=pt,pt&&pt.emit(se("cxtdragover")))}else if(z&&k.touches[2]&&X.boxSelectionEnabled())k.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit(se("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,G[4]=1,!G||G.length===0||G[0]===void 0?(G[0]=(Z[0]+Z[2]+Z[4])/3,G[1]=(Z[1]+Z[3]+Z[5])/3,G[2]=(Z[0]+Z[2]+Z[4])/3+1,G[3]=(Z[1]+Z[3]+Z[5])/3+1):(G[2]=(Z[0]+Z[2]+Z[4])/3,G[3]=(Z[1]+Z[3]+Z[5])/3),t.redrawHint("select",!0),t.redraw();else if(z&&k.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){k.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var at=t.dragData.touchDragEles;if(at){t.redrawHint("drag",!0);for(var st=0;st<at.length;st++){var Ft=at[st]._private;Ft.grabbed=!1,Ft.rscratch.inDragLayer=!1}}var ut=t.touchData.start,Ce=k.touches[0].clientX-re,Se=k.touches[0].clientY-U,Ue=k.touches[1].clientX-re,Re=k.touches[1].clientY-U,Rr=J(Ce,Se,Ue,Re),lr=Rr/Q;if(W){var fr=Ce-F,wn=Se-B,Ma=Ue-Y,En=Re-q,Ra=(fr+Ma)/2,Ii=(wn+En)/2,rr=X.zoom(),Qr=rr*lr,Or=X.pan(),Jr=j[0]*rr+Or.x,Oa=j[1]*rr+Or.y,ht={x:-Qr/rr*(Jr-Or.x-Ra)+Jr,y:-Qr/rr*(Oa-Or.y-Ii)+Oa};if(ut&&ut.active()){var at=t.dragData.touchDragEles;p(at),t.redrawHint("drag",!0),t.redrawHint("eles",!0),ut.unactivate().emit(se("freeon")),at.emit(se("free")),t.dragData.didDrag&&(ut.emit(se("dragfreeon")),at.emit(se("dragfree")))}X.viewport({zoom:Qr,pan:ht,cancelOnFailedZoom:!0}),X.emit(se("pinchzoom")),Q=Rr,F=Ce,B=Se,Y=Ue,q=Re,t.pinching=!0}if(k.touches[0]){var ie=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Z[0]=ie[0],Z[1]=ie[1]}if(k.touches[1]){var ie=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);Z[2]=ie[0],Z[3]=ie[1]}if(k.touches[2]){var ie=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);Z[4]=ie[0],Z[5]=ie[1]}}else if(k.touches[0]&&!t.touchData.didSelect){var Pe=t.touchData.start,Ye=t.touchData.last,pt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(pt=t.findNearestElement(Z[0],Z[1],!0,!0)),z&&Pe!=null&&k.preventDefault(),z&&Pe!=null&&t.nodeIsDraggable(Pe))if(ue){var at=t.dragData.touchDragEles,Ht=!t.dragData.didDrag;Ht&&c(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var yt={x:0,y:0};if(be(pe[0])&&be(pe[1])&&(yt.x+=pe[0],yt.y+=pe[1],Ht)){t.redrawHint("eles",!0);var Yt=t.touchData.dragDelta;Yt&&be(Yt[0])&&be(Yt[1])&&(yt.x+=Yt[0],yt.y+=Yt[1])}t.hoverData.draggingEles=!0,at.silentShift(yt).emit(se("position")).emit(se("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ae[0]&&t.touchData.startPosition[1]==ae[1]&&t.redrawHint("eles",!0),t.redraw()}else{var Yt=t.touchData.dragDelta=t.touchData.dragDelta||[];Yt.length===0?(Yt.push(pe[0]),Yt.push(pe[1])):(Yt[0]+=pe[0],Yt[1]+=pe[1])}if(n(Pe||pt,["touchmove","tapdrag","vmousemove"],k,{x:Z[0],y:Z[1]}),(!Pe||!Pe.grabbed())&&pt!=Ye&&(Ye&&Ye.emit(se("tapdragout")),pt&&pt.emit(se("tapdragover"))),t.touchData.last=pt,z)for(var st=0;st<Z.length;st++)Z[st]&&t.touchData.startPosition[st]&&ue&&(t.touchData.singleTouchMoved=!0);if(z&&(Pe==null||Pe.pannable())&&X.panningEnabled()&&X.userPanningEnabled()){var jv=o(Pe,t.touchData.starts);jv&&(k.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ua(t.touchData.startPosition)),t.swipePanning?(X.panBy({x:pe[0]*ee,y:pe[1]*ee}),X.emit(se("dragpan"))):ue&&(t.swipePanning=!0,X.panBy({x:we*ee,y:De*ee}),X.emit(se("dragpan")),Pe&&(Pe.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ie=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Z[0]=ie[0],Z[1]=ie[1]}}for(var ce=0;ce<Z.length;ce++)ae[ce]=Z[ce];z&&k.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var ge;t.registerBinding(e,"touchcancel",ge=function(k){var z=t.touchData.start;t.touchData.capture=!1,z&&z.unactivate()});var le,he,fe,ve;if(t.registerBinding(e,"touchend",le=function(k){var z=t.touchData.start,G=t.touchData.capture;if(G)k.touches.length===0&&(t.touchData.capture=!1),k.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var Z=t.cy,ae=Z.zoom(),ee=t.touchData.now,ie=t.touchData.earlier;if(k.touches[0]){var se=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);ee[0]=se[0],ee[1]=se[1]}if(k.touches[1]){var se=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);ee[2]=se[0],ee[3]=se[1]}if(k.touches[2]){var se=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);ee[4]=se[0],ee[5]=se[1]}var oe=function(tt){return{originalEvent:k,type:tt,position:{x:ee[0],y:ee[1]}}};z&&z.unactivate();var ue;if(t.touchData.cxt){if(ue=oe("cxttapend"),z?z.emit(ue):Z.emit(ue),!t.touchData.cxtDragged){var pe=oe("cxttap");z?z.emit(pe):Z.emit(pe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!k.touches[2]&&Z.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var ce=Z.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),Z.emit(oe("boxend"));var we=function(tt){return tt.selectable()&&!tt.selected()};ce.emit(oe("box")).stdFilter(we).select().emit(oe("boxselect")),ce.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(z?.unactivate(),k.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!k.touches[1]){if(!k.touches[0]){if(!k.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ne=t.dragData.touchDragEles;if(z!=null){var De=z._private.grabbed;p(Ne),t.redrawHint("drag",!0),t.redrawHint("eles",!0),De&&(z.emit(oe("freeon")),Ne.emit(oe("free")),t.dragData.didDrag&&(z.emit(oe("dragfreeon")),Ne.emit(oe("dragfree")))),n(z,["touchend","tapend","vmouseup","tapdragout"],k,{x:ee[0],y:ee[1]}),z.unactivate(),t.touchData.start=null}else{var Ee=t.findNearestElement(ee[0],ee[1],!0,!0);n(Ee,["touchend","tapend","vmouseup","tapdragout"],k,{x:ee[0],y:ee[1]})}var ze=t.touchData.startPosition[0]-ee[0],Ce=ze*ze,Se=t.touchData.startPosition[1]-ee[1],Ue=Se*Se,Re=Ce+Ue,Ve=Re*ae*ae;t.touchData.singleTouchMoved||(z||Z.$(":selected").unselect(["tapunselect"]),n(z,["tap","vclick"],k,{x:ee[0],y:ee[1]}),he=!1,k.timeStamp-ve<=Z.multiClickDebounceTime()?(fe&&clearTimeout(fe),he=!0,ve=null,n(z,["dbltap","vdblclick"],k,{x:ee[0],y:ee[1]})):(fe=setTimeout(function(){he||n(z,["onetap","voneclick"],k,{x:ee[0],y:ee[1]})},Z.multiClickDebounceTime()),ve=k.timeStamp)),z!=null&&!t.dragData.didDrag&&z._private.selectable&&Ve<t.touchTapThreshold2&&!t.pinching&&(Z.selectionType()==="single"?(Z.$(r).unmerge(z).unselect(["tapunselect"]),z.select(["tapselect"])):z.selected()?z.unselect(["tapunselect"]):z.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var He=0;He<ee.length;He++)ie[He]=ee[He];t.dragData.didDrag=!1,k.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),k.touches.length<2&&(k.touches.length===1&&(t.touchData.startGPosition=[k.touches[0].clientX,k.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ye=[],me=function(k){return{clientX:k.clientX,clientY:k.clientY,force:1,identifier:k.pointerId,pageX:k.pageX,pageY:k.pageY,radiusX:k.width/2,radiusY:k.height/2,screenX:k.screenX,screenY:k.screenY,target:k.target}},xe=function(k){return{event:k,touch:me(k)}},Le=function(k){ye.push(xe(k))},ke=function(k){for(var z=0;z<ye.length;z++){var G=ye[z];if(G.event.pointerId===k.pointerId){ye.splice(z,1);return}}},Fe=function(k){var z=ye.filter(function(G){return G.event.pointerId===k.pointerId})[0];z.event=k,z.touch=me(k)},Be=function(k){k.touches=ye.map(function(z){return z.touch})},Oe=function(k){return k.pointerType==="mouse"||k.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ne){Oe(ne)||(ne.preventDefault(),Le(ne),Be(ne),de(ne))}),t.registerBinding(t.container,"pointerup",function(ne){Oe(ne)||(ke(ne),Be(ne),le(ne))}),t.registerBinding(t.container,"pointercancel",function(ne){Oe(ne)||(ke(ne),Be(ne),ge(ne))}),t.registerBinding(t.container,"pointermove",function(ne){Oe(ne)||(ne.preventDefault(),Fe(ne),Be(ne),Te(ne))})}};var sr={};sr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(a,n,i,o,s,u){this.renderer.nodeShapeImpl("polygon",a,n,i,o,s,this.points)},intersectLine:function(a,n,i,o,s,u,l,f){return Ja(s,u,this.points,a,n,i/2,o/2,l)},checkPoint:function(a,n,i,o,s,u,l,f){return or(a,n,this.points,u,l,o,s,[0,-1],i)},hasMiterBounds:t!=="rectangle",miterBounds:function(a,n,i,o,s,u){return Kg(this.points,a,n,i,o,s)}}};sr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s,u){return ap(i,o,e,r,a/2+s,n/2+s)},checkPoint:function(e,r,a,n,i,o,s,u){return Ur(e,r,n,i,o,s,a)}}};sr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(a,n,i,o,s,u,l){if(u[l]!==void 0&&u[l+"-cx"]===a&&u[l+"-cy"]===n)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=a,u[l+"-cy"]=n;var f=i/2,h=o/2;s=s==="auto"?tc(i,o):s;for(var v=new Array(e.length/2),c=0;c<e.length/2;c++)v[c]={x:a+f*e[c*2],y:n+h*e[c*2+1]};var d,p,y,g,b=v.length;for(p=v[b-1],d=0;d<b;d++)y=v[d%b],g=v[(d+1)%b],u[l][d]=cu(p,y,g,s),p=y,y=g;return u[l]},draw:function(a,n,i,o,s,u,l){this.renderer.nodeShapeImpl("round-polygon",a,n,i,o,s,this.points,this.getOrCreateCorners(n,i,o,s,u,l,"drawCorners"))},intersectLine:function(a,n,i,o,s,u,l,f,h){return ip(s,u,this.points,a,n,i,o,l,this.getOrCreateCorners(a,n,i,o,f,h,"corners"))},checkPoint:function(a,n,i,o,s,u,l,f,h){return rp(a,n,this.points,u,l,o,s,this.getOrCreateCorners(u,l,o,s,f,h,"corners"))}}};sr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Nt(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,o)},intersectLine:function(e,r,a,n,i,o,s,u){return jh(i,o,e,r,a,n,s,u)},checkPoint:function(e,r,a,n,i,o,s,u){var l=n/2,f=i/2;u=u==="auto"?Er(n,i):u,u=Math.min(l,f,u);var h=u*2;return!!(or(e,r,this.points,o,s,n,i-h,[0,-1],a)||or(e,r,this.points,o,s,n-h,i,[0,-1],a)||Ur(e,r,h,h,o-l+u,s-f+u,a)||Ur(e,r,h,h,o+l-u,s-f+u,a)||Ur(e,r,h,h,o+l-u,s+f-u,a)||Ur(e,r,h,h,o-l+u,s+f-u,a))}}};sr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:tu(),points:Nt(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,null,o)},generateCutTrianglePts:function(e,r,a,n,i){var o=i==="auto"?this.cornerLength:i,s=r/2,u=e/2,l=a-u,f=a+u,h=n-s,v=n+s;return{topLeft:[l,h+o,l+o,h,l+o,h+o],topRight:[f-o,h,f,h+o,f-o,h+o],bottomRight:[f,v-o,f-o,v,f-o,v-o],bottomLeft:[l+o,v,l,v-o,l+o,v-o]}},intersectLine:function(e,r,a,n,i,o,s,u){var l=this.generateCutTrianglePts(a+2*s,n+2*s,e,r,u),f=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return Ja(i,o,f,e,r)},checkPoint:function(e,r,a,n,i,o,s,u){var l=u==="auto"?this.cornerLength:u;if(or(e,r,this.points,o,s,n,i-2*l,[0,-1],a)||or(e,r,this.points,o,s,n-2*l,i,[0,-1],a))return!0;var f=this.generateCutTrianglePts(n,i,o,s);return It(e,r,f.topLeft)||It(e,r,f.topRight)||It(e,r,f.bottomRight)||It(e,r,f.bottomLeft)}}};sr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Nt(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s,u){var l=.15,f=.5,h=.85,v=this.generateBarrelBezierPts(a+2*s,n+2*s,e,r),c=function(y){var g=ha({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},l),b=ha({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f),m=ha({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},h);return[y[0],y[1],g.x,g.y,b.x,b.y,m.x,m.y,y[4],y[5]]},d=[].concat(c(v.topLeft),c(v.topRight),c(v.bottomRight),c(v.bottomLeft));return Ja(i,o,d,e,r)},generateBarrelBezierPts:function(e,r,a,n){var i=r/2,o=e/2,s=a-o,u=a+o,l=n-i,f=n+i,h=Cs(e,r),v=h.heightOffset,c=h.widthOffset,d=h.ctrlPtOffsetPct*e,p={topLeft:[s,l+v,s+d,l,s+c,l],topRight:[u-c,l,u-d,l,u,l+v],bottomRight:[u,f-v,u-d,f,u-c,f],bottomLeft:[s+c,f,s+d,f,s,f-v]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,r,a,n,i,o,s,u){var l=Cs(n,i),f=l.heightOffset,h=l.widthOffset;if(or(e,r,this.points,o,s,n,i-2*f,[0,-1],a)||or(e,r,this.points,o,s,n-2*h,i,[0,-1],a))return!0;for(var v=this.generateBarrelBezierPts(n,i,o,s),c=function(N,O,R){var P=R[4],M=R[2],I=R[0],E=R[5],A=R[1],C=Math.min(P,I),S=Math.max(P,I),L=Math.min(E,A),V=Math.max(E,A);if(C<=N&&N<=S&&L<=O&&O<=V){var F=op(P,M,I),B=Jg(F[0],F[1],F[2],N),Y=B.filter(function(q){return 0<=q&&q<=1});if(Y.length>0)return Y[0]}return null},d=Object.keys(v),p=0;p<d.length;p++){var y=d[p],g=v[y],b=c(e,r,g);if(b!=null){var m=g[5],w=g[3],T=g[1],D=mt(m,w,T,b);if(g.isTop&&D<=r||g.isBottom&&r<=D)return!0}}return!1}}};sr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Nt(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,o)},intersectLine:function(e,r,a,n,i,o,s,u){var l=e-(a/2+s),f=r-(n/2+s),h=f,v=e+(a/2+s),c=pr(i,o,e,r,l,f,v,h,!1);return c.length>0?c:jh(i,o,e,r,a,n,s,u)},checkPoint:function(e,r,a,n,i,o,s,u){u=u==="auto"?Er(n,i):u;var l=2*u;if(or(e,r,this.points,o,s,n,i-l,[0,-1],a)||or(e,r,this.points,o,s,n-l,i,[0,-1],a))return!0;var f=n/2+2*a,h=i/2+2*a,v=[o-f,s-h,o-f,s,o+f,s,o+f,s-h];return!!(It(e,r,v)||Ur(e,r,l,l,o+n/2-u,s+i/2-u,a)||Ur(e,r,l,l,o-n/2+u,s+i/2-u,a))}}};sr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Nt(3,0)),this.generateRoundPolygon("round-triangle",Nt(3,0)),this.generatePolygon("rectangle",Nt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Nt(5,0)),this.generateRoundPolygon("round-pentagon",Nt(5,0)),this.generatePolygon("hexagon",Nt(6,0)),this.generateRoundPolygon("round-hexagon",Nt(6,0)),this.generatePolygon("heptagon",Nt(7,0)),this.generateRoundPolygon("round-heptagon",Nt(7,0)),this.generatePolygon("octagon",Nt(8,0)),this.generateRoundPolygon("round-octagon",Nt(8,0));var a=new Array(20);{var n=Ts(5,0),i=Ts(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)a[s*4]=n[s*2],a[s*4+1]=n[s*2+1],a[s*4+2]=i[s*2],a[s*4+3]=i[s*2+1]}a=ec(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(l){var f=l.join("$"),h="polygon-"+f,v;return(v=this[h])?v:e.generatePolygon(h,l)}};var yn={};yn.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};yn.redraw=function(t){t=t||Kh();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};yn.beforeRender=function(t,e){if(!this.destroyed){e==null&&nt("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(a,n){return n.priority-a.priority})}};var Uf=function(e,r,a){for(var n=e.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(r,a)};yn.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(n){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){Uf(t,!0,n);var i=ir();t.render(t.renderOptions);var o=t.lastDrawTime=ir();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var s=o-i;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else Uf(t,!1,n);t.skipFrame=!1,Jn(r)}};Jn(r)}};var S0=function(e){this.init(e)},rv=S0,La=rv.prototype;La.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];La.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),a=e.cy.window();if(a){var n=a.document,i=n.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",u=n.getElementById(o)!=null;if(r.className.indexOf(s)<0&&(r.className=(r.className||"")+" "+s),!u){var l=n.createElement("style");l.id=o,l.textContent="."+s+" { position: relative; }",i.insertBefore(l,i.children[0])}var f=a.getComputedStyle(r),h=f.getPropertyValue("position");h==="static"&&Ke("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=be(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};La.notify=function(t,e){var r=this,a=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&a.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};La.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],a=r,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};La.isHeadless=function(){return!1};[hu,jc,ev,Aa,sr,yn].forEach(function(t){Ie(La,t)});var is=1e3/60,av={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=cn(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(l,f){var h=ir(),v=n.averageRedrawTime,c=n.lastRedrawTime,d=[],p=n.cy.extent(),y=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var g=ir(),b=g-h,m=g-f;if(c<is){var w=is-(l?v:0);if(m>=e.deqFastCost*w)break}else if(l){if(b>=e.deqCost*c||b>=e.deqAvgCost*v)break}else if(m>=e.deqNoDrawCost*is)break;var T=e.deq(a,y,p);if(T.length>0)for(var D=0;D<T.length;D++)d.push(T[D]);else break}d.length>0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,y,p)&&i())},s=e.priority||Zs;n.beforeRender(o,s(a))}}}},D0=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jn;Dr(this,t),this.idsByKey=new nr,this.keyForId=new nr,this.cachesByLvl=new nr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Ar(t,[{key:"getIdsFor",value:function(r){r==null&&nt("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new Ta,a.set(r,n)),n}},{key:"addIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).add(a)}},{key:"deleteIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).delete(a)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);return n!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);return i||(i=new nr,a.set(r,i),n.push(r)),i}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(r,a){return this.getCachesAt(a).has(r)}},{key:"has",value:function(r,a){var n=this.getKey(r);return this.hasCache(n,a)}},{key:"setCache",value:function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)}},{key:"set",value:function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,a){this.getCachesAt(a).delete(r)}},{key:"delete",value:function(r,a){var n=this.getKey(r);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})}},{key:"invalidate",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Hf=25,In=50,Wn=-4,Fs=3,nv=7.99,A0=8,L0=1024,N0=1024,M0=1024,R0=.2,O0=.8,P0=10,I0=.15,k0=.1,B0=.9,F0=.9,z0=100,V0=1,fa={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},G0=Tt({getKey:null,doesEleInvalidateKey:jn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Wh,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ya=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=G0(r);Ie(a,n),a.lookup=new D0(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},gt=Ya.prototype;gt.reasons=fa;gt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};gt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};gt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new vn(function(r,a){return a.reqs-r.reqs});return e};gt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};gt.getElement=function(t,e,r,a,n){var i=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(Js(s*r))),a<Wn)a=Wn;else if(s>=nv||a>Fs)return null;var l=Math.pow(2,a),f=e.h*l,h=e.w*l,v=o.eleTextBiggerThanMin(t,l);if(!this.isVisible(t,v))return null;var c=u.get(t,a);if(c&&c.invalidated&&(c.invalidated=!1,c.texture.invalidatedWidth-=c.width),c)return c;var d;if(f<=Hf?d=Hf:f<=In?d=In:d=Math.ceil(f/In)*In,f>M0||h>N0)return null;var p=i.getTextureQueue(d),y=p[p.length-2],g=function(){return i.recycleTexture(d,h)||i.addTexture(d,h)};y||(y=p[p.length-1]),y||(y=g()),y.width-y.usedWidth<h&&(y=g());for(var b=function(C){return C&&C.scaledLabelShown===v},m=n&&n===fa.dequeue,w=n&&n===fa.highQuality,T=n&&n===fa.downscale,D,x=a+1;x<=Fs;x++){var N=u.get(t,x);if(N){D=N;break}}var O=D&&D.level===a+1?D:null,R=function(){y.context.drawImage(O.texture.canvas,O.x,0,O.width,O.height,y.usedWidth,0,h,f)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,h,d),b(O))R();else if(b(D))if(w){for(var P=D.level;P>a;P--)O=i.getElement(t,e,r,P,fa.downscale);R()}else return i.queueElement(t,D.level-1),D;else{var M;if(!m&&!w&&!T)for(var I=a-1;I>=Wn;I--){var E=u.get(t,I);if(E){M=E;break}}if(b(M))return i.queueElement(t,a),M;y.context.translate(y.usedWidth,0),y.context.scale(l,l),this.drawElement(y.context,t,e,v,!1),y.context.scale(1/l,1/l),y.context.translate(-y.usedWidth,0)}return c={x:y.usedWidth,texture:y,level:a,scale:l,width:h,height:f,scaledLabelShown:v},y.usedWidth+=Math.ceil(h+A0),y.eleCaches.push(c),u.set(t,a,c),i.checkTextureFullness(y),c};gt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};gt.invalidateElement=function(t){var e=this,r=e.lookup,a=[],n=r.isInvalid(t);if(n){for(var i=Wn;i<=Fs;i++){var o=r.getForCachedKey(t,i);o&&a.push(o)}var s=r.invalidate(t);if(s)for(var u=0;u<a.length;u++){var l=a[u],f=l.texture;f.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)}};gt.checkTextureUtility=function(t){t.invalidatedWidth>=R0*t.width&&this.retireTexture(t)};gt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>O0&&t.fullnessChecks>=P0?wr(r,t):t.fullnessChecks++};gt.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;wr(a,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var s=i[o];n.deleteCache(s.key,s.level)}Qs(i);var u=e.getRetiredTextureQueue(r);u.push(t)};gt.addTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n={};return a.push(n),n.eleCaches=[],n.height=t,n.width=Math.max(L0,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};gt.recycleTexture=function(t,e){for(var r=this,a=r.getTextureQueue(t),n=r.getRetiredTextureQueue(t),i=0;i<n.length;i++){var o=n[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Qs(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),wr(n,o),a.push(o),o}};gt.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),o=n[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,a.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(s),n[i]=s}};gt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,o=0;o<V0&&r.size()>0;o++){var s=r.pop(),u=s.key,l=s.eles[0],f=i.hasCache(l,s.level);if(a[u]=null,f)continue;n.push(s);var h=e.getBoundingBox(l);e.getElement(l,h,t,s.level,fa.dequeue)}return n};gt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Ks,r.updateItem(i),r.pop(),a[n]=null):i.eles.unmerge(t))};gt.onDequeue=function(t){this.onDequeues.push(t)};gt.offDequeue=function(t){wr(this.onDequeues,t)};gt.setupDequeueing=av.setupDequeueing({deqRedrawThreshold:z0,deqCost:I0,deqAvgCost:k0,deqNoDrawCost:B0,deqFastCost:F0,deq:function(e,r,a){return e.dequeue(r,a)},onDeqd:function(e,r){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(r)}},shouldRedraw:function(e,r,a,n){for(var i=0;i<r.length;i++)for(var o=r[i].eles,s=0;s<o.length;s++){var u=o[s].boundingBox();if(eu(u,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var U0=1,Wa=-4,si=2,H0=3.99,Y0=50,q0=50,_0=.15,W0=.1,X0=.9,$0=.9,K0=1,Yf=250,Z0=4e3*4e3,qf=32767,Q0=!0,iv=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=ir()-2*Yf,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=cn(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},q0),a.beforeRender(function(o,s){s-r.lastInvalidationTime<=Yf?r.skipping=!0:r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(s,u){return u.reqs-s.reqs};r.layersQueue=new vn(i),r.setupDequeueing()},Ct=iv.prototype,_f=0,J0=Math.pow(2,53)-1;Ct.makeLayer=function(t,e){var r=Math.pow(2,e),a=Math.ceil(t.w*r),n=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(a,n),o={id:_f=++_f%J0,bb:t,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(r,r),s.translate(u,l),o};Ct.getLayers=function(t,e,r){var a=this,n=a.renderer,i=n.cy,o=i.zoom(),s=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(Js(o*e)),r<Wa)r=Wa;else if(o>=H0||r>si)return null}a.validateLayersElesOrdering(r,t);var u=a.layersByLevel,l=Math.pow(2,r),f=u[r]=u[r]||[],h,v=a.levelIsComplete(r,t),c,d=function(){var R=function(A){if(a.validateLayersElesOrdering(A,t),a.levelIsComplete(A,t))return c=u[A],!0},P=function(A){if(!c)for(var C=r+A;Wa<=C&&C<=si&&!R(C);C+=A);};P(1),P(-1);for(var M=f.length-1;M>=0;M--){var I=f[M];I.invalid&&wr(f,I)}};if(!v)d();else return f;var p=function(){if(!h){h=Rt();for(var R=0;R<t.length;R++)Wg(h,t[R].boundingBox())}return h},y=function(R){R=R||{};var P=R.after;p();var M=Math.ceil(h.w*l),I=Math.ceil(h.h*l);if(M>qf||I>qf)return null;var E=M*I;if(E>Z0)return null;var A=a.makeLayer(h,r);if(P!=null){var C=f.indexOf(P)+1;f.splice(C,0,A)}else(R.insert===void 0||R.insert)&&f.unshift(A);return A};if(a.skipping&&!s)return null;for(var g=null,b=t.length/U0,m=!s,w=0;w<t.length;w++){var T=t[w],D=T._private.rscratch,x=D.imgLayerCaches=D.imgLayerCaches||{},N=x[r];if(N){g=N;continue}if((!g||g.eles.length>=b||!Jh(g.bb,T.boundingBox()))&&(g=y({insert:!0,after:g}),!g))return null;c||m?a.queueLayer(g,T):a.drawEleInLayer(g,T,r,e),g.eles.push(T),x[r]=g}return c||(m?null:f)};Ct.getEleLevelForLayerLevel=function(t,e){return t};Ct.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,Q0),i.setImgSmoothing(o,!0))};Ct.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;for(var n=0,i=0;i<a.length;i++){var o=a[i];if(o.reqs>0||o.invalid)return!1;n+=o.eles.length}return n===e.length};Ct.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a<r.length;a++){for(var n=r[a],i=-1,o=0;o<e.length;o++)if(n.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(n);continue}for(var s=i,o=0;o<n.eles.length;o++)if(n.eles[o]!==e[s+o]){this.invalidateLayer(n);break}}};Ct.updateElementsInLayers=function(t,e){for(var r=this,a=un(t[0]),n=0;n<t.length;n++)for(var i=a?null:t[n],o=a?t[n]:t[n].ele,s=o._private.rscratch,u=s.imgLayerCaches=s.imgLayerCaches||{},l=Wa;l<=si;l++){var f=u[l];f&&(i&&r.getEleLevelForLayerLevel(f.level)!==i.level||e(f,o,i))}};Ct.haveLayers=function(){for(var t=this,e=!1,r=Wa;r<=si;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};Ct.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=ir(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)}))};Ct.invalidateLayer=function(t){if(this.lastInvalidationTime=ir(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];wr(a,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var n=0;n<r.length;n++){var i=r[n]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};Ct.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(a,n,i){var o=a.replacement;if(o||(o=a.replacement=e.makeLayer(a.bb,a.level),o.replaces=a,o.eles=a.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};Ct.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Ct.queueLayer=function(t,e){var r=this,a=r.layersQueue,n=t.elesQueue,i=n.hasId=n.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,a.updateItem(t)):(t.reqs=1,a.push(t))}};Ct.dequeue=function(t){for(var e=this,r=e.layersQueue,a=[],n=0;n<K0&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,t),n++),a.length===0&&a.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return a};Ct.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],a=t.replaces,n=r.indexOf(a);if(!(n<0||a.invalid)){r[n]=t;for(var i=0;i<t.eles.length;i++){var o=t.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[t.level]=t)}e.requestRedraw()}};Ct.requestRedraw=cn(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Ct.setupDequeueing=av.setupDequeueing({deqRedrawThreshold:Y0,deqCost:_0,deqAvgCost:W0,deqNoDrawCost:X0,deqFastCost:$0,deq:function(e,r){return e.dequeue(r)},onDeqd:Zs,shouldRedraw:Wh,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var ov={},Wf;function j0(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function eb(t,e,r){for(var a,n=0;n<e.length;n++){var i=e[n];n===0&&(a=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}function Xf(t,e,r){t.beginPath&&t.beginPath();for(var a=e,n=0;n<a.length;n++){var i=a[n];t.lineTo(i.x,i.y)}var o=r,s=r[0];t.moveTo(s.x,s.y);for(var n=1;n<o.length;n++){var i=o[n];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function tb(t,e,r,a,n){t.beginPath&&t.beginPath(),t.arc(r,a,n,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function rb(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}ov.arrowShapeImpl=function(t){return(Wf||(Wf={polygon:j0,"triangle-backcurve":eb,"triangle-tee":Xf,"circle-triangle":tb,"triangle-cross":Xf,circle:rb}))[t]};var tr={};tr.drawElement=function(t,e,r,a,n,i){var o=this;e.isNode()?o.drawNode(t,e,r,a,n,i):o.drawEdge(t,e,r,a,n,i)};tr.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};tr.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};tr.drawCachedElementPortion=function(t,e,r,a,n,i,o,s){var u=this,l=r.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=r.getElement(e,l,a,n,i);if(f!=null){var h=s(u,e);if(h===0)return;var v=o(u,e),c=l.x1,d=l.y1,p=l.w,y=l.h,g,b,m,w,T;if(v!==0){var D=r.getRotationPoint(e);m=D.x,w=D.y,t.translate(m,w),t.rotate(v),T=u.getImgSmoothing(t),T||u.setImgSmoothing(t,!0);var x=r.getRotationOffset(e);g=x.x,b=x.y}else g=c,b=d;var N;h!==1&&(N=t.globalAlpha,t.globalAlpha=N*h),t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,g,b,p,y),h!==1&&(t.globalAlpha=N),v!==0&&(t.rotate(-v),t.translate(-m,-w),T||u.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var ab=function(){return 0},nb=function(e,r){return e.getTextAngle(r,null)},ib=function(e,r){return e.getTextAngle(r,"source")},ob=function(e,r){return e.getTextAngle(r,"target")},sb=function(e,r){return r.effectiveOpacity()},os=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};tr.drawCachedElement=function(t,e,r,a,n,i){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,f=s.slbTxrCache,h=s.tlbTxrCache,v=e.boundingBox(),c=i===!0?u.reasons.highQuality:null;if(!(v.w===0||v.h===0||!e.visible())&&(!a||eu(v,a))){var d=e.isEdge(),p=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,u,r,n,c,ab,sb),(!d||!p)&&o.drawCachedElementPortion(t,e,l,r,n,c,nb,os),d&&!p&&(o.drawCachedElementPortion(t,e,f,r,n,c,ib,os),o.drawCachedElementPortion(t,e,h,r,n,c,ob,os)),o.drawElementOverlay(t,e)}};tr.drawElements=function(t,e){for(var r=this,a=0;a<e.length;a++){var n=e[a];r.drawElement(t,n)}};tr.drawCachedElements=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];n.drawCachedElement(t,o,r,a)}};tr.drawCachedNodes=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&n.drawCachedElement(t,o,r,a)}};tr.drawLayeredElements=function(t,e,r,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var s=i[o],u=s.bb;u.w===0||u.h===0||t.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(t,e,r,a)};var ur={};ur.drawEdge=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,h=e.pstyle("curve-style").value,v=e.pstyle("line-style").value,c=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,p=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,g=l*f,b=l*f,m=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;h==="straight-triangle"?(o.eleStrokeStyle(t,e,A),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=c,t.lineCap=d,o.eleStrokeStyle(t,e,A),o.drawEdgePath(e,t,s.allpts,v),t.lineCap="butt")},w=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;if(t.lineWidth=c+p,t.lineCap=d,p>0)o.colorStrokeStyle(t,y[0],y[1],y[2],A);else{t.lineCap="butt";return}h==="straight-triangle"?o.drawEdgeTrianglePath(e,t,s.allpts):(o.drawEdgePath(e,t,s.allpts,v),t.lineCap="butt")},T=function(){n&&o.drawEdgeOverlay(t,e)},D=function(){n&&o.drawEdgeUnderlay(t,e)},x=function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,A)},N=function(){o.drawElementText(t,e,null,a)};t.lineJoin="round";var O=e.pstyle("ghost").value==="yes";if(O){var R=e.pstyle("ghost-offset-x").pfValue,P=e.pstyle("ghost-offset-y").pfValue,M=e.pstyle("ghost-opacity").value,I=g*M;t.translate(R,P),m(I),x(I),t.translate(-R,-P)}else w();D(),m(),x(),T(),N(),r&&t.translate(u.x1,u.y1)}};var sv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,o=i.usePaths(),s=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,f=a.pstyle("".concat(e,"-color")).value;r.lineWidth=l,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,f[0],f[1],f[2],n),i.drawEdgePath(a,r,s.allpts,"solid")}}}};ur.drawEdgeOverlay=sv("overlay");ur.drawEdgeUnderlay=sv("underlay");ur.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,o,s=!1,u=this.usePaths(),l=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(u){var h=r.join("$"),v=n.pathCacheKey&&n.pathCacheKey===h;v?(o=e=n.pathCache,s=!0):(o=e=new Path2D,n.pathCacheKey=h,n.pathCache=o)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!s&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var c=2;c+3<r.length;c+=4)e.quadraticCurveTo(r[c],r[c+1],r[c+2],r[c+3]);break;case"straight":case"haystack":for(var d=2;d+1<r.length;d+=2)e.lineTo(r[d],r[d+1]);break;case"segments":if(n.isRound){var p=kt(n.roundCorners),y;try{for(p.s();!(y=p.n()).done;){var g=y.value;$c(e,g)}}catch(m){p.e(m)}finally{p.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};ur.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var a=t.pstyle("width").pfValue,n=0;n+1<r.length;n+=2){var i=[r[n+2]-r[n],r[n+3]-r[n+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],u=[s[0]*a/2,s[1]*a/2];e.beginPath(),e.moveTo(r[n]-u[0],r[n+1]-u[1]),e.lineTo(r[n]+u[0],r[n+1]+u[1]),e.lineTo(r[n+2],r[n+3]),e.closePath(),e.fill()}};ur.drawArrowheads=function(t,e,r){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(t,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,r),n||this.drawArrowhead(t,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,r)};ur.drawArrowhead=function(t,e,r,a,n,i,o){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)){var s=this,u=e.pstyle(r+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,h=e.pstyle("width").pfValue,v=e.pstyle(r+"-arrow-width"),c=v.value==="match-line"?h:v.pfValue;v.units==="%"&&(c*=h);var d=e.pstyle("opacity").value;o===void 0&&(o=d);var p=t.globalCompositeOperation;(o!==1||f==="hollow")&&(t.globalCompositeOperation="destination-out",s.colorFillStyle(t,255,255,255,1),s.colorStrokeStyle(t,255,255,255,1),s.drawArrowShape(e,t,l,h,u,c,a,n,i),t.globalCompositeOperation=p);var y=e.pstyle(r+"-arrow-color").value;s.colorFillStyle(t,y[0],y[1],y[2],o),s.colorStrokeStyle(t,y[0],y[1],y[2],o),s.drawArrowShape(e,t,f,h,u,c,a,n,i)}}};ur.drawArrowShape=function(t,e,r,a,n,i,o,s,u){var l=this,f=this.usePaths()&&n!=="triangle-cross",h=!1,v,c=e,d={x:o,y:s},p=t.pstyle("arrow-scale").value,y=this.getArrowWidth(a,p),g=l.arrowShapes[n];if(f){var b=l.arrowPathCache=l.arrowPathCache||[],m=Yr(n),w=b[m];w!=null?(v=e=w,h=!0):(v=e=new Path2D,b[m]=v)}h||(e.beginPath&&e.beginPath(),f?g.draw(e,1,0,{x:0,y:0},1):g.draw(e,y,u,d,a),e.closePath&&e.closePath()),e=c,f&&(e.translate(o,s),e.rotate(u),e.scale(y,y)),(r==="filled"||r==="both")&&(f?e.fill(v):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(f?y:1),e.lineJoin="miter",f?e.stroke(v):e.stroke()),f&&(e.scale(1/y,1/y),e.rotate(-u),e.translate(-o,-s))};var du={};du.safeDrawImage=function(t,e,r,a,n,i,o,s,u,l){if(!(n<=0||i<=0||u<=0||l<=0))try{t.drawImage(e,r,a,n,i,o,s,u,l)}catch(f){Ke(f)}};du.drawInscribedImage=function(t,e,r,a,n){var i=this,o=r.position(),s=o.x,u=o.y,l=r.cy().style(),f=l.getIndexedStyle.bind(l),h=f(r,"background-fit","value",a),v=f(r,"background-repeat","value",a),c=r.width(),d=r.height(),p=r.padding()*2,y=c+(f(r,"background-width-relative-to","value",a)==="inner"?0:p),g=d+(f(r,"background-height-relative-to","value",a)==="inner"?0:p),b=r._private.rscratch,m=f(r,"background-clip","value",a),w=m==="node",T=f(r,"background-image-opacity","value",a)*n,D=f(r,"background-image-smoothing","value",a),x=r.pstyle("corner-radius").value;x!=="auto"&&(x=r.pstyle("corner-radius").pfValue);var N=e.width||e.cachedW,O=e.height||e.cachedH;(N==null||O==null)&&(document.body.appendChild(e),N=e.cachedW=e.width||e.offsetWidth,O=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var R=N,P=O;if(f(r,"background-width","value",a)!=="auto"&&(f(r,"background-width","units",a)==="%"?R=f(r,"background-width","pfValue",a)*y:R=f(r,"background-width","pfValue",a)),f(r,"background-height","value",a)!=="auto"&&(f(r,"background-height","units",a)==="%"?P=f(r,"background-height","pfValue",a)*g:P=f(r,"background-height","pfValue",a)),!(R===0||P===0)){if(h==="contain"){var M=Math.min(y/R,g/P);R*=M,P*=M}else if(h==="cover"){var M=Math.max(y/R,g/P);R*=M,P*=M}var I=s-y/2,E=f(r,"background-position-x","units",a),A=f(r,"background-position-x","pfValue",a);E==="%"?I+=(y-R)*A:I+=A;var C=f(r,"background-offset-x","units",a),S=f(r,"background-offset-x","pfValue",a);C==="%"?I+=(y-R)*S:I+=S;var L=u-g/2,V=f(r,"background-position-y","units",a),F=f(r,"background-position-y","pfValue",a);V==="%"?L+=(g-P)*F:L+=F;var B=f(r,"background-offset-y","units",a),Y=f(r,"background-offset-y","pfValue",a);B==="%"?L+=(g-P)*Y:L+=Y,b.pathCache&&(I-=s,L-=u,s=0,u=0);var q=t.globalAlpha;t.globalAlpha=T;var Q=i.getImgSmoothing(t),$=!1;if(D==="no"&&Q?(i.setImgSmoothing(t,!1),$=!0):D==="yes"&&!Q&&(i.setImgSmoothing(t,!0),$=!0),v==="no-repeat")w&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,y,g,x,b),t.clip())),i.safeDrawImage(t,e,0,0,N,O,I,L,R,P),w&&t.restore();else{var K=t.createPattern(e,v);t.fillStyle=K,i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,y,g,x,b),t.translate(I,L),t.fill(),t.translate(-I,-L)}t.globalAlpha=q,$&&i.setImgSmoothing(t,Q)}};var Kr={};Kr.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(Js(r*a));e=Math.pow(2,n)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};Kr.drawElementText=function(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(a==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(e),l=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=u,t.textBaseline=l?"alphabetic":"bottom"}else{var f=e.element()._private.rscratch.badLine,h=e.pstyle("label"),v=e.pstyle("source-label"),c=e.pstyle("target-label");if(f||(!h||!h.value)&&(!v||!v.value)&&(!c||!c.value))return;t.textAlign="center",t.textBaseline="bottom"}var d=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),n==null?(o.drawText(t,e,null,d,i),e.isEdge()&&(o.drawText(t,e,"source",d,i),o.drawText(t,e,"target",d,i))):o.drawText(t,e,n,d,i),r&&t.translate(p.x1,p.y1)};Kr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Kr.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*s,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+o+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,l[0],l[1],l[2],s),this.colorStrokeStyle(t,f[0],f[1],f[2],u)};function ub(t,e,r,a,n){var i=Math.min(a,n),o=i/2,s=e+a/2,u=r+n/2;t.beginPath(),t.arc(s,u,o,0,Math.PI*2),t.closePath()}function $f(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,a/2,n/2);t.beginPath(),t.moveTo(e+o,r),t.lineTo(e+a-o,r),t.quadraticCurveTo(e+a,r,e+a,r+o),t.lineTo(e+a,r+n-o),t.quadraticCurveTo(e+a,r+n,e+a-o,r+n),t.lineTo(e+o,r+n),t.quadraticCurveTo(e,r+n,e,r+n-o),t.lineTo(e,r+o),t.quadraticCurveTo(e,r,e+o,r),t.closePath()}Kr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=Mt(n,"labelAngle",e);r=t.isEdge()?s:0}else o.strValue==="none"?r=0:r=o.pfValue;return r};Kr.drawText=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=n?e.effectiveOpacity():1;if(!(n&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=Mt(o,"labelX",r),l=Mt(o,"labelY",r),f,h,v=this.getLabelText(e,r);if(v!=null&&v!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(t,e,n);var c=r?r+"-":"",d=Mt(o,"labelWidth",r),p=Mt(o,"labelHeight",r),y=Mt(o,"labelActualDescent",r),g=e.pstyle(c+"text-margin-x").pfValue,b=e.pstyle(c+"text-margin-y").pfValue,m=e.isEdge(),w=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;m&&(w="center",T="center"),u+=g,l+=b;var D;a?D=this.getTextAngle(e,r):D=0,D!==0&&(f=u,h=l,t.translate(f,h),t.rotate(D),u=0,l=0);var x=ba(w),N=wa(T);switch(N){case"top":break;case"center":l+=p/2;break;case"bottom":l+=p;break}var O=e.pstyle("text-background-opacity").value,R=e.pstyle("text-border-opacity").value,P=e.pstyle("text-border-width").pfValue,M=e.pstyle("text-background-padding").pfValue,I=e.pstyle("text-background-shape").strValue,E=I==="round-rectangle"||I==="roundrectangle",A=I==="circle",C=2;if(O>0||P>0&&R>0){var S=t.fillStyle,L=t.strokeStyle,V=t.lineWidth,F=e.pstyle("text-background-color").value,B=e.pstyle("text-border-color").value,Y=e.pstyle("text-border-style").value,q=O>0,Q=P>0&&R>0,$=u-M;switch(x){case"left":$-=d;break;case"center":$-=d/2;break}var K=l-p-M,j=d+2*M,re=p+2*M;if(q&&(t.fillStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(O*s,")")),Q&&(t.strokeStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(R*s,")"),t.lineWidth=P,t.setLineDash))switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=P/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(E?(t.beginPath(),$f(t,$,K,j,re,C)):A?(t.beginPath(),ub(t,$,K,j,re)):(t.beginPath(),t.rect($,K,j,re)),q&&t.fill(),Q&&t.stroke(),Q&&Y==="double"){var U=P/2;t.beginPath(),E?$f(t,$+U,K+U,j-2*U,re-2*U,C):t.rect($+U,K+U,j-2*U,re-2*U),t.stroke()}t.fillStyle=S,t.strokeStyle=L,t.lineWidth=V,t.setLineDash&&t.setLineDash([])}var H=2*e.pstyle("text-outline-width").pfValue;if(H>0&&(t.lineWidth=H),l-=y,e.pstyle("text-wrap").value==="wrap"){var _=Mt(o,"labelWrapCachedLines",r),W=Mt(o,"labelLineHeight",r),J=d/2,te=this.getLabelJustification(e);switch(te==="auto"||(x==="left"?te==="left"?u+=-d:te==="center"&&(u+=-J):x==="center"?te==="left"?u+=-J:te==="right"&&(u+=J):x==="right"&&(te==="center"?u+=J:te==="right"&&(u+=d))),N){case"top":l-=(_.length-1)*W;break;case"center":case"bottom":l-=(_.length-1)*W;break}for(var de=0;de<_.length;de++)H>0&&t.strokeText(_[de],u,l),t.fillText(_[de],u,l),l+=W}else H>0&&t.strokeText(v,u,l),t.fillText(v,u,l);D!==0&&(t.rotate(-D),t.translate(-f,-h))}}};var Nr={};Nr.drawNode=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,u,l=e._private,f=l.rscratch,h=e.position();if(!(!be(h.x)||!be(h.y))&&!(i&&!e.visible())){var v=i?e.effectiveOpacity():1,c=o.usePaths(),d,p=!1,y=e.padding();s=e.width()+2*y,u=e.height()+2*y;var g;r&&(g=r,t.translate(-g.x1,-g.y1));for(var b=e.pstyle("background-image"),m=b.value,w=new Array(m.length),T=new Array(m.length),D=0,x=0;x<m.length;x++){var N=m[x],O=w[x]=N!=null&&N!=="none";if(O){var R=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",x);D++,T[x]=o.getCachedImage(N,R,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var P=e.pstyle("background-blacken").value,M=e.pstyle("border-width").pfValue,I=e.pstyle("background-opacity").value*v,E=e.pstyle("border-color").value,A=e.pstyle("border-style").value,C=e.pstyle("border-join").value,S=e.pstyle("border-cap").value,L=e.pstyle("border-position").value,V=e.pstyle("border-dash-pattern").pfValue,F=e.pstyle("border-dash-offset").pfValue,B=e.pstyle("border-opacity").value*v,Y=e.pstyle("outline-width").pfValue,q=e.pstyle("outline-color").value,Q=e.pstyle("outline-style").value,$=e.pstyle("outline-opacity").value*v,K=e.pstyle("outline-offset").value,j=e.pstyle("corner-radius").value;j!=="auto"&&(j=e.pstyle("corner-radius").pfValue);var re=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;o.eleFillStyle(t,e,k)},U=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B;o.colorStrokeStyle(t,E[0],E[1],E[2],k)},H=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;o.colorStrokeStyle(t,q[0],q[1],q[2],k)},_=function(k,z,G,X){var Z=o.nodePathCache=o.nodePathCache||[],ae=_h(G==="polygon"?G+","+X.join(","):G,""+z,""+k,""+j),ee=Z[ae],ie,se=!1;return ee!=null?(ie=ee,se=!0,f.pathCache=ie):(ie=new Path2D,Z[ae]=f.pathCache=ie),{path:ie,cacheHit:se}},W=e.pstyle("shape").strValue,J=e.pstyle("shape-polygon-points").pfValue;if(c){t.translate(h.x,h.y);var te=_(s,u,W,J);d=te.path,p=te.cacheHit}var de=function(){if(!p){var k=h;c&&(k={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(d||t,k.x,k.y,s,u,j,f)}c?t.fill(d):t.fill()},Te=function(){for(var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=l.backgrounding,X=0,Z=0;Z<T.length;Z++){var ae=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Z);if(z&&ae==="over"||!z&&ae==="inside"){X++;continue}w[Z]&&T[Z].complete&&!T[Z].error&&(X++,o.drawInscribedImage(t,T[Z],e,Z,k))}l.backgrounding=X!==D,G!==l.backgrounding&&e.updateStyle(!1)},ge=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;o.hasPie(e)&&(o.drawPie(t,e,z),k&&(c||o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,j,f)))},le=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;o.hasStripe(e)&&(t.save(),c?t.clip(f.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,j,f),t.clip()),o.drawStripe(t,e,z),t.restore(),k&&(c||o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,j,f)))},he=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,z=(P>0?P:-P)*k,G=P>0?0:255;P!==0&&(o.colorFillStyle(t,G,G,G,z),c?t.fill(d):t.fill())},fe=function(){if(M>0){if(t.lineWidth=M,t.lineCap=S,t.lineJoin=C,t.setLineDash)switch(A){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(V),t.lineDashOffset=F;break;case"solid":case"double":t.setLineDash([]);break}if(L!=="center"){if(t.save(),t.lineWidth*=2,L==="inside")c?t.clip(d):t.clip();else{var k=new Path2D;k.rect(-s/2-M,-u/2-M,s+2*M,u+2*M),k.addPath(d),t.clip(k,"evenodd")}c?t.stroke(d):t.stroke(),t.restore()}else c?t.stroke(d):t.stroke();if(A==="double"){t.lineWidth=M/3;var z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",c?t.stroke(d):t.stroke(),t.globalCompositeOperation=z}t.setLineDash&&t.setLineDash([])}},ve=function(){if(Y>0){if(t.lineWidth=Y,t.lineCap="butt",t.setLineDash)switch(Q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var k=h;c&&(k={x:0,y:0});var z=o.getNodeShape(e),G=M;L==="inside"&&(G=0),L==="outside"&&(G*=2);var X=(s+G+(Y+K))/s,Z=(u+G+(Y+K))/u,ae=s*X,ee=u*Z,ie=o.nodeShapes[z].points,se;if(c){var oe=_(ae,ee,z,ie);se=oe.path}if(z==="ellipse")o.drawEllipsePath(se||t,k.x,k.y,ae,ee);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(z)){var ue=0,pe=0,ce=0;z==="round-diamond"?ue=(G+K+Y)*1.4:z==="round-heptagon"?(ue=(G+K+Y)*1.075,ce=-(G/2+K+Y)/35):z==="round-hexagon"?ue=(G+K+Y)*1.12:z==="round-pentagon"?(ue=(G+K+Y)*1.13,ce=-(G/2+K+Y)/15):z==="round-tag"?(ue=(G+K+Y)*1.12,pe=(G/2+Y+K)*.07):z==="round-triangle"&&(ue=(G+K+Y)*(Math.PI/2),ce=-(G+K/2+Y)/Math.PI),ue!==0&&(X=(s+ue)/s,ae=s*X,["round-hexagon","round-tag"].includes(z)||(Z=(u+ue)/u,ee=u*Z)),j=j==="auto"?tc(ae,ee):j;for(var we=ae/2,Ne=ee/2,De=j+(G+Y+K)/2,Ee=new Array(ie.length/2),ze=new Array(ie.length/2),Ce=0;Ce<ie.length/2;Ce++)Ee[Ce]={x:k.x+pe+we*ie[Ce*2],y:k.y+ce+Ne*ie[Ce*2+1]};var Se,Ue,Re,Ve,He=Ee.length;for(Ue=Ee[He-1],Se=0;Se<He;Se++)Re=Ee[Se%He],Ve=Ee[(Se+1)%He],ze[Se]=cu(Ue,Re,Ve,De),Ue=Re,Re=Ve;o.drawRoundPolygonPath(se||t,k.x+pe,k.y+ce,s*X,u*Z,ie,ze)}else if(["roundrectangle","round-rectangle"].includes(z))j=j==="auto"?Er(ae,ee):j,o.drawRoundRectanglePath(se||t,k.x,k.y,ae,ee,j+(G+Y+K)/2);else if(["cutrectangle","cut-rectangle"].includes(z))j=j==="auto"?tu():j,o.drawCutRectanglePath(se||t,k.x,k.y,ae,ee,null,j+(G+Y+K)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(z))j=j==="auto"?Er(ae,ee):j,o.drawBottomRoundRectanglePath(se||t,k.x,k.y,ae,ee,j+(G+Y+K)/2);else if(z==="barrel")o.drawBarrelPath(se||t,k.x,k.y,ae,ee);else if(z.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(z)){var Ze=(G+Y+K)/s;ie=ei(ti(ie,Ze)),o.drawPolygonPath(se||t,k.x,k.y,s,u,ie)}else{var tt=(G+Y+K)/s;ie=ei(ti(ie,-tt)),o.drawPolygonPath(se||t,k.x,k.y,s,u,ie)}if(c?t.stroke(se):t.stroke(),Q==="double"){t.lineWidth=G/3;var Xe=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",c?t.stroke(se):t.stroke(),t.globalCompositeOperation=Xe}t.setLineDash&&t.setLineDash([])}},ye=function(){n&&o.drawNodeOverlay(t,e,h,s,u)},me=function(){n&&o.drawNodeUnderlay(t,e,h,s,u)},xe=function(){o.drawElementText(t,e,null,a)},Le=e.pstyle("ghost").value==="yes";if(Le){var ke=e.pstyle("ghost-offset-x").pfValue,Fe=e.pstyle("ghost-offset-y").pfValue,Be=e.pstyle("ghost-opacity").value,Oe=Be*v;t.translate(ke,Fe),H(),ve(),re(Be*I),de(),Te(Oe,!0),U(Be*B),fe(),ge(P!==0||M!==0),le(P!==0||M!==0),Te(Oe,!1),he(Oe),t.translate(-ke,-Fe)}c&&t.translate(-h.x,-h.y),me(),c&&t.translate(h.x,h.y),H(),ve(),re(),de(),Te(v,!0),U(),fe(),ge(P!==0||M!==0),le(P!==0||M!==0),Te(v,!1),he(),c&&t.translate(-h.x,-h.y),xe(),ye(),r&&t.translate(g.x1,g.y1)}};var uv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a,n,i,o){var s=this;if(a.visible()){var u=a.pstyle("".concat(e,"-padding")).pfValue,l=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,h=a.pstyle("".concat(e,"-shape")).value,v=a.pstyle("".concat(e,"-corner-radius")).value;if(l>0){if(n=n||a.position(),i==null||o==null){var c=a.padding();i=a.width()+2*c,o=a.height()+2*c}s.colorFillStyle(r,f[0],f[1],f[2],l),s.nodeShapes[h].draw(r,n.x,n.y,i+u*2,o+u*2,v),r.fill()}}}};Nr.drawNodeOverlay=uv("overlay");Nr.drawNodeUnderlay=uv("underlay");Nr.hasPie=function(t){return t=t[0],t._private.hasPie};Nr.hasStripe=function(t){return t=t[0],t._private.hasStripe};Nr.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,f=e.width(),h=e.height(),v=Math.min(f,h)/2,c,d=0,p=this.usePaths();if(p&&(u=0,l=0),i.units==="%"?v=v*i.pfValue:i.pfValue!==void 0&&(v=i.pfValue/2),o.units==="%"?c=v*o.pfValue:o.pfValue!==void 0&&(c=o.pfValue/2),!(c>=v))for(var y=1;y<=n.pieBackgroundN;y++){var g=e.pstyle("pie-"+y+"-background-size").value,b=e.pstyle("pie-"+y+"-background-color").value,m=e.pstyle("pie-"+y+"-background-opacity").value*r,w=g/100;w+d>1&&(w=1-d);var T=1.5*Math.PI+2*Math.PI*d;T+=s;var D=2*Math.PI*w,x=T+D;g===0||d>=1||d+w>1||(c===0?(t.beginPath(),t.moveTo(u,l),t.arc(u,l,v,T,x),t.closePath()):(t.beginPath(),t.arc(u,l,v,T,x),t.arc(u,l,c,x,T,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],m),t.fill(),d+=w)}};Nr.drawStripe=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,o=a.y,s=e.width(),u=e.height(),l=0,f=this.usePaths();t.save();var h=e.pstyle("stripe-direction").value,v=e.pstyle("stripe-size");switch(h){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var c=s,d=u;v.units==="%"?(c=c*v.pfValue,d=d*v.pfValue):v.pfValue!==void 0&&(c=v.pfValue,d=v.pfValue),f&&(i=0,o=0),o-=c/2,i-=d/2;for(var p=1;p<=n.stripeBackgroundN;p++){var y=e.pstyle("stripe-"+p+"-background-size").value,g=e.pstyle("stripe-"+p+"-background-color").value,b=e.pstyle("stripe-"+p+"-background-opacity").value*r,m=y/100;m+l>1&&(m=1-l),!(y===0||l>=1||l+m>1)&&(t.beginPath(),t.rect(i,o+d*l,c,d*m),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],b),t.fill(),l+=m)}t.restore()};var Ot={},lb=100;Ot.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Ot.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===t){r=!1;break}return r&&(a={context:t},e.push(a)),a};Ot.createGradientStyleFor=function(t,e,r,a,n){var i,o=this.usePaths(),s=r.pstyle(e+"-gradient-stop-colors").value,u=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),h=r.midpoint(),v=qr(l,h),c=qr(f,h);i=t.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(v,c))}else{var d=o?{x:0,y:0}:r.position(),p=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(p,y))}else if(r.isEdge()){var g=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(g.x,g.y,b.x,b.y)}else{var m=o?{x:0,y:0}:r.position(),w=r.paddedWidth(),T=r.paddedHeight(),D=w/2,x=T/2,N=r.pstyle("background-gradient-direction").value;switch(N){case"to-bottom":i=t.createLinearGradient(m.x,m.y-x,m.x,m.y+x);break;case"to-top":i=t.createLinearGradient(m.x,m.y+x,m.x,m.y-x);break;case"to-left":i=t.createLinearGradient(m.x+D,m.y,m.x-D,m.y);break;case"to-right":i=t.createLinearGradient(m.x-D,m.y,m.x+D,m.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(m.x-D,m.y-x,m.x+D,m.y+x);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(m.x-D,m.y+x,m.x+D,m.y-x);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(m.x+D,m.y-x,m.x-D,m.y+x);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(m.x+D,m.y+x,m.x-D,m.y-x);break}}if(!i)return null;for(var O=u.length===s.length,R=s.length,P=0;P<R;P++)i.addColorStop(O?u[P]:P/(R-1),"rgba("+s[P][0]+","+s[P][1]+","+s[P][2]+","+n+")");return i};Ot.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};Ot.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};Ot.eleFillStyle=function(t,e,r){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(t,e,a,r);else{var n=e.pstyle("background-color").value;this.colorFillStyle(t,n[0],n[1],n[2],r)}};Ot.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};Ot.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};Ot.eleStrokeStyle=function(t,e,r){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(t,e,a,r);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(t,n[0],n[1],n[2],r)}};Ot.matchCanvasSize=function(t){var e=this,r=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var u=n*o,l=i*o,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var h=r.canvasContainer;h.style.width=n+"px",h.style.height=i+"px";for(var v=0;v<e.CANVAS_LAYERS;v++)f=r.canvases[v],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";for(var v=0;v<e.BUFFER_COUNT;v++)f=r.bufferCanvases[v],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";e.textureMult=1,o<=1&&(f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l,e.pixelRatio=o}};Ot.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};Ot.clearCanvas=function(){var t=this,e=t.data;function r(a){a.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};Ot.render=function(t){var e=this;t=t||Kh();var r=e.cy,a=t.forcedContext,n=t.drawAllLayers,i=t.drawOnlyNodeLayer,o=t.forcedZoom,s=t.forcedPan,u=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,l=e.data,f=l.canvasNeedsRedraw,h=e.textureOnViewport&&!a&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),v=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,c=e.motionBlurPxRatio,d=r.hasCompoundNodes(),p=e.hoverData.draggingEles,y=!!(e.hoverData.selecting||e.touchData.selecting);v=v&&!a&&e.motionBlurEnabled&&!y;var g=v;a||(e.prevPxRatio!==u&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=u),!a&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),v&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(g=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!h&&(f[e.NODE]=!0,f[e.SELECT_BOX]=!0);var b=r.style(),m=r.zoom(),w=o!==void 0?o:m,T=r.pan(),D={x:T.x,y:T.y},x={zoom:m,pan:{x:T.x,y:T.y}},N=e.prevViewport,O=N===void 0||x.zoom!==N.zoom||x.pan.x!==N.pan.x||x.pan.y!==N.pan.y;!O&&!(p&&!d)&&(e.motionBlurPxRatio=1),s&&(D=s),w*=u,D.x*=u,D.y*=u;var R=e.getCachedZSortedEles();function P(U,H,_,W,J){var te=U.globalCompositeOperation;U.globalCompositeOperation="destination-out",e.colorFillStyle(U,255,255,255,e.motionBlurTransparency),U.fillRect(H,_,W,J),U.globalCompositeOperation=te}function M(U,H){var _,W,J,te;!e.clearingMotionBlur&&(U===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||U===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(_={x:T.x*c,y:T.y*c},W=m*c,J=e.canvasWidth*c,te=e.canvasHeight*c):(_=D,W=w,J=e.canvasWidth,te=e.canvasHeight),U.setTransform(1,0,0,1,0,0),H==="motionBlur"?P(U,0,0,J,te):!a&&(H===void 0||H)&&U.clearRect(0,0,J,te),n||(U.translate(_.x,_.y),U.scale(W,W)),s&&U.translate(s.x,s.y),o&&U.scale(o,o)}if(h||(e.textureDrawLastFrame=!1),h){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var I=e.data.bufferContexts[e.TEXTURE_BUFFER];I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:I,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var x=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}f[e.DRAG]=!1,f[e.NODE]=!1;var E=l.contexts[e.NODE],A=e.textureCache.texture,x=e.textureCache.viewport;E.setTransform(1,0,0,1,0,0),v?P(E,0,0,x.width,x.height):E.clearRect(0,0,x.width,x.height);var C=b.core("outside-texture-bg-color").value,S=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(E,C[0],C[1],C[2],S),E.fillRect(0,0,x.width,x.height);var m=r.zoom();M(E,!1),E.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u),E.drawImage(A,x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var L=r.extent(),V=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),F=e.hideEdgesOnViewport&&V,B=[];if(B[e.NODE]=!f[e.NODE]&&v&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,B[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),B[e.DRAG]=!f[e.DRAG]&&v&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,B[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),f[e.NODE]||n||i||B[e.NODE]){var Y=v&&!B[e.NODE]&&c!==1,E=a||(Y?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),q=v&&!Y?"motionBlur":void 0;M(E,q),F?e.drawCachedNodes(E,R.nondrag,u,L):e.drawLayeredElements(E,R.nondrag,u,L),e.debug&&e.drawDebugPoints(E,R.nondrag),!n&&!v&&(f[e.NODE]=!1)}if(!i&&(f[e.DRAG]||n||B[e.DRAG])){var Y=v&&!B[e.DRAG]&&c!==1,E=a||(Y?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);M(E,v&&!Y?"motionBlur":void 0),F?e.drawCachedNodes(E,R.drag,u,L):e.drawCachedElements(E,R.drag,u,L),e.debug&&e.drawDebugPoints(E,R.drag),!n&&!v&&(f[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,M),v&&c!==1){var Q=l.contexts[e.NODE],$=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],K=l.contexts[e.DRAG],j=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],re=function(H,_,W){H.setTransform(1,0,0,1,0,0),W||!g?H.clearRect(0,0,e.canvasWidth,e.canvasHeight):P(H,0,0,e.canvasWidth,e.canvasHeight);var J=c;H.drawImage(_,0,0,e.canvasWidth*J,e.canvasHeight*J,0,0,e.canvasWidth,e.canvasHeight)};(f[e.NODE]||B[e.NODE])&&(re(Q,$,B[e.NODE]),f[e.NODE]=!1),(f[e.DRAG]||B[e.DRAG])&&(re(K,j,B[e.DRAG]),f[e.DRAG]=!1)}e.prevViewport=x,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),v&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!h,e.mbFrames=0,f[e.NODE]=!0,f[e.DRAG]=!0,e.redraw()},lb)),a||r.emit("render")};var za;Ot.drawSelectionRectangle=function(t,e){var r=this,a=r.cy,n=r.data,i=a.style(),o=t.drawOnlyNodeLayer,s=t.drawAllLayers,u=n.canvasNeedsRedraw,l=t.forcedContext;if(r.showFps||!o&&u[r.SELECT_BOX]&&!s){var f=l||n.contexts[r.SELECT_BOX];if(e(f),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var h=r.cy.zoom(),v=i.core("selection-box-border-width").value/h;f.lineWidth=v,f.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",f.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),v>0&&(f.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",f.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(n.bgActivePosistion&&!r.hoverData.selecting){var h=r.cy.zoom(),c=n.bgActivePosistion;f.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",f.beginPath(),f.arc(c.x,c.y,i.core("active-bg-size").pfValue/h,0,2*Math.PI),f.fill()}var d=r.lastRedrawTime;if(r.showFps&&d){d=Math.round(d);var p=Math.round(1e3/d),y="1 frame = "+d+" ms = "+p+" fps";if(f.setTransform(1,0,0,1,0,0),f.fillStyle="rgba(255, 0, 0, 0.75)",f.strokeStyle="rgba(255, 0, 0, 0.75)",f.font="30px Arial",!za){var g=f.measureText(y);za=g.actualBoundingBoxAscent}f.fillText(y,0,za);var b=60;f.strokeRect(0,za+10,250,20),f.fillRect(0,za+10,250*Math.min(p/b,1),20)}s||(u[r.SELECT_BOX]=!1)}};function Kf(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(a));return a}function fb(t,e,r){var a=Kf(t,t.VERTEX_SHADER,e),n=Kf(t,t.FRAGMENT_SHADER,r),i=t.createProgram();if(t.attachShader(i,a),t.attachShader(i,n),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function hb(t,e,r){r===void 0&&(r=e);var a=t.makeOffscreenCanvas(e,r),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function gu(t){var e=t.pixelRatio,r=t.cy.zoom(),a=t.cy.pan();return{zoom:r*e,pan:{x:a.x*e,y:a.y*e}}}function cb(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function vb(t,e,r,a,n){var i=a*r+e.x,o=n*r+e.y;return o=Math.round(t.canvasHeight-o),[i,o]}function db(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function gb(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Ir(t,e,r){var a=t[0]/255,n=t[1]/255,i=t[2]/255,o=e,s=r||new Array(4);return s[0]=a*o,s[1]=n*o,s[2]=i*o,s[3]=o,s}function na(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function pb(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function yb(t,e){var r=t.createTexture();return r.buffer=function(a){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function lv(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function fv(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function mb(t,e,r,a,n,i){switch(e){case t.FLOAT:return new Float32Array(r.buffer,i*a,n);case t.INT:return new Int32Array(r.buffer,i*a,n)}}function bb(t,e,r,a){var n=lv(t,e),i=ft(n,2),o=i[0],s=i[1],u=fv(t,s,a),l=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,u,t.STATIC_DRAW),s===t.FLOAT?t.vertexAttribPointer(r,o,s,!1,0,0):s===t.INT&&t.vertexAttribIPointer(r,o,s,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),l}function $t(t,e,r,a){var n=lv(t,r),i=ft(n,3),o=i[0],s=i[1],u=i[2],l=fv(t,s,e*o),f=o*u,h=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,h),t.bufferData(t.ARRAY_BUFFER,e*f,t.DYNAMIC_DRAW),t.enableVertexAttribArray(a),s===t.FLOAT?t.vertexAttribPointer(a,o,s,!1,f,0):s===t.INT&&t.vertexAttribIPointer(a,o,s,f,0),t.vertexAttribDivisor(a,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var v=new Array(e),c=0;c<e;c++)v[c]=mb(t,s,l,f,o,c);return h.dataArray=l,h.stride=f,h.size=o,h.getView=function(d){return v[d]},h.setPoint=function(d,p,y){var g=v[d];g[0]=p,g[1]=y},h.bufferSubData=function(d){t.bindBuffer(t.ARRAY_BUFFER,h),d?t.bufferSubData(t.ARRAY_BUFFER,0,l,0,d*o):t.bufferSubData(t.ARRAY_BUFFER,0,l)},h}function wb(t,e,r){for(var a=9,n=new Float32Array(e*a),i=new Array(e),o=0;o<e;o++){var s=o*a*4;i[o]=new Float32Array(n.buffer,s,a)}var u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,n.byteLength,t.DYNAMIC_DRAW);for(var l=0;l<3;l++){var f=r+l;t.enableVertexAttribArray(f),t.vertexAttribPointer(f,3,t.FLOAT,!1,36,l*12),t.vertexAttribDivisor(f,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),u.getMatrixView=function(h){return i[h]},u.setData=function(h,v){i[v].set(h,0)},u.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferSubData(t.ARRAY_BUFFER,0,n)},u}function Eb(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(a,n){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,a,n,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var Zf=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function ss(){var t=new Zf(9);return Zf!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Qf(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function xb(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=r[0],c=r[1],d=r[2],p=r[3],y=r[4],g=r[5],b=r[6],m=r[7],w=r[8];return t[0]=v*a+c*o+d*l,t[1]=v*n+c*s+d*f,t[2]=v*i+c*u+d*h,t[3]=p*a+y*o+g*l,t[4]=p*n+y*s+g*f,t[5]=p*i+y*u+g*h,t[6]=b*a+m*o+w*l,t[7]=b*n+m*s+w*f,t[8]=b*i+m*u+w*h,t}function Xn(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=r[0],c=r[1];return t[0]=a,t[1]=n,t[2]=i,t[3]=o,t[4]=s,t[5]=u,t[6]=v*a+c*o+l,t[7]=v*n+c*s+f,t[8]=v*i+c*u+h,t}function Jf(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=Math.sin(r),c=Math.cos(r);return t[0]=c*a+v*o,t[1]=c*n+v*s,t[2]=c*i+v*u,t[3]=c*o-v*a,t[4]=c*s-v*n,t[5]=c*u-v*i,t[6]=l,t[7]=f,t[8]=h,t}function zs(t,e,r){var a=r[0],n=r[1];return t[0]=a*e[0],t[1]=a*e[1],t[2]=a*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Tb(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var Cb=(function(){function t(e,r,a,n){Dr(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=a,this.texHeight=Math.floor(r/a),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=n(e,r,r),this.scratch=n(e,r,this.texHeight,"scratch")}return Ar(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var a=r.w,n=r.h,i=this.texHeight,o=this.texSize,s=i/n,u=a*s,l=n*s;return u>o&&(s=o/a,u=a*s,l=n*s),{scale:s,texW:u,texH:l}}},{key:"draw",value:function(r,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,u=this.texHeight,l=this.getScale(a),f=l.scale,h=l.texW,v=l.texH,c=function(m,w){if(n&&w){var T=w.context,D=m.x,x=m.row,N=D,O=u*x;T.save(),T.translate(N,O),T.scale(f,f),n(T,a),T.restore()}},d=[null,null],p=function(){c(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:h,h:v},d[1]={x:i.freePointer.x+h,y:i.freePointer.row*u,w:0,h:v},i.freePointer.x+=h,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},y=function(){var m=i.scratch,w=i.canvas;m.clear(),c({x:0,row:0},m);var T=o-i.freePointer.x,D=h-T,x=u;{var N=i.freePointer.x,O=i.freePointer.row*u,R=T;w.context.drawImage(m,0,0,R,x,N,O,R,x),d[0]={x:N,y:O,w:R,h:v}}{var P=T,M=(i.freePointer.row+1)*u,I=D;w&&w.context.drawImage(m,P,0,I,x,0,M,I,x),d[1]={x:0,y:M,w:I,h:v}}i.freePointer.x=D,i.freePointer.row++},g=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+h<=o)p();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(g(),p()):this.enableWrapping?y():(g(),p())}return this.keyToLocation.set(r,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(r),o=i.texW;return this.freePointer.x+o>a?this.freePointer.row<n-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=yb(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),Sb=(function(){function t(e,r,a,n){Dr(this,t),this.r=e,this.texSize=r,this.texRows=a,this.createTextureCanvas=n,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Ar(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas;return new Cb(r,a,n,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas,o=Math.floor(a/n);this.scratch=i(r,a,o,"scratch")}return this.scratch}},{key:"draw",value:function(r,a,n){var i=this.styleKeyToAtlas.get(r);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(a))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(r,a,n),this.styleKeyToAtlas.set(r,i)),i}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,a=this.markedKeys;if(a.size===0){console.log("nothing to garbage collect");return}var n=[],i=new Map,o=null,s=kt(this.atlases),u;try{var l=function(){var h=u.value,v=h.getKeys(),c=Db(a,v);if(c.size===0)return n.push(h),v.forEach(function(T){return i.set(T,h)}),1;o||(o=r._createAtlas(),n.push(o));var d=kt(v),p;try{for(d.s();!(p=d.n()).done;){var y=p.value;if(!c.has(y)){var g=h.getOffsets(y),b=ft(g,2),m=b[0],w=b[1];o.canFit({w:m.w+w.w,h:m.h})||(o.lock(),o=r._createAtlas(),n.push(o)),h.canvas&&(r._copyTextureToNewAtlas(y,h,o),i.set(y,o))}}}catch(T){d.e(T)}finally{d.f()}h.dispose()};for(s.s();!(u=s.n()).done;)l()}catch(f){s.e(f)}finally{s.f()}this.atlases=n,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,a,n){var i=a.getOffsets(r),o=ft(i,2),s=o[0],u=o[1];if(u.w===0)n.draw(r,s,function(v){v.drawImage(a.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var l=this._getScratchCanvas();l.clear(),l.context.drawImage(a.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),l.context.drawImage(a.canvas,u.x,u.y,u.w,u.h,s.w,0,u.w,u.h);var f=s.w+u.w,h=s.h;n.draw(r,{w:f,h},function(v){v.drawImage(l,0,0,f,h,0,0,f,h)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function Db(t,e){return t.intersection?t.intersection(e):new Set(Zn(t).filter(function(r){return e.has(r)}))}var Ab=(function(){function t(e,r){Dr(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Ar(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,a){var n=this.globalOptions,i=n.webglTexSize,o=n.createTextureCanvas,s=a.texRows,u=this._cacheScratchCanvas(o),l=new Sb(this.r,i,s,u);this.collections.set(r,l)}},{key:"addRenderType",value:function(r,a){var n=a.collection;if(!this.collections.has(n))throw new Error("invalid atlas collection name '".concat(n,"'"));var i=this.collections.get(n),o=Ie({type:r,atlasCollection:i},a);this.renderTypes.set(r,o)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var a=-1,n=-1,i=null;return function(o,s,u,l){return l?((!i||s!=a||u!=n)&&(a=s,n=u,i=r(o,s,u)),i):r(o,s,u)}}},{key:"_key",value:function(r,a){return"".concat(r,"-").concat(a)}},{key:"invalidate",value:function(r){var a=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,o=i===void 0?!1:i,s=n.filterEle,u=s===void 0?function(){return!0}:s,l=n.filterType,f=l===void 0?function(){return!0}:l,h=!1,v=!1,c=kt(r),d;try{for(c.s();!(d=c.n()).done;){var p=d.value;if(u(p)){var y=kt(this.renderTypes.values()),g;try{var b=function(){var w=g.value,T=w.type;if(f(T)){var D=a.collections.get(w.collection),x=w.getKey(p),N=Array.isArray(x)?x:[x];if(o)N.forEach(function(M){return D.markKeyForGC(M)}),v=!0;else{var O=w.getID?w.getID(p):p.id(),R=a._key(T,O),P=a.typeAndIdToKey.get(R);P!==void 0&&!gb(N,P)&&(h=!0,a.typeAndIdToKey.delete(R),P.forEach(function(M){return D.markKeyForGC(M)}))}}};for(y.s();!(g=y.n()).done;)b()}catch(m){y.e(m)}finally{y.f()}}}}catch(m){c.e(m)}finally{c.f()}return v&&(this.gc(),h=!1),h}},{key:"gc",value:function(){var r=kt(this.collections.values()),a;try{for(r.s();!(a=r.n()).done;){var n=a.value;n.gc()}}catch(i){r.e(i)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,a,n,i){var o=this.renderTypes.get(a),s=this.collections.get(o.collection),u=!1,l=s.draw(i,n,function(v){o.drawClipped?(v.save(),v.beginPath(),v.rect(0,0,n.w,n.h),v.clip(),o.drawElement(v,r,n,!0,!0),v.restore()):o.drawElement(v,r,n,!0,!0),u=!0});if(u){var f=o.getID?o.getID(r):r.id(),h=this._key(a,f);this.typeAndIdToKey.has(h)?this.typeAndIdToKey.get(h).push(i):this.typeAndIdToKey.set(h,[i])}return l}},{key:"getAtlasInfo",value:function(r,a){var n=this,i=this.renderTypes.get(a),o=i.getKey(r),s=Array.isArray(o)?o:[o];return s.map(function(u){var l=i.getBoundingBox(r,u),f=n.getOrCreateAtlas(r,a,l,u),h=f.getOffsets(u),v=ft(h,2),c=v[0],d=v[1];return{atlas:f,tex:c,tex1:c,tex2:d,bb:l}})}},{key:"getDebugInfo",value:function(){var r=[],a=kt(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=ft(n.value,2),o=i[0],s=i[1],u=s.getCounts(),l=u.keyCount,f=u.atlasCount;r.push({type:o,keyCount:l,atlasCount:f})}}catch(h){a.e(h)}finally{a.f()}return r}}])})(),Lb=(function(){function t(e){Dr(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Ar(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var a=this.batchAtlases.indexOf(r);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),a=this.batchAtlases.length-1}return a}}])})(),Nb=`
18
18
  float circleSD(vec2 p, float r) {
19
19
  return distance(vec2(0), p) - r; // signed distance
20
20
  }
@@ -50,7 +50,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
50
50
  // return signed distance
51
51
  return (dot(p/ab,p/ab)>1.0) ? d : -d;
52
52
  }
53
- `,Xa={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},ui={IGNORE:1,USE_BB:2},us=0,jf=1,eh=2,ls=3,na=4,kn=5,Va=6,Ga=7,Pb=(function(){function t(e,r,a){Dr(this,t),this.r=e,this.gl=r,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=hb,this.atlasManager=new Ab(e,a),this.batchManager=new Lb(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Xa.SCREEN),this.pickingProgram=this._createShaderProgram(Xa.PICKING),this.vao=this._createVAO()}return Ar(t,[{key:"addAtlasCollection",value:function(r,a){this.atlasManager.addAtlasCollection(r,a)}},{key:"addTextureAtlasRenderType",value:function(r,a){this.atlasManager.addRenderType(r,a)}},{key:"addSimpleShapeRenderType",value:function(r,a){this.simpleShapeOptions.set(r,a)}},{key:"invalidate",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(r,{filterType:function(s){return s===n},forceRedraw:!0}):i.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var a=this.gl,n=`#version 300 es
53
+ `,Xa={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},ui={IGNORE:1,USE_BB:2},us=0,jf=1,eh=2,ls=3,ia=4,kn=5,Va=6,Ga=7,Pb=(function(){function t(e,r,a){Dr(this,t),this.r=e,this.gl=r,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=hb,this.atlasManager=new Ab(e,a),this.batchManager=new Lb(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Xa.SCREEN),this.pickingProgram=this._createShaderProgram(Xa.PICKING),this.vao=this._createVAO()}return Ar(t,[{key:"addAtlasCollection",value:function(r,a){this.atlasManager.addAtlasCollection(r,a)}},{key:"addTextureAtlasRenderType",value:function(r,a){this.atlasManager.addRenderType(r,a)}},{key:"addSimpleShapeRenderType",value:function(r,a){this.simpleShapeOptions.set(r,a)}},{key:"invalidate",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(r,{filterType:function(s){return s===n},forceRedraw:!0}):i.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var a=this.gl,n=`#version 300 es
54
54
  precision highp float;
55
55
 
56
56
  uniform mat3 uPanZoomMatrix;
@@ -115,7 +115,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
115
115
 
116
116
  gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
117
117
  }
118
- else if(aVertType == `).concat(na," || aVertType == ").concat(Ga,`
118
+ else if(aVertType == `).concat(ia," || aVertType == ").concat(Ga,`
119
119
  || aVertType == `).concat(kn," || aVertType == ").concat(Va,`) { // simple shapes
120
120
 
121
121
  // the bounding box is needed by the fragment shader
@@ -269,10 +269,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js
269
269
  outColor = blend(vColor, uBGColor);
270
270
  outColor.a = 1.0; // make opaque, masks out line under arrow
271
271
  }
272
- else if(vVertType == `).concat(na,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
272
+ else if(vVertType == `).concat(ia,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
273
273
  outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
274
274
  }
275
- else if(vVertType == `).concat(na," || vVertType == ").concat(Ga,`
275
+ else if(vVertType == `).concat(ia," || vVertType == ").concat(Ga,`
276
276
  || vVertType == `).concat(kn," || vVertType == ").concat(Va,`) { // use SDF
277
277
 
278
278
  float outerBorder = vBorderWidth[0];
@@ -284,7 +284,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
284
284
  vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
285
285
 
286
286
  float d; // signed distance
287
- if(vVertType == `).concat(na,`) {
287
+ if(vVertType == `).concat(ia,`) {
288
288
  d = rectangleSD(p, b);
289
289
  } else if(vVertType == `).concat(Ga,` && w == h) {
290
290
  d = circleSD(p, b.x); // faster than ellipse
@@ -328,9 +328,9 @@ https://github.com/jquery/jquery/blob/master/src/event.js
328
328
  `).concat(r.picking?`if(outColor.a == 0.0) discard;
329
329
  else outColor = vIndex;`:"",`
330
330
  }
331
- `),s=fb(a,n,o);s.aPosition=a.getAttribLocation(s,"aPosition"),s.aIndex=a.getAttribLocation(s,"aIndex"),s.aVertType=a.getAttribLocation(s,"aVertType"),s.aTransform=a.getAttribLocation(s,"aTransform"),s.aAtlasId=a.getAttribLocation(s,"aAtlasId"),s.aTex=a.getAttribLocation(s,"aTex"),s.aPointAPointB=a.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=a.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=a.getAttribLocation(s,"aLineWidth"),s.aColor=a.getAttribLocation(s,"aColor"),s.aCornerRadius=a.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=a.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=a.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=a.getUniformLocation(s,"uAtlasSize"),s.uBGColor=a.getUniformLocation(s,"uBGColor"),s.uZoom=a.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)s.uTextures.push(a.getUniformLocation(s,"uTexture".concat(u)));return s}},{key:"_createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var a=this.maxInstances,n=this.gl,i=this.program,o=n.createVertexArray();return n.bindVertexArray(o),bb(n,"vec2",i.aPosition,r),this.transformBuffer=wb(n,a,i.aTransform),this.indexBuffer=$t(n,a,"vec4",i.aIndex),this.vertTypeBuffer=$t(n,a,"int",i.aVertType),this.atlasIdBuffer=$t(n,a,"int",i.aAtlasId),this.texBuffer=$t(n,a,"vec4",i.aTex),this.pointAPointBBuffer=$t(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=$t(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=$t(n,a,"vec2",i.aLineWidth),this.colorBuffer=$t(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=$t(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=$t(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),o}},{key:"buffers",get:function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(a){return dr(a,"Buffer")}).map(function(a){return r[a]})),this._buffers}},{key:"startFrame",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xa.SCREEN;this.panZoomMatrix=r,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,a){return r.visible()?a&&a.isVisible?a.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,a,n){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(n);if(this._isVisible(r,s)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&s.getTexPickingMode){var u=s.getTexPickingMode(r);if(u===ui.IGNORE)return;if(u==ui.USE_BB){this.drawPickingRectangle(r,a,n);return}}var l=i.getAtlasInfo(r,n),f=kt(l),h;try{for(f.s();!(h=f.n()).done;){var v=h.value,c=v.atlas,d=v.tex1,p=v.tex2;o.canAddToCurrentBatch(c)||this.endBatch();for(var y=o.getAtlasIndexForBatch(c),g=0,b=[[d,!0],[p,!1]];g<b.length;g++){var m=ft(b[g],2),w=m[0],T=m[1];if(w.w!=0){var D=this.instanceCount;this.vertTypeBuffer.getView(D)[0]=us;var x=this.indexBuffer.getView(D);aa(a,x);var N=this.atlasIdBuffer.getView(D);N[0]=y;var O=this.texBuffer.getView(D);O[0]=w.x,O[1]=w.y,O[2]=w.w,O[3]=w.h;var R=this.transformBuffer.getMatrixView(D);this.setTransformMatrix(r,R,s,v,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(P){f.e(P)}finally{f.f()}}}},{key:"setTransformMatrix",value:function(r,a,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(n.shapeProps&&n.shapeProps.padding&&(s=r.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,f=i.tex2,h=l.w/(l.w+f.w);o||(h=1-h);var v=this._getAdjustedBB(u,s,o,h);this._applyTransformMatrix(a,v,n,r)}else{var c=n.getBoundingBox(r),d=this._getAdjustedBB(c,s,!0,1);this._applyTransformMatrix(a,d,n,r)}}},{key:"_applyTransformMatrix",value:function(r,a,n,i){var o,s;Qf(r);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),f=l.x,h=l.y;Xn(r,r,[f,h]),Jf(r,r,u);var v=n.getRotationOffset(i);o=v.x+(a.xOffset||0),s=v.y+(a.yOffset||0)}else o=a.x1,s=a.y1;Xn(r,r,[o,s]),zs(r,r,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(r,a,n,i){var o=r.x1,s=r.y1,u=r.w,l=r.h,f=r.yOffset;a&&(o-=a,s-=a,u+=2*a,l+=2*a);var h=0,v=u*i;return n&&i<1?u=v:!n&&i<1&&(h=u-v,o+=h,u=v),{x1:o,y1:s,w:u,h:l,xOffset:h,yOffset:f}}},{key:"drawPickingRectangle",value:function(r,a,n){var i=this.atlasManager.getRenderTypeOpts(n),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=na;var s=this.indexBuffer.getView(o);aa(a,s);var u=this.colorBuffer.getView(o);Ir([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(r,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(r,i)){var o=i.shapeProps,s=this._getVertTypeForShape(r,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(r,this.renderTarget)){this.drawTexture(r,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=s,s===kn||s===Va){var l=i.getBoundingBox(r),f=this._getCornerRadius(r,o.radius,l),h=this.cornerRadiusBuffer.getView(u);h[0]=f,h[1]=f,h[2]=f,h[3]=f,s===Va&&(h[0]=0,h[2]=0)}var v=this.indexBuffer.getView(u);aa(a,v);var c=this.renderTarget.picking?1:n==="node-body"?r.effectiveOpacity():1,d=this.renderTarget.picking?1:r.pstyle(o.opacity).value*c,p=r.pstyle(o.color).value,y=this.colorBuffer.getView(u);Ir(p,d,y);var g=this.lineWidthBuffer.getView(u);if(g[0]=0,g[1]=0,o.border){var b=r.pstyle("border-width").value;if(b>0){var m=r.pstyle("border-color").value,w=c*r.pstyle("border-opacity").value,T=this.borderColorBuffer.getView(u);Ir(m,w,T);var D=r.pstyle("border-position").value;if(D==="inside")g[0]=0,g[1]=-b;else if(D==="outside")g[0]=b,g[1]=0;else{var x=b/2;g[0]=x,g[1]=-x}}}var N=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(r,N,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,a){var n=r.pstyle(a).value;switch(n){case"rectangle":return na;case"ellipse":return Ga;case"roundrectangle":case"round-rectangle":return kn;case"bottom-round-rectangle":return Va;default:return}}},{key:"_getCornerRadius",value:function(r,a,n){var i=n.w,o=n.h;if(r.pstyle(a).value==="auto")return Er(i,o);var s=r.pstyle(a).pfValue,u=i/2,l=o/2;return Math.min(s,l,u)}},{key:"drawEdgeArrow",value:function(r,a,n){if(r.visible()){var i=r._private.rscratch,o,s,u;if(n==="source"?(o=i.arrowStartX,s=i.arrowStartY,u=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(u)||u==null)){var l=r.pstyle(n+"-arrow-shape").value;if(l!=="none"){var f=r.pstyle(n+"-arrow-color").value,h=r.pstyle("opacity").value,v=r.pstyle("line-opacity").value,c=h*v,d=r.pstyle("width").pfValue,p=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(d,p),g=this.instanceCount,b=this.transformBuffer.getMatrixView(g);Qf(b),Xn(b,b,[o,s]),zs(b,b,[y,y]),Jf(b,b,u),this.vertTypeBuffer.getView(g)[0]=ls;var m=this.indexBuffer.getView(g);aa(a,m);var w=this.colorBuffer.getView(g);Ir(f,c,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,a){if(r.visible()){var n=this._getEdgePoints(r);if(n){var i=r.pstyle("opacity").value,o=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,u=r.pstyle("line-color").value,l=i*o;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=jf;var h=this.indexBuffer.getView(f);aa(a,h);var v=this.colorBuffer.getView(f);Ir(u,l,v);var c=this.lineWidthBuffer.getView(f);c[0]=s;var d=this.pointAPointBBuffer.getView(f);d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var p=0;p<n.length-2;p+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=eh;var g=this.indexBuffer.getView(y);aa(a,g);var b=this.colorBuffer.getView(y);Ir(u,l,b);var m=this.lineWidthBuffer.getView(y);m[0]=s;var w=n[p-2],T=n[p-1],D=n[p],x=n[p+1],N=n[p+2],O=n[p+3],R=n[p+4],P=n[p+5];p==0&&(w=2*D-N+.001,T=2*x-O+.001),p==n.length-4&&(R=2*N-D+.001,P=2*O-x+.001);var M=this.pointAPointBBuffer.getView(y);M[0]=w,M[1]=T,M[2]=D,M[3]=x;var I=this.pointCPointDBuffer.getView(y);I[0]=N,I[1]=O,I[2]=R,I[3]=P,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var a=r._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var a=r._private.rscratch;if(this._isValidEdge(r)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(r);return this._getCurveSegmentPoints(n,i)}}},{key:"_getNumSegments",value:function(r){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,a){if(r.length==4)return r;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=r[0],n[1]=r[1];else if(i==a)n[i*2]=r[r.length-2],n[i*2+1]=r[r.length-1];else{var o=i/a;this._setCurvePoint(r,o,n,i*2)}return n}},{key:"_setCurvePoint",value:function(r,a,n,i){if(r.length<=2)n[i]=r[0],n[i+1]=r[1];else{for(var o=Array(r.length-2),s=0;s<o.length;s+=2){var u=(1-a)*r[s]+a*r[s+2],l=(1-a)*r[s+1]+a*r[s+3];o[s]=u,o[s+1]=l}return this._setCurvePoint(o,a,n,i)}}},{key:"endBatch",value:function(){var r=this.gl,a=this.vao,n=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(o),r.bindVertexArray(a);var s=kt(this.buffers),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.bufferSubData(i)}}catch(d){s.e(d)}finally{s.f()}for(var f=this.batchManager.getAtlases(),h=0;h<f.length;h++)f[h].bufferIfNeeded(r);for(var v=0;v<f.length;v++)r.activeTexture(r.TEXTURE0+v),r.bindTexture(r.TEXTURE_2D,f[v].texture),r.uniform1i(o.uTextures[v],v);r.uniform1f(o.uZoom,cb(this.r)),r.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var c=Ir(this.bgColor,1);r.uniform4fv(o.uBGColor,c),r.drawArraysInstanced(r.TRIANGLES,0,n,i),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:f.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var r=this.atlasManager.getDebugInfo(),a=r.reduce(function(o,s){return o+s.atlasCount},0),n=this.batchDebugInfo,i=n.reduce(function(o,s){return o+s.count},0);return{atlasInfo:r,totalAtlases:a,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:i}}}])})(),hv={};hv.initWebgl=function(t,e){var r=this,a=r.data.contexts[r.WEBGL];t.bgColor=Ib(r),t.webglTexSize=Math.min(t.webglTexSize,a.getParameter(a.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=Eb(a),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new Pb(r,a,t);var n=function(h){return function(v){return r.getTextAngle(v,h)}},i=function(h){return function(v){var c=v.pstyle(h);return c&&c.value}},o=function(h){return function(v){return v.pstyle("".concat(h,"-opacity")).value>0}},s=function(h){var v=h.pstyle("text-events").strValue==="yes";return v?ui.USE_BB:ui.IGNORE},u=function(h){var v=h.position(),c=v.x,d=v.y,p=h.outerWidth(),y=h.outerHeight();return{w:p,h:y,x1:c-p/2,y1:d-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:db,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:fs(e.getLabelKey,null),getBoundingBox:hs(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:fs(e.getSourceLabelKey,"source"),getBoundingBox:hs(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:fs(e.getTargetLabelKey,"target"),getBoundingBox:hs(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=cn(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(f,h){var v=!1;h&&h.length>0&&(v|=r.drawing.invalidate(h)),v&&l()}),kb(r)};function Ib(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return zh(r)}function cv(t,e){var r=t._private.rscratch;return Mt(r,"labelWrapCachedLines",e)||[]}var fs=function(e,r){return function(a){var n=e(a),i=cv(a,r);return i.length>1?i.map(function(o,s){return"".concat(n,"_").concat(s)}):n}},hs=function(e,r){return function(a,n){var i=e(a);if(typeof n=="string"){var o=n.indexOf("_");if(o>0){var s=Number(n.substring(o+1)),u=cv(a,r),l=i.h/u.length,f=l*s,h=i.y1+f;return{x1:i.x1,w:i.w,y1:h,h:l,yOffset:f}}}return i}};function kb(t){{var e=t.render;t.render=function(i){i=i||{};var o=t.cy;t.webgl&&(o.zoom()>nv?(Bb(t),e.call(t,i)):(Fb(t),dv(t,i,Xa.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(i){r.call(t,i),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(i,o,s,u){return Yb(t,i,o)};{var a=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){a.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var n=t.notify;t.notify=function(i,o){n.call(t,i,o),i==="viewport"||i==="bounds"?t.pickingFrameBuffer.needsDraw=!0:i==="background"&&t.drawing.invalidate(o,{type:"node-body"})}}}function Bb(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Fb(t){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,t.canvasWidth,t.canvasHeight),a.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function zb(t){var e=t.canvasWidth,r=t.canvasHeight,a=gu(t),n=a.pan,i=a.zoom,o=ss();Xn(o,o,[n.x,n.y]),zs(o,o,[i,i]);var s=ss();Tb(s,e,r);var u=ss();return xb(u,s,o),u}function vv(t,e){var r=t.canvasWidth,a=t.canvasHeight,n=gu(t),i=n.pan,o=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,a),e.translate(i.x,i.y),e.scale(o,o)}function Vb(t,e){t.drawSelectionRectangle(e,function(r){return vv(t,r)})}function Gb(t){var e=t.data.contexts[t.NODE];e.save(),vv(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Ub(t){var e=function(n,i,o){for(var s=n.atlasManager.getAtlasCollection(i),u=t.data.contexts[t.NODE],l=s.atlases,f=0;f<l.length;f++){var h=l[f],v=h.canvas;if(v){var c=v.width,d=v.height,p=c*f,y=v.height*o,g=.4;u.save(),u.scale(g,g),u.drawImage(v,p,y),u.strokeStyle="black",u.rect(p,y,c,d),u.stroke(),u.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function Hb(t,e,r,a,n){var i,o,s,u,l=gu(t),f=l.pan,h=l.zoom;{var v=vb(t,f,h,e,r),c=ft(v,2),d=c[0],p=c[1],y=6;i=d-y/2,o=p-y/2,s=y,u=y}if(s===0||u===0)return[];var g=t.data.contexts[t.WEBGL];g.bindFramebuffer(g.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(g.viewport(0,0,g.canvas.width,g.canvas.height),dv(t,null,Xa.PICKING),t.pickingFrameBuffer.needsDraw=!1);var b=s*u,m=new Uint8Array(b*4);g.readPixels(i,o,s,u,g.RGBA,g.UNSIGNED_BYTE,m),g.bindFramebuffer(g.FRAMEBUFFER,null);for(var w=new Set,T=0;T<b;T++){var D=m.slice(T*4,T*4+4),x=pb(D)-1;x>=0&&w.add(x)}return w}function Yb(t,e,r){var a=Hb(t,e,r),n=t.getCachedZSortedEles(),i,o,s=kt(a),u;try{for(s.s();!(u=s.n()).done;){var l=u.value,f=n[l];if(!i&&f.isNode()&&(i=f),!o&&f.isEdge()&&(o=f),i&&o)break}}catch(h){s.e(h)}finally{s.f()}return[i,o].filter(Boolean)}function cs(t,e,r){var a=t.drawing;e+=1,r.isNode()?(a.drawNode(r,e,"node-underlay"),a.drawNode(r,e,"node-body"),a.drawTexture(r,e,"label"),a.drawNode(r,e,"node-overlay")):(a.drawEdgeLine(r,e),a.drawEdgeArrow(r,e,"source"),a.drawEdgeArrow(r,e,"target"),a.drawTexture(r,e,"label"),a.drawTexture(r,e,"edge-source-label"),a.drawTexture(r,e,"edge-target-label"))}function dv(t,e,r){var a;t.webglDebug&&(a=performance.now());var n=t.drawing,i=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Vb(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var o=t.data.contexts[t.WEBGL];r.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=zb(t),u=t.getCachedZSortedEles();if(i=u.length,n.startFrame(s,r),r.screen){for(var l=0;l<u.nondrag.length;l++)cs(t,l,u.nondrag[l]);for(var f=0;f<u.drag.length;f++)cs(t,f,u.drag[f])}else if(r.picking)for(var h=0;h<u.length;h++)cs(t,h,u[h]);n.endFrame(),r.screen&&t.webglDebugShowAtlases&&(Gb(t),Ub(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var v=performance.now(),c=!1,d=Math.ceil(v-a),p=n.getDebugInfo(),y=["".concat(i," elements"),"".concat(p.totalInstances," instances"),"".concat(p.batchCount," batches"),"".concat(p.totalAtlases," atlases"),"".concat(p.wrappedCount," wrapped textures"),"".concat(p.simpleCount," simple shapes")].join(", ");if(c)console.log("WebGL (".concat(r.name,") - time ").concat(d,"ms, ").concat(y));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(d,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var g=p.atlasInfo,b=kt(g),m;try{for(b.s();!(m=b.n()).done;){var w=m.value;console.log(" ".concat(w.type,": ").concat(w.keyCount," keys, ").concat(w.atlasCount," atlases"))}}catch(T){b.e(T)}finally{b.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,n.gc())}var Mr={};Mr.drawPolygonPath=function(t,e,r,a,n,i){var o=a/2,s=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+s*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+o*i[u*2],r+s*i[u*2+1]);t.closePath()};Mr.drawRoundPolygonPath=function(t,e,r,a,n,i,o){o.forEach(function(s){return $c(t,s)}),t.closePath()};Mr.drawRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?Er(a,n):Math.min(i,s,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.arcTo(e+o,r-s,e+o,r,u),t.arcTo(e+o,r+s,e,r+s,u),t.arcTo(e-o,r+s,e-o,r,u),t.arcTo(e-o,r-s,e,r-s,u),t.lineTo(e,r-s),t.closePath()};Mr.drawBottomRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?Er(a,n):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.lineTo(e+o,r-s),t.lineTo(e+o,r),t.arcTo(e+o,r+s,e,r+s,u),t.arcTo(e-o,r+s,e-o,r,u),t.lineTo(e-o,r-s),t.lineTo(e,r-s),t.closePath()};Mr.drawCutRectanglePath=function(t,e,r,a,n,i,o){var s=a/2,u=n/2,l=o==="auto"?tu():o;t.beginPath&&t.beginPath(),t.moveTo(e-s+l,r-u),t.lineTo(e+s-l,r-u),t.lineTo(e+s,r-u+l),t.lineTo(e+s,r+u-l),t.lineTo(e+s-l,r+u),t.lineTo(e-s+l,r+u),t.lineTo(e-s,r+u-l),t.lineTo(e-s,r-u+l),t.closePath()};Mr.drawBarrelPath=function(t,e,r,a,n){var i=a/2,o=n/2,s=e-i,u=e+i,l=r-o,f=r+o,h=Cs(a,n),v=h.widthOffset,c=h.heightOffset,d=h.ctrlPtOffsetPct*v;t.beginPath&&t.beginPath(),t.moveTo(s,l+c),t.lineTo(s,f-c),t.quadraticCurveTo(s+d,f,s+v,f),t.lineTo(u-v,f),t.quadraticCurveTo(u-d,f,u,f-c),t.lineTo(u,l+c),t.quadraticCurveTo(u-d,l,u-v,l),t.lineTo(s+v,l),t.quadraticCurveTo(s+d,l,s,l+c),t.closePath()};var th=Math.sin(0),rh=Math.cos(0),Vs={},Gs={},gv=Math.PI/40;for(var ia=0*Math.PI;ia<2*Math.PI;ia+=gv)Vs[ia]=Math.sin(ia),Gs[ia]=Math.cos(ia);Mr.drawEllipsePath=function(t,e,r,a,n){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,a/2,n/2,0,0,2*Math.PI);else for(var i,o,s=a/2,u=n/2,l=0*Math.PI;l<2*Math.PI;l+=gv)i=e-s*Vs[l]*th+s*Gs[l]*rh,o=r+u*Gs[l]*th+u*Vs[l]*rh,l===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var mn={};mn.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};mn.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),a=r.boundingBox(),n=this.findContainerClientCoords(),i=t.full?Math.ceil(a.w):n[2],o=t.full?Math.ceil(a.h):n[3],s=be(t.maxWidth)||be(t.maxHeight),u=this.getPixelRatio(),l=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,l=t.scale;else if(s){var f=1/0,h=1/0;be(t.maxWidth)&&(f=l*t.maxWidth/i),be(t.maxHeight)&&(h=l*t.maxHeight/o),l=Math.min(f,h),i*=l,o*=l}s||(i*=u,o*=u,l*=u);var v=document.createElement("canvas");v.width=i,v.height=o,v.style.width=i+"px",v.style.height=o+"px";var c=v.getContext("2d");if(i>0&&o>0){c.clearRect(0,0,i,o),c.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(t.full)c.translate(-a.x1*l,-a.y1*l),c.scale(l,l),this.drawElements(c,d),c.scale(1/l,1/l),c.translate(a.x1*l,a.y1*l);else{var p=e.pan(),y={x:p.x*l,y:p.y*l};l*=e.zoom(),c.translate(y.x,y.y),c.scale(l,l),this.drawElements(c,d),c.scale(1/l,1/l),c.translate(-y.x,-y.y)}t.bg&&(c.globalCompositeOperation="destination-over",c.fillStyle=t.bg,c.rect(0,0,i,o),c.fill())}return v};function qb(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return new Blob([a],{type:e})}function ah(t){var e=t.indexOf(",");return t.substr(e+1)}function pv(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Ca(function(n,i){try{e.toBlob(function(o){o!=null?n(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return qb(ah(a()),r);case"base64":return ah(a());case"base64uri":default:return a()}}mn.png=function(t){return pv(t,this.bufferCanvasImage(t),"image/png")};mn.jpg=function(t){return pv(t,this.bufferCanvasImage(t),"image/jpeg")};var yv={};yv.nodeShapeImpl=function(t,e,r,a,n,i,o,s){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,i);case"polygon":return this.drawPolygonPath(e,r,a,n,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,i,s);case"barrel":return this.drawBarrelPath(e,r,a,n,i)}};var _b=mv,Ge=mv.prototype;Ge.CANVAS_LAYERS=3;Ge.SELECT_BOX=0;Ge.DRAG=1;Ge.NODE=2;Ge.WEBGL=3;Ge.CANVAS_TYPES=["2d","2d","2d","webgl2"];Ge.BUFFER_COUNT=3;Ge.TEXTURE_BUFFER=0;Ge.MOTIONBLUR_BUFFER_NODE=1;Ge.MOTIONBLUR_BUFFER_DRAG=2;function mv(t){var e=this,r=e.cy.window(),a=r.document;t.webgl&&(Ge.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Ge.CANVAS_LAYERS),contexts:new Array(Ge.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Ge.CANVAS_LAYERS),bufferCanvases:new Array(Ge.BUFFER_COUNT),bufferContexts:new Array(Ge.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=a.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=t.cy.container();s.appendChild(e.data.canvasContainer),s.style[n]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Bd()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var l=0;l<Ge.CANVAS_LAYERS;l++){var f=e.data.canvases[l]=a.createElement("canvas"),h=Ge.CANVAS_TYPES[l];e.data.contexts[l]=f.getContext(h),e.data.contexts[l]||nt("Could not create canvas of type "+h),Object.keys(u).forEach(function(U){f.style[U]=u[U]}),f.style.position="absolute",f.setAttribute("data-id","layer"+l),f.style.zIndex=String(Ge.CANVAS_LAYERS-l),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[l]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Ge.NODE].setAttribute("data-id","layer"+Ge.NODE+"-node"),e.data.canvases[Ge.SELECT_BOX].setAttribute("data-id","layer"+Ge.SELECT_BOX+"-selectbox"),e.data.canvases[Ge.DRAG].setAttribute("data-id","layer"+Ge.DRAG+"-drag"),e.data.canvases[Ge.WEBGL]&&e.data.canvases[Ge.WEBGL].setAttribute("data-id","layer"+Ge.WEBGL+"-webgl");for(var l=0;l<Ge.BUFFER_COUNT;l++)e.data.bufferCanvases[l]=a.createElement("canvas"),e.data.bufferContexts[l]=e.data.bufferCanvases[l].getContext("2d"),e.data.bufferCanvases[l].style.position="absolute",e.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),e.data.bufferCanvases[l].style.zIndex=String(-l-1),e.data.bufferCanvases[l].style.visibility="hidden";e.pathsEnabled=!0;var v=Rt(),c=function(H){return{x:(H.x1+H.x2)/2,y:(H.y1+H.y2)/2}},d=function(H){return{x:-H.w/2,y:-H.h/2}},p=function(H){var _=H[0]._private,W=_.oldBackgroundTimestamp===_.backgroundTimestamp;return!W},y=function(H){return H[0]._private.nodeKey},g=function(H){return H[0]._private.labelStyleKey},b=function(H){return H[0]._private.sourceLabelStyleKey},m=function(H){return H[0]._private.targetLabelStyleKey},w=function(H,_,W,J,te){return e.drawElement(H,_,W,!1,!1,te)},T=function(H,_,W,J,te){return e.drawElementText(H,_,W,J,"main",te)},D=function(H,_,W,J,te){return e.drawElementText(H,_,W,J,"source",te)},x=function(H,_,W,J,te){return e.drawElementText(H,_,W,J,"target",te)},N=function(H){return H.boundingBox(),H[0]._private.bodyBounds},O=function(H){return H.boundingBox(),H[0]._private.labelBounds.main||v},R=function(H){return H.boundingBox(),H[0]._private.labelBounds.source||v},P=function(H){return H.boundingBox(),H[0]._private.labelBounds.target||v},M=function(H,_){return _},I=function(H){return c(N(H))},E=function(H,_,W){var J=H?H+"-":"";return{x:_.x+W.pstyle(J+"text-margin-x").pfValue,y:_.y+W.pstyle(J+"text-margin-y").pfValue}},A=function(H,_,W){var J=H[0]._private.rscratch;return{x:J[_],y:J[W]}},C=function(H){return E("",A(H,"labelX","labelY"),H)},S=function(H){return E("source",A(H,"sourceLabelX","sourceLabelY"),H)},L=function(H){return E("target",A(H,"targetLabelX","targetLabelY"),H)},V=function(H){return d(N(H))},F=function(H){return d(R(H))},B=function(H){return d(P(H))},Y=function(H){var _=O(H),W=d(O(H));if(H.isNode()){switch(ba(H.pstyle("text-halign").value)){case"left":W.x=-_.w-(_.leftPad||0);break;case"right":W.x=-(_.rightPad||0);break}switch(wa(H.pstyle("text-valign").value)){case"top":W.y=-_.h-(_.topPad||0);break;case"bottom":W.y=-(_.botPad||0);break}}return W},q=e.data.eleTxrCache=new Ya(e,{getKey:y,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:N,getRotationPoint:I,getRotationOffset:V,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),Q=e.data.lblTxrCache=new Ya(e,{getKey:g,drawElement:T,getBoundingBox:O,getRotationPoint:C,getRotationOffset:Y,isVisible:M}),$=e.data.slbTxrCache=new Ya(e,{getKey:b,drawElement:D,getBoundingBox:R,getRotationPoint:S,getRotationOffset:F,isVisible:M}),K=e.data.tlbTxrCache=new Ya(e,{getKey:m,drawElement:x,getBoundingBox:P,getRotationPoint:L,getRotationOffset:B,isVisible:M}),j=e.data.lyrTxrCache=new iv(e);e.onUpdateEleCalcs(function(H,_){q.invalidateElements(_),Q.invalidateElements(_),$.invalidateElements(_),K.invalidateElements(_),j.invalidateElements(_);for(var W=0;W<_.length;W++){var J=_[W]._private;J.oldBackgroundTimestamp=J.backgroundTimestamp}});var re=function(H){for(var _=0;_<H.length;_++)j.enqueueElementRefinement(H[_].ele)};q.onDequeue(re),Q.onDequeue(re),$.onDequeue(re),K.onDequeue(re),t.webgl&&e.initWebgl(t,{getStyleKey:y,getLabelKey:g,getSourceLabelKey:b,getTargetLabelKey:m,drawElement:w,drawLabel:T,drawSourceLabel:D,drawTargetLabel:x,getElementBox:N,getLabelBox:O,getSourceLabelBox:R,getTargetLabelBox:P,getElementRotationPoint:I,getElementRotationOffset:V,getLabelRotationPoint:C,getSourceLabelRotationPoint:S,getTargetLabelRotationPoint:L,getLabelRotationOffset:Y,getSourceLabelRotationOffset:F,getTargetLabelRotationOffset:B})}Ge.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Ge.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Ge.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Ge.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var Wb=typeof Path2D<"u";Ge.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Ge.usePaths=function(){return Wb&&this.pathsEnabled};Ge.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Ge.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Ge.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":dt(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var a=this.cy.window(),n=a.document;r=n.createElement("canvas"),r.width=t,r.height=e}return r};[ov,tr,ur,du,$r,Nr,Ot,hv,Mr,mn,yv].forEach(function(t){Ie(Ge,t)});var Xb=[{name:"null",impl:_c},{name:"base",impl:rv},{name:"canvas",impl:_b}],$b=[{type:"layout",extensions:y0},{type:"renderer",extensions:Xb}],bv={},wv={};function Ev(t,e,r){var a=r,n=function(N){Ke("Can not register `"+e+"` for `"+t+"` since `"+N+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(rn.prototype[e])return n(e);rn.prototype[e]=r}else if(t==="collection"){if(xt.prototype[e])return n(e);xt.prototype[e]=r}else if(t==="layout"){for(var i=function(N){this.options=N,r.call(this,N),_e(this._private)||(this._private={}),this._private.cy=N.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var f=r.prototype.stop;o.stop=function(){var x=this.options;if(x&&x.animate){var N=this.animations;if(N)for(var O=0;O<N.length;O++)N[O].stop()}return f?f.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var h=function(N){return N._private.cy},v={addEventFields:function(N,O){O.layout=N,O.cy=h(N),O.target=N},bubble:function(){return!0},parent:function(N){return h(N)}};Ie(o,{createEmitter:function(){return this._private.emitter=new Ci(v,this),this},emitter:function(){return this._private.emitter},on:function(N,O){return this.emitter().on(N,O),this},one:function(N,O){return this.emitter().one(N,O),this},once:function(N,O){return this.emitter().one(N,O),this},removeListener:function(N,O){return this.emitter().removeListener(N,O),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(N,O){return this.emitter().emit(N,O),this}}),$e.eventAliasesOn(o),a=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var c=xv("renderer","base"),d=c.prototype,p=r,y=r.prototype,g=function(){c.apply(this,arguments),p.apply(this,arguments)},b=g.prototype;for(var m in d){var w=d[m],T=y[m]!=null;if(T)return n(m);b[m]=w}for(var D in y)b[D]=y[D];d.clientFunctions.forEach(function(x){b[x]=b[x]||function(){nt("Renderer does not implement `renderer."+x+"()` on its prototype")}}),a=g}else if(t==="__proto__"||t==="constructor"||t==="prototype")return nt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Vh({map:bv,keys:[t,e],value:a})}function xv(t,e){return Gh({map:bv,keys:[t,e]})}function Kb(t,e,r,a,n){return Vh({map:wv,keys:[t,e,r,a],value:n})}function Zb(t,e,r,a){return Gh({map:wv,keys:[t,e,r,a]})}var Us=function(){if(arguments.length===2)return xv.apply(null,arguments);if(arguments.length===3)return Ev.apply(null,arguments);if(arguments.length===4)return Zb.apply(null,arguments);if(arguments.length===5)return Kb.apply(null,arguments);nt("Invalid extension access syntax")};rn.prototype.extension=Us;$b.forEach(function(t){t.extensions.forEach(function(e){Ev(t.type,e.name,e.impl)})});var li=function(){if(!(this instanceof li))return new li;this.length=0},Wr=li.prototype;Wr.instanceString=function(){return"stylesheet"};Wr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Wr.css=function(t,e){var r=this.length-1;if(Me(t))this[r].properties.push({name:t,value:e});else if(_e(t))for(var a=t,n=Object.keys(a),i=0;i<n.length;i++){var o=n[i],s=a[o];if(s!=null){var u=bt.properties[o]||bt.properties[di(o)];if(u!=null){var l=u.name,f=s;this[r].properties.push({name:l,value:f})}}}return this};Wr.style=Wr.css;Wr.generateStyle=function(t){var e=new bt(t);return this.appendToStyle(e)};Wr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],a=r.selector,n=r.properties;t.selector(a);for(var i=0;i<n.length;i++){var o=n[i];t.css(o.name,o.value)}}return t};var Qb="3.34.0",Sr=function(e){if(e===void 0&&(e={}),_e(e))return new rn(e);if(Me(e))return Us.apply(Us,arguments)};Sr.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Sr),t.apply(null,e),this};Sr.warnings=function(t){return Xh(t)};Sr.version=Qb;Sr.stylesheet=Sr.Stylesheet=li;/*!
331
+ `),s=fb(a,n,o);s.aPosition=a.getAttribLocation(s,"aPosition"),s.aIndex=a.getAttribLocation(s,"aIndex"),s.aVertType=a.getAttribLocation(s,"aVertType"),s.aTransform=a.getAttribLocation(s,"aTransform"),s.aAtlasId=a.getAttribLocation(s,"aAtlasId"),s.aTex=a.getAttribLocation(s,"aTex"),s.aPointAPointB=a.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=a.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=a.getAttribLocation(s,"aLineWidth"),s.aColor=a.getAttribLocation(s,"aColor"),s.aCornerRadius=a.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=a.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=a.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=a.getUniformLocation(s,"uAtlasSize"),s.uBGColor=a.getUniformLocation(s,"uBGColor"),s.uZoom=a.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)s.uTextures.push(a.getUniformLocation(s,"uTexture".concat(u)));return s}},{key:"_createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var a=this.maxInstances,n=this.gl,i=this.program,o=n.createVertexArray();return n.bindVertexArray(o),bb(n,"vec2",i.aPosition,r),this.transformBuffer=wb(n,a,i.aTransform),this.indexBuffer=$t(n,a,"vec4",i.aIndex),this.vertTypeBuffer=$t(n,a,"int",i.aVertType),this.atlasIdBuffer=$t(n,a,"int",i.aAtlasId),this.texBuffer=$t(n,a,"vec4",i.aTex),this.pointAPointBBuffer=$t(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=$t(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=$t(n,a,"vec2",i.aLineWidth),this.colorBuffer=$t(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=$t(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=$t(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),o}},{key:"buffers",get:function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(a){return dr(a,"Buffer")}).map(function(a){return r[a]})),this._buffers}},{key:"startFrame",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xa.SCREEN;this.panZoomMatrix=r,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,a){return r.visible()?a&&a.isVisible?a.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,a,n){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(n);if(this._isVisible(r,s)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&s.getTexPickingMode){var u=s.getTexPickingMode(r);if(u===ui.IGNORE)return;if(u==ui.USE_BB){this.drawPickingRectangle(r,a,n);return}}var l=i.getAtlasInfo(r,n),f=kt(l),h;try{for(f.s();!(h=f.n()).done;){var v=h.value,c=v.atlas,d=v.tex1,p=v.tex2;o.canAddToCurrentBatch(c)||this.endBatch();for(var y=o.getAtlasIndexForBatch(c),g=0,b=[[d,!0],[p,!1]];g<b.length;g++){var m=ft(b[g],2),w=m[0],T=m[1];if(w.w!=0){var D=this.instanceCount;this.vertTypeBuffer.getView(D)[0]=us;var x=this.indexBuffer.getView(D);na(a,x);var N=this.atlasIdBuffer.getView(D);N[0]=y;var O=this.texBuffer.getView(D);O[0]=w.x,O[1]=w.y,O[2]=w.w,O[3]=w.h;var R=this.transformBuffer.getMatrixView(D);this.setTransformMatrix(r,R,s,v,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(P){f.e(P)}finally{f.f()}}}},{key:"setTransformMatrix",value:function(r,a,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(n.shapeProps&&n.shapeProps.padding&&(s=r.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,f=i.tex2,h=l.w/(l.w+f.w);o||(h=1-h);var v=this._getAdjustedBB(u,s,o,h);this._applyTransformMatrix(a,v,n,r)}else{var c=n.getBoundingBox(r),d=this._getAdjustedBB(c,s,!0,1);this._applyTransformMatrix(a,d,n,r)}}},{key:"_applyTransformMatrix",value:function(r,a,n,i){var o,s;Qf(r);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),f=l.x,h=l.y;Xn(r,r,[f,h]),Jf(r,r,u);var v=n.getRotationOffset(i);o=v.x+(a.xOffset||0),s=v.y+(a.yOffset||0)}else o=a.x1,s=a.y1;Xn(r,r,[o,s]),zs(r,r,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(r,a,n,i){var o=r.x1,s=r.y1,u=r.w,l=r.h,f=r.yOffset;a&&(o-=a,s-=a,u+=2*a,l+=2*a);var h=0,v=u*i;return n&&i<1?u=v:!n&&i<1&&(h=u-v,o+=h,u=v),{x1:o,y1:s,w:u,h:l,xOffset:h,yOffset:f}}},{key:"drawPickingRectangle",value:function(r,a,n){var i=this.atlasManager.getRenderTypeOpts(n),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=ia;var s=this.indexBuffer.getView(o);na(a,s);var u=this.colorBuffer.getView(o);Ir([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(r,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(r,i)){var o=i.shapeProps,s=this._getVertTypeForShape(r,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(r,this.renderTarget)){this.drawTexture(r,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=s,s===kn||s===Va){var l=i.getBoundingBox(r),f=this._getCornerRadius(r,o.radius,l),h=this.cornerRadiusBuffer.getView(u);h[0]=f,h[1]=f,h[2]=f,h[3]=f,s===Va&&(h[0]=0,h[2]=0)}var v=this.indexBuffer.getView(u);na(a,v);var c=this.renderTarget.picking?1:n==="node-body"?r.effectiveOpacity():1,d=this.renderTarget.picking?1:r.pstyle(o.opacity).value*c,p=r.pstyle(o.color).value,y=this.colorBuffer.getView(u);Ir(p,d,y);var g=this.lineWidthBuffer.getView(u);if(g[0]=0,g[1]=0,o.border){var b=r.pstyle("border-width").value;if(b>0){var m=r.pstyle("border-color").value,w=c*r.pstyle("border-opacity").value,T=this.borderColorBuffer.getView(u);Ir(m,w,T);var D=r.pstyle("border-position").value;if(D==="inside")g[0]=0,g[1]=-b;else if(D==="outside")g[0]=b,g[1]=0;else{var x=b/2;g[0]=x,g[1]=-x}}}var N=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(r,N,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,a){var n=r.pstyle(a).value;switch(n){case"rectangle":return ia;case"ellipse":return Ga;case"roundrectangle":case"round-rectangle":return kn;case"bottom-round-rectangle":return Va;default:return}}},{key:"_getCornerRadius",value:function(r,a,n){var i=n.w,o=n.h;if(r.pstyle(a).value==="auto")return Er(i,o);var s=r.pstyle(a).pfValue,u=i/2,l=o/2;return Math.min(s,l,u)}},{key:"drawEdgeArrow",value:function(r,a,n){if(r.visible()){var i=r._private.rscratch,o,s,u;if(n==="source"?(o=i.arrowStartX,s=i.arrowStartY,u=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(u)||u==null)){var l=r.pstyle(n+"-arrow-shape").value;if(l!=="none"){var f=r.pstyle(n+"-arrow-color").value,h=r.pstyle("opacity").value,v=r.pstyle("line-opacity").value,c=h*v,d=r.pstyle("width").pfValue,p=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(d,p),g=this.instanceCount,b=this.transformBuffer.getMatrixView(g);Qf(b),Xn(b,b,[o,s]),zs(b,b,[y,y]),Jf(b,b,u),this.vertTypeBuffer.getView(g)[0]=ls;var m=this.indexBuffer.getView(g);na(a,m);var w=this.colorBuffer.getView(g);Ir(f,c,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,a){if(r.visible()){var n=this._getEdgePoints(r);if(n){var i=r.pstyle("opacity").value,o=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,u=r.pstyle("line-color").value,l=i*o;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=jf;var h=this.indexBuffer.getView(f);na(a,h);var v=this.colorBuffer.getView(f);Ir(u,l,v);var c=this.lineWidthBuffer.getView(f);c[0]=s;var d=this.pointAPointBBuffer.getView(f);d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var p=0;p<n.length-2;p+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=eh;var g=this.indexBuffer.getView(y);na(a,g);var b=this.colorBuffer.getView(y);Ir(u,l,b);var m=this.lineWidthBuffer.getView(y);m[0]=s;var w=n[p-2],T=n[p-1],D=n[p],x=n[p+1],N=n[p+2],O=n[p+3],R=n[p+4],P=n[p+5];p==0&&(w=2*D-N+.001,T=2*x-O+.001),p==n.length-4&&(R=2*N-D+.001,P=2*O-x+.001);var M=this.pointAPointBBuffer.getView(y);M[0]=w,M[1]=T,M[2]=D,M[3]=x;var I=this.pointCPointDBuffer.getView(y);I[0]=N,I[1]=O,I[2]=R,I[3]=P,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var a=r._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var a=r._private.rscratch;if(this._isValidEdge(r)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(r);return this._getCurveSegmentPoints(n,i)}}},{key:"_getNumSegments",value:function(r){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,a){if(r.length==4)return r;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=r[0],n[1]=r[1];else if(i==a)n[i*2]=r[r.length-2],n[i*2+1]=r[r.length-1];else{var o=i/a;this._setCurvePoint(r,o,n,i*2)}return n}},{key:"_setCurvePoint",value:function(r,a,n,i){if(r.length<=2)n[i]=r[0],n[i+1]=r[1];else{for(var o=Array(r.length-2),s=0;s<o.length;s+=2){var u=(1-a)*r[s]+a*r[s+2],l=(1-a)*r[s+1]+a*r[s+3];o[s]=u,o[s+1]=l}return this._setCurvePoint(o,a,n,i)}}},{key:"endBatch",value:function(){var r=this.gl,a=this.vao,n=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(o),r.bindVertexArray(a);var s=kt(this.buffers),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.bufferSubData(i)}}catch(d){s.e(d)}finally{s.f()}for(var f=this.batchManager.getAtlases(),h=0;h<f.length;h++)f[h].bufferIfNeeded(r);for(var v=0;v<f.length;v++)r.activeTexture(r.TEXTURE0+v),r.bindTexture(r.TEXTURE_2D,f[v].texture),r.uniform1i(o.uTextures[v],v);r.uniform1f(o.uZoom,cb(this.r)),r.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var c=Ir(this.bgColor,1);r.uniform4fv(o.uBGColor,c),r.drawArraysInstanced(r.TRIANGLES,0,n,i),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:f.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var r=this.atlasManager.getDebugInfo(),a=r.reduce(function(o,s){return o+s.atlasCount},0),n=this.batchDebugInfo,i=n.reduce(function(o,s){return o+s.count},0);return{atlasInfo:r,totalAtlases:a,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:i}}}])})(),hv={};hv.initWebgl=function(t,e){var r=this,a=r.data.contexts[r.WEBGL];t.bgColor=Ib(r),t.webglTexSize=Math.min(t.webglTexSize,a.getParameter(a.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=Eb(a),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new Pb(r,a,t);var n=function(h){return function(v){return r.getTextAngle(v,h)}},i=function(h){return function(v){var c=v.pstyle(h);return c&&c.value}},o=function(h){return function(v){return v.pstyle("".concat(h,"-opacity")).value>0}},s=function(h){var v=h.pstyle("text-events").strValue==="yes";return v?ui.USE_BB:ui.IGNORE},u=function(h){var v=h.position(),c=v.x,d=v.y,p=h.outerWidth(),y=h.outerHeight();return{w:p,h:y,x1:c-p/2,y1:d-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:db,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:fs(e.getLabelKey,null),getBoundingBox:hs(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:fs(e.getSourceLabelKey,"source"),getBoundingBox:hs(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:fs(e.getTargetLabelKey,"target"),getBoundingBox:hs(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=cn(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(f,h){var v=!1;h&&h.length>0&&(v|=r.drawing.invalidate(h)),v&&l()}),kb(r)};function Ib(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return zh(r)}function cv(t,e){var r=t._private.rscratch;return Mt(r,"labelWrapCachedLines",e)||[]}var fs=function(e,r){return function(a){var n=e(a),i=cv(a,r);return i.length>1?i.map(function(o,s){return"".concat(n,"_").concat(s)}):n}},hs=function(e,r){return function(a,n){var i=e(a);if(typeof n=="string"){var o=n.indexOf("_");if(o>0){var s=Number(n.substring(o+1)),u=cv(a,r),l=i.h/u.length,f=l*s,h=i.y1+f;return{x1:i.x1,w:i.w,y1:h,h:l,yOffset:f}}}return i}};function kb(t){{var e=t.render;t.render=function(i){i=i||{};var o=t.cy;t.webgl&&(o.zoom()>nv?(Bb(t),e.call(t,i)):(Fb(t),dv(t,i,Xa.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(i){r.call(t,i),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(i,o,s,u){return Yb(t,i,o)};{var a=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){a.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var n=t.notify;t.notify=function(i,o){n.call(t,i,o),i==="viewport"||i==="bounds"?t.pickingFrameBuffer.needsDraw=!0:i==="background"&&t.drawing.invalidate(o,{type:"node-body"})}}}function Bb(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Fb(t){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,t.canvasWidth,t.canvasHeight),a.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function zb(t){var e=t.canvasWidth,r=t.canvasHeight,a=gu(t),n=a.pan,i=a.zoom,o=ss();Xn(o,o,[n.x,n.y]),zs(o,o,[i,i]);var s=ss();Tb(s,e,r);var u=ss();return xb(u,s,o),u}function vv(t,e){var r=t.canvasWidth,a=t.canvasHeight,n=gu(t),i=n.pan,o=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,a),e.translate(i.x,i.y),e.scale(o,o)}function Vb(t,e){t.drawSelectionRectangle(e,function(r){return vv(t,r)})}function Gb(t){var e=t.data.contexts[t.NODE];e.save(),vv(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Ub(t){var e=function(n,i,o){for(var s=n.atlasManager.getAtlasCollection(i),u=t.data.contexts[t.NODE],l=s.atlases,f=0;f<l.length;f++){var h=l[f],v=h.canvas;if(v){var c=v.width,d=v.height,p=c*f,y=v.height*o,g=.4;u.save(),u.scale(g,g),u.drawImage(v,p,y),u.strokeStyle="black",u.rect(p,y,c,d),u.stroke(),u.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function Hb(t,e,r,a,n){var i,o,s,u,l=gu(t),f=l.pan,h=l.zoom;{var v=vb(t,f,h,e,r),c=ft(v,2),d=c[0],p=c[1],y=6;i=d-y/2,o=p-y/2,s=y,u=y}if(s===0||u===0)return[];var g=t.data.contexts[t.WEBGL];g.bindFramebuffer(g.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(g.viewport(0,0,g.canvas.width,g.canvas.height),dv(t,null,Xa.PICKING),t.pickingFrameBuffer.needsDraw=!1);var b=s*u,m=new Uint8Array(b*4);g.readPixels(i,o,s,u,g.RGBA,g.UNSIGNED_BYTE,m),g.bindFramebuffer(g.FRAMEBUFFER,null);for(var w=new Set,T=0;T<b;T++){var D=m.slice(T*4,T*4+4),x=pb(D)-1;x>=0&&w.add(x)}return w}function Yb(t,e,r){var a=Hb(t,e,r),n=t.getCachedZSortedEles(),i,o,s=kt(a),u;try{for(s.s();!(u=s.n()).done;){var l=u.value,f=n[l];if(!i&&f.isNode()&&(i=f),!o&&f.isEdge()&&(o=f),i&&o)break}}catch(h){s.e(h)}finally{s.f()}return[i,o].filter(Boolean)}function cs(t,e,r){var a=t.drawing;e+=1,r.isNode()?(a.drawNode(r,e,"node-underlay"),a.drawNode(r,e,"node-body"),a.drawTexture(r,e,"label"),a.drawNode(r,e,"node-overlay")):(a.drawEdgeLine(r,e),a.drawEdgeArrow(r,e,"source"),a.drawEdgeArrow(r,e,"target"),a.drawTexture(r,e,"label"),a.drawTexture(r,e,"edge-source-label"),a.drawTexture(r,e,"edge-target-label"))}function dv(t,e,r){var a;t.webglDebug&&(a=performance.now());var n=t.drawing,i=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Vb(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var o=t.data.contexts[t.WEBGL];r.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=zb(t),u=t.getCachedZSortedEles();if(i=u.length,n.startFrame(s,r),r.screen){for(var l=0;l<u.nondrag.length;l++)cs(t,l,u.nondrag[l]);for(var f=0;f<u.drag.length;f++)cs(t,f,u.drag[f])}else if(r.picking)for(var h=0;h<u.length;h++)cs(t,h,u[h]);n.endFrame(),r.screen&&t.webglDebugShowAtlases&&(Gb(t),Ub(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var v=performance.now(),c=!1,d=Math.ceil(v-a),p=n.getDebugInfo(),y=["".concat(i," elements"),"".concat(p.totalInstances," instances"),"".concat(p.batchCount," batches"),"".concat(p.totalAtlases," atlases"),"".concat(p.wrappedCount," wrapped textures"),"".concat(p.simpleCount," simple shapes")].join(", ");if(c)console.log("WebGL (".concat(r.name,") - time ").concat(d,"ms, ").concat(y));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(d,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var g=p.atlasInfo,b=kt(g),m;try{for(b.s();!(m=b.n()).done;){var w=m.value;console.log(" ".concat(w.type,": ").concat(w.keyCount," keys, ").concat(w.atlasCount," atlases"))}}catch(T){b.e(T)}finally{b.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,n.gc())}var Mr={};Mr.drawPolygonPath=function(t,e,r,a,n,i){var o=a/2,s=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+s*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+o*i[u*2],r+s*i[u*2+1]);t.closePath()};Mr.drawRoundPolygonPath=function(t,e,r,a,n,i,o){o.forEach(function(s){return $c(t,s)}),t.closePath()};Mr.drawRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?Er(a,n):Math.min(i,s,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.arcTo(e+o,r-s,e+o,r,u),t.arcTo(e+o,r+s,e,r+s,u),t.arcTo(e-o,r+s,e-o,r,u),t.arcTo(e-o,r-s,e,r-s,u),t.lineTo(e,r-s),t.closePath()};Mr.drawBottomRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?Er(a,n):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.lineTo(e+o,r-s),t.lineTo(e+o,r),t.arcTo(e+o,r+s,e,r+s,u),t.arcTo(e-o,r+s,e-o,r,u),t.lineTo(e-o,r-s),t.lineTo(e,r-s),t.closePath()};Mr.drawCutRectanglePath=function(t,e,r,a,n,i,o){var s=a/2,u=n/2,l=o==="auto"?tu():o;t.beginPath&&t.beginPath(),t.moveTo(e-s+l,r-u),t.lineTo(e+s-l,r-u),t.lineTo(e+s,r-u+l),t.lineTo(e+s,r+u-l),t.lineTo(e+s-l,r+u),t.lineTo(e-s+l,r+u),t.lineTo(e-s,r+u-l),t.lineTo(e-s,r-u+l),t.closePath()};Mr.drawBarrelPath=function(t,e,r,a,n){var i=a/2,o=n/2,s=e-i,u=e+i,l=r-o,f=r+o,h=Cs(a,n),v=h.widthOffset,c=h.heightOffset,d=h.ctrlPtOffsetPct*v;t.beginPath&&t.beginPath(),t.moveTo(s,l+c),t.lineTo(s,f-c),t.quadraticCurveTo(s+d,f,s+v,f),t.lineTo(u-v,f),t.quadraticCurveTo(u-d,f,u,f-c),t.lineTo(u,l+c),t.quadraticCurveTo(u-d,l,u-v,l),t.lineTo(s+v,l),t.quadraticCurveTo(s+d,l,s,l+c),t.closePath()};var th=Math.sin(0),rh=Math.cos(0),Vs={},Gs={},gv=Math.PI/40;for(var oa=0*Math.PI;oa<2*Math.PI;oa+=gv)Vs[oa]=Math.sin(oa),Gs[oa]=Math.cos(oa);Mr.drawEllipsePath=function(t,e,r,a,n){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,a/2,n/2,0,0,2*Math.PI);else for(var i,o,s=a/2,u=n/2,l=0*Math.PI;l<2*Math.PI;l+=gv)i=e-s*Vs[l]*th+s*Gs[l]*rh,o=r+u*Gs[l]*th+u*Vs[l]*rh,l===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var mn={};mn.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};mn.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),a=r.boundingBox(),n=this.findContainerClientCoords(),i=t.full?Math.ceil(a.w):n[2],o=t.full?Math.ceil(a.h):n[3],s=be(t.maxWidth)||be(t.maxHeight),u=this.getPixelRatio(),l=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,l=t.scale;else if(s){var f=1/0,h=1/0;be(t.maxWidth)&&(f=l*t.maxWidth/i),be(t.maxHeight)&&(h=l*t.maxHeight/o),l=Math.min(f,h),i*=l,o*=l}s||(i*=u,o*=u,l*=u);var v=document.createElement("canvas");v.width=i,v.height=o,v.style.width=i+"px",v.style.height=o+"px";var c=v.getContext("2d");if(i>0&&o>0){c.clearRect(0,0,i,o),c.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(t.full)c.translate(-a.x1*l,-a.y1*l),c.scale(l,l),this.drawElements(c,d),c.scale(1/l,1/l),c.translate(a.x1*l,a.y1*l);else{var p=e.pan(),y={x:p.x*l,y:p.y*l};l*=e.zoom(),c.translate(y.x,y.y),c.scale(l,l),this.drawElements(c,d),c.scale(1/l,1/l),c.translate(-y.x,-y.y)}t.bg&&(c.globalCompositeOperation="destination-over",c.fillStyle=t.bg,c.rect(0,0,i,o),c.fill())}return v};function qb(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return new Blob([a],{type:e})}function ah(t){var e=t.indexOf(",");return t.substr(e+1)}function pv(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Ca(function(n,i){try{e.toBlob(function(o){o!=null?n(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return qb(ah(a()),r);case"base64":return ah(a());case"base64uri":default:return a()}}mn.png=function(t){return pv(t,this.bufferCanvasImage(t),"image/png")};mn.jpg=function(t){return pv(t,this.bufferCanvasImage(t),"image/jpeg")};var yv={};yv.nodeShapeImpl=function(t,e,r,a,n,i,o,s){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,i);case"polygon":return this.drawPolygonPath(e,r,a,n,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,i,s);case"barrel":return this.drawBarrelPath(e,r,a,n,i)}};var _b=mv,Ge=mv.prototype;Ge.CANVAS_LAYERS=3;Ge.SELECT_BOX=0;Ge.DRAG=1;Ge.NODE=2;Ge.WEBGL=3;Ge.CANVAS_TYPES=["2d","2d","2d","webgl2"];Ge.BUFFER_COUNT=3;Ge.TEXTURE_BUFFER=0;Ge.MOTIONBLUR_BUFFER_NODE=1;Ge.MOTIONBLUR_BUFFER_DRAG=2;function mv(t){var e=this,r=e.cy.window(),a=r.document;t.webgl&&(Ge.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Ge.CANVAS_LAYERS),contexts:new Array(Ge.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Ge.CANVAS_LAYERS),bufferCanvases:new Array(Ge.BUFFER_COUNT),bufferContexts:new Array(Ge.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=a.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=t.cy.container();s.appendChild(e.data.canvasContainer),s.style[n]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Bd()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var l=0;l<Ge.CANVAS_LAYERS;l++){var f=e.data.canvases[l]=a.createElement("canvas"),h=Ge.CANVAS_TYPES[l];e.data.contexts[l]=f.getContext(h),e.data.contexts[l]||nt("Could not create canvas of type "+h),Object.keys(u).forEach(function(U){f.style[U]=u[U]}),f.style.position="absolute",f.setAttribute("data-id","layer"+l),f.style.zIndex=String(Ge.CANVAS_LAYERS-l),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[l]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Ge.NODE].setAttribute("data-id","layer"+Ge.NODE+"-node"),e.data.canvases[Ge.SELECT_BOX].setAttribute("data-id","layer"+Ge.SELECT_BOX+"-selectbox"),e.data.canvases[Ge.DRAG].setAttribute("data-id","layer"+Ge.DRAG+"-drag"),e.data.canvases[Ge.WEBGL]&&e.data.canvases[Ge.WEBGL].setAttribute("data-id","layer"+Ge.WEBGL+"-webgl");for(var l=0;l<Ge.BUFFER_COUNT;l++)e.data.bufferCanvases[l]=a.createElement("canvas"),e.data.bufferContexts[l]=e.data.bufferCanvases[l].getContext("2d"),e.data.bufferCanvases[l].style.position="absolute",e.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),e.data.bufferCanvases[l].style.zIndex=String(-l-1),e.data.bufferCanvases[l].style.visibility="hidden";e.pathsEnabled=!0;var v=Rt(),c=function(H){return{x:(H.x1+H.x2)/2,y:(H.y1+H.y2)/2}},d=function(H){return{x:-H.w/2,y:-H.h/2}},p=function(H){var _=H[0]._private,W=_.oldBackgroundTimestamp===_.backgroundTimestamp;return!W},y=function(H){return H[0]._private.nodeKey},g=function(H){return H[0]._private.labelStyleKey},b=function(H){return H[0]._private.sourceLabelStyleKey},m=function(H){return H[0]._private.targetLabelStyleKey},w=function(H,_,W,J,te){return e.drawElement(H,_,W,!1,!1,te)},T=function(H,_,W,J,te){return e.drawElementText(H,_,W,J,"main",te)},D=function(H,_,W,J,te){return e.drawElementText(H,_,W,J,"source",te)},x=function(H,_,W,J,te){return e.drawElementText(H,_,W,J,"target",te)},N=function(H){return H.boundingBox(),H[0]._private.bodyBounds},O=function(H){return H.boundingBox(),H[0]._private.labelBounds.main||v},R=function(H){return H.boundingBox(),H[0]._private.labelBounds.source||v},P=function(H){return H.boundingBox(),H[0]._private.labelBounds.target||v},M=function(H,_){return _},I=function(H){return c(N(H))},E=function(H,_,W){var J=H?H+"-":"";return{x:_.x+W.pstyle(J+"text-margin-x").pfValue,y:_.y+W.pstyle(J+"text-margin-y").pfValue}},A=function(H,_,W){var J=H[0]._private.rscratch;return{x:J[_],y:J[W]}},C=function(H){return E("",A(H,"labelX","labelY"),H)},S=function(H){return E("source",A(H,"sourceLabelX","sourceLabelY"),H)},L=function(H){return E("target",A(H,"targetLabelX","targetLabelY"),H)},V=function(H){return d(N(H))},F=function(H){return d(R(H))},B=function(H){return d(P(H))},Y=function(H){var _=O(H),W=d(O(H));if(H.isNode()){switch(ba(H.pstyle("text-halign").value)){case"left":W.x=-_.w-(_.leftPad||0);break;case"right":W.x=-(_.rightPad||0);break}switch(wa(H.pstyle("text-valign").value)){case"top":W.y=-_.h-(_.topPad||0);break;case"bottom":W.y=-(_.botPad||0);break}}return W},q=e.data.eleTxrCache=new Ya(e,{getKey:y,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:N,getRotationPoint:I,getRotationOffset:V,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),Q=e.data.lblTxrCache=new Ya(e,{getKey:g,drawElement:T,getBoundingBox:O,getRotationPoint:C,getRotationOffset:Y,isVisible:M}),$=e.data.slbTxrCache=new Ya(e,{getKey:b,drawElement:D,getBoundingBox:R,getRotationPoint:S,getRotationOffset:F,isVisible:M}),K=e.data.tlbTxrCache=new Ya(e,{getKey:m,drawElement:x,getBoundingBox:P,getRotationPoint:L,getRotationOffset:B,isVisible:M}),j=e.data.lyrTxrCache=new iv(e);e.onUpdateEleCalcs(function(H,_){q.invalidateElements(_),Q.invalidateElements(_),$.invalidateElements(_),K.invalidateElements(_),j.invalidateElements(_);for(var W=0;W<_.length;W++){var J=_[W]._private;J.oldBackgroundTimestamp=J.backgroundTimestamp}});var re=function(H){for(var _=0;_<H.length;_++)j.enqueueElementRefinement(H[_].ele)};q.onDequeue(re),Q.onDequeue(re),$.onDequeue(re),K.onDequeue(re),t.webgl&&e.initWebgl(t,{getStyleKey:y,getLabelKey:g,getSourceLabelKey:b,getTargetLabelKey:m,drawElement:w,drawLabel:T,drawSourceLabel:D,drawTargetLabel:x,getElementBox:N,getLabelBox:O,getSourceLabelBox:R,getTargetLabelBox:P,getElementRotationPoint:I,getElementRotationOffset:V,getLabelRotationPoint:C,getSourceLabelRotationPoint:S,getTargetLabelRotationPoint:L,getLabelRotationOffset:Y,getSourceLabelRotationOffset:F,getTargetLabelRotationOffset:B})}Ge.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Ge.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Ge.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Ge.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var Wb=typeof Path2D<"u";Ge.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Ge.usePaths=function(){return Wb&&this.pathsEnabled};Ge.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Ge.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Ge.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":dt(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var a=this.cy.window(),n=a.document;r=n.createElement("canvas"),r.width=t,r.height=e}return r};[ov,tr,ur,du,Kr,Nr,Ot,hv,Mr,mn,yv].forEach(function(t){Ie(Ge,t)});var Xb=[{name:"null",impl:_c},{name:"base",impl:rv},{name:"canvas",impl:_b}],$b=[{type:"layout",extensions:y0},{type:"renderer",extensions:Xb}],bv={},wv={};function Ev(t,e,r){var a=r,n=function(N){Ke("Can not register `"+e+"` for `"+t+"` since `"+N+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(rn.prototype[e])return n(e);rn.prototype[e]=r}else if(t==="collection"){if(xt.prototype[e])return n(e);xt.prototype[e]=r}else if(t==="layout"){for(var i=function(N){this.options=N,r.call(this,N),_e(this._private)||(this._private={}),this._private.cy=N.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var f=r.prototype.stop;o.stop=function(){var x=this.options;if(x&&x.animate){var N=this.animations;if(N)for(var O=0;O<N.length;O++)N[O].stop()}return f?f.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var h=function(N){return N._private.cy},v={addEventFields:function(N,O){O.layout=N,O.cy=h(N),O.target=N},bubble:function(){return!0},parent:function(N){return h(N)}};Ie(o,{createEmitter:function(){return this._private.emitter=new Ci(v,this),this},emitter:function(){return this._private.emitter},on:function(N,O){return this.emitter().on(N,O),this},one:function(N,O){return this.emitter().one(N,O),this},once:function(N,O){return this.emitter().one(N,O),this},removeListener:function(N,O){return this.emitter().removeListener(N,O),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(N,O){return this.emitter().emit(N,O),this}}),$e.eventAliasesOn(o),a=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var c=xv("renderer","base"),d=c.prototype,p=r,y=r.prototype,g=function(){c.apply(this,arguments),p.apply(this,arguments)},b=g.prototype;for(var m in d){var w=d[m],T=y[m]!=null;if(T)return n(m);b[m]=w}for(var D in y)b[D]=y[D];d.clientFunctions.forEach(function(x){b[x]=b[x]||function(){nt("Renderer does not implement `renderer."+x+"()` on its prototype")}}),a=g}else if(t==="__proto__"||t==="constructor"||t==="prototype")return nt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Vh({map:bv,keys:[t,e],value:a})}function xv(t,e){return Gh({map:bv,keys:[t,e]})}function Kb(t,e,r,a,n){return Vh({map:wv,keys:[t,e,r,a],value:n})}function Zb(t,e,r,a){return Gh({map:wv,keys:[t,e,r,a]})}var Us=function(){if(arguments.length===2)return xv.apply(null,arguments);if(arguments.length===3)return Ev.apply(null,arguments);if(arguments.length===4)return Zb.apply(null,arguments);if(arguments.length===5)return Kb.apply(null,arguments);nt("Invalid extension access syntax")};rn.prototype.extension=Us;$b.forEach(function(t){t.extensions.forEach(function(e){Ev(t.type,e.name,e.impl)})});var li=function(){if(!(this instanceof li))return new li;this.length=0},Xr=li.prototype;Xr.instanceString=function(){return"stylesheet"};Xr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Xr.css=function(t,e){var r=this.length-1;if(Me(t))this[r].properties.push({name:t,value:e});else if(_e(t))for(var a=t,n=Object.keys(a),i=0;i<n.length;i++){var o=n[i],s=a[o];if(s!=null){var u=bt.properties[o]||bt.properties[di(o)];if(u!=null){var l=u.name,f=s;this[r].properties.push({name:l,value:f})}}}return this};Xr.style=Xr.css;Xr.generateStyle=function(t){var e=new bt(t);return this.appendToStyle(e)};Xr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],a=r.selector,n=r.properties;t.selector(a);for(var i=0;i<n.length;i++){var o=n[i];t.css(o.name,o.value)}}return t};var Qb="3.34.0",Sr=function(e){if(e===void 0&&(e={}),_e(e))return new rn(e);if(Me(e))return Us.apply(Us,arguments)};Sr.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Sr),t.apply(null,e),this};Sr.warnings=function(t){return Xh(t)};Sr.version=Qb;Sr.stylesheet=Sr.Stylesheet=li;/*!
332
332
  * cytoscape-dagre 3.0.0
333
333
  * https://github.com/cytoscape/cytoscape.js-dagre
334
334
  * License: MIT
335
335
  */function nh(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 Jb(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=jb(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 Hs(t){"@babel/helpers - typeof";return Hs=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},Hs(t)}function jb(t,e){if(t){if(typeof t=="string")return nh(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)?nh(t,e):void 0}}var ew={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(){}},tw=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},Tv=Object.defineProperty,rw=(t,e,r)=>e in t?Tv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,aw=(t,e)=>{for(var r in e)Tv(t,r,{get:e[r],enumerable:!0})},nw=(t,e,r)=>rw(t,e+"",r),Cv={};aw(Cv,{Graph:()=>Ut,alg:()=>pu,json:()=>Dv,version:()=>sw});var iw=Object.defineProperty,Sv=(t,e)=>{for(var r in e)iw(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=qa(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=ow(this._isDirected,n,i,o);return n=f.v,i=f.w,Object.freeze(f),this._edgeObjs[l]=f,ih(this._preds[i],n),ih(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?vs(this._isDirected,t):qa(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?vs(this._isDirected,t):qa(this._isDirected,t,e,r))in this._edgeLabels}removeEdge(t,e,r){let a=arguments.length===1?vs(this._isDirected,t):qa(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],oh(this._preds[o],i),oh(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 ih(t,e){t[e]?t[e]++:t[e]=1}function oh(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function qa(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 ow(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 vs(t,e){return qa(t,e.v,e.w,e.name)}var sw="4.0.1",Dv={};Sv(Dv,{read:()=>hw,write:()=>uw});function uw(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:lw(t),edges:fw(t)},r=t.graph();return r!==void 0&&(e.value=structuredClone(r)),e}function lw(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 fw(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 hw(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 pu={};Sv(pu,{CycleException:()=>hi,bellmanFord:()=>Av,components:()=>dw,dijkstra:()=>fi,dijkstraAll:()=>yw,findCycles:()=>mw,floydWarshall:()=>ww,isAcyclic:()=>xw,postorder:()=>Cw,preorder:()=>Sw,prim:()=>Dw,shortestPaths:()=>Aw,tarjan:()=>Nv,topsort:()=>Mv});var cw=()=>1;function Av(t,e,r,a){return vw(t,String(e),r||cw,a||function(n){return t.outEdges(n)})}function vw(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 dw(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 Lv=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}},gw=()=>1;function fi(t,e,r,a){let n=function(i){return t.outEdges(i)};return pw(t,String(e),r||gw,a||n)}function pw(t,e,r,a){let n={},i=new Lv,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 yw(t,e,r){return t.nodes().reduce(function(a,n){return a[n]=fi(t,n,e,r),a},{})}function Nv(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 mw(t){return Nv(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}var bw=()=>1;function ww(t,e,r){return Ew(t,e||bw,r||function(a){return t.outEdges(a)})}function Ew(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 hi=class extends Error{constructor(...t){super(...t)}};function Mv(t){let e={},r={},a=[];function n(i){if(i in r)throw new hi;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 hi;return a}function xw(t){try{Mv(t)}catch(e){if(e instanceof hi)return!1;throw e}return!0}function Tw(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=Rv(t,s,r==="post",o,i,a,n)}),n}function Rv(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=Rv(t,s,r,a,n,i,o)}),r&&(o=i(o,e))),o}function Ov(t,e,r){return Tw(t,e,r,function(a,n){return a.push(n),a},[])}function Cw(t,e){return Ov(t,e,"post")}function Sw(t,e){return Ov(t,e,"pre")}function Dw(t,e){let r=new Ut,a={},n=new Lv,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 Aw(t,e,r,a){return Lw(t,e,r,a??(n=>{let i=t.outEdges(n);return i??[]}))}function Lw(t,e,r,a){if(r===void 0)return fi(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 Av(t,e,r,a)}return fi(t,e,r,a)}function Na(t,e,r,a){let n=a;for(;t.hasNode(n);)n=yu(a);return r.dummy=e,t.setNode(n,r),n}function Nw(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 Pv(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 sh(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 bn(t){let e=nn(kv(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 Mw(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 Rw(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 uh(t,e,r,a){let n={width:0,height:0};return arguments.length>=4&&(n.rank=r,n.order=a),Na(t,"border",n,e)}function Ow(t,e=Iv){let r=[];for(let a=0;a<t.length;a+=e){let n=t.slice(a,a+e);r.push(n)}return r}var Iv=65535;function Jt(t,e){if(e.length>Iv){let r=Ow(e);return t(...r.map(a=>t(...a)))}else return t(...e)}function kv(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 Pw(t,e){let r={lhs:[],rhs:[]};return t.forEach(a=>{e(a)?r.lhs.push(a):r.rhs.push(a)}),r}function Bv(t,e){let r=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-r)+"ms")}}function Fv(t,e){return e()}var Iw=0;function yu(t){let e=++Iw;return t+(""+e)}function nn(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 ci(t,e){let r={};for(let a of e)t[a]!==void 0&&(r[a]=t[a]);return r}function Oi(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 kw(t,e){return t.reduce((r,a,n)=>(r[a]=e[n],r),{})}var Pi="\0",Bw="3.0.0",Fw=class{constructor(){nw(this,"_sentinel");let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return lh(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&lh(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,zw)),r=r._prev;return"["+t.join(", ")+"]"}};function lh(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function zw(t,e){if(t!=="_next"&&t!=="_prev")return e}var Vw=Fw,Gw=()=>1;function Uw(t,e){if(t.nodeCount()<=1)return[];let r=Yw(t,e||Gw);return Hw(r.graph,r.buckets,r.zeroIdx).flatMap(a=>t.outEdges(a.v,a.w)||[])}function Hw(t,e,r){var a;let n=[],i=e[e.length-1],o=e[0],s;for(;t.nodeCount();){for(;s=o.dequeue();)ds(t,e,r,s);for(;s=i.dequeue();)ds(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(ds(t,e,r,s,!0)||[]);break}}}return n}function ds(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,Ys(e,r,l)}),(t.outEdges(a.v)||[]).forEach(s=>{let u=t.edge(s),l=s.w,f=t.node(l);f.in-=u,Ys(e,r,f)}),t.removeNode(a.v),o}function Yw(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=qw(n+a+3).map(()=>new Vw),o=a+1;return r.nodes().forEach(s=>{Ys(i,o,r.node(s))}),{graph:r,buckets:i,zeroIdx:o}}function Ys(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 qw(t){let e=[];for(let r=0;r<t;r++)e.push(r);return e}function _w(t){(t.graph().acyclicer==="greedy"?Uw(t,e(t)):Ww(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,yu("rev"))});function e(r){return a=>r.edge(a).weight}}function Ww(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 Xw(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 $w(t){t.graph().dummyChains=[],t.edges().forEach(e=>Kw(t,e))}function Kw(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=Na(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 Zw(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 mu(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 Ea(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var zv=Qw;function Qw(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(;Jw(e,t)<n&&(i=jw(e,t),!!i);)o=e.hasNode(i.v)?Ea(t,i):-Ea(t,i),eE(e,t,o);return e}function Jw(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)&&!Ea(e,i)&&(t.setNode(s,{}),t.setEdge(a,s,{}),r(s))})}return t.nodes().forEach(r),t.nodeCount()}function jw(t,e){return e.edges().reduce((r,a)=>{let n=Number.POSITIVE_INFINITY;return t.hasNode(a.v)!==t.hasNode(a.w)&&(n=Ea(e,a)),n<r[0]?[n,a]:r},[Number.POSITIVE_INFINITY,null])[1]}function eE(t,e,r){t.nodes().forEach(a=>e.node(a).rank+=r)}var{preorder:tE,postorder:rE}=pu,aE=Kr;Kr.initLowLimValues=wu;Kr.initCutValues=bu;Kr.calcCutValue=Vv;Kr.leaveEdge=Uv;Kr.enterEdge=Hv;Kr.exchangeEdges=Yv;function Kr(t){t=Nw(t),mu(t);let e=zv(t);wu(e),bu(e,t);let r,a;for(;r=Uv(e);)a=Hv(e,t,r),Yv(e,t,r,a)}function bu(t,e){let r=rE(t,t.nodes());r=r.slice(0,r.length-1),r.forEach(a=>nE(t,e,a))}function nE(t,e,r){let a=t.node(r).parent,n=t.edge(r,a);n.cutvalue=Vv(t,e,r)}function Vv(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,oE(t,r,f)){let c=t.edge(r,f).cutvalue;o+=h?-c:c}}}),o}function wu(t,e){arguments.length<2&&(e=t.nodes()[0]),Gv(t,{},1,e)}function Gv(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=Gv(t,e,r,u,a))}),o.low=i,o.lim=r++,n?o.parent=n:delete o.parent,r}function Uv(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function Hv(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===fh(t,t.node(l.v),s)&&u!==fh(t,t.node(l.w),s)).reduce((l,f)=>Ea(e,f)<Ea(e,l)?f:l)}function Yv(t,e,r,a){let n=r.v,i=r.w;t.removeEdge(n,i),t.setEdge(a.v,a.w,{}),wu(t),bu(t,e),iE(t,e)}function iE(t,e){let r=t.nodes().find(n=>!t.node(n).parent);if(!r)return;let a=tE(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 oE(t,e,r){return t.hasEdge(e,r)}function fh(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}var sE=uE;function uE(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":hh(t);break;case"tight-tree":fE(t);break;case"longest-path":lE(t);break;case"none":break;default:hh(t)}}var lE=mu;function fE(t){mu(t),zv(t)}function hh(t){aE(t)}var hE=cE;function cE(t){let e=dE(t);t.graph().dummyChains.forEach(r=>{let a=t.node(r),n=a.edgeObj,i=vE(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 vE(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 dE(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(Pi).forEach(a),e}function gE(t){let e=Na(t,"root",{},"_root"),r=pE(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=yE(t)+1;t.children(Pi).forEach(s=>qv(t,e,i,o,n,r,s)),t.graph().nodeRankFactor=i}function qv(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=uh(t,"_bt"),f=uh(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;qv(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 pE(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(Pi).forEach(a=>r(a,1)),e}function yE(t){return t.edges().reduce((e,r)=>e+t.edge(r).weight,0)}function mE(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(r=>{t.edge(r).nestingEdge&&t.removeEdge(r)})}var bE=wE;function wE(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)ch(t,"borderLeft","_bl",r,n,i),ch(t,"borderRight","_br",r,n,i)}}t.children(Pi).forEach(e)}function ch(t,e,r,a,n,i){let o={width:0,height:0,rank:i,borderType:e},s=n[e][i-1],u=Na(t,"border",o,r);n[e][i]=u,t.setParent(u,a),s&&t.setEdge(s,u,{weight:1})}function EE(t){var e;let r=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(r==="lr"||r==="rl")&&_v(t)}function xE(t){var e;let r=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(r==="bt"||r==="rl")&&TE(t),(r==="lr"||r==="rl")&&(CE(t),_v(t))}function _v(t){t.nodes().forEach(e=>vh(t.node(e))),t.edges().forEach(e=>vh(t.edge(e)))}function vh(t){let e=t.width;t.width=t.height,t.height=e}function TE(t){t.nodes().forEach(e=>gs(t.node(e))),t.edges().forEach(e=>{var r;let a=t.edge(e);(r=a.points)==null||r.forEach(gs),Object.hasOwn(a,"y")&&gs(a)})}function gs(t){t.y=-t.y}function CE(t){t.nodes().forEach(e=>ps(t.node(e))),t.edges().forEach(e=>{var r;let a=t.edge(e);(r=a.points)==null||r.forEach(ps),Object.hasOwn(a,"x")&&ps(a)})}function ps(t){let e=t.x;t.x=t.y,t.y=e}function SE(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=nn(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 DE(t,e){let r=0;for(let a=1;a<e.length;++a)r+=AE(t,e[a-1],e[a]);return r}function AE(t,e,r){let a=kw(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 LE(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 NE(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 ME(a)}function ME(t){let e=[];function r(n){return i=>{i.merged||(i.barycenter===void 0||n.barycenter===void 0||i.barycenter>=n.barycenter)&&RE(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=>ci(n,["vs","i","barycenter","weight"]))}function RE(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 OE(t,e){let r=Pw(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(PE(!!e)),u=dh(i,n,u),a.forEach(f=>{u+=f.vs.length,i.push(f.vs),o+=f.barycenter*f.weight,s+=f.weight,u=dh(i,n,u)});let l={vs:i.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function dh(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 PE(t){return(e,r)=>e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}function Wv(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=LE(t,n);l.forEach(v=>{if(t.children(v.v).length){let c=Wv(t,v.v,r,a);u[v.v]=c,Object.hasOwn(c,"barycenter")&&kE(v,c)}});let f=NE(l,r);IE(f,u);let h=OE(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 IE(t,e){t.forEach(r=>{r.vs=r.vs.flatMap(a=>e[a]?e[a].vs:a)})}function kE(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 BE(t,e,r,a){a||(a=t.nodes());let n=FE(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 FE(t){let e;for(;t.hasNode(e=yu("_root")););return e}function zE(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 Xv(t,e={}){if(typeof e.customOrder=="function"){e.customOrder(t,Xv);return}let r=kv(t),a=gh(t,nn(1,r+1),"inEdges"),n=gh(t,nn(r-1,-1,-1),"outEdges"),i=SE(t);if(ph(t,i),e.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,s,u=e.constraints||[];for(let l=0,f=0;f<4;++l,++f){VE(l%2?a:n,l%4>=2,u),i=bn(t);let h=DE(t,i);h<o?(f=0,s=Object.assign({},i),o=h):h===o&&(s=structuredClone(i))}ph(t,s)}function gh(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 BE(t,i,r,a.get(i)||[])})}function VE(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=Wv(n,i,a,e);o.vs.forEach((s,u)=>n.node(s).order=u),zE(n,a,o.vs)})}function ph(t,e){Object.values(e).forEach(r=>r.forEach((a,n)=>t.node(a).order=n))}function GE(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=HE(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)&&$v(r,y,d)})}),s=h+1,o=c)}),i}return e.length&&e.reduce(a),r}function UE(t,e){let r={};function a(i,o,s,u,l){nn(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)&&$v(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 HE(t,e){if(t.node(e).dummy){let r=t.predecessors(e);if(r)return r.find(a=>t.node(a).dummy)}}function $v(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 YE(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 qE(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&&!YE(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=WE(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 WE(t,e,r,a){let n=new Ut,i=t.graph(),o=QE(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 XE(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=JE(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 $E(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]=Oi(u,h=>h+f))})})}function KE(t,e=void 0){let r=t.ul;return r?Oi(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 ZE(t){let e=bn(t),r=Object.assign(GE(t,e),UE(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=qE(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=Oi(l,f=>-f)),a[o+s]=l})});let i=XE(t,a);return $E(a,i),KE(a,t.graph().align)}function QE(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 JE(t,e){return t.node(e).width}function jE(t){t=Pv(t),e1(t),Object.entries(ZE(t)).forEach(([e,r])=>t.node(e).x=r)}function e1(t){let e=bn(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 t1(t,e={}){let r=e.debugTiming?Bv:Fv;return r("layout",()=>{let a=r(" buildLayoutGraph",()=>h1(t));return r(" runLayout",()=>r1(a,r,e)),r(" updateInputGraph",()=>a1(t,a)),a})}function r1(t,e,r){e(" makeSpaceForEdgeLabels",()=>c1(t)),e(" removeSelfEdges",()=>E1(t)),e(" acyclic",()=>_w(t)),e(" nestingGraph.run",()=>gE(t)),e(" rank",()=>sE(Pv(t))),e(" injectEdgeLabelProxies",()=>v1(t)),e(" removeEmptyRanks",()=>Rw(t)),e(" nestingGraph.cleanup",()=>mE(t)),e(" normalizeRanks",()=>Mw(t)),e(" assignRankMinMax",()=>d1(t)),e(" removeEdgeLabelProxies",()=>g1(t)),e(" normalize.run",()=>$w(t)),e(" parentDummyChains",()=>hE(t)),e(" addBorderSegments",()=>bE(t)),e(" order",()=>Xv(t,r)),e(" insertSelfEdges",()=>x1(t)),e(" adjustCoordinateSystem",()=>EE(t)),e(" position",()=>jE(t)),e(" positionSelfEdges",()=>T1(t)),e(" removeBorderNodes",()=>w1(t)),e(" normalize.undo",()=>Zw(t)),e(" fixupEdgeLabelCoords",()=>m1(t)),e(" undoCoordinateSystem",()=>xE(t)),e(" translateGraph",()=>p1(t)),e(" assignNodeIntersects",()=>y1(t)),e(" reversePoints",()=>b1(t)),e(" acyclic.undo",()=>Xw(t))}function a1(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 n1=["nodesep","edgesep","ranksep","marginx","marginy"],i1={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},o1=["acyclicer","ranker","rankdir","align","rankalign"],s1=["width","height","rank"],yh={width:0,height:0},u1=["minlen","weight","width","height","labeloffset"],l1={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},f1=["labelpos"];function h1(t){let e=new Ut({multigraph:!0,compound:!0}),r=ms(t.graph());return e.setGraph(Object.assign({},i1,ys(r,n1),ci(r,o1))),t.nodes().forEach(a=>{let n=ms(t.node(a)),i=ys(n,s1);Object.keys(yh).forEach(s=>{i[s]===void 0&&(i[s]=yh[s])}),e.setNode(a,i);let o=t.parent(a);o!==void 0&&e.setParent(a,o)}),t.edges().forEach(a=>{let n=ms(t.edge(a));e.setEdge(a,Object.assign({},l1,ys(n,u1),ci(n,f1)))}),e}function c1(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 v1(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};Na(t,"edge-proxy",n,"_ep")}})}function d1(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 g1(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 p1(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 y1(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(sh(a,i)),r.points.push(sh(n,o))})}function m1(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 b1(t){t.edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}function w1(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 E1(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 x1(t){bn(t).forEach(e=>{let r=0;e.forEach((a,n)=>{let i=t.node(a);i.order=n+r,(i.selfEdges||[]).forEach(o=>{Na(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 T1(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 ys(t,e){return Oi(ci(t,e),Number)}function ms(t){let e={};return t&&Object.entries(t).forEach(([r,a])=>{typeof r=="string"&&(r=r.toLowerCase()),e[r]=a}),e}function C1(t){let e=bn(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 S1={graphlib:Cv,version:Bw,layout:t1,debug:C1,util:{time:Bv,notime:Fv}},mh=S1;/*! For license information please see dagre.esm.js.LEGAL.txt */var bs=function(e){return typeof e=="function"},ws=.001;function Kv(t){this.options=tw({},ew,t)}function Zv(t,e){return{x:xa(t.x-e.x),y:xa(t.y-e.y)}}function bh(t,e){return xa(t.x*e.x)+xa(t.y*e.y)}function D1(t){var e=Math.hypot(t.x,t.y)||1;return{x:t.x/e,y:t.y/e,len:e}}function A1(t){return{x:-t.y,y:t.x}}function L1(t,e){var r=Zv(e,t),a=D1(r),n=a.x,i=a.y,o=a.len,s={x:n,y:i},u=A1(s);return{src:t,tgt:e,dir:s,normal:u,len:o}}function xa(t){return Math.abs(t)<ws?t<0?-ws:ws:t}function N1(t,e){var r=Zv(t,e.src),a=xa(bh(r,e.dir)/e.len),n=xa(bh(r,e.normal));return{weight:a,distance:n}}function M1(t){var e=1/0,r=-1/0,a=Jb(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 R1(t,e){var r=e.source().position(),a=e.target().position(),n=L1(r,a),i=M1(t.points.map(function(l){return N1(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}Kv.prototype.run=function(){var t=this.options,e=this,r=t.cy,a=t.eles,n=function(O,R){return bs(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 mh.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();bs(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()});bs(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())}mh.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=Hs(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(R1(R,O))})),this};var Qv=function(e){e&&e("layout","dagre",Kv)};typeof window<"u"&&typeof window.cytoscape<"u"&&Qv(window.cytoscape);var Eu={exports:{}},$n={exports:{}},Kn={exports:{}},O1=Kn.exports,wh;function P1(){return wh||(wh=1,(function(t,e){(function(a,n){t.exports=n()})(O1,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})])})})(Kn)),Kn.exports}var I1=$n.exports,Eh;function k1(){return Eh||(Eh=1,(function(t,e){(function(a,n){t.exports=n(P1())})(I1,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,wn=void 0;try{for(var Ma=Ft.keys()[Symbol.iterator](),En;!(lr=(En=Ma.next()).done);lr=!0){var Ra=En.value;Rr(Ra)}}catch(ht){fr=!0,wn=ht}finally{try{!lr&&Ma.return&&Ma.return()}finally{if(fr)throw wn}}var Ii=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,Zr=!1,Or=void 0;try{for(var Qr=ut.keys()[Symbol.iterator](),Oa;!(rr=(Oa=Qr.next()).done);rr=!0){var Ra=Oa.value;Ii(Ra)}}catch(ht){Zr=!0,Or=ht}finally{try{!rr&&Qr.return&&Qr.return()}finally{if(Zr)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})()})})($n)),$n.exports}var B1=Eu.exports;(function(t,e){(function(a,n){t.exports=n(k1())})(B1,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})()})})(Eu);var F1=Eu.exports;const z1=yd(F1);function Vr(t,e){return{selector:t,style:fd(e)}}function xh(t){Sr.use(t)}function V1(t){return t.target.id()}let G1={targetId:V1},Th={contents:!1};function U1(){if(!Th.contents)return Th.contents=!0,xh(Qv),xh(z1)}function Bn(t,e,r){let a=getComputedStyle(t).getPropertyValue(e).trim();return a===""?r:a}let Ch=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function Jv(t){return"grp-"+t.replace(/[^a-zA-Z0-9_-]+/g,"-")}function xu(t,e){return t+"-"+e.replace(/[^a-zA-Z0-9_-]+/g,"-")}function Sh(t){return on(t,e=>e).join(" ")}function qs(t,e){return xu(t,e.bg+"-"+e.border+"-"+e.fg+"-"+(ga(e.emphasis,!1)?"b":"n")+(ga(e.dashed,!1)?"d":"s"))}function Dh(t,e){let r=t.map(i=>i.id),a=t.map(i=>({data:{id:i.id,label:i.label},classes:Sh([xn(i.group,Jv),xn(i.accent,o=>xu("fill",o)),xn(i.chip,o=>qs("nchip",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},classes:Sh([xn(i.chip,s=>qs("echip",s))])}));return a.concat(n)}function H1(t){return vi(on(t,e=>e),[],(e,r)=>e.includes(r)?e:e.concat([r]))}function Ah(t,e){return vi(on(e,r=>r),[],(r,a)=>{let n=qs(t,a);return r.some(i=>i[0]===n)?r:r.concat([[n,a]])})}function Y1(t){let e=t[1];return Vr("."+t[0],[["shape","round-rectangle"],["corner-radius","14"],["background-color",e.bg],["background-opacity","1"],["border-color",e.border],["border-width",ga(e.emphasis,!1)?"3":"1.5"],["border-style",ga(e.dashed,!1)?"dashed":"solid"],["width","label"],["height","label"],["padding","10px"],["label","data(label)"],["color",e.fg],["font-size","12px"],["font-weight","500"],["text-valign","center"],["text-halign","center"],["text-margin-x","0"],["text-wrap","wrap"],["text-max-width","180"],["min-zoomed-font-size","7"]])}function q1(t){let e=t[1];return Vr("."+t[0],[["line-color",e.border],["target-arrow-color",e.border],["width","1.5"],["label","data(label)"],["color",e.fg],["font-size","11px"],["font-weight","500"],["text-rotation","autorotate"],["text-background-color",e.bg],["text-background-opacity","1"],["text-background-padding","4"],["text-background-shape","roundrectangle"],["text-border-color",e.border],["text-border-width","1"],["text-border-opacity","1"],["min-zoomed-font-size","7"]])}function Es(t,e,r){let a=md(e),n=Bn(t,Gr.brand,"#3b6ea5"),i=Bn(t,Gr.textPrimary,"#1a1a1a"),o=Bn(t,Gr.border,"#d4d4d4"),s=Bn(t,Gr.surface,"#ffffff"),u=d=>d===0?n:Ch[vd(d-1|0,Ch.length)],l=[Vr("node",[["background-color",n],["border-width","2"],["border-color",s],["width","18"],["height","18"],["label","data(label)"],["color",i],["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"]]),Vr("node:parent",[["background-color",o],["background-opacity","0.12"],["border-width","1"],["border-color",o],["text-valign","top"],["text-halign","center"],["font-size","12px"],["color",i],["padding","12"]]),Vr("edge",[["width","1.5"],["line-color",o],["target-arrow-color",o],["target-arrow-shape","triangle"],["arrow-scale","0.9"],["curve-style","bezier"]])],f=a.map((d,p)=>Vr("."+Jv(d),[["background-color",u(p)]])),h=H1(e.map(d=>d.accent)).map(d=>Vr("."+xu("fill",d),[["background-color",d]])),v=Ah("nchip",e.map(d=>d.chip)).map(Y1),c=Ah("echip",r.map(d=>d.chip)).map(q1);return[l,f,h,v,c].flat()}function Lh(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"dagre-lr":return{name:"dagre",fit:!0,padding:24,animate:!1,nodeDimensionsIncludeLabels:!0,rankDir:"LR",nodeSep:48,rankSep:130};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 da(t){return"var("+t+")"}function _1(t){return{background:da(Gr.surface),border:"1px solid "+da(Gr.border),height:t,overflow:"hidden",width:"100%",borderRadius:da(dd.md)}}let W1={color:da(Gr.textSecondary),fontSize:da(pd.sizeSm),padding:da(gd.lg)};function X1(t,e){return t.map(r=>r.id+"|"+r.label+"|"+ga(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=Pa(null),l=Pa(void 0),f=Pa(a);f.current=a;let h=Pa([i,n]);h.current=[i,n];let v=hd(),c=X1(i,n),d=Pa(!0);return ki(()=>{let p=u.current;if(p==null)return;U1();let y=Sr({container:p,elements:Dh(i,n),style:Es(p,i,n),layout:Lh(o),minZoom:.2,maxZoom:3});y.on("tap","node",b=>cd(f.current,m=>m(G1.targetId(b)))),l.current=Su(y);let g=new ResizeObserver(()=>{y.resize(),y.fit(24)});return g.observe(p),()=>{l.current=void 0,g.disconnect(),y.destroy()}},[]),ki(()=>{if(d.current)d.current=!1;else{let p=l.current,y=u.current;if(p!==void 0&&y!=null){let g=Du(p),b=h.current,m=b[1],w=b[0];g.remove(g.elements()),g.add(Dh(w,m)),g.style(Es(y,w,m)),g.layout(Lh(o)).run()}}},[c,o]),ki(()=>{let p=l.current,y=u.current;if(p!==void 0&&y!=null){let g=h.current;Du(p).style(Es(y,g[0],g[1]))}},[v.preset]),i.length===0?Au("div",{children:"No relationships to graph.",style:W1}):Au("div",{ref:Su(u),style:_1(s)})}let rx=$1;export{tx as b,ex as g,rx as m};
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 Hs(t){"@babel/helpers - typeof";return Hs=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},Hs(t)}function jb(t,e){if(t){if(typeof t=="string")return nh(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)?nh(t,e):void 0}}var ew={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(){}},tw=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},Tv=Object.defineProperty,rw=(t,e,r)=>e in t?Tv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,aw=(t,e)=>{for(var r in e)Tv(t,r,{get:e[r],enumerable:!0})},nw=(t,e,r)=>rw(t,e+"",r),Cv={};aw(Cv,{Graph:()=>Ut,alg:()=>pu,json:()=>Dv,version:()=>sw});var iw=Object.defineProperty,Sv=(t,e)=>{for(var r in e)iw(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=qa(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=ow(this._isDirected,n,i,o);return n=f.v,i=f.w,Object.freeze(f),this._edgeObjs[l]=f,ih(this._preds[i],n),ih(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?vs(this._isDirected,t):qa(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?vs(this._isDirected,t):qa(this._isDirected,t,e,r))in this._edgeLabels}removeEdge(t,e,r){let a=arguments.length===1?vs(this._isDirected,t):qa(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],oh(this._preds[o],i),oh(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 ih(t,e){t[e]?t[e]++:t[e]=1}function oh(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function qa(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 ow(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 vs(t,e){return qa(t,e.v,e.w,e.name)}var sw="4.0.1",Dv={};Sv(Dv,{read:()=>hw,write:()=>uw});function uw(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:lw(t),edges:fw(t)},r=t.graph();return r!==void 0&&(e.value=structuredClone(r)),e}function lw(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 fw(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 hw(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 pu={};Sv(pu,{CycleException:()=>hi,bellmanFord:()=>Av,components:()=>dw,dijkstra:()=>fi,dijkstraAll:()=>yw,findCycles:()=>mw,floydWarshall:()=>ww,isAcyclic:()=>xw,postorder:()=>Cw,preorder:()=>Sw,prim:()=>Dw,shortestPaths:()=>Aw,tarjan:()=>Nv,topsort:()=>Mv});var cw=()=>1;function Av(t,e,r,a){return vw(t,String(e),r||cw,a||function(n){return t.outEdges(n)})}function vw(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 dw(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 Lv=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}},gw=()=>1;function fi(t,e,r,a){let n=function(i){return t.outEdges(i)};return pw(t,String(e),r||gw,a||n)}function pw(t,e,r,a){let n={},i=new Lv,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 yw(t,e,r){return t.nodes().reduce(function(a,n){return a[n]=fi(t,n,e,r),a},{})}function Nv(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 mw(t){return Nv(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}var bw=()=>1;function ww(t,e,r){return Ew(t,e||bw,r||function(a){return t.outEdges(a)})}function Ew(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 hi=class extends Error{constructor(...t){super(...t)}};function Mv(t){let e={},r={},a=[];function n(i){if(i in r)throw new hi;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 hi;return a}function xw(t){try{Mv(t)}catch(e){if(e instanceof hi)return!1;throw e}return!0}function Tw(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=Rv(t,s,r==="post",o,i,a,n)}),n}function Rv(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=Rv(t,s,r,a,n,i,o)}),r&&(o=i(o,e))),o}function Ov(t,e,r){return Tw(t,e,r,function(a,n){return a.push(n),a},[])}function Cw(t,e){return Ov(t,e,"post")}function Sw(t,e){return Ov(t,e,"pre")}function Dw(t,e){let r=new Ut,a={},n=new Lv,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 Aw(t,e,r,a){return Lw(t,e,r,a??(n=>{let i=t.outEdges(n);return i??[]}))}function Lw(t,e,r,a){if(r===void 0)return fi(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 Av(t,e,r,a)}return fi(t,e,r,a)}function Na(t,e,r,a){let n=a;for(;t.hasNode(n);)n=yu(a);return r.dummy=e,t.setNode(n,r),n}function Nw(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 Pv(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 sh(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 bn(t){let e=nn(kv(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 Mw(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 Rw(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 uh(t,e,r,a){let n={width:0,height:0};return arguments.length>=4&&(n.rank=r,n.order=a),Na(t,"border",n,e)}function Ow(t,e=Iv){let r=[];for(let a=0;a<t.length;a+=e){let n=t.slice(a,a+e);r.push(n)}return r}var Iv=65535;function Jt(t,e){if(e.length>Iv){let r=Ow(e);return t(...r.map(a=>t(...a)))}else return t(...e)}function kv(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 Pw(t,e){let r={lhs:[],rhs:[]};return t.forEach(a=>{e(a)?r.lhs.push(a):r.rhs.push(a)}),r}function Bv(t,e){let r=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-r)+"ms")}}function Fv(t,e){return e()}var Iw=0;function yu(t){let e=++Iw;return t+(""+e)}function nn(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 ci(t,e){let r={};for(let a of e)t[a]!==void 0&&(r[a]=t[a]);return r}function Oi(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 kw(t,e){return t.reduce((r,a,n)=>(r[a]=e[n],r),{})}var Pi="\0",Bw="3.0.0",Fw=class{constructor(){nw(this,"_sentinel");let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return lh(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&lh(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,zw)),r=r._prev;return"["+t.join(", ")+"]"}};function lh(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function zw(t,e){if(t!=="_next"&&t!=="_prev")return e}var Vw=Fw,Gw=()=>1;function Uw(t,e){if(t.nodeCount()<=1)return[];let r=Yw(t,e||Gw);return Hw(r.graph,r.buckets,r.zeroIdx).flatMap(a=>t.outEdges(a.v,a.w)||[])}function Hw(t,e,r){var a;let n=[],i=e[e.length-1],o=e[0],s;for(;t.nodeCount();){for(;s=o.dequeue();)ds(t,e,r,s);for(;s=i.dequeue();)ds(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(ds(t,e,r,s,!0)||[]);break}}}return n}function ds(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,Ys(e,r,l)}),(t.outEdges(a.v)||[]).forEach(s=>{let u=t.edge(s),l=s.w,f=t.node(l);f.in-=u,Ys(e,r,f)}),t.removeNode(a.v),o}function Yw(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=qw(n+a+3).map(()=>new Vw),o=a+1;return r.nodes().forEach(s=>{Ys(i,o,r.node(s))}),{graph:r,buckets:i,zeroIdx:o}}function Ys(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 qw(t){let e=[];for(let r=0;r<t;r++)e.push(r);return e}function _w(t){(t.graph().acyclicer==="greedy"?Uw(t,e(t)):Ww(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,yu("rev"))});function e(r){return a=>r.edge(a).weight}}function Ww(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 Xw(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 $w(t){t.graph().dummyChains=[],t.edges().forEach(e=>Kw(t,e))}function Kw(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=Na(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 Zw(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 mu(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 Ea(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var zv=Qw;function Qw(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(;Jw(e,t)<n&&(i=jw(e,t),!!i);)o=e.hasNode(i.v)?Ea(t,i):-Ea(t,i),eE(e,t,o);return e}function Jw(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)&&!Ea(e,i)&&(t.setNode(s,{}),t.setEdge(a,s,{}),r(s))})}return t.nodes().forEach(r),t.nodeCount()}function jw(t,e){return e.edges().reduce((r,a)=>{let n=Number.POSITIVE_INFINITY;return t.hasNode(a.v)!==t.hasNode(a.w)&&(n=Ea(e,a)),n<r[0]?[n,a]:r},[Number.POSITIVE_INFINITY,null])[1]}function eE(t,e,r){t.nodes().forEach(a=>e.node(a).rank+=r)}var{preorder:tE,postorder:rE}=pu,aE=Zr;Zr.initLowLimValues=wu;Zr.initCutValues=bu;Zr.calcCutValue=Vv;Zr.leaveEdge=Uv;Zr.enterEdge=Hv;Zr.exchangeEdges=Yv;function Zr(t){t=Nw(t),mu(t);let e=zv(t);wu(e),bu(e,t);let r,a;for(;r=Uv(e);)a=Hv(e,t,r),Yv(e,t,r,a)}function bu(t,e){let r=rE(t,t.nodes());r=r.slice(0,r.length-1),r.forEach(a=>nE(t,e,a))}function nE(t,e,r){let a=t.node(r).parent,n=t.edge(r,a);n.cutvalue=Vv(t,e,r)}function Vv(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,oE(t,r,f)){let c=t.edge(r,f).cutvalue;o+=h?-c:c}}}),o}function wu(t,e){arguments.length<2&&(e=t.nodes()[0]),Gv(t,{},1,e)}function Gv(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=Gv(t,e,r,u,a))}),o.low=i,o.lim=r++,n?o.parent=n:delete o.parent,r}function Uv(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function Hv(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===fh(t,t.node(l.v),s)&&u!==fh(t,t.node(l.w),s)).reduce((l,f)=>Ea(e,f)<Ea(e,l)?f:l)}function Yv(t,e,r,a){let n=r.v,i=r.w;t.removeEdge(n,i),t.setEdge(a.v,a.w,{}),wu(t),bu(t,e),iE(t,e)}function iE(t,e){let r=t.nodes().find(n=>!t.node(n).parent);if(!r)return;let a=tE(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 oE(t,e,r){return t.hasEdge(e,r)}function fh(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}var sE=uE;function uE(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":hh(t);break;case"tight-tree":fE(t);break;case"longest-path":lE(t);break;case"none":break;default:hh(t)}}var lE=mu;function fE(t){mu(t),zv(t)}function hh(t){aE(t)}var hE=cE;function cE(t){let e=dE(t);t.graph().dummyChains.forEach(r=>{let a=t.node(r),n=a.edgeObj,i=vE(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 vE(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 dE(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(Pi).forEach(a),e}function gE(t){let e=Na(t,"root",{},"_root"),r=pE(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=yE(t)+1;t.children(Pi).forEach(s=>qv(t,e,i,o,n,r,s)),t.graph().nodeRankFactor=i}function qv(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=uh(t,"_bt"),f=uh(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;qv(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 pE(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(Pi).forEach(a=>r(a,1)),e}function yE(t){return t.edges().reduce((e,r)=>e+t.edge(r).weight,0)}function mE(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(r=>{t.edge(r).nestingEdge&&t.removeEdge(r)})}var bE=wE;function wE(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)ch(t,"borderLeft","_bl",r,n,i),ch(t,"borderRight","_br",r,n,i)}}t.children(Pi).forEach(e)}function ch(t,e,r,a,n,i){let o={width:0,height:0,rank:i,borderType:e},s=n[e][i-1],u=Na(t,"border",o,r);n[e][i]=u,t.setParent(u,a),s&&t.setEdge(s,u,{weight:1})}function EE(t){var e;let r=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(r==="lr"||r==="rl")&&_v(t)}function xE(t){var e;let r=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(r==="bt"||r==="rl")&&TE(t),(r==="lr"||r==="rl")&&(CE(t),_v(t))}function _v(t){t.nodes().forEach(e=>vh(t.node(e))),t.edges().forEach(e=>vh(t.edge(e)))}function vh(t){let e=t.width;t.width=t.height,t.height=e}function TE(t){t.nodes().forEach(e=>gs(t.node(e))),t.edges().forEach(e=>{var r;let a=t.edge(e);(r=a.points)==null||r.forEach(gs),Object.hasOwn(a,"y")&&gs(a)})}function gs(t){t.y=-t.y}function CE(t){t.nodes().forEach(e=>ps(t.node(e))),t.edges().forEach(e=>{var r;let a=t.edge(e);(r=a.points)==null||r.forEach(ps),Object.hasOwn(a,"x")&&ps(a)})}function ps(t){let e=t.x;t.x=t.y,t.y=e}function SE(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=nn(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 DE(t,e){let r=0;for(let a=1;a<e.length;++a)r+=AE(t,e[a-1],e[a]);return r}function AE(t,e,r){let a=kw(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 LE(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 NE(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 ME(a)}function ME(t){let e=[];function r(n){return i=>{i.merged||(i.barycenter===void 0||n.barycenter===void 0||i.barycenter>=n.barycenter)&&RE(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=>ci(n,["vs","i","barycenter","weight"]))}function RE(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 OE(t,e){let r=Pw(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(PE(!!e)),u=dh(i,n,u),a.forEach(f=>{u+=f.vs.length,i.push(f.vs),o+=f.barycenter*f.weight,s+=f.weight,u=dh(i,n,u)});let l={vs:i.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function dh(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 PE(t){return(e,r)=>e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}function Wv(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=LE(t,n);l.forEach(v=>{if(t.children(v.v).length){let c=Wv(t,v.v,r,a);u[v.v]=c,Object.hasOwn(c,"barycenter")&&kE(v,c)}});let f=NE(l,r);IE(f,u);let h=OE(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 IE(t,e){t.forEach(r=>{r.vs=r.vs.flatMap(a=>e[a]?e[a].vs:a)})}function kE(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 BE(t,e,r,a){a||(a=t.nodes());let n=FE(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 FE(t){let e;for(;t.hasNode(e=yu("_root")););return e}function zE(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 Xv(t,e={}){if(typeof e.customOrder=="function"){e.customOrder(t,Xv);return}let r=kv(t),a=gh(t,nn(1,r+1),"inEdges"),n=gh(t,nn(r-1,-1,-1),"outEdges"),i=SE(t);if(ph(t,i),e.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,s,u=e.constraints||[];for(let l=0,f=0;f<4;++l,++f){VE(l%2?a:n,l%4>=2,u),i=bn(t);let h=DE(t,i);h<o?(f=0,s=Object.assign({},i),o=h):h===o&&(s=structuredClone(i))}ph(t,s)}function gh(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 BE(t,i,r,a.get(i)||[])})}function VE(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=Wv(n,i,a,e);o.vs.forEach((s,u)=>n.node(s).order=u),zE(n,a,o.vs)})}function ph(t,e){Object.values(e).forEach(r=>r.forEach((a,n)=>t.node(a).order=n))}function GE(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=HE(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)&&$v(r,y,d)})}),s=h+1,o=c)}),i}return e.length&&e.reduce(a),r}function UE(t,e){let r={};function a(i,o,s,u,l){nn(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)&&$v(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 HE(t,e){if(t.node(e).dummy){let r=t.predecessors(e);if(r)return r.find(a=>t.node(a).dummy)}}function $v(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 YE(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 qE(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&&!YE(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=WE(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 WE(t,e,r,a){let n=new Ut,i=t.graph(),o=QE(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 XE(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=JE(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 $E(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]=Oi(u,h=>h+f))})})}function KE(t,e=void 0){let r=t.ul;return r?Oi(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 ZE(t){let e=bn(t),r=Object.assign(GE(t,e),UE(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=qE(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=Oi(l,f=>-f)),a[o+s]=l})});let i=XE(t,a);return $E(a,i),KE(a,t.graph().align)}function QE(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 JE(t,e){return t.node(e).width}function jE(t){t=Pv(t),e1(t),Object.entries(ZE(t)).forEach(([e,r])=>t.node(e).x=r)}function e1(t){let e=bn(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 t1(t,e={}){let r=e.debugTiming?Bv:Fv;return r("layout",()=>{let a=r(" buildLayoutGraph",()=>h1(t));return r(" runLayout",()=>r1(a,r,e)),r(" updateInputGraph",()=>a1(t,a)),a})}function r1(t,e,r){e(" makeSpaceForEdgeLabels",()=>c1(t)),e(" removeSelfEdges",()=>E1(t)),e(" acyclic",()=>_w(t)),e(" nestingGraph.run",()=>gE(t)),e(" rank",()=>sE(Pv(t))),e(" injectEdgeLabelProxies",()=>v1(t)),e(" removeEmptyRanks",()=>Rw(t)),e(" nestingGraph.cleanup",()=>mE(t)),e(" normalizeRanks",()=>Mw(t)),e(" assignRankMinMax",()=>d1(t)),e(" removeEdgeLabelProxies",()=>g1(t)),e(" normalize.run",()=>$w(t)),e(" parentDummyChains",()=>hE(t)),e(" addBorderSegments",()=>bE(t)),e(" order",()=>Xv(t,r)),e(" insertSelfEdges",()=>x1(t)),e(" adjustCoordinateSystem",()=>EE(t)),e(" position",()=>jE(t)),e(" positionSelfEdges",()=>T1(t)),e(" removeBorderNodes",()=>w1(t)),e(" normalize.undo",()=>Zw(t)),e(" fixupEdgeLabelCoords",()=>m1(t)),e(" undoCoordinateSystem",()=>xE(t)),e(" translateGraph",()=>p1(t)),e(" assignNodeIntersects",()=>y1(t)),e(" reversePoints",()=>b1(t)),e(" acyclic.undo",()=>Xw(t))}function a1(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 n1=["nodesep","edgesep","ranksep","marginx","marginy"],i1={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},o1=["acyclicer","ranker","rankdir","align","rankalign"],s1=["width","height","rank"],yh={width:0,height:0},u1=["minlen","weight","width","height","labeloffset"],l1={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},f1=["labelpos"];function h1(t){let e=new Ut({multigraph:!0,compound:!0}),r=ms(t.graph());return e.setGraph(Object.assign({},i1,ys(r,n1),ci(r,o1))),t.nodes().forEach(a=>{let n=ms(t.node(a)),i=ys(n,s1);Object.keys(yh).forEach(s=>{i[s]===void 0&&(i[s]=yh[s])}),e.setNode(a,i);let o=t.parent(a);o!==void 0&&e.setParent(a,o)}),t.edges().forEach(a=>{let n=ms(t.edge(a));e.setEdge(a,Object.assign({},l1,ys(n,u1),ci(n,f1)))}),e}function c1(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 v1(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};Na(t,"edge-proxy",n,"_ep")}})}function d1(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 g1(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 p1(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 y1(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(sh(a,i)),r.points.push(sh(n,o))})}function m1(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 b1(t){t.edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}function w1(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 E1(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 x1(t){bn(t).forEach(e=>{let r=0;e.forEach((a,n)=>{let i=t.node(a);i.order=n+r,(i.selfEdges||[]).forEach(o=>{Na(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 T1(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 ys(t,e){return Oi(ci(t,e),Number)}function ms(t){let e={};return t&&Object.entries(t).forEach(([r,a])=>{typeof r=="string"&&(r=r.toLowerCase()),e[r]=a}),e}function C1(t){let e=bn(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 S1={graphlib:Cv,version:Bw,layout:t1,debug:C1,util:{time:Bv,notime:Fv}},mh=S1;/*! For license information please see dagre.esm.js.LEGAL.txt */var bs=function(e){return typeof e=="function"},ws=.001;function Kv(t){this.options=tw({},ew,t)}function Zv(t,e){return{x:xa(t.x-e.x),y:xa(t.y-e.y)}}function bh(t,e){return xa(t.x*e.x)+xa(t.y*e.y)}function D1(t){var e=Math.hypot(t.x,t.y)||1;return{x:t.x/e,y:t.y/e,len:e}}function A1(t){return{x:-t.y,y:t.x}}function L1(t,e){var r=Zv(e,t),a=D1(r),n=a.x,i=a.y,o=a.len,s={x:n,y:i},u=A1(s);return{src:t,tgt:e,dir:s,normal:u,len:o}}function xa(t){return Math.abs(t)<ws?t<0?-ws:ws:t}function N1(t,e){var r=Zv(t,e.src),a=xa(bh(r,e.dir)/e.len),n=xa(bh(r,e.normal));return{weight:a,distance:n}}function M1(t){var e=1/0,r=-1/0,a=Jb(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 R1(t,e){var r=e.source().position(),a=e.target().position(),n=L1(r,a),i=M1(t.points.map(function(l){return N1(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}Kv.prototype.run=function(){var t=this.options,e=this,r=t.cy,a=t.eles,n=function(O,R){return bs(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 mh.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();bs(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()});bs(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())}mh.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=Hs(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(R1(R,O))})),this};var Qv=function(e){e&&e("layout","dagre",Kv)};typeof window<"u"&&typeof window.cytoscape<"u"&&Qv(window.cytoscape);var Eu={exports:{}},$n={exports:{}},Kn={exports:{}},O1=Kn.exports,wh;function P1(){return wh||(wh=1,(function(t,e){(function(a,n){t.exports=n()})(O1,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})])})})(Kn)),Kn.exports}var I1=$n.exports,Eh;function k1(){return Eh||(Eh=1,(function(t,e){(function(a,n){t.exports=n(P1())})(I1,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,wn=void 0;try{for(var Ma=Ft.keys()[Symbol.iterator](),En;!(lr=(En=Ma.next()).done);lr=!0){var Ra=En.value;Rr(Ra)}}catch(ht){fr=!0,wn=ht}finally{try{!lr&&Ma.return&&Ma.return()}finally{if(fr)throw wn}}var Ii=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,Qr=!1,Or=void 0;try{for(var Jr=ut.keys()[Symbol.iterator](),Oa;!(rr=(Oa=Jr.next()).done);rr=!0){var Ra=Oa.value;Ii(Ra)}}catch(ht){Qr=!0,Or=ht}finally{try{!rr&&Jr.return&&Jr.return()}finally{if(Qr)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})()})})($n)),$n.exports}var B1=Eu.exports;(function(t,e){(function(a,n){t.exports=n(k1())})(B1,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})()})})(Eu);var F1=Eu.exports;const z1=yd(F1);function Vr(t,e){return{selector:t,style:fd(e)}}function xh(t){Sr.use(t)}function V1(t){return t.target.id()}let G1={targetId:V1},Th={contents:!1};function U1(){if(!Th.contents)return Th.contents=!0,xh(Qv),xh(z1)}function Bn(t,e,r){let a=getComputedStyle(t).getPropertyValue(e).trim();return a===""?r:a}let Ch=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function Jv(t){return"grp-"+t.replace(/[^a-zA-Z0-9_-]+/g,"-")}function xu(t,e){return t+"-"+e.replace(/[^a-zA-Z0-9_-]+/g,"-")}function Sh(t){return on(t,e=>e).join(" ")}function qs(t,e){return xu(t,e.bg+"-"+e.border+"-"+e.fg+"-"+(Hr(e.emphasis,!1)?"b":"n")+(Hr(e.dashed,!1)?"d":"s"))}function Dh(t,e){let r=t.map(i=>i.id),a=t.map(i=>({data:{id:i.id,label:i.label},classes:Sh([xn(i.group,Jv),xn(i.accent,o=>xu("fill",o)),xn(i.chip,o=>qs("nchip",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},classes:Sh([xn(i.chip,s=>qs("echip",s))])}));return a.concat(n)}function H1(t){return vi(on(t,e=>e),[],(e,r)=>e.includes(r)?e:e.concat([r]))}function Ah(t,e){return vi(on(e,r=>r),[],(r,a)=>{let n=qs(t,a);return r.some(i=>i[0]===n)?r:r.concat([[n,a]])})}function Y1(t){let e=t[1];return Vr("."+t[0],[["shape","round-rectangle"],["corner-radius","14"],["background-color",e.bg],["background-opacity","1"],["border-color",e.border],["border-width",Hr(e.emphasis,!1)?"3":"1.5"],["border-style",Hr(e.dashed,!1)?"dashed":"solid"],["width","label"],["height","label"],["padding","10px"],["label","data(label)"],["color",e.fg],["font-size","12px"],["font-weight","500"],["text-valign","center"],["text-halign","center"],["text-margin-x","0"],["text-wrap","wrap"],["text-max-width","180"],["min-zoomed-font-size","7"]])}function q1(t){let e=t[1],r=Hr(e.dashed,!1);return Vr("."+t[0],[["line-color",e.border],["line-style",r?"dashed":"solid"],["target-arrow-color",e.border],["width","1.5"],["label","data(label)"],["color",e.fg],["font-size","11px"],["font-weight",r?"400":"500"],["font-style",r?"italic":"normal"],["text-rotation","autorotate"],["text-background-color",e.bg],["text-background-opacity",r?"0.85":"1"],["text-background-padding","4"],["text-background-shape","roundrectangle"],["text-border-color",e.border],["text-border-width",r?"0":"1"],["text-border-opacity",r?"0":"1"],["min-zoomed-font-size","7"]])}function Es(t,e,r){let a=md(e),n=Bn(t,Gr.brand,"#3b6ea5"),i=Bn(t,Gr.textPrimary,"#1a1a1a"),o=Bn(t,Gr.border,"#d4d4d4"),s=Bn(t,Gr.surface,"#ffffff"),u=d=>d===0?n:Ch[vd(d-1|0,Ch.length)],l=[Vr("node",[["background-color",n],["border-width","2"],["border-color",s],["width","18"],["height","18"],["label","data(label)"],["color",i],["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"]]),Vr("node:parent",[["background-color",o],["background-opacity","0.12"],["border-width","1"],["border-color",o],["text-valign","top"],["text-halign","center"],["font-size","12px"],["color",i],["padding","12"]]),Vr("edge",[["width","1.5"],["line-color",o],["target-arrow-color",o],["target-arrow-shape","triangle"],["arrow-scale","0.9"],["curve-style","bezier"]])],f=a.map((d,p)=>Vr("."+Jv(d),[["background-color",u(p)]])),h=H1(e.map(d=>d.accent)).map(d=>Vr("."+xu("fill",d),[["background-color",d]])),v=Ah("nchip",e.map(d=>d.chip)).map(Y1),c=Ah("echip",r.map(d=>d.chip)).map(q1);return[l,f,h,v,c].flat()}function Lh(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"dagre-lr":return{name:"dagre",fit:!0,padding:24,animate:!1,nodeDimensionsIncludeLabels:!0,rankDir:"LR",nodeSep:48,rankSep:130};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 ga(t){return"var("+t+")"}function _1(t){return{background:ga(Gr.surface),border:"1px solid "+ga(Gr.border),height:t,overflow:"hidden",width:"100%",borderRadius:ga(dd.md)}}let W1={color:ga(Gr.textSecondary),fontSize:ga(pd.sizeSm),padding:ga(gd.lg)};function X1(t,e){return t.map(r=>r.id+"|"+r.label+"|"+Hr(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=Pa(null),l=Pa(void 0),f=Pa(a);f.current=a;let h=Pa([i,n]);h.current=[i,n];let v=hd(),c=X1(i,n),d=Pa(!0);return ki(()=>{let p=u.current;if(p==null)return;U1();let y=Sr({container:p,elements:Dh(i,n),style:Es(p,i,n),layout:Lh(o),minZoom:.2,maxZoom:3});y.on("tap","node",b=>cd(f.current,m=>m(G1.targetId(b)))),l.current=Su(y);let g=new ResizeObserver(()=>{y.resize(),y.fit(24)});return g.observe(p),()=>{l.current=void 0,g.disconnect(),y.destroy()}},[]),ki(()=>{if(d.current)d.current=!1;else{let p=l.current,y=u.current;if(p!==void 0&&y!=null){let g=Du(p),b=h.current,m=b[1],w=b[0];g.remove(g.elements()),g.add(Dh(w,m)),g.style(Es(y,w,m)),g.layout(Lh(o)).run()}}},[c,o]),ki(()=>{let p=l.current,y=u.current;if(p!==void 0&&y!=null){let g=h.current;Du(p).style(Es(y,g[0],g[1]))}},[v.preset]),i.length===0?Au("div",{children:"No relationships to graph.",style:W1}):Au("div",{ref:Su(u),style:_1(s)})}let rx=$1;export{tx as b,ex as g,rx as m};