zky_mandate/resource/public/doc/webjars/js/diagram-definition.2c0ce47b-f7604107.js

102 lines
450 KiB
JavaScript

import{ar as fu,as as gs,at as hu,B as qa,au as vu,av as cu,aw as du,ax as gu,ay as ps,az as pu,aA as yu,aB as mu,aC as bu,aD as Eu,aE as wu,C as xu,aF as Tu,a7 as _r,a5 as or,a6 as Xr,a9 as Du,am as Cu,an as Lu}from"./doc-19de6184.js";import{i as Su}from"./is_dark-f23e070c.js";var Au=fu,Nu=function(){return Au.Date.now()},Mu=Nu,Ou=gs,fn=Mu,li=hu,Iu="Expected a function",Ru=Math.max,ku=Math.min;function Pu(r,e,t){var a,n,i,s,o,u,l=0,f=!1,h=!1,c=!0;if(typeof r!="function")throw new TypeError(Iu);e=li(e)||0,Ou(t)&&(f=!!t.leading,h="maxWait"in t,i=h?Ru(li(t.maxWait)||0,e):i,c="trailing"in t?!!t.trailing:c);function v(L){var b=a,x=n;return a=n=void 0,l=L,s=r.apply(x,b),s}function d(L){return l=L,o=setTimeout(p,e),f?v(L):s}function g(L){var b=L-u,x=L-l,w=e-b;return h?ku(w,i-x):w}function y(L){var b=L-u,x=L-l;return u===void 0||b>=e||b<0||h&&x>=i}function p(){var L=fn();if(y(L))return E(L);o=setTimeout(p,g(L))}function E(L){return o=void 0,c&&a?v(L):(a=n=void 0,s)}function m(){o!==void 0&&clearTimeout(o),l=0,a=u=n=o=void 0}function T(){return o===void 0?s:E(fn())}function D(){var L=fn(),b=y(L);if(a=arguments,n=this,u=L,b){if(o===void 0)return d(u);if(h)return clearTimeout(o),o=setTimeout(p,e),v(u)}return o===void 0&&(o=setTimeout(p,e)),s}return D.cancel=m,D.flush=T,D}var Bu=Pu,ys={exports:{}},ms={exports:{}};(function(r,e){(function(){var t,a,n,i,s,o,u,l,f,h,c,v,d,g,y;n=Math.floor,h=Math.min,a=function(p,E){return p<E?-1:p>E?1:0},f=function(p,E,m,T,D){var L;if(m==null&&(m=0),D==null&&(D=a),m<0)throw new Error("lo must be non-negative");for(T==null&&(T=p.length);m<T;)L=n((m+T)/2),D(E,p[L])<0?T=L:m=L+1;return[].splice.apply(p,[m,m-m].concat(E)),E},o=function(p,E,m){return m==null&&(m=a),p.push(E),g(p,0,p.length-1,m)},s=function(p,E){var m,T;return E==null&&(E=a),m=p.pop(),p.length?(T=p[0],p[0]=m,y(p,0,E)):T=m,T},l=function(p,E,m){var T;return m==null&&(m=a),T=p[0],p[0]=E,y(p,0,m),T},u=function(p,E,m){var T;return m==null&&(m=a),p.length&&m(p[0],E)<0&&(T=[p[0],E],E=T[0],p[0]=T[1],y(p,0,m)),E},i=function(p,E){var m,T,D,L,b,x;for(E==null&&(E=a),L=function(){x=[];for(var w=0,C=n(p.length/2);0<=C?w<C:w>C;0<=C?w++:w--)x.push(w);return x}.apply(this).reverse(),b=[],T=0,D=L.length;T<D;T++)m=L[T],b.push(y(p,m,E));return b},d=function(p,E,m){var T;if(m==null&&(m=a),T=p.indexOf(E),T!==-1)return g(p,0,T,m),y(p,T,m)},c=function(p,E,m){var T,D,L,b,x;if(m==null&&(m=a),D=p.slice(0,E),!D.length)return D;for(i(D,m),x=p.slice(E),L=0,b=x.length;L<b;L++)T=x[L],u(D,T,m);return D.sort(m).reverse()},v=function(p,E,m){var T,D,L,b,x,w,C,A,S;if(m==null&&(m=a),E*10<=p.length){if(L=p.slice(0,E).sort(m),!L.length)return L;for(D=L[L.length-1],C=p.slice(E),b=0,w=C.length;b<w;b++)T=C[b],m(T,D)<0&&(f(L,T,0,null,m),L.pop(),D=L[L.length-1]);return L}for(i(p,m),S=[],x=0,A=h(E,p.length);0<=A?x<A:x>A;0<=A?++x:--x)S.push(s(p,m));return S},g=function(p,E,m,T){var D,L,b;for(T==null&&(T=a),D=p[m];m>E;){if(b=m-1>>1,L=p[b],T(D,L)<0){p[m]=L,m=b;continue}break}return p[m]=D},y=function(p,E,m){var T,D,L,b,x;for(m==null&&(m=a),D=p.length,x=E,L=p[E],T=2*E+1;T<D;)b=T+1,b<D&&!(m(p[T],p[b])<0)&&(T=b),p[E]=p[T],E=T,T=2*E+1;return p[E]=L,g(p,x,E,m)},t=function(){p.push=o,p.pop=s,p.replace=l,p.pushpop=u,p.heapify=i,p.updateItem=d,p.nlargest=c,p.nsmallest=v;function p(E){this.cmp=E!=null?E:a,this.nodes=[]}return p.prototype.push=function(E){return o(this.nodes,E,this.cmp)},p.prototype.pop=function(){return s(this.nodes,this.cmp)},p.prototype.peek=function(){return this.nodes[0]},p.prototype.contains=function(E){return this.nodes.indexOf(E)!==-1},p.prototype.replace=function(E){return l(this.nodes,E,this.cmp)},p.prototype.pushpop=function(E){return u(this.nodes,E,this.cmp)},p.prototype.heapify=function(){return i(this.nodes,this.cmp)},p.prototype.updateItem=function(E){return d(this.nodes,E,this.cmp)},p.prototype.clear=function(){return this.nodes=[]},p.prototype.empty=function(){return this.nodes.length===0},p.prototype.size=function(){return this.nodes.length},p.prototype.clone=function(){var E;return E=new p,E.nodes=this.nodes.slice(0),E},p.prototype.toArray=function(){return this.nodes.slice(0)},p.prototype.insert=p.prototype.push,p.prototype.top=p.prototype.peek,p.prototype.front=p.prototype.peek,p.prototype.has=p.prototype.contains,p.prototype.copy=p.prototype.clone,p}(),function(p,E){return r.exports=E()}(this,function(){return t})}).call(qa)})(ms);(function(r){r.exports=ms.exports})(ys);var Fu=vu;function Gu(r,e,t){var a=r==null?void 0:Fu(r,e);return a===void 0?t:a}var zu=Gu,Vu=cu,$u=du,Yu=gu,fi=gs,Uu=ps;function Hu(r,e,t,a){if(!fi(r))return r;e=$u(e,r);for(var n=-1,i=e.length,s=i-1,o=r;o!=null&&++n<i;){var u=Uu(e[n]),l=t;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(n!=s){var f=o[u];l=a?a(f,u,o):void 0,l===void 0&&(l=fi(f)?f:Yu(e[n+1])?[]:{})}Vu(o,u,l),o=o[u]}return r}var Xu=Hu,qu=Xu;function Wu(r,e,t){return r==null?r:qu(r,e,t)}var _u=Wu,Ku=pu,Zu=yu,Qu=mu,Ju=bu,ju=Eu,el=ps,tl=wu;function rl(r){return Qu(r)?Ku(r,el):Ju(r)?[r]:Zu(ju(tl(r)))}var al=rl,nl=Bu,il=ys.exports,sl=zu,ol=_u,ul=al;function sa(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var Wa=sa(nl),oa=sa(il),ll=sa(sl),fl=sa(ol),hl=sa(ul);function Ye(r){return Ye=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},Ye(r)}function Fn(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function hi(r,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}function Gn(r,e,t){return e&&hi(r.prototype,e),t&&hi(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function bs(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Mt(r,e){return vl(r)||cl(r,e)||dl(r,e)||gl()}function vl(r){if(Array.isArray(r))return r}function cl(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a=[],n=!0,i=!1,s,o;try{for(t=t.call(r);!(n=(s=t.next()).done)&&(a.push(s.value),!(e&&a.length===e));n=!0);}catch(u){i=!0,o=u}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw o}}return a}}function dl(r,e){if(!!r){if(typeof r=="string")return vi(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return vi(r,e)}}function vi(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=new Array(e);t<e;t++)a[t]=r[t];return a}function gl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Be=typeof window>"u"?null:window,ci=Be?Be.navigator:null;Be&&Be.document;var pl=Ye(""),Es=Ye({}),yl=Ye(function(){}),ml=typeof HTMLElement>"u"?"undefined":Ye(HTMLElement),ua=function(e){return e&&e.instanceString&&Fe(e.instanceString)?e.instanceString():null},le=function(e){return e!=null&&Ye(e)==pl},Fe=function(e){return e!=null&&Ye(e)===yl},Ie=function(e){return!ft(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Te=function(e){return e!=null&&Ye(e)===Es&&!Ie(e)&&e.constructor===Object},bl=function(e){return e!=null&&Ye(e)===Es},ae=function(e){return e!=null&&Ye(e)===Ye(1)&&!isNaN(e)},El=function(e){return ae(e)&&Math.floor(e)===e},Fa=function(e){if(ml!=="undefined")return e!=null&&e instanceof HTMLElement},ft=function(e){return la(e)||ws(e)},la=function(e){return ua(e)==="collection"&&e._private.single},ws=function(e){return ua(e)==="collection"&&!e._private.single},zn=function(e){return ua(e)==="core"},xs=function(e){return ua(e)==="stylesheet"},wl=function(e){return ua(e)==="event"},Ut=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},xl=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Tl=function(e){return Te(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},Dl=function(e){return bl(e)&&Fe(e.then)},Cl=function(){return ci&&ci.userAgent.match(/msie|trident|edge/i)},Kr=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var a=function n(){var i=this,s=arguments,o,u=t.apply(i,s),l=n.cache;return(o=l[u])||(o=l[u]=e.apply(i,s)),o};return a.cache={},a},Vn=Kr(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),_a=Kr(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Ts=Kr(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),di=function(e){return Ut(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},$e="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Ll="rgb[a]?\\(("+$e+"[%]?)\\s*,\\s*("+$e+"[%]?)\\s*,\\s*("+$e+"[%]?)(?:\\s*,\\s*("+$e+"))?\\)",Sl="rgb[a]?\\((?:"+$e+"[%]?)\\s*,\\s*(?:"+$e+"[%]?)\\s*,\\s*(?:"+$e+"[%]?)(?:\\s*,\\s*(?:"+$e+"))?\\)",Al="hsl[a]?\\(("+$e+")\\s*,\\s*("+$e+"[%])\\s*,\\s*("+$e+"[%])(?:\\s*,\\s*("+$e+"))?\\)",Nl="hsl[a]?\\((?:"+$e+")\\s*,\\s*(?:"+$e+"[%])\\s*,\\s*(?:"+$e+"[%])(?:\\s*,\\s*(?:"+$e+"))?\\)",Ml="\\#[0-9a-fA-F]{3}",Ol="\\#[0-9a-fA-F]{6}",Ds=function(e,t){return e<t?-1:e>t?1:0},Il=function(e,t){return-1*Ds(e,t)},ce=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var a=e[t];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var s=n[i];r[s]=a[s]}}return r},Rl=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,a,n,i,s=16;return t?(a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[a,n,i]}},kl=function(e){var t,a,n,i,s,o,u,l;function f(d,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?d+(g-d)*6*y:y<1/2?g:y<2/3?d+(g-d)*(2/3-y)*6:d}var h=new RegExp("^"+Al+"$").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,s=h[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,v=2*i-c;o=Math.round(255*f(v,c,a+1/3)),u=Math.round(255*f(v,c,a)),l=Math.round(255*f(v,c,a-1/3))}t=[o,u,l,s]}return t},Pl=function(e){var t,a=new RegExp("^"+Ll+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(o&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},Bl=function(e){return Gl[e.toLowerCase()]},Fl=function(e){return(Ie(e)?e:null)||Bl(e)||Rl(e)||Pl(e)||kl(e)},Gl={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]},Cs=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var s=a[i];if(Te(s))throw Error("Tried to set map with object key");i<a.length-1?(t[s]==null&&(t[s]={}),t=t[s]):t[s]=e.value}},Ls=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var s=a[i];if(Te(s))throw Error("Tried to get map with object key");if(t=t[s],t==null)return t}return t},hn=Be?Be.performance:null,Ss=hn&&hn.now?function(){return hn.now()}:function(){return Date.now()},zl=function(){if(Be){if(Be.requestAnimationFrame)return function(r){Be.requestAnimationFrame(r)};if(Be.mozRequestAnimationFrame)return function(r){Be.mozRequestAnimationFrame(r)};if(Be.webkitRequestAnimationFrame)return function(r){Be.webkitRequestAnimationFrame(r)};if(Be.msRequestAnimationFrame)return function(r){Be.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(Ss())},1e3/60)}}(),Ga=function(e){return zl(e)},Ot=Ss,mr=9261,As=65599,$r=5381,Ns=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mr,a=t,n;n=e.next(),!n.done;)a=a*As+n.value|0;return a},Zr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mr;return t*As+e|0},Qr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$r;return(t<<5)+t+e|0},Vl=function(e,t){return e*2097152+t},Ft=function(e){return e[0]*2097152+e[1]},ba=function(e,t){return[Zr(e[0],t[0]),Qr(e[1],t[1])]},$l=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return Ns(s,t)},tr=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return Ns(s,t)},Ms=function(){return Yl(arguments)},Yl=function(e){for(var t,a=0;a<e.length;a++){var n=e[a];a===0?t=tr(n):t=tr(n,t)}return t},gi=!0,Ul=console.warn!=null,Hl=console.trace!=null,$n=Number.MAX_SAFE_INTEGER||9007199254740991,Os=function(){return!0},za=function(){return!1},pi=function(){return 0},Yn=function(){},ze=function(e){throw new Error(e)},Is=function(e){if(e!==void 0)gi=!!e;else return gi},Ae=function(e){!Is()||(Ul?console.warn(e):(console.log(e),Hl&&console.trace()))},Xl=function(e){return ce({},e)},Dt=function(e){return e==null?e:Ie(e)?e.slice():Te(e)?Xl(e):e},ql=function(e){return e.slice()},Rs=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},Wl={},ks=function(){return Wl},Ze=function(e){var t=Object.keys(e);return function(a){for(var n={},i=0;i<t.length;i++){var s=t[i],o=a==null?void 0:a[s];n[s]=o===void 0?e[s]:o}return n}},Ht=function(e,t,a){for(var n=e.length-1;n>=0&&!(e[n]===t&&(e.splice(n,1),a));n--);},Un=function(e){e.splice(0,e.length)},_l=function(e,t){for(var a=0;a<t.length;a++){var n=t[a];e.push(n)}},wt=function(e,t,a){return a&&(t=Ts(a,t)),e[t]},zt=function(e,t,a,n){a&&(t=Ts(a,t)),e[t]=n},Kl=function(){function r(){Fn(this,r),this._obj={}}return Gn(r,[{key:"set",value:function(t,a){return this._obj[t]=a,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}]),r}(),Ct=typeof Map<"u"?Map:Kl,Zl="undefined",Ql=function(){function r(e){if(Fn(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var a=0;a<t.length;a++)this.add(t[a])}}return Gn(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var a=this._obj;a[t]!==1&&(a[t]=1,this.size++)}},{key:"delete",value:function(t){var a=this._obj;a[t]===1&&(a[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(a){return t.has(a)})}},{key:"forEach",value:function(t,a){return this.toArray().forEach(t,a)}}]),r}(),Ar=(typeof Set>"u"?"undefined":Ye(Set))!==Zl?Set:Ql,Ka=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!zn(e)){ze("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){ze("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:t.data||{},position:t.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:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new Ar,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),u=e.zoom();i.position={x:(s.x-o.x)/u,y:(s.y-o.y)/u}}var l=[];Ie(t.classes)?l=t.classes:le(t.classes)&&(l=t.classes.split(/\s+/));for(var f=0,h=l.length;f<h;f++){var c=l[f];!c||c===""||i.classes.add(c)}this.createEmitter();var v=t.style||t.css;v&&(Ae("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(a===void 0||a)&&this.restore()},yi=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var s;Te(a)&&!ft(a)&&(s=a,a=s.roots||s.root,n=s.visit,i=s.directed),i=arguments.length===2&&!Fe(n)?n:i,n=Fe(n)?n:function(){};for(var o=this._private.cy,u=a=le(a)?this.filter(a):a,l=[],f=[],h={},c={},v={},d=0,g,y=this.byGroup(),p=y.nodes,E=y.edges,m=0;m<u.length;m++){var T=u[m],D=T.id();T.isNode()&&(l.unshift(T),e.bfs&&(v[D]=!0,f.push(T)),c[D]=0)}for(var L=function(){var O=e.bfs?l.shift():l.pop(),N=O.id();if(e.dfs){if(v[N])return"continue";v[N]=!0,f.push(O)}var P=c[N],I=h[N],k=I!=null?I.source():null,R=I!=null?I.target():null,B=I==null?void 0:O.same(k)?R[0]:k[0],z=void 0;if(z=n(O,I,B,d++,P),z===!0)return g=O,"break";if(z===!1)return"break";for(var F=O.connectedEdges().filter(function(H){return(!i||H.source().same(O))&&E.has(H)}),V=0;V<F.length;V++){var U=F[V],$=U.connectedNodes().filter(function(H){return!H.same(O)&&p.has(H)}),X=$.id();$.length!==0&&!v[X]&&($=$[0],l.push($),e.bfs&&(v[X]=!0,f.push($)),h[X]=U,c[X]=c[N]+1)}};l.length!==0;){var b=L();if(b!=="continue"&&b==="break")break}for(var x=o.collection(),w=0;w<f.length;w++){var C=f[w],A=h[C.id()];A!=null&&x.push(A),x.push(C)}return{path:o.collection(x),found:o.collection(g)}}},Jr={breadthFirstSearch:yi({bfs:!0}),depthFirstSearch:yi({dfs:!0})};Jr.bfs=Jr.breadthFirstSearch;Jr.dfs=Jr.depthFirstSearch;var Jl=Ze({root:null,weight:function(e){return 1},directed:!1}),jl={dijkstra:function(e){if(!Te(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var a=Jl(e),n=a.root,i=a.weight,s=a.directed,o=this,u=i,l=le(n)?this.filter(n)[0]:n[0],f={},h={},c={},v=this.byGroup(),d=v.nodes,g=v.edges;g.unmergeBy(function(P){return P.isLoop()});for(var y=function(I){return f[I.id()]},p=function(I,k){f[I.id()]=k,E.updateItem(I)},E=new oa.default(function(P,I){return y(P)-y(I)}),m=0;m<d.length;m++){var T=d[m];f[T.id()]=T.same(l)?0:1/0,E.push(T)}for(var D=function(I,k){for(var R=(s?I.edgesTo(k):I.edgesWith(k)).intersect(g),B=1/0,z,F=0;F<R.length;F++){var V=R[F],U=u(V);(U<B||!z)&&(B=U,z=V)}return{edge:z,dist:B}};E.size()>0;){var L=E.pop(),b=y(L),x=L.id();if(c[x]=b,b!==1/0)for(var w=L.neighborhood().intersect(d),C=0;C<w.length;C++){var A=w[C],S=A.id(),O=D(L,A),N=b+O.dist;N<y(A)&&(p(A,N),h[S]={node:L,edge:O.edge})}}return{distanceTo:function(I){var k=le(I)?d.filter(I)[0]:I[0];return c[k.id()]},pathTo:function(I){var k=le(I)?d.filter(I)[0]:I[0],R=[],B=k,z=B.id();if(k.length>0)for(R.unshift(k);h[z];){var F=h[z];R.unshift(F.edge),R.unshift(F.node),B=F.node,z=B.id()}return o.spawn(R)}}}},ef={kruskal:function(e){e=e||function(m){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,s=new Array(i),o=a,u=function(T){for(var D=0;D<s.length;D++){var L=s[D];if(L.has(T))return D}},l=0;l<i;l++)s[l]=this.spawn(a[l]);for(var f=n.sort(function(m,T){return e(m)-e(T)}),h=0;h<f.length;h++){var c=f[h],v=c.source()[0],d=c.target()[0],g=u(v),y=u(d),p=s[g],E=s[y];g!==y&&(o.merge(c),p.merge(E),s.splice(y,1))}return o}},tf=Ze({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),rf={aStar:function(e){var t=this.cy(),a=tf(e),n=a.root,i=a.goal,s=a.heuristic,o=a.directed,u=a.weight;n=t.collection(n)[0],i=t.collection(i)[0];var l=n.id(),f=i.id(),h={},c={},v={},d=new oa.default(function(z,F){return c[z.id()]-c[F.id()]}),g=new Ar,y={},p={},E=function(F,V){d.push(F),g.add(V)},m,T,D=function(){m=d.pop(),T=m.id(),g.delete(T)},L=function(F){return g.has(F)};E(n,l),h[l]=0,c[l]=s(n);for(var b=0;d.size()>0;){if(D(),b++,T===f){for(var x=[],w=i,C=f,A=p[C];x.unshift(w),A!=null&&x.unshift(A),w=y[C],w!=null;)C=w.id(),A=p[C];return{found:!0,distance:h[T],path:this.spawn(x),steps:b}}v[T]=!0;for(var S=m._private.edges,O=0;O<S.length;O++){var N=S[O];if(!!this.hasElementWithId(N.id())&&!(o&&N.data("source")!==T)){var P=N.source(),I=N.target(),k=P.id()!==T?P:I,R=k.id();if(!!this.hasElementWithId(R)&&!v[R]){var B=h[T]+u(N);if(!L(R)){h[R]=B,c[R]=B+s(k),E(k,R),y[R]=m,p[R]=N;continue}B<h[R]&&(h[R]=B,c[R]=B+s(k),y[R]=m,p[R]=N)}}}}return{found:!1,distance:void 0,path:void 0,steps:b}}},af=Ze({weight:function(e){return 1},directed:!1}),nf={floydWarshall:function(e){for(var t=this.cy(),a=af(e),n=a.weight,i=a.directed,s=n,o=this.byGroup(),u=o.nodes,l=o.edges,f=u.length,h=f*f,c=function(U){return u.indexOf(U)},v=function(U){return u[U]},d=new Array(h),g=0;g<h;g++){var y=g%f,p=(g-y)/f;p===y?d[g]=0:d[g]=1/0}for(var E=new Array(h),m=new Array(h),T=0;T<l.length;T++){var D=l[T],L=D.source()[0],b=D.target()[0];if(L!==b){var x=c(L),w=c(b),C=x*f+w,A=s(D);if(d[C]>A&&(d[C]=A,E[C]=w,m[C]=D),!i){var S=w*f+x;!i&&d[S]>A&&(d[S]=A,E[S]=x,m[S]=D)}}}for(var O=0;O<f;O++)for(var N=0;N<f;N++)for(var P=N*f+O,I=0;I<f;I++){var k=N*f+I,R=O*f+I;d[P]+d[R]<d[k]&&(d[k]=d[P]+d[R],E[k]=E[P])}var B=function(U){return(le(U)?t.filter(U):U)[0]},z=function(U){return c(B(U))},F={distance:function(U,$){var X=z(U),H=z($);return d[X*f+H]},path:function(U,$){var X=z(U),H=z($),G=v(X);if(X===H)return G.collection();if(E[X*f+H]==null)return t.collection();var q=t.collection(),K=X,Z;for(q.merge(G);X!==H;)K=X,X=E[X*f+H],Z=m[K*f+X],q.merge(Z),q.merge(v(X));return q}};return F}},sf=Ze({weight:function(e){return 1},directed:!1,root:null}),of={bellmanFord:function(e){var t=this,a=sf(e),n=a.weight,i=a.directed,s=a.root,o=n,u=this,l=this.cy(),f=this.byGroup(),h=f.edges,c=f.nodes,v=c.length,d=new Ct,g=!1,y=[];s=l.collection(s)[0],h.unmergeBy(function(se){return se.isLoop()});for(var p=h.length,E=function(ne){var ue=d.get(ne.id());return ue||(ue={},d.set(ne.id(),ue)),ue},m=function(ne){return(le(ne)?l.$(ne):ne)[0]},T=function(ne){return E(m(ne)).dist},D=function(ne){for(var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,Ee=m(ne),ge=[],ve=Ee;;){if(ve==null)return t.spawn();var J=E(ve),M=J.edge,Y=J.pred;if(ge.unshift(ve[0]),ve.same(ue)&&ge.length>0)break;M!=null&&ge.unshift(M),ve=Y}return u.spawn(ge)},L=0;L<v;L++){var b=c[L],x=E(b);b.same(s)?x.dist=0:x.dist=1/0,x.pred=null,x.edge=null}for(var w=!1,C=function(ne,ue,Ee,ge,ve,J){var M=ge.dist+J;M<ve.dist&&!Ee.same(ge.edge)&&(ve.dist=M,ve.pred=ne,ve.edge=Ee,w=!0)},A=1;A<v;A++){w=!1;for(var S=0;S<p;S++){var O=h[S],N=O.source(),P=O.target(),I=o(O),k=E(N),R=E(P);C(N,P,O,k,R,I),i||C(P,N,O,R,k,I)}if(!w)break}if(w)for(var B=[],z=0;z<p;z++){var F=h[z],V=F.source(),U=F.target(),$=o(F),X=E(V).dist,H=E(U).dist;if(X+$<H||!i&&H+$<X)if(g||(Ae("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var G=[];X+$<H&&G.push(V),!i&&H+$<X&&G.push(U);for(var q=G.length,K=0;K<q;K++){var Z=G[K],te=[Z];te.push(E(Z).edge);for(var he=E(Z).pred;te.indexOf(he)===-1;)te.push(he),te.push(E(he).edge),he=E(he).pred;te=te.slice(te.indexOf(he));for(var de=te[0].id(),ee=0,re=2;re<te.length;re+=2)te[re].id()<de&&(de=te[re].id(),ee=re);te=te.slice(ee).concat(te.slice(0,ee)),te.push(te[0]);var fe=te.map(function(se){return se.id()}).join(",");B.indexOf(fe)===-1&&(y.push(u.spawn(te)),B.push(fe))}}else break}return{distanceTo:T,pathTo:D,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},uf=Math.sqrt(2),lf=function(e,t,a){a.length===0&&ze("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],s=n[2],o=t[i],u=t[s],l=a,f=l.length-1;f>=0;f--){var h=l[f],c=h[1],v=h[2];(t[c]===o&&t[v]===u||t[c]===u&&t[v]===o)&&l.splice(f,1)}for(var d=0;d<l.length;d++){var g=l[d];g[1]===u?(l[d]=g.slice(),l[d][1]=o):g[2]===u&&(l[d]=g.slice(),l[d][2]=o)}for(var y=0;y<t.length;y++)t[y]===u&&(t[y]=o);return l},vn=function(e,t,a,n){for(;a>n;){var i=Math.floor(Math.random()*t.length);t=lf(i,e,t),a--}return t},ff={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(R){return R.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/uf);if(i<2){ze("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<s;f++){var h=n[f];l.push([f,a.indexOf(h.source()),a.indexOf(h.target())])}for(var c=1/0,v=[],d=new Array(i),g=new Array(i),y=new Array(i),p=function(B,z){for(var F=0;F<i;F++)z[F]=B[F]},E=0;E<=o;E++){for(var m=0;m<i;m++)g[m]=m;var T=vn(g,l.slice(),i,u),D=T.slice();p(g,y);var L=vn(g,T,u,2),b=vn(y,D,u,2);L.length<=b.length&&L.length<c?(c=L.length,v=L,p(g,d)):b.length<=L.length&&b.length<c&&(c=b.length,v=b,p(y,d))}for(var x=this.spawn(v.map(function(R){return n[R[0]]})),w=this.spawn(),C=this.spawn(),A=d[0],S=0;S<d.length;S++){var O=d[S],N=a[S];O===A?w.merge(N):C.merge(N)}var P=function(B){var z=e.spawn();return B.forEach(function(F){z.merge(F),F.connectedEdges().forEach(function(V){e.contains(V)&&!x.contains(V)&&z.merge(V)})}),z},I=[P(w),P(C)],k={cut:x,components:I,partition1:w,partition2:C};return k}},hf=function(e){return{x:e.x,y:e.y}},Za=function(e,t,a){return{x:e.x*t+a.x,y:e.y*t+a.y}},Ps=function(e,t,a){return{x:(e.x-a.x)/t,y:(e.y-a.y)/t}},br=function(e){return{x:e[0],y:e[1]}},vf=function(e){for(var t=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=t;i<a;i++){var s=e[i];isFinite(s)&&(n=Math.min(s,n))}return n},cf=function(e){for(var t=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=t;i<a;i++){var s=e[i];isFinite(s)&&(n=Math.max(s,n))}return n},df=function(e){for(var t=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,s=t;s<a;s++){var o=e[s];isFinite(o)&&(n+=o,i++)}return n/i},gf=function(e){var t=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,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a<e.length&&e.splice(a,e.length-a),t>0&&e.splice(0,t));for(var o=0,u=e.length-1;u>=0;u--){var l=e[u];s?isFinite(l)||(e[u]=-1/0,o++):e.splice(u,1)}i&&e.sort(function(c,v){return c-v});var f=e.length,h=Math.floor(f/2);return f%2!==0?e[h+1+o]:(e[h-1+o]+e[h+o])/2},pf=function(e){return Math.PI*e/180},Ea=function(e,t){return Math.atan2(t,e)-Math.PI/2},Hn=Math.log2||function(r){return Math.log(r)/Math.log(2)},Bs=function(e){return e>0?1:e<0?-1:0},rr=function(e,t){return Math.sqrt(Jt(e,t))},Jt=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},yf=function(e){for(var t=e.length,a=0,n=0;n<t;n++)a+=e[n];for(var i=0;i<t;i++)e[i]=e[i]/a;return e},He=function(e,t,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*t+n*n*a},wr=function(e,t,a,n){return{x:He(e.x,t.x,a.x,n),y:He(e.y,t.y,a.y,n)}},mf=function(e,t,a,n){var i={x:t.x-e.x,y:t.y-e.y},s=rr(e,t),o={x:i.x/s,y:i.y/s};return a=a==null?0:a,n=n!=null?n:a*s,{x:e.x+o.x*n,y:e.y+o.y*n}},jr=function(e,t,a){return Math.max(e,Math.min(a,t))},lt=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}}},bf=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Ef=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},wf=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},xf=function(e,t,a){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),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},Ma=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},cn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(t.length===1)a=n=i=s=t[0];else if(t.length===2)a=i=t[0],s=n=t[1];else if(t.length===4){var o=Mt(t,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},mi=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Xn=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},Cr=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},Tf=function(e,t){return Cr(e,t.x,t.y)},Fs=function(e,t){return Cr(e,t.x1,t.y1)&&Cr(e,t.x2,t.y2)},Gs=function(e,t,a,n,i,s,o){var u=fa(i,s),l=i/2,f=s/2,h;{var c=a-l+u-o,v=n-f-o,d=a+l-u+o,g=v;if(h=Vt(e,t,a,n,c,v,d,g,!1),h.length>0)return h}{var y=a+l+o,p=n-f+u-o,E=y,m=n+f-u+o;if(h=Vt(e,t,a,n,y,p,E,m,!1),h.length>0)return h}{var T=a-l+u-o,D=n+f+o,L=a+l-u+o,b=D;if(h=Vt(e,t,a,n,T,D,L,b,!1),h.length>0)return h}{var x=a-l-o,w=n-f+u-o,C=x,A=n+f-u+o;if(h=Vt(e,t,a,n,x,w,C,A,!1),h.length>0)return h}var S;{var O=a-l+u,N=n-f+u;if(S=Yr(e,t,a,n,O,N,u+o),S.length>0&&S[0]<=O&&S[1]<=N)return[S[0],S[1]]}{var P=a+l-u,I=n-f+u;if(S=Yr(e,t,a,n,P,I,u+o),S.length>0&&S[0]>=P&&S[1]<=I)return[S[0],S[1]]}{var k=a+l-u,R=n+f-u;if(S=Yr(e,t,a,n,k,R,u+o),S.length>0&&S[0]>=k&&S[1]>=R)return[S[0],S[1]]}{var B=a-l+u,z=n+f-u;if(S=Yr(e,t,a,n,B,z,u+o),S.length>0&&S[0]<=B&&S[1]>=z)return[S[0],S[1]]}return[]},Df=function(e,t,a,n,i,s,o){var u=o,l=Math.min(a,i),f=Math.max(a,i),h=Math.min(n,s),c=Math.max(n,s);return l-u<=e&&e<=f+u&&h-u<=t&&t<=c+u},Cf=function(e,t,a,n,i,s,o,u,l){var f={x1:Math.min(a,o,i)-l,x2:Math.max(a,o,i)+l,y1:Math.min(n,u,s)-l,y2:Math.max(n,u,s)+l};return!(e<f.x1||e>f.x2||t<f.y1||t>f.y2)},Lf=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,u=(-t+s)/o,l=(-t-s)/o;return[u,l]},Sf=function(e,t,a,n,i){var s=1e-5;e===0&&(e=s),t/=e,a/=e,n/=e;var o,u,l,f,h,c,v,d;if(u=(3*a-t*t)/9,l=-(27*n)+t*(9*a-2*(t*t)),l/=54,o=u*u*u+l*l,i[1]=0,v=t/3,o>0){h=l+Math.sqrt(o),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),c=l-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-v+h+c,v+=(h+c)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-c+h)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,o===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-v+2*d,i[4]=i[2]=-(d+v);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),d=2*Math.sqrt(u),i[0]=-v+d*Math.cos(f/3),i[2]=-v+d*Math.cos((f+2*Math.PI)/3),i[4]=-v+d*Math.cos((f+4*Math.PI)/3)},Af=function(e,t,a,n,i,s,o,u){var l=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*u+4*s*s-4*s*u+u*u,f=1*9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*u-6*s*s+3*s*u,h=1*3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*u-n*t+2*s*s+2*s*t-u*t,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*t-s*t,v=[];Sf(l,f,h,c,v);for(var d=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<d&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var p=-1,E,m,T,D=0;D<g.length;D++)E=Math.pow(1-g[D],2)*a+2*(1-g[D])*g[D]*i+g[D]*g[D]*o,m=Math.pow(1-g[D],2)*n+2*(1-g[D])*g[D]*s+g[D]*g[D]*u,T=Math.pow(E-e,2)+Math.pow(m-t,2),p>=0?T<p&&(p=T):p=T;return p},Nf=function(e,t,a,n,i,s){var o=[e-a,t-n],u=[i-a,s-n],l=u[0]*u[0]+u[1]*u[1],f=o[0]*o[0]+o[1]*o[1],h=o[0]*u[0]+o[1]*u[1],c=h*h/l;return h<0?f:c>l?(e-i)*(e-i)+(t-s)*(t-s):f-c},ut=function(e,t,a){for(var n,i,s,o,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?(s=a[(f+1)*2],o=a[(f+1)*2+1]):(s=a[(f+1-a.length/2)*2],o=a[(f+1-a.length/2)*2+1]),!(n==e&&s==e))if(n>=e&&e>=s||n<=e&&e<=s)u=(e-n)/(s-n)*(o-i)+i,u>t&&l++;else continue;return l%2!==0},It=function(e,t,a,n,i,s,o,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 c=Math.cos(-h),v=Math.sin(-h),d=0;d<f.length/2;d++)f[d*2]=s/2*(a[d*2]*c-a[d*2+1]*v),f[d*2+1]=o/2*(a[d*2+1]*c+a[d*2]*v),f[d*2]+=n,f[d*2+1]+=i;var g;if(l>0){var y=Vs(f,-l);g=zs(y)}else g=f;return ut(e,t,g)},Mf=function(e,t,a,n,i,s,o){for(var u=new Array(a.length),l=s/2,f=o/2,h=qn(s,o),c=h*h,v=0;v<a.length/4;v++){var d=void 0,g=void 0;v===0?d=a.length-2:d=v*4-2,g=v*4+2;var y=n+l*a[v*4],p=i+f*a[v*4+1],E=-a[d]*a[g]-a[d+1]*a[g+1],m=h/Math.tan(Math.acos(E)/2),T=y-m*a[d],D=p-m*a[d+1],L=y+m*a[g],b=p+m*a[g+1];u[v*4]=T,u[v*4+1]=D,u[v*4+2]=L,u[v*4+3]=b;var x=a[d+1],w=-a[d],C=x*a[g]+w*a[g+1];C<0&&(x*=-1,w*=-1);var A=T+x*h,S=D+w*h,O=Math.pow(A-e,2)+Math.pow(S-t,2);if(O<=c)return!0}return ut(e,t,u)},zs=function(e){for(var t=new Array(e.length/2),a,n,i,s,o,u,l,f,h=0;h<e.length/4;h++){a=e[h*4],n=e[h*4+1],i=e[h*4+2],s=e[h*4+3],h<e.length/4-1?(o=e[(h+1)*4],u=e[(h+1)*4+1],l=e[(h+1)*4+2],f=e[(h+1)*4+3]):(o=e[0],u=e[1],l=e[2],f=e[3]);var c=Vt(a,n,i,s,o,u,l,f,!0);t[h*2]=c[0],t[h*2+1]=c[1]}return t},Vs=function(e,t){for(var a=new Array(e.length*2),n,i,s,o,u=0;u<e.length/2;u++){n=e[u*2],i=e[u*2+1],u<e.length/2-1?(s=e[(u+1)*2],o=e[(u+1)*2+1]):(s=e[0],o=e[1]);var l=o-i,f=-(s-n),h=Math.sqrt(l*l+f*f),c=l/h,v=f/h;a[u*4]=n+c*t,a[u*4+1]=i+v*t,a[u*4+2]=s+c*t,a[u*4+3]=o+v*t}return a},Of=function(e,t,a,n,i,s){var o=a-e,u=n-t;o/=i,u/=s;var l=Math.sqrt(o*o+u*u),f=l-1;if(f<0)return[];var h=f/l;return[(a-e)*h+e,(n-t)*h+t]},er=function(e,t,a,n,i,s,o){return e-=i,t-=s,e/=a/2+o,t/=n/2+o,e*e+t*t<=1},Yr=function(e,t,a,n,i,s,o){var u=[a-e,n-t],l=[e-i,t-s],f=u[0]*u[0]+u[1]*u[1],h=2*(l[0]*u[0]+l[1]*u[1]),c=l[0]*l[0]+l[1]*l[1]-o*o,v=h*h-4*f*c;if(v<0)return[];var d=(-h+Math.sqrt(v))/(2*f),g=(-h-Math.sqrt(v))/(2*f),y=Math.min(d,g),p=Math.max(d,g),E=[];if(y>=0&&y<=1&&E.push(y),p>=0&&p<=1&&E.push(p),E.length===0)return[];var m=E[0]*u[0]+e,T=E[0]*u[1]+t;if(E.length>1){if(E[0]==E[1])return[m,T];var D=E[1]*u[0]+e,L=E[1]*u[1]+t;return[m,T,D,L]}else return[m,T]},dn=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},Vt=function(e,t,a,n,i,s,o,u,l){var f=e-i,h=a-e,c=o-i,v=t-s,d=n-t,g=u-s,y=c*v-g*f,p=h*v-d*f,E=g*h-c*d;if(E!==0){var m=y/E,T=p/E,D=.001,L=0-D,b=1+D;return L<=m&&m<=b&&L<=T&&T<=b?[e+m*h,t+m*d]:l?[e+m*h,t+m*d]:[]}else return y===0||p===0?dn(e,a,o)===o?[o,u]:dn(e,a,i)===i?[i,s]:dn(i,o,a)===a?[a,n]:[]:[]},ea=function(e,t,a,n,i,s,o,u){var l=[],f,h=new Array(a.length),c=!0;s==null&&(c=!1);var v;if(c){for(var d=0;d<h.length/2;d++)h[d*2]=a[d*2]*s+n,h[d*2+1]=a[d*2+1]*o+i;if(u>0){var g=Vs(h,-u);v=zs(g)}else v=h}else v=a;for(var y,p,E,m,T=0;T<v.length/2;T++)y=v[T*2],p=v[T*2+1],T<v.length/2-1?(E=v[(T+1)*2],m=v[(T+1)*2+1]):(E=v[0],m=v[1]),f=Vt(e,t,n,i,y,p,E,m),f.length!==0&&l.push(f[0],f[1]);return l},If=function(e,t,a,n,i,s,o,u){for(var l=[],f,h=new Array(a.length),c=s/2,v=o/2,d=qn(s,o),g=0;g<a.length/4;g++){var y=void 0,p=void 0;g===0?y=a.length-2:y=g*4-2,p=g*4+2;var E=n+c*a[g*4],m=i+v*a[g*4+1],T=-a[y]*a[p]-a[y+1]*a[p+1],D=d/Math.tan(Math.acos(T)/2),L=E-D*a[y],b=m-D*a[y+1],x=E+D*a[p],w=m+D*a[p+1];g===0?(h[a.length-2]=L,h[a.length-1]=b):(h[g*4-2]=L,h[g*4-1]=b),h[g*4]=x,h[g*4+1]=w;var C=a[y+1],A=-a[y],S=C*a[p]+A*a[p+1];S<0&&(C*=-1,A*=-1);var O=L+C*d,N=b+A*d;f=Yr(e,t,n,i,O,N,d),f.length!==0&&l.push(f[0],f[1])}for(var P=0;P<h.length/4;P++)f=Vt(e,t,n,i,h[P*4],h[P*4+1],h[P*4+2],h[P*4+3],!1),f.length!==0&&l.push(f[0],f[1]);if(l.length>2){for(var I=[l[0],l[1]],k=Math.pow(I[0]-e,2)+Math.pow(I[1]-t,2),R=1;R<l.length/2;R++){var B=Math.pow(l[R*2]-e,2)+Math.pow(l[R*2+1]-t,2);B<=k&&(I[0]=l[R*2],I[1]=l[R*2+1],k=B)}return I}return l},wa=function(e,t,a){var n=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=(i-a)/i;return s<0&&(s=1e-5),[t[0]+s*n[0],t[1]+s*n[1]]},nt=function(e,t){var a=Dn(e,t);return a=$s(a),a},$s=function(e){for(var t,a,n=e.length/2,i=1/0,s=1/0,o=-1/0,u=-1/0,l=0;l<n;l++)t=e[2*l],a=e[2*l+1],i=Math.min(i,t),o=Math.max(o,t),s=Math.min(s,a),u=Math.max(u,a);for(var f=2/(o-i),h=2/(u-s),c=0;c<n;c++)t=e[2*c]=e[2*c]*f,a=e[2*c+1]=e[2*c+1]*h,i=Math.min(i,t),o=Math.max(o,t),s=Math.min(s,a),u=Math.max(u,a);if(s<-1)for(var v=0;v<n;v++)a=e[2*v+1]=e[2*v+1]+(-1-s);return e},Dn=function(e,t){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=t;for(var i=new Array(e*2),s,o=0;o<e;o++)s=o*a+n,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},fa=function(e,t){return Math.min(e/4,t/4,8)},qn=function(e,t){return Math.min(e/10,t/10,8)},Ys=function(){return 8},Rf=function(e,t,a){return[e-2*t+a,2*(t-e),e]},Cn=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},kf=Ze({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Pf={pageRank:function(e){for(var t=kf(e),a=t.dampingFactor,n=t.precision,i=t.iterations,s=t.weight,o=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,h=l.length,c=h*h,v=f.length,d=new Array(c),g=new Array(h),y=(1-a)/h,p=0;p<h;p++){for(var E=0;E<h;E++){var m=p*h+E;d[m]=0}g[p]=0}for(var T=0;T<v;T++){var D=f[T],L=D.data("source"),b=D.data("target");if(L!==b){var x=l.indexOfId(L),w=l.indexOfId(b),C=s(D),A=w*h+x;d[A]+=C,g[x]+=C}}for(var S=1/h+y,O=0;O<h;O++)if(g[O]===0)for(var N=0;N<h;N++){var P=N*h+O;d[P]=S}else for(var I=0;I<h;I++){var k=I*h+O;d[k]=d[k]/g[O]+y}for(var R=new Array(h),B=new Array(h),z,F=0;F<h;F++)R[F]=1;for(var V=0;V<i;V++){for(var U=0;U<h;U++)B[U]=0;for(var $=0;$<h;$++)for(var X=0;X<h;X++){var H=$*h+X;B[$]+=d[H]*R[X]}yf(B),z=R,R=B,B=z;for(var G=0,q=0;q<h;q++){var K=z[q]-R[q];G+=K*K}if(G<n)break}var Z={rank:function(he){return he=o.collection(he)[0],R[l.indexOf(he)]}};return Z}},bi=Ze({root:null,weight:function(e){return 1},directed:!1,alpha:0}),xr={degreeCentralityNormalized:function(e){e=bi(e);var t=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},h={},c=0,v=0,d=0;d<n;d++){var g=a[d],y=g.id();e.root=g;var p=this.degreeCentrality(e);c<p.indegree&&(c=p.indegree),v<p.outdegree&&(v=p.outdegree),f[y]=p.indegree,h[y]=p.outdegree}return{indegree:function(m){return c==0?0:(le(m)&&(m=t.filter(m)),f[m.id()]/c)},outdegree:function(m){return v===0?0:(le(m)&&(m=t.filter(m)),h[m.id()]/v)}}}else{for(var i={},s=0,o=0;o<n;o++){var u=a[o];e.root=u;var l=this.degreeCentrality(e);s<l.degree&&(s=l.degree),i[u.id()]=l.degree}return{degree:function(m){return s===0?0:(le(m)&&(m=t.filter(m)),i[m.id()]/s)}}}},degreeCentrality:function(e){e=bi(e);var t=this.cy(),a=this,n=e,i=n.root,s=n.weight,o=n.directed,u=n.alpha;if(i=t.collection(i)[0],o){for(var v=i.connectedEdges(),d=v.filter(function(L){return L.target().same(i)&&a.has(L)}),g=v.filter(function(L){return L.source().same(i)&&a.has(L)}),y=d.length,p=g.length,E=0,m=0,T=0;T<d.length;T++)E+=s(d[T]);for(var D=0;D<g.length;D++)m+=s(g[D]);return{indegree:Math.pow(y,1-u)*Math.pow(E,u),outdegree:Math.pow(p,1-u)*Math.pow(m,u)}}else{for(var l=i.connectedEdges().intersection(a),f=l.length,h=0,c=0;c<l.length;c++)h+=s(l[c]);return{degree:Math.pow(f,1-u)*Math.pow(h,u)}}}};xr.dc=xr.degreeCentrality;xr.dcn=xr.degreeCentralityNormalised=xr.degreeCentralityNormalized;var Ei=Ze({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Tr={closenessCentralityNormalized:function(e){for(var t=Ei(e),a=t.harmonic,n=t.weight,i=t.directed,s=this.cy(),o={},u=0,l=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),h=0;h<l.length;h++){for(var c=0,v=l[h],d=0;d<l.length;d++)if(h!==d){var g=f.distance(v,l[d]);a?c+=1/g:c+=g}a||(c=1/c),u<c&&(u=c),o[v.id()]=c}return{closeness:function(p){return u==0?0:(le(p)?p=s.filter(p)[0].id():p=p.id(),o[p]/u)}}},closenessCentrality:function(e){var t=Ei(e),a=t.root,n=t.weight,i=t.directed,s=t.harmonic;a=this.filter(a)[0];for(var o=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 c=o.distanceTo(h);s?u+=1/c:u+=c}}return s?u:1/u}};Tr.cc=Tr.closenessCentrality;Tr.ccn=Tr.closenessCentralityNormalised=Tr.closenessCentralityNormalized;var Bf=Ze({weight:null,directed:!1}),Ln={betweennessCentrality:function(e){for(var t=Bf(e),a=t.directed,n=t.weight,i=n!=null,s=this.cy(),o=this.nodes(),u={},l={},f=0,h={set:function(m,T){l[m]=T,T>f&&(f=T)},get:function(m){return l[m]}},c=0;c<o.length;c++){var v=o[c],d=v.id();a?u[d]=v.outgoers().nodes():u[d]=v.openNeighborhood().nodes(),h.set(d,0)}for(var g=function(m){for(var T=o[m].id(),D=[],L={},b={},x={},w=new oa.default(function(X,H){return x[X]-x[H]}),C=0;C<o.length;C++){var A=o[C].id();L[A]=[],b[A]=0,x[A]=1/0}for(b[T]=1,x[T]=0,w.push(T);!w.empty();){var S=w.pop();if(D.push(S),i)for(var O=0;O<u[S].length;O++){var N=u[S][O],P=s.getElementById(S),I=void 0;P.edgesTo(N).length>0?I=P.edgesTo(N)[0]:I=N.edgesTo(P)[0];var k=n(I);N=N.id(),x[N]>x[S]+k&&(x[N]=x[S]+k,w.nodes.indexOf(N)<0?w.push(N):w.updateItem(N),b[N]=0,L[N]=[]),x[N]==x[S]+k&&(b[N]=b[N]+b[S],L[N].push(S))}else for(var R=0;R<u[S].length;R++){var B=u[S][R].id();x[B]==1/0&&(w.push(B),x[B]=x[S]+1),x[B]==x[S]+1&&(b[B]=b[B]+b[S],L[B].push(S))}}for(var z={},F=0;F<o.length;F++)z[o[F].id()]=0;for(;D.length>0;){for(var V=D.pop(),U=0;U<L[V].length;U++){var $=L[V][U];z[$]=z[$]+b[$]/b[V]*(1+z[V])}V!=o[m].id()&&h.set(V,h.get(V)+z[V])}},y=0;y<o.length;y++)g(y);var p={betweenness:function(m){var T=s.collection(m).id();return h.get(T)},betweennessNormalized:function(m){if(f==0)return 0;var T=s.collection(m).id();return h.get(T)/f}};return p.betweennessNormalised=p.betweennessNormalized,p}};Ln.bc=Ln.betweennessCentrality;var Ff=Ze({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),Gf=function(e){return Ff(e)},zf=function(e,t){for(var a=0,n=0;n<t.length;n++)a+=t[n](e);return a},Vf=function(e,t,a){for(var n=0;n<t;n++)e[n*t+n]=a},Us=function(e,t){for(var a,n=0;n<t;n++){a=0;for(var i=0;i<t;i++)a+=e[i*t+n];for(var s=0;s<t;s++)e[s*t+n]=e[s*t+n]/a}},$f=function(e,t,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var s=0;s<a;s++)n[i*a+s]=0;for(var o=0;o<a;o++)for(var u=0;u<a;u++)n[i*a+u]+=e[i*a+o]*t[o*a+u]}return n},Yf=function(e,t,a){for(var n=e.slice(0),i=1;i<a;i++)e=$f(e,n,t);return e},Uf=function(e,t,a){for(var n=new Array(t*t),i=0;i<t*t;i++)n[i]=Math.pow(e[i],a);return Us(n,t),n},Hf=function(e,t,a,n){for(var i=0;i<a;i++){var s=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),o=Math.round(t[i]*Math.pow(10,n))/Math.pow(10,n);if(s!==o)return!1}return!0},Xf=function(e,t,a,n){for(var i=[],s=0;s<t;s++){for(var o=[],u=0;u<t;u++)Math.round(e[s*t+u]*1e3)/1e3>0&&o.push(a[u]);o.length!==0&&i.push(n.collection(o))}return i},qf=function(e,t){for(var a=0;a<e.length;a++)if(!t[a]||e[a].id()!==t[a].id())return!1;return!0},Wf=function(e){for(var t=0;t<e.length;t++)for(var a=0;a<e.length;a++)t!=a&&qf(e[t],e[a])&&e.splice(a,1);return e},wi=function(e){for(var t=this.nodes(),a=this.edges(),n=this.cy(),i=Gf(e),s={},o=0;o<t.length;o++)s[t[o].id()]=o;for(var u=t.length,l=u*u,f=new Array(l),h,c=0;c<l;c++)f[c]=0;for(var v=0;v<a.length;v++){var d=a[v],g=s[d.source().id()],y=s[d.target().id()],p=zf(d,i.attributes);f[g*u+y]+=p,f[y*u+g]+=p}Vf(f,u,i.multFactor),Us(f,u);for(var E=!0,m=0;E&&m<i.maxIterations;)E=!1,h=Yf(f,u,i.expandFactor),f=Uf(h,u,i.inflateFactor),Hf(f,h,l,4)||(E=!0),m++;var T=Xf(f,u,t,n);return T=Wf(T),T},_f={markovClustering:wi,mcl:wi},Kf=function(e){return e},Hs=function(e,t){return Math.abs(t-e)},xi=function(e,t,a){return e+Hs(t,a)},Ti=function(e,t,a){return e+Math.pow(a-t,2)},Zf=function(e){return Math.sqrt(e)},Qf=function(e,t,a){return Math.max(e,Hs(t,a))},Fr=function(e,t,a,n,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Kf,o=n,u,l,f=0;f<e;f++)u=t(f),l=a(f),o=i(o,u,l);return s(o)},Lr={euclidean:function(e,t,a){return e>=2?Fr(e,t,a,0,Ti,Zf):Fr(e,t,a,0,xi)},squaredEuclidean:function(e,t,a){return Fr(e,t,a,0,Ti)},manhattan:function(e,t,a){return Fr(e,t,a,0,xi)},max:function(e,t,a){return Fr(e,t,a,-1/0,Qf)}};Lr["squared-euclidean"]=Lr.squaredEuclidean;Lr.squaredeuclidean=Lr.squaredEuclidean;function Qa(r,e,t,a,n,i){var s;return Fe(r)?s=r:s=Lr[r]||Lr.euclidean,e===0&&Fe(r)?s(n,i):s(e,t,a,n,i)}var Jf=Ze({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Wn=function(e){return Jf(e)},Va=function(e,t,a,n,i){var s=i!=="kMedoids",o=s?function(h){return a[h]}:function(h){return n[h](a)},u=function(c){return n[c](t)},l=a,f=t;return Qa(e,n.length,o,u,l,f)},gn=function(e,t,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(t),u=null,l=0;l<n;l++)i[l]=e.min(a[l]).value,s[l]=e.max(a[l]).value;for(var f=0;f<t;f++){u=[];for(var h=0;h<n;h++)u[h]=Math.random()*(s[h]-i[h])+i[h];o[f]=u}return o},Xs=function(e,t,a,n,i){for(var s=1/0,o=0,u=0;u<t.length;u++){var l=Va(a,e,t[u],n,i);l<s&&(s=l,o=u)}return o},qs=function(e,t,a){for(var n=[],i=null,s=0;s<t.length;s++)i=t[s],a[i.id()]===e&&n.push(i);return n},jf=function(e,t,a){return Math.abs(t-e)<=a},eh=function(e,t,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var s=Math.abs(e[n][i]-t[n][i]);if(s>a)return!1}return!0},th=function(e,t,a){for(var n=0;n<a;n++)if(e===t[n])return!0;return!1},Di=function(e,t){var a=new Array(t);if(e.length<50)for(var n=0;n<t;n++){for(var i=e[Math.floor(Math.random()*e.length)];th(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var s=0;s<t;s++)a[s]=e[Math.floor(Math.random()*e.length)];return a},Ci=function(e,t,a){for(var n=0,i=0;i<t.length;i++)n+=Va("manhattan",t[i],e,a,"kMedoids");return n},rh=function(e){var t=this.cy(),a=this.nodes(),n=null,i=Wn(e),s=new Array(i.k),o={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=gn(a,i.k,i.attributes)):Ye(i.testCentroids)==="object"?u=i.testCentroids:u=gn(a,i.k,i.attributes):u=gn(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],o[n.id()]=Xs(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var c=0;c<i.k;c++){var v=qs(c,a,o);if(v.length!==0){for(var d=i.attributes.length,g=u[c],y=new Array(d),p=new Array(d),E=0;E<d;E++){p[E]=0;for(var m=0;m<v.length;m++)n=v[m],p[E]+=i.attributes[E](n);y[E]=p[E]/v.length,jf(y[E],g[E],i.sensitivityThreshold)||(l=!0)}u[c]=y,s[c]=t.collection(v)}}f++}return s},ah=function(e){var t=this.cy(),a=this.nodes(),n=null,i=Wn(e),s=new Array(i.k),o,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(Ye(i.testCentroids)==="object"?o=i.testCentroids:o=Di(a,i.k)):o=Di(a,i.k);for(var h=!0,c=0;h&&c<i.maxIterations;){for(var v=0;v<a.length;v++)n=a[v],u[n.id()]=Xs(n,o,i.distance,i.attributes,"kMedoids");h=!1;for(var d=0;d<o.length;d++){var g=qs(d,a,u);if(g.length!==0){f[d]=Ci(o[d],g,i.attributes);for(var y=0;y<g.length;y++)l=Ci(g[y],g,i.attributes),l<f[d]&&(f[d]=l,o[d]=g[y],h=!0);s[d]=t.collection(g)}}c++}return s},nh=function(e,t,a,n,i){for(var s,o,u=0;u<t.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++){s=0,o=0;for(var c=0;c<t.length;c++)s+=n[c][f]*i.attributes[h](t[c]),o+=n[c][f];e[f][h]=s/o}},ih=function(e,t,a,n,i){for(var s=0;s<e.length;s++)t[s]=e[s].slice();for(var o,u,l,f=2/(i.m-1),h=0;h<a.length;h++)for(var c=0;c<n.length;c++){o=0;for(var v=0;v<a.length;v++)u=Va(i.distance,n[c],a[h],i.attributes,"cmeans"),l=Va(i.distance,n[c],a[v],i.attributes,"cmeans"),o+=Math.pow(u/l,f);e[c][h]=1/o}},sh=function(e,t,a,n){for(var i=new Array(a.k),s=0;s<i.length;s++)i[s]=[];for(var o,u,l=0;l<t.length;l++){o=-1/0,u=-1;for(var f=0;f<t[0].length;f++)t[l][f]>o&&(o=t[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},Li=function(e){var t=this.cy(),a=this.nodes(),n=Wn(e),i,s,o,u,l;u=new Array(a.length);for(var f=0;f<a.length;f++)u[f]=new Array(n.k);o=new Array(a.length);for(var h=0;h<a.length;h++)o[h]=new Array(n.k);for(var c=0;c<a.length;c++){for(var v=0,d=0;d<n.k;d++)o[c][d]=Math.random(),v+=o[c][d];for(var g=0;g<n.k;g++)o[c][g]=o[c][g]/v}s=new Array(n.k);for(var y=0;y<n.k;y++)s[y]=new Array(n.attributes.length);l=new Array(a.length);for(var p=0;p<a.length;p++)l[p]=new Array(n.k);for(var E=!0,m=0;E&&m<n.maxIterations;)E=!1,nh(s,a,o,l,n),ih(o,u,s,a,n),eh(o,u,n.sensitivityThreshold)||(E=!0),m++;return i=sh(a,o,n,t),{clusters:i,degreeOfMembership:o}},oh={kMeans:rh,kMedoids:ah,fuzzyCMeans:Li,fcm:Li},uh=Ze({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),lh={single:"min",complete:"max"},fh=function(e){var t=uh(e),a=lh[t.linkage];return a!=null&&(t.linkage=a),t},Si=function(e,t,a,n,i){for(var s=0,o=1/0,u,l=i.attributes,f=function(w,C){return Qa(i.distance,l.length,function(A){return l[A](w)},function(A){return l[A](C)},w,C)},h=0;h<e.length;h++){var c=e[h].key,v=a[c][n[c]];v<o&&(s=c,o=v)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=t[s],g=t[n[s]],y;i.mode==="dendrogram"?y={left:d,right:g,key:d.key}:y={value:d.value.concat(g.value),key:d.key},e[d.index]=y,e.splice(g.index,1),t[d.key]=y;for(var p=0;p<e.length;p++){var E=e[p];d.key===E.key?u=1/0:i.linkage==="min"?(u=a[d.key][E.key],a[d.key][E.key]>a[g.key][E.key]&&(u=a[g.key][E.key])):i.linkage==="max"?(u=a[d.key][E.key],a[d.key][E.key]<a[g.key][E.key]&&(u=a[g.key][E.key])):i.linkage==="mean"?u=(a[d.key][E.key]*d.size+a[g.key][E.key]*g.size)/(d.size+g.size):i.mode==="dendrogram"?u=f(E.value,d.value):u=f(E.value[0],d.value[0]),a[d.key][E.key]=a[E.key][d.key]=u}for(var m=0;m<e.length;m++){var T=e[m].key;if(n[T]===d.key||n[T]===g.key){for(var D=T,L=0;L<e.length;L++){var b=e[L].key;a[T][b]<a[T][D]&&(D=b)}n[T]=D}e[m].index=m}return d.key=g.key=d.index=g.index=null,!0},xa=function r(e,t,a){!e||(e.value?t.push(e.value):(e.left&&r(e.left,t),e.right&&r(e.right,t)))},hh=function r(e,t){if(!e)return"";if(e.left&&e.right){var a=r(e.left,t),n=r(e.right,t),i=t.add({group:"nodes",data:{id:a+","+n}});return t.add({group:"edges",data:{source:a,target:i.id()}}),t.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},vh=function r(e,t,a){if(!e)return[];var n=[],i=[],s=[];return t===0?(e.left&&xa(e.left,n),e.right&&xa(e.right,i),s=n.concat(i),[a.collection(s)]):t===1?e.value?[a.collection(e.value)]:(e.left&&xa(e.left,n),e.right&&xa(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=r(e.left,t-1,a)),e.right&&(i=r(e.right,t-1,a)),n.concat(i))},Ai=function(e){for(var t=this.cy(),a=this.nodes(),n=fh(e),i=n.attributes,s=function(m,T){return Qa(n.distance,i.length,function(D){return i[D](m)},function(D){return i[D](T)},m,T)},o=[],u=[],l=[],f=[],h=0;h<a.length;h++){var c={value:n.mode==="dendrogram"?a[h]:[a[h]],key:h,index:h};o[h]=c,f[h]=c,u[h]=[],l[h]=0}for(var v=0;v<o.length;v++)for(var d=0;d<=v;d++){var g=void 0;n.mode==="dendrogram"?g=v===d?1/0:s(o[v].value,o[d].value):g=v===d?1/0:s(o[v].value[0],o[d].value[0]),u[v][d]=g,u[d][v]=g,g<u[v][l[v]]&&(l[v]=d)}for(var y=Si(o,f,u,l,n);y;)y=Si(o,f,u,l,n);var p;return n.mode==="dendrogram"?(p=vh(o[0],n.dendrogramDepth,t),n.addDendrogram&&hh(o[0],t)):(p=new Array(o.length),o.forEach(function(E,m){E.key=E.index=null,p[m]=t.collection(E.value)})),p},ch={hierarchicalClustering:Ai,hca:Ai},dh=Ze({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),gh=function(e){var t=e.damping,a=e.preference;.5<=t&&t<1||ze("Damping must range on [0.5, 1). Got: ".concat(t));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||ae(a)||ze("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),dh(e)},ph=function(e,t,a,n){var i=function(o,u){return n[u](o)};return-Qa(e,n.length,function(s){return i(t,s)},function(s){return i(a,s)},t,a)},yh=function(e,t){var a=null;return t==="median"?a=gf(e):t==="mean"?a=df(e):t==="min"?a=vf(e):t==="max"?a=cf(e):a=t,a},mh=function(e,t,a){for(var n=[],i=0;i<e;i++)t[i*e+i]+a[i*e+i]>0&&n.push(i);return n},Ni=function(e,t,a){for(var n=[],i=0;i<e;i++){for(var s=-1,o=-1/0,u=0;u<a.length;u++){var l=a[u];t[i*e+l]>o&&(s=l,o=t[i*e+l])}s>0&&n.push(s)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},bh=function(e,t,a){for(var n=Ni(e,t,a),i=0;i<a.length;i++){for(var s=[],o=0;o<n.length;o++)n[o]===a[i]&&s.push(o);for(var u=-1,l=-1/0,f=0;f<s.length;f++){for(var h=0,c=0;c<s.length;c++)h+=t[s[c]*e+s[f]];h>l&&(u=f,l=h)}a[i]=s[u]}return n=Ni(e,t,a),n},Mi=function(e){for(var t=this.cy(),a=this.nodes(),n=gh(e),i={},s=0;s<a.length;s++)i[a[s].id()]=s;var o,u,l,f,h,c;o=a.length,u=o*o,l=new Array(u);for(var v=0;v<u;v++)l[v]=-1/0;for(var d=0;d<o;d++)for(var g=0;g<o;g++)d!==g&&(l[d*o+g]=ph(n.distance,a[d],a[g],n.attributes));f=yh(l,n.preference);for(var y=0;y<o;y++)l[y*o+y]=f;h=new Array(u);for(var p=0;p<u;p++)h[p]=0;c=new Array(u);for(var E=0;E<u;E++)c[E]=0;for(var m=new Array(o),T=new Array(o),D=new Array(o),L=0;L<o;L++)m[L]=0,T[L]=0,D[L]=0;for(var b=new Array(o*n.minIterations),x=0;x<b.length;x++)b[x]=0;var w;for(w=0;w<n.maxIterations;w++){for(var C=0;C<o;C++){for(var A=-1/0,S=-1/0,O=-1,N=0,P=0;P<o;P++)m[P]=h[C*o+P],N=c[C*o+P]+l[C*o+P],N>=A?(S=A,A=N,O=P):N>S&&(S=N);for(var I=0;I<o;I++)h[C*o+I]=(1-n.damping)*(l[C*o+I]-A)+n.damping*m[I];h[C*o+O]=(1-n.damping)*(l[C*o+O]-S)+n.damping*m[O]}for(var k=0;k<o;k++){for(var R=0,B=0;B<o;B++)m[B]=c[B*o+k],T[B]=Math.max(0,h[B*o+k]),R+=T[B];R-=T[k],T[k]=h[k*o+k],R+=T[k];for(var z=0;z<o;z++)c[z*o+k]=(1-n.damping)*Math.min(0,R-T[z])+n.damping*m[z];c[k*o+k]=(1-n.damping)*(R-T[k])+n.damping*m[k]}for(var F=0,V=0;V<o;V++){var U=c[V*o+V]+h[V*o+V]>0?1:0;b[w%n.minIterations*o+V]=U,F+=U}if(F>0&&(w>=n.minIterations-1||w==n.maxIterations-1)){for(var $=0,X=0;X<o;X++){D[X]=0;for(var H=0;H<n.minIterations;H++)D[X]+=b[H*o+X];(D[X]===0||D[X]===n.minIterations)&&$++}if($===o)break}}for(var G=mh(o,h,c),q=bh(o,l,G),K={},Z=0;Z<G.length;Z++)K[G[Z]]=[];for(var te=0;te<a.length;te++){var he=i[a[te].id()],de=q[he];de!=null&&K[de].push(a[te])}for(var ee=new Array(G.length),re=0;re<G.length;re++)ee[re]=t.collection(K[G[re]]);return ee},Eh={affinityPropagation:Mi,ap:Mi},wh=Ze({root:void 0,directed:!1}),xh={hierholzer:function(e){if(!Te(e)){var t=arguments;e={root:t[0],directed:t[1]}}var a=wh(e),n=a.root,i=a.directed,s=this,o=!1,u,l,f;n&&(f=le(n)?this.filter(n)[0].id():n[0].id());var h={},c={};i?s.forEach(function(E){var m=E.id();if(E.isNode()){var T=E.indegree(!0),D=E.outdegree(!0),L=T-D,b=D-T;L==1?u?o=!0:u=m:b==1?l?o=!0:l=m:(b>1||L>1)&&(o=!0),h[m]=[],E.outgoers().forEach(function(x){x.isEdge()&&h[m].push(x.id())})}else c[m]=[void 0,E.target().id()]}):s.forEach(function(E){var m=E.id();if(E.isNode()){var T=E.degree(!0);T%2&&(u?l?o=!0:l=m:u=m),h[m]=[],E.connectedEdges().forEach(function(D){return h[m].push(D.id())})}else c[m]=[E.source().id(),E.target().id()]});var v={found:!1,trail:void 0};if(o)return v;if(l&&u)if(i){if(f&&l!=f)return v;f=l}else{if(f&&l!=f&&u!=f)return v;f||(f=l)}else f||(f=s[0].id());var d=function(m){for(var T=m,D=[m],L,b,x;h[T].length;)L=h[T].shift(),b=c[L][0],x=c[L][1],T!=x?(h[x]=h[x].filter(function(w){return w!=L}),T=x):!i&&T!=b&&(h[b]=h[b].filter(function(w){return w!=L}),T=b),D.unshift(L),D.unshift(T);return D},g=[],y=[];for(y=d(f);y.length!=1;)h[y[0]].length==0?(g.unshift(s.getElementById(y.shift())),g.unshift(s.getElementById(y.shift()))):y=d(y.shift()).concat(y);g.unshift(s.getElementById(y.shift()));for(var p in h)if(h[p].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Ta=function(){var e=this,t={},a=0,n=0,i=[],s=[],o={},u=function(c,v){for(var d=s.length-1,g=[],y=e.spawn();s[d].x!=c||s[d].y!=v;)g.push(s.pop().edge),d--;g.push(s.pop().edge),g.forEach(function(p){var E=p.connectedNodes().intersection(e);y.merge(p),E.forEach(function(m){var T=m.id(),D=m.connectedEdges().intersection(e);y.merge(m),t[T].cutVertex?y.merge(D.filter(function(L){return L.isLoop()})):y.merge(D)})}),i.push(y)},l=function h(c,v,d){c===d&&(n+=1),t[v]={id:a,low:a++,cutVertex:!1};var g=e.getElementById(v).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(v)));else{var y,p,E,m;g.forEach(function(T){y=T.source().id(),p=T.target().id(),E=y===v?p:y,E!==d&&(m=T.id(),o[m]||(o[m]=!0,s.push({x:v,y:E,edge:T})),E in t?t[v].low=Math.min(t[v].low,t[E].id):(h(c,E,v),t[v].low=Math.min(t[v].low,t[E].low),t[v].id<=t[E].low&&(t[v].cutVertex=!0,u(v,E))))})}};e.forEach(function(h){if(h.isNode()){var c=h.id();c in t||(n=0,l(c,c),t[c].cutVertex=n>1)}});var f=Object.keys(t).filter(function(h){return t[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(f),components:i}},Th={hopcroftTarjanBiconnected:Ta,htbc:Ta,htb:Ta,hopcroftTarjanBiconnectedComponents:Ta},Da=function(){var e=this,t={},a=0,n=[],i=[],s=e.spawn(e),o=function u(l){i.push(l),t[l]={index:a,low:a++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(g){var y=g.target().id();y!==l&&(y in t||u(y),t[y].explored||(t[l].low=Math.min(t[l].low,t[y].low)))}),t[l].index===t[l].low){for(var h=e.spawn();;){var c=i.pop();if(h.merge(e.getElementById(c)),t[c].low=t[l].index,t[c].explored=!0,c===l)break}var v=h.edgesWith(h),d=h.merge(v);n.push(d),s=s.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in t||o(l)}}),{cut:s,components:n}},Dh={tarjanStronglyConnected:Da,tsc:Da,tscc:Da,tarjanStronglyConnectedComponents:Da},Ws={};[Jr,jl,ef,rf,nf,of,ff,Pf,xr,Tr,Ln,_f,oh,ch,Eh,xh,Th,Dh].forEach(function(r){ce(Ws,r)});/*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*/var _s=0,Ks=1,Zs=2,Rt=function r(e){if(!(this instanceof r))return new r(e);this.id="Thenable/1.0.7",this.state=_s,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))};Rt.prototype={fulfill:function(e){return Oi(this,Ks,"fulfillValue",e)},reject:function(e){return Oi(this,Zs,"rejectReason",e)},then:function(e,t){var a=this,n=new Rt;return a.onFulfilled.push(Ri(e,n,"fulfill")),a.onRejected.push(Ri(t,n,"reject")),Qs(a),n.proxy}};var Oi=function(e,t,a,n){return e.state===_s&&(e.state=t,e[a]=n,Qs(e)),e},Qs=function(e){e.state===Ks?Ii(e,"onFulfilled",e.fulfillValue):e.state===Zs&&Ii(e,"onRejected",e.rejectReason)},Ii=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var o=0;o<n.length;o++)n[o](a)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Ri=function(e,t,a){return function(n){if(typeof e!="function")t[a].call(t,n);else{var i;try{i=e(n)}catch(s){t.reject(s);return}Ch(t,i)}}},Ch=function r(e,t){if(e===t||e.proxy===t){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(Ye(t)==="object"&&t!==null||typeof t=="function")try{a=t.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(t,function(i){n||(n=!0,i===t?e.reject(new TypeError("circular thenable chain")):r(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(t)};Rt.all=function(r){return new Rt(function(e,t){for(var a=new Array(r.length),n=0,i=function(u,l){a[u]=l,n++,n===r.length&&e(a)},s=0;s<r.length;s++)(function(o){var u=r[o],l=u!=null&&u.then!=null;if(l)u.then(function(h){i(o,h)},function(h){t(h)});else{var f=u;i(o,f)}})(s)})};Rt.resolve=function(r){return new Rt(function(e,t){e(r)})};Rt.reject=function(r){return new Rt(function(e,t){t(r)})};var Nr=typeof Promise<"u"?Promise:Rt,Sn=function(e,t,a){var n=zn(e),i=!n,s=this._private=ce({duration:1e3},t,a);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&Fe(s.complete)&&s.completes.push(s.complete),i){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(n){var u=e.pan();s.startPan={x:u.x,y:u.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},ar=Sn.prototype;ce(ar,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,a=e.target._private.animation;e.queue?t=a.queue:t=a.current,t.push(this),ft(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 t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,a=t.playing;return e===void 0?t.progress:(a&&this.pause(),t.progress=e,t.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&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],s=i.name,o=e.startStyle[s];e.startStyle[s]=i,e.style[n]=o}return t&&this.play(),this},promise:function(e){var t=this._private,a;switch(e){case"frame":a=t.frames;break;default:case"complete":case"completed":a=t.completes}return new Nr(function(n,i){a.push(function(){n()})})}});ar.complete=ar.completed;ar.run=ar.play;ar.running=ar.playing;var Lh={animated:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=n[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<n.length;s++){var o=n[s];o._private.animation.queue=[]}return this}},delay:function(){return function(t,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:t,duration:t,complete:a}):this}},delayAnimation:function(){return function(t,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:t,duration:t,complete:a}):this}},animation:function(){return function(t,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this,u=!i,l=!u;if(!o.styleEnabled())return this;var f=o.style();t=ce({},t,a);var h=Object.keys(t).length===0;if(h)return new Sn(s[0],t);switch(t.duration===void 0&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(l&&(t.style=f.getPropsList(t.style||t.css),t.css=void 0),l&&t.renderedPosition!=null){var c=t.renderedPosition,v=o.pan(),d=o.zoom();t.position=Ps(c,d,v)}if(u&&t.panBy!=null){var g=t.panBy,y=o.pan();t.pan={x:y.x+g.x,y:y.y+g.y}}var p=t.center||t.centre;if(u&&p!=null){var E=o.getCenterPan(p.eles,t.zoom);E!=null&&(t.pan=E)}if(u&&t.fit!=null){var m=t.fit,T=o.getFitViewport(m.eles||m.boundingBox,m.padding);T!=null&&(t.pan=T.pan,t.zoom=T.zoom)}if(u&&Te(t.zoom)){var D=o.getZoomedViewport(t.zoom);D!=null?(D.zoomed&&(t.zoom=D.zoom),D.panned&&(t.pan=D.pan)):t.zoom=null}return new Sn(s[0],t)}},animate:function(){return function(t,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;a&&(t=ce({},t,a));for(var u=0;u<s.length;u++){var l=s[u],f=l.animated()&&(t.queue===void 0||t.queue),h=l.animation(t,f?{queue:!0}:void 0);h.play()}return this}},stop:function(){return function(t,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var u=0;u<s.length;u++){for(var l=s[u],f=l._private,h=f.animation.current,c=0;c<h.length;c++){var v=h[c],d=v._private;a&&(d.duration=0)}t&&(f.animation.queue=[]),a||(f.animation.current=[])}return o.notify("draw"),this}}},Sh={data:function(e){var t={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=ce({},t,e),function(n,i){var s=e,o=this,u=o.length!==void 0,l=u?o:[o],f=u?o[0]:o;if(le(n)){var h=n.indexOf(".")!==-1,c=h&&hl.default(n);if(s.allowGetting&&i===void 0){var v;return f&&(s.beforeGet(f),c&&f._private[s.field][n]===void 0?v=ll.default(f._private[s.field],c):v=f._private[s.field][n]),v}else if(s.allowSetting&&i!==void 0){var d=!s.immutableKeys[n];if(d){var g=bs({},n,i);s.beforeSet(o,g);for(var y=0,p=l.length;y<p;y++){var E=l[y];s.canSet(E)&&(c&&f._private[s.field][n]===void 0?fl.default(E._private[s.field],c,i):E._private[s.field][n]=i)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Te(n)){var m=n,T,D,L=Object.keys(m);s.beforeSet(o,m);for(var b=0;b<L.length;b++){T=L[b],D=m[T];var x=!s.immutableKeys[T];if(x)for(var w=0;w<l.length;w++){var C=l[w];s.canSet(C)&&(C._private[s.field][T]=D)}}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Fe(n)){var A=n;o.on(s.bindingEvent,A)}else if(s.allowGetting&&n===void 0){var S;return f&&(s.beforeGet(f),S=f._private[s.field]),S}return o}},removeData:function(e){var t={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=ce({},t,e),function(n){var i=e,s=this,o=s.length!==void 0,u=o?s:[s];if(le(n)){for(var l=n.split(/\s+/),f=l.length,h=0;h<f;h++){var c=l[h];if(!Ut(c)){var v=!i.immutableKeys[c];if(v)for(var d=0,g=u.length;d<g;d++)u[d]._private[i.field][c]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(n===void 0){for(var y=0,p=u.length;y<p;y++)for(var E=u[y]._private[i.field],m=Object.keys(E),T=0;T<m.length;T++){var D=m[T],L=!i.immutableKeys[D];L&&(E[D]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},Ah={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(a,n){var i=this,s=Array.prototype.slice.call(arguments,0);return new Nr(function(o,u){var l=function(v){i.off.apply(i,h),o(v)},f=s.concat([l]),h=f.concat([]);i.on.apply(i,f)})}}},Se={};[Lh,Sh,Ah].forEach(function(r){ce(Se,r)});var Nh={animate:Se.animate(),animation:Se.animation(),animated:Se.animated(),clearQueue:Se.clearQueue(),delay:Se.delay(),delayAnimation:Se.delayAnimation(),stop:Se.stop()},Oa={classes:function(e){var t=this;if(e===void 0){var a=[];return t[0]._private.classes.forEach(function(d){return a.push(d)}),a}else Ie(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new Ar(e),s=0;s<t.length;s++){for(var o=t[s],u=o._private,l=u.classes,f=!1,h=0;h<e.length;h++){var c=e[h],v=l.has(c);if(!v){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=i,n.push(o))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Ie(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],s=0,o=a.length;s<o;s++)for(var u=a[s],l=u._private.classes,f=!1,h=0;h<e.length;h++){var c=e[h],v=l.has(c),d=!1;t||n&&!v?(l.add(c),d=!0):(!t||n&&v)&&(l.delete(c),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,t){var a=this;if(t==null)t=250;else if(t===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},t),a}};Oa.className=Oa.classNames=Oa.classes;var xe={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:$e,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};xe.variable="(?:[\\w-.]|(?:\\\\"+xe.metaChar+"))+";xe.className="(?:[\\w-]|(?:\\\\"+xe.metaChar+"))+";xe.value=xe.string+"|"+xe.number;xe.id=xe.variable;(function(){var r,e,t;for(r=xe.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],xe.comparatorOp+="|@"+e;for(r=xe.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],!(e.indexOf("!")>=0)&&e!=="="&&(xe.comparatorOp+="|\\!"+e)})();var Me=function(){return{checks:[]}},ie={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},An=[{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(r,e){return Il(r.selector,e.selector)}),Mh=function(){for(var r={},e,t=0;t<An.length;t++)e=An[t],r[e.selector]=e.matches;return r}(),Oh=function(e,t){return Mh[e](t)},Ih="("+An.map(function(r){return r.selector}).join("|")+")",cr=function(e){return e.replace(new RegExp("\\\\("+xe.metaChar+")","g"),function(t,a){return a})},Gt=function(e,t,a){e[e.length-1]=a},Nn=[{name:"group",query:!0,regex:"("+xe.group+")",populate:function(e,t,a){var n=Mt(a,1),i=n[0];t.checks.push({type:ie.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Ih,populate:function(e,t,a){var n=Mt(a,1),i=n[0];t.checks.push({type:ie.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+xe.id+")",populate:function(e,t,a){var n=Mt(a,1),i=n[0];t.checks.push({type:ie.ID,value:cr(i)})}},{name:"className",query:!0,regex:"\\.("+xe.className+")",populate:function(e,t,a){var n=Mt(a,1),i=n[0];t.checks.push({type:ie.CLASS,value:cr(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+xe.variable+")\\s*\\]",populate:function(e,t,a){var n=Mt(a,1),i=n[0];t.checks.push({type:ie.DATA_EXIST,field:cr(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+xe.variable+")\\s*("+xe.comparatorOp+")\\s*("+xe.value+")\\s*\\]",populate:function(e,t,a){var n=Mt(a,3),i=n[0],s=n[1],o=n[2],u=new RegExp("^"+xe.string+"$").exec(o)!=null;u?o=o.substring(1,o.length-1):o=parseFloat(o),t.checks.push({type:ie.DATA_COMPARE,field:cr(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+xe.boolOp+")\\s*("+xe.variable+")\\s*\\]",populate:function(e,t,a){var n=Mt(a,2),i=n[0],s=n[1];t.checks.push({type:ie.DATA_BOOL,field:cr(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+xe.meta+")\\s*("+xe.comparatorOp+")\\s*("+xe.number+")\\s*\\]\\]",populate:function(e,t,a){var n=Mt(a,3),i=n[0],s=n[1],o=n[2];t.checks.push({type:ie.META_COMPARE,field:cr(i),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:xe.separator,populate:function(e,t){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,s=e[e.length-1];a!=null&&(s.subject=a,e.currentSubject=null),s.edgeCount=n,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=Me();return o}},{name:"directedEdge",separator:!0,regex:xe.directedEdge,populate:function(e,t){if(e.currentSubject==null){var a=Me(),n=t,i=Me();return a.checks.push({type:ie.DIRECTED_EDGE,source:n,target:i}),Gt(e,t,a),e.edgeCount++,i}else{var s=Me(),o=t,u=Me();return s.checks.push({type:ie.NODE_SOURCE,source:o,target:u}),Gt(e,t,s),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:xe.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var a=Me(),n=t,i=Me();return a.checks.push({type:ie.UNDIRECTED_EDGE,nodes:[n,i]}),Gt(e,t,a),e.edgeCount++,i}else{var s=Me(),o=t,u=Me();return s.checks.push({type:ie.NODE_NEIGHBOR,node:o,neighbor:u}),Gt(e,t,s),u}}},{name:"child",separator:!0,regex:xe.child,populate:function(e,t){if(e.currentSubject==null){var a=Me(),n=Me(),i=e[e.length-1];return a.checks.push({type:ie.CHILD,parent:i,child:n}),Gt(e,t,a),e.compoundCount++,n}else if(e.currentSubject===t){var s=Me(),o=e[e.length-1],u=Me(),l=Me(),f=Me(),h=Me();return s.checks.push({type:ie.COMPOUND_SPLIT,left:o,right:u,subject:l}),l.checks=t.checks,t.checks=[{type:ie.TRUE}],h.checks.push({type:ie.TRUE}),u.checks.push({type:ie.PARENT,parent:h,child:f}),Gt(e,o,s),e.currentSubject=l,e.compoundCount++,f}else{var c=Me(),v=Me(),d=[{type:ie.PARENT,parent:c,child:v}];return c.checks=t.checks,t.checks=d,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:xe.descendant,populate:function(e,t){if(e.currentSubject==null){var a=Me(),n=Me(),i=e[e.length-1];return a.checks.push({type:ie.DESCENDANT,ancestor:i,descendant:n}),Gt(e,t,a),e.compoundCount++,n}else if(e.currentSubject===t){var s=Me(),o=e[e.length-1],u=Me(),l=Me(),f=Me(),h=Me();return s.checks.push({type:ie.COMPOUND_SPLIT,left:o,right:u,subject:l}),l.checks=t.checks,t.checks=[{type:ie.TRUE}],h.checks.push({type:ie.TRUE}),u.checks.push({type:ie.ANCESTOR,ancestor:h,descendant:f}),Gt(e,o,s),e.currentSubject=l,e.compoundCount++,f}else{var c=Me(),v=Me(),d=[{type:ie.ANCESTOR,ancestor:c,descendant:v}];return c.checks=t.checks,t.checks=d,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:xe.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Ae("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;i===ie.DIRECTED_EDGE?n.type=ie.NODE_TARGET:i===ie.UNDIRECTED_EDGE&&(n.type=ie.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Nn.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var Rh=function(e){for(var t,a,n,i=0;i<Nn.length;i++){var s=Nn[i],o=s.name,u=e.match(s.regexObj);if(u!=null){a=u,t=s,n=o;var l=u[0];e=e.substring(l.length);break}}return{expr:t,match:a,name:n,remaining:e}},kh=function(e){var t=e.match(/^\s+/);if(t){var a=t[0];e=e.substring(a.length)}return e},Ph=function(e){var t=this,a=t.inputText=e,n=t[0]=Me();for(t.length=1,a=kh(a);;){var i=Rh(a);if(i.expr==null)return Ae("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),o=i.expr.populate(t,n,s);if(o===!1)return!1;if(o!=null&&(n=o),a=i.remaining,a.match(/^\s*$/))break}var u=t[t.length-1];t.currentSubject!=null&&(u.subject=t.currentSubject),u.edgeCount=t.edgeCount,u.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var f=t[l];if(f.compoundCount>0&&f.edgeCount>0)return Ae("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Ae("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Ae("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},Bh=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f==null?"":f},t=function(f){return le(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,h){var c=f.type,v=f.value;switch(c){case ie.GROUP:{var d=e(v);return d.substring(0,d.length-1)}case ie.DATA_COMPARE:{var g=f.field,y=f.operator;return"["+g+a(e(y))+t(v)+"]"}case ie.DATA_BOOL:{var p=f.operator,E=f.field;return"["+e(p)+E+"]"}case ie.DATA_EXIST:{var m=f.field;return"["+m+"]"}case ie.META_COMPARE:{var T=f.operator,D=f.field;return"[["+D+a(e(T))+t(v)+"]]"}case ie.STATE:return v;case ie.ID:return"#"+v;case ie.CLASS:return"."+v;case ie.PARENT:case ie.CHILD:return i(f.parent,h)+a(">")+i(f.child,h);case ie.ANCESTOR:case ie.DESCENDANT:return i(f.ancestor,h)+" "+i(f.descendant,h);case ie.COMPOUND_SPLIT:{var L=i(f.left,h),b=i(f.subject,h),x=i(f.right,h);return L+(L.length>0?" ":"")+b+x}case ie.TRUE:return""}},i=function(f,h){return f.checks.reduce(function(c,v,d){return c+(h===f&&d===0?"$":"")+n(v,h)},"")},s="",o=0;o<this.length;o++){var u=this[o];s+=i(u,u.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s},Fh={parse:Ph,toString:Bh},Js=function(e,t,a){var n,i=le(e),s=ae(e),o=le(a),u,l,f=!1,h=!1,c=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),h=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),f=!0),(i||o||f)&&(u=!i&&!s?"":""+e,l=""+a),f&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),t){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">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e<a;break;case"<=":c=!0,n=e<=a;break;default:n=!1;break}return h&&(e!=null||!c)&&(n=!n),n},Gh=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},zh=function(e){return e!==void 0},_n=function(e,t){return e.data(t)},Vh=function(e,t){return e[t]()},Ve=[],Pe=function(e,t){return e.checks.every(function(a){return Ve[a.type](a,t)})};Ve[ie.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()};Ve[ie.STATE]=function(r,e){var t=r.value;return Oh(t,e)};Ve[ie.ID]=function(r,e){var t=r.value;return e.id()===t};Ve[ie.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)};Ve[ie.META_COMPARE]=function(r,e){var t=r.field,a=r.operator,n=r.value;return Js(Vh(e,t),a,n)};Ve[ie.DATA_COMPARE]=function(r,e){var t=r.field,a=r.operator,n=r.value;return Js(_n(e,t),a,n)};Ve[ie.DATA_BOOL]=function(r,e){var t=r.field,a=r.operator;return Gh(_n(e,t),a)};Ve[ie.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,zh(_n(e,t))};Ve[ie.UNDIRECTED_EDGE]=function(r,e){var t=r.nodes[0],a=r.nodes[1],n=e.source(),i=e.target();return Pe(t,n)&&Pe(a,i)||Pe(a,n)&&Pe(t,i)};Ve[ie.NODE_NEIGHBOR]=function(r,e){return Pe(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Pe(r.neighbor,t)})};Ve[ie.DIRECTED_EDGE]=function(r,e){return Pe(r.source,e.source())&&Pe(r.target,e.target())};Ve[ie.NODE_SOURCE]=function(r,e){return Pe(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Pe(r.target,t)})};Ve[ie.NODE_TARGET]=function(r,e){return Pe(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Pe(r.source,t)})};Ve[ie.CHILD]=function(r,e){return Pe(r.child,e)&&Pe(r.parent,e.parent())};Ve[ie.PARENT]=function(r,e){return Pe(r.parent,e)&&e.children().some(function(t){return Pe(r.child,t)})};Ve[ie.DESCENDANT]=function(r,e){return Pe(r.descendant,e)&&e.ancestors().some(function(t){return Pe(r.ancestor,t)})};Ve[ie.ANCESTOR]=function(r,e){return Pe(r.ancestor,e)&&e.descendants().some(function(t){return Pe(r.descendant,t)})};Ve[ie.COMPOUND_SPLIT]=function(r,e){return Pe(r.subject,e)&&Pe(r.left,e)&&Pe(r.right,e)};Ve[ie.TRUE]=function(){return!0};Ve[ie.COLLECTION]=function(r,e){var t=r.value;return t.has(e)};Ve[ie.FILTER]=function(r,e){var t=r.value;return t(e)};var $h=function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===ie.ID)return e.getElementById(t[0].checks[0].value).collection();var a=function(i){for(var s=0;s<t.length;s++){var o=t[s];if(Pe(o,i))return!0}return!1};return t.text()==null&&(a=function(){return!0}),e.filter(a)},Yh=function(e){for(var t=this,a=0;a<t.length;a++){var n=t[a];if(Pe(n,e))return!0}return!1},Uh={matches:Yh,filter:$h},Xt=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||le(e)&&e.match(/^\s*$/)||(ft(e)?this.addQuery({checks:[{type:ie.COLLECTION,value:e.collection()}]}):Fe(e)?this.addQuery({checks:[{type:ie.FILTER,value:e}]}):le(e)?this.parse(e)||(this.invalid=!0):ze("A selector must be created from a string; found "))},qt=Xt.prototype;[Fh,Uh].forEach(function(r){return ce(qt,r)});qt.text=function(){return this.inputText};qt.size=function(){return this.length};qt.eq=function(r){return this[r]};qt.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()};qt.addQuery=function(r){this[this.length++]=r};qt.selector=qt.toString;var $t={allAre:function(e){var t=new Xt(e);return this.every(function(a){return t.matches(a)})},is:function(e){var t=new Xt(e);return this.some(function(a){return t.matches(a)})},some:function(e,t){for(var a=0;a<this.length;a++){var n=t?e.apply(t,[this[a],a,this]):e(this[a],a,this);if(n)return!0}return!1},every:function(e,t){for(var a=0;a<this.length;a++){var n=t?e.apply(t,[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 t=this.length,a=e.length;return t!==a?!1:t===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(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(a){return t.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(a){return t.hasElementWithId(a.id())})}};$t.allAreNeighbours=$t.allAreNeighbors;$t.has=$t.contains;$t.equal=$t.equals=$t.same;var dt=function(e,t){return function(n,i,s,o){var u=n,l=this,f;if(u==null?f="":ft(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var h=l[0]._private,c=h.traversalCache=h.traversalCache||{},v=c[t]=c[t]||[],d=tr(f),g=v[d];return g||(v[d]=e.call(l,n,i,s,o))}else return e.call(l,n,i,s,o)}},Sr={parent:function(e){var t=[];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],s=i._private.parent;s&&t.push(s)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var i=a[n];t.push(i)}a=a.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,a=0;a<this.length;a++){var n=this[a],i=n.parents();t=t||i,t=t.intersect(i)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:dt(function(r){for(var e=[],t=0;t<this.length;t++)for(var a=this[t],n=a._private.children,i=0;i<n.length;i++)e.push(n[i]);return this.spawn(e,!0).filter(r)},"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 t=[];function a(n){for(var i=0;i<n.length;i++){var s=n[i];t.push(s),s.children().nonempty()&&a(s.children())}}return a(this.children()),this.spawn(t,!0).filter(e)}};function Kn(r,e,t,a){for(var n=[],i=new Ar,s=r.cy(),o=s.hasCompoundNodes(),u=0;u<r.length;u++){var l=r[u];t?n.push(l):o&&a(n,i,l)}for(;n.length>0;){var f=n.shift();e(f),i.add(f.id()),o&&a(n,i,f)}return r}function js(r,e,t){if(t.isParent())for(var a=t._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||r.push(i)}}Sr.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Kn(this,r,e,js)};function eo(r,e,t){if(t.isChild()){var a=t._private.parent;e.has(a.id())||r.push(a)}}Sr.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Kn(this,r,e,eo)};function Hh(r,e,t){eo(r,e,t),js(r,e,t)}Sr.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Kn(this,r,e,Hh)};Sr.ancestors=Sr.parents;var ta,to;ta=to={data:Se.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:Se.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Se.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Se.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Se.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Se.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ta.attr=ta.data;ta.removeAttr=ta.removeData;var Xh=to,Ja={};function pn(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var a=0,n=t[0],i=n._private.edges,s=0;s<i.length;s++){var o=i[s];!e&&o.isLoop()||(a+=r(n,o))}return a}else return}}ce(Ja,{degree:pn(function(r,e){return e.source().same(e.target())?2:1}),indegree:pn(function(r,e){return e.target().same(r)?1:0}),outdegree:pn(function(r,e){return e.source().same(r)?1:0})});function dr(r,e){return function(t){for(var a,n=this.nodes(),i=0;i<n.length;i++){var s=n[i],o=s[r](t);o!==void 0&&(a===void 0||e(o,a))&&(a=o)}return a}}ce(Ja,{minDegree:dr("degree",function(r,e){return r<e}),maxDegree:dr("degree",function(r,e){return r>e}),minIndegree:dr("indegree",function(r,e){return r<e}),maxIndegree:dr("indegree",function(r,e){return r>e}),minOutdegree:dr("outdegree",function(r,e){return r<e}),maxOutdegree:dr("outdegree",function(r,e){return r>e})});ce(Ja,{totalDegree:function(e){for(var t=0,a=this.nodes(),n=0;n<a.length;n++)t+=a[n].degree(e);return t}});var xt,ro,ao=function(e,t,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var s=i._private.position,o={x:t.x!=null?t.x-s.x:0,y:t.y!=null?t.y-s.y:0};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,a),i.dirtyBoundingBoxCache()}}},ki={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,t){ao(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};xt=ro={position:Se.data(ki),silentPosition:Se.data(ce({},ki,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){ao(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(Te(e))t?this.silentPosition(e):this.position(e);else if(Fe(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var s=this[i],o=void 0;(o=a(s,i))&&(t?s.silentPosition(o):s.position(o))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,a){var n;if(Te(e)?(n={x:ae(e.x)?e.x:0,y:ae(e.y)?e.y:0},a=t):le(e)&&ae(t)&&(n={x:0,y:0},n[e]=t),n!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var u=o.position(),l={x:u.x+n.x,y:u.y+n.y};a?o.silentPosition(l):o.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return Te(e)?this.shift(e,!0):le(e)&&ae(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var a=this[0],n=this.cy(),i=n.zoom(),s=n.pan(),o=Te(e)?e:void 0,u=o!==void 0||t!==void 0&&le(e);if(a&&a.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];t!==void 0?f.position(e,(t-s[e])/i):o!==void 0&&f.position(Ps(o,i,s))}else{var h=a.position();return o=Za(h,i,s),e===void 0?o:o[e]}else if(!u)return;return this},relativePosition:function(e,t){var a=this[0],n=this.cy(),i=Te(e)?e:void 0,s=i!==void 0||t!==void 0&&le(e),o=n.hasCompoundNodes();if(a&&a.isNode())if(s)for(var u=0;u<this.length;u++){var l=this[u],f=o?l.parent():null,h=f&&f.length>0,c=h;h&&(f=f[0]);var v=c?f.position():{x:0,y:0};t!==void 0?l.position(e,t+v[e]):i!==void 0&&l.position({x:i.x+v.x,y:i.y+v.y})}else{var d=a.position(),g=o?a.parent():null,y=g&&g.length>0,p=y;y&&(g=g[0]);var E=p?g.position():{x:0,y:0};return i={x:d.x-E.x,y:d.y-E.y},e===void 0?i:i[e]}else if(!s)return;return this}};xt.modelPosition=xt.point=xt.position;xt.modelPositions=xt.points=xt.positions;xt.renderedPoint=xt.renderedPosition;xt.relativePoint=xt.relativePosition;var qh=ro,Dr,_t;Dr=_t={};_t.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),a=t.zoom(),n=t.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:u,w:s-i,h:u-o}};_t.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var a=t._private;a.compoundBoundsClean=!1,a.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};_t.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(!s.isParent())return;var o=s._private,u=s.children(),l=s.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},h=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),c=o.position;(h.w===0||h.h===0)&&(h={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},h.x1=c.x-h.w/2,h.x2=c.x+h.w/2,h.y1=c.y-h.h/2,h.y2=c.y+h.h/2);function v(w,C,A){var S=0,O=0,N=C+A;return w>0&&N>0&&(S=C/N*w,O=A/N*w),{biasDiff:S,biasComplementDiff:O}}function d(w,C,A,S){if(A.units==="%")switch(S){case"width":return w>0?A.pfValue*w:0;case"height":return C>0?A.pfValue*C:0;case"average":return w>0&&C>0?A.pfValue*(w+C)/2:0;case"min":return w>0&&C>0?w>C?A.pfValue*C:A.pfValue*w:0;case"max":return w>0&&C>0?w>C?A.pfValue*w:A.pfValue*C:0;default:return 0}else return A.units==="px"?A.pfValue:0}var g=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(g=g*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 p=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(p=p*100/f.height.val);var E=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(E=E*100/f.height.val);var m=v(f.width.val-h.w,g,y),T=m.biasDiff,D=m.biasComplementDiff,L=v(f.height.val-h.h,p,E),b=L.biasDiff,x=L.biasComplementDiff;o.autoPadding=d(h.w,h.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(h.w,f.width.val),c.x=(-T+h.x1+h.x2+D)/2,o.autoHeight=Math.max(h.h,f.height.val),c.y=(-b+h.y1+h.y2+x)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||r)&&(t(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var ct=function(e){return e===1/0||e===-1/0?0:e},Et=function(e,t,a,n,i){n-t===0||i-a===0||t==null||a==null||n==null||i==null||(e.x1=t<e.x1?t: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)},jt=function(e,t){return t==null?e:Et(e,t.x1,t.y1,t.x2,t.y2)},Gr=function(e,t,a){return wt(e,t,a)},Ca=function(e,t,a){if(!t.cy().headless()){var n=t._private,i=n.rstyle,s=i.arrowWidth/2,o=t.pstyle(a+"-arrow-shape").value,u,l;if(o!=="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-s,h.y1=l-s,h.x2=u+s,h.y2=l+s,h.w=h.x2-h.x1,h.h=h.y2-h.y1,Ma(h,1),Et(e,h.x1,h.y1,h.x2,h.y2)}}},yn=function(e,t,a){if(!t.cy().headless()){var n;a?n=a+"-":n="";var i=t._private,s=i.rstyle,o=t.pstyle(n+"label").strValue;if(o){var u=t.pstyle("text-halign"),l=t.pstyle("text-valign"),f=Gr(s,"labelWidth",a),h=Gr(s,"labelHeight",a),c=Gr(s,"labelX",a),v=Gr(s,"labelY",a),d=t.pstyle(n+"text-margin-x").pfValue,g=t.pstyle(n+"text-margin-y").pfValue,y=t.isEdge(),p=t.pstyle(n+"text-rotation"),E=t.pstyle("text-outline-width").pfValue,m=t.pstyle("text-border-width").pfValue,T=m/2,D=t.pstyle("text-background-padding").pfValue,L=2,b=h,x=f,w=x/2,C=b/2,A,S,O,N;if(y)A=c-w,S=c+w,O=v-C,N=v+C;else{switch(u.value){case"left":A=c-x,S=c;break;case"center":A=c-w,S=c+w;break;case"right":A=c,S=c+x;break}switch(l.value){case"top":O=v-b,N=v;break;case"center":O=v-C,N=v+C;break;case"bottom":O=v,N=v+b;break}}A+=d-Math.max(E,T)-D-L,S+=d+Math.max(E,T)+D+L,O+=g-Math.max(E,T)-D-L,N+=g+Math.max(E,T)+D+L;var P=a||"main",I=i.labelBounds,k=I[P]=I[P]||{};k.x1=A,k.y1=O,k.x2=S,k.y2=N,k.w=S-A,k.h=N-O;var R=y&&p.strValue==="autorotate",B=p.pfValue!=null&&p.pfValue!==0;if(R||B){var z=R?Gr(i.rstyle,"labelAngle",a):p.pfValue,F=Math.cos(z),V=Math.sin(z),U=(A+S)/2,$=(O+N)/2;if(!y){switch(u.value){case"left":U=S;break;case"right":U=A;break}switch(l.value){case"top":$=N;break;case"bottom":$=O;break}}var X=function(de,ee){return de=de-U,ee=ee-$,{x:de*F-ee*V+U,y:de*V+ee*F+$}},H=X(A,O),G=X(A,N),q=X(S,O),K=X(S,N);A=Math.min(H.x,G.x,q.x,K.x),S=Math.max(H.x,G.x,q.x,K.x),O=Math.min(H.y,G.y,q.y,K.y),N=Math.max(H.y,G.y,q.y,K.y)}var Z=P+"Rot",te=I[Z]=I[Z]||{};te.x1=A,te.y1=O,te.x2=S,te.y2=N,te.w=S-A,te.h=N-O,Et(e,A,O,S,N),Et(i.labelBounds.all,A,O,S,N)}return e}},Wh=function(e,t){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=lt(),o=e._private,u=e.isNode(),l=e.isEdge(),f,h,c,v,d,g,y=o.rstyle,p=u&&n?e.pstyle("bounds-expansion").pfValue:[0],E=function(fe){return fe.pstyle("display").value!=="none"},m=!n||E(e)&&(!l||E(e.source())&&E(e.target()));if(m){var T=0,D=0;n&&t.includeOverlays&&(T=e.pstyle("overlay-opacity").value,T!==0&&(D=e.pstyle("overlay-padding").value));var L=0,b=0;n&&t.includeUnderlays&&(L=e.pstyle("underlay-opacity").value,L!==0&&(b=e.pstyle("underlay-padding").value));var x=Math.max(D,b),w=0,C=0;if(n&&(w=e.pstyle("width").pfValue,C=w/2),u&&t.includeNodes){var A=e.position();d=A.x,g=A.y;var S=e.outerWidth(),O=S/2,N=e.outerHeight(),P=N/2;f=d-O,h=d+O,c=g-P,v=g+P,Et(s,f,c,h,v)}else if(l&&t.includeEdges)if(n&&!i){var I=e.pstyle("curve-style").strValue;if(f=Math.min(y.srcX,y.midX,y.tgtX),h=Math.max(y.srcX,y.midX,y.tgtX),c=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),f-=C,h+=C,c-=C,v+=C,Et(s,f,c,h,v),I==="haystack"){var k=y.haystackPts;if(k&&k.length===2){if(f=k[0].x,c=k[0].y,h=k[1].x,v=k[1].y,f>h){var R=f;f=h,h=R}if(c>v){var B=c;c=v,v=B}Et(s,f-C,c-C,h+C,v+C)}}else if(I==="bezier"||I==="unbundled-bezier"||I==="segments"||I==="taxi"){var z;switch(I){case"bezier":case"unbundled-bezier":z=y.bezierPts;break;case"segments":case"taxi":z=y.linePts;break}if(z!=null)for(var F=0;F<z.length;F++){var V=z[F];f=V.x-C,h=V.x+C,c=V.y-C,v=V.y+C,Et(s,f,c,h,v)}}}else{var U=e.source(),$=U.position(),X=e.target(),H=X.position();if(f=$.x,h=H.x,c=$.y,v=H.y,f>h){var G=f;f=h,h=G}if(c>v){var q=c;c=v,v=q}f-=C,h+=C,c-=C,v+=C,Et(s,f,c,h,v)}if(n&&t.includeEdges&&l&&(Ca(s,e,"mid-source"),Ca(s,e,"mid-target"),Ca(s,e,"source"),Ca(s,e,"target")),n){var K=e.pstyle("ghost").value==="yes";if(K){var Z=e.pstyle("ghost-offset-x").pfValue,te=e.pstyle("ghost-offset-y").pfValue;Et(s,s.x1+Z,s.y1+te,s.x2+Z,s.y2+te)}}var he=o.bodyBounds=o.bodyBounds||{};mi(he,s),cn(he,p),Ma(he,1),n&&(f=s.x1,h=s.x2,c=s.y1,v=s.y2,Et(s,f-x,c-x,h+x,v+x));var de=o.overlayBounds=o.overlayBounds||{};mi(de,s),cn(de,p),Ma(de,1);var ee=o.labelBounds=o.labelBounds||{};ee.all!=null?Ef(ee.all):ee.all=lt(),n&&t.includeLabels&&(t.includeMainLabels&&yn(s,e,null),l&&(t.includeSourceLabels&&yn(s,e,"source"),t.includeTargetLabels&&yn(s,e,"target")))}return s.x1=ct(s.x1),s.y1=ct(s.y1),s.x2=ct(s.x2),s.y2=ct(s.y2),s.w=ct(s.x2-s.x1),s.h=ct(s.y2-s.y1),s.w>0&&s.h>0&&m&&(cn(s,p),Ma(s,1)),s},no=function(e){var t=0,a=function(s){return(s?1:0)<<t++},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},io=function(e){if(e.isEdge()){var t=e.source().position(),a=e.target().position(),n=function(s){return Math.round(s)};return $l([n(t.x),n(t.y),n(a.x),n(a.y)])}else return 0},Pi=function(e,t){var a=e._private,n,i=e.isEdge(),s=t==null?Bi:no(t),o=s===Bi,u=io(e),l=a.bbCachePosKey===u,f=t.useCache&&l,h=function(g){return g._private.bbCache==null||g._private.styleDirty},c=!f||h(e)||i&&h(e.source())||h(e.target());if(c?(l||e.recalculateRenderedStyle(f),n=Wh(e,ra),a.bbCache=n,a.bbCachePosKey=u):n=a.bbCache,!o){var v=e.isNode();n=lt(),(t.includeNodes&&v||t.includeEdges&&!v)&&(t.includeOverlays?jt(n,a.overlayBounds):jt(n,a.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?jt(n,a.labelBounds.all):(t.includeMainLabels&&jt(n,a.labelBounds.mainRot),t.includeSourceLabels&&jt(n,a.labelBounds.sourceRot),t.includeTargetLabels&&jt(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},ra={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},Bi=no(ra),Fi=Ze(ra);_t.boundingBox=function(r){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(r===void 0||r.useCache===void 0||r.useCache===!0))r===void 0?r=ra:r=Fi(r),e=Pi(this[0],r);else{e=lt(),r=r||ra;var t=Fi(r),a=this,n=a.cy(),i=n.styleEnabled();if(i)for(var s=0;s<a.length;s++){var o=a[s],u=o._private,l=io(o),f=u.bbCachePosKey===l,h=t.useCache&&f&&!u.styleDirty;o.recalculateRenderedStyle(h)}this.updateCompoundBounds(!r.useCache);for(var c=0;c<a.length;c++){var v=a[c];jt(e,Pi(v,t))}}return e.x1=ct(e.x1),e.y1=ct(e.y1),e.x2=ct(e.x2),e.y2=ct(e.y2),e.w=ct(e.x2-e.x1),e.h=ct(e.y2-e.y1),e};_t.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._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};_t.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),a=t.hasCompoundNodes(),n=t.collection();if(a&&(n=e.filter(function(l){return l.isParent()}),e=e.not(n)),Te(r)){var i=r;r=function(){return i}}var s=function(f,h){return f._private.bbAtOldPos=r(f,h)},o=function(f){return f._private.bbAtOldPos};t.startBatch(),e.forEach(s).silentPositions(r),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=bf(this.boundingBox({useCache:!1}));return e.silentPositions(o),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),t.endBatch(),u};Dr.boundingbox=Dr.bb=Dr.boundingBox;Dr.renderedBoundingbox=Dr.renderedBoundingBox;var _h=_t,Ur,ha;Ur=ha={};var so=function(e){e.uppercaseName=di(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=di(e.outerName),Ur[e.name]=function(){var a=this[0],n=a._private,i=n.cy,s=i._private.styleEnabled;if(a)if(s){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var o=a.pstyle(e.name);switch(o.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},Ur["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,s=i._private.styleEnabled;if(a)if(s){var o=a[e.name](),u=a.pstyle("border-width").pfValue,l=2*a.padding();return o+u+l}else return 1},Ur["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Ur["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};so({name:"width"});so({name:"height"});ha.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue};ha.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()};ha.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var Kh=ha,Zh=function(e,t){if(e.isEdge())return t(e)},Qh=function(e,t){if(e.isEdge()){var a=e.cy();return Za(t(e),a.zoom(),a.pan())}},Jh=function(e,t){if(e.isEdge()){var a=e.cy(),n=a.pan(),i=a.zoom();return t(e).map(function(s){return Za(s,i,n)})}},jh=function(e){return e.renderer().getControlPoints(e)},ev=function(e){return e.renderer().getSegmentPoints(e)},tv=function(e){return e.renderer().getSourceEndpoint(e)},rv=function(e){return e.renderer().getTargetEndpoint(e)},av=function(e){return e.renderer().getEdgeMidpoint(e)},Gi={controlPoints:{get:jh,mult:!0},segmentPoints:{get:ev,mult:!0},sourceEndpoint:{get:tv},targetEndpoint:{get:rv},midpoint:{get:av}},nv=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},iv=Object.keys(Gi).reduce(function(r,e){var t=Gi[e],a=nv(e);return r[e]=function(){return Zh(this,t.get)},t.mult?r[a]=function(){return Jh(this,t.get)}:r[a]=function(){return Qh(this,t.get)},r},{}),sv=ce({},qh,_h,Kh,iv);/*!
Event object based on jQuery events, MIT license
https://jquery.org/license/
https://tldrlegal.com/license/mit-license
https://github.com/jquery/jquery/blob/master/src/event.js
*/var oo=function(e,t){this.recycle(e,t)};function zr(){return!1}function La(){return!0}oo.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=zr,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?La:zr):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.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=La;var e=this.originalEvent;!e||e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=La;var e=this.originalEvent;!e||e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=La,this.stopPropagation()},isDefaultPrevented:zr,isPropagationStopped:zr,isImmediatePropagationStopped:zr};var uo=/^([^.]+)(\.(?:[^.]+))?$/,ov=".*",lo={qualifierCompare:function(e,t){return e===t},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},zi=Object.keys(lo),uv={};function ja(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:uv,e=arguments.length>1?arguments[1]:void 0,t=0;t<zi.length;t++){var a=zi[t];this[a]=r[a]||lo[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Wt=ja.prototype,fo=function(e,t,a,n,i,s,o){Fe(n)&&(i=n,n=null),o&&(s==null?s=o:s=ce({},s,o));for(var u=Ie(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!Ut(f)){var h=f.match(uo);if(h){var c=h[1],v=h[2]?h[2]:null,d=t(e,f,c,v,n,i,s);if(d===!1)break}}}},Vi=function(e,t){return e.addEventFields(e.context,t),new oo(t.type,t)},lv=function(e,t,a){if(wl(a)){t(e,a);return}else if(Te(a)){t(e,Vi(e,a));return}for(var n=Ie(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var s=n[i];if(!Ut(s)){var o=s.match(uo);if(o){var u=o[1],l=o[2]?o[2]:null,f=Vi(e,{type:u,namespace:l,target:e.context});t(e,f)}}}};Wt.on=Wt.addListener=function(r,e,t,a,n){return fo(this,function(i,s,o,u,l,f,h){Fe(f)&&i.listeners.push({event:s,callback:f,type:o,namespace:u,qualifier:l,conf:h})},r,e,t,a,n),this};Wt.one=function(r,e,t,a){return this.on(r,e,t,a,{one:!0})};Wt.removeListener=Wt.off=function(r,e,t,a){var n=this;this.emitting!==0&&(this.listeners=ql(this.listeners));for(var i=this.listeners,s=function(l){var f=i[l];fo(n,function(h,c,v,d,g,y){if((f.type===v||r==="*")&&(!d&&f.namespace!==".*"||f.namespace===d)&&(!g||h.qualifierCompare(f.qualifier,g))&&(!y||f.callback===y))return i.splice(l,1),!1},r,e,t,a)},o=i.length-1;o>=0;o--)s(o);return this};Wt.removeAllListeners=function(){return this.removeListener("*")};Wt.emit=Wt.trigger=function(r,e,t){var a=this.listeners,n=a.length;return this.emitting++,Ie(e)||(e=[e]),lv(this,function(i,s){t!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}],n=a.length);for(var o=function(f){var h=a[f];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===ov)&&i.eventMatches(i.context,h,s)){var c=[s];e!=null&&_l(c,e),i.beforeEmit(i.context,h,s),h.conf&&h.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==h}));var v=i.callbackContext(i.context,h,s),d=h.callback.apply(v,c);i.afterEmit(i.context,h,s),d===!1&&(s.stopPropagation(),s.preventDefault())}},u=0;u<n;u++)o(u);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},r),this.emitting--,this};var fv={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&la(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Sa=function(e){return le(e)?new Xt(e):e},ho={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],a=t._private;a.emitter||(a.emitter=new ja(fv,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,a){for(var n=Sa(t),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,n,a)}return this},removeListener:function(e,t,a){for(var n=Sa(t),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,a){for(var n=Sa(t),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,n,a)}return this},once:function(e,t,a){for(var n=Sa(t),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,t){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};Se.eventAliasesOn(ho);var vo={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):t.push(n)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(le(e)||ft(e))return new Xt(e).filter(this);if(Fe(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var s=n[i],o=t?e.apply(t,[s,i,n]):e(s,i,n);o&&a.push(s)}return a}return this.spawn()},not:function(e){if(e){le(e)&&(e=this.filter(e));for(var t=this.spawn(),a=0;a<this.length;a++){var n=this[a],i=e.has(n);i||t.push(n)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(le(e)){var t=e;return this.filter(t)}for(var a=this.spawn(),n=this,i=e,s=this.length<e.length,o=s?n:i,u=s?i:n,l=0;l<o.length;l++){var f=o[l];u.has(f)&&a.push(f)}return a},xor:function(e){var t=this._private.cy;le(e)&&(e=t.$(e));var a=this.spawn(),n=this,i=e,s=function(u,l){for(var f=0;f<u.length;f++){var h=u[f],c=h._private.data.id,v=l.hasElementWithId(c);v||a.push(h)}};return s(n,i),s(i,n),a},diff:function(e){var t=this._private.cy;le(e)&&(e=t.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),s=this,o=e,u=function(f,h,c){for(var v=0;v<f.length;v++){var d=f[v],g=d._private.data.id,y=h.hasElementWithId(g);y?i.merge(d):c.push(d)}};return u(s,o,a),u(o,s,n),{left:a,right:n,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(le(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],o=!this.has(s);o&&n.push(s)}return n},merge:function(e){var t=this._private,a=t.cy;if(!e)return this;if(e&&le(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=t.map,s=0;s<e.length;s++){var o=e[s],u=o._private.data.id,l=!i.has(u);if(l){var f=this.length++;this[f]=o,i.set(u,{ele:o,index:f})}}return this},unmergeAt:function(e){var t=this[e],a=t.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,u=this[o],l=u._private.data.id;this[o]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,a=e._private.data.id,n=t.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&le(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var a=this[t];e(a)&&this.unmergeAt(t)}return this},map:function(e,t){for(var a=[],n=this,i=0;i<n.length;i++){var s=n[i],o=t?e.apply(t,[s,i,n]):e(s,i,n);a.push(o)}return a},reduce:function(e,t){for(var a=t,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,t){for(var a=-1/0,n,i=this,s=0;s<i.length;s++){var o=i[s],u=t?e.apply(t,[o,s,i]):e(o,s,i);u>a&&(a=u,n=o)}return{value:a,ele:n}},min:function(e,t){for(var a=1/0,n,i=this,s=0;s<i.length;s++){var o=i[s],u=t?e.apply(t,[o,s,i]):e(o,s,i);u<a&&(a=u,n=o)}return{value:a,ele:n}}},Ce=vo;Ce.u=Ce["|"]=Ce["+"]=Ce.union=Ce.or=Ce.add;Ce["\\"]=Ce["!"]=Ce["-"]=Ce.difference=Ce.relativeComplement=Ce.subtract=Ce.not;Ce.n=Ce["&"]=Ce["."]=Ce.and=Ce.intersection=Ce.intersect;Ce["^"]=Ce["(+)"]=Ce["(-)"]=Ce.symmetricDifference=Ce.symdiff=Ce.xor;Ce.fnFilter=Ce.filterFn=Ce.stdFilter=Ce.filter;Ce.complement=Ce.abscomp=Ce.absoluteComplement;var hv={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}},co=function(e,t){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"?$n:0}var s=i(e)-i(t);if(s!==0)return s;function o(f){var h=f.pstyle("z-index-compare");return h.value==="auto"&&f.isNode()?1:0}var u=o(e)-o(t);if(u!==0)return u;var l=e.pstyle("z-index").value-t.pstyle("z-index").value;return l!==0?l:e.poolIndex()-t.poolIndex()},$a={forEach:function(e,t){if(Fe(e))for(var a=this.length,n=0;n<a;n++){var i=this[n],s=t?e.apply(t,[i,n,this]):e(i,n,this);if(s===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var a=[],n=this.length;t==null&&(t=n),e==null&&(e=0),e<0&&(e=n+e),t<0&&(t=n+t);for(var i=e;i>=0&&i<t&&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(!Fe(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(co)},zDepth:function(){var e=this[0];if(!!e){var t=e._private,a=t.group;if(a==="nodes"){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:$n-1}else{var i=t.source,s=t.target,o=i.zDepth(),u=s.zDepth();return Math.max(o,u,0)}}}};$a.each=$a.forEach;var vv=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":Ye(Symbol))!=e&&Ye(Symbol.iterator)!=e;t&&($a[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return bs({next:function(){return i<s?n.value=a[i++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};vv();var cv=Ze({nodeDimensionsIncludeLabels:!1}),Ia={layoutDimensions:function(e){e=cv(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();t={w:a.w,h:a.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,a){var n=this.nodes().filter(function(D){return!D.isParent()}),i=this.cy(),s=t.eles,o=function(L){return L.id()},u=Kr(a,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(L,b,x){var w={x:b.x1+b.w/2,y:b.y1+b.h/2},C={x:(x.x-w.x)*L,y:(x.y-w.y)*L};return{x:w.x+C.x,y:w.y+C.y}},f=t.spacingFactor&&t.spacingFactor!==1,h=function(){if(!f)return null;for(var L=lt(),b=0;b<n.length;b++){var x=n[b],w=u(x,b);xf(L,w.x,w.y)}return L},c=h(),v=Kr(function(D,L){var b=u(D,L);if(f){var x=Math.abs(t.spacingFactor);b=l(x,c,b)}return t.transform!=null&&(b=t.transform(D,b)),b},o);if(t.animate){for(var d=0;d<n.length;d++){var g=n[d],y=v(g,d),p=t.animateFilter==null||t.animateFilter(g,d);if(p){var E=g.animation({position:y,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(E)}else g.position(y)}if(t.fit){var m=i.animation({fit:{boundingBox:s.boundingBoxAt(v),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(m)}else if(t.zoom!==void 0&&t.pan!==void 0){var T=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(T)}e.animations.forEach(function(D){return D.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Nr.all(e.animations.map(function(D){return D.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(v),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var t=this.cy();return t.makeLayout(ce({},e,{eles:this}))}};Ia.createLayout=Ia.makeLayout=Ia.layout;function go(r,e,t){var a=t._private,n=a.styleCache=a.styleCache||[],i;return(i=n[r])!=null||(i=n[r]=e(t)),i}function en(r,e){return r=tr(r),function(a){return go(r,e,a)}}function tn(r,e){r=tr(r);var t=function(n){return e.call(n)};return function(){var n=this[0];if(n)return go(r,t,n)}}var _e={recalculateRenderedStyle:function(e){var t=this.cy(),a=t.renderer(),n=t.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=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(t)}else this.forEach(function(n){t(n),n.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var a=t._private.batchStyleEles;return a.merge(this),this}var n=t.hasCompoundNodes(),i=this;e=!!(e||e===void 0),n&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(!!e.styleEnabled())for(var t=0;t<this.length;t++){var a=this[t];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(!!n.styleEnabled()&&a){this.cleanStyle();var i=a._private.style[e];return i!=null?i:t?n.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(!!t.cy().styleEnabled()&&t){var a=t.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var t=this[0];if(!!t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=this[0];if(a)return t.style().getRenderedStyle(a,e)},style:function(e,t){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Te(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(le(e))if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,t,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 t=this.cy();if(!t.styleEnabled())return this;var a=!1,n=t.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var o=i[s];n.removeAllBypasses(o,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 t=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!t)return i;var s=n.data.parent?a.parents():null;if(s)for(var o=0;o<s.length;o++){var u=s[o],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],a=t.cy().hasCompoundNodes();if(t)return a?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function mn(r,e){var t=r._private,a=t.data.parent?r.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function Zn(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,a=r.parentOk||r.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],s=n.hasCompoundNodes();if(i){var o=i._private;if(!e(i))return!1;if(i.isNode())return!s||mn(i,a);var u=o.source,l=o.target;return t(u)&&(!s||mn(u,t))&&(u===l||t(l)&&(!s||mn(l,t)))}}}var Mr=en("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});_e.takesUpSpace=tn("takesUpSpace",Zn({ok:Mr}));var dv=en("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&Mr(r)}),gv=en("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&Mr(r)});_e.interactive=tn("interactive",Zn({ok:dv,parentOk:gv,edgeOkViaNode:Mr}));_e.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var pv=en("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&Mr(r)}),yv=Mr;_e.visible=tn("visible",Zn({ok:pv,edgeOkViaNode:yv}));_e.hidden=function(){var r=this[0];if(r)return!r.visible()};_e.isBundledBezier=tn("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});_e.bypass=_e.css=_e.style;_e.renderedCss=_e.renderedStyle;_e.removeBypass=_e.removeCss=_e.removeStyle;_e.pstyle=_e.parsedStyle;var Yt={};function $i(r){return function(){var e=arguments,t=[];if(e.length===2){var a=e[0],n=e[1];this.on(r.event,a,n)}else if(e.length===1&&Fe(e[0])){var i=e[0];this.on(r.event,i)}else if(e.length===0||e.length===1&&Ie(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var u=this[o],l=!r.ableField||u._private[r.ableField],f=u._private[r.field]!=r.value;if(r.overrideAble){var h=r.overrideAble(u);if(h!==void 0&&(l=h,!h))return this}l&&(u._private[r.field]=r.value,f&&t.push(u))}var c=this.spawn(t);c.updateStyle(),c.emit(r.event),s&&c.emit(s)}return this}}function Or(r){Yt[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(t!==void 0)return t}return e._private[r.field]}},Yt[r.on]=$i({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),Yt[r.off]=$i({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}Or({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Or({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Or({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Or({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Yt.deselect=Yt.unselect;Yt.grabbed=function(){var r=this[0];if(r)return r._private.grabbed};Or({field:"active",on:"activate",off:"unactivate"});Or({field:"pannable",on:"panify",off:"unpanify"});Yt.inactive=function(){var r=this[0];if(r)return!r._private.active};var et={},Yi=function(e){return function(a){for(var n=this,i=[],s=0;s<n.length;s++){var o=n[s];if(!!o.isNode()){for(var u=!1,l=o.connectedEdges(),f=0;f<l.length;f++){var h=l[f],c=h.source(),v=h.target();if(e.noIncomingEdges&&v===o&&c!==o||e.noOutgoingEdges&&c===o&&v!==o){u=!0;break}}u||i.push(o)}}return this.spawn(i,!0).filter(a)}},Ui=function(e){return function(t){for(var a=this,n=[],i=0;i<a.length;i++){var s=a[i];if(!!s.isNode())for(var o=s.connectedEdges(),u=0;u<o.length;u++){var l=o[u],f=l.source(),h=l.target();e.outgoing&&f===s?(n.push(l),n.push(h)):e.incoming&&h===s&&(n.push(l),n.push(f))}}return this.spawn(n,!0).filter(t)}},Hi=function(e){return function(t){for(var a=this,n=[],i={};;){var s=e.outgoing?a.outgoers():a.incomers();if(s.length===0)break;for(var o=!1,u=0;u<s.length;u++){var l=s[u],f=l.id();i[f]||(i[f]=!0,n.push(l),o=!0)}if(!o)break;a=s}return this.spawn(n,!0).filter(t)}};et.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null};ce(et,{roots:Yi({noIncomingEdges:!0}),leaves:Yi({noOutgoingEdges:!0}),outgoers:dt(Ui({outgoing:!0}),"outgoers"),successors:Hi({outgoing:!0}),incomers:dt(Ui({incoming:!0}),"incomers"),predecessors:Hi({incoming:!0})});ce(et,{neighborhood:dt(function(r){for(var e=[],t=this.nodes(),a=0;a<t.length;a++)for(var n=t[a],i=n.connectedEdges(),s=0;s<i.length;s++){var o=i[s],u=o.source(),l=o.target(),f=n===u?l:u;f.length>0&&e.push(f[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});et.neighbourhood=et.neighborhood;et.closedNeighbourhood=et.closedNeighborhood;et.openNeighbourhood=et.openNeighborhood;ce(et,{source:dt(function(e){var t=this[0],a;return t&&(a=t._private.source||t.cy().collection()),a&&e?a.filter(e):a},"source"),target:dt(function(e){var t=this[0],a;return t&&(a=t._private.target||t.cy().collection()),a&&e?a.filter(e):a},"target"),sources:Xi({attr:"source"}),targets:Xi({attr:"target"})});function Xi(r){return function(t){for(var a=[],n=0;n<this.length;n++){var i=this[n],s=i._private[r.attr];s&&a.push(s)}return this.spawn(a,!0).filter(t)}}ce(et,{edgesWith:dt(qi(),"edgesWith"),edgesTo:dt(qi({thisIsSrc:!0}),"edgesTo")});function qi(r){return function(t){var a=[],n=this._private.cy,i=r||{};le(t)&&(t=n.$(t));for(var s=0;s<t.length;s++)for(var o=t[s]._private.edges,u=0;u<o.length;u++){var l=o[u],f=l._private.data,h=this.hasElementWithId(f.source)&&t.hasElementWithId(f.target),c=t.hasElementWithId(f.source)&&this.hasElementWithId(f.target),v=h||c;!v||(i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!h||i.thisIsTgt&&!c)||a.push(l)}return this.spawn(a,!0)}}ce(et,{connectedEdges:dt(function(r){for(var e=[],t=this,a=0;a<t.length;a++){var n=t[a];if(!!n.isNode())for(var i=n._private.edges,s=0;s<i.length;s++){var o=i[s];e.push(o)}}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:dt(function(r){for(var e=[],t=this,a=0;a<t.length;a++){var n=t[a];!n.isEdge()||(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:dt(Wi(),"parallelEdges"),codirectedEdges:dt(Wi({codirected:!0}),"codirectedEdges")});function Wi(r){var e={codirected:!1};return r=ce({},e,r),function(a){for(var n=[],i=this.edges(),s=r,o=0;o<i.length;o++)for(var u=i[o],l=u._private,f=l.source,h=f._private.data.id,c=l.data.target,v=f._private.edges,d=0;d<v.length;d++){var g=v[d],y=g._private.data,p=y.target,E=y.source,m=p===c&&E===h,T=h===p&&c===E;(s.codirected&&m||!s.codirected&&(m||T))&&n.push(g)}return this.spawn(n,!0).filter(a)}}ce(et,{components:function(e){var t=this,a=t.cy(),n=a.collection(),i=e==null?t.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var o=function(f,h){n.merge(f),i.unmerge(f),h.merge(f)};if(i.empty())return t.spawn();var u=function(){var f=a.collection();s.push(f);var h=i[0];o(h,f),t.bfs({directed:!1,roots:h,visit:function(v){return o(v,f)}}),f.forEach(function(c){c.connectedEdges().forEach(function(v){t.has(v)&&f.has(v.source())&&f.has(v.target())&&f.merge(v)})})};do u();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});et.componentsOf=et.components;var Ke=function(e,t){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){ze("A collection must have a reference to the core");return}var i=new Ct,s=!1;if(!t)t=[];else if(t.length>0&&Te(t[0])&&!la(t[0])){s=!0;for(var o=[],u=new Ar,l=0,f=t.length;l<f;l++){var h=t[l];h.data==null&&(h.data={});var c=h.data;if(c.id==null)c.id=Rs();else if(e.hasElementWithId(c.id)||u.has(c.id))continue;var v=new Ka(e,h,!1);o.push(v),u.add(c.id)}t=o}this.length=0;for(var d=0,g=t.length;d<g;d++){var y=t[d][0];if(y!=null){var p=y._private.data.id;(!a||!i.has(p))&&(a&&i.set(p,{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(E){this.lazyMap=E},rebuildMap:function(){for(var m=this.lazyMap=new Ct,T=this.eles,D=0;D<T.length;D++){var L=T[D];m.set(L.id(),{index:D,ele:L})}}},a&&(this._private.map=i),s&&!n&&this.restore()},ke=Ka.prototype=Ke.prototype=Object.create(Array.prototype);ke.instanceString=function(){return"collection"};ke.spawn=function(r,e){return new Ke(this.cy(),r,e)};ke.spawnSelf=function(){return this.spawn(this)};ke.cy=function(){return this._private.cy};ke.renderer=function(){return this._private.cy.renderer()};ke.element=function(){return this[0]};ke.collection=function(){return ws(this)?this:new Ke(this._private.cy,[this])};ke.unique=function(){return new Ke(this._private.cy,this,!0)};ke.hasElementWithId=function(r){return r=""+r,this._private.map.has(r)};ke.getElementById=function(r){r=""+r;var e=this._private.cy,t=this._private.map.get(r);return t?t.ele:new Ke(e)};ke.$id=ke.getElementById;ke.poolIndex=function(){var r=this._private.cy,e=r._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index};ke.indexOf=function(r){var e=r[0]._private.data.id;return this._private.map.get(e).index};ke.indexOfId=function(r){return r=""+r,this._private.map.get(r).index};ke.json=function(r){var e=this.element(),t=this.cy();if(e==null&&r)return this;if(e!=null){var a=e._private;if(Te(r)){if(t.startBatch(),r.data){e.data(r.data);var n=a.data;if(e.isEdge()){var i=!1,s={},o=r.data.source,u=r.data.target;o!=null&&o!=n.source&&(s.source=""+o,i=!0),u!=null&&u!=n.target&&(s.target=""+u,i=!0),i&&(e=e.move(s))}else{var l="parent"in r.data,f=r.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}))}}r.position&&e.position(r.position);var h=function(g,y,p){var E=r[g];E!=null&&E!==a[g]&&(E?e[y]():e[p]())};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"),r.classes!=null&&e.classes(r.classes),t.endBatch(),this}else if(r===void 0){var c={data:Dt(a.data),position:Dt(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};c.classes="";var v=0;return a.classes.forEach(function(d){return c.classes+=v++===0?d:" "+d}),c}}};ke.jsons=function(){for(var r=[],e=0;e<this.length;e++){var t=this[e],a=t.json();r.push(a)}return r};ke.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var a=this[t],n=a.json(),i=new Ka(r,n,!1);e.push(i)}return new Ke(r,e)};ke.copy=ke.clone;ke.restore=function(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=t.cy(),n=a._private,i=[],s=[],o,u=0,l=t.length;u<l;u++){var f=t[u];e&&!f.removed()||(f.isNode()?i.push(f):s.push(f))}o=i.concat(s);var h,c=function(){o.splice(h,1),h--};for(h=0;h<o.length;h++){var v=o[h],d=v._private,g=d.data;if(v.clearTraversalCache(),!(!e&&!d.removed)){if(g.id===void 0)g.id=Rs();else if(ae(g.id))g.id=""+g.id;else if(Ut(g.id)||!le(g.id)){ze("Can not create element with invalid string ID `"+g.id+"`"),c();continue}else if(a.hasElementWithId(g.id)){ze("Can not create second element with ID `"+g.id+"`"),c();continue}}var y=g.id;if(v.isNode()){var p=d.position;p.x==null&&(p.x=0),p.y==null&&(p.y=0)}if(v.isEdge()){for(var E=v,m=["source","target"],T=m.length,D=!1,L=0;L<T;L++){var b=m[L],x=g[b];ae(x)&&(x=g[b]=""+g[b]),x==null||x===""?(ze("Can not create edge `"+y+"` with unspecified "+b),D=!0):a.hasElementWithId(x)||(ze("Can not create edge `"+y+"` with nonexistant "+b+" `"+x+"`"),D=!0)}if(D){c();continue}var w=a.getElementById(g.source),C=a.getElementById(g.target);w.same(C)?w._private.edges.push(E):(w._private.edges.push(E),C._private.edges.push(E)),E._private.source=w,E._private.target=C}d.map=new Ct,d.map.set(y,{ele:v,index:0}),d.removed=!1,e&&a.addToPool(v)}for(var A=0;A<i.length;A++){var S=i[A],O=S._private.data;ae(O.parent)&&(O.parent=""+O.parent);var N=O.parent,P=N!=null;if(P||S._private.parent){var I=S._private.parent?a.collection().merge(S._private.parent):a.getElementById(N);if(I.empty())O.parent=void 0;else if(I[0].removed())Ae("Node added with missing parent, reference to parent removed"),O.parent=void 0,S._private.parent=null;else{for(var k=!1,R=I;!R.empty();){if(S.same(R)){k=!0,O.parent=void 0;break}R=R.parent()}k||(I[0]._private.children.push(S),S._private.parent=I[0],n.hasCompoundNodes=!0)}}}if(o.length>0){for(var B=o.length===t.length?t:new Ke(a,o),z=0;z<B.length;z++){var F=B[z];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}var V;n.hasCompoundNodes?V=a.collection().merge(B).merge(B.connectedNodes()).merge(B.parent()):V=B,V.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?B.emitAndNotify("add"):e&&B.emit("add")}return t};ke.removed=function(){var r=this[0];return r&&r._private.removed};ke.inside=function(){var r=this[0];return r&&!r._private.removed};ke.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=[],n={},i=t._private.cy;function s(N){for(var P=N._private.edges,I=0;I<P.length;I++)u(P[I])}function o(N){for(var P=N._private.children,I=0;I<P.length;I++)u(P[I])}function u(N){var P=n[N.id()];e&&N.removed()||P||(n[N.id()]=!0,N.isNode()?(a.push(N),s(N),o(N)):a.unshift(N))}for(var l=0,f=t.length;l<f;l++){var h=t[l];u(h)}function c(N,P){var I=N._private.edges;Ht(I,P),N.clearTraversalCache()}function v(N){N.clearTraversalCache()}var d=[];d.ids={};function g(N,P){P=P[0],N=N[0];var I=N._private.children,k=N.id();Ht(I,P),P._private.parent=null,d.ids[k]||(d.ids[k]=!0,d.push(N))}t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var y=0;y<a.length;y++){var p=a[y];if(p.isEdge()){var E=p.source()[0],m=p.target()[0];c(E,p),c(m,p);for(var T=p.parallelEdges(),D=0;D<T.length;D++){var L=T[D];v(L),L.isBundledBezier()&&L.dirtyBoundingBoxCache()}}else{var b=p.parent();b.length!==0&&g(b,p)}e&&(p._private.removed=!0)}var x=i._private.elements;i._private.hasCompoundNodes=!1;for(var w=0;w<x.length;w++){var C=x[w];if(C.isParent()){i._private.hasCompoundNodes=!0;break}}var A=new Ke(this.cy(),a);A.size()>0&&(r?A.emitAndNotify("remove"):e&&A.emit("remove"));for(var S=0;S<d.length;S++){var O=d[S];(!e||!O.removed())&&O.updateStyle()}return A};ke.move=function(r){var e=this._private.cy,t=this,a=!1,n=!1,i=function(d){return d==null?d:""+d};if(r.source!==void 0||r.target!==void 0){var s=i(r.source),o=i(r.target),u=s!=null&&e.hasElementWithId(s),l=o!=null&&e.hasElementWithId(o);(u||l)&&(e.batch(function(){t.remove(a,n),t.emitAndNotify("moveout");for(var v=0;v<t.length;v++){var d=t[v],g=d._private.data;d.isEdge()&&(u&&(g.source=s),l&&(g.target=o))}t.restore(a,n)}),t.emitAndNotify("move"))}else if(r.parent!==void 0){var f=i(r.parent),h=f===null||e.hasElementWithId(f);if(h){var c=f===null?void 0:f;e.batch(function(){var v=t.remove(a,n);v.emitAndNotify("moveout");for(var d=0;d<t.length;d++){var g=t[d],y=g._private.data;g.isNode()&&(y.parent=c)}v.restore(a,n)}),t.emitAndNotify("move")}}return this};[Ws,Nh,Oa,$t,Sr,Xh,Ja,sv,ho,vo,hv,$a,Ia,_e,Yt,et].forEach(function(r){ce(ke,r)});var mv={add:function(e){var t,a=this;if(ft(e)){var n=e;if(n._private.cy===a)t=n.restore();else{for(var i=[],s=0;s<n.length;s++){var o=n[s];i.push(o.json())}t=new Ke(a,i)}}else if(Ie(e)){var u=e;t=new Ke(a,u)}else if(Te(e)&&(Ie(e.nodes)||Ie(e.edges))){for(var l=e,f=[],h=["nodes","edges"],c=0,v=h.length;c<v;c++){var d=h[c],g=l[d];if(Ie(g))for(var y=0,p=g.length;y<p;y++){var E=ce({group:d},g[y]);f.push(E)}}t=new Ke(a,f)}else{var m=e;t=new Ka(a,m).collection()}return t},remove:function(e){if(!ft(e)){if(le(e)){var t=e;e=this.$(t)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function bv(r,e,t,a){var n=4,i=.001,s=1e-7,o=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;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var c=f?new Float32Array(u):new Array(u);function v(C,A){return 1-3*A+3*C}function d(C,A){return 3*A-6*C}function g(C){return 3*C}function y(C,A,S){return((v(A,S)*C+d(A,S))*C+g(A))*C}function p(C,A,S){return 3*v(A,S)*C*C+2*d(A,S)*C+g(A)}function E(C,A){for(var S=0;S<n;++S){var O=p(A,r,t);if(O===0)return A;var N=y(A,r,t)-C;A-=N/O}return A}function m(){for(var C=0;C<u;++C)c[C]=y(C*l,r,t)}function T(C,A,S){var O,N,P=0;do N=A+(S-A)/2,O=y(N,r,t)-C,O>0?S=N:A=N;while(Math.abs(O)>s&&++P<o);return N}function D(C){for(var A=0,S=1,O=u-1;S!==O&&c[S]<=C;++S)A+=l;--S;var N=(C-c[S])/(c[S+1]-c[S]),P=A+N*l,I=p(P,r,t);return I>=i?E(C,P):I===0?P:T(C,A,A+l)}var L=!1;function b(){L=!0,(r!==e||t!==a)&&m()}var x=function(A){return L||b(),r===e&&t===a?A:A===0?0:A===1?1:y(D(A),e,a)};x.getControlPoints=function(){return[{x:r,y:e},{x:t,y:a}]};var w="generateBezier("+[r,e,t,a]+")";return x.toString=function(){return w},x}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Ev=function(){function r(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:r(s)}}function t(a,n){var i={dx:a.v,dv:r(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),u=e(a,n,o),l=1/6*(i.dx+2*(s.dx+o.dx)+u.dx),f=1/6*(i.dv+2*(s.dv+o.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+f*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,h=16/1e3,c,v,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,c=s!==null,c?(l=a(n,i),v=l/s*h):v=h;d=t(d||o,v),u.push(1+d.x),l+=16,Math.abs(d.x)>f&&Math.abs(d.v)>f;);return c?function(g){return u[g*(u.length-1)|0]}:l}}(),Re=function(e,t,a,n){var i=bv(e,t,a,n);return function(s,o,u){return s+(o-s)*i(u)}},Ra={linear:function(e,t,a){return e+(t-e)*a},ease:Re(.25,.1,.25,1),"ease-in":Re(.42,0,1,1),"ease-out":Re(0,0,.58,1),"ease-in-out":Re(.42,0,.58,1),"ease-in-sine":Re(.47,0,.745,.715),"ease-out-sine":Re(.39,.575,.565,1),"ease-in-out-sine":Re(.445,.05,.55,.95),"ease-in-quad":Re(.55,.085,.68,.53),"ease-out-quad":Re(.25,.46,.45,.94),"ease-in-out-quad":Re(.455,.03,.515,.955),"ease-in-cubic":Re(.55,.055,.675,.19),"ease-out-cubic":Re(.215,.61,.355,1),"ease-in-out-cubic":Re(.645,.045,.355,1),"ease-in-quart":Re(.895,.03,.685,.22),"ease-out-quart":Re(.165,.84,.44,1),"ease-in-out-quart":Re(.77,0,.175,1),"ease-in-quint":Re(.755,.05,.855,.06),"ease-out-quint":Re(.23,1,.32,1),"ease-in-out-quint":Re(.86,0,.07,1),"ease-in-expo":Re(.95,.05,.795,.035),"ease-out-expo":Re(.19,1,.22,1),"ease-in-out-expo":Re(1,0,0,1),"ease-in-circ":Re(.6,.04,.98,.335),"ease-out-circ":Re(.075,.82,.165,1),"ease-in-out-circ":Re(.785,.135,.15,.86),spring:function(e,t,a){if(a===0)return Ra.linear;var n=Ev(e,t,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":Re};function _i(r,e,t,a,n){if(a===1||e===t)return t;var i=n(e,t,a);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function Ki(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function gr(r,e,t,a,n){var i=n!=null?n.type:null;t<0?t=0:t>1&&(t=1);var s=Ki(r,n),o=Ki(e,n);if(ae(s)&&ae(o))return _i(i,s,o,t,a);if(Ie(s)&&Ie(o)){for(var u=[],l=0;l<o.length;l++){var f=s[l],h=o[l];if(f!=null&&h!=null){var c=_i(i,f,h,t,a);u.push(c)}else u.push(h)}return u}}function wv(r,e,t,a){var n=!a,i=r._private,s=e._private,o=s.easing,u=s.startTime,l=a?r:r.cy(),f=l.style();if(!s.easingImpl)if(o==null)s.easingImpl=Ra.linear;else{var h;if(le(o)){var c=f.parse("transition-timing-function",o);h=c.value}else h=o;var v,d;le(h)?(v=h,d=[]):(v=h[1],d=h.slice(2).map(function(B){return+B})),d.length>0?(v==="spring"&&d.push(s.duration),s.easingImpl=Ra[v].apply(null,d)):s.easingImpl=Ra[v]}var g=s.easingImpl,y;if(s.duration===0?y=1:y=(t-u)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var p=s.startPosition,E=s.position;if(E&&n&&!r.locked()){var m={};Vr(p.x,E.x)&&(m.x=gr(p.x,E.x,y,g)),Vr(p.y,E.y)&&(m.y=gr(p.y,E.y,y,g)),r.position(m)}var T=s.startPan,D=s.pan,L=i.pan,b=D!=null&&a;b&&(Vr(T.x,D.x)&&(L.x=gr(T.x,D.x,y,g)),Vr(T.y,D.y)&&(L.y=gr(T.y,D.y,y,g)),r.emit("pan"));var x=s.startZoom,w=s.zoom,C=w!=null&&a;C&&(Vr(x,w)&&(i.zoom=jr(i.minZoom,gr(x,w,y,g),i.maxZoom)),r.emit("zoom")),(b||C)&&r.emit("viewport");var A=s.style;if(A&&A.length>0&&n){for(var S=0;S<A.length;S++){var O=A[S],N=O.name,P=O,I=s.startStyle[N],k=f.properties[I.name],R=gr(I,P,y,g,k);f.overrideBypass(r,N,R)}r.emit("style")}}return s.progress=y,y}function Vr(r,e){return r==null||e==null?!1:ae(r)&&ae(e)?!0:!!(r&&e)}function xv(r,e,t,a){var n=e._private;n.started=!0,n.startTime=t-n.progress*n.duration}function Zi(r,e){var t=e._private.aniEles,a=[];function n(f,h){var c=f._private,v=c.animation.current,d=c.animation.queue,g=!1;if(v.length===0){var y=d.shift();y&&v.push(y)}for(var p=function(L){for(var b=L.length-1;b>=0;b--){var x=L[b];x()}L.splice(0,L.length)},E=v.length-1;E>=0;E--){var m=v[E],T=m._private;if(T.stopped){v.splice(E,1),T.hooked=!1,T.playing=!1,T.started=!1,p(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||xv(f,m,r),wv(f,m,r,h),T.applying&&(T.applying=!1),p(T.frames),T.step!=null&&T.step(r),m.completed()&&(v.splice(E,1),T.hooked=!1,T.playing=!1,T.started=!1,p(T.completes)),g=!0)}return!h&&v.length===0&&d.length===0&&a.push(f),g}for(var i=!1,s=0;s<t.length;s++){var o=t[s],u=n(o);i=i||u}var l=n(e,!0);(i||l)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(a),e.emit("step")}var Tv={animate:Se.animate(),animation:Se.animation(),animated:Se.animated(),clearQueue:Se.clearQueue(),delay:Se.delay(),delayAnimation:Se.delayAnimation(),stop:Se.stop(),addToAnimationPool:function(e){var t=this;!t.styleEnabled()||t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){!e._private.animationsRunning||Ga(function(i){Zi(i,e),t()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,s){Zi(s,e)},a.beforeRenderPriorities.animations):t()}},Dv={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&la(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e}},Aa=function(e){return le(e)?new Xt(e):e},po={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new ja(Dv,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,a){return this.emitter().on(e,Aa(t),a),this},removeListener:function(e,t,a){return this.emitter().removeListener(e,Aa(t),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,a){return this.emitter().one(e,Aa(t),a),this},once:function(e,t,a){return this.emitter().one(e,Aa(t),a),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Se.eventAliasesOn(po);var Mn={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};Mn.jpeg=Mn.jpg;var ka={layout:function(e){var t=this;if(e==null){ze("Layout options must be specified to make a layout");return}if(e.name==null){ze("A `name` must be specified to make a layout");return}var a=e.name,n=t.extension("layout",a);if(n==null){ze("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;le(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var s=new n(ce({},e,{cy:t,eles:i}));return s}};ka.createLayout=ka.makeLayout=ka.layout;var Cv={notify:function(e,t){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();t!=null&&n.merge(t);return}if(!!a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.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 t=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?t.notify(a):t.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],s=e[i],o=t.getElementById(i);o.data(s)}})}},Lv=Ze({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),On={renderTo:function(e,t,a,n){var i=this._private.renderer;return i.renderTo(e,t,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 t=this,a=t.extension("renderer",e.name);if(a==null){ze("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&&Ae("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=Lv(e);n.cy=t,t._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.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)}};On.invalidateDimensions=On.resize;var Pa={collection:function(e,t){return le(e)?this.$(e):ft(e)?e.collection():Ie(e)?(t||(t={}),new Ke(this,e,t.unique,t.removed)):new Ke(this)},nodes:function(e){var t=this.$(function(a){return a.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(a){return a.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Pa.elements=Pa.filter=Pa.$;var rt={},qr="t",Sv="f";rt.apply=function(r){for(var e=this,t=e._private,a=t.cy,n=a.collection(),i=0;i<r.length;i++){var s=r[i],o=e.getContextMeta(s);if(!o.empty){var u=e.getContextStyle(o),l=e.applyContextStyle(o,u,s);s._private.appliedInitStyle?e.updateTransitions(s,l.diffProps):s._private.appliedInitStyle=!0;var f=e.updateStyleHints(s);f&&n.push(s)}}return n};rt.getPropertiesDiff=function(r,e){var t=this,a=t._private.propDiffs=t._private.propDiffs||{},n=r+"-"+e,i=a[n];if(i)return i;for(var s=[],o={},u=0;u<t.length;u++){var l=t[u],f=r[u]===qr,h=e[u]===qr,c=f!==h,v=l.mappedProperties.length>0;if(c||h&&v){var d=void 0;c&&v||c?d=l.properties:v&&(d=l.mappedProperties);for(var g=0;g<d.length;g++){for(var y=d[g],p=y.name,E=!1,m=u+1;m<t.length;m++){var T=t[m],D=e[m]===qr;if(!!D&&(E=T.properties[y.name]!=null,E))break}!o[p]&&!E&&(o[p]=!0,s.push(p))}}}return a[n]=s,s};rt.getContextMeta=function(r){for(var e=this,t="",a,n=r._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],o=s.selector&&s.selector.matches(r);o?t+=qr:t+=Sv}return a=e.getPropertiesDiff(n,t),r._private.styleCxtKey=t,{key:t,diffPropNames:a,empty:a.length===0}};rt.getContextStyle=function(r){var e=r.key,t=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<t.length;i++){var s=t[i],o=e[i]===qr;if(!!o)for(var u=0;u<s.properties.length;u++){var l=s.properties[u];n[l.name]=l}}return a[e]=n,n};rt.applyContextStyle=function(r,e,t){for(var a=this,n=r.diffPropNames,i={},s=a.types,o=0;o<n.length;o++){var u=n[o],l=e[u],f=t.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===s.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var h=f.mapping,c=h.fnValue=l.value(t);if(c===h.prevFnValue)continue}var v=i[u]={prev:f};a.applyParsedProperty(t,l),v.next=t.pstyle(u),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}};rt.updateStyleHints=function(r){var e=r._private,t=this,a=t.propertyGroupNames,n=t.propertyGroupKeys,i=function(Z,te,he){return t.getPropertiesHash(Z,te,he)},s=e.styleKey;if(r.removed())return!1;var o=e.group==="nodes",u=r._private.style;a=Object.keys(u);for(var l=0;l<n.length;l++){var f=n[l];e.styleKeys[f]=[mr,$r]}for(var h=function(Z,te){return e.styleKeys[te][0]=Zr(Z,e.styleKeys[te][0])},c=function(Z,te){return e.styleKeys[te][1]=Qr(Z,e.styleKeys[te][1])},v=function(Z,te){h(Z,te),c(Z,te)},d=function(Z,te){for(var he=0;he<Z.length;he++){var de=Z.charCodeAt(he);h(de,te),c(de,te)}},g=2e9,y=function(Z){return-128<Z&&Z<128&&Math.floor(Z)!==Z?g-(Z*1024|0):Z},p=0;p<a.length;p++){var E=a[p],m=u[E];if(m!=null){var T=this.properties[E],D=T.type,L=T.groupKey,b=void 0;T.hashOverride!=null?b=T.hashOverride(r,m):m.pfValue!=null&&(b=m.pfValue);var x=T.enums==null?m.value:null,w=b!=null,C=x!=null,A=w||C,S=m.units;if(D.number&&A&&!D.multiple){var O=w?b:x;v(y(O),L),!w&&S!=null&&d(S,L)}else d(m.strValue,L)}}for(var N=[mr,$r],P=0;P<n.length;P++){var I=n[P],k=e.styleKeys[I];N[0]=Zr(k[0],N[0]),N[1]=Qr(k[1],N[1])}e.styleKey=Vl(N[0],N[1]);var R=e.styleKeys;e.labelDimsKey=Ft(R.labelDimensions);var B=i(r,["label"],R.labelDimensions);if(e.labelKey=Ft(B),e.labelStyleKey=Ft(ba(R.commonLabel,B)),!o){var z=i(r,["source-label"],R.labelDimensions);e.sourceLabelKey=Ft(z),e.sourceLabelStyleKey=Ft(ba(R.commonLabel,z));var F=i(r,["target-label"],R.labelDimensions);e.targetLabelKey=Ft(F),e.targetLabelStyleKey=Ft(ba(R.commonLabel,F))}if(o){var V=e.styleKeys,U=V.nodeBody,$=V.nodeBorder,X=V.backgroundImage,H=V.compound,G=V.pie,q=[U,$,X,H,G].filter(function(K){return K!=null}).reduce(ba,[mr,$r]);e.nodeKey=Ft(q),e.hasPie=G!=null&&G[0]!==mr&&G[1]!==$r}return s!==e.styleKey};rt.clearStyleHints=function(r){var e=r._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};rt.applyParsedProperty=function(r,e){var t=this,a=e,n=r._private.style,i,s=t.types,o=t.properties[a.name].type,u=a.bypass,l=n[a.name],f=l&&l.bypass,h=r._private,c="mapping",v=function(U){return U==null?null:U.pfValue!=null?U.pfValue:U.value},d=function(){var U=v(l),$=v(a);t.checkTriggers(r,a.name,U,$)};if(a&&a.name.substr(0,3)==="pie"&&Ae("The pie style properties are deprecated. Create charts using background images instead."),e.name==="curve-style"&&r.isEdge()&&(e.value!=="bezier"&&r.isLoop()||e.value==="haystack"&&(r.source().isParent()||r.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 g=function(){Ae("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.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 s.mapData:{for(var y=a.field.split("."),p=h.data,E=0;E<y.length&&p;E++){var m=y[E];p=p[m]}if(p==null)return g(),!1;var T;if(ae(p)){var D=a.fieldMax-a.fieldMin;D===0?T=0:T=(p-a.fieldMin)/D}else return Ae("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+p+"` for `"+r.id()+"` is non-numeric)"),!1;if(T<0?T=0:T>1&&(T=1),o.color){var L=a.valueMin[0],b=a.valueMax[0],x=a.valueMin[1],w=a.valueMax[1],C=a.valueMin[2],A=a.valueMax[2],S=a.valueMin[3]==null?1:a.valueMin[3],O=a.valueMax[3]==null?1:a.valueMax[3],N=[Math.round(L+(b-L)*T),Math.round(x+(w-x)*T),Math.round(C+(A-C)*T),Math.round(S+(O-S)*T)];i={bypass:a.bypass,name:a.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else if(o.number){var P=a.valueMin+(a.valueMax-a.valueMin)*T;i=this.parse(a.name,P,a.bypass,c)}else return!1;if(!i)return g(),!1;i.mapping=a,a=i;break}case s.data:{for(var I=a.field.split("."),k=h.data,R=0;R<I.length&&k;R++){var B=I[R];k=k[B]}if(k!=null&&(i=this.parse(a.name,k,a.bypass,c)),!i)return g(),!1;i.mapping=a,a=i;break}case s.fn:{var z=a.value,F=a.fnValue!=null?a.fnValue:z(r);if(a.prevFnValue=F,F==null)return Ae("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+r.id()+"` is null)"),!1;if(i=this.parse(a.name,F,a.bypass,c),!i)return Ae("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+r.id()+"` is invalid)"),!1;i.mapping=Dt(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};rt.cleanElements=function(r,e){for(var t=0;t<r.length;t++){var a=r[t];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],u=n[o];u!=null&&(u.bypass?u.bypassed=null:n[o]=null)}}};rt.update=function(){var r=this._private.cy,e=r.mutableElements();e.updateStyle()};rt.updateTransitions=function(r,e){var t=this,a=r._private,n=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,s=r.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var o={},u=!1,l=0;l<n.length;l++){var f=n[l],h=r.pstyle(f),c=e[f];if(!!c){var v=c.prev,d=v,g=c.next!=null?c.next:h,y=!1,p=void 0,E=1e-6;!d||(ae(d.pfValue)&&ae(g.pfValue)?(y=g.pfValue-d.pfValue,p=d.pfValue+E*y):ae(d.value)&&ae(g.value)?(y=g.value-d.value,p=d.value+E*y):Ie(d.value)&&Ie(g.value)&&(y=d.value[0]!==g.value[0]||d.value[1]!==g.value[1]||d.value[2]!==g.value[2],p=d.strValue),y&&(o[f]=g.strValue,this.applyBypass(r,f,p),u=!0))}}if(!u)return;a.transitioning=!0,new Nr(function(m){s>0?r.delayAnimation(s).play().promise().then(m):m()}).then(function(){return r.animation({style:o,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1)};rt.checkTrigger=function(r,e,t,a,n,i){var s=this.properties[e],o=n(s);o!=null&&o(t,a)&&i(s)};rt.checkZOrderTrigger=function(r,e,t,a){var n=this;this.checkTrigger(r,e,t,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",r)})};rt.checkBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBounds},function(n){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),n.triggersBoundsOfParallelBeziers&&(e==="curve-style"&&(t==="bezier"||a==="bezier")||e==="display"&&(t==="none"||a==="none"))&&r.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()})})};rt.checkTriggers=function(r,e,t,a){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,a),this.checkBoundsTrigger(r,e,t,a)};var va={};va.applyBypass=function(r,e,t,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var o=0;o<n.properties.length;o++){var u=n.properties[o],l=u.name,f=this.parse(l,t,!0);f&&i.push(f)}}else if(le(e)){var h=this.parse(e,t,!0);h&&i.push(h)}else if(Te(e)){var c=e;a=t;for(var v=Object.keys(c),d=0;d<v.length;d++){var g=v[d],y=c[g];if(y===void 0&&(y=c[_a(g)]),y!==void 0){var p=this.parse(g,y,!0);p&&i.push(p)}}}else return!1;if(i.length===0)return!1;for(var E=!1,m=0;m<r.length;m++){for(var T=r[m],D={},L=void 0,b=0;b<i.length;b++){var x=i[b];if(a){var w=T.pstyle(x.name);L=D[x.name]={prev:w}}E=this.applyParsedProperty(T,Dt(x))||E,a&&(L.next=T.pstyle(x.name))}E&&this.updateStyleHints(T),a&&this.updateTransitions(T,D,s)}return E};va.overrideBypass=function(r,e,t){e=Vn(e);for(var a=0;a<r.length;a++){var n=r[a],i=n._private.style[e],s=this.properties[e].type,o=s.color,u=s.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,t):(i.value=t,i.pfValue!=null&&(i.pfValue=t),o?i.strValue="rgb("+t.join(",")+")":u?i.strValue=t.join(" "):i.strValue=""+t,this.updateStyleHints(n)),this.checkTriggers(n,e,l,t)}};va.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)};va.removeBypasses=function(r,e,t){for(var a=!0,n=0;n<r.length;n++){for(var i=r[n],s={},o=0;o<e.length;o++){var u=e[o],l=this.properties[u],f=i.pstyle(l.name);if(!(!f||!f.bypass)){var h="",c=this.parse(u,h,!0),v=s[l.name]={prev:f};this.applyParsedProperty(i,c),v.next=i.pstyle(l.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,s,a)}};var Qn={};Qn.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1};Qn.containerCss=function(r){var e=this._private.cy,t=e.container();if(Be&&t&&Be.getComputedStyle)return Be.getComputedStyle(t).getPropertyValue(r)};var Lt={};Lt.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)};Lt.getRawStyle=function(r,e){var t=this;if(r=r[0],r){for(var a={},n=0;n<t.properties.length;n++){var i=t.properties[n],s=t.getStylePropertyValue(r,i.name,e);s!=null&&(a[i.name]=s,a[_a(i.name)]=s)}return a}};Lt.getIndexedStyle=function(r,e,t,a){var n=r.pstyle(e)[t][a];return n!=null?n:r.cy().style().getDefaultProperty(e)[t][0]};Lt.getStylePropertyValue=function(r,e,t){var a=this;if(r=r[0],r){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,s=r.pstyle(n.name);if(s){var o=s.value,u=s.units,l=s.strValue;if(t&&i.number&&o!=null&&ae(o)){var f=r.cy().zoom(),h=function(y){return y*f},c=function(y,p){return h(y)+p},v=Ie(o),d=v?u.every(function(g){return g!=null}):u!=null;return d?v?o.map(function(g,y){return c(g,u[y])}).join(" "):c(o,u):v?o.map(function(g){return le(g)?g:""+h(g)}).join(" "):""+h(o)}else if(l!=null)return l}return null}};Lt.getAnimationStartStyle=function(r,e){for(var t={},a=0;a<e.length;a++){var n=e[a],i=n.name,s=r.pstyle(i);s!==void 0&&(Te(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(t[i]=s)}return t};Lt.getPropsList=function(r){var e=this,t=[],a=r,n=e.properties;if(a)for(var i=Object.keys(a),s=0;s<i.length;s++){var o=i[s],u=a[o],l=n[o]||n[Vn(o)],f=this.parse(l.name,u);f&&t.push(f)}return t};Lt.getNonDefaultPropertiesHash=function(r,e,t){var a=t.slice(),n,i,s,o,u,l;for(u=0;u<e.length;u++)if(n=e[u],i=r.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=Zr(o,a[0]),a[1]=Qr(o,a[1]);else for(s=i.strValue,l=0;l<s.length;l++)o=s.charCodeAt(l),a[0]=Zr(o,a[0]),a[1]=Qr(o,a[1]);return a};Lt.getPropertiesHash=Lt.getNonDefaultPropertiesHash;var rn={};rn.appendFromJson=function(r){for(var e=this,t=0;t<r.length;t++){var a=r[t],n=a.selector,i=a.style||a.css,s=Object.keys(i);e.selector(n);for(var o=0;o<s.length;o++){var u=s[o],l=i[u];e.css(u,l)}}return e};rn.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e};rn.json=function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],a=t.selector,n=t.properties,i={},s=0;s<n.length;s++){var o=n[s];i[o.name]=o.strValue}r.push({selector:a?a.toString():"core",style:i})}return r};var Jn={};Jn.appendFromString=function(r){var e=this,t=this,a=""+r,n,i,s;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){a.length>n.length?a=a.substr(n.length):a=""}function u(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){Ae("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 c=new Xt(h);if(c.invalid){Ae("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),o();continue}}var v=f[2],d=!1;i=v;for(var g=[];;){var y=i.match(/^\s*$/);if(y)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ae("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),d=!0;break}s=p[0];var E=p[1],m=p[2],T=e.properties[E];if(!T){Ae("Skipping property: Invalid property name in: "+s),u();continue}var D=t.parse(E,m);if(!D){Ae("Skipping property: Invalid property definition in: "+s),u();continue}g.push({name:E,val:m}),u()}if(d){o();break}t.selector(h);for(var L=0;L<g.length;L++){var b=g[L];t.css(b.name,b.val)}o()}return t};Jn.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var We={};(function(){var r=$e,e=Sl,t=Nl,a=Ml,n=Ol,i=function(q){return"^"+q+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(q){var K=r+"|\\w+|"+e+"|"+t+"|"+a+"|"+n;return"^"+q+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+K+")\\s*\\,\\s*("+K+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];We.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},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"]},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"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},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"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},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"]},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","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},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"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},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:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,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"]},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(q,K){switch(q.length){case 2:return K[0]!=="deg"&&K[0]!=="rad"&&K[1]!=="deg"&&K[1]!=="rad";case 1:return le(q[0])||K[0]==="deg"||K[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\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(q){var K=q.length;return K===1||K===2||K===4}}};var u={zeroNonZero:function(q,K){return(q==null||K==null)&&q!==K||q==0&&K!=0?!0:q!=0&&K==0},any:function(q,K){return q!=K},emptyNonEmpty:function(q,K){var Z=Ut(q),te=Ut(K);return Z&&!te||!Z&&te}},l=We.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}],c=[{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}],v=[{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}],g=[{name:"events",type:l.bool},{name:"text-events",type:l.bool}],y=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{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.nonNegativeInt,triggersZOrder:u.any}],p=[{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}],E=[{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}],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}],T=function(q,K){return K.value==="label"?-q.poolIndex():K.pfValue},D=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:T},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:T},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{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}],L=[{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}],b=[{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}],x=[{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}],w=[{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-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{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:"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:"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}],C=[{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}],A=[{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}],S=[];We.pieBackgroundN=16,S.push({name:"pie-size",type:l.sizeMaybePercent});for(var O=1;O<=We.pieBackgroundN;O++)S.push({name:"pie-"+O+"-background-color",type:l.color}),S.push({name:"pie-"+O+"-background-size",type:l.percent}),S.push({name:"pie-"+O+"-background-opacity",type:l.zeroOneNumber});var N=[],P=We.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}].forEach(function(G){P.forEach(function(q){var K=q+"-"+G.name,Z=G.type,te=G.triggersBounds;N.push({name:K,type:Z,triggersBounds:te})})},{});var I=We.properties=[].concat(g,m,y,p,E,C,d,v,f,h,c,D,L,b,S,x,w,N,A),k=We.propertyGroups={behavior:g,transition:m,visibility:y,overlay:p,underlay:E,ghost:C,commonLabel:d,labelDimensions:v,mainLabel:f,sourceLabel:h,targetLabel:c,nodeBody:D,nodeBorder:L,backgroundImage:b,pie:S,compound:x,edgeLine:w,edgeArrow:N,core:A},R=We.propertyGroupNames={},B=We.propertyGroupKeys=Object.keys(k);B.forEach(function(G){R[G]=k[G].map(function(q){return q.name}),k[G].forEach(function(q){return q.groupKey=G})});var z=We.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{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"}];We.propertyNames=I.map(function(G){return G.name});for(var F=0;F<I.length;F++){var V=I[F];I[V.name]=V}for(var U=0;U<z.length;U++){var $=z[U],X=I[$.pointsTo],H={name:$.name,alias:!0,pointsTo:X};I.push(H),I[$.name]=H}})();We.getDefaultProperty=function(r){return this.getDefaultProperties()[r]};We.getDefaultProperties=function(){var r=this._private;if(r.defaultProperties!=null)return r.defaultProperties;for(var e=ce({"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","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","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","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",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","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%"},[{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<=We.pieBackgroundN;f++){var h=l.name.replace("{{i}}",f),c=l.value;u[h]=c}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"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,"taxi-turn":"50%","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"}].reduce(function(u,l){return We.arrowPrefixes.forEach(function(f){var h=f+"-"+l.name,c=l.value;u[h]=c}),u},{})),t={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,s=e[i],o=this.parse(i,s);t[i]=o}}return r.defaultProperties=t,r.defaultProperties};We.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 an={};an.parse=function(r,e,t,a){var n=this;if(Fe(e))return n.parseImplWarn(r,e,t,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,s=t?"t":"f",o=""+e,u=Ms(r,o,s,i),l=n.propCache=n.propCache||[],f;return(f=l[u])||(f=l[u]=n.parseImplWarn(r,e,t,a)),(t||a==="mapping")&&(f=Dt(f),f&&(f.value=Dt(f.value))),f};an.parseImplWarn=function(r,e,t,a){var n=this.parseImpl(r,e,t,a);return!n&&e!=null&&Ae("The style property `".concat(r,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Ae("The style value of `label` is deprecated for `"+n.name+"`"),n};an.parseImpl=function(r,e,t,a){var n=this;r=Vn(r);var i=n.properties[r],s=e,o=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,r=i.name);var u=le(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(t&&(e===""||e===null))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(Fe(e))return{name:r,value:e,strValue:"fn",mapped:o.fn,bypass:t};var f,h;if(!(!u||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(o.data.regex).exec(e))){if(t)return!1;var c=o.data;return{name:r,value:f,strValue:""+e,mapped:c,field:f[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(h=new RegExp(o.mapData.regex).exec(e))){if(t||l.multiple)return!1;var v=o.mapData;if(!(l.color||l.number))return!1;var d=this.parse(r,h[4]);if(!d||d.mapped)return!1;var g=this.parse(r,h[5]);if(!g||g.mapped)return!1;if(d.pfValue===g.pfValue||d.strValue===g.strValue)return Ae("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+d.strValue+"`"),this.parse(r,d.strValue);if(l.color){var y=d.value,p=g.value,E=y[0]===p[0]&&y[1]===p[1]&&y[2]===p[2]&&(y[3]===p[3]||(y[3]==null||y[3]===1)&&(p[3]==null||p[3]===1));if(E)return!1}return{name:r,value:h,strValue:""+e,mapped:v,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:d.value,valueMax:g.value,bypass:t}}}if(l.multiple&&a!=="multiple"){var m;if(u?m=e.split(/\s+/):Ie(e)?m=e:m=[e],l.evenMultiple&&m.length%2!==0)return null;for(var T=[],D=[],L=[],b="",x=!1,w=0;w<m.length;w++){var C=n.parse(r,m[w],t,"multiple");x=x||le(C.value),T.push(C.value),L.push(C.pfValue!=null?C.pfValue:C.value),D.push(C.units),b+=(w>0?" ":"")+C.strValue}return l.validate&&!l.validate(T,D)?null:l.singleEnum&&x?T.length===1&&le(T[0])?{name:r,value:T[0],strValue:T[0],bypass:t}:null:{name:r,value:T,pfValue:L,strValue:b,bypass:t,units:D}}var A=function(){for(var K=0;K<l.enums.length;K++){var Z=l.enums[K];if(Z===e)return{name:r,value:e,strValue:""+e,bypass:t}}return null};if(l.number){var S,O="px";if(l.units&&(S=l.units),l.implicitUnits&&(O=l.implicitUnits),!l.unitless)if(u){var N="px|em"+(l.allowPercent?"|\\%":"");S&&(N=S);var P=e.match("^("+$e+")("+N+")?$");P&&(e=P[1],S=P[2]||O)}else(!S||l.implicitUnits)&&(S=O);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=s,A();if(l.integer&&!El(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 I={name:r,value:e,strValue:""+e+(S||""),units:S,bypass:t};return l.unitless||S!=="px"&&S!=="em"?I.pfValue=e:I.pfValue=S==="px"||!S?e:this.getEmSizeInPixels()*e,(S==="ms"||S==="s")&&(I.pfValue=S==="ms"?e:1e3*e),(S==="deg"||S==="rad")&&(I.pfValue=S==="rad"?e:pf(e)),S==="%"&&(I.pfValue=e/100),I}else if(l.propList){var k=[],R=""+e;if(R!=="none"){for(var B=R.split(/\s*,\s*|\s+/),z=0;z<B.length;z++){var F=B[z].trim();n.properties[F]?k.push(F):Ae("`"+F+"` is not a valid property name")}if(k.length===0)return null}return{name:r,value:k,strValue:k.length===0?"none":k.join(" "),bypass:t}}else if(l.color){var V=Fl(e);return V?{name:r,value:V,pfValue:V,strValue:"rgb("+V[0]+","+V[1]+","+V[2]+")",bypass:t}:null}else if(l.regex||l.regexes){if(l.enums){var U=A();if(U)return U}for(var $=l.regexes?l.regexes:[l.regex],X=0;X<$.length;X++){var H=new RegExp($[X]),G=H.exec(e);if(G)return{name:r,value:l.singleRegexMatchValue?G[1]:G,strValue:""+e,bypass:t}}return null}else return l.string?{name:r,value:""+e,strValue:""+e,bypass:t}:l.enums?A():null};var je=function r(e){if(!(this instanceof r))return new r(e);if(!zn(e)){ze("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},tt=je.prototype;tt.instanceString=function(){return"style"};tt.clear=function(){for(var r=this._private,e=r.cy,t=e.elements(),a=0;a<this.length;a++)this[a]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};tt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};tt.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)};tt.selector=function(r){var e=r==="core"?null:new Xt(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this};tt.css=function(){var r=this,e=arguments;if(e.length===1)for(var t=e[0],a=0;a<r.properties.length;a++){var n=r.properties[a],i=t[n.name];i===void 0&&(i=t[_a(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};tt.style=tt.css;tt.cssRule=function(r,e){var t=this.parse(r,e);if(t){var a=this.length-1;this[a].properties.push(t),this[a].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.mapped&&this[a].mappedProperties.push(t);var n=!this[a].selector;n&&(this._private.coreStyle[t.name]=t)}return this};tt.append=function(r){return xs(r)?r.appendToStyle(this):Ie(r)?this.appendFromJson(r):le(r)&&this.appendFromString(r),this};je.fromJson=function(r,e){var t=new je(r);return t.fromJson(e),t};je.fromString=function(r,e){return new je(r).fromString(e)};[rt,va,Qn,Lt,rn,Jn,We,an].forEach(function(r){ce(tt,r)});je.types=tt.types;je.properties=tt.properties;je.propertyGroups=tt.propertyGroups;je.propertyGroupNames=tt.propertyGroupNames;je.propertyGroupKeys=tt.propertyGroupKeys;var Av={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return xs(e)?t.style=e.generateStyle(this):Ie(e)?t.style=je.fromJson(this,e):le(e)?t.style=je.fromString(this,e):t.style=je(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Nv="single",nr={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 t=this._private;if(t.selectionType==null&&(t.selectionType=Nv),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.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,t=this._private.pan,a,n,i,s,o;switch(e.length){case 0:return t;case 1:if(le(e[0]))return a=e[0],t[a];if(Te(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,o=i.y,ae(s)&&(t.x=s),ae(o)&&(t.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&ae(n)&&(t[a]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var a=arguments,n=this._private.pan,i,s,o,u,l;if(!this._private.panningEnabled)return this;switch(a.length){case 1:Te(e)&&(o=a[0],u=o.x,l=o.y,ae(u)&&(n.x+=u),ae(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:i=e,s=t,(i==="x"||i==="y")&&ae(s)&&(n[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,t){var a=this.getFitViewport(e,t);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,t){if(ae(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(le(e)){var n=e;e=this.$(n)}else if(Tl(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 ft(e)||(e=this.mutableElements());if(!(ft(e)&&e.empty())){a=a||e.boundingBox();var s=this.width(),o=this.height(),u;if(t=ae(t)?t:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((s-2*t)/a.w,(o-2*t)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(s-u*(a.x1+a.x2))/2,y:(o-u*(a.y1+a.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,t){var a=this._private;if(t==null){var n=e;e=n.min,t=n.max}return ae(e)&&ae(t)&&e<=t?(a.minZoom=e,a.maxZoom=t):ae(e)&&t===void 0&&e<=a.maxZoom?a.minZoom=e:ae(t)&&e===void 0&&t>=a.minZoom&&(a.maxZoom=t),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 t=this._private,a=t.pan,n=t.zoom,i,s,o=!1;if(t.zoomingEnabled||(o=!0),ae(e)?s=e:Te(e)&&(s=e.level,e.position!=null?i=Za(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(o=!0)),s=s>t.maxZoom?t.maxZoom:s,s=s<t.minZoom?t.minZoom:s,o||!ae(s)||s===n||i!=null&&(!ae(i.x)||!ae(i.y)))return null;if(i!=null){var u=a,l=n,f=s,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:s,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),a=this._private;return t==null||!t.zoomed?this:(a.zoom=t.zoom,t.panned&&(a.pan.x=t.pan.x,a.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var t=this._private,a=!0,n=!0,i=[],s=!1,o=!1;if(!e)return this;if(ae(e.zoom)||(a=!1),Te(e.pan)||(n=!1),!a&&!n)return this;if(a){var u=e.zoom;u<t.minZoom||u>t.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=u,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;ae(l.x)&&(t.pan.x=l.x,o=!1),ae(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(!!this._private.panningEnabled){if(le(e)){var a=e;e=this.mutableElements().filter(a)}else ft(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();t=t===void 0?this._private.zoom:t;var o={x:(i-t*(n.x1+n.x2))/2,y:(s-t*(n.y1+n.y2))/2};return o}}},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,t=e.container;return e.sizeCache=e.sizeCache||(t?function(){var a=Be.getComputedStyle(t),n=function(s){return parseFloat(a.getPropertyValue(s))};return{width:t.clientWidth-n("padding-left")-n("padding-right"),height:t.clientHeight-n("padding-top")-n("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,t=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/t,x2:(a.x2-e.x)/t,y1:(a.y1-e.y)/t,y2:(a.y2-e.y)/t};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};nr.centre=nr.center;nr.autolockNodes=nr.autolock;nr.autoungrabifyNodes=nr.autoungrabify;var aa={data:Se.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Se.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Se.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Se.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};aa.attr=aa.data;aa.removeAttr=aa.removeData;var na=function(e){var t=this;e=ce({},e);var a=e.container;a&&!Fa(a)&&Fa(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=t;var s=Be!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=ce({name:s?"grid":"null"},o.layout),o.renderer=ce({name:s?"canvas":"null"},o.renderer);var u=function(d,g,y){return g!==void 0?g:y!==void 0?y:d},l=this._private={container:a,ready:!1,options:o,elements:new Ke(this),listeners:[],aniEles:new Ke(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,o.zoomingEnabled),userZoomingEnabled:u(!0,o.userZoomingEnabled),panningEnabled:u(!0,o.panningEnabled),userPanningEnabled:u(!0,o.userPanningEnabled),boxSelectionEnabled:u(!0,o.boxSelectionEnabled),autolock:u(!1,o.autolock,o.autolockNodes),autoungrabify:u(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:u(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ae(o.zoom)?o.zoom:1,pan:{x:Te(o.pan)&&ae(o.pan.x)?o.pan.x:0,y:Te(o.pan)&&ae(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var f=function(d,g){var y=d.some(Dl);if(y)return Nr.all(d).then(g);g(d)};l.styleEnabled&&t.setStyle([]);var h=ce({},o,o.renderer);t.initRenderer(h);var c=function(d,g,y){t.notifications(!1);var p=t.mutableElements();p.length>0&&p.remove(),d!=null&&(Te(d)||Ie(d))&&t.add(d),t.one("layoutready",function(m){t.notifications(!0),t.emit(m),t.one("load",g),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",y),t.emit("done")});var E=ce({},t._private.options.layout);E.eles=t.elements(),t.layout(E).run()};f([o.style,o.elements],function(v){var d=v[0],g=v[1];l.styleEnabled&&t.style().append(d),c(g,function(){t.startAnimationLoop(),l.ready=!0,Fe(o.ready)&&t.on("ready",o.ready);for(var y=0;y<i.length;y++){var p=i[y];t.on("ready",p)}n&&(n.readies=[]),t.emit("ready")},o.done)})},Ya=na.prototype;ce(Ya,{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},mount:function(e){if(e!=null){var t=this,a=t._private,n=a.options;return!Fa(e)&&Fa(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),a.container=e,a.styleEnabled=!0,t.invalidateSize(),t.initRenderer(ce({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),t.startAnimationLoop(),t.style(n.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Dt(this._private.options)},json:function(e){var t=this,a=t._private,n=t.mutableElements(),i=function(T){return t.getElementById(T.id())};if(Te(e)){if(t.startBatch(),e.elements){var s={},o=function(T,D){for(var L=[],b=[],x=0;x<T.length;x++){var w=T[x];if(!w.data.id){Ae("cy.json() cannot handle elements without an ID attribute");continue}var C=""+w.data.id,A=t.getElementById(C);s[C]=!0,A.length!==0?b.push({ele:A,json:w}):(D&&(w.group=D),L.push(w))}t.add(L);for(var S=0;S<b.length;S++){var O=b[S],N=O.ele,P=O.json;N.json(P)}};if(Ie(e.elements))o(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],h=e.elements[f];Ie(h)&&o(h,f)}var c=t.collection();n.filter(function(m){return!s[m.id()]}).forEach(function(m){m.isParent()?c.merge(m):m.remove()}),c.forEach(function(m){return m.children().move({parent:null})}),c.forEach(function(m){return i(m).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<v.length;d++){var g=v[d];e[g]!=null&&t[g](e[g])}return t.endBatch(),this}else{var y=!!e,p={};y?p.elements=this.elements().map(function(m){return m.json()}):(p.elements={},n.forEach(function(m){var T=m.group();p.elements[T]||(p.elements[T]=[]),p.elements[T].push(m.json())})),this._private.styleEnabled&&(p.style=t.style().json()),p.data=Dt(t.data());var E=a.options;return p.zoomingEnabled=a.zoomingEnabled,p.userZoomingEnabled=a.userZoomingEnabled,p.zoom=a.zoom,p.minZoom=a.minZoom,p.maxZoom=a.maxZoom,p.panningEnabled=a.panningEnabled,p.userPanningEnabled=a.userPanningEnabled,p.pan=Dt(a.pan),p.boxSelectionEnabled=a.boxSelectionEnabled,p.renderer=Dt(E.renderer),p.hideEdgesOnViewport=E.hideEdgesOnViewport,p.textureOnViewport=E.textureOnViewport,p.wheelSensitivity=E.wheelSensitivity,p.motionBlur=E.motionBlur,p.multiClickDebounceTime=E.multiClickDebounceTime,p}}});Ya.$id=Ya.getElementById;[mv,Tv,po,Mn,ka,Cv,On,Pa,Av,nr,aa].forEach(function(r){ce(Ya,r)});var Mv={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},pr=function(e){return e.scratch("breadthfirst")},Qi=function(e,t){return e.scratch("breadthfirst",t)};function yo(r){this.options=ce({},Mv,r)}yo.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().filter(function(ee){return!ee.isParent()}),i=a,s=e.directed,o=e.maximal||e.maximalAdjustments>0,u=lt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),l;if(ft(e.roots))l=e.roots;else if(Ie(e.roots)){for(var f=[],h=0;h<e.roots.length;h++){var c=e.roots[h],v=t.getElementById(c);f.push(v)}l=t.collection(f)}else if(le(e.roots))l=t.$(e.roots);else if(s)l=n.roots();else{var d=a.components();l=t.collection();for(var g=function(re){var fe=d[re],se=fe.maxDegree(!1),ne=fe.filter(function(ue){return ue.degree(!1)===se});l=l.add(ne)},y=0;y<d.length;y++)g(y)}var p=[],E={},m=function(re,fe){p[fe]==null&&(p[fe]=[]);var se=p[fe].length;p[fe].push(re),Qi(re,{index:se,depth:fe})},T=function(re,fe){var se=pr(re),ne=se.depth,ue=se.index;p[ne][ue]=null,m(re,fe)};i.bfs({roots:l,directed:e.directed,visit:function(re,fe,se,ne,ue){var Ee=re[0],ge=Ee.id();m(Ee,ue),E[ge]=!0}});for(var D=[],L=0;L<n.length;L++){var b=n[L];E[b.id()]||D.push(b)}var x=function(re){for(var fe=p[re],se=0;se<fe.length;se++){var ne=fe[se];if(ne==null){fe.splice(se,1),se--;continue}Qi(ne,{depth:re,index:se})}},w=function(){for(var re=0;re<p.length;re++)x(re)},C=function(re,fe){for(var se=pr(re),ne=re.incomers().filter(function(M){return M.isNode()&&a.has(M)}),ue=-1,Ee=re.id(),ge=0;ge<ne.length;ge++){var ve=ne[ge],J=pr(ve);ue=Math.max(ue,J.depth)}return se.depth<=ue?fe[Ee]?null:(T(re,ue+1),fe[Ee]=!0,!0):!1};if(s&&o){var A=[],S={},O=function(re){return A.push(re)},N=function(){return A.shift()};for(n.forEach(function(ee){return A.push(ee)});A.length>0;){var P=N(),I=C(P,S);if(I)P.outgoers().filter(function(ee){return ee.isNode()&&a.has(ee)}).forEach(O);else if(I===null){Ae("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}w();var k=0;if(e.avoidOverlap)for(var R=0;R<n.length;R++){var B=n[R],z=B.layoutDimensions(e),F=z.w,V=z.h;k=Math.max(k,F,V)}var U={},$=function(re){if(U[re.id()])return U[re.id()];for(var fe=pr(re).depth,se=re.neighborhood(),ne=0,ue=0,Ee=0;Ee<se.length;Ee++){var ge=se[Ee];if(!(ge.isEdge()||ge.isParent()||!n.has(ge))){var ve=pr(ge);if(ve!=null){var J=ve.index,M=ve.depth;if(!(J==null||M==null)){var Y=p[M].length;M<fe&&(ne+=J/Y,ue++)}}}}return ue=Math.max(1,ue),ne=ne/ue,ue===0&&(ne=0),U[re.id()]=ne,ne},X=function(re,fe){var se=$(re),ne=$(fe),ue=se-ne;return ue===0?Ds(re.id(),fe.id()):ue};e.depthSort!==void 0&&(X=e.depthSort);for(var H=0;H<p.length;H++)p[H].sort(X),x(H);for(var G=[],q=0;q<D.length;q++)G.push(D[q]);p.unshift(G),w();for(var K=0,Z=0;Z<p.length;Z++)K=Math.max(p[Z].length,K);var te={x:u.x1+u.w/2,y:u.x1+u.h/2},he=p.reduce(function(ee,re){return Math.max(ee,re.length)},0),de=function(re){var fe=pr(re),se=fe.depth,ne=fe.index,ue=p[se].length,Ee=Math.max(u.w/((e.grid?he:ue)+1),k),ge=Math.max(u.h/(p.length+1),k),ve=Math.min(u.w/2/p.length,u.h/2/p.length);if(ve=Math.max(ve,k),e.circle){var M=ve*se+ve-(p.length>0&&p[0].length<=3?ve/2:0),Y=2*Math.PI/p[se].length*ne;return se===0&&p[0].length===1&&(M=1),{x:te.x+M*Math.cos(Y),y:te.y+M*Math.sin(Y)}}else{var J={x:te.x+(ne+1-(ue+1)/2)*Ee,y:(se+1)*ge};return J}};return a.nodes().layoutPositions(this,e,de),this};var Ov={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function mo(r){this.options=ce({},Ov,r)}mo.prototype.run=function(){var r=this.options,e=r,t=r.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 s=lt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.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,c=0;c<i.length;c++){var v=i[c],d=v.layoutDimensions(e),g=d.w,y=d.h;h=Math.max(h,g,y)}if(ae(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(s.h,s.w)/2-h,i.length>1&&e.avoidOverlap){h*=1.75;var p=Math.cos(l)-Math.cos(0),E=Math.sin(l)-Math.sin(0),m=Math.sqrt(h*h/(p*p+E*E));f=Math.max(m,f)}var T=function(L,b){var x=e.startAngle+b*l*(n?1:-1),w=f*Math.cos(x),C=f*Math.sin(x),A={x:o.x+w,y:o.y+C};return A};return a.nodes().layoutPositions(this,e,T),this};var Iv={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function bo(r){this.options=ce({},Iv,r)}bo.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=r.cy,n=e.eles,i=n.nodes().not(":parent"),s=lt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],l=0,f=0;f<i.length;f++){var h=i[f],c=void 0;c=e.concentric(h),u.push({value:c,node:h}),h._private.scratch.concentric=c}i.updateStyle();for(var v=0;v<i.length;v++){var d=i[v],g=d.layoutDimensions(e);l=Math.max(l,g.w,g.h)}u.sort(function(ee,re){return re.value-ee.value});for(var y=e.levelWidth(i),p=[[]],E=p[0],m=0;m<u.length;m++){var T=u[m];if(E.length>0){var D=Math.abs(E[0].value-T.value);D>=y&&(E=[],p.push(E))}E.push(T)}var L=l+e.minNodeSpacing;if(!e.avoidOverlap){var b=p.length>0&&p[0].length>1,x=Math.min(s.w,s.h)/2-L,w=x/(p.length+b?1:0);L=Math.min(L,w)}for(var C=0,A=0;A<p.length;A++){var S=p[A],O=e.sweep===void 0?2*Math.PI-2*Math.PI/S.length:e.sweep,N=S.dTheta=O/Math.max(1,S.length-1);if(S.length>1&&e.avoidOverlap){var P=Math.cos(N)-Math.cos(0),I=Math.sin(N)-Math.sin(0),k=Math.sqrt(L*L/(P*P+I*I));C=Math.max(k,C)}S.r=C,C+=L}if(e.equidistant){for(var R=0,B=0,z=0;z<p.length;z++){var F=p[z],V=F.r-B;R=Math.max(R,V)}B=0;for(var U=0;U<p.length;U++){var $=p[U];U===0&&(B=$.r),$.r=B,B+=R}}for(var X={},H=0;H<p.length;H++)for(var G=p[H],q=G.dTheta,K=G.r,Z=0;Z<G.length;Z++){var te=G[Z],he=e.startAngle+(t?1:-1)*q*Z,de={x:o.x+K*Math.cos(he),y:o.y+K*Math.sin(he)};X[te.node.id()]=de}return n.nodes().layoutPositions(this,e,function(ee){var re=ee.id();return X[re]}),this};var bn,Rv={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){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 nn(r){this.options=ce({},Rv,r),this.options.layout=this}nn.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(r.animate===!0||r.animate===!1)&&t.emit({type:"layoutstart",layout:t}),r.debug===!0?bn=!0:bn=!1;var a=kv(e,t,r);bn&&Fv(a),r.randomize&&Gv(a);var n=Ot(),i=function(){zv(a,e,r),r.fit===!0&&e.fit(r.padding)},s=function(c){return!(t.stopped||c>=r.numIter||(Vv(a,r),a.temperature=a.temperature*r.coolingFactor,a.temperature<r.minTemp))},o=function(){if(r.animate===!0||r.animate===!1)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var c=r.eles.nodes(),v=Eo(a,r,c);c.layoutPositions(t,r,v)}},u=0,l=!0;if(r.animate===!0){var f=function h(){for(var c=0;l&&c<r.refresh;)l=s(u),u++,c++;if(!l)ji(a,r),o();else{var v=Ot();v-n>=r.animationThreshold&&i(),Ga(h)}};f()}else{for(;l;)l=s(u),u++;ji(a,r),o()}return this};nn.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};nn.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var kv=function(e,t,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:lt(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},o=a.eles.components(),u={},l=0;l<o.length;l++)for(var f=o[l],h=0;h<f.length;h++){var c=f[h];u[c.id()]=l}for(var l=0;l<s.nodeSize;l++){var v=i[l],d=v.layoutDimensions(a),g={};g.isLocked=v.locked(),g.id=v.data("id"),g.parentId=v.data("parent"),g.cmptId=u[v.id()],g.children=[],g.positionX=v.position("x"),g.positionY=v.position("y"),g.offsetX=0,g.offsetY=0,g.height=d.w,g.width=d.h,g.maxX=g.positionX+g.width/2,g.minX=g.positionX-g.width/2,g.maxY=g.positionY+g.height/2,g.minY=g.positionY-g.height/2,g.padLeft=parseFloat(v.style("padding")),g.padRight=parseFloat(v.style("padding")),g.padTop=parseFloat(v.style("padding")),g.padBottom=parseFloat(v.style("padding")),g.nodeRepulsion=Fe(a.nodeRepulsion)?a.nodeRepulsion(v):a.nodeRepulsion,s.layoutNodes.push(g),s.idToIndex[g.id]=l}for(var y=[],p=0,E=-1,m=[],l=0;l<s.nodeSize;l++){var v=s.layoutNodes[l],T=v.parentId;T!=null?s.layoutNodes[s.idToIndex[T]].children.push(v.id):(y[++E]=v.id,m.push(v.id))}for(s.graphSet.push(m);p<=E;){var D=y[p++],L=s.idToIndex[D],c=s.layoutNodes[L],b=c.children;if(b.length>0){s.graphSet.push(b);for(var l=0;l<b.length;l++)y[++E]=b[l]}}for(var l=0;l<s.graphSet.length;l++)for(var x=s.graphSet[l],h=0;h<x.length;h++){var w=s.idToIndex[x[h]];s.indexToGraph[w]=l}for(var l=0;l<s.edgeSize;l++){var C=n[l],A={};A.id=C.data("id"),A.sourceId=C.data("source"),A.targetId=C.data("target");var S=Fe(a.idealEdgeLength)?a.idealEdgeLength(C):a.idealEdgeLength,O=Fe(a.edgeElasticity)?a.edgeElasticity(C):a.edgeElasticity,N=s.idToIndex[A.sourceId],P=s.idToIndex[A.targetId],I=s.indexToGraph[N],k=s.indexToGraph[P];if(I!=k){for(var R=Pv(A.sourceId,A.targetId,s),B=s.graphSet[R],z=0,g=s.layoutNodes[N];B.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],z++;for(g=s.layoutNodes[P];B.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],z++;S*=z*a.nestingFactor}A.idealLength=S,A.elasticity=O,s.layoutEdges.push(A)}return s},Pv=function(e,t,a){var n=Bv(e,t,0,a);return 2>n.count?0:n.graph},Bv=function r(e,t,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:a};for(var s=0,o=0;o<i.length;o++){var u=i[o],l=n.idToIndex[u],f=n.layoutNodes[l].children;if(f.length!==0){var h=n.indexToGraph[n.idToIndex[f[0]]],c=r(e,t,h,n);if(c.count!==0)if(c.count===1){if(s++,s===2)break}else return c}}return{count:s,graph:a}},Fv,Gv=function(e,t){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*a,s.positionY=Math.random()*n)}},Eo=function(e,t,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(a.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,o){var u=e.layoutNodes[e.idToIndex[s.data("id")]];if(t.boundingBox){var l=(u.positionX-i.x1)/i.w,f=(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}}},zv=function(e,t,a){var n=a.layout,i=a.eles.nodes(),s=Eo(e,a,i);i.positions(s),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},Vv=function(e,t,a){$v(e,t),Hv(e),Xv(e,t),qv(e),Wv(e)},$v=function(e,t){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,s=0;s<i;s++)for(var o=e.layoutNodes[e.idToIndex[n[s]]],u=s+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[n[u]]];Yv(o,l,e,t)}},Ji=function(e){return-e+2*e*Math.random()},Yv=function(e,t,a,n){var i=e.cmptId,s=t.cmptId;if(!(i!==s&&!a.isCompound)){var o=t.positionX-e.positionX,u=t.positionY-e.positionY,l=1;o===0&&u===0&&(o=Ji(l),u=Ji(l));var f=Uv(e,t,o,u);if(f>0)var h=n.nodeOverlap*f,c=Math.sqrt(o*o+u*u),v=h*o/c,d=h*u/c;else var g=Ua(e,o,u),y=Ua(t,-1*o,-1*u),p=y.x-g.x,E=y.y-g.y,m=p*p+E*E,c=Math.sqrt(m),h=(e.nodeRepulsion+t.nodeRepulsion)/m,v=h*p/c,d=h*E/c;e.isLocked||(e.offsetX-=v,e.offsetY-=d),t.isLocked||(t.offsetX+=v,t.offsetY+=d)}},Uv=function(e,t,a,n){if(a>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(n>0)var s=e.maxY-t.minY;else var s=t.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Ua=function(e,t,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,u=a/t,l=s/o,f={};return t===0&&0<a||t===0&&0>a?(f.x=n,f.y=i+s/2,f):0<t&&-1*l<=u&&u<=l?(f.x=n+o/2,f.y=i+o*a/2/t,f):0>t&&-1*l<=u&&u<=l?(f.x=n-o/2,f.y=i-o*a/2/t,f):0<a&&(u<=-1*l||u>=l)?(f.x=n+s*t/2/a,f.y=i+s/2,f):(0>a&&(u<=-1*l||u>=l)&&(f.x=n-s*t/2/a,f.y=i-s/2),f)},Hv=function(e,t){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],s=e.layoutNodes[i],o=e.idToIndex[n.targetId],u=e.layoutNodes[o],l=u.positionX-s.positionX,f=u.positionY-s.positionY;if(!(l===0&&f===0)){var h=Ua(s,l,f),c=Ua(u,-1*l,-1*f),v=c.x-h.x,d=c.y-h.y,g=Math.sqrt(v*v+d*d),y=Math.pow(n.idealLength-g,2)/n.elasticity;if(g!==0)var p=y*v/g,E=y*d/g;else var p=0,E=0;s.isLocked||(s.offsetX+=p,s.offsetY+=E),u.isLocked||(u.offsetX-=p,u.offsetY-=E)}}},Xv=function(e,t){if(t.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],s=i.length;if(n===0)var o=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],o=f.positionX,u=f.positionY;for(var h=0;h<s;h++){var c=e.layoutNodes[e.idToIndex[i[h]]];if(!c.isLocked){var v=o-c.positionX,d=u-c.positionY,g=Math.sqrt(v*v+d*d);if(g>a){var y=t.gravity*v/g,p=t.gravity*d/g;c.offsetX+=y,c.offsetY+=p}}}}},qv=function(e,t){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var s=a[n++],o=e.idToIndex[s],u=e.layoutNodes[o],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,h=u.offsetY,c=0;c<l.length;c++){var v=e.layoutNodes[e.idToIndex[l[c]]];v.offsetX+=f,v.offsetY+=h,a[++i]=l[c]}u.offsetX=0,u.offsetY=0}}},Wv=function(e,t){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=_v(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,Kv(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)}},_v=function(e,t,a){var n=Math.sqrt(e*e+t*t);if(n>a)var i={x:a*e/n,y:a*t/n};else var i={x:e,y:t};return i},Kv=function r(e,t){var a=e.parentId;if(a!=null){var n=t.layoutNodes[t.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 r(n,t)}},ji=function(e,t){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var s=a[i],o=s.cmptId,u=n[o]=n[o]||[];u.push(s)}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 c=f[h];f.x1=Math.min(f.x1,c.positionX-c.width/2),f.x2=Math.max(f.x2,c.positionX+c.width/2),f.y1=Math.min(f.y1,c.positionY-c.height/2),f.y2=Math.max(f.y2,c.positionY+c.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,l+=f.w*f.h}}n.sort(function(E,m){return m.w*m.h-E.w*E.h});for(var v=0,d=0,g=0,y=0,p=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 c=f[h];c.isLocked||(c.positionX+=v-f.x1,c.positionY+=d-f.y1)}v+=f.w+t.componentSpacing,g+=f.w+t.componentSpacing,y=Math.max(y,f.h),g>p&&(d+=y+t.componentSpacing,v=0,g=0,y=0)}}},Zv={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function wo(r){this.options=ce({},Zv,r)}wo.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=lt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(U){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),u=Math.round(o),l=Math.round(i.w/i.h*o),f=function($){if($==null)return Math.min(u,l);var X=Math.min(u,l);X==u?u=$:l=$},h=function($){if($==null)return Math.max(u,l);var X=Math.max(u,l);X==u?u=$:l=$},c=e.rows,v=e.cols!=null?e.cols:e.columns;if(c!=null&&v!=null)u=c,l=v;else if(c!=null&&v==null)u=c,l=Math.ceil(s/u);else if(c==null&&v!=null)l=v,u=Math.ceil(s/l);else if(l*u>s){var d=f(),g=h();(d-1)*g>=s?f(d-1):(g-1)*d>=s&&h(g-1)}else for(;l*u<s;){var y=f(),p=h();(p+1)*y>=s?h(p+1):f(y+1)}var E=i.w/l,m=i.h/u;if(e.condense&&(E=0,m=0),e.avoidOverlap)for(var T=0;T<n.length;T++){var D=n[T],L=D._private.position;(L.x==null||L.y==null)&&(L.x=0,L.y=0);var b=D.layoutDimensions(e),x=e.avoidOverlapPadding,w=b.w+x,C=b.h+x;E=Math.max(E,w),m=Math.max(m,C)}for(var A={},S=function($,X){return!!A["c-"+$+"-"+X]},O=function($,X){A["c-"+$+"-"+X]=!0},N=0,P=0,I=function(){P++,P>=l&&(P=0,N++)},k={},R=0;R<n.length;R++){var B=n[R],z=e.position(B);if(z&&(z.row!==void 0||z.col!==void 0)){var F={row:z.row,col:z.col};if(F.col===void 0)for(F.col=0;S(F.row,F.col);)F.col++;else if(F.row===void 0)for(F.row=0;S(F.row,F.col);)F.row++;k[B.id()]=F,O(F.row,F.col)}}var V=function($,X){var H,G;if($.locked()||$.isParent())return!1;var q=k[$.id()];if(q)H=q.col*E+E/2+i.x1,G=q.row*m+m/2+i.y1;else{for(;S(N,P);)I();H=P*E+E/2+i.x1,G=N*m+m/2+i.y1,O(N,P),I()}return{x:H,y:G}};n.layoutPositions(this,e,V)}return this};var Qv={ready:function(){},stop:function(){}};function jn(r){this.options=ce({},Qv,r)}jn.prototype.run=function(){var r=this.options,e=r.eles,t=this;return r.cy,t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this};jn.prototype.stop=function(){return this};var Jv={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function xo(r){this.options=ce({},Jv,r)}xo.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),a=Fe(r.positions);function n(i){if(r.positions==null)return hf(i.position());if(a)return r.positions(i);var s=r.positions[i._private.data.id];return s==null?null:s}return t.layoutPositions(this,r,function(i,s){var o=n(i);return i.locked()||o==null?!1:o}),this};var jv={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function To(r){this.options=ce({},jv,r)}To.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,a=lt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(s,o){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return t.nodes().layoutPositions(this,r,n),this};var ec=[{name:"breadthfirst",impl:yo},{name:"circle",impl:mo},{name:"concentric",impl:bo},{name:"cose",impl:nn},{name:"grid",impl:wo},{name:"null",impl:jn},{name:"preset",impl:xo},{name:"random",impl:To}];function Do(r){this.options=r,this.notifications=0}var es=function(){},ts=function(){throw new Error("A headless instance can not render images")};Do.prototype={recalculateRenderedStyle:es,notify:function(){this.notifications++},init:es,isHeadless:function(){return!0},png:ts,jpg:ts};var ei={};ei.arrowShapeWidth=.3;ei.registerArrowShapes=function(){var r=this.arrowShapes={},e=this,t=function(l,f,h,c,v,d,g){var y=v.x-h/2-g,p=v.x+h/2+g,E=v.y-h/2-g,m=v.y+h/2+g,T=y<=l&&l<=p&&E<=f&&f<=m;return T},a=function(l,f,h,c,v){var d=l*Math.cos(c)-f*Math.sin(c),g=l*Math.sin(c)+f*Math.cos(c),y=d*h,p=g*h,E=y+v.x,m=p+v.y;return{x:E,y:m}},n=function(l,f,h,c){for(var v=[],d=0;d<l.length;d+=2){var g=l[d],y=l[d+1];v.push(a(g,y,f,h,c))}return v},i=function(l){for(var f=[],h=0;h<l.length;h++){var c=l[h];f.push(c.x,c.y)}return f},s=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},o=function(l,f){le(f)&&(f=r[f]),r[l]=ce({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(c,v,d,g,y,p){var E=i(n(this.points,d+2*p,g,y)),m=ut(c,v,E);return m},roughCollide:t,draw:function(c,v,d,g){var y=n(this.points,v,d,g);e.arrowShapeImpl("polygon")(c,y)},spacing:function(c){return 0},gap:s},f)};o("none",{collide:za,roughCollide:za,draw:Yn,spacing:pi,gap:pi}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(l,f,h,c,v){var d=n(this.points,f,h,c),g=this.controlPoint,y=a(g[0],g[1],f,h,c);e.arrowShapeImpl(this.name)(l,d,y)},gap:function(l){return s(l)*.8}}),o("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,c,v,d,g){var y=i(n(this.points,h+2*g,c,v)),p=i(n(this.pointsTee,h+2*g,c,v)),E=ut(l,f,y)||ut(l,f,p);return E},draw:function(l,f,h,c,v){var d=n(this.points,f,h,c),g=n(this.pointsTee,f,h,c);e.arrowShapeImpl(this.name)(l,d,g)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,f,h,c,v,d,g){var y=v,p=Math.pow(y.x-l,2)+Math.pow(y.y-f,2)<=Math.pow((h+2*g)*this.radius,2),E=i(n(this.points,h+2*g,c,v));return ut(l,f,E)||p},draw:function(l,f,h,c,v){var d=n(this.pointsTr,f,h,c);e.arrowShapeImpl(this.name)(l,d,c.x,c.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),o("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(),c=f/l,v=3,d=5;return h[v]=h[v]-c,h[d]=h[d]-c,h},collide:function(l,f,h,c,v,d,g){var y=i(n(this.points,h+2*g,c,v)),p=i(n(this.crossLinePts(h,d),h+2*g,c,v)),E=ut(l,f,y)||ut(l,f,p);return E},draw:function(l,f,h,c,v){var d=n(this.points,f,h,c),g=n(this.crossLinePts(f,v),f,h,c);e.arrowShapeImpl(this.name)(l,d,g)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return s(l)*.525}}),o("circle",{radius:.15,collide:function(l,f,h,c,v,d,g){var y=v,p=Math.pow(y.x-l,2)+Math.pow(y.y-f,2)<=Math.pow((h+2*g)*this.radius,2);return p},draw:function(l,f,h,c,v){e.arrowShapeImpl(this.name)(l,c.x,c.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),o("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 ur={};ur.projectIntoViewport=function(r,e){var t=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],s=a[4],o=t.pan(),u=t.zoom(),l=((r-n)/s-o.x)/u,f=((e-i)/s-o.y)/u;return[l,f]};ur.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=Be.getComputedStyle(r),a=function(p){return parseFloat(t.getPropertyValue(p))},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")},s=r.clientWidth,o=r.clientHeight,u=n.left+n.right,l=n.top+n.bottom,f=i.left+i.right,h=e.width/(s+f),c=s-u,v=o-l,d=e.left+n.left+i.left,g=e.top+n.top+i.top;return this.containerBB=[d,g,c,v,h]};ur.invalidateContainerClientCoordsCache=function(){this.containerBB=null};ur.findNearestElement=function(r,e,t,a){return this.findNearestElements(r,e,t,a)[0]};ur.findNearestElements=function(r,e,t,a){var n=this,i=this,s=i.getCachedZSortedEles(),o=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),f=(a?24:8)/u,h=(a?8:2)/u,c=(a?8:2)/u,v=1/0,d,g;t&&(s=s.interactive);function y(b,x){if(b.isNode()){if(g)return;g=b,o.push(b)}if(b.isEdge()&&(x==null||x<v))if(d){if(d.pstyle("z-compound-depth").value===b.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===b.pstyle("z-compound-depth").value){for(var w=0;w<o.length;w++)if(o[w].isEdge()){o[w]=b,d=b,v=x!=null?x:v;break}}}else o.push(b),d=b,v=x!=null?x:v}function p(b){var x=b.outerWidth()+2*h,w=b.outerHeight()+2*h,C=x/2,A=w/2,S=b.position();if(S.x-C<=r&&r<=S.x+C&&S.y-A<=e&&e<=S.y+A){var O=i.nodeShapes[n.getNodeShape(b)];if(O.checkPoint(r,e,0,x,w,S.x,S.y))return y(b,0),!0}}function E(b){var x=b._private,w=x.rscratch,C=b.pstyle("width").pfValue,A=b.pstyle("arrow-scale").value,S=C/2+f,O=S*S,N=S*2,R=x.source,B=x.target,P;if(w.edgeType==="segments"||w.edgeType==="straight"||w.edgeType==="haystack"){for(var I=w.allpts,k=0;k+3<I.length;k+=2)if(Df(r,e,I[k],I[k+1],I[k+2],I[k+3],N)&&O>(P=Nf(r,e,I[k],I[k+1],I[k+2],I[k+3])))return y(b,P),!0}else if(w.edgeType==="bezier"||w.edgeType==="multibezier"||w.edgeType==="self"||w.edgeType==="compound"){for(var I=w.allpts,k=0;k+5<w.allpts.length;k+=4)if(Cf(r,e,I[k],I[k+1],I[k+2],I[k+3],I[k+4],I[k+5],N)&&O>(P=Af(r,e,I[k],I[k+1],I[k+2],I[k+3],I[k+4],I[k+5])))return y(b,P),!0}for(var R=R||x.source,B=B||x.target,z=n.getArrowWidth(C,A),F=[{name:"source",x:w.arrowStartX,y:w.arrowStartY,angle:w.srcArrowAngle},{name:"target",x:w.arrowEndX,y:w.arrowEndY,angle:w.tgtArrowAngle},{name:"mid-source",x:w.midX,y:w.midY,angle:w.midsrcArrowAngle},{name:"mid-target",x:w.midX,y:w.midY,angle:w.midtgtArrowAngle}],k=0;k<F.length;k++){var V=F[k],U=i.arrowShapes[b.pstyle(V.name+"-arrow-shape").value],$=b.pstyle("width").pfValue;if(U.roughCollide(r,e,z,V.angle,{x:V.x,y:V.y},$,f)&&U.collide(r,e,z,V.angle,{x:V.x,y:V.y},$,f))return y(b),!0}l&&o.length>0&&(p(R),p(B))}function m(b,x,w){return wt(b,x,w)}function T(b,x){var w=b._private,C=c,A;x?A=x+"-":A="",b.boundingBox();var S=w.labelBounds[x||"main"],O=b.pstyle(A+"label").value,N=b.pstyle("text-events").strValue==="yes";if(!(!N||!O)){var P=m(w.rscratch,"labelX",x),I=m(w.rscratch,"labelY",x),k=m(w.rscratch,"labelAngle",x),R=b.pstyle(A+"text-margin-x").pfValue,B=b.pstyle(A+"text-margin-y").pfValue,z=S.x1-C-R,F=S.x2+C-R,V=S.y1-C-B,U=S.y2+C-B;if(k){var $=Math.cos(k),X=Math.sin(k),H=function(de,ee){return de=de-P,ee=ee-I,{x:de*$-ee*X+P,y:de*X+ee*$+I}},G=H(z,V),q=H(z,U),K=H(F,V),Z=H(F,U),te=[G.x+R,G.y+B,K.x+R,K.y+B,Z.x+R,Z.y+B,q.x+R,q.y+B];if(ut(r,e,te))return y(b),!0}else if(Cr(S,r,e))return y(b),!0}}for(var D=s.length-1;D>=0;D--){var L=s[D];L.isNode()?p(L)||T(L):E(L)||T(L)||T(L,"source")||T(L,"target")}return o};ur.getAllInBox=function(r,e,t,a){var n=this.getCachedZSortedEles().interactive,i=[],s=Math.min(r,t),o=Math.max(r,t),u=Math.min(e,a),l=Math.max(e,a);r=s,t=o,e=u,a=l;for(var f=lt({x1:r,y1:e,x2:t,y2:a}),h=0;h<n.length;h++){var c=n[h];if(c.isNode()){var v=c,d=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Xn(f,d)&&!Fs(d,f)&&i.push(v)}else{var g=c,y=g._private,p=y.rscratch;if(p.startX!=null&&p.startY!=null&&!Cr(f,p.startX,p.startY)||p.endX!=null&&p.endY!=null&&!Cr(f,p.endX,p.endY))continue;if(p.edgeType==="bezier"||p.edgeType==="multibezier"||p.edgeType==="self"||p.edgeType==="compound"||p.edgeType==="segments"||p.edgeType==="haystack"){for(var E=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,m=!0,T=0;T<E.length;T++)if(!Tf(f,E[T])){m=!1;break}m&&i.push(g)}else(p.edgeType==="haystack"||p.edgeType==="straight")&&i.push(g)}}return i};var Ha={};Ha.calculateArrowAngles=function(r){var e=r._private.rscratch,t=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",u,l,f,h,c,v,p,E;if(t?(f=e.haystackPts[0],h=e.haystackPts[1],c=e.haystackPts[2],v=e.haystackPts[3]):(f=e.arrowStartX,h=e.arrowStartY,c=e.arrowEndX,v=e.arrowEndY),p=e.midX,E=e.midY,i)u=f-e.segpts[0],l=h-e.segpts[1];else if(n||s||o||a){var d=e.allpts,g=He(d[0],d[2],d[4],.1),y=He(d[1],d[3],d[5],.1);u=f-g,l=h-y}else u=f-p,l=h-E;e.srcArrowAngle=Ea(u,l);var p=e.midX,E=e.midY;if(t&&(p=(f+c)/2,E=(h+v)/2),u=c-f,l=v-h,i){var d=e.allpts;if(d.length/2%2===0){var m=d.length/2,T=m-2;u=d[m]-d[T],l=d[m+1]-d[T+1]}else{var m=d.length/2-1,T=m-2,D=m+2;u=d[m]-d[T],l=d[m+1]-d[T+1]}}else if(n||s||o){var d=e.allpts,L=e.ctrlpts,b,x,w,C;if(L.length/2%2===0){var A=d.length/2-1,S=A+2,O=S+2;b=He(d[A],d[S],d[O],0),x=He(d[A+1],d[S+1],d[O+1],0),w=He(d[A],d[S],d[O],1e-4),C=He(d[A+1],d[S+1],d[O+1],1e-4)}else{var S=d.length/2-1,A=S-2,O=S+2;b=He(d[A],d[S],d[O],.4999),x=He(d[A+1],d[S+1],d[O+1],.4999),w=He(d[A],d[S],d[O],.5),C=He(d[A+1],d[S+1],d[O+1],.5)}u=w-b,l=C-x}if(e.midtgtArrowAngle=Ea(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var d=e.allpts;if(d.length/2%2!==0){var m=d.length/2-1,D=m+2;u=-(d[D]-d[m]),l=-(d[D+1]-d[m+1])}}if(e.midsrcArrowAngle=Ea(u,l),i)u=c-e.segpts[e.segpts.length-2],l=v-e.segpts[e.segpts.length-1];else if(n||s||o||a){var d=e.allpts,N=d.length,g=He(d[N-6],d[N-4],d[N-2],.9),y=He(d[N-5],d[N-3],d[N-1],.9);u=c-g,l=v-y}else u=c-p,l=v-E;e.tgtArrowAngle=Ea(u,l)};Ha.getArrowWidth=Ha.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},a=t[r+", "+e];return a||(a=Math.max(Math.pow(r*13.37,.9),29)*e,t[r+", "+e]=a,a)};var it={};it.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],a=t._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 s=a.source,o=a.target,u=s.position(),l=o.position(),f=s.width(),h=o.width(),c=s.height(),v=o.height(),d=t.pstyle("haystack-radius").value,g=d/2;n.haystackPts=n.allpts=[n.source.x*f*g+u.x,n.source.y*c*g+u.y,n.target.x*h*g+l.x,n.target.y*v*g+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(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}};it.findSegmentsPoints=function(r,e){var t=r._private.rscratch,a=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,s=r.pstyle("edge-distances").value,o=r.pstyle("segment-weights"),u=r.pstyle("segment-distances"),l=Math.min(o.pfValue.length,u.pfValue.length);t.edgeType="segments",t.segpts=[];for(var f=0;f<l;f++){var h=o.pfValue[f],c=u.pfValue[f],v=1-h,d=h,g=s==="node-position"?a:n,y={x:g.x1*v+g.x2*d,y:g.y1*v+g.y2*d};t.segpts.push(y.x+i.x*c,y.y+i.y*c)}};it.findLoopPoints=function(r,e,t,a){var n=r._private.rscratch,i=e.dirCounts,s=e.srcPos,o=r.pstyle("control-point-distances"),u=o?o.pfValue[0]:void 0,l=r.pstyle("loop-direction").pfValue,f=r.pstyle("loop-sweep").pfValue,h=r.pstyle("control-point-step-size").pfValue;n.edgeType="self";var c=t,v=h;a&&(c=0,v=u);var d=l-Math.PI/2,g=d-f/2,y=d+f/2,p=String(l+"_"+f);c=i[p]===void 0?i[p]=0:++i[p],n.ctrlpts=[s.x+Math.cos(g)*1.4*v*(c/3+1),s.y+Math.sin(g)*1.4*v*(c/3+1),s.x+Math.cos(y)*1.4*v*(c/3+1),s.y+Math.sin(y)*1.4*v*(c/3+1)]};it.findCompoundLoopPoints=function(r,e,t,a){var n=r._private.rscratch;n.edgeType="compound";var i=e.srcPos,s=e.tgtPos,o=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,h=r.pstyle("control-point-step-size").pfValue,c=r.pstyle("control-point-distances"),v=c?c.pfValue[0]:void 0,d=t,g=h;a&&(d=0,g=v);var y=50,p={x:i.x-o/2,y:i.y-u/2},E={x:s.x-l/2,y:s.y-f/2},m={x:Math.min(p.x,E.x),y:Math.min(p.y,E.y)},T=.5,D=Math.max(T,Math.log(o*.01)),L=Math.max(T,Math.log(l*.01));n.ctrlpts=[m.x,m.y-(1+Math.pow(y,1.12)/100)*g*(d/3+1)*D,m.x-(1+Math.pow(y,1.12)/100)*g*(d/3+1)*L,m.y]};it.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"};it.findBezierPoints=function(r,e,t,a,n){var i=r._private.rscratch,s=e.vectorNormInverse,o=e.posPts,u=e.intersectionPts,l=r.pstyle("edge-distances").value,f=r.pstyle("control-point-step-size").pfValue,h=r.pstyle("control-point-distances"),c=r.pstyle("control-point-weights"),v=h&&c?Math.min(h.value.length,c.value.length):1,d=h?h.pfValue[0]:void 0,g=c.value[0],y=a;i.edgeType=y?"multibezier":"bezier",i.ctrlpts=[];for(var p=0;p<v;p++){var E=(.5-e.eles.length/2+t)*f*(n?-1:1),m=void 0,T=Bs(E);y&&(d=h?h.pfValue[p]:f,g=c.value[p]),a?m=d:m=d!==void 0?T*d:void 0;var D=m!==void 0?m:E,L=1-g,b=g,x=l==="node-position"?o:u,w={x:x.x1*L+x.x2*b,y:x.y1*L+x.y2*b};i.ctrlpts.push(w.x+s.x*D,w.y+s.y*D)}};it.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var a="vertical",n="horizontal",i="leftward",s="rightward",o="downward",u="upward",l="auto",f=e.posPts,h=e.srcW,c=e.srcH,v=e.tgtW,d=e.tgtH,g=r.pstyle("edge-distances").value,y=g!=="node-position",p=r.pstyle("taxi-direction").value,E=p,m=r.pstyle("taxi-turn"),T=m.units==="%",D=m.pfValue,L=D<0,b=r.pstyle("taxi-turn-min-distance").pfValue,x=y?(h+v)/2:0,w=y?(c+d)/2:0,C=f.x2-f.x1,A=f.y2-f.y1,S=function(oe,we){return oe>0?Math.max(oe-we,0):Math.min(oe+we,0)},O=S(C,x),N=S(A,w),P=!1;E===l?p=Math.abs(O)>Math.abs(N)?n:a:E===u||E===o?(p=a,P=!0):(E===i||E===s)&&(p=n,P=!0);var I=p===a,k=I?N:O,R=I?A:C,B=Bs(R),z=!1;!(P&&(T||L))&&(E===o&&R<0||E===u&&R>0||E===i&&R>0||E===s&&R<0)&&(B*=-1,k=B*Math.abs(k),z=!0);var F;if(T){var V=D<0?1+D:D;F=V*k}else{var U=D<0?k:0;F=U+D*B}var $=function(oe){return Math.abs(oe)<b||Math.abs(oe)>=Math.abs(k)},X=$(F),H=$(Math.abs(k)-Math.abs(F)),G=X||H;if(G&&!z)if(I){var q=Math.abs(R)<=c/2,K=Math.abs(C)<=v/2;if(q){var Z=(f.x1+f.x2)/2,te=f.y1,he=f.y2;t.segpts=[Z,te,Z,he]}else if(K){var de=(f.y1+f.y2)/2,ee=f.x1,re=f.x2;t.segpts=[ee,de,re,de]}else t.segpts=[f.x1,f.y2]}else{var fe=Math.abs(R)<=h/2,se=Math.abs(A)<=d/2;if(fe){var ne=(f.y1+f.y2)/2,ue=f.x1,Ee=f.x2;t.segpts=[ue,ne,Ee,ne]}else if(se){var ge=(f.x1+f.x2)/2,ve=f.y1,J=f.y2;t.segpts=[ge,ve,ge,J]}else t.segpts=[f.x2,f.y1]}else if(I){var M=f.y1+F+(y?c/2*B:0),Y=f.x1,Q=f.x2;t.segpts=[Y,M,Q,M]}else{var W=f.x1+F+(y?h/2*B:0),_=f.y1,pe=f.y2;t.segpts=[W,_,W,pe]}};it.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,h=!ae(t.startX)||!ae(t.startY),c=!ae(t.arrowStartX)||!ae(t.arrowStartY),v=!ae(t.endX)||!ae(t.endY),d=!ae(t.arrowEndX)||!ae(t.arrowEndY),g=3,y=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,p=g*y,E=rr({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),m=E<p,T=rr({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),D=T<p,L=!1;if(h||c||m){L=!0;var b={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},x=Math.sqrt(b.x*b.x+b.y*b.y),w={x:b.x/x,y:b.y/x},C=Math.max(i,s),A={x:t.ctrlpts[0]+w.x*2*C,y:t.ctrlpts[1]+w.y*2*C},S=l.intersectLine(a.x,a.y,i,s,A.x,A.y,0);m?(t.ctrlpts[0]=t.ctrlpts[0]+w.x*(p-E),t.ctrlpts[1]=t.ctrlpts[1]+w.y*(p-E)):(t.ctrlpts[0]=S[0]+w.x*p,t.ctrlpts[1]=S[1]+w.y*p)}if(v||d||D){L=!0;var O={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},N=Math.sqrt(O.x*O.x+O.y*O.y),P={x:O.x/N,y:O.y/N},I=Math.max(i,s),k={x:t.ctrlpts[0]+P.x*2*I,y:t.ctrlpts[1]+P.y*2*I},R=f.intersectLine(n.x,n.y,o,u,k.x,k.y,0);D?(t.ctrlpts[0]=t.ctrlpts[0]+P.x*(p-T),t.ctrlpts[1]=t.ctrlpts[1]+P.y*(p-T)):(t.ctrlpts[0]=R[0]+P.x*p,t.ctrlpts[1]=R[1]+P.y*p)}L&&this.findEndpoints(r)}};it.storeAllpts=function(r){var e=r._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 t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+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=He(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=He(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.segpts.length%4===0){var i=e.segpts.length/2,s=i-2;e.midX=(e.segpts[s]+e.segpts[i])/2,e.midY=(e.segpts[s+1]+e.segpts[i+1])/2}else{var o=e.segpts.length/2-1;e.midX=e.segpts[o],e.midY=e.segpts[o+1]}};it.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||ae(e.startX)&&ae(e.startY)&&ae(e.endX)&&ae(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ae("Edge `"+r.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."))};it.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,a=t.cy,n=a.hasCompoundNodes(),i={map:new Ct,get:function(b){var x=this.map.get(b[0]);return x!=null?x.get(b[1]):null},set:function(b,x){var w=this.map.get(b[0]);w==null&&(w=new Ct,this.map.set(b[0],w)),w.set(b[1],x)}},s=[],o=[],u=0;u<r.length;u++){var l=r[u],f=l._private,h=l.pstyle("curve-style").value;if(!(l.removed()||!l.takesUpSpace())){if(h==="haystack"){o.push(l);continue}var c=h==="unbundled-bezier"||h==="segments"||h==="straight"||h==="straight-triangle"||h==="taxi",v=h==="unbundled-bezier"||h==="bezier",d=f.source,g=f.target,y=d.poolIndex(),p=g.poolIndex(),E=[y,p].sort(),m=i.get(E);m==null&&(m={eles:[]},i.set(E,m),s.push(E)),m.eles.push(l),c&&(m.hasUnbundled=!0),v&&(m.hasBezier=!0)}}for(var T=function(b){var x=s[b],w=i.get(x),C=void 0;if(!w.hasUnbundled){var A=w.eles[0].parallelEdges().filter(function(J){return J.isBundledBezier()});Un(w.eles),A.forEach(function(J){return w.eles.push(J)}),w.eles.sort(function(J,M){return J.poolIndex()-M.poolIndex()})}var S=w.eles[0],O=S.source(),N=S.target();if(O.poolIndex()>N.poolIndex()){var P=O;O=N,N=P}var I=w.srcPos=O.position(),k=w.tgtPos=N.position(),R=w.srcW=O.outerWidth(),B=w.srcH=O.outerHeight(),z=w.tgtW=N.outerWidth(),F=w.tgtH=N.outerHeight(),V=w.srcShape=t.nodeShapes[e.getNodeShape(O)],U=w.tgtShape=t.nodeShapes[e.getNodeShape(N)];w.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var $=0;$<w.eles.length;$++){var X=w.eles[$],H=X[0]._private.rscratch,G=X.pstyle("curve-style").value,q=G==="unbundled-bezier"||G==="segments"||G==="taxi",K=!O.same(X.source());if(!w.calculatedIntersection&&O!==N&&(w.hasBezier||w.hasUnbundled)){w.calculatedIntersection=!0;var Z=V.intersectLine(I.x,I.y,R,B,k.x,k.y,0),te=w.srcIntn=Z,he=U.intersectLine(k.x,k.y,z,F,I.x,I.y,0),de=w.tgtIntn=he,ee=w.intersectionPts={x1:Z[0],x2:he[0],y1:Z[1],y2:he[1]},re=w.posPts={x1:I.x,x2:k.x,y1:I.y,y2:k.y},fe=he[1]-Z[1],se=he[0]-Z[0],ne=Math.sqrt(se*se+fe*fe),ue=w.vector={x:se,y:fe},Ee=w.vectorNorm={x:ue.x/ne,y:ue.y/ne},ge={x:-Ee.y,y:Ee.x};w.nodesOverlap=!ae(ne)||U.checkPoint(Z[0],Z[1],0,z,F,k.x,k.y)||V.checkPoint(he[0],he[1],0,R,B,I.x,I.y),w.vectorNormInverse=ge,C={nodesOverlap:w.nodesOverlap,dirCounts:w.dirCounts,calculatedIntersection:!0,hasBezier:w.hasBezier,hasUnbundled:w.hasUnbundled,eles:w.eles,srcPos:k,tgtPos:I,srcW:z,srcH:F,tgtW:R,tgtH:B,srcIntn:de,tgtIntn:te,srcShape:U,tgtShape:V,posPts:{x1:re.x2,y1:re.y2,x2:re.x1,y2:re.y1},intersectionPts:{x1:ee.x2,y1:ee.y2,x2:ee.x1,y2:ee.y1},vector:{x:-ue.x,y:-ue.y},vectorNorm:{x:-Ee.x,y:-Ee.y},vectorNormInverse:{x:-ge.x,y:-ge.y}}}var ve=K?C:w;H.nodesOverlap=ve.nodesOverlap,H.srcIntn=ve.srcIntn,H.tgtIntn=ve.tgtIntn,n&&(O.isParent()||O.isChild()||N.isParent()||N.isChild())&&(O.parents().anySame(N)||N.parents().anySame(O)||O.same(N)&&O.isParent())?e.findCompoundLoopPoints(X,ve,$,q):O===N?e.findLoopPoints(X,ve,$,q):G==="segments"?e.findSegmentsPoints(X,ve):G==="taxi"?e.findTaxiPoints(X,ve):G==="straight"||!q&&w.eles.length%2===1&&$===Math.floor(w.eles.length/2)?e.findStraightEdgePoints(X):e.findBezierPoints(X,ve,$,q,K),e.findEndpoints(X),e.tryToCorrectInvalidPoints(X,ve),e.checkForInvalidEdgeWarning(X),e.storeAllpts(X),e.storeEdgeProjections(X),e.calculateArrowAngles(X),e.recalculateEdgeLabelProjections(X),e.calculateLabelAngles(X)}},D=0;D<s.length;D++)T(D);this.findHaystackPoints(o)}};function Co(r){var e=[];if(r!=null){for(var t=0;t<r.length;t+=2){var a=r[t],n=r[t+1];e.push({x:a,y:n})}return e}}it.getSegmentPoints=function(r){var e=r[0]._private.rscratch,t=e.edgeType;if(t==="segments")return this.recalculateRenderedStyle(r),Co(e.segpts)};it.getControlPoints=function(r){var e=r[0]._private.rscratch,t=e.edgeType;if(t==="bezier"||t==="multibezier"||t==="self"||t==="compound")return this.recalculateRenderedStyle(r),Co(e.ctrlpts)};it.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var ca={};ca.manualEndptToPx=function(r,e){var t=this,a=r.position(),n=r.outerWidth(),i=r.outerHeight();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 o=e.pfValue[0];o=-Math.PI/2+o;var u=2*Math.max(n,i),l=[a.x+Math.cos(o)*u,a.y+Math.sin(o)*u];return t.nodeShapes[this.getNodeShape(r)].intersectLine(a.x,a.y,n,i,l[0],l[1],0)}};ca.findEndpoints=function(r){var e=this,t,a=r.source()[0],n=r.target()[0],i=a.position(),s=n.position(),o=r.pstyle("target-arrow-shape").value,u=r.pstyle("source-arrow-shape").value,l=r.pstyle("target-distance-from-node").pfValue,f=r.pstyle("source-distance-from-node").pfValue,h=r.pstyle("curve-style").value,c=r._private.rscratch,v=c.edgeType,d=h==="taxi",g=v==="self"||v==="compound",y=v==="bezier"||v==="multibezier"||g,p=v!=="bezier",E=v==="straight"||v==="segments",m=v==="segments",T=y||p||E,D=g||d,L=r.pstyle("source-endpoint"),b=D?"outside-to-node":L.value,x=r.pstyle("target-endpoint"),w=D?"outside-to-node":x.value;c.srcManEndpt=L,c.tgtManEndpt=x;var C,A,S,O;if(y){var N=[c.ctrlpts[0],c.ctrlpts[1]],P=p?[c.ctrlpts[c.ctrlpts.length-2],c.ctrlpts[c.ctrlpts.length-1]]:N;C=P,A=N}else if(E){var I=m?c.segpts.slice(0,2):[s.x,s.y],k=m?c.segpts.slice(c.segpts.length-2):[i.x,i.y];C=k,A=I}if(w==="inside-to-node")t=[s.x,s.y];else if(x.units)t=this.manualEndptToPx(n,x);else if(w==="outside-to-line")t=c.tgtIntn;else if(w==="outside-to-node"||w==="outside-to-node-or-label"?S=C:(w==="outside-to-line"||w==="outside-to-line-or-label")&&(S=[i.x,i.y]),t=e.nodeShapes[this.getNodeShape(n)].intersectLine(s.x,s.y,n.outerWidth(),n.outerHeight(),S[0],S[1],0),w==="outside-to-node-or-label"||w==="outside-to-line-or-label"){var R=n._private.rscratch,B=R.labelWidth,z=R.labelHeight,F=R.labelX,V=R.labelY,U=B/2,$=z/2,X=n.pstyle("text-valign").value;X==="top"?V-=$:X==="bottom"&&(V+=$);var H=n.pstyle("text-halign").value;H==="left"?F-=U:H==="right"&&(F+=U);var G=ea(S[0],S[1],[F-U,V-$,F+U,V-$,F+U,V+$,F-U,V+$],s.x,s.y);if(G.length>0){var q=i,K=Jt(q,br(t)),Z=Jt(q,br(G)),te=K;if(Z<K&&(t=G,te=Z),G.length>2){var he=Jt(q,{x:G[2],y:G[3]});he<te&&(t=[G[2],G[3]])}}}var de=wa(t,C,e.arrowShapes[o].spacing(r)+l),ee=wa(t,C,e.arrowShapes[o].gap(r)+l);if(c.endX=ee[0],c.endY=ee[1],c.arrowEndX=de[0],c.arrowEndY=de[1],b==="inside-to-node")t=[i.x,i.y];else if(L.units)t=this.manualEndptToPx(a,L);else if(b==="outside-to-line")t=c.srcIntn;else if(b==="outside-to-node"||b==="outside-to-node-or-label"?O=A:(b==="outside-to-line"||b==="outside-to-line-or-label")&&(O=[s.x,s.y]),t=e.nodeShapes[this.getNodeShape(a)].intersectLine(i.x,i.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0),b==="outside-to-node-or-label"||b==="outside-to-line-or-label"){var re=a._private.rscratch,fe=re.labelWidth,se=re.labelHeight,ne=re.labelX,ue=re.labelY,Ee=fe/2,ge=se/2,ve=a.pstyle("text-valign").value;ve==="top"?ue-=ge:ve==="bottom"&&(ue+=ge);var J=a.pstyle("text-halign").value;J==="left"?ne-=Ee:J==="right"&&(ne+=Ee);var M=ea(O[0],O[1],[ne-Ee,ue-ge,ne+Ee,ue-ge,ne+Ee,ue+ge,ne-Ee,ue+ge],i.x,i.y);if(M.length>0){var Y=s,Q=Jt(Y,br(t)),W=Jt(Y,br(M)),_=Q;if(W<Q&&(t=[M[0],M[1]],_=W),M.length>2){var pe=Jt(Y,{x:M[2],y:M[3]});pe<_&&(t=[M[2],M[3]])}}}var j=wa(t,A,e.arrowShapes[u].spacing(r)+f),oe=wa(t,A,e.arrowShapes[u].gap(r)+f);c.startX=oe[0],c.startY=oe[1],c.arrowStartX=j[0],c.arrowStartY=j[1],T&&(!ae(c.startX)||!ae(c.startY)||!ae(c.endX)||!ae(c.endY)?c.badLine=!0:c.badLine=!1)};ca.getSourceEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};ca.getTargetEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var ti={};function tc(r,e,t){for(var a=function(l,f,h,c){return He(l,f,h,c)},n=e._private,i=n.rstyle.bezierPts,s=0;s<r.bezierProjPcts.length;s++){var o=r.bezierProjPcts[s];i.push({x:a(t[0],t[2],t[4],o),y:a(t[1],t[3],t[5],o)})}}ti.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,a=t.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<t.allpts.length;n+=4)tc(this,r,t.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],n=0;n+1<t.allpts.length;n+=2)i.push({x:t.allpts[n],y:t.allpts[n+1]});else if(a==="haystack"){var s=t.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth};ti.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var St={};St.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!Ut(e)){var t,a,n=r._private,i=r.width(),s=r.height(),o=r.padding(),u=r.position(),l=r.pstyle("text-halign").strValue,f=r.pstyle("text-valign").strValue,h=n.rscratch,c=n.rstyle;switch(l){case"left":t=u.x-i/2-o;break;case"right":t=u.x+i/2+o;break;default:t=u.x}switch(f){case"top":a=u.y-s/2-o;break;case"bottom":a=u.y+s/2+o;break;default:a=u.y}h.labelX=t,h.labelY=a,c.labelX=t,c.labelY=a,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}};var Lo=function(e,t){var a=Math.atan(t/e);return e===0&&a<0&&(a=a*-1),a},So=function(e,t){var a=t.x-e.x,n=t.y-e.y;return Lo(a,n)},rc=function(e,t,a,n){var i=jr(0,n-.001,1),s=jr(0,n+.001,1),o=wr(e,t,a,i),u=wr(e,t,a,s);return So(o,u)};St.recalculateEdgeLabelProjections=function(r){var e,t=r._private,a=t.rscratch,n=this,i={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(!!(i.mid||i.source||i.target)){e={x:a.midX,y:a.midY};var s=function(h,c,v){zt(t.rscratch,h,c,v),zt(t.rstyle,h,c,v)};s("labelX",null,e.x),s("labelY",null,e.y);var o=Lo(a.midDispX,a.midDispY);s("labelAutoAngle",null,o);var u=function f(){if(f.cache)return f.cache;for(var h=[],c=0;c+5<a.allpts.length;c+=4){var v={x:a.allpts[c],y:a.allpts[c+1]},d={x:a.allpts[c+2],y:a.allpts[c+3]},g={x:a.allpts[c+4],y:a.allpts[c+5]};h.push({p0:v,p1:d,p2:g,startDist:0,length:0,segments:[]})}var y=t.rstyle.bezierPts,p=n.bezierProjPcts.length;function E(b,x,w,C,A){var S=rr(x,w),O=b.segments[b.segments.length-1],N={p0:x,p1:w,t0:C,t1:A,startDist:O?O.startDist+O.length:0,length:S};b.segments.push(N),b.length+=S}for(var m=0;m<h.length;m++){var T=h[m],D=h[m-1];D&&(T.startDist=D.startDist+D.length),E(T,T.p0,y[m*p],0,n.bezierProjPcts[0]);for(var L=0;L<p-1;L++)E(T,y[m*p+L],y[m*p+L+1],n.bezierProjPcts[L],n.bezierProjPcts[L+1]);E(T,y[m*p+p-1],T.p2,n.bezierProjPcts[p-1],1)}return f.cache=h},l=function(h){var c,v=h==="source";if(!!i[h]){var d=r.pstyle(h+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=u(),y,p=0,E=0,m=0;m<g.length;m++){for(var T=g[v?m:g.length-1-m],D=0;D<T.segments.length;D++){var L=T.segments[v?D:T.segments.length-1-D],b=m===g.length-1&&D===T.segments.length-1;if(p=E,E+=L.length,E>=d||b){y={cp:T,segment:L};break}}if(y)break}var x=y.cp,w=y.segment,C=(d-p)/w.length,A=w.t1-w.t0,S=v?w.t0+A*C:w.t1-A*C;S=jr(0,S,1),e=wr(x.p0,x.p1,x.p2,S),c=rc(x.p0,x.p1,x.p2,S);break}case"straight":case"segments":case"haystack":{for(var O=0,N,P,I,k,R=a.allpts.length,B=0;B+3<R&&(v?(I={x:a.allpts[B],y:a.allpts[B+1]},k={x:a.allpts[B+2],y:a.allpts[B+3]}):(I={x:a.allpts[R-2-B],y:a.allpts[R-1-B]},k={x:a.allpts[R-4-B],y:a.allpts[R-3-B]}),N=rr(I,k),P=O,O+=N,!(O>=d));B+=2);var z=d-P,F=z/N;F=jr(0,F,1),e=mf(I,k,F),c=So(I,k);break}}s("labelX",h,e.x),s("labelY",h,e.y),s("labelAutoAngle",h,c)}};l("source"),l("target"),this.applyLabelDimensions(r)}};St.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};St.applyPrefixedLabelDimensions=function(r,e){var t=r._private,a=this.getLabelText(r,e),n=this.calculateLabelDimensions(r,a),i=r.pstyle("line-height").pfValue,s=r.pstyle("text-wrap").strValue,o=wt(t.rscratch,"labelWrapCachedLines",e)||[],u=s!=="wrap"?1:Math.max(o.length,1),l=n.height/u,f=l*i,h=n.width,c=n.height+(u-1)*(i-1)*l;zt(t.rstyle,"labelWidth",e,h),zt(t.rscratch,"labelWidth",e,h),zt(t.rstyle,"labelHeight",e,c),zt(t.rscratch,"labelHeight",e,c),zt(t.rscratch,"labelLineHeight",e,f)};St.getLabelText=function(r,e){var t=r._private,a=e?e+"-":"",n=r.pstyle(a+"label").strValue,i=r.pstyle("text-transform").value,s=function(z,F){return F?(zt(t.rscratch,z,e,F),F):wt(t.rscratch,z,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=r.pstyle("text-wrap").value;if(o==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var l="\u200B",f=n.split(`
`),h=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,v=c==="anywhere",d=[],g=/[\s\u200b]+/,y=v?"":" ",p=0;p<f.length;p++){var E=f[p],m=this.calculateLabelDimensions(r,E),T=m.width;if(v){var D=E.split("").join(l);E=D}if(T>h){for(var L=E.split(g),b="",x=0;x<L.length;x++){var w=L[x],C=b.length===0?w:b+y+w,A=this.calculateLabelDimensions(r,C),S=A.width;S<=h?b+=w+y:(b&&d.push(b),b=w+y)}b.match(/^[\s\u200b]+$/)||d.push(b)}else d.push(E)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(`
`)),s("labelWrapKey",u)}else if(o==="ellipsis"){var O=r.pstyle("text-max-width").pfValue,N="",P="\u2026",I=!1;if(this.calculateLabelDimensions(r,n).width<O)return n;for(var k=0;k<n.length;k++){var R=this.calculateLabelDimensions(r,N+n[k]+P).width;if(R>O)break;N+=n[k],k===n.length-1&&(I=!0)}return I||(N+=P),N}return n};St.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};St.calculateLabelDimensions=function(r,e){var t=this,a=tr(e,r._private.labelDimsKey),n=t.labelDimCache||(t.labelDimCache=[]),i=n[a];if(i!=null)return i;var s=0,o=r.pstyle("font-style").strValue,u=r.pstyle("font-size").pfValue,l=r.pstyle("font-family").strValue,f=r.pstyle("font-weight").strValue,h=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=h.getContext("2d");var v=h.style;v.position="absolute",v.left="-9999px",v.top="-9999px",v.zIndex="-1",v.visibility="hidden",v.pointerEvents="none"}c.font="".concat(o," ").concat(f," ").concat(u,"px ").concat(l);for(var d=0,g=0,y=e.split(`
`),p=0;p<y.length;p++){var E=y[p],m=c.measureText(E),T=Math.ceil(m.width),D=u;d=Math.max(T,d),g+=D}return d+=s,g+=s,n[a]={width:d,height:g}};St.calculateLabelAngle=function(r,e){var t=r._private,a=t.rscratch,n=r.isEdge(),i=e?e+"-":"",s=r.pstyle(i+"text-rotation"),o=s.strValue;return o==="none"?0:n&&o==="autorotate"?a.labelAutoAngle:o==="autorotate"?0:s.pfValue};St.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),a=r._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(r),t&&(n.sourceLabelAngle=e.calculateLabelAngle(r,"source"),n.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var Ao={},rs=28,as=!1;Ao.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<rs||r.height()<rs))return as||(Ae("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),as=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var a=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return t};var sn={};sn.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,a=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var u=0;u<s.length;u++){var l=s[u],f=l._private,h=f.rstyle;h.clean=!1,h.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(s){var o=s.target;a(o)}).on("style.* background.*",function(s){var o=s.target;a(o,!1)});var n=function(s){if(s){var o=t.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(o)for(var h=0;h<o.length;h++){var c=o[h];c(s,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){n(!0)},t.beforeRender(n,t.beforeRenderPriorities.eleCalcs)};sn.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};sn.recalculateRenderedStyle=function(r,e){var t=function(T){return T._private.rstyle.cleanConnected},a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var s=r[i],o=s._private,u=o.rstyle;s.isEdge()&&(!t(s.source())||!t(s.target()))&&(u.clean=!1),!(e&&u.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?n.push(s):a.push(s),u.clean=!0)}for(var l=0;l<n.length;l++){var f=n[l],h=f._private,c=h.rstyle,v=f.position();this.recalculateNodeLabelProjection(f),c.nodeX=v.x,c.nodeY=v.y,c.nodeW=f.pstyle("width").pfValue,c.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var g=a[d],y=g._private,p=y.rstyle,E=y.rscratch;p.srcX=E.arrowStartX,p.srcY=E.arrowStartY,p.tgtX=E.arrowEndX,p.tgtY=E.arrowEndY,p.midX=E.midX,p.midY=E.midY,p.labelAngle=E.labelAngle,p.sourceLabelAngle=E.sourceLabelAngle,p.targetLabelAngle=E.targetLabelAngle}}};var on={};on.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(!!r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var a=r[t],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?r.drag.push(a):r.nondrag.push(a)}for(var t=0;t<e.length;t++){var a=e[t];r.drag.push(a)}}};on.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};on.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(co),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var No={};[ur,Ha,it,ca,ti,St,Ao,sn,on].forEach(function(r){ce(No,r)});var Mo={};Mo.getCachedImage=function(r,e,t){var a=this,n=a.imageCache=a.imageCache||{},i=n[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=n[r]=n[r]||{};var s=i.image=new Image;s.addEventListener("load",t),s.addEventListener("error",function(){s.error=!0});var o="data:",u=r.substring(0,o.length).toLowerCase()===o;return u||(s.crossOrigin=e),s.src=r,s};var Ir={};Ir.registerBinding=function(r,e,t,a){var n=Array.prototype.slice.apply(arguments,[1]),i=this.binder(r);return i.on.apply(i,n)};Ir.binder=function(r){var e=this,t=r===window||r===document||r===document.body||xl(r);if(e.supportsPassiveEvents==null){var a=!1;try{var n=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});window.addEventListener("test",null,n)}catch{}e.supportsPassiveEvents=a}var i=function(o,u,l){var f=Array.prototype.slice.call(arguments);return t&&e.supportsPassiveEvents&&(f[2]={capture:l!=null?l:!1,passive:!1,once:!1}),e.bindings.push({target:r,args:f}),(r.addEventListener||r.on).apply(r,f),this};return{on:i,addEventListener:i,addListener:i,bind:i}};Ir.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()};Ir.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()};Ir.load=function(){var r=this,e=function(M){return M.selected()},t=function(M,Y,Q,W){M==null&&(M=r.cy);for(var _=0;_<Y.length;_++){var pe=Y[_];M.emit({originalEvent:Q,type:pe,position:W})}},a=function(M){return M.shiftKey||M.metaKey||M.ctrlKey},n=function(M,Y){var Q=!0;if(r.cy.hasCompoundNodes()&&M&&M.pannable())for(var W=0;Y&&W<Y.length;W++){var M=Y[W];if(M.isNode()&&M.isParent()&&!M.pannable()){Q=!1;break}}else Q=!0;return Q},i=function(M){M[0]._private.grabbed=!0},s=function(M){M[0]._private.grabbed=!1},o=function(M){M[0]._private.rscratch.inDragLayer=!0},u=function(M){M[0]._private.rscratch.inDragLayer=!1},l=function(M){M[0]._private.rscratch.isGrabTarget=!0},f=function(M){M[0]._private.rscratch.isGrabTarget=!1},h=function(M,Y){var Q=Y.addToList,W=Q.has(M);!W&&M.grabbable()&&!M.locked()&&(Q.merge(M),i(M))},c=function(M,Y){if(!!M.cy().hasCompoundNodes()&&!(Y.inDragLayer==null&&Y.addToList==null)){var Q=M.descendants();Y.inDragLayer&&(Q.forEach(o),Q.connectedEdges().forEach(o)),Y.addToList&&h(Q,Y)}},v=function(M,Y){Y=Y||{};var Q=M.cy().hasCompoundNodes();Y.inDragLayer&&(M.forEach(o),M.neighborhood().stdFilter(function(W){return!Q||W.isEdge()}).forEach(o)),Y.addToList&&M.forEach(function(W){h(W,Y)}),c(M,Y),y(M,{inDragLayer:Y.inDragLayer}),r.updateCachedGrabbedEles()},d=v,g=function(M){!M||(r.getCachedZSortedEles().forEach(function(Y){s(Y),u(Y),f(Y)}),r.updateCachedGrabbedEles())},y=function(M,Y){if(!(Y.inDragLayer==null&&Y.addToList==null)&&!!M.cy().hasCompoundNodes()){var Q=M.ancestors().orphans();if(!Q.same(M)){var W=Q.descendants().spawnSelf().merge(Q).unmerge(M).unmerge(M.descendants()),_=W.connectedEdges();Y.inDragLayer&&(_.forEach(o),W.forEach(o)),Y.addToList&&W.forEach(function(pe){h(pe,Y)})}}},p=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},E=typeof MutationObserver<"u",m=typeof ResizeObserver<"u";E?(r.removeObserver=new MutationObserver(function(J){for(var M=0;M<J.length;M++){var Y=J[M],Q=Y.removedNodes;if(Q)for(var W=0;W<Q.length;W++){var _=Q[W];if(_===r.container){r.destroy();break}}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(J){r.destroy()});var T=Wa.default(function(){r.cy.resize()},100);E&&(r.styleObserver=new MutationObserver(T),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(window,"resize",T),m&&(r.resizeObserver=new ResizeObserver(T),r.resizeObserver.observe(r.container));var D=function(M,Y){for(;M!=null;)Y(M),M=M.parentNode},L=function(){r.invalidateContainerClientCoordsCache()};D(r.container,function(J){r.registerBinding(J,"transitionend",L),r.registerBinding(J,"animationend",L),r.registerBinding(J,"scroll",L)}),r.registerBinding(r.container,"contextmenu",function(J){J.preventDefault()});var b=function(){return r.selection[4]!==0},x=function(M){for(var Y=r.findContainerClientCoords(),Q=Y[0],W=Y[1],_=Y[2],pe=Y[3],j=M.touches?M.touches:[M],oe=!1,we=0;we<j.length;we++){var Ne=j[we];if(Q<=Ne.clientX&&Ne.clientX<=Q+_&&W<=Ne.clientY&&Ne.clientY<=W+pe){oe=!0;break}}if(!oe)return!1;for(var me=r.container,Le=M.target,ye=Le.parentNode,be=!1;ye;){if(ye===me){be=!0;break}ye=ye.parentNode}return!!be};r.registerBinding(r.container,"mousedown",function(M){if(!!x(M)){M.preventDefault(),p(),r.hoverData.capture=!0,r.hoverData.which=M.which;var Y=r.cy,Q=[M.clientX,M.clientY],W=r.projectIntoViewport(Q[0],Q[1]),_=r.selection,pe=r.findNearestElements(W[0],W[1],!0,!1),j=pe[0],oe=r.dragData.possibleDragElements;r.hoverData.mdownPos=W,r.hoverData.mdownGPos=Q;var we=function(){r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var Ge=r.hoverData.down;Ge?Ge.emit({originalEvent:M,type:"taphold",position:{x:W[0],y:W[1]}}):Y.emit({originalEvent:M,type:"taphold",position:{x:W[0],y:W[1]}})}},r.tapholdDuration)};if(M.which==3){r.hoverData.cxtStarted=!0;var Ne={originalEvent:M,type:"cxttapstart",position:{x:W[0],y:W[1]}};j?(j.activate(),j.emit(Ne),r.hoverData.down=j):Y.emit(Ne),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(M.which==1){j&&j.activate();{if(j!=null&&r.nodeIsGrabbable(j)){var me=function(Ge){return{originalEvent:M,type:Ge,position:{x:W[0],y:W[1]}}},Le=function(Ge){Ge.emit(me("grab"))};if(l(j),!j.selected())oe=r.dragData.possibleDragElements=Y.collection(),d(j,{addToList:oe}),j.emit(me("grabon")).emit(me("grab"));else{oe=r.dragData.possibleDragElements=Y.collection();var ye=Y.$(function(be){return be.isNode()&&be.selected()&&r.nodeIsGrabbable(be)});v(ye,{addToList:oe}),j.emit(me("grabon")),ye.forEach(Le)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=j,r.hoverData.downs=pe,r.hoverData.downTime=new Date().getTime()}t(j,["mousedown","tapstart","vmousedown"],M,{x:W[0],y:W[1]}),j==null?(_[4]=1,r.data.bgActivePosistion={x:W[0],y:W[1]},r.redrawHint("select",!0),r.redraw()):j.pannable()&&(_[4]=1),we()}_[0]=_[2]=W[0],_[1]=_[3]=W[1]}},!1),r.registerBinding(window,"mousemove",function(M){var Y=r.hoverData.capture;if(!(!Y&&!x(M))){var Q=!1,W=r.cy,_=W.zoom(),pe=[M.clientX,M.clientY],j=r.projectIntoViewport(pe[0],pe[1]),oe=r.hoverData.mdownPos,we=r.hoverData.mdownGPos,Ne=r.selection,me=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(me=r.findNearestElement(j[0],j[1],!0,!1));var Le=r.hoverData.last,ye=r.hoverData.down,be=[j[0]-Ne[2],j[1]-Ne[3]],Ge=r.dragData.possibleDragElements,Xe;if(we){var pt=pe[0]-we[0],yt=pt*pt,qe=pe[1]-we[1],vt=qe*qe,at=yt+vt;r.hoverData.isOverThresholdDrag=Xe=at>=r.desktopTapThreshold2}var Nt=a(M);Xe&&(r.hoverData.tapholdCancelled=!0);var Bt=function(){var Tt=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Tt.length===0?(Tt.push(be[0]),Tt.push(be[1])):(Tt[0]+=be[0],Tt[1]+=be[1])};Q=!0,t(me,["mousemove","vmousemove","tapdrag"],M,{x:j[0],y:j[1]});var hr=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||W.emit({originalEvent:M,type:"boxstart",position:{x:j[0],y:j[1]}}),Ne[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Xe){var Zt={originalEvent:M,type:"cxtdrag",position:{x:j[0],y:j[1]}};ye?ye.emit(Zt):W.emit(Zt),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||me!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit({originalEvent:M,type:"cxtdragout",position:{x:j[0],y:j[1]}}),r.hoverData.cxtOver=me,me&&me.emit({originalEvent:M,type:"cxtdragover",position:{x:j[0],y:j[1]}}))}}else if(r.hoverData.dragging){if(Q=!0,W.panningEnabled()&&W.userPanningEnabled()){var vr;if(r.hoverData.justStartedPan){var pa=r.hoverData.mdownPos;vr={x:(j[0]-pa[0])*_,y:(j[1]-pa[1])*_},r.hoverData.justStartedPan=!1}else vr={x:be[0]*_,y:be[1]*_};W.panBy(vr),W.emit("dragpan"),r.hoverData.dragged=!0}j=r.projectIntoViewport(M.clientX,M.clientY)}else if(Ne[4]==1&&(ye==null||ye.pannable())){if(Xe){if(!r.hoverData.dragging&&W.boxSelectionEnabled()&&(Nt||!W.panningEnabled()||!W.userPanningEnabled()))hr();else if(!r.hoverData.selecting&&W.panningEnabled()&&W.userPanningEnabled()){var Qt=n(ye,r.hoverData.downs);Qt&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,Ne[4]=0,r.data.bgActivePosistion=br(oe),r.redrawHint("select",!0),r.redraw())}ye&&ye.pannable()&&ye.active()&&ye.unactivate()}}else{if(ye&&ye.pannable()&&ye.active()&&ye.unactivate(),(!ye||!ye.grabbed())&&me!=Le&&(Le&&t(Le,["mouseout","tapdragout"],M,{x:j[0],y:j[1]}),me&&t(me,["mouseover","tapdragover"],M,{x:j[0],y:j[1]}),r.hoverData.last=me),ye)if(Xe){if(W.boxSelectionEnabled()&&Nt)ye&&ye.grabbed()&&(g(Ge),ye.emit("freeon"),Ge.emit("free"),r.dragData.didDrag&&(ye.emit("dragfreeon"),Ge.emit("dragfree"))),hr();else if(ye&&ye.grabbed()&&r.nodeIsDraggable(ye)){var st=!r.dragData.didDrag;st&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||v(Ge,{inDragLayer:!0});var Je={x:0,y:0};if(ae(be[0])&&ae(be[1])&&(Je.x+=be[0],Je.y+=be[1],st)){var ot=r.hoverData.dragDelta;ot&&ae(ot[0])&&ae(ot[1])&&(Je.x+=ot[0],Je.y+=ot[1])}r.hoverData.draggingEles=!0,Ge.silentShift(Je).emit("position drag"),r.redrawHint("drag",!0),r.redraw()}}else Bt();Q=!0}if(Ne[2]=j[0],Ne[3]=j[1],Q)return M.stopPropagation&&M.stopPropagation(),M.preventDefault&&M.preventDefault(),!1}},!1);var w,C,A;r.registerBinding(window,"mouseup",function(M){var Y=r.hoverData.capture;if(!!Y){r.hoverData.capture=!1;var Q=r.cy,W=r.projectIntoViewport(M.clientX,M.clientY),_=r.selection,pe=r.findNearestElement(W[0],W[1],!0,!1),j=r.dragData.possibleDragElements,oe=r.hoverData.down,we=a(M);if(r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,oe&&oe.unactivate(),r.hoverData.which===3){var Ne={originalEvent:M,type:"cxttapend",position:{x:W[0],y:W[1]}};if(oe?oe.emit(Ne):Q.emit(Ne),!r.hoverData.cxtDragged){var me={originalEvent:M,type:"cxttap",position:{x:W[0],y:W[1]}};oe?oe.emit(me):Q.emit(me)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(t(pe,["mouseup","tapend","vmouseup"],M,{x:W[0],y:W[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(t(oe,["click","tap","vclick"],M,{x:W[0],y:W[1]}),C=!1,M.timeStamp-A<=Q.multiClickDebounceTime()?(w&&clearTimeout(w),C=!0,A=null,t(oe,["dblclick","dbltap","vdblclick"],M,{x:W[0],y:W[1]})):(w=setTimeout(function(){C||t(oe,["oneclick","onetap","voneclick"],M,{x:W[0],y:W[1]})},Q.multiClickDebounceTime()),A=M.timeStamp)),oe==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!a(M)&&(Q.$(e).unselect(["tapunselect"]),j.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=j=Q.collection()),pe==oe&&!r.dragData.didDrag&&!r.hoverData.selecting&&pe!=null&&pe._private.selectable&&(r.hoverData.dragging||(Q.selectionType()==="additive"||we?pe.selected()?pe.unselect(["tapunselect"]):pe.select(["tapselect"]):we||(Q.$(e).unmerge(pe).unselect(["tapunselect"]),pe.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var Le=Q.collection(r.getAllInBox(_[0],_[1],_[2],_[3]));r.redrawHint("select",!0),Le.length>0&&r.redrawHint("eles",!0),Q.emit({type:"boxend",originalEvent:M,position:{x:W[0],y:W[1]}});var ye=function(Xe){return Xe.selectable()&&!Xe.selected()};Q.selectionType()==="additive"||we||Q.$(e).unmerge(Le).unselect(),Le.emit("box").stdFilter(ye).select().emit("boxselect"),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!_[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var be=oe&&oe.grabbed();g(j),be&&(oe.emit("freeon"),j.emit("free"),r.dragData.didDrag&&(oe.emit("dragfreeon"),j.emit("dragfree")))}}_[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null}},!1);var S=function(M){if(!r.scrollingPage){var Y=r.cy,Q=Y.zoom(),W=Y.pan(),_=r.projectIntoViewport(M.clientX,M.clientY),pe=[_[0]*Q+W.x,_[1]*Q+W.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||b()){M.preventDefault();return}if(Y.panningEnabled()&&Y.userPanningEnabled()&&Y.zoomingEnabled()&&Y.userZoomingEnabled()){M.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var j;M.deltaY!=null?j=M.deltaY/-250:M.wheelDeltaY!=null?j=M.wheelDeltaY/1e3:j=M.wheelDelta/1e3,j=j*r.wheelSensitivity;var oe=M.deltaMode===1;oe&&(j*=33);var we=Y.zoom()*Math.pow(10,j);M.type==="gesturechange"&&(we=r.gestureStartZoom*M.scale),Y.zoom({level:we,renderedPosition:{x:pe[0],y:pe[1]}}),Y.emit(M.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};r.registerBinding(r.container,"wheel",S,!0),r.registerBinding(window,"scroll",function(M){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(M){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||M.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(J){r.hasTouchStarted||S(J)},!0),r.registerBinding(r.container,"mouseout",function(M){var Y=r.projectIntoViewport(M.clientX,M.clientY);r.cy.emit({originalEvent:M,type:"mouseout",position:{x:Y[0],y:Y[1]}})},!1),r.registerBinding(r.container,"mouseover",function(M){var Y=r.projectIntoViewport(M.clientX,M.clientY);r.cy.emit({originalEvent:M,type:"mouseover",position:{x:Y[0],y:Y[1]}})},!1);var O,N,P,I,k,R,B,z,F,V,U,$,X,H=function(M,Y,Q,W){return Math.sqrt((Q-M)*(Q-M)+(W-Y)*(W-Y))},G=function(M,Y,Q,W){return(Q-M)*(Q-M)+(W-Y)*(W-Y)},q;r.registerBinding(r.container,"touchstart",q=function(M){if(r.hasTouchStarted=!0,!!x(M)){p(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var Y=r.cy,Q=r.touchData.now,W=r.touchData.earlier;if(M.touches[0]){var _=r.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);Q[0]=_[0],Q[1]=_[1]}if(M.touches[1]){var _=r.projectIntoViewport(M.touches[1].clientX,M.touches[1].clientY);Q[2]=_[0],Q[3]=_[1]}if(M.touches[2]){var _=r.projectIntoViewport(M.touches[2].clientX,M.touches[2].clientY);Q[4]=_[0],Q[5]=_[1]}if(M.touches[1]){r.touchData.singleTouchMoved=!0,g(r.dragData.touchDragEles);var pe=r.findContainerClientCoords();F=pe[0],V=pe[1],U=pe[2],$=pe[3],O=M.touches[0].clientX-F,N=M.touches[0].clientY-V,P=M.touches[1].clientX-F,I=M.touches[1].clientY-V,X=0<=O&&O<=U&&0<=P&&P<=U&&0<=N&&N<=$&&0<=I&&I<=$;var j=Y.pan(),oe=Y.zoom();k=H(O,N,P,I),R=G(O,N,P,I),B=[(O+P)/2,(N+I)/2],z=[(B[0]-j.x)/oe,(B[1]-j.y)/oe];var we=200,Ne=we*we;if(R<Ne&&!M.touches[2]){var me=r.findNearestElement(Q[0],Q[1],!0,!0),Le=r.findNearestElement(Q[2],Q[3],!0,!0);me&&me.isNode()?(me.activate().emit({originalEvent:M,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),r.touchData.start=me):Le&&Le.isNode()?(Le.activate().emit({originalEvent:M,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),r.touchData.start=Le):Y.emit({originalEvent:M,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,r.redraw();return}}if(M.touches[2])Y.boxSelectionEnabled()&&M.preventDefault();else if(!M.touches[1]){if(M.touches[0]){var ye=r.findNearestElements(Q[0],Q[1],!0,!0),be=ye[0];if(be!=null&&(be.activate(),r.touchData.start=be,r.touchData.starts=ye,r.nodeIsGrabbable(be))){var Ge=r.dragData.touchDragEles=Y.collection(),Xe=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),be.selected()?(Xe=Y.$(function(at){return at.selected()&&r.nodeIsGrabbable(at)}),v(Xe,{addToList:Ge})):d(be,{addToList:Ge}),l(be);var pt=function(Nt){return{originalEvent:M,type:Nt,position:{x:Q[0],y:Q[1]}}};be.emit(pt("grabon")),Xe?Xe.forEach(function(at){at.emit(pt("grab"))}):be.emit(pt("grab"))}t(be,["touchstart","tapstart","vmousedown"],M,{x:Q[0],y:Q[1]}),be==null&&(r.data.bgActivePosistion={x:_[0],y:_[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){r.touchData.singleTouchMoved===!1&&!r.pinching&&!r.touchData.selecting&&t(r.touchData.start,["taphold"],M,{x:Q[0],y:Q[1]})},r.tapholdDuration)}}if(M.touches.length>=1){for(var yt=r.touchData.startPosition=[],qe=0;qe<Q.length;qe++)yt[qe]=W[qe]=Q[qe];var vt=M.touches[0];r.touchData.startGPosition=[vt.clientX,vt.clientY]}}},!1);var K;r.registerBinding(window,"touchmove",K=function(M){var Y=r.touchData.capture;if(!(!Y&&!x(M))){var Q=r.selection,W=r.cy,_=r.touchData.now,pe=r.touchData.earlier,j=W.zoom();if(M.touches[0]){var oe=r.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);_[0]=oe[0],_[1]=oe[1]}if(M.touches[1]){var oe=r.projectIntoViewport(M.touches[1].clientX,M.touches[1].clientY);_[2]=oe[0],_[3]=oe[1]}if(M.touches[2]){var oe=r.projectIntoViewport(M.touches[2].clientX,M.touches[2].clientY);_[4]=oe[0],_[5]=oe[1]}var we=r.touchData.startGPosition,Ne;if(Y&&M.touches[0]&&we){for(var me=[],Le=0;Le<_.length;Le++)me[Le]=_[Le]-pe[Le];var ye=M.touches[0].clientX-we[0],be=ye*ye,Ge=M.touches[0].clientY-we[1],Xe=Ge*Ge,pt=be+Xe;Ne=pt>=r.touchTapThreshold2}if(Y&&r.touchData.cxt){M.preventDefault();var yt=M.touches[0].clientX-F,qe=M.touches[0].clientY-V,vt=M.touches[1].clientX-F,at=M.touches[1].clientY-V,Nt=G(yt,qe,vt,at),Bt=Nt/R,hr=150,Zt=hr*hr,vr=1.5,pa=vr*vr;if(Bt>=pa||Nt>=Zt){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Qt={originalEvent:M,type:"cxttapend",position:{x:_[0],y:_[1]}};r.touchData.start?(r.touchData.start.unactivate().emit(Qt),r.touchData.start=null):W.emit(Qt)}}if(Y&&r.touchData.cxt){var Qt={originalEvent:M,type:"cxtdrag",position:{x:_[0],y:_[1]}};r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(Qt):W.emit(Qt),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var st=r.findNearestElement(_[0],_[1],!0,!0);(!r.touchData.cxtOver||st!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit({originalEvent:M,type:"cxtdragout",position:{x:_[0],y:_[1]}}),r.touchData.cxtOver=st,st&&st.emit({originalEvent:M,type:"cxtdragover",position:{x:_[0],y:_[1]}}))}else if(Y&&M.touches[2]&&W.boxSelectionEnabled())M.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||W.emit({originalEvent:M,type:"boxstart",position:{x:_[0],y:_[1]}}),r.touchData.selecting=!0,r.touchData.didSelect=!0,Q[4]=1,!Q||Q.length===0||Q[0]===void 0?(Q[0]=(_[0]+_[2]+_[4])/3,Q[1]=(_[1]+_[3]+_[5])/3,Q[2]=(_[0]+_[2]+_[4])/3+1,Q[3]=(_[1]+_[3]+_[5])/3+1):(Q[2]=(_[0]+_[2]+_[4])/3,Q[3]=(_[1]+_[3]+_[5])/3),r.redrawHint("select",!0),r.redraw();else if(Y&&M.touches[1]&&!r.touchData.didSelect&&W.zoomingEnabled()&&W.panningEnabled()&&W.userZoomingEnabled()&&W.userPanningEnabled()){M.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Je=r.dragData.touchDragEles;if(Je){r.redrawHint("drag",!0);for(var ot=0;ot<Je.length;ot++){var ya=Je[ot]._private;ya.grabbed=!1,ya.rscratch.inDragLayer=!1}}var Tt=r.touchData.start,yt=M.touches[0].clientX-F,qe=M.touches[0].clientY-V,vt=M.touches[1].clientX-F,at=M.touches[1].clientY-V,ii=H(yt,qe,vt,at),tu=ii/k;if(X){var ru=yt-O,au=qe-N,nu=vt-P,iu=at-I,su=(ru+nu)/2,ou=(au+iu)/2,Pr=W.zoom(),un=Pr*tu,ma=W.pan(),si=z[0]*Pr+ma.x,oi=z[1]*Pr+ma.y,uu={x:-un/Pr*(si-ma.x-su)+si,y:-un/Pr*(oi-ma.y-ou)+oi};if(Tt&&Tt.active()){var Je=r.dragData.touchDragEles;g(Je),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Tt.unactivate().emit("freeon"),Je.emit("free"),r.dragData.didDrag&&(Tt.emit("dragfreeon"),Je.emit("dragfree"))}W.viewport({zoom:un,pan:uu,cancelOnFailedZoom:!0}),W.emit("pinchzoom"),k=ii,O=yt,N=qe,P=vt,I=at,r.pinching=!0}if(M.touches[0]){var oe=r.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);_[0]=oe[0],_[1]=oe[1]}if(M.touches[1]){var oe=r.projectIntoViewport(M.touches[1].clientX,M.touches[1].clientY);_[2]=oe[0],_[3]=oe[1]}if(M.touches[2]){var oe=r.projectIntoViewport(M.touches[2].clientX,M.touches[2].clientY);_[4]=oe[0],_[5]=oe[1]}}else if(M.touches[0]&&!r.touchData.didSelect){var mt=r.touchData.start,ln=r.touchData.last,st;if(!r.hoverData.draggingEles&&!r.swipePanning&&(st=r.findNearestElement(_[0],_[1],!0,!0)),Y&&mt!=null&&M.preventDefault(),Y&&mt!=null&&r.nodeIsDraggable(mt))if(Ne){var Je=r.dragData.touchDragEles,ui=!r.dragData.didDrag;ui&&v(Je,{inDragLayer:!0}),r.dragData.didDrag=!0;var Br={x:0,y:0};if(ae(me[0])&&ae(me[1])&&(Br.x+=me[0],Br.y+=me[1],ui)){r.redrawHint("eles",!0);var bt=r.touchData.dragDelta;bt&&ae(bt[0])&&ae(bt[1])&&(Br.x+=bt[0],Br.y+=bt[1])}r.hoverData.draggingEles=!0,Je.silentShift(Br).emit("position drag"),r.redrawHint("drag",!0),r.touchData.startPosition[0]==pe[0]&&r.touchData.startPosition[1]==pe[1]&&r.redrawHint("eles",!0),r.redraw()}else{var bt=r.touchData.dragDelta=r.touchData.dragDelta||[];bt.length===0?(bt.push(me[0]),bt.push(me[1])):(bt[0]+=me[0],bt[1]+=me[1])}if(t(mt||st,["touchmove","tapdrag","vmousemove"],M,{x:_[0],y:_[1]}),(!mt||!mt.grabbed())&&st!=ln&&(ln&&ln.emit({originalEvent:M,type:"tapdragout",position:{x:_[0],y:_[1]}}),st&&st.emit({originalEvent:M,type:"tapdragover",position:{x:_[0],y:_[1]}})),r.touchData.last=st,Y)for(var ot=0;ot<_.length;ot++)_[ot]&&r.touchData.startPosition[ot]&&Ne&&(r.touchData.singleTouchMoved=!0);if(Y&&(mt==null||mt.pannable())&&W.panningEnabled()&&W.userPanningEnabled()){var lu=n(mt,r.touchData.starts);lu&&(M.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=br(r.touchData.startPosition)),r.swipePanning?(W.panBy({x:me[0]*j,y:me[1]*j}),W.emit("dragpan")):Ne&&(r.swipePanning=!0,W.panBy({x:ye*j,y:Ge*j}),W.emit("dragpan"),mt&&(mt.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var oe=r.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);_[0]=oe[0],_[1]=oe[1]}}for(var Le=0;Le<_.length;Le++)pe[Le]=_[Le];Y&&M.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var Z;r.registerBinding(window,"touchcancel",Z=function(M){var Y=r.touchData.start;r.touchData.capture=!1,Y&&Y.unactivate()});var te,he,de,ee;if(r.registerBinding(window,"touchend",te=function(M){var Y=r.touchData.start,Q=r.touchData.capture;if(Q)M.touches.length===0&&(r.touchData.capture=!1),M.preventDefault();else return;var W=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var _=r.cy,pe=_.zoom(),j=r.touchData.now,oe=r.touchData.earlier;if(M.touches[0]){var we=r.projectIntoViewport(M.touches[0].clientX,M.touches[0].clientY);j[0]=we[0],j[1]=we[1]}if(M.touches[1]){var we=r.projectIntoViewport(M.touches[1].clientX,M.touches[1].clientY);j[2]=we[0],j[3]=we[1]}if(M.touches[2]){var we=r.projectIntoViewport(M.touches[2].clientX,M.touches[2].clientY);j[4]=we[0],j[5]=we[1]}Y&&Y.unactivate();var Ne;if(r.touchData.cxt){if(Ne={originalEvent:M,type:"cxttapend",position:{x:j[0],y:j[1]}},Y?Y.emit(Ne):_.emit(Ne),!r.touchData.cxtDragged){var me={originalEvent:M,type:"cxttap",position:{x:j[0],y:j[1]}};Y?Y.emit(me):_.emit(me)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!M.touches[2]&&_.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var Le=_.collection(r.getAllInBox(W[0],W[1],W[2],W[3]));W[0]=void 0,W[1]=void 0,W[2]=void 0,W[3]=void 0,W[4]=0,r.redrawHint("select",!0),_.emit({type:"boxend",originalEvent:M,position:{x:j[0],y:j[1]}});var ye=function(Zt){return Zt.selectable()&&!Zt.selected()};Le.emit("box").stdFilter(ye).select().emit("boxselect"),Le.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(Y!=null&&Y.unactivate(),M.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!M.touches[1]){if(!M.touches[0]){if(!M.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var be=r.dragData.touchDragEles;if(Y!=null){var Ge=Y._private.grabbed;g(be),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Ge&&(Y.emit("freeon"),be.emit("free"),r.dragData.didDrag&&(Y.emit("dragfreeon"),be.emit("dragfree"))),t(Y,["touchend","tapend","vmouseup","tapdragout"],M,{x:j[0],y:j[1]}),Y.unactivate(),r.touchData.start=null}else{var Xe=r.findNearestElement(j[0],j[1],!0,!0);t(Xe,["touchend","tapend","vmouseup","tapdragout"],M,{x:j[0],y:j[1]})}var pt=r.touchData.startPosition[0]-j[0],yt=pt*pt,qe=r.touchData.startPosition[1]-j[1],vt=qe*qe,at=yt+vt,Nt=at*pe*pe;r.touchData.singleTouchMoved||(Y||_.$(":selected").unselect(["tapunselect"]),t(Y,["tap","vclick"],M,{x:j[0],y:j[1]}),he=!1,M.timeStamp-ee<=_.multiClickDebounceTime()?(de&&clearTimeout(de),he=!0,ee=null,t(Y,["dbltap","vdblclick"],M,{x:j[0],y:j[1]})):(de=setTimeout(function(){he||t(Y,["onetap","voneclick"],M,{x:j[0],y:j[1]})},_.multiClickDebounceTime()),ee=M.timeStamp)),Y!=null&&!r.dragData.didDrag&&Y._private.selectable&&Nt<r.touchTapThreshold2&&!r.pinching&&(_.selectionType()==="single"?(_.$(e).unmerge(Y).unselect(["tapunselect"]),Y.select(["tapselect"])):Y.selected()?Y.unselect(["tapunselect"]):Y.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}}}for(var Bt=0;Bt<j.length;Bt++)oe[Bt]=j[Bt];r.dragData.didDrag=!1,M.touches.length===0&&(r.touchData.dragDelta=[],r.touchData.startPosition=null,r.touchData.startGPosition=null,r.touchData.didSelect=!1),M.touches.length<2&&(M.touches.length===1&&(r.touchData.startGPosition=[M.touches[0].clientX,M.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())},!1),typeof TouchEvent>"u"){var re=[],fe=function(M){return{clientX:M.clientX,clientY:M.clientY,force:1,identifier:M.pointerId,pageX:M.pageX,pageY:M.pageY,radiusX:M.width/2,radiusY:M.height/2,screenX:M.screenX,screenY:M.screenY,target:M.target}},se=function(M){return{event:M,touch:fe(M)}},ne=function(M){re.push(se(M))},ue=function(M){for(var Y=0;Y<re.length;Y++){var Q=re[Y];if(Q.event.pointerId===M.pointerId){re.splice(Y,1);return}}},Ee=function(M){var Y=re.filter(function(Q){return Q.event.pointerId===M.pointerId})[0];Y.event=M,Y.touch=fe(M)},ge=function(M){M.touches=re.map(function(Y){return Y.touch})},ve=function(M){return M.pointerType==="mouse"||M.pointerType===4};r.registerBinding(r.container,"pointerdown",function(J){ve(J)||(J.preventDefault(),ne(J),ge(J),q(J))}),r.registerBinding(r.container,"pointerup",function(J){ve(J)||(ue(J),ge(J),te(J))}),r.registerBinding(r.container,"pointercancel",function(J){ve(J)||(ue(J),ge(J),Z(J))}),r.registerBinding(r.container,"pointermove",function(J){ve(J)||(J.preventDefault(),Ee(J),ge(J),K(J))})}};var kt={};kt.generatePolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(a,n,i,s,o){this.renderer.nodeShapeImpl("polygon",a,n,i,s,o,this.points)},intersectLine:function(a,n,i,s,o,u,l){return ea(o,u,this.points,a,n,i/2,s/2,l)},checkPoint:function(a,n,i,s,o,u,l){return It(a,n,this.points,u,l,s,o,[0,-1],i)}}};kt.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,s,o){return Of(i,s,e,t,a/2+o,n/2+o)},checkPoint:function(e,t,a,n,i,s,o){return er(e,t,n,i,s,o,a)}}};kt.generateRoundPolygon=function(r,e){for(var t=new Array(e.length*2),a=0;a<e.length/2;a++){var n=a*2,i=void 0;a<e.length/2-1?i=(a+1)*2:i=0,t[a*4]=e[n],t[a*4+1]=e[n+1];var s=e[i]-e[n],o=e[i+1]-e[n+1],u=Math.sqrt(s*s+o*o);t[a*4+2]=s/u,t[a*4+3]=o/u}return this.nodeShapes[r]={renderer:this,name:r,points:t,draw:function(f,h,c,v,d){this.renderer.nodeShapeImpl("round-polygon",f,h,c,v,d,this.points)},intersectLine:function(f,h,c,v,d,g,y){return If(d,g,this.points,f,h,c,v)},checkPoint:function(f,h,c,v,d,g,y){return Mf(f,h,this.points,g,y,v,d)}}};kt.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:nt(4,0),draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,s,o){return Gs(i,s,e,t,a,n,o)},checkPoint:function(e,t,a,n,i,s,o){var u=fa(n,i),l=u*2;return!!(It(e,t,this.points,s,o,n,i-l,[0,-1],a)||It(e,t,this.points,s,o,n-l,i,[0,-1],a)||er(e,t,l,l,s-n/2+u,o-i/2+u,a)||er(e,t,l,l,s+n/2-u,o-i/2+u,a)||er(e,t,l,l,s+n/2-u,o+i/2-u,a)||er(e,t,l,l,s-n/2+u,o+i/2-u,a))}}};kt.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Ys(),points:nt(4,0),draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},generateCutTrianglePts:function(e,t,a,n){var i=this.cornerLength,s=t/2,o=e/2,u=a-o,l=a+o,f=n-s,h=n+s;return{topLeft:[u,f+i,u+i,f,u+i,f+i],topRight:[l-i,f,l,f+i,l-i,f+i],bottomRight:[l,h-i,l-i,h,l-i,h-i],bottomLeft:[u+i,h,u,h-i,u+i,h-i]}},intersectLine:function(e,t,a,n,i,s,o){var u=this.generateCutTrianglePts(a+2*o,n+2*o,e,t),l=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return ea(i,s,l,e,t)},checkPoint:function(e,t,a,n,i,s,o){if(It(e,t,this.points,s,o,n,i-2*this.cornerLength,[0,-1],a)||It(e,t,this.points,s,o,n-2*this.cornerLength,i,[0,-1],a))return!0;var u=this.generateCutTrianglePts(n,i,s,o);return ut(e,t,u.topLeft)||ut(e,t,u.topRight)||ut(e,t,u.bottomRight)||ut(e,t,u.bottomLeft)}}};kt.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:nt(4,0),draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,s,o){var u=.15,l=.5,f=.85,h=this.generateBarrelBezierPts(a+2*o,n+2*o,e,t),c=function(g){var y=wr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},u),p=wr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},l),E=wr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},f);return[g[0],g[1],y.x,y.y,p.x,p.y,E.x,E.y,g[4],g[5]]},v=[].concat(c(h.topLeft),c(h.topRight),c(h.bottomRight),c(h.bottomLeft));return ea(i,s,v,e,t)},generateBarrelBezierPts:function(e,t,a,n){var i=t/2,s=e/2,o=a-s,u=a+s,l=n-i,f=n+i,h=Cn(e,t),c=h.heightOffset,v=h.widthOffset,d=h.ctrlPtOffsetPct*e,g={topLeft:[o,l+c,o+d,l,o+v,l],topRight:[u-v,l,u-d,l,u,l+c],bottomRight:[u,f-c,u-d,f,u-v,f],bottomLeft:[o+v,f,o+d,f,o,f-c]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,t,a,n,i,s,o){var u=Cn(n,i),l=u.heightOffset,f=u.widthOffset;if(It(e,t,this.points,s,o,n,i-2*l,[0,-1],a)||It(e,t,this.points,s,o,n-2*f,i,[0,-1],a))return!0;for(var h=this.generateBarrelBezierPts(n,i,s,o),c=function(b,x,w){var C=w[4],A=w[2],S=w[0],O=w[5],N=w[1],P=Math.min(C,S),I=Math.max(C,S),k=Math.min(O,N),R=Math.max(O,N);if(P<=b&&b<=I&&k<=x&&x<=R){var B=Rf(C,A,S),z=Lf(B[0],B[1],B[2],b),F=z.filter(function(V){return 0<=V&&V<=1});if(F.length>0)return F[0]}return null},v=Object.keys(h),d=0;d<v.length;d++){var g=v[d],y=h[g],p=c(e,t,y);if(p!=null){var E=y[5],m=y[3],T=y[1],D=He(E,m,T,p);if(y.isTop&&D<=t||y.isBottom&&t<=D)return!0}}return!1}}};kt.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:nt(4,0),draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,s,o){var u=e-(a/2+o),l=t-(n/2+o),f=l,h=e+(a/2+o),c=Vt(i,s,e,t,u,l,h,f,!1);return c.length>0?c:Gs(i,s,e,t,a,n,o)},checkPoint:function(e,t,a,n,i,s,o){var u=fa(n,i),l=2*u;if(It(e,t,this.points,s,o,n,i-l,[0,-1],a)||It(e,t,this.points,s,o,n-l,i,[0,-1],a))return!0;var f=n/2+2*a,h=i/2+2*a,c=[s-f,o-h,s-f,o,s+f,o,s+f,o-h];return!!(ut(e,t,c)||er(e,t,l,l,s+n/2-u,o+i/2-u,a)||er(e,t,l,l,s-n/2+u,o+i/2-u,a))}}};kt.registerNodeShapes=function(){var r=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)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}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=Dn(5,0),i=Dn(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=s,i[o*2+1]*=s;for(var o=0;o<20/4;o++)a[o*4]=n[o*2],a[o*4+1]=n[o*2+1],a[o*4+2]=i[o*2],a[o*4+3]=i[o*2+1]}a=$s(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.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)}r.makePolygon=function(l){var f=l.join("$"),h="polygon-"+f,c;return(c=this[h])?c:e.generatePolygon(h,l)}};var da={};da.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};da.redraw=function(r){r=r||ks();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=r};da.beforeRender=function(r,e){if(!this.destroyed){e==null&&ze("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(a,n){return n.priority-a.priority})}};var ns=function(e,t,a){for(var n=e.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(t,a)};da.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function a(n){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){ns(r,!0,n);var i=Ot();r.render(r.renderOptions);var s=r.lastDrawTime=Ot();r.averageRedrawTime===void 0&&(r.averageRedrawTime=s-i),r.redrawCount===void 0&&(r.redrawCount=0),r.redrawCount++,r.redrawTotalTime===void 0&&(r.redrawTotalTime=0);var o=s-i;r.redrawTotalTime+=o,r.lastRedrawTime=o,r.averageRedrawTime=r.averageRedrawTime/2+o/2,r.requestedFrame=!1}else ns(r,!1,n);r.skipFrame=!1,Ga(a)}};Ga(t)}};var ac=function(e){this.init(e)},Oo=ac,Rr=Oo.prototype;Rr.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Rr.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container();if(Be){var a=Be.document,n=a.head,i="__________cytoscape_stylesheet",s="__________cytoscape_container",o=a.getElementById(i)!=null;if(t.className.indexOf(s)<0&&(t.className=(t.className||"")+" "+s),!o){var u=a.createElement("style");u.id=i,u.innerHTML="."+s+" { position: relative; }",n.insertBefore(u,n.children[0])}var l=Be.getComputedStyle(t),f=l.getPropertyValue("position");f==="static"&&Ae("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=r.showFps,e.debug=r.debug,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=ae(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.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()};Rr.notify=function(r,e){var t=this,a=t.cy;if(!this.destroyed){if(r==="init"){t.load();return}if(r==="destroy"){t.destroy();return}(r==="add"||r==="remove"||r==="move"&&a.hasCompoundNodes()||r==="load"||r==="zorder"||r==="mount")&&t.invalidateCachedZSortedEles(),r==="viewport"&&t.redrawHint("select",!0),(r==="load"||r==="resize"||r==="mount")&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Rr.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],a=t,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch{}};Rr.isHeadless=function(){return!1};[ei,No,Mo,Ir,kt,da].forEach(function(r){ce(Rr,r)});var En=1e3/60,Io={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=Wa.default(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),s=function(l,f){var h=Ot(),c=n.averageRedrawTime,v=n.lastRedrawTime,d=[],g=n.cy.extent(),y=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var p=Ot(),E=p-h,m=p-f;if(v<En){var T=En-(l?c:0);if(m>=e.deqFastCost*T)break}else if(l){if(E>=e.deqCost*v||E>=e.deqAvgCost*c)break}else if(m>=e.deqNoDrawCost*En)break;var D=e.deq(a,y,g);if(D.length>0)for(var L=0;L<D.length;L++)d.push(D[L]);else break}d.length>0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,y,g)&&i())},o=e.priority||Yn;n.beforeRender(s,o(a))}}}},nc=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:za;Fn(this,r),this.idsByKey=new Ct,this.keyForId=new Ct,this.cachesByLvl=new Ct,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return Gn(r,[{key:"getIdsFor",value:function(t){t==null&&ze("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new Ar,a.set(t,n)),n}},{key:"addIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).add(a)}},{key:"deleteIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).delete(a)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);return n!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var a=this.cachesByLvl,n=this.lvls,i=a.get(t);return i||(i=new Ct,a.set(t,i),n.push(t)),i}},{key:"getCache",value:function(t,a){return this.getCachesAt(a).get(t)}},{key:"get",value:function(t,a){var n=this.getKey(t),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,a){var n=this.keyForId.get(t.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(t,a){return this.getCachesAt(a).has(t)}},{key:"has",value:function(t,a){var n=this.getKey(t);return this.hasCache(n,a)}},{key:"setCache",value:function(t,a,n){n.key=t,this.getCachesAt(a).set(t,n)}},{key:"set",value:function(t,a,n){var i=this.getKey(t);this.setCache(i,a,n),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,a){this.getCachesAt(a).delete(t)}},{key:"delete",value:function(t,a){var n=this.getKey(t);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(t){var a=this;this.lvls.forEach(function(n){return a.deleteCache(t,n)})}},{key:"invalidate",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}]),r}(),is=25,Na=50,Ba=-4,In=3,ic=7.99,sc=8,oc=1024,uc=1024,lc=1024,fc=.2,hc=.8,vc=10,cc=.15,dc=.1,gc=.9,pc=.9,yc=100,mc=1,Er={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},bc=Ze({getKey:null,doesEleInvalidateKey:za,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Os,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Hr=function(e,t){var a=this;a.renderer=e,a.onDequeues=[];var n=bc(t);ce(a,n),a.lookup=new nc(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},Ue=Hr.prototype;Ue.reasons=Er;Ue.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};Ue.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=t[r]=t[r]||[];return a};Ue.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new oa.default(function(t,a){return a.reqs-t.reqs});return e};Ue.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};Ue.getElement=function(r,e,t,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(a==null&&(a=Math.ceil(Hn(o*t))),a<Ba)a=Ba;else if(o>=ic||a>In)return null;var l=Math.pow(2,a),f=e.h*l,h=e.w*l,c=s.eleTextBiggerThanMin(r,l);if(!this.isVisible(r,c))return null;var v=u.get(r,a);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var d;if(f<=is?d=is:f<=Na?d=Na:d=Math.ceil(f/Na)*Na,f>lc||h>uc)return null;var g=i.getTextureQueue(d),y=g[g.length-2],p=function(){return i.recycleTexture(d,h)||i.addTexture(d,h)};y||(y=g[g.length-1]),y||(y=p()),y.width-y.usedWidth<h&&(y=p());for(var E=function(I){return I&&I.scaledLabelShown===c},m=n&&n===Er.dequeue,T=n&&n===Er.highQuality,D=n&&n===Er.downscale,L,b=a+1;b<=In;b++){var x=u.get(r,b);if(x){L=x;break}}var w=L&&L.level===a+1?L:null,C=function(){y.context.drawImage(w.texture.canvas,w.x,0,w.width,w.height,y.usedWidth,0,h,f)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,h,d),E(w))C();else if(E(L))if(T){for(var A=L.level;A>a;A--)w=i.getElement(r,e,t,A,Er.downscale);C()}else return i.queueElement(r,L.level-1),L;else{var S;if(!m&&!T&&!D)for(var O=a-1;O>=Ba;O--){var N=u.get(r,O);if(N){S=N;break}}if(E(S))return i.queueElement(r,a),S;y.context.translate(y.usedWidth,0),y.context.scale(l,l),this.drawElement(y.context,r,e,c,!1),y.context.scale(1/l,1/l),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:a,scale:l,width:h,height:f,scaledLabelShown:c},y.usedWidth+=Math.ceil(h+sc),y.eleCaches.push(v),u.set(r,a,v),i.checkTextureFullness(y),v};Ue.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])};Ue.invalidateElement=function(r){var e=this,t=e.lookup,a=[],n=t.isInvalid(r);if(!!n){for(var i=Ba;i<=In;i++){var s=t.getForCachedKey(r,i);s&&a.push(s)}var o=t.invalidate(r);if(o)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(r)}};Ue.checkTextureUtility=function(r){r.invalidatedWidth>=fc*r.width&&this.retireTexture(r)};Ue.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>hc&&r.fullnessChecks>=vc?Ht(t,r):r.fullnessChecks++};Ue.retireTexture=function(r){var e=this,t=r.height,a=e.getTextureQueue(t),n=this.lookup;Ht(a,r),r.retired=!0;for(var i=r.eleCaches,s=0;s<i.length;s++){var o=i[s];n.deleteCache(o.key,o.level)}Un(i);var u=e.getRetiredTextureQueue(t);u.push(r)};Ue.addTexture=function(r,e){var t=this,a=t.getTextureQueue(r),n={};return a.push(n),n.eleCaches=[],n.height=r,n.width=Math.max(oc,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=t.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};Ue.recycleTexture=function(r,e){for(var t=this,a=t.getTextureQueue(r),n=t.getRetiredTextureQueue(r),i=0;i<n.length;i++){var s=n[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Un(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Ht(n,s),a.push(s),s}};Ue.queueElement=function(r,e){var t=this,a=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(r),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,a.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:i};a.push(o),n[i]=o}};Ue.dequeue=function(r){for(var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s<mc&&t.size()>0;s++){var o=t.pop(),u=o.key,l=o.eles[0],f=i.hasCache(l,o.level);if(a[u]=null,f)continue;n.push(o);var h=e.getBoundingBox(l);e.getElement(l,h,r,o.level,Er.dequeue)}return n};Ue.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(r),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=$n,t.updateItem(i),t.pop(),a[n]=null):i.eles.unmerge(r))};Ue.onDequeue=function(r){this.onDequeues.push(r)};Ue.offDequeue=function(r){Ht(this.onDequeues,r)};Ue.setupDequeueing=Io.setupDequeueing({deqRedrawThreshold:yc,deqCost:cc,deqAvgCost:dc,deqNoDrawCost:gc,deqFastCost:pc,deq:function(e,t,a){return e.dequeue(t,a)},onDeqd:function(e,t){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(t)}},shouldRedraw:function(e,t,a,n){for(var i=0;i<t.length;i++)for(var s=t[i].eles,o=0;o<s.length;o++){var u=s[o].boundingBox();if(Xn(u,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Ec=1,Wr=-4,Xa=2,wc=3.99,xc=50,Tc=50,Dc=.15,Cc=.1,Lc=.9,Sc=.9,Ac=1,ss=250,Nc=4e3*4e3,Mc=!0,Ro=function(e){var t=this,a=t.renderer=e,n=a.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Ot()-2*ss,t.skipping=!1,t.eleTxrDeqs=n.collection(),t.scheduleElementRefinement=Wa.default(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},Tc),a.beforeRender(function(s,o){o-t.lastInvalidationTime<=ss?t.skipping=!0:t.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(o,u){return u.reqs-o.reqs};t.layersQueue=new oa.default(i),t.setupDequeueing()},Qe=Ro.prototype,os=0,Oc=Math.pow(2,53)-1;Qe.makeLayer=function(r,e){var t=Math.pow(2,e),a=Math.ceil(r.w*t),n=Math.ceil(r.h*t),i=this.renderer.makeOffscreenCanvas(a,n),s={id:os=++os%Oc,bb:r,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,u=-s.bb.x1,l=-s.bb.y1;return o.scale(t,t),o.translate(u,l),s};Qe.getLayers=function(r,e,t){var a=this,n=a.renderer,i=n.cy,s=i.zoom(),o=a.firstGet;if(a.firstGet=!1,t==null){if(t=Math.ceil(Hn(s*e)),t<Wr)t=Wr;else if(s>=wc||t>Xa)return null}a.validateLayersElesOrdering(t,r);var u=a.layersByLevel,l=Math.pow(2,t),f=u[t]=u[t]||[],h,c=a.levelIsComplete(t,r),v,d=function(){var C=function(P){if(a.validateLayersElesOrdering(P,r),a.levelIsComplete(P,r))return v=u[P],!0},A=function(P){if(!v)for(var I=t+P;Wr<=I&&I<=Xa&&!C(I);I+=P);};A(1),A(-1);for(var S=f.length-1;S>=0;S--){var O=f[S];O.invalid&&Ht(f,O)}};if(!c)d();else return f;var g=function(){if(!h){h=lt();for(var C=0;C<r.length;C++)wf(h,r[C].boundingBox())}return h},y=function(C){C=C||{};var A=C.after;g();var S=h.w*l*(h.h*l);if(S>Nc)return null;var O=a.makeLayer(h,t);if(A!=null){var N=f.indexOf(A)+1;f.splice(N,0,O)}else(C.insert===void 0||C.insert)&&f.unshift(O);return O};if(a.skipping&&!o)return null;for(var p=null,E=r.length/Ec,m=!o,T=0;T<r.length;T++){var D=r[T],L=D._private.rscratch,b=L.imgLayerCaches=L.imgLayerCaches||{},x=b[t];if(x){p=x;continue}if((!p||p.eles.length>=E||!Fs(p.bb,D.boundingBox()))&&(p=y({insert:!0,after:p}),!p))return null;v||m?a.queueLayer(p,D):a.drawEleInLayer(p,D,t,e),p.eles.push(D),b[t]=p}return v||(m?null:f)};Qe.getEleLevelForLayerLevel=function(r,e){return r};Qe.drawEleInLayer=function(r,e,t,a){var n=this,i=this.renderer,s=r.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(t=n.getEleLevelForLayerLevel(t,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,t,Mc),i.setImgSmoothing(s,!0))};Qe.levelIsComplete=function(r,e){var t=this,a=t.layersByLevel[r];if(!a||a.length===0)return!1;for(var n=0,i=0;i<a.length;i++){var s=a[i];if(s.reqs>0||s.invalid)return!1;n+=s.eles.length}return n===e.length};Qe.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(!!t)for(var a=0;a<t.length;a++){for(var n=t[a],i=-1,s=0;s<e.length;s++)if(n.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(n);continue}for(var o=i,s=0;s<n.eles.length;s++)if(n.eles[s]!==e[o+s]){this.invalidateLayer(n);break}}};Qe.updateElementsInLayers=function(r,e){for(var t=this,a=la(r[0]),n=0;n<r.length;n++)for(var i=a?null:r[n],s=a?r[n]:r[n].ele,o=s._private.rscratch,u=o.imgLayerCaches=o.imgLayerCaches||{},l=Wr;l<=Xa;l++){var f=u[l];!f||i&&t.getEleLevelForLayerLevel(f.level)!==i.level||e(f,s,i)}};Qe.haveLayers=function(){for(var r=this,e=!1,t=Wr;t<=Xa;t++){var a=r.layersByLevel[t];if(a&&a.length>0){e=!0;break}}return e};Qe.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Ot(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(a,n,i){e.invalidateLayer(a)}))};Qe.invalidateLayer=function(r){if(this.lastInvalidationTime=Ot(),!r.invalid){var e=r.level,t=r.eles,a=this.layersByLevel[e];Ht(a,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var n=0;n<t.length;n++){var i=t[n]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};Qe.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(a,n,i){var s=a.replacement;if(s||(s=a.replacement=e.makeLayer(a.bb,a.level),s.replaces=a,s.eles=a.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};Qe.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()};Qe.queueLayer=function(r,e){var t=this,a=t.layersQueue,n=r.elesQueue,i=n.hasId=n.hasId||{};if(!r.replacement){if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}r.reqs?(r.reqs++,a.updateItem(r)):(r.reqs=1,a.push(r))}};Qe.dequeue=function(r){for(var e=this,t=e.layersQueue,a=[],n=0;n<Ac&&t.size()!==0;){var i=t.peek();if(i.replacement){t.pop();continue}if(i.replaces&&i!==i.replaces.replacement){t.pop();continue}if(i.invalid){t.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,r),n++),a.length===0&&a.push(!0),i.elesQueue.length===0&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return a};Qe.applyLayerReplacement=function(r){var e=this,t=e.layersByLevel[r.level],a=r.replaces,n=t.indexOf(a);if(!(n<0||a.invalid)){t[n]=r;for(var i=0;i<r.eles.length;i++){var s=r.eles[i]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[r.level]=r)}e.requestRedraw()}};Qe.requestRedraw=Wa.default(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100);Qe.setupDequeueing=Io.setupDequeueing({deqRedrawThreshold:xc,deqCost:Dc,deqAvgCost:Cc,deqNoDrawCost:Lc,deqFastCost:Sc,deq:function(e,t){return e.dequeue(t)},onDeqd:Yn,shouldRedraw:Os,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var ko={},us;function Ic(r,e){for(var t=0;t<e.length;t++){var a=e[t];r.lineTo(a.x,a.y)}}function Rc(r,e,t){for(var a,n=0;n<e.length;n++){var i=e[n];n===0&&(a=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,a.x,a.y)}function ls(r,e,t){r.beginPath&&r.beginPath();for(var a=e,n=0;n<a.length;n++){var i=a[n];r.lineTo(i.x,i.y)}var s=t,o=t[0];r.moveTo(o.x,o.y);for(var n=1;n<s.length;n++){var i=s[n];r.lineTo(i.x,i.y)}r.closePath&&r.closePath()}function kc(r,e,t,a,n){r.beginPath&&r.beginPath(),r.arc(t,a,n,0,Math.PI*2,!1);var i=e,s=i[0];r.moveTo(s.x,s.y);for(var o=0;o<i.length;o++){var u=i[o];r.lineTo(u.x,u.y)}r.closePath&&r.closePath()}function Pc(r,e,t,a){r.arc(e,t,a,0,Math.PI*2,!1)}ko.arrowShapeImpl=function(r){return(us||(us={polygon:Ic,"triangle-backcurve":Rc,"triangle-tee":ls,"circle-triangle":kc,"triangle-cross":ls,circle:Pc}))[r]};var At={};At.drawElement=function(r,e,t,a,n,i){var s=this;e.isNode()?s.drawNode(r,e,t,a,n,i):s.drawEdge(r,e,t,a,n,i)};At.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)};At.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)};At.drawCachedElementPortion=function(r,e,t,a,n,i,s,o){var u=this,l=t.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=t.getElement(e,l,a,n,i);if(f!=null){var h=o(u,e);if(h===0)return;var c=s(u,e),v=l.x1,d=l.y1,g=l.w,y=l.h,p,E,m,T,D;if(c!==0){var L=t.getRotationPoint(e);m=L.x,T=L.y,r.translate(m,T),r.rotate(c),D=u.getImgSmoothing(r),D||u.setImgSmoothing(r,!0);var b=t.getRotationOffset(e);p=b.x,E=b.y}else p=v,E=d;var x;h!==1&&(x=r.globalAlpha,r.globalAlpha=x*h),r.drawImage(f.texture.canvas,f.x,0,f.width,f.height,p,E,g,y),h!==1&&(r.globalAlpha=x),c!==0&&(r.rotate(-c),r.translate(-m,-T),D||u.setImgSmoothing(r,!1))}else t.drawElement(r,e)}};var Bc=function(){return 0},Fc=function(e,t){return e.getTextAngle(t,null)},Gc=function(e,t){return e.getTextAngle(t,"source")},zc=function(e,t){return e.getTextAngle(t,"target")},Vc=function(e,t){return t.effectiveOpacity()},wn=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};At.drawCachedElement=function(r,e,t,a,n,i){var s=this,o=s.data,u=o.eleTxrCache,l=o.lblTxrCache,f=o.slbTxrCache,h=o.tlbTxrCache,c=e.boundingBox(),v=i===!0?u.reasons.highQuality:null;if(!(c.w===0||c.h===0||!e.visible())&&(!a||Xn(c,a))){var d=e.isEdge(),g=e.element()._private.rscratch.badLine;s.drawElementUnderlay(r,e),s.drawCachedElementPortion(r,e,u,t,n,v,Bc,Vc),(!d||!g)&&s.drawCachedElementPortion(r,e,l,t,n,v,Fc,wn),d&&!g&&(s.drawCachedElementPortion(r,e,f,t,n,v,Gc,wn),s.drawCachedElementPortion(r,e,h,t,n,v,zc,wn)),s.drawElementOverlay(r,e)}};At.drawElements=function(r,e){for(var t=this,a=0;a<e.length;a++){var n=e[a];t.drawElement(r,n)}};At.drawCachedElements=function(r,e,t,a){for(var n=this,i=0;i<e.length;i++){var s=e[i];n.drawCachedElement(r,s,t,a)}};At.drawCachedNodes=function(r,e,t,a){for(var n=this,i=0;i<e.length;i++){var s=e[i];!s.isNode()||n.drawCachedElement(r,s,t,a)}};At.drawLayeredElements=function(r,e,t,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,t);if(i)for(var s=0;s<i.length;s++){var o=i[s],u=o.bb;u.w===0||u.h===0||r.drawImage(o.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(r,e,t,a)};var Pt={};Pt.drawEdge=function(r,e,t){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,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var u;t&&(u=t,r.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,c=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,g=l*f,y=l*f,p=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;h==="straight-triangle"?(s.eleStrokeStyle(r,e,S),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=v,r.lineCap=d,s.eleStrokeStyle(r,e,S),s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},E=function(){!n||s.drawEdgeOverlay(r,e)},m=function(){!n||s.drawEdgeUnderlay(r,e)},T=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;s.drawArrowheads(r,e,S)},D=function(){s.drawElementText(r,e,null,a)};r.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var b=e.pstyle("ghost-offset-x").pfValue,x=e.pstyle("ghost-offset-y").pfValue,w=e.pstyle("ghost-opacity").value,C=g*w;r.translate(b,x),p(C),T(C),r.translate(-b,-x)}m(),p(),T(),E(),D(),t&&r.translate(u.x1,u.y1)}};var Po=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a){if(!!a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,s=i.usePaths(),o=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,f=a.pstyle("".concat(e,"-color")).value;t.lineWidth=l,o.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,f[0],f[1],f[2],n),i.drawEdgePath(a,t,o.allpts,"solid")}}}};Pt.drawEdgeOverlay=Po("overlay");Pt.drawEdgeUnderlay=Po("underlay");Pt.drawEdgePath=function(r,e,t,a){var n=r._private.rscratch,i=e,s,o=!1,u=this.usePaths(),l=r.pstyle("line-dash-pattern").pfValue,f=r.pstyle("line-dash-offset").pfValue;if(u){var h=t.join("$"),c=n.pathCacheKey&&n.pathCacheKey===h;c?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=h,n.pathCache=s)}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(!o&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<t.length;v+=4)e.quadraticCurveTo(t[v],t[v+1],t[v+2],t[v+3]);break;case"straight":case"segments":case"haystack":for(var d=2;d+1<t.length;d+=2)e.lineTo(t[d],t[d+1]);break}e=i,u?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};Pt.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var a=r.pstyle("width").pfValue,n=0;n+1<t.length;n+=2){var i=[t[n+2]-t[n],t[n+3]-t[n+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/s,-i[0]/s],u=[o[0]*a/2,o[1]*a/2];e.beginPath(),e.moveTo(t[n]-u[0],t[n+1]-u[1]),e.lineTo(t[n]+u[0],t[n+1]+u[1]),e.lineTo(t[n+2],t[n+3]),e.closePath(),e.fill()}};Pt.drawArrowheads=function(r,e,t){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(r,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,t),n||this.drawArrowhead(r,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,t)};Pt.drawArrowhead=function(r,e,t,a,n,i,s){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)){var o=this,u=e.pstyle(t+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(t+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(t+"-arrow-fill").value,h=e.pstyle("width").pfValue,c=e.pstyle("opacity").value;s===void 0&&(s=c);var v=r.globalCompositeOperation;(s!==1||f==="hollow")&&(r.globalCompositeOperation="destination-out",o.colorFillStyle(r,255,255,255,1),o.colorStrokeStyle(r,255,255,255,1),o.drawArrowShape(e,r,l,h,u,a,n,i),r.globalCompositeOperation=v);var d=e.pstyle(t+"-arrow-color").value;o.colorFillStyle(r,d[0],d[1],d[2],s),o.colorStrokeStyle(r,d[0],d[1],d[2],s),o.drawArrowShape(e,r,f,h,u,a,n,i)}}};Pt.drawArrowShape=function(r,e,t,a,n,i,s,o){var u=this,l=this.usePaths()&&n!=="triangle-cross",f=!1,h,c=e,v={x:i,y:s},d=r.pstyle("arrow-scale").value,g=this.getArrowWidth(a,d),y=u.arrowShapes[n];if(l){var p=u.arrowPathCache=u.arrowPathCache||[],E=tr(n),m=p[E];m!=null?(h=e=m,f=!0):(h=e=new Path2D,p[E]=h)}f||(e.beginPath&&e.beginPath(),l?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,g,o,v,a),e.closePath&&e.closePath()),e=c,l&&(e.translate(i,s),e.rotate(o),e.scale(g,g)),(t==="filled"||t==="both")&&(l?e.fill(h):e.fill()),(t==="hollow"||t==="both")&&(e.lineWidth=(y.matchEdgeWidth?a:1)/(l?g:1),e.lineJoin="miter",l?e.stroke(h):e.stroke()),l&&(e.scale(1/g,1/g),e.rotate(-o),e.translate(-i,-s))};var ri={};ri.safeDrawImage=function(r,e,t,a,n,i,s,o,u,l){if(!(n<=0||i<=0||u<=0||l<=0))try{r.drawImage(e,t,a,n,i,s,o,u,l)}catch(f){Ae(f)}};ri.drawInscribedImage=function(r,e,t,a,n){var i=this,s=t.position(),o=s.x,u=s.y,l=t.cy().style(),f=l.getIndexedStyle.bind(l),h=f(t,"background-fit","value",a),c=f(t,"background-repeat","value",a),v=t.width(),d=t.height(),g=t.padding()*2,y=v+(f(t,"background-width-relative-to","value",a)==="inner"?0:g),p=d+(f(t,"background-height-relative-to","value",a)==="inner"?0:g),E=t._private.rscratch,m=f(t,"background-clip","value",a),T=m==="node",D=f(t,"background-image-opacity","value",a)*n,L=f(t,"background-image-smoothing","value",a),b=e.width||e.cachedW,x=e.height||e.cachedH;(b==null||x==null)&&(document.body.appendChild(e),b=e.cachedW=e.width||e.offsetWidth,x=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var w=b,C=x;if(f(t,"background-width","value",a)!=="auto"&&(f(t,"background-width","units",a)==="%"?w=f(t,"background-width","pfValue",a)*y:w=f(t,"background-width","pfValue",a)),f(t,"background-height","value",a)!=="auto"&&(f(t,"background-height","units",a)==="%"?C=f(t,"background-height","pfValue",a)*p:C=f(t,"background-height","pfValue",a)),!(w===0||C===0)){if(h==="contain"){var A=Math.min(y/w,p/C);w*=A,C*=A}else if(h==="cover"){var A=Math.max(y/w,p/C);w*=A,C*=A}var S=o-y/2,O=f(t,"background-position-x","units",a),N=f(t,"background-position-x","pfValue",a);O==="%"?S+=(y-w)*N:S+=N;var P=f(t,"background-offset-x","units",a),I=f(t,"background-offset-x","pfValue",a);P==="%"?S+=(y-w)*I:S+=I;var k=u-p/2,R=f(t,"background-position-y","units",a),B=f(t,"background-position-y","pfValue",a);R==="%"?k+=(p-C)*B:k+=B;var z=f(t,"background-offset-y","units",a),F=f(t,"background-offset-y","pfValue",a);z==="%"?k+=(p-C)*F:k+=F,E.pathCache&&(S-=o,k-=u,o=0,u=0);var V=r.globalAlpha;r.globalAlpha=D;var U=i.getImgSmoothing(r),$=!1;if(L==="no"&&U?(i.setImgSmoothing(r,!1),$=!0):L==="yes"&&!U&&(i.setImgSmoothing(r,!0),$=!0),c==="no-repeat")T&&(r.save(),E.pathCache?r.clip(E.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,o,u,y,p),r.clip())),i.safeDrawImage(r,e,0,0,b,x,S,k,w,C),T&&r.restore();else{var X=r.createPattern(e,c);r.fillStyle=X,i.nodeShapes[i.getNodeShape(t)].draw(r,o,u,y,p),r.translate(S,k),r.fill(),r.translate(-S,-k)}r.globalAlpha=V,$&&i.setImgSmoothing(r,U)}};var lr={};lr.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(Hn(t*a));e=Math.pow(2,n)}var i=r.pstyle("font-size").pfValue*e,s=r.pstyle("min-zoomed-font-size").pfValue;return!(i<s)};lr.drawElementText=function(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var u=s.getLabelJustification(e);r.textAlign=u,r.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,f=e.pstyle("label"),h=e.pstyle("source-label"),c=e.pstyle("target-label");if(l||(!f||!f.value)&&(!h||!h.value)&&(!c||!c.value))return;r.textAlign="center",r.textBaseline="bottom"}var v=!t,d;t&&(d=t,r.translate(-d.x1,-d.y1)),n==null?(s.drawText(r,e,null,v,i),e.isEdge()&&(s.drawText(r,e,"source",v,i),s.drawText(r,e,"target",v,i))):s.drawText(r,e,n,v,i),t&&r.translate(d.x1,d.y1)};lr.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if(e=this.fontCaches[t],e.context===r)return e;return e={context:r},this.fontCaches.push(e),e};lr.setupTextStyle=function(r,e){var t=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,s=e.pstyle("font-weight").strValue,o=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*o,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;r.font=a+" "+s+" "+n+" "+i,r.lineJoin="round",this.colorFillStyle(r,l[0],l[1],l[2],o),this.colorStrokeStyle(r,f[0],f[1],f[2],u)};function $c(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5;r.beginPath(),r.moveTo(e+i,t),r.lineTo(e+a-i,t),r.quadraticCurveTo(e+a,t,e+a,t+i),r.lineTo(e+a,t+n-i),r.quadraticCurveTo(e+a,t+n,e+a-i,t+n),r.lineTo(e+i,t+n),r.quadraticCurveTo(e,t+n,e,t+n-i),r.lineTo(e,t+i),r.quadraticCurveTo(e,t,e+i,t),r.closePath(),r.fill()}lr.getTextAngle=function(r,e){var t,a=r._private,n=a.rscratch,i=e?e+"-":"",s=r.pstyle(i+"text-rotation"),o=wt(n,"labelAngle",e);return s.strValue==="autorotate"?t=r.isEdge()?o:0:s.strValue==="none"?t=0:t=s.pfValue,t};lr.drawText=function(r,e,t){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,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var u=wt(s,"labelX",t),l=wt(s,"labelY",t),f,h,c=this.getLabelText(e,t);if(c!=null&&c!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(r,e,n);var v=t?t+"-":"",d=wt(s,"labelWidth",t),g=wt(s,"labelHeight",t),y=e.pstyle(v+"text-margin-x").pfValue,p=e.pstyle(v+"text-margin-y").pfValue,E=e.isEdge(),m=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;E&&(m="center",T="center"),u+=y,l+=p;var D;switch(a?D=this.getTextAngle(e,t):D=0,D!==0&&(f=u,h=l,r.translate(f,h),r.rotate(D),u=0,l=0),T){case"top":break;case"center":l+=g/2;break;case"bottom":l+=g;break}var L=e.pstyle("text-background-opacity").value,b=e.pstyle("text-border-opacity").value,x=e.pstyle("text-border-width").pfValue,w=e.pstyle("text-background-padding").pfValue;if(L>0||x>0&&b>0){var C=u-w;switch(m){case"left":C-=d;break;case"center":C-=d/2;break}var A=l-g-w,S=d+2*w,O=g+2*w;if(L>0){var N=r.fillStyle,P=e.pstyle("text-background-color").value;r.fillStyle="rgba("+P[0]+","+P[1]+","+P[2]+","+L*o+")";var I=e.pstyle("text-background-shape").strValue;I.indexOf("round")===0?$c(r,C,A,S,O,2):r.fillRect(C,A,S,O),r.fillStyle=N}if(x>0&&b>0){var k=r.strokeStyle,R=r.lineWidth,B=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value;if(r.strokeStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+b*o+")",r.lineWidth=x,r.setLineDash)switch(z){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=x/4,r.setLineDash([]);break;case"solid":r.setLineDash([]);break}if(r.strokeRect(C,A,S,O),z==="double"){var F=x/2;r.strokeRect(C+F,A+F,S-F*2,O-F*2)}r.setLineDash&&r.setLineDash([]),r.lineWidth=R,r.strokeStyle=k}}var V=2*e.pstyle("text-outline-width").pfValue;if(V>0&&(r.lineWidth=V),e.pstyle("text-wrap").value==="wrap"){var U=wt(s,"labelWrapCachedLines",t),$=wt(s,"labelLineHeight",t),X=d/2,H=this.getLabelJustification(e);switch(H==="auto"||(m==="left"?H==="left"?u+=-d:H==="center"&&(u+=-X):m==="center"?H==="left"?u+=-X:H==="right"&&(u+=X):m==="right"&&(H==="center"?u+=X:H==="right"&&(u+=d))),T){case"top":l-=(U.length-1)*$;break;case"center":case"bottom":l-=(U.length-1)*$;break}for(var G=0;G<U.length;G++)V>0&&r.strokeText(U[G],u,l),r.fillText(U[G],u,l),l+=$}else V>0&&r.strokeText(c,u,l),r.fillText(c,u,l);D!==0&&(r.rotate(-D),r.translate(-f,-h))}}};var kr={};kr.drawNode=function(r,e,t){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,s=this,o,u,l=e._private,f=l.rscratch,h=e.position();if(!(!ae(h.x)||!ae(h.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,v=s.usePaths(),d,g=!1,y=e.padding();o=e.width()+2*y,u=e.height()+2*y;var p;t&&(p=t,r.translate(-p.x1,-p.y1));for(var E=e.pstyle("background-image"),m=E.value,T=new Array(m.length),D=new Array(m.length),L=0,b=0;b<m.length;b++){var x=m[b],w=T[b]=x!=null&&x!=="none";if(w){var C=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",b);L++,D[b]=s.getCachedImage(x,C,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var A=e.pstyle("background-blacken").value,S=e.pstyle("border-width").pfValue,O=e.pstyle("background-opacity").value*c,N=e.pstyle("border-color").value,P=e.pstyle("border-style").value,I=e.pstyle("border-opacity").value*c;r.lineJoin="miter";var k=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O;s.eleFillStyle(r,e,ne)},R=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;s.colorStrokeStyle(r,N[0],N[1],N[2],ne)},B=e.pstyle("shape").strValue,z=e.pstyle("shape-polygon-points").pfValue;if(v){r.translate(h.x,h.y);var F=s.nodePathCache=s.nodePathCache||[],V=Ms(B==="polygon"?B+","+z.join(","):B,""+u,""+o),U=F[V];U!=null?(d=U,g=!0,f.pathCache=d):(d=new Path2D,F[V]=f.pathCache=d)}var $=function(){if(!g){var ne=h;v&&(ne={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(d||r,ne.x,ne.y,o,u)}v?r.fill(d):r.fill()},X=function(){for(var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Ee=l.backgrounding,ge=0,ve=0;ve<D.length;ve++){var J=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ve);if(ue&&J==="over"||!ue&&J==="inside"){ge++;continue}T[ve]&&D[ve].complete&&!D[ve].error&&(ge++,s.drawInscribedImage(r,D[ve],e,ve,ne))}l.backgrounding=ge!==L,Ee!==l.backgrounding&&e.updateStyle(!1)},H=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasPie(e)&&(s.drawPie(r,e,ue),ne&&(v||s.nodeShapes[s.getNodeShape(e)].draw(r,h.x,h.y,o,u)))},G=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,ue=(A>0?A:-A)*ne,Ee=A>0?0:255;A!==0&&(s.colorFillStyle(r,Ee,Ee,Ee,ue),v?r.fill(d):r.fill())},q=function(){if(S>0){if(r.lineWidth=S,r.lineCap="butt",r.setLineDash)switch(P){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}if(v?r.stroke(d):r.stroke(),P==="double"){r.lineWidth=S/3;var ne=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",v?r.stroke(d):r.stroke(),r.globalCompositeOperation=ne}r.setLineDash&&r.setLineDash([])}},K=function(){n&&s.drawNodeOverlay(r,e,h,o,u)},Z=function(){n&&s.drawNodeUnderlay(r,e,h,o,u)},te=function(){s.drawElementText(r,e,null,a)},he=e.pstyle("ghost").value==="yes";if(he){var de=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue,re=e.pstyle("ghost-opacity").value,fe=re*c;r.translate(de,ee),k(re*O),$(),X(fe,!0),R(re*I),q(),H(A!==0||S!==0),X(fe,!1),G(fe),r.translate(-de,-ee)}v&&r.translate(-h.x,-h.y),Z(),v&&r.translate(h.x,h.y),k(),$(),X(c,!0),R(),q(),H(A!==0||S!==0),X(c,!1),G(),v&&r.translate(-h.x,-h.y),te(),K(),t&&r.translate(p.x1,p.y1)}};var Bo=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a,n,i,s){var o=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;if(l>0){if(n=n||a.position(),i==null||s==null){var c=a.padding();i=a.width()+2*c,s=a.height()+2*c}o.colorFillStyle(t,f[0],f[1],f[2],l),o.nodeShapes[h].draw(t,n.x,n.y,i+u*2,s+u*2),t.fill()}}}};kr.drawNodeOverlay=Bo("overlay");kr.drawNodeUnderlay=Bo("underlay");kr.hasPie=function(r){return r=r[0],r._private.hasPie};kr.drawPie=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=a.x,o=a.y,u=e.width(),l=e.height(),f=Math.min(u,l)/2,h=0,c=this.usePaths();c&&(s=0,o=0),i.units==="%"?f=f*i.pfValue:i.pfValue!==void 0&&(f=i.pfValue/2);for(var v=1;v<=n.pieBackgroundN;v++){var d=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*t,p=d/100;p+h>1&&(p=1-h);var E=1.5*Math.PI+2*Math.PI*h,m=2*Math.PI*p,T=E+m;d===0||h>=1||h+p>1||(r.beginPath(),r.moveTo(s,o),r.arc(s,o,f,E,T),r.closePath(),this.colorFillStyle(r,g[0],g[1],g[2],y),r.fill(),h+=p)}};var ht={},Yc=100;ht.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e};ht.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===r){t=!1;break}return t&&(a={context:r},e.push(a)),a};ht.createGradientStyleFor=function(r,e,t,a,n){var i,s=this.usePaths(),o=t.pstyle(e+"-gradient-stop-colors").value,u=t.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(t.isEdge()){var l=t.sourceEndpoint(),f=t.targetEndpoint(),h=t.midpoint(),c=rr(l,h),v=rr(f,h);i=r.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(c,v))}else{var d=s?{x:0,y:0}:t.position(),g=t.paddedWidth(),y=t.paddedHeight();i=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(g,y))}else if(t.isEdge()){var p=t.sourceEndpoint(),E=t.targetEndpoint();i=r.createLinearGradient(p.x,p.y,E.x,E.y)}else{var m=s?{x:0,y:0}:t.position(),T=t.paddedWidth(),D=t.paddedHeight(),L=T/2,b=D/2,x=t.pstyle("background-gradient-direction").value;switch(x){case"to-bottom":i=r.createLinearGradient(m.x,m.y-b,m.x,m.y+b);break;case"to-top":i=r.createLinearGradient(m.x,m.y+b,m.x,m.y-b);break;case"to-left":i=r.createLinearGradient(m.x+L,m.y,m.x-L,m.y);break;case"to-right":i=r.createLinearGradient(m.x-L,m.y,m.x+L,m.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(m.x-L,m.y-b,m.x+L,m.y+b);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(m.x-L,m.y+b,m.x+L,m.y-b);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(m.x+L,m.y-b,m.x-L,m.y+b);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(m.x+L,m.y+b,m.x-L,m.y-b);break}}if(!i)return null;for(var w=u.length===o.length,C=o.length,A=0;A<C;A++)i.addColorStop(w?u[A]:A/(C-1),"rgba("+o[A][0]+","+o[A][1]+","+o[A][2]+","+n+")");return i};ht.gradientFillStyle=function(r,e,t,a){var n=this.createGradientStyleFor(r,"background",e,t,a);if(!n)return null;r.fillStyle=n};ht.colorFillStyle=function(r,e,t,a,n){r.fillStyle="rgba("+e+","+t+","+a+","+n+")"};ht.eleFillStyle=function(r,e,t){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(r,e,a,t);else{var n=e.pstyle("background-color").value;this.colorFillStyle(r,n[0],n[1],n[2],t)}};ht.gradientStrokeStyle=function(r,e,t,a){var n=this.createGradientStyleFor(r,"line",e,t,a);if(!n)return null;r.strokeStyle=n};ht.colorStrokeStyle=function(r,e,t,a,n){r.strokeStyle="rgba("+e+","+t+","+a+","+n+")"};ht.eleStrokeStyle=function(r,e,t){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(r,e,a,t);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(r,n[0],n[1],n[2],t)}};ht.matchCanvasSize=function(r){var e=this,t=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=o);var u=n*s,l=i*s,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var h=t.canvasContainer;h.style.width=n+"px",h.style.height=i+"px";for(var c=0;c<e.CANVAS_LAYERS;c++)f=t.canvases[c],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";for(var c=0;c<e.BUFFER_COUNT;c++)f=t.bufferCanvases[c],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";e.textureMult=1,s<=1&&(f=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l}};ht.renderTo=function(r,e,t,a){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:a})};ht.render=function(r){r=r||ks();var e=r.forcedContext,t=r.drawAllLayers,a=r.drawOnlyNodeLayer,n=r.forcedZoom,i=r.forcedPan,s=this,o=r.forcedPxRatio===void 0?this.getPixelRatio():r.forcedPxRatio,u=s.cy,l=s.data,f=l.canvasNeedsRedraw,h=s.textureOnViewport&&!e&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),c=r.motionBlur!==void 0?r.motionBlur:s.motionBlur,v=s.motionBlurPxRatio,d=u.hasCompoundNodes(),g=s.hoverData.draggingEles,y=!!(s.hoverData.selecting||s.touchData.selecting);c=c&&!e&&s.motionBlurEnabled&&!y;var p=c;e||(s.prevPxRatio!==o&&(s.invalidateContainerClientCoordsCache(),s.matchCanvasSize(s.container),s.redrawHint("eles",!0),s.redrawHint("drag",!0)),s.prevPxRatio=o),!e&&s.motionBlurTimeout&&clearTimeout(s.motionBlurTimeout),c&&(s.mbFrames==null&&(s.mbFrames=0),s.mbFrames++,s.mbFrames<3&&(p=!1),s.mbFrames>s.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!h&&(f[s.NODE]=!0,f[s.SELECT_BOX]=!0);var E=u.style(),m=u.zoom(),T=n!==void 0?n:m,D=u.pan(),L={x:D.x,y:D.y},b={zoom:m,pan:{x:D.x,y:D.y}},x=s.prevViewport,w=x===void 0||b.zoom!==x.zoom||b.pan.x!==x.pan.x||b.pan.y!==x.pan.y;!w&&!(g&&!d)&&(s.motionBlurPxRatio=1),i&&(L=i),T*=o,L.x*=o,L.y*=o;var C=s.getCachedZSortedEles();function A(ee,re,fe,se,ne){var ue=ee.globalCompositeOperation;ee.globalCompositeOperation="destination-out",s.colorFillStyle(ee,255,255,255,s.motionBlurTransparency),ee.fillRect(re,fe,se,ne),ee.globalCompositeOperation=ue}function S(ee,re){var fe,se,ne,ue;!s.clearingMotionBlur&&(ee===l.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||ee===l.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(fe={x:D.x*v,y:D.y*v},se=m*v,ne=s.canvasWidth*v,ue=s.canvasHeight*v):(fe=L,se=T,ne=s.canvasWidth,ue=s.canvasHeight),ee.setTransform(1,0,0,1,0,0),re==="motionBlur"?A(ee,0,0,ne,ue):!e&&(re===void 0||re)&&ee.clearRect(0,0,ne,ue),t||(ee.translate(fe.x,fe.y),ee.scale(se,se)),i&&ee.translate(i.x,i.y),n&&ee.scale(n,n)}if(h||(s.textureDrawLastFrame=!1),h){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=u.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var O=s.data.bufferContexts[s.TEXTURE_BUFFER];O.setTransform(1,0,0,1,0,0),O.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:O,drawOnlyNodeLayer:!0,forcedPxRatio:o*s.textureMult});var b=s.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:s.canvasWidth,height:s.canvasHeight};b.mpan={x:(0-b.pan.x)/b.zoom,y:(0-b.pan.y)/b.zoom}}f[s.DRAG]=!1,f[s.NODE]=!1;var N=l.contexts[s.NODE],P=s.textureCache.texture,b=s.textureCache.viewport;N.setTransform(1,0,0,1,0,0),c?A(N,0,0,b.width,b.height):N.clearRect(0,0,b.width,b.height);var I=E.core("outside-texture-bg-color").value,k=E.core("outside-texture-bg-opacity").value;s.colorFillStyle(N,I[0],I[1],I[2],k),N.fillRect(0,0,b.width,b.height);var m=u.zoom();S(N,!1),N.clearRect(b.mpan.x,b.mpan.y,b.width/b.zoom/o,b.height/b.zoom/o),N.drawImage(P,b.mpan.x,b.mpan.y,b.width/b.zoom/o,b.height/b.zoom/o)}else s.textureOnViewport&&!e&&(s.textureCache=null);var R=u.extent(),B=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),z=s.hideEdgesOnViewport&&B,F=[];if(F[s.NODE]=!f[s.NODE]&&c&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,F[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),F[s.DRAG]=!f[s.DRAG]&&c&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,F[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),f[s.NODE]||t||a||F[s.NODE]){var V=c&&!F[s.NODE]&&v!==1,N=e||(V?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:l.contexts[s.NODE]),U=c&&!V?"motionBlur":void 0;S(N,U),z?s.drawCachedNodes(N,C.nondrag,o,R):s.drawLayeredElements(N,C.nondrag,o,R),s.debug&&s.drawDebugPoints(N,C.nondrag),!t&&!c&&(f[s.NODE]=!1)}if(!a&&(f[s.DRAG]||t||F[s.DRAG])){var V=c&&!F[s.DRAG]&&v!==1,N=e||(V?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:l.contexts[s.DRAG]);S(N,c&&!V?"motionBlur":void 0),z?s.drawCachedNodes(N,C.drag,o,R):s.drawCachedElements(N,C.drag,o,R),s.debug&&s.drawDebugPoints(N,C.drag),!t&&!c&&(f[s.DRAG]=!1)}if(s.showFps||!a&&f[s.SELECT_BOX]&&!t){var N=e||l.contexts[s.SELECT_BOX];if(S(N),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var m=s.cy.zoom(),$=E.core("selection-box-border-width").value/m;N.lineWidth=$,N.fillStyle="rgba("+E.core("selection-box-color").value[0]+","+E.core("selection-box-color").value[1]+","+E.core("selection-box-color").value[2]+","+E.core("selection-box-opacity").value+")",N.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),$>0&&(N.strokeStyle="rgba("+E.core("selection-box-border-color").value[0]+","+E.core("selection-box-border-color").value[1]+","+E.core("selection-box-border-color").value[2]+","+E.core("selection-box-opacity").value+")",N.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(l.bgActivePosistion&&!s.hoverData.selecting){var m=s.cy.zoom(),X=l.bgActivePosistion;N.fillStyle="rgba("+E.core("active-bg-color").value[0]+","+E.core("active-bg-color").value[1]+","+E.core("active-bg-color").value[2]+","+E.core("active-bg-opacity").value+")",N.beginPath(),N.arc(X.x,X.y,E.core("active-bg-size").pfValue/m,0,2*Math.PI),N.fill()}var H=s.lastRedrawTime;if(s.showFps&&H){H=Math.round(H);var G=Math.round(1e3/H);N.setTransform(1,0,0,1,0,0),N.fillStyle="rgba(255, 0, 0, 0.75)",N.strokeStyle="rgba(255, 0, 0, 0.75)",N.lineWidth=1,N.fillText("1 frame = "+H+" ms = "+G+" fps",0,20);var q=60;N.strokeRect(0,30,250,20),N.fillRect(0,30,250*Math.min(G/q,1),20)}t||(f[s.SELECT_BOX]=!1)}if(c&&v!==1){var K=l.contexts[s.NODE],Z=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],te=l.contexts[s.DRAG],he=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],de=function(re,fe,se){re.setTransform(1,0,0,1,0,0),se||!p?re.clearRect(0,0,s.canvasWidth,s.canvasHeight):A(re,0,0,s.canvasWidth,s.canvasHeight);var ne=v;re.drawImage(fe,0,0,s.canvasWidth*ne,s.canvasHeight*ne,0,0,s.canvasWidth,s.canvasHeight)};(f[s.NODE]||F[s.NODE])&&(de(K,Z,F[s.NODE]),f[s.NODE]=!1),(f[s.DRAG]||F[s.DRAG])&&(de(te,he,F[s.DRAG]),f[s.DRAG]=!1)}s.prevViewport=b,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),c&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!h,s.mbFrames=0,f[s.NODE]=!0,f[s.DRAG]=!0,s.redraw()},Yc)),e||u.emit("render")};var Kt={};Kt.drawPolygonPath=function(r,e,t,a,n,i){var s=a/2,o=n/2;r.beginPath&&r.beginPath(),r.moveTo(e+s*i[0],t+o*i[1]);for(var u=1;u<i.length/2;u++)r.lineTo(e+s*i[u*2],t+o*i[u*2+1]);r.closePath()};Kt.drawRoundPolygonPath=function(r,e,t,a,n,i){var s=a/2,o=n/2,u=qn(a,n);r.beginPath&&r.beginPath();for(var l=0;l<i.length/4;l++){var f=void 0,h=void 0;l===0?f=i.length-2:f=l*4-2,h=l*4+2;var c=e+s*i[l*4],v=t+o*i[l*4+1],d=-i[f]*i[h]-i[f+1]*i[h+1],g=u/Math.tan(Math.acos(d)/2),y=c-g*i[f],p=v-g*i[f+1],E=c+g*i[h],m=v+g*i[h+1];l===0?r.moveTo(y,p):r.lineTo(y,p),r.arcTo(c,v,E,m,u)}r.closePath()};Kt.drawRoundRectanglePath=function(r,e,t,a,n){var i=a/2,s=n/2,o=fa(a,n);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+i,t-s,e+i,t,o),r.arcTo(e+i,t+s,e,t+s,o),r.arcTo(e-i,t+s,e-i,t,o),r.arcTo(e-i,t-s,e,t-s,o),r.lineTo(e,t-s),r.closePath()};Kt.drawBottomRoundRectanglePath=function(r,e,t,a,n){var i=a/2,s=n/2,o=fa(a,n);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+i,t-s),r.lineTo(e+i,t),r.arcTo(e+i,t+s,e,t+s,o),r.arcTo(e-i,t+s,e-i,t,o),r.lineTo(e-i,t-s),r.lineTo(e,t-s),r.closePath()};Kt.drawCutRectanglePath=function(r,e,t,a,n){var i=a/2,s=n/2,o=Ys();r.beginPath&&r.beginPath(),r.moveTo(e-i+o,t-s),r.lineTo(e+i-o,t-s),r.lineTo(e+i,t-s+o),r.lineTo(e+i,t+s-o),r.lineTo(e+i-o,t+s),r.lineTo(e-i+o,t+s),r.lineTo(e-i,t+s-o),r.lineTo(e-i,t-s+o),r.closePath()};Kt.drawBarrelPath=function(r,e,t,a,n){var i=a/2,s=n/2,o=e-i,u=e+i,l=t-s,f=t+s,h=Cn(a,n),c=h.widthOffset,v=h.heightOffset,d=h.ctrlPtOffsetPct*c;r.beginPath&&r.beginPath(),r.moveTo(o,l+v),r.lineTo(o,f-v),r.quadraticCurveTo(o+d,f,o+c,f),r.lineTo(u-c,f),r.quadraticCurveTo(u-d,f,u,f-v),r.lineTo(u,l+v),r.quadraticCurveTo(u-d,l,u-c,l),r.lineTo(o+c,l),r.quadraticCurveTo(o+d,l,o,l+v),r.closePath()};var fs=Math.sin(0),hs=Math.cos(0),Rn={},kn={},Fo=Math.PI/40;for(var yr=0*Math.PI;yr<2*Math.PI;yr+=Fo)Rn[yr]=Math.sin(yr),kn[yr]=Math.cos(yr);Kt.drawEllipsePath=function(r,e,t,a,n){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,a/2,n/2,0,0,2*Math.PI);else for(var i,s,o=a/2,u=n/2,l=0*Math.PI;l<2*Math.PI;l+=Fo)i=e-o*Rn[l]*fs+o*kn[l]*hs,s=t+u*kn[l]*fs+u*Rn[l]*hs,l===0?r.moveTo(i,s):r.lineTo(i,s);r.closePath()};var ga={};ga.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};ga.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),a=t.boundingBox(),n=this.findContainerClientCoords(),i=r.full?Math.ceil(a.w):n[2],s=r.full?Math.ceil(a.h):n[3],o=ae(r.maxWidth)||ae(r.maxHeight),u=this.getPixelRatio(),l=1;if(r.scale!==void 0)i*=r.scale,s*=r.scale,l=r.scale;else if(o){var f=1/0,h=1/0;ae(r.maxWidth)&&(f=l*r.maxWidth/i),ae(r.maxHeight)&&(h=l*r.maxHeight/s),l=Math.min(f,h),i*=l,s*=l}o||(i*=u,s*=u,l*=u);var c=document.createElement("canvas");c.width=i,c.height=s,c.style.width=i+"px",c.style.height=s+"px";var v=c.getContext("2d");if(i>0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(r.full)v.translate(-a.x1*l,-a.y1*l),v.scale(l,l),this.drawElements(v,d),v.scale(1/l,1/l),v.translate(a.x1*l,a.y1*l);else{var g=e.pan(),y={x:g.x*l,y:g.y*l};l*=e.zoom(),v.translate(y.x,y.y),v.scale(l,l),this.drawElements(v,d),v.scale(1/l,1/l),v.translate(-y.x,-y.y)}r.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=r.bg,v.rect(0,0,i,s),v.fill())}return c};function Uc(r,e){for(var t=atob(r),a=new ArrayBuffer(t.length),n=new Uint8Array(a),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return new Blob([a],{type:e})}function vs(r){var e=r.indexOf(",");return r.substr(e+1)}function Go(r,e,t){var a=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new Nr(function(n,i){try{e.toBlob(function(s){s!=null?n(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(s){i(s)}});case"blob":return Uc(vs(a()),t);case"base64":return vs(a());case"base64uri":default:return a()}}ga.png=function(r){return Go(r,this.bufferCanvasImage(r),"image/png")};ga.jpg=function(r){return Go(r,this.bufferCanvasImage(r),"image/jpeg")};var zo={};zo.nodeShapeImpl=function(r,e,t,a,n,i,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,a,n,i);case"polygon":return this.drawPolygonPath(e,t,a,n,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,t,a,n,i,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,a,n,i);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,a,n,i);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,a,n,i);case"barrel":return this.drawBarrelPath(e,t,a,n,i)}};var Hc=Vo,De=Vo.prototype;De.CANVAS_LAYERS=3;De.SELECT_BOX=0;De.DRAG=1;De.NODE=2;De.BUFFER_COUNT=3;De.TEXTURE_BUFFER=0;De.MOTIONBLUR_BUFFER_NODE=1;De.MOTIONBLUR_BUFFER_DRAG=2;function Vo(r){var e=this;e.data={canvases:new Array(De.CANVAS_LAYERS),contexts:new Array(De.CANVAS_LAYERS),canvasNeedsRedraw:new Array(De.CANVAS_LAYERS),bufferCanvases:new Array(De.BUFFER_COUNT),bufferContexts:new Array(De.CANVAS_LAYERS)};var t="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";e.data.canvasContainer=document.createElement("div");var n=e.data.canvasContainer.style;e.data.canvasContainer.style[t]=a,n.position="relative",n.zIndex="0",n.overflow="hidden";var i=r.cy.container();i.appendChild(e.data.canvasContainer),i.style[t]=a;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Cl()&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var o=0;o<De.CANVAS_LAYERS;o++){var u=e.data.canvases[o]=document.createElement("canvas");e.data.contexts[o]=u.getContext("2d"),Object.keys(s).forEach(function(H){u.style[H]=s[H]}),u.style.position="absolute",u.setAttribute("data-id","layer"+o),u.style.zIndex=String(De.CANVAS_LAYERS-o),e.data.canvasContainer.appendChild(u),e.data.canvasNeedsRedraw[o]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[De.NODE].setAttribute("data-id","layer"+De.NODE+"-node"),e.data.canvases[De.SELECT_BOX].setAttribute("data-id","layer"+De.SELECT_BOX+"-selectbox"),e.data.canvases[De.DRAG].setAttribute("data-id","layer"+De.DRAG+"-drag");for(var o=0;o<De.BUFFER_COUNT;o++)e.data.bufferCanvases[o]=document.createElement("canvas"),e.data.bufferContexts[o]=e.data.bufferCanvases[o].getContext("2d"),e.data.bufferCanvases[o].style.position="absolute",e.data.bufferCanvases[o].setAttribute("data-id","buffer"+o),e.data.bufferCanvases[o].style.zIndex=String(-o-1),e.data.bufferCanvases[o].style.visibility="hidden";e.pathsEnabled=!0;var l=lt(),f=function(G){return{x:(G.x1+G.x2)/2,y:(G.y1+G.y2)/2}},h=function(G){return{x:-G.w/2,y:-G.h/2}},c=function(G){var q=G[0]._private,K=q.oldBackgroundTimestamp===q.backgroundTimestamp;return!K},v=function(G){return G[0]._private.nodeKey},d=function(G){return G[0]._private.labelStyleKey},g=function(G){return G[0]._private.sourceLabelStyleKey},y=function(G){return G[0]._private.targetLabelStyleKey},p=function(G,q,K,Z,te){return e.drawElement(G,q,K,!1,!1,te)},E=function(G,q,K,Z,te){return e.drawElementText(G,q,K,Z,"main",te)},m=function(G,q,K,Z,te){return e.drawElementText(G,q,K,Z,"source",te)},T=function(G,q,K,Z,te){return e.drawElementText(G,q,K,Z,"target",te)},D=function(G){return G.boundingBox(),G[0]._private.bodyBounds},L=function(G){return G.boundingBox(),G[0]._private.labelBounds.main||l},b=function(G){return G.boundingBox(),G[0]._private.labelBounds.source||l},x=function(G){return G.boundingBox(),G[0]._private.labelBounds.target||l},w=function(G,q){return q},C=function(G){return f(D(G))},A=function(G,q,K){var Z=G?G+"-":"";return{x:q.x+K.pstyle(Z+"text-margin-x").pfValue,y:q.y+K.pstyle(Z+"text-margin-y").pfValue}},S=function(G,q,K){var Z=G[0]._private.rscratch;return{x:Z[q],y:Z[K]}},O=function(G){return A("",S(G,"labelX","labelY"),G)},N=function(G){return A("source",S(G,"sourceLabelX","sourceLabelY"),G)},P=function(G){return A("target",S(G,"targetLabelX","targetLabelY"),G)},I=function(G){return h(D(G))},k=function(G){return h(b(G))},R=function(G){return h(x(G))},B=function(G){var q=L(G),K=h(L(G));if(G.isNode()){switch(G.pstyle("text-halign").value){case"left":K.x=-q.w;break;case"right":K.x=0;break}switch(G.pstyle("text-valign").value){case"top":K.y=-q.h;break;case"bottom":K.y=0;break}}return K},z=e.data.eleTxrCache=new Hr(e,{getKey:v,doesEleInvalidateKey:c,drawElement:p,getBoundingBox:D,getRotationPoint:C,getRotationOffset:I,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),F=e.data.lblTxrCache=new Hr(e,{getKey:d,drawElement:E,getBoundingBox:L,getRotationPoint:O,getRotationOffset:B,isVisible:w}),V=e.data.slbTxrCache=new Hr(e,{getKey:g,drawElement:m,getBoundingBox:b,getRotationPoint:N,getRotationOffset:k,isVisible:w}),U=e.data.tlbTxrCache=new Hr(e,{getKey:y,drawElement:T,getBoundingBox:x,getRotationPoint:P,getRotationOffset:R,isVisible:w}),$=e.data.lyrTxrCache=new Ro(e);e.onUpdateEleCalcs(function(G,q){z.invalidateElements(q),F.invalidateElements(q),V.invalidateElements(q),U.invalidateElements(q),$.invalidateElements(q);for(var K=0;K<q.length;K++){var Z=q[K]._private;Z.oldBackgroundTimestamp=Z.backgroundTimestamp}});var X=function(G){for(var q=0;q<G.length;q++)$.enqueueElementRefinement(G[q].ele)};z.onDequeue(X),F.onDequeue(X),V.onDequeue(X),U.onDequeue(X)}De.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[De.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[De.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[De.SELECT_BOX]=e;break}};var Xc=typeof Path2D<"u";De.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};De.usePaths=function(){return Xc&&this.pathsEnabled};De.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};De.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};De.makeOffscreenCanvas=function(r,e){var t;return(typeof OffscreenCanvas>"u"?"undefined":Ye(OffscreenCanvas))!=="undefined"?t=new OffscreenCanvas(r,e):(t=document.createElement("canvas"),t.width=r,t.height=e),t};[ko,At,Pt,ri,lr,kr,ht,Kt,ga,zo].forEach(function(r){ce(De,r)});var qc=[{name:"null",impl:Do},{name:"base",impl:Oo},{name:"canvas",impl:Hc}],Wc=[{type:"layout",extensions:ec},{type:"renderer",extensions:qc}],$o={},Yo={};function Uo(r,e,t){var a=t,n=function(x){Ae("Can not register `"+e+"` for `"+r+"` since `"+x+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(na.prototype[e])return n(e);na.prototype[e]=t}else if(r==="collection"){if(Ke.prototype[e])return n(e);Ke.prototype[e]=t}else if(r==="layout"){for(var i=function(x){this.options=x,t.call(this,x),Te(this._private)||(this._private={}),this._private.cy=x.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(t.prototype),o=[],u=0;u<o.length;u++){var l=o[u];s[l]=s[l]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var f=t.prototype.stop;s.stop=function(){var b=this.options;if(b&&b.animate){var x=this.animations;if(x)for(var w=0;w<x.length;w++)x[w].stop()}return f?f.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var h=function(x){return x._private.cy},c={addEventFields:function(x,w){w.layout=x,w.cy=h(x),w.target=x},bubble:function(){return!0},parent:function(x){return h(x)}};ce(s,{createEmitter:function(){return this._private.emitter=new ja(c,this),this},emitter:function(){return this._private.emitter},on:function(x,w){return this.emitter().on(x,w),this},one:function(x,w){return this.emitter().one(x,w),this},once:function(x,w){return this.emitter().one(x,w),this},removeListener:function(x,w){return this.emitter().removeListener(x,w),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(x,w){return this.emitter().emit(x,w),this}}),Se.eventAliasesOn(s),a=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var v=Ho("renderer","base"),d=v.prototype,g=t,y=t.prototype,p=function(){v.apply(this,arguments),g.apply(this,arguments)},E=p.prototype;for(var m in d){var T=d[m],D=y[m]!=null;if(D)return n(m);E[m]=T}for(var L in y)E[L]=y[L];d.clientFunctions.forEach(function(b){E[b]=E[b]||function(){ze("Renderer does not implement `renderer."+b+"()` on its prototype")}}),a=p}else if(r==="__proto__"||r==="constructor"||r==="prototype")return ze(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return Cs({map:$o,keys:[r,e],value:a})}function Ho(r,e){return Ls({map:$o,keys:[r,e]})}function _c(r,e,t,a,n){return Cs({map:Yo,keys:[r,e,t,a],value:n})}function Kc(r,e,t,a){return Ls({map:Yo,keys:[r,e,t,a]})}var Pn=function(){if(arguments.length===2)return Ho.apply(null,arguments);if(arguments.length===3)return Uo.apply(null,arguments);if(arguments.length===4)return Kc.apply(null,arguments);if(arguments.length===5)return _c.apply(null,arguments);ze("Invalid extension access syntax")};na.prototype.extension=Pn;Wc.forEach(function(r){r.extensions.forEach(function(e){Uo(r.type,e.name,e.impl)})});var Xo=function r(){if(!(this instanceof r))return new r;this.length=0},ir=Xo.prototype;ir.instanceString=function(){return"stylesheet"};ir.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};ir.css=function(r,e){var t=this.length-1;if(le(r))this[t].properties.push({name:r,value:e});else if(Te(r))for(var a=r,n=Object.keys(a),i=0;i<n.length;i++){var s=n[i],o=a[s];if(o!=null){var u=je.properties[s]||je.properties[_a(s)];if(u!=null){var l=u.name,f=o;this[t].properties.push({name:l,value:f})}}}return this};ir.style=ir.css;ir.generateStyle=function(r){var e=new je(r);return this.appendToStyle(e)};ir.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],a=t.selector,n=t.properties;r.selector(a);for(var i=0;i<n.length;i++){var s=n[i];r.css(s.name,s.value)}}return r};var Zc="3.23.0",sr=function(e){if(e===void 0&&(e={}),Te(e))return new na(e);if(le(e))return Pn.apply(Pn,arguments)};sr.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(sr),r.apply(null,e),this};sr.warnings=function(r){return Is(r)};sr.version=Zc;sr.stylesheet=sr.Stylesheet=Xo;var qo=sr,Wo={exports:{}},xn={exports:{}},Tn={exports:{}},cs;function Qc(){return cs||(cs=1,function(r,e){(function(a,n){r.exports=n()})(qa,function(){return function(t){var a={};function n(i){if(a[i])return a[i].exports;var s=a[i]={i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=a,n.i=function(i){return i},n.d=function(i,s,o){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:o})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="",n(n.s=26)}([function(t,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,t.exports=i},function(t,a,n){var i=n(2),s=n(8),o=n(9);function u(f,h,c){i.call(this,c),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=c,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 c=this.getOtherEnd(f),v=h.getGraphManager().getRoot();;){if(c.getOwner()==h)return c;if(c.getOwner()==v)break;c=c.getOwner().getParent()}return null},u.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=s.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=u},function(t,a,n){function i(s){this.vGraphObject=s}t.exports=i},function(t,a,n){var i=n(2),s=n(10),o=n(13),u=n(0),l=n(16),f=n(4);function h(v,d,g,y){g==null&&y==null&&(y=d),i.call(this,y),v.graphManager!=null&&(v=v.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=v,g!=null&&d!=null?this.rect=new o(d.x,d.y,g.width,g.height):this.rect=new o}h.prototype=Object.create(i.prototype);for(var c in i)h[c]=i[c];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(v){this.rect.width=v},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(v){this.rect.height=v},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(v,d){this.rect.x=v.x,this.rect.y=v.y,this.rect.width=d.width,this.rect.height=d.height},h.prototype.setCenter=function(v,d){this.rect.x=v-this.rect.width/2,this.rect.y=d-this.rect.height/2},h.prototype.setLocation=function(v,d){this.rect.x=v,this.rect.y=d},h.prototype.moveBy=function(v,d){this.rect.x+=v,this.rect.y+=d},h.prototype.getEdgeListToNode=function(v){var d=[],g=this;return g.edges.forEach(function(y){if(y.target==v){if(y.source!=g)throw"Incorrect edge source!";d.push(y)}}),d},h.prototype.getEdgesBetween=function(v){var d=[],g=this;return g.edges.forEach(function(y){if(!(y.source==g||y.target==g))throw"Incorrect edge source and/or target";(y.target==v||y.source==v)&&d.push(y)}),d},h.prototype.getNeighborsList=function(){var v=new Set,d=this;return d.edges.forEach(function(g){if(g.source==d)v.add(g.target);else{if(g.target!=d)throw"Incorrect incidency!";v.add(g.source)}}),v},h.prototype.withChildren=function(){var v=new Set,d,g;if(v.add(this),this.child!=null)for(var y=this.child.getNodes(),p=0;p<y.length;p++)d=y[p],g=d.withChildren(),g.forEach(function(E){v.add(E)});return v},h.prototype.getNoOfChildren=function(){var v=0,d;if(this.child==null)v=1;else for(var g=this.child.getNodes(),y=0;y<g.length;y++)d=g[y],v+=d.getNoOfChildren();return v==0&&(v=1),v},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.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 v,d,g=-u.INITIAL_WORLD_BOUNDARY,y=u.INITIAL_WORLD_BOUNDARY;v=u.WORLD_CENTER_X+l.nextDouble()*(y-g)+g;var p=-u.INITIAL_WORLD_BOUNDARY,E=u.INITIAL_WORLD_BOUNDARY;d=u.WORLD_CENTER_Y+l.nextDouble()*(E-p)+p,this.rect.x=v,this.rect.y=d},h.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var v=this.getChild();if(v.updateBounds(!0),this.rect.x=v.getLeft(),this.rect.y=v.getTop(),this.setWidth(v.getRight()-v.getLeft()),this.setHeight(v.getBottom()-v.getTop()),u.NODE_DIMENSIONS_INCLUDE_LABELS){var d=v.getRight()-v.getLeft(),g=v.getBottom()-v.getTop();this.labelWidth>d&&(this.rect.x-=(this.labelWidth-d)/2,this.setWidth(this.labelWidth)),this.labelHeight>g&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-g)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-g),this.setHeight(this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(v){var d=this.rect.x;d>u.WORLD_BOUNDARY?d=u.WORLD_BOUNDARY:d<-u.WORLD_BOUNDARY&&(d=-u.WORLD_BOUNDARY);var g=this.rect.y;g>u.WORLD_BOUNDARY?g=u.WORLD_BOUNDARY:g<-u.WORLD_BOUNDARY&&(g=-u.WORLD_BOUNDARY);var y=new f(d,g),p=v.inverseTransformPoint(y);this.setLocation(p.x,p.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()},t.exports=h},function(t,a,n){function i(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(s){this.x=s},i.prototype.setY=function(s){this.y=s},i.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},t.exports=i},function(t,a,n){var i=n(2),s=n(10),o=n(0),u=n(6),l=n(3),f=n(1),h=n(13),c=n(12),v=n(11);function d(y,p,E){i.call(this,E),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,p!=null&&p instanceof u?this.graphManager=p:p!=null&&p instanceof Layout&&(this.graphManager=p.graphManager)}d.prototype=Object.create(i.prototype);for(var g in i)d[g]=i[g];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,p,E){if(p==null&&E==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 T=y;if(!(this.getNodes().indexOf(p)>-1&&this.getNodes().indexOf(E)>-1))throw"Source or target not in graph!";if(!(p.owner==E.owner&&p.owner==this))throw"Both owners must be this graph!";return p.owner!=E.owner?null:(T.source=p,T.target=E,T.isInterGraph=!1,this.getEdges().push(T),p.edges.push(T),E!=p&&E.edges.push(T),T)}},d.prototype.remove=function(y){var p=y;if(y instanceof l){if(p==null)throw"Node is null!";if(!(p.owner!=null&&p.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var E=p.edges.slice(),m,T=E.length,D=0;D<T;D++)m=E[D],m.isInterGraph?this.graphManager.remove(m):m.source.owner.remove(m);var L=this.nodes.indexOf(p);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,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 b=m.source.edges.indexOf(m),x=m.target.edges.indexOf(m);if(!(b>-1&&x>-1))throw"Source and/or target doesn't know this edge!";m.source.edges.splice(b,1),m.target!=m.source&&m.target.edges.splice(x,1);var L=m.source.owner.getEdges().indexOf(m);if(L==-1)throw"Not in owner's edge list!";m.source.owner.getEdges().splice(L,1)}},d.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,p=s.MAX_VALUE,E,m,T,D=this.getNodes(),L=D.length,b=0;b<L;b++){var x=D[b];E=x.getTop(),m=x.getLeft(),y>E&&(y=E),p>m&&(p=m)}return y==s.MAX_VALUE?null:(D[0].getParent().paddingLeft!=null?T=D[0].getParent().paddingLeft:T=this.margin,this.left=p-T,this.top=y-T,new c(this.left,this.top))},d.prototype.updateBounds=function(y){for(var p=s.MAX_VALUE,E=-s.MAX_VALUE,m=s.MAX_VALUE,T=-s.MAX_VALUE,D,L,b,x,w,C=this.nodes,A=C.length,S=0;S<A;S++){var O=C[S];y&&O.child!=null&&O.updateBounds(),D=O.getLeft(),L=O.getRight(),b=O.getTop(),x=O.getBottom(),p>D&&(p=D),E<L&&(E=L),m>b&&(m=b),T<x&&(T=x)}var N=new h(p,m,E-p,T-m);p==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=N.x-w,this.right=N.x+N.width+w,this.top=N.y-w,this.bottom=N.y+N.height+w},d.calculateBounds=function(y){for(var p=s.MAX_VALUE,E=-s.MAX_VALUE,m=s.MAX_VALUE,T=-s.MAX_VALUE,D,L,b,x,w=y.length,C=0;C<w;C++){var A=y[C];D=A.getLeft(),L=A.getRight(),b=A.getTop(),x=A.getBottom(),p>D&&(p=D),E<L&&(E=L),m>b&&(m=b),T<x&&(T=x)}var S=new h(p,m,E-p,T-m);return S},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var y=0,p=this.nodes,E=p.length,m=0;m<E;m++){var T=p[m];y+=T.calcEstimatedSize()}return y==0?this.estimatedSize=o.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 p=new v,E=new Set,m=this.nodes[0],T,D,L=m.withChildren();for(L.forEach(function(S){p.push(S),E.add(S)});p.length!==0;){m=p.shift(),T=m.getEdges();for(var b=T.length,x=0;x<b;x++){var w=T[x];if(D=w.getOtherEndInGraph(m,this),D!=null&&!E.has(D)){var C=D.withChildren();C.forEach(function(S){p.push(S),E.add(S)})}}}if(this.isConnected=!1,E.size>=this.nodes.length){var A=0;E.forEach(function(S){S.owner==y&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},t.exports=d},function(t,a,n){var i,s=n(1);function o(u){i=n(5),this.layout=u,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var u=this.layout.newGraph(),l=this.layout.newNode(null),f=this.add(u,l);return this.setRootGraph(f),this.rootGraph},o.prototype.add=function(u,l,f,h,c){if(f==null&&h==null&&c==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{c=f,h=l,f=u;var v=h.getOwner(),d=c.getOwner();if(!(v!=null&&v.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(d!=null&&d.getGraphManager()==this))throw"Target not in this graph mgr!";if(v==d)return f.isInterGraph=!1,v.add(f,h,c);if(f.isInterGraph=!0,f.source=h,f.target=c,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}},o.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,c=f.length,v=0;v<c;v++)h=f[v],l.remove(h);var d=[];d=d.concat(l.getNodes());var g;c=d.length;for(var v=0;v<c;v++)g=d[v],l.remove(g);l==this.rootGraph&&this.setRootGraph(null);var y=this.graphs.indexOf(l);this.graphs.splice(y,1),l.parent=null}else if(u instanceof s){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)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.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},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.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},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(u){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=u},o.prototype.getRoot=function(){return this.rootGraph},o.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"))},o.prototype.getLayout=function(){return this.layout},o.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},o.prototype.calcLowestCommonAncestors=function(){for(var u,l,f,h,c,v=this.getAllEdges(),d=v.length,g=0;g<d;g++){if(u=v[g],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,c=f.getOwner();u.lca==null;){if(c==h){u.lca=c;break}if(c==this.rootGraph)break;if(u.lca!=null)throw"assert failed";u.targetInLca=c.getParent(),c=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"}},o.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},o.prototype.calcInclusionTreeDepths=function(u,l){u==null&&l==null&&(u=this.rootGraph,l=1);for(var f,h=u.getNodes(),c=h.length,v=0;v<c;v++)f=h[v],f.inclusionTreeDepth=l,f.child!=null&&this.calcInclusionTreeDepths(f.child,l+1)},o.prototype.includesInvalidEdge=function(){for(var u,l=this.edges.length,f=0;f<l;f++)if(u=this.edges[f],this.isOneAncestorOfOther(u.source,u.target))return!0;return!1},t.exports=o},function(t,a,n){var i=n(0);function s(){}for(var o in i)s[o]=i[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=s},function(t,a,n){var i=n(12);function s(){}s.calcSeparationAmount=function(o,u,l,f){if(!o.intersects(u))throw"assert failed";var h=new Array(2);this.decideDirectionsForOverlappingNodes(o,u,h),l[0]=Math.min(o.getRight(),u.getRight())-Math.max(o.x,u.x),l[1]=Math.min(o.getBottom(),u.getBottom())-Math.max(o.y,u.y),o.getX()<=u.getX()&&o.getRight()>=u.getRight()?l[0]+=Math.min(u.getX()-o.getX(),o.getRight()-u.getRight()):u.getX()<=o.getX()&&u.getRight()>=o.getRight()&&(l[0]+=Math.min(o.getX()-u.getX(),u.getRight()-o.getRight())),o.getY()<=u.getY()&&o.getBottom()>=u.getBottom()?l[1]+=Math.min(u.getY()-o.getY(),o.getBottom()-u.getBottom()):u.getY()<=o.getY()&&u.getBottom()>=o.getBottom()&&(l[1]+=Math.min(o.getY()-u.getY(),u.getBottom()-o.getBottom()));var c=Math.abs((u.getCenterY()-o.getCenterY())/(u.getCenterX()-o.getCenterX()));u.getCenterY()===o.getCenterY()&&u.getCenterX()===o.getCenterX()&&(c=1);var v=c*l[0],d=l[1]/c;l[0]<d?d=l[0]:v=l[1],l[0]=-1*h[0]*(d/2+f),l[1]=-1*h[1]*(v/2+f)},s.decideDirectionsForOverlappingNodes=function(o,u,l){o.getCenterX()<u.getCenterX()?l[0]=-1:l[0]=1,o.getCenterY()<u.getCenterY()?l[1]=-1:l[1]=1},s.getIntersection2=function(o,u,l){var f=o.getCenterX(),h=o.getCenterY(),c=u.getCenterX(),v=u.getCenterY();if(o.intersects(u))return l[0]=f,l[1]=h,l[2]=c,l[3]=v,!0;var d=o.getX(),g=o.getY(),y=o.getRight(),p=o.getX(),E=o.getBottom(),m=o.getRight(),T=o.getWidthHalf(),D=o.getHeightHalf(),L=u.getX(),b=u.getY(),x=u.getRight(),w=u.getX(),C=u.getBottom(),A=u.getRight(),S=u.getWidthHalf(),O=u.getHeightHalf(),N=!1,P=!1;if(f===c){if(h>v)return l[0]=f,l[1]=g,l[2]=c,l[3]=C,!1;if(h<v)return l[0]=f,l[1]=E,l[2]=c,l[3]=b,!1}else if(h===v){if(f>c)return l[0]=d,l[1]=h,l[2]=x,l[3]=v,!1;if(f<c)return l[0]=y,l[1]=h,l[2]=L,l[3]=v,!1}else{var I=o.height/o.width,k=u.height/u.width,R=(v-h)/(c-f),B=void 0,z=void 0,F=void 0,V=void 0,U=void 0,$=void 0;if(-I===R?f>c?(l[0]=p,l[1]=E,N=!0):(l[0]=y,l[1]=g,N=!0):I===R&&(f>c?(l[0]=d,l[1]=g,N=!0):(l[0]=m,l[1]=E,N=!0)),-k===R?c>f?(l[2]=w,l[3]=C,P=!0):(l[2]=x,l[3]=b,P=!0):k===R&&(c>f?(l[2]=L,l[3]=b,P=!0):(l[2]=A,l[3]=C,P=!0)),N&&P)return!1;if(f>c?h>v?(B=this.getCardinalDirection(I,R,4),z=this.getCardinalDirection(k,R,2)):(B=this.getCardinalDirection(-I,R,3),z=this.getCardinalDirection(-k,R,1)):h>v?(B=this.getCardinalDirection(-I,R,1),z=this.getCardinalDirection(-k,R,3)):(B=this.getCardinalDirection(I,R,2),z=this.getCardinalDirection(k,R,4)),!N)switch(B){case 1:V=g,F=f+-D/R,l[0]=F,l[1]=V;break;case 2:F=m,V=h+T*R,l[0]=F,l[1]=V;break;case 3:V=E,F=f+D/R,l[0]=F,l[1]=V;break;case 4:F=p,V=h+-T*R,l[0]=F,l[1]=V;break}if(!P)switch(z){case 1:$=b,U=c+-O/R,l[2]=U,l[3]=$;break;case 2:U=A,$=v+S*R,l[2]=U,l[3]=$;break;case 3:$=C,U=c+O/R,l[2]=U,l[3]=$;break;case 4:U=w,$=v+-S*R,l[2]=U,l[3]=$;break}}return!1},s.getCardinalDirection=function(o,u,l){return o>u?l:1+l%4},s.getIntersection=function(o,u,l,f){if(f==null)return this.getIntersection2(o,u,l);var h=o.x,c=o.y,v=u.x,d=u.y,g=l.x,y=l.y,p=f.x,E=f.y,m=void 0,T=void 0,D=void 0,L=void 0,b=void 0,x=void 0,w=void 0,C=void 0,A=void 0;return D=d-c,b=h-v,w=v*c-h*d,L=E-y,x=g-p,C=p*y-g*E,A=D*x-L*b,A===0?null:(m=(b*C-x*w)/A,T=(L*w-D*C)/A,new i(m,T))},s.angleOfVector=function(o,u,l,f){var h=void 0;return o!==l?(h=Math.atan((f-u)/(l-o)),l<o?h+=Math.PI:f<u&&(h+=this.TWO_PI)):f<u?h=this.ONE_AND_HALF_PI:h=this.HALF_PI,h},s.doIntersect=function(o,u,l,f){var h=o.x,c=o.y,v=u.x,d=u.y,g=l.x,y=l.y,p=f.x,E=f.y,m=(v-h)*(E-y)-(p-g)*(d-c);if(m===0)return!1;var T=((E-y)*(p-h)+(g-p)*(E-c))/m,D=((c-d)*(p-h)+(v-h)*(E-c))/m;return 0<T&&T<1&&0<D&&D<1},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,t.exports=s},function(t,a,n){function i(){}i.sign=function(s){return s>0?1:s<0?-1:0},i.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},i.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},t.exports=i},function(t,a,n){function i(){}i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,t.exports=i},function(t,a,n){var i=function(){function h(c,v){for(var d=0;d<v.length;d++){var g=v[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,v,d){return v&&h(c.prototype,v),d&&h(c,d),c}}();function s(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}var o=function(c){return{value:c,next:null,prev:null}},u=function(c,v,d,g){return c!==null?c.next=v:g.head=v,d!==null?d.prev=v:g.tail=v,v.prev=c,v.next=d,g.length++,v},l=function(c,v){var d=c.prev,g=c.next;return d!==null?d.next=g:v.head=g,g!==null?g.prev=d:v.tail=d,c.prev=c.next=null,v.length--,c},f=function(){function h(c){var v=this;s(this,h),this.length=0,this.head=null,this.tail=null,c!=null&&c.forEach(function(d){return v.push(d)})}return i(h,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(v,d){return u(d.prev,o(v),d,this)}},{key:"insertAfter",value:function(v,d){return u(d,o(v),d.next,this)}},{key:"insertNodeBefore",value:function(v,d){return u(d.prev,v,d,this)}},{key:"insertNodeAfter",value:function(v,d){return u(d,v,d.next,this)}},{key:"push",value:function(v){return u(this.tail,o(v),null,this)}},{key:"unshift",value:function(v){return u(null,o(v),this.head,this)}},{key:"remove",value:function(v){return l(v,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(v){if(v<=this.length()){for(var d=1,g=this.head;d<v;)g=g.next,d++;return g.value}}},{key:"set_object_at",value:function(v,d){if(v<=this.length()){for(var g=1,y=this.head;g<v;)y=y.next,g++;y.value=d}}}]),h}();t.exports=f},function(t,a,n){function i(s,o,u){this.x=null,this.y=null,s==null&&o==null&&u==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&u==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&u==null&&(u=s,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(s,o,u){s.constructor.name=="Point"&&o==null&&u==null?(u=s,this.setLocation(u.x,u.y)):typeof s=="number"&&typeof o=="number"&&u==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},i.prototype.move=function(s,o){this.x=s,this.y=o},i.prototype.translate=function(s,o){this.x+=s,this.y+=o},i.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=i},function(t,a,n){function i(s,o,u,l){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&u!=null&&l!=null&&(this.x=s,this.y=o,this.width=u,this.height=l)}i.prototype.getX=function(){return this.x},i.prototype.setX=function(s){this.x=s},i.prototype.getY=function(){return this.y},i.prototype.setY=function(s){this.y=s},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(s){this.width=s},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(s){this.height=s},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.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},t.exports=i},function(t,a,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var u=typeof o>"u"?"undefined":i(o);return o==null||u!="object"&&u!="function"},t.exports=s},function(t,a,n){function i(g){if(Array.isArray(g)){for(var y=0,p=Array(g.length);y<g.length;y++)p[y]=g[y];return p}else return Array.from(g)}var s=n(0),o=n(6),u=n(3),l=n(1),f=n(5),h=n(4),c=n(17),v=n(27);function d(g){v.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null&&(this.isRemoteUse=g)}d.RANDOM_SEED=1,d.prototype=Object.create(v.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 g=new o(this);return this.graphManager=g,g},d.prototype.newGraph=function(g){return new f(null,this.graphManager,g)},d.prototype.newNode=function(g){return new u(this.graphManager,g)},d.prototype.newEdge=function(g){return new l(null,null,g)},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 g;return this.checkLayoutSuccess()?g=!1:g=this.layout(),s.ANIMATE==="during"?!1:(g&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,g)},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 g=this.graphManager.getAllEdges(),y=0;y<g.length;y++)g[y];for(var p=this.graphManager.getRoot().getNodes(),y=0;y<p.length;y++)p[y];this.update(this.graphManager.getRoot())}},d.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof u){var y=g;if(y.getChild()!=null)for(var p=y.getChild().getNodes(),E=0;E<p.length;E++)update(p[E]);if(y.vGraphObject!=null){var m=y.vGraphObject;m.update(y)}}else if(g instanceof l){var T=g;if(T.vGraphObject!=null){var D=T.vGraphObject;D.update(T)}}else if(g instanceof f){var L=g;if(L.vGraphObject!=null){var b=L.vGraphObject;b.update(L)}}},d.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},d.prototype.transform=function(g){if(g==null)this.transform(new h(0,0));else{var y=new c,p=this.graphManager.getRoot().updateLeftTop();if(p!=null){y.setWorldOrgX(g.x),y.setWorldOrgY(g.y),y.setDeviceOrgX(p.x),y.setDeviceOrgY(p.y);for(var E=this.getAllNodes(),m,T=0;T<E.length;T++)m=E[T],m.transform(y)}}},d.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var y,p,E=g.getNodes(),m=0;m<E.length;m++)y=E[m],p=y.getChild(),p==null||p.getNodes().length==0?y.scatter():(this.positionNodesRandomly(p),y.updateBounds())},d.prototype.getFlatForest=function(){for(var g=[],y=!0,p=this.graphManager.getRoot().getNodes(),E=!0,m=0;m<p.length;m++)p[m].getChild()!=null&&(E=!1);if(!E)return g;var T=new Set,D=[],L=new Map,b=[];for(b=b.concat(p);b.length>0&&y;){for(D.push(b[0]);D.length>0&&y;){var x=D[0];D.splice(0,1),T.add(x);for(var w=x.getEdges(),m=0;m<w.length;m++){var C=w[m].getOtherEnd(x);if(L.get(x)!=C)if(!T.has(C))D.push(C),L.set(C,x);else{y=!1;break}}}if(!y)g=[];else{var A=[].concat(i(T));g.push(A);for(var m=0;m<A.length;m++){var S=A[m],O=b.indexOf(S);O>-1&&b.splice(O,1)}T=new Set,L=new Map}}return g},d.prototype.createDummyNodesForBendpoints=function(g){for(var y=[],p=g.source,E=this.graphManager.calcLowestCommonAncestor(g.source,g.target),m=0;m<g.bendpoints.length;m++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),E.add(T);var D=this.newEdge(null);this.graphManager.add(D,p,T),y.add(T),p=T}var D=this.newEdge(null);return this.graphManager.add(D,p,g.target),this.edgeToDummyNodes.set(g,y),g.isInterGraph()?this.graphManager.remove(g):E.remove(g),y},d.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(i(this.edgeToDummyNodes.keys())).concat(g);for(var y=0;y<g.length;y++){var p=g[y];if(p.bendpoints.length>0){for(var E=this.edgeToDummyNodes.get(p),m=0;m<E.length;m++){var T=E[m],D=new h(T.getCenterX(),T.getCenterY()),L=p.bendpoints.get(m);L.x=D.x,L.y=D.y,T.getOwner().remove(T)}this.graphManager.add(p,p.source,p.target)}}},d.transform=function(g,y,p,E){if(p!=null&&E!=null){var m=y;if(g<=50){var T=y/p;m-=(y-T)/50*(50-g)}else{var D=y*E;m+=(D-y)/50*(g-50)}return m}else{var L,b;return g<=50?(L=9*y/500,b=y/10):(L=9*y/50,b=-8*y),L*g+b}},d.findCenterOfTree=function(g){var y=[];y=y.concat(g);var p=[],E=new Map,m=!1,T=null;(y.length==1||y.length==2)&&(m=!0,T=y[0]);for(var D=0;D<y.length;D++){var L=y[D],b=L.getNeighborsList().size;E.set(L,L.getNeighborsList().size),b==1&&p.push(L)}var x=[];for(x=x.concat(p);!m;){var w=[];w=w.concat(x),x=[];for(var D=0;D<y.length;D++){var L=y[D],C=y.indexOf(L);C>=0&&y.splice(C,1);var A=L.getNeighborsList();A.forEach(function(N){if(p.indexOf(N)<0){var P=E.get(N),I=P-1;I==1&&x.push(N),E.set(N,I)}})}p=p.concat(x),(y.length==1||y.length==2)&&(m=!0,T=y[0])}return T},d.prototype.setGraphManager=function(g){this.graphManager=g},t.exports=d},function(t,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)},t.exports=i},function(t,a,n){var i=n(4);function s(o,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}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var u=0,l=this.lworldExtX;return l!=0&&(u=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/l),u},s.prototype.transformY=function(o){var u=0,l=this.lworldExtY;return l!=0&&(u=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/l),u},s.prototype.inverseTransformX=function(o){var u=0,l=this.ldeviceExtX;return l!=0&&(u=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/l),u},s.prototype.inverseTransformY=function(o){var u=0,l=this.ldeviceExtY;return l!=0&&(u=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/l),u},s.prototype.inverseTransformPoint=function(o){var u=new i(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return u},t.exports=s},function(t,a,n){function i(v){if(Array.isArray(v)){for(var d=0,g=Array(v.length);d<v.length;d++)g[d]=v[d];return g}else return Array.from(v)}var s=n(15),o=n(7),u=n(0),l=n(8),f=n(9);function h(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.springConstant=o.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=o.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}h.prototype=Object.create(s.prototype);for(var c in s)h[c]=s[c];h.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var v,d,g,y,p,E,m=this.getGraphManager().getAllEdges(),T=0;T<m.length;T++)v=m[T],v.idealLength=this.idealEdgeLength,v.isInterGraph&&(g=v.getSource(),y=v.getTarget(),p=v.getSourceInLca().getEstimatedSize(),E=v.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(v.idealLength+=p+E-2*u.SIMPLE_NODE_SIZE),d=v.getLca().getInclusionTreeDepth(),v.idealLength+=o.DEFAULT_EDGE_LENGTH*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+y.getInclusionTreeDepth()-2*d))},h.prototype.initSpringEmbedder=function(){var v=this.getAllNodes().length;this.incremental?(v>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(v-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(v>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(v-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var v=this.getAllEdges(),d,g=0;g<v.length;g++)d=v[g],this.calcSpringForce(d,d.idealLength)},h.prototype.calcRepulsionForces=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,y,p,E,m=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&v&&this.updateGrid(),T=new Set,g=0;g<m.length;g++)p=m[g],this.calculateRepulsionForceOfANode(p,T,v,d),T.add(p);else for(g=0;g<m.length;g++)for(p=m[g],y=g+1;y<m.length;y++)E=m[y],p.getOwner()==E.getOwner()&&this.calcRepulsionForce(p,E)},h.prototype.calcGravitationalForces=function(){for(var v,d=this.getAllNodesToApplyGravitation(),g=0;g<d.length;g++)v=d[g],this.calcGravitationalForce(v)},h.prototype.moveNodes=function(){for(var v=this.getAllNodes(),d,g=0;g<v.length;g++)d=v[g],d.move()},h.prototype.calcSpringForce=function(v,d){var g=v.getSource(),y=v.getTarget(),p,E,m,T;if(this.uniformLeafNodeSizes&&g.getChild()==null&&y.getChild()==null)v.updateLengthSimple();else if(v.updateLength(),v.isOverlapingSourceAndTarget)return;p=v.getLength(),p!=0&&(E=this.springConstant*(p-d),m=E*(v.lengthX/p),T=E*(v.lengthY/p),g.springForceX+=m,g.springForceY+=T,y.springForceX-=m,y.springForceY-=T)},h.prototype.calcRepulsionForce=function(v,d){var g=v.getRect(),y=d.getRect(),p=new Array(2),E=new Array(4),m,T,D,L,b,x,w;if(g.intersects(y)){l.calcSeparationAmount(g,y,p,o.DEFAULT_EDGE_LENGTH/2),x=2*p[0],w=2*p[1];var C=v.noOfChildren*d.noOfChildren/(v.noOfChildren+d.noOfChildren);v.repulsionForceX-=C*x,v.repulsionForceY-=C*w,d.repulsionForceX+=C*x,d.repulsionForceY+=C*w}else this.uniformLeafNodeSizes&&v.getChild()==null&&d.getChild()==null?(m=y.getCenterX()-g.getCenterX(),T=y.getCenterY()-g.getCenterY()):(l.getIntersection(g,y,E),m=E[2]-E[0],T=E[3]-E[1]),Math.abs(m)<o.MIN_REPULSION_DIST&&(m=f.sign(m)*o.MIN_REPULSION_DIST),Math.abs(T)<o.MIN_REPULSION_DIST&&(T=f.sign(T)*o.MIN_REPULSION_DIST),D=m*m+T*T,L=Math.sqrt(D),b=this.repulsionConstant*v.noOfChildren*d.noOfChildren/D,x=b*m/L,w=b*T/L,v.repulsionForceX-=x,v.repulsionForceY-=w,d.repulsionForceX+=x,d.repulsionForceY+=w},h.prototype.calcGravitationalForce=function(v){var d,g,y,p,E,m,T,D;d=v.getOwner(),g=(d.getRight()+d.getLeft())/2,y=(d.getTop()+d.getBottom())/2,p=v.getCenterX()-g,E=v.getCenterY()-y,m=Math.abs(p)+v.getWidth()/2,T=Math.abs(E)+v.getHeight()/2,v.getOwner()==this.graphManager.getRoot()?(D=d.getEstimatedSize()*this.gravityRangeFactor,(m>D||T>D)&&(v.gravitationForceX=-this.gravityConstant*p,v.gravitationForceY=-this.gravityConstant*E)):(D=d.getEstimatedSize()*this.compoundGravityRangeFactor,(m>D||T>D)&&(v.gravitationForceX=-this.gravityConstant*p*this.compoundGravityConstant,v.gravitationForceY=-this.gravityConstant*E*this.compoundGravityConstant))},h.prototype.isConverged=function(){var v,d=!1;return this.totalIterations>this.maxIterations/3&&(d=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),v=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,v||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 v,d=this.graphManager.getAllNodes(),g=0;g<d.length;g++)v=d[g],v.noOfChildren=v.getNoOfChildren()},h.prototype.calcGrid=function(v){var d=0,g=0;d=parseInt(Math.ceil((v.getRight()-v.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((v.getBottom()-v.getTop())/this.repulsionRange));for(var y=new Array(d),p=0;p<d;p++)y[p]=new Array(g);for(var p=0;p<d;p++)for(var E=0;E<g;E++)y[p][E]=new Array;return y},h.prototype.addNodeToGrid=function(v,d,g){var y=0,p=0,E=0,m=0;y=parseInt(Math.floor((v.getRect().x-d)/this.repulsionRange)),p=parseInt(Math.floor((v.getRect().width+v.getRect().x-d)/this.repulsionRange)),E=parseInt(Math.floor((v.getRect().y-g)/this.repulsionRange)),m=parseInt(Math.floor((v.getRect().height+v.getRect().y-g)/this.repulsionRange));for(var T=y;T<=p;T++)for(var D=E;D<=m;D++)this.grid[T][D].push(v),v.setGridCoordinates(y,p,E,m)},h.prototype.updateGrid=function(){var v,d,g=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),v=0;v<g.length;v++)d=g[v],this.addNodeToGrid(d,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(v,d,g,y){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||y){var p=new Set;v.surrounding=new Array;for(var E,m=this.grid,T=v.startX-1;T<v.finishX+2;T++)for(var D=v.startY-1;D<v.finishY+2;D++)if(!(T<0||D<0||T>=m.length||D>=m[0].length)){for(var L=0;L<m[T][D].length;L++)if(E=m[T][D][L],!(v.getOwner()!=E.getOwner()||v==E)&&!d.has(E)&&!p.has(E)){var b=Math.abs(v.getCenterX()-E.getCenterX())-(v.getWidth()/2+E.getWidth()/2),x=Math.abs(v.getCenterY()-E.getCenterY())-(v.getHeight()/2+E.getHeight()/2);b<=this.repulsionRange&&x<=this.repulsionRange&&p.add(E)}}v.surrounding=[].concat(i(p))}for(T=0;T<v.surrounding.length;T++)this.calcRepulsionForce(v,v.surrounding[T])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,a,n){var i=n(1),s=n(7);function o(l,f,h){i.call(this,l,f,h),this.idealLength=s.DEFAULT_EDGE_LENGTH}o.prototype=Object.create(i.prototype);for(var u in i)o[u]=i[u];t.exports=o},function(t,a,n){var i=n(3);function s(u,l,f,h){i.call(this,u,l,f,h),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 o in i)s[o]=i[o];s.prototype.setGridCoordinates=function(u,l,f,h){this.startX=u,this.finishX=l,this.startY=f,this.finishY=h},t.exports=s},function(t,a,n){function i(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(s){this.width=s},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(s){this.height=s},t.exports=i},function(t,a,n){var i=n(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,u){var l=i.createID(o);this.contains(l)||(this.map[l]=u,this.keys.push(o))},s.prototype.contains=function(o){return i.createID(o),this.map[o]!=null},s.prototype.get=function(o){var u=i.createID(o);return this.map[u]},s.prototype.keySet=function(){return this.keys},t.exports=s},function(t,a,n){var i=n(14);function s(){this.set={}}s.prototype.add=function(o){var u=i.createID(o);this.contains(u)||(this.set[u]=o)},s.prototype.remove=function(o){delete this.set[i.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[i.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var u=Object.keys(this.set),l=u.length,f=0;f<l;f++)o.push(this.set[u[f]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var u=o.length,l=0;l<u;l++){var f=o[l];this.add(f)}},t.exports=s},function(t,a,n){var i=function(){function l(f,h){for(var c=0;c<h.length;c++){var v=h[c];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,h,c){return h&&l(f.prototype,h),c&&l(f,c),f}}();function s(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}var o=n(11),u=function(){function l(f,h){s(this,l),(h!==null||h!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var c=void 0;f instanceof o?c=f.size():c=f.length,this._quicksort(f,0,c-1)}return i(l,[{key:"_quicksort",value:function(h,c,v){if(c<v){var d=this._partition(h,c,v);this._quicksort(h,c,d),this._quicksort(h,d+1,v)}}},{key:"_partition",value:function(h,c,v){for(var d=this._get(h,c),g=c,y=v;;){for(;this.compareFunction(d,this._get(h,y));)y--;for(;this.compareFunction(this._get(h,g),d);)g++;if(g<y)this._swap(h,g,y),g++,y--;else return y}}},{key:"_get",value:function(h,c){return h instanceof o?h.get_object_at(c):h[c]}},{key:"_set",value:function(h,c,v){h instanceof o?h.set_object_at(c,v):h[c]=v}},{key:"_swap",value:function(h,c,v){var d=this._get(h,c);this._set(h,c,this._get(h,v)),this._set(h,v,d)}},{key:"_defaultCompareFunction",value:function(h,c){return c>h}}]),l}();t.exports=u},function(t,a,n){var i=function(){function u(l,f){for(var h=0;h<f.length;h++){var c=f[h];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,f,h){return f&&u(l.prototype,f),h&&u(l,h),l}}();function s(u,l){if(!(u instanceof l))throw new TypeError("Cannot call a class as a function")}var o=function(){function u(l,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,u),this.sequence1=l,this.sequence2=f,this.match_score=h,this.mismatch_penalty=c,this.gap_penalty=v,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 g=0;g<this.jMax;g++)this.grid[d][g]=0}this.tracebackGrid=new Array(this.iMax);for(var y=0;y<this.iMax;y++){this.tracebackGrid[y]=new Array(this.jMax);for(var p=0;p<this.jMax;p++)this.tracebackGrid[y][p]=[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 c=1;c<this.iMax;c++)for(var v=1;v<this.jMax;v++){var d=void 0;this.sequence1[c-1]===this.sequence2[v-1]?d=this.grid[c-1][v-1]+this.match_score:d=this.grid[c-1][v-1]+this.mismatch_penalty;var g=this.grid[c-1][v]+this.gap_penalty,y=this.grid[c][v-1]+this.gap_penalty,p=[d,g,y],E=this.arrayAllMaxIndexes(p);this.grid[c][v]=p[E[0]],this.tracebackGrid[c][v]=[E.includes(0),E.includes(1),E.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],c=this.tracebackGrid[h.pos[0]][h.pos[1]];c[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}),c[1]&&f.push({pos:[h.pos[0]-1,h.pos[1]],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:"-"+h.seq2}),c[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 c=[],v=-1;(v=f.indexOf(h,v+1))!==-1;)c.push(v);return c}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),u}();t.exports=o},function(t,a,n){var i=function(){};i.FDLayout=n(18),i.FDLayoutConstants=n(7),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(4),i.RandomSeed=n(16),i.RectangleD=n(13),i.Transform=n(17),i.UniqueIDGeneretor=n(14),i.Quicksort=n(24),i.LinkedList=n(11),i.LGraphObject=n(2),i.LGraph=n(5),i.LEdge=n(1),i.LGraphManager=n(6),i.LNode=n(3),i.Layout=n(15),i.LayoutConstants=n(0),i.NeedlemanWunsch=n(25),t.exports=i},function(t,a,n){function i(){this.listeners=[]}var s=i.prototype;s.addListener=function(o,u){this.listeners.push({event:o,callback:u})},s.removeListener=function(o,u){for(var l=this.listeners.length;l>=0;l--){var f=this.listeners[l];f.event===o&&f.callback===u&&this.listeners.splice(l,1)}},s.emit=function(o,u){for(var l=0;l<this.listeners.length;l++){var f=this.listeners[l];o===f.event&&f.callback(u)}},t.exports=i}])})}(Tn)),Tn.exports}var ds;function Jc(){return ds||(ds=1,function(r,e){(function(a,n){r.exports=n(Qc())})(qa,function(t){return function(a){var n={};function i(s){if(n[s])return n[s].exports;var o=n[s]={i:s,l:!1,exports:{}};return a[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=a,i.c=n,i.i=function(s){return s},i.d=function(s,o,u){i.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:u})},i.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(o,"a",o),o},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},i.p="",i(i.s=7)}([function(a,n){a.exports=t},function(a,n,i){var s=i(0).FDLayoutConstants;function o(){}for(var u in s)o[u]=s[u];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=s.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TREE_REDUCTION_ON_INCREMENTAL=!1,a.exports=o},function(a,n,i){var s=i(0).FDLayoutEdge;function o(l,f,h){s.call(this,l,f,h)}o.prototype=Object.create(s.prototype);for(var u in s)o[u]=s[u];a.exports=o},function(a,n,i){var s=i(0).LGraph;function o(l,f,h){s.call(this,l,f,h)}o.prototype=Object.create(s.prototype);for(var u in s)o[u]=s[u];a.exports=o},function(a,n,i){var s=i(0).LGraphManager;function o(l){s.call(this,l)}o.prototype=Object.create(s.prototype);for(var u in s)o[u]=s[u];a.exports=o},function(a,n,i){var s=i(0).FDLayoutNode,o=i(0).IMath;function u(f,h,c,v){s.call(this,f,h,c,v)}u.prototype=Object.create(s.prototype);for(var l in s)u[l]=s[l];u.prototype.move=function(){var f=this.graphManager.getLayout();this.displacementX=f.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=f.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>f.coolingFactor*f.maxNodeDisplacement&&(this.displacementX=f.coolingFactor*f.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>f.coolingFactor*f.maxNodeDisplacement&&(this.displacementY=f.coolingFactor*f.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),f.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},u.prototype.propogateDisplacementToChildren=function(f,h){for(var c=this.getChild().getNodes(),v,d=0;d<c.length;d++)v=c[d],v.getChild()==null?(v.moveBy(f,h),v.displacementX+=f,v.displacementY+=h):v.propogateDisplacementToChildren(f,h)},u.prototype.setPred1=function(f){this.pred1=f},u.prototype.getPred1=function(){return pred1},u.prototype.getPred2=function(){return pred2},u.prototype.setNext=function(f){this.next=f},u.prototype.getNext=function(){return next},u.prototype.setProcessed=function(f){this.processed=f},u.prototype.isProcessed=function(){return processed},a.exports=u},function(a,n,i){var s=i(0).FDLayout,o=i(4),u=i(3),l=i(5),f=i(2),h=i(1),c=i(0).FDLayoutConstants,v=i(0).LayoutConstants,d=i(0).Point,g=i(0).PointD,y=i(0).Layout,p=i(0).Integer,E=i(0).IGeometry,m=i(0).LGraph,T=i(0).Transform;function D(){s.call(this),this.toBeTiled={}}D.prototype=Object.create(s.prototype);for(var L in s)D[L]=s[L];D.prototype.newGraphManager=function(){var b=new o(this);return this.graphManager=b,b},D.prototype.newGraph=function(b){return new u(null,this.graphManager,b)},D.prototype.newNode=function(b){return new l(this.graphManager,b)},D.prototype.newEdge=function(b){return new f(null,null,b)},D.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=c.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=c.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=c.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},D.prototype.layout=function(){var b=v.DEFAULT_CREATE_BENDS_AS_NEEDED;return b&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.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(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(S){return x.has(S)});this.graphManager.setAllNodesToApplyGravitation(w)}}else{var b=this.getFlatForest();if(b.length>0)this.positionNodesRadially(b);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(C){return x.has(C)});this.graphManager.setAllNodesToApplyGravitation(w),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},D.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%c.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 b=new Set(this.getAllNodes()),x=this.nodesWithGravity.filter(function(A){return b.has(A)});this.graphManager.setAllNodesToApplyGravitation(x),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=c.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()),this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var w=!this.isTreeGrowing&&!this.isGrowthFinished,C=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(w,C),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var b=this.graphManager.getAllNodes(),x={},w=0;w<b.length;w++){var C=b[w].rect,A=b[w].id;x[A]={id:A,x:C.getCenterX(),y:C.getCenterY(),w:C.width,h:C.height}}return x},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var b=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{for(;!b;)b=this.tick();this.graphManager.updateBounds()}},D.prototype.calculateNodesToApplyGravitationTo=function(){var b=[],x,w=this.graphManager.getGraphs(),C=w.length,A;for(A=0;A<C;A++)x=w[A],x.updateConnected(),x.isConnected||(b=b.concat(x.getNodes()));return b},D.prototype.createBendpoints=function(){var b=[];b=b.concat(this.graphManager.getAllEdges());var x=new Set,w;for(w=0;w<b.length;w++){var C=b[w];if(!x.has(C)){var A=C.getSource(),S=C.getTarget();if(A==S)C.getBendpoints().push(new g),C.getBendpoints().push(new g),this.createDummyNodesForBendpoints(C),x.add(C);else{var O=[];if(O=O.concat(A.getEdgeListToNode(S)),O=O.concat(S.getEdgeListToNode(A)),!x.has(O[0])){if(O.length>1){var N;for(N=0;N<O.length;N++){var P=O[N];P.getBendpoints().push(new g),this.createDummyNodesForBendpoints(P)}}O.forEach(function(I){x.add(I)})}}}if(x.size==b.length)break}},D.prototype.positionNodesRadially=function(b){for(var x=new d(0,0),w=Math.ceil(Math.sqrt(b.length)),C=0,A=0,S=0,O=new g(0,0),N=0;N<b.length;N++){N%w==0&&(S=0,A=C,N!=0&&(A+=h.DEFAULT_COMPONENT_SEPERATION),C=0);var P=b[N],I=y.findCenterOfTree(P);x.x=S,x.y=A,O=D.radialLayout(P,I,x),O.y>C&&(C=Math.floor(O.y)),S=Math.floor(O.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(v.WORLD_CENTER_X-O.x/2,v.WORLD_CENTER_Y-O.y/2))},D.radialLayout=function(b,x,w){var C=Math.max(this.maxDiagonalInTree(b),h.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(x,null,0,359,0,C);var A=m.calculateBounds(b),S=new T;S.setDeviceOrgX(A.getMinX()),S.setDeviceOrgY(A.getMinY()),S.setWorldOrgX(w.x),S.setWorldOrgY(w.y);for(var O=0;O<b.length;O++){var N=b[O];N.transform(S)}var P=new g(A.getMaxX(),A.getMaxY());return S.inverseTransformPoint(P)},D.branchRadialLayout=function(b,x,w,C,A,S){var O=(C-w+1)/2;O<0&&(O+=180);var N=(O+w)%360,P=N*E.TWO_PI/360,I=A*Math.cos(P),k=A*Math.sin(P);b.setCenter(I,k);var R=[];R=R.concat(b.getEdges());var B=R.length;x!=null&&B--;for(var z=0,F=R.length,V,U=b.getEdgesBetween(x);U.length>1;){var $=U[0];U.splice(0,1);var X=R.indexOf($);X>=0&&R.splice(X,1),F--,B--}x!=null?V=(R.indexOf(U[0])+1)%F:V=0;for(var H=Math.abs(C-w)/B,G=V;z!=B;G=++G%F){var q=R[G].getOtherEnd(b);if(q!=x){var K=(w+z*H)%360,Z=(K+H)%360;D.branchRadialLayout(q,b,K,Z,A+S,S),z++}}},D.maxDiagonalInTree=function(b){for(var x=p.MIN_VALUE,w=0;w<b.length;w++){var C=b[w],A=C.getDiagonal();A>x&&(x=A)}return x},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var b=this,x={};this.memberGroups={},this.idToDummyNode={};for(var w=[],C=this.graphManager.getAllNodes(),A=0;A<C.length;A++){var S=C[A],O=S.getParent();this.getNodeDegreeWithChildren(S)===0&&(O.id==null||!this.getToBeTiled(O))&&w.push(S)}for(var A=0;A<w.length;A++){var S=w[A],N=S.getParent().id;typeof x[N]>"u"&&(x[N]=[]),x[N]=x[N].concat(S)}Object.keys(x).forEach(function(P){if(x[P].length>1){var I="DummyCompound_"+P;b.memberGroups[I]=x[P];var k=x[P][0].getParent(),R=new l(b.graphManager);R.id=I,R.paddingLeft=k.paddingLeft||0,R.paddingRight=k.paddingRight||0,R.paddingBottom=k.paddingBottom||0,R.paddingTop=k.paddingTop||0,b.idToDummyNode[I]=R;var B=b.getGraphManager().add(b.newGraph(),R),z=k.getChild();z.add(R);for(var F=0;F<x[P].length;F++){var V=x[P][F];z.remove(V),B.add(V)}}})},D.prototype.clearCompounds=function(){var b={},x={};this.performDFSOnCompounds();for(var w=0;w<this.compoundOrder.length;w++)x[this.compoundOrder[w].id]=this.compoundOrder[w],b[this.compoundOrder[w].id]=[].concat(this.compoundOrder[w].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[w].getChild()),this.compoundOrder[w].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(b,x)},D.prototype.clearZeroDegreeMembers=function(){var b=this,x=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(w){var C=b.idToDummyNode[w];x[w]=b.tileNodes(b.memberGroups[w],C.paddingLeft+C.paddingRight),C.rect.width=x[w].width,C.rect.height=x[w].height})},D.prototype.repopulateCompounds=function(){for(var b=this.compoundOrder.length-1;b>=0;b--){var x=this.compoundOrder[b],w=x.id,C=x.paddingLeft,A=x.paddingTop;this.adjustLocations(this.tiledMemberPack[w],x.rect.x,x.rect.y,C,A)}},D.prototype.repopulateZeroDegreeMembers=function(){var b=this,x=this.tiledZeroDegreePack;Object.keys(x).forEach(function(w){var C=b.idToDummyNode[w],A=C.paddingLeft,S=C.paddingTop;b.adjustLocations(x[w],C.rect.x,C.rect.y,A,S)})},D.prototype.getToBeTiled=function(b){var x=b.id;if(this.toBeTiled[x]!=null)return this.toBeTiled[x];var w=b.getChild();if(w==null)return this.toBeTiled[x]=!1,!1;for(var C=w.getNodes(),A=0;A<C.length;A++){var S=C[A];if(this.getNodeDegree(S)>0)return this.toBeTiled[x]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[x]=!1,!1}return this.toBeTiled[x]=!0,!0},D.prototype.getNodeDegree=function(b){b.id;for(var x=b.getEdges(),w=0,C=0;C<x.length;C++){var A=x[C];A.getSource().id!==A.getTarget().id&&(w=w+1)}return w},D.prototype.getNodeDegreeWithChildren=function(b){var x=this.getNodeDegree(b);if(b.getChild()==null)return x;for(var w=b.getChild().getNodes(),C=0;C<w.length;C++){var A=w[C];x+=this.getNodeDegreeWithChildren(A)}return x},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(b){for(var x=0;x<b.length;x++){var w=b[x];w.getChild()!=null&&this.fillCompexOrderByDFS(w.getChild().getNodes()),this.getToBeTiled(w)&&this.compoundOrder.push(w)}},D.prototype.adjustLocations=function(b,x,w,C,A){x+=C,w+=A;for(var S=x,O=0;O<b.rows.length;O++){var N=b.rows[O];x=S;for(var P=0,I=0;I<N.length;I++){var k=N[I];k.rect.x=x,k.rect.y=w,x+=k.rect.width+b.horizontalPadding,k.rect.height>P&&(P=k.rect.height)}w+=P+b.verticalPadding}},D.prototype.tileCompoundMembers=function(b,x){var w=this;this.tiledMemberPack=[],Object.keys(b).forEach(function(C){var A=x[C];w.tiledMemberPack[C]=w.tileNodes(b[C],A.paddingLeft+A.paddingRight),A.rect.width=w.tiledMemberPack[C].width,A.rect.height=w.tiledMemberPack[C].height})},D.prototype.tileNodes=function(b,x){var w=h.TILING_PADDING_VERTICAL,C=h.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:x,verticalPadding:w,horizontalPadding:C};b.sort(function(N,P){return N.rect.width*N.rect.height>P.rect.width*P.rect.height?-1:N.rect.width*N.rect.height<P.rect.width*P.rect.height?1:0});for(var S=0;S<b.length;S++){var O=b[S];A.rows.length==0?this.insertNodeToRow(A,O,0,x):this.canAddHorizontal(A,O.rect.width,O.rect.height)?this.insertNodeToRow(A,O,this.getShortestRowIndex(A),x):this.insertNodeToRow(A,O,A.rows.length,x),this.shiftToLastRow(A)}return A},D.prototype.insertNodeToRow=function(b,x,w,C){var A=C;if(w==b.rows.length){var S=[];b.rows.push(S),b.rowWidth.push(A),b.rowHeight.push(0)}var O=b.rowWidth[w]+x.rect.width;b.rows[w].length>0&&(O+=b.horizontalPadding),b.rowWidth[w]=O,b.width<O&&(b.width=O);var N=x.rect.height;w>0&&(N+=b.verticalPadding);var P=0;N>b.rowHeight[w]&&(P=b.rowHeight[w],b.rowHeight[w]=N,P=b.rowHeight[w]-P),b.height+=P,b.rows[w].push(x)},D.prototype.getShortestRowIndex=function(b){for(var x=-1,w=Number.MAX_VALUE,C=0;C<b.rows.length;C++)b.rowWidth[C]<w&&(x=C,w=b.rowWidth[C]);return x},D.prototype.getLongestRowIndex=function(b){for(var x=-1,w=Number.MIN_VALUE,C=0;C<b.rows.length;C++)b.rowWidth[C]>w&&(x=C,w=b.rowWidth[C]);return x},D.prototype.canAddHorizontal=function(b,x,w){var C=this.getShortestRowIndex(b);if(C<0)return!0;var A=b.rowWidth[C];if(A+b.horizontalPadding+x<=b.width)return!0;var S=0;b.rowHeight[C]<w&&C>0&&(S=w+b.verticalPadding-b.rowHeight[C]);var O;b.width-A>=x+b.horizontalPadding?O=(b.height+S)/(A+x+b.horizontalPadding):O=(b.height+S)/b.width,S=w+b.verticalPadding;var N;return b.width<x?N=(b.height+S)/x:N=(b.height+S)/b.width,N<1&&(N=1/N),O<1&&(O=1/O),O<N},D.prototype.shiftToLastRow=function(b){var x=this.getLongestRowIndex(b),w=b.rowWidth.length-1,C=b.rows[x],A=C[C.length-1],S=A.width+b.horizontalPadding;if(b.width-b.rowWidth[w]>S&&x!=w){C.splice(-1,1),b.rows[w].push(A),b.rowWidth[x]=b.rowWidth[x]-S,b.rowWidth[w]=b.rowWidth[w]+S,b.width=b.rowWidth[instance.getLongestRowIndex(b)];for(var O=Number.MIN_VALUE,N=0;N<C.length;N++)C[N].height>O&&(O=C[N].height);x>0&&(O+=b.verticalPadding);var P=b.rowHeight[x]+b.rowHeight[w];b.rowHeight[x]=O,b.rowHeight[w]<A.height+b.verticalPadding&&(b.rowHeight[w]=A.height+b.verticalPadding);var I=b.rowHeight[x]+b.rowHeight[w];b.height+=I-P,this.shiftToLastRow(b)}},D.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},D.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},D.prototype.reduceTrees=function(){for(var b=[],x=!0,w;x;){var C=this.graphManager.getAllNodes(),A=[];x=!1;for(var S=0;S<C.length;S++)w=C[S],w.getEdges().length==1&&!w.getEdges()[0].isInterGraph&&w.getChild()==null&&(A.push([w,w.getEdges()[0],w.getOwner()]),x=!0);if(x==!0){for(var O=[],N=0;N<A.length;N++)A[N][0].getEdges().length==1&&(O.push(A[N]),A[N][0].getOwner().remove(A[N][0]));b.push(O),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=b},D.prototype.growTree=function(b){for(var x=b.length,w=b[x-1],C,A=0;A<w.length;A++)C=w[A],this.findPlaceforPrunedNode(C),C[2].add(C[0]),C[2].add(C[1],C[1].source,C[1].target);b.splice(b.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(b){var x,w,C=b[0];C==b[1].source?w=b[1].target:w=b[1].source;var A=w.startX,S=w.finishX,O=w.startY,N=w.finishY,P=0,I=0,k=0,R=0,B=[P,k,I,R];if(O>0)for(var z=A;z<=S;z++)B[0]+=this.grid[z][O-1].length+this.grid[z][O].length-1;if(S<this.grid.length-1)for(var z=O;z<=N;z++)B[1]+=this.grid[S+1][z].length+this.grid[S][z].length-1;if(N<this.grid[0].length-1)for(var z=A;z<=S;z++)B[2]+=this.grid[z][N+1].length+this.grid[z][N].length-1;if(A>0)for(var z=O;z<=N;z++)B[3]+=this.grid[A-1][z].length+this.grid[A][z].length-1;for(var F=p.MAX_VALUE,V,U,$=0;$<B.length;$++)B[$]<F?(F=B[$],V=1,U=$):B[$]==F&&V++;if(V==3&&F==0)B[0]==0&&B[1]==0&&B[2]==0?x=1:B[0]==0&&B[1]==0&&B[3]==0?x=0:B[0]==0&&B[2]==0&&B[3]==0?x=3:B[1]==0&&B[2]==0&&B[3]==0&&(x=2);else if(V==2&&F==0){var X=Math.floor(Math.random()*2);B[0]==0&&B[1]==0?X==0?x=0:x=1:B[0]==0&&B[2]==0?X==0?x=0:x=2:B[0]==0&&B[3]==0?X==0?x=0:x=3:B[1]==0&&B[2]==0?X==0?x=1:x=2:B[1]==0&&B[3]==0?X==0?x=1:x=3:X==0?x=2:x=3}else if(V==4&&F==0){var X=Math.floor(Math.random()*4);x=X}else x=U;x==0?C.setCenter(w.getCenterX(),w.getCenterY()-w.getHeight()/2-c.DEFAULT_EDGE_LENGTH-C.getHeight()/2):x==1?C.setCenter(w.getCenterX()+w.getWidth()/2+c.DEFAULT_EDGE_LENGTH+C.getWidth()/2,w.getCenterY()):x==2?C.setCenter(w.getCenterX(),w.getCenterY()+w.getHeight()/2+c.DEFAULT_EDGE_LENGTH+C.getHeight()/2):C.setCenter(w.getCenterX()-w.getWidth()/2-c.DEFAULT_EDGE_LENGTH-C.getWidth()/2,w.getCenterY())},a.exports=D},function(a,n,i){var s={};s.layoutBase=i(0),s.CoSEConstants=i(1),s.CoSEEdge=i(2),s.CoSEGraph=i(3),s.CoSEGraphManager=i(4),s.CoSELayout=i(6),s.CoSENode=i(5),a.exports=s}])})}(xn)),xn.exports}(function(r,e){(function(a,n){r.exports=n(Jc())})(qa,function(t){return function(a){var n={};function i(s){if(n[s])return n[s].exports;var o=n[s]={i:s,l:!1,exports:{}};return a[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=a,i.c=n,i.i=function(s){return s},i.d=function(s,o,u){i.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:u})},i.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(o,"a",o),o},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},i.p="",i(i.s=1)}([function(a,n){a.exports=t},function(a,n,i){var s=i(0).layoutBase.LayoutConstants,o=i(0).layoutBase.FDLayoutConstants,u=i(0).CoSEConstants,l=i(0).CoSELayout,f=i(0).CoSENode,h=i(0).layoutBase.PointD,c=i(0).layoutBase.DimensionD,v={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function d(E,m){var T={};for(var D in E)T[D]=E[D];for(var D in m)T[D]=m[D];return T}function g(E){this.options=d(v,E),y(this.options)}var y=function(m){m.nodeRepulsion!=null&&(u.DEFAULT_REPULSION_STRENGTH=o.DEFAULT_REPULSION_STRENGTH=m.nodeRepulsion),m.idealEdgeLength!=null&&(u.DEFAULT_EDGE_LENGTH=o.DEFAULT_EDGE_LENGTH=m.idealEdgeLength),m.edgeElasticity!=null&&(u.DEFAULT_SPRING_STRENGTH=o.DEFAULT_SPRING_STRENGTH=m.edgeElasticity),m.nestingFactor!=null&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=m.nestingFactor),m.gravity!=null&&(u.DEFAULT_GRAVITY_STRENGTH=o.DEFAULT_GRAVITY_STRENGTH=m.gravity),m.numIter!=null&&(u.MAX_ITERATIONS=o.MAX_ITERATIONS=m.numIter),m.gravityRange!=null&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=o.DEFAULT_GRAVITY_RANGE_FACTOR=m.gravityRange),m.gravityCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=m.gravityCompound),m.gravityRangeCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=m.gravityRangeCompound),m.initialEnergyOnIncremental!=null&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.DEFAULT_COOLING_FACTOR_INCREMENTAL=m.initialEnergyOnIncremental),m.quality=="draft"?s.QUALITY=0:m.quality=="proof"?s.QUALITY=2:s.QUALITY=1,u.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=m.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!m.randomize,u.ANIMATE=o.ANIMATE=s.ANIMATE=m.animate,u.TILE=m.tile,u.TILING_PADDING_VERTICAL=typeof m.tilingPaddingVertical=="function"?m.tilingPaddingVertical.call():m.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL=typeof m.tilingPaddingHorizontal=="function"?m.tilingPaddingHorizontal.call():m.tilingPaddingHorizontal};g.prototype.run=function(){var E,m,T=this.options;this.idToLNode={};var D=this.layout=new l,L=this;L.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var b=D.newGraphManager();this.gm=b;var x=this.options.eles.nodes(),w=this.options.eles.edges();this.root=b.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(x),D);for(var C=0;C<w.length;C++){var A=w[C],S=this.idToLNode[A.data("source")],O=this.idToLNode[A.data("target")];if(S!==O&&S.getEdgesBetween(O).length==0){var N=b.add(D.newEdge(),S,O);N.id=A.id()}}var P=function(R,B){typeof R=="number"&&(R=B);var z=R.data("id"),F=L.idToLNode[z];return{x:F.getRect().getCenterX(),y:F.getRect().getCenterY()}},I=function k(){for(var R=function(){T.fit&&T.cy.fit(T.eles,T.padding),E||(E=!0,L.cy.one("layoutready",T.ready),L.cy.trigger({type:"layoutready",layout:L}))},B=L.options.refresh,z,F=0;F<B&&!z;F++)z=L.stopped||L.layout.tick();if(z){D.checkLayoutSuccess()&&!D.isSubLayout&&D.doPostLayout(),D.tilingPostLayout&&D.tilingPostLayout(),D.isLayoutFinished=!0,L.options.eles.nodes().positions(P),R(),L.cy.one("layoutstop",L.options.stop),L.cy.trigger({type:"layoutstop",layout:L}),m&&cancelAnimationFrame(m),E=!1;return}var V=L.layout.getPositionsData();T.eles.nodes().positions(function(U,$){if(typeof U=="number"&&(U=$),!U.isParent()){for(var X=U.id(),H=V[X],G=U;H==null&&(H=V[G.data("parent")]||V["DummyCompound_"+G.data("parent")],V[X]=H,G=G.parent()[0],G!=null););return H!=null?{x:H.x,y:H.y}:{x:U.position("x"),y:U.position("y")}}}),R(),m=requestAnimationFrame(k)};return D.addListener("layoutstarted",function(){L.options.animate==="during"&&(m=requestAnimationFrame(I))}),D.runLayout(),this.options.animate!=="during"&&(L.options.eles.nodes().not(":parent").layoutPositions(L,L.options,P),E=!1),this},g.prototype.getTopMostNodes=function(E){for(var m={},T=0;T<E.length;T++)m[E[T].id()]=!0;var D=E.filter(function(L,b){typeof L=="number"&&(L=b);for(var x=L.parent()[0];x!=null;){if(m[x.id()])return!1;x=x.parent()[0]}return!0});return D},g.prototype.processChildrenList=function(E,m,T){for(var D=m.length,L=0;L<D;L++){var b=m[L],x=b.children(),w,C=b.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(b.outerWidth()!=null&&b.outerHeight()!=null?w=E.add(new f(T.graphManager,new h(b.position("x")-C.w/2,b.position("y")-C.h/2),new c(parseFloat(C.w),parseFloat(C.h)))):w=E.add(new f(this.graphManager)),w.id=b.data("id"),w.paddingLeft=parseInt(b.css("padding")),w.paddingTop=parseInt(b.css("padding")),w.paddingRight=parseInt(b.css("padding")),w.paddingBottom=parseInt(b.css("padding")),this.options.nodeDimensionsIncludeLabels&&b.isParent()){var A=b.boundingBox({includeLabels:!0,includeNodes:!1}).w,S=b.boundingBox({includeLabels:!0,includeNodes:!1}).h,O=b.css("text-halign");w.labelWidth=A,w.labelHeight=S,w.labelPos=O}if(this.idToLNode[b.data("id")]=w,isNaN(w.rect.x)&&(w.rect.x=0),isNaN(w.rect.y)&&(w.rect.y=0),x!=null&&x.length>0){var N;N=T.getGraphManager().add(T.newGraph(),w),this.processChildrenList(N,x,T)}}},g.prototype.stop=function(){return this.stopped=!0,this};var p=function(m){m("layout","cose-bilkent",g)};typeof cytoscape<"u"&&p(cytoscape),a.exports=p}])})})(Wo);const jc=xu(Wo.exports);var Bn=function(){var r=function(T,D,L,b){for(L=L||{},b=T.length;b--;L[T[b]]=D);return L},e=[1,4],t=[1,13],a=[1,12],n=[1,15],i=[1,16],s=[1,20],o=[1,19],u=[6,7,8],l=[1,26],f=[1,24],h=[1,25],c=[6,7,11],v=[1,6,13,15,16,19,22],d=[1,33],g=[1,34],y=[1,6,7,11,13,15,16,19,22],p={trace:function(){},yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:function(D,L,b,x,w,C,A){var S=C.length-1;switch(w){case 6:case 7:return x;case 8:x.getLogger().trace("Stop NL ");break;case 9:x.getLogger().trace("Stop EOF ");break;case 11:x.getLogger().trace("Stop NL2 ");break;case 12:x.getLogger().trace("Stop EOF2 ");break;case 15:x.getLogger().info("Node: ",C[S].id),x.addNode(C[S-1].length,C[S].id,C[S].descr,C[S].type);break;case 16:x.getLogger().trace("Icon: ",C[S]),x.decorateNode({icon:C[S]});break;case 17:case 21:x.decorateNode({class:C[S]});break;case 18:x.getLogger().trace("SPACELIST");break;case 19:x.getLogger().trace("Node: ",C[S].id),x.addNode(0,C[S].id,C[S].descr,C[S].type);break;case 20:x.decorateNode({icon:C[S]});break;case 25:x.getLogger().trace("node found ..",C[S-2]),this.$={id:C[S-1],descr:C[S-1],type:x.getType(C[S-2],C[S])};break;case 26:this.$={id:C[S],descr:C[S],type:x.nodeType.DEFAULT};break;case 27:x.getLogger().trace("node found ..",C[S-3]),this.$={id:C[S-3],descr:C[S-1],type:x.getType(C[S-2],C[S])};break}},table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:t,7:[1,10],9:9,12:11,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},r(u,[2,3]),{1:[2,2]},r(u,[2,4]),r(u,[2,5]),{1:[2,6],6:t,12:21,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},{6:t,9:22,12:11,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},{6:l,7:f,10:23,11:h},r(c,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),r(c,[2,18]),r(c,[2,19]),r(c,[2,20]),r(c,[2,21]),r(c,[2,23]),r(c,[2,24]),r(c,[2,26],{19:[1,30]}),{20:[1,31]},{6:l,7:f,10:32,11:h},{1:[2,7],6:t,12:21,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},r(v,[2,14],{7:d,11:g}),r(y,[2,8]),r(y,[2,9]),r(y,[2,10]),r(c,[2,15]),r(c,[2,16]),r(c,[2,17]),{20:[1,35]},{21:[1,36]},r(v,[2,13],{7:d,11:g}),r(y,[2,11]),r(y,[2,12]),{21:[1,37]},r(c,[2,25]),r(c,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:function(D,L){if(L.recoverable)this.trace(D);else{var b=new Error(D);throw b.hash=L,b}},parse:function(D){var L=this,b=[0],x=[],w=[null],C=[],A=this.table,S="",O=0,N=0,P=2,I=1,k=C.slice.call(arguments,1),R=Object.create(this.lexer),B={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(B.yy[z]=this.yy[z]);R.setInput(D,B.yy),B.yy.lexer=R,B.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var F=R.yylloc;C.push(F);var V=R.options&&R.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function U(){var ee;return ee=x.pop()||R.lex()||I,typeof ee!="number"&&(ee instanceof Array&&(x=ee,ee=x.pop()),ee=L.symbols_[ee]||ee),ee}for(var $,X,H,G,q={},K,Z,te,he;;){if(X=b[b.length-1],this.defaultActions[X]?H=this.defaultActions[X]:(($===null||typeof $>"u")&&($=U()),H=A[X]&&A[X][$]),typeof H>"u"||!H.length||!H[0]){var de="";he=[];for(K in A[X])this.terminals_[K]&&K>P&&he.push("'"+this.terminals_[K]+"'");R.showPosition?de="Parse error on line "+(O+1)+`:
`+R.showPosition()+`
Expecting `+he.join(", ")+", got '"+(this.terminals_[$]||$)+"'":de="Parse error on line "+(O+1)+": Unexpected "+($==I?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(de,{text:R.match,token:this.terminals_[$]||$,line:R.yylineno,loc:F,expected:he})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+$);switch(H[0]){case 1:b.push($),w.push(R.yytext),C.push(R.yylloc),b.push(H[1]),$=null,N=R.yyleng,S=R.yytext,O=R.yylineno,F=R.yylloc;break;case 2:if(Z=this.productions_[H[1]][1],q.$=w[w.length-Z],q._$={first_line:C[C.length-(Z||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(Z||1)].first_column,last_column:C[C.length-1].last_column},V&&(q._$.range=[C[C.length-(Z||1)].range[0],C[C.length-1].range[1]]),G=this.performAction.apply(q,[S,N,O,B.yy,H[1],w,C].concat(k)),typeof G<"u")return G;Z&&(b=b.slice(0,-1*Z*2),w=w.slice(0,-1*Z),C=C.slice(0,-1*Z)),b.push(this.productions_[H[1]][0]),w.push(q.$),C.push(q._$),te=A[b[b.length-2]][b[b.length-1]],b.push(te);break;case 3:return!0}}return!0}},E=function(){var T={EOF:1,parseError:function(L,b){if(this.yy.parser)this.yy.parser.parseError(L,b);else throw new Error(L)},setInput:function(D,L){return this.yy=L||this.yy||{},this._input=D,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var D=this._input[0];this.yytext+=D,this.yyleng++,this.offset++,this.match+=D,this.matched+=D;var L=D.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),D},unput:function(D){var L=D.length,b=D.split(/(?:\r\n?|\n)/g);this._input=D+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===x.length?this.yylloc.first_column:0)+x[x.length-b.length].length-b[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(D){this.unput(this.match.slice(D))},pastInput:function(){var D=this.matched.substr(0,this.matched.length-this.match.length);return(D.length>20?"...":"")+D.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var D=this.match;return D.length<20&&(D+=this._input.substr(0,20-D.length)),(D.substr(0,20)+(D.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var D=this.pastInput(),L=new Array(D.length+1).join("-");return D+this.upcomingInput()+`
`+L+"^"},test_match:function(D,L){var b,x,w;if(this.options.backtrack_lexer&&(w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(w.yylloc.range=this.yylloc.range.slice(0))),x=D[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+D[0].length},this.yytext+=D[0],this.match+=D[0],this.matches=D,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(D[0].length),this.matched+=D[0],b=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var C in w)this[C]=w[C];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var D,L,b,x;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),C=0;C<w.length;C++)if(b=this._input.match(this.rules[w[C]]),b&&(!L||b[0].length>L[0].length)){if(L=b,x=C,this.options.backtrack_lexer){if(D=this.test_match(b,w[C]),D!==!1)return D;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(D=this.test_match(L,w[x]),D!==!1?D:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var L=this.next();return L||this.lex()},begin:function(L){this.conditionStack.push(L)},popState:function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},pushState:function(L){this.begin(L)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(L,b,x,w){switch(x){case 0:L.getLogger().trace("Found comment",b.yytext);break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:L.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return L.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:L.getLogger().trace("end icon"),this.popState();break;case 10:return L.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return L.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return L.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return L.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:L.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 22:return L.getLogger().trace("description:",b.yytext),"NODE_DESCR";case 23:this.popState();break;case 24:return this.popState(),L.getLogger().trace("node end ))"),"NODE_DEND";case 25:return this.popState(),L.getLogger().trace("node end )"),"NODE_DEND";case 26:return this.popState(),L.getLogger().trace("node end ...",b.yytext),"NODE_DEND";case 27:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 28:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 29:return this.popState(),L.getLogger().trace("node end (-"),"NODE_DEND";case 30:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),L.getLogger().trace("node end (("),"NODE_DEND";case 32:return L.getLogger().trace("Long description:",b.yytext),20;case 33:return L.getLogger().trace("Long description:",b.yytext),20}},rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\-\)\{\}]+)/i,/^(?:$)/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR:{rules:[22,23],inclusive:!1},NODE:{rules:[21,24,25,26,27,28,29,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return T}();p.lexer=E;function m(){this.yy={}}return m.prototype=p,p.Parser=m,new m}();Bn.parser=Bn;const ed=Bn,ia=r=>Tu(r,_r());let gt=[],_o=0,ai={};const td=()=>{gt=[],_o=0,ai={}},rd=function(r){for(let e=gt.length-1;e>=0;e--)if(gt[e].level<r)return gt[e];return null},ad=()=>gt.length>0?gt[0]:null,nd=(r,e,t,a)=>{or.info("addNode",r,e,t,a);const n=_r(),i={id:_o++,nodeId:ia(e),level:r,descr:ia(t),type:a,children:[],width:_r().mindmap.maxNodeWidth};switch(i.type){case Oe.ROUNDED_RECT:i.padding=2*n.mindmap.padding;break;case Oe.RECT:i.padding=2*n.mindmap.padding;break;case Oe.HEXAGON:i.padding=2*n.mindmap.padding;break;default:i.padding=n.mindmap.padding}const s=rd(r);if(s)s.children.push(i),gt.push(i);else if(gt.length===0)gt.push(i);else{let o=new Error('There can be only one root. No parent could be found for ("'+i.descr+'")');throw o.hash={text:"branch "+name,token:"branch "+name,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+name+'"']},o}},Oe={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},id=(r,e)=>{switch(or.debug("In get type",r,e),r){case"[":return Oe.RECT;case"(":return e===")"?Oe.ROUNDED_RECT:Oe.CLOUD;case"((":return Oe.CIRCLE;case")":return Oe.CLOUD;case"))":return Oe.BANG;case"{{":return Oe.HEXAGON;default:return Oe.DEFAULT}},Ko=(r,e)=>{ai[r]=e},sd=r=>{const e=gt[gt.length-1];r&&r.icon&&(e.icon=ia(r.icon)),r&&r.class&&(e.class=ia(r.class))},fr=r=>{switch(r){case Oe.DEFAULT:return"no-border";case Oe.RECT:return"rect";case Oe.ROUNDED_RECT:return"rounded-rect";case Oe.CIRCLE:return"circle";case Oe.CLOUD:return"cloud";case Oe.BANG:return"bang";case Oe.HEXAGON:return"hexgon";default:return"no-border"}};let Zo;const od=r=>{Zo=r},ud=()=>or,ld=r=>gt[r],ni=r=>ai[r],fd=Object.freeze(Object.defineProperty({__proto__:null,sanitizeText:ia,clear:td,getMindmap:ad,addNode:nd,nodeType:Oe,getType:id,setElementForId:Ko,decorateNode:sd,type2Str:fr,get parseError(){return Zo},setErrorHandler:od,getLogger:ud,getNodeById:ld,getElementById:ni},Symbol.toStringTag,{value:"Module"})),Qo=12;function hd(r,e){r.each(function(){var t=Xr(this),a=t.text().split(/(\s+|<br>)/).reverse(),n,i=[],s=1.1,o=t.attr("y"),u=parseFloat(t.attr("dy")),l=t.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",u+"em");for(let f=0;f<a.length;f++)n=a[a.length-1-f],i.push(n),l.text(i.join(" ").trim()),(l.node().getComputedTextLength()>e||n==="<br>")&&(i.pop(),l.text(i.join(" ").trim()),n==="<br>"?i=[""]:i=[n],l=t.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(n))})}const vd=function(r,e,t){r.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+fr(e.type)).attr("d",`M0 ${e.height-5} v${-e.height+2*5} q0,-5 5,-5 h${e.width-2*5} q5,0 5,5 v${e.height-5} H0 Z`),r.append("line").attr("class","node-line-"+t).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},cd=function(r,e){r.append("rect").attr("id","node-"+e.id).attr("class","node-bkg node-"+fr(e.type)).attr("height",e.height).attr("width",e.width)},dd=function(r,e){const t=e.width,a=e.height,n=.15*t,i=.25*t,s=.35*t,o=.2*t;r.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+fr(e.type)).attr("d",`M0 0 a${n},${n} 0 0,1 ${t*.25},${-1*t*.1}
a${s},${s} 1 0,1 ${t*.4},${-1*t*.1}
a${i},${i} 1 0,1 ${t*.35},${1*t*.2}
a${n},${n} 1 0,1 ${t*.15},${1*a*.35}
a${o},${o} 1 0,1 ${-1*t*.15},${1*a*.65}
a${i},${n} 1 0,1 ${-1*t*.25},${t*.15}
a${s},${s} 1 0,1 ${-1*t*.5},${0}
a${n},${n} 1 0,1 ${-1*t*.25},${-1*t*.15}
a${n},${n} 1 0,1 ${-1*t*.1},${-1*a*.35}
a${o},${o} 1 0,1 ${t*.1},${-1*a*.65}
H0 V0 Z`)},gd=function(r,e){const t=e.width,a=e.height,n=.15*t;r.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+fr(e.type)).attr("d",`M0 0 a${n},${n} 1 0,0 ${t*.25},${-1*a*.1}
a${n},${n} 1 0,0 ${t*.25},${0}
a${n},${n} 1 0,0 ${t*.25},${0}
a${n},${n} 1 0,0 ${t*.25},${1*a*.1}
a${n},${n} 1 0,0 ${t*.15},${1*a*.33}
a${n*.8},${n*.8} 1 0,0 ${0},${1*a*.34}
a${n},${n} 1 0,0 ${-1*t*.15},${1*a*.33}
a${n},${n} 1 0,0 ${-1*t*.25},${a*.15}
a${n},${n} 1 0,0 ${-1*t*.25},${0}
a${n},${n} 1 0,0 ${-1*t*.25},${0}
a${n},${n} 1 0,0 ${-1*t*.25},${-1*a*.15}
a${n},${n} 1 0,0 ${-1*t*.1},${-1*a*.33}
a${n*.8},${n*.8} 1 0,0 ${0},${-1*a*.34}
a${n},${n} 1 0,0 ${t*.1},${-1*a*.33}
H0 V0 Z`)},pd=function(r,e){r.append("circle").attr("id","node-"+e.id).attr("class","node-bkg node-"+fr(e.type)).attr("r",e.width/2)};function yd(r,e,t,a,n){return r.insert("polygon",":first-child").attr("points",a.map(function(i){return i.x+","+i.y}).join(" ")).attr("transform","translate("+(n.width-e)/2+", "+t+")")}const md=function(r,e){const t=e.height,n=t/4,i=e.width-e.padding+2*n,s=[{x:n,y:0},{x:i-n,y:0},{x:i,y:-t/2},{x:i-n,y:-t},{x:n,y:-t},{x:0,y:-t/2}];yd(r,i,t,s,e)},bd=function(r,e){r.append("rect").attr("id","node-"+e.id).attr("class","node-bkg node-"+fr(e.type)).attr("height",e.height).attr("rx",e.padding).attr("ry",e.padding).attr("width",e.width)},Ed=function(r,e,t,a){const n=t%(Qo-1),i=r.append("g");e.section=n;let s="section-"+n;n<0&&(s+=" section-root"),i.attr("class",(e.class?e.class+" ":"")+"mindmap-node "+s);const o=i.append("g"),u=i.append("g"),f=u.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(hd,e.width).node().getBBox(),h=a.fontSize.replace?a.fontSize.replace("px",""):a.fontSize;if(e.height=f.height+h*1.1*.5+e.padding,e.width=f.width+2*e.padding,e.icon)if(e.type===Oe.CIRCLE)e.height+=50,e.width+=50,i.append("foreignObject").attr("height","50px").attr("width",e.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+n+" "+e.icon),u.attr("transform","translate("+e.width/2+", "+(e.height/2-1.5*e.padding)+")");else{e.width+=50;const c=e.height;e.height=Math.max(c,60);const v=Math.abs(e.height-c);i.append("foreignObject").attr("width","60px").attr("height",e.height).attr("style","text-align: center;margin-top:"+v/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+n+" "+e.icon),u.attr("transform","translate("+(25+e.width/2)+", "+(v/2+e.padding/2)+")")}else u.attr("transform","translate("+e.width/2+", "+e.padding/2+")");switch(e.type){case Oe.DEFAULT:vd(o,e,n);break;case Oe.ROUNDED_RECT:bd(o,e);break;case Oe.RECT:cd(o,e);break;case Oe.CIRCLE:o.attr("transform","translate("+e.width/2+", "+ +e.height/2+")"),pd(o,e);break;case Oe.CLOUD:dd(o,e);break;case Oe.BANG:gd(o,e);break;case Oe.HEXAGON:md(o,e);break}return Ko(e.id,i),e.height},wd=function(e,t,a,n,i){const s=i%(Qo-1),o=a.x+a.width/2,u=a.y+a.height/2,l=t.x+t.width/2,f=t.y+t.height/2,h=l>o?o+Math.abs(o-l)/2:o-Math.abs(o-l)/2,c=f>u?u+Math.abs(u-f)/2:u-Math.abs(u-f)/2,v=l>o?Math.abs(o-h)/2+o:-Math.abs(o-h)/2+o,d=f>u?Math.abs(u-c)/2+u:-Math.abs(u-c)/2+u;e.append("path").attr("d",a.direction==="TB"||a.direction==="BT"?`M${o},${u} Q${o},${d} ${h},${c} T${l},${f}`:`M${o},${u} Q${v},${u} ${h},${c} T${l},${f}`).attr("class","edge section-edge-"+s+" edge-depth-"+n)},xd=function(r){const e=ni(r.id),t=r.x||0,a=r.y||0;e.attr("transform","translate("+t+","+a+")")},Jo={drawNode:Ed,positionNode:xd,drawEdge:wd};qo.use(jc);function jo(r,e,t,a){Jo.drawNode(r,e,t,a),e.children&&e.children.forEach((n,i)=>{jo(r,n,t<0?i:t,a)})}function Td(r,e){e.edges().map((t,a)=>{const n=t.data();if(t[0]._private.bodyBounds){const i=t[0]._private.rscratch;or.trace("Edge: ",a,n),r.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+n.section+" edge-depth-"+n.depth)}})}function eu(r,e,t,a){e.add({group:"nodes",data:{id:r.id,labelText:r.descr,height:r.height,width:r.width,level:a,nodeId:r.id,padding:r.padding,type:r.type},position:{x:r.x,y:r.y}}),r.children&&r.children.forEach(n=>{eu(n,e,t,a+1),e.add({group:"edges",data:{id:`${r.id}_${n.id}`,source:r.id,target:n.id,depth:a,section:n.section}})})}function Dd(r,e){return new Promise(t=>{const a=Xr("body").append("div").attr("id","cy").attr("style","display:none"),n=qo({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});a.remove(),eu(r,n,e,0),n.nodes().forEach(function(i){i.layoutDimensions=()=>{const s=i.data();return{w:s.width,h:s.height}}}),n.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),n.ready(i=>{or.info("Ready",i),t(n)})})}function Cd(r){r.nodes().map((e,t)=>{const a=e.data();a.x=e.position().x,a.y=e.position().y,Jo.positionNode(a);const n=ni(a.nodeId);or.info("Id:",t,"Position: (",e.position().x,", ",e.position().y,")",a),n.attr("transform",`translate(${e.position().x-a.width/2}, ${e.position().y-a.height/2})`),n.attr("attr",`apa-${t})`)})}const Ld=async(r,e,t,a)=>{const n=_r();a.db.clear(),a.parser.parse(r),or.debug(`Renering info diagram
`+r);const i=_r().securityLevel;let s;i==="sandbox"&&(s=Xr("#i"+e));const u=(i==="sandbox"?Xr(s.nodes()[0].contentDocument.body):Xr("body")).select("#"+e);u.append("g");const l=a.db.getMindmap(),f=u.append("g");f.attr("class","mindmap-edges");const h=u.append("g");h.attr("class","mindmap-nodes"),jo(h,l,-1,n);const c=await Dd(l,n);Td(f,c),Cd(c),Du(void 0,u,n.mindmap.padding,n.mindmap.useMaxWidth)},Sd={draw:Ld},Ad=r=>{let e="";for(let t=0;t<r.THEME_COLOR_LIMIT;t++)r["lineColor"+t]=r["lineColor"+t]||r["cScaleInv"+t],Su(r["lineColor"+t])?r["lineColor"+t]=Cu(r["lineColor"+t],20):r["lineColor"+t]=Lu(r["lineColor"+t],20);for(let t=0;t<r.THEME_COLOR_LIMIT;t++){const a=""+(17-3*t);e+=`
.section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {
fill: ${r["cScale"+t]};
}
.section-${t-1} text {
fill: ${r["cScaleLabel"+t]};
}
.node-icon-${t-1} {
font-size: 40px;
color: ${r["cScaleLabel"+t]};
}
.section-edge-${t-1}{
stroke: ${r["cScale"+t]};
}
.edge-depth-${t-1}{
stroke-width: ${a};
}
.section-${t-1} line {
stroke: ${r["cScaleInv"+t]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
`}return e},Nd=r=>`
.edge {
stroke-width: 3;
}
${Ad(r)}
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${r.git0};
}
.section-root text {
fill: ${r.gitBranchLabel0};
}
.icon-container {
height:100%;
display: flex;
justify-content: center;
align-items: center;
}
.edge {
fill: none;
}
`,Md=Nd,Rd={db:fd,renderer:Sd,parser:ed,styles:Md};export{Rd as diagram};