%PDF- %PDF-
Direktori : /var/www/projetos/suporte.iigd.com.br/public/lib/ |
Current File : /var/www/projetos/suporte.iigd.com.br/public/lib/cytoscape.min.js |
(()=>{var e=Array(41).concat([e=>{e.exports=function(e){function t(e){typeof console!=="undefined"&&(console.error||console.log)("[Script Loader]",e)}function r(){return typeof attachEvent!=="undefined"&&typeof addEventListener==="undefined"}try{if(typeof execScript!=="undefined"&&r()){execScript(e)}else if(typeof eval!=="undefined"){eval.call(null,e)}else{t("EvalError: No eval function available")}}catch(e){t(e)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,(e,t,r)=>{"use strict";var n=r(137);var a=r(151);var i=r(153);var o=r(196);var s=r(202);function u(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var l=u(n);var f=u(a);var v=u(i);var c=u(o);var d=u(s);function h(e){"@babel/helpers - typeof";return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function p(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function y(e,t,r){if(t)g(e.prototype,t);if(r)g(e,r);Object.defineProperty(e,"prototype",{writable:false});return e}function m(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function b(e,t){return x(e)||w(e,t)||E(e,t)||_()}function x(e){if(Array.isArray(e))return e}function w(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var i=false;var o,s;try{for(r=r.call(e);!(a=(o=r.next()).done);a=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){i=true;s=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(i)throw s}}return n}function E(e,t){if(!e)return;if(typeof e==="string")return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(e,t)}function k(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var S=typeof window==="undefined"?null:window;var D=S?S.navigator:null;S?S.document:null;var C=h("");var T=h({});var P=h((function(){}));var M=typeof HTMLElement==="undefined"?"undefined":h(HTMLElement);var I=function e(t){return t&&t.instanceString&&N(t.instanceString)?t.instanceString():null};var O=function e(t){return t!=null&&h(t)==C};var N=function e(t){return t!=null&&h(t)===P};var z=function e(t){return!F(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)};var L=function e(t){return t!=null&&h(t)===T&&!z(t)&&t.constructor===Object};var A=function e(t){return t!=null&&h(t)===T};var B=function e(t){return t!=null&&h(t)===h(1)&&!isNaN(t)};var R=function e(t){return B(t)&&Math.floor(t)===t};var j=function e(t){if("undefined"===M){return undefined}else{return null!=t&&t instanceof HTMLElement}};var F=function e(t){return V(t)||q(t)};var V=function e(t){return I(t)==="collection"&&t._private.single};var q=function e(t){return I(t)==="collection"&&!t._private.single};var G=function e(t){return I(t)==="core"};var Y=function e(t){return I(t)==="stylesheet"};var W=function e(t){return I(t)==="event"};var X=function e(t){if(t===undefined||t===null){return true}else if(t===""||t.match(/^\s+$/)){return true}return false};var H=function e(t){if(typeof HTMLElement==="undefined"){return false}else{return t instanceof HTMLElement}};var U=function e(t){return L(t)&&B(t.x1)&&B(t.x2)&&B(t.y1)&&B(t.y2)};var K=function e(t){return A(t)&&N(t.then)};var Z=function e(){return D&&D.userAgent.match(/msie|trident|edge/i)};var $=function e(t,r){if(!r){r=function e(){if(arguments.length===1){return arguments[0]}else if(arguments.length===0){return"undefined"}var t=[];for(var r=0;r<arguments.length;r++){t.push(arguments[r])}return t.join("$")}}var n=function e(){var n=this;var a=arguments;var i;var o=r.apply(n,a);var s=e.cache;if(!(i=s[o])){i=s[o]=t.apply(n,a)}return i};n.cache={};return n};var Q=$((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))}));var J=$((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))}));var ee=$((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t}));var te=function e(t){if(X(t)){return t}return t.charAt(0).toUpperCase()+t.substring(1)};var re="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))";var ne="rgb[a]?\\(("+re+"[%]?)\\s*,\\s*("+re+"[%]?)\\s*,\\s*("+re+"[%]?)(?:\\s*,\\s*("+re+"))?\\)";var ae="rgb[a]?\\((?:"+re+"[%]?)\\s*,\\s*(?:"+re+"[%]?)\\s*,\\s*(?:"+re+"[%]?)(?:\\s*,\\s*(?:"+re+"))?\\)";var ie="hsl[a]?\\(("+re+")\\s*,\\s*("+re+"[%])\\s*,\\s*("+re+"[%])(?:\\s*,\\s*("+re+"))?\\)";var oe="hsl[a]?\\((?:"+re+")\\s*,\\s*(?:"+re+"[%])\\s*,\\s*(?:"+re+"[%])(?:\\s*,\\s*(?:"+re+"))?\\)";var se="\\#[0-9a-fA-F]{3}";var ue="\\#[0-9a-fA-F]{6}";var le=function e(t,r){if(t<r){return-1}else if(t>r){return 1}else{return 0}};var fe=function e(t,r){return-1*le(t,r)};var ve=Object.assign!=null?Object.assign.bind(Object):function(e){var t=arguments;for(var r=1;r<t.length;r++){var n=t[r];if(n==null){continue}var a=Object.keys(n);for(var i=0;i<a.length;i++){var o=a[i];e[o]=n[o]}}return e};var ce=function e(t){if(!(t.length===4||t.length===7)||t[0]!=="#"){return}var r=t.length===4;var n,a,i;var o=16;if(r){n=parseInt(t[1]+t[1],o);a=parseInt(t[2]+t[2],o);i=parseInt(t[3]+t[3],o)}else{n=parseInt(t[1]+t[2],o);a=parseInt(t[3]+t[4],o);i=parseInt(t[5]+t[6],o)}return[n,a,i]};var de=function e(t){var r;var n,a,i,o,s,u,l;function f(e,t,r){if(r<0)r+=1;if(r>1)r-=1;if(r<1/6)return e+(t-e)*6*r;if(r<1/2)return t;if(r<2/3)return e+(t-e)*(2/3-r)*6;return e}var v=new RegExp("^"+ie+"$").exec(t);if(v){n=parseInt(v[1]);if(n<0){n=(360- -1*n%360)%360}else if(n>360){n=n%360}n/=360;a=parseFloat(v[2]);if(a<0||a>100){return}a=a/100;i=parseFloat(v[3]);if(i<0||i>100){return}i=i/100;o=v[4];if(o!==undefined){o=parseFloat(o);if(o<0||o>1){return}}if(a===0){s=u=l=Math.round(i*255)}else{var c=i<.5?i*(1+a):i+a-i*a;var d=2*i-c;s=Math.round(255*f(d,c,n+1/3));u=Math.round(255*f(d,c,n));l=Math.round(255*f(d,c,n-1/3))}r=[s,u,l,o]}return r};var he=function e(t){var r;var n=new RegExp("^"+ne+"$").exec(t);if(n){r=[];var a=[];for(var i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"){a[i]=true}o=parseFloat(o);if(a[i]){o=o/100*255}if(o<0||o>255){return}r.push(Math.floor(o))}var s=a[1]||a[2]||a[3];var u=a[1]&&a[2]&&a[3];if(s&&!u){return}var l=n[4];if(l!==undefined){l=parseFloat(l);if(l<0||l>1){return}r.push(l)}}return r};var pe=function e(t){return ye[t.toLowerCase()]};var ge=function e(t){return(z(t)?t:null)||pe(t)||ce(t)||he(t)||de(t)};var ye={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]};var me=function e(t){var r=t.map;var n=t.keys;var a=n.length;for(var i=0;i<a;i++){var o=n[i];if(L(o)){throw Error("Tried to set map with object key")}if(i<n.length-1){if(r[o]==null){r[o]={}}r=r[o]}else{r[o]=t.value}}};var be=function e(t){var r=t.map;var n=t.keys;var a=n.length;for(var i=0;i<a;i++){var o=n[i];if(L(o)){throw Error("Tried to get map with object key")}r=r[o];if(r==null){return r}}return r};var xe=S?S.performance:null;var we=xe&&xe.now?function(){return xe.now()}:function(){return Date.now()};var Ee=function(){if(S){if(S.requestAnimationFrame){return function(e){S.requestAnimationFrame(e)}}else if(S.mozRequestAnimationFrame){return function(e){S.mozRequestAnimationFrame(e)}}else if(S.webkitRequestAnimationFrame){return function(e){S.webkitRequestAnimationFrame(e)}}else if(S.msRequestAnimationFrame){return function(e){S.msRequestAnimationFrame(e)}}}return function(e){if(e){setTimeout((function(){e(we())}),1e3/60)}}}();var ke=function e(t){return Ee(t)};var _e=we;var Se=9261;var De=65599;var Ce=5381;var Te=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Se;var n=r;var a;for(;;){a=t.next();if(a.done){break}n=n*De+a.value|0}return n};var Pe=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Se;return r*De+t|0};var Me=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ce;return(r<<5)+r+t|0};var Ie=function e(t,r){return t*2097152+r};var Oe=function e(t){return t[0]*2097152+t[1]};var Ne=function e(t,r){return[Pe(t[0],r[0]),Me(t[1],r[1])]};var ze=function e(t,r){var n={value:0,done:false};var a=0;var i=t.length;var o={next:function e(){if(a<i){n.value=t[a++]}else{n.done=true}return n}};return Te(o,r)};var Le=function e(t,r){var n={value:0,done:false};var a=0;var i=t.length;var o={next:function e(){if(a<i){n.value=t.charCodeAt(a++)}else{n.done=true}return n}};return Te(o,r)};var Ae=function e(){return Be(arguments)};var Be=function e(t){var r;for(var n=0;n<t.length;n++){var a=t[n];if(n===0){r=Le(a)}else{r=Le(a,r)}}return r};var Re=true;var je=console.warn!=null;var Fe=console.trace!=null;var Ve=Number.MAX_SAFE_INTEGER||9007199254740991;var qe=function e(){return true};var Ge=function e(){return false};var Ye=function e(){return 0};var We=function e(){};var Xe=function e(t){throw new Error(t)};var He=function e(t){if(t!==undefined){Re=!!t}else{return Re}};var Ue=function e(t){if(!He()){return}if(je){console.warn(t)}else{console.log(t);if(Fe){console.trace()}}};var Ke=function e(t){return ve({},t)};var Ze=function e(t){if(t==null){return t}if(z(t)){return t.slice()}else if(L(t)){return Ke(t)}else{return t}};var $e=function e(t){return t.slice()};var Qe=function e(t,r){for(r=t="";t++<36;r+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-"){}return r};var Je={};var et=function e(){return Je};var tt=function e(t){var r=Object.keys(t);return function(e){var n={};for(var a=0;a<r.length;a++){var i=r[a];var o=e==null?undefined:e[i];n[i]=o===undefined?t[i]:o}return n}};var rt=function e(t,r,n){for(var a=t.length-1;a>=0;a--){if(t[a]===r){t.splice(a,1);if(n){break}}}};var nt=function e(t){t.splice(0,t.length)};var at=function e(t,r){for(var n=0;n<r.length;n++){var a=r[n];t.push(a)}};var it=function e(t,r,n){if(n){r=ee(n,r)}return t[r]};var ot=function e(t,r,n,a){if(n){r=ee(n,r)}t[r]=a};var st=function(){function e(){p(this,e);this._obj={}}y(e,[{key:"set",value:function e(t,r){this._obj[t]=r;return this}},{key:"delete",value:function e(t){this._obj[t]=undefined;return this}},{key:"clear",value:function e(){this._obj={}}},{key:"has",value:function e(t){return this._obj[t]!==undefined}},{key:"get",value:function e(t){return this._obj[t]}}]);return e}();var ut=typeof Map!=="undefined"?Map:st;var lt="undefined";var ft=function(){function e(t){p(this,e);this._obj=Object.create(null);this.size=0;if(t!=null){var r;if(t.instanceString!=null&&t.instanceString()===this.instanceString()){r=t.toArray()}else{r=t}for(var n=0;n<r.length;n++){this.add(r[n])}}}y(e,[{key:"instanceString",value:function e(){return"set"}},{key:"add",value:function e(t){var r=this._obj;if(r[t]!==1){r[t]=1;this.size++}}},{key:"delete",value:function e(t){var r=this._obj;if(r[t]===1){r[t]=0;this.size--}}},{key:"clear",value:function e(){this._obj=Object.create(null)}},{key:"has",value:function e(t){return this._obj[t]===1}},{key:"toArray",value:function e(){var t=this;return Object.keys(this._obj).filter((function(e){return t.has(e)}))}},{key:"forEach",value:function e(t,r){return this.toArray().forEach(t,r)}}]);return e}();var vt=(typeof Set==="undefined"?"undefined":h(Set))!==lt?Set:ft;var ct=function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(t===undefined||r===undefined||!G(t)){Xe("An element must have a core reference and parameters set");return}var a=r.group;if(a==null){if(r.data&&r.data.source!=null&&r.data.target!=null){a="edges"}else{a="nodes"}}if(a!=="nodes"&&a!=="edges"){Xe("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1;this[0]=this;var i=this._private={cy:t,single:true,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:undefined,autoHeight:undefined,autoPadding:undefined,compoundBoundsClean:false,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:true,selected:r.selected?true:false,selectable:r.selectable===undefined?true:r.selectable?true:false,locked:r.locked?true:false,grabbed:false,grabbable:r.grabbable===undefined?true:r.grabbable?true:false,pannable:r.pannable===undefined?a==="edges"?true:false:r.pannable?true:false,active:false,classes:new vt,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:false,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}if(i.position.y==null){i.position.y=0}if(r.renderedPosition){var o=r.renderedPosition;var s=t.pan();var u=t.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];if(z(r.classes)){l=r.classes}else if(O(r.classes)){l=r.classes.split(/\s+/)}for(var f=0,v=l.length;f<v;f++){var c=l[f];if(!c||c===""){continue}i.classes.add(c)}this.createEmitter();var d=r.style||r.css;if(d){Ue("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead.");this.style(d)}if(n===undefined||n){this.restore()}};var dt=function e(t){t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs};return function e(r,n,a){var i;if(L(r)&&!F(r)){i=r;r=i.roots||i.root;n=i.visit;a=i.directed}a=arguments.length===2&&!N(n)?n:a;n=N(n)?n:function(){};var o=this._private.cy;var s=r=O(r)?this.filter(r):r;var u=[];var l=[];var f={};var v={};var c={};var d=0;var h;var p=this.byGroup(),g=p.nodes,y=p.edges;for(var m=0;m<s.length;m++){var b=s[m];var x=b.id();if(b.isNode()){u.unshift(b);if(t.bfs){c[x]=true;l.push(b)}v[x]=0}}var w=function e(){var r=t.bfs?u.shift():u.pop();var i=r.id();if(t.dfs){if(c[i]){return"continue"}c[i]=true;l.push(r)}var o=v[i];var s=f[i];var p=s!=null?s.source():null;var m=s!=null?s.target():null;var b=s==null?undefined:r.same(p)?m[0]:p[0];var x=void 0;x=n(r,s,b,d++,o);if(x===true){h=r;return"break"}if(x===false){return"break"}var w=r.connectedEdges().filter((function(e){return(!a||e.source().same(r))&&y.has(e)}));for(var E=0;E<w.length;E++){var k=w[E];var _=k.connectedNodes().filter((function(e){return!e.same(r)&&g.has(e)}));var S=_.id();if(_.length!==0&&!c[S]){_=_[0];u.push(_);if(t.bfs){c[S]=true;l.push(_)}f[S]=k;v[S]=v[i]+1}}};while(u.length!==0){var E=w();if(E==="continue")continue;if(E==="break")break}var k=o.collection();for(var _=0;_<l.length;_++){var S=l[_];var D=f[S.id()];if(D!=null){k.push(D)}k.push(S)}return{path:o.collection(k),found:o.collection(h)}}};var ht={breadthFirstSearch:dt({bfs:true}),depthFirstSearch:dt({dfs:true})};ht.bfs=ht.breadthFirstSearch;ht.dfs=ht.depthFirstSearch;var pt=tt({root:null,weight:function e(t){return 1},directed:false});var gt={dijkstra:function e(t){if(!L(t)){var r=arguments;t={root:r[0],weight:r[1],directed:r[2]}}var n=pt(t),a=n.root,i=n.weight,o=n.directed;var s=this;var u=i;var l=O(a)?this.filter(a)[0]:a[0];var v={};var c={};var d={};var h=this.byGroup(),p=h.nodes,g=h.edges;g.unmergeBy((function(e){return e.isLoop()}));var y=function e(t){return v[t.id()]};var m=function e(t,r){v[t.id()]=r;b.updateItem(t)};var b=new f["default"]((function(e,t){return y(e)-y(t)}));for(var x=0;x<p.length;x++){var w=p[x];v[w.id()]=w.same(l)?0:Infinity;b.push(w)}var E=function e(t,r){var n=(o?t.edgesTo(r):t.edgesWith(r)).intersect(g);var a=Infinity;var i;for(var s=0;s<n.length;s++){var l=n[s];var f=u(l);if(f<a||!i){a=f;i=l}}return{edge:i,dist:a}};while(b.size()>0){var k=b.pop();var _=y(k);var S=k.id();d[S]=_;if(_===Infinity){continue}var D=k.neighborhood().intersect(p);for(var C=0;C<D.length;C++){var T=D[C];var P=T.id();var M=E(k,T);var I=_+M.dist;if(I<y(T)){m(T,I);c[P]={node:k,edge:M.edge}}}}return{distanceTo:function e(t){var r=O(t)?p.filter(t)[0]:t[0];return d[r.id()]},pathTo:function e(t){var r=O(t)?p.filter(t)[0]:t[0];var n=[];var a=r;var i=a.id();if(r.length>0){n.unshift(r);while(c[i]){var o=c[i];n.unshift(o.edge);n.unshift(o.node);a=o.node;i=a.id()}}return s.spawn(n)}}}};var yt={kruskal:function e(t){t=t||function(e){return 1};var r=this.byGroup(),n=r.nodes,a=r.edges;var i=n.length;var o=new Array(i);var s=n;var u=function e(t){for(var r=0;r<o.length;r++){var n=o[r];if(n.has(t)){return r}}};for(var l=0;l<i;l++){o[l]=this.spawn(n[l])}var f=a.sort((function(e,r){return t(e)-t(r)}));for(var v=0;v<f.length;v++){var c=f[v];var d=c.source()[0];var h=c.target()[0];var p=u(d);var g=u(h);var y=o[p];var m=o[g];if(p!==g){s.merge(c);y.merge(m);o.splice(g,1)}}return s}};var mt=tt({root:null,goal:null,weight:function e(t){return 1},heuristic:function e(t){return 0},directed:false});var bt={aStar:function e(t){var r=this.cy();var n=mt(t),a=n.root,i=n.goal,o=n.heuristic,s=n.directed,u=n.weight;a=r.collection(a)[0];i=r.collection(i)[0];var l=a.id();var v=i.id();var c={};var d={};var h={};var p=new f["default"]((function(e,t){return d[e.id()]-d[t.id()]}));var g=new vt;var y={};var m={};var b=function e(t,r){p.push(t);g.add(r)};var x,w;var E=function e(){x=p.pop();w=x.id();g["delete"](w)};var k=function e(t){return g.has(t)};b(a,l);c[l]=0;d[l]=o(a);var _=0;while(p.size()>0){E();_++;if(w===v){var S=[];var D=i;var C=v;var T=m[C];for(;;){S.unshift(D);if(T!=null){S.unshift(T)}D=y[C];if(D==null){break}C=D.id();T=m[C]}return{found:true,distance:c[w],path:this.spawn(S),steps:_}}h[w]=true;var P=x._private.edges;for(var M=0;M<P.length;M++){var I=P[M];if(!this.hasElementWithId(I.id())){continue}if(s&&I.data("source")!==w){continue}var O=I.source();var N=I.target();var z=O.id()!==w?O:N;var L=z.id();if(!this.hasElementWithId(L)){continue}if(h[L]){continue}var A=c[w]+u(I);if(!k(L)){c[L]=A;d[L]=A+o(z);b(z,L);y[L]=x;m[L]=I;continue}if(A<c[L]){c[L]=A;d[L]=A+o(z);y[L]=x;m[L]=I}}}return{found:false,distance:undefined,path:undefined,steps:_}}};var xt=tt({weight:function e(t){return 1},directed:false});var wt={floydWarshall:function e(t){var r=this.cy();var n=xt(t),a=n.weight,i=n.directed;var o=a;var s=this.byGroup(),u=s.nodes,l=s.edges;var f=u.length;var v=f*f;var c=function e(t){return u.indexOf(t)};var d=function e(t){return u[t]};var h=new Array(v);for(var p=0;p<v;p++){var g=p%f;var y=(p-g)/f;if(y===g){h[p]=0}else{h[p]=Infinity}}var m=new Array(v);var b=new Array(v);for(var x=0;x<l.length;x++){var w=l[x];var E=w.source()[0];var k=w.target()[0];if(E===k){continue}var _=c(E);var S=c(k);var D=_*f+S;var C=o(w);if(h[D]>C){h[D]=C;m[D]=S;b[D]=w}if(!i){var T=S*f+_;if(!i&&h[T]>C){h[T]=C;m[T]=_;b[T]=w}}}for(var P=0;P<f;P++){for(var M=0;M<f;M++){var I=M*f+P;for(var N=0;N<f;N++){var z=M*f+N;var L=P*f+N;if(h[I]+h[L]<h[z]){h[z]=h[I]+h[L];m[z]=m[I]}}}}var A=function e(t){return(O(t)?r.filter(t):t)[0]};var B=function e(t){return c(A(t))};var R={distance:function e(t,r){var n=B(t);var a=B(r);return h[n*f+a]},path:function e(t,n){var a=B(t);var i=B(n);var o=d(a);if(a===i){return o.collection()}if(m[a*f+i]==null){return r.collection()}var e=r.collection();var s=a;var u;e.merge(o);while(a!==i){s=a;a=m[a*f+i];u=b[s*f+a];e.merge(u);e.merge(d(a))}return e}};return R}};var Et=tt({weight:function e(t){return 1},directed:false,root:null});var kt={bellmanFord:function e(t){var r=this;var n=Et(t),a=n.weight,i=n.directed,o=n.root;var s=a;var u=this;var l=this.cy();var f=this.byGroup(),v=f.edges,c=f.nodes;var d=c.length;var h=new ut;var p=false;var g=[];o=l.collection(o)[0];v.unmergeBy((function(e){return e.isLoop()}));var y=v.length;var m=function e(t){var r=h.get(t.id());if(!r){r={};h.set(t.id(),r)}return r};var b=function e(t){return(O(t)?l.$(t):t)[0]};var x=function e(t){return m(b(t)).dist};var w=function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:o;var a=b(t);var i=[];var s=a;for(;;){if(s==null){return r.spawn()}var l=m(s),f=l.edge,v=l.pred;i.unshift(s[0]);if(s.same(n)&&i.length>0){break}if(f!=null){i.unshift(f)}s=v}return u.spawn(i)};for(var E=0;E<d;E++){var k=c[E];var _=m(k);if(k.same(o)){_.dist=0}else{_.dist=Infinity}_.pred=null;_.edge=null}var S=false;var D=function e(t,r,n,a,i,o){var s=a.dist+o;if(s<i.dist&&!n.same(a.edge)){i.dist=s;i.pred=t;i.edge=n;S=true}};for(var C=1;C<d;C++){S=false;for(var T=0;T<y;T++){var P=v[T];var M=P.source();var I=P.target();var N=s(P);var z=m(M);var L=m(I);D(M,I,P,z,L,N);if(!i){D(I,M,P,L,z,N)}}if(!S){break}}if(S){var A=[];for(var B=0;B<y;B++){var R=v[B];var j=R.source();var F=R.target();var V=s(R);var q=m(j).dist;var G=m(F).dist;if(q+V<G||!i&&G+V<q){if(!p){Ue("Graph contains a negative weight cycle for Bellman-Ford");p=true}if(t.findNegativeWeightCycles!==false){var Y=[];if(q+V<G){Y.push(j)}if(!i&&G+V<q){Y.push(F)}var W=Y.length;for(var X=0;X<W;X++){var H=Y[X];var U=[H];U.push(m(H).edge);var K=m(H).pred;while(U.indexOf(K)===-1){U.push(K);U.push(m(K).edge);K=m(K).pred}U=U.slice(U.indexOf(K));var Z=U[0].id();var $=0;for(var Q=2;Q<U.length;Q+=2){if(U[Q].id()<Z){Z=U[Q].id();$=Q}}U=U.slice($).concat(U.slice(0,$));U.push(U[0]);var J=U.map((function(e){return e.id()})).join(",");if(A.indexOf(J)===-1){g.push(u.spawn(U));A.push(J)}}}else{break}}}}return{distanceTo:x,pathTo:w,hasNegativeWeightCycle:p,negativeWeightCycles:g}}};var _t=Math.sqrt(2);var St=function e(t,r,n){if(n.length===0){Xe("Karger-Stein must be run on a connected (sub)graph")}var a=n[t];var i=a[1];var o=a[2];var s=r[i];var u=r[o];var l=n;for(var f=l.length-1;f>=0;f--){var v=l[f];var c=v[1];var d=v[2];if(r[c]===s&&r[d]===u||r[c]===u&&r[d]===s){l.splice(f,1)}}for(var h=0;h<l.length;h++){var p=l[h];if(p[1]===u){l[h]=p.slice();l[h][1]=s}else if(p[2]===u){l[h]=p.slice();l[h][2]=s}}for(var g=0;g<r.length;g++){if(r[g]===u){r[g]=s}}return l};var Dt=function e(t,r,n,a){while(n>a){var i=Math.floor(Math.random()*r.length);r=St(i,t,r);n--}return r};var Ct={kargerStein:function e(){var t=this;var r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy((function(e){return e.isLoop()}));var i=n.length;var o=a.length;var s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2));var u=Math.floor(i/_t);if(i<2){Xe("At least 2 nodes are required for Karger-Stein algorithm");return undefined}var l=[];for(var f=0;f<o;f++){var v=a[f];l.push([f,n.indexOf(v.source()),n.indexOf(v.target())])}var c=Infinity;var d=[];var h=new Array(i);var p=new Array(i);var g=new Array(i);var y=function e(t,r){for(var n=0;n<i;n++){r[n]=t[n]}};for(var m=0;m<=s;m++){for(var b=0;b<i;b++){p[b]=b}var x=Dt(p,l.slice(),i,u);var w=x.slice();y(p,g);var E=Dt(p,x,u,2);var k=Dt(g,w,u,2);if(E.length<=k.length&&E.length<c){c=E.length;d=E;y(p,h)}else if(k.length<=E.length&&k.length<c){c=k.length;d=k;y(g,h)}}var _=this.spawn(d.map((function(e){return a[e[0]]})));var S=this.spawn();var D=this.spawn();var C=h[0];for(var T=0;T<h.length;T++){var P=h[T];var M=n[T];if(P===C){S.merge(M)}else{D.merge(M)}}var I=function e(r){var n=t.spawn();r.forEach((function(e){n.merge(e);e.connectedEdges().forEach((function(e){if(t.contains(e)&&!_.contains(e)){n.merge(e)}}))}));return n};var O=[I(S),I(D)];var N={cut:_,components:O,partition1:S,partition2:D};return N}};var Tt=function e(t){return{x:t.x,y:t.y}};var Pt=function e(t,r,n){return{x:t.x*r+n.x,y:t.y*r+n.y}};var Mt=function e(t,r,n){return{x:(t.x-n.x)/r,y:(t.y-n.y)/r}};var It=function e(t){return{x:t[0],y:t[1]}};var Ot=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var e=Infinity;for(var a=r;a<n;a++){var i=t[a];if(isFinite(i)){e=Math.min(i,e)}}return e};var Nt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var e=-Infinity;for(var a=r;a<n;a++){var i=t[a];if(isFinite(i)){e=Math.max(i,e)}}return e};var zt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var a=0;var i=0;for(var o=r;o<n;o++){var s=t[o];if(isFinite(s)){a+=s;i++}}return a/i};var Lt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;if(a){t=t.slice(r,n)}else{if(n<t.length){t.splice(n,t.length-n)}if(r>0){t.splice(0,r)}}var s=0;for(var u=t.length-1;u>=0;u--){var l=t[u];if(o){if(!isFinite(l)){t[u]=-Infinity;s++}}else{t.splice(u,1)}}if(i){t.sort((function(e,t){return e-t}))}var f=t.length;var v=Math.floor(f/2);if(f%2!==0){return t[v+1+s]}else{return(t[v-1+s]+t[v+s])/2}};var At=function e(t){return Math.PI*t/180};var Bt=function e(t,r){return Math.atan2(r,t)-Math.PI/2};var Rt=Math.log2||function(e){return Math.log(e)/Math.log(2)};var jt=function e(t){if(t>0){return 1}else if(t<0){return-1}else{return 0}};var Ft=function e(t,r){return Math.sqrt(Vt(t,r))};var Vt=function e(t,r){var n=r.x-t.x;var a=r.y-t.y;return n*n+a*a};var qt=function e(t){var r=t.length;var n=0;for(var a=0;a<r;a++){n+=t[a]}for(var i=0;i<r;i++){t[i]=t[i]/n}return t};var Gt=function e(t,r,n,a){return(1-a)*(1-a)*t+2*(1-a)*a*r+a*a*n};var Yt=function e(t,r,n,a){return{x:Gt(t.x,r.x,n.x,a),y:Gt(t.y,r.y,n.y,a)}};var Wt=function e(t,r,n,a){var i={x:r.x-t.x,y:r.y-t.y};var o=Ft(t,r);var s={x:i.x/o,y:i.y/o};n=n==null?0:n;a=a!=null?a:n*o;return{x:t.x+s.x*a,y:t.y+s.y*a}};var Xt=function e(t,r,n){return Math.max(t,Math.min(n,r))};var Ht=function e(t){if(t==null){return{x1:Infinity,y1:Infinity,x2:-Infinity,y2:-Infinity,w:0,h:0}}else if(t.x1!=null&&t.y1!=null){if(t.x2!=null&&t.y2!=null&&t.x2>=t.x1&&t.y2>=t.y1){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1}}else if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0){return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}}};var Ut=function e(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}};var Kt=function e(t){t.x1=Infinity;t.y1=Infinity;t.x2=-Infinity;t.y2=-Infinity;t.w=0;t.h=0};var Zt=function e(t,r,n){return{x1:t.x1+r,x2:t.x2+r,y1:t.y1+n,y2:t.y2+n,w:t.w,h:t.h}};var $t=function e(t,r){t.x1=Math.min(t.x1,r.x1);t.x2=Math.max(t.x2,r.x2);t.w=t.x2-t.x1;t.y1=Math.min(t.y1,r.y1);t.y2=Math.max(t.y2,r.y2);t.h=t.y2-t.y1};var Qt=function e(t,r,n){t.x1=Math.min(t.x1,r);t.x2=Math.max(t.x2,r);t.w=t.x2-t.x1;t.y1=Math.min(t.y1,n);t.y2=Math.max(t.y2,n);t.h=t.y2-t.y1};var Jt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;t.x1-=r;t.x2+=r;t.y1-=r;t.y2+=r;t.w=t.x2-t.x1;t.h=t.y2-t.y1;return t};var er=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];var n,a,i,o;if(r.length===1){n=a=i=o=r[0]}else if(r.length===2){n=i=r[0];o=a=r[1]}else if(r.length===4){var s=b(r,4);n=s[0];a=s[1];i=s[2];o=s[3]}t.x1-=o;t.x2+=a;t.y1-=n;t.y2+=i;t.w=t.x2-t.x1;t.h=t.y2-t.y1;return t};var tr=function e(t,r){t.x1=r.x1;t.y1=r.y1;t.x2=r.x2;t.y2=r.y2;t.w=t.x2-t.x1;t.h=t.y2-t.y1};var rr=function e(t,r){if(t.x1>r.x2){return false}if(r.x1>t.x2){return false}if(t.x2<r.x1){return false}if(r.x2<t.x1){return false}if(t.y2<r.y1){return false}if(r.y2<t.y1){return false}if(t.y1>r.y2){return false}if(r.y1>t.y2){return false}return true};var nr=function e(t,r,n){return t.x1<=r&&r<=t.x2&&t.y1<=n&&n<=t.y2};var ar=function e(t,r){return nr(t,r.x,r.y)};var ir=function e(t,r){return nr(t,r.x1,r.y1)&&nr(t,r.x2,r.y2)};var or=function e(t,r,n,a,i,o,s){var u=Pr(i,o);var l=i/2;var f=o/2;var v;{var c=n-l+u-s;var d=a-f-s;var h=n+l-u+s;var p=d;v=Er(t,r,n,a,c,d,h,p,false);if(v.length>0){return v}}{var g=n+l+s;var y=a-f+u-s;var m=g;var b=a+f-u+s;v=Er(t,r,n,a,g,y,m,b,false);if(v.length>0){return v}}{var x=n-l+u-s;var w=a+f+s;var E=n+l-u+s;var k=w;v=Er(t,r,n,a,x,w,E,k,false);if(v.length>0){return v}}{var _=n-l-s;var S=a-f+u-s;var D=_;var C=a+f-u+s;v=Er(t,r,n,a,_,S,D,C,false);if(v.length>0){return v}}var T;{var P=n-l+u;var M=a-f+u;T=xr(t,r,n,a,P,M,u+s);if(T.length>0&&T[0]<=P&&T[1]<=M){return[T[0],T[1]]}}{var I=n+l-u;var O=a-f+u;T=xr(t,r,n,a,I,O,u+s);if(T.length>0&&T[0]>=I&&T[1]<=O){return[T[0],T[1]]}}{var N=n+l-u;var z=a+f-u;T=xr(t,r,n,a,N,z,u+s);if(T.length>0&&T[0]>=N&&T[1]>=z){return[T[0],T[1]]}}{var L=n-l+u;var A=a+f-u;T=xr(t,r,n,a,L,A,u+s);if(T.length>0&&T[0]<=L&&T[1]>=A){return[T[0],T[1]]}}return[]};var sr=function e(t,r,n,a,i,o,s){var u=s;var l=Math.min(n,i);var f=Math.max(n,i);var v=Math.min(a,o);var c=Math.max(a,o);return l-u<=t&&t<=f+u&&v-u<=r&&r<=c+u};var ur=function e(t,r,n,a,i,o,s,u,l){var f={x1:Math.min(n,s,i)-l,x2:Math.max(n,s,i)+l,y1:Math.min(a,u,o)-l,y2:Math.max(a,u,o)+l};if(t<f.x1||t>f.x2||r<f.y1||r>f.y2){return false}else{return true}};var lr=function e(t,r,n,a){n-=a;var i=r*r-4*t*n;if(i<0){return[]}var o=Math.sqrt(i);var s=2*t;var u=(-r+o)/s;var l=(-r-o)/s;return[u,l]};var fr=function e(t,r,n,a,i){var o=1e-5;if(t===0){t=o}r/=t;n/=t;a/=t;var s,u,l,f,v,c,d,h;u=(3*n-r*r)/9;l=-(27*a)+r*(9*n-2*(r*r));l/=54;s=u*u*u+l*l;i[1]=0;d=r/3;if(s>0){v=l+Math.sqrt(s);v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3);c=l-Math.sqrt(s);c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);i[0]=-d+v+c;d+=(v+c)/2;i[4]=i[2]=-d;d=Math.sqrt(3)*(-c+v)/2;i[3]=d;i[5]=-d;return}i[5]=i[3]=0;if(s===0){h=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3);i[0]=-d+2*h;i[4]=i[2]=-(h+d);return}u=-u;f=u*u*u;f=Math.acos(l/Math.sqrt(f));h=2*Math.sqrt(u);i[0]=-d+h*Math.cos(f/3);i[2]=-d+h*Math.cos((f+2*Math.PI)/3);i[4]=-d+h*Math.cos((f+4*Math.PI)/3);return};var vr=function e(t,r,n,a,i,o,s,u){var l=1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+a*a-4*a*o+2*a*u+4*o*o-4*o*u+u*u;var f=1*9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*a*o-3*a*a-3*a*u-6*o*o+3*o*u;var v=1*3*n*n-6*n*i+n*s-n*t+2*i*i+2*i*t-s*t+3*a*a-6*a*o+a*u-a*r+2*o*o+2*o*r-u*r;var c=1*n*i-n*n+n*t-i*t+a*o-a*a+a*r-o*r;var d=[];fr(l,f,v,c,d);var h=1e-7;var p=[];for(var g=0;g<6;g+=2){if(Math.abs(d[g+1])<h&&d[g]>=0&&d[g]<=1){p.push(d[g])}}p.push(1);p.push(0);var y=-1;var m,b,x;for(var w=0;w<p.length;w++){m=Math.pow(1-p[w],2)*n+2*(1-p[w])*p[w]*i+p[w]*p[w]*s;b=Math.pow(1-p[w],2)*a+2*(1-p[w])*p[w]*o+p[w]*p[w]*u;x=Math.pow(m-t,2)+Math.pow(b-r,2);if(y>=0){if(x<y){y=x}}else{y=x}}return y};var cr=function e(t,r,n,a,i,o){var s=[t-n,r-a];var u=[i-n,o-a];var l=u[0]*u[0]+u[1]*u[1];var f=s[0]*s[0]+s[1]*s[1];var v=s[0]*u[0]+s[1]*u[1];var c=v*v/l;if(v<0){return f}if(c>l){return(t-i)*(t-i)+(r-o)*(r-o)}return f-c};var dr=function e(t,r,n){var a,i,o,s;var u;var l=0;for(var f=0;f<n.length/2;f++){a=n[f*2];i=n[f*2+1];if(f+1<n.length/2){o=n[(f+1)*2];s=n[(f+1)*2+1]}else{o=n[(f+1-n.length/2)*2];s=n[(f+1-n.length/2)*2+1]}if(a==t&&o==t);else if(a>=t&&t>=o||a<=t&&t<=o){u=(t-a)/(o-a)*(s-i)+i;if(u>r){l++}}else{continue}}if(l%2===0){return false}else{return true}};var hr=function e(t,r,n,a,i,o,s,u,l){var f=new Array(n.length);var v;if(u[0]!=null){v=Math.atan(u[1]/u[0]);if(u[0]<0){v=v+Math.PI/2}else{v=-v-Math.PI/2}}else{v=u}var c=Math.cos(-v);var d=Math.sin(-v);for(var h=0;h<f.length/2;h++){f[h*2]=o/2*(n[h*2]*c-n[h*2+1]*d);f[h*2+1]=s/2*(n[h*2+1]*c+n[h*2]*d);f[h*2]+=a;f[h*2+1]+=i}var p;if(l>0){var g=yr(f,-l);p=gr(g)}else{p=f}return dr(t,r,p)};var pr=function e(t,r,n,a,i,o,s){var u=new Array(n.length);var l=o/2;var f=s/2;var v=Mr(o,s);var c=v*v;for(var d=0;d<n.length/4;d++){var h=void 0,p=void 0;if(d===0){h=n.length-2}else{h=d*4-2}p=d*4+2;var g=a+l*n[d*4];var y=i+f*n[d*4+1];var m=-n[h]*n[p]-n[h+1]*n[p+1];var b=v/Math.tan(Math.acos(m)/2);var x=g-b*n[h];var w=y-b*n[h+1];var E=g+b*n[p];var k=y+b*n[p+1];u[d*4]=x;u[d*4+1]=w;u[d*4+2]=E;u[d*4+3]=k;var _=n[h+1];var S=-n[h];var D=_*n[p]+S*n[p+1];if(D<0){_*=-1;S*=-1}var C=x+_*v;var T=w+S*v;var P=Math.pow(C-t,2)+Math.pow(T-r,2);if(P<=c){return true}}return dr(t,r,u)};var gr=function e(t){var r=new Array(t.length/2);var n,a,i,o;var s,u,l,f;for(var v=0;v<t.length/4;v++){n=t[v*4];a=t[v*4+1];i=t[v*4+2];o=t[v*4+3];if(v<t.length/4-1){s=t[(v+1)*4];u=t[(v+1)*4+1];l=t[(v+1)*4+2];f=t[(v+1)*4+3]}else{s=t[0];u=t[1];l=t[2];f=t[3]}var c=Er(n,a,i,o,s,u,l,f,true);r[v*2]=c[0];r[v*2+1]=c[1]}return r};var yr=function e(t,r){var n=new Array(t.length*2);var a,i,o,s;for(var u=0;u<t.length/2;u++){a=t[u*2];i=t[u*2+1];if(u<t.length/2-1){o=t[(u+1)*2];s=t[(u+1)*2+1]}else{o=t[0];s=t[1]}var l=s-i;var f=-(o-a);var v=Math.sqrt(l*l+f*f);var c=l/v;var d=f/v;n[u*4]=a+c*r;n[u*4+1]=i+d*r;n[u*4+2]=o+c*r;n[u*4+3]=s+d*r}return n};var mr=function e(t,r,n,a,i,o){var s=n-t;var u=a-r;s/=i;u/=o;var l=Math.sqrt(s*s+u*u);var f=l-1;if(f<0){return[]}var v=f/l;return[(n-t)*v+t,(a-r)*v+r]};var br=function e(t,r,n,a,i,o,s){t-=i;r-=o;t/=n/2+s;r/=a/2+s;return t*t+r*r<=1};var xr=function e(t,r,n,a,i,o,s){var u=[n-t,a-r];var l=[t-i,r-o];var f=u[0]*u[0]+u[1]*u[1];var v=2*(l[0]*u[0]+l[1]*u[1]);var c=l[0]*l[0]+l[1]*l[1]-s*s;var d=v*v-4*f*c;if(d<0){return[]}var h=(-v+Math.sqrt(d))/(2*f);var p=(-v-Math.sqrt(d))/(2*f);var g=Math.min(h,p);var y=Math.max(h,p);var m=[];if(g>=0&&g<=1){m.push(g)}if(y>=0&&y<=1){m.push(y)}if(m.length===0){return[]}var b=m[0]*u[0]+t;var x=m[0]*u[1]+r;if(m.length>1){if(m[0]==m[1]){return[b,x]}else{var w=m[1]*u[0]+t;var E=m[1]*u[1]+r;return[b,x,w,E]}}else{return[b,x]}};var wr=function e(t,r,n){if(r<=t&&t<=n||n<=t&&t<=r){return t}else if(t<=r&&r<=n||n<=r&&r<=t){return r}else{return n}};var Er=function e(t,r,n,a,i,o,s,u,l){var f=t-i;var v=n-t;var c=s-i;var d=r-o;var h=a-r;var p=u-o;var g=c*d-p*f;var y=v*d-h*f;var m=p*v-c*h;if(m!==0){var b=g/m;var x=y/m;var w=.001;var E=0-w;var k=1+w;if(E<=b&&b<=k&&E<=x&&x<=k){return[t+b*v,r+b*h]}else{if(!l){return[]}else{return[t+b*v,r+b*h]}}}else{if(g===0||y===0){if(wr(t,n,s)===s){return[s,u]}if(wr(t,n,i)===i){return[i,o]}if(wr(i,s,n)===n){return[n,a]}return[]}else{return[]}}};var kr=function e(t,r,n,a,i,o,s,u){var l=[];var f;var v=new Array(n.length);var c=true;if(o==null){c=false}var d;if(c){for(var h=0;h<v.length/2;h++){v[h*2]=n[h*2]*o+a;v[h*2+1]=n[h*2+1]*s+i}if(u>0){var p=yr(v,-u);d=gr(p)}else{d=v}}else{d=n}var g,y,m,b;for(var x=0;x<d.length/2;x++){g=d[x*2];y=d[x*2+1];if(x<d.length/2-1){m=d[(x+1)*2];b=d[(x+1)*2+1]}else{m=d[0];b=d[1]}f=Er(t,r,a,i,g,y,m,b);if(f.length!==0){l.push(f[0],f[1])}}return l};var _r=function e(t,r,n,a,i,o,s,u){var l=[];var f;var v=new Array(n.length);var c=o/2;var d=s/2;var h=Mr(o,s);for(var p=0;p<n.length/4;p++){var g=void 0,y=void 0;if(p===0){g=n.length-2}else{g=p*4-2}y=p*4+2;var m=a+c*n[p*4];var b=i+d*n[p*4+1];var x=-n[g]*n[y]-n[g+1]*n[y+1];var w=h/Math.tan(Math.acos(x)/2);var E=m-w*n[g];var k=b-w*n[g+1];var _=m+w*n[y];var S=b+w*n[y+1];if(p===0){v[n.length-2]=E;v[n.length-1]=k}else{v[p*4-2]=E;v[p*4-1]=k}v[p*4]=_;v[p*4+1]=S;var D=n[g+1];var C=-n[g];var T=D*n[y]+C*n[y+1];if(T<0){D*=-1;C*=-1}var P=E+D*h;var M=k+C*h;f=xr(t,r,a,i,P,M,h);if(f.length!==0){l.push(f[0],f[1])}}for(var I=0;I<v.length/4;I++){f=Er(t,r,a,i,v[I*4],v[I*4+1],v[I*4+2],v[I*4+3],false);if(f.length!==0){l.push(f[0],f[1])}}if(l.length>2){var O=[l[0],l[1]];var N=Math.pow(O[0]-t,2)+Math.pow(O[1]-r,2);for(var z=1;z<l.length/2;z++){var L=Math.pow(l[z*2]-t,2)+Math.pow(l[z*2+1]-r,2);if(L<=N){O[0]=l[z*2];O[1]=l[z*2+1];N=L}}return O}return l};var Sr=function e(t,r,n){var a=[t[0]-r[0],t[1]-r[1]];var i=Math.sqrt(a[0]*a[0]+a[1]*a[1]);var o=(i-n)/i;if(o<0){o=1e-5}return[r[0]+o*a[0],r[1]+o*a[1]]};var Dr=function e(t,r){var n=Tr(t,r);n=Cr(n);return n};var Cr=function e(t){var r,n;var a=t.length/2;var i=Infinity,o=Infinity,s=-Infinity,u=-Infinity;for(var l=0;l<a;l++){r=t[2*l];n=t[2*l+1];i=Math.min(i,r);s=Math.max(s,r);o=Math.min(o,n);u=Math.max(u,n)}var f=2/(s-i);var v=2/(u-o);for(var c=0;c<a;c++){r=t[2*c]=t[2*c]*f;n=t[2*c+1]=t[2*c+1]*v;i=Math.min(i,r);s=Math.max(s,r);o=Math.min(o,n);u=Math.max(u,n)}if(o<-1){for(var d=0;d<a;d++){n=t[2*d+1]=t[2*d+1]+(-1-o)}}return t};var Tr=function e(t,r){var n=1/t*2*Math.PI;var a=t%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;var i=new Array(t*2);var o;for(var s=0;s<t;s++){o=s*n+a;i[2*s]=Math.cos(o);i[2*s+1]=Math.sin(-o)}return i};var Pr=function e(t,r){return Math.min(t/4,r/4,8)};var Mr=function e(t,r){return Math.min(t/10,r/10,8)};var Ir=function e(){return 8};var Or=function e(t,r,n){return[t-2*r+n,2*(r-t),t]};var Nr=function e(t,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}};var zr=tt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function e(t){return 1}});var Lr={pageRank:function e(t){var r=zr(t),n=r.dampingFactor,a=r.precision,i=r.iterations,o=r.weight;var s=this._private.cy;var u=this.byGroup(),l=u.nodes,f=u.edges;var v=l.length;var c=v*v;var d=f.length;var h=new Array(c);var p=new Array(v);var g=(1-n)/v;for(var y=0;y<v;y++){for(var m=0;m<v;m++){var b=y*v+m;h[b]=0}p[y]=0}for(var x=0;x<d;x++){var w=f[x];var E=w.data("source");var k=w.data("target");if(E===k){continue}var _=l.indexOfId(E);var S=l.indexOfId(k);var D=o(w);var C=S*v+_;h[C]+=D;p[_]+=D}var T=1/v+g;for(var P=0;P<v;P++){if(p[P]===0){for(var M=0;M<v;M++){var I=M*v+P;h[I]=T}}else{for(var O=0;O<v;O++){var N=O*v+P;h[N]=h[N]/p[P]+g}}}var z=new Array(v);var L=new Array(v);var A;for(var B=0;B<v;B++){z[B]=1}for(var R=0;R<i;R++){for(var j=0;j<v;j++){L[j]=0}for(var F=0;F<v;F++){for(var V=0;V<v;V++){var q=F*v+V;L[F]+=h[q]*z[V]}}qt(L);A=z;z=L;L=A;var G=0;for(var Y=0;Y<v;Y++){var W=A[Y]-z[Y];G+=W*W}if(G<a){break}}var X={rank:function e(t){t=s.collection(t)[0];return z[l.indexOf(t)]}};return X}};var Ar=tt({root:null,weight:function e(t){return 1},directed:false,alpha:0});var Br={degreeCentralityNormalized:function e(t){t=Ar(t);var r=this.cy();var n=this.nodes();var a=n.length;if(!t.directed){var i={};var o=0;for(var s=0;s<a;s++){var u=n[s];t.root=u;var l=this.degreeCentrality(t);if(o<l.degree){o=l.degree}i[u.id()]=l.degree}return{degree:function e(t){if(o===0){return 0}if(O(t)){t=r.filter(t)}return i[t.id()]/o}}}else{var f={};var v={};var c=0;var d=0;for(var h=0;h<a;h++){var p=n[h];var g=p.id();t.root=p;var y=this.degreeCentrality(t);if(c<y.indegree)c=y.indegree;if(d<y.outdegree)d=y.outdegree;f[g]=y.indegree;v[g]=y.outdegree}return{indegree:function e(t){if(c==0){return 0}if(O(t)){t=r.filter(t)}return f[t.id()]/c},outdegree:function e(t){if(d===0){return 0}if(O(t)){t=r.filter(t)}return v[t.id()]/d}}}},degreeCentrality:function e(t){t=Ar(t);var r=this.cy();var n=this;var a=t,i=a.root,o=a.weight,s=a.directed,u=a.alpha;i=r.collection(i)[0];if(!s){var l=i.connectedEdges().intersection(n);var f=l.length;var v=0;for(var c=0;c<l.length;c++){v+=o(l[c])}return{degree:Math.pow(f,1-u)*Math.pow(v,u)}}else{var d=i.connectedEdges();var h=d.filter((function(e){return e.target().same(i)&&n.has(e)}));var p=d.filter((function(e){return e.source().same(i)&&n.has(e)}));var g=h.length;var y=p.length;var m=0;var b=0;for(var x=0;x<h.length;x++){m+=o(h[x])}for(var w=0;w<p.length;w++){b+=o(p[w])}return{indegree:Math.pow(g,1-u)*Math.pow(m,u),outdegree:Math.pow(y,1-u)*Math.pow(b,u)}}}};Br.dc=Br.degreeCentrality;Br.dcn=Br.degreeCentralityNormalised=Br.degreeCentralityNormalized;var Rr=tt({harmonic:true,weight:function e(){return 1},directed:false,root:null});var jr={closenessCentralityNormalized:function e(t){var r=Rr(t),n=r.harmonic,a=r.weight,i=r.directed;var o=this.cy();var s={};var u=0;var l=this.nodes();var f=this.floydWarshall({weight:a,directed:i});for(var v=0;v<l.length;v++){var c=0;var d=l[v];for(var h=0;h<l.length;h++){if(v!==h){var p=f.distance(d,l[h]);if(n){c+=1/p}else{c+=p}}}if(!n){c=1/c}if(u<c){u=c}s[d.id()]=c}return{closeness:function e(t){if(u==0){return 0}if(O(t)){t=o.filter(t)[0].id()}else{t=t.id()}return s[t]/u}}},closenessCentrality:function e(t){var r=Rr(t),n=r.root,a=r.weight,i=r.directed,o=r.harmonic;n=this.filter(n)[0];var s=this.dijkstra({root:n,weight:a,directed:i});var u=0;var l=this.nodes();for(var f=0;f<l.length;f++){var v=l[f];if(!v.same(n)){var c=s.distanceTo(v);if(o){u+=1/c}else{u+=c}}}return o?u:1/u}};jr.cc=jr.closenessCentrality;jr.ccn=jr.closenessCentralityNormalised=jr.closenessCentralityNormalized;var Fr=tt({weight:null,directed:false});var Vr={betweennessCentrality:function e(t){var r=Fr(t),n=r.directed,a=r.weight;var i=a!=null;var o=this.cy();var s=this.nodes();var u={};var l={};var v=0;var c={set:function e(t,r){l[t]=r;if(r>v){v=r}},get:function e(t){return l[t]}};for(var d=0;d<s.length;d++){var h=s[d];var p=h.id();if(n){u[p]=h.outgoers().nodes()}else{u[p]=h.openNeighborhood().nodes()}c.set(p,0)}var g=function e(t){var r=s[t].id();var n=[];var l={};var v={};var d={};var h=new f["default"]((function(e,t){return d[e]-d[t]}));for(var p=0;p<s.length;p++){var g=s[p].id();l[g]=[];v[g]=0;d[g]=Infinity}v[r]=1;d[r]=0;h.push(r);while(!h.empty()){var y=h.pop();n.push(y);if(i){for(var m=0;m<u[y].length;m++){var b=u[y][m];var x=o.getElementById(y);var w=void 0;if(x.edgesTo(b).length>0){w=x.edgesTo(b)[0]}else{w=b.edgesTo(x)[0]}var E=a(w);b=b.id();if(d[b]>d[y]+E){d[b]=d[y]+E;if(h.nodes.indexOf(b)<0){h.push(b)}else{h.updateItem(b)}v[b]=0;l[b]=[]}if(d[b]==d[y]+E){v[b]=v[b]+v[y];l[b].push(y)}}}else{for(var k=0;k<u[y].length;k++){var _=u[y][k].id();if(d[_]==Infinity){h.push(_);d[_]=d[y]+1}if(d[_]==d[y]+1){v[_]=v[_]+v[y];l[_].push(y)}}}}var S={};for(var D=0;D<s.length;D++){S[s[D].id()]=0}while(n.length>0){var C=n.pop();for(var T=0;T<l[C].length;T++){var P=l[C][T];S[P]=S[P]+v[P]/v[C]*(1+S[C])}if(C!=s[t].id()){c.set(C,c.get(C)+S[C])}}};for(var y=0;y<s.length;y++){g(y)}var m={betweenness:function e(t){var r=o.collection(t).id();return c.get(r)},betweennessNormalized:function e(t){if(v==0){return 0}var r=o.collection(t).id();return c.get(r)/v}};m.betweennessNormalised=m.betweennessNormalized;return m}};Vr.bc=Vr.betweennessCentrality;var qr=tt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]});var Gr=function e(t){return qr(t)};var Yr=function e(t,r){var n=0;for(var a=0;a<r.length;a++){n+=r[a](t)}return n};var Wr=function e(t,r,n){for(var a=0;a<r;a++){t[a*r+a]=n}};var Xr=function e(t,r){var n;for(var a=0;a<r;a++){n=0;for(var i=0;i<r;i++){n+=t[i*r+a]}for(var o=0;o<r;o++){t[o*r+a]=t[o*r+a]/n}}};var Hr=function e(t,r,n){var a=new Array(n*n);for(var i=0;i<n;i++){for(var o=0;o<n;o++){a[i*n+o]=0}for(var s=0;s<n;s++){for(var u=0;u<n;u++){a[i*n+u]+=t[i*n+s]*r[s*n+u]}}}return a};var Ur=function e(t,r,n){var a=t.slice(0);for(var i=1;i<n;i++){t=Hr(t,a,r)}return t};var Kr=function e(t,r,n){var a=new Array(r*r);for(var i=0;i<r*r;i++){a[i]=Math.pow(t[i],n)}Xr(a,r);return a};var Zr=function e(t,r,n,a){for(var i=0;i<n;i++){var o=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a);var s=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==s){return false}}return true};var $r=function e(t,r,n,a){var i=[];for(var o=0;o<r;o++){var s=[];for(var u=0;u<r;u++){if(Math.round(t[o*r+u]*1e3)/1e3>0){s.push(n[u])}}if(s.length!==0){i.push(a.collection(s))}}return i};var Qr=function e(t,r){for(var n=0;n<t.length;n++){if(!r[n]||t[n].id()!==r[n].id()){return false}}return true};var Jr=function e(t){for(var r=0;r<t.length;r++){for(var n=0;n<t.length;n++){if(r!=n&&Qr(t[r],t[n])){t.splice(n,1)}}}return t};var en=function e(t){var r=this.nodes();var n=this.edges();var a=this.cy();var i=Gr(t);var o={};for(var s=0;s<r.length;s++){o[r[s].id()]=s}var u=r.length,l=u*u;var f=new Array(l),v;for(var c=0;c<l;c++){f[c]=0}for(var d=0;d<n.length;d++){var h=n[d];var p=o[h.source().id()];var g=o[h.target().id()];var y=Yr(h,i.attributes);f[p*u+g]+=y;f[g*u+p]+=y}Wr(f,u,i.multFactor);Xr(f,u);var m=true;var b=0;while(m&&b<i.maxIterations){m=false;v=Ur(f,u,i.expandFactor);f=Kr(v,u,i.inflateFactor);if(!Zr(f,v,l,4)){m=true}b++}var x=$r(f,u,r,a);x=Jr(x);return x};var tn={markovClustering:en,mcl:en};var rn=function e(t){return t};var nn=function e(t,r){return Math.abs(r-t)};var an=function e(t,r,n){return t+nn(r,n)};var on=function e(t,r,n){return t+Math.pow(n-r,2)};var sn=function e(t){return Math.sqrt(t)};var un=function e(t,r,n){return Math.max(t,nn(r,n))};var ln=function e(t,r,n,a,i){var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:rn;var s=a;var u,l;for(var f=0;f<t;f++){u=r(f);l=n(f);s=i(s,u,l)}return o(s)};var fn={euclidean:function e(t,r,n){if(t>=2){return ln(t,r,n,0,on,sn)}else{return ln(t,r,n,0,an)}},squaredEuclidean:function e(t,r,n){return ln(t,r,n,0,on)},manhattan:function e(t,r,n){return ln(t,r,n,0,an)},max:function e(t,r,n){return ln(t,r,n,-Infinity,un)}};fn["squared-euclidean"]=fn["squaredEuclidean"];fn["squaredeuclidean"]=fn["squaredEuclidean"];function vn(e,t,r,n,a,i){var o;if(N(e)){o=e}else{o=fn[e]||fn.euclidean}if(t===0&&N(e)){return o(a,i)}else{return o(t,r,n,a,i)}}var cn=tt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:false,testCentroids:null});var dn=function e(t){return cn(t)};var hn=function e(t,r,n,a,i){var o=i!=="kMedoids";var s=o?function(e){return n[e]}:function(e){return a[e](n)};var u=function e(t){return a[t](r)};var l=n;var f=r;return vn(t,a.length,s,u,l,f)};var pn=function e(t,r,n){var a=n.length;var i=new Array(a);var o=new Array(a);var s=new Array(r);var u=null;for(var l=0;l<a;l++){i[l]=t.min(n[l]).value;o[l]=t.max(n[l]).value}for(var f=0;f<r;f++){u=[];for(var v=0;v<a;v++){u[v]=Math.random()*(o[v]-i[v])+i[v]}s[f]=u}return s};var gn=function e(t,r,n,a,i){var o=Infinity;var s=0;for(var u=0;u<r.length;u++){var l=hn(n,t,r[u],a,i);if(l<o){o=l;s=u}}return s};var yn=function e(t,r,n){var a=[];var i=null;for(var o=0;o<r.length;o++){i=r[o];if(n[i.id()]===t){a.push(i)}}return a};var mn=function e(t,r,n){return Math.abs(r-t)<=n};var bn=function e(t,r,n){for(var a=0;a<t.length;a++){for(var i=0;i<t[a].length;i++){var o=Math.abs(t[a][i]-r[a][i]);if(o>n){return false}}}return true};var xn=function e(t,r,n){for(var a=0;a<n;a++){if(t===r[a])return true}return false};var wn=function e(t,r){var n=new Array(r);if(t.length<50){for(var a=0;a<r;a++){var i=t[Math.floor(Math.random()*t.length)];while(xn(i,n,a)){i=t[Math.floor(Math.random()*t.length)]}n[a]=i}}else{for(var o=0;o<r;o++){n[o]=t[Math.floor(Math.random()*t.length)]}}return n};var En=function e(t,r,n){var a=0;for(var i=0;i<r.length;i++){a+=hn("manhattan",r[i],t,n,"kMedoids")}return a};var kn=function e(t){var r=this.cy();var n=this.nodes();var a=null;var i=dn(t);var o=new Array(i.k);var s={};var u;if(i.testMode){if(typeof i.testCentroids==="number"){i.testCentroids;u=pn(n,i.k,i.attributes)}else if(h(i.testCentroids)==="object"){u=i.testCentroids}else{u=pn(n,i.k,i.attributes)}}else{u=pn(n,i.k,i.attributes)}var l=true;var f=0;while(l&&f<i.maxIterations){for(var v=0;v<n.length;v++){a=n[v];s[a.id()]=gn(a,u,i.distance,i.attributes,"kMeans")}l=false;for(var c=0;c<i.k;c++){var d=yn(c,n,s);if(d.length===0){continue}var p=i.attributes.length;var g=u[c];var y=new Array(p);var m=new Array(p);for(var b=0;b<p;b++){m[b]=0;for(var x=0;x<d.length;x++){a=d[x];m[b]+=i.attributes[b](a)}y[b]=m[b]/d.length;if(!mn(y[b],g[b],i.sensitivityThreshold)){l=true}}u[c]=y;o[c]=r.collection(d)}f++}return o};var _n=function e(t){var r=this.cy();var n=this.nodes();var a=null;var i=dn(t);var o=new Array(i.k);var s;var u={};var l;var f=new Array(i.k);if(i.testMode){if(typeof i.testCentroids==="number");else if(h(i.testCentroids)==="object"){s=i.testCentroids}else{s=wn(n,i.k)}}else{s=wn(n,i.k)}var v=true;var c=0;while(v&&c<i.maxIterations){for(var d=0;d<n.length;d++){a=n[d];u[a.id()]=gn(a,s,i.distance,i.attributes,"kMedoids")}v=false;for(var p=0;p<s.length;p++){var g=yn(p,n,u);if(g.length===0){continue}f[p]=En(s[p],g,i.attributes);for(var y=0;y<g.length;y++){l=En(g[y],g,i.attributes);if(l<f[p]){f[p]=l;s[p]=g[y];v=true}}o[p]=r.collection(g)}c++}return o};var Sn=function e(t,r,n,a,i){var o,s;for(var u=0;u<r.length;u++){for(var l=0;l<t.length;l++){a[u][l]=Math.pow(n[u][l],i.m)}}for(var f=0;f<t.length;f++){for(var v=0;v<i.attributes.length;v++){o=0;s=0;for(var c=0;c<r.length;c++){o+=a[c][f]*i.attributes[v](r[c]);s+=a[c][f]}t[f][v]=o/s}}};var Dn=function e(t,r,n,a,i){for(var o=0;o<t.length;o++){r[o]=t[o].slice()}var s,u,l;var f=2/(i.m-1);for(var v=0;v<n.length;v++){for(var c=0;c<a.length;c++){s=0;for(var d=0;d<n.length;d++){u=hn(i.distance,a[c],n[v],i.attributes,"cmeans");l=hn(i.distance,a[c],n[d],i.attributes,"cmeans");s+=Math.pow(u/l,f)}t[c][v]=1/s}}};var Cn=function e(t,r,n,a){var i=new Array(n.k);for(var o=0;o<i.length;o++){i[o]=[]}var s;var u;for(var l=0;l<r.length;l++){s=-Infinity;u=-1;for(var f=0;f<r[0].length;f++){if(r[l][f]>s){s=r[l][f];u=f}}i[u].push(t[l])}for(var v=0;v<i.length;v++){i[v]=a.collection(i[v])}return i};var Tn=function e(t){var r=this.cy();var n=this.nodes();var a=dn(t);var i;var o;var s;var u;var l;u=new Array(n.length);for(var f=0;f<n.length;f++){u[f]=new Array(a.k)}s=new Array(n.length);for(var v=0;v<n.length;v++){s[v]=new Array(a.k)}for(var c=0;c<n.length;c++){var d=0;for(var h=0;h<a.k;h++){s[c][h]=Math.random();d+=s[c][h]}for(var p=0;p<a.k;p++){s[c][p]=s[c][p]/d}}o=new Array(a.k);for(var g=0;g<a.k;g++){o[g]=new Array(a.attributes.length)}l=new Array(n.length);for(var y=0;y<n.length;y++){l[y]=new Array(a.k)}var m=true;var b=0;while(m&&b<a.maxIterations){m=false;Sn(o,n,s,l,a);Dn(s,u,o,n,a);if(!bn(s,u,a.sensitivityThreshold)){m=true}b++}i=Cn(n,s,a,r);return{clusters:i,degreeOfMembership:s}};var Pn={kMeans:kn,kMedoids:_n,fuzzyCMeans:Tn,fcm:Tn};var Mn=tt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:Infinity,addDendrogram:false,dendrogramDepth:0,attributes:[]});var In={single:"min",complete:"max"};var On=function e(t){var r=Mn(t);var n=In[r.linkage];if(n!=null){r.linkage=n}return r};var Nn=function e(t,r,n,a,i){var o=0;var s=Infinity;var u;var l=i.attributes;var f=function e(t,r){return vn(i.distance,l.length,(function(e){return l[e](t)}),(function(e){return l[e](r)}),t,r)};for(var v=0;v<t.length;v++){var c=t[v].key;var d=n[c][a[c]];if(d<s){o=c;s=d}}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&t.length===1){return false}var h=r[o];var p=r[a[o]];var g;if(i.mode==="dendrogram"){g={left:h,right:p,key:h.key}}else{g={value:h.value.concat(p.value),key:h.key}}t[h.index]=g;t.splice(p.index,1);r[h.key]=g;for(var y=0;y<t.length;y++){var m=t[y];if(h.key===m.key){u=Infinity}else if(i.linkage==="min"){u=n[h.key][m.key];if(n[h.key][m.key]>n[p.key][m.key]){u=n[p.key][m.key]}}else if(i.linkage==="max"){u=n[h.key][m.key];if(n[h.key][m.key]<n[p.key][m.key]){u=n[p.key][m.key]}}else if(i.linkage==="mean"){u=(n[h.key][m.key]*h.size+n[p.key][m.key]*p.size)/(h.size+p.size)}else{if(i.mode==="dendrogram")u=f(m.value,h.value);else u=f(m.value[0],h.value[0])}n[h.key][m.key]=n[m.key][h.key]=u}for(var b=0;b<t.length;b++){var x=t[b].key;if(a[x]===h.key||a[x]===p.key){var w=x;for(var E=0;E<t.length;E++){var k=t[E].key;if(n[x][k]<n[x][w]){w=k}}a[x]=w}t[b].index=b}h.key=p.key=h.index=p.index=null;return true};var zn=function e(t,r,n){if(!t)return;if(t.value){r.push(t.value)}else{if(t.left)e(t.left,r);if(t.right)e(t.right,r)}};var Ln=function e(t,r){if(!t)return"";if(t.left&&t.right){var n=e(t.left,r);var a=e(t.right,r);var i=r.add({group:"nodes",data:{id:n+","+a}});r.add({group:"edges",data:{source:n,target:i.id()}});r.add({group:"edges",data:{source:a,target:i.id()}});return i.id()}else if(t.value){return t.value.id()}};var An=function e(t,r,n){if(!t)return[];var a=[],i=[],o=[];if(r===0){if(t.left)zn(t.left,a);if(t.right)zn(t.right,i);o=a.concat(i);return[n.collection(o)]}else if(r===1){if(t.value){return[n.collection(t.value)]}else{if(t.left)zn(t.left,a);if(t.right)zn(t.right,i);return[n.collection(a),n.collection(i)]}}else{if(t.value){return[n.collection(t.value)]}else{if(t.left)a=e(t.left,r-1,n);if(t.right)i=e(t.right,r-1,n);return a.concat(i)}}};var Bn=function e(t){var r=this.cy();var n=this.nodes();var a=On(t);var i=a.attributes;var o=function e(t,r){return vn(a.distance,i.length,(function(e){return i[e](t)}),(function(e){return i[e](r)}),t,r)};var s=[];var u=[];var l=[];var f=[];for(var v=0;v<n.length;v++){var c={value:a.mode==="dendrogram"?n[v]:[n[v]],key:v,index:v};s[v]=c;f[v]=c;u[v]=[];l[v]=0}for(var d=0;d<s.length;d++){for(var h=0;h<=d;h++){var p=void 0;if(a.mode==="dendrogram"){p=d===h?Infinity:o(s[d].value,s[h].value)}else{p=d===h?Infinity:o(s[d].value[0],s[h].value[0])}u[d][h]=p;u[h][d]=p;if(p<u[d][l[d]]){l[d]=h}}}var g=Nn(s,f,u,l,a);while(g){g=Nn(s,f,u,l,a)}var y;if(a.mode==="dendrogram"){y=An(s[0],a.dendrogramDepth,r);if(a.addDendrogram)Ln(s[0],r)}else{y=new Array(s.length);s.forEach((function(e,t){e.key=e.index=null;y[t]=r.collection(e.value)}))}return y};var Rn={hierarchicalClustering:Bn,hca:Bn};var jn=tt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]});var Fn=function e(t){var r=t.damping;var n=t.preference;if(!(.5<=r&&r<1)){Xe("Damping must range on [0.5, 1). Got: ".concat(r))}var a=["median","mean","min","max"];if(!(a.some((function(e){return e===n}))||B(n))){Xe("Preference must be one of [".concat(a.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n))}return jn(t)};var Vn=function e(t,r,n,a){var i=function e(t,r){return a[r](t)};return-vn(t,a.length,(function(e){return i(r,e)}),(function(e){return i(n,e)}),r,n)};var qn=function e(t,r){var n=null;if(r==="median"){n=Lt(t)}else if(r==="mean"){n=zt(t)}else if(r==="min"){n=Ot(t)}else if(r==="max"){n=Nt(t)}else{n=r}return n};var Gn=function e(t,r,n){var a=[];for(var i=0;i<t;i++){if(r[i*t+i]+n[i*t+i]>0){a.push(i)}}return a};var Yn=function e(t,r,n){var a=[];for(var i=0;i<t;i++){var o=-1;var s=-Infinity;for(var u=0;u<n.length;u++){var l=n[u];if(r[i*t+l]>s){o=l;s=r[i*t+l]}}if(o>0){a.push(o)}}for(var f=0;f<n.length;f++){a[n[f]]=n[f]}return a};var Wn=function e(t,r,n){var a=Yn(t,r,n);for(var i=0;i<n.length;i++){var o=[];for(var s=0;s<a.length;s++){if(a[s]===n[i]){o.push(s)}}var u=-1;var l=-Infinity;for(var f=0;f<o.length;f++){var v=0;for(var c=0;c<o.length;c++){v+=r[o[c]*t+o[f]]}if(v>l){u=f;l=v}}n[i]=o[u]}a=Yn(t,r,n);return a};var Xn=function e(t){var r=this.cy();var n=this.nodes();var a=Fn(t);var i={};for(var o=0;o<n.length;o++){i[n[o].id()]=o}var s;var u;var l;var f;var v;var c;s=n.length;u=s*s;l=new Array(u);for(var d=0;d<u;d++){l[d]=-Infinity}for(var h=0;h<s;h++){for(var p=0;p<s;p++){if(h!==p){l[h*s+p]=Vn(a.distance,n[h],n[p],a.attributes)}}}f=qn(l,a.preference);for(var g=0;g<s;g++){l[g*s+g]=f}v=new Array(u);for(var y=0;y<u;y++){v[y]=0}c=new Array(u);for(var m=0;m<u;m++){c[m]=0}var b=new Array(s);var x=new Array(s);var w=new Array(s);for(var E=0;E<s;E++){b[E]=0;x[E]=0;w[E]=0}var k=new Array(s*a.minIterations);for(var _=0;_<k.length;_++){k[_]=0}var S;for(S=0;S<a.maxIterations;S++){for(var D=0;D<s;D++){var C=-Infinity,T=-Infinity,P=-1,M=0;for(var I=0;I<s;I++){b[I]=v[D*s+I];M=c[D*s+I]+l[D*s+I];if(M>=C){T=C;C=M;P=I}else if(M>T){T=M}}for(var O=0;O<s;O++){v[D*s+O]=(1-a.damping)*(l[D*s+O]-C)+a.damping*b[O]}v[D*s+P]=(1-a.damping)*(l[D*s+P]-T)+a.damping*b[P]}for(var N=0;N<s;N++){var z=0;for(var L=0;L<s;L++){b[L]=c[L*s+N];x[L]=Math.max(0,v[L*s+N]);z+=x[L]}z-=x[N];x[N]=v[N*s+N];z+=x[N];for(var A=0;A<s;A++){c[A*s+N]=(1-a.damping)*Math.min(0,z-x[A])+a.damping*b[A]}c[N*s+N]=(1-a.damping)*(z-x[N])+a.damping*b[N]}var B=0;for(var R=0;R<s;R++){var j=c[R*s+R]+v[R*s+R]>0?1:0;k[S%a.minIterations*s+R]=j;B+=j}if(B>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){var F=0;for(var V=0;V<s;V++){w[V]=0;for(var q=0;q<a.minIterations;q++){w[V]+=k[q*s+V]}if(w[V]===0||w[V]===a.minIterations){F++}}if(F===s){break}}}var G=Gn(s,v,c);var Y=Wn(s,l,G);var W={};for(var X=0;X<G.length;X++){W[G[X]]=[]}for(var H=0;H<n.length;H++){var U=i[n[H].id()];var K=Y[U];if(K!=null){W[K].push(n[H])}}var Z=new Array(G.length);for(var $=0;$<G.length;$++){Z[$]=r.collection(W[G[$]])}return Z};var Hn={affinityPropagation:Xn,ap:Xn};var Un=tt({root:undefined,directed:false});var Kn={hierholzer:function e(t){if(!L(t)){var r=arguments;t={root:r[0],directed:r[1]}}var n=Un(t),a=n.root,i=n.directed;var o=this;var s=false;var u;var l;var f;if(a)f=O(a)?this.filter(a)[0].id():a[0].id();var v={};var c={};if(i){o.forEach((function(e){var t=e.id();if(e.isNode()){var r=e.indegree(true);var n=e.outdegree(true);var a=r-n;var i=n-r;if(a==1){if(u)s=true;else u=t}else if(i==1){if(l)s=true;else l=t}else if(i>1||a>1){s=true}v[t]=[];e.outgoers().forEach((function(e){if(e.isEdge())v[t].push(e.id())}))}else{c[t]=[undefined,e.target().id()]}}))}else{o.forEach((function(e){var t=e.id();if(e.isNode()){var r=e.degree(true);if(r%2){if(!u)u=t;else if(!l)l=t;else s=true}v[t]=[];e.connectedEdges().forEach((function(e){return v[t].push(e.id())}))}else{c[t]=[e.source().id(),e.target().id()]}}))}var d={found:false,trail:undefined};if(s)return d;else if(l&&u){if(i){if(f&&l!=f){return d}f=l}else{if(f&&l!=f&&u!=f){return d}else if(!f){f=l}}}else{if(!f)f=o[0].id()}var h=function e(t){var r=t;var n=[t];var a,o,s;while(v[r].length){a=v[r].shift();o=c[a][0];s=c[a][1];if(r!=s){v[s]=v[s].filter((function(e){return e!=a}));r=s}else if(!i&&r!=o){v[o]=v[o].filter((function(e){return e!=a}));r=o}n.unshift(a);n.unshift(r)}return n};var p=[];var g=[];g=h(f);while(g.length!=1){if(v[g[0]].length==0){p.unshift(o.getElementById(g.shift()));p.unshift(o.getElementById(g.shift()))}else{g=h(g.shift()).concat(g)}}p.unshift(o.getElementById(g.shift()));for(var y in v){if(v[y].length){return d}}d.found=true;d.trail=this.spawn(p,true);return d}};var Zn=function e(){var t=this;var r={};var n=0;var a=0;var i=[];var o=[];var s={};var u=function e(n,a){var s=o.length-1;var u=[];var l=t.spawn();while(o[s].x!=n||o[s].y!=a){u.push(o.pop().edge);s--}u.push(o.pop().edge);u.forEach((function(e){var n=e.connectedNodes().intersection(t);l.merge(e);n.forEach((function(e){var n=e.id();var a=e.connectedEdges().intersection(t);l.merge(e);if(!r[n].cutVertex){l.merge(a)}else{l.merge(a.filter((function(e){return e.isLoop()})))}}))}));i.push(l)};var l=function e(l,f,v){if(l===v)a+=1;r[f]={id:n,low:n++,cutVertex:false};var c=t.getElementById(f).connectedEdges().intersection(t);if(c.size()===0){i.push(t.spawn(t.getElementById(f)))}else{var d,h,p,g;c.forEach((function(t){d=t.source().id();h=t.target().id();p=d===f?h:d;if(p!==v){g=t.id();if(!s[g]){s[g]=true;o.push({x:f,y:p,edge:t})}if(!(p in r)){e(l,p,f);r[f].low=Math.min(r[f].low,r[p].low);if(r[f].id<=r[p].low){r[f].cutVertex=true;u(f,p)}}else{r[f].low=Math.min(r[f].low,r[p].id)}}}))}};t.forEach((function(e){if(e.isNode()){var t=e.id();if(!(t in r)){a=0;l(t,t);r[t].cutVertex=a>1}}}));var f=Object.keys(r).filter((function(e){return r[e].cutVertex})).map((function(e){return t.getElementById(e)}));return{cut:t.spawn(f),components:i}};var $n={hopcroftTarjanBiconnected:Zn,htbc:Zn,htb:Zn,hopcroftTarjanBiconnectedComponents:Zn};var Qn=function e(){var t=this;var r={};var n=0;var a=[];var i=[];var o=t.spawn(t);var s=function e(s){i.push(s);r[s]={index:n,low:n++,explored:false};var u=t.getElementById(s).connectedEdges().intersection(t);u.forEach((function(t){var n=t.target().id();if(n!==s){if(!(n in r)){e(n)}if(!r[n].explored){r[s].low=Math.min(r[s].low,r[n].low)}}}));if(r[s].index===r[s].low){var l=t.spawn();for(;;){var f=i.pop();l.merge(t.getElementById(f));r[f].low=r[s].index;r[f].explored=true;if(f===s){break}}var v=l.edgesWith(l);var c=l.merge(v);a.push(c);o=o.difference(c)}};t.forEach((function(e){if(e.isNode()){var t=e.id();if(!(t in r)){s(t)}}}));return{cut:o,components:a}};var Jn={tarjanStronglyConnected:Qn,tsc:Qn,tscc:Qn,tarjanStronglyConnectedComponents:Qn};var ea={};[ht,gt,yt,bt,wt,kt,Ct,Lr,Br,jr,Vr,tn,Pn,Rn,Hn,Kn,$n,Jn].forEach((function(e){ve(ea,e)})); /*! 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 ta=0;var ra=1;var na=2;var aa=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7";this.state=ta;this.fulfillValue=undefined;this.rejectReason=undefined;this.onFulfilled=[];this.onRejected=[];this.proxy={then:this.then.bind(this)};if(typeof t==="function")t.call(this,this.fulfill.bind(this),this.reject.bind(this))};aa.prototype={fulfill:function e(t){return ia(this,ra,"fulfillValue",t)},reject:function e(t){return ia(this,na,"rejectReason",t)},then:function e(t,r){var n=this;var a=new aa;n.onFulfilled.push(ua(t,a,"fulfill"));n.onRejected.push(ua(r,a,"reject"));oa(n);return a.proxy}};var ia=function e(t,r,n,a){if(t.state===ta){t.state=r;t[n]=a;oa(t)}return t};var oa=function e(t){if(t.state===ra)sa(t,"onFulfilled",t.fulfillValue);else if(t.state===na)sa(t,"onRejected",t.rejectReason)};var sa=function e(t,r,n){if(t[r].length===0)return;var a=t[r];t[r]=[];var i=function e(){for(var t=0;t<a.length;t++){a[t](n)}};if(typeof setImmediate==="function")setImmediate(i);else setTimeout(i,0)};var ua=function e(t,r,n){return function(e){if(typeof t!=="function")r[n].call(r,e);else{var a;try{a=t(e)}catch(e){r.reject(e);return}la(r,a)}}};var la=function e(t,r){if(t===r||t.proxy===r){t.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(h(r)==="object"&&r!==null||typeof r==="function"){try{n=r.then}catch(e){t.reject(e);return}}if(typeof n==="function"){var a=false;try{n.call(r,(function(n){if(a)return;a=true;if(n===r)t.reject(new TypeError("circular thenable chain"));else e(t,n)}),(function(e){if(a)return;a=true;t.reject(e)}))}catch(e){if(!a)t.reject(e)}return}t.fulfill(r)};aa.all=function(e){return new aa((function(t,r){var n=new Array(e.length);var a=0;var i=function r(i,o){n[i]=o;a++;if(a===e.length){t(n)}};for(var o=0;o<e.length;o++){(function(t){var n=e[t];var a=n!=null&&n.then!=null;if(a){n.then((function(e){i(t,e)}),(function(e){r(e)}))}else{var o=n;i(t,o)}})(o)}}))};aa.resolve=function(e){return new aa((function(t,r){t(e)}))};aa.reject=function(e){return new aa((function(t,r){r(e)}))};var fa=typeof Promise!=="undefined"?Promise:aa;var va=function e(t,r,n){var a=G(t);var i=!a;var o=this._private=ve({duration:1e3},r,n);o.target=t;o.style=o.style||o.css;o.started=false;o.playing=false;o.hooked=false;o.applying=false;o.progress=0;o.completes=[];o.frames=[];if(o.complete&&N(o.complete)){o.completes.push(o.complete)}if(i){var s=t.position();o.startPosition=o.startPosition||{x:s.x,y:s.y};o.startStyle=o.startStyle||t.cy().style().getAnimationStartStyle(t,o.style)}if(a){var u=t.pan();o.startPan={x:u.x,y:u.y};o.startZoom=t.zoom()}this.length=1;this[0]=this};var ca=va.prototype;ve(ca,{instanceString:function e(){return"animation"},hook:function e(){var t=this._private;if(!t.hooked){var r;var n=t.target._private.animation;if(t.queue){r=n.queue}else{r=n.current}r.push(this);if(F(t.target)){t.target.cy().addToAnimationPool(t.target)}t.hooked=true}return this},play:function e(){var t=this._private;if(t.progress===1){t.progress=0}t.playing=true;t.started=false;t.stopped=false;this.hook();return this},playing:function e(){return this._private.playing},apply:function e(){var t=this._private;t.applying=true;t.started=false;t.stopped=false;this.hook();return this},applying:function e(){return this._private.applying},pause:function e(){var t=this._private;t.playing=false;t.started=false;return this},stop:function e(){var t=this._private;t.playing=false;t.started=false;t.stopped=true;return this},rewind:function e(){return this.progress(0)},fastforward:function e(){return this.progress(1)},time:function e(t){var r=this._private;if(t===undefined){return r.progress*r.duration}else{return this.progress(t/r.duration)}},progress:function e(t){var r=this._private;var n=r.playing;if(t===undefined){return r.progress}else{if(n){this.pause()}r.progress=t;r.started=false;if(n){this.play()}}return this},completed:function e(){return this._private.progress===1},reverse:function e(){var t=this._private;var r=t.playing;if(r){this.pause()}t.progress=1-t.progress;t.started=false;var n=function e(r,n){var a=t[r];if(a==null){return}t[r]=t[n];t[n]=a};n("zoom","startZoom");n("pan","startPan");n("position","startPosition");if(t.style){for(var a=0;a<t.style.length;a++){var i=t.style[a];var o=i.name;var s=t.startStyle[o];t.startStyle[o]=i;t.style[a]=s}}if(r){this.play()}return this},promise:function e(t){var r=this._private;var n;switch(t){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new fa((function(e,t){n.push((function(){e()}))}))}});ca.complete=ca.completed;ca.run=ca.play;ca.running=ca.playing;var da={animated:function e(){return function e(){var t=this;var r=t.length!==undefined;var n=r?t:[t];var a=this._private.cy||this;if(!a.styleEnabled()){return false}var i=n[0];if(i){return i._private.animation.current.length>0}}},clearQueue:function e(){return function e(){var t=this;var r=t.length!==undefined;var n=r?t:[t];var a=this._private.cy||this;if(!a.styleEnabled()){return this}for(var i=0;i<n.length;i++){var o=n[i];o._private.animation.queue=[]}return this}},delay:function e(){return function e(t,r){var n=this._private.cy||this;if(!n.styleEnabled()){return this}return this.animate({delay:t,duration:t,complete:r})}},delayAnimation:function e(){return function e(t,r){var n=this._private.cy||this;if(!n.styleEnabled()){return this}return this.animation({delay:t,duration:t,complete:r})}},animation:function e(){return function e(t,r){var n=this;var a=n.length!==undefined;var i=a?n:[n];var o=this._private.cy||this;var s=!a;var u=!s;if(!o.styleEnabled()){return this}var l=o.style();t=ve({},t,r);var f=Object.keys(t).length===0;if(f){return new va(i[0],t)}if(t.duration===undefined){t.duration=400}switch(t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(u){t.style=l.getPropsList(t.style||t.css);t.css=undefined}if(u&&t.renderedPosition!=null){var v=t.renderedPosition;var c=o.pan();var d=o.zoom();t.position=Mt(v,d,c)}if(s&&t.panBy!=null){var h=t.panBy;var p=o.pan();t.pan={x:p.x+h.x,y:p.y+h.y}}var g=t.center||t.centre;if(s&&g!=null){var y=o.getCenterPan(g.eles,t.zoom);if(y!=null){t.pan=y}}if(s&&t.fit!=null){var m=t.fit;var b=o.getFitViewport(m.eles||m.boundingBox,m.padding);if(b!=null){t.pan=b.pan;t.zoom=b.zoom}}if(s&&L(t.zoom)){var x=o.getZoomedViewport(t.zoom);if(x!=null){if(x.zoomed){t.zoom=x.zoom}if(x.panned){t.pan=x.pan}}else{t.zoom=null}}return new va(i[0],t)}},animate:function e(){return function e(t,r){var n=this;var a=n.length!==undefined;var i=a?n:[n];var o=this._private.cy||this;if(!o.styleEnabled()){return this}if(r){t=ve({},t,r)}for(var s=0;s<i.length;s++){var u=i[s];var l=u.animated()&&(t.queue===undefined||t.queue);var f=u.animation(t,l?{queue:true}:undefined);f.play()}return this}},stop:function e(){return function e(t,r){var n=this;var a=n.length!==undefined;var i=a?n:[n];var o=this._private.cy||this;if(!o.styleEnabled()){return this}for(var s=0;s<i.length;s++){var u=i[s];var l=u._private;var f=l.animation.current;for(var v=0;v<f.length;v++){var c=f[v];var d=c._private;if(r){d.duration=0}}if(t){l.animation.queue=[]}if(!r){l.animation.current=[]}}o.notify("draw");return this}}};var ha={data:function e(t){var r={field:"data",bindingEvent:"data",allowBinding:false,allowSetting:false,allowGetting:false,settingEvent:"data",settingTriggersEvent:false,triggerFnName:"trigger",immutableKeys:{},updateStyle:false,beforeGet:function e(t){},beforeSet:function e(t,r){},onSet:function e(t){},canSet:function e(t){return true}};t=ve({},r,t);return function e(r,n){var a=t;var i=this;var o=i.length!==undefined;var s=o?i:[i];var u=o?i[0]:i;if(O(r)){var l=r.indexOf(".")!==-1;var f=l&&d["default"](r);if(a.allowGetting&&n===undefined){var h;if(u){a.beforeGet(u);if(f&&u._private[a.field][r]===undefined){h=v["default"](u._private[a.field],f)}else{h=u._private[a.field][r]}}return h}else if(a.allowSetting&&n!==undefined){var p=!a.immutableKeys[r];if(p){var g=m({},r,n);a.beforeSet(i,g);for(var y=0,b=s.length;y<b;y++){var x=s[y];if(a.canSet(x)){if(f&&u._private[a.field][r]===undefined){c["default"](x._private[a.field],f,n)}else{x._private[a.field][r]=n}}}if(a.updateStyle){i.updateStyle()}a.onSet(i);if(a.settingTriggersEvent){i[a.triggerFnName](a.settingEvent)}}}}else if(a.allowSetting&&L(r)){var w=r;var E,k;var _=Object.keys(w);a.beforeSet(i,w);for(var S=0;S<_.length;S++){E=_[S];k=w[E];var D=!a.immutableKeys[E];if(D){for(var C=0;C<s.length;C++){var T=s[C];if(a.canSet(T)){T._private[a.field][E]=k}}}}if(a.updateStyle){i.updateStyle()}a.onSet(i);if(a.settingTriggersEvent){i[a.triggerFnName](a.settingEvent)}}else if(a.allowBinding&&N(r)){var P=r;i.on(a.bindingEvent,P)}else if(a.allowGetting&&r===undefined){var M;if(u){a.beforeGet(u);M=u._private[a.field]}return M}return i}},removeData:function e(t){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:false,immutableKeys:{}};t=ve({},r,t);return function e(r){var n=t;var a=this;var i=a.length!==undefined;var o=i?a:[a];if(O(r)){var s=r.split(/\s+/);var u=s.length;for(var l=0;l<u;l++){var f=s[l];if(X(f)){continue}var v=!n.immutableKeys[f];if(v){for(var c=0,d=o.length;c<d;c++){o[c]._private[n.field][f]=undefined}}}if(n.triggerEvent){a[n.triggerFnName](n.event)}}else if(r===undefined){for(var h=0,p=o.length;h<p;h++){var g=o[h]._private[n.field];var y=Object.keys(g);for(var m=0;m<y.length;m++){var b=y[m];var x=!n.immutableKeys[b];if(x){g[b]=undefined}}}if(n.triggerEvent){a[n.triggerFnName](n.event)}}return a}}};var pa={eventAliasesOn:function e(t){var r=t;r.addListener=r.listen=r.bind=r.on;r.unlisten=r.unbind=r.off=r.removeListener;r.trigger=r.emit;r.pon=r.promiseOn=function(e,t){var r=this;var n=Array.prototype.slice.call(arguments,0);return new fa((function(e,t){var a=function t(n){r.off.apply(r,o);e(n)};var i=n.concat([a]);var o=i.concat([]);r.on.apply(r,i)}))}}};var ga={};[da,ha,pa].forEach((function(e){ve(ga,e)}));var ya={animate:ga.animate(),animation:ga.animation(),animated:ga.animated(),clearQueue:ga.clearQueue(),delay:ga.delay(),delayAnimation:ga.delayAnimation(),stop:ga.stop()};var ma={classes:function e(t){var r=this;if(t===undefined){var n=[];r[0]._private.classes.forEach((function(e){return n.push(e)}));return n}else if(!z(t)){t=(t||"").match(/\S+/g)||[]}var a=[];var i=new vt(t);for(var o=0;o<r.length;o++){var s=r[o];var u=s._private;var l=u.classes;var f=false;for(var v=0;v<t.length;v++){var c=t[v];var d=l.has(c);if(!d){f=true;break}}if(!f){f=l.size!==t.length}if(f){u.classes=i;a.push(s)}}if(a.length>0){this.spawn(a).updateStyle().emit("class")}return r},addClass:function e(t){return this.toggleClass(t,true)},hasClass:function e(t){var r=this[0];return r!=null&&r._private.classes.has(t)},toggleClass:function e(t,r){if(!z(t)){t=t.match(/\S+/g)||[]}var n=this;var a=r===undefined;var i=[];for(var o=0,s=n.length;o<s;o++){var u=n[o];var l=u._private.classes;var f=false;for(var v=0;v<t.length;v++){var c=t[v];var d=l.has(c);var h=false;if(r||a&&!d){l.add(c);h=true}else if(!r||a&&d){l["delete"](c);h=true}if(!f&&h){i.push(u);f=true}}}if(i.length>0){this.spawn(i).updateStyle().emit("class")}return n},removeClass:function e(t){return this.toggleClass(t,false)},flashClass:function e(t,r){var n=this;if(r==null){r=250}else if(r===0){return n}n.addClass(t);setTimeout((function(){n.removeClass(t)}),r);return n}};ma.className=ma.classNames=ma.classes;var ba={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])*"'+"|"+"'(?:\\\\'|[^'])*'",number:re,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};ba.variable="(?:[\\w-.]|(?:\\\\"+ba.metaChar+"))+";ba.className="(?:[\\w-]|(?:\\\\"+ba.metaChar+"))+";ba.value=ba.string+"|"+ba.number;ba.id=ba.variable;(function(){var e,t,r;e=ba.comparatorOp.split("|");for(r=0;r<e.length;r++){t=e[r];ba.comparatorOp+="|@"+t}e=ba.comparatorOp.split("|");for(r=0;r<e.length;r++){t=e[r];if(t.indexOf("!")>=0){continue}if(t==="="){continue}ba.comparatorOp+="|\\!"+t}})();var xa=function e(){return{checks:[]}};var wa={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};var Ea=[{selector:":selected",matches:function e(t){return t.selected()}},{selector:":unselected",matches:function e(t){return!t.selected()}},{selector:":selectable",matches:function e(t){return t.selectable()}},{selector:":unselectable",matches:function e(t){return!t.selectable()}},{selector:":locked",matches:function e(t){return t.locked()}},{selector:":unlocked",matches:function e(t){return!t.locked()}},{selector:":visible",matches:function e(t){return t.visible()}},{selector:":hidden",matches:function e(t){return!t.visible()}},{selector:":transparent",matches:function e(t){return t.transparent()}},{selector:":grabbed",matches:function e(t){return t.grabbed()}},{selector:":free",matches:function e(t){return!t.grabbed()}},{selector:":removed",matches:function e(t){return t.removed()}},{selector:":inside",matches:function e(t){return!t.removed()}},{selector:":grabbable",matches:function e(t){return t.grabbable()}},{selector:":ungrabbable",matches:function e(t){return!t.grabbable()}},{selector:":animated",matches:function e(t){return t.animated()}},{selector:":unanimated",matches:function e(t){return!t.animated()}},{selector:":parent",matches:function e(t){return t.isParent()}},{selector:":childless",matches:function e(t){return t.isChildless()}},{selector:":child",matches:function e(t){return t.isChild()}},{selector:":orphan",matches:function e(t){return t.isOrphan()}},{selector:":nonorphan",matches:function e(t){return t.isChild()}},{selector:":compound",matches:function e(t){if(t.isNode()){return t.isParent()}else{return t.source().isParent()||t.target().isParent()}}},{selector:":loop",matches:function e(t){return t.isLoop()}},{selector:":simple",matches:function e(t){return t.isSimple()}},{selector:":active",matches:function e(t){return t.active()}},{selector:":inactive",matches:function e(t){return!t.active()}},{selector:":backgrounding",matches:function e(t){return t.backgrounding()}},{selector:":nonbackgrounding",matches:function e(t){return!t.backgrounding()}}].sort((function(e,t){return fe(e.selector,t.selector)}));var ka=function(){var e={};var t;for(var r=0;r<Ea.length;r++){t=Ea[r];e[t.selector]=t.matches}return e}();var _a=function e(t,r){return ka[t](r)};var Sa="("+Ea.map((function(e){return e.selector})).join("|")+")";var Da=function e(t){return t.replace(new RegExp("\\\\("+ba.metaChar+")","g"),(function(e,t){return t}))};var Ca=function e(t,r,n){t[t.length-1]=n};var Ta=[{name:"group",query:true,regex:"("+ba.group+")",populate:function e(t,r,n){var a=b(n,1),i=a[0];r.checks.push({type:wa.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:true,regex:Sa,populate:function e(t,r,n){var a=b(n,1),i=a[0];r.checks.push({type:wa.STATE,value:i})}},{name:"id",query:true,regex:"\\#("+ba.id+")",populate:function e(t,r,n){var a=b(n,1),i=a[0];r.checks.push({type:wa.ID,value:Da(i)})}},{name:"className",query:true,regex:"\\.("+ba.className+")",populate:function e(t,r,n){var a=b(n,1),i=a[0];r.checks.push({type:wa.CLASS,value:Da(i)})}},{name:"dataExists",query:true,regex:"\\[\\s*("+ba.variable+")\\s*\\]",populate:function e(t,r,n){var a=b(n,1),i=a[0];r.checks.push({type:wa.DATA_EXIST,field:Da(i)})}},{name:"dataCompare",query:true,regex:"\\[\\s*("+ba.variable+")\\s*("+ba.comparatorOp+")\\s*("+ba.value+")\\s*\\]",populate:function e(t,r,n){var a=b(n,3),i=a[0],o=a[1],s=a[2];var u=new RegExp("^"+ba.string+"$").exec(s)!=null;if(u){s=s.substring(1,s.length-1)}else{s=parseFloat(s)}r.checks.push({type:wa.DATA_COMPARE,field:Da(i),operator:o,value:s})}},{name:"dataBool",query:true,regex:"\\[\\s*("+ba.boolOp+")\\s*("+ba.variable+")\\s*\\]",populate:function e(t,r,n){var a=b(n,2),i=a[0],o=a[1];r.checks.push({type:wa.DATA_BOOL,field:Da(o),operator:i})}},{name:"metaCompare",query:true,regex:"\\[\\[\\s*("+ba.meta+")\\s*("+ba.comparatorOp+")\\s*("+ba.number+")\\s*\\]\\]",populate:function e(t,r,n){var a=b(n,3),i=a[0],o=a[1],s=a[2];r.checks.push({type:wa.META_COMPARE,field:Da(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:true,regex:ba.separator,populate:function e(t,r){var n=t.currentSubject;var a=t.edgeCount;var i=t.compoundCount;var o=t[t.length-1];if(n!=null){o.subject=n;t.currentSubject=null}o.edgeCount=a;o.compoundCount=i;t.edgeCount=0;t.compoundCount=0;var s=t[t.length++]=xa();return s}},{name:"directedEdge",separator:true,regex:ba.directedEdge,populate:function e(t,r){if(t.currentSubject==null){var n=xa();var a=r;var i=xa();n.checks.push({type:wa.DIRECTED_EDGE,source:a,target:i});Ca(t,r,n);t.edgeCount++;return i}else{var o=xa();var s=r;var u=xa();o.checks.push({type:wa.NODE_SOURCE,source:s,target:u});Ca(t,r,o);t.edgeCount++;return u}}},{name:"undirectedEdge",separator:true,regex:ba.undirectedEdge,populate:function e(t,r){if(t.currentSubject==null){var n=xa();var a=r;var i=xa();n.checks.push({type:wa.UNDIRECTED_EDGE,nodes:[a,i]});Ca(t,r,n);t.edgeCount++;return i}else{var o=xa();var s=r;var u=xa();o.checks.push({type:wa.NODE_NEIGHBOR,node:s,neighbor:u});Ca(t,r,o);return u}}},{name:"child",separator:true,regex:ba.child,populate:function e(t,r){if(t.currentSubject==null){var n=xa();var a=xa();var i=t[t.length-1];n.checks.push({type:wa.CHILD,parent:i,child:a});Ca(t,r,n);t.compoundCount++;return a}else if(t.currentSubject===r){var o=xa();var s=t[t.length-1];var u=xa();var l=xa();var f=xa();var v=xa();o.checks.push({type:wa.COMPOUND_SPLIT,left:s,right:u,subject:l});l.checks=r.checks;r.checks=[{type:wa.TRUE}];v.checks.push({type:wa.TRUE});u.checks.push({type:wa.PARENT,parent:v,child:f});Ca(t,s,o);t.currentSubject=l;t.compoundCount++;return f}else{var c=xa();var d=xa();var h=[{type:wa.PARENT,parent:c,child:d}];c.checks=r.checks;r.checks=h;t.compoundCount++;return d}}},{name:"descendant",separator:true,regex:ba.descendant,populate:function e(t,r){if(t.currentSubject==null){var n=xa();var a=xa();var i=t[t.length-1];n.checks.push({type:wa.DESCENDANT,ancestor:i,descendant:a});Ca(t,r,n);t.compoundCount++;return a}else if(t.currentSubject===r){var o=xa();var s=t[t.length-1];var u=xa();var l=xa();var f=xa();var v=xa();o.checks.push({type:wa.COMPOUND_SPLIT,left:s,right:u,subject:l});l.checks=r.checks;r.checks=[{type:wa.TRUE}];v.checks.push({type:wa.TRUE});u.checks.push({type:wa.ANCESTOR,ancestor:v,descendant:f});Ca(t,s,o);t.currentSubject=l;t.compoundCount++;return f}else{var c=xa();var d=xa();var h=[{type:wa.ANCESTOR,ancestor:c,descendant:d}];c.checks=r.checks;r.checks=h;t.compoundCount++;return d}}},{name:"subject",modifier:true,regex:ba.subject,populate:function e(t,r){if(t.currentSubject!=null&&t.currentSubject!==r){Ue("Redefinition of subject in selector `"+t.toString()+"`");return false}t.currentSubject=r;var n=t[t.length-1];var a=n.checks[0];var i=a==null?null:a.type;if(i===wa.DIRECTED_EDGE){a.type=wa.NODE_TARGET}else if(i===wa.UNDIRECTED_EDGE){a.type=wa.NODE_NEIGHBOR;a.node=a.nodes[1];a.neighbor=a.nodes[0];a.nodes=null}}}];Ta.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Pa=function e(t){var r;var n;var a;for(var i=0;i<Ta.length;i++){var o=Ta[i];var s=o.name;var u=t.match(o.regexObj);if(u!=null){n=u;r=o;a=s;var l=u[0];t=t.substring(l.length);break}}return{expr:r,match:n,name:a,remaining:t}};var Ma=function e(t){var r=t.match(/^\s+/);if(r){var n=r[0];t=t.substring(n.length)}return t};var Ia=function e(t){var r=this;var n=r.inputText=t;var a=r[0]=xa();r.length=1;n=Ma(n);for(;;){var i=Pa(n);if(i.expr==null){Ue("The selector `"+t+"`is invalid");return false}else{var o=i.match.slice(1);var s=i.expr.populate(r,a,o);if(s===false){return false}else if(s!=null){a=s}}n=i.remaining;if(n.match(/^\s*$/)){break}}var u=r[r.length-1];if(r.currentSubject!=null){u.subject=r.currentSubject}u.edgeCount=r.edgeCount;u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0){Ue("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector");return false}if(f.edgeCount>1){Ue("The selector `"+t+"` is invalid because it uses multiple edge selectors");return false}else if(f.edgeCount===1){Ue("The selector `"+t+"` 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 true};var Oa=function e(){if(this.toStringCache!=null){return this.toStringCache}var t=function e(t){if(t==null){return""}else{return t}};var r=function e(r){if(O(r)){return'"'+r+'"'}else{return t(r)}};var n=function e(t){return" "+t+" "};var a=function e(a,o){var s=a.type,u=a.value;switch(s){case wa.GROUP:{var l=t(u);return l.substring(0,l.length-1)}case wa.DATA_COMPARE:{var f=a.field,v=a.operator;return"["+f+n(t(v))+r(u)+"]"}case wa.DATA_BOOL:{var c=a.operator,d=a.field;return"["+t(c)+d+"]"}case wa.DATA_EXIST:{var h=a.field;return"["+h+"]"}case wa.META_COMPARE:{var p=a.operator,g=a.field;return"[["+g+n(t(p))+r(u)+"]]"}case wa.STATE:{return u}case wa.ID:{return"#"+u}case wa.CLASS:{return"."+u}case wa.PARENT:case wa.CHILD:{return i(a.parent,o)+n(">")+i(a.child,o)}case wa.ANCESTOR:case wa.DESCENDANT:{return i(a.ancestor,o)+" "+i(a.descendant,o)}case wa.COMPOUND_SPLIT:{var y=i(a.left,o);var m=i(a.subject,o);var b=i(a.right,o);return y+(y.length>0?" ":"")+m+b}case wa.TRUE:{return""}}};var i=function e(t,r){return t.checks.reduce((function(e,n,i){return e+(r===t&&i===0?"$":"")+a(n,r)}),"")};var o="";for(var s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject);if(this.length>1&&s<this.length-1){o+=", "}}this.toStringCache=o;return o};var Na={parse:Ia,toString:Oa};var za=function e(t,r,n){var a;var i=O(t);var o=B(t);var s=O(n);var u,l;var f=false;var v=false;var c=false;if(r.indexOf("!")>=0){r=r.replace("!","");v=true}if(r.indexOf("@")>=0){r=r.replace("@","");f=true}if(i||s||f){u=!i&&!o?"":""+t;l=""+n}if(f){t=u=u.toLowerCase();n=l=l.toLowerCase()}switch(r){case"*=":a=u.indexOf(l)>=0;break;case"$=":a=u.indexOf(l,u.length-l.length)>=0;break;case"^=":a=u.indexOf(l)===0;break;case"=":a=t===n;break;case">":c=true;a=t>n;break;case">=":c=true;a=t>=n;break;case"<":c=true;a=t<n;break;case"<=":c=true;a=t<=n;break;default:a=false;break}if(v&&(t!=null||!c)){a=!a}return a};var La=function e(t,r){switch(r){case"?":return t?true:false;case"!":return t?false:true;case"^":return t===undefined}};var Aa=function e(t){return t!==undefined};var Ba=function e(t,r){return t.data(r)};var Ra=function e(t,r){return t[r]()};var ja=[];var Fa=function e(t,r){return t.checks.every((function(e){return ja[e.type](e,r)}))};ja[wa.GROUP]=function(e,t){var r=e.value;return r==="*"||r===t.group()};ja[wa.STATE]=function(e,t){var r=e.value;return _a(r,t)};ja[wa.ID]=function(e,t){var r=e.value;return t.id()===r};ja[wa.CLASS]=function(e,t){var r=e.value;return t.hasClass(r)};ja[wa.META_COMPARE]=function(e,t){var r=e.field,n=e.operator,a=e.value;return za(Ra(t,r),n,a)};ja[wa.DATA_COMPARE]=function(e,t){var r=e.field,n=e.operator,a=e.value;return za(Ba(t,r),n,a)};ja[wa.DATA_BOOL]=function(e,t){var r=e.field,n=e.operator;return La(Ba(t,r),n)};ja[wa.DATA_EXIST]=function(e,t){var r=e.field;e.operator;return Aa(Ba(t,r))};ja[wa.UNDIRECTED_EDGE]=function(e,t){var r=e.nodes[0];var n=e.nodes[1];var a=t.source();var i=t.target();return Fa(r,a)&&Fa(n,i)||Fa(n,a)&&Fa(r,i)};ja[wa.NODE_NEIGHBOR]=function(e,t){return Fa(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Fa(e.neighbor,t)}))};ja[wa.DIRECTED_EDGE]=function(e,t){return Fa(e.source,t.source())&&Fa(e.target,t.target())};ja[wa.NODE_SOURCE]=function(e,t){return Fa(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Fa(e.target,t)}))};ja[wa.NODE_TARGET]=function(e,t){return Fa(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Fa(e.source,t)}))};ja[wa.CHILD]=function(e,t){return Fa(e.child,t)&&Fa(e.parent,t.parent())};ja[wa.PARENT]=function(e,t){return Fa(e.parent,t)&&t.children().some((function(t){return Fa(e.child,t)}))};ja[wa.DESCENDANT]=function(e,t){return Fa(e.descendant,t)&&t.ancestors().some((function(t){return Fa(e.ancestor,t)}))};ja[wa.ANCESTOR]=function(e,t){return Fa(e.ancestor,t)&&t.descendants().some((function(t){return Fa(e.descendant,t)}))};ja[wa.COMPOUND_SPLIT]=function(e,t){return Fa(e.subject,t)&&Fa(e.left,t)&&Fa(e.right,t)};ja[wa.TRUE]=function(){return true};ja[wa.COLLECTION]=function(e,t){var r=e.value;return r.has(t)};ja[wa.FILTER]=function(e,t){var r=e.value;return r(t)};var Va=function e(t){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===wa.ID){return t.getElementById(r[0].checks[0].value).collection()}var n=function e(t){for(var n=0;n<r.length;n++){var a=r[n];if(Fa(a,t)){return true}}return false};if(r.text()==null){n=function e(){return true}}return t.filter(n)};var qa=function e(t){var r=this;for(var n=0;n<r.length;n++){var a=r[n];if(Fa(a,t)){return true}}return false};var Ga={matches:qa,filter:Va};var Ya=function e(t){this.inputText=t;this.currentSubject=null;this.compoundCount=0;this.edgeCount=0;this.length=0;if(t==null||O(t)&&t.match(/^\s*$/));else if(F(t)){this.addQuery({checks:[{type:wa.COLLECTION,value:t.collection()}]})}else if(N(t)){this.addQuery({checks:[{type:wa.FILTER,value:t}]})}else if(O(t)){if(!this.parse(t)){this.invalid=true}}else{Xe("A selector must be created from a string; found ")}};var Wa=Ya.prototype;[Na,Ga].forEach((function(e){return ve(Wa,e)}));Wa.text=function(){return this.inputText};Wa.size=function(){return this.length};Wa.eq=function(e){return this[e]};Wa.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()};Wa.addQuery=function(e){this[this.length++]=e};Wa.selector=Wa.toString;var Xa={allAre:function e(t){var r=new Ya(t);return this.every((function(e){return r.matches(e)}))},is:function e(t){var r=new Ya(t);return this.some((function(e){return r.matches(e)}))},some:function e(t,r){for(var n=0;n<this.length;n++){var a=!r?t(this[n],n,this):t.apply(r,[this[n],n,this]);if(a){return true}}return false},every:function e(t,r){for(var n=0;n<this.length;n++){var a=!r?t(this[n],n,this):t.apply(r,[this[n],n,this]);if(!a){return false}}return true},same:function e(t){if(this===t){return true}t=this.cy().collection(t);var r=this.length;var n=t.length;if(r!==n){return false}if(r===1){return this[0]===t[0]}return this.every((function(e){return t.hasElementWithId(e.id())}))},anySame:function e(t){t=this.cy().collection(t);return this.some((function(e){return t.hasElementWithId(e.id())}))},allAreNeighbors:function e(t){t=this.cy().collection(t);var r=this.neighborhood();return t.every((function(e){return r.hasElementWithId(e.id())}))},contains:function e(t){t=this.cy().collection(t);var r=this;return t.every((function(e){return r.hasElementWithId(e.id())}))}};Xa.allAreNeighbours=Xa.allAreNeighbors;Xa.has=Xa.contains;Xa.equal=Xa.equals=Xa.same;var Ha=function e(t,r){return function e(n,a,i,o){var s=n;var u=this;var l;if(s==null){l=""}else if(F(s)&&s.length===1){l=s.id()}if(u.length===1&&l){var f=u[0]._private;var v=f.traversalCache=f.traversalCache||{};var c=v[r]=v[r]||[];var d=Le(l);var h=c[d];if(h){return h}else{return c[d]=t.call(u,n,a,i,o)}}else{return t.call(u,n,a,i,o)}}};var Ua={parent:function e(t){var r=[];if(this.length===1){var e=this[0]._private.parent;if(e){return e}}for(var n=0;n<this.length;n++){var a=this[n];var i=a._private.parent;if(i){r.push(i)}}return this.spawn(r,true).filter(t)},parents:function e(t){var e=[];var r=this.parent();while(r.nonempty()){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}r=r.parent()}return this.spawn(e,true).filter(t)},commonAncestors:function e(t){var r;for(var n=0;n<this.length;n++){var a=this[n];var i=a.parents();r=r||i;r=r.intersect(i)}return r.filter(t)},orphans:function e(t){return this.stdFilter((function(e){return e.isOrphan()})).filter(t)},nonorphans:function e(t){return this.stdFilter((function(e){return e.isChild()})).filter(t)},children:Ha((function(e){var t=[];for(var r=0;r<this.length;r++){var n=this[r];var a=n._private.children;for(var i=0;i<a.length;i++){t.push(a[i])}}return this.spawn(t,true).filter(e)}),"children"),siblings:function e(t){return this.parent().children().not(this).filter(t)},isParent:function e(){var t=this[0];if(t){return t.isNode()&&t._private.children.length!==0}},isChildless:function e(){var t=this[0];if(t){return t.isNode()&&t._private.children.length===0}},isChild:function e(){var t=this[0];if(t){return t.isNode()&&t._private.parent!=null}},isOrphan:function e(){var t=this[0];if(t){return t.isNode()&&t._private.parent==null}},descendants:function e(t){var r=[];function n(e){for(var t=0;t<e.length;t++){var a=e[t];r.push(a);if(a.children().nonempty()){n(a.children())}}}n(this.children());return this.spawn(r,true).filter(t)}};function Ka(e,t,r,n){var a=[];var i=new vt;var o=e.cy();var s=o.hasCompoundNodes();for(var u=0;u<e.length;u++){var l=e[u];if(r){a.push(l)}else if(s){n(a,i,l)}}while(a.length>0){var f=a.shift();t(f);i.add(f.id());if(s){n(a,i,f)}}return e}function Za(e,t,r){if(r.isParent()){var n=r._private.children;for(var a=0;a<n.length;a++){var i=n[a];if(!t.has(i.id())){e.push(i)}}}}Ua.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return Ka(this,e,t,Za)};function $a(e,t,r){if(r.isChild()){var n=r._private.parent;if(!t.has(n.id())){e.push(n)}}}Ua.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return Ka(this,e,t,$a)};function Qa(e,t,r){$a(e,t,r);Za(e,t,r)}Ua.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return Ka(this,e,t,Qa)};Ua.ancestors=Ua.parents;var Ja,ei;Ja=ei={data:ga.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,immutableKeys:{id:true,source:true,target:true,parent:true},updateStyle:true}),removeData:ga.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,immutableKeys:{id:true,source:true,target:true,parent:true},updateStyle:true}),scratch:ga.data({field:"scratch",bindingEvent:"scratch",allowBinding:true,allowSetting:true,settingEvent:"scratch",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeScratch:ga.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:true,updateStyle:true}),rscratch:ga.data({field:"rscratch",allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:true}),removeRscratch:ga.removeData({field:"rscratch",triggerEvent:false}),id:function e(){var t=this[0];if(t){return t._private.data.id}}};Ja.attr=Ja.data;Ja.removeAttr=Ja.removeData;var ti=ei;var ri={};function ni(e){return function(t){var r=this;if(t===undefined){t=true}if(r.length===0){return}if(r.isNode()&&!r.removed()){var n=0;var a=r[0];var i=a._private.edges;for(var o=0;o<i.length;o++){var s=i[o];if(!t&&s.isLoop()){continue}n+=e(a,s)}return n}else{return}}}ve(ri,{degree:ni((function(e,t){if(t.source().same(t.target())){return 2}else{return 1}})),indegree:ni((function(e,t){if(t.target().same(e)){return 1}else{return 0}})),outdegree:ni((function(e,t){if(t.source().same(e)){return 1}else{return 0}}))});function ai(e,t){return function(r){var n;var a=this.nodes();for(var i=0;i<a.length;i++){var o=a[i];var s=o[e](r);if(s!==undefined&&(n===undefined||t(s,n))){n=s}}return n}}ve(ri,{minDegree:ai("degree",(function(e,t){return e<t})),maxDegree:ai("degree",(function(e,t){return e>t})),minIndegree:ai("indegree",(function(e,t){return e<t})),maxIndegree:ai("indegree",(function(e,t){return e>t})),minOutdegree:ai("outdegree",(function(e,t){return e<t})),maxOutdegree:ai("outdegree",(function(e,t){return e>t}))});ve(ri,{totalDegree:function e(t){var r=0;var n=this.nodes();for(var a=0;a<n.length;a++){r+=n[a].degree(t)}return r}});var ii,oi;var si=function e(t,r,n){for(var a=0;a<t.length;a++){var i=t[a];if(!i.locked()){var o=i._private.position;var s={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};if(i.isParent()&&!(s.x===0&&s.y===0)){i.children().shift(s,n)}i.dirtyBoundingBoxCache()}}};var ui={field:"position",bindingEvent:"position",allowBinding:true,allowSetting:true,settingEvent:"position",settingTriggersEvent:true,triggerFnName:"emitAndNotify",allowGetting:true,validKeys:["x","y"],beforeGet:function e(t){t.updateCompoundBounds()},beforeSet:function e(t,r){si(t,r,false)},onSet:function e(t){t.dirtyCompoundBoundsCache()},canSet:function e(t){return!t.locked()}};ii=oi={position:ga.data(ui),silentPosition:ga.data(ve({},ui,{allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:false,beforeSet:function e(t,r){si(t,r,true)},onSet:function e(t){t.dirtyCompoundBoundsCache()}})),positions:function e(t,r){if(L(t)){if(r){this.silentPosition(t)}else{this.position(t)}}else if(N(t)){var n=t;var a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i];var s=void 0;if(s=n(o,i)){if(r){o.silentPosition(s)}else{o.position(s)}}}a.endBatch()}return this},silentPositions:function e(t){return this.positions(t,true)},shift:function e(t,r,n){var a;if(L(t)){a={x:B(t.x)?t.x:0,y:B(t.y)?t.y:0};n=r}else if(O(t)&&B(r)){a={x:0,y:0};a[t]=r}if(a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this)){continue}var u=s.position();var l={x:u.x+a.x,y:u.y+a.y};if(n){s.silentPosition(l)}else{s.position(l)}}i.endBatch()}return this},silentShift:function e(t,r){if(L(t)){this.shift(t,true)}else if(O(t)&&B(r)){this.shift(t,r,true)}return this},renderedPosition:function e(t,r){var n=this[0];var a=this.cy();var i=a.zoom();var o=a.pan();var s=L(t)?t:undefined;var u=s!==undefined||r!==undefined&&O(t);if(n&&n.isNode()){if(u){for(var l=0;l<this.length;l++){var f=this[l];if(r!==undefined){f.position(t,(r-o[t])/i)}else if(s!==undefined){f.position(Mt(s,i,o))}}}else{var v=n.position();s=Pt(v,i,o);if(t===undefined){return s}else{return s[t]}}}else if(!u){return undefined}return this},relativePosition:function e(t,r){var n=this[0];var a=this.cy();var i=L(t)?t:undefined;var o=i!==undefined||r!==undefined&&O(t);var s=a.hasCompoundNodes();if(n&&n.isNode()){if(o){for(var u=0;u<this.length;u++){var l=this[u];var f=s?l.parent():null;var v=f&&f.length>0;var c=v;if(v){f=f[0]}var d=c?f.position():{x:0,y:0};if(r!==undefined){l.position(t,r+d[t])}else if(i!==undefined){l.position({x:i.x+d.x,y:i.y+d.y})}}}else{var h=n.position();var p=s?n.parent():null;var g=p&&p.length>0;var y=g;if(g){p=p[0]}var m=y?p.position():{x:0,y:0};i={x:h.x-m.x,y:h.y-m.y};if(t===undefined){return i}else{return i[t]}}}else if(!o){return undefined}return this}};ii.modelPosition=ii.point=ii.position;ii.modelPositions=ii.points=ii.positions;ii.renderedPoint=ii.renderedPosition;ii.relativePoint=ii.relativePosition;var li=oi;var fi,vi;fi=vi={};vi.renderedBoundingBox=function(e){var t=this.boundingBox(e);var r=this.cy();var n=r.zoom();var a=r.pan();var i=t.x1*n+a.x;var o=t.x2*n+a.x;var s=t.y1*n+a.y;var u=t.y2*n+a.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};vi.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()){return this}this.forEachUp((function(t){if(t.isParent()){var r=t._private;r.compoundBoundsClean=false;r.bbCache=null;if(!e){t.emitAndNotify("bounds")}}}));return this};vi.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()){return this}if(!e&&t.batching()){return this}function r(e){if(!e.isParent()){return}var t=e._private;var r=e.children();var n=e.pstyle("compound-sizing-wrt-labels").value==="include";var a={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}};var i=r.boundingBox({includeLabels:n,includeOverlays:false,useCache:false});var o=t.position;if(i.w===0||i.h===0){i={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue};i.x1=o.x-i.w/2;i.x2=o.x+i.w/2;i.y1=o.y-i.h/2;i.y2=o.y+i.h/2}function s(e,t,r){var n=0;var a=0;var i=t+r;if(e>0&&i>0){n=t/i*e;a=r/i*e}return{biasDiff:n,biasComplementDiff:a}}function u(e,t,r,n){if(r.units==="%"){switch(n){case"width":return e>0?r.pfValue*e:0;case"height":return t>0?r.pfValue*t:0;case"average":return e>0&&t>0?r.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?r.pfValue*t:r.pfValue*e:0;case"max":return e>0&&t>0?e>t?r.pfValue*e:r.pfValue*t:0;default:return 0}}else if(r.units==="px"){return r.pfValue}else{return 0}}var l=a.width.left.value;if(a.width.left.units==="px"&&a.width.val>0){l=l*100/a.width.val}var f=a.width.right.value;if(a.width.right.units==="px"&&a.width.val>0){f=f*100/a.width.val}var v=a.height.top.value;if(a.height.top.units==="px"&&a.height.val>0){v=v*100/a.height.val}var c=a.height.bottom.value;if(a.height.bottom.units==="px"&&a.height.val>0){c=c*100/a.height.val}var d=s(a.width.val-i.w,l,f);var h=d.biasDiff;var p=d.biasComplementDiff;var g=s(a.height.val-i.h,v,c);var y=g.biasDiff;var m=g.biasComplementDiff;t.autoPadding=u(i.w,i.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value);t.autoWidth=Math.max(i.w,a.width.val);o.x=(-h+i.x1+i.x2+p)/2;t.autoHeight=Math.max(i.h,a.height.val);o.y=(-y+i.y1+i.y2+m)/2}for(var n=0;n<this.length;n++){var a=this[n];var i=a._private;if(!i.compoundBoundsClean||e){r(a);if(!t.batching()){i.compoundBoundsClean=true}}}return this};var ci=function e(t){if(t===Infinity||t===-Infinity){return 0}return t};var di=function e(t,r,n,a,i){if(a-r===0||i-n===0){return}if(r==null||n==null||a==null||i==null){return}t.x1=r<t.x1?r:t.x1;t.x2=a>t.x2?a:t.x2;t.y1=n<t.y1?n:t.y1;t.y2=i>t.y2?i:t.y2;t.w=t.x2-t.x1;t.h=t.y2-t.y1};var hi=function e(t,r){if(r==null){return t}return di(t,r.x1,r.y1,r.x2,r.y2)};var pi=function e(t,r,n){return it(t,r,n)};var gi=function e(t,r,n){if(r.cy().headless()){return}var a=r._private;var i=a.rstyle;var o=i.arrowWidth/2;var s=r.pstyle(n+"-arrow-shape").value;var u;var l;if(s!=="none"){if(n==="source"){u=i.srcX;l=i.srcY}else if(n==="target"){u=i.tgtX;l=i.tgtY}else{u=i.midX;l=i.midY}var f=a.arrowBounds=a.arrowBounds||{};var v=f[n]=f[n]||{};v.x1=u-o;v.y1=l-o;v.x2=u+o;v.y2=l+o;v.w=v.x2-v.x1;v.h=v.y2-v.y1;Jt(v,1);di(t,v.x1,v.y1,v.x2,v.y2)}};var yi=function e(t,r,n){if(r.cy().headless()){return}var a;if(n){a=n+"-"}else{a=""}var i=r._private;var o=i.rstyle;var s=r.pstyle(a+"label").strValue;if(s){var u=r.pstyle("text-halign");var l=r.pstyle("text-valign");var f=pi(o,"labelWidth",n);var v=pi(o,"labelHeight",n);var c=pi(o,"labelX",n);var d=pi(o,"labelY",n);var h=r.pstyle(a+"text-margin-x").pfValue;var p=r.pstyle(a+"text-margin-y").pfValue;var g=r.isEdge();var y=r.pstyle(a+"text-rotation");var m=r.pstyle("text-outline-width").pfValue;var b=r.pstyle("text-border-width").pfValue;var x=b/2;var w=r.pstyle("text-background-padding").pfValue;var E=2;var k=v;var _=f;var S=_/2;var D=k/2;var C,T,P,M;if(g){C=c-S;T=c+S;P=d-D;M=d+D}else{switch(u.value){case"left":C=c-_;T=c;break;case"center":C=c-S;T=c+S;break;case"right":C=c;T=c+_;break}switch(l.value){case"top":P=d-k;M=d;break;case"center":P=d-D;M=d+D;break;case"bottom":P=d;M=d+k;break}}C+=h-Math.max(m,x)-w-E;T+=h+Math.max(m,x)+w+E;P+=p-Math.max(m,x)-w-E;M+=p+Math.max(m,x)+w+E;var I=n||"main";var O=i.labelBounds;var N=O[I]=O[I]||{};N.x1=C;N.y1=P;N.x2=T;N.y2=M;N.w=T-C;N.h=M-P;var z=g&&y.strValue==="autorotate";var L=y.pfValue!=null&&y.pfValue!==0;if(z||L){var A=z?pi(i.rstyle,"labelAngle",n):y.pfValue;var B=Math.cos(A);var R=Math.sin(A);var j=(C+T)/2;var F=(P+M)/2;if(!g){switch(u.value){case"left":j=T;break;case"right":j=C;break}switch(l.value){case"top":F=M;break;case"bottom":F=P;break}}var V=function e(t,r){t=t-j;r=r-F;return{x:t*B-r*R+j,y:t*R+r*B+F}};var q=V(C,P);var G=V(C,M);var Y=V(T,P);var W=V(T,M);C=Math.min(q.x,G.x,Y.x,W.x);T=Math.max(q.x,G.x,Y.x,W.x);P=Math.min(q.y,G.y,Y.y,W.y);M=Math.max(q.y,G.y,Y.y,W.y)}var X=I+"Rot";var H=O[X]=O[X]||{};H.x1=C;H.y1=P;H.x2=T;H.y2=M;H.w=T-C;H.h=M-P;di(t,C,P,T,M);di(i.labelBounds.all,C,P,T,M)}return t};var mi=function e(t,r){if(r.cy().headless()){return}var n=r.pstyle("outline-opacity").value;var a=r.pstyle("outline-width").value;if(n>0&&a>0){var i=r.pstyle("outline-offset").value;var o=r.pstyle("shape").value;var s=a+i;var u=(t.w+s*2)/t.w;var l=(t.h+s*2)/t.h;var f=0;var v=0;if(["diamond","pentagon","round-triangle"].includes(o)){u=(t.w+s*2.4)/t.w;v=-s/3.6}else if(["concave-hexagon","rhomboid","right-rhomboid"].includes(o)){u=(t.w+s*2.4)/t.w}else if(o==="star"){u=(t.w+s*2.8)/t.w;l=(t.h+s*2.6)/t.h;v=-s/3.8}else if(o==="triangle"){u=(t.w+s*2.8)/t.w;l=(t.h+s*2.4)/t.h;v=-s/1.4}else if(o==="vee"){u=(t.w+s*4.4)/t.w;l=(t.h+s*3.8)/t.h;v=-s*.5}var c=t.h*l-t.h;var d=t.w*u-t.w;er(t,[Math.ceil(c/2),Math.ceil(d/2)]);if(f!=0||v!==0){var h=Zt(t,f,v);$t(t,h)}}};var bi=function e(t,r){var n=t._private.cy;var a=n.styleEnabled();var i=n.headless();var o=Ht();var s=t._private;var u=t.isNode();var l=t.isEdge();var f,v,c,d;var h,p;var g=s.rstyle;var y=u&&a?t.pstyle("bounds-expansion").pfValue:[0];var m=function e(t){return t.pstyle("display").value!=="none"};var b=!a||m(t)&&(!l||m(t.source())&&m(t.target()));if(b){var x=0;var w=0;if(a&&r.includeOverlays){x=t.pstyle("overlay-opacity").value;if(x!==0){w=t.pstyle("overlay-padding").value}}var E=0;var k=0;if(a&&r.includeUnderlays){E=t.pstyle("underlay-opacity").value;if(E!==0){k=t.pstyle("underlay-padding").value}}var _=Math.max(w,k);var S=0;var D=0;if(a){S=t.pstyle("width").pfValue;D=S/2}if(u&&r.includeNodes){var C=t.position();h=C.x;p=C.y;var T=t.outerWidth();var P=T/2;var M=t.outerHeight();var I=M/2;f=h-P;v=h+P;c=p-I;d=p+I;di(o,f,c,v,d);if(a&&r.includeOutlines){mi(o,t)}}else if(l&&r.includeEdges){if(a&&!i){var O=t.pstyle("curve-style").strValue;f=Math.min(g.srcX,g.midX,g.tgtX);v=Math.max(g.srcX,g.midX,g.tgtX);c=Math.min(g.srcY,g.midY,g.tgtY);d=Math.max(g.srcY,g.midY,g.tgtY);f-=D;v+=D;c-=D;d+=D;di(o,f,c,v,d);if(O==="haystack"){var N=g.haystackPts;if(N&&N.length===2){f=N[0].x;c=N[0].y;v=N[1].x;d=N[1].y;if(f>v){var z=f;f=v;v=z}if(c>d){var L=c;c=d;d=L}di(o,f-D,c-D,v+D,d+D)}}else if(O==="bezier"||O==="unbundled-bezier"||O==="segments"||O==="taxi"){var A;switch(O){case"bezier":case"unbundled-bezier":A=g.bezierPts;break;case"segments":case"taxi":A=g.linePts;break}if(A!=null){for(var B=0;B<A.length;B++){var R=A[B];f=R.x-D;v=R.x+D;c=R.y-D;d=R.y+D;di(o,f,c,v,d)}}}}else{var j=t.source();var F=j.position();var V=t.target();var q=V.position();f=F.x;v=q.x;c=F.y;d=q.y;if(f>v){var G=f;f=v;v=G}if(c>d){var Y=c;c=d;d=Y}f-=D;v+=D;c-=D;d+=D;di(o,f,c,v,d)}}if(a&&r.includeEdges&&l){gi(o,t,"mid-source");gi(o,t,"mid-target");gi(o,t,"source");gi(o,t,"target")}if(a){var W=t.pstyle("ghost").value==="yes";if(W){var X=t.pstyle("ghost-offset-x").pfValue;var H=t.pstyle("ghost-offset-y").pfValue;di(o,o.x1+X,o.y1+H,o.x2+X,o.y2+H)}}var U=s.bodyBounds=s.bodyBounds||{};tr(U,o);er(U,y);Jt(U,1);if(a){f=o.x1;v=o.x2;c=o.y1;d=o.y2;di(o,f-_,c-_,v+_,d+_)}var K=s.overlayBounds=s.overlayBounds||{};tr(K,o);er(K,y);Jt(K,1);var Z=s.labelBounds=s.labelBounds||{};if(Z.all!=null){Kt(Z.all)}else{Z.all=Ht()}if(a&&r.includeLabels){if(r.includeMainLabels){yi(o,t,null)}if(l){if(r.includeSourceLabels){yi(o,t,"source")}if(r.includeTargetLabels){yi(o,t,"target")}}}}o.x1=ci(o.x1);o.y1=ci(o.y1);o.x2=ci(o.x2);o.y2=ci(o.y2);o.w=ci(o.x2-o.x1);o.h=ci(o.y2-o.y1);if(o.w>0&&o.h>0&&b){er(o,y);Jt(o,1)}return o};var xi=function e(t){var r=0;var n=function e(t){return(t?1:0)<<r++};var a=0;a+=n(t.incudeNodes);a+=n(t.includeEdges);a+=n(t.includeLabels);a+=n(t.includeMainLabels);a+=n(t.includeSourceLabels);a+=n(t.includeTargetLabels);a+=n(t.includeOverlays);a+=n(t.includeOutlines);return a};var wi=function e(t){if(t.isEdge()){var r=t.source().position();var n=t.target().position();var a=function e(t){return Math.round(t)};return ze([a(r.x),a(r.y),a(n.x),a(n.y)])}else{return 0}};var Ei=function e(t,r){var n=t._private;var a;var i=t.isEdge();var o=r==null?_i:xi(r);var s=o===_i;var u=wi(t);var l=n.bbCachePosKey===u;var f=r.useCache&&l;var v=function e(t){return t._private.bbCache==null||t._private.styleDirty};var c=!f||v(t)||i&&v(t.source())||v(t.target());if(c){if(!l){t.recalculateRenderedStyle(f)}a=bi(t,ki);n.bbCache=a;n.bbCachePosKey=u}else{a=n.bbCache}if(!s){var d=t.isNode();a=Ht();if(r.includeNodes&&d||r.includeEdges&&!d){if(r.includeOverlays){hi(a,n.overlayBounds)}else{hi(a,n.bodyBounds)}}if(r.includeLabels){if(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)){hi(a,n.labelBounds.all)}else{if(r.includeMainLabels){hi(a,n.labelBounds.mainRot)}if(r.includeSourceLabels){hi(a,n.labelBounds.sourceRot)}if(r.includeTargetLabels){hi(a,n.labelBounds.targetRot)}}}a.w=a.x2-a.x1;a.h=a.y2-a.y1}return a};var ki={includeNodes:true,includeEdges:true,includeLabels:true,includeMainLabels:true,includeSourceLabels:true,includeTargetLabels:true,includeOverlays:true,includeUnderlays:true,includeOutlines:true,useCache:true};var _i=xi(ki);var Si=tt(ki);vi.boundingBox=function(e){var t;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(e===undefined||e.useCache===undefined||e.useCache===true)){if(e===undefined){e=ki}else{e=Si(e)}t=Ei(this[0],e)}else{t=Ht();e=e||ki;var r=Si(e);var n=this;var a=n.cy();var i=a.styleEnabled();if(i){for(var o=0;o<n.length;o++){var s=n[o];var u=s._private;var l=wi(s);var f=u.bbCachePosKey===l;var v=r.useCache&&f&&!u.styleDirty;s.recalculateRenderedStyle(v)}}this.updateCompoundBounds(!e.useCache);for(var c=0;c<n.length;c++){var d=n[c];hi(t,Ei(d,r))}}t.x1=ci(t.x1);t.y1=ci(t.y1);t.x2=ci(t.x2);t.y2=ci(t.y2);t.w=ci(t.x2-t.x1);t.h=ci(t.y2-t.y1);return t};vi.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null;t.bbCachePosKey=null;t.bodyBounds=null;t.overlayBounds=null;t.labelBounds.all=null;t.labelBounds.source=null;t.labelBounds.target=null;t.labelBounds.main=null;t.labelBounds.sourceRot=null;t.labelBounds.targetRot=null;t.labelBounds.mainRot=null;t.arrowBounds.source=null;t.arrowBounds.target=null;t.arrowBounds["mid-source"]=null;t.arrowBounds["mid-target"]=null}this.emitAndNotify("bounds");return this};vi.boundingBoxAt=function(e){var t=this.nodes();var r=this.cy();var n=r.hasCompoundNodes();var a=r.collection();if(n){a=t.filter((function(e){return e.isParent()}));t=t.not(a)}if(L(e)){var i=e;e=function e(){return i}}var o=function t(r,n){return r._private.bbAtOldPos=e(r,n)};var s=function e(t){return t._private.bbAtOldPos};r.startBatch();t.forEach(o).silentPositions(e);if(n){a.dirtyCompoundBoundsCache();a.dirtyBoundingBoxCache();a.updateCompoundBounds(true)}var u=Ut(this.boundingBox({useCache:false}));t.silentPositions(s);if(n){a.dirtyCompoundBoundsCache();a.dirtyBoundingBoxCache();a.updateCompoundBounds(true)}r.endBatch();return u};fi.boundingbox=fi.bb=fi.boundingBox;fi.renderedBoundingbox=fi.renderedBoundingBox;var Di=vi;var Ci,Ti;Ci=Ti={};var Pi=function e(t){t.uppercaseName=te(t.name);t.autoName="auto"+t.uppercaseName;t.labelName="label"+t.uppercaseName;t.outerName="outer"+t.uppercaseName;t.uppercaseOuterName=te(t.outerName);Ci[t.name]=function e(){var r=this[0];var n=r._private;var a=n.cy;var i=a._private.styleEnabled;if(r){if(i){if(r.isParent()){r.updateCompoundBounds();return n[t.autoName]||0}var o=r.pstyle(t.name);switch(o.strValue){case"label":r.recalculateRenderedStyle();return n.rstyle[t.labelName]||0;default:return o.pfValue}}else{return 1}}};Ci["outer"+t.uppercaseName]=function e(){var r=this[0];var n=r._private;var a=n.cy;var i=a._private.styleEnabled;if(r){if(i){var o=r[t.name]();var s=r.pstyle("border-width").pfValue;var u=2*r.padding();return o+s+u}else{return 1}}};Ci["rendered"+t.uppercaseName]=function e(){var r=this[0];if(r){var n=r[t.name]();return n*this.cy().zoom()}};Ci["rendered"+t.uppercaseOuterName]=function e(){var r=this[0];if(r){var n=r[t.outerName]();return n*this.cy().zoom()}}};Pi({name:"width"});Pi({name:"height"});Ti.padding=function(){var e=this[0];var t=e._private;if(e.isParent()){e.updateCompoundBounds();if(t.autoPadding!==undefined){return t.autoPadding}else{return e.pstyle("padding").pfValue}}else{return e.pstyle("padding").pfValue}};Ti.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()};Ti.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var Mi=Ti;var Ii=function e(t,r){if(t.isEdge()){return r(t)}};var Oi=function e(t,r){if(t.isEdge()){var n=t.cy();return Pt(r(t),n.zoom(),n.pan())}};var Ni=function e(t,r){if(t.isEdge()){var n=t.cy();var a=n.pan();var i=n.zoom();return r(t).map((function(e){return Pt(e,i,a)}))}};var zi=function e(t){return t.renderer().getControlPoints(t)};var Li=function e(t){return t.renderer().getSegmentPoints(t)};var Ai=function e(t){return t.renderer().getSourceEndpoint(t)};var Bi=function e(t){return t.renderer().getTargetEndpoint(t)};var Ri=function e(t){return t.renderer().getEdgeMidpoint(t)};var ji={controlPoints:{get:zi,mult:true},segmentPoints:{get:Li,mult:true},sourceEndpoint:{get:Ai},targetEndpoint:{get:Bi},midpoint:{get:Ri}};var Fi=function e(t){return"rendered"+t[0].toUpperCase()+t.substr(1)};var Vi=Object.keys(ji).reduce((function(e,t){var r=ji[t];var n=Fi(t);e[t]=function(){return Ii(this,r.get)};if(r.mult){e[n]=function(){return Ni(this,r.get)}}else{e[n]=function(){return Oi(this,r.get)}}return e}),{});var qi=ve({},li,Di,Mi,Vi); /*! 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 Gi=function e(t,r){this.recycle(t,r)};function Yi(){return false}function Wi(){return true}Gi.prototype={instanceString:function e(){return"event"},recycle:function e(t,r){this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Yi;if(t!=null&&t.preventDefault){this.type=t.type;this.isDefaultPrevented=t.defaultPrevented?Wi:Yi}else if(t!=null&&t.type){r=t}else{this.type=t}if(r!=null){this.originalEvent=r.originalEvent;this.type=r.type!=null?r.type:this.type;this.cy=r.cy;this.target=r.target;this.position=r.position;this.renderedPosition=r.renderedPosition;this.namespace=r.namespace;this.layout=r.layout}if(this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position;var a=this.cy.zoom();var i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=t&&t.timeStamp||Date.now()},preventDefault:function e(){this.isDefaultPrevented=Wi;var t=this.originalEvent;if(!t){return}if(t.preventDefault){t.preventDefault()}},stopPropagation:function e(){this.isPropagationStopped=Wi;var t=this.originalEvent;if(!t){return}if(t.stopPropagation){t.stopPropagation()}},stopImmediatePropagation:function e(){this.isImmediatePropagationStopped=Wi;this.stopPropagation()},isDefaultPrevented:Yi,isPropagationStopped:Yi,isImmediatePropagationStopped:Yi};var Xi=/^([^.]+)(\.(?:[^.]+))?$/;var Hi=".*";var Ui={qualifierCompare:function e(t,r){return t===r},eventMatches:function e(){return true},addEventFields:function e(){},callbackContext:function e(t){return t},beforeEmit:function e(){},afterEmit:function e(){},bubble:function e(){return false},parent:function e(){return null},context:null};var Ki=Object.keys(Ui);var Zi={};function $i(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Zi;var t=arguments.length>1?arguments[1]:undefined;for(var r=0;r<Ki.length;r++){var n=Ki[r];this[n]=e[n]||Ui[n]}this.context=t||this.context;this.listeners=[];this.emitting=0}var Qi=$i.prototype;var Ji=function e(t,r,n,a,i,o,s){if(N(a)){i=a;a=null}if(s){if(o==null){o=s}else{o=ve({},o,s)}}var u=z(n)?n:n.split(/\s+/);for(var l=0;l<u.length;l++){var f=u[l];if(X(f)){continue}var v=f.match(Xi);if(v){var c=v[1];var d=v[2]?v[2]:null;var h=r(t,f,c,d,a,i,o);if(h===false){break}}}};var eo=function e(t,r){t.addEventFields(t.context,r);return new Gi(r.type,r)};var to=function e(t,r,n){if(W(n)){r(t,n);return}else if(L(n)){r(t,eo(t,n));return}var a=z(n)?n:n.split(/\s+/);for(var i=0;i<a.length;i++){var o=a[i];if(X(o)){continue}var s=o.match(Xi);if(s){var u=s[1];var l=s[2]?s[2]:null;var f=eo(t,{type:u,namespace:l,target:t.context});r(t,f)}}};Qi.on=Qi.addListener=function(e,t,r,n,a){Ji(this,(function(e,t,r,n,a,i,o){if(N(i)){e.listeners.push({event:t,callback:i,type:r,namespace:n,qualifier:a,conf:o})}}),e,t,r,n,a);return this};Qi.one=function(e,t,r,n){return this.on(e,t,r,n,{one:true})};Qi.removeListener=Qi.off=function(e,t,r,n){var a=this;if(this.emitting!==0){this.listeners=$e(this.listeners)}var i=this.listeners;var o=function o(s){var u=i[s];Ji(a,(function(t,r,n,a,o,l){if((u.type===n||e==="*")&&(!a&&u.namespace!==".*"||u.namespace===a)&&(!o||t.qualifierCompare(u.qualifier,o))&&(!l||u.callback===l)){i.splice(s,1);return false}}),e,t,r,n)};for(var s=i.length-1;s>=0;s--){o(s)}return this};Qi.removeAllListeners=function(){return this.removeListener("*")};Qi.emit=Qi.trigger=function(e,t,r){var n=this.listeners;var a=n.length;this.emitting++;if(!z(t)){t=[t]}to(this,(function(e,i){if(r!=null){n=[{event:i.event,type:i.type,namespace:i.namespace,callback:r}];a=n.length}var o=function r(a){var o=n[a];if(o.type===i.type&&(!o.namespace||o.namespace===i.namespace||o.namespace===Hi)&&e.eventMatches(e.context,o,i)){var s=[i];if(t!=null){at(s,t)}e.beforeEmit(e.context,o,i);if(o.conf&&o.conf.one){e.listeners=e.listeners.filter((function(e){return e!==o}))}var u=e.callbackContext(e.context,o,i);var l=o.callback.apply(u,s);e.afterEmit(e.context,o,i);if(l===false){i.stopPropagation();i.preventDefault()}}};for(var s=0;s<a;s++){o(s)}if(e.bubble(e.context)&&!i.isPropagationStopped()){e.parent(e.context).emit(i,t)}}),e);this.emitting--;return this};var ro={qualifierCompare:function e(t,r){if(t==null||r==null){return t==null&&r==null}else{return t.sameText(r)}},eventMatches:function e(t,r,n){var a=r.qualifier;if(a!=null){return t!==n.target&&V(n.target)&&a.matches(n.target)}return true},addEventFields:function e(t,r){r.cy=t.cy();r.target=t},callbackContext:function e(t,r,n){return r.qualifier!=null?n.target:t},beforeEmit:function e(t,r){if(r.conf&&r.conf.once){r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)}},bubble:function e(){return true},parent:function e(t){return t.isChild()?t.parent():t.cy()}};var no=function e(t){if(O(t)){return new Ya(t)}else{return t}};var ao={createEmitter:function e(){for(var t=0;t<this.length;t++){var r=this[t];var n=r._private;if(!n.emitter){n.emitter=new $i(ro,r)}}return this},emitter:function e(){return this._private.emitter},on:function e(t,r,n){var a=no(r);for(var i=0;i<this.length;i++){var o=this[i];o.emitter().on(t,a,n)}return this},removeListener:function e(t,r,n){var a=no(r);for(var i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(t,a,n)}return this},removeAllListeners:function e(){for(var t=0;t<this.length;t++){var r=this[t];r.emitter().removeAllListeners()}return this},one:function e(t,r,n){var a=no(r);for(var i=0;i<this.length;i++){var o=this[i];o.emitter().one(t,a,n)}return this},once:function e(t,r,n){var a=no(r);for(var i=0;i<this.length;i++){var o=this[i];o.emitter().on(t,a,n,{once:true,onceCollection:this})}},emit:function e(t,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(t,r)}return this},emitAndNotify:function e(t,r){if(this.length===0){return}this.cy().notify(t,this);this.emit(t,r);return this}};ga.eventAliasesOn(ao);var io={nodes:function e(t){return this.filter((function(e){return e.isNode()})).filter(t)},edges:function e(t){return this.filter((function(e){return e.isEdge()})).filter(t)},byGroup:function e(){var t=this.spawn();var r=this.spawn();for(var n=0;n<this.length;n++){var a=this[n];if(a.isNode()){t.push(a)}else{r.push(a)}}return{nodes:t,edges:r}},filter:function e(t,r){if(t===undefined){return this}else if(O(t)||F(t)){return new Ya(t).filter(this)}else if(N(t)){var n=this.spawn();var a=this;for(var i=0;i<a.length;i++){var o=a[i];var s=r?t.apply(r,[o,i,a]):t(o,i,a);if(s){n.push(o)}}return n}return this.spawn()},not:function e(t){if(!t){return this}else{if(O(t)){t=this.filter(t)}var r=this.spawn();for(var n=0;n<this.length;n++){var a=this[n];var i=t.has(a);if(!i){r.push(a)}}return r}},absoluteComplement:function e(){var t=this.cy();return t.mutableElements().not(this)},intersect:function e(t){if(O(t)){var r=t;return this.filter(r)}var n=this.spawn();var a=this;var i=t;var o=this.length<t.length;var s=o?a:i;var u=o?i:a;for(var l=0;l<s.length;l++){var f=s[l];if(u.has(f)){n.push(f)}}return n},xor:function e(t){var r=this._private.cy;if(O(t)){t=r.$(t)}var n=this.spawn();var a=this;var i=t;var o=function e(t,r){for(var a=0;a<t.length;a++){var i=t[a];var o=i._private.data.id;var s=r.hasElementWithId(o);if(!s){n.push(i)}}};o(a,i);o(i,a);return n},diff:function e(t){var r=this._private.cy;if(O(t)){t=r.$(t)}var n=this.spawn();var a=this.spawn();var i=this.spawn();var o=this;var s=t;var u=function e(t,r,n){for(var a=0;a<t.length;a++){var o=t[a];var s=o._private.data.id;var u=r.hasElementWithId(s);if(u){i.merge(o)}else{n.push(o)}}};u(o,s,n);u(s,o,a);return{left:n,right:a,both:i}},add:function e(t){var r=this._private.cy;if(!t){return this}if(O(t)){var n=t;t=r.mutableElements().filter(n)}var a=this.spawnSelf();for(var i=0;i<t.length;i++){var o=t[i];var e=!this.has(o);if(e){a.push(o)}}return a},merge:function e(t){var r=this._private;var n=r.cy;if(!t){return this}if(t&&O(t)){var a=t;t=n.mutableElements().filter(a)}var i=r.map;for(var o=0;o<t.length;o++){var s=t[o];var u=s._private.data.id;var l=!i.has(u);if(l){var f=this.length++;this[f]=s;i.set(u,{ele:s,index:f})}}return this},unmergeAt:function e(t){var r=this[t];var n=r.id();var a=this._private;var i=a.map;this[t]=undefined;i["delete"](n);var o=t===this.length-1;if(this.length>1&&!o){var s=this.length-1;var u=this[s];var l=u._private.data.id;this[s]=undefined;this[t]=u;i.set(l,{ele:u,index:t})}this.length--;return this},unmergeOne:function e(t){t=t[0];var r=this._private;var n=t._private.data.id;var a=r.map;var i=a.get(n);if(!i){return this}var o=i.index;this.unmergeAt(o);return this},unmerge:function e(t){var r=this._private.cy;if(!t){return this}if(t&&O(t)){var n=t;t=r.mutableElements().filter(n)}for(var a=0;a<t.length;a++){this.unmergeOne(t[a])}return this},unmergeBy:function e(t){for(var r=this.length-1;r>=0;r--){var n=this[r];if(t(n)){this.unmergeAt(r)}}return this},map:function e(t,r){var n=[];var a=this;for(var i=0;i<a.length;i++){var o=a[i];var s=r?t.apply(r,[o,i,a]):t(o,i,a);n.push(s)}return n},reduce:function e(t,r){var n=r;var a=this;for(var i=0;i<a.length;i++){n=t(n,a[i],i,a)}return n},max:function e(t,r){var e=-Infinity;var n;var a=this;for(var i=0;i<a.length;i++){var o=a[i];var s=r?t.apply(r,[o,i,a]):t(o,i,a);if(s>e){e=s;n=o}}return{value:e,ele:n}},min:function e(t,r){var e=Infinity;var n;var a=this;for(var i=0;i<a.length;i++){var o=a[i];var s=r?t.apply(r,[o,i,a]):t(o,i,a);if(s<e){e=s;n=o}}return{value:e,ele:n}}};var oo=io;oo["u"]=oo["|"]=oo["+"]=oo.union=oo.or=oo.add;oo["\\"]=oo["!"]=oo["-"]=oo.difference=oo.relativeComplement=oo.subtract=oo.not;oo["n"]=oo["&"]=oo["."]=oo.and=oo.intersection=oo.intersect;oo["^"]=oo["(+)"]=oo["(-)"]=oo.symmetricDifference=oo.symdiff=oo.xor;oo.fnFilter=oo.filterFn=oo.stdFilter=oo.filter;oo.complement=oo.abscomp=oo.absoluteComplement;var so={isNode:function e(){return this.group()==="nodes"},isEdge:function e(){return this.group()==="edges"},isLoop:function e(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function e(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function e(){var t=this[0];if(t){return t._private.group}}};var uo=function e(t,r){var n=t.cy();var a=n.hasCompoundNodes();function i(e){var t=e.pstyle("z-compound-depth");if(t.value==="auto"){return a?e.zDepth():0}else if(t.value==="bottom"){return-1}else if(t.value==="top"){return Ve}return 0}var o=i(t)-i(r);if(o!==0){return o}function s(e){var t=e.pstyle("z-index-compare");if(t.value==="auto"){return e.isNode()?1:0}return 0}var u=s(t)-s(r);if(u!==0){return u}var l=t.pstyle("z-index").value-r.pstyle("z-index").value;if(l!==0){return l}return t.poolIndex()-r.poolIndex()};var lo={forEach:function e(t,r){if(N(t)){var n=this.length;for(var a=0;a<n;a++){var i=this[a];var o=r?t.apply(r,[i,a,this]):t(i,a,this);if(o===false){break}}}return this},toArray:function e(){var t=[];for(var r=0;r<this.length;r++){t.push(this[r])}return t},slice:function e(t,r){var n=[];var a=this.length;if(r==null){r=a}if(t==null){t=0}if(t<0){t=a+t}if(r<0){r=a+r}for(var i=t;i>=0&&i<r&&i<a;i++){n.push(this[i])}return this.spawn(n)},size:function e(){return this.length},eq:function e(t){return this[t]||this.spawn()},first:function e(){return this[0]||this.spawn()},last:function e(){return this[this.length-1]||this.spawn()},empty:function e(){return this.length===0},nonempty:function e(){return!this.empty()},sort:function e(t){if(!N(t)){return this}var r=this.toArray().sort(t);return this.spawn(r)},sortByZIndex:function e(){return this.sort(uo)},zDepth:function e(){var t=this[0];if(!t){return undefined}var r=t._private;var n=r.group;if(n==="nodes"){var a=r.data.parent?t.parents().size():0;if(!t.isParent()){return Ve-1}return a}else{var i=r.source;var o=r.target;var s=i.zDepth();var u=o.zDepth();return Math.max(s,u,0)}}};lo.each=lo.forEach;var fo=function e(){var t="undefined";var r=(typeof Symbol==="undefined"?"undefined":h(Symbol))!=t&&h(Symbol.iterator)!=t;if(r){lo[Symbol.iterator]=function(){var e=this;var t={value:undefined,done:false};var r=0;var n=this.length;return m({next:function a(){if(r<n){t.value=e[r++]}else{t.value=undefined;t.done=true}return t}},Symbol.iterator,(function(){return this}))}}};fo();var vo=tt({nodeDimensionsIncludeLabels:false});var co={layoutDimensions:function e(t){t=vo(t);var r;if(!this.takesUpSpace()){r={w:0,h:0}}else if(t.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else{r={w:this.outerWidth(),h:this.outerHeight()}}if(r.w===0||r.h===0){r.w=r.h=1}return r},layoutPositions:function e(t,r,n){var a=this.nodes().filter((function(e){return!e.isParent()}));var i=this.cy();var o=r.eles;var s=function e(t){return t.id()};var u=$(n,s);t.emit({type:"layoutstart",layout:t});t.animations=[];var l=function e(t,r,n){var a={x:r.x1+r.w/2,y:r.y1+r.h/2};var i={x:(n.x-a.x)*t,y:(n.y-a.y)*t};return{x:a.x+i.x,y:a.y+i.y}};var f=r.spacingFactor&&r.spacingFactor!==1;var v=function e(){if(!f){return null}var t=Ht();for(var r=0;r<a.length;r++){var n=a[r];var i=u(n,r);Qt(t,i.x,i.y)}return t};var c=v();var d=$((function(e,t){var n=u(e,t);if(f){var a=Math.abs(r.spacingFactor);n=l(a,c,n)}if(r.transform!=null){n=r.transform(e,n)}return n}),s);if(r.animate){for(var h=0;h<a.length;h++){var p=a[h];var g=d(p,h);var y=r.animateFilter==null||r.animateFilter(p,h);if(y){var m=p.animation({position:g,duration:r.animationDuration,easing:r.animationEasing});t.animations.push(m)}else{p.position(g)}}if(r.fit){var b=i.animation({fit:{boundingBox:o.boundingBoxAt(d),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});t.animations.push(b)}else if(r.zoom!==undefined&&r.pan!==undefined){var x=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});t.animations.push(x)}t.animations.forEach((function(e){return e.play()}));t.one("layoutready",r.ready);t.emit({type:"layoutready",layout:t});fa.all(t.animations.map((function(e){return e.promise()}))).then((function(){t.one("layoutstop",r.stop);t.emit({type:"layoutstop",layout:t})}))}else{a.positions(d);if(r.fit){i.fit(r.eles,r.padding)}if(r.zoom!=null){i.zoom(r.zoom)}if(r.pan){i.pan(r.pan)}t.one("layoutready",r.ready);t.emit({type:"layoutready",layout:t});t.one("layoutstop",r.stop);t.emit({type:"layoutstop",layout:t})}return this},layout:function e(t){var r=this.cy();return r.makeLayout(ve({},t,{eles:this}))}};co.createLayout=co.makeLayout=co.layout;function ho(e,t,r){var n=r._private;var a=n.styleCache=n.styleCache||[];var i;if((i=a[e])!=null){return i}else{i=a[e]=t(r);return i}}function po(e,t){e=Le(e);return function r(n){return ho(e,t,n)}}function go(e,t){e=Le(e);var r=function e(r){return t.call(r)};return function t(){var n=this[0];if(n){return ho(e,r,n)}}}var yo={recalculateRenderedStyle:function e(t){var r=this.cy();var n=r.renderer();var a=r.styleEnabled();if(n&&a){n.recalculateRenderedStyle(this,t)}return this},dirtyStyleCache:function e(){var t=this.cy();var r=function e(t){return t._private.styleCache=null};if(t.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents());n.merge(n.connectedEdges());n.forEach(r)}else{this.forEach((function(e){r(e);e.connectedEdges().forEach(r)}))}return this},updateStyle:function e(t){var r=this._private.cy;if(!r.styleEnabled()){return this}if(r.batching()){var n=r._private.batchStyleEles;n.merge(this);return this}var a=r.hasCompoundNodes();var i=this;t=t||t===undefined?true:false;if(a){i=this.spawnSelf().merge(this.descendants()).merge(this.parents())}var o=i;if(t){o.emitAndNotify("style")}else{o.emit("style")}i.forEach((function(e){return e._private.styleDirty=true}));return this},cleanStyle:function e(){var t=this.cy();if(!t.styleEnabled()){return}for(var r=0;r<this.length;r++){var n=this[r];if(n._private.styleDirty){n._private.styleDirty=false;t.style().apply(n)}}},parsedStyle:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var n=this[0];var a=n.cy();if(!a.styleEnabled()){return}if(n){this.cleanStyle();var i=n._private.style[t];if(i!=null){return i}else if(r){return a.style().getDefaultProperty(t)}else{return null}}},numericStyle:function e(t){var r=this[0];if(!r.cy().styleEnabled()){return}if(r){var n=r.pstyle(t);return n.pfValue!==undefined?n.pfValue:n.value}},numericStyleUnits:function e(t){var r=this[0];if(!r.cy().styleEnabled()){return}if(r){return r.pstyle(t).units}},renderedStyle:function e(t){var r=this.cy();if(!r.styleEnabled()){return this}var n=this[0];if(n){return r.style().getRenderedStyle(n,t)}},style:function e(t,r){var n=this.cy();if(!n.styleEnabled()){return this}var a=false;var e=n.style();if(L(t)){var i=t;e.applyBypass(this,i,a);this.emitAndNotify("style")}else if(O(t)){if(r===undefined){var o=this[0];if(o){return e.getStylePropertyValue(o,t)}else{return}}else{e.applyBypass(this,t,r,a);this.emitAndNotify("style")}}else if(t===undefined){var s=this[0];if(s){return e.getRawStyle(s)}else{return}}return this},removeStyle:function e(t){var r=this.cy();if(!r.styleEnabled()){return this}var n=false;var a=r.style();var i=this;if(t===undefined){for(var o=0;o<i.length;o++){var s=i[o];a.removeAllBypasses(s,n)}}else{t=t.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];a.removeBypasses(l,t,n)}}this.emitAndNotify("style");return this},show:function e(){this.css("display","element");return this},hide:function e(){this.css("display","none");return this},effectiveOpacity:function e(){var t=this.cy();if(!t.styleEnabled()){return 1}var r=t.hasCompoundNodes();var n=this[0];if(n){var a=n._private;var i=n.pstyle("opacity").value;if(!r){return i}var o=!a.data.parent?null:n.parents();if(o){for(var s=0;s<o.length;s++){var u=o[s];var l=u.pstyle("opacity").value;i=l*i}}return i}},transparent:function e(){var t=this.cy();if(!t.styleEnabled()){return false}var r=this[0];var n=r.cy().hasCompoundNodes();if(r){if(!n){return r.pstyle("opacity").value===0}else{return r.effectiveOpacity()===0}}},backgrounding:function e(){var t=this.cy();if(!t.styleEnabled()){return false}var r=this[0];return r._private.backgrounding?true:false}};function mo(e,t){var r=e._private;var n=r.data.parent?e.parents():null;if(n){for(var a=0;a<n.length;a++){var i=n[a];if(!t(i)){return false}}}return true}function bo(e){var t=e.ok;var r=e.edgeOkViaNode||e.ok;var n=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled()){return true}var a=this[0];var i=e.hasCompoundNodes();if(a){var o=a._private;if(!t(a)){return false}if(a.isNode()){return!i||mo(a,n)}else{var s=o.source;var u=o.target;return r(s)&&(!i||mo(s,r))&&(s===u||r(u)&&(!i||mo(u,r)))}}}}var xo=po("eleTakesUpSpace",(function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:true)}));yo.takesUpSpace=go("takesUpSpace",bo({ok:xo}));var wo=po("eleInteractive",(function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&xo(e)}));var Eo=po("parentInteractive",(function(e){return e.pstyle("visibility").value==="visible"&&xo(e)}));yo.interactive=go("interactive",bo({ok:wo,parentOk:Eo,edgeOkViaNode:xo}));yo.noninteractive=function(){var e=this[0];if(e){return!e.interactive()}};var ko=po("eleVisible",(function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&xo(e)}));var _o=xo;yo.visible=go("visible",bo({ok:ko,edgeOkViaNode:_o}));yo.hidden=function(){var e=this[0];if(e){return!e.visible()}};yo.isBundledBezier=go("isBundledBezier",(function(){if(!this.cy().styleEnabled()){return false}return!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace()}));yo.bypass=yo.css=yo.style;yo.renderedCss=yo.renderedStyle;yo.removeBypass=yo.removeCss=yo.removeStyle;yo.pstyle=yo.parsedStyle;var So={};function Do(e){return function(){var t=arguments;var r=[];if(t.length===2){var n=t[0];var a=t[1];this.on(e.event,n,a)}else if(t.length===1&&N(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&z(t[0])){var o=t.length===1?t[0]:null;for(var s=0;s<this.length;s++){var u=this[s];var l=!e.ableField||u._private[e.ableField];var f=u._private[e.field]!=e.value;if(e.overrideAble){var v=e.overrideAble(u);if(v!==undefined){l=v;if(!v){return this}}}if(l){u._private[e.field]=e.value;if(f){r.push(u)}}}var c=this.spawn(r);c.updateStyle();c.emit(e.event);if(o){c.emit(o)}}return this}}function Co(e){So[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var r=e.overrideField(t);if(r!==undefined){return r}}return t._private[e.field]}};So[e.on]=Do({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:true});So[e.off]=Do({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:false})}Co({field:"locked",overrideField:function e(t){return t.cy().autolock()?true:undefined},on:"lock",off:"unlock"});Co({field:"grabbable",overrideField:function e(t){return t.cy().autoungrabify()||t.pannable()?false:undefined},on:"grabify",off:"ungrabify"});Co({field:"selected",ableField:"selectable",overrideAble:function e(t){return t.cy().autounselectify()?false:undefined},on:"select",off:"unselect"});Co({field:"selectable",overrideField:function e(t){return t.cy().autounselectify()?false:undefined},on:"selectify",off:"unselectify"});So.deselect=So.unselect;So.grabbed=function(){var e=this[0];if(e){return e._private.grabbed}};Co({field:"active",on:"activate",off:"unactivate"});Co({field:"pannable",on:"panify",off:"unpanify"});So.inactive=function(){var e=this[0];if(e){return!e._private.active}};var To={};var Po=function e(t){return function e(r){var n=this;var a=[];for(var i=0;i<n.length;i++){var o=n[i];if(!o.isNode()){continue}var s=false;var u=o.connectedEdges();for(var l=0;l<u.length;l++){var f=u[l];var v=f.source();var c=f.target();if(t.noIncomingEdges&&c===o&&v!==o||t.noOutgoingEdges&&v===o&&c!==o){s=true;break}}if(!s){a.push(o)}}return this.spawn(a,true).filter(r)}};var Mo=function e(t){return function(e){var r=this;var n=[];for(var a=0;a<r.length;a++){var i=r[a];if(!i.isNode()){continue}var o=i.connectedEdges();for(var s=0;s<o.length;s++){var u=o[s];var l=u.source();var f=u.target();if(t.outgoing&&l===i){n.push(u);n.push(f)}else if(t.incoming&&f===i){n.push(u);n.push(l)}}}return this.spawn(n,true).filter(e)}};var Io=function e(t){return function(e){var r=this;var n=[];var a={};for(;;){var i=t.outgoing?r.outgoers():r.incomers();if(i.length===0){break}var o=false;for(var s=0;s<i.length;s++){var u=i[s];var l=u.id();if(!a[l]){a[l]=true;n.push(u);o=true}}if(!o){break}r=i}return this.spawn(n,true).filter(e)}};To.clearTraversalCache=function(){for(var e=0;e<this.length;e++){this[e]._private.traversalCache=null}};ve(To,{roots:Po({noIncomingEdges:true}),leaves:Po({noOutgoingEdges:true}),outgoers:Ha(Mo({outgoing:true}),"outgoers"),successors:Io({outgoing:true}),incomers:Ha(Mo({incoming:true}),"incomers"),predecessors:Io({incoming:true})});ve(To,{neighborhood:Ha((function(e){var t=[];var r=this.nodes();for(var n=0;n<r.length;n++){var a=r[n];var i=a.connectedEdges();for(var o=0;o<i.length;o++){var s=i[o];var u=s.source();var l=s.target();var f=a===u?l:u;if(f.length>0){t.push(f[0])}t.push(s[0])}}return this.spawn(t,true).filter(e)}),"neighborhood"),closedNeighborhood:function e(t){return this.neighborhood().add(this).filter(t)},openNeighborhood:function e(t){return this.neighborhood(t)}});To.neighbourhood=To.neighborhood;To.closedNeighbourhood=To.closedNeighborhood;To.openNeighbourhood=To.openNeighborhood;ve(To,{source:Ha((function e(t){var r=this[0];var n;if(r){n=r._private.source||r.cy().collection()}return n&&t?n.filter(t):n}),"source"),target:Ha((function e(t){var r=this[0];var n;if(r){n=r._private.target||r.cy().collection()}return n&&t?n.filter(t):n}),"target"),sources:Oo({attr:"source"}),targets:Oo({attr:"target"})});function Oo(e){return function t(r){var n=[];for(var a=0;a<this.length;a++){var i=this[a];var o=i._private[e.attr];if(o){n.push(o)}}return this.spawn(n,true).filter(r)}}ve(To,{edgesWith:Ha(No(),"edgesWith"),edgesTo:Ha(No({thisIsSrc:true}),"edgesTo")});function No(e){return function t(r){var n=[];var a=this._private.cy;var i=e||{};if(O(r)){r=a.$(r)}for(var o=0;o<r.length;o++){var s=r[o]._private.edges;for(var u=0;u<s.length;u++){var l=s[u];var f=l._private.data;var v=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target);var c=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target);var d=v||c;if(!d){continue}if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!v){continue}if(i.thisIsTgt&&!c){continue}}n.push(l)}}return this.spawn(n,true)}}ve(To,{connectedEdges:Ha((function(e){var t=[];var r=this;for(var n=0;n<r.length;n++){var a=r[n];if(!a.isNode()){continue}var i=a._private.edges;for(var o=0;o<i.length;o++){var s=i[o];t.push(s)}}return this.spawn(t,true).filter(e)}),"connectedEdges"),connectedNodes:Ha((function(e){var t=[];var r=this;for(var n=0;n<r.length;n++){var a=r[n];if(!a.isEdge()){continue}t.push(a.source()[0]);t.push(a.target()[0])}return this.spawn(t,true).filter(e)}),"connectedNodes"),parallelEdges:Ha(zo(),"parallelEdges"),codirectedEdges:Ha(zo({codirected:true}),"codirectedEdges")});function zo(e){var t={codirected:false};e=ve({},t,e);return function t(r){var n=[];var a=this.edges();var i=e;for(var o=0;o<a.length;o++){var s=a[o];var u=s._private;var l=u.source;var f=l._private.data.id;var v=u.data.target;var c=l._private.edges;for(var d=0;d<c.length;d++){var h=c[d];var p=h._private.data;var g=p.target;var y=p.source;var m=g===v&&y===f;var b=f===g&&v===y;if(i.codirected&&m||!i.codirected&&(m||b)){n.push(h)}}}return this.spawn(n,true).filter(r)}}ve(To,{components:function e(t){var r=this;var n=r.cy();var a=n.collection();var i=t==null?r.nodes():t.nodes();var e=[];if(t!=null&&i.empty()){i=t.sources()}var o=function e(t,r){a.merge(t);i.unmerge(t);r.merge(t)};if(i.empty()){return r.spawn()}var s=function t(){var a=n.collection();e.push(a);var s=i[0];o(s,a);r.bfs({directed:false,roots:s,visit:function e(t){return o(t,a)}});a.forEach((function(e){e.connectedEdges().forEach((function(e){if(r.has(e)&&a.has(e.source())&&a.has(e.target())){a.merge(e)}}))}))};do{s()}while(i.length>0);return e},component:function e(){var t=this[0];return t.cy().mutableElements().components(t)[0]}});To.componentsOf=To.components;var Lo=function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(t===undefined){Xe("A collection must have a reference to the core");return}var i=new ut;var o=false;if(!r){r=[]}else if(r.length>0&&L(r[0])&&!V(r[0])){o=true;var s=[];var u=new vt;for(var l=0,f=r.length;l<f;l++){var v=r[l];if(v.data==null){v.data={}}var c=v.data;if(c.id==null){c.id=Qe()}else if(t.hasElementWithId(c.id)||u.has(c.id)){continue}var d=new ct(t,v,false);s.push(d);u.add(c.id)}r=s}this.length=0;for(var h=0,p=r.length;h<p;h++){var g=r[h][0];if(g==null){continue}var y=g._private.data.id;if(!n||!i.has(y)){if(n){i.set(y,{index:this.length,ele:g})}this[this.length]=g;this.length++}}this._private={eles:this,cy:t,get map(){if(this.lazyMap==null){this.rebuildMap()}return this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function e(){var t=this.lazyMap=new ut;var r=this.eles;for(var n=0;n<r.length;n++){var a=r[n];t.set(a.id(),{index:n,ele:a})}}};if(n){this._private.map=i}if(o&&!a){this.restore()}};var Ao=ct.prototype=Lo.prototype=Object.create(Array.prototype);Ao.instanceString=function(){return"collection"};Ao.spawn=function(e,t){return new Lo(this.cy(),e,t)};Ao.spawnSelf=function(){return this.spawn(this)};Ao.cy=function(){return this._private.cy};Ao.renderer=function(){return this._private.cy.renderer()};Ao.element=function(){return this[0]};Ao.collection=function(){if(q(this)){return this}else{return new Lo(this._private.cy,[this])}};Ao.unique=function(){return new Lo(this._private.cy,this,true)};Ao.hasElementWithId=function(e){e=""+e;return this._private.map.has(e)};Ao.getElementById=function(e){e=""+e;var t=this._private.cy;var r=this._private.map.get(e);return r?r.ele:new Lo(t)};Ao.$id=Ao.getElementById;Ao.poolIndex=function(){var e=this._private.cy;var t=e._private.elements;var r=this[0]._private.data.id;return t._private.map.get(r).index};Ao.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index};Ao.indexOfId=function(e){e=""+e;return this._private.map.get(e).index};Ao.json=function(e){var t=this.element();var r=this.cy();if(t==null&&e){return this}if(t==null){return undefined}var n=t._private;if(L(e)){r.startBatch();if(e.data){t.data(e.data);var a=n.data;if(t.isEdge()){var i=false;var o={};var s=e.data.source;var u=e.data.target;if(s!=null&&s!=a.source){o.source=""+s;i=true}if(u!=null&&u!=a.target){o.target=""+u;i=true}if(i){t=t.move(o)}}else{var l="parent"in e.data;var f=e.data.parent;if(l&&(f!=null||a.parent!=null)&&f!=a.parent){if(f===undefined){f=null}if(f!=null){f=""+f}t=t.move({parent:f})}}}if(e.position){t.position(e.position)}var v=function r(a,i,o){var s=e[a];if(s!=null&&s!==n[a]){if(s){t[i]()}else{t[o]()}}};v("removed","remove","restore");v("selected","select","unselect");v("selectable","selectify","unselectify");v("locked","lock","unlock");v("grabbable","grabify","ungrabify");v("pannable","panify","unpanify");if(e.classes!=null){t.classes(e.classes)}r.endBatch();return this}else if(e===undefined){var c={data:Ze(n.data),position:Ze(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};c.classes="";var d=0;n.classes.forEach((function(e){return c.classes+=d++===0?e:" "+e}));return c}};Ao.jsons=function(){var e=[];for(var t=0;t<this.length;t++){var r=this[t];var n=r.json();e.push(n)}return e};Ao.clone=function(){var e=this.cy();var t=[];for(var r=0;r<this.length;r++){var n=this[r];var a=n.json();var i=new ct(e,a,false);t.push(i)}return new Lo(e,t)};Ao.copy=Ao.clone;Ao.restore=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var r=this;var n=r.cy();var a=n._private;var i=[];var o=[];var s;for(var u=0,l=r.length;u<l;u++){var f=r[u];if(t&&!f.removed()){continue}if(f.isNode()){i.push(f)}else{o.push(f)}}s=i.concat(o);var v;var c=function e(){s.splice(v,1);v--};for(v=0;v<s.length;v++){var d=s[v];var h=d._private;var p=h.data;d.clearTraversalCache();if(!t&&!h.removed);else if(p.id===undefined){p.id=Qe()}else if(B(p.id)){p.id=""+p.id}else if(X(p.id)||!O(p.id)){Xe("Can not create element with invalid string ID `"+p.id+"`");c();continue}else if(n.hasElementWithId(p.id)){Xe("Can not create second element with ID `"+p.id+"`");c();continue}var g=p.id;if(d.isNode()){var y=h.position;if(y.x==null){y.x=0}if(y.y==null){y.y=0}}if(d.isEdge()){var m=d;var b=["source","target"];var x=b.length;var w=false;for(var E=0;E<x;E++){var k=b[E];var _=p[k];if(B(_)){_=p[k]=""+p[k]}if(_==null||_===""){Xe("Can not create edge `"+g+"` with unspecified "+k);w=true}else if(!n.hasElementWithId(_)){Xe("Can not create edge `"+g+"` with nonexistant "+k+" `"+_+"`");w=true}}if(w){c();continue}var S=n.getElementById(p.source);var D=n.getElementById(p.target);if(S.same(D)){S._private.edges.push(m)}else{S._private.edges.push(m);D._private.edges.push(m)}m._private.source=S;m._private.target=D}h.map=new ut;h.map.set(g,{ele:d,index:0});h.removed=false;if(t){n.addToPool(d)}}for(var C=0;C<i.length;C++){var T=i[C];var P=T._private.data;if(B(P.parent)){P.parent=""+P.parent}var M=P.parent;var I=M!=null;if(I||T._private.parent){var N=T._private.parent?n.collection().merge(T._private.parent):n.getElementById(M);if(N.empty()){P.parent=undefined}else if(N[0].removed()){Ue("Node added with missing parent, reference to parent removed");P.parent=undefined;T._private.parent=null}else{var z=false;var L=N;while(!L.empty()){if(T.same(L)){z=true;P.parent=undefined;break}L=L.parent()}if(!z){N[0]._private.children.push(T);T._private.parent=N[0];a.hasCompoundNodes=true}}}}if(s.length>0){var A=s.length===r.length?r:new Lo(n,s);for(var R=0;R<A.length;R++){var j=A[R];if(j.isNode()){continue}j.parallelEdges().clearTraversalCache();j.source().clearTraversalCache();j.target().clearTraversalCache()}var F;if(a.hasCompoundNodes){F=n.collection().merge(A).merge(A.connectedNodes()).merge(A.parent())}else{F=A}F.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e);if(e){A.emitAndNotify("add")}else if(t){A.emit("add")}}return r};Ao.removed=function(){var e=this[0];return e&&e._private.removed};Ao.inside=function(){var e=this[0];return e&&!e._private.removed};Ao.remove=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var r=this;var n=[];var a={};var i=r._private.cy;function o(e){var t=e._private.edges;for(var r=0;r<t.length;r++){u(t[r])}}function s(e){var t=e._private.children;for(var r=0;r<t.length;r++){u(t[r])}}function u(e){var r=a[e.id()];if(t&&e.removed()||r){return}else{a[e.id()]=true}if(e.isNode()){n.push(e);o(e);s(e)}else{n.unshift(e)}}for(var l=0,f=r.length;l<f;l++){var v=r[l];u(v)}function c(e,t){var r=e._private.edges;rt(r,t);e.clearTraversalCache()}function d(e){e.clearTraversalCache()}var h=[];h.ids={};function p(e,t){t=t[0];e=e[0];var r=e._private.children;var n=e.id();rt(r,t);t._private.parent=null;if(!h.ids[n]){h.ids[n]=true;h.push(e)}}r.dirtyCompoundBoundsCache();if(t){i.removeFromPool(n)}for(var g=0;g<n.length;g++){var y=n[g];if(y.isEdge()){var m=y.source()[0];var b=y.target()[0];c(m,y);c(b,y);var x=y.parallelEdges();for(var w=0;w<x.length;w++){var E=x[w];d(E);if(E.isBundledBezier()){E.dirtyBoundingBoxCache()}}}else{var k=y.parent();if(k.length!==0){p(k,y)}}if(t){y._private.removed=true}}var _=i._private.elements;i._private.hasCompoundNodes=false;for(var S=0;S<_.length;S++){var D=_[S];if(D.isParent()){i._private.hasCompoundNodes=true;break}}var C=new Lo(this.cy(),n);if(C.size()>0){if(e){C.emitAndNotify("remove")}else if(t){C.emit("remove")}}for(var T=0;T<h.length;T++){var P=h[T];if(!t||!P.removed()){P.updateStyle()}}return C};Ao.move=function(e){var t=this._private.cy;var r=this;var n=false;var a=false;var i=function e(t){return t==null?t:""+t};if(e.source!==undefined||e.target!==undefined){var o=i(e.source);var s=i(e.target);var u=o!=null&&t.hasElementWithId(o);var l=s!=null&&t.hasElementWithId(s);if(u||l){t.batch((function(){r.remove(n,a);r.emitAndNotify("moveout");for(var e=0;e<r.length;e++){var t=r[e];var i=t._private.data;if(t.isEdge()){if(u){i.source=o}if(l){i.target=s}}}r.restore(n,a)}));r.emitAndNotify("move")}}else if(e.parent!==undefined){var f=i(e.parent);var v=f===null||t.hasElementWithId(f);if(v){var c=f===null?undefined:f;t.batch((function(){var e=r.remove(n,a);e.emitAndNotify("moveout");for(var t=0;t<r.length;t++){var i=r[t];var o=i._private.data;if(i.isNode()){o.parent=c}}e.restore(n,a)}));r.emitAndNotify("move")}}return this};[ea,ya,ma,Xa,Ua,ti,ri,qi,ao,io,so,lo,co,yo,So,To].forEach((function(e){ve(Ao,e)}));var Bo={add:function e(t){var r;var n=this;if(F(t)){var a=t;if(a._private.cy===n){r=a.restore()}else{var i=[];for(var o=0;o<a.length;o++){var s=a[o];i.push(s.json())}r=new Lo(n,i)}}else if(z(t)){var u=t;r=new Lo(n,u)}else if(L(t)&&(z(t.nodes)||z(t.edges))){var l=t;var f=[];var v=["nodes","edges"];for(var c=0,d=v.length;c<d;c++){var h=v[c];var p=l[h];if(z(p)){for(var g=0,y=p.length;g<y;g++){var m=ve({group:h},p[g]);f.push(m)}}}r=new Lo(n,f)}else{var b=t;r=new ct(n,b).collection()}return r},remove:function e(t){if(F(t));else if(O(t)){var r=t;t=this.$(r)}return t.remove()}}; /*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Ro(e,t,r,n){var a=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),f=typeof Float32Array!=="undefined";if(arguments.length!==4){return false}for(var v=0;v<4;++v){if(typeof arguments[v]!=="number"||isNaN(arguments[v])||!isFinite(arguments[v])){return false}}e=Math.min(e,1);r=Math.min(r,1);e=Math.max(e,0);r=Math.max(r,0);var c=f?new Float32Array(u):new Array(u);function d(e,t){return 1-3*t+3*e}function h(e,t){return 3*t-6*e}function p(e){return 3*e}function g(e,t,r){return((d(t,r)*e+h(t,r))*e+p(t))*e}function y(e,t,r){return 3*d(t,r)*e*e+2*h(t,r)*e+p(t)}function m(t,n){for(var i=0;i<a;++i){var o=y(n,e,r);if(o===0){return n}var s=g(n,e,r)-t;n-=s/o}return n}function b(){for(var t=0;t<u;++t){c[t]=g(t*l,e,r)}}function x(t,n,a){var i,u,l=0;do{u=n+(a-n)/2;i=g(u,e,r)-t;if(i>0){a=u}else{n=u}}while(Math.abs(i)>o&&++l<s);return u}function w(t){var n=0,a=1,o=u-1;for(;a!==o&&c[a]<=t;++a){n+=l}--a;var s=(t-c[a])/(c[a+1]-c[a]),f=n+s*l,v=y(f,e,r);if(v>=i){return m(t,f)}else if(v===0){return f}else{return x(t,n,n+l)}}var E=false;function k(){E=true;if(e!==t||r!==n){b()}}var _=function a(i){if(!E){k()}if(e===t&&r===n){return i}if(i===0){return 0}if(i===1){return 1}return g(w(i),t,n)};_.getControlPoints=function(){return[{x:e,y:t},{x:r,y:n}]};var S="generateBezier("+[e,t,r,n]+")";_.toString=function(){return S};return _} /*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var jo=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,n){var a={x:t.x+n.dx*r,v:t.v+n.dv*r,tension:t.tension,friction:t.friction};return{dx:a.v,dv:e(a)}}function r(r,n){var a={dx:r.v,dv:e(r)},i=t(r,n*.5,a),o=t(r,n*.5,i),s=t(r,n,o),u=1/6*(a.dx+2*(i.dx+o.dx)+s.dx),l=1/6*(a.dv+2*(i.dv+o.dv)+s.dv);r.x=r.x+u*n;r.v=r.v+l*n;return r}return function e(t,n,a){var i={x:-1,v:0,tension:null,friction:null},o=[0],s=0,u=1/1e4,l=16/1e3,f,v,c;t=parseFloat(t)||500;n=parseFloat(n)||20;a=a||null;i.tension=t;i.friction=n;f=a!==null;if(f){s=e(t,n);v=s/a*l}else{v=l}for(;;){c=r(c||i,v);o.push(1+c.x);s+=16;if(!(Math.abs(c.x)>u&&Math.abs(c.v)>u)){break}}return!f?s:function(e){return o[e*(o.length-1)|0]}}}();var Fo=function e(t,r,n,a){var i=Ro(t,r,n,a);return function(e,t,r){return e+(t-e)*i(r)}};var Vo={linear:function e(t,r,n){return t+(r-t)*n},ease:Fo(.25,.1,.25,1),"ease-in":Fo(.42,0,1,1),"ease-out":Fo(0,0,.58,1),"ease-in-out":Fo(.42,0,.58,1),"ease-in-sine":Fo(.47,0,.745,.715),"ease-out-sine":Fo(.39,.575,.565,1),"ease-in-out-sine":Fo(.445,.05,.55,.95),"ease-in-quad":Fo(.55,.085,.68,.53),"ease-out-quad":Fo(.25,.46,.45,.94),"ease-in-out-quad":Fo(.455,.03,.515,.955),"ease-in-cubic":Fo(.55,.055,.675,.19),"ease-out-cubic":Fo(.215,.61,.355,1),"ease-in-out-cubic":Fo(.645,.045,.355,1),"ease-in-quart":Fo(.895,.03,.685,.22),"ease-out-quart":Fo(.165,.84,.44,1),"ease-in-out-quart":Fo(.77,0,.175,1),"ease-in-quint":Fo(.755,.05,.855,.06),"ease-out-quint":Fo(.23,1,.32,1),"ease-in-out-quint":Fo(.86,0,.07,1),"ease-in-expo":Fo(.95,.05,.795,.035),"ease-out-expo":Fo(.19,1,.22,1),"ease-in-out-expo":Fo(1,0,0,1),"ease-in-circ":Fo(.6,.04,.98,.335),"ease-out-circ":Fo(.075,.82,.165,1),"ease-in-out-circ":Fo(.785,.135,.15,.86),spring:function e(t,r,n){if(n===0){return Vo.linear}var e=jo(t,r,n);return function(t,r,n){return t+(r-t)*e(n)}},"cubic-bezier":Fo};function qo(e,t,r,n,a){if(n===1){return r}if(t===r){return r}var i=a(t,r,n);if(e==null){return i}if(e.roundValue||e.color){i=Math.round(i)}if(e.min!==undefined){i=Math.max(i,e.min)}if(e.max!==undefined){i=Math.min(i,e.max)}return i}function Go(e,t){if(e.pfValue!=null||e.value!=null){if(e.pfValue!=null&&(t==null||t.type.units!=="%")){return e.pfValue}else{return e.value}}else{return e}}function Yo(e,t,r,n,a){var i=a!=null?a.type:null;if(r<0){r=0}else if(r>1){r=1}var o=Go(e,a);var s=Go(t,a);if(B(o)&&B(s)){return qo(i,o,s,r,n)}else if(z(o)&&z(s)){var u=[];for(var l=0;l<s.length;l++){var f=o[l];var v=s[l];if(f!=null&&v!=null){var c=qo(i,f,v,r,n);u.push(c)}else{u.push(v)}}return u}return undefined}function Wo(e,t,r,n){var a=!n;var i=e._private;var o=t._private;var s=o.easing;var u=o.startTime;var l=n?e:e.cy();var f=l.style();if(!o.easingImpl){if(s==null){o.easingImpl=Vo["linear"]}else{var v;if(O(s)){var c=f.parse("transition-timing-function",s);v=c.value}else{v=s}var d,h;if(O(v)){d=v;h=[]}else{d=v[1];h=v.slice(2).map((function(e){return+e}))}if(h.length>0){if(d==="spring"){h.push(o.duration)}o.easingImpl=Vo[d].apply(null,h)}else{o.easingImpl=Vo[d]}}}var p=o.easingImpl;var g;if(o.duration===0){g=1}else{g=(r-u)/o.duration}if(o.applying){g=o.progress}if(g<0){g=0}else if(g>1){g=1}if(o.delay==null){var y=o.startPosition;var m=o.position;if(m&&a&&!e.locked()){var b={};if(Xo(y.x,m.x)){b.x=Yo(y.x,m.x,g,p)}if(Xo(y.y,m.y)){b.y=Yo(y.y,m.y,g,p)}e.position(b)}var x=o.startPan;var w=o.pan;var E=i.pan;var k=w!=null&&n;if(k){if(Xo(x.x,w.x)){E.x=Yo(x.x,w.x,g,p)}if(Xo(x.y,w.y)){E.y=Yo(x.y,w.y,g,p)}e.emit("pan")}var _=o.startZoom;var S=o.zoom;var D=S!=null&&n;if(D){if(Xo(_,S)){i.zoom=Xt(i.minZoom,Yo(_,S,g,p),i.maxZoom)}e.emit("zoom")}if(k||D){e.emit("viewport")}var C=o.style;if(C&&C.length>0&&a){for(var T=0;T<C.length;T++){var P=C[T];var M=P.name;var I=P;var N=o.startStyle[M];var z=f.properties[N.name];var L=Yo(N,I,g,p,z);f.overrideBypass(e,M,L)}e.emit("style")}}o.progress=g;return g}function Xo(e,t){if(e==null||t==null){return false}if(B(e)&&B(t)){return true}else if(e&&t){return true}return false}function Ho(e,t,r,n){var a=t._private;a.started=true;a.startTime=r-a.progress*a.duration}function Uo(e,t){var r=t._private.aniEles;var n=[];function a(t,r){var a=t._private;var i=a.animation.current;var o=a.animation.queue;var s=false;if(i.length===0){var u=o.shift();if(u){i.push(u)}}var l=function e(t){for(var r=t.length-1;r>=0;r--){var n=t[r];n()}t.splice(0,t.length)};for(var f=i.length-1;f>=0;f--){var v=i[f];var c=v._private;if(c.stopped){i.splice(f,1);c.hooked=false;c.playing=false;c.started=false;l(c.frames);continue}if(!c.playing&&!c.applying){continue}if(c.playing&&c.applying){c.applying=false}if(!c.started){Ho(t,v,e)}Wo(t,v,e,r);if(c.applying){c.applying=false}l(c.frames);if(c.step!=null){c.step(e)}if(v.completed()){i.splice(f,1);c.hooked=false;c.playing=false;c.started=false;l(c.completes)}s=true}if(!r&&i.length===0&&o.length===0){n.push(t)}return s}var i=false;for(var o=0;o<r.length;o++){var s=r[o];var u=a(s);i=i||u}var l=a(t,true);if(i||l){if(r.length>0){t.notify("draw",r)}else{t.notify("draw")}}r.unmerge(n);t.emit("step")}var Ko={animate:ga.animate(),animation:ga.animation(),animated:ga.animated(),clearQueue:ga.clearQueue(),delay:ga.delay(),delayAnimation:ga.delayAnimation(),stop:ga.stop(),addToAnimationPool:function e(t){var r=this;if(!r.styleEnabled()){return}r._private.aniEles.merge(t)},stopAnimationLoop:function e(){this._private.animationsRunning=false},startAnimationLoop:function e(){var t=this;t._private.animationsRunning=true;if(!t.styleEnabled()){return}function r(){if(!t._private.animationsRunning){return}ke((function e(n){Uo(n,t);r()}))}var n=t.renderer();if(n&&n.beforeRender){n.beforeRender((function e(r,n){Uo(n,t)}),n.beforeRenderPriorities.animations)}else{r()}}};var Zo={qualifierCompare:function e(t,r){if(t==null||r==null){return t==null&&r==null}else{return t.sameText(r)}},eventMatches:function e(t,r,n){var a=r.qualifier;if(a!=null){return t!==n.target&&V(n.target)&&a.matches(n.target)}return true},addEventFields:function e(t,r){r.cy=t;r.target=t},callbackContext:function e(t,r,n){return r.qualifier!=null?n.target:t}};var $o=function e(t){if(O(t)){return new Ya(t)}else{return t}};var Qo={createEmitter:function e(){var t=this._private;if(!t.emitter){t.emitter=new $i(Zo,this)}return this},emitter:function e(){return this._private.emitter},on:function e(t,r,n){this.emitter().on(t,$o(r),n);return this},removeListener:function e(t,r,n){this.emitter().removeListener(t,$o(r),n);return this},removeAllListeners:function e(){this.emitter().removeAllListeners();return this},one:function e(t,r,n){this.emitter().one(t,$o(r),n);return this},once:function e(t,r,n){this.emitter().one(t,$o(r),n);return this},emit:function e(t,r){this.emitter().emit(t,r);return this},emitAndNotify:function e(t,r){this.emit(t);this.notify(t,r);return this}};ga.eventAliasesOn(Qo);var Jo={png:function e(t){var r=this._private.renderer;t=t||{};return r.png(t)},jpg:function e(t){var r=this._private.renderer;t=t||{};t.bg=t.bg||"#fff";return r.jpg(t)}};Jo.jpeg=Jo.jpg;var es={layout:function e(t){var r=this;if(t==null){Xe("Layout options must be specified to make a layout");return}if(t.name==null){Xe("A `name` must be specified to make a layout");return}var n=t.name;var a=r.extension("layout",n);if(a==null){Xe("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;if(O(t.eles)){i=r.$(t.eles)}else{i=t.eles!=null?t.eles:r.$()}var e=new a(ve({},t,{cy:r,eles:i}));return e}};es.createLayout=es.makeLayout=es.layout;var ts={notify:function e(t,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[t]=n.batchNotifications[t]||this.collection();if(r!=null){a.merge(r)}return}if(!n.notificationsEnabled){return}var i=this.renderer();if(this.destroyed()||!i){return}i.notify(t,r)},notifications:function e(t){var r=this._private;if(t===undefined){return r.notificationsEnabled}else{r.notificationsEnabled=t?true:false}return this},noNotifications:function e(t){this.notifications(false);t();this.notifications(true)},batching:function e(){return this._private.batchCount>0},startBatch:function e(){var t=this._private;if(t.batchCount==null){t.batchCount=0}if(t.batchCount===0){t.batchStyleEles=this.collection();t.batchNotifications={}}t.batchCount++;return this},endBatch:function e(){var t=this._private;if(t.batchCount===0){return this}t.batchCount--;if(t.batchCount===0){t.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(t.batchNotifications).forEach((function(e){var n=t.batchNotifications[e];if(n.empty()){r.notify(e)}else{r.notify(e,n)}}))}return this},batch:function e(t){this.startBatch();t();this.endBatch();return this},batchData:function e(t){var r=this;return this.batch((function(){var e=Object.keys(t);for(var n=0;n<e.length;n++){var a=e[n];var i=t[a];var o=r.getElementById(a);o.data(i)}}))}};var rs=tt({hideEdgesOnViewport:false,textureOnViewport:false,motionBlur:false,motionBlurOpacity:.05,pixelRatio:undefined,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:false,showFps:false});var ns={renderTo:function e(t,r,n,a){var i=this._private.renderer;i.renderTo(t,r,n,a);return this},renderer:function e(){return this._private.renderer},forceRender:function e(){this.notify("draw");return this},resize:function e(){this.invalidateSize();this.emitAndNotify("resize");return this},initRenderer:function e(t){var r=this;var n=r.extension("renderer",t.name);if(n==null){Xe("Can not initialise: No such renderer `".concat(t.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}if(t.wheelSensitivity!==undefined){Ue("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 a=rs(t);a.cy=r;r._private.renderer=new n(a);this.notify("init")},destroyRenderer:function e(){var t=this;t.notify("destroy");var r=t.container();if(r){r._cyreg=null;while(r.childNodes.length>0){r.removeChild(r.childNodes[0])}}t._private.renderer=null;t.mutableElements().forEach((function(e){var t=e._private;t.rscratch={};t.rstyle={};t.animation.current=[];t.animation.queue=[]}))},onRender:function e(t){return this.on("render",t)},offRender:function e(t){return this.off("render",t)}};ns.invalidateDimensions=ns.resize;var as={collection:function e(t,r){if(O(t)){return this.$(t)}else if(F(t)){return t.collection()}else if(z(t)){if(!r){r={}}return new Lo(this,t,r.unique,r.removed)}return new Lo(this)},nodes:function e(t){var e=this.$((function(e){return e.isNode()}));if(t){return e.filter(t)}return e},edges:function e(t){var e=this.$((function(e){return e.isEdge()}));if(t){return e.filter(t)}return e},$:function e(t){var r=this._private.elements;if(t){return r.filter(t)}else{return r.spawnSelf()}},mutableElements:function e(){return this._private.elements}};as.elements=as.filter=as.$;var is={};var os="t";var ss="f";is.apply=function(e){var t=this;var r=t._private;var n=r.cy;var a=n.collection();for(var i=0;i<e.length;i++){var o=e[i];var s=t.getContextMeta(o);if(s.empty){continue}var u=t.getContextStyle(s);var l=t.applyContextStyle(s,u,o);if(o._private.appliedInitStyle){t.updateTransitions(o,l.diffProps)}else{o._private.appliedInitStyle=true}var f=t.updateStyleHints(o);if(f){a.push(o)}}return a};is.getPropertiesDiff=function(e,t){var r=this;var n=r._private.propDiffs=r._private.propDiffs||{};var a=e+"-"+t;var i=n[a];if(i){return i}var o=[];var s={};for(var u=0;u<r.length;u++){var l=r[u];var f=e[u]===os;var v=t[u]===os;var c=f!==v;var d=l.mappedProperties.length>0;if(c||v&&d){var h=void 0;if(c&&d){h=l.properties}else if(c){h=l.properties}else if(d){h=l.mappedProperties}for(var p=0;p<h.length;p++){var g=h[p];var y=g.name;var m=false;for(var b=u+1;b<r.length;b++){var x=r[b];var w=t[b]===os;if(!w){continue}m=x.properties[g.name]!=null;if(m){break}}if(!s[y]&&!m){s[y]=true;o.push(y)}}}}n[a]=o;return o};is.getContextMeta=function(e){var t=this;var r="";var n;var a=e._private.styleCxtKey||"";for(var i=0;i<t.length;i++){var o=t[i];var s=o.selector&&o.selector.matches(e);if(s){r+=os}else{r+=ss}}n=t.getPropertiesDiff(a,r);e._private.styleCxtKey=r;return{key:r,diffPropNames:n,empty:n.length===0}};is.getContextStyle=function(e){var t=e.key;var r=this;var n=this._private.contextStyles=this._private.contextStyles||{};if(n[t]){return n[t]}var a={_private:{key:t}};for(var i=0;i<r.length;i++){var o=r[i];var s=t[i]===os;if(!s){continue}for(var u=0;u<o.properties.length;u++){var l=o.properties[u];a[l.name]=l}}n[t]=a;return a};is.applyContextStyle=function(e,t,r){var n=this;var a=e.diffPropNames;var i={};var o=n.types;for(var s=0;s<a.length;s++){var u=a[s];var l=t[u];var f=r.pstyle(u);if(!l){if(!f){continue}else if(f.bypass){l={name:u,deleteBypassed:true}}else{l={name:u,delete:true}}}if(f===l){continue}if(l.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var v=f.mapping;var c=v.fnValue=l.value(r);if(c===v.prevFnValue){continue}}var d=i[u]={prev:f};n.applyParsedProperty(r,l);d.next=r.pstyle(u);if(d.next&&d.next.bypass){d.next=d.next.bypassed}}return{diffProps:i}};is.updateStyleHints=function(e){var t=e._private;var r=this;var n=r.propertyGroupNames;var a=r.propertyGroupKeys;var i=function e(t,n,a){return r.getPropertiesHash(t,n,a)};var o=t.styleKey;if(e.removed()){return false}var s=t.group==="nodes";var u=e._private.style;n=Object.keys(u);for(var l=0;l<a.length;l++){var f=a[l];t.styleKeys[f]=[Se,Ce]}var v=function e(r,n){return t.styleKeys[n][0]=Pe(r,t.styleKeys[n][0])};var c=function e(r,n){return t.styleKeys[n][1]=Me(r,t.styleKeys[n][1])};var d=function e(t,r){v(t,r);c(t,r)};var h=function e(t,r){for(var n=0;n<t.length;n++){var a=t.charCodeAt(n);v(a,r);c(a,r)}};var p=2e9;var g=function e(t){return-128<t&&t<128&&Math.floor(t)!==t?p-(t*1024|0):t};for(var y=0;y<n.length;y++){var m=n[y];var b=u[m];if(b==null){continue}var x=this.properties[m];var w=x.type;var E=x.groupKey;var k=void 0;if(x.hashOverride!=null){k=x.hashOverride(e,b)}else if(b.pfValue!=null){k=b.pfValue}var _=x.enums==null?b.value:null;var S=k!=null;var D=_!=null;var C=S||D;var T=b.units;if(w.number&&C&&!w.multiple){var P=S?k:_;d(g(P),E);if(!S&&T!=null){h(T,E)}}else{h(b.strValue,E)}}var M=[Se,Ce];for(var I=0;I<a.length;I++){var O=a[I];var N=t.styleKeys[O];M[0]=Pe(N[0],M[0]);M[1]=Me(N[1],M[1])}t.styleKey=Ie(M[0],M[1]);var z=t.styleKeys;t.labelDimsKey=Oe(z.labelDimensions);var L=i(e,["label"],z.labelDimensions);t.labelKey=Oe(L);t.labelStyleKey=Oe(Ne(z.commonLabel,L));if(!s){var A=i(e,["source-label"],z.labelDimensions);t.sourceLabelKey=Oe(A);t.sourceLabelStyleKey=Oe(Ne(z.commonLabel,A));var B=i(e,["target-label"],z.labelDimensions);t.targetLabelKey=Oe(B);t.targetLabelStyleKey=Oe(Ne(z.commonLabel,B))}if(s){var R=t.styleKeys,j=R.nodeBody,F=R.nodeBorder,V=R.nodeOutline,q=R.backgroundImage,G=R.compound,Y=R.pie;var W=[j,F,V,q,G,Y].filter((function(e){return e!=null})).reduce(Ne,[Se,Ce]);t.nodeKey=Oe(W);t.hasPie=Y!=null&&Y[0]!==Se&&Y[1]!==Ce}return o!==t.styleKey};is.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="";t.styleKeys={};t.styleKey=null;t.labelKey=null;t.labelStyleKey=null;t.sourceLabelKey=null;t.sourceLabelStyleKey=null;t.targetLabelKey=null;t.targetLabelStyleKey=null;t.nodeKey=null;t.hasPie=null};is.applyParsedProperty=function(e,t){var r=this;var n=t;var a=e._private.style;var i;var o=r.types;var s=r.properties[n.name].type;var u=n.bypass;var l=a[n.name];var f=l&&l.bypass;var v=e._private;var c="mapping";var d=function e(t){if(t==null){return null}else if(t.pfValue!=null){return t.pfValue}else{return t.value}};var h=function t(){var a=d(l);var i=d(n);r.checkTriggers(e,n.name,a,i)};if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))){n=t=this.parse(t.name,"bezier",u)}if(n["delete"]){a[n.name]=undefined;h();return true}if(n.deleteBypassed){if(!l){h();return true}else if(l.bypass){l.bypassed=undefined;h();return true}else{return false}}if(n.deleteBypass){if(!l){h();return true}else if(l.bypass){a[n.name]=l.bypassed;h();return true}else{return false}}var p=function t(){Ue("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:{var g=n.field.split(".");var y=v.data;for(var m=0;m<g.length&&y;m++){var b=g[m];y=y[b]}if(y==null){p();return false}var x;if(!B(y)){Ue("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+y+"` for `"+e.id()+"` is non-numeric)");return false}else{var w=n.fieldMax-n.fieldMin;if(w===0){x=0}else{x=(y-n.fieldMin)/w}}if(x<0){x=0}else if(x>1){x=1}if(s.color){var E=n.valueMin[0];var k=n.valueMax[0];var _=n.valueMin[1];var S=n.valueMax[1];var D=n.valueMin[2];var C=n.valueMax[2];var T=n.valueMin[3]==null?1:n.valueMin[3];var P=n.valueMax[3]==null?1:n.valueMax[3];var M=[Math.round(E+(k-E)*x),Math.round(_+(S-_)*x),Math.round(D+(C-D)*x),Math.round(T+(P-T)*x)];i={bypass:n.bypass,name:n.name,value:M,strValue:"rgb("+M[0]+", "+M[1]+", "+M[2]+")"}}else if(s.number){var I=n.valueMin+(n.valueMax-n.valueMin)*x;i=this.parse(n.name,I,n.bypass,c)}else{return false}if(!i){p();return false}i.mapping=n;n=i;break}case o.data:{var O=n.field.split(".");var N=v.data;for(var z=0;z<O.length&&N;z++){var L=O[z];N=N[L]}if(N!=null){i=this.parse(n.name,N,n.bypass,c)}if(!i){p();return false}i.mapping=n;n=i;break}case o.fn:{var A=n.value;var R=n.fnValue!=null?n.fnValue:A(e);n.prevFnValue=R;if(R==null){Ue("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+e.id()+"` is null)");return false}i=this.parse(n.name,R,n.bypass,c);if(!i){Ue("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+e.id()+"` is invalid)");return false}i.mapping=Ze(n);n=i;break}case undefined:break;default:return false}if(u){if(f){n.bypassed=l.bypassed}else{n.bypassed=l}a[n.name]=n}else{if(f){l.bypassed=n}else{a[n.name]=n}}h();return true};is.cleanElements=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];this.clearStyleHints(n);n.dirtyCompoundBoundsCache();n.dirtyBoundingBoxCache();if(!t){n._private.style={}}else{var a=n._private.style;var i=Object.keys(a);for(var o=0;o<i.length;o++){var s=i[o];var u=a[s];if(u!=null){if(u.bypass){u.bypassed=null}else{a[s]=null}}}}}};is.update=function(){var e=this._private.cy;var t=e.mutableElements();t.updateStyle()};is.updateTransitions=function(e,t){var r=this;var n=e._private;var a=e.pstyle("transition-property").value;var i=e.pstyle("transition-duration").pfValue;var o=e.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){var s={};var u=false;for(var l=0;l<a.length;l++){var f=a[l];var v=e.pstyle(f);var c=t[f];if(!c){continue}var d=c.prev;var h=d;var p=c.next!=null?c.next:v;var g=false;var y=void 0;var m=1e-6;if(!h){continue}if(B(h.pfValue)&&B(p.pfValue)){g=p.pfValue-h.pfValue;y=h.pfValue+m*g}else if(B(h.value)&&B(p.value)){g=p.value-h.value;y=h.value+m*g}else if(z(h.value)&&z(p.value)){g=h.value[0]!==p.value[0]||h.value[1]!==p.value[1]||h.value[2]!==p.value[2];y=h.strValue}if(g){s[f]=p.strValue;this.applyBypass(e,f,y);u=true}}if(!u){return}n.transitioning=true;new fa((function(t){if(o>0){e.delayAnimation(o).play().promise().then(t)}else{t()}})).then((function(){return e.animation({style:s,duration:i,easing:e.pstyle("transition-timing-function").value,queue:false}).play().promise()})).then((function(){r.removeBypasses(e,a);e.emitAndNotify("style");n.transitioning=false}))}else if(n.transitioning){this.removeBypasses(e,a);e.emitAndNotify("style");n.transitioning=false}};is.checkTrigger=function(e,t,r,n,a,i){var o=this.properties[t];var s=a(o);if(s!=null&&s(r,n)){i(o)}};is.checkZOrderTrigger=function(e,t,r,n){var a=this;this.checkTrigger(e,t,r,n,(function(e){return e.triggersZOrder}),(function(){a._private.cy.notify("zorder",e)}))};is.checkBoundsTrigger=function(e,t,r,n){this.checkTrigger(e,t,r,n,(function(e){return e.triggersBounds}),(function(a){e.dirtyCompoundBoundsCache();e.dirtyBoundingBoxCache();if(a.triggersBoundsOfParallelBeziers&&t==="curve-style"&&(r==="bezier"||n==="bezier")){e.parallelEdges().forEach((function(e){if(e.isBundledBezier()){e.dirtyBoundingBoxCache()}}))}if(a.triggersBoundsOfConnectedEdges&&t==="display"&&(r==="none"||n==="none")){e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}}))};is.checkTriggers=function(e,t,r,n){e.dirtyStyleCache();this.checkZOrderTrigger(e,t,r,n);this.checkBoundsTrigger(e,t,r,n)};var us={};us.applyBypass=function(e,t,r,n){var a=this;var i=[];var o=true;if(t==="*"||t==="**"){if(r!==undefined){for(var s=0;s<a.properties.length;s++){var u=a.properties[s];var l=u.name;var f=this.parse(l,r,true);if(f){i.push(f)}}}}else if(O(t)){var v=this.parse(t,r,true);if(v){i.push(v)}}else if(L(t)){var c=t;n=r;var d=Object.keys(c);for(var h=0;h<d.length;h++){var p=d[h];var g=c[p];if(g===undefined){g=c[J(p)]}if(g!==undefined){var y=this.parse(p,g,true);if(y){i.push(y)}}}}else{return false}if(i.length===0){return false}var m=false;for(var b=0;b<e.length;b++){var x=e[b];var w={};var E=void 0;for(var k=0;k<i.length;k++){var _=i[k];if(n){var S=x.pstyle(_.name);E=w[_.name]={prev:S}}m=this.applyParsedProperty(x,Ze(_))||m;if(n){E.next=x.pstyle(_.name)}}if(m){this.updateStyleHints(x)}if(n){this.updateTransitions(x,w,o)}}return m};us.overrideBypass=function(e,t,r){t=Q(t);for(var n=0;n<e.length;n++){var a=e[n];var i=a._private.style[t];var o=this.properties[t].type;var s=o.color;var u=o.mutiple;var l=!i?null:i.pfValue!=null?i.pfValue:i.value;if(!i||!i.bypass){this.applyBypass(a,t,r)}else{i.value=r;if(i.pfValue!=null){i.pfValue=r}if(s){i.strValue="rgb("+r.join(",")+")"}else if(u){i.strValue=r.join(" ")}else{i.strValue=""+r}this.updateStyleHints(a)}this.checkTriggers(a,t,l,r)}};us.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)};us.removeBypasses=function(e,t,r){var n=true;for(var a=0;a<e.length;a++){var i=e[a];var o={};for(var s=0;s<t.length;s++){var u=t[s];var l=this.properties[u];var f=i.pstyle(l.name);if(!f||!f.bypass){continue}var v="";var c=this.parse(u,v,true);var d=o[l.name]={prev:f};this.applyParsedProperty(i,c);d.next=i.pstyle(l.name)}this.updateStyleHints(i);if(r){this.updateTransitions(i,o,n)}}};var ls={};ls.getEmSizeInPixels=function(){var e=this.containerCss("font-size");if(e!=null){return parseFloat(e)}else{return 1}};ls.containerCss=function(e){var t=this._private.cy;var r=t.container();var n=t.window();if(n&&r&&n.getComputedStyle){return n.getComputedStyle(r).getPropertyValue(e)}};var fs={};fs.getRenderedStyle=function(e,t){if(t){return this.getStylePropertyValue(e,t,true)}else{return this.getRawStyle(e,true)}};fs.getRawStyle=function(e,t){var r=this;e=e[0];if(e){var n={};for(var a=0;a<r.properties.length;a++){var i=r.properties[a];var o=r.getStylePropertyValue(e,i.name,t);if(o!=null){n[i.name]=o;n[J(i.name)]=o}}return n}};fs.getIndexedStyle=function(e,t,r,n){var a=e.pstyle(t)[r][n];return a!=null?a:e.cy().style().getDefaultProperty(t)[r][0]};fs.getStylePropertyValue=function(e,t,r){var n=this;e=e[0];if(e){var a=n.properties[t];if(a.alias){a=a.pointsTo}var i=a.type;var o=e.pstyle(a.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(r&&i.number&&s!=null&&B(s)){var f=e.cy().zoom();var v=function e(t){return t*f};var c=function e(t,r){return v(t)+r};var d=z(s);var h=d?u.every((function(e){return e!=null})):u!=null;if(h){if(d){return s.map((function(e,t){return c(e,u[t])})).join(" ")}else{return c(s,u)}}else{if(d){return s.map((function(e){return O(e)?e:""+v(e)})).join(" ")}else{return""+v(s)}}}else if(l!=null){return l}}return null}};fs.getAnimationStartStyle=function(e,t){var r={};for(var n=0;n<t.length;n++){var a=t[n];var i=a.name;var o=e.pstyle(i);if(o!==undefined){if(L(o)){o=this.parse(i,o.strValue)}else{o=this.parse(i,o)}}if(o){r[i]=o}}return r};fs.getPropsList=function(e){var t=this;var r=[];var n=e;var a=t.properties;if(n){var i=Object.keys(n);for(var o=0;o<i.length;o++){var s=i[o];var u=n[s];var l=a[s]||a[Q(s)];var f=this.parse(l.name,u);if(f){r.push(f)}}}return r};fs.getNonDefaultPropertiesHash=function(e,t,r){var n=r.slice();var a,i,o,s;var u,l;for(u=0;u<t.length;u++){a=t[u];i=e.pstyle(a,false);if(i==null){continue}else if(i.pfValue!=null){n[0]=Pe(s,n[0]);n[1]=Me(s,n[1])}else{o=i.strValue;for(l=0;l<o.length;l++){s=o.charCodeAt(l);n[0]=Pe(s,n[0]);n[1]=Me(s,n[1])}}}return n};fs.getPropertiesHash=fs.getNonDefaultPropertiesHash;var vs={};vs.appendFromJson=function(e){var t=this;for(var r=0;r<e.length;r++){var n=e[r];var a=n.selector;var i=n.style||n.css;var o=Object.keys(i);t.selector(a);for(var s=0;s<o.length;s++){var u=o[s];var l=i[u];t.css(u,l)}}return t};vs.fromJson=function(e){var t=this;t.resetToDefault();t.appendFromJson(e);return t};vs.json=function(){var e=[];for(var t=this.defaultLength;t<this.length;t++){var r=this[t];var n=r.selector;var a=r.properties;var i={};for(var o=0;o<a.length;o++){var s=a[o];i[s.name]=s.strValue}e.push({selector:!n?"core":n.toString(),style:i})}return e};var cs={};cs.appendFromString=function(e){var t=this;var r=this;var n=""+e;var a;var i;var o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){if(n.length>a.length){n=n.substr(a.length)}else{n=""}}function u(){if(i.length>o.length){i=i.substr(o.length)}else{i=""}}for(;;){var l=n.match(/^\s*$/);if(l){break}var f=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){Ue("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=f[0];var v=f[1];if(v!=="core"){var c=new Ya(v);if(c.invalid){Ue("Skipping parsing of block: Invalid selector found in string stylesheet: "+v);s();continue}}var d=f[2];var h=false;i=d;var p=[];for(;;){var g=i.match(/^\s*$/);if(g){break}var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){Ue("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+d);h=true;break}o=y[0];var m=y[1];var b=y[2];var x=t.properties[m];if(!x){Ue("Skipping property: Invalid property name in: "+o);u();continue}var w=r.parse(m,b);if(!w){Ue("Skipping property: Invalid property definition in: "+o);u();continue}p.push({name:m,val:b});u()}if(h){s();break}r.selector(v);for(var E=0;E<p.length;E++){var k=p[E];r.css(k.name,k.val)}s()}return r};cs.fromString=function(e){var t=this;t.resetToDefault();t.appendFromString(e);return t};var ds={};(function(){var e=re;var t=ae;var r=oe;var n=se;var a=ue;var i=function e(t){return"^"+t+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"};var o=function i(o){var s=e+"|\\w+|"+t+"|"+r+"|"+n+"|"+a;return"^"+o+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+s+")\\s*\\,\\s*("+s+")\\)$"};var s=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];ds.types={time:{number:true,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:true,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:true,min:0,max:100,units:"%",implicitUnits:"%",multiple:true},zeroOneNumber:{number:true,min:0,max:1,unitless:true},zeroOneNumbers:{number:true,min:0,max:1,unitless:true,multiple:true},nOneOneNumber:{number:true,min:-1,max:1,unitless:true},nonNegativeInt:{number:true,min:0,integer:true,unitless:true},nonNegativeNumber:{number:true,min:0,unitless:true},position:{enums:["parent","origin"]},nodeSize:{number:true,min:0,enums:["label"]},number:{number:true,unitless:true},numbers:{number:true,unitless:true,multiple:true},positiveNumber:{number:true,unitless:true,min:0,strictMin:true},size:{number:true,min:0},bidirectionalSize:{number:true},bidirectionalSizeMaybePercent:{number:true,allowPercent:true},bidirectionalSizes:{number:true,multiple:true},sizeMaybePercent:{number:true,min:0,allowPercent:true},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:true,min:0,allowPercent:true,enums:["auto"],multiple:true},bgPos:{number:true,allowPercent:true,multiple:true},bgRelativeTo:{enums:["inner","include-padding"],multiple:true},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:true},bgFit:{enums:["none","contain","cover"],multiple:true},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:true},bgClip:{enums:["none","node"],multiple:true},bgContainment:{enums:["inside","over"],multiple:true},color:{color:true},colors:{color:true,multiple:true},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:true},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","right-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"]},arrowWidth:{number:true,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:true},data:{mapping:true,regex:i("data")},layoutData:{mapping:true,regex:i("layoutData")},scratch:{mapping:true,regex:i("scratch")},mapData:{mapping:true,regex:o("mapData")},mapLayoutData:{mapping:true,regex:o("mapLayoutData")},mapScratch:{mapping:true,regex:o("mapScratch")},fn:{mapping:true,fn:true},url:{regexes:s,singleRegexMatchValue:true},urls:{regexes:s,singleRegexMatchValue:true,multiple:true},propList:{propList:true},angle:{number:true,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:true,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:true,multiple:true,evenMultiple:true,min:-1,max:1,unitless:true},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:true,multiple:true,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:true,validate:function e(t,r){switch(t.length){case 2:return r[0]!=="deg"&&r[0]!=="rad"&&r[1]!=="deg"&&r[1]!=="rad";case 1:return O(t[0])||r[0]==="deg"||r[0]==="rad";default:return false}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\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:true,multiple:true,min:0,validate:function e(t){var r=t.length;return r===1||r===2||r===4}}};var u={zeroNonZero:function e(t,r){if((t==null||r==null)&&t!==r){return true}if(t==0&&r!=0){return true}else if(t!=0&&r==0){return true}else{return false}},any:function e(t,r){return t!=r},emptyNonEmpty:function e(t,r){var n=X(t);var a=X(r);return n&&!a||!n&&a}};var l=ds.types;var 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}];var v=[{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}];var 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}];var d=[{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}];var h=[{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}];var p=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any}];var g=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:true},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}];var y=[{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}];var m=[{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}];var b=[{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}];var x=function e(t,r){if(r.value==="label"){return-t.poolIndex()}else{return r.pfValue}};var w=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:x},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:x},{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}];var E=[{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}];var k=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}];var _=[{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}];var S=[{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}];var D=[{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:true},{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}];var 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}];var T=[{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}];var P=[];ds.pieBackgroundN=16;P.push({name:"pie-size",type:l.sizeMaybePercent});for(var M=1;M<=ds.pieBackgroundN;M++){P.push({name:"pie-"+M+"-background-color",type:l.color});P.push({name:"pie-"+M+"-background-size",type:l.percent});P.push({name:"pie-"+M+"-background-opacity",type:l.zeroOneNumber})}var I=[];var N=ds.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach((function(e){N.forEach((function(t){var r=t+"-"+e.name;var n=e.type,a=e.triggersBounds;I.push({name:r,type:n,triggersBounds:a})}))}),{});var z=ds.properties=[].concat(p,b,g,y,m,C,h,d,f,v,c,w,E,k,_,P,S,D,I,T);var L=ds.propertyGroups={behavior:p,transition:b,visibility:g,overlay:y,underlay:m,ghost:C,commonLabel:h,labelDimensions:d,mainLabel:f,sourceLabel:v,targetLabel:c,nodeBody:w,nodeBorder:E,nodeOutline:k,backgroundImage:_,pie:P,compound:S,edgeLine:D,edgeArrow:I,core:T};var A=ds.propertyGroupNames={};var B=ds.propertyGroupKeys=Object.keys(L);B.forEach((function(e){A[e]=L[e].map((function(e){return e.name}));L[e].forEach((function(t){return t.groupKey=e}))}));var R=ds.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"}];ds.propertyNames=z.map((function(e){return e.name}));for(var j=0;j<z.length;j++){var F=z[j];z[F.name]=F}for(var V=0;V<R.length;V++){var q=R[V];var G=z[q.pointsTo];var Y={name:q.name,alias:true,pointsTo:G};z.push(Y);z[q.name]=Y}})();ds.getDefaultProperty=function(e){return this.getDefaultProperties()[e]};ds.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null){return e.defaultProperties}var t=ve({"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","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","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(e,t){for(var r=1;r<=ds.pieBackgroundN;r++){var n=t.name.replace("{{i}}",r);var a=t.value;e[n]=a}return e}),{}),{"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"},{name:"arrow-width",value:1}].reduce((function(e,t){ds.arrowPrefixes.forEach((function(r){var n=r+"-"+t.name;var a=t.value;e[n]=a}));return e}),{}));var r={};for(var n=0;n<this.properties.length;n++){var a=this.properties[n];if(a.pointsTo){continue}var i=a.name;var o=t[i];var s=this.parse(i,o);r[i]=s}e.defaultProperties=r;return e.defaultProperties};ds.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 hs={};hs.parse=function(e,t,r,n){var a=this;if(N(t)){return a.parseImplWarn(e,t,r,n)}var i=n==="mapping"||n===true||n===false||n==null?"dontcare":n;var o=r?"t":"f";var s=""+t;var u=Ae(e,s,o,i);var l=a.propCache=a.propCache||[];var f;if(!(f=l[u])){f=l[u]=a.parseImplWarn(e,t,r,n)}if(r||n==="mapping"){f=Ze(f);if(f){f.value=Ze(f.value)}}return f};hs.parseImplWarn=function(e,t,r,n){var a=this.parseImpl(e,t,r,n);if(!a&&t!=null){Ue("The style property `".concat(e,": ").concat(t,"` is invalid"))}if(a&&(a.name==="width"||a.name==="height")&&t==="label"){Ue("The style value of `label` is deprecated for `"+a.name+"`")}return a};hs.parseImpl=function(e,t,r,n){var a=this;e=Q(e);var i=a.properties[e];var o=t;var s=a.types;if(!i){return null}if(t===undefined){return null}if(i.alias){i=i.pointsTo;e=i.name}var u=O(t);if(u){t=t.trim()}var l=i.type;if(!l){return null}if(r&&(t===""||t===null)){return{name:e,value:t,bypass:true,deleteBypass:true}}if(N(t)){return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:r}}var f,v;if(!u||n||t.length<7||t[1]!=="a");else if(t.length>=7&&t[0]==="d"&&(f=new RegExp(s.data.regex).exec(t))){if(r){return false}var c=s.data;return{name:e,value:f,strValue:""+t,mapped:c,field:f[1],bypass:r}}else if(t.length>=10&&t[0]==="m"&&(v=new RegExp(s.mapData.regex).exec(t))){if(r){return false}if(l.multiple){return false}var d=s.mapData;if(!(l.color||l.number)){return false}var h=this.parse(e,v[4]);if(!h||h.mapped){return false}var p=this.parse(e,v[5]);if(!p||p.mapped){return false}if(h.pfValue===p.pfValue||h.strValue===p.strValue){Ue("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+h.strValue+"`");return this.parse(e,h.strValue)}else if(l.color){var g=h.value;var y=p.value;var m=g[0]===y[0]&&g[1]===y[1]&&g[2]===y[2]&&(g[3]===y[3]||(g[3]==null||g[3]===1)&&(y[3]==null||y[3]===1));if(m){return false}}return{name:e,value:v,strValue:""+t,mapped:d,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:h.value,valueMax:p.value,bypass:r}}if(l.multiple&&n!=="multiple"){var b;if(u){b=t.split(/\s+/)}else if(z(t)){b=t}else{b=[t]}if(l.evenMultiple&&b.length%2!==0){return null}var x=[];var w=[];var E=[];var k="";var _=false;for(var S=0;S<b.length;S++){var D=a.parse(e,b[S],r,"multiple");_=_||O(D.value);x.push(D.value);E.push(D.pfValue!=null?D.pfValue:D.value);w.push(D.units);k+=(S>0?" ":"")+D.strValue}if(l.validate&&!l.validate(x,w)){return null}if(l.singleEnum&&_){if(x.length===1&&O(x[0])){return{name:e,value:x[0],strValue:x[0],bypass:r}}else{return null}}return{name:e,value:x,pfValue:E,strValue:k,bypass:r,units:w}}var C=function n(){for(var a=0;a<l.enums.length;a++){var i=l.enums[a];if(i===t){return{name:e,value:t,strValue:""+t,bypass:r}}}return null};if(l.number){var T;var P="px";if(l.units){T=l.units}if(l.implicitUnits){P=l.implicitUnits}if(!l.unitless){if(u){var M="px|em"+(l.allowPercent?"|\\%":"");if(T){M=T}var I=t.match("^("+re+")("+M+")?"+"$");if(I){t=I[1];T=I[2]||P}}else if(!T||l.implicitUnits){T=P}}t=parseFloat(t);if(isNaN(t)&&l.enums===undefined){return null}if(isNaN(t)&&l.enums!==undefined){t=o;return C()}if(l.integer&&!R(t)){return null}if(l.min!==undefined&&(t<l.min||l.strictMin&&t===l.min)||l.max!==undefined&&(t>l.max||l.strictMax&&t===l.max)){return null}var L={name:e,value:t,strValue:""+t+(T?T:""),units:T,bypass:r};if(l.unitless||T!=="px"&&T!=="em"){L.pfValue=t}else{L.pfValue=T==="px"||!T?t:this.getEmSizeInPixels()*t}if(T==="ms"||T==="s"){L.pfValue=T==="ms"?t:1e3*t}if(T==="deg"||T==="rad"){L.pfValue=T==="rad"?t:At(t)}if(T==="%"){L.pfValue=t/100}return L}else if(l.propList){var A=[];var B=""+t;if(B==="none");else{var j=B.split(/\s*,\s*|\s+/);for(var F=0;F<j.length;F++){var V=j[F].trim();if(a.properties[V]){A.push(V)}else{Ue("`"+V+"` is not a valid property name")}}if(A.length===0){return null}}return{name:e,value:A,strValue:A.length===0?"none":A.join(" "),bypass:r}}else if(l.color){var q=ge(t);if(!q){return null}return{name:e,value:q,pfValue:q,strValue:"rgb("+q[0]+","+q[1]+","+q[2]+")",bypass:r}}else if(l.regex||l.regexes){if(l.enums){var G=C();if(G){return G}}var Y=l.regexes?l.regexes:[l.regex];for(var W=0;W<Y.length;W++){var X=new RegExp(Y[W]);var H=X.exec(t);if(H){return{name:e,value:l.singleRegexMatchValue?H[1]:H,strValue:""+t,bypass:r}}}return null}else if(l.string){return{name:e,value:""+t,strValue:""+t,bypass:r}}else if(l.enums){return C()}else{return null}};var ps=function e(t){if(!(this instanceof e)){return new e(t)}if(!G(t)){Xe("A style must have a core reference");return}this._private={cy:t,coreStyle:{}};this.length=0;this.resetToDefault()};var gs=ps.prototype;gs.instanceString=function(){return"style"};gs.clear=function(){var e=this._private;var t=e.cy;var r=t.elements();for(var n=0;n<this.length;n++){this[n]=undefined}this.length=0;e.contextStyles={};e.propDiffs={};this.cleanElements(r,true);r.forEach((function(e){var t=e[0]._private;t.styleDirty=true;t.appliedInitStyle=false}));return this};gs.resetToDefault=function(){this.clear();this.addDefaultStylesheet();return this};gs.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)};gs.selector=function(e){var t=e==="core"?null:new Ya(e);var r=this.length++;this[r]={selector:t,properties:[],mappedProperties:[],index:r};return this};gs.css=function(){var e=this;var t=arguments;if(t.length===1){var r=t[0];for(var n=0;n<e.properties.length;n++){var a=e.properties[n];var i=r[a.name];if(i===undefined){i=r[J(a.name)]}if(i!==undefined){this.cssRule(a.name,i)}}}else if(t.length===2){this.cssRule(t[0],t[1])}return this};gs.style=gs.css;gs.cssRule=function(e,t){var r=this.parse(e,t);if(r){var n=this.length-1;this[n].properties.push(r);this[n].properties[r.name]=r;if(r.name.match(/pie-(\d+)-background-size/)&&r.value){this._private.hasPie=true}if(r.mapped){this[n].mappedProperties.push(r)}var a=!this[n].selector;if(a){this._private.coreStyle[r.name]=r}}return this};gs.append=function(e){if(Y(e)){e.appendToStyle(this)}else if(z(e)){this.appendFromJson(e)}else if(O(e)){this.appendFromString(e)}return this};ps.fromJson=function(e,t){var r=new ps(e);r.fromJson(t);return r};ps.fromString=function(e,t){return new ps(e).fromString(t)};[is,us,ls,fs,vs,cs,ds,hs].forEach((function(e){ve(gs,e)}));ps.types=gs.types;ps.properties=gs.properties;ps.propertyGroups=gs.propertyGroups;ps.propertyGroupNames=gs.propertyGroupNames;ps.propertyGroupKeys=gs.propertyGroupKeys;var ys={style:function e(t){if(t){var r=this.setStyle(t);r.update()}return this._private.style},setStyle:function e(t){var r=this._private;if(Y(t)){r.style=t.generateStyle(this)}else if(z(t)){r.style=ps.fromJson(this,t)}else if(O(t)){r.style=ps.fromString(this,t)}else{r.style=ps(this)}return r.style},updateStyle:function e(){this.mutableElements().updateStyle()}};var ms="single";var bs={autolock:function e(t){if(t!==undefined){this._private.autolock=t?true:false}else{return this._private.autolock}return this},autoungrabify:function e(t){if(t!==undefined){this._private.autoungrabify=t?true:false}else{return this._private.autoungrabify}return this},autounselectify:function e(t){if(t!==undefined){this._private.autounselectify=t?true:false}else{return this._private.autounselectify}return this},selectionType:function e(t){var r=this._private;if(r.selectionType==null){r.selectionType=ms}if(t!==undefined){if(t==="additive"||t==="single"){r.selectionType=t}}else{return r.selectionType}return this},panningEnabled:function e(t){if(t!==undefined){this._private.panningEnabled=t?true:false}else{return this._private.panningEnabled}return this},userPanningEnabled:function e(t){if(t!==undefined){this._private.userPanningEnabled=t?true:false}else{return this._private.userPanningEnabled}return this},zoomingEnabled:function e(t){if(t!==undefined){this._private.zoomingEnabled=t?true:false}else{return this._private.zoomingEnabled}return this},userZoomingEnabled:function e(t){if(t!==undefined){this._private.userZoomingEnabled=t?true:false}else{return this._private.userZoomingEnabled}return this},boxSelectionEnabled:function e(t){if(t!==undefined){this._private.boxSelectionEnabled=t?true:false}else{return this._private.boxSelectionEnabled}return this},pan:function e(){var t=arguments;var e=this._private.pan;var r,n,a,i,o;switch(t.length){case 0:return e;case 1:if(O(t[0])){r=t[0];return e[r]}else if(L(t[0])){if(!this._private.panningEnabled){return this}a=t[0];i=a.x;o=a.y;if(B(i)){e.x=i}if(B(o)){e.y=o}this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled){return this}r=t[0];n=t[1];if((r==="x"||r==="y")&&B(n)){e[r]=n}this.emit("pan viewport");break}this.notify("viewport");return this},panBy:function e(t,r){var n=arguments;var a=this._private.pan;var i,o,s,u,l;if(!this._private.panningEnabled){return this}switch(n.length){case 1:if(L(t)){s=n[0];u=s.x;l=s.y;if(B(u)){a.x+=u}if(B(l)){a.y+=l}this.emit("pan viewport")}break;case 2:i=t;o=r;if((i==="x"||i==="y")&&B(o)){a[i]+=o}this.emit("pan viewport");break}this.notify("viewport");return this},fit:function e(t,r){var n=this.getFitViewport(t,r);if(n){var a=this._private;a.zoom=n.zoom;a.pan=n.pan;this.emit("pan zoom viewport");this.notify("viewport")}return this},getFitViewport:function e(t,r){if(B(t)&&r===undefined){r=t;t=undefined}if(!this._private.panningEnabled||!this._private.zoomingEnabled){return}var n;if(O(t)){var a=t;t=this.$(a)}else if(U(t)){var i=t;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2};n.w=n.x2-n.x1;n.h=n.y2-n.y1}else if(!F(t)){t=this.mutableElements()}if(F(t)&&t.empty()){return}n=n||t.boundingBox();var o=this.width();var s=this.height();var u;r=B(r)?r:0;if(!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){u=Math.min((o-2*r)/n.w,(s-2*r)/n.h);u=u>this._private.maxZoom?this._private.maxZoom:u;u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(n.x1+n.x2))/2,y:(s-u*(n.y1+n.y2))/2};return{zoom:u,pan:l}}return},zoomRange:function e(t,r){var n=this._private;if(r==null){var a=t;t=a.min;r=a.max}if(B(t)&&B(r)&&t<=r){n.minZoom=t;n.maxZoom=r}else if(B(t)&&r===undefined&&t<=n.maxZoom){n.minZoom=t}else if(B(r)&&t===undefined&&r>=n.minZoom){n.maxZoom=r}return this},minZoom:function e(t){if(t===undefined){return this._private.minZoom}else{return this.zoomRange({min:t})}},maxZoom:function e(t){if(t===undefined){return this._private.maxZoom}else{return this.zoomRange({max:t})}},getZoomedViewport:function e(t){var r=this._private;var n=r.pan;var a=r.zoom;var i;var o;var s=false;if(!r.zoomingEnabled){s=true}if(B(t)){o=t}else if(L(t)){o=t.level;if(t.position!=null){i=Pt(t.position,a,n)}else if(t.renderedPosition!=null){i=t.renderedPosition}if(i!=null&&!r.panningEnabled){s=true}}o=o>r.maxZoom?r.maxZoom:o;o=o<r.minZoom?r.minZoom:o;if(s||!B(o)||o===a||i!=null&&(!B(i.x)||!B(i.y))){return null}if(i!=null){var u=n;var l=a;var f=o;var v={x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y};return{zoomed:true,panned:true,zoom:f,pan:v}}else{return{zoomed:true,panned:false,zoom:o,pan:n}}},zoom:function e(t){if(t===undefined){return this._private.zoom}else{var r=this.getZoomedViewport(t);var n=this._private;if(r==null||!r.zoomed){return this}n.zoom=r.zoom;if(r.panned){n.pan.x=r.pan.x;n.pan.y=r.pan.y}this.emit("zoom"+(r.panned?" pan":"")+" viewport");this.notify("viewport");return this}},viewport:function e(t){var r=this._private;var n=true;var a=true;var i=[];var o=false;var s=false;if(!t){return this}if(!B(t.zoom)){n=false}if(!L(t.pan)){a=false}if(!n&&!a){return this}if(n){var u=t.zoom;if(u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled){o=true}else{r.zoom=u;i.push("zoom")}}if(a&&(!o||!t.cancelOnFailedZoom)&&r.panningEnabled){var l=t.pan;if(B(l.x)){r.pan.x=l.x;s=false}if(B(l.y)){r.pan.y=l.y;s=false}if(!s){i.push("pan")}}if(i.length>0){i.push("viewport");this.emit(i.join(" "));this.notify("viewport")}return this},center:function e(t){var r=this.getCenterPan(t);if(r){this._private.pan=r;this.emit("pan viewport");this.notify("viewport")}return this},getCenterPan:function e(t,r){if(!this._private.panningEnabled){return}if(O(t)){var n=t;t=this.mutableElements().filter(n)}else if(!F(t)){t=this.mutableElements()}if(t.length===0){return}var a=t.boundingBox();var i=this.width();var o=this.height();r=r===undefined?this._private.zoom:r;var s={x:(i-r*(a.x1+a.x2))/2,y:(o-r*(a.y1+a.y2))/2};return s},reset:function e(){if(!this._private.panningEnabled||!this._private.zoomingEnabled){return this}this.viewport({pan:{x:0,y:0},zoom:1});return this},invalidateSize:function e(){this._private.sizeCache=null},size:function e(){var t=this._private;var r=t.container;var n=this;return t.sizeCache=t.sizeCache||(r?function(){var e=n.window().getComputedStyle(r);var t=function t(r){return parseFloat(e.getPropertyValue(r))};return{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}}():{width:1,height:1})},width:function e(){return this.size().width},height:function e(){return this.size().height},extent:function e(){var t=this._private.pan;var r=this._private.zoom;var n=this.renderedExtent();var a={x1:(n.x1-t.x)/r,x2:(n.x2-t.x)/r,y1:(n.y1-t.y)/r,y2:(n.y2-t.y)/r};a.w=a.x2-a.x1;a.h=a.y2-a.y1;return a},renderedExtent:function e(){var t=this.width();var r=this.height();return{x1:0,y1:0,x2:t,y2:r,w:t,h:r}},multiClickDebounceTime:function e(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this}};bs.centre=bs.center;bs.autolockNodes=bs.autolock;bs.autoungrabifyNodes=bs.autoungrabify;var xs={data:ga.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeData:ga.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,updateStyle:true}),scratch:ga.data({field:"scratch",bindingEvent:"scratch",allowBinding:true,allowSetting:true,settingEvent:"scratch",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeScratch:ga.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:true,updateStyle:true})};xs.attr=xs.data;xs.removeAttr=xs.removeData;var ws=function e(t){var r=this;t=ve({},t);var n=t.container;if(n&&!j(n)&&j(n[0])){n=n[0]}var a=n?n._cyreg:null;a=a||{};if(a&&a.cy){a.cy.destroy();a={}}var i=a.readies=a.readies||[];if(n){n._cyreg=a}a.cy=r;var o=S!==undefined&&n!==undefined&&!t.headless;var s=t;s.layout=ve({name:o?"grid":"null"},s.layout);s.renderer=ve({name:o?"canvas":"null"},s.renderer);var u=function e(t,r,n){if(r!==undefined){return r}else if(n!==undefined){return n}else{return t}};var l=this._private={container:n,ready:false,options:s,elements:new Lo(this),listeners:[],aniEles:new Lo(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:false,notificationsEnabled:true,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(true,s.zoomingEnabled),userZoomingEnabled:u(true,s.userZoomingEnabled),panningEnabled:u(true,s.panningEnabled),userPanningEnabled:u(true,s.userPanningEnabled),boxSelectionEnabled:u(true,s.boxSelectionEnabled),autolock:u(false,s.autolock,s.autolockNodes),autoungrabify:u(false,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(false,s.autounselectify),styleEnabled:s.styleEnabled===undefined?o:s.styleEnabled,zoom:B(s.zoom)?s.zoom:1,pan:{x:L(s.pan)&&B(s.pan.x)?s.pan.x:0,y:L(s.pan)&&B(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:false,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter();this.selectionType(s.selectionType);this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=function e(t,r){var n=t.some(K);if(n){return fa.all(t).then(r)}else{r(t)}};if(l.styleEnabled){r.setStyle([])}var v=ve({},s,s.renderer);r.initRenderer(v);var c=function e(t,n,a){r.notifications(false);var i=r.mutableElements();if(i.length>0){i.remove()}if(t!=null){if(L(t)||z(t)){r.add(t)}}r.one("layoutready",(function(e){r.notifications(true);r.emit(e);r.one("load",n);r.emitAndNotify("load")})).one("layoutstop",(function(){r.one("done",a);r.emit("done")}));var o=ve({},r._private.options.layout);o.eles=r.elements();r.layout(o).run()};f([s.style,s.elements],(function(e){var t=e[0];var n=e[1];if(l.styleEnabled){r.style().append(t)}c(n,(function(){r.startAnimationLoop();l.ready=true;if(N(s.ready)){r.on("ready",s.ready)}for(var e=0;e<i.length;e++){var t=i[e];r.on("ready",t)}if(a){a.readies=[]}r.emit("ready")}),s.done)}))};var Es=ws.prototype;ve(Es,{instanceString:function e(){return"core"},isReady:function e(){return this._private.ready},destroyed:function e(){return this._private.destroyed},ready:function e(t){if(this.isReady()){this.emitter().emit("ready",[],t)}else{this.on("ready",t)}return this},destroy:function e(){var t=this;if(t.destroyed())return;t.stopAnimationLoop();t.destroyRenderer();this.emit("destroy");t._private.destroyed=true;return t},hasElementWithId:function e(t){return this._private.elements.hasElementWithId(t)},getElementById:function e(t){return this._private.elements.getElementById(t)},hasCompoundNodes:function e(){return this._private.hasCompoundNodes},headless:function e(){return this._private.renderer.isHeadless()},styleEnabled:function e(){return this._private.styleEnabled},addToPool:function e(t){this._private.elements.merge(t);return this},removeFromPool:function e(t){this._private.elements.unmerge(t);return this},container:function e(){return this._private.container||null},window:function e(){var t=this._private.container;if(t==null)return S;var r=this._private.container.ownerDocument;if(r===undefined||r==null){return S}return r.defaultView||S},mount:function e(t){if(t==null){return}var r=this;var n=r._private;var a=n.options;if(!j(t)&&j(t[0])){t=t[0]}r.stopAnimationLoop();r.destroyRenderer();n.container=t;n.styleEnabled=true;r.invalidateSize();r.initRenderer(ve({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name}));r.startAnimationLoop();r.style(a.style);r.emit("mount");return r},unmount:function e(){var t=this;t.stopAnimationLoop();t.destroyRenderer();t.initRenderer({name:"null"});t.emit("unmount");return t},options:function e(){return Ze(this._private.options)},json:function e(t){var r=this;var n=r._private;var a=r.mutableElements();var i=function e(t){return r.getElementById(t.id())};if(L(t)){r.startBatch();if(t.elements){var o={};var s=function e(t,n){var a=[];var i=[];for(var s=0;s<t.length;s++){var u=t[s];if(!u.data.id){Ue("cy.json() cannot handle elements without an ID attribute");continue}var l=""+u.data.id;var f=r.getElementById(l);o[l]=true;if(f.length!==0){i.push({ele:f,json:u})}else{if(n){u.group=n;a.push(u)}else{a.push(u)}}}r.add(a);for(var v=0;v<i.length;v++){var c=i[v],d=c.ele,h=c.json;d.json(h)}};if(z(t.elements)){s(t.elements)}else{var u=["nodes","edges"];for(var l=0;l<u.length;l++){var f=u[l];var v=t.elements[f];if(z(v)){s(v,f)}}}var c=r.collection();a.filter((function(e){return!o[e.id()]})).forEach((function(e){if(e.isParent()){c.merge(e)}else{e.remove()}}));c.forEach((function(e){return e.children().move({parent:null})}));c.forEach((function(e){return i(e).remove()}))}if(t.style){r.style(t.style)}if(t.zoom!=null&&t.zoom!==n.zoom){r.zoom(t.zoom)}if(t.pan){if(t.pan.x!==n.pan.x||t.pan.y!==n.pan.y){r.pan(t.pan)}}if(t.data){r.data(t.data)}var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"];for(var h=0;h<d.length;h++){var p=d[h];if(t[p]!=null){r[p](t[p])}}r.endBatch();return this}else{var g=!!t;var e={};if(g){e.elements=this.elements().map((function(e){return e.json()}))}else{e.elements={};a.forEach((function(t){var r=t.group();if(!e.elements[r]){e.elements[r]=[]}e.elements[r].push(t.json())}))}if(this._private.styleEnabled){e.style=r.style().json()}e.data=Ze(r.data());var y=n.options;e.zoomingEnabled=n.zoomingEnabled;e.userZoomingEnabled=n.userZoomingEnabled;e.zoom=n.zoom;e.minZoom=n.minZoom;e.maxZoom=n.maxZoom;e.panningEnabled=n.panningEnabled;e.userPanningEnabled=n.userPanningEnabled;e.pan=Ze(n.pan);e.boxSelectionEnabled=n.boxSelectionEnabled;e.renderer=Ze(y.renderer);e.hideEdgesOnViewport=y.hideEdgesOnViewport;e.textureOnViewport=y.textureOnViewport;e.wheelSensitivity=y.wheelSensitivity;e.motionBlur=y.motionBlur;e.multiClickDebounceTime=y.multiClickDebounceTime;return e}}});Es.$id=Es.getElementById;[Bo,Ko,Qo,Jo,es,ts,ns,as,ys,bs,xs].forEach((function(e){ve(Es,e)}));var ks={fit:true,directed:false,padding:30,circle:false,grid:false,spacingFactor:1.75,boundingBox:undefined,avoidOverlap:true,nodeDimensionsIncludeLabels:false,roots:undefined,depthSort:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};var _s={maximal:false,acyclic:false};var Ss=function e(t){return t.scratch("breadthfirst")};var Ds=function e(t,r){return t.scratch("breadthfirst",r)};function Cs(e){this.options=ve({},ks,_s,e)}Cs.prototype.run=function(){var e=this.options;var t=e;var r=e.cy;var n=t.eles;var a=n.nodes().filter((function(e){return!e.isParent()}));var i=n;var o=t.directed;var s=t.acyclic||t.maximal||t.maximalAdjustments>0;var u=Ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});var l;if(F(t.roots)){l=t.roots}else if(z(t.roots)){var f=[];for(var v=0;v<t.roots.length;v++){var c=t.roots[v];var d=r.getElementById(c);f.push(d)}l=r.collection(f)}else if(O(t.roots)){l=r.$(t.roots)}else{if(o){l=a.roots()}else{var h=n.components();l=r.collection();var p=function e(t){var r=h[t];var n=r.maxDegree(false);var a=r.filter((function(e){return e.degree(false)===n}));l=l.add(a)};for(var g=0;g<h.length;g++){p(g)}}}var y=[];var m={};var b=function e(t,r){if(y[r]==null){y[r]=[]}var n=y[r].length;y[r].push(t);Ds(t,{index:n,depth:r})};var x=function e(t,r){var n=Ss(t),a=n.depth,i=n.index;y[a][i]=null;b(t,r)};i.bfs({roots:l,directed:t.directed,visit:function e(t,r,n,a,i){var o=t[0];var s=o.id();b(o,i);m[s]=true}});var w=[];for(var E=0;E<a.length;E++){var k=a[E];if(m[k.id()]){continue}else{w.push(k)}}var _=function e(t){var r=y[t];for(var n=0;n<r.length;n++){var a=r[n];if(a==null){r.splice(n,1);n--;continue}Ds(a,{depth:t,index:n})}};var S=function e(){for(var t=0;t<y.length;t++){_(t)}};var D=function e(r,a){var i=Ss(r);var o=r.incomers().filter((function(e){return e.isNode()&&n.has(e)}));var s=-1;var u=r.id();for(var l=0;l<o.length;l++){var f=o[l];var v=Ss(f);s=Math.max(s,v.depth)}if(i.depth<=s){if(!t.acyclic&&a[u]){return null}var c=s+1;x(r,c);a[u]=c;return true}return false};if(o&&s){var C=[];var T={};var P=function e(t){return C.push(t)};var M=function e(){return C.shift()};a.forEach((function(e){return C.push(e)}));while(C.length>0){var I=M();var N=D(I,T);if(N){I.outgoers().filter((function(e){return e.isNode()&&n.has(e)})).forEach(P)}else if(N===null){Ue("Detected double maximal shift for node `"+I.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var L=0;if(t.avoidOverlap){for(var A=0;A<a.length;A++){var B=a[A];var R=B.layoutDimensions(t);var j=R.w;var V=R.h;L=Math.max(L,j,V)}}var q={};var G=function e(t){if(q[t.id()]){return q[t.id()]}var r=Ss(t).depth;var n=t.neighborhood();var i=0;var o=0;for(var s=0;s<n.length;s++){var u=n[s];if(u.isEdge()||u.isParent()||!a.has(u)){continue}var l=Ss(u);if(l==null){continue}var f=l.index;var v=l.depth;if(f==null||v==null){continue}var c=y[v].length;if(v<r){i+=f/c;o++}}o=Math.max(1,o);i=i/o;if(o===0){i=0}q[t.id()]=i;return i};var Y=function e(t,r){var n=G(t);var a=G(r);var i=n-a;if(i===0){return le(t.id(),r.id())}else{return i}};if(t.depthSort!==undefined){Y=t.depthSort}for(var W=0;W<y.length;W++){y[W].sort(Y);_(W)}var X=[];for(var H=0;H<w.length;H++){X.push(w[H])}y.unshift(X);S();var U=0;for(var K=0;K<y.length;K++){U=Math.max(y[K].length,U)}var Z={x:u.x1+u.w/2,y:u.x1+u.h/2};var $=y.reduce((function(e,t){return Math.max(e,t.length)}),0);var Q=function e(r){var n=Ss(r),a=n.depth,i=n.index;var o=y[a].length;var s=Math.max(u.w/((t.grid?$:o)+1),L);var l=Math.max(u.h/(y.length+1),L);var f=Math.min(u.w/2/y.length,u.h/2/y.length);f=Math.max(f,L);if(!t.circle){var v={x:Z.x+(i+1-(o+1)/2)*s,y:(a+1)*l};return v}else{var c=f*a+f-(y.length>0&&y[0].length<=3?f/2:0);var d=2*Math.PI/y[a].length*i;if(a===0&&y[0].length===1){c=1}return{x:Z.x+c*Math.cos(d),y:Z.y+c*Math.sin(d)}}};n.nodes().layoutPositions(this,t,Q);return this};var Ts={fit:true,padding:30,boundingBox:undefined,avoidOverlap:true,nodeDimensionsIncludeLabels:false,spacingFactor:undefined,radius:undefined,startAngle:3/2*Math.PI,sweep:undefined,clockwise:true,sort:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function Ps(e){this.options=ve({},Ts,e)}Ps.prototype.run=function(){var e=this.options;var t=e;var r=e.cy;var n=t.eles;var a=t.counterclockwise!==undefined?!t.counterclockwise:t.clockwise;var i=n.nodes().not(":parent");if(t.sort){i=i.sort(t.sort)}var o=Ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});var s={x:o.x1+o.w/2,y:o.y1+o.h/2};var u=t.sweep===undefined?2*Math.PI-2*Math.PI/i.length:t.sweep;var l=u/Math.max(1,i.length-1);var f;var v=0;for(var c=0;c<i.length;c++){var d=i[c];var h=d.layoutDimensions(t);var p=h.w;var g=h.h;v=Math.max(v,p,g)}if(B(t.radius)){f=t.radius}else if(i.length<=1){f=0}else{f=Math.min(o.h,o.w)/2-v}if(i.length>1&&t.avoidOverlap){v*=1.75;var y=Math.cos(l)-Math.cos(0);var m=Math.sin(l)-Math.sin(0);var b=Math.sqrt(v*v/(y*y+m*m));f=Math.max(b,f)}var x=function e(r,n){var i=t.startAngle+n*l*(a?1:-1);var o=f*Math.cos(i);var u=f*Math.sin(i);var v={x:s.x+o,y:s.y+u};return v};n.nodes().layoutPositions(this,t,x);return this};var Ms={fit:true,padding:30,startAngle:3/2*Math.PI,sweep:undefined,clockwise:true,equidistant:false,minNodeSpacing:10,boundingBox:undefined,avoidOverlap:true,nodeDimensionsIncludeLabels:false,height:undefined,width:undefined,spacingFactor:undefined,concentric:function e(t){return t.degree()},levelWidth:function e(t){return t.maxDegree()/4},animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function Is(e){this.options=ve({},Ms,e)}Is.prototype.run=function(){var e=this.options;var t=e;var r=t.counterclockwise!==undefined?!t.counterclockwise:t.clockwise;var n=e.cy;var a=t.eles;var i=a.nodes().not(":parent");var o=Ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});var s={x:o.x1+o.w/2,y:o.y1+o.h/2};var u=[];var l=0;for(var f=0;f<i.length;f++){var v=i[f];var c=void 0;c=t.concentric(v);u.push({value:c,node:v});v._private.scratch.concentric=c}i.updateStyle();for(var d=0;d<i.length;d++){var h=i[d];var p=h.layoutDimensions(t);l=Math.max(l,p.w,p.h)}u.sort((function(e,t){return t.value-e.value}));var g=t.levelWidth(i);var y=[[]];var m=y[0];for(var b=0;b<u.length;b++){var x=u[b];if(m.length>0){var w=Math.abs(m[0].value-x.value);if(w>=g){m=[];y.push(m)}}m.push(x)}var E=l+t.minNodeSpacing;if(!t.avoidOverlap){var k=y.length>0&&y[0].length>1;var _=Math.min(o.w,o.h)/2-E;var S=_/(y.length+k?1:0);E=Math.min(E,S)}var D=0;for(var C=0;C<y.length;C++){var T=y[C];var P=t.sweep===undefined?2*Math.PI-2*Math.PI/T.length:t.sweep;var M=T.dTheta=P/Math.max(1,T.length-1);if(T.length>1&&t.avoidOverlap){var I=Math.cos(M)-Math.cos(0);var O=Math.sin(M)-Math.sin(0);var N=Math.sqrt(E*E/(I*I+O*O));D=Math.max(N,D)}T.r=D;D+=E}if(t.equidistant){var z=0;var L=0;for(var A=0;A<y.length;A++){var B=y[A];var R=B.r-L;z=Math.max(z,R)}L=0;for(var j=0;j<y.length;j++){var F=y[j];if(j===0){L=F.r}F.r=L;L+=z}}var V={};for(var q=0;q<y.length;q++){var G=y[q];var Y=G.dTheta;var W=G.r;for(var X=0;X<G.length;X++){var H=G[X];var U=t.startAngle+(r?1:-1)*Y*X;var K={x:s.x+W*Math.cos(U),y:s.y+W*Math.sin(U)};V[H.node.id()]=K}}a.nodes().layoutPositions(this,t,(function(e){var t=e.id();return V[t]}));return this};var Os;var Ns={ready:function e(){},stop:function e(){},animate:true,animationEasing:undefined,animationDuration:undefined,animateFilter:function e(t,r){return true},animationThreshold:250,refresh:20,fit:true,padding:30,boundingBox:undefined,nodeDimensionsIncludeLabels:false,randomize:false,componentSpacing:40,nodeRepulsion:function e(t){return 2048},nodeOverlap:4,idealEdgeLength:function e(t){return 32},edgeElasticity:function e(t){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function zs(e){this.options=ve({},Ns,e);this.options.layout=this;var t=this.options.eles.nodes();var r=this.options.eles.edges();var n=r.filter((function(e){var r=e.source().data("id");var n=e.target().data("id");var a=t.some((function(e){return e.data("id")===r}));var i=t.some((function(e){return e.data("id")===n}));return!a||!i}));this.options.eles=this.options.eles.not(n)}zs.prototype.run=function(){var e=this.options;var t=e.cy;var r=this;r.stopped=false;if(e.animate===true||e.animate===false){r.emit({type:"layoutstart",layout:r})}if(true===e.debug){Os=true}else{Os=false}var n=Ls(t,r,e);if(Os){Rs(n)}if(e.randomize){js(n)}var a=_e();var i=function r(){Vs(n,t,e);if(true===e.fit){t.fit(e.padding)}};var o=function t(a){if(r.stopped||a>=e.numIter){return false}qs(n,e);n.temperature=n.temperature*e.coolingFactor;if(n.temperature<e.minTemp){return false}return true};var s=function t(){if(e.animate===true||e.animate===false){i();r.one("layoutstop",e.stop);r.emit({type:"layoutstop",layout:r})}else{var a=e.eles.nodes();var o=Fs(n,e,a);a.layoutPositions(r,e,o)}};var u=0;var l=true;if(e.animate===true){var f=function t(){var r=0;while(l&&r<e.refresh){l=o(u);u++;r++}if(!l){eu(n,e);s()}else{var f=_e();if(f-a>=e.animationThreshold){i()}ke(t)}};f()}else{while(l){l=o(u);u++}eu(n,e);s()}return this};zs.prototype.stop=function(){this.stopped=true;if(this.thread){this.thread.stop()}this.emit("layoutstop");return this};zs.prototype.destroy=function(){if(this.thread){this.thread.stop()}return this};var Ls=function e(t,r,n){var a=n.eles.edges();var i=n.eles.nodes();var o=Ht(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});var s={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o};var u=n.eles.components();var l={};for(var f=0;f<u.length;f++){var v=u[f];for(var c=0;c<v.length;c++){var d=v[c];l[d.id()]=f}}for(var f=0;f<s.nodeSize;f++){var h=i[f];var p=h.layoutDimensions(n);var g={};g.isLocked=h.locked();g.id=h.data("id");g.parentId=h.data("parent");g.cmptId=l[h.id()];g.children=[];g.positionX=h.position("x");g.positionY=h.position("y");g.offsetX=0;g.offsetY=0;g.height=p.w;g.width=p.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(h.style("padding"));g.padRight=parseFloat(h.style("padding"));g.padTop=parseFloat(h.style("padding"));g.padBottom=parseFloat(h.style("padding"));g.nodeRepulsion=N(n.nodeRepulsion)?n.nodeRepulsion(h):n.nodeRepulsion;s.layoutNodes.push(g);s.idToIndex[g.id]=f}var y=[];var m=0;var b=-1;var x=[];for(var f=0;f<s.nodeSize;f++){var h=s.layoutNodes[f];var w=h.parentId;if(null!=w){s.layoutNodes[s.idToIndex[w]].children.push(h.id)}else{y[++b]=h.id;x.push(h.id)}}s.graphSet.push(x);while(m<=b){var E=y[m++];var k=s.idToIndex[E];var d=s.layoutNodes[k];var _=d.children;if(_.length>0){s.graphSet.push(_);for(var f=0;f<_.length;f++){y[++b]=_[f]}}}for(var f=0;f<s.graphSet.length;f++){var S=s.graphSet[f];for(var c=0;c<S.length;c++){var D=s.idToIndex[S[c]];s.indexToGraph[D]=f}}for(var f=0;f<s.edgeSize;f++){var C=a[f];var T={};T.id=C.data("id");T.sourceId=C.data("source");T.targetId=C.data("target");var P=N(n.idealEdgeLength)?n.idealEdgeLength(C):n.idealEdgeLength;var M=N(n.edgeElasticity)?n.edgeElasticity(C):n.edgeElasticity;var I=s.idToIndex[T.sourceId];var O=s.idToIndex[T.targetId];var z=s.indexToGraph[I];var L=s.indexToGraph[O];if(z!=L){var A=As(T.sourceId,T.targetId,s);var B=s.graphSet[A];var R=0;var g=s.layoutNodes[I];while(-1===B.indexOf(g.id)){g=s.layoutNodes[s.idToIndex[g.parentId]];R++}g=s.layoutNodes[O];while(-1===B.indexOf(g.id)){g=s.layoutNodes[s.idToIndex[g.parentId]];R++}P*=R*n.nestingFactor}T.idealLength=P;T.elasticity=M;s.layoutEdges.push(T)}return s};var As=function e(t,r,n){var a=Bs(t,r,0,n);if(2>a.count){return 0}else{return a.graph}};var Bs=function e(t,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(t)&&-1<i.indexOf(r)){return{count:2,graph:n}}var o=0;for(var s=0;s<i.length;s++){var u=i[s];var l=a.idToIndex[u];var f=a.layoutNodes[l].children;if(0===f.length){continue}var v=a.indexToGraph[a.idToIndex[f[0]]];var c=e(t,r,v,a);if(0===c.count){continue}else if(1===c.count){o++;if(2===o){break}}else{return c}}return{count:o,graph:n}};var Rs;var js=function e(t,r){var n=t.clientWidth;var a=t.clientHeight;for(var i=0;i<t.nodeSize;i++){var o=t.layoutNodes[i];if(0===o.children.length&&!o.isLocked){o.positionX=Math.random()*n;o.positionY=Math.random()*a}}};var Fs=function e(t,r,n){var a=t.boundingBox;var i={x1:Infinity,x2:-Infinity,y1:Infinity,y2:-Infinity};if(r.boundingBox){n.forEach((function(e){var r=t.layoutNodes[t.idToIndex[e.data("id")]];i.x1=Math.min(i.x1,r.positionX);i.x2=Math.max(i.x2,r.positionX);i.y1=Math.min(i.y1,r.positionY);i.y2=Math.max(i.y2,r.positionY)}));i.w=i.x2-i.x1;i.h=i.y2-i.y1}return function(e,n){var o=t.layoutNodes[t.idToIndex[e.data("id")]];if(r.boundingBox){var s=(o.positionX-i.x1)/i.w;var u=(o.positionY-i.y1)/i.h;return{x:a.x1+s*a.w,y:a.y1+u*a.h}}else{return{x:o.positionX,y:o.positionY}}}};var Vs=function e(t,r,n){var a=n.layout;var i=n.eles.nodes();var o=Fs(t,n,i);i.positions(o);if(true!==t.ready){t.ready=true;a.one("layoutready",n.ready);a.emit({type:"layoutready",layout:this})}};var qs=function e(t,r,n){Gs(t,r);Us(t);Ks(t,r);Zs(t);$s(t)};var Gs=function e(t,r){for(var n=0;n<t.graphSet.length;n++){var a=t.graphSet[n];var i=a.length;for(var o=0;o<i;o++){var s=t.layoutNodes[t.idToIndex[a[o]]];for(var u=o+1;u<i;u++){var l=t.layoutNodes[t.idToIndex[a[u]]];Ws(s,l,t,r)}}}};var Ys=function e(t){return-t+2*t*Math.random()};var Ws=function e(t,r,n,a){var i=t.cmptId;var o=r.cmptId;if(i!==o&&!n.isCompound){return}var s=r.positionX-t.positionX;var u=r.positionY-t.positionY;var l=1;if(0===s&&0===u){s=Ys(l);u=Ys(l)}var f=Xs(t,r,s,u);if(f>0){var v=a.nodeOverlap*f;var c=Math.sqrt(s*s+u*u);var d=v*s/c;var h=v*u/c}else{var p=Hs(t,s,u);var g=Hs(r,-1*s,-1*u);var y=g.x-p.x;var m=g.y-p.y;var b=y*y+m*m;var c=Math.sqrt(b);var v=(t.nodeRepulsion+r.nodeRepulsion)/b;var d=v*y/c;var h=v*m/c}if(!t.isLocked){t.offsetX-=d;t.offsetY-=h}if(!r.isLocked){r.offsetX+=d;r.offsetY+=h}return};var Xs=function e(t,r,n,a){if(n>0){var i=t.maxX-r.minX}else{var i=r.maxX-t.minX}if(a>0){var o=t.maxY-r.minY}else{var o=r.maxY-t.minY}if(i>=0&&o>=0){return Math.sqrt(i*i+o*o)}else{return 0}};var Hs=function e(t,r,n){var a=t.positionX;var i=t.positionY;var o=t.height||1;var s=t.width||1;var u=n/r;var l=o/s;var f={};if(0===r&&0<n){f.x=a;f.y=i+o/2;return f}if(0===r&&0>n){f.x=a;f.y=i+o/2;return f}if(0<r&&-1*l<=u&&u<=l){f.x=a+s/2;f.y=i+s*n/2/r;return f}if(0>r&&-1*l<=u&&u<=l){f.x=a-s/2;f.y=i-s*n/2/r;return f}if(0<n&&(u<=-1*l||u>=l)){f.x=a+o*r/2/n;f.y=i+o/2;return f}if(0>n&&(u<=-1*l||u>=l)){f.x=a-o*r/2/n;f.y=i-o/2;return f}return f};var Us=function e(t,r){for(var n=0;n<t.edgeSize;n++){var a=t.layoutEdges[n];var i=t.idToIndex[a.sourceId];var o=t.layoutNodes[i];var s=t.idToIndex[a.targetId];var u=t.layoutNodes[s];var l=u.positionX-o.positionX;var f=u.positionY-o.positionY;if(0===l&&0===f){continue}var v=Hs(o,l,f);var c=Hs(u,-1*l,-1*f);var d=c.x-v.x;var h=c.y-v.y;var p=Math.sqrt(d*d+h*h);var g=Math.pow(a.idealLength-p,2)/a.elasticity;if(0!==p){var y=g*d/p;var m=g*h/p}else{var y=0;var m=0}if(!o.isLocked){o.offsetX+=y;o.offsetY+=m}if(!u.isLocked){u.offsetX-=y;u.offsetY-=m}}};var Ks=function e(t,r){if(r.gravity===0){return}var n=1;for(var a=0;a<t.graphSet.length;a++){var i=t.graphSet[a];var o=i.length;if(0===a){var s=t.clientHeight/2;var u=t.clientWidth/2}else{var l=t.layoutNodes[t.idToIndex[i[0]]];var f=t.layoutNodes[t.idToIndex[l.parentId]];var s=f.positionX;var u=f.positionY}for(var v=0;v<o;v++){var c=t.layoutNodes[t.idToIndex[i[v]]];if(c.isLocked){continue}var d=s-c.positionX;var h=u-c.positionY;var p=Math.sqrt(d*d+h*h);if(p>n){var g=r.gravity*d/p;var y=r.gravity*h/p;c.offsetX+=g;c.offsetY+=y}}}};var Zs=function e(t,r){var n=[];var a=0;var i=-1;n.push.apply(n,t.graphSet[0]);i+=t.graphSet[0].length;while(a<=i){var o=n[a++];var s=t.idToIndex[o];var u=t.layoutNodes[s];var l=u.children;if(0<l.length&&!u.isLocked){var f=u.offsetX;var v=u.offsetY;for(var c=0;c<l.length;c++){var d=t.layoutNodes[t.idToIndex[l[c]]];d.offsetX+=f;d.offsetY+=v;n[++i]=l[c]}u.offsetX=0;u.offsetY=0}}};var $s=function e(t,r){for(var n=0;n<t.nodeSize;n++){var a=t.layoutNodes[n];if(0<a.children.length){a.maxX=undefined;a.minX=undefined;a.maxY=undefined;a.minY=undefined}}for(var n=0;n<t.nodeSize;n++){var a=t.layoutNodes[n];if(0<a.children.length||a.isLocked){continue}var i=Qs(a.offsetX,a.offsetY,t.temperature);a.positionX+=i.x;a.positionY+=i.y;a.offsetX=0;a.offsetY=0;a.minX=a.positionX-a.width;a.maxX=a.positionX+a.width;a.minY=a.positionY-a.height;a.maxY=a.positionY+a.height;Js(a,t)}for(var n=0;n<t.nodeSize;n++){var a=t.layoutNodes[n];if(0<a.children.length&&!a.isLocked){a.positionX=(a.maxX+a.minX)/2;a.positionY=(a.maxY+a.minY)/2;a.width=a.maxX-a.minX;a.height=a.maxY-a.minY}}};var Qs=function e(t,r,n){var a=Math.sqrt(t*t+r*r);if(a>n){var i={x:n*t/a,y:n*r/a}}else{var i={x:t,y:r}}return i};var Js=function e(t,r){var n=t.parentId;if(null==n){return}var a=r.layoutNodes[r.idToIndex[n]];var i=false;if(null==a.maxX||t.maxX+a.padRight>a.maxX){a.maxX=t.maxX+a.padRight;i=true}if(null==a.minX||t.minX-a.padLeft<a.minX){a.minX=t.minX-a.padLeft;i=true}if(null==a.maxY||t.maxY+a.padBottom>a.maxY){a.maxY=t.maxY+a.padBottom;i=true}if(null==a.minY||t.minY-a.padTop<a.minY){a.minY=t.minY-a.padTop;i=true}if(i){return e(a,r)}return};var eu=function e(t,r){var n=t.layoutNodes;var a=[];for(var i=0;i<n.length;i++){var o=n[i];var s=o.cmptId;var u=a[s]=a[s]||[];u.push(o)}var l=0;for(var i=0;i<a.length;i++){var f=a[i];if(!f){continue}f.x1=Infinity;f.x2=-Infinity;f.y1=Infinity;f.y2=-Infinity;for(var v=0;v<f.length;v++){var c=f[v];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}a.sort((function(e,t){return t.w*t.h-e.w*e.h}));var d=0;var h=0;var p=0;var g=0;var y=Math.sqrt(l)*t.clientWidth/t.clientHeight;for(var i=0;i<a.length;i++){var f=a[i];if(!f){continue}for(var v=0;v<f.length;v++){var c=f[v];if(!c.isLocked){c.positionX+=d-f.x1;c.positionY+=h-f.y1}}d+=f.w+r.componentSpacing;p+=f.w+r.componentSpacing;g=Math.max(g,f.h);if(p>y){h+=g+r.componentSpacing;d=0;p=0;g=0}}};var tu={fit:true,padding:30,boundingBox:undefined,avoidOverlap:true,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:false,spacingFactor:undefined,condense:false,rows:undefined,cols:undefined,position:function e(t){},sort:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function ru(e){this.options=ve({},tu,e)}ru.prototype.run=function(){var e=this.options;var t=e;var r=e.cy;var n=t.eles;var a=n.nodes().not(":parent");if(t.sort){a=a.sort(t.sort)}var i=Ht(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0){n.nodes().layoutPositions(this,t,(function(e){return{x:i.x1,y:i.y1}}))}else{var o=a.size();var s=Math.sqrt(o*i.h/i.w);var u=Math.round(s);var l=Math.round(i.w/i.h*s);var f=function e(t){if(t==null){return Math.min(u,l)}else{var r=Math.min(u,l);if(r==u){u=t}else{l=t}}};var v=function e(t){if(t==null){return Math.max(u,l)}else{var r=Math.max(u,l);if(r==u){u=t}else{l=t}}};var c=t.rows;var d=t.cols!=null?t.cols:t.columns;if(c!=null&&d!=null){u=c;l=d}else if(c!=null&&d==null){u=c;l=Math.ceil(o/u)}else if(c==null&&d!=null){l=d;u=Math.ceil(o/l)}else if(l*u>o){var h=f();var p=v();if((h-1)*p>=o){f(h-1)}else if((p-1)*h>=o){v(p-1)}}else{while(l*u<o){var g=f();var y=v();if((y+1)*g>=o){v(y+1)}else{f(g+1)}}}var m=i.w/l;var b=i.h/u;if(t.condense){m=0;b=0}if(t.avoidOverlap){for(var x=0;x<a.length;x++){var w=a[x];var E=w._private.position;if(E.x==null||E.y==null){E.x=0;E.y=0}var k=w.layoutDimensions(t);var _=t.avoidOverlapPadding;var S=k.w+_;var D=k.h+_;m=Math.max(m,S);b=Math.max(b,D)}}var C={};var T=function e(t,r){return C["c-"+t+"-"+r]?true:false};var P=function e(t,r){C["c-"+t+"-"+r]=true};var M=0;var I=0;var O=function e(){I++;if(I>=l){I=0;M++}};var N={};for(var z=0;z<a.length;z++){var L=a[z];var A=t.position(L);if(A&&(A.row!==undefined||A.col!==undefined)){var B={row:A.row,col:A.col};if(B.col===undefined){B.col=0;while(T(B.row,B.col)){B.col++}}else if(B.row===undefined){B.row=0;while(T(B.row,B.col)){B.row++}}N[L.id()]=B;P(B.row,B.col)}}var R=function e(t,r){var n,a;if(t.locked()||t.isParent()){return false}var o=N[t.id()];if(o){n=o.col*m+m/2+i.x1;a=o.row*b+b/2+i.y1}else{while(T(M,I)){O()}n=I*m+m/2+i.x1;a=M*b+b/2+i.y1;P(M,I);O()}return{x:n,y:a}};a.layoutPositions(this,t,R)}return this};var nu={ready:function e(){},stop:function e(){}};function au(e){this.options=ve({},nu,e)}au.prototype.run=function(){var e=this.options;var t=e.eles;var r=this;e.cy;r.emit("layoutstart");t.nodes().positions((function(){return{x:0,y:0}}));r.one("layoutready",e.ready);r.emit("layoutready");r.one("layoutstop",e.stop);r.emit("layoutstop");return this};au.prototype.stop=function(){return this};var iu={positions:undefined,zoom:undefined,pan:undefined,fit:true,padding:30,spacingFactor:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function ou(e){this.options=ve({},iu,e)}ou.prototype.run=function(){var e=this.options;var t=e.eles;var r=t.nodes();var n=N(e.positions);function a(t){if(e.positions==null){return Tt(t.position())}if(n){return e.positions(t)}var r=e.positions[t._private.data.id];if(r==null){return null}return r}r.layoutPositions(this,e,(function(e,t){var r=a(e);if(e.locked()||r==null){return false}return r}));return this};var su={fit:true,padding:30,boundingBox:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function uu(e){this.options=ve({},su,e)}uu.prototype.run=function(){var e=this.options;var t=e.cy;var r=e.eles;var n=Ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});var a=function e(t,r){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};r.nodes().layoutPositions(this,e,a);return this};var lu=[{name:"breadthfirst",impl:Cs},{name:"circle",impl:Ps},{name:"concentric",impl:Is},{name:"cose",impl:zs},{name:"grid",impl:ru},{name:"null",impl:au},{name:"preset",impl:ou},{name:"random",impl:uu}];function fu(e){this.options=e;this.notifications=0}var vu=function e(){};var cu=function e(){throw new Error("A headless instance can not render images")};fu.prototype={recalculateRenderedStyle:vu,notify:function e(){this.notifications++},init:vu,isHeadless:function e(){return true},png:cu,jpg:cu};var du={};du.arrowShapeWidth=.3;du.registerArrowShapes=function(){var e=this.arrowShapes={};var t=this;var r=function e(t,r,n,a,i,o,s){var u=i.x-n/2-s;var l=i.x+n/2+s;var f=i.y-n/2-s;var v=i.y+n/2+s;var c=u<=t&&t<=l&&f<=r&&r<=v;return c};var n=function e(t,r,n,a,i){var o=t*Math.cos(a)-r*Math.sin(a);var s=t*Math.sin(a)+r*Math.cos(a);var u=o*n;var l=s*n;var f=u+i.x;var v=l+i.y;return{x:f,y:v}};var a=function e(t,r,a,i){var o=[];for(var s=0;s<t.length;s+=2){var u=t[s];var l=t[s+1];o.push(n(u,l,r,a,i))}return o};var i=function e(t){var r=[];for(var n=0;n<t.length;n++){var a=t[n];r.push(a.x,a.y)}return r};var o=function e(t){return t.pstyle("width").pfValue*t.pstyle("arrow-scale").pfValue*2};var s=function n(s,u){if(O(u)){u=e[u]}e[s]=ve({name:s,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function e(t,r,n,o,s,u){var l=i(a(this.points,n+2*u,o,s));var f=dr(t,r,l);return f},roughCollide:r,draw:function e(r,n,i,o){var s=a(this.points,n,i,o);t.arrowShapeImpl("polygon")(r,s)},spacing:function e(t){return 0},gap:o},u)};s("none",{collide:Ge,roughCollide:Ge,draw:We,spacing:Ye,gap:Ye});s("triangle",{points:[-.15,-.3,0,0,.15,-.3]});s("arrow","triangle");s("triangle-backcurve",{points:e["triangle"].points,controlPoint:[0,-.15],roughCollide:r,draw:function e(r,i,o,s,u){var l=a(this.points,i,o,s);var f=this.controlPoint;var v=n(f[0],f[1],i,o,s);t.arrowShapeImpl(this.name)(r,l,v)},gap:function e(t){return o(t)*.8}});s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function e(t,r,n,o,s,u,l){var f=i(a(this.points,n+2*l,o,s));var v=i(a(this.pointsTee,n+2*l,o,s));var c=dr(t,r,f)||dr(t,r,v);return c},draw:function e(r,n,i,o,s){var u=a(this.points,n,i,o);var l=a(this.pointsTee,n,i,o);t.arrowShapeImpl(this.name)(r,u,l)}});s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function e(t,r,n,o,s,u,l){var f=s;var v=Math.pow(f.x-t,2)+Math.pow(f.y-r,2)<=Math.pow((n+2*l)*this.radius,2);var c=i(a(this.points,n+2*l,o,s));return dr(t,r,c)||v},draw:function e(r,n,i,o,s){var u=a(this.pointsTr,n,i,o);t.arrowShapeImpl(this.name)(r,u,o.x,o.y,this.radius*n)},spacing:function e(r){return t.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.radius}});s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function e(t,r){var n=this.baseCrossLinePts.slice();var a=r/t;var i=3;var o=5;n[i]=n[i]-a;n[o]=n[o]-a;return n},collide:function e(t,r,n,o,s,u,l){var f=i(a(this.points,n+2*l,o,s));var v=i(a(this.crossLinePts(n,u),n+2*l,o,s));var c=dr(t,r,f)||dr(t,r,v);return c},draw:function e(r,n,i,o,s){var u=a(this.points,n,i,o);var l=a(this.crossLinePts(n,s),n,i,o);t.arrowShapeImpl(this.name)(r,u,l)}});s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function e(t){return o(t)*.525}});s("circle",{radius:.15,collide:function e(t,r,n,a,i,o,s){var u=i;var l=Math.pow(u.x-t,2)+Math.pow(u.y-r,2)<=Math.pow((n+2*s)*this.radius,2);return l},draw:function e(r,n,a,i,o){t.arrowShapeImpl(this.name)(r,i.x,i.y,this.radius*n)},spacing:function e(r){return t.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.radius}});s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function e(t){return 1},gap:function e(t){return 1}});s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]});s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function e(t){return t.pstyle("width").pfValue*t.pstyle("arrow-scale").value}});s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function e(t){return.95*t.pstyle("width").pfValue*t.pstyle("arrow-scale").value}})};var hu={};hu.projectIntoViewport=function(e,t){var r=this.cy;var n=this.findContainerClientCoords();var a=n[0];var i=n[1];var o=n[4];var s=r.pan();var u=r.zoom();var l=((e-a)/o-s.x)/u;var f=((t-i)/o-s.y)/u;return[l,f]};hu.findContainerClientCoords=function(){if(this.containerBB){return this.containerBB}var e=this.container;var t=e.getBoundingClientRect();var r=this.cy.window().getComputedStyle(e);var n=function e(t){return parseFloat(r.getPropertyValue(t))};var a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")};var i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")};var o=e.clientWidth;var s=e.clientHeight;var u=a.left+a.right;var l=a.top+a.bottom;var f=i.left+i.right;var v=t.width/(o+f);var c=o-u;var d=s-l;var h=t.left+a.left+i.left;var p=t.top+a.top+i.top;return this.containerBB=[h,p,c,d,v]};hu.invalidateContainerClientCoordsCache=function(){this.containerBB=null};hu.findNearestElement=function(e,t,r,n){return this.findNearestElements(e,t,r,n)[0]};hu.findNearestElements=function(e,t,r,n){var a=this;var i=this;var o=i.getCachedZSortedEles();var s=[];var u=i.cy.zoom();var l=i.cy.hasCompoundNodes();var f=(n?24:8)/u;var v=(n?8:2)/u;var c=(n?8:2)/u;var d=Infinity;var h;var p;if(r){o=o.interactive}function g(e,t){if(e.isNode()){if(p){return}else{p=e;s.push(e)}}if(e.isEdge()&&(t==null||t<d)){if(h){if(h.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&h.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value){for(var r=0;r<s.length;r++){if(s[r].isEdge()){s[r]=e;h=e;d=t!=null?t:d;break}}}}else{s.push(e);h=e;d=t!=null?t:d}}}function y(r){var n=r.outerWidth()+2*v;var o=r.outerHeight()+2*v;var s=n/2;var u=o/2;var l=r.position();if(l.x-s<=e&&e<=l.x+s&&l.y-u<=t&&t<=l.y+u){var f=i.nodeShapes[a.getNodeShape(r)];if(f.checkPoint(e,t,0,n,o,l.x,l.y)){g(r,0);return true}}}function m(r){var n=r._private;var o=n.rscratch;var u=r.pstyle("width").pfValue;var v=r.pstyle("arrow-scale").value;var c=u/2+f;var d=c*c;var h=c*2;var p=n.source;var m=n.target;var b;if(o.edgeType==="segments"||o.edgeType==="straight"||o.edgeType==="haystack"){var x=o.allpts;for(var w=0;w+3<x.length;w+=2){if(sr(e,t,x[w],x[w+1],x[w+2],x[w+3],h)&&d>(b=cr(e,t,x[w],x[w+1],x[w+2],x[w+3]))){g(r,b);return true}}}else if(o.edgeType==="bezier"||o.edgeType==="multibezier"||o.edgeType==="self"||o.edgeType==="compound"){var x=o.allpts;for(var w=0;w+5<o.allpts.length;w+=4){if(ur(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],h)&&d>(b=vr(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5]))){g(r,b);return true}}}var p=p||n.source;var m=m||n.target;var E=a.getArrowWidth(u,v);var k=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(var w=0;w<k.length;w++){var _=k[w];var S=i.arrowShapes[r.pstyle(_.name+"-arrow-shape").value];var D=r.pstyle("width").pfValue;if(S.roughCollide(e,t,E,_.angle,{x:_.x,y:_.y},D,f)&&S.collide(e,t,E,_.angle,{x:_.x,y:_.y},D,f)){g(r);return true}}if(l&&s.length>0){y(p);y(m)}}function b(e,t,r){return it(e,t,r)}function x(r,n){var a=r._private;var i=c;var o;if(n){o=n+"-"}else{o=""}r.boundingBox();var s=a.labelBounds[n||"main"];var u=r.pstyle(o+"label").value;var l=r.pstyle("text-events").strValue==="yes";if(!l||!u){return}var f=b(a.rscratch,"labelX",n);var v=b(a.rscratch,"labelY",n);var d=b(a.rscratch,"labelAngle",n);var h=r.pstyle(o+"text-margin-x").pfValue;var p=r.pstyle(o+"text-margin-y").pfValue;var y=s.x1-i-h;var m=s.x2+i-h;var x=s.y1-i-p;var w=s.y2+i-p;if(d){var E=Math.cos(d);var k=Math.sin(d);var _=function e(t,r){t=t-f;r=r-v;return{x:t*E-r*k+f,y:t*k+r*E+v}};var S=_(y,x);var D=_(y,w);var C=_(m,x);var T=_(m,w);var P=[S.x+h,S.y+p,C.x+h,C.y+p,T.x+h,T.y+p,D.x+h,D.y+p];if(dr(e,t,P)){g(r);return true}}else{if(nr(s,e,t)){g(r);return true}}}for(var w=o.length-1;w>=0;w--){var E=o[w];if(E.isNode()){y(E)||x(E)}else{m(E)||x(E)||x(E,"source")||x(E,"target")}}return s};hu.getAllInBox=function(e,t,r,n){var a=this.getCachedZSortedEles().interactive;var i=[];var o=Math.min(e,r);var s=Math.max(e,r);var u=Math.min(t,n);var l=Math.max(t,n);e=o;r=s;t=u;n=l;var f=Ht({x1:e,y1:t,x2:r,y2:n});for(var v=0;v<a.length;v++){var c=a[v];if(c.isNode()){var d=c;var h=d.boundingBox({includeNodes:true,includeEdges:false,includeLabels:false});if(rr(f,h)&&!ir(h,f)){i.push(d)}}else{var p=c;var g=p._private;var y=g.rscratch;if(y.startX!=null&&y.startY!=null&&!nr(f,y.startX,y.startY)){continue}if(y.endX!=null&&y.endY!=null&&!nr(f,y.endX,y.endY)){continue}if(y.edgeType==="bezier"||y.edgeType==="multibezier"||y.edgeType==="self"||y.edgeType==="compound"||y.edgeType==="segments"||y.edgeType==="haystack"){var m=g.rstyle.bezierPts||g.rstyle.linePts||g.rstyle.haystackPts;var b=true;for(var x=0;x<m.length;x++){if(!ar(f,m[x])){b=false;break}}if(b){i.push(p)}}else if(y.edgeType==="haystack"||y.edgeType==="straight"){i.push(p)}}}return i};var pu={};pu.calculateArrowAngles=function(e){var t=e._private.rscratch;var r=t.edgeType==="haystack";var n=t.edgeType==="bezier";var a=t.edgeType==="multibezier";var i=t.edgeType==="segments";var o=t.edgeType==="compound";var s=t.edgeType==="self";var u,l;var f,v,c,d,h,p;if(r){f=t.haystackPts[0];v=t.haystackPts[1];c=t.haystackPts[2];d=t.haystackPts[3]}else{f=t.arrowStartX;v=t.arrowStartY;c=t.arrowEndX;d=t.arrowEndY}h=t.midX;p=t.midY;if(i){u=f-t.segpts[0];l=v-t.segpts[1]}else if(a||o||s||n){var g=t.allpts;var y=Gt(g[0],g[2],g[4],.1);var m=Gt(g[1],g[3],g[5],.1);u=f-y;l=v-m}else{u=f-h;l=v-p}t.srcArrowAngle=Bt(u,l);var h=t.midX;var p=t.midY;if(r){h=(f+c)/2;p=(v+d)/2}u=c-f;l=d-v;if(i){var g=t.allpts;if(g.length/2%2===0){var b=g.length/2;var x=b-2;u=g[b]-g[x];l=g[b+1]-g[x+1]}else{var b=g.length/2-1;var x=b-2;var w=b+2;u=g[b]-g[x];l=g[b+1]-g[x+1]}}else if(a||o||s){var g=t.allpts;var E=t.ctrlpts;var k,_;var S,D;if(E.length/2%2===0){var C=g.length/2-1;var T=C+2;var P=T+2;k=Gt(g[C],g[T],g[P],0);_=Gt(g[C+1],g[T+1],g[P+1],0);S=Gt(g[C],g[T],g[P],1e-4);D=Gt(g[C+1],g[T+1],g[P+1],1e-4)}else{var T=g.length/2-1;var C=T-2;var P=T+2;k=Gt(g[C],g[T],g[P],.4999);_=Gt(g[C+1],g[T+1],g[P+1],.4999);S=Gt(g[C],g[T],g[P],.5);D=Gt(g[C+1],g[T+1],g[P+1],.5)}u=S-k;l=D-_}t.midtgtArrowAngle=Bt(u,l);t.midDispX=u;t.midDispY=l;u*=-1;l*=-1;if(i){var g=t.allpts;if(g.length/2%2===0);else{var b=g.length/2-1;var w=b+2;u=-(g[w]-g[b]);l=-(g[w+1]-g[b+1])}}t.midsrcArrowAngle=Bt(u,l);if(i){u=c-t.segpts[t.segpts.length-2];l=d-t.segpts[t.segpts.length-1]}else if(a||o||s||n){var g=t.allpts;var M=g.length;var y=Gt(g[M-6],g[M-4],g[M-2],.9);var m=Gt(g[M-5],g[M-3],g[M-1],.9);u=c-y;l=d-m}else{u=c-h;l=d-p}t.tgtArrowAngle=Bt(u,l)};pu.getArrowWidth=pu.getArrowHeight=function(e,t){var r=this.arrowWidthCache=this.arrowWidthCache||{};var n=r[e+", "+t];if(n){return n}n=Math.max(Math.pow(e*13.37,.9),29)*t;r[e+", "+t]=n;return n};var gu={};gu.findMidptPtsEtc=function(e,t){var r=t.posPts,n=t.intersectionPts,a=t.vectorNormInverse;var i;var o=e.pstyle("source-endpoint");var s=e.pstyle("target-endpoint");var u=o.units!=null&&s.units!=null;var l=function e(t,r,n,a){var i=a-r;var o=n-t;var s=Math.sqrt(o*o+i*i);return{x:-i/s,y:o/s}};var f=e.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=n;break;case"endpoints":{if(u){var v=this.manualEndptToPx(e.source()[0],o),c=b(v,2),d=c[0],h=c[1];var p=this.manualEndptToPx(e.target()[0],s),g=b(p,2),y=g[0],m=g[1];var x={x1:d,y1:h,x2:y,y2:m};a=l(d,h,y,m);i=x}else{Ue("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default)."));i=n}break}}return{midptPts:i,vectorNormInverse:a}};gu.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var r=e[t];var n=r._private;var a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)};i=Math.random()*2*Math.PI;a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source;var s=n.target;var u=o.position();var l=s.position();var f=o.width();var v=s.width();var c=o.height();var d=s.height();var h=r.pstyle("haystack-radius").value;var p=h/2;a.haystackPts=a.allpts=[a.source.x*f*p+u.x,a.source.y*c*p+u.y,a.target.x*v*p+l.x,a.target.y*d*p+l.y];a.midX=(a.allpts[0]+a.allpts[2])/2;a.midY=(a.allpts[1]+a.allpts[3])/2;a.edgeType="haystack";a.haystack=true;this.storeEdgeProjections(r);this.calculateArrowAngles(r);this.recalculateEdgeLabelProjections(r);this.calculateLabelAngles(r)}};gu.findSegmentsPoints=function(e,t){var r=e._private.rscratch;var n=e.pstyle("segment-weights");var a=e.pstyle("segment-distances");var i=Math.min(n.pfValue.length,a.pfValue.length);r.edgeType="segments";r.segpts=[];for(var o=0;o<i;o++){var s=n.pfValue[o];var u=a.pfValue[o];var l=1-s;var f=s;var v=this.findMidptPtsEtc(e,t),c=v.midptPts,d=v.vectorNormInverse;var h={x:c.x1*l+c.x2*f,y:c.y1*l+c.y2*f};r.segpts.push(h.x+d.x*u,h.y+d.y*u)}};gu.findLoopPoints=function(e,t,r,n){var a=e._private.rscratch;var i=t.dirCounts,o=t.srcPos;var s=e.pstyle("control-point-distances");var u=s?s.pfValue[0]:undefined;var l=e.pstyle("loop-direction").pfValue;var f=e.pstyle("loop-sweep").pfValue;var v=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var c=r;var d=v;if(n){c=0;d=u}var h=l-Math.PI/2;var p=h-f/2;var g=h+f/2;var y=String(l+"_"+f);c=i[y]===undefined?i[y]=0:++i[y];a.ctrlpts=[o.x+Math.cos(p)*1.4*d*(c/3+1),o.y+Math.sin(p)*1.4*d*(c/3+1),o.x+Math.cos(g)*1.4*d*(c/3+1),o.y+Math.sin(g)*1.4*d*(c/3+1)]};gu.findCompoundLoopPoints=function(e,t,r,n){var a=e._private.rscratch;a.edgeType="compound";var i=t.srcPos,o=t.tgtPos,s=t.srcW,u=t.srcH,l=t.tgtW,f=t.tgtH;var v=e.pstyle("control-point-step-size").pfValue;var c=e.pstyle("control-point-distances");var d=c?c.pfValue[0]:undefined;var h=r;var p=v;if(n){h=0;p=d}var g=50;var y={x:i.x-s/2,y:i.y-u/2};var m={x:o.x-l/2,y:o.y-f/2};var b={x:Math.min(y.x,m.x),y:Math.min(y.y,m.y)};var x=.5;var w=Math.max(x,Math.log(s*.01));var E=Math.max(x,Math.log(l*.01));a.ctrlpts=[b.x,b.y-(1+Math.pow(g,1.12)/100)*p*(h/3+1)*w,b.x-(1+Math.pow(g,1.12)/100)*p*(h/3+1)*E,b.y]};gu.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"};gu.findBezierPoints=function(e,t,r,n,a){var i=e._private.rscratch;var o=e.pstyle("control-point-step-size").pfValue;var s=e.pstyle("control-point-distances");var u=e.pstyle("control-point-weights");var l=s&&u?Math.min(s.value.length,u.value.length):1;var f=s?s.pfValue[0]:undefined;var v=u.value[0];var c=n;i.edgeType=c?"multibezier":"bezier";i.ctrlpts=[];for(var d=0;d<l;d++){var h=(.5-t.eles.length/2+r)*o*(a?-1:1);var p=void 0;var g=jt(h);if(c){f=s?s.pfValue[d]:o;v=u.value[d]}if(n){p=f}else{p=f!==undefined?g*f:undefined}var y=p!==undefined?p:h;var m=1-v;var b=v;var x=this.findMidptPtsEtc(e,t),w=x.midptPts,E=x.vectorNormInverse;var k={x:w.x1*m+w.x2*b,y:w.y1*m+w.y2*b};i.ctrlpts.push(k.x+E.x*y,k.y+E.y*y)}};gu.findTaxiPoints=function(e,t){var r=e._private.rscratch;r.edgeType="segments";var n="vertical";var a="horizontal";var i="leftward";var o="rightward";var s="downward";var u="upward";var l="auto";var f=t.posPts,v=t.srcW,c=t.srcH,d=t.tgtW,h=t.tgtH;var p=e.pstyle("edge-distances").value;var g=p!=="node-position";var y=e.pstyle("taxi-direction").value;var m=y;var b=e.pstyle("taxi-turn");var x=b.units==="%";var w=b.pfValue;var E=w<0;var k=e.pstyle("taxi-turn-min-distance").pfValue;var _=g?(v+d)/2:0;var S=g?(c+h)/2:0;var D=f.x2-f.x1;var C=f.y2-f.y1;var T=function e(t,r){if(t>0){return Math.max(t-r,0)}else{return Math.min(t+r,0)}};var P=T(D,_);var M=T(C,S);var I=false;if(m===l){y=Math.abs(P)>Math.abs(M)?a:n}else if(m===u||m===s){y=n;I=true}else if(m===i||m===o){y=a;I=true}var O=y===n;var N=O?M:P;var z=O?C:D;var L=jt(z);var A=false;if(!(I&&(x||E))&&(m===s&&z<0||m===u&&z>0||m===i&&z>0||m===o&&z<0)){L*=-1;N=L*Math.abs(N);A=true}var B;if(x){var R=w<0?1+w:w;B=R*N}else{var j=w<0?N:0;B=j+w*L}var F=function e(t){return Math.abs(t)<k||Math.abs(t)>=Math.abs(N)};var V=F(B);var q=F(Math.abs(N)-Math.abs(B));var G=V||q;if(G&&!A){if(O){var Y=Math.abs(z)<=c/2;var W=Math.abs(D)<=d/2;if(Y){var X=(f.x1+f.x2)/2;var H=f.y1,U=f.y2;r.segpts=[X,H,X,U]}else if(W){var K=(f.y1+f.y2)/2;var Z=f.x1,$=f.x2;r.segpts=[Z,K,$,K]}else{r.segpts=[f.x1,f.y2]}}else{var Q=Math.abs(z)<=v/2;var J=Math.abs(C)<=h/2;if(Q){var ee=(f.y1+f.y2)/2;var te=f.x1,re=f.x2;r.segpts=[te,ee,re,ee]}else if(J){var ne=(f.x1+f.x2)/2;var ae=f.y1,ie=f.y2;r.segpts=[ne,ae,ne,ie]}else{r.segpts=[f.x2,f.y1]}}}else{if(O){var oe=f.y1+B+(g?c/2*L:0);var se=f.x1,ue=f.x2;r.segpts=[se,oe,ue,oe]}else{var le=f.x1+B+(g?v/2*L:0);var fe=f.y1,ve=f.y2;r.segpts=[le,fe,le,ve]}}};gu.tryToCorrectInvalidPoints=function(e,t){var r=e._private.rscratch;if(r.edgeType==="bezier"){var n=t.srcPos,a=t.tgtPos,i=t.srcW,o=t.srcH,s=t.tgtW,u=t.tgtH,l=t.srcShape,f=t.tgtShape;var v=!B(r.startX)||!B(r.startY);var c=!B(r.arrowStartX)||!B(r.arrowStartY);var d=!B(r.endX)||!B(r.endY);var h=!B(r.arrowEndX)||!B(r.arrowEndY);var p=3;var g=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth;var y=p*g;var m=Ft({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY});var b=m<y;var x=Ft({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY});var w=x<y;var E=false;if(v||c||b){E=true;var k={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y};var _=Math.sqrt(k.x*k.x+k.y*k.y);var S={x:k.x/_,y:k.y/_};var D=Math.max(i,o);var C={x:r.ctrlpts[0]+S.x*2*D,y:r.ctrlpts[1]+S.y*2*D};var T=l.intersectLine(n.x,n.y,i,o,C.x,C.y,0);if(b){r.ctrlpts[0]=r.ctrlpts[0]+S.x*(y-m);r.ctrlpts[1]=r.ctrlpts[1]+S.y*(y-m)}else{r.ctrlpts[0]=T[0]+S.x*y;r.ctrlpts[1]=T[1]+S.y*y}}if(d||h||w){E=true;var P={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y};var M=Math.sqrt(P.x*P.x+P.y*P.y);var I={x:P.x/M,y:P.y/M};var O=Math.max(i,o);var N={x:r.ctrlpts[0]+I.x*2*O,y:r.ctrlpts[1]+I.y*2*O};var z=f.intersectLine(a.x,a.y,s,u,N.x,N.y,0);if(w){r.ctrlpts[0]=r.ctrlpts[0]+I.x*(y-x);r.ctrlpts[1]=r.ctrlpts[1]+I.y*(y-x)}else{r.ctrlpts[0]=z[0]+I.x*y;r.ctrlpts[1]=z[1]+I.y*y}}if(E){this.findEndpoints(e)}}};gu.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){t.allpts=[];t.allpts.push(t.startX,t.startY);for(var r=0;r+1<t.ctrlpts.length;r+=2){t.allpts.push(t.ctrlpts[r],t.ctrlpts[r+1]);if(r+3<t.ctrlpts.length){t.allpts.push((t.ctrlpts[r]+t.ctrlpts[r+2])/2,(t.ctrlpts[r+1]+t.ctrlpts[r+3])/2)}}t.allpts.push(t.endX,t.endY);var n,a;if(t.ctrlpts.length/2%2===0){n=t.allpts.length/2-1;t.midX=t.allpts[n];t.midY=t.allpts[n+1]}else{n=t.allpts.length/2-3;a=.5;t.midX=Gt(t.allpts[n],t.allpts[n+2],t.allpts[n+4],a);t.midY=Gt(t.allpts[n+1],t.allpts[n+3],t.allpts[n+5],a)}}else if(t.edgeType==="straight"){t.allpts=[t.startX,t.startY,t.endX,t.endY];t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4;t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4}else if(t.edgeType==="segments"){t.allpts=[];t.allpts.push(t.startX,t.startY);t.allpts.push.apply(t.allpts,t.segpts);t.allpts.push(t.endX,t.endY);if(t.segpts.length%4===0){var i=t.segpts.length/2;var o=i-2;t.midX=(t.segpts[o]+t.segpts[i])/2;t.midY=(t.segpts[o+1]+t.segpts[i+1])/2}else{var s=t.segpts.length/2-1;t.midX=t.segpts[s];t.midY=t.segpts[s+1]}}};gu.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;if(t.nodesOverlap||B(t.startX)&&B(t.startY)&&B(t.endX)&&B(t.endY)){t.loggedErr=false}else{if(!t.loggedErr){t.loggedErr=true;Ue("Edge `"+e.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.")}}};gu.findEdgeControlPoints=function(e){var t=this;if(!e||e.length===0){return}var r=this;var n=r.cy;var a=n.hasCompoundNodes();var i={map:new ut,get:function e(t){var r=this.map.get(t[0]);if(r!=null){return r.get(t[1])}else{return null}},set:function e(t,r){var n=this.map.get(t[0]);if(n==null){n=new ut;this.map.set(t[0],n)}n.set(t[1],r)}};var o=[];var s=[];for(var u=0;u<e.length;u++){var l=e[u];var f=l._private;var v=l.pstyle("curve-style").value;if(l.removed()||!l.takesUpSpace()){continue}if(v==="haystack"){s.push(l);continue}var c=v==="unbundled-bezier"||v==="segments"||v==="straight"||v==="straight-triangle"||v==="taxi";var d=v==="unbundled-bezier"||v==="bezier";var h=f.source;var p=f.target;var g=h.poolIndex();var y=p.poolIndex();var m=[g,y].sort();var b=i.get(m);if(b==null){b={eles:[]};i.set(m,b);o.push(m)}b.eles.push(l);if(c){b.hasUnbundled=true}if(d){b.hasBezier=true}}var x=function e(n){var s=o[n];var u=i.get(s);var l=void 0;if(!u.hasUnbundled){var f=u.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));nt(u.eles);f.forEach((function(e){return u.eles.push(e)}));u.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var v=u.eles[0];var c=v.source();var d=v.target();if(c.poolIndex()>d.poolIndex()){var h=c;c=d;d=h}var p=u.srcPos=c.position();var g=u.tgtPos=d.position();var y=u.srcW=c.outerWidth();var m=u.srcH=c.outerHeight();var b=u.tgtW=d.outerWidth();var x=u.tgtH=d.outerHeight();var w=u.srcShape=r.nodeShapes[t.getNodeShape(c)];var E=u.tgtShape=r.nodeShapes[t.getNodeShape(d)];u.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var k=0;k<u.eles.length;k++){var _=u.eles[k];var S=_[0]._private.rscratch;var D=_.pstyle("curve-style").value;var C=D==="unbundled-bezier"||D==="segments"||D==="taxi";var T=!c.same(_.source());if(!u.calculatedIntersection&&c!==d&&(u.hasBezier||u.hasUnbundled)){u.calculatedIntersection=true;var P=w.intersectLine(p.x,p.y,y,m,g.x,g.y,0);var M=u.srcIntn=P;var I=E.intersectLine(g.x,g.y,b,x,p.x,p.y,0);var O=u.tgtIntn=I;var N=u.intersectionPts={x1:P[0],x2:I[0],y1:P[1],y2:I[1]};var z=u.posPts={x1:p.x,x2:g.x,y1:p.y,y2:g.y};var L=I[1]-P[1];var A=I[0]-P[0];var R=Math.sqrt(A*A+L*L);var j=u.vector={x:A,y:L};var F=u.vectorNorm={x:j.x/R,y:j.y/R};var V={x:-F.y,y:F.x};u.nodesOverlap=!B(R)||E.checkPoint(P[0],P[1],0,b,x,g.x,g.y)||w.checkPoint(I[0],I[1],0,y,m,p.x,p.y);u.vectorNormInverse=V;l={nodesOverlap:u.nodesOverlap,dirCounts:u.dirCounts,calculatedIntersection:true,hasBezier:u.hasBezier,hasUnbundled:u.hasUnbundled,eles:u.eles,srcPos:g,tgtPos:p,srcW:b,srcH:x,tgtW:y,tgtH:m,srcIntn:O,tgtIntn:M,srcShape:E,tgtShape:w,posPts:{x1:z.x2,y1:z.y2,x2:z.x1,y2:z.y1},intersectionPts:{x1:N.x2,y1:N.y2,x2:N.x1,y2:N.y1},vector:{x:-j.x,y:-j.y},vectorNorm:{x:-F.x,y:-F.y},vectorNormInverse:{x:-V.x,y:-V.y}}}var q=T?l:u;S.nodesOverlap=q.nodesOverlap;S.srcIntn=q.srcIntn;S.tgtIntn=q.tgtIntn;if(a&&(c.isParent()||c.isChild()||d.isParent()||d.isChild())&&(c.parents().anySame(d)||d.parents().anySame(c)||c.same(d)&&c.isParent())){t.findCompoundLoopPoints(_,q,k,C)}else if(c===d){t.findLoopPoints(_,q,k,C)}else if(D==="segments"){t.findSegmentsPoints(_,q)}else if(D==="taxi"){t.findTaxiPoints(_,q)}else if(D==="straight"||!C&&u.eles.length%2===1&&k===Math.floor(u.eles.length/2)){t.findStraightEdgePoints(_)}else{t.findBezierPoints(_,q,k,C,T)}t.findEndpoints(_);t.tryToCorrectInvalidPoints(_,q);t.checkForInvalidEdgeWarning(_);t.storeAllpts(_);t.storeEdgeProjections(_);t.calculateArrowAngles(_);t.recalculateEdgeLabelProjections(_);t.calculateLabelAngles(_)}};for(var w=0;w<o.length;w++){x(w)}this.findHaystackPoints(s)};function yu(e){var t=[];if(e==null){return}for(var r=0;r<e.length;r+=2){var n=e[r];var a=e[r+1];t.push({x:n,y:a})}return t}gu.getSegmentPoints=function(e){var t=e[0]._private.rscratch;var r=t.edgeType;if(r==="segments"){this.recalculateRenderedStyle(e);return yu(t.segpts)}};gu.getControlPoints=function(e){var t=e[0]._private.rscratch;var r=t.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound"){this.recalculateRenderedStyle(e);return yu(t.ctrlpts)}};gu.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);return{x:t.midX,y:t.midY}};var mu={};mu.manualEndptToPx=function(e,t){var r=this;var n=e.position();var a=e.outerWidth();var i=e.outerHeight();if(t.value.length===2){var o=[t.pfValue[0],t.pfValue[1]];if(t.units[0]==="%"){o[0]=o[0]*a}if(t.units[1]==="%"){o[1]=o[1]*i}o[0]+=n.x;o[1]+=n.y;return o}else{var s=t.pfValue[0];s=-Math.PI/2+s;var u=2*Math.max(a,i);var l=[n.x+Math.cos(s)*u,n.y+Math.sin(s)*u];return r.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,a,i,l[0],l[1],0)}};mu.findEndpoints=function(e){var t=this;var r;var n=e.source()[0];var a=e.target()[0];var i=n.position();var o=a.position();var s=e.pstyle("target-arrow-shape").value;var u=e.pstyle("source-arrow-shape").value;var l=e.pstyle("target-distance-from-node").pfValue;var f=e.pstyle("source-distance-from-node").pfValue;var v=e.pstyle("curve-style").value;var c=e._private.rscratch;var d=c.edgeType;var h=v==="taxi";var p=d==="self"||d==="compound";var g=d==="bezier"||d==="multibezier"||p;var y=d!=="bezier";var m=d==="straight"||d==="segments";var b=d==="segments";var x=g||y||m;var w=p||h;var E=e.pstyle("source-endpoint");var k=w?"outside-to-node":E.value;var _=e.pstyle("target-endpoint");var S=w?"outside-to-node":_.value;c.srcManEndpt=E;c.tgtManEndpt=_;var D;var C;var T;var P;if(g){var M=[c.ctrlpts[0],c.ctrlpts[1]];var I=y?[c.ctrlpts[c.ctrlpts.length-2],c.ctrlpts[c.ctrlpts.length-1]]:M;D=I;C=M}else if(m){var O=!b?[o.x,o.y]:c.segpts.slice(0,2);var N=!b?[i.x,i.y]:c.segpts.slice(c.segpts.length-2);D=N;C=O}if(S==="inside-to-node"){r=[o.x,o.y]}else if(_.units){r=this.manualEndptToPx(a,_)}else if(S==="outside-to-line"){r=c.tgtIntn}else{if(S==="outside-to-node"||S==="outside-to-node-or-label"){T=D}else if(S==="outside-to-line"||S==="outside-to-line-or-label"){T=[i.x,i.y]}r=t.nodeShapes[this.getNodeShape(a)].intersectLine(o.x,o.y,a.outerWidth(),a.outerHeight(),T[0],T[1],0);if(S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var z=a._private.rscratch;var L=z.labelWidth;var A=z.labelHeight;var R=z.labelX;var j=z.labelY;var F=L/2;var V=A/2;var q=a.pstyle("text-valign").value;if(q==="top"){j-=V}else if(q==="bottom"){j+=V}var G=a.pstyle("text-halign").value;if(G==="left"){R-=F}else if(G==="right"){R+=F}var Y=kr(T[0],T[1],[R-F,j-V,R+F,j-V,R+F,j+V,R-F,j+V],o.x,o.y);if(Y.length>0){var W=i;var X=Vt(W,It(r));var H=Vt(W,It(Y));var U=X;if(H<X){r=Y;U=H}if(Y.length>2){var K=Vt(W,{x:Y[2],y:Y[3]});if(K<U){r=[Y[2],Y[3]]}}}}}var Z=Sr(r,D,t.arrowShapes[s].spacing(e)+l);var $=Sr(r,D,t.arrowShapes[s].gap(e)+l);c.endX=$[0];c.endY=$[1];c.arrowEndX=Z[0];c.arrowEndY=Z[1];if(k==="inside-to-node"){r=[i.x,i.y]}else if(E.units){r=this.manualEndptToPx(n,E)}else if(k==="outside-to-line"){r=c.srcIntn}else{if(k==="outside-to-node"||k==="outside-to-node-or-label"){P=C}else if(k==="outside-to-line"||k==="outside-to-line-or-label"){P=[o.x,o.y]}r=t.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),P[0],P[1],0);if(k==="outside-to-node-or-label"||k==="outside-to-line-or-label"){var Q=n._private.rscratch;var J=Q.labelWidth;var ee=Q.labelHeight;var te=Q.labelX;var re=Q.labelY;var ne=J/2;var ae=ee/2;var ie=n.pstyle("text-valign").value;if(ie==="top"){re-=ae}else if(ie==="bottom"){re+=ae}var oe=n.pstyle("text-halign").value;if(oe==="left"){te-=ne}else if(oe==="right"){te+=ne}var se=kr(P[0],P[1],[te-ne,re-ae,te+ne,re-ae,te+ne,re+ae,te-ne,re+ae],i.x,i.y);if(se.length>0){var ue=o;var le=Vt(ue,It(r));var fe=Vt(ue,It(se));var ve=le;if(fe<le){r=[se[0],se[1]];ve=fe}if(se.length>2){var ce=Vt(ue,{x:se[2],y:se[3]});if(ce<ve){r=[se[2],se[3]]}}}}}var de=Sr(r,C,t.arrowShapes[u].spacing(e)+f);var he=Sr(r,C,t.arrowShapes[u].gap(e)+f);c.startX=he[0];c.startY=he[1];c.arrowStartX=de[0];c.arrowStartY=de[1];if(x){if(!B(c.startX)||!B(c.startY)||!B(c.endX)||!B(c.endY)){c.badLine=true}else{c.badLine=false}}};mu.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);switch(t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}};mu.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);switch(t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var bu={};function xu(e,t,r){var n=function e(t,r,n,a){return Gt(t,r,n,a)};var a=t._private;var i=a.rstyle.bezierPts;for(var o=0;o<e.bezierProjPcts.length;o++){var s=e.bezierProjPcts[o];i.push({x:n(r[0],r[2],r[4],s),y:n(r[1],r[3],r[5],s)})}}bu.storeEdgeProjections=function(e){var t=e._private;var r=t.rscratch;var n=r.edgeType;t.rstyle.bezierPts=null;t.rstyle.linePts=null;t.rstyle.haystackPts=null;if(n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){t.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4){xu(this,e,r.allpts.slice(a,a+6))}}else if(n==="segments"){var i=t.rstyle.linePts=[];for(var a=0;a+1<r.allpts.length;a+=2){i.push({x:r.allpts[a],y:r.allpts[a+1]})}}else if(n==="haystack"){var o=r.haystackPts;t.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth};bu.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var wu={};wu.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(X(t)){return}var r,n;var a=e._private;var i=e.width();var o=e.height();var s=e.padding();var u=e.position();var l=e.pstyle("text-halign").strValue;var f=e.pstyle("text-valign").strValue;var v=a.rscratch;var c=a.rstyle;switch(l){case"left":r=u.x-i/2-s;break;case"right":r=u.x+i/2+s;break;default:r=u.x}switch(f){case"top":n=u.y-o/2-s;break;case"bottom":n=u.y+o/2+s;break;default:n=u.y}v.labelX=r;v.labelY=n;c.labelX=r;c.labelY=n;this.calculateLabelAngles(e);this.applyLabelDimensions(e)};var Eu=function e(t,r){var n=Math.atan(r/t);if(t===0&&n<0){n=n*-1}return n};var ku=function e(t,r){var n=r.x-t.x;var a=r.y-t.y;return Eu(n,a)};var _u=function e(t,r,n,a){var i=Xt(0,a-.001,1);var o=Xt(0,a+.001,1);var s=Yt(t,r,n,i);var u=Yt(t,r,n,o);return ku(s,u)};wu.recalculateEdgeLabelProjections=function(e){var t;var r=e._private;var n=r.rscratch;var a=this;var i={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(i.mid||i.source||i.target);else{return}t={x:n.midX,y:n.midY};var o=function e(t,n,a){ot(r.rscratch,t,n,a);ot(r.rstyle,t,n,a)};o("labelX",null,t.x);o("labelY",null,t.y);var s=Eu(n.midDispX,n.midDispY);o("labelAutoAngle",null,s);var u=function e(){if(e.cache){return e.cache}var t=[];for(var i=0;i+5<n.allpts.length;i+=4){var o={x:n.allpts[i],y:n.allpts[i+1]};var s={x:n.allpts[i+2],y:n.allpts[i+3]};var u={x:n.allpts[i+4],y:n.allpts[i+5]};t.push({p0:o,p1:s,p2:u,startDist:0,length:0,segments:[]})}var l=r.rstyle.bezierPts;var f=a.bezierProjPcts.length;function v(e,t,r,n,a){var i=Ft(t,r);var o=e.segments[e.segments.length-1];var s={p0:t,p1:r,t0:n,t1:a,startDist:o?o.startDist+o.length:0,length:i};e.segments.push(s);e.length+=i}for(var c=0;c<t.length;c++){var d=t[c];var h=t[c-1];if(h){d.startDist=h.startDist+h.length}v(d,d.p0,l[c*f],0,a.bezierProjPcts[0]);for(var p=0;p<f-1;p++){v(d,l[c*f+p],l[c*f+p+1],a.bezierProjPcts[p],a.bezierProjPcts[p+1])}v(d,l[c*f+f-1],d.p2,a.bezierProjPcts[f-1],1)}return e.cache=t};var l=function r(a){var s;var l=a==="source";if(!i[a]){return}var f=e.pstyle(a+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{var v=u();var c;var d=0;var h=0;for(var p=0;p<v.length;p++){var g=v[l?p:v.length-1-p];for(var y=0;y<g.segments.length;y++){var m=g.segments[l?y:g.segments.length-1-y];var b=p===v.length-1&&y===g.segments.length-1;d=h;h+=m.length;if(h>=f||b){c={cp:g,segment:m};break}}if(c){break}}var x=c.cp;var w=c.segment;var E=(f-d)/w.length;var k=w.t1-w.t0;var _=l?w.t0+k*E:w.t1-k*E;_=Xt(0,_,1);t=Yt(x.p0,x.p1,x.p2,_);s=_u(x.p0,x.p1,x.p2,_);break}case"straight":case"segments":case"haystack":{var S=0,D,C;var T,P;var M=n.allpts.length;for(var I=0;I+3<M;I+=2){if(l){T={x:n.allpts[I],y:n.allpts[I+1]};P={x:n.allpts[I+2],y:n.allpts[I+3]}}else{T={x:n.allpts[M-2-I],y:n.allpts[M-1-I]};P={x:n.allpts[M-4-I],y:n.allpts[M-3-I]}}D=Ft(T,P);C=S;S+=D;if(S>=f){break}}var O=f-C;var N=O/D;N=Xt(0,N,1);t=Wt(T,P,N);s=ku(T,P);break}}o("labelX",a,t.x);o("labelY",a,t.y);o("labelAutoAngle",a,s)};l("source");l("target");this.applyLabelDimensions(e)};wu.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e);if(e.isEdge()){this.applyPrefixedLabelDimensions(e,"source");this.applyPrefixedLabelDimensions(e,"target")}};wu.applyPrefixedLabelDimensions=function(e,t){var r=e._private;var n=this.getLabelText(e,t);var a=this.calculateLabelDimensions(e,n);var i=e.pstyle("line-height").pfValue;var o=e.pstyle("text-wrap").strValue;var s=it(r.rscratch,"labelWrapCachedLines",t)||[];var u=o!=="wrap"?1:Math.max(s.length,1);var l=a.height/u;var f=l*i;var v=a.width;var c=a.height+(u-1)*(i-1)*l;ot(r.rstyle,"labelWidth",t,v);ot(r.rscratch,"labelWidth",t,v);ot(r.rstyle,"labelHeight",t,c);ot(r.rscratch,"labelHeight",t,c);ot(r.rscratch,"labelLineHeight",t,f)};wu.getLabelText=function(e,t){var r=e._private;var n=t?t+"-":"";var a=e.pstyle(n+"label").strValue;var i=e.pstyle("text-transform").value;var o=function e(n,a){if(a){ot(r.rscratch,n,t,a);return a}else{return it(r.rscratch,n,t)}};if(!a){return""}if(i=="none");else if(i=="uppercase"){a=a.toUpperCase()}else if(i=="lowercase"){a=a.toLowerCase()}var s=e.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u){return o("labelWrapCachedText")}var l="​";var f=a.split("\n");var v=e.pstyle("text-max-width").pfValue;var c=e.pstyle("text-overflow-wrap").value;var d=c==="anywhere";var h=[];var p=/[\s\u200b]+/;var g=d?"":" ";for(var y=0;y<f.length;y++){var m=f[y];var b=this.calculateLabelDimensions(e,m);var x=b.width;if(d){var w=m.split("").join(l);m=w}if(x>v){var E=m.split(p);var k="";for(var _=0;_<E.length;_++){var S=E[_];var D=k.length===0?S:k+g+S;var C=this.calculateLabelDimensions(e,D);var T=C.width;if(T<=v){k+=S+g}else{if(k){h.push(k)}k=S+g}}if(!k.match(/^[\s\u200b]+$/)){h.push(k)}}else{h.push(m)}}o("labelWrapCachedLines",h);a=o("labelWrapCachedText",h.join("\n"));o("labelWrapKey",u)}else if(s==="ellipsis"){var P=e.pstyle("text-max-width").pfValue;var M="";var I="…";var O=false;if(this.calculateLabelDimensions(e,a).width<P){return a}for(var N=0;N<a.length;N++){var z=this.calculateLabelDimensions(e,M+a[N]+I).width;if(z>P){break}M+=a[N];if(N===a.length-1){O=true}}if(!O){M+=I}return M}return a};wu.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue;var r=e.pstyle("text-halign").strValue;if(t==="auto"){if(e.isNode()){switch(r){case"left":return"right";case"right":return"left";default:return"center"}}else{return"center"}}else{return t}};wu.calculateLabelDimensions=function(e,t){var r=this;var n=Le(t,e._private.labelDimsKey);var a=r.labelDimCache||(r.labelDimCache=[]);var i=a[n];if(i!=null){return i}var o=0;var s=e.pstyle("font-style").strValue;var u=e.pstyle("font-size").pfValue;var l=e.pstyle("font-family").strValue;var f=e.pstyle("font-weight").strValue;var v=this.labelCalcCanvas;var c=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=document.createElement("canvas");c=this.labelCalcCanvasContext=v.getContext("2d");var d=v.style;d.position="absolute";d.left="-9999px";d.top="-9999px";d.zIndex="-1";d.visibility="hidden";d.pointerEvents="none"}c.font="".concat(s," ").concat(f," ").concat(u,"px ").concat(l);var h=0;var p=0;var g=t.split("\n");for(var y=0;y<g.length;y++){var m=g[y];var b=c.measureText(m);var x=Math.ceil(b.width);var w=u;h=Math.max(x,h);p+=w}h+=o;p+=o;return a[n]={width:h,height:p}};wu.calculateLabelAngle=function(e,t){var r=e._private;var n=r.rscratch;var a=e.isEdge();var i=t?t+"-":"";var o=e.pstyle(i+"text-rotation");var s=o.strValue;if(s==="none"){return 0}else if(a&&s==="autorotate"){return n.labelAutoAngle}else if(s==="autorotate"){return 0}else{return o.pfValue}};wu.calculateLabelAngles=function(e){var t=this;var r=e.isEdge();var n=e._private;var a=n.rscratch;a.labelAngle=t.calculateLabelAngle(e);if(r){a.sourceLabelAngle=t.calculateLabelAngle(e,"source");a.targetLabelAngle=t.calculateLabelAngle(e,"target")}};var Su={};var Du=28;var Cu=false;Su.getNodeShape=function(e){var t=this;var r=e.pstyle("shape").value;if(r==="cutrectangle"&&(e.width()<Du||e.height()<Du)){if(!Cu){Ue("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead");Cu=true}return"rectangle"}if(e.isParent()){if(r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"){return r}else{return"rectangle"}}if(r==="polygon"){var n=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(n).name}return r};var Tu={};Tu.registerCalculationListeners=function(){var e=this.cy;var t=e.collection();var r=this;var n=function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;t.merge(r);if(n){for(var a=0;a<r.length;a++){var i=r[a];var o=i._private;var s=o.rstyle;s.clean=false;s.cleanConnected=false}}};r.binder(e).on("bounds.* dirty.*",(function e(t){var r=t.target;n(r)})).on("style.* background.*",(function e(t){var r=t.target;n(r,false)}));var a=function a(i){if(i){var o=r.onUpdateEleCalcsFns;t.cleanStyle();for(var s=0;s<t.length;s++){var u=t[s];var l=u._private.rstyle;if(u.isNode()&&!l.cleanConnected){n(u.connectedEdges());l.cleanConnected=true}}if(o){for(var f=0;f<o.length;f++){var v=o[f];v(i,t)}}r.recalculateRenderedStyle(t);t=e.collection()}};r.flushRenderedStyleQueue=function(){a(true)};r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)};Tu.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)};Tu.recalculateRenderedStyle=function(e,t){var r=function e(t){return t._private.rstyle.cleanConnected};var n=[];var a=[];if(this.destroyed){return}if(t===undefined){t=true}for(var i=0;i<e.length;i++){var o=e[i];var s=o._private;var u=s.rstyle;if(o.isEdge()&&(!r(o.source())||!r(o.target()))){u.clean=false}if(t&&u.clean||o.removed()){continue}if(o.pstyle("display").value==="none"){continue}if(s.group==="nodes"){a.push(o)}else{n.push(o)}u.clean=true}for(var l=0;l<a.length;l++){var f=a[l];var v=f._private;var c=v.rstyle;var d=f.position();this.recalculateNodeLabelProjection(f);c.nodeX=d.x;c.nodeY=d.y;c.nodeW=f.pstyle("width").pfValue;c.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var h=0;h<n.length;h++){var p=n[h];var g=p._private;var y=g.rstyle;var m=g.rscratch;y.srcX=m.arrowStartX;y.srcY=m.arrowStartY;y.tgtX=m.arrowEndX;y.tgtY=m.arrowEndY;y.midX=m.midX;y.midY=m.midY;y.labelAngle=m.labelAngle;y.sourceLabelAngle=m.sourceLabelAngle;y.targetLabelAngle=m.targetLabelAngle}};var Pu={};Pu.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(!e){return}e.drag=[];e.nondrag=[];var t=[];for(var r=0;r<e.length;r++){var n=e[r];var a=n._private.rscratch;if(n.grabbed()&&!n.isParent()){t.push(n)}else if(a.inDragLayer){e.drag.push(n)}else{e.nondrag.push(n)}}for(var r=0;r<t.length;r++){var n=t[r];e.drag.push(n)}};Pu.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Pu.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(uo);t.interactive=t.filter((function(e){return e.interactive()}));this.cachedZSortedEles=t;this.updateCachedGrabbedEles()}else{t=this.cachedZSortedEles}return t};var Mu={};[hu,pu,gu,mu,bu,wu,Su,Tu,Pu].forEach((function(e){ve(Mu,e)}));var Iu={};Iu.getCachedImage=function(e,t,r){var n=this;var a=n.imageCache=n.imageCache||{};var i=a[e];if(i){if(!i.image.complete){i.image.addEventListener("load",r)}return i.image}else{i=a[e]=a[e]||{};var o=i.image=new Image;o.addEventListener("load",r);o.addEventListener("error",(function(){o.error=true}));var s="data:";var u=e.substring(0,s.length).toLowerCase()===s;if(!u){t=t==="null"?null:t;o.crossOrigin=t}o.src=e;return o}};var Ou={};Ou.registerBinding=function(e,t,r,n){var a=Array.prototype.slice.apply(arguments,[1]);var i=this.binder(e);return i.on.apply(i,a)};Ou.binder=function(e){var t=this;var r=t.cy.window();var n=e===r||e===r.document||e===r.document.body||H(e);if(t.supportsPassiveEvents==null){var a=false;try{var i=Object.defineProperty({},"passive",{get:function e(){a=true;return true}});r.addEventListener("test",null,i)}catch(e){}t.supportsPassiveEvents=a}var o=function r(a,i,o){var s=Array.prototype.slice.call(arguments);if(n&&t.supportsPassiveEvents){s[2]={capture:o!=null?o:false,passive:false,once:false}}t.bindings.push({target:e,args:s});(e.addEventListener||e.on).apply(e,s);return this};return{on:o,addEventListener:o,addListener:o,bind:o}};Ou.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()};Ou.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()};Ou.load=function(){var e=this;var t=e.cy.window();var r=function e(t){return t.selected()};var n=function t(r,n,a,i){if(r==null){r=e.cy}for(var o=0;o<n.length;o++){var s=n[o];r.emit({originalEvent:a,type:s,position:i})}};var a=function e(t){return t.shiftKey||t.metaKey||t.ctrlKey};var i=function t(r,n){var a=true;if(e.cy.hasCompoundNodes()&&r&&r.pannable()){for(var i=0;n&&i<n.length;i++){var r=n[i];if(r.isNode()&&r.isParent()&&!r.pannable()){a=false;break}}}else{a=true}return a};var o=function e(t){t[0]._private.grabbed=true};var s=function e(t){t[0]._private.grabbed=false};var u=function e(t){t[0]._private.rscratch.inDragLayer=true};var f=function e(t){t[0]._private.rscratch.inDragLayer=false};var v=function e(t){t[0]._private.rscratch.isGrabTarget=true};var c=function e(t){t[0]._private.rscratch.isGrabTarget=false};var d=function e(t,r){var n=r.addToList;var a=n.has(t);if(!a&&t.grabbable()&&!t.locked()){n.merge(t);o(t)}};var h=function e(t,r){if(!t.cy().hasCompoundNodes()){return}if(r.inDragLayer==null&&r.addToList==null){return}var n=t.descendants();if(r.inDragLayer){n.forEach(u);n.connectedEdges().forEach(u)}if(r.addToList){d(n,r)}};var p=function t(r,n){n=n||{};var a=r.cy().hasCompoundNodes();if(n.inDragLayer){r.forEach(u);r.neighborhood().stdFilter((function(e){return!a||e.isEdge()})).forEach(u)}if(n.addToList){r.forEach((function(e){d(e,n)}))}h(r,n);m(r,{inDragLayer:n.inDragLayer});e.updateCachedGrabbedEles()};var g=p;var y=function t(r){if(!r){return}e.getCachedZSortedEles().forEach((function(e){s(e);f(e);c(e)}));e.updateCachedGrabbedEles()};var m=function e(t,r){if(r.inDragLayer==null&&r.addToList==null){return}if(!t.cy().hasCompoundNodes()){return}var n=t.ancestors().orphans();if(n.same(t)){return}var a=n.descendants().spawnSelf().merge(n).unmerge(t).unmerge(t.descendants());var i=a.connectedEdges();if(r.inDragLayer){i.forEach(u);a.forEach(u)}if(r.addToList){a.forEach((function(e){d(e,r)}))}};var b=function e(){if(document.activeElement!=null&&document.activeElement.blur!=null){document.activeElement.blur()}};var x=typeof MutationObserver!=="undefined";var w=typeof ResizeObserver!=="undefined";if(x){e.removeObserver=new MutationObserver((function(t){for(var r=0;r<t.length;r++){var n=t[r];var a=n.removedNodes;if(a){for(var i=0;i<a.length;i++){var o=a[i];if(o===e.container){e.destroy();break}}}}}));if(e.container.parentNode){e.removeObserver.observe(e.container.parentNode,{childList:true})}}else{e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}))}var E=l["default"]((function(){e.cy.resize()}),100);if(x){e.styleObserver=new MutationObserver(E);e.styleObserver.observe(e.container,{attributes:true})}e.registerBinding(t,"resize",E);if(w){e.resizeObserver=new ResizeObserver(E);e.resizeObserver.observe(e.container)}var k=function e(t,r){while(t!=null){r(t);t=t.parentNode}};var _=function t(){e.invalidateContainerClientCoordsCache()};k(e.container,(function(t){e.registerBinding(t,"transitionend",_);e.registerBinding(t,"animationend",_);e.registerBinding(t,"scroll",_)}));e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var S=function t(){return e.selection[4]!==0};var D=function t(r){var n=e.findContainerClientCoords();var a=n[0];var i=n[1];var o=n[2];var s=n[3];var u=r.touches?r.touches:[r];var l=false;for(var f=0;f<u.length;f++){var v=u[f];if(a<=v.clientX&&v.clientX<=a+o&&i<=v.clientY&&v.clientY<=i+s){l=true;break}}if(!l){return false}var c=e.container;var d=r.target;var h=d.parentNode;var p=false;while(h){if(h===c){p=true;break}h=h.parentNode}if(!p){return false}return true};e.registerBinding(e.container,"mousedown",(function t(r){if(!D(r)){return}r.preventDefault();b();e.hoverData.capture=true;e.hoverData.which=r.which;var a=e.cy;var i=[r.clientX,r.clientY];var o=e.projectIntoViewport(i[0],i[1]);var s=e.selection;var u=e.findNearestElements(o[0],o[1],true,false);var l=u[0];var f=e.dragData.possibleDragElements;e.hoverData.mdownPos=o;e.hoverData.mdownGPos=i;var c=function t(){e.hoverData.tapholdCancelled=false;clearTimeout(e.hoverData.tapholdTimeout);e.hoverData.tapholdTimeout=setTimeout((function(){if(e.hoverData.tapholdCancelled){return}else{var t=e.hoverData.down;if(t){t.emit({originalEvent:r,type:"taphold",position:{x:o[0],y:o[1]}})}else{a.emit({originalEvent:r,type:"taphold",position:{x:o[0],y:o[1]}})}}}),e.tapholdDuration)};if(r.which==3){e.hoverData.cxtStarted=true;var d={originalEvent:r,type:"cxttapstart",position:{x:o[0],y:o[1]}};if(l){l.activate();l.emit(d);e.hoverData.down=l}else{a.emit(d)}e.hoverData.downTime=(new Date).getTime();e.hoverData.cxtDragged=false}else if(r.which==1){if(l){l.activate()}{if(l!=null){if(e.nodeIsGrabbable(l)){var h=function e(t){return{originalEvent:r,type:t,position:{x:o[0],y:o[1]}}};var y=function e(t){t.emit(h("grab"))};v(l);if(!l.selected()){f=e.dragData.possibleDragElements=a.collection();g(l,{addToList:f});l.emit(h("grabon")).emit(h("grab"))}else{f=e.dragData.possibleDragElements=a.collection();var m=a.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));p(m,{addToList:f});l.emit(h("grabon"));m.forEach(y)}e.redrawHint("eles",true);e.redrawHint("drag",true)}}e.hoverData.down=l;e.hoverData.downs=u;e.hoverData.downTime=(new Date).getTime()}n(l,["mousedown","tapstart","vmousedown"],r,{x:o[0],y:o[1]});if(l==null){s[4]=1;e.data.bgActivePosistion={x:o[0],y:o[1]};e.redrawHint("select",true);e.redraw()}else if(l.pannable()){s[4]=1}c()}s[0]=s[2]=o[0];s[1]=s[3]=o[1]}),false);e.registerBinding(t,"mousemove",(function t(r){var o=e.hoverData.capture;if(!o&&!D(r)){return}var s=false;var u=e.cy;var l=u.zoom();var f=[r.clientX,r.clientY];var v=e.projectIntoViewport(f[0],f[1]);var c=e.hoverData.mdownPos;var d=e.hoverData.mdownGPos;var h=e.selection;var g=null;if(!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting){g=e.findNearestElement(v[0],v[1],true,false)}var m=e.hoverData.last;var b=e.hoverData.down;var x=[v[0]-h[2],v[1]-h[3]];var w=e.dragData.possibleDragElements;var E;if(d){var k=f[0]-d[0];var _=k*k;var S=f[1]-d[1];var C=S*S;var T=_+C;e.hoverData.isOverThresholdDrag=E=T>=e.desktopTapThreshold2}var P=a(r);if(E){e.hoverData.tapholdCancelled=true}var M=function t(){var r=e.hoverData.dragDelta=e.hoverData.dragDelta||[];if(r.length===0){r.push(x[0]);r.push(x[1])}else{r[0]+=x[0];r[1]+=x[1]}};s=true;n(g,["mousemove","vmousemove","tapdrag"],r,{x:v[0],y:v[1]});var I=function t(){e.data.bgActivePosistion=undefined;if(!e.hoverData.selecting){u.emit({originalEvent:r,type:"boxstart",position:{x:v[0],y:v[1]}})}h[4]=1;e.hoverData.selecting=true;e.redrawHint("select",true);e.redraw()};if(e.hoverData.which===3){if(E){var O={originalEvent:r,type:"cxtdrag",position:{x:v[0],y:v[1]}};if(b){b.emit(O)}else{u.emit(O)}e.hoverData.cxtDragged=true;if(!e.hoverData.cxtOver||g!==e.hoverData.cxtOver){if(e.hoverData.cxtOver){e.hoverData.cxtOver.emit({originalEvent:r,type:"cxtdragout",position:{x:v[0],y:v[1]}})}e.hoverData.cxtOver=g;if(g){g.emit({originalEvent:r,type:"cxtdragover",position:{x:v[0],y:v[1]}})}}}}else if(e.hoverData.dragging){s=true;if(u.panningEnabled()&&u.userPanningEnabled()){var N;if(e.hoverData.justStartedPan){var z=e.hoverData.mdownPos;N={x:(v[0]-z[0])*l,y:(v[1]-z[1])*l};e.hoverData.justStartedPan=false}else{N={x:x[0]*l,y:x[1]*l}}u.panBy(N);u.emit("dragpan");e.hoverData.dragged=true}v=e.projectIntoViewport(r.clientX,r.clientY)}else if(h[4]==1&&(b==null||b.pannable())){if(E){if(!e.hoverData.dragging&&u.boxSelectionEnabled()&&(P||!u.panningEnabled()||!u.userPanningEnabled())){I()}else if(!e.hoverData.selecting&&u.panningEnabled()&&u.userPanningEnabled()){var L=i(b,e.hoverData.downs);if(L){e.hoverData.dragging=true;e.hoverData.justStartedPan=true;h[4]=0;e.data.bgActivePosistion=It(c);e.redrawHint("select",true);e.redraw()}}if(b&&b.pannable()&&b.active()){b.unactivate()}}}else{if(b&&b.pannable()&&b.active()){b.unactivate()}if((!b||!b.grabbed())&&g!=m){if(m){n(m,["mouseout","tapdragout"],r,{x:v[0],y:v[1]})}if(g){n(g,["mouseover","tapdragover"],r,{x:v[0],y:v[1]})}e.hoverData.last=g}if(b){if(E){if(u.boxSelectionEnabled()&&P){if(b&&b.grabbed()){y(w);b.emit("freeon");w.emit("free");if(e.dragData.didDrag){b.emit("dragfreeon");w.emit("dragfree")}}I()}else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var A=!e.dragData.didDrag;if(A){e.redrawHint("eles",true)}e.dragData.didDrag=true;if(!e.hoverData.draggingEles){p(w,{inDragLayer:true})}var R={x:0,y:0};if(B(x[0])&&B(x[1])){R.x+=x[0];R.y+=x[1];if(A){var j=e.hoverData.dragDelta;if(j&&B(j[0])&&B(j[1])){R.x+=j[0];R.y+=j[1]}}}e.hoverData.draggingEles=true;w.silentShift(R).emit("position drag");e.redrawHint("drag",true);e.redraw()}}else{M()}}s=true}h[2]=v[0];h[3]=v[1];if(s){if(r.stopPropagation)r.stopPropagation();if(r.preventDefault)r.preventDefault();return false}}),false);var C,T,P;e.registerBinding(t,"mouseup",(function t(i){var o=e.hoverData.capture;if(!o){return}e.hoverData.capture=false;var s=e.cy;var u=e.projectIntoViewport(i.clientX,i.clientY);var l=e.selection;var f=e.findNearestElement(u[0],u[1],true,false);var v=e.dragData.possibleDragElements;var c=e.hoverData.down;var d=a(i);if(e.data.bgActivePosistion){e.redrawHint("select",true);e.redraw()}e.hoverData.tapholdCancelled=true;e.data.bgActivePosistion=undefined;if(c){c.unactivate()}if(e.hoverData.which===3){var h={originalEvent:i,type:"cxttapend",position:{x:u[0],y:u[1]}};if(c){c.emit(h)}else{s.emit(h)}if(!e.hoverData.cxtDragged){var p={originalEvent:i,type:"cxttap",position:{x:u[0],y:u[1]}};if(c){c.emit(p)}else{s.emit(p)}}e.hoverData.cxtDragged=false;e.hoverData.which=null}else if(e.hoverData.which===1){n(f,["mouseup","tapend","vmouseup"],i,{x:u[0],y:u[1]});if(!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag){n(c,["click","tap","vclick"],i,{x:u[0],y:u[1]});T=false;if(i.timeStamp-P<=s.multiClickDebounceTime()){C&&clearTimeout(C);T=true;P=null;n(c,["dblclick","dbltap","vdblclick"],i,{x:u[0],y:u[1]})}else{C=setTimeout((function(){if(T)return;n(c,["oneclick","onetap","voneclick"],i,{x:u[0],y:u[1]})}),s.multiClickDebounceTime());P=i.timeStamp}}if(c==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!a(i)){s.$(r).unselect(["tapunselect"]);if(v.length>0){e.redrawHint("eles",true)}e.dragData.possibleDragElements=v=s.collection()}if(f==c&&!e.dragData.didDrag&&!e.hoverData.selecting){if(f!=null&&f._private.selectable){if(e.hoverData.dragging);else if(s.selectionType()==="additive"||d){if(f.selected()){f.unselect(["tapunselect"])}else{f.select(["tapselect"])}}else{if(!d){s.$(r).unmerge(f).unselect(["tapunselect"]);f.select(["tapselect"])}}e.redrawHint("eles",true)}}if(e.hoverData.selecting){var g=s.collection(e.getAllInBox(l[0],l[1],l[2],l[3]));e.redrawHint("select",true);if(g.length>0){e.redrawHint("eles",true)}s.emit({type:"boxend",originalEvent:i,position:{x:u[0],y:u[1]}});var m=function e(t){return t.selectable()&&!t.selected()};if(s.selectionType()==="additive"){g.emit("box").stdFilter(m).select().emit("boxselect")}else{if(!d){s.$(r).unmerge(g).unselect()}g.emit("box").stdFilter(m).select().emit("boxselect")}e.redraw()}if(e.hoverData.dragging){e.hoverData.dragging=false;e.redrawHint("select",true);e.redrawHint("eles",true);e.redraw()}if(!l[4]){e.redrawHint("drag",true);e.redrawHint("eles",true);var b=c&&c.grabbed();y(v);if(b){c.emit("freeon");v.emit("free");if(e.dragData.didDrag){c.emit("dragfreeon");v.emit("dragfree")}}}}l[4]=0;e.hoverData.down=null;e.hoverData.cxtStarted=false;e.hoverData.draggingEles=false;e.hoverData.selecting=false;e.hoverData.isOverThresholdDrag=false;e.dragData.didDrag=false;e.hoverData.dragged=false;e.hoverData.dragDelta=[];e.hoverData.mdownPos=null;e.hoverData.mdownGPos=null}),false);var M=function t(r){if(e.scrollingPage){return}var n=e.cy;var a=n.zoom();var i=n.pan();var o=e.projectIntoViewport(r.clientX,r.clientY);var s=[o[0]*a+i.x,o[1]*a+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||S()){r.preventDefault();return}if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){r.preventDefault();e.data.wheelZooming=true;clearTimeout(e.data.wheelTimeout);e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=false;e.redrawHint("eles",true);e.redraw()}),150);var u;if(r.deltaY!=null){u=r.deltaY/-250}else if(r.wheelDeltaY!=null){u=r.wheelDeltaY/1e3}else{u=r.wheelDelta/1e3}u=u*e.wheelSensitivity;var l=r.deltaMode===1;if(l){u*=33}var f=n.zoom()*Math.pow(10,u);if(r.type==="gesturechange"){f=e.gestureStartZoom*r.scale}n.zoom({level:f,renderedPosition:{x:s[0],y:s[1]}});n.emit(r.type==="gesturechange"?"pinchzoom":"scrollzoom")}};e.registerBinding(e.container,"wheel",M,true);e.registerBinding(t,"scroll",(function t(r){e.scrollingPage=true;clearTimeout(e.scrollingPageTimeout);e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=false}),250)}),true);e.registerBinding(e.container,"gesturestart",(function t(r){e.gestureStartZoom=e.cy.zoom();if(!e.hasTouchStarted){r.preventDefault()}}),true);e.registerBinding(e.container,"gesturechange",(function(t){if(!e.hasTouchStarted){M(t)}}),true);e.registerBinding(e.container,"mouseout",(function t(r){var n=e.projectIntoViewport(r.clientX,r.clientY);e.cy.emit({originalEvent:r,type:"mouseout",position:{x:n[0],y:n[1]}})}),false);e.registerBinding(e.container,"mouseover",(function t(r){var n=e.projectIntoViewport(r.clientX,r.clientY);e.cy.emit({originalEvent:r,type:"mouseover",position:{x:n[0],y:n[1]}})}),false);var I,O,N,z;var L,A;var R,j;var F,V;var q,G;var Y;var W=function e(t,r,n,a){return Math.sqrt((n-t)*(n-t)+(a-r)*(a-r))};var X=function e(t,r,n,a){return(n-t)*(n-t)+(a-r)*(a-r)};var H;e.registerBinding(e.container,"touchstart",H=function t(r){e.hasTouchStarted=true;if(!D(r)){return}b();e.touchData.capture=true;e.data.bgActivePosistion=undefined;var a=e.cy;var i=e.touchData.now;var o=e.touchData.earlier;if(r.touches[0]){var s=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);i[0]=s[0];i[1]=s[1]}if(r.touches[1]){var s=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);i[2]=s[0];i[3]=s[1]}if(r.touches[2]){var s=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);i[4]=s[0];i[5]=s[1]}if(r.touches[1]){e.touchData.singleTouchMoved=true;y(e.dragData.touchDragEles);var u=e.findContainerClientCoords();F=u[0];V=u[1];q=u[2];G=u[3];I=r.touches[0].clientX-F;O=r.touches[0].clientY-V;N=r.touches[1].clientX-F;z=r.touches[1].clientY-V;Y=0<=I&&I<=q&&0<=N&&N<=q&&0<=O&&O<=G&&0<=z&&z<=G;var l=a.pan();var f=a.zoom();L=W(I,O,N,z);A=X(I,O,N,z);R=[(I+N)/2,(O+z)/2];j=[(R[0]-l.x)/f,(R[1]-l.y)/f];var c=200;var d=c*c;if(A<d&&!r.touches[2]){var h=e.findNearestElement(i[0],i[1],true,true);var m=e.findNearestElement(i[2],i[3],true,true);if(h&&h.isNode()){h.activate().emit({originalEvent:r,type:"cxttapstart",position:{x:i[0],y:i[1]}});e.touchData.start=h}else if(m&&m.isNode()){m.activate().emit({originalEvent:r,type:"cxttapstart",position:{x:i[0],y:i[1]}});e.touchData.start=m}else{a.emit({originalEvent:r,type:"cxttapstart",position:{x:i[0],y:i[1]}})}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxt=true;e.touchData.cxtDragged=false;e.data.bgActivePosistion=undefined;e.redraw();return}}if(r.touches[2]){if(a.boxSelectionEnabled()){r.preventDefault()}}else if(r.touches[1]);else if(r.touches[0]){var x=e.findNearestElements(i[0],i[1],true,true);var w=x[0];if(w!=null){w.activate();e.touchData.start=w;e.touchData.starts=x;if(e.nodeIsGrabbable(w)){var E=e.dragData.touchDragEles=a.collection();var k=null;e.redrawHint("eles",true);e.redrawHint("drag",true);if(w.selected()){k=a.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)}));p(k,{addToList:E})}else{g(w,{addToList:E})}v(w);var _=function e(t){return{originalEvent:r,type:t,position:{x:i[0],y:i[1]}}};w.emit(_("grabon"));if(k){k.forEach((function(e){e.emit(_("grab"))}))}else{w.emit(_("grab"))}}}n(w,["touchstart","tapstart","vmousedown"],r,{x:i[0],y:i[1]});if(w==null){e.data.bgActivePosistion={x:s[0],y:s[1]};e.redrawHint("select",true);e.redraw()}e.touchData.singleTouchMoved=false;e.touchData.singleTouchStartTime=+new Date;clearTimeout(e.touchData.tapholdTimeout);e.touchData.tapholdTimeout=setTimeout((function(){if(e.touchData.singleTouchMoved===false&&!e.pinching&&!e.touchData.selecting){n(e.touchData.start,["taphold"],r,{x:i[0],y:i[1]})}}),e.tapholdDuration)}if(r.touches.length>=1){var S=e.touchData.startPosition=[null,null,null,null,null,null];for(var C=0;C<i.length;C++){S[C]=o[C]=i[C]}var T=r.touches[0];e.touchData.startGPosition=[T.clientX,T.clientY]}},false);var U;e.registerBinding(window,"touchmove",U=function t(r){var a=e.touchData.capture;if(!a&&!D(r)){return}var o=e.selection;var s=e.cy;var u=e.touchData.now;var l=e.touchData.earlier;var f=s.zoom();if(r.touches[0]){var v=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);u[0]=v[0];u[1]=v[1]}if(r.touches[1]){var v=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);u[2]=v[0];u[3]=v[1]}if(r.touches[2]){var v=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);u[4]=v[0];u[5]=v[1]}var c=e.touchData.startGPosition;var d;if(a&&r.touches[0]&&c){var h=[];for(var g=0;g<u.length;g++){h[g]=u[g]-l[g]}var m=r.touches[0].clientX-c[0];var b=m*m;var x=r.touches[0].clientY-c[1];var w=x*x;var E=b+w;d=E>=e.touchTapThreshold2}if(a&&e.touchData.cxt){r.preventDefault();var k=r.touches[0].clientX-F,_=r.touches[0].clientY-V;var S=r.touches[1].clientX-F,C=r.touches[1].clientY-V;var T=X(k,_,S,C);var P=T/A;var M=150;var R=M*M;var q=1.5;var G=q*q;if(P>=G||T>=R){e.touchData.cxt=false;e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var H={originalEvent:r,type:"cxttapend",position:{x:u[0],y:u[1]}};if(e.touchData.start){e.touchData.start.unactivate().emit(H);e.touchData.start=null}else{s.emit(H)}}}if(a&&e.touchData.cxt){var H={originalEvent:r,type:"cxtdrag",position:{x:u[0],y:u[1]}};e.data.bgActivePosistion=undefined;e.redrawHint("select",true);if(e.touchData.start){e.touchData.start.emit(H)}else{s.emit(H)}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxtDragged=true;var U=e.findNearestElement(u[0],u[1],true,true);if(!e.touchData.cxtOver||U!==e.touchData.cxtOver){if(e.touchData.cxtOver){e.touchData.cxtOver.emit({originalEvent:r,type:"cxtdragout",position:{x:u[0],y:u[1]}})}e.touchData.cxtOver=U;if(U){U.emit({originalEvent:r,type:"cxtdragover",position:{x:u[0],y:u[1]}})}}}else if(a&&r.touches[2]&&s.boxSelectionEnabled()){r.preventDefault();e.data.bgActivePosistion=undefined;this.lastThreeTouch=+new Date;if(!e.touchData.selecting){s.emit({originalEvent:r,type:"boxstart",position:{x:u[0],y:u[1]}})}e.touchData.selecting=true;e.touchData.didSelect=true;o[4]=1;if(!o||o.length===0||o[0]===undefined){o[0]=(u[0]+u[2]+u[4])/3;o[1]=(u[1]+u[3]+u[5])/3;o[2]=(u[0]+u[2]+u[4])/3+1;o[3]=(u[1]+u[3]+u[5])/3+1}else{o[2]=(u[0]+u[2]+u[4])/3;o[3]=(u[1]+u[3]+u[5])/3}e.redrawHint("select",true);e.redraw()}else if(a&&r.touches[1]&&!e.touchData.didSelect&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){r.preventDefault();e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var K=e.dragData.touchDragEles;if(K){e.redrawHint("drag",true);for(var Z=0;Z<K.length;Z++){var $=K[Z]._private;$.grabbed=false;$.rscratch.inDragLayer=false}}var Q=e.touchData.start;var k=r.touches[0].clientX-F,_=r.touches[0].clientY-V;var S=r.touches[1].clientX-F,C=r.touches[1].clientY-V;var J=W(k,_,S,C);var ee=J/L;if(Y){var te=k-I;var re=_-O;var ne=S-N;var ae=C-z;var ie=(te+ne)/2;var oe=(re+ae)/2;var se=s.zoom();var ue=se*ee;var le=s.pan();var fe=j[0]*se+le.x;var ve=j[1]*se+le.y;var ce={x:-ue/se*(fe-le.x-ie)+fe,y:-ue/se*(ve-le.y-oe)+ve};if(Q&&Q.active()){var K=e.dragData.touchDragEles;y(K);e.redrawHint("drag",true);e.redrawHint("eles",true);Q.unactivate().emit("freeon");K.emit("free");if(e.dragData.didDrag){Q.emit("dragfreeon");K.emit("dragfree")}}s.viewport({zoom:ue,pan:ce,cancelOnFailedZoom:true});s.emit("pinchzoom");L=J;I=k;O=_;N=S;z=C;e.pinching=true}if(r.touches[0]){var v=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);u[0]=v[0];u[1]=v[1]}if(r.touches[1]){var v=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);u[2]=v[0];u[3]=v[1]}if(r.touches[2]){var v=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);u[4]=v[0];u[5]=v[1]}}else if(r.touches[0]&&!e.touchData.didSelect){var de=e.touchData.start;var he=e.touchData.last;var U;if(!e.hoverData.draggingEles&&!e.swipePanning){U=e.findNearestElement(u[0],u[1],true,true)}if(a&&de!=null){r.preventDefault()}if(a&&de!=null&&e.nodeIsDraggable(de)){if(d){var K=e.dragData.touchDragEles;var pe=!e.dragData.didDrag;if(pe){p(K,{inDragLayer:true})}e.dragData.didDrag=true;var ge={x:0,y:0};if(B(h[0])&&B(h[1])){ge.x+=h[0];ge.y+=h[1];if(pe){e.redrawHint("eles",true);var ye=e.touchData.dragDelta;if(ye&&B(ye[0])&&B(ye[1])){ge.x+=ye[0];ge.y+=ye[1]}}}e.hoverData.draggingEles=true;K.silentShift(ge).emit("position drag");e.redrawHint("drag",true);if(e.touchData.startPosition[0]==l[0]&&e.touchData.startPosition[1]==l[1]){e.redrawHint("eles",true)}e.redraw()}else{var ye=e.touchData.dragDelta=e.touchData.dragDelta||[];if(ye.length===0){ye.push(h[0]);ye.push(h[1])}else{ye[0]+=h[0];ye[1]+=h[1]}}}{n(de||U,["touchmove","tapdrag","vmousemove"],r,{x:u[0],y:u[1]});if((!de||!de.grabbed())&&U!=he){if(he){he.emit({originalEvent:r,type:"tapdragout",position:{x:u[0],y:u[1]}})}if(U){U.emit({originalEvent:r,type:"tapdragover",position:{x:u[0],y:u[1]}})}}e.touchData.last=U}if(a){for(var Z=0;Z<u.length;Z++){if(u[Z]&&e.touchData.startPosition[Z]&&d){e.touchData.singleTouchMoved=true}}}if(a&&(de==null||de.pannable())&&s.panningEnabled()&&s.userPanningEnabled()){var me=i(de,e.touchData.starts);if(me){r.preventDefault();if(!e.data.bgActivePosistion){e.data.bgActivePosistion=It(e.touchData.startPosition)}if(e.swipePanning){s.panBy({x:h[0]*f,y:h[1]*f});s.emit("dragpan")}else if(d){e.swipePanning=true;s.panBy({x:m*f,y:x*f});s.emit("dragpan");if(de){de.unactivate();e.redrawHint("select",true);e.touchData.start=null}}}var v=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);u[0]=v[0];u[1]=v[1]}}for(var g=0;g<u.length;g++){l[g]=u[g]}if(a&&r.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null){e.data.bgActivePosistion=undefined;e.redrawHint("select",true);e.redraw()}},false);var K;e.registerBinding(t,"touchcancel",K=function t(r){var n=e.touchData.start;e.touchData.capture=false;if(n){n.unactivate()}});var Z,$,Q,J;e.registerBinding(t,"touchend",Z=function t(a){var i=e.touchData.start;var o=e.touchData.capture;if(o){if(a.touches.length===0){e.touchData.capture=false}a.preventDefault()}else{return}var s=e.selection;e.swipePanning=false;e.hoverData.draggingEles=false;var u=e.cy;var l=u.zoom();var f=e.touchData.now;var v=e.touchData.earlier;if(a.touches[0]){var c=e.projectIntoViewport(a.touches[0].clientX,a.touches[0].clientY);f[0]=c[0];f[1]=c[1]}if(a.touches[1]){var c=e.projectIntoViewport(a.touches[1].clientX,a.touches[1].clientY);f[2]=c[0];f[3]=c[1]}if(a.touches[2]){var c=e.projectIntoViewport(a.touches[2].clientX,a.touches[2].clientY);f[4]=c[0];f[5]=c[1]}if(i){i.unactivate()}var d;if(e.touchData.cxt){d={originalEvent:a,type:"cxttapend",position:{x:f[0],y:f[1]}};if(i){i.emit(d)}else{u.emit(d)}if(!e.touchData.cxtDragged){var h={originalEvent:a,type:"cxttap",position:{x:f[0],y:f[1]}};if(i){i.emit(h)}else{u.emit(h)}}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxt=false;e.touchData.start=null;e.redraw();return}if(!a.touches[2]&&u.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=false;var p=u.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));s[0]=undefined;s[1]=undefined;s[2]=undefined;s[3]=undefined;s[4]=0;e.redrawHint("select",true);u.emit({type:"boxend",originalEvent:a,position:{x:f[0],y:f[1]}});var g=function e(t){return t.selectable()&&!t.selected()};p.emit("box").stdFilter(g).select().emit("boxselect");if(p.nonempty()){e.redrawHint("eles",true)}e.redraw()}if(i!=null){i.unactivate()}if(a.touches[2]){e.data.bgActivePosistion=undefined;e.redrawHint("select",true)}else if(a.touches[1]);else if(a.touches[0]);else if(!a.touches[0]){e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var m=e.dragData.touchDragEles;if(i!=null){var b=i._private.grabbed;y(m);e.redrawHint("drag",true);e.redrawHint("eles",true);if(b){i.emit("freeon");m.emit("free");if(e.dragData.didDrag){i.emit("dragfreeon");m.emit("dragfree")}}n(i,["touchend","tapend","vmouseup","tapdragout"],a,{x:f[0],y:f[1]});i.unactivate();e.touchData.start=null}else{var x=e.findNearestElement(f[0],f[1],true,true);n(x,["touchend","tapend","vmouseup","tapdragout"],a,{x:f[0],y:f[1]})}var w=e.touchData.startPosition[0]-f[0];var E=w*w;var k=e.touchData.startPosition[1]-f[1];var _=k*k;var S=E+_;var D=S*l*l;if(!e.touchData.singleTouchMoved){if(!i){u.$(":selected").unselect(["tapunselect"])}n(i,["tap","vclick"],a,{x:f[0],y:f[1]});$=false;if(a.timeStamp-J<=u.multiClickDebounceTime()){Q&&clearTimeout(Q);$=true;J=null;n(i,["dbltap","vdblclick"],a,{x:f[0],y:f[1]})}else{Q=setTimeout((function(){if($)return;n(i,["onetap","voneclick"],a,{x:f[0],y:f[1]})}),u.multiClickDebounceTime());J=a.timeStamp}}if(i!=null&&!e.dragData.didDrag&&i._private.selectable&&D<e.touchTapThreshold2&&!e.pinching){if(u.selectionType()==="single"){u.$(r).unmerge(i).unselect(["tapunselect"]);i.select(["tapselect"])}else{if(i.selected()){i.unselect(["tapunselect"])}else{i.select(["tapselect"])}}e.redrawHint("eles",true)}e.touchData.singleTouchMoved=true}for(var C=0;C<f.length;C++){v[C]=f[C]}e.dragData.didDrag=false;if(a.touches.length===0){e.touchData.dragDelta=[];e.touchData.startPosition=[null,null,null,null,null,null];e.touchData.startGPosition=null;e.touchData.didSelect=false}if(a.touches.length<2){if(a.touches.length===1){e.touchData.startGPosition=[a.touches[0].clientX,a.touches[0].clientY]}e.pinching=false;e.redrawHint("eles",true);e.redraw()}},false);if(typeof TouchEvent==="undefined"){var ee=[];var te=function e(t){return{clientX:t.clientX,clientY:t.clientY,force:1,identifier:t.pointerId,pageX:t.pageX,pageY:t.pageY,radiusX:t.width/2,radiusY:t.height/2,screenX:t.screenX,screenY:t.screenY,target:t.target}};var re=function e(t){return{event:t,touch:te(t)}};var ne=function e(t){ee.push(re(t))};var ae=function e(t){for(var r=0;r<ee.length;r++){var n=ee[r];if(n.event.pointerId===t.pointerId){ee.splice(r,1);return}}};var ie=function e(t){var r=ee.filter((function(e){return e.event.pointerId===t.pointerId}))[0];r.event=t;r.touch=te(t)};var oe=function e(t){t.touches=ee.map((function(e){return e.touch}))};var se=function e(t){return t.pointerType==="mouse"||t.pointerType===4};e.registerBinding(e.container,"pointerdown",(function(e){if(se(e)){return}e.preventDefault();ne(e);oe(e);H(e)}));e.registerBinding(e.container,"pointerup",(function(e){if(se(e)){return}ae(e);oe(e);Z(e)}));e.registerBinding(e.container,"pointercancel",(function(e){if(se(e)){return}ae(e);oe(e);K(e)}));e.registerBinding(e.container,"pointermove",(function(e){if(se(e)){return}e.preventDefault();ie(e);oe(e);U(e)}))}};var Nu={};Nu.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl("polygon",t,r,n,a,i,this.points)},intersectLine:function e(t,r,n,a,i,o,s){return kr(i,o,this.points,t,r,n/2,a/2,s)},checkPoint:function e(t,r,n,a,i,o,s){return hr(t,r,this.points,o,s,a,i,[0,-1],n)}}};Nu.generateEllipse=function(){return this.nodeShapes["ellipse"]={renderer:this,name:"ellipse",draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},intersectLine:function e(t,r,n,a,i,o,s){return mr(i,o,t,r,n/2+s,a/2+s)},checkPoint:function e(t,r,n,a,i,o,s){return br(t,r,a,i,o,s,n)}}};Nu.generateRoundPolygon=function(e,t){var r=new Array(t.length*2);for(var n=0;n<t.length/2;n++){var a=n*2;var i=void 0;if(n<t.length/2-1){i=(n+1)*2}else{i=0}r[n*4]=t[a];r[n*4+1]=t[a+1];var o=t[i]-t[a];var s=t[i+1]-t[a+1];var u=Math.sqrt(o*o+s*s);r[n*4+2]=o/u;r[n*4+3]=s/u}return this.nodeShapes[e]={renderer:this,name:e,points:r,draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl("round-polygon",t,r,n,a,i,this.points)},intersectLine:function e(t,r,n,a,i,o,s){return _r(i,o,this.points,t,r,n,a)},checkPoint:function e(t,r,n,a,i,o,s){return pr(t,r,this.points,o,s,a,i)}}};Nu.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes["roundrectangle"]={renderer:this,name:"round-rectangle",points:Dr(4,0),draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},intersectLine:function e(t,r,n,a,i,o,s){return or(i,o,t,r,n,a,s)},checkPoint:function e(t,r,n,a,i,o,s){var u=Pr(a,i);var l=u*2;if(hr(t,r,this.points,o,s,a,i-l,[0,-1],n)){return true}if(hr(t,r,this.points,o,s,a-l,i,[0,-1],n)){return true}if(br(t,r,l,l,o-a/2+u,s-i/2+u,n)){return true}if(br(t,r,l,l,o+a/2-u,s-i/2+u,n)){return true}if(br(t,r,l,l,o+a/2-u,s+i/2-u,n)){return true}if(br(t,r,l,l,o-a/2+u,s+i/2-u,n)){return true}return false}}};Nu.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes["cutrectangle"]={renderer:this,name:"cut-rectangle",cornerLength:Ir(),points:Dr(4,0),draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},generateCutTrianglePts:function e(t,r,n,a){var i=this.cornerLength;var o=r/2;var s=t/2;var u=n-s;var l=n+s;var f=a-o;var v=a+o;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,v-i,l-i,v,l-i,v-i],bottomLeft:[u+i,v,u,v-i,u+i,v-i]}},intersectLine:function e(t,r,n,a,i,o,s){var u=this.generateCutTrianglePts(n+2*s,a+2*s,t,r);var l=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return kr(i,o,l,t,r)},checkPoint:function e(t,r,n,a,i,o,s){if(hr(t,r,this.points,o,s,a,i-2*this.cornerLength,[0,-1],n)){return true}if(hr(t,r,this.points,o,s,a-2*this.cornerLength,i,[0,-1],n)){return true}var u=this.generateCutTrianglePts(a,i,o,s);return dr(t,r,u.topLeft)||dr(t,r,u.topRight)||dr(t,r,u.bottomRight)||dr(t,r,u.bottomLeft)}}};Nu.generateBarrel=function(){return this.nodeShapes["barrel"]={renderer:this,name:"barrel",points:Dr(4,0),draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},intersectLine:function e(t,r,n,a,i,o,s){var u=.15;var l=.5;var f=.85;var v=this.generateBarrelBezierPts(n+2*s,a+2*s,t,r);var c=function e(t){var r=Yt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},u);var n=Yt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},l);var a=Yt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},f);return[t[0],t[1],r.x,r.y,n.x,n.y,a.x,a.y,t[4],t[5]]};var d=[].concat(c(v.topLeft),c(v.topRight),c(v.bottomRight),c(v.bottomLeft));return kr(i,o,d,t,r)},generateBarrelBezierPts:function e(t,r,n,a){var i=r/2;var o=t/2;var s=n-o;var u=n+o;var l=a-i;var f=a+i;var v=Nr(t,r);var c=v.heightOffset;var d=v.widthOffset;var h=v.ctrlPtOffsetPct*t;var p={topLeft:[s,l+c,s+h,l,s+d,l],topRight:[u-d,l,u-h,l,u,l+c],bottomRight:[u,f-c,u-h,f,u-d,f],bottomLeft:[s+d,f,s+h,f,s,f-c]};p.topLeft.isTop=true;p.topRight.isTop=true;p.bottomLeft.isBottom=true;p.bottomRight.isBottom=true;return p},checkPoint:function e(t,r,n,a,i,o,s){var u=Nr(a,i);var l=u.heightOffset;var f=u.widthOffset;if(hr(t,r,this.points,o,s,a,i-2*l,[0,-1],n)){return true}if(hr(t,r,this.points,o,s,a-2*f,i,[0,-1],n)){return true}var v=this.generateBarrelBezierPts(a,i,o,s);var c=function e(t,r,n){var a=n[4];var i=n[2];var o=n[0];var s=n[5];var u=n[1];var l=Math.min(a,o);var f=Math.max(a,o);var v=Math.min(s,u);var c=Math.max(s,u);if(l<=t&&t<=f&&v<=r&&r<=c){var d=Or(a,i,o);var h=lr(d[0],d[1],d[2],t);var p=h.filter((function(e){return 0<=e&&e<=1}));if(p.length>0){return p[0]}}return null};var d=Object.keys(v);for(var h=0;h<d.length;h++){var p=d[h];var g=v[p];var y=c(t,r,g);if(y==null){continue}var m=g[5];var b=g[3];var x=g[1];var w=Gt(m,b,x,y);if(g.isTop&&w<=r){return true}if(g.isBottom&&r<=w){return true}}return false}}};Nu.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes["bottomroundrectangle"]={renderer:this,name:"bottom-round-rectangle",points:Dr(4,0),draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},intersectLine:function e(t,r,n,a,i,o,s){var u=t-(n/2+s);var l=r-(a/2+s);var f=l;var v=t+(n/2+s);var c=Er(i,o,t,r,u,l,v,f,false);if(c.length>0){return c}return or(i,o,t,r,n,a,s)},checkPoint:function e(t,r,n,a,i,o,s){var u=Pr(a,i);var l=2*u;if(hr(t,r,this.points,o,s,a,i-l,[0,-1],n)){return true}if(hr(t,r,this.points,o,s,a-l,i,[0,-1],n)){return true}var f=a/2+2*n;var v=i/2+2*n;var c=[o-f,s-v,o-f,s,o+f,s,o+f,s-v];if(dr(t,r,c)){return true}if(br(t,r,l,l,o+a/2-u,s+i/2-u,n)){return true}if(br(t,r,l,l,o-a/2+u,s+i/2-u,n)){return true}return false}}};Nu.registerNodeShapes=function(){var e=this.nodeShapes={};var t=this;this.generateEllipse();this.generatePolygon("triangle",Dr(3,0));this.generateRoundPolygon("round-triangle",Dr(3,0));this.generatePolygon("rectangle",Dr(4,0));e["square"]=e["rectangle"];this.generateRoundRectangle();this.generateCutRectangle();this.generateBarrel();this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r);this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Dr(5,0));this.generateRoundPolygon("round-pentagon",Dr(5,0));this.generatePolygon("hexagon",Dr(6,0));this.generateRoundPolygon("round-hexagon",Dr(6,0));this.generatePolygon("heptagon",Dr(7,0));this.generateRoundPolygon("round-heptagon",Dr(7,0));this.generatePolygon("octagon",Dr(8,0));this.generateRoundPolygon("round-octagon",Dr(8,0));var n=new Array(20);{var a=Tr(5,0);var i=Tr(5,Math.PI/5);var o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++){i[s*2]*=o;i[s*2+1]*=o}for(var s=0;s<20/4;s++){n[s*4]=a[s*2];n[s*4+1]=a[s*2+1];n[s*4+2]=i[s*2];n[s*4+3]=i[s*2+1]}}n=Cr(n);this.generatePolygon("star",n);this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]);this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]);this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]);this.nodeShapes["concavehexagon"]=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u);this.generateRoundPolygon("round-tag",u)}e.makePolygon=function(e){var r=e.join("$");var n="polygon-"+r;var a;if(a=this[n]){return a}return t.generatePolygon(n,e)}};var zu={};zu.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};zu.redraw=function(e){e=e||et();var t=this;if(t.averageRedrawTime===undefined){t.averageRedrawTime=0}if(t.lastRedrawTime===undefined){t.lastRedrawTime=0}if(t.lastDrawTime===undefined){t.lastDrawTime=0}t.requestedFrame=true;t.renderOptions=e};zu.beforeRender=function(e,t){if(this.destroyed){return}if(t==null){Xe("Priority is not optional for beforeRender")}var r=this.beforeRenderCallbacks;r.push({fn:e,priority:t});r.sort((function(e,t){return t.priority-e.priority}))};var Lu=function e(t,r,n){var a=t.beforeRenderCallbacks;for(var i=0;i<a.length;i++){a[i].fn(r,n)}};zu.startRenderLoop=function(){var e=this;var t=e.cy;if(e.renderLoopStarted){return}else{e.renderLoopStarted=true}var r=function r(n){if(e.destroyed){return}if(t.batching());else if(e.requestedFrame&&!e.skipFrame){Lu(e,true,n);var a=_e();e.render(e.renderOptions);var i=e.lastDrawTime=_e();if(e.averageRedrawTime===undefined){e.averageRedrawTime=i-a}if(e.redrawCount===undefined){e.redrawCount=0}e.redrawCount++;if(e.redrawTotalTime===undefined){e.redrawTotalTime=0}var o=i-a;e.redrawTotalTime+=o;e.lastRedrawTime=o;e.averageRedrawTime=e.averageRedrawTime/2+o/2;e.requestedFrame=false}else{Lu(e,false,n)}e.skipFrame=false;ke(r)};ke(r)};var Au=function e(t){this.init(t)};var Bu=Au;var Ru=Bu.prototype;Ru.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Ru.init=function(e){var t=this;t.options=e;t.cy=e.cy;var r=t.container=e.cy.container();var n=t.cy.window();if(n){var a=n.document;var i=a.head;var o="__________cytoscape_stylesheet";var s="__________cytoscape_container";var u=a.getElementById(o)!=null;if(r.className.indexOf(s)<0){r.className=(r.className||"")+" "+s}if(!u){var l=a.createElement("style");l.id=o;l.textContent="."+s+" { position: relative; }";i.insertBefore(l,i.children[0])}var f=n.getComputedStyle(r);var v=f.getPropertyValue("position");if(v==="static"){Ue("A Cytoscape container has style position:static and so can not use UI extensions properly")}}t.selection=[undefined,undefined,undefined,undefined,0];t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95];t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:false,initialPan:[null,null],capture:false};t.dragData={possibleDragElements:[]};t.touchData={start:null,capture:false,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:true,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]};t.redraws=0;t.showFps=e.showFps;t.debug=e.debug;t.hideEdgesOnViewport=e.hideEdgesOnViewport;t.textureOnViewport=e.textureOnViewport;t.wheelSensitivity=e.wheelSensitivity;t.motionBlurEnabled=e.motionBlur;t.forcedPixelRatio=B(e.pixelRatio)?e.pixelRatio:null;t.motionBlur=e.motionBlur;t.motionBlurOpacity=e.motionBlurOpacity;t.motionBlurTransparency=1-t.motionBlurOpacity;t.motionBlurPxRatio=1;t.mbPxRBlurry=1;t.minMbLowQualFrames=4;t.fullQualityMb=false;t.clearedForMotionBlur=[];t.desktopTapThreshold=e.desktopTapThreshold;t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold;t.touchTapThreshold=e.touchTapThreshold;t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold;t.tapholdDuration=500;t.bindings=[];t.beforeRenderCallbacks=[];t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100};t.registerNodeShapes();t.registerArrowShapes();t.registerCalculationListeners()};Ru.notify=function(e,t){var r=this;var n=r.cy;if(this.destroyed){return}if(e==="init"){r.load();return}if(e==="destroy"){r.destroy();return}if(e==="add"||e==="remove"||e==="move"&&n.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount"){r.invalidateCachedZSortedEles()}if(e==="viewport"){r.redrawHint("select",true)}if(e==="load"||e==="resize"||e==="mount"){r.invalidateContainerClientCoordsCache();r.matchCanvasSize(r.container)}r.redrawHint("eles",true);r.redrawHint("drag",true);this.startRenderLoop();this.redraw()};Ru.destroy=function(){var e=this;e.destroyed=true;e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var r=e.bindings[t];var n=r;var a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}e.bindings=[];e.beforeRenderCallbacks=[];e.onUpdateEleCalcsFns=[];if(e.removeObserver){e.removeObserver.disconnect()}if(e.styleObserver){e.styleObserver.disconnect()}if(e.resizeObserver){e.resizeObserver.disconnect()}if(e.labelCalcDiv){try{document.body.removeChild(e.labelCalcDiv)}catch(e){}}};Ru.isHeadless=function(){return false};[du,Mu,Iu,Ou,Nu,zu].forEach((function(e){ve(Ru,e)}));var ju=1e3/60;var Fu={setupDequeueing:function e(t){return function e(){var r=this;var n=this.renderer;if(r.dequeueingSetup){return}else{r.dequeueingSetup=true}var a=l["default"]((function(){n.redrawHint("eles",true);n.redrawHint("drag",true);n.redraw()}),t.deqRedrawThreshold);var i=function e(i,o){var s=_e();var u=n.averageRedrawTime;var l=n.lastRedrawTime;var f=[];var v=n.cy.extent();var c=n.getPixelRatio();if(!i){n.flushRenderedStyleQueue()}while(true){var d=_e();var h=d-s;var p=d-o;if(l<ju){var g=ju-(i?u:0);if(p>=t.deqFastCost*g){break}}else{if(i){if(h>=t.deqCost*l||h>=t.deqAvgCost*u){break}}else if(p>=t.deqNoDrawCost*ju){break}}var y=t.deq(r,c,v);if(y.length>0){for(var m=0;m<y.length;m++){f.push(y[m])}}else{break}}if(f.length>0){t.onDeqd(r,f);if(!i&&t.shouldRedraw(r,f,c,v)){a()}}};var o=t.priority||We;n.beforeRender(i,o(r))}}};var Vu=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ge;p(this,e);this.idsByKey=new ut;this.keyForId=new ut;this.cachesByLvl=new ut;this.lvls=[];this.getKey=t;this.doesEleInvalidateKey=r}y(e,[{key:"getIdsFor",value:function e(t){if(t==null){Xe("Can not get id list for null key")}var r=this.idsByKey;var n=this.idsByKey.get(t);if(!n){n=new vt;r.set(t,n)}return n}},{key:"addIdForKey",value:function e(t,r){if(t!=null){this.getIdsFor(t).add(r)}}},{key:"deleteIdForKey",value:function e(t,r){if(t!=null){this.getIdsFor(t)["delete"](r)}}},{key:"getNumberOfIdsForKey",value:function e(t){if(t==null){return 0}else{return this.getIdsFor(t).size}}},{key:"updateKeyMappingFor",value:function e(t){var r=t.id();var n=this.keyForId.get(r);var a=this.getKey(t);this.deleteIdForKey(n,r);this.addIdForKey(a,r);this.keyForId.set(r,a)}},{key:"deleteKeyMappingFor",value:function e(t){var r=t.id();var n=this.keyForId.get(r);this.deleteIdForKey(n,r);this.keyForId["delete"](r)}},{key:"keyHasChangedFor",value:function e(t){var r=t.id();var n=this.keyForId.get(r);var a=this.getKey(t);return n!==a}},{key:"isInvalid",value:function e(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function e(t){var r=this.cachesByLvl,n=this.lvls;var a=r.get(t);if(!a){a=new ut;r.set(t,a);n.push(t)}return a}},{key:"getCache",value:function e(t,r){return this.getCachesAt(r).get(t)}},{key:"get",value:function e(t,r){var n=this.getKey(t);var a=this.getCache(n,r);if(a!=null){this.updateKeyMappingFor(t)}return a}},{key:"getForCachedKey",value:function e(t,r){var n=this.keyForId.get(t.id());var a=this.getCache(n,r);return a}},{key:"hasCache",value:function e(t,r){return this.getCachesAt(r).has(t)}},{key:"has",value:function e(t,r){var n=this.getKey(t);return this.hasCache(n,r)}},{key:"setCache",value:function e(t,r,n){n.key=t;this.getCachesAt(r).set(t,n)}},{key:"set",value:function e(t,r,n){var a=this.getKey(t);this.setCache(a,r,n);this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function e(t,r){this.getCachesAt(r)["delete"](t)}},{key:"delete",value:function e(t,r){var n=this.getKey(t);this.deleteCache(n,r)}},{key:"invalidateKey",value:function e(t){var r=this;this.lvls.forEach((function(e){return r.deleteCache(t,e)}))}},{key:"invalidate",value:function e(t){var r=t.id();var n=this.keyForId.get(r);this.deleteKeyMappingFor(t);var a=this.doesEleInvalidateKey(t);if(a){this.invalidateKey(n)}return a||this.getNumberOfIdsForKey(n)===0}}]);return e}();var qu=25;var Gu=50;var Yu=-4;var Wu=3;var Xu=7.99;var Hu=8;var Uu=1024;var Ku=1024;var Zu=1024;var $u=.2;var Qu=.8;var Ju=10;var el=.15;var tl=.1;var rl=.9;var nl=.9;var al=100;var il=1;var ol={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"};var sl=tt({getKey:null,doesEleInvalidateKey:Ge,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:qe,allowEdgeTxrCaching:true,allowParentTxrCaching:true});var ul=function e(t,r){var n=this;n.renderer=t;n.onDequeues=[];var a=sl(r);ve(n,a);n.lookup=new Vu(a.getKey,a.doesEleInvalidateKey);n.setupDequeueing()};var ll=ul.prototype;ll.reasons=ol;ll.getTextureQueue=function(e){var t=this;t.eleImgCaches=t.eleImgCaches||{};return t.eleImgCaches[e]=t.eleImgCaches[e]||[]};ll.getRetiredTextureQueue=function(e){var t=this;var r=t.eleImgCaches.retired=t.eleImgCaches.retired||{};var n=r[e]=r[e]||[];return n};ll.getElementQueue=function(){var e=this;var t=e.eleCacheQueue=e.eleCacheQueue||new f["default"]((function(e,t){return t.reqs-e.reqs}));return t};ll.getElementKeyToQueue=function(){var e=this;var t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};ll.getElement=function(e,t,r,n,a){var i=this;var o=this.renderer;var s=o.cy.zoom();var u=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()){return null}if(!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent()){return null}if(n==null){n=Math.ceil(Rt(s*r))}if(n<Yu){n=Yu}else if(s>=Xu||n>Wu){return null}var l=Math.pow(2,n);var f=t.h*l;var v=t.w*l;var c=o.eleTextBiggerThanMin(e,l);if(!this.isVisible(e,c)){return null}var d=u.get(e,n);if(d&&d.invalidated){d.invalidated=false;d.texture.invalidatedWidth-=d.width}if(d){return d}var h;if(f<=qu){h=qu}else if(f<=Gu){h=Gu}else{h=Math.ceil(f/Gu)*Gu}if(f>Zu||v>Ku){return null}var p=i.getTextureQueue(h);var g=p[p.length-2];var y=function e(){return i.recycleTexture(h,v)||i.addTexture(h,v)};if(!g){g=p[p.length-1]}if(!g){g=y()}if(g.width-g.usedWidth<v){g=y()}var m=function e(t){return t&&t.scaledLabelShown===c};var b=a&&a===ol.dequeue;var x=a&&a===ol.highQuality;var w=a&&a===ol.downscale;var E;for(var k=n+1;k<=Wu;k++){var _=u.get(e,k);if(_){E=_;break}}var S=E&&E.level===n+1?E:null;var D=function e(){g.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,g.usedWidth,0,v,f)};g.context.setTransform(1,0,0,1,0,0);g.context.clearRect(g.usedWidth,0,v,h);if(m(S)){D()}else if(m(E)){if(x){for(var C=E.level;C>n;C--){S=i.getElement(e,t,r,C,ol.downscale)}D()}else{i.queueElement(e,E.level-1);return E}}else{var T;if(!b&&!x&&!w){for(var P=n-1;P>=Yu;P--){var M=u.get(e,P);if(M){T=M;break}}}if(m(T)){i.queueElement(e,n);return T}g.context.translate(g.usedWidth,0);g.context.scale(l,l);this.drawElement(g.context,e,t,c,false);g.context.scale(1/l,1/l);g.context.translate(-g.usedWidth,0)}d={x:g.usedWidth,texture:g,level:n,scale:l,width:v,height:f,scaledLabelShown:c};g.usedWidth+=Math.ceil(v+Hu);g.eleCaches.push(d);u.set(e,n,d);i.checkTextureFullness(g);return d};ll.invalidateElements=function(e){for(var t=0;t<e.length;t++){this.invalidateElement(e[t])}};ll.invalidateElement=function(e){var t=this;var r=t.lookup;var n=[];var a=r.isInvalid(e);if(!a){return}for(var i=Yu;i<=Wu;i++){var o=r.getForCachedKey(e,i);if(o){n.push(o)}}var s=r.invalidate(e);if(s){for(var u=0;u<n.length;u++){var l=n[u];var f=l.texture;f.invalidatedWidth+=l.width;l.invalidated=true;t.checkTextureUtility(f)}}t.removeFromQueue(e)};ll.checkTextureUtility=function(e){if(e.invalidatedWidth>=$u*e.width){this.retireTexture(e)}};ll.checkTextureFullness=function(e){var t=this;var r=t.getTextureQueue(e.height);if(e.usedWidth/e.width>Qu&&e.fullnessChecks>=Ju){rt(r,e)}else{e.fullnessChecks++}};ll.retireTexture=function(e){var t=this;var r=e.height;var n=t.getTextureQueue(r);var a=this.lookup;rt(n,e);e.retired=true;var i=e.eleCaches;for(var o=0;o<i.length;o++){var s=i[o];a.deleteCache(s.key,s.level)}nt(i);var u=t.getRetiredTextureQueue(r);u.push(e)};ll.addTexture=function(e,t){var r=this;var n=r.getTextureQueue(e);var a={};n.push(a);a.eleCaches=[];a.height=e;a.width=Math.max(Uu,t);a.usedWidth=0;a.invalidatedWidth=0;a.fullnessChecks=0;a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height);a.context=a.canvas.getContext("2d");return a};ll.recycleTexture=function(e,t){var r=this;var n=r.getTextureQueue(e);var a=r.getRetiredTextureQueue(e);for(var i=0;i<a.length;i++){var o=a[i];if(o.width>=t){o.retired=false;o.usedWidth=0;o.invalidatedWidth=0;o.fullnessChecks=0;nt(o.eleCaches);o.context.setTransform(1,0,0,1,0,0);o.context.clearRect(0,0,o.width,o.height);rt(a,o);n.push(o);return o}}};ll.queueElement=function(e,t){var r=this;var n=r.getElementQueue();var a=r.getElementKeyToQueue();var i=this.getKey(e);var o=a[i];if(o){o.level=Math.max(o.level,t);o.eles.merge(e);o.reqs++;n.updateItem(o)}else{var s={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(s);a[i]=s}};ll.dequeue=function(e){var t=this;var r=t.getElementQueue();var n=t.getElementKeyToQueue();var a=[];var i=t.lookup;for(var o=0;o<il;o++){if(r.size()>0){var s=r.pop();var u=s.key;var l=s.eles[0];var f=i.hasCache(l,s.level);n[u]=null;if(f){continue}a.push(s);var v=t.getBoundingBox(l);t.getElement(l,v,e,s.level,ol.dequeue)}else{break}}return a};ll.removeFromQueue=function(e){var t=this;var r=t.getElementQueue();var n=t.getElementKeyToQueue();var a=this.getKey(e);var i=n[a];if(i!=null){if(i.eles.length===1){i.reqs=Ve;r.updateItem(i);r.pop();n[a]=null}else{i.eles.unmerge(e)}}};ll.onDequeue=function(e){this.onDequeues.push(e)};ll.offDequeue=function(e){rt(this.onDequeues,e)};ll.setupDequeueing=Fu.setupDequeueing({deqRedrawThreshold:al,deqCost:el,deqAvgCost:tl,deqNoDrawCost:rl,deqFastCost:nl,deq:function e(t,r,n){return t.dequeue(r,n)},onDeqd:function e(t,r){for(var n=0;n<t.onDequeues.length;n++){var a=t.onDequeues[n];a(r)}},shouldRedraw:function e(t,r,n,a){for(var i=0;i<r.length;i++){var o=r[i].eles;for(var s=0;s<o.length;s++){var u=o[s].boundingBox();if(rr(u,a)){return true}}}return false},priority:function e(t){return t.renderer.beforeRenderPriorities.eleTxrDeq}});var fl=1;var vl=-4;var cl=2;var dl=3.99;var hl=50;var pl=50;var gl=.15;var yl=.1;var ml=.9;var bl=.9;var xl=1;var wl=250;var El=4e3*4e3;var kl=true;var _l=function e(t){var r=this;var n=r.renderer=t;var a=n.cy;r.layersByLevel={};r.firstGet=true;r.lastInvalidationTime=_e()-2*wl;r.skipping=false;r.eleTxrDeqs=a.collection();r.scheduleElementRefinement=l["default"]((function(){r.refineElementTextures(r.eleTxrDeqs);r.eleTxrDeqs.unmerge(r.eleTxrDeqs)}),pl);n.beforeRender((function(e,t){if(t-r.lastInvalidationTime<=wl){r.skipping=true}else{r.skipping=false}}),n.beforeRenderPriorities.lyrTxrSkip);var i=function e(t,r){return r.reqs-t.reqs};r.layersQueue=new f["default"](i);r.setupDequeueing()};var Sl=_l.prototype;var Dl=0;var Cl=Math.pow(2,53)-1;Sl.makeLayer=function(e,t){var r=Math.pow(2,t);var n=Math.ceil(e.w*r);var a=Math.ceil(e.h*r);var i=this.renderer.makeOffscreenCanvas(n,a);var o={id:Dl=++Dl%Cl,bb:e,level:t,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0};var s=o.context;var u=-o.bb.x1;var l=-o.bb.y1;s.scale(r,r);s.translate(u,l);return o};Sl.getLayers=function(e,t,r){var n=this;var a=n.renderer;var i=a.cy;var o=i.zoom();var s=n.firstGet;n.firstGet=false;if(r==null){r=Math.ceil(Rt(o*t));if(r<vl){r=vl}else if(o>=dl||r>cl){return null}}n.validateLayersElesOrdering(r,e);var u=n.layersByLevel;var l=Math.pow(2,r);var f=u[r]=u[r]||[];var v;var c=n.levelIsComplete(r,e);var d;var h=function t(){var a=function t(r){n.validateLayersElesOrdering(r,e);if(n.levelIsComplete(r,e)){d=u[r];return true}};var i=function e(t){if(d){return}for(var n=r+t;vl<=n&&n<=cl;n+=t){if(a(n)){break}}};i(+1);i(-1);for(var o=f.length-1;o>=0;o--){var s=f[o];if(s.invalid){rt(f,s)}}};if(!c){h()}else{return f}var p=function t(){if(!v){v=Ht();for(var r=0;r<e.length;r++){$t(v,e[r].boundingBox())}}return v};var g=function e(t){t=t||{};var a=t.after;p();var i=v.w*l*(v.h*l);if(i>El){return null}var o=n.makeLayer(v,r);if(a!=null){var s=f.indexOf(a)+1;f.splice(s,0,o)}else if(t.insert===undefined||t.insert){f.unshift(o)}return o};if(n.skipping&&!s){return null}var y=null;var m=e.length/fl;var b=!s;for(var x=0;x<e.length;x++){var w=e[x];var E=w._private.rscratch;var k=E.imgLayerCaches=E.imgLayerCaches||{};var _=k[r];if(_){y=_;continue}if(!y||y.eles.length>=m||!ir(y.bb,w.boundingBox())){y=g({insert:true,after:y});if(!y){return null}}if(d||b){n.queueLayer(y,w)}else{n.drawEleInLayer(y,w,r,t)}y.eles.push(w);k[r]=y}if(d){return d}if(b){return null}return f};Sl.getEleLevelForLayerLevel=function(e,t){return e};Sl.drawEleInLayer=function(e,t,r,n){var a=this;var i=this.renderer;var o=e.context;var s=t.boundingBox();if(s.w===0||s.h===0||!t.visible()){return}r=a.getEleLevelForLayerLevel(r,n);{i.setImgSmoothing(o,false)}{i.drawCachedElement(o,t,null,null,r,kl)}{i.setImgSmoothing(o,true)}};Sl.levelIsComplete=function(e,t){var r=this;var n=r.layersByLevel[e];if(!n||n.length===0){return false}var a=0;for(var i=0;i<n.length;i++){var o=n[i];if(o.reqs>0){return false}if(o.invalid){return false}a+=o.eles.length}if(a!==t.length){return false}return true};Sl.validateLayersElesOrdering=function(e,t){var r=this.layersByLevel[e];if(!r){return}for(var n=0;n<r.length;n++){var a=r[n];var i=-1;for(var o=0;o<t.length;o++){if(a.eles[0]===t[o]){i=o;break}}if(i<0){this.invalidateLayer(a);continue}var s=i;for(var o=0;o<a.eles.length;o++){if(a.eles[o]!==t[s+o]){this.invalidateLayer(a);break}}}};Sl.updateElementsInLayers=function(e,t){var r=this;var n=V(e[0]);for(var a=0;a<e.length;a++){var i=n?null:e[a];var o=n?e[a]:e[a].ele;var s=o._private.rscratch;var u=s.imgLayerCaches=s.imgLayerCaches||{};for(var l=vl;l<=cl;l++){var f=u[l];if(!f){continue}if(i&&r.getEleLevelForLayerLevel(f.level)!==i.level){continue}t(f,o,i)}}};Sl.haveLayers=function(){var e=this;var t=false;for(var r=vl;r<=cl;r++){var n=e.layersByLevel[r];if(n&&n.length>0){t=true;break}}return t};Sl.invalidateElements=function(e){var t=this;if(e.length===0){return}t.lastInvalidationTime=_e();if(e.length===0||!t.haveLayers()){return}t.updateElementsInLayers(e,(function e(r,n,a){t.invalidateLayer(r)}))};Sl.invalidateLayer=function(e){this.lastInvalidationTime=_e();if(e.invalid){return}var t=e.level;var r=e.eles;var n=this.layersByLevel[t];rt(n,e);e.elesQueue=[];e.invalid=true;if(e.replacement){e.replacement.invalid=true}for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;if(i){i[t]=null}}};Sl.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function e(r,n,a){var i=r.replacement;if(!i){i=r.replacement=t.makeLayer(r.bb,r.level);i.replaces=r;i.eles=r.eles}if(!i.reqs){for(var o=0;o<i.eles.length;o++){t.queueLayer(i,i.eles[o])}}}))};Sl.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e);this.scheduleElementRefinement()};Sl.queueLayer=function(e,t){var r=this;var n=r.layersQueue;var a=e.elesQueue;var i=a.hasId=a.hasId||{};if(e.replacement){return}if(t){if(i[t.id()]){return}a.push(t);i[t.id()]=true}if(e.reqs){e.reqs++;n.updateItem(e)}else{e.reqs=1;n.push(e)}};Sl.dequeue=function(e){var t=this;var r=t.layersQueue;var n=[];var a=0;while(a<xl){if(r.size()===0){break}var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();if(o){t.drawEleInLayer(i,o,i.level,e);a++}if(n.length===0){n.push(true)}if(i.elesQueue.length===0){r.pop();i.reqs=0;if(i.replaces){t.applyLayerReplacement(i)}t.requestRedraw()}}return n};Sl.applyLayerReplacement=function(e){var t=this;var r=t.layersByLevel[e.level];var n=e.replaces;var a=r.indexOf(n);if(a<0||n.invalid){return}r[a]=e;for(var i=0;i<e.eles.length;i++){var o=e.eles[i]._private;var s=o.imgLayerCaches=o.imgLayerCaches||{};if(s){s[e.level]=e}}t.requestRedraw()};Sl.requestRedraw=l["default"]((function(){var e=this.renderer;e.redrawHint("eles",true);e.redrawHint("drag",true);e.redraw()}),100);Sl.setupDequeueing=Fu.setupDequeueing({deqRedrawThreshold:hl,deqCost:gl,deqAvgCost:yl,deqNoDrawCost:ml,deqFastCost:bl,deq:function e(t,r){return t.dequeue(r)},onDeqd:We,shouldRedraw:qe,priority:function e(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq}});var Tl={};var Pl;function Ml(e,t){for(var r=0;r<t.length;r++){var n=t[r];e.lineTo(n.x,n.y)}}function Il(e,t,r){var n;for(var a=0;a<t.length;a++){var i=t[a];if(a===0){n=i}e.lineTo(i.x,i.y)}e.quadraticCurveTo(r.x,r.y,n.x,n.y)}function Ol(e,t,r){if(e.beginPath){e.beginPath()}var n=t;for(var a=0;a<n.length;a++){var i=n[a];e.lineTo(i.x,i.y)}var o=r;var s=r[0];e.moveTo(s.x,s.y);for(var a=1;a<o.length;a++){var i=o[a];e.lineTo(i.x,i.y)}if(e.closePath){e.closePath()}}function Nl(e,t,r,n,a){if(e.beginPath){e.beginPath()}e.arc(r,n,a,0,Math.PI*2,false);var i=t;var o=i[0];e.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];e.lineTo(u.x,u.y)}if(e.closePath){e.closePath()}}function zl(e,t,r,n){e.arc(t,r,n,0,Math.PI*2,false)}Tl.arrowShapeImpl=function(e){return(Pl||(Pl={polygon:Ml,"triangle-backcurve":Il,"triangle-tee":Ol,"circle-triangle":Nl,"triangle-cross":Ol,circle:zl}))[e]};var Ll={};Ll.drawElement=function(e,t,r,n,a,i){var o=this;if(t.isNode()){o.drawNode(e,t,r,n,a,i)}else{o.drawEdge(e,t,r,n,a,i)}};Ll.drawElementOverlay=function(e,t){var r=this;if(t.isNode()){r.drawNodeOverlay(e,t)}else{r.drawEdgeOverlay(e,t)}};Ll.drawElementUnderlay=function(e,t){var r=this;if(t.isNode()){r.drawNodeUnderlay(e,t)}else{r.drawEdgeUnderlay(e,t)}};Ll.drawCachedElementPortion=function(e,t,r,n,a,i,o,s){var u=this;var l=r.getBoundingBox(t);if(l.w===0||l.h===0){return}var f=r.getElement(t,l,n,a,i);if(f!=null){var v=s(u,t);if(v===0){return}var c=o(u,t);var d=l.x1,h=l.y1,p=l.w,g=l.h;var y,m,b,x,w;if(c!==0){var E=r.getRotationPoint(t);b=E.x;x=E.y;e.translate(b,x);e.rotate(c);w=u.getImgSmoothing(e);if(!w){u.setImgSmoothing(e,true)}var k=r.getRotationOffset(t);y=k.x;m=k.y}else{y=d;m=h}var _;if(v!==1){_=e.globalAlpha;e.globalAlpha=_*v}e.drawImage(f.texture.canvas,f.x,0,f.width,f.height,y,m,p,g);if(v!==1){e.globalAlpha=_}if(c!==0){e.rotate(-c);e.translate(-b,-x);if(!w){u.setImgSmoothing(e,false)}}}else{r.drawElement(e,t)}};var Al=function e(){return 0};var Bl=function e(t,r){return t.getTextAngle(r,null)};var Rl=function e(t,r){return t.getTextAngle(r,"source")};var jl=function e(t,r){return t.getTextAngle(r,"target")};var Fl=function e(t,r){return r.effectiveOpacity()};var Vl=function e(t,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Ll.drawCachedElement=function(e,t,r,n,a,i){var o=this;var s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,f=s.slbTxrCache,v=s.tlbTxrCache;var c=t.boundingBox();var d=i===true?u.reasons.highQuality:null;if(c.w===0||c.h===0||!t.visible()){return}if(!n||rr(c,n)){var h=t.isEdge();var p=t.element()._private.rscratch.badLine;o.drawElementUnderlay(e,t);o.drawCachedElementPortion(e,t,u,r,a,d,Al,Fl);if(!h||!p){o.drawCachedElementPortion(e,t,l,r,a,d,Bl,Vl)}if(h&&!p){o.drawCachedElementPortion(e,t,f,r,a,d,Rl,Vl);o.drawCachedElementPortion(e,t,v,r,a,d,jl,Vl)}o.drawElementOverlay(e,t)}};Ll.drawElements=function(e,t){var r=this;for(var n=0;n<t.length;n++){var a=t[n];r.drawElement(e,a)}};Ll.drawCachedElements=function(e,t,r,n){var a=this;for(var i=0;i<t.length;i++){var o=t[i];a.drawCachedElement(e,o,r,n)}};Ll.drawCachedNodes=function(e,t,r,n){var a=this;for(var i=0;i<t.length;i++){var o=t[i];if(!o.isNode()){continue}a.drawCachedElement(e,o,r,n)}};Ll.drawLayeredElements=function(e,t,r,n){var a=this;var i=a.data.lyrTxrCache.getLayers(t,r);if(i){for(var o=0;o<i.length;o++){var s=i[o];var u=s.bb;if(u.w===0||u.h===0){continue}e.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}}else{a.drawCachedElements(e,t,r,n)}};var ql={};ql.drawEdge=function(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;var o=this;var s=t._private.rscratch;if(i&&!t.visible()){return}if(s.badLine||s.allpts==null||isNaN(s.allpts[0])){return}var u;if(r){u=r;e.translate(-u.x1,-u.y1)}var l=i?t.pstyle("opacity").value:1;var f=i?t.pstyle("line-opacity").value:1;var v=t.pstyle("curve-style").value;var c=t.pstyle("line-style").value;var d=t.pstyle("width").pfValue;var h=t.pstyle("line-cap").value;var p=l*f;var g=l*f;var y=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:p;if(v==="straight-triangle"){o.eleStrokeStyle(e,t,n);o.drawEdgeTrianglePath(t,e,s.allpts)}else{e.lineWidth=d;e.lineCap=h;o.eleStrokeStyle(e,t,n);o.drawEdgePath(t,e,s.allpts,c);e.lineCap="butt"}};var m=function r(){if(!a){return}o.drawEdgeOverlay(e,t)};var b=function r(){if(!a){return}o.drawEdgeUnderlay(e,t)};var x=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:g;o.drawArrowheads(e,t,n)};var w=function r(){o.drawElementText(e,t,null,n)};e.lineJoin="round";var E=t.pstyle("ghost").value==="yes";if(E){var k=t.pstyle("ghost-offset-x").pfValue;var _=t.pstyle("ghost-offset-y").pfValue;var S=t.pstyle("ghost-opacity").value;var D=p*S;e.translate(k,_);y(D);x(D);e.translate(-k,-_)}b();y();x();m();w();if(r){e.translate(u.x1,u.y1)}};var Gl=function e(t){if(!["overlay","underlay"].includes(t)){throw new Error("Invalid state")}return function(e,r){if(!r.visible()){return}var n=r.pstyle("".concat(t,"-opacity")).value;if(n===0){return}var a=this;var i=a.usePaths();var o=r._private.rscratch;var s=r.pstyle("".concat(t,"-padding")).pfValue;var u=2*s;var l=r.pstyle("".concat(t,"-color")).value;e.lineWidth=u;if(o.edgeType==="self"&&!i){e.lineCap="butt"}else{e.lineCap="round"}a.colorStrokeStyle(e,l[0],l[1],l[2],n);a.drawEdgePath(r,e,o.allpts,"solid")}};ql.drawEdgeOverlay=Gl("overlay");ql.drawEdgeUnderlay=Gl("underlay");ql.drawEdgePath=function(e,t,r,n){var a=e._private.rscratch;var i=t;var o;var s=false;var u=this.usePaths();var l=e.pstyle("line-dash-pattern").pfValue;var f=e.pstyle("line-dash-offset").pfValue;if(u){var v=r.join("$");var c=a.pathCacheKey&&a.pathCacheKey===v;if(c){o=t=a.pathCache;s=true}else{o=t=new Path2D;a.pathCacheKey=v;a.pathCache=o}}if(i.setLineDash){switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l);i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}}if(!s&&!a.badLine){if(t.beginPath){t.beginPath()}t.moveTo(r[0],r[1]);switch(a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<r.length;d+=4){t.quadraticCurveTo(r[d],r[d+1],r[d+2],r[d+3])}break;case"straight":case"segments":case"haystack":for(var h=2;h+1<r.length;h+=2){t.lineTo(r[h],r[h+1])}break}}t=i;if(u){t.stroke(o)}else{t.stroke()}if(t.setLineDash){t.setLineDash([])}};ql.drawEdgeTrianglePath=function(e,t,r){t.fillStyle=t.strokeStyle;var n=e.pstyle("width").pfValue;for(var a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]];var o=Math.sqrt(i[0]*i[0]+i[1]*i[1]);var s=[i[1]/o,-i[0]/o];var u=[s[0]*n/2,s[1]*n/2];t.beginPath();t.moveTo(r[a]-u[0],r[a+1]-u[1]);t.lineTo(r[a]+u[0],r[a+1]+u[1]);t.lineTo(r[a+2],r[a+3]);t.closePath();t.fill()}};ql.drawArrowheads=function(e,t,r){var n=t._private.rscratch;var a=n.edgeType==="haystack";if(!a){this.drawArrowhead(e,t,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r)}this.drawArrowhead(e,t,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r);this.drawArrowhead(e,t,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r);if(!a){this.drawArrowhead(e,t,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)}};ql.drawArrowhead=function(e,t,r,n,a,i,o){if(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null){return}var s=this;var u=t.pstyle(r+"-arrow-shape").value;if(u==="none"){return}var l=t.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled";var f=t.pstyle(r+"-arrow-fill").value;var v=t.pstyle("width").pfValue;var c=t.pstyle(r+"-arrow-width");var d=c.value==="match-line"?v:c.pfValue;if(c.units==="%")d*=v;var h=t.pstyle("opacity").value;if(o===undefined){o=h}var p=e.globalCompositeOperation;if(o!==1||f==="hollow"){e.globalCompositeOperation="destination-out";s.colorFillStyle(e,255,255,255,1);s.colorStrokeStyle(e,255,255,255,1);s.drawArrowShape(t,e,l,v,u,d,n,a,i);e.globalCompositeOperation=p}var g=t.pstyle(r+"-arrow-color").value;s.colorFillStyle(e,g[0],g[1],g[2],o);s.colorStrokeStyle(e,g[0],g[1],g[2],o);s.drawArrowShape(t,e,f,v,u,d,n,a,i)};ql.drawArrowShape=function(e,t,r,n,a,i,o,s,u){var l=this;var f=this.usePaths()&&a!=="triangle-cross";var v=false;var c;var d=t;var h={x:o,y:s};var p=e.pstyle("arrow-scale").value;var g=this.getArrowWidth(n,p);var y=l.arrowShapes[a];if(f){var m=l.arrowPathCache=l.arrowPathCache||[];var b=Le(a);var x=m[b];if(x!=null){c=t=x;v=true}else{c=t=new Path2D;m[b]=c}}if(!v){if(t.beginPath){t.beginPath()}if(f){y.draw(t,1,0,{x:0,y:0},1)}else{y.draw(t,g,u,h,n)}if(t.closePath){t.closePath()}}t=d;if(f){t.translate(o,s);t.rotate(u);t.scale(g,g)}if(r==="filled"||r==="both"){if(f){t.fill(c)}else{t.fill()}}if(r==="hollow"||r==="both"){t.lineWidth=i/(f?g:1);t.lineJoin="miter";if(f){t.stroke(c)}else{t.stroke()}}if(f){t.scale(1/g,1/g);t.rotate(-u);t.translate(-o,-s)}};var Yl={};Yl.safeDrawImage=function(e,t,r,n,a,i,o,s,u,l){if(a<=0||i<=0||u<=0||l<=0){return}try{e.drawImage(t,r,n,a,i,o,s,u,l)}catch(e){Ue(e)}};Yl.drawInscribedImage=function(e,t,r,n,a){var i=this;var o=r.position();var s=o.x;var u=o.y;var l=r.cy().style();var f=l.getIndexedStyle.bind(l);var v=f(r,"background-fit","value",n);var c=f(r,"background-repeat","value",n);var d=r.width();var h=r.height();var p=r.padding()*2;var g=d+(f(r,"background-width-relative-to","value",n)==="inner"?0:p);var y=h+(f(r,"background-height-relative-to","value",n)==="inner"?0:p);var m=r._private.rscratch;var b=f(r,"background-clip","value",n);var x=b==="node";var w=f(r,"background-image-opacity","value",n)*a;var E=f(r,"background-image-smoothing","value",n);var k=t.width||t.cachedW;var _=t.height||t.cachedH;if(null==k||null==_){document.body.appendChild(t);k=t.cachedW=t.width||t.offsetWidth;_=t.cachedH=t.height||t.offsetHeight;document.body.removeChild(t)}var S=k;var D=_;if(f(r,"background-width","value",n)!=="auto"){if(f(r,"background-width","units",n)==="%"){S=f(r,"background-width","pfValue",n)*g}else{S=f(r,"background-width","pfValue",n)}}if(f(r,"background-height","value",n)!=="auto"){if(f(r,"background-height","units",n)==="%"){D=f(r,"background-height","pfValue",n)*y}else{D=f(r,"background-height","pfValue",n)}}if(S===0||D===0){return}if(v==="contain"){var C=Math.min(g/S,y/D);S*=C;D*=C}else if(v==="cover"){var C=Math.max(g/S,y/D);S*=C;D*=C}var T=s-g/2;var P=f(r,"background-position-x","units",n);var M=f(r,"background-position-x","pfValue",n);if(P==="%"){T+=(g-S)*M}else{T+=M}var I=f(r,"background-offset-x","units",n);var O=f(r,"background-offset-x","pfValue",n);if(I==="%"){T+=(g-S)*O}else{T+=O}var N=u-y/2;var z=f(r,"background-position-y","units",n);var L=f(r,"background-position-y","pfValue",n);if(z==="%"){N+=(y-D)*L}else{N+=L}var A=f(r,"background-offset-y","units",n);var B=f(r,"background-offset-y","pfValue",n);if(A==="%"){N+=(y-D)*B}else{N+=B}if(m.pathCache){T-=s;N-=u;s=0;u=0}var R=e.globalAlpha;e.globalAlpha=w;var j=i.getImgSmoothing(e);var F=false;if(E==="no"&&j){i.setImgSmoothing(e,false);F=true}else if(E==="yes"&&!j){i.setImgSmoothing(e,true);F=true}if(c==="no-repeat"){if(x){e.save();if(m.pathCache){e.clip(m.pathCache)}else{i.nodeShapes[i.getNodeShape(r)].draw(e,s,u,g,y);e.clip()}}i.safeDrawImage(e,t,0,0,k,_,T,N,S,D);if(x){e.restore()}}else{var V=e.createPattern(t,c);e.fillStyle=V;i.nodeShapes[i.getNodeShape(r)].draw(e,s,u,g,y);e.translate(T,N);e.fill();e.translate(-T,-N)}e.globalAlpha=R;if(F){i.setImgSmoothing(e,j)}};var Wl={};Wl.eleTextBiggerThanMin=function(e,t){if(!t){var r=e.cy().zoom();var n=this.getPixelRatio();var a=Math.ceil(Rt(r*n));t=Math.pow(2,a)}var i=e.pstyle("font-size").pfValue*t;var o=e.pstyle("min-zoomed-font-size").pfValue;if(i<o){return false}return true};Wl.drawElementText=function(e,t,r,n,a){var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;var o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(t)){return}}else if(n===false){return}if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value){return}var u=o.getLabelJustification(t);e.textAlign=u;e.textBaseline="bottom"}else{var l=t.element()._private.rscratch.badLine;var f=t.pstyle("label");var v=t.pstyle("source-label");var c=t.pstyle("target-label");if(l||(!f||!f.value)&&(!v||!v.value)&&(!c||!c.value)){return}e.textAlign="center";e.textBaseline="bottom"}var d=!r;var h;if(r){h=r;e.translate(-h.x1,-h.y1)}if(a==null){o.drawText(e,t,null,d,i);if(t.isEdge()){o.drawText(e,t,"source",d,i);o.drawText(e,t,"target",d,i)}}else{o.drawText(e,t,a,d,i)}if(r){e.translate(h.x1,h.y1)}};Wl.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++){t=this.fontCaches[r];if(t.context===e){return t}}t={context:e};this.fontCaches.push(t);return t};Wl.setupTextStyle=function(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var n=t.pstyle("font-style").strValue;var a=t.pstyle("font-size").pfValue+"px";var i=t.pstyle("font-family").strValue;var o=t.pstyle("font-weight").strValue;var s=r?t.effectiveOpacity()*t.pstyle("text-opacity").value:1;var u=t.pstyle("text-outline-opacity").value*s;var l=t.pstyle("color").value;var f=t.pstyle("text-outline-color").value;e.font=n+" "+o+" "+a+" "+i;e.lineJoin="round";this.colorFillStyle(e,l[0],l[1],l[2],s);this.colorStrokeStyle(e,f[0],f[1],f[2],u)};function Xl(e,t,r,n,a){var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:5;var o=arguments.length>6?arguments[6]:undefined;e.beginPath();e.moveTo(t+i,r);e.lineTo(t+n-i,r);e.quadraticCurveTo(t+n,r,t+n,r+i);e.lineTo(t+n,r+a-i);e.quadraticCurveTo(t+n,r+a,t+n-i,r+a);e.lineTo(t+i,r+a);e.quadraticCurveTo(t,r+a,t,r+a-i);e.lineTo(t,r+i);e.quadraticCurveTo(t,r,t+i,r);e.closePath();if(o)e.stroke();else e.fill()}Wl.getTextAngle=function(e,t){var r;var n=e._private;var a=n.rscratch;var i=t?t+"-":"";var o=e.pstyle(i+"text-rotation");var s=it(a,"labelAngle",t);if(o.strValue==="autorotate"){r=e.isEdge()?s:0}else if(o.strValue==="none"){r=0}else{r=o.pfValue}return r};Wl.drawText=function(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=t._private;var o=i.rscratch;var s=a?t.effectiveOpacity():1;if(a&&(s===0||t.pstyle("text-opacity").value===0)){return}if(r==="main"){r=null}var u=it(o,"labelX",r);var l=it(o,"labelY",r);var f,v;var c=this.getLabelText(t,r);if(c!=null&&c!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(e,t,a);var d=r?r+"-":"";var h=it(o,"labelWidth",r);var p=it(o,"labelHeight",r);var g=t.pstyle(d+"text-margin-x").pfValue;var y=t.pstyle(d+"text-margin-y").pfValue;var m=t.isEdge();var b=t.pstyle("text-halign").value;var x=t.pstyle("text-valign").value;if(m){b="center";x="center"}u+=g;l+=y;var w;if(!n){w=0}else{w=this.getTextAngle(t,r)}if(w!==0){f=u;v=l;e.translate(f,v);e.rotate(w);u=0;l=0}switch(x){case"top":break;case"center":l+=p/2;break;case"bottom":l+=p;break}var E=t.pstyle("text-background-opacity").value;var k=t.pstyle("text-border-opacity").value;var _=t.pstyle("text-border-width").pfValue;var S=t.pstyle("text-background-padding").pfValue;var D=t.pstyle("text-background-shape").strValue;var C=D.indexOf("round")===0;var T=2;if(E>0||_>0&&k>0){var P=u-S;switch(b){case"left":P-=h;break;case"center":P-=h/2;break}var M=l-p-S;var I=h+2*S;var O=p+2*S;if(E>0){var N=e.fillStyle;var z=t.pstyle("text-background-color").value;e.fillStyle="rgba("+z[0]+","+z[1]+","+z[2]+","+E*s+")";if(C){Xl(e,P,M,I,O,T)}else{e.fillRect(P,M,I,O)}e.fillStyle=N}if(_>0&&k>0){var L=e.strokeStyle;var A=e.lineWidth;var B=t.pstyle("text-border-color").value;var R=t.pstyle("text-border-style").value;e.strokeStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+k*s+")";e.lineWidth=_;if(e.setLineDash){switch(R){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4;e.setLineDash([]);break;case"solid":e.setLineDash([]);break}}if(C){Xl(e,P,M,I,O,T,"stroke")}else{e.strokeRect(P,M,I,O)}if(R==="double"){var j=_/2;if(C){Xl(e,P+j,M+j,I-j*2,O-j*2,T,"stroke")}else{e.strokeRect(P+j,M+j,I-j*2,O-j*2)}}if(e.setLineDash){e.setLineDash([])}e.lineWidth=A;e.strokeStyle=L}}var F=2*t.pstyle("text-outline-width").pfValue;if(F>0){e.lineWidth=F}if(t.pstyle("text-wrap").value==="wrap"){var V=it(o,"labelWrapCachedLines",r);var q=it(o,"labelLineHeight",r);var G=h/2;var Y=this.getLabelJustification(t);if(Y==="auto");else if(b==="left"){if(Y==="left"){u+=-h}else if(Y==="center"){u+=-G}}else if(b==="center"){if(Y==="left"){u+=-G}else if(Y==="right"){u+=G}}else if(b==="right"){if(Y==="center"){u+=G}else if(Y==="right"){u+=h}}switch(x){case"top":l-=(V.length-1)*q;break;case"center":case"bottom":l-=(V.length-1)*q;break}for(var W=0;W<V.length;W++){if(F>0){e.strokeText(V[W],u,l)}e.fillText(V[W],u,l);l+=q}}else{if(F>0){e.strokeText(c,u,l)}e.fillText(c,u,l)}if(w!==0){e.rotate(-w);e.translate(-f,-v)}}};var Hl={};Hl.drawNode=function(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;var o=this;var s,u;var l=t._private;var f=l.rscratch;var v=t.position();if(!B(v.x)||!B(v.y)){return}if(i&&!t.visible()){return}var c=i?t.effectiveOpacity():1;var d=o.usePaths();var h;var p=false;var g=t.padding();s=t.width()+2*g;u=t.height()+2*g;var y;if(r){y=r;e.translate(-y.x1,-y.y1)}var m=t.pstyle("background-image");var b=m.value;var x=new Array(b.length);var w=new Array(b.length);var E=0;for(var k=0;k<b.length;k++){var _=b[k];var S=x[k]=_!=null&&_!=="none";if(S){var D=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",k);E++;w[k]=o.getCachedImage(_,D,(function(){l.backgroundTimestamp=Date.now();t.emitAndNotify("background")}))}}var C=t.pstyle("background-blacken").value;var T=t.pstyle("border-width").pfValue;var P=t.pstyle("background-opacity").value*c;var M=t.pstyle("border-color").value;var I=t.pstyle("border-style").value;var O=t.pstyle("border-opacity").value*c;var N=t.pstyle("outline-width").pfValue;var z=t.pstyle("outline-color").value;var L=t.pstyle("outline-style").value;var A=t.pstyle("outline-opacity").value*c;var R=t.pstyle("outline-offset").value;e.lineJoin="miter";var j=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:P;o.eleFillStyle(e,t,n)};var F=function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:O;o.colorStrokeStyle(e,M[0],M[1],M[2],r)};var V=function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:A;o.colorStrokeStyle(e,z[0],z[1],z[2],r)};var q=function e(t,r,n,a){var i=o.nodePathCache=o.nodePathCache||[];var s=Ae(n==="polygon"?n+","+a.join(","):n,""+r,""+t);var u=i[s];var l;var v=false;if(u!=null){l=u;v=true;f.pathCache=l}else{l=new Path2D;i[s]=f.pathCache=l}return{path:l,cacheHit:v}};var G=t.pstyle("shape").strValue;var Y=t.pstyle("shape-polygon-points").pfValue;if(d){e.translate(v.x,v.y);var W=q(s,u,G,Y);h=W.path;p=W.cacheHit}var X=function r(){if(!p){var n=v;if(d){n={x:0,y:0}}o.nodeShapes[o.getNodeShape(t)].draw(h||e,n.x,n.y,s,u)}if(d){e.fill(h)}else{e.fill()}};var H=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:c;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var i=l.backgrounding;var s=0;for(var u=0;u<w.length;u++){var f=t.cy().style().getIndexedStyle(t,"background-image-containment","value",u);if(a&&f==="over"||!a&&f==="inside"){s++;continue}if(x[u]&&w[u].complete&&!w[u].error){s++;o.drawInscribedImage(e,w[u],t,u,n)}}l.backgrounding=!(s===E);if(i!==l.backgrounding){t.updateStyle(false)}};var U=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:c;if(o.hasPie(t)){o.drawPie(e,t,a);if(n){if(!d){o.nodeShapes[o.getNodeShape(t)].draw(e,v.x,v.y,s,u)}}}};var K=function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:c;var n=(C>0?C:-C)*r;var a=C>0?0:255;if(C!==0){o.colorFillStyle(e,a,a,a,n);if(d){e.fill(h)}else{e.fill()}}};var Z=function t(){if(T>0){e.lineWidth=T;e.lineCap="butt";if(e.setLineDash){switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}}if(d){e.stroke(h)}else{e.stroke()}if(I==="double"){e.lineWidth=T/3;var r=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";if(d){e.stroke(h)}else{e.stroke()}e.globalCompositeOperation=r}if(e.setLineDash){e.setLineDash([])}}};var $=function r(){if(N>0){e.lineWidth=N;e.lineCap="butt";if(e.setLineDash){switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}}var n=v;if(d){n={x:0,y:0}}var a=o.getNodeShape(t);var i=(s+T+(N+R))/s;var l=(u+T+(N+R))/u;var f=s*i;var c=u*l;var h=o.nodeShapes[a].points;var p;if(d){var g=q(f,c,a,h);p=g.path}if(a==="ellipse"){o.drawEllipsePath(p||e,n.x,n.y,f,c)}else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(a)){var y=0;var m=0;var b=0;if(a==="round-diamond"){y=(T+R+N)*1.4}else if(a==="round-heptagon"){y=(T+R+N)*1.075;b=-(T/2+R+N)/35}else if(a==="round-hexagon"){y=(T+R+N)*1.12}else if(a==="round-pentagon"){y=(T+R+N)*1.13;b=-(T/2+R+N)/15}else if(a==="round-tag"){y=(T+R+N)*1.12;m=(T/2+N+R)*.07}else if(a==="round-triangle"){y=(T+R+N)*(Math.PI/2);b=-(T+R/2+N)/Math.PI}if(y!==0){i=(s+y)/s;l=(u+y)/u}o.drawRoundPolygonPath(p||e,n.x+m,n.y+b,s*i,u*l,h)}else if(["roundrectangle","round-rectangle"].includes(a)){o.drawRoundRectanglePath(p||e,n.x,n.y,f,c)}else if(["cutrectangle","cut-rectangle"].includes(a)){o.drawCutRectanglePath(p||e,n.x,n.y,f,c)}else if(["bottomroundrectangle","bottom-round-rectangle"].includes(a)){o.drawBottomRoundRectanglePath(p||e,n.x,n.y,f,c)}else if(a==="barrel"){o.drawBarrelPath(p||e,n.x,n.y,f,c)}else if(a.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(a)){var x=(T+N+R)/s;h=gr(yr(h,x));o.drawPolygonPath(p||e,n.x,n.y,s,u,h)}else{var w=(T+N+R)/s;h=gr(yr(h,-w));o.drawPolygonPath(p||e,n.x,n.y,s,u,h)}if(d){e.stroke(p)}else{e.stroke()}if(L==="double"){e.lineWidth=T/3;var E=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";if(d){e.stroke(p)}else{e.stroke()}e.globalCompositeOperation=E}if(e.setLineDash){e.setLineDash([])}}};var Q=function r(){if(a){o.drawNodeOverlay(e,t,v,s,u)}};var J=function r(){if(a){o.drawNodeUnderlay(e,t,v,s,u)}};var ee=function r(){o.drawElementText(e,t,null,n)};var te=t.pstyle("ghost").value==="yes";if(te){var re=t.pstyle("ghost-offset-x").pfValue;var ne=t.pstyle("ghost-offset-y").pfValue;var ae=t.pstyle("ghost-opacity").value;var ie=ae*c;e.translate(re,ne);V();$();j(ae*P);X();H(ie,true);F(ae*O);Z();U(C!==0||T!==0);H(ie,false);K(ie);e.translate(-re,-ne)}if(d){e.translate(-v.x,-v.y)}J();if(d){e.translate(v.x,v.y)}V();$();j();X();H(c,true);F();Z();U(C!==0||T!==0);H(c,false);K();if(d){e.translate(-v.x,-v.y)}ee();Q();if(r){e.translate(y.x1,y.y1)}};var Ul=function e(t){if(!["overlay","underlay"].includes(t)){throw new Error("Invalid state")}return function(e,r,n,a,i){var o=this;if(!r.visible()){return}var s=r.pstyle("".concat(t,"-padding")).pfValue;var u=r.pstyle("".concat(t,"-opacity")).value;var l=r.pstyle("".concat(t,"-color")).value;var f=r.pstyle("".concat(t,"-shape")).value;if(u>0){n=n||r.position();if(a==null||i==null){var v=r.padding();a=r.width()+2*v;i=r.height()+2*v}o.colorFillStyle(e,l[0],l[1],l[2],u);o.nodeShapes[f].draw(e,n.x,n.y,a+s*2,i+s*2);e.fill()}}};Hl.drawNodeOverlay=Ul("overlay");Hl.drawNodeUnderlay=Ul("underlay");Hl.hasPie=function(e){e=e[0];return e._private.hasPie};Hl.drawPie=function(e,t,r,n){t=t[0];n=n||t.position();var a=t.cy().style();var i=t.pstyle("pie-size");var o=n.x;var s=n.y;var u=t.width();var l=t.height();var f=Math.min(u,l)/2;var v=0;var c=this.usePaths();if(c){o=0;s=0}if(i.units==="%"){f=f*i.pfValue}else if(i.pfValue!==undefined){f=i.pfValue/2}for(var d=1;d<=a.pieBackgroundN;d++){var h=t.pstyle("pie-"+d+"-background-size").value;var p=t.pstyle("pie-"+d+"-background-color").value;var g=t.pstyle("pie-"+d+"-background-opacity").value*r;var y=h/100;if(y+v>1){y=1-v}var m=1.5*Math.PI+2*Math.PI*v;var b=2*Math.PI*y;var x=m+b;if(h===0||v>=1||v+y>1){continue}e.beginPath();e.moveTo(o,s);e.arc(o,s,f,m,x);e.closePath();this.colorFillStyle(e,p[0],p[1],p[2],g);e.fill();v+=y}};var Kl={};var Zl=100;Kl.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null){return this.forcedPixelRatio}var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t};Kl.paintCache=function(e){var t=this.paintCaches=this.paintCaches||[];var r=true;var n;for(var a=0;a<t.length;a++){n=t[a];if(n.context===e){r=false;break}}if(r){n={context:e};t.push(n)}return n};Kl.createGradientStyleFor=function(e,t,r,n,a){var i;var o=this.usePaths();var s=r.pstyle(t+"-gradient-stop-colors").value,u=r.pstyle(t+"-gradient-stop-positions").pfValue;if(n==="radial-gradient"){if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),v=r.midpoint();var c=Ft(l,v);var d=Ft(f,v);i=e.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(c,d))}else{var h=o?{x:0,y:0}:r.position(),p=r.paddedWidth(),g=r.paddedHeight();i=e.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(p,g))}}else{if(r.isEdge()){var y=r.sourceEndpoint(),m=r.targetEndpoint();i=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=o?{x:0,y:0}:r.position(),x=r.paddedWidth(),w=r.paddedHeight(),E=x/2,k=w/2;var _=r.pstyle("background-gradient-direction").value;switch(_){case"to-bottom":i=e.createLinearGradient(b.x,b.y-k,b.x,b.y+k);break;case"to-top":i=e.createLinearGradient(b.x,b.y+k,b.x,b.y-k);break;case"to-left":i=e.createLinearGradient(b.x+E,b.y,b.x-E,b.y);break;case"to-right":i=e.createLinearGradient(b.x-E,b.y,b.x+E,b.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(b.x-E,b.y-k,b.x+E,b.y+k);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(b.x-E,b.y+k,b.x+E,b.y-k);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(b.x+E,b.y-k,b.x-E,b.y+k);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(b.x+E,b.y+k,b.x-E,b.y-k);break}}}if(!i)return null;var S=u.length===s.length;var D=s.length;for(var C=0;C<D;C++){i.addColorStop(S?u[C]:C/(D-1),"rgba("+s[C][0]+","+s[C][1]+","+s[C][2]+","+a+")")}return i};Kl.gradientFillStyle=function(e,t,r,n){var a=this.createGradientStyleFor(e,"background",t,r,n);if(!a)return null;e.fillStyle=a};Kl.colorFillStyle=function(e,t,r,n,a){e.fillStyle="rgba("+t+","+r+","+n+","+a+")"};Kl.eleFillStyle=function(e,t,r){var n=t.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient"){this.gradientFillStyle(e,t,n,r)}else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],r)}};Kl.gradientStrokeStyle=function(e,t,r,n){var a=this.createGradientStyleFor(e,"line",t,r,n);if(!a)return null;e.strokeStyle=a};Kl.colorStrokeStyle=function(e,t,r,n,a){e.strokeStyle="rgba("+t+","+r+","+n+","+a+")"};Kl.eleStrokeStyle=function(e,t,r){var n=t.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient"){this.gradientStrokeStyle(e,t,n,r)}else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],r)}};Kl.matchCanvasSize=function(e){var t=this;var r=t.data;var n=t.findContainerClientCoords();var a=n[2];var i=n[3];var o=t.getPixelRatio();var s=t.motionBlurPxRatio;if(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]){o=s}var u=a*o;var l=i*o;var f;if(u===t.canvasWidth&&l===t.canvasHeight){return}t.fontCaches=null;var v=r.canvasContainer;v.style.width=a+"px";v.style.height=i+"px";for(var c=0;c<t.CANVAS_LAYERS;c++){f=r.canvases[c];f.width=u;f.height=l;f.style.width=a+"px";f.style.height=i+"px"}for(var c=0;c<t.BUFFER_COUNT;c++){f=r.bufferCanvases[c];f.width=u;f.height=l;f.style.width=a+"px";f.style.height=i+"px"}t.textureMult=1;if(o<=1){f=r.bufferCanvases[t.TEXTURE_BUFFER];t.textureMult=2;f.width=u*t.textureMult;f.height=l*t.textureMult}t.canvasWidth=u;t.canvasHeight=l};Kl.renderTo=function(e,t,r,n){this.render({forcedContext:e,forcedZoom:t,forcedPan:r,drawAllLayers:true,forcedPxRatio:n})};Kl.render=function(e){e=e||et();var t=e.forcedContext;var r=e.drawAllLayers;var n=e.drawOnlyNodeLayer;var a=e.forcedZoom;var i=e.forcedPan;var o=this;var s=e.forcedPxRatio===undefined?this.getPixelRatio():e.forcedPxRatio;var u=o.cy;var l=o.data;var f=l.canvasNeedsRedraw;var v=o.textureOnViewport&&!t&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming);var c=e.motionBlur!==undefined?e.motionBlur:o.motionBlur;var d=o.motionBlurPxRatio;var h=u.hasCompoundNodes();var p=o.hoverData.draggingEles;var g=o.hoverData.selecting||o.touchData.selecting?true:false;c=c&&!t&&o.motionBlurEnabled&&!g;var y=c;if(!t){if(o.prevPxRatio!==s){o.invalidateContainerClientCoordsCache();o.matchCanvasSize(o.container);o.redrawHint("eles",true);o.redrawHint("drag",true)}o.prevPxRatio=s}if(!t&&o.motionBlurTimeout){clearTimeout(o.motionBlurTimeout)}if(c){if(o.mbFrames==null){o.mbFrames=0}o.mbFrames++;if(o.mbFrames<3){y=false}if(o.mbFrames>o.minMbLowQualFrames){o.motionBlurPxRatio=o.mbPxRBlurry}}if(o.clearingMotionBlur){o.motionBlurPxRatio=1}if(o.textureDrawLastFrame&&!v){f[o.NODE]=true;f[o.SELECT_BOX]=true}var m=u.style();var b=u.zoom();var x=a!==undefined?a:b;var w=u.pan();var E={x:w.x,y:w.y};var k={zoom:b,pan:{x:w.x,y:w.y}};var _=o.prevViewport;var S=_===undefined||k.zoom!==_.zoom||k.pan.x!==_.pan.x||k.pan.y!==_.pan.y;if(!S&&!(p&&!h)){o.motionBlurPxRatio=1}if(i){E=i}x*=s;E.x*=s;E.y*=s;var D=o.getCachedZSortedEles();function C(e,t,r,n,a){var i=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";o.colorFillStyle(e,255,255,255,o.motionBlurTransparency);e.fillRect(t,r,n,a);e.globalCompositeOperation=i}function T(e,n){var s,u,f,v;if(!o.clearingMotionBlur&&(e===l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||e===l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])){s={x:w.x*d,y:w.y*d};u=b*d;f=o.canvasWidth*d;v=o.canvasHeight*d}else{s=E;u=x;f=o.canvasWidth;v=o.canvasHeight}e.setTransform(1,0,0,1,0,0);if(n==="motionBlur"){C(e,0,0,f,v)}else if(!t&&(n===undefined||n)){e.clearRect(0,0,f,v)}if(!r){e.translate(s.x,s.y);e.scale(u,u)}if(i){e.translate(i.x,i.y)}if(a){e.scale(a,a)}}if(!v){o.textureDrawLastFrame=false}if(v){o.textureDrawLastFrame=true;if(!o.textureCache){o.textureCache={};o.textureCache.bb=u.mutableElements().boundingBox();o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var P=o.data.bufferContexts[o.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0);P.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult);o.render({forcedContext:P,drawOnlyNodeLayer:true,forcedPxRatio:s*o.textureMult});var k=o.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:o.canvasWidth,height:o.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}f[o.DRAG]=false;f[o.NODE]=false;var M=l.contexts[o.NODE];var I=o.textureCache.texture;var k=o.textureCache.viewport;M.setTransform(1,0,0,1,0,0);if(c){C(M,0,0,k.width,k.height)}else{M.clearRect(0,0,k.width,k.height)}var O=m.core("outside-texture-bg-color").value;var N=m.core("outside-texture-bg-opacity").value;o.colorFillStyle(M,O[0],O[1],O[2],N);M.fillRect(0,0,k.width,k.height);var b=u.zoom();T(M,false);M.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/s,k.height/k.zoom/s);M.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/s,k.height/k.zoom/s)}else if(o.textureOnViewport&&!t){o.textureCache=null}var z=u.extent();var L=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated();var A=o.hideEdgesOnViewport&&L;var B=[];B[o.NODE]=!f[o.NODE]&&c&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur;if(B[o.NODE]){o.clearedForMotionBlur[o.NODE]=true}B[o.DRAG]=!f[o.DRAG]&&c&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur;if(B[o.DRAG]){o.clearedForMotionBlur[o.DRAG]=true}if(f[o.NODE]||r||n||B[o.NODE]){var R=c&&!B[o.NODE]&&d!==1;var M=t||(R?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:l.contexts[o.NODE]);var j=c&&!R?"motionBlur":undefined;T(M,j);if(A){o.drawCachedNodes(M,D.nondrag,s,z)}else{o.drawLayeredElements(M,D.nondrag,s,z)}if(o.debug){o.drawDebugPoints(M,D.nondrag)}if(!r&&!c){f[o.NODE]=false}}if(!n&&(f[o.DRAG]||r||B[o.DRAG])){var R=c&&!B[o.DRAG]&&d!==1;var M=t||(R?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:l.contexts[o.DRAG]);T(M,c&&!R?"motionBlur":undefined);if(A){o.drawCachedNodes(M,D.drag,s,z)}else{o.drawCachedElements(M,D.drag,s,z)}if(o.debug){o.drawDebugPoints(M,D.drag)}if(!r&&!c){f[o.DRAG]=false}}if(o.showFps||!n&&f[o.SELECT_BOX]&&!r){var M=t||l.contexts[o.SELECT_BOX];T(M);if(o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var b=o.cy.zoom();var F=m.core("selection-box-border-width").value/b;M.lineWidth=F;M.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")";M.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]);if(F>0){M.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")";M.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1])}}if(l.bgActivePosistion&&!o.hoverData.selecting){var b=o.cy.zoom();var V=l.bgActivePosistion;M.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")";M.beginPath();M.arc(V.x,V.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI);M.fill()}var q=o.lastRedrawTime;if(o.showFps&&q){q=Math.round(q);var G=Math.round(1e3/q);M.setTransform(1,0,0,1,0,0);M.fillStyle="rgba(255, 0, 0, 0.75)";M.strokeStyle="rgba(255, 0, 0, 0.75)";M.lineWidth=1;M.fillText("1 frame = "+q+" ms = "+G+" fps",0,20);var Y=60;M.strokeRect(0,30,250,20);M.fillRect(0,30,250*Math.min(G/Y,1),20)}if(!r){f[o.SELECT_BOX]=false}}if(c&&d!==1){var W=l.contexts[o.NODE];var X=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE];var H=l.contexts[o.DRAG];var U=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG];var K=function e(t,r,n){t.setTransform(1,0,0,1,0,0);if(n||!y){t.clearRect(0,0,o.canvasWidth,o.canvasHeight)}else{C(t,0,0,o.canvasWidth,o.canvasHeight)}var a=d;t.drawImage(r,0,0,o.canvasWidth*a,o.canvasHeight*a,0,0,o.canvasWidth,o.canvasHeight)};if(f[o.NODE]||B[o.NODE]){K(W,X,B[o.NODE]);f[o.NODE]=false}if(f[o.DRAG]||B[o.DRAG]){K(H,U,B[o.DRAG]);f[o.DRAG]=false}}o.prevViewport=k;if(o.clearingMotionBlur){o.clearingMotionBlur=false;o.motionBlurCleared=true;o.motionBlur=true}if(c){o.motionBlurTimeout=setTimeout((function(){o.motionBlurTimeout=null;o.clearedForMotionBlur[o.NODE]=false;o.clearedForMotionBlur[o.DRAG]=false;o.motionBlur=false;o.clearingMotionBlur=!v;o.mbFrames=0;f[o.NODE]=true;f[o.DRAG]=true;o.redraw()}),Zl)}if(!t){u.emit("render")}};var $l={};$l.drawPolygonPath=function(e,t,r,n,a,i){var o=n/2;var s=a/2;if(e.beginPath){e.beginPath()}e.moveTo(t+o*i[0],r+s*i[1]);for(var u=1;u<i.length/2;u++){e.lineTo(t+o*i[u*2],r+s*i[u*2+1])}e.closePath()};$l.drawRoundPolygonPath=function(e,t,r,n,a,i){var o=n/2;var s=a/2;var u=Mr(n,a);if(e.beginPath){e.beginPath()}for(var l=0;l<i.length/4;l++){var f=void 0,v=void 0;if(l===0){f=i.length-2}else{f=l*4-2}v=l*4+2;var c=t+o*i[l*4];var d=r+s*i[l*4+1];var h=-i[f]*i[v]-i[f+1]*i[v+1];var p=u/Math.tan(Math.acos(h)/2);var g=c-p*i[f];var y=d-p*i[f+1];var m=c+p*i[v];var b=d+p*i[v+1];if(l===0){e.moveTo(g,y)}else{e.lineTo(g,y)}e.arcTo(c,d,m,b,u)}e.closePath()};$l.drawRoundRectanglePath=function(e,t,r,n,a){var i=n/2;var o=a/2;var s=Pr(n,a);if(e.beginPath){e.beginPath()}e.moveTo(t,r-o);e.arcTo(t+i,r-o,t+i,r,s);e.arcTo(t+i,r+o,t,r+o,s);e.arcTo(t-i,r+o,t-i,r,s);e.arcTo(t-i,r-o,t,r-o,s);e.lineTo(t,r-o);e.closePath()};$l.drawBottomRoundRectanglePath=function(e,t,r,n,a){var i=n/2;var o=a/2;var s=Pr(n,a);if(e.beginPath){e.beginPath()}e.moveTo(t,r-o);e.lineTo(t+i,r-o);e.lineTo(t+i,r);e.arcTo(t+i,r+o,t,r+o,s);e.arcTo(t-i,r+o,t-i,r,s);e.lineTo(t-i,r-o);e.lineTo(t,r-o);e.closePath()};$l.drawCutRectanglePath=function(e,t,r,n,a){var i=n/2;var o=a/2;var s=Ir();if(e.beginPath){e.beginPath()}e.moveTo(t-i+s,r-o);e.lineTo(t+i-s,r-o);e.lineTo(t+i,r-o+s);e.lineTo(t+i,r+o-s);e.lineTo(t+i-s,r+o);e.lineTo(t-i+s,r+o);e.lineTo(t-i,r+o-s);e.lineTo(t-i,r-o+s);e.closePath()};$l.drawBarrelPath=function(e,t,r,n,a){var i=n/2;var o=a/2;var s=t-i;var u=t+i;var l=r-o;var f=r+o;var v=Nr(n,a);var c=v.widthOffset;var d=v.heightOffset;var h=v.ctrlPtOffsetPct*c;if(e.beginPath){e.beginPath()}e.moveTo(s,l+d);e.lineTo(s,f-d);e.quadraticCurveTo(s+h,f,s+c,f);e.lineTo(u-c,f);e.quadraticCurveTo(u-h,f,u,f-d);e.lineTo(u,l+d);e.quadraticCurveTo(u-h,l,u-c,l);e.lineTo(s+c,l);e.quadraticCurveTo(s+h,l,s,l+d);e.closePath()};var Ql=Math.sin(0);var Jl=Math.cos(0);var ef={};var tf={};var rf=Math.PI/40;for(var nf=0*Math.PI;nf<2*Math.PI;nf+=rf){ef[nf]=Math.sin(nf);tf[nf]=Math.cos(nf)}$l.drawEllipsePath=function(e,t,r,n,a){if(e.beginPath){e.beginPath()}if(e.ellipse){e.ellipse(t,r,n/2,a/2,0,0,2*Math.PI)}else{var i,o;var s=n/2;var u=a/2;for(var l=0*Math.PI;l<2*Math.PI;l+=rf){i=t-s*ef[l]*Ql+s*tf[l]*Jl;o=r+u*tf[l]*Ql+u*ef[l]*Jl;if(l===0){e.moveTo(i,o)}else{e.lineTo(i,o)}}}e.closePath()};var af={};af.createBuffer=function(e,t){var r=document.createElement("canvas");r.width=e;r.height=t;return[r,r.getContext("2d")]};af.bufferCanvasImage=function(e){var t=this.cy;var r=t.mutableElements();var n=r.boundingBox();var a=this.findContainerClientCoords();var i=e.full?Math.ceil(n.w):a[2];var o=e.full?Math.ceil(n.h):a[3];var s=B(e.maxWidth)||B(e.maxHeight);var u=this.getPixelRatio();var l=1;if(e.scale!==undefined){i*=e.scale;o*=e.scale;l=e.scale}else if(s){var f=Infinity;var v=Infinity;if(B(e.maxWidth)){f=l*e.maxWidth/i}if(B(e.maxHeight)){v=l*e.maxHeight/o}l=Math.min(f,v);i*=l;o*=l}if(!s){i*=u;o*=u;l*=u}var c=document.createElement("canvas");c.width=i;c.height=o;c.style.width=i+"px";c.style.height=o+"px";var d=c.getContext("2d");if(i>0&&o>0){d.clearRect(0,0,i,o);d.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(e.full){d.translate(-n.x1*l,-n.y1*l);d.scale(l,l);this.drawElements(d,h);d.scale(1/l,1/l);d.translate(n.x1*l,n.y1*l)}else{var p=t.pan();var g={x:p.x*l,y:p.y*l};l*=t.zoom();d.translate(g.x,g.y);d.scale(l,l);this.drawElements(d,h);d.scale(1/l,1/l);d.translate(-g.x,-g.y)}if(e.bg){d.globalCompositeOperation="destination-over";d.fillStyle=e.bg;d.rect(0,0,i,o);d.fill()}}return c};function of(e,t){var r=atob(e);var n=new ArrayBuffer(r.length);var a=new Uint8Array(n);for(var i=0;i<r.length;i++){a[i]=r.charCodeAt(i)}return new Blob([n],{type:t})}function sf(e){var t=e.indexOf(",");return e.substr(t+1)}function uf(e,t,r){var n=function n(){return t.toDataURL(r,e.quality)};switch(e.output){case"blob-promise":return new fa((function(n,a){try{t.toBlob((function(e){if(e!=null){n(e)}else{a(new Error("`canvas.toBlob()` sent a null value in its callback"))}}),r,e.quality)}catch(e){a(e)}}));case"blob":return of(sf(n()),r);case"base64":return sf(n());case"base64uri":default:return n()}}af.png=function(e){return uf(e,this.bufferCanvasImage(e),"image/png")};af.jpg=function(e){return uf(e,this.bufferCanvasImage(e),"image/jpeg")};var lf={};lf.nodeShapeImpl=function(e,t,r,n,a,i,o){switch(e){case"ellipse":return this.drawEllipsePath(t,r,n,a,i);case"polygon":return this.drawPolygonPath(t,r,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(t,r,n,a,i,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,r,n,a,i);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,r,n,a,i);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,r,n,a,i);case"barrel":return this.drawBarrelPath(t,r,n,a,i)}};var ff=cf;var vf=cf.prototype;vf.CANVAS_LAYERS=3;vf.SELECT_BOX=0;vf.DRAG=1;vf.NODE=2;vf.BUFFER_COUNT=3;vf.TEXTURE_BUFFER=0;vf.MOTIONBLUR_BUFFER_NODE=1;vf.MOTIONBLUR_BUFFER_DRAG=2;function cf(e){var t=this;t.data={canvases:new Array(vf.CANVAS_LAYERS),contexts:new Array(vf.CANVAS_LAYERS),canvasNeedsRedraw:new Array(vf.CANVAS_LAYERS),bufferCanvases:new Array(vf.BUFFER_COUNT),bufferContexts:new Array(vf.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color";var n="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=n;a.position="relative";a.zIndex="0";a.overflow="hidden";var i=e.cy.container();i.appendChild(t.data.canvasContainer);i.style[r]=n;var o={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};if(Z()){o["-ms-touch-action"]="none";o["touch-action"]="none"}for(var s=0;s<vf.CANVAS_LAYERS;s++){var u=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=u.getContext("2d");Object.keys(o).forEach((function(e){u.style[e]=o[e]}));u.style.position="absolute";u.setAttribute("data-id","layer"+s);u.style.zIndex=String(vf.CANVAS_LAYERS-s);t.data.canvasContainer.appendChild(u);t.data.canvasNeedsRedraw[s]=false}t.data.topCanvas=t.data.canvases[0];t.data.canvases[vf.NODE].setAttribute("data-id","layer"+vf.NODE+"-node");t.data.canvases[vf.SELECT_BOX].setAttribute("data-id","layer"+vf.SELECT_BOX+"-selectbox");t.data.canvases[vf.DRAG].setAttribute("data-id","layer"+vf.DRAG+"-drag");for(var s=0;s<vf.BUFFER_COUNT;s++){t.data.bufferCanvases[s]=document.createElement("canvas");t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d");t.data.bufferCanvases[s].style.position="absolute";t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s);t.data.bufferCanvases[s].style.zIndex=String(-s-1);t.data.bufferCanvases[s].style.visibility="hidden"}t.pathsEnabled=true;var l=Ht();var f=function e(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}};var v=function e(t){return{x:-t.w/2,y:-t.h/2}};var c=function e(t){var r=t[0]._private;var n=r.oldBackgroundTimestamp===r.backgroundTimestamp;return!n};var d=function e(t){return t[0]._private.nodeKey};var h=function e(t){return t[0]._private.labelStyleKey};var p=function e(t){return t[0]._private.sourceLabelStyleKey};var g=function e(t){return t[0]._private.targetLabelStyleKey};var y=function e(r,n,a,i,o){return t.drawElement(r,n,a,false,false,o)};var m=function e(r,n,a,i,o){return t.drawElementText(r,n,a,i,"main",o)};var b=function e(r,n,a,i,o){return t.drawElementText(r,n,a,i,"source",o)};var x=function e(r,n,a,i,o){return t.drawElementText(r,n,a,i,"target",o)};var w=function e(t){t.boundingBox();return t[0]._private.bodyBounds};var E=function e(t){t.boundingBox();return t[0]._private.labelBounds.main||l};var k=function e(t){t.boundingBox();return t[0]._private.labelBounds.source||l};var _=function e(t){t.boundingBox();return t[0]._private.labelBounds.target||l};var S=function e(t,r){return r};var D=function e(t){return f(w(t))};var C=function e(t,r,n){var a=t?t+"-":"";return{x:r.x+n.pstyle(a+"text-margin-x").pfValue,y:r.y+n.pstyle(a+"text-margin-y").pfValue}};var T=function e(t,r,n){var a=t[0]._private.rscratch;return{x:a[r],y:a[n]}};var P=function e(t){return C("",T(t,"labelX","labelY"),t)};var M=function e(t){return C("source",T(t,"sourceLabelX","sourceLabelY"),t)};var I=function e(t){return C("target",T(t,"targetLabelX","targetLabelY"),t)};var O=function e(t){return v(w(t))};var N=function e(t){return v(k(t))};var z=function e(t){return v(_(t))};var L=function e(t){var r=E(t);var n=v(E(t));if(t.isNode()){switch(t.pstyle("text-halign").value){case"left":n.x=-r.w;break;case"right":n.x=0;break}switch(t.pstyle("text-valign").value){case"top":n.y=-r.h;break;case"bottom":n.y=0;break}}return n};var A=t.data.eleTxrCache=new ul(t,{getKey:d,doesEleInvalidateKey:c,drawElement:y,getBoundingBox:w,getRotationPoint:D,getRotationOffset:O,allowEdgeTxrCaching:false,allowParentTxrCaching:false});var B=t.data.lblTxrCache=new ul(t,{getKey:h,drawElement:m,getBoundingBox:E,getRotationPoint:P,getRotationOffset:L,isVisible:S});var R=t.data.slbTxrCache=new ul(t,{getKey:p,drawElement:b,getBoundingBox:k,getRotationPoint:M,getRotationOffset:N,isVisible:S});var j=t.data.tlbTxrCache=new ul(t,{getKey:g,drawElement:x,getBoundingBox:_,getRotationPoint:I,getRotationOffset:z,isVisible:S});var F=t.data.lyrTxrCache=new _l(t);t.onUpdateEleCalcs((function e(t,r){A.invalidateElements(r);B.invalidateElements(r);R.invalidateElements(r);j.invalidateElements(r);F.invalidateElements(r);for(var n=0;n<r.length;n++){var a=r[n]._private;a.oldBackgroundTimestamp=a.backgroundTimestamp}}));var V=function e(t){for(var r=0;r<t.length;r++){F.enqueueElementRefinement(t[r].ele)}};A.onDequeue(V);B.onDequeue(V);R.onDequeue(V);j.onDequeue(V)}vf.redrawHint=function(e,t){var r=this;switch(e){case"eles":r.data.canvasNeedsRedraw[vf.NODE]=t;break;case"drag":r.data.canvasNeedsRedraw[vf.DRAG]=t;break;case"select":r.data.canvasNeedsRedraw[vf.SELECT_BOX]=t;break}};var df=typeof Path2D!=="undefined";vf.path2dEnabled=function(e){if(e===undefined){return this.pathsEnabled}this.pathsEnabled=e?true:false};vf.usePaths=function(){return df&&this.pathsEnabled};vf.setImgSmoothing=function(e,t){if(e.imageSmoothingEnabled!=null){e.imageSmoothingEnabled=t}else{e.webkitImageSmoothingEnabled=t;e.mozImageSmoothingEnabled=t;e.msImageSmoothingEnabled=t}};vf.getImgSmoothing=function(e){if(e.imageSmoothingEnabled!=null){return e.imageSmoothingEnabled}else{return e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled}};vf.makeOffscreenCanvas=function(e,t){var r;if((typeof OffscreenCanvas==="undefined"?"undefined":h(OffscreenCanvas))!=="undefined"){r=new OffscreenCanvas(e,t)}else{r=document.createElement("canvas");r.width=e;r.height=t}return r};[Tl,Ll,ql,Yl,Wl,Hl,Kl,$l,af,lf].forEach((function(e){ve(vf,e)}));var hf=[{name:"null",impl:fu},{name:"base",impl:Bu},{name:"canvas",impl:ff}];var pf=[{type:"layout",extensions:lu},{type:"renderer",extensions:hf}];var gf={};var yf={};function mf(e,t,r){var n=r;var a=function r(n){Ue("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(ws.prototype[t]){return a(t)}else{ws.prototype[t]=r}}else if(e==="collection"){if(Lo.prototype[t]){return a(t)}else{Lo.prototype[t]=r}}else if(e==="layout"){var i=function e(t){this.options=t;r.call(this,t);if(!L(this._private)){this._private={}}this._private.cy=t.cy;this._private.listeners=[];this.createEmitter()};var o=i.prototype=Object.create(r.prototype);var s=[];for(var u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}if(o.start&&!o.run){o.run=function(){this.start();return this}}else if(!o.start&&o.run){o.start=function(){this.run();return this}}var f=r.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t){for(var r=0;r<t.length;r++){t[r].stop()}}}if(f){f.call(this)}else{this.emit("layoutstop")}return this};if(!o.destroy){o.destroy=function(){return this}}o.cy=function(){return this._private.cy};var v=function e(t){return t._private.cy};var c={addEventFields:function e(t,r){r.layout=t;r.cy=v(t);r.target=t},bubble:function e(){return true},parent:function e(t){return v(t)}};ve(o,{createEmitter:function e(){this._private.emitter=new $i(c,this);return this},emitter:function e(){return this._private.emitter},on:function e(t,r){this.emitter().on(t,r);return this},one:function e(t,r){this.emitter().one(t,r);return this},once:function e(t,r){this.emitter().one(t,r);return this},removeListener:function e(t,r){this.emitter().removeListener(t,r);return this},removeAllListeners:function e(){this.emitter().removeAllListeners();return this},emit:function e(t,r){this.emitter().emit(t,r);return this}});ga.eventAliasesOn(o);n=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var d=bf("renderer","base");var h=d.prototype;var p=r;var g=r.prototype;var y=function e(){d.apply(this,arguments);p.apply(this,arguments)};var m=y.prototype;for(var b in h){var x=h[b];var w=g[b]!=null;if(w){return a(b)}m[b]=x}for(var E in g){m[E]=g[E]}h.clientFunctions.forEach((function(e){m[e]=m[e]||function(){Xe("Renderer does not implement `renderer."+e+"()` on its prototype")}}));n=y}else if(e==="__proto__"||e==="constructor"||e==="prototype"){return Xe(e+" is an illegal type to be registered, possibly lead to prototype pollutions")}return me({map:gf,keys:[e,t],value:n})}function bf(e,t){return be({map:gf,keys:[e,t]})}function xf(e,t,r,n,a){return me({map:yf,keys:[e,t,r,n],value:a})}function wf(e,t,r,n){return be({map:yf,keys:[e,t,r,n]})}var Ef=function e(){if(arguments.length===2){return bf.apply(null,arguments)}else if(arguments.length===3){return mf.apply(null,arguments)}else if(arguments.length===4){return wf.apply(null,arguments)}else if(arguments.length===5){return xf.apply(null,arguments)}else{Xe("Invalid extension access syntax")}};ws.prototype.extension=Ef;pf.forEach((function(e){e.extensions.forEach((function(t){mf(e.type,t.name,t.impl)}))}));var kf=function e(){if(!(this instanceof e)){return new e}this.length=0};var _f=kf.prototype;_f.instanceString=function(){return"stylesheet"};_f.selector=function(e){var t=this.length++;this[t]={selector:e,properties:[]};return this};_f.css=function(e,t){var r=this.length-1;if(O(e)){this[r].properties.push({name:e,value:t})}else if(L(e)){var n=e;var a=Object.keys(n);for(var i=0;i<a.length;i++){var o=a[i];var s=n[o];if(s==null){continue}var u=ps.properties[o]||ps.properties[J(o)];if(u==null){continue}var l=u.name;var f=s;this[r].properties.push({name:l,value:f})}}return this};_f.style=_f.css;_f.generateStyle=function(e){var t=new ps(e);return this.appendToStyle(t)};_f.appendToStyle=function(e){for(var t=0;t<this.length;t++){var r=this[t];var n=r.selector;var a=r.properties;e.selector(n);for(var i=0;i<a.length;i++){var o=a[i];e.css(o.name,o.value)}}return e};var Sf="3.28.1";var Df=function e(t){if(t===undefined){t={}}if(L(t)){return new ws(t)}else if(O(t)){return Ef.apply(Ef,arguments)}};Df.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(Df);e.apply(null,t);return this};Df.warnings=function(e){return He(e)};Df.version=Sf;Df.stylesheet=Df.Stylesheet=kf;e.exports=Df},(e,t,r)=>{var n=r(138),a=r(139),i=r(142);var o="Expected a function";var s=Math.max,u=Math.min;function l(e,t,r){var l,f,v,c,d,h,p=0,g=false,y=false,m=true;if(typeof e!="function"){throw new TypeError(o)}t=i(t)||0;if(n(r)){g=!!r.leading;y="maxWait"in r;v=y?s(i(r.maxWait)||0,t):v;m="trailing"in r?!!r.trailing:m}function b(t){var r=l,n=f;l=f=undefined;p=t;c=e.apply(n,r);return c}function x(e){p=e;d=setTimeout(k,t);return g?b(e):c}function w(e){var r=e-h,n=e-p,a=t-r;return y?u(a,v-n):a}function E(e){var r=e-h,n=e-p;return h===undefined||r>=t||r<0||y&&n>=v}function k(){var e=a();if(E(e)){return _(e)}d=setTimeout(k,w(e))}function _(e){d=undefined;if(m&&l){return b(e)}l=f=undefined;return c}function S(){if(d!==undefined){clearTimeout(d)}p=0;l=h=f=d=undefined}function D(){return d===undefined?c:_(a())}function C(){var e=a(),r=E(e);l=arguments;f=this;h=e;if(r){if(d===undefined){return x(h)}if(y){clearTimeout(d);d=setTimeout(k,t);return b(h)}}if(d===undefined){d=setTimeout(k,t)}return c}C.cancel=S;C.flush=D;return C}e.exports=l},e=>{function t(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}e.exports=t},(e,t,r)=>{var n=r(140);var a=function(){return n.Date.now()};e.exports=a},(e,t,r)=>{var n=r(141);var a=typeof self=="object"&&self&&self.Object===Object&&self;var i=n||a||Function("return this")();e.exports=i},(e,t,r)=>{var n=typeof r.g=="object"&&r.g&&r.g.Object===Object&&r.g;e.exports=n},(e,t,r)=>{var n=r(143),a=r(138),i=r(145);var o=0/0;var s=/^[-+]0x[0-9a-f]+$/i;var u=/^0b[01]+$/i;var l=/^0o[0-7]+$/i;var f=parseInt;function v(e){if(typeof e=="number"){return e}if(i(e)){return o}if(a(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=a(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=n(e);var r=u.test(e);return r||l.test(e)?f(e.slice(2),r?2:8):s.test(e)?o:+e}e.exports=v},(e,t,r)=>{var n=r(144);var a=/^\s+/;function i(e){return e?e.slice(0,n(e)+1).replace(a,""):e}e.exports=i},e=>{var t=/\s/;function r(e){var r=e.length;while(r--&&t.test(e.charAt(r))){}return r}e.exports=r},(e,t,r)=>{var n=r(146),a=r(150);var i="[object Symbol]";function o(e){return typeof e=="symbol"||a(e)&&n(e)==i}e.exports=o},(e,t,r)=>{var n=r(147),a=r(148),i=r(149);var o="[object Null]",s="[object Undefined]";var u=n?n.toStringTag:undefined;function l(e){if(e==null){return e===undefined?s:o}return u&&u in Object(e)?a(e):i(e)}e.exports=l},(e,t,r)=>{var n=r(140);var a=n.Symbol;e.exports=a},(e,t,r)=>{var n=r(147);var a=Object.prototype;var i=a.hasOwnProperty;var o=a.toString;var s=n?n.toStringTag:undefined;function u(e){var t=i.call(e,s),r=e[s];try{e[s]=undefined;var n=true}catch(e){}var a=o.call(e);if(n){if(t){e[s]=r}else{delete e[s]}}return a}e.exports=u},e=>{var t=Object.prototype;var r=t.toString;function n(e){return r.call(e)}e.exports=n},e=>{function t(e){return e!=null&&typeof e=="object"}e.exports=t},(e,t,r)=>{e.exports=r(152)},function(e,t){var r,n,a;(function(){var i,o,s,u,l,f,v,c,d,h,p,g,y,m,b;s=Math.floor,h=Math.min;o=function(e,t){if(e<t){return-1}if(e>t){return 1}return 0};d=function(e,t,r,n,a){var i;if(r==null){r=0}if(a==null){a=o}if(r<0){throw new Error("lo must be non-negative")}if(n==null){n=e.length}while(r<n){i=s((r+n)/2);if(a(t,e[i])<0){n=i}else{r=i+1}}return[].splice.apply(e,[r,r-r].concat(t)),t};f=function(e,t,r){if(r==null){r=o}e.push(t);return m(e,0,e.length-1,r)};l=function(e,t){var r,n;if(t==null){t=o}r=e.pop();if(e.length){n=e[0];e[0]=r;b(e,0,t)}else{n=r}return n};c=function(e,t,r){var n;if(r==null){r=o}n=e[0];e[0]=t;b(e,0,r);return n};v=function(e,t,r){var n;if(r==null){r=o}if(e.length&&r(e[0],t)<0){n=[e[0],t],t=n[0],e[0]=n[1];b(e,0,r)}return t};u=function(e,t){var r,n,a,i,u,l,f,v;if(t==null){t=o}l=function(){v=[];for(var t=0,r=s(e.length/2);0<=r?t<r:t>r;0<=r?t++:t--){v.push(t)}return v}.apply(this).reverse();f=[];for(n=0,i=l.length;n<i;n++){r=l[n];f.push(b(e,r,t))}return f};y=function(e,t,r){var n;if(r==null){r=o}n=e.indexOf(t);if(n===-1){return}m(e,0,n,r);return b(e,n,r)};p=function(e,t,r){var n,a,i,s,l;if(r==null){r=o}a=e.slice(0,t);if(!a.length){return a}u(a,r);l=e.slice(t);for(i=0,s=l.length;i<s;i++){n=l[i];v(a,n,r)}return a.sort(r).reverse()};g=function(e,t,r){var n,a,i,s,f,v,c,p,g,y;if(r==null){r=o}if(t*10<=e.length){s=e.slice(0,t).sort(r);if(!s.length){return s}i=s[s.length-1];p=e.slice(t);for(f=0,c=p.length;f<c;f++){n=p[f];if(r(n,i)<0){d(s,n,0,null,r);s.pop();i=s[s.length-1]}}return s}u(e,r);y=[];for(a=v=0,g=h(t,e.length);0<=g?v<g:v>g;a=0<=g?++v:--v){y.push(l(e,r))}return y};m=function(e,t,r,n){var a,i,s;if(n==null){n=o}a=e[r];while(r>t){s=r-1>>1;i=e[s];if(n(a,i)<0){e[r]=i;r=s;continue}break}return e[r]=a};b=function(e,t,r){var n,a,i,s,u;if(r==null){r=o}a=e.length;u=t;i=e[t];n=2*t+1;while(n<a){s=n+1;if(s<a&&!(r(e[n],e[s])<0)){n=s}e[t]=e[n];t=n;n=2*t+1}e[t]=i;return m(e,u,t,r)};i=function(){e.push=f;e.pop=l;e.replace=c;e.pushpop=v;e.heapify=u;e.updateItem=y;e.nlargest=p;e.nsmallest=g;function e(e){this.cmp=e!=null?e:o;this.nodes=[]}e.prototype.push=function(e){return f(this.nodes,e,this.cmp)};e.prototype.pop=function(){return l(this.nodes,this.cmp)};e.prototype.peek=function(){return this.nodes[0]};e.prototype.contains=function(e){return this.nodes.indexOf(e)!==-1};e.prototype.replace=function(e){return c(this.nodes,e,this.cmp)};e.prototype.pushpop=function(e){return v(this.nodes,e,this.cmp)};e.prototype.heapify=function(){return u(this.nodes,this.cmp)};e.prototype.updateItem=function(e){return y(this.nodes,e,this.cmp)};e.prototype.clear=function(){return this.nodes=[]};e.prototype.empty=function(){return this.nodes.length===0};e.prototype.size=function(){return this.nodes.length};e.prototype.clone=function(){var t;t=new e;t.nodes=this.nodes.slice(0);return t};e.prototype.toArray=function(){return this.nodes.slice(0)};e.prototype.insert=e.prototype.push;e.prototype.top=e.prototype.peek;e.prototype.front=e.prototype.peek;e.prototype.has=e.prototype.contains;e.prototype.copy=e.prototype.clone;return e}();(function(i,o){if(true){return!(n=[],r=o,a=typeof r==="function"?r.apply(t,n):r,a!==undefined&&(e.exports=a))}else{}})(this,(function(){return i}))}).call(this)},(e,t,r)=>{var n=r(154);function a(e,t,r){var a=e==null?undefined:n(e,t);return a===undefined?r:a}e.exports=a},(e,t,r)=>{var n=r(155),a=r(195);function i(e,t){t=n(t,e);var r=0,i=t.length;while(e!=null&&r<i){e=e[a(t[r++])]}return r&&r==i?e:undefined}e.exports=i},(e,t,r)=>{var n=r(156),a=r(157),i=r(158),o=r(192);function s(e,t){if(n(e)){return e}return a(e,t)?[e]:i(o(e))}e.exports=s},e=>{var t=Array.isArray;e.exports=t},(e,t,r)=>{var n=r(156),a=r(145);var i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;function s(e,t){if(n(e)){return false}var r=typeof e;if(r=="number"||r=="symbol"||r=="boolean"||e==null||a(e)){return true}return o.test(e)||!i.test(e)||t!=null&&e in Object(t)}e.exports=s},(e,t,r)=>{var n=r(159);var a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var i=/\\(\\)?/g;var o=n((function(e){var t=[];if(e.charCodeAt(0)===46){t.push("")}e.replace(a,(function(e,r,n,a){t.push(n?a.replace(i,"$1"):r||e)}));return t}));e.exports=o},(e,t,r)=>{var n=r(160);var a=500;function i(e){var t=n(e,(function(e){if(r.size===a){r.clear()}return e}));var r=t.cache;return t}e.exports=i},(e,t,r)=>{var n=r(161);var a="Expected a function";function i(e,t){if(typeof e!="function"||t!=null&&typeof t!="function"){throw new TypeError(a)}var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a)){return i.get(a)}var o=e.apply(this,n);r.cache=i.set(a,o)||i;return o};r.cache=new(i.Cache||n);return r}i.Cache=n;e.exports=i},(e,t,r)=>{var n=r(162),a=r(186),i=r(189),o=r(190),s=r(191);function u(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n;u.prototype["delete"]=a;u.prototype.get=i;u.prototype.has=o;u.prototype.set=s;e.exports=u},(e,t,r)=>{var n=r(163),a=r(177),i=r(185);function o(){this.size=0;this.__data__={hash:new n,map:new(i||a),string:new n}}e.exports=o},(e,t,r)=>{var n=r(164),a=r(173),i=r(174),o=r(175),s=r(176);function u(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n;u.prototype["delete"]=a;u.prototype.get=i;u.prototype.has=o;u.prototype.set=s;e.exports=u},(e,t,r)=>{var n=r(165);function a(){this.__data__=n?n(null):{};this.size=0}e.exports=a},(e,t,r)=>{var n=r(166);var a=n(Object,"create");e.exports=a},(e,t,r)=>{var n=r(167),a=r(172);function i(e,t){var r=a(e,t);return n(r)?r:undefined}e.exports=i},(e,t,r)=>{var n=r(168),a=r(169),i=r(138),o=r(171);var s=/[\\^$.*+?()[\]{}|]/g;var u=/^\[object .+?Constructor\]$/;var l=Function.prototype,f=Object.prototype;var v=l.toString;var c=f.hasOwnProperty;var d=RegExp("^"+v.call(c).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(e){if(!i(e)||a(e)){return false}var t=n(e)?d:u;return t.test(o(e))}e.exports=h},(e,t,r)=>{var n=r(146),a=r(138);var i="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";function l(e){if(!a(e)){return false}var t=n(e);return t==o||t==s||t==i||t==u}e.exports=l},(e,t,r)=>{var n=r(170);var a=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function i(e){return!!a&&a in e}e.exports=i},(e,t,r)=>{var n=r(140);var a=n["__core-js_shared__"];e.exports=a},e=>{var t=Function.prototype;var r=t.toString;function n(e){if(e!=null){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}e.exports=n},e=>{function t(e,t){return e==null?undefined:e[t]}e.exports=t},e=>{function t(e){var t=this.has(e)&&delete this.__data__[e];this.size-=t?1:0;return t}e.exports=t},(e,t,r)=>{var n=r(165);var a="__lodash_hash_undefined__";var i=Object.prototype;var o=i.hasOwnProperty;function s(e){var t=this.__data__;if(n){var r=t[e];return r===a?undefined:r}return o.call(t,e)?t[e]:undefined}e.exports=s},(e,t,r)=>{var n=r(165);var a=Object.prototype;var i=a.hasOwnProperty;function o(e){var t=this.__data__;return n?t[e]!==undefined:i.call(t,e)}e.exports=o},(e,t,r)=>{var n=r(165);var a="__lodash_hash_undefined__";function i(e,t){var r=this.__data__;this.size+=this.has(e)?0:1;r[e]=n&&t===undefined?a:t;return this}e.exports=i},(e,t,r)=>{var n=r(178),a=r(179),i=r(182),o=r(183),s=r(184);function u(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n;u.prototype["delete"]=a;u.prototype.get=i;u.prototype.has=o;u.prototype.set=s;e.exports=u},e=>{function t(){this.__data__=[];this.size=0}e.exports=t},(e,t,r)=>{var n=r(180);var a=Array.prototype;var i=a.splice;function o(e){var t=this.__data__,r=n(t,e);if(r<0){return false}var a=t.length-1;if(r==a){t.pop()}else{i.call(t,r,1)}--this.size;return true}e.exports=o},(e,t,r)=>{var n=r(181);function a(e,t){var r=e.length;while(r--){if(n(e[r][0],t)){return r}}return-1}e.exports=a},e=>{function t(e,t){return e===t||e!==e&&t!==t}e.exports=t},(e,t,r)=>{var n=r(180);function a(e){var t=this.__data__,r=n(t,e);return r<0?undefined:t[r][1]}e.exports=a},(e,t,r)=>{var n=r(180);function a(e){return n(this.__data__,e)>-1}e.exports=a},(e,t,r)=>{var n=r(180);function a(e,t){var r=this.__data__,a=n(r,e);if(a<0){++this.size;r.push([e,t])}else{r[a][1]=t}return this}e.exports=a},(e,t,r)=>{var n=r(166),a=r(140);var i=n(a,"Map");e.exports=i},(e,t,r)=>{var n=r(187);function a(e){var t=n(this,e)["delete"](e);this.size-=t?1:0;return t}e.exports=a},(e,t,r)=>{var n=r(188);function a(e,t){var r=e.__data__;return n(t)?r[typeof t=="string"?"string":"hash"]:r.map}e.exports=a},e=>{function t(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}e.exports=t},(e,t,r)=>{var n=r(187);function a(e){return n(this,e).get(e)}e.exports=a},(e,t,r)=>{var n=r(187);function a(e){return n(this,e).has(e)}e.exports=a},(e,t,r)=>{var n=r(187);function a(e,t){var r=n(this,e),a=r.size;r.set(e,t);this.size+=r.size==a?0:1;return this}e.exports=a},(e,t,r)=>{var n=r(193);function a(e){return e==null?"":n(e)}e.exports=a},(e,t,r)=>{var n=r(147),a=r(194),i=r(156),o=r(145);var s=1/0;var u=n?n.prototype:undefined,l=u?u.toString:undefined;function f(e){if(typeof e=="string"){return e}if(i(e)){return a(e,f)+""}if(o(e)){return l?l.call(e):""}var t=e+"";return t=="0"&&1/e==-s?"-0":t}e.exports=f},e=>{function t(e,t){var r=-1,n=e==null?0:e.length,a=Array(n);while(++r<n){a[r]=t(e[r],r,e)}return a}e.exports=t},(e,t,r)=>{var n=r(145);var a=1/0;function i(e){if(typeof e=="string"||n(e)){return e}var t=e+"";return t=="0"&&1/e==-a?"-0":t}e.exports=i},(e,t,r)=>{var n=r(197);function a(e,t,r){return e==null?e:n(e,t,r)}e.exports=a},(e,t,r)=>{var n=r(198),a=r(155),i=r(201),o=r(138),s=r(195);function u(e,t,r,u){if(!o(e)){return e}t=a(t,e);var l=-1,f=t.length,v=f-1,c=e;while(c!=null&&++l<f){var d=s(t[l]),h=r;if(d==="__proto__"||d==="constructor"||d==="prototype"){return e}if(l!=v){var p=c[d];h=u?u(p,d,c):undefined;if(h===undefined){h=o(p)?p:i(t[l+1])?[]:{}}}n(c,d,h);c=c[d]}return e}e.exports=u},(e,t,r)=>{var n=r(199),a=r(181);var i=Object.prototype;var o=i.hasOwnProperty;function s(e,t,r){var i=e[t];if(!(o.call(e,t)&&a(i,r))||r===undefined&&!(t in e)){n(e,t,r)}}e.exports=s},(e,t,r)=>{var n=r(200);function a(e,t,r){if(t=="__proto__"&&n){n(e,t,{configurable:true,enumerable:true,value:r,writable:true})}else{e[t]=r}}e.exports=a},(e,t,r)=>{var n=r(166);var a=function(){try{var e=n(Object,"defineProperty");e({},"",{});return e}catch(e){}}();e.exports=a},e=>{var t=9007199254740991;var r=/^(?:0|[1-9]\d*)$/;function n(e,n){var a=typeof e;n=n==null?t:n;return!!n&&(a=="number"||a!="symbol"&&r.test(e))&&(e>-1&&e%1==0&&e<n)}e.exports=n},(e,t,r)=>{var n=r(194),a=r(203),i=r(156),o=r(145),s=r(158),u=r(195),l=r(192);function f(e){if(i(e)){return n(e,u)}return o(e)?[e]:a(s(l(e)))}e.exports=f},e=>{function t(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n){t[r]=e[r]}return t}e.exports=t},(e,t,r)=>{r(41)(r(205))},e=>{e.exports='!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cytoscapeContextMenus=t():e.cytoscapeContextMenus=t()}(self,(function(){return(()=>{var e={621:(e,t,n)=>{"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function o(e){for(var t="",n=0;n<e.length;n++)t+=e[n],n!==e.length-1&&(t+=" ");return t}function r(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function u(e,t,n){void 0===customElements.get(e)&&customElements.define(e,t,{extends:n})}n.r(t),n.d(t,{contextMenus:()=>O});var s="cy-context-menus-divider",a={evtType:"cxttap",menuItems:[],menuItemClasses:["cy-context-menus-cxt-menuitem"],contextMenuClasses:["cy-context-menus-cxt-menu"],submenuIndicator:{src:"assets/submenu-indicator-default.svg",width:12,height:12}};function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,u=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,r=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw r}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&C(e,t)}function y(e){var t=M();return function(){var n,i=I(e);if(t){var o=I(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return p(this,n)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?b(e):t}function b(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}function g(e,t,n){return(g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return x(e,arguments,I(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),C(i,e)})(e)}function x(e,t,n){return(x=M()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&C(o,n.prototype),o}).apply(null,arguments)}function M(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e){e.preventDefault(),e.stopPropagation()}var E=function(e){v(n,e);var t=y(n);function n(e,i,o){var u,s,a,c,l,f,h,m,v,y;d(this,n),g((s=b(y=t.call(this)),I(n.prototype)),"setAttribute",s).call(s,"id",e.id);var p=y._getMenuItemClassStr(o.cxtMenuItemClasses,e.hasTrailingDivider);if(g((a=b(y),I(n.prototype)),"setAttribute",a).call(a,"class",p),g((c=b(y),I(n.prototype)),"setAttribute",c).call(c,"title",null!==(u=e.tooltipText)&&void 0!==u?u:""),e.disabled&&r(b(y),"disabled",!0),e.image){var w=document.createElement("img");w.src=e.image.src,w.width=e.image.width,w.height=e.image.height,w.style.position="absolute",w.style.top=e.image.y+"px",w.style.left=e.image.x+"px",g((l=b(y),I(n.prototype)),"appendChild",l).call(l,w)}if(y.innerHTML+=e.content,y.onMenuItemClick=i,y.data={},y.clickFns=[],y.selector=e.selector,y.hasTrailingDivider=e.hasTrailingDivider,y.show=void 0===e.show||e.show,y.coreAsWell=e.coreAsWell||!1,y.scratchpad=o,void 0===e.onClickFunction&&void 0===e.submenu)throw new Error("A menu item must either have click function or a submenu or both");return y.onClickFunction=e.onClickFunction,e.submenu instanceof Array&&y._createSubmenu(e.submenu),g((f=b(y),I(n.prototype)),"addEventListener",f).call(f,"mousedown",k),g((h=b(y),I(n.prototype)),"addEventListener",h).call(h,"mouseup",k),g((m=b(y),I(n.prototype)),"addEventListener",m).call(m,"touchstart",k),g((v=b(y),I(n.prototype)),"addEventListener",v).call(v,"touchend",k),y}return m(n,[{key:"bindOnClickFunction",value:function(e){this.clickFns.push(e),g(I(n.prototype),"addEventListener",this).call(this,"click",e)}},{key:"unbindOnClickFunctions",value:function(){var e,t=l(this.clickFns);try{for(t.s();!(e=t.n()).done;){var i=e.value;g(I(n.prototype),"removeEventListener",this).call(this,"click",i)}}catch(e){t.e(e)}finally{t.f()}this.clickFns=[]}},{key:"enable",value:function(){r(this,"disabled",!1),this.hasSubmenu()&&this.addEventListener("mouseenter",this.mouseEnterHandler)}},{key:"disable",value:function(){r(this,"disabled",!0),this.hasSubmenu()&&this.removeEventListener("mouseenter",this.mouseEnterHandler)}},{key:"hide",value:function(){this.show=!1,this.style.display="none"}},{key:"getHasTrailingDivider",value:function(){return!!this.hasTrailingDivider}},{key:"setHasTrailingDivider",value:function(e){this.hasTrailingDivider=e}},{key:"hasSubmenu",value:function(){return this.submenu instanceof S}},{key:"appendSubmenuItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.hasSubmenu()||this._createSubmenu(),this.submenu.appendMenuItem(e,t)}},{key:"isClickable",value:function(){return void 0!==this.onClickFunction}},{key:"display",value:function(){this.show=!0,this.style.display="block"}},{key:"isVisible",value:function(){return!0===this.show&&"none"!==this.style.display}},{key:"removeSubmenu",value:function(){this.hasSubmenu()&&(this.submenu.removeAllMenuItems(),this.detachSubmenu())}},{key:"detachSubmenu",value:function(){this.hasSubmenu()&&(this.removeChild(this.submenu),this.removeChild(this.indicator),this.removeEventListener("mouseenter",this.mouseEnterHandler),this.removeEventListener("mouseleave",this.mouseLeaveHandler),this.submenu=void 0,this.indicator=void 0)}},{key:"_onMouseEnter",value:function(e){var t=this.getBoundingClientRect(),i=function(e){e.style.opacity="0",e.style.display="block";var t=e.getBoundingClientRect();return e.style.opacity="1",e.style.display="none",t}(this.submenu),o=t.right+i.width>window.innerWidth,r=t.top+i.height>window.innerHeight;o||r?o&&!r?(this.submenu.style.right=this.clientWidth+"px",this.submenu.style.top="0px",this.submenu.style.left="auto",this.submenu.style.bottom="auto"):o&&r?(this.submenu.style.right=this.clientWidth+"px",this.submenu.style.bottom="0px",this.submenu.style.top="auto",this.submenu.style.left="auto"):(this.submenu.style.left=this.clientWidth+"px",this.submenu.style.bottom="0px",this.submenu.style.right="auto",this.submenu.style.top="auto"):(this.submenu.style.left=this.clientWidth+"px",this.submenu.style.top="0px",this.submenu.style.right="auto",this.submenu.style.bottom="auto"),this.submenu.display();var u=Array.from(this.submenu.children).filter((function(e){if(e instanceof n)return e.isVisible()})),a=u.length;u.forEach((function(e,t){e instanceof n&&(t<a-1&&e.getHasTrailingDivider()?e.classList.add(s):e.getHasTrailingDivider()&&e.classList.remove(s))}))}},{key:"_onMouseLeave",value:function(e){var t,n,i,o,r;t={x:e.clientX,y:e.clientY},n=this.submenu,o=t.y,(i=t.x)>=(r=n.getBoundingClientRect()).left&&i<=r.right&&o>=r.top&&o<=r.bottom||this.submenu.hide()}},{key:"_createSubmenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.indicator=this.scratchpad.submenuIndicatorGen(),this.submenu=new S(this.onMenuItemClick,this.scratchpad),this.appendChild(this.indicator),this.appendChild(this.submenu);var t,i=l(e);try{for(i.s();!(t=i.n()).done;){var o=t.value,r=new n(o,this.onMenuItemClick,this.scratchpad);this.submenu.appendMenuItem(r)}}catch(e){i.e(e)}finally{i.f()}this.mouseEnterHandler=this._onMouseEnter.bind(this),this.mouseLeaveHandler=this._onMouseLeave.bind(this),this.addEventListener("mouseenter",this.mouseEnterHandler),this.addEventListener("mouseleave",this.mouseLeaveHandler)}},{key:"_getMenuItemClassStr",value:function(e,t){return t?e+" "+s:e}}],[{key:"define",value:function(){u("ctx-menu-item",n,"button")}}]),n}(w(HTMLButtonElement)),S=function(e){v(n,e);var t=y(n);function n(e,i){var o,r;return d(this,n),g((o=b(r=t.call(this)),I(n.prototype)),"setAttribute",o).call(o,"class",i.cxtMenuClasses),r.style.position="absolute",r.onMenuItemClick=e,r.scratchpad=i,r}return m(n,[{key:"hide",value:function(){this.isVisible()&&(this.hideSubmenus(),this.style.display="none")}},{key:"display",value:function(){this.style.display="block"}},{key:"isVisible",value:function(){return"none"!==this.style.display}},{key:"hideMenuItems",value:function(){var e,t=l(this.children);try{for(t.s();!(e=t.n()).done;){var n=e.value;n instanceof HTMLElement?n.style.display="none":console.warn("".concat(n," is not a HTMLElement"))}}catch(e){t.e(e)}finally{t.f()}}},{key:"hideSubmenus",value:function(){var e,t=l(this.children);try{for(t.s();!(e=t.n()).done;){var n=e.value;n instanceof E&&n.submenu&&n.submenu.hide()}}catch(e){t.e(e)}finally{t.f()}}},{key:"appendMenuItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(void 0!==t){if(t.parentNode!==this)throw new Error("The item with id=\'".concat(t.id,"\' is not a child of the context menu"));this.insertBefore(e,t)}else this.appendChild(e);e.isClickable()&&this._performBindings(e)}},{key:"moveBefore",value:function(e,t){if(e.parentNode!==this)throw new Error("The item with id=\'".concat(e.id,"\' is not a child of context menu"));if(t.parentNode!==this)throw new Error("The item with id=\'".concat(t.id,"\' is not a child of context menu"));this.removeChild(e),this.insertBefore(e,t)}},{key:"removeAllMenuItems",value:function(){for(;this.firstChild;){var e=this.lastChild;e instanceof E?this._removeImmediateMenuItem(e):(console.warn("Found non menu item in the context menu: ",e),this.removeChild(e))}}},{key:"_removeImmediateMenuItem",value:function(e){if(!this._detachImmediateMenuItem(e))throw new Error("menu item(id=".concat(e.id,") is not in the context menu"));e.detachSubmenu(),e.unbindOnClickFunctions()}},{key:"_detachImmediateMenuItem",value:function(e){if(e.parentNode===this){if(this.removeChild(e),this.children.length<=0){var t=this.parentNode;t instanceof E&&t.detachSubmenu()}return!0}return!1}},{key:"_performBindings",value:function(e){var t=this._bindOnClick(e.onClickFunction);e.bindOnClickFunction(t),e.bindOnClickFunction(this.onMenuItemClick)}},{key:"_bindOnClick",value:function(e){var t=this;return function(){var n=t.scratchpad.currentCyEvent;e(n)}}}],[{key:"define",value:function(){u("menu-item-list",n,"div")}}]),n}(w(HTMLDivElement)),T=function(e){v(n,e);var t=y(n);function n(e,i){var o;return d(this,n),(o=t.call(this,e,i)).onMenuItemClick=function(t){k(t),o.hide(),e()},o}return m(n,[{key:"removeMenuItem",value:function(e){var t=e.parentElement;t instanceof S&&this.contains(t)&&t._removeImmediateMenuItem(e)}},{key:"appendMenuItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.ensureDoesntContain(e.id),g(I(n.prototype),"appendMenuItem",this).call(this,e,t)}},{key:"insertMenuItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.before,i=t.parent;if(this.ensureDoesntContain(e.id),void 0!==n){if(!this.contains(n))throw new Error("before(id=".concat(n.id,") is not in the context menu"));var o=n.parentNode;if(!(o instanceof S))throw new Error("Parent of before(id=".concat(n.id,") is not a submenu"));o.appendMenuItem(e,n)}else if(void 0!==i){if(!this.contains(i))throw new Error("parent(id=".concat(i.id,") is not a descendant of the context menu"));i.appendSubmenuItem(e)}else this.appendMenuItem(e)}},{key:"moveBefore",value:function(e,t){var n=e.parentElement;if(!this.contains(n))throw new Error("parent(id=".concat(n.id,") is not in the contex menu"));if(!this.contains(t))throw new Error("before(id=".concat(t.id,") is not in the context menu"));n.removeChild(e),this.insertMenuItem(e,{before:t})}},{key:"moveToSubmenu",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.parentElement;if(!(i instanceof S))throw new Error("current parent(id=".concat(i.id,") is not a submenu"));if(!this.contains(i))throw new Error("parent of the menu item(id=".concat(i.id,") is not in the context menu"));if(null!==t){if(!this.contains(t))throw new Error("parent(id=".concat(t.id,") is not in the context menu"));i._detachImmediateMenuItem(e),t.appendSubmenuItem(e)}else null!==n&&(e.selector=n.selector,e.coreAsWell=n.coreAsWell),i._detachImmediateMenuItem(e),this.appendMenuItem(e)}},{key:"ensureDoesntContain",value:function(e){var t=document.getElementById(e);if(void 0!==t&&this.contains(t))throw new Error("There is already an element with id=".concat(e," in the context menu"))}}],[{key:"define",value:function(){u("ctx-menu",n,"div")}}]),n}(S);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function O(e){var t=this;t.scratch("cycontextmenus")||t.scratch("cycontextmenus",{});var n,r,u=function(e){return t.scratch("cycontextmenus")[e]},c=function(e,n){return t.scratch("cycontextmenus")[e]=n},l=u("options"),f=u("cxtMenu"),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=m(e);if(void 0!==t){var i=y(t);f.insertMenuItem(n,{parent:i})}else f.insertMenuItem(n)},h=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=0;n<e.length;n++)d(e[n],t)},m=function(e){var n=t.scratch("cycontextmenus");return new E(e,f.onMenuItemClick,n)},v=function(){u("active")&&(f.removeAllMenuItems(),t.off("tapstart",u("eventCyTapStart")),t.off(l.evtType,u("onCxttap")),t.off("viewport",u("onViewport")),document.removeEventListener("mouseup",u("hideOnNonCyClick")),f.parentNode.removeChild(f),f=void 0,c("cxtMenu",void 0),c("active",!1),c("anyVisibleChild",!1),c("onCxttap",void 0),c("onViewport",void 0),c("hideOnNonCyClick",void 0))},y=function(e){var t=document.getElementById(e);if(t instanceof E)return t;throw new Error("The item with id=".concat(e," is not a menu item"))};if("get"!==e){E.define(),S.define(),T.define(),l=function(e,t){var n={};for(var i in e)n[i]=e[i];for(var o in t)n[o]instanceof Array?n[o]=n[o].concat(t[o]):n[o]=t[o];return n}(a,e),c("options",l),u("active")&&v(),c("active",!0),c("submenuIndicatorGen",function(e){var t=document.createElement("img");return t.src=e.src,t.width=e.width,t.height=e.height,t.classList.add("cy-context-menus-submenu-indicator"),t}.bind(void 0,l.submenuIndicator));var p=o(l.contextMenuClasses);c("cxtMenuClasses",p);var b=t.scratch("cycontextmenus");f=new T((function(){return c("cxtMenuPosition",void 0)}),b),c("cxtMenu",f),t.container().appendChild(f),c("cxtMenuItemClasses",o(l.menuItemClasses));var g=l.menuItems;h(g),r=function(e){c("currentCyEvent",e),function(e){var n,i=t.container(),o=u("cxtMenuPosition"),r=e.position||e.cyPosition;if(o!=r){f.hideMenuItems(),c("anyVisibleChild",!1),c("cxtMenuPosition",r);var s={top:(n=i.getBoundingClientRect()).top,left:n.left},a=e.renderedPosition||e.cyRenderedPosition,l=getComputedStyle(i)["border-width"],d=parseInt(l.replace("px",""))||0;d>0&&(s.top+=d,s.left+=d);var h=i.clientHeight,m=i.clientWidth,v=h/2,y=m/2;a.y>v&&a.x<=y?(f.style.left=a.x+"px",f.style.bottom=h-a.y+"px",f.style.right="auto",f.style.top="auto"):a.y>v&&a.x>y?(f.style.right=m-a.x+"px",f.style.bottom=h-a.y+"px",f.style.left="auto",f.style.top="auto"):a.y<=v&&a.x<=y?(f.style.left=a.x+"px",f.style.top=a.y+"px",f.style.right="auto",f.style.bottom="auto"):(f.style.right=m-a.x+"px",f.style.top=a.y+"px",f.style.left="auto",f.style.bottom="auto")}}(e);var n,i=e.target||e.cyTarget,o=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,u=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,r=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw r}}}}(f.children);try{for(o.s();!(n=o.n()).done;){var r=n.value;r instanceof E&&(i===t?r.coreAsWell:i.is(r.selector))&&r.show&&(f.display(),c("anyVisibleChild",!0),r.display())}}catch(e){o.e(e)}finally{o.f()}var a=Array.from(f.children).filter((function(e){if(e instanceof E)return e.isVisible()})),l=a.length;a.forEach((function(e,t){e instanceof E&&(t<l-1&&e.getHasTrailingDivider()?e.classList.add(s):e.getHasTrailingDivider()&&e.classList.remove(s))})),!u("anyVisibleChild")&&!function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||e.style&&e.style.display||getComputedStyle(e).display}(f)&&f.hide()},t.on(l.evtType,r),c("onCxttap",r),function(){var e=function(e){if(f.contains(e.originalEvent.target))return!1;f.hide(),c("cxtMenuPosition",void 0),c("currentCyEvent",void 0)};t.on("tapstart",e),c("eventCyTapStart",e);var n=function(){f.hide()};t.on("viewport",n),c("onViewport",n)}(),n=function(e){t.container().contains(e.target)||f.contains(e.target)||(f.hide(),c("cxtMenuPosition",void 0))},document.addEventListener("mouseup",n),c("hideOnNonCyClick",n),function(){var e,t=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,u=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw u}}}}(document.getElementsByClassName("cy-context-menus-cxt-menu"));try{for(t.s();!(e=t.n()).done;)e.value.addEventListener("contextmenu",(function(e){return e.preventDefault()}))}catch(e){t.e(e)}finally{t.f()}}()}return function(e){return{isActive:function(){return u("active")},appendMenuItem:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return d(t,n),e},appendMenuItems:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return h(t,n),e},removeMenuItem:function(t){var n=y(t);return f.removeMenuItem(n),e},setTrailingDivider:function(t,n){var i=y(t);return i.setHasTrailingDivider(n),n?i.classList.add(s):i.classList.remove(s),e},insertBeforeMenuItem:function(t,n){var i=m(t),o=y(n);return f.insertMenuItem(i,{before:o}),e},moveToSubmenu:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=y(t);if(null===n)f.moveToSubmenu(i);else if("string"==typeof n){var o=y(n.toString());f.moveToSubmenu(i,o)}else void 0!==n.coreAsWell||void 0!==n.selector?f.moveToSubmenu(i,null,n):console.warn("options neither has coreAsWell nor selector property but it is an object. Are you sure that this is what you want to do?");return e},moveBeforeOtherMenuItem:function(t,n){var i=y(t),o=y(n);return f.moveBefore(i,o),e},disableMenuItem:function(t){return y(t).disable(),e},enableMenuItem:function(t){return y(t).enable(),e},hideMenuItem:function(t){return y(t).hide(),e},showMenuItem:function(t){return y(t).display(),e},destroy:function(){return v(),e}}}(this)}},579:(e,t,n)=>{var i=n(621).contextMenus,o=function(e){e&&e("core","contextMenus",i)};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}return n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(579)})()}));'},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{var n;(function(){"use strict";var a=function(e){if(!e){return}r(208);var t=false;var n={snapToGridOnRelease:true,snapToGridDuringDrag:false,snapToAlignmentLocationOnRelease:false,snapToAlignmentLocationDuringDrag:false,distributionGuidelines:false,geometricGuideline:false,initPosAlignment:false,centerToEdgeAlignment:false,resize:false,parentPadding:false,drawGrid:true,gridSpacing:20,snapToGridCenter:true,zoomDash:true,panGrid:false,gridStackOrder:-1,gridColor:"#dedede",lineWidth:1,guidelinesStackOrder:4,guidelinesTolerance:2,guidelinesStyle:{strokeStyle:"#8b7d6b",geometricGuidelineRange:400,range:100,minDistRange:10,distGuidelineOffset:10,horizontalDistColor:"#ff0000",verticalDistColor:"#00ff00",initPosAlignmentColor:"#0000ff",lineDash:[0,0],horizontalDistLine:[0,0],verticalDistLine:[0,0],initPosAlignmentLine:[0,0]},parentSpacing:-1};var a=r(209);var i=r(210);var o=r(211);var s=r(212);var u=r(213);var l=r(214);var f=r(216);var v=r(217);var c=r(218);function d(e){if(!e.scratch("_gridGuide")){e.scratch("_gridGuide",{})}return e.scratch("_gridGuide")}e("core","gridGuide",(function(r){var h=this;var p=d(h);var g=Object.extend({},p.options||n,r);p.options=g;if(!p.initialized){var y,m,b,x,w,E,k,_;y=a(h,g.gridSpacing,g.snapToGridCenter);m=s(g.gridSpacing);b=i(h,y);x=o(g,h,c);E=l(g,h,c);k=f(g,h);w=u(h,y,m,b,x,E,k,g);_=v(e,h,t);t=true;w.init(g);p.initialized=true;p.eventsController=w}else{var w=p.eventsController;w.syncWithOptions(g)}return this}))};if(true&&e.exports){e.exports=a}if(true){!(n=function(){return a}.call(t,r,t,e),n!==undefined&&(e.exports=n))}if(typeof cytoscape!=="undefined"){a(cytoscape)}})()},()=>{Object.extend=function(e){e=e||{};for(var t=1;t<arguments.length;t++){var r=arguments[t];if(!r)continue;for(var n in r){if(r.hasOwnProperty(n)){if(Array.isArray(r[n])){e[n]=r[n].slice()}else if(typeof r[n]==="object"){e[n]=Object.extend(e[n],r[n])}else{e[n]=r[n]}}}}return e}},e=>{e.exports=function(e,t,r){var n={};n.changeOptions=function(e){t=e.gridSpacing;r=e.snapToGridCenter?.5:0};var a=function(e){if(!e.scratch("_gridGuide"))e.scratch("_gridGuide",{});return e.scratch("_gridGuide")};n.snapPos=function(e){var n=r?Math.floor(e.x/t):Math.round(e.x/t);var a=r?Math.floor(e.y/t):Math.round(e.y/t);var i={x:(n+r)*t,y:(a+r)*t};return i};n.snapNode=function(e){var t=e.position();var r=n.snapPos(t);e.position(r)};n.snapNodesTopDown=function(t){e.startBatch();t.union(t.descendants()).filter(":childless").positions((function(e,t){if(typeof e==="number"){e=t}var r=e.position();return n.snapPos(r)}));e.endBatch()};n.onFreeNode=function(e){var t;var r=e.target||e.cyTarget;if(r.selected())t=e.cy.$(":selected");else t=r;n.snapNodesTopDown(t)};n.recoverSnapNode=function(e){var t=a(e).snap;if(t){e.position(t.oldPos)}};return n}},e=>{e.exports=function(e,t){var r={};var n;var a;var i;var o;r.onTapStartNode=function(t){if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey){return}var r=t.target||t.cyTarget;if(r.selected())a=t.cy.$(":selected");else a=r;i=t.position||t.cyPosition;if(r.grabbable()&&!r.locked()){n=r;n.lock();e.on("tapdrag",l);e.on("tapend",s)}};var s=function(t){e.off("tapdrag",l);e.off("tapend",s);n.unlock();t.preventDefault()};var u=function(){return{x:o.x-i.x,y:o.y-i.y}};var l=function(e){var r=n.position();o=e.position||e.cyPosition;o=t.snapPos(o);var s=u();if(s.x!=0||s.y!=0){n.unlock();var l=a.union(a.descendants());l.filter(":childless").positions((function(e,r){if(typeof e==="number"){e=r}var n=e.position();return t.snapPos({x:n.x+s.x,y:n.y+s.y})}));i=o;n.lock();n.trigger("drag")}};return r}},e=>{e.exports=function(e,t,r){var n=e;var a=function(e){n=e};var i=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}};var o=document.createElement("canvas");var s=t.container();var u=o.getContext("2d");s.appendChild(o);var l=function(){o.height=0;o.width=0;o.style.position="absolute";o.style.top=0;o.style.left=0;o.style.zIndex=n.gridStackOrder};l();var f=function(){var e=t.zoom();var r=t.width();var a=t.height();var i=n.gridSpacing*e;var o=t.pan();var s=o.x%i;var l=o.y%i;u.strokeStyle=n.gridColor;u.lineWidth=n.lineWidth;var f='\t<svg width="'+r+'" height="'+a+'" xmlns="http://www.w3.org/2000/svg">\n <defs>\n <pattern id="horizontalLines" width="'+i+'" height="'+i+'" patternUnits="userSpaceOnUse">\n <path d="M '+i+" 0 L 0 0 0 "+0+'" fill="none" stroke="'+n.gridColor+'" stroke-width="'+n.lineWidth+'" />\n </pattern>\n <pattern id="verticalLines" width="'+i+'" height="'+i+'" patternUnits="userSpaceOnUse">\n <path d="M '+0+" 0 L 0 0 0 "+i+'" fill="none" stroke="'+n.gridColor+'" stroke-width="'+n.lineWidth+'" />\n </pattern>\n </defs>\n <rect width="100%" height="100%" fill="url(#horizontalLines)" transform="translate('+0+", "+l+')" />\n <rect width="100%" height="100%" fill="url(#verticalLines)" transform="translate('+s+", "+0+')" />\n </svg>\n';var c=new Image;f=encodeURIComponent(f);c.onload=function(){v();u.drawImage(c,0,0)};c.src="data:image/svg+xml,"+f};var v=function(){var e=t.width();var r=t.height();u.clearRect(0,0,e,r)};var c=r((function(){o.height=t.height();o.width=t.width();o.style.position="absolute";o.style.top=0;o.style.left=0;o.style.zIndex=n.gridStackOrder;setTimeout((function(){o.height=t.height();o.width=t.width();var e=i(o);var r=i(s);o.style.top=-(e.top-r.top);o.style.left=-(e.left-r.left);f()}),0)}),250);return{initCanvas:c,resizeCanvas:c,resetCanvas:l,clearCanvas:v,drawGrid:f,changeOptions:a,sizeCanvas:f}}},e=>{e.exports=function(e){var t=function(t){e=Number(t.gridSpacing)};var r=function(e){if(!e.scratch("_gridGuide"))e.scratch("_gridGuide",{});return e.scratch("_gridGuide")};function n(t){var n=t.width();var a=t.height();var i=Math.round((n-e)/(e*2))*(e*2);var o=Math.round((a-e)/(e*2))*(e*2);i=i>0?i+e:e;o=o>0?o+e:e;if(n!=i||a!=o){t.style({width:i,height:o});r(t).resize={oldWidth:n,oldHeight:a}}}function a(e){var t=r(e).resize;if(t)e.style({width:t.oldWidth,height:t.oldHeight})}return{resizeNode:n,recoverNodeDimensions:a,changeOptions:t}}},e=>{e.exports=function(e,t,r,n,a,i,o,s){var u=function(e){return function(t){e(t)}};var l={snapToGridDuringDrag:new u(h),resize:new u(m),snapToGridOnRelease:new u(E),drawGrid:new u(S),guidelines:new u(N),parentPadding:new u(A)};function f(e,t){return function(r){var n=r.target||r.cyTarget;if(!n.is(":parent")||t)e(n)}}function v(t){return function(){e.nodes().not(":parent").each((function(e,r){if(typeof e==="number"){e=r}t(e)}))}}function c(t){return function(){e.nodes().each((function(e,r){if(typeof e==="number"){e=r}t(e)}))}}function d(e){return e?"on":"off"}function h(t){e[d(t)]("tapstart","node",n.onTapStartNode)}var p=v(r.resizeNode);var g=f(r.resizeNode);var y=v(r.recoverNodeDimensions);function m(t){e[d(t)]("ready",p);t?p():y()}var b=c(t.snapNodesTopDown);var x=c(t.recoverSnapNode);var w=f(t.snapNode,true);function E(r){e[d(r)]("add","node",w);e[d(r)]("ready",b);e[d(r)]("free","node",t.onFreeNode);if(r){b()}else{x()}}var k=function(){if(R.zoomDash)a.drawGrid()};var _=function(){if(R.panGrid)a.drawGrid()};function S(t){e[d(t)]("zoom",k);e[d(t)]("pan",_);if(t){a.initCanvas();e.on("resize",a.resizeCanvas)}else{a.clearCanvas();a.resetCanvas();e.off("resize",a.resizeCanvas)}}var D=null;var C=function(e){var t=e.target||e.cyTarget;var r=t.selected()?e.cy.$(":selected"):t;D=i.getTopMostNodes(r.nodes());i.lines.init(D)};var T=function(e){if(this.id()==D.id()){i.lines.update(D);if(R.snapToAlignmentLocationDuringDrag)i.lines.snapToAlignmentLocation(D)}};var P=function(e){if(R.snapToAlignmentLocationOnRelease)i.lines.snapToAlignmentLocation(D);i.lines.destroy();D=null};var M=function(e){i.lines.resize()};var I=function(e){i.getMousePos(e)};var O=function(t){if(D){i.setMousePos(e.pan());i.lines.init(D)}};function N(t){if(t){i.resizeCanvas();e.on("tapstart","node",I);e.on("grab",C);e.on("pan",O);e.on("drag","node",T);e.on("free",P);window.addEventListener("resize",M)}else{e.off("tapstart","node",I);e.off("grab",C);e.off("pan",O);e.off("drag","node",T);e.off("free",P);i.resetCanvas();window.removeEventListener("resize",M)}}var z=function(t){o.setPaddingOfParent(e.nodes(":parent"),t)};var L=function(e){o.setPaddingOfParent(e,true)};function A(t){z(t);e[d(t)]("ready",z);e[d(t)]("add","node:parent",f(L,true))}var B={};var R;var j={drawGrid:["gridSpacing","zoomDash","panGrid","gridStackOrder","gridColor","lineWidth","lineDash"],guidelines:["gridSpacing","guidelinesStackOrder","guidelinesTolerance","guidelinesStyle","distributionGuidelines","range","minDistRange","geometricGuidelineRange"],resize:["gridSpacing"],parentPadding:["gridSpacing","parentSpacing"],snapToGridOnRelease:["gridSpacing","snapToGridCenter"]};function F(e){R=Object.extend({},e);e.guidelines=e.initPosAlignment||e.distributionGuidelines||e.geometricGuideline;for(var n in e)if(B[n]!=e[n])if(l.hasOwnProperty(n)){l[n](e[n])}else{for(var s in j){var u=j[s];if(u.indexOf(n)>=0){if(s=="drawGrid"){a.changeOptions(e);if(e.drawGrid)a.resizeCanvas()}if(s=="snapToGridOnRelease"){t.changeOptions(e);if(e.snapToGridOnRelease)b()}if(s=="guidelines")i.changeOptions(e);if(s=="resize"){r.changeOptions(e);if(e.resize)p()}if(s=="parentPadding")o.changeOptions(e)}}}B=Object.extend({},B,e)}return{init:F,syncWithOptions:F}}},(e,t,r)=>{e.exports=function(e,t,n){var a=r(215);var i=e;var o=function(e){i=e;if(i.guidelinesTolerance==0)i.guidelinesTolerance=.001};var s=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}};var u=function(){var e=t.scratch("_guidelines");if(!e)e=t.scratch("_guidelines",{});return e};var l=n((function(){f();v.height=t.height();v.width=t.width();v.style.position="absolute";v.style.top=0;v.style.left=0;v.style.zIndex=i.guidelinesStackOrder;setTimeout((function(){v.height=t.height();v.width=t.width();var e=s(v);var r=s(c);v.style.top=-(e.top-r.top);v.style.left=-(e.left-r.left)}),0)}),250);var f=function(){var e=t.width();var r=t.height();d.clearRect(0,0,e,r)};var v=document.createElement("canvas");var c=t.container();var d=v.getContext("2d");c.appendChild(v);var h=function(){v.height=0;v.width=0;v.style.position="absolute";v.style.top=0;v.style.left=0;v.style.zIndex=i.guidelinesStackOrder};h();var p=null;var g=null;var y;var m;var b={};var x={};var w={h:null,v:null};b.getDims=function(e){var t=e.renderedPosition();var r=e.renderedWidth();var n=e.renderedHeight();var a={left:Number(e.renderedStyle("padding-left").replace("px","")),right:Number(e.renderedStyle("padding-right").replace("px","")),top:Number(e.renderedStyle("padding-top").replace("px","")),bottom:Number(e.renderedStyle("padding-bottom").replace("px",""))};return{horizontal:{center:t.x,left:Math.round(t.x-(a.left+r/2)),right:Math.round(t.x+(a.right+r/2))},vertical:{center:t.y,top:Math.round(t.y-(a.top+n/2)),bottom:Math.round(t.y+(a.bottom+n/2))}}};b.init=function(e){p=a();g=a();if(!y){x.x=t.pan("x");x.y=t.pan("y");y=e.renderedPosition()}var r=t.nodes(":visible");m=e.union(e.ancestors());m=m.union(e.descendants());r.not(m).each((function(e,t){if(typeof e==="number"){e=t}var r=b.getDims(e);["left","center","right"].forEach((function(t){var n=r.horizontal[t];if(g.get(n))g.get(n).push(e);else g=g.insert(n,[e])}));["top","center","bottom"].forEach((function(t){var n=r.vertical[t];if(p.get(n))p.get(n).push(e);else p=p.insert(n,[e])}))}));d.lineWidth=i.lineWidth;b.update(e)};b.destroy=function(){b.clear();p=null;g=null;y=null;_={};w={h:null,v:null};if(N){N.unlock();N=undefined}};b.clear=f;b.drawLine=function(e,t,r,n){d.setLineDash(n);d.beginPath();d.moveTo(e.x,e.y);d.lineTo(t.x,t.y);d.strokeStyle=r;d.stroke()};b.drawArrow=function(e,t){if(t=="right"){d.setLineDash([]);d.beginPath();d.moveTo(e.x-5,e.y-5);d.lineTo(e.x,e.y);d.lineTo(e.x-5,e.y+5);d.stroke()}else if(t=="left"){d.setLineDash([]);d.beginPath();d.moveTo(e.x+5,e.y-5);d.lineTo(e.x,e.y);d.lineTo(e.x+5,e.y+5);d.stroke()}else if(t=="top"){d.setLineDash([]);d.beginPath();d.moveTo(e.x-5,e.y+5);d.lineTo(e.x,e.y);d.lineTo(e.x+5,e.y+5);d.stroke()}else if(t=="bottom"){d.setLineDash([]);d.beginPath();d.moveTo(e.x-5,e.y-5);d.lineTo(e.x,e.y);d.lineTo(e.x+5,e.y-5);d.stroke()}};b.drawCross=function(e){d.setLineDash([]);d.beginPath();d.moveTo(e.x-5,e.y+5);d.lineTo(e.x+5,e.y-5);d.moveTo(e.x-5,e.y-5);d.lineTo(e.x+5,e.y+5);d.stroke()};var E=function(e,r){var n=e[0],a=b.getDims(n)[r]["center"];var o=e[0],s=b.getDims(o)[r]["center"];for(var u=0;u<e.length;u++){var l=e[u];if(b.getDims(l)[r]["center"]<a){a=b.getDims(l)[r]["center"];n=l}if(b.getDims(l)[r]["center"]>s){s=b.getDims(l)[r]["center"];o=l}}if(r=="horizontal")var f=(a+s)/2<b.getDims(e[1])[r]["center"]?s+(.5*o.width()+i.guidelinesStyle.distGuidelineOffset)*t.zoom():a-(.5*n.width()+i.guidelinesStyle.distGuidelineOffset)*t.zoom();else var f=(a+s)/2<b.getDims(e[1])[r]["center"]?s+(.5*o.height()+i.guidelinesStyle.distGuidelineOffset)*t.zoom():a-(.5*n.height()+i.guidelinesStyle.distGuidelineOffset)*t.zoom();return f};b.horizontalDistribution=function(e){var r=null,n=null;var a=b.getDims(e);var o=a["horizontal"]["center"];var s=a["vertical"]["center"];g.forEach((function(e,u){for(var l=0;l<u.length;l++){var f=u[l];var v=b.getDims(f);if(Math.abs(v["vertical"]["center"]-a["vertical"]["center"])<i.guidelinesStyle.range*t.zoom()){if(v["horizontal"]["right"]==e&&a["horizontal"]["left"]-v["horizontal"]["right"]>i.guidelinesStyle.minDistRange){var c=Math.round(2*o)-e;g.forEach((function(e,a){for(var o=0;o<a.length;o++){var u=a[o];if(Math.abs(b.getDims(u)["vertical"]["center"]-s)<i.guidelinesStyle.range*t.zoom()){if(Math.abs(c-b.getDims(u)["horizontal"]["left"])<2*i.guidelinesTolerance){r=f;n=u}}}}),c-i.guidelinesTolerance,c+i.guidelinesTolerance)}}}}),o-i.guidelinesStyle.range*t.zoom(),o);if(r){w.hd=o-(b.getDims(n)["horizontal"]["left"]+b.getDims(r)["horizontal"]["right"])/2;if(!i.geometricGuideline||w.h==null||Math.abs(w.h)>Math.abs(w.hd)){w.h=w.hd}var u=E([r,e,n],"vertical");b.drawLine({x:b.getDims(r)["horizontal"]["right"],y:u},{x:a["horizontal"]["left"],y:u},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(n)["horizontal"]["left"],y:u},{x:a["horizontal"]["right"],y:u},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(r)["horizontal"]["right"],y:u},{x:b.getDims(r)["horizontal"]["right"],y:b.getDims(r)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(n)["horizontal"]["left"],y:u},{x:b.getDims(n)["horizontal"]["left"],y:b.getDims(n)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:a["horizontal"]["left"],y:u},{x:a["horizontal"]["left"],y:s},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:a["horizontal"]["right"],y:u},{x:a["horizontal"]["right"],y:s},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawArrow({x:b.getDims(r)["horizontal"]["right"],y:u},"left");b.drawArrow({x:a["horizontal"]["left"],y:u},"right");b.drawArrow({x:a["horizontal"]["right"],y:u},"left");b.drawArrow({x:b.getDims(n)["horizontal"]["left"],y:u},"right")}else{var l=b.horizontalDistributionNext(e,"left");if(!l)b.horizontalDistributionNext(e,"right")}};b.verticalDistribution=function(e){var r=null,n=null;var a=b.getDims(e);var o=a["horizontal"]["center"];var s=a["vertical"]["center"];p.forEach((function(e,u){for(var l=0;l<u.length;l++){var f=u[l];var v=b.getDims(f);if(Math.abs(v["horizontal"]["center"]-a["horizontal"]["center"])<i.guidelinesStyle.range*t.zoom()){if(v["vertical"]["bottom"]==e&&a["vertical"]["top"]-v["vertical"]["bottom"]>i.guidelinesStyle.minDistRange){var c=Math.round(2*s-e);p.forEach((function(e,a){for(var s=0;s<a.length;s++){var u=a[s];if(Math.abs(b.getDims(u)["horizontal"]["center"]-o)<i.guidelinesStyle.range*t.zoom()){if(Math.abs(c-b.getDims(u)["vertical"]["top"])<2*i.guidelinesTolerance){r=f;n=u}}}}),c-i.guidelinesTolerance,c+i.guidelinesTolerance)}}}}),s-i.guidelinesStyle.range*t.zoom(),s);if(r){w.vd=s-(b.getDims(r)["vertical"]["bottom"]+b.getDims(n)["vertical"]["top"])/2;if(!i.geometricGuideline||w.v==null||Math.abs(w.v)>Math.abs(w.vd)){w.v=w.vd}var u=E([r,e,n],"horizontal");b.drawLine({y:b.getDims(r)["vertical"]["bottom"],x:u},{y:a["vertical"]["top"],x:u},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:b.getDims(n)["vertical"]["top"],x:u},{y:a["vertical"]["bottom"],x:u},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:b.getDims(r)["vertical"]["bottom"],x:u},{y:b.getDims(r)["vertical"]["bottom"],x:b.getDims(r)["horizontal"]["center"]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:b.getDims(n)["vertical"]["top"],x:u},{y:b.getDims(n)["vertical"]["top"],x:b.getDims(n)["horizontal"]["center"]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:a["vertical"]["bottom"],x:u},{y:a["vertical"]["bottom"],x:o},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:a["vertical"]["top"],x:u},{y:a["vertical"]["top"],x:o},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawArrow({x:u,y:b.getDims(r)["vertical"]["bottom"]},"top");b.drawArrow({x:u,y:a["vertical"]["top"]},"bottom");b.drawArrow({x:u,y:b.getDims(n)["vertical"]["top"]},"bottom");b.drawArrow({x:u,y:a["vertical"]["bottom"]},"top")}else{var l=b.verticalDistributionNext(e,"below");if(!l)b.verticalDistributionNext(e,"above")}};b.searchForLine=function(e,r){var n,a,o,s,u,l,f;var v=b.getDims(r)[e];var c=Number.MAX_SAFE_INTEGER;if(e=="horizontal"){l=g;s="y";u="x";w.h=null}else{l=p;s="x";u="y";w.v=null}o=r.renderedPosition(s);for(var d in v){n=v[d];l.forEach((function(e,r){for(var n=0;n<r.length;n++){var l=r[n];if(i.centerToEdgeAlignment||d!="center"&&l.renderedPosition(u)!=e||d=="center"&&l.renderedPosition(u)==e){var v=Math.abs(o-l.renderedPosition(s));if(v<c&&v<i.guidelinesStyle.geometricGuidelineRange*t.zoom()){a=l;c=v;f=e}}}}),n-Number(i.guidelinesTolerance),n+Number(i.guidelinesTolerance));if(a){c=b.getDims(r)[e][d];if(e=="horizontal"){w.h=c-f;b.drawLine({x:c,y:r.renderedPosition("y")},{x:c,y:a.renderedPosition("y")},i.guidelinesStyle.strokeStyle,i.guidelinesStyle.lineDash)}else{w.v=c-f;b.drawLine({x:r.renderedPosition("x"),y:c},{x:a.renderedPosition("x"),y:c},i.guidelinesStyle.strokeStyle,i.guidelinesStyle.lineDash)}break}}};b.horizontalDistributionNext=function(e,r){var n=null,a=null;var o=b.getDims(e);var s=o["horizontal"]["center"];var u=o["vertical"]["center"];var l="right",f="left";var v=s;if(r=="left"){l="left";f="right";var v=s-i.guidelinesStyle.range*t.zoom()}var c={left:function(e,t){return t-e>i.guidelinesStyle.minDistRange},right:function(e,t){return e-t>i.guidelinesStyle.minDistRange}};g.forEach((function(e,s){for(var v=0;v<s.length;v++){var d=s[v];var h=b.getDims(d);if(Math.abs(h["vertical"]["center"]-o["vertical"]["center"])<i.guidelinesStyle.range*t.zoom()){if(h["horizontal"][f]==e&&c[r](h["horizontal"][f],o["horizontal"][l])){var p=h["horizontal"][l]-(o["horizontal"][l]-e);g.forEach((function(e,r){for(var o=0;o<r.length;o++){var s=r[o];if(Math.abs(b.getDims(s)["vertical"]["center"]-u)<i.guidelinesStyle.range*t.zoom()){if(Math.abs(p-b.getDims(s)["horizontal"][f])<2*i.guidelinesTolerance){n=d;a=s}}}}),p-i.guidelinesTolerance,p+i.guidelinesTolerance)}}}}),v,v+i.guidelinesStyle.range*t.zoom());if(n){w.hd=b.getDims(e)["horizontal"][l]-b.getDims(n)["horizontal"][f]-(b.getDims(n)["horizontal"][l]-b.getDims(a)["horizontal"][f]);if(!i.geometricGuideline||w.h==null||Math.abs(w.h)>Math.abs(w.hd)){w.h=w.hd}b.drawDH(e,n,a,r);return true}else if(!i.geometricGuideline){w.h=null}return false};b.drawDH=function(e,t,r,n){var a=b.getDims(e)["vertical"]["center"];var o="right",s="left";if(n=="left"){o="left";s="right"}var u=E([t,e,r],"vertical");b.drawLine({x:b.getDims(t)["horizontal"][s],y:u},{x:b.getDims(e)["horizontal"][o],y:u},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(e)["horizontal"][o],y:u},{x:b.getDims(e)["horizontal"][o],y:a},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(r)["horizontal"][s],y:u},{x:b.getDims(t)["horizontal"][o],y:u},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(r)["horizontal"][s],y:u},{x:b.getDims(r)["horizontal"][s],y:b.getDims(r)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(t)["horizontal"][s],y:u},{x:b.getDims(t)["horizontal"][s],y:b.getDims(t)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(t)["horizontal"][o],y:u},{x:b.getDims(t)["horizontal"][o],y:b.getDims(t)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawArrow({x:b.getDims(e)["horizontal"][o],y:u},s);b.drawArrow({x:b.getDims(t)["horizontal"][s],y:u},o);b.drawArrow({x:b.getDims(t)["horizontal"][o],y:u},s);b.drawArrow({x:b.getDims(r)["horizontal"][s],y:u},o)};b.verticalDistributionNext=function(e,r){var n=null,a=null;var o=b.getDims(e);var s=o["horizontal"]["center"];var u=o["vertical"]["center"];var l="top",f="bottom";var v=u-i.guidelinesStyle.range*t.zoom();if(r=="above"){l="bottom";f="top";v=u}var c={below:function(e,t){return t-e>i.guidelinesStyle.minDistRange},above:function(e,t){return e-t>i.guidelinesStyle.minDistRange}};p.forEach((function(e,u){for(var v=0;v<u.length;v++){var d=u[v];var h=b.getDims(d);if(Math.abs(h["horizontal"]["center"]-o["horizontal"]["center"])<i.guidelinesStyle.range*t.zoom()){if(h["vertical"][f]==e&&c[r](h["vertical"][f],o["vertical"][l])){var g=h["vertical"][l]-(o["vertical"][l]-e);p.forEach((function(e,r){for(var o=0;o<r.length;o++){var u=r[o];if(Math.abs(b.getDims(u)["horizontal"]["center"]-s)<i.guidelinesStyle.range*t.zoom()){if(Math.abs(g-b.getDims(u)["vertical"][f])<2*i.guidelinesTolerance){n=d;a=u}}}}),g-i.guidelinesTolerance,g+i.guidelinesTolerance)}}}}),v,v+i.guidelinesStyle.range*t.zoom());if(n){w.vd=b.getDims(e)["vertical"][l]-b.getDims(n)["vertical"][f]-(b.getDims(n)["vertical"][l]-b.getDims(a)["vertical"][f]);if(!i.geometricGuideline||w.v==null||Math.abs(w.v)>Math.abs(w.vd)){w.v=w.vd}b.drawDV(e,n,a,r);return true}else if(!i.geometricGuideline){w.v=null}return false};b.drawDV=function(e,t,r,n){var a=b.getDims(e);var o=a["horizontal"]["center"];var s="top",u="bottom";if(n=="above"){s="bottom";u="top"}var l=E([t,e,r],"horizontal");b.drawLine({x:l,y:a["vertical"][s]},{x:l,y:b.getDims(t)["vertical"][u]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:l,y:b.getDims(t)["vertical"][s]},{x:l,y:b.getDims(r)["vertical"][u]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:o,y:a["vertical"][s]},{x:l,y:a["vertical"][s]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:b.getDims(t)["horizontal"]["center"],y:b.getDims(t)["vertical"][u]},{x:l,y:b.getDims(t)["vertical"][u]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:b.getDims(t)["horizontal"]["center"],y:b.getDims(t)["vertical"][s]},{x:l,y:b.getDims(t)["vertical"][s]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:l,y:b.getDims(r)["vertical"][u]},{x:b.getDims(r)["horizontal"]["center"],y:b.getDims(r)["vertical"][u]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawArrow({x:l,y:a["vertical"][s]},u);b.drawArrow({x:l,y:b.getDims(t)["vertical"][u]},s);b.drawArrow({x:l,y:b.getDims(t)["vertical"][s]},u);b.drawArrow({x:l,y:b.getDims(r)["vertical"][u]},s)};b.update=function(e){b.clear();if(i.initPosAlignment){T(e)}e.each((function(e,t){if(typeof e==="number"){e=t}if(i.geometricGuideline){b.searchForLine("horizontal",e);b.searchForLine("vertical",e)}if(i.distributionGuidelines){b.horizontalDistribution(e);b.verticalDistribution(e)}}))};b.resize=function(){l()};function k(e){var t={};for(var r=0;r<e.length;r++){t[e[r].id()]=true}var n=e.filter((function(e,r){if(typeof e==="number"){e=r}var n=e.parent()[0];while(n!=null){if(t[n.id()]){return false}n=n.parent()[0]}return true}));return n}var _={};var S={};var D=function(e){_=e.renderedPosition||e.cyRenderedPosition;S.x=_.x;S.y=_.y};var C=function(e){S.x+=e.x-x.x;S.y+=e.y-x.y;x.x=e.x;x.y=e.y};var T=function(e){var t=e.renderedPosition();if(Math.abs(y.y-t.y)<i.guidelinesTolerance){b.drawLine({x:S.x,y:_.y},{x:t.x,y:_.y},i.guidelinesStyle.initPosAlignmentColor,i.guidelinesStyle.initPosAlignmentLine);if(_.y==S.y){b.drawCross(S)}else{b.drawCross(_)}}else if(Math.abs(y.x-t.x)<i.guidelinesTolerance){b.drawLine({x:_.x,y:S.y},{x:_.x,y:t.y},i.guidelinesStyle.initPosAlignmentColor,i.guidelinesStyle.initPosAlignmentLine);if(_.x==S.x){b.drawCross(S)}else{b.drawCross(_)}}};function P(e,t){var r=k(t);var n=r.union(r.descendants());n.filter(":childless").forEach((function(t,r){if(typeof t==="number"){t=r}var n={x:e.x+t.renderedPosition("x"),y:e.y+t.renderedPosition("y")};t.renderedPosition(n)}))}var M;t.on("tapstart","node",(function(){M=this}));var I,O={x:0,y:0};t.on("mousemove",(function(e){I=e.renderedPosition||e.cyRenderedPosition;if(N)N.each((function(e,t){if(typeof e==="number"){e=t}if(e.locked()&&(Math.abs(I.x-O.x)>2*i.guidelinesTolerance||Math.abs(I.y-O.y)>2*i.guidelinesTolerance)){e.unlock();var r={};r.x=I.x-M.renderedPosition("x");r.y=I.y-M.renderedPosition("y");P(r,e)}}))}));var N;b.snapToAlignmentLocation=function(e){N=e;e.each((function(e,t){if(typeof e==="number"){e=t}var r=e.renderedPosition();if(w.h){O=I;r.x-=w.h;e.renderedPosition(r)}if(w.v){O=I;r.y-=w.v;e.renderedPosition(r)}if(w.v||w.h){w.h=null;w.v=null;N.lock()}}));b.update(e)};return{changeOptions:o,lines:b,getTopMostNodes:k,getMousePos:D,setMousePos:C,resizeCanvas:l,resetCanvas:h}}},e=>{"use strict";e.exports=y;var t=0;var r=1;function n(e,t,r,n,a,i){this._color=e;this.key=t;this.value=r;this.left=n;this.right=a;this._count=i}function a(e){return new n(e._color,e.key,e.value,e.left,e.right,e._count)}function i(e,t){return new n(e,t.key,t.value,t.left,t.right,t._count)}function o(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function s(e,t){this._compare=e;this.root=t}var u=s.prototype;Object.defineProperty(u,"keys",{get:function(){var e=[];this.forEach((function(t,r){e.push(t)}));return e}});Object.defineProperty(u,"values",{get:function(){var e=[];this.forEach((function(t,r){e.push(r)}));return e}});Object.defineProperty(u,"length",{get:function(){if(this.root){return this.root._count}return 0}});u.insert=function(e,a){var u=this._compare;var l=this.root;var f=[];var v=[];while(l){var c=u(e,l.key);f.push(l);v.push(c);if(c<=0){l=l.left}else{l=l.right}}f.push(new n(t,e,a,null,null,1));for(var d=f.length-2;d>=0;--d){var l=f[d];if(v[d]<=0){f[d]=new n(l._color,l.key,l.value,f[d+1],l.right,l._count+1)}else{f[d]=new n(l._color,l.key,l.value,l.left,f[d+1],l._count+1)}}for(var d=f.length-1;d>1;--d){var h=f[d-1];var l=f[d];if(h._color===r||l._color===r){break}var p=f[d-2];if(p.left===h){if(h.left===l){var g=p.right;if(g&&g._color===t){h._color=r;p.right=i(r,g);p._color=t;d-=1}else{p._color=t;p.left=h.right;h._color=r;h.right=p;f[d-2]=h;f[d-1]=l;o(p);o(h);if(d>=3){var y=f[d-3];if(y.left===p){y.left=h}else{y.right=h}}break}}else{var g=p.right;if(g&&g._color===t){h._color=r;p.right=i(r,g);p._color=t;d-=1}else{h.right=l.left;p._color=t;p.left=l.right;l._color=r;l.left=h;l.right=p;f[d-2]=l;f[d-1]=h;o(p);o(h);o(l);if(d>=3){var y=f[d-3];if(y.left===p){y.left=l}else{y.right=l}}break}}}else{if(h.right===l){var g=p.left;if(g&&g._color===t){h._color=r;p.left=i(r,g);p._color=t;d-=1}else{p._color=t;p.right=h.left;h._color=r;h.left=p;f[d-2]=h;f[d-1]=l;o(p);o(h);if(d>=3){var y=f[d-3];if(y.right===p){y.right=h}else{y.left=h}}break}}else{var g=p.left;if(g&&g._color===t){h._color=r;p.left=i(r,g);p._color=t;d-=1}else{h.left=l.right;p._color=t;p.right=l.left;l._color=r;l.right=h;l.left=p;f[d-2]=l;f[d-1]=h;o(p);o(h);o(l);if(d>=3){var y=f[d-3];if(y.right===p){y.right=l}else{y.left=l}}break}}}}f[0]._color=r;return new s(u,f[0])};function l(e,t){if(t.left){var r=l(e,t.left);if(r){return r}}var r=e(t.key,t.value);if(r){return r}if(t.right){return l(e,t.right)}}function f(e,t,r,n){var a=t(e,n.key);if(a<=0){if(n.left){var i=f(e,t,r,n.left);if(i){return i}}var i=r(n.key,n.value);if(i){return i}}if(n.right){return f(e,t,r,n.right)}}function v(e,t,r,n,a){var i=r(e,a.key);var o=r(t,a.key);var s;if(i<=0){if(a.left){s=v(e,t,r,n,a.left);if(s){return s}}if(o>0){s=n(a.key,a.value);if(s){return s}}}if(o>0&&a.right){return v(e,t,r,n,a.right)}}u.forEach=function e(t,r,n){if(!this.root){return}switch(arguments.length){case 1:return l(t,this.root);break;case 2:return f(r,this._compare,t,this.root);break;case 3:if(this._compare(r,n)>=0){return}return v(r,n,this._compare,t,this.root);break}};Object.defineProperty(u,"begin",{get:function(){var e=[];var t=this.root;while(t){e.push(t);t=t.left}return new c(this,e)}});Object.defineProperty(u,"end",{get:function(){var e=[];var t=this.root;while(t){e.push(t);t=t.right}return new c(this,e)}});u.at=function(e){if(e<0){return new c(this,[])}var t=this.root;var r=[];while(true){r.push(t);if(t.left){if(e<t.left._count){t=t.left;continue}e-=t.left._count}if(!e){return new c(this,r)}e-=1;if(t.right){if(e>=t.right._count){break}t=t.right}else{break}}return new c(this,[])};u.ge=function(e){var t=this._compare;var r=this.root;var n=[];var a=0;while(r){var i=t(e,r.key);n.push(r);if(i<=0){a=n.length}if(i<=0){r=r.left}else{r=r.right}}n.length=a;return new c(this,n)};u.gt=function(e){var t=this._compare;var r=this.root;var n=[];var a=0;while(r){var i=t(e,r.key);n.push(r);if(i<0){a=n.length}if(i<0){r=r.left}else{r=r.right}}n.length=a;return new c(this,n)};u.lt=function(e){var t=this._compare;var r=this.root;var n=[];var a=0;while(r){var i=t(e,r.key);n.push(r);if(i>0){a=n.length}if(i<=0){r=r.left}else{r=r.right}}n.length=a;return new c(this,n)};u.le=function(e){var t=this._compare;var r=this.root;var n=[];var a=0;while(r){var i=t(e,r.key);n.push(r);if(i>=0){a=n.length}if(i<0){r=r.left}else{r=r.right}}n.length=a;return new c(this,n)};u.find=function(e){var t=this._compare;var r=this.root;var n=[];while(r){var a=t(e,r.key);n.push(r);if(a===0){return new c(this,n)}if(a<=0){r=r.left}else{r=r.right}}return new c(this,[])};u.remove=function(e){var t=this.find(e);if(t){return t.remove()}return this};u.get=function(e){var t=this._compare;var r=this.root;while(r){var n=t(e,r.key);if(n===0){return r.value}if(n<=0){r=r.left}else{r=r.right}}return};function c(e,t){this.tree=e;this._stack=t}var d=c.prototype;Object.defineProperty(d,"valid",{get:function(){return this._stack.length>0}});Object.defineProperty(d,"node",{get:function(){if(this._stack.length>0){return this._stack[this._stack.length-1]}return null},enumerable:true});d.clone=function(){return new c(this.tree,this._stack.slice())};function h(e,t){e.key=t.key;e.value=t.value;e.left=t.left;e.right=t.right;e._color=t._color;e._count=t._count}function p(e){var n,s,u,l;for(var f=e.length-1;f>=0;--f){n=e[f];if(f===0){n._color=r;return}s=e[f-1];if(s.left===n){u=s.right;if(u.right&&u.right._color===t){u=s.right=a(u);l=u.right=a(u.right);s.right=u.left;u.left=s;u.right=l;u._color=s._color;n._color=r;s._color=r;l._color=r;o(s);o(u);if(f>1){var v=e[f-2];if(v.left===s){v.left=u}else{v.right=u}}e[f-1]=u;return}else if(u.left&&u.left._color===t){u=s.right=a(u);l=u.left=a(u.left);s.right=l.left;u.left=l.right;l.left=s;l.right=u;l._color=s._color;s._color=r;u._color=r;n._color=r;o(s);o(u);o(l);if(f>1){var v=e[f-2];if(v.left===s){v.left=l}else{v.right=l}}e[f-1]=l;return}if(u._color===r){if(s._color===t){s._color=r;s.right=i(t,u);return}else{s.right=i(t,u);continue}}else{u=a(u);s.right=u.left;u.left=s;u._color=s._color;s._color=t;o(s);o(u);if(f>1){var v=e[f-2];if(v.left===s){v.left=u}else{v.right=u}}e[f-1]=u;e[f]=s;if(f+1<e.length){e[f+1]=n}else{e.push(n)}f=f+2}}else{u=s.left;if(u.left&&u.left._color===t){u=s.left=a(u);l=u.left=a(u.left);s.left=u.right;u.right=s;u.left=l;u._color=s._color;n._color=r;s._color=r;l._color=r;o(s);o(u);if(f>1){var v=e[f-2];if(v.right===s){v.right=u}else{v.left=u}}e[f-1]=u;return}else if(u.right&&u.right._color===t){u=s.left=a(u);l=u.right=a(u.right);s.left=l.right;u.right=l.left;l.right=s;l.left=u;l._color=s._color;s._color=r;u._color=r;n._color=r;o(s);o(u);o(l);if(f>1){var v=e[f-2];if(v.right===s){v.right=l}else{v.left=l}}e[f-1]=l;return}if(u._color===r){if(s._color===t){s._color=r;s.left=i(t,u);return}else{s.left=i(t,u);continue}}else{u=a(u);s.left=u.right;u.right=s;u._color=s._color;s._color=t;o(s);o(u);if(f>1){var v=e[f-2];if(v.right===s){v.right=u}else{v.left=u}}e[f-1]=u;e[f]=s;if(f+1<e.length){e[f+1]=n}else{e.push(n)}f=f+2}}}}d.remove=function(){var e=this._stack;if(e.length===0){return this.tree}var a=new Array(e.length);var i=e[e.length-1];a[a.length-1]=new n(i._color,i.key,i.value,i.left,i.right,i._count);for(var o=e.length-2;o>=0;--o){var i=e[o];if(i.left===e[o+1]){a[o]=new n(i._color,i.key,i.value,a[o+1],i.right,i._count)}else{a[o]=new n(i._color,i.key,i.value,i.left,a[o+1],i._count)}}i=a[a.length-1];if(i.left&&i.right){var u=a.length;i=i.left;while(i.right){a.push(i);i=i.right}var l=a[u-1];a.push(new n(i._color,l.key,l.value,i.left,i.right,i._count));a[u-1].key=i.key;a[u-1].value=i.value;for(var o=a.length-2;o>=u;--o){i=a[o];a[o]=new n(i._color,i.key,i.value,i.left,a[o+1],i._count)}a[u-1].left=a[u]}i=a[a.length-1];if(i._color===t){var f=a[a.length-2];if(f.left===i){f.left=null}else if(f.right===i){f.right=null}a.pop();for(var o=0;o<a.length;++o){a[o]._count--}return new s(this.tree._compare,a[0])}else{if(i.left||i.right){if(i.left){h(i,i.left)}else if(i.right){h(i,i.right)}i._color=r;for(var o=0;o<a.length-1;++o){a[o]._count--}return new s(this.tree._compare,a[0])}else if(a.length===1){return new s(this.tree._compare,null)}else{for(var o=0;o<a.length;++o){a[o]._count--}var v=a[a.length-2];p(a);if(v.left===i){v.left=null}else{v.right=null}}}return new s(this.tree._compare,a[0])};Object.defineProperty(d,"key",{get:function(){if(this._stack.length>0){return this._stack[this._stack.length-1].key}return},enumerable:true});Object.defineProperty(d,"value",{get:function(){if(this._stack.length>0){return this._stack[this._stack.length-1].value}return},enumerable:true});Object.defineProperty(d,"index",{get:function(){var e=0;var t=this._stack;if(t.length===0){var r=this.tree.root;if(r){return r._count}return 0}else if(t[t.length-1].left){e=t[t.length-1].left._count}for(var n=t.length-2;n>=0;--n){if(t[n+1]===t[n].right){++e;if(t[n].left){e+=t[n].left._count}}}return e},enumerable:true});d.next=function(){var e=this._stack;if(e.length===0){return}var t=e[e.length-1];if(t.right){t=t.right;while(t){e.push(t);t=t.left}}else{e.pop();while(e.length>0&&e[e.length-1].right===t){t=e[e.length-1];e.pop()}}};Object.defineProperty(d,"hasNext",{get:function(){var e=this._stack;if(e.length===0){return false}if(e[e.length-1].right){return true}for(var t=e.length-1;t>0;--t){if(e[t-1].left===e[t]){return true}}return false}});d.update=function(e){var t=this._stack;if(t.length===0){throw new Error("Can't update empty node!")}var r=new Array(t.length);var a=t[t.length-1];r[r.length-1]=new n(a._color,a.key,e,a.left,a.right,a._count);for(var i=t.length-2;i>=0;--i){a=t[i];if(a.left===t[i+1]){r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count)}else{r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count)}}return new s(this.tree._compare,r[0])};d.prev=function(){var e=this._stack;if(e.length===0){return}var t=e[e.length-1];if(t.left){t=t.left;while(t){e.push(t);t=t.right}}else{e.pop();while(e.length>0&&e[e.length-1].left===t){t=e[e.length-1];e.pop()}}};Object.defineProperty(d,"hasPrev",{get:function(){var e=this._stack;if(e.length===0){return false}if(e[e.length-1].left){return true}for(var t=e.length-1;t>0;--t){if(e[t-1].right===e[t]){return true}}return false}});function g(e,t){if(e<t){return-1}if(e>t){return 1}return 0}function y(e){return new s(e||g,null)}},e=>{e.exports=function(e,t){var r=e;var n="_gridParentPadding";var a;function i(){t.style().selector("."+n).style("compound-sizing-wrt-labels","exclude").style("padding-left",a).style("padding-right",a).style("padding-top",a).style("padding-bottom",a).update()}function o(e){r=e;a=r.parentSpacing<0?r.gridSpacing:r.parentSpacing;i()}function s(e,t){if(t)e.addClass(n);else e.removeClass(n)}return{changeOptions:o,setPaddingOfParent:s}}},e=>{e.exports=function(e,t,r){function n(e,t,r){var n=e.union(e.descendants());n.filter(":childless").positions((function(e,n){if(typeof e==="number"){e=n}var a=e.position();return{x:a.x+t,y:a.y+r}}))}function a(e){var t={};for(var r=0;r<e.length;r++){t[e[r].id()]=true}var n=e.filter((function(e,r){if(typeof e==="number"){e=r}var n=e.parent()[0];while(n!=null){if(t[n.id()]){return false}n=n.parent()[0]}return true}));return n}if(!r){e("collection","align",(function(e,t,r){var i=a(this.nodes(":visible"));var o=r?r:i[0];i=i.not(o);e=e?e:"none";t=t?t:"none";var s=0;var u=0;if(t=="left")s=-1;else if(t=="right")s=1;if(e=="top")u=-1;else if(e=="bottom")u=1;for(var l=0;l<i.length;l++){var f=i[l];var v=Object.assign({},f.position());var c=Object.assign({},f.position());if(t!="none")c.x=o.position("x")+s*(o.outerWidth()-f.outerWidth())/2;if(e!="none")c.y=o.position("y")+u*(o.outerHeight()-f.outerHeight())/2;n(f,c.x-v.x,c.y-v.y)}return this}))}if(t.undoRedo){function i(){var e={};var r=t.nodes();for(var n=0;n<r.length;n++){var a=r[n];e[a.id()]={x:a.position("x"),y:a.position("y")}}return e}function o(e){var r={};t.nodes().not(":parent").positions((function(t,n){if(typeof t==="number"){t=n}r[t.id()]={x:t.position("x"),y:t.position("y")};var a=e[t.id()];return{x:a.x,y:a.y}}));return r}var s=t.undoRedo(null,true);s.action("align",(function(e){var t;if(e.firstTime){t=i();e.nodes.align(e.horizontal,e.vertical,e.alignTo)}else t=o(e);return t}),(function(e){return o(e)}))}}},e=>{var t=function(){var e="Expected a function";var t=Math.max,r=Date.now;var n=r||function(){return(new Date).getTime()};function a(r,a,o){var s,u,l,f,v,c,d,h=0,p=false,g=true;if(typeof r!="function"){throw new TypeError(e)}a=a<0?0:+a||0;if(o===true){var y=true;g=false}else if(i(o)){y=!!o.leading;p="maxWait"in o&&t(+o.maxWait||0,a);g="trailing"in o?!!o.trailing:g}function m(){if(c){clearTimeout(c)}if(u){clearTimeout(u)}h=0;u=c=d=undefined}function b(e,t){if(t){clearTimeout(t)}u=c=d=undefined;if(e){h=n();l=r.apply(v,s);if(!c&&!u){s=v=undefined}}}function x(){var e=a-(n()-f);if(e<=0||e>a){b(d,u)}else{c=setTimeout(x,e)}}function w(){b(g,c)}function E(){s=arguments;f=n();v=this;d=g&&(c||!y);if(p===false){var e=y&&!c}else{if(!u&&!y){h=f}var t=p-(f-h),i=t<=0||t>p;if(i){if(u){u=clearTimeout(u)}h=f;l=r.apply(v,s)}else if(!u){u=setTimeout(w,t)}}if(i&&c){c=clearTimeout(c)}else if(!c&&a!==p){c=setTimeout(x,a)}if(e){i=true;l=r.apply(v,s)}if(i&&!c&&!u){s=v=undefined}return l}E.cancel=m;return E}function i(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}return a}();e.exports=t},function(e,t,r){(function t(n,a){if(true)e.exports=a(r(220));else{}})(this,(function(e){return function(e){var t={};function r(n){if(t[n]){return t[n].exports}var a=t[n]={i:n,l:false,exports:{}};e[n].call(a.exports,a,a.exports,r);a.l=true;return a.exports}r.m=e;r.c=t;r.d=function(e,t,n){if(!r.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}};r.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};r.t=function(e,t){if(t&1)e=r(e);if(t&8)return e;if(t&4&&typeof e==="object"&&e&&e.__esModule)return e;var n=Object.create(null);r.r(n);Object.defineProperty(n,"default",{enumerable:true,value:e});if(t&2&&typeof e!="string")for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n};r.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=0)}([function(e,t,r){var n=r(1);var a=function e(t){if(!t){return}t("layout","dagre",n)};if(typeof cytoscape!=="undefined"){a(cytoscape)}e.exports=a},function(e,t,r){function n(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){n=function e(t){return typeof t}}else{n=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return n(e)}var a=function e(t){return typeof t==="function"};var i=r(2);var o=r(3);var s=r(4);function u(e){this.options=o({},i,e)}u.prototype.run=function(){var e=this.options;var t=this;var r=e.cy;var i=e.eles;var o=function e(t,r){return a(r)?r.apply(t,[t]):r};var u=e.boundingBox||{x1:0,y1:0,w:r.width(),h:r.height()};if(u.x2===undefined){u.x2=u.x1+u.w}if(u.w===undefined){u.w=u.x2-u.x1}if(u.y2===undefined){u.y2=u.y1+u.h}if(u.h===undefined){u.h=u.y2-u.y1}var l=new s.graphlib.Graph({multigraph:true,compound:true});var f={};var v=function e(t,r){if(r!=null){f[t]=r}};v("nodesep",e.nodeSep);v("edgesep",e.edgeSep);v("ranksep",e.rankSep);v("rankdir",e.rankDir);v("align",e.align);v("ranker",e.ranker);v("acyclicer",e.acyclicer);l.setGraph(f);l.setDefaultEdgeLabel((function(){return{}}));l.setDefaultNodeLabel((function(){return{}}));var c=i.nodes();for(var d=0;d<c.length;d++){var h=c[d];var p=h.layoutDimensions(e);l.setNode(h.id(),{width:p.w,height:p.h,name:h.id()})}for(var g=0;g<c.length;g++){var y=c[g];if(y.isChild()){l.setParent(y.id(),y.parent().id())}}var m=i.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()}));for(var b=0;b<m.length;b++){var x=m[b];l.setEdge(x.source().id(),x.target().id(),{minlen:o(x,e.minLen),weight:o(x,e.edgeWeight),name:x.id()},x.id())}s.layout(l);var w=l.nodes();for(var E=0;E<w.length;E++){var k=w[E];var _=l.node(k);r.getElementById(k).scratch().dagre=_}var S;if(e.boundingBox){S={x1:Infinity,x2:-Infinity,y1:Infinity,y2:-Infinity};c.forEach((function(e){var t=e.scratch().dagre;S.x1=Math.min(S.x1,t.x);S.x2=Math.max(S.x2,t.x);S.y1=Math.min(S.y1,t.y);S.y2=Math.max(S.y2,t.y)}));S.w=S.x2-S.x1;S.h=S.y2-S.y1}else{S=u}var D=function t(r){if(e.boundingBox){var n=S.w===0?0:(r.x-S.x1)/S.w;var a=S.h===0?0:(r.y-S.y1)/S.h;return{x:u.x1+n*u.w,y:u.y1+a*u.h}}else{return r}};c.layoutPositions(t,e,(function(e){e=n(e)==="object"?e:this;var t=e.scratch().dagre;return D({x:t.x,y:t.y})}));return this};e.exports=u},function(e,t){var r={nodeSep:undefined,edgeSep:undefined,rankSep:undefined,rankDir:undefined,align:undefined,ranker:undefined,minLen:function e(t){return 1},edgeWeight:function e(t){return 1},fit:true,padding:30,spacingFactor:undefined,nodeDimensionsIncludeLabels:false,animate:false,animateFilter:function e(t,r){return true},animationDuration:500,animationEasing:undefined,boundingBox:undefined,transform:function e(t,r){return r},ready:function e(){},stop:function e(){}};e.exports=r},function(e,t){e.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}r.forEach((function(t){Object.keys(t).forEach((function(r){return e[r]=t[r]}))}));return e}},function(t,r){t.exports=e}])}))},(e,t,r)=>{e.exports={graphlib:r(221),layout:r(379),debug:r(446),util:{time:r(426).time,notime:r(426).notime},version:r(447)}},(e,t,r)=>{var n;if(true){try{n=r(222)}catch(e){}}if(!n){n=window.graphlib}e.exports=n},(e,t,r)=>{var n=r(223);e.exports={Graph:n.Graph,json:r(364),alg:r(365),version:n.version}},(e,t,r)=>{e.exports={Graph:r(224),version:r(363)}},(e,t,r)=>{"use strict";var n=r(225);e.exports=s;var a="\0";var i="\0";var o="";function s(e){this._isDirected=n.has(e,"directed")?e.directed:true;this._isMultigraph=n.has(e,"multigraph")?e.multigraph:false;this._isCompound=n.has(e,"compound")?e.compound:false;this._label=undefined;this._defaultNodeLabelFn=n.constant(undefined);this._defaultEdgeLabelFn=n.constant(undefined);this._nodes={};if(this._isCompound){this._parent={};this._children={};this._children[i]={}}this._in={};this._preds={};this._out={};this._sucs={};this._edgeObjs={};this._edgeLabels={}}s.prototype._nodeCount=0;s.prototype._edgeCount=0;s.prototype.isDirected=function(){return this._isDirected};s.prototype.isMultigraph=function(){return this._isMultigraph};s.prototype.isCompound=function(){return this._isCompound};s.prototype.setGraph=function(e){this._label=e;return this};s.prototype.graph=function(){return this._label};s.prototype.setDefaultNodeLabel=function(e){if(!n.isFunction(e)){e=n.constant(e)}this._defaultNodeLabelFn=e;return this};s.prototype.nodeCount=function(){return this._nodeCount};s.prototype.nodes=function(){return n.keys(this._nodes)};s.prototype.sources=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._in[t])}))};s.prototype.sinks=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._out[t])}))};s.prototype.setNodes=function(e,t){var r=arguments;var a=this;n.each(e,(function(e){if(r.length>1){a.setNode(e,t)}else{a.setNode(e)}}));return this};s.prototype.setNode=function(e,t){if(n.has(this._nodes,e)){if(arguments.length>1){this._nodes[e]=t}return this}this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e);if(this._isCompound){this._parent[e]=i;this._children[e]={};this._children[i][e]=true}this._in[e]={};this._preds[e]={};this._out[e]={};this._sucs[e]={};++this._nodeCount;return this};s.prototype.node=function(e){return this._nodes[e]};s.prototype.hasNode=function(e){return n.has(this._nodes,e)};s.prototype.removeNode=function(e){var t=this;if(n.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e];if(this._isCompound){this._removeFromParentsChildList(e);delete this._parent[e];n.each(this.children(e),(function(e){t.setParent(e)}));delete this._children[e]}n.each(n.keys(this._in[e]),r);delete this._in[e];delete this._preds[e];n.each(n.keys(this._out[e]),r);delete this._out[e];delete this._sucs[e];--this._nodeCount}return this};s.prototype.setParent=function(e,t){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(n.isUndefined(t)){t=i}else{t+="";for(var r=t;!n.isUndefined(r);r=this.parent(r)){if(r===e){throw new Error("Setting "+t+" as parent of "+e+" would create a cycle")}}this.setNode(t)}this.setNode(e);this._removeFromParentsChildList(e);this._parent[e]=t;this._children[t][e]=true;return this};s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]};s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==i){return t}}};s.prototype.children=function(e){if(n.isUndefined(e)){e=i}if(this._isCompound){var t=this._children[e];if(t){return n.keys(t)}}else if(e===i){return this.nodes()}else if(this.hasNode(e)){return[]}};s.prototype.predecessors=function(e){var t=this._preds[e];if(t){return n.keys(t)}};s.prototype.successors=function(e){var t=this._sucs[e];if(t){return n.keys(t)}};s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t){return n.union(t,this.successors(e))}};s.prototype.isLeaf=function(e){var t;if(this.isDirected()){t=this.successors(e)}else{t=this.neighbors(e)}return t.length===0};s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;n.each(this._nodes,(function(r,n){if(e(n)){t.setNode(n,r)}}));n.each(this._edgeObjs,(function(e){if(t.hasNode(e.v)&&t.hasNode(e.w)){t.setEdge(e,r.edge(e))}}));var a={};function i(e){var n=r.parent(e);if(n===undefined||t.hasNode(n)){a[e]=n;return n}else if(n in a){return a[n]}else{return i(n)}}if(this._isCompound){n.each(t.nodes(),(function(e){t.setParent(e,i(e))}))}return t};s.prototype.setDefaultEdgeLabel=function(e){if(!n.isFunction(e)){e=n.constant(e)}this._defaultEdgeLabelFn=e;return this};s.prototype.edgeCount=function(){return this._edgeCount};s.prototype.edges=function(){return n.values(this._edgeObjs)};s.prototype.setPath=function(e,t){var r=this;var a=arguments;n.reduce(e,(function(e,n){if(a.length>1){r.setEdge(e,n,t)}else{r.setEdge(e,n)}return n}));return this};s.prototype.setEdge=function(){var e,t,r,a;var i=false;var o=arguments[0];if(typeof o==="object"&&o!==null&&"v"in o){e=o.v;t=o.w;r=o.name;if(arguments.length===2){a=arguments[1];i=true}}else{e=o;t=arguments[1];r=arguments[3];if(arguments.length>2){a=arguments[2];i=true}}e=""+e;t=""+t;if(!n.isUndefined(r)){r=""+r}var s=f(this._isDirected,e,t,r);if(n.has(this._edgeLabels,s)){if(i){this._edgeLabels[s]=a}return this}if(!n.isUndefined(r)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")}this.setNode(e);this.setNode(t);this._edgeLabels[s]=i?a:this._defaultEdgeLabelFn(e,t,r);var l=v(this._isDirected,e,t,r);e=l.v;t=l.w;Object.freeze(l);this._edgeObjs[s]=l;u(this._preds[t],e);u(this._sucs[e],t);this._in[t][s]=l;this._out[e][s]=l;this._edgeCount++;return this};s.prototype.edge=function(e,t,r){var n=arguments.length===1?c(this._isDirected,arguments[0]):f(this._isDirected,e,t,r);return this._edgeLabels[n]};s.prototype.hasEdge=function(e,t,r){var a=arguments.length===1?c(this._isDirected,arguments[0]):f(this._isDirected,e,t,r);return n.has(this._edgeLabels,a)};s.prototype.removeEdge=function(e,t,r){var n=arguments.length===1?c(this._isDirected,arguments[0]):f(this._isDirected,e,t,r);var a=this._edgeObjs[n];if(a){e=a.v;t=a.w;delete this._edgeLabels[n];delete this._edgeObjs[n];l(this._preds[t],e);l(this._sucs[e],t);delete this._in[t][n];delete this._out[e][n];this._edgeCount--}return this};s.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var a=n.values(r);if(!t){return a}return n.filter(a,(function(e){return e.v===t}))}};s.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var a=n.values(r);if(!t){return a}return n.filter(a,(function(e){return e.w===t}))}};s.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r){return r.concat(this.outEdges(e,t))}};function u(e,t){if(e[t]){e[t]++}else{e[t]=1}}function l(e,t){if(! --e[t]){delete e[t]}}function f(e,t,r,i){var s=""+t;var u=""+r;if(!e&&s>u){var l=s;s=u;u=l}return s+o+u+o+(n.isUndefined(i)?a:i)}function v(e,t,r,n){var a=""+t;var i=""+r;if(!e&&a>i){var o=a;a=i;i=o}var s={v:a,w:i};if(n){s.name=n}return s}function c(e,t){return f(e,t.v,t.w,t.name)}},(e,t,r)=>{var n;if(true){try{n={clone:r(226),constant:r(289),each:r(290),filter:r(299),has:r(326),isArray:r(156),isEmpty:r(328),isFunction:r(168),isUndefined:r(329),keys:r(237),map:r(330),reduce:r(332),size:r(335),transform:r(341),union:r(342),values:r(361)}}catch(e){}}if(!n){n=window._}e.exports=n},(e,t,r)=>{var n=r(227);var a=4;function i(e){return n(e,a)}e.exports=i},(e,t,r)=>{var n=r(228),a=r(234),i=r(198),o=r(235),s=r(254),u=r(258),l=r(203),f=r(259),v=r(263),c=r(267),d=r(269),h=r(270),p=r(275),g=r(276),y=r(283),m=r(156),b=r(242),x=r(285),w=r(138),E=r(287),k=r(237),_=r(255);var S=1,D=2,C=4;var T="[object Arguments]",P="[object Array]",M="[object Boolean]",I="[object Date]",O="[object Error]",N="[object Function]",z="[object GeneratorFunction]",L="[object Map]",A="[object Number]",B="[object Object]",R="[object RegExp]",j="[object Set]",F="[object String]",V="[object Symbol]",q="[object WeakMap]";var G="[object ArrayBuffer]",Y="[object DataView]",W="[object Float32Array]",X="[object Float64Array]",H="[object Int8Array]",U="[object Int16Array]",K="[object Int32Array]",Z="[object Uint8Array]",$="[object Uint8ClampedArray]",Q="[object Uint16Array]",J="[object Uint32Array]";var ee={};ee[T]=ee[P]=ee[G]=ee[Y]=ee[M]=ee[I]=ee[W]=ee[X]=ee[H]=ee[U]=ee[K]=ee[L]=ee[A]=ee[B]=ee[R]=ee[j]=ee[F]=ee[V]=ee[Z]=ee[$]=ee[Q]=ee[J]=true;ee[O]=ee[N]=ee[q]=false;function te(e,t,r,P,M,I){var O,L=t&S,A=t&D,R=t&C;if(r){O=M?r(e,P,M,I):r(e)}if(O!==undefined){return O}if(!w(e)){return e}var j=m(e);if(j){O=p(e);if(!L){return l(e,O)}}else{var F=h(e),V=F==N||F==z;if(b(e)){return u(e,L)}if(F==B||F==T||V&&!M){O=A||V?{}:y(e);if(!L){return A?v(e,s(O,e)):f(e,o(O,e))}}else{if(!ee[F]){return M?e:{}}O=g(e,F,L)}}I||(I=new n);var q=I.get(e);if(q){return q}I.set(e,O);if(E(e)){e.forEach((function(n){O.add(te(n,t,r,n,e,I))}))}else if(x(e)){e.forEach((function(n,a){O.set(a,te(n,t,r,a,e,I))}))}var G=R?A?d:c:A?_:k;var Y=j?undefined:G(e);a(Y||e,(function(n,a){if(Y){a=n;n=e[a]}i(O,a,te(n,t,r,a,e,I))}));return O}e.exports=te},(e,t,r)=>{var n=r(177),a=r(229),i=r(230),o=r(231),s=r(232),u=r(233);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=a;l.prototype["delete"]=i;l.prototype.get=o;l.prototype.has=s;l.prototype.set=u;e.exports=l},(e,t,r)=>{var n=r(177);function a(){this.__data__=new n;this.size=0}e.exports=a},e=>{function t(e){var t=this.__data__,r=t["delete"](e);this.size=t.size;return r}e.exports=t},e=>{function t(e){return this.__data__.get(e)}e.exports=t},e=>{function t(e){return this.__data__.has(e)}e.exports=t},(e,t,r)=>{var n=r(177),a=r(185),i=r(161);var o=200;function s(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!a||s.length<o-1){s.push([e,t]);this.size=++r.size;return this}r=this.__data__=new i(s)}r.set(e,t);this.size=r.size;return this}e.exports=s},e=>{function t(e,t){var r=-1,n=e==null?0:e.length;while(++r<n){if(t(e[r],r,e)===false){break}}return e}e.exports=t},(e,t,r)=>{var n=r(236),a=r(237);function i(e,t){return e&&n(t,a(t),e)}e.exports=i},(e,t,r)=>{var n=r(198),a=r(199);function i(e,t,r,i){var o=!r;r||(r={});var s=-1,u=t.length;while(++s<u){var l=t[s];var f=i?i(r[l],e[l],l,r,e):undefined;if(f===undefined){f=e[l]}if(o){a(r,l,f)}else{n(r,l,f)}}return r}e.exports=i},(e,t,r)=>{var n=r(238),a=r(249),i=r(253);function o(e){return i(e)?n(e):a(e)}e.exports=o},(e,t,r)=>{var n=r(239),a=r(240),i=r(156),o=r(242),s=r(201),u=r(244);var l=Object.prototype;var f=l.hasOwnProperty;function v(e,t){var r=i(e),l=!r&&a(e),v=!r&&!l&&o(e),c=!r&&!l&&!v&&u(e),d=r||l||v||c,h=d?n(e.length,String):[],p=h.length;for(var g in e){if((t||f.call(e,g))&&!(d&&(g=="length"||v&&(g=="offset"||g=="parent")||c&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||s(g,p)))){h.push(g)}}return h}e.exports=v},e=>{function t(e,t){var r=-1,n=Array(e);while(++r<e){n[r]=t(r)}return n}e.exports=t},(e,t,r)=>{var n=r(241),a=r(150);var i=Object.prototype;var o=i.hasOwnProperty;var s=i.propertyIsEnumerable;var u=n(function(){return arguments}())?n:function(e){return a(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},(e,t,r)=>{var n=r(146),a=r(150);var i="[object Arguments]";function o(e){return a(e)&&n(e)==i}e.exports=o},(e,t,r)=>{e=r.nmd(e);var n=r(140),a=r(243);var i=true&&t&&!t.nodeType&&t;var o=i&&"object"=="object"&&e&&!e.nodeType&&e;var s=o&&o.exports===i;var u=s?n.Buffer:undefined;var l=u?u.isBuffer:undefined;var f=l||a;e.exports=f},e=>{function t(){return false}e.exports=t},(e,t,r)=>{var n=r(245),a=r(247),i=r(248);var o=i&&i.isTypedArray;var s=o?a(o):n;e.exports=s},(e,t,r)=>{var n=r(146),a=r(246),i=r(150);var o="[object Arguments]",s="[object Array]",u="[object Boolean]",l="[object Date]",f="[object Error]",v="[object Function]",c="[object Map]",d="[object Number]",h="[object Object]",p="[object RegExp]",g="[object Set]",y="[object String]",m="[object WeakMap]";var b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",k="[object Int8Array]",_="[object Int16Array]",S="[object Int32Array]",D="[object Uint8Array]",C="[object Uint8ClampedArray]",T="[object Uint16Array]",P="[object Uint32Array]";var M={};M[w]=M[E]=M[k]=M[_]=M[S]=M[D]=M[C]=M[T]=M[P]=true;M[o]=M[s]=M[b]=M[u]=M[x]=M[l]=M[f]=M[v]=M[c]=M[d]=M[h]=M[p]=M[g]=M[y]=M[m]=false;function I(e){return i(e)&&a(e.length)&&!!M[n(e)]}e.exports=I},e=>{var t=9007199254740991;function r(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=t}e.exports=r},e=>{function t(e){return function(t){return e(t)}}e.exports=t},(e,t,r)=>{e=r.nmd(e);var n=r(141);var a=true&&t&&!t.nodeType&&t;var i=a&&"object"=="object"&&e&&!e.nodeType&&e;var o=i&&i.exports===a;var s=o&&n.process;var u=function(){try{var e=i&&i.require&&i.require("util").types;if(e){return e}return s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=u},(e,t,r)=>{var n=r(250),a=r(251);var i=Object.prototype;var o=i.hasOwnProperty;function s(e){if(!n(e)){return a(e)}var t=[];for(var r in Object(e)){if(o.call(e,r)&&r!="constructor"){t.push(r)}}return t}e.exports=s},e=>{var t=Object.prototype;function r(e){var r=e&&e.constructor,n=typeof r=="function"&&r.prototype||t;return e===n}e.exports=r},(e,t,r)=>{var n=r(252);var a=n(Object.keys,Object);e.exports=a},e=>{function t(e,t){return function(r){return e(t(r))}}e.exports=t},(e,t,r)=>{var n=r(168),a=r(246);function i(e){return e!=null&&a(e.length)&&!n(e)}e.exports=i},(e,t,r)=>{var n=r(236),a=r(255);function i(e,t){return e&&n(t,a(t),e)}e.exports=i},(e,t,r)=>{var n=r(238),a=r(256),i=r(253);function o(e){return i(e)?n(e,true):a(e)}e.exports=o},(e,t,r)=>{var n=r(138),a=r(250),i=r(257);var o=Object.prototype;var s=o.hasOwnProperty;function u(e){if(!n(e)){return i(e)}var t=a(e),r=[];for(var o in e){if(!(o=="constructor"&&(t||!s.call(e,o)))){r.push(o)}}return r}e.exports=u},e=>{function t(e){var t=[];if(e!=null){for(var r in Object(e)){t.push(r)}}return t}e.exports=t},(e,t,r)=>{e=r.nmd(e);var n=r(140);var a=true&&t&&!t.nodeType&&t;var i=a&&"object"=="object"&&e&&!e.nodeType&&e;var o=i&&i.exports===a;var s=o?n.Buffer:undefined,u=s?s.allocUnsafe:undefined;function l(e,t){if(t){return e.slice()}var r=e.length,n=u?u(r):new e.constructor(r);e.copy(n);return n}e.exports=l},(e,t,r)=>{var n=r(236),a=r(260);function i(e,t){return n(e,a(e),t)}e.exports=i},(e,t,r)=>{var n=r(261),a=r(262);var i=Object.prototype;var o=i.propertyIsEnumerable;var s=Object.getOwnPropertySymbols;var u=!s?a:function(e){if(e==null){return[]}e=Object(e);return n(s(e),(function(t){return o.call(e,t)}))};e.exports=u},e=>{function t(e,t){var r=-1,n=e==null?0:e.length,a=0,i=[];while(++r<n){var o=e[r];if(t(o,r,e)){i[a++]=o}}return i}e.exports=t},e=>{function t(){return[]}e.exports=t},(e,t,r)=>{var n=r(236),a=r(264);function i(e,t){return n(e,a(e),t)}e.exports=i},(e,t,r)=>{var n=r(265),a=r(266),i=r(260),o=r(262);var s=Object.getOwnPropertySymbols;var u=!s?o:function(e){var t=[];while(e){n(t,i(e));e=a(e)}return t};e.exports=u},e=>{function t(e,t){var r=-1,n=t.length,a=e.length;while(++r<n){e[a+r]=t[r]}return e}e.exports=t},(e,t,r)=>{var n=r(252);var a=n(Object.getPrototypeOf,Object);e.exports=a},(e,t,r)=>{var n=r(268),a=r(260),i=r(237);function o(e){return n(e,i,a)}e.exports=o},(e,t,r)=>{var n=r(265),a=r(156);function i(e,t,r){var i=t(e);return a(e)?i:n(i,r(e))}e.exports=i},(e,t,r)=>{var n=r(268),a=r(264),i=r(255);function o(e){return n(e,i,a)}e.exports=o},(e,t,r)=>{var n=r(271),a=r(185),i=r(272),o=r(273),s=r(274),u=r(146),l=r(171);var f="[object Map]",v="[object Object]",c="[object Promise]",d="[object Set]",h="[object WeakMap]";var p="[object DataView]";var g=l(n),y=l(a),m=l(i),b=l(o),x=l(s);var w=u;if(n&&w(new n(new ArrayBuffer(1)))!=p||a&&w(new a)!=f||i&&w(i.resolve())!=c||o&&w(new o)!=d||s&&w(new s)!=h){w=function(e){var t=u(e),r=t==v?e.constructor:undefined,n=r?l(r):"";if(n){switch(n){case g:return p;case y:return f;case m:return c;case b:return d;case x:return h}}return t}}e.exports=w},(e,t,r)=>{var n=r(166),a=r(140);var i=n(a,"DataView");e.exports=i},(e,t,r)=>{var n=r(166),a=r(140);var i=n(a,"Promise");e.exports=i},(e,t,r)=>{var n=r(166),a=r(140);var i=n(a,"Set");e.exports=i},(e,t,r)=>{var n=r(166),a=r(140);var i=n(a,"WeakMap");e.exports=i},e=>{var t=Object.prototype;var r=t.hasOwnProperty;function n(e){var t=e.length,n=new e.constructor(t);if(t&&typeof e[0]=="string"&&r.call(e,"index")){n.index=e.index;n.input=e.input}return n}e.exports=n},(e,t,r)=>{var n=r(277),a=r(279),i=r(280),o=r(281),s=r(282);var u="[object Boolean]",l="[object Date]",f="[object Map]",v="[object Number]",c="[object RegExp]",d="[object Set]",h="[object String]",p="[object Symbol]";var g="[object ArrayBuffer]",y="[object DataView]",m="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",w="[object Int16Array]",E="[object Int32Array]",k="[object Uint8Array]",_="[object Uint8ClampedArray]",S="[object Uint16Array]",D="[object Uint32Array]";function C(e,t,r){var C=e.constructor;switch(t){case g:return n(e);case u:case l:return new C(+e);case y:return a(e,r);case m:case b:case x:case w:case E:case k:case _:case S:case D:return s(e,r);case f:return new C;case v:case h:return new C(e);case c:return i(e);case d:return new C;case p:return o(e)}}e.exports=C},(e,t,r)=>{var n=r(278);function a(e){var t=new e.constructor(e.byteLength);new n(t).set(new n(e));return t}e.exports=a},(e,t,r)=>{var n=r(140);var a=n.Uint8Array;e.exports=a},(e,t,r)=>{var n=r(277);function a(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}e.exports=a},e=>{var t=/\w*$/;function r(e){var r=new e.constructor(e.source,t.exec(e));r.lastIndex=e.lastIndex;return r}e.exports=r},(e,t,r)=>{var n=r(147);var a=n?n.prototype:undefined,i=a?a.valueOf:undefined;function o(e){return i?Object(i.call(e)):{}}e.exports=o},(e,t,r)=>{var n=r(277);function a(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}e.exports=a},(e,t,r)=>{var n=r(284),a=r(266),i=r(250);function o(e){return typeof e.constructor=="function"&&!i(e)?n(a(e)):{}}e.exports=o},(e,t,r)=>{var n=r(138);var a=Object.create;var i=function(){function e(){}return function(t){if(!n(t)){return{}}if(a){return a(t)}e.prototype=t;var r=new e;e.prototype=undefined;return r}}();e.exports=i},(e,t,r)=>{var n=r(286),a=r(247),i=r(248);var o=i&&i.isMap;var s=o?a(o):n;e.exports=s},(e,t,r)=>{var n=r(270),a=r(150);var i="[object Map]";function o(e){return a(e)&&n(e)==i}e.exports=o},(e,t,r)=>{var n=r(288),a=r(247),i=r(248);var o=i&&i.isSet;var s=o?a(o):n;e.exports=s},(e,t,r)=>{var n=r(270),a=r(150);var i="[object Set]";function o(e){return a(e)&&n(e)==i}e.exports=o},e=>{function t(e){return function(){return e}}e.exports=t},(e,t,r)=>{e.exports=r(291)},(e,t,r)=>{var n=r(234),a=r(292),i=r(297),o=r(156);function s(e,t){var r=o(e)?n:a;return r(e,i(t))}e.exports=s},(e,t,r)=>{var n=r(293),a=r(296);var i=a(n);e.exports=i},(e,t,r)=>{var n=r(294),a=r(237);function i(e,t){return e&&n(e,t,a)}e.exports=i},(e,t,r)=>{var n=r(295);var a=n();e.exports=a},e=>{function t(e){return function(t,r,n){var a=-1,i=Object(t),o=n(t),s=o.length;while(s--){var u=o[e?s:++a];if(r(i[u],u,i)===false){break}}return t}}e.exports=t},(e,t,r)=>{var n=r(253);function a(e,t){return function(r,a){if(r==null){return r}if(!n(r)){return e(r,a)}var i=r.length,o=t?i:-1,s=Object(r);while(t?o--:++o<i){if(a(s[o],o,s)===false){break}}return r}}e.exports=a},(e,t,r)=>{var n=r(298);function a(e){return typeof e=="function"?e:n}e.exports=a},e=>{function t(e){return e}e.exports=t},(e,t,r)=>{var n=r(261),a=r(300),i=r(301),o=r(156);function s(e,t){var r=o(e)?n:a;return r(e,i(t,3))}e.exports=s},(e,t,r)=>{var n=r(292);function a(e,t){var r=[];n(e,(function(e,n,a){if(t(e,n,a)){r.push(e)}}));return r}e.exports=a},(e,t,r)=>{var n=r(302),a=r(319),i=r(298),o=r(156),s=r(323);function u(e){if(typeof e=="function"){return e}if(e==null){return i}if(typeof e=="object"){return o(e)?a(e[0],e[1]):n(e)}return s(e)}e.exports=u},(e,t,r)=>{var n=r(303),a=r(316),i=r(318);function o(e){var t=a(e);if(t.length==1&&t[0][2]){return i(t[0][0],t[0][1])}return function(r){return r===e||n(r,e,t)}}e.exports=o},(e,t,r)=>{var n=r(228),a=r(304);var i=1,o=2;function s(e,t,r,s){var u=r.length,l=u,f=!s;if(e==null){return!l}e=Object(e);while(u--){var v=r[u];if(f&&v[2]?v[1]!==e[v[0]]:!(v[0]in e)){return false}}while(++u<l){v=r[u];var c=v[0],d=e[c],h=v[1];if(f&&v[2]){if(d===undefined&&!(c in e)){return false}}else{var p=new n;if(s){var g=s(d,h,c,e,t,p)}if(!(g===undefined?a(h,d,i|o,s,p):g)){return false}}}return true}e.exports=s},(e,t,r)=>{var n=r(305),a=r(150);function i(e,t,r,o,s){if(e===t){return true}if(e==null||t==null||!a(e)&&!a(t)){return e!==e&&t!==t}return n(e,t,r,o,i,s)}e.exports=i},(e,t,r)=>{var n=r(228),a=r(306),i=r(312),o=r(315),s=r(270),u=r(156),l=r(242),f=r(244);var v=1;var c="[object Arguments]",d="[object Array]",h="[object Object]";var p=Object.prototype;var g=p.hasOwnProperty;function y(e,t,r,p,y,m){var b=u(e),x=u(t),w=b?d:s(e),E=x?d:s(t);w=w==c?h:w;E=E==c?h:E;var k=w==h,_=E==h,S=w==E;if(S&&l(e)){if(!l(t)){return false}b=true;k=false}if(S&&!k){m||(m=new n);return b||f(e)?a(e,t,r,p,y,m):i(e,t,w,r,p,y,m)}if(!(r&v)){var D=k&&g.call(e,"__wrapped__"),C=_&&g.call(t,"__wrapped__");if(D||C){var T=D?e.value():e,P=C?t.value():t;m||(m=new n);return y(T,P,r,p,m)}}if(!S){return false}m||(m=new n);return o(e,t,r,p,y,m)}e.exports=y},(e,t,r)=>{var n=r(307),a=r(310),i=r(311);var o=1,s=2;function u(e,t,r,u,l,f){var v=r&o,c=e.length,d=t.length;if(c!=d&&!(v&&d>c)){return false}var h=f.get(e);var p=f.get(t);if(h&&p){return h==t&&p==e}var g=-1,y=true,m=r&s?new n:undefined;f.set(e,t);f.set(t,e);while(++g<c){var b=e[g],x=t[g];if(u){var w=v?u(x,b,g,t,e,f):u(b,x,g,e,t,f)}if(w!==undefined){if(w){continue}y=false;break}if(m){if(!a(t,(function(e,t){if(!i(m,t)&&(b===e||l(b,e,r,u,f))){return m.push(t)}}))){y=false;break}}else if(!(b===x||l(b,x,r,u,f))){y=false;break}}f["delete"](e);f["delete"](t);return y}e.exports=u},(e,t,r)=>{var n=r(161),a=r(308),i=r(309);function o(e){var t=-1,r=e==null?0:e.length;this.__data__=new n;while(++t<r){this.add(e[t])}}o.prototype.add=o.prototype.push=a;o.prototype.has=i;e.exports=o},e=>{var t="__lodash_hash_undefined__";function r(e){this.__data__.set(e,t);return this}e.exports=r},e=>{function t(e){return this.__data__.has(e)}e.exports=t},e=>{function t(e,t){var r=-1,n=e==null?0:e.length;while(++r<n){if(t(e[r],r,e)){return true}}return false}e.exports=t},e=>{function t(e,t){return e.has(t)}e.exports=t},(e,t,r)=>{var n=r(147),a=r(278),i=r(181),o=r(306),s=r(313),u=r(314);var l=1,f=2;var v="[object Boolean]",c="[object Date]",d="[object Error]",h="[object Map]",p="[object Number]",g="[object RegExp]",y="[object Set]",m="[object String]",b="[object Symbol]";var x="[object ArrayBuffer]",w="[object DataView]";var E=n?n.prototype:undefined,k=E?E.valueOf:undefined;function _(e,t,r,n,E,_,S){switch(r){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset){return false}e=e.buffer;t=t.buffer;case x:if(e.byteLength!=t.byteLength||!_(new a(e),new a(t))){return false}return true;case v:case c:case p:return i(+e,+t);case d:return e.name==t.name&&e.message==t.message;case g:case m:return e==t+"";case h:var D=s;case y:var C=n&l;D||(D=u);if(e.size!=t.size&&!C){return false}var T=S.get(e);if(T){return T==t}n|=f;S.set(e,t);var P=o(D(e),D(t),n,E,_,S);S["delete"](e);return P;case b:if(k){return k.call(e)==k.call(t)}}return false}e.exports=_},e=>{function t(e){var t=-1,r=Array(e.size);e.forEach((function(e,n){r[++t]=[n,e]}));return r}e.exports=t},e=>{function t(e){var t=-1,r=Array(e.size);e.forEach((function(e){r[++t]=e}));return r}e.exports=t},(e,t,r)=>{var n=r(267);var a=1;var i=Object.prototype;var o=i.hasOwnProperty;function s(e,t,r,i,s,u){var l=r&a,f=n(e),v=f.length,c=n(t),d=c.length;if(v!=d&&!l){return false}var h=v;while(h--){var p=f[h];if(!(l?p in t:o.call(t,p))){return false}}var g=u.get(e);var y=u.get(t);if(g&&y){return g==t&&y==e}var m=true;u.set(e,t);u.set(t,e);var b=l;while(++h<v){p=f[h];var x=e[p],w=t[p];if(i){var E=l?i(w,x,p,t,e,u):i(x,w,p,e,t,u)}if(!(E===undefined?x===w||s(x,w,r,i,u):E)){m=false;break}b||(b=p=="constructor")}if(m&&!b){var k=e.constructor,_=t.constructor;if(k!=_&&("constructor"in e&&"constructor"in t)&&!(typeof k=="function"&&k instanceof k&&typeof _=="function"&&_ instanceof _)){m=false}}u["delete"](e);u["delete"](t);return m}e.exports=s},(e,t,r)=>{var n=r(317),a=r(237);function i(e){var t=a(e),r=t.length;while(r--){var i=t[r],o=e[i];t[r]=[i,o,n(o)]}return t}e.exports=i},(e,t,r)=>{var n=r(138);function a(e){return e===e&&!n(e)}e.exports=a},e=>{function t(e,t){return function(r){if(r==null){return false}return r[e]===t&&(t!==undefined||e in Object(r))}}e.exports=t},(e,t,r)=>{var n=r(304),a=r(153),i=r(320),o=r(157),s=r(317),u=r(318),l=r(195);var f=1,v=2;function c(e,t){if(o(e)&&s(t)){return u(l(e),t)}return function(r){var o=a(r,e);return o===undefined&&o===t?i(r,e):n(t,o,f|v)}}e.exports=c},(e,t,r)=>{var n=r(321),a=r(322);function i(e,t){return e!=null&&a(e,t,n)}e.exports=i},e=>{function t(e,t){return e!=null&&t in Object(e)}e.exports=t},(e,t,r)=>{var n=r(155),a=r(240),i=r(156),o=r(201),s=r(246),u=r(195);function l(e,t,r){t=n(t,e);var l=-1,f=t.length,v=false;while(++l<f){var c=u(t[l]);if(!(v=e!=null&&r(e,c))){break}e=e[c]}if(v||++l!=f){return v}f=e==null?0:e.length;return!!f&&s(f)&&o(c,f)&&(i(e)||a(e))}e.exports=l},(e,t,r)=>{var n=r(324),a=r(325),i=r(157),o=r(195);function s(e){return i(e)?n(o(e)):a(e)}e.exports=s},e=>{function t(e){return function(t){return t==null?undefined:t[e]}}e.exports=t},(e,t,r)=>{var n=r(154);function a(e){return function(t){return n(t,e)}}e.exports=a},(e,t,r)=>{var n=r(327),a=r(322);function i(e,t){return e!=null&&a(e,t,n)}e.exports=i},e=>{var t=Object.prototype;var r=t.hasOwnProperty;function n(e,t){return e!=null&&r.call(e,t)}e.exports=n},(e,t,r)=>{var n=r(249),a=r(270),i=r(240),o=r(156),s=r(253),u=r(242),l=r(250),f=r(244);var v="[object Map]",c="[object Set]";var d=Object.prototype;var h=d.hasOwnProperty;function p(e){if(e==null){return true}if(s(e)&&(o(e)||typeof e=="string"||typeof e.splice=="function"||u(e)||f(e)||i(e))){return!e.length}var t=a(e);if(t==v||t==c){return!e.size}if(l(e)){return!n(e).length}for(var r in e){if(h.call(e,r)){return false}}return true}e.exports=p},e=>{function t(e){return e===undefined}e.exports=t},(e,t,r)=>{var n=r(194),a=r(301),i=r(331),o=r(156);function s(e,t){var r=o(e)?n:i;return r(e,a(t,3))}e.exports=s},(e,t,r)=>{var n=r(292),a=r(253);function i(e,t){var r=-1,i=a(e)?Array(e.length):[];n(e,(function(e,n,a){i[++r]=t(e,n,a)}));return i}e.exports=i},(e,t,r)=>{var n=r(333),a=r(292),i=r(301),o=r(334),s=r(156);function u(e,t,r){var u=s(e)?n:o,l=arguments.length<3;return u(e,i(t,4),r,l,a)}e.exports=u},e=>{function t(e,t,r,n){var a=-1,i=e==null?0:e.length;if(n&&i){r=e[++a]}while(++a<i){r=t(r,e[a],a,e)}return r}e.exports=t},e=>{function t(e,t,r,n,a){a(e,(function(e,a,i){r=n?(n=false,e):t(r,e,a,i)}));return r}e.exports=t},(e,t,r)=>{var n=r(249),a=r(270),i=r(253),o=r(336),s=r(337);var u="[object Map]",l="[object Set]";function f(e){if(e==null){return 0}if(i(e)){return o(e)?s(e):e.length}var t=a(e);if(t==u||t==l){return e.size}return n(e).length}e.exports=f},(e,t,r)=>{var n=r(146),a=r(156),i=r(150);var o="[object String]";function s(e){return typeof e=="string"||!a(e)&&i(e)&&n(e)==o}e.exports=s},(e,t,r)=>{var n=r(338),a=r(339),i=r(340);function o(e){return a(e)?i(e):n(e)}e.exports=o},(e,t,r)=>{var n=r(324);var a=n("length");e.exports=a},e=>{var t="\\ud800-\\udfff",r="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",i=r+n+a,o="\\ufe0e\\ufe0f";var s="\\u200d";var u=RegExp("["+s+t+i+o+"]");function l(e){return u.test(e)}e.exports=l},e=>{var t="\\ud800-\\udfff",r="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",i=r+n+a,o="\\ufe0e\\ufe0f";var s="["+t+"]",u="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+l+")",v="[^"+t+"]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",h="\\u200d";var p=f+"?",g="["+o+"]?",y="(?:"+h+"(?:"+[v,c,d].join("|")+")"+g+p+")*",m=g+p+y,b="(?:"+[v+u+"?",u,c,d,s].join("|")+")";var x=RegExp(l+"(?="+l+")|"+b+m,"g");function w(e){var t=x.lastIndex=0;while(x.test(e)){++t}return t}e.exports=w},(e,t,r)=>{var n=r(234),a=r(284),i=r(293),o=r(301),s=r(266),u=r(156),l=r(242),f=r(168),v=r(138),c=r(244);function d(e,t,r){var d=u(e),h=d||l(e)||c(e);t=o(t,4);if(r==null){var p=e&&e.constructor;if(h){r=d?new p:[]}else if(v(e)){r=f(p)?a(s(e)):{}}else{r={}}}(h?n:i)(e,(function(e,n,a){return t(r,e,n,a)}));return r}e.exports=d},(e,t,r)=>{var n=r(343),a=r(345),i=r(351),o=r(360);var s=a((function(e){return i(n(e,1,o,true))}));e.exports=s},(e,t,r)=>{var n=r(265),a=r(344);function i(e,t,r,o,s){var u=-1,l=e.length;r||(r=a);s||(s=[]);while(++u<l){var f=e[u];if(t>0&&r(f)){if(t>1){i(f,t-1,r,o,s)}else{n(s,f)}}else if(!o){s[s.length]=f}}return s}e.exports=i},(e,t,r)=>{var n=r(147),a=r(240),i=r(156);var o=n?n.isConcatSpreadable:undefined;function s(e){return i(e)||a(e)||!!(o&&e&&e[o])}e.exports=s},(e,t,r)=>{var n=r(298),a=r(346),i=r(348);function o(e,t){return i(a(e,t,n),e+"")}e.exports=o},(e,t,r)=>{var n=r(347);var a=Math.max;function i(e,t,r){t=a(t===undefined?e.length-1:t,0);return function(){var i=arguments,o=-1,s=a(i.length-t,0),u=Array(s);while(++o<s){u[o]=i[t+o]}o=-1;var l=Array(t+1);while(++o<t){l[o]=i[o]}l[t]=r(u);return n(e,this,l)}}e.exports=i},e=>{function t(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}e.exports=t},(e,t,r)=>{var n=r(349),a=r(350);var i=a(n);e.exports=i},(e,t,r)=>{var n=r(289),a=r(200),i=r(298);var o=!a?i:function(e,t){return a(e,"toString",{configurable:true,enumerable:false,value:n(t),writable:true})};e.exports=o},e=>{var t=800,r=16;var n=Date.now;function a(e){var a=0,i=0;return function(){var o=n(),s=r-(o-i);i=o;if(s>0){if(++a>=t){return arguments[0]}}else{a=0}return e.apply(undefined,arguments)}}e.exports=a},(e,t,r)=>{var n=r(307),a=r(352),i=r(357),o=r(311),s=r(358),u=r(314);var l=200;function f(e,t,r){var f=-1,v=a,c=e.length,d=true,h=[],p=h;if(r){d=false;v=i}else if(c>=l){var g=t?null:s(e);if(g){return u(g)}d=false;v=o;p=new n}else{p=t?[]:h}e:while(++f<c){var y=e[f],m=t?t(y):y;y=r||y!==0?y:0;if(d&&m===m){var b=p.length;while(b--){if(p[b]===m){continue e}}if(t){p.push(m)}h.push(y)}else if(!v(p,m,r)){if(p!==h){p.push(m)}h.push(y)}}return h}e.exports=f},(e,t,r)=>{var n=r(353);function a(e,t){var r=e==null?0:e.length;return!!r&&n(e,t,0)>-1}e.exports=a},(e,t,r)=>{var n=r(354),a=r(355),i=r(356);function o(e,t,r){return t===t?i(e,t,r):n(e,a,r)}e.exports=o},e=>{function t(e,t,r,n){var a=e.length,i=r+(n?1:-1);while(n?i--:++i<a){if(t(e[i],i,e)){return i}}return-1}e.exports=t},e=>{function t(e){return e!==e}e.exports=t},e=>{function t(e,t,r){var n=r-1,a=e.length;while(++n<a){if(e[n]===t){return n}}return-1}e.exports=t},e=>{function t(e,t,r){var n=-1,a=e==null?0:e.length;while(++n<a){if(r(t,e[n])){return true}}return false}e.exports=t},(e,t,r)=>{var n=r(273),a=r(359),i=r(314);var o=1/0;var s=!(n&&1/i(new n([,-0]))[1]==o)?a:function(e){return new n(e)};e.exports=s},e=>{function t(){}e.exports=t},(e,t,r)=>{var n=r(253),a=r(150);function i(e){return a(e)&&n(e)}e.exports=i},(e,t,r)=>{var n=r(362),a=r(237);function i(e){return e==null?[]:n(e,a(e))}e.exports=i},(e,t,r)=>{var n=r(194);function a(e,t){return n(t,(function(t){return e[t]}))}e.exports=a},e=>{e.exports="2.1.8"},(e,t,r)=>{var n=r(225);var a=r(224);e.exports={write:i,read:u};function i(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:s(e)};if(!n.isUndefined(e.graph())){t.value=n.clone(e.graph())}return t}function o(e){return n.map(e.nodes(),(function(t){var r=e.node(t);var a=e.parent(t);var i={v:t};if(!n.isUndefined(r)){i.value=r}if(!n.isUndefined(a)){i.parent=a}return i}))}function s(e){return n.map(e.edges(),(function(t){var r=e.edge(t);var a={v:t.v,w:t.w};if(!n.isUndefined(t.name)){a.name=t.name}if(!n.isUndefined(r)){a.value=r}return a}))}function u(e){var t=new a(e.options).setGraph(e.value);n.each(e.nodes,(function(e){t.setNode(e.v,e.value);if(e.parent){t.setParent(e.v,e.parent)}}));n.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}));return t}},(e,t,r)=>{e.exports={components:r(366),dijkstra:r(367),dijkstraAll:r(369),findCycles:r(370),floydWarshall:r(372),isAcyclic:r(373),postorder:r(375),preorder:r(377),prim:r(378),tarjan:r(371),topsort:r(374)}},(e,t,r)=>{var n=r(225);e.exports=a;function a(e){var t={};var r=[];var a;function i(r){if(n.has(t,r))return;t[r]=true;a.push(r);n.each(e.successors(r),i);n.each(e.predecessors(r),i)}n.each(e.nodes(),(function(e){a=[];i(e);if(a.length){r.push(a)}}));return r}},(e,t,r)=>{var n=r(225);var a=r(368);e.exports=o;var i=n.constant(1);function o(e,t,r,n){return s(e,String(t),r||i,n||function(t){return e.outEdges(t)})}function s(e,t,r,n){var i={};var o=new a;var s,u;var l=function(e){var t=e.v!==s?e.v:e.w;var n=i[t];var a=r(e);var l=u.distance+a;if(a<0){throw new Error("dijkstra does not allow negative edge weights. "+"Bad edge: "+e+" Weight: "+a)}if(l<n.distance){n.distance=l;n.predecessor=s;o.decrease(t,l)}};e.nodes().forEach((function(e){var r=e===t?0:Number.POSITIVE_INFINITY;i[e]={distance:r};o.add(e,r)}));while(o.size()>0){s=o.removeMin();u=i[s];if(u.distance===Number.POSITIVE_INFINITY){break}n(s).forEach(l)}return i}},(e,t,r)=>{var n=r(225);e.exports=a;function a(){this._arr=[];this._keyIndices={}}a.prototype.size=function(){return this._arr.length};a.prototype.keys=function(){return this._arr.map((function(e){return e.key}))};a.prototype.has=function(e){return n.has(this._keyIndices,e)};a.prototype.priority=function(e){var t=this._keyIndices[e];if(t!==undefined){return this._arr[t].priority}};a.prototype.min=function(){if(this.size()===0){throw new Error("Queue underflow")}return this._arr[0].key};a.prototype.add=function(e,t){var r=this._keyIndices;e=String(e);if(!n.has(r,e)){var a=this._arr;var i=a.length;r[e]=i;a.push({key:e,priority:t});this._decrease(i);return true}return false};a.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();delete this._keyIndices[e.key];this._heapify(0);return e.key};a.prototype.decrease=function(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority){throw new Error("New priority is greater than current priority. "+"Key: "+e+" Old: "+this._arr[r].priority+" New: "+t)}this._arr[r].priority=t;this._decrease(r)};a.prototype._heapify=function(e){var t=this._arr;var r=2*e;var n=r+1;var a=e;if(r<t.length){a=t[r].priority<t[a].priority?r:a;if(n<t.length){a=t[n].priority<t[a].priority?n:a}if(a!==e){this._swap(e,a);this._heapify(a)}}};a.prototype._decrease=function(e){var t=this._arr;var r=t[e].priority;var n;while(e!==0){n=e>>1;if(t[n].priority<r){break}this._swap(e,n);e=n}};a.prototype._swap=function(e,t){var r=this._arr;var n=this._keyIndices;var a=r[e];var i=r[t];r[e]=i;r[t]=a;n[i.key]=e;n[a.key]=t}},(e,t,r)=>{var n=r(367);var a=r(225);e.exports=i;function i(e,t,r){return a.transform(e.nodes(),(function(a,i){a[i]=n(e,i,t,r)}),{})}},(e,t,r)=>{var n=r(225);var a=r(371);e.exports=i;function i(e){return n.filter(a(e),(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])}))}},(e,t,r)=>{var n=r(225);e.exports=a;function a(e){var t=0;var r=[];var a={};var i=[];function o(s){var u=a[s]={onStack:true,lowlink:t,index:t++};r.push(s);e.successors(s).forEach((function(e){if(!n.has(a,e)){o(e);u.lowlink=Math.min(u.lowlink,a[e].lowlink)}else if(a[e].onStack){u.lowlink=Math.min(u.lowlink,a[e].index)}}));if(u.lowlink===u.index){var l=[];var f;do{f=r.pop();a[f].onStack=false;l.push(f)}while(s!==f);i.push(l)}}e.nodes().forEach((function(e){if(!n.has(a,e)){o(e)}}));return i}},(e,t,r)=>{var n=r(225);e.exports=i;var a=n.constant(1);function i(e,t,r){return o(e,t||a,r||function(t){return e.outEdges(t)})}function o(e,t,r){var n={};var a=e.nodes();a.forEach((function(e){n[e]={};n[e][e]={distance:0};a.forEach((function(t){if(e!==t){n[e][t]={distance:Number.POSITIVE_INFINITY}}}));r(e).forEach((function(r){var a=r.v===e?r.w:r.v;var i=t(r);n[e][a]={distance:i,predecessor:e}}))}));a.forEach((function(e){var t=n[e];a.forEach((function(r){var i=n[r];a.forEach((function(r){var n=i[e];var a=t[r];var o=i[r];var s=n.distance+a.distance;if(s<o.distance){o.distance=s;o.predecessor=a.predecessor}}))}))}));return n}},(e,t,r)=>{var n=r(374);e.exports=a;function a(e){try{n(e)}catch(e){if(e instanceof n.CycleException){return false}throw e}return true}},(e,t,r)=>{var n=r(225);e.exports=a;a.CycleException=i;function a(e){var t={};var r={};var a=[];function o(s){if(n.has(r,s)){throw new i}if(!n.has(t,s)){r[s]=true;t[s]=true;n.each(e.predecessors(s),o);delete r[s];a.push(s)}}n.each(e.sinks(),o);if(n.size(t)!==e.nodeCount()){throw new i}return a}function i(){}i.prototype=new Error},(e,t,r)=>{var n=r(376);e.exports=a;function a(e,t){return n(e,t,"post")}},(e,t,r)=>{var n=r(225);e.exports=a;function a(e,t,r){if(!n.isArray(t)){t=[t]}var a=(e.isDirected()?e.successors:e.neighbors).bind(e);var o=[];var s={};n.each(t,(function(t){if(!e.hasNode(t)){throw new Error("Graph does not have node: "+t)}i(e,t,r==="post",s,a,o)}));return o}function i(e,t,r,a,o,s){if(!n.has(a,t)){a[t]=true;if(!r){s.push(t)}n.each(o(t),(function(t){i(e,t,r,a,o,s)}));if(r){s.push(t)}}}},(e,t,r)=>{var n=r(376);e.exports=a;function a(e,t){return n(e,t,"pre")}},(e,t,r)=>{var n=r(225);var a=r(224);var i=r(368);e.exports=o;function o(e,t){var r=new a;var o={};var s=new i;var u;function l(e){var r=e.v===u?e.w:e.v;var n=s.priority(r);if(n!==undefined){var a=t(e);if(a<n){o[r]=u;s.decrease(r,a)}}}if(e.nodeCount()===0){return r}n.each(e.nodes(),(function(e){s.add(e,Number.POSITIVE_INFINITY);r.setNode(e)}));s.decrease(e.nodes()[0],0);var f=false;while(s.size()>0){u=s.removeMin();if(n.has(o,u)){r.setEdge(u,o[u])}else if(f){throw new Error("Input graph is not connected: "+e)}else{f=true}e.nodeEdges(u).forEach(l)}return r}},(e,t,r)=>{"use strict";var n=r(380);var a=r(422);var i=r(425);var o=r(427);var s=r(426).normalizeRanks;var u=r(431);var l=r(426).removeEmptyRanks;var f=r(432);var v=r(433);var c=r(434);var d=r(435);var h=r(444);var p=r(426);var g=r(221).Graph;e.exports=y;function y(e,t){var r=t&&t.debugTiming?p.time:p.notime;r("layout",(function(){var t=r(" buildLayoutGraph",(function(){return T(e)}));r(" runLayout",(function(){m(t,r)}));r(" updateInputGraph",(function(){b(e,t)}))}))}function m(e,t){t(" makeSpaceForEdgeLabels",(function(){P(e)}));t(" removeSelfEdges",(function(){R(e)}));t(" acyclic",(function(){a.run(e)}));t(" nestingGraph.run",(function(){f.run(e)}));t(" rank",(function(){o(p.asNonCompoundGraph(e))}));t(" injectEdgeLabelProxies",(function(){M(e)}));t(" removeEmptyRanks",(function(){l(e)}));t(" nestingGraph.cleanup",(function(){f.cleanup(e)}));t(" normalizeRanks",(function(){s(e)}));t(" assignRankMinMax",(function(){I(e)}));t(" removeEdgeLabelProxies",(function(){O(e)}));t(" normalize.run",(function(){i.run(e)}));t(" parentDummyChains",(function(){u(e)}));t(" addBorderSegments",(function(){v(e)}));t(" order",(function(){d(e)}));t(" insertSelfEdges",(function(){j(e)}));t(" adjustCoordinateSystem",(function(){c.adjust(e)}));t(" position",(function(){h(e)}));t(" positionSelfEdges",(function(){F(e)}));t(" removeBorderNodes",(function(){B(e)}));t(" normalize.undo",(function(){i.undo(e)}));t(" fixupEdgeLabelCoords",(function(){L(e)}));t(" undoCoordinateSystem",(function(){c.undo(e)}));t(" translateGraph",(function(){N(e)}));t(" assignNodeIntersects",(function(){z(e)}));t(" reversePoints",(function(){A(e)}));t(" acyclic.undo",(function(){a.undo(e)}))}function b(e,t){n.forEach(e.nodes(),(function(r){var n=e.node(r);var a=t.node(r);if(n){n.x=a.x;n.y=a.y;if(t.children(r).length){n.width=a.width;n.height=a.height}}}));n.forEach(e.edges(),(function(r){var a=e.edge(r);var i=t.edge(r);a.points=i.points;if(n.has(i,"x")){a.x=i.x;a.y=i.y}}));e.graph().width=t.graph().width;e.graph().height=t.graph().height}var x=["nodesep","edgesep","ranksep","marginx","marginy"];var w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"};var E=["acyclicer","ranker","rankdir","align"];var k=["width","height"];var _={width:0,height:0};var S=["minlen","weight","width","height","labeloffset"];var D={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"};var C=["labelpos"];function T(e){var t=new g({multigraph:true,compound:true});var r=q(e.graph());t.setGraph(n.merge({},w,V(r,x),n.pick(r,E)));n.forEach(e.nodes(),(function(r){var a=q(e.node(r));t.setNode(r,n.defaults(V(a,k),_));t.setParent(r,e.parent(r))}));n.forEach(e.edges(),(function(r){var a=q(e.edge(r));t.setEdge(r,n.merge({},D,V(a,S),n.pick(a,C)))}));return t}function P(e){var t=e.graph();t.ranksep/=2;n.forEach(e.edges(),(function(r){var n=e.edge(r);n.minlen*=2;if(n.labelpos.toLowerCase()!=="c"){if(t.rankdir==="TB"||t.rankdir==="BT"){n.width+=n.labeloffset}else{n.height+=n.labeloffset}}}))}function M(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v);var a=e.node(t.w);var i={rank:(a.rank-n.rank)/2+n.rank,e:t};p.addDummyNode(e,"edge-proxy",i,"_ep")}}))}function I(e){var t=0;n.forEach(e.nodes(),(function(r){var a=e.node(r);if(a.borderTop){a.minRank=e.node(a.borderTop).rank;a.maxRank=e.node(a.borderBottom).rank;t=n.max(t,a.maxRank)}}));e.graph().maxRank=t}function O(e){n.forEach(e.nodes(),(function(t){var r=e.node(t);if(r.dummy==="edge-proxy"){e.edge(r.e).labelRank=r.rank;e.removeNode(t)}}))}function N(e){var t=Number.POSITIVE_INFINITY;var r=0;var a=Number.POSITIVE_INFINITY;var i=0;var o=e.graph();var s=o.marginx||0;var u=o.marginy||0;function l(e){var n=e.x;var o=e.y;var s=e.width;var u=e.height;t=Math.min(t,n-s/2);r=Math.max(r,n+s/2);a=Math.min(a,o-u/2);i=Math.max(i,o+u/2)}n.forEach(e.nodes(),(function(t){l(e.node(t))}));n.forEach(e.edges(),(function(t){var r=e.edge(t);if(n.has(r,"x")){l(r)}}));t-=s;a-=u;n.forEach(e.nodes(),(function(r){var n=e.node(r);n.x-=t;n.y-=a}));n.forEach(e.edges(),(function(r){var i=e.edge(r);n.forEach(i.points,(function(e){e.x-=t;e.y-=a}));if(n.has(i,"x")){i.x-=t}if(n.has(i,"y")){i.y-=a}}));o.width=r-t+s;o.height=i-a+u}function z(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);var n=e.node(t.v);var a=e.node(t.w);var i,o;if(!r.points){r.points=[];i=a;o=n}else{i=r.points[0];o=r.points[r.points.length-1]}r.points.unshift(p.intersectRect(n,i));r.points.push(p.intersectRect(a,o))}))}function L(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);if(n.has(r,"x")){if(r.labelpos==="l"||r.labelpos==="r"){r.width-=r.labeloffset}switch(r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}}}))}function A(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.reversed){r.points.reverse()}}))}function B(e){n.forEach(e.nodes(),(function(t){if(e.children(t).length){var r=e.node(t);var a=e.node(r.borderTop);var i=e.node(r.borderBottom);var o=e.node(n.last(r.borderLeft));var s=e.node(n.last(r.borderRight));r.width=Math.abs(s.x-o.x);r.height=Math.abs(i.y-a.y);r.x=o.x+r.width/2;r.y=a.y+r.height/2}}));n.forEach(e.nodes(),(function(t){if(e.node(t).dummy==="border"){e.removeNode(t)}}))}function R(e){n.forEach(e.edges(),(function(t){if(t.v===t.w){var r=e.node(t.v);if(!r.selfEdges){r.selfEdges=[]}r.selfEdges.push({e:t,label:e.edge(t)});e.removeEdge(t)}}))}function j(e){var t=p.buildLayerMatrix(e);n.forEach(t,(function(t){var r=0;n.forEach(t,(function(t,a){var i=e.node(t);i.order=a+r;n.forEach(i.selfEdges,(function(t){p.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:a+ ++r,e:t.e,label:t.label},"_se")}));delete i.selfEdges}))}))}function F(e){n.forEach(e.nodes(),(function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v);var a=n.x+n.width/2;var i=n.y;var o=r.x-a;var s=n.height/2;e.setEdge(r.e,r.label);e.removeNode(t);r.label.points=[{x:a+2*o/3,y:i-s},{x:a+5*o/6,y:i-s},{x:a+o,y:i},{x:a+5*o/6,y:i+s},{x:a+2*o/3,y:i+s}];r.label.x=r.x;r.label.y=r.y}}))}function V(e,t){return n.mapValues(n.pick(e,t),Number)}function q(e){var t={};n.forEach(e,(function(e,r){t[r.toLowerCase()]=e}));return t}},(e,t,r)=>{var n;if(true){try{n={cloneDeep:r(381),constant:r(289),defaults:r(382),each:r(290),filter:r(299),find:r(384),flatten:r(389),forEach:r(291),forIn:r(390),has:r(326),isUndefined:r(329),last:r(391),map:r(330),mapValues:r(392),max:r(393),merge:r(396),min:r(404),minBy:r(406),now:r(139),pick:r(407),range:r(411),reduce:r(332),sortBy:r(414),uniqueId:r(419),values:r(361),zipObject:r(420)}}catch(e){}}if(!n){n=window._}e.exports=n},(e,t,r)=>{var n=r(227);var a=1,i=4;function o(e){return n(e,a|i)}e.exports=o},(e,t,r)=>{var n=r(345),a=r(181),i=r(383),o=r(255);var s=Object.prototype;var u=s.hasOwnProperty;var l=n((function(e,t){e=Object(e);var r=-1;var n=t.length;var l=n>2?t[2]:undefined;if(l&&i(t[0],t[1],l)){n=1}while(++r<n){var f=t[r];var v=o(f);var c=-1;var d=v.length;while(++c<d){var h=v[c];var p=e[h];if(p===undefined||a(p,s[h])&&!u.call(e,h)){e[h]=f[h]}}}return e}));e.exports=l},(e,t,r)=>{var n=r(181),a=r(253),i=r(201),o=r(138);function s(e,t,r){if(!o(r)){return false}var s=typeof t;if(s=="number"?a(r)&&i(t,r.length):s=="string"&&t in r){return n(r[t],e)}return false}e.exports=s},(e,t,r)=>{var n=r(385),a=r(386);var i=n(a);e.exports=i},(e,t,r)=>{var n=r(301),a=r(253),i=r(237);function o(e){return function(t,r,o){var s=Object(t);if(!a(t)){var u=n(r,3);t=i(t);r=function(e){return u(s[e],e,s)}}var l=e(t,r,o);return l>-1?s[u?t[l]:l]:undefined}}e.exports=o},(e,t,r)=>{var n=r(354),a=r(301),i=r(387);var o=Math.max;function s(e,t,r){var s=e==null?0:e.length;if(!s){return-1}var u=r==null?0:i(r);if(u<0){u=o(s+u,0)}return n(e,a(t,3),u)}e.exports=s},(e,t,r)=>{var n=r(388);function a(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}e.exports=a},(e,t,r)=>{var n=r(142);var a=1/0,i=17976931348623157e292;function o(e){if(!e){return e===0?e:0}e=n(e);if(e===a||e===-a){var t=e<0?-1:1;return t*i}return e===e?e:0}e.exports=o},(e,t,r)=>{var n=r(343);function a(e){var t=e==null?0:e.length;return t?n(e,1):[]}e.exports=a},(e,t,r)=>{var n=r(294),a=r(297),i=r(255);function o(e,t){return e==null?e:n(e,a(t),i)}e.exports=o},e=>{function t(e){var t=e==null?0:e.length;return t?e[t-1]:undefined}e.exports=t},(e,t,r)=>{var n=r(199),a=r(293),i=r(301);function o(e,t){var r={};t=i(t,3);a(e,(function(e,a,i){n(r,a,t(e,a,i))}));return r}e.exports=o},(e,t,r)=>{var n=r(394),a=r(395),i=r(298);function o(e){return e&&e.length?n(e,i,a):undefined}e.exports=o},(e,t,r)=>{var n=r(145);function a(e,t,r){var a=-1,i=e.length;while(++a<i){var o=e[a],s=t(o);if(s!=null&&(u===undefined?s===s&&!n(s):r(s,u))){var u=s,l=o}}return l}e.exports=a},e=>{function t(e,t){return e>t}e.exports=t},(e,t,r)=>{var n=r(397),a=r(403);var i=a((function(e,t,r){n(e,t,r)}));e.exports=i},(e,t,r)=>{var n=r(228),a=r(398),i=r(294),o=r(399),s=r(138),u=r(255),l=r(401);function f(e,t,r,v,c){if(e===t){return}i(t,(function(i,u){c||(c=new n);if(s(i)){o(e,t,u,r,f,v,c)}else{var d=v?v(l(e,u),i,u+"",e,t,c):undefined;if(d===undefined){d=i}a(e,u,d)}}),u)}e.exports=f},(e,t,r)=>{var n=r(199),a=r(181);function i(e,t,r){if(r!==undefined&&!a(e[t],r)||r===undefined&&!(t in e)){n(e,t,r)}}e.exports=i},(e,t,r)=>{var n=r(398),a=r(258),i=r(282),o=r(203),s=r(283),u=r(240),l=r(156),f=r(360),v=r(242),c=r(168),d=r(138),h=r(400),p=r(244),g=r(401),y=r(402);function m(e,t,r,m,b,x,w){var E=g(e,r),k=g(t,r),_=w.get(k);if(_){n(e,r,_);return}var S=x?x(E,k,r+"",e,t,w):undefined;var D=S===undefined;if(D){var C=l(k),T=!C&&v(k),P=!C&&!T&&p(k);S=k;if(C||T||P){if(l(E)){S=E}else if(f(E)){S=o(E)}else if(T){D=false;S=a(k,true)}else if(P){D=false;S=i(k,true)}else{S=[]}}else if(h(k)||u(k)){S=E;if(u(E)){S=y(E)}else if(!d(E)||c(E)){S=s(k)}}else{D=false}}if(D){w.set(k,S);b(S,k,m,x,w);w["delete"](k)}n(e,r,S)}e.exports=m},(e,t,r)=>{var n=r(146),a=r(266),i=r(150);var o="[object Object]";var s=Function.prototype,u=Object.prototype;var l=s.toString;var f=u.hasOwnProperty;var v=l.call(Object);function c(e){if(!i(e)||n(e)!=o){return false}var t=a(e);if(t===null){return true}var r=f.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&l.call(r)==v}e.exports=c},e=>{function t(e,t){if(t==="constructor"&&typeof e[t]==="function"){return}if(t=="__proto__"){return}return e[t]}e.exports=t},(e,t,r)=>{var n=r(236),a=r(255);function i(e){return n(e,a(e))}e.exports=i},(e,t,r)=>{var n=r(345),a=r(383);function i(e){return n((function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:undefined,s=i>2?r[2]:undefined;o=e.length>3&&typeof o=="function"?(i--,o):undefined;if(s&&a(r[0],r[1],s)){o=i<3?undefined:o;i=1}t=Object(t);while(++n<i){var u=r[n];if(u){e(t,u,n,o)}}return t}))}e.exports=i},(e,t,r)=>{var n=r(394),a=r(405),i=r(298);function o(e){return e&&e.length?n(e,i,a):undefined}e.exports=o},e=>{function t(e,t){return e<t}e.exports=t},(e,t,r)=>{var n=r(394),a=r(301),i=r(405);function o(e,t){return e&&e.length?n(e,a(t,2),i):undefined}e.exports=o},(e,t,r)=>{var n=r(408),a=r(410);var i=a((function(e,t){return e==null?{}:n(e,t)}));e.exports=i},(e,t,r)=>{var n=r(409),a=r(320);function i(e,t){return n(e,t,(function(t,r){return a(e,r)}))}e.exports=i},(e,t,r)=>{var n=r(154),a=r(197),i=r(155);function o(e,t,r){var o=-1,s=t.length,u={};while(++o<s){var l=t[o],f=n(e,l);if(r(f,l)){a(u,i(l,e),f)}}return u}e.exports=o},(e,t,r)=>{var n=r(389),a=r(346),i=r(348);function o(e){return i(a(e,undefined,n),e+"")}e.exports=o},(e,t,r)=>{var n=r(412);var a=n();e.exports=a},(e,t,r)=>{var n=r(413),a=r(383),i=r(388);function o(e){return function(t,r,o){if(o&&typeof o!="number"&&a(t,r,o)){r=o=undefined}t=i(t);if(r===undefined){r=t;t=0}else{r=i(r)}o=o===undefined?t<r?1:-1:i(o);return n(t,r,o,e)}}e.exports=o},e=>{var t=Math.ceil,r=Math.max;function n(e,n,a,i){var o=-1,s=r(t((n-e)/(a||1)),0),u=Array(s);while(s--){u[i?s:++o]=e;e+=a}return u}e.exports=n},(e,t,r)=>{var n=r(343),a=r(415),i=r(345),o=r(383);var s=i((function(e,t){if(e==null){return[]}var r=t.length;if(r>1&&o(e,t[0],t[1])){t=[]}else if(r>2&&o(t[0],t[1],t[2])){t=[t[0]]}return a(e,n(t,1),[])}));e.exports=s},(e,t,r)=>{var n=r(194),a=r(154),i=r(301),o=r(331),s=r(416),u=r(247),l=r(417),f=r(298),v=r(156);function c(e,t,r){if(t.length){t=n(t,(function(e){if(v(e)){return function(t){return a(t,e.length===1?e[0]:e)}}return e}))}else{t=[f]}var c=-1;t=n(t,u(i));var d=o(e,(function(e,r,a){var i=n(t,(function(t){return t(e)}));return{criteria:i,index:++c,value:e}}));return s(d,(function(e,t){return l(e,t,r)}))}e.exports=c},e=>{function t(e,t){var r=e.length;e.sort(t);while(r--){e[r]=e[r].value}return e}e.exports=t},(e,t,r)=>{var n=r(418);function a(e,t,r){var a=-1,i=e.criteria,o=t.criteria,s=i.length,u=r.length;while(++a<s){var l=n(i[a],o[a]);if(l){if(a>=u){return l}var f=r[a];return l*(f=="desc"?-1:1)}}return e.index-t.index}e.exports=a},(e,t,r)=>{var n=r(145);function a(e,t){if(e!==t){var r=e!==undefined,a=e===null,i=e===e,o=n(e);var s=t!==undefined,u=t===null,l=t===t,f=n(t);if(!u&&!f&&!o&&e>t||o&&s&&l&&!u&&!f||a&&s&&l||!r&&l||!i){return 1}if(!a&&!o&&!f&&e<t||f&&r&&i&&!a&&!o||u&&r&&i||!s&&i||!l){return-1}}return 0}e.exports=a},(e,t,r)=>{var n=r(192);var a=0;function i(e){var t=++a;return n(e)+t}e.exports=i},(e,t,r)=>{var n=r(198),a=r(421);function i(e,t){return a(e||[],t||[],n)}e.exports=i},e=>{function t(e,t,r){var n=-1,a=e.length,i=t.length,o={};while(++n<a){var s=n<i?t[n]:undefined;r(o,e[n],s)}return o}e.exports=t},(e,t,r)=>{"use strict";var n=r(380);var a=r(423);e.exports={run:i,undo:s};function i(e){var t=e.graph().acyclicer==="greedy"?a(e,r(e)):o(e);n.forEach(t,(function(t){var r=e.edge(t);e.removeEdge(t);r.forwardName=t.name;r.reversed=true;e.setEdge(t.w,t.v,r,n.uniqueId("rev"))}));function r(e){return function(t){return e.edge(t).weight}}}function o(e){var t=[];var r={};var a={};function i(o){if(n.has(a,o)){return}a[o]=true;r[o]=true;n.forEach(e.outEdges(o),(function(e){if(n.has(r,e.w)){t.push(e)}else{i(e.w)}}));delete r[o]}n.forEach(e.nodes(),i);return t}function s(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed;delete r.forwardName;e.setEdge(t.w,t.v,r,n)}}))}},(e,t,r)=>{var n=r(380);var a=r(221).Graph;var i=r(424);e.exports=s;var o=n.constant(1);function s(e,t){if(e.nodeCount()<=1){return[]}var r=f(e,t||o);var a=u(r.graph,r.buckets,r.zeroIdx);return n.flatten(n.map(a,(function(t){return e.outEdges(t.v,t.w)})),true)}function u(e,t,r){var n=[];var a=t[t.length-1];var i=t[0];var o;while(e.nodeCount()){while(o=i.dequeue()){l(e,t,r,o)}while(o=a.dequeue()){l(e,t,r,o)}if(e.nodeCount()){for(var s=t.length-2;s>0;--s){o=t[s].dequeue();if(o){n=n.concat(l(e,t,r,o,true));break}}}}return n}function l(e,t,r,a,i){var o=i?[]:undefined;n.forEach(e.inEdges(a.v),(function(n){var a=e.edge(n);var s=e.node(n.v);if(i){o.push({v:n.v,w:n.w})}s.out-=a;v(t,r,s)}));n.forEach(e.outEdges(a.v),(function(n){var a=e.edge(n);var i=n.w;var o=e.node(i);o["in"]-=a;v(t,r,o)}));e.removeNode(a.v);return o}function f(e,t){var r=new a;var o=0;var s=0;n.forEach(e.nodes(),(function(e){r.setNode(e,{v:e,in:0,out:0})}));n.forEach(e.edges(),(function(e){var n=r.edge(e.v,e.w)||0;var a=t(e);var i=n+a;r.setEdge(e.v,e.w,i);s=Math.max(s,r.node(e.v).out+=a);o=Math.max(o,r.node(e.w)["in"]+=a)}));var u=n.range(s+o+3).map((function(){return new i}));var l=o+1;n.forEach(r.nodes(),(function(e){v(u,l,r.node(e))}));return{graph:r,buckets:u,zeroIdx:l}}function v(e,t,r){if(!r.out){e[0].enqueue(r)}else if(!r["in"]){e[e.length-1].enqueue(r)}else{e[r.out-r["in"]+t].enqueue(r)}}},e=>{e.exports=t;function t(){var e={};e._next=e._prev=e;this._sentinel=e}t.prototype.dequeue=function(){var e=this._sentinel;var t=e._prev;if(t!==e){r(t);return t}};t.prototype.enqueue=function(e){var t=this._sentinel;if(e._prev&&e._next){r(e)}e._next=t._next;t._next._prev=e;t._next=e;e._prev=t};t.prototype.toString=function(){var e=[];var t=this._sentinel;var r=t._prev;while(r!==t){e.push(JSON.stringify(r,n));r=r._prev}return"["+e.join(", ")+"]"};function r(e){e._prev._next=e._next;e._next._prev=e._prev;delete e._next;delete e._prev}function n(e,t){if(e!=="_next"&&e!=="_prev"){return t}}},(e,t,r)=>{"use strict";var n=r(380);var a=r(426);e.exports={run:i,undo:s};function i(e){e.graph().dummyChains=[];n.forEach(e.edges(),(function(t){o(e,t)}))}function o(e,t){var r=t.v;var n=e.node(r).rank;var i=t.w;var o=e.node(i).rank;var s=t.name;var u=e.edge(t);var l=u.labelRank;if(o===n+1)return;e.removeEdge(t);var f,v,c;for(c=0,++n;n<o;++c,++n){u.points=[];v={width:0,height:0,edgeLabel:u,edgeObj:t,rank:n};f=a.addDummyNode(e,"edge",v,"_d");if(n===l){v.width=u.width;v.height=u.height;v.dummy="edge-label";v.labelpos=u.labelpos}e.setEdge(r,f,{weight:u.weight},s);if(c===0){e.graph().dummyChains.push(f)}r=f}e.setEdge(r,i,{weight:u.weight},s)}function s(e){n.forEach(e.graph().dummyChains,(function(t){var r=e.node(t);var n=r.edgeLabel;var a;e.setEdge(r.edgeObj,n);while(r.dummy){a=e.successors(t)[0];e.removeNode(t);n.points.push({x:r.x,y:r.y});if(r.dummy==="edge-label"){n.x=r.x;n.y=r.y;n.width=r.width;n.height=r.height}t=a;r=e.node(t)}}))}},(e,t,r)=>{"use strict";var n=r(380);var a=r(221).Graph;e.exports={addDummyNode:i,simplify:o,asNonCompoundGraph:s,successorWeights:u,predecessorWeights:l,intersectRect:f,buildLayerMatrix:v,normalizeRanks:c,removeEmptyRanks:d,addBorderNode:h,maxRank:p,partition:g,time:y,notime:m};function i(e,t,r,a){var i;do{i=n.uniqueId(a)}while(e.hasNode(i));r.dummy=t;e.setNode(i,r);return i}function o(e){var t=(new a).setGraph(e.graph());n.forEach(e.nodes(),(function(r){t.setNode(r,e.node(r))}));n.forEach(e.edges(),(function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1};var a=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+a.weight,minlen:Math.max(n.minlen,a.minlen)})}));return t}function s(e){var t=new a({multigraph:e.isMultigraph()}).setGraph(e.graph());n.forEach(e.nodes(),(function(r){if(!e.children(r).length){t.setNode(r,e.node(r))}}));n.forEach(e.edges(),(function(r){t.setEdge(r,e.edge(r))}));return t}function u(e){var t=n.map(e.nodes(),(function(t){var r={};n.forEach(e.outEdges(t),(function(t){r[t.w]=(r[t.w]||0)+e.edge(t).weight}));return r}));return n.zipObject(e.nodes(),t)}function l(e){var t=n.map(e.nodes(),(function(t){var r={};n.forEach(e.inEdges(t),(function(t){r[t.v]=(r[t.v]||0)+e.edge(t).weight}));return r}));return n.zipObject(e.nodes(),t)}function f(e,t){var r=e.x;var n=e.y;var a=t.x-r;var i=t.y-n;var o=e.width/2;var s=e.height/2;if(!a&&!i){throw new Error("Not possible to find intersection inside of the rectangle")}var u,l;if(Math.abs(i)*o>Math.abs(a)*s){if(i<0){s=-s}u=s*a/i;l=s}else{if(a<0){o=-o}u=o;l=o*i/a}return{x:r+u,y:n+l}}function v(e){var t=n.map(n.range(p(e)+1),(function(){return[]}));n.forEach(e.nodes(),(function(r){var a=e.node(r);var i=a.rank;if(!n.isUndefined(i)){t[i][a.order]=r}}));return t}function c(e){var t=n.min(n.map(e.nodes(),(function(t){return e.node(t).rank})));n.forEach(e.nodes(),(function(r){var a=e.node(r);if(n.has(a,"rank")){a.rank-=t}}))}function d(e){var t=n.min(n.map(e.nodes(),(function(t){return e.node(t).rank})));var r=[];n.forEach(e.nodes(),(function(n){var a=e.node(n).rank-t;if(!r[a]){r[a]=[]}r[a].push(n)}));var a=0;var i=e.graph().nodeRankFactor;n.forEach(r,(function(t,r){if(n.isUndefined(t)&&r%i!==0){--a}else if(a){n.forEach(t,(function(t){e.node(t).rank+=a}))}}))}function h(e,t,r,n){var a={width:0,height:0};if(arguments.length>=4){a.rank=r;a.order=n}return i(e,"border",a,t)}function p(e){return n.max(n.map(e.nodes(),(function(t){var r=e.node(t).rank;if(!n.isUndefined(r)){return r}})))}function g(e,t){var r={lhs:[],rhs:[]};n.forEach(e,(function(e){if(t(e)){r.lhs.push(e)}else{r.rhs.push(e)}}));return r}function y(e,t){var r=n.now();try{return t()}finally{console.log(e+" time: "+(n.now()-r)+"ms")}}function m(e,t){return t()}},(e,t,r)=>{"use strict";var n=r(428);var a=n.longestPath;var i=r(429);var o=r(430);e.exports=s;function s(e){switch(e.graph().ranker){case"network-simplex":f(e);break;case"tight-tree":l(e);break;case"longest-path":u(e);break;default:f(e)}}var u=a;function l(e){a(e);i(e)}function f(e){o(e)}},(e,t,r)=>{"use strict";var n=r(380);e.exports={longestPath:a,slack:i};function a(e){var t={};function r(a){var i=e.node(a);if(n.has(t,a)){return i.rank}t[a]=true;var o=n.min(n.map(e.outEdges(a),(function(t){return r(t.w)-e.edge(t).minlen})));if(o===Number.POSITIVE_INFINITY||o===undefined||o===null){o=0}return i.rank=o}n.forEach(e.sources(),r)}function i(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}},(e,t,r)=>{"use strict";var n=r(380);var a=r(221).Graph;var i=r(428).slack;e.exports=o;function o(e){var t=new a({directed:false});var r=e.nodes()[0];var n=e.nodeCount();t.setNode(r,{});var o,f;while(s(t,e)<n){o=u(t,e);f=t.hasNode(o.v)?i(e,o):-i(e,o);l(t,e,f)}return t}function s(e,t){function r(a){n.forEach(t.nodeEdges(a),(function(n){var o=n.v,s=a===o?n.w:o;if(!e.hasNode(s)&&!i(t,n)){e.setNode(s,{});e.setEdge(a,s,{});r(s)}}))}n.forEach(e.nodes(),r);return e.nodeCount()}function u(e,t){return n.minBy(t.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w)){return i(t,r)}}))}function l(e,t,r){n.forEach(e.nodes(),(function(e){t.node(e).rank+=r}))}},(e,t,r)=>{"use strict";var n=r(380);var a=r(429);var i=r(428).slack;var o=r(428).longestPath;var s=r(221).alg.preorder;var u=r(221).alg.postorder;var l=r(426).simplify;e.exports=f;f.initLowLimValues=h;f.initCutValues=v;f.calcCutValue=d;f.leaveEdge=g;f.enterEdge=y;f.exchangeEdges=m;function f(e){e=l(e);o(e);var t=a(e);h(t);v(t,e);var r,n;while(r=g(t)){n=y(t,e,r);m(t,e,r,n)}}function v(e,t){var r=u(e,e.nodes());r=r.slice(0,r.length-1);n.forEach(r,(function(r){c(e,t,r)}))}function c(e,t,r){var n=e.node(r);var a=n.parent;e.edge(r,a).cutvalue=d(e,t,r)}function d(e,t,r){var a=e.node(r);var i=a.parent;var o=true;var s=t.edge(r,i);var u=0;if(!s){o=false;s=t.edge(i,r)}u=s.weight;n.forEach(t.nodeEdges(r),(function(n){var a=n.v===r,s=a?n.w:n.v;if(s!==i){var l=a===o,f=t.edge(n).weight;u+=l?f:-f;if(x(e,r,s)){var v=e.edge(r,s).cutvalue;u+=l?-v:v}}}));return u}function h(e,t){if(arguments.length<2){t=e.nodes()[0]}p(e,{},1,t)}function p(e,t,r,a,i){var o=r;var s=e.node(a);t[a]=true;n.forEach(e.neighbors(a),(function(i){if(!n.has(t,i)){r=p(e,t,r,i,a)}}));s.low=o;s.lim=r++;if(i){s.parent=i}else{delete s.parent}return r}function g(e){return n.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function y(e,t,r){var a=r.v;var o=r.w;if(!t.hasEdge(a,o)){a=r.w;o=r.v}var s=e.node(a);var u=e.node(o);var l=s;var f=false;if(s.lim>u.lim){l=u;f=true}var v=n.filter(t.edges(),(function(t){return f===w(e,e.node(t.v),l)&&f!==w(e,e.node(t.w),l)}));return n.minBy(v,(function(e){return i(t,e)}))}function m(e,t,r,n){var a=r.v;var i=r.w;e.removeEdge(a,i);e.setEdge(n.v,n.w,{});h(e);v(e,t);b(e,t)}function b(e,t){var r=n.find(e.nodes(),(function(e){return!t.node(e).parent}));var a=s(e,r);a=a.slice(1);n.forEach(a,(function(r){var n=e.node(r).parent,a=t.edge(r,n),i=false;if(!a){a=t.edge(n,r);i=true}t.node(r).rank=t.node(n).rank+(i?a.minlen:-a.minlen)}))}function x(e,t,r){return e.hasEdge(t,r)}function w(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}},(e,t,r)=>{var n=r(380);e.exports=a;function a(e){var t=o(e);n.forEach(e.graph().dummyChains,(function(r){var n=e.node(r);var a=n.edgeObj;var o=i(e,t,a.v,a.w);var s=o.path;var u=o.lca;var l=0;var f=s[l];var v=true;while(r!==a.w){n=e.node(r);if(v){while((f=s[l])!==u&&e.node(f).maxRank<n.rank){l++}if(f===u){v=false}}if(!v){while(l<s.length-1&&e.node(f=s[l+1]).minRank<=n.rank){l++}f=s[l]}e.setParent(r,f);r=e.successors(r)[0]}}))}function i(e,t,r,n){var a=[];var i=[];var o=Math.min(t[r].low,t[n].low);var s=Math.max(t[r].lim,t[n].lim);var u;var l;u=r;do{u=e.parent(u);a.push(u)}while(u&&(t[u].low>o||s>t[u].lim));l=u;u=n;while((u=e.parent(u))!==l){i.push(u)}return{path:a.concat(i.reverse()),lca:l}}function o(e){var t={};var r=0;function a(i){var o=r;n.forEach(e.children(i),a);t[i]={low:o,lim:r++}}n.forEach(e.children(),a);return t}},(e,t,r)=>{var n=r(380);var a=r(426);e.exports={run:i,cleanup:l};function i(e){var t=a.addDummyNode(e,"root",{},"_root");var r=s(e);var i=n.max(n.values(r))-1;var l=2*i+1;e.graph().nestingRoot=t;n.forEach(e.edges(),(function(t){e.edge(t).minlen*=l}));var f=u(e)+1;n.forEach(e.children(),(function(n){o(e,t,l,f,i,r,n)}));e.graph().nodeRankFactor=l}function o(e,t,r,i,s,u,l){var f=e.children(l);if(!f.length){if(l!==t){e.setEdge(t,l,{weight:0,minlen:r})}return}var v=a.addBorderNode(e,"_bt");var c=a.addBorderNode(e,"_bb");var d=e.node(l);e.setParent(v,l);d.borderTop=v;e.setParent(c,l);d.borderBottom=c;n.forEach(f,(function(n){o(e,t,r,i,s,u,n);var a=e.node(n);var f=a.borderTop?a.borderTop:n;var d=a.borderBottom?a.borderBottom:n;var h=a.borderTop?i:2*i;var p=f!==d?1:s-u[l]+1;e.setEdge(v,f,{weight:h,minlen:p,nestingEdge:true});e.setEdge(d,c,{weight:h,minlen:p,nestingEdge:true})}));if(!e.parent(l)){e.setEdge(t,v,{weight:0,minlen:s+u[l]})}}function s(e){var t={};function r(a,i){var o=e.children(a);if(o&&o.length){n.forEach(o,(function(e){r(e,i+1)}))}t[a]=i}n.forEach(e.children(),(function(e){r(e,1)}));return t}function u(e){return n.reduce(e.edges(),(function(t,r){return t+e.edge(r).weight}),0)}function l(e){var t=e.graph();e.removeNode(t.nestingRoot);delete t.nestingRoot;n.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.nestingEdge){e.removeEdge(t)}}))}},(e,t,r)=>{var n=r(380);var a=r(426);e.exports=i;function i(e){function t(r){var a=e.children(r);var i=e.node(r);if(a.length){n.forEach(a,t)}if(n.has(i,"minRank")){i.borderLeft=[];i.borderRight=[];for(var s=i.minRank,u=i.maxRank+1;s<u;++s){o(e,"borderLeft","_bl",r,i,s);o(e,"borderRight","_br",r,i,s)}}}n.forEach(e.children(),t)}function o(e,t,r,n,i,o){var s={width:0,height:0,rank:o,borderType:t};var u=i[t][o-1];var l=a.addDummyNode(e,"border",s,r);i[t][o]=l;e.setParent(l,n);if(u){e.setEdge(u,l,{weight:1})}}},(e,t,r)=>{"use strict";var n=r(380);e.exports={adjust:a,undo:i};function a(e){var t=e.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl"){o(e)}}function i(e){var t=e.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl"){u(e)}if(t==="lr"||t==="rl"){f(e);o(e)}}function o(e){n.forEach(e.nodes(),(function(t){s(e.node(t))}));n.forEach(e.edges(),(function(t){s(e.edge(t))}))}function s(e){var t=e.width;e.width=e.height;e.height=t}function u(e){n.forEach(e.nodes(),(function(t){l(e.node(t))}));n.forEach(e.edges(),(function(t){var r=e.edge(t);n.forEach(r.points,l);if(n.has(r,"y")){l(r)}}))}function l(e){e.y=-e.y}function f(e){n.forEach(e.nodes(),(function(t){v(e.node(t))}));n.forEach(e.edges(),(function(t){var r=e.edge(t);n.forEach(r.points,v);if(n.has(r,"x")){v(r)}}))}function v(e){var t=e.x;e.x=e.y;e.y=t}},(e,t,r)=>{"use strict";var n=r(380);var a=r(436);var i=r(437);var o=r(438);var s=r(442);var u=r(443);var l=r(221).Graph;var f=r(426);e.exports=v;function v(e){var t=f.maxRank(e),r=c(e,n.range(1,t+1),"inEdges"),o=c(e,n.range(t-1,-1,-1),"outEdges");var s=a(e);h(e,s);var u=Number.POSITIVE_INFINITY,l;for(var v=0,p=0;p<4;++v,++p){d(v%2?r:o,v%4>=2);s=f.buildLayerMatrix(e);var g=i(e,s);if(g<u){p=0;l=n.cloneDeep(s);u=g}}h(e,l)}function c(e,t,r){return n.map(t,(function(t){return s(e,t,r)}))}function d(e,t){var r=new l;n.forEach(e,(function(e){var a=e.graph().root;var i=o(e,a,r,t);n.forEach(i.vs,(function(t,r){e.node(t).order=r}));u(e,r,i.vs)}))}function h(e,t){n.forEach(t,(function(t){n.forEach(t,(function(t,r){e.node(t).order=r}))}))}},(e,t,r)=>{"use strict";var n=r(380);e.exports=a;function a(e){var t={};var r=n.filter(e.nodes(),(function(t){return!e.children(t).length}));var a=n.max(n.map(r,(function(t){return e.node(t).rank})));var i=n.map(n.range(a+1),(function(){return[]}));function o(r){if(n.has(t,r))return;t[r]=true;var a=e.node(r);i[a.rank].push(r);n.forEach(e.successors(r),o)}var s=n.sortBy(r,(function(t){return e.node(t).rank}));n.forEach(s,o);return i}},(e,t,r)=>{"use strict";var n=r(380);e.exports=a;function a(e,t){var r=0;for(var n=1;n<t.length;++n){r+=i(e,t[n-1],t[n])}return r}function i(e,t,r){var a=n.zipObject(r,n.map(r,(function(e,t){return t})));var i=n.flatten(n.map(t,(function(t){return n.sortBy(n.map(e.outEdges(t),(function(t){return{pos:a[t.w],weight:e.edge(t).weight}})),"pos")})),true);var o=1;while(o<r.length)o<<=1;var s=2*o-1;o-=1;var u=n.map(new Array(s),(function(){return 0}));var l=0;n.forEach(i.forEach((function(e){var t=e.pos+o;u[t]+=e.weight;var r=0;while(t>0){if(t%2){r+=u[t+1]}t=t-1>>1;u[t]+=e.weight}l+=e.weight*r})));return l}},(e,t,r)=>{var n=r(380);var a=r(439);var i=r(440);var o=r(441);e.exports=s;function s(e,t,r,f){var v=e.children(t);var c=e.node(t);var d=c?c.borderLeft:undefined;var h=c?c.borderRight:undefined;var p={};if(d){v=n.filter(v,(function(e){return e!==d&&e!==h}))}var g=a(e,v);n.forEach(g,(function(t){if(e.children(t.v).length){var a=s(e,t.v,r,f);p[t.v]=a;if(n.has(a,"barycenter")){l(t,a)}}}));var y=i(g,r);u(y,p);var m=o(y,f);if(d){m.vs=n.flatten([d,m.vs,h],true);if(e.predecessors(d).length){var b=e.node(e.predecessors(d)[0]),x=e.node(e.predecessors(h)[0]);if(!n.has(m,"barycenter")){m.barycenter=0;m.weight=0}m.barycenter=(m.barycenter*m.weight+b.order+x.order)/(m.weight+2);m.weight+=2}}return m}function u(e,t){n.forEach(e,(function(e){e.vs=n.flatten(e.vs.map((function(e){if(t[e]){return t[e].vs}return e})),true)}))}function l(e,t){if(!n.isUndefined(e.barycenter)){e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight);e.weight+=t.weight}else{e.barycenter=t.barycenter;e.weight=t.weight}}},(e,t,r)=>{var n=r(380);e.exports=a;function a(e,t){return n.map(t,(function(t){var r=e.inEdges(t);if(!r.length){return{v:t}}else{var a=n.reduce(r,(function(t,r){var n=e.edge(r),a=e.node(r.v);return{sum:t.sum+n.weight*a.order,weight:t.weight+n.weight}}),{sum:0,weight:0});return{v:t,barycenter:a.sum/a.weight,weight:a.weight}}}))}},(e,t,r)=>{"use strict";var n=r(380);e.exports=a;function a(e,t){var r={};n.forEach(e,(function(e,t){var a=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};if(!n.isUndefined(e.barycenter)){a.barycenter=e.barycenter;a.weight=e.weight}}));n.forEach(t.edges(),(function(e){var t=r[e.v];var a=r[e.w];if(!n.isUndefined(t)&&!n.isUndefined(a)){a.indegree++;t.out.push(r[e.w])}}));var a=n.filter(r,(function(e){return!e.indegree}));return i(a)}function i(e){var t=[];function r(e){return function(t){if(t.merged){return}if(n.isUndefined(t.barycenter)||n.isUndefined(e.barycenter)||t.barycenter>=e.barycenter){o(e,t)}}}function a(t){return function(r){r["in"].push(t);if(--r.indegree===0){e.push(r)}}}while(e.length){var i=e.pop();t.push(i);n.forEach(i["in"].reverse(),r(i));n.forEach(i.out,a(i))}return n.map(n.filter(t,(function(e){return!e.merged})),(function(e){return n.pick(e,["vs","i","barycenter","weight"])}))}function o(e,t){var r=0;var n=0;if(e.weight){r+=e.barycenter*e.weight;n+=e.weight}if(t.weight){r+=t.barycenter*t.weight;n+=t.weight}e.vs=t.vs.concat(e.vs);e.barycenter=r/n;e.weight=n;e.i=Math.min(t.i,e.i);t.merged=true}},(e,t,r)=>{var n=r(380);var a=r(426);e.exports=i;function i(e,t){var r=a.partition(e,(function(e){return n.has(e,"barycenter")}));var i=r.lhs,u=n.sortBy(r.rhs,(function(e){return-e.i})),l=[],f=0,v=0,c=0;i.sort(s(!!t));c=o(l,u,c);n.forEach(i,(function(e){c+=e.vs.length;l.push(e.vs);f+=e.barycenter*e.weight;v+=e.weight;c=o(l,u,c)}));var d={vs:n.flatten(l,true)};if(v){d.barycenter=f/v;d.weight=v}return d}function o(e,t,r){var a;while(t.length&&(a=n.last(t)).i<=r){t.pop();e.push(a.vs);r++}return r}function s(e){return function(t,r){if(t.barycenter<r.barycenter){return-1}else if(t.barycenter>r.barycenter){return 1}return!e?t.i-r.i:r.i-t.i}}},(e,t,r)=>{var n=r(380);var a=r(221).Graph;e.exports=i;function i(e,t,r){var i=o(e),s=new a({compound:true}).setGraph({root:i}).setDefaultNodeLabel((function(t){return e.node(t)}));n.forEach(e.nodes(),(function(a){var o=e.node(a),u=e.parent(a);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){s.setNode(a);s.setParent(a,u||i);n.forEach(e[r](a),(function(t){var r=t.v===a?t.w:t.v,i=s.edge(r,a),o=!n.isUndefined(i)?i.weight:0;s.setEdge(r,a,{weight:e.edge(t).weight+o})}));if(n.has(o,"minRank")){s.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}}));return s}function o(e){var t;while(e.hasNode(t=n.uniqueId("_root")));return t}},(e,t,r)=>{var n=r(380);e.exports=a;function a(e,t,r){var a={},i;n.forEach(r,(function(r){var n=e.parent(r),o,s;while(n){o=e.parent(n);if(o){s=a[o];a[o]=n}else{s=i;i=n}if(s&&s!==n){t.setEdge(s,n);return}n=o}}))}},(e,t,r)=>{"use strict";var n=r(380);var a=r(426);var i=r(445).positionX;e.exports=o;function o(e){e=a.asNonCompoundGraph(e);s(e);n.forEach(i(e),(function(t,r){e.node(r).x=t}))}function s(e){var t=a.buildLayerMatrix(e);var r=e.graph().ranksep;var i=0;n.forEach(t,(function(t){var a=n.max(n.map(t,(function(t){return e.node(t).height})));n.forEach(t,(function(t){e.node(t).y=i+a/2}));i+=a+r}))}},(e,t,r)=>{"use strict";var n=r(380);var a=r(221).Graph;var i=r(426);e.exports={positionX:y,findType1Conflicts:o,findType2Conflicts:s,addConflict:l,hasConflict:f,verticalAlignment:v,horizontalCompaction:c,alignCoordinates:p,findSmallestWidthAlignment:h,balance:g};function o(e,t){var r={};function a(t,a){var i=0,o=0,s=t.length,f=n.last(a);n.forEach(a,(function(t,v){var c=u(e,t),d=c?e.node(c).order:s;if(c||t===f){n.forEach(a.slice(o,v+1),(function(t){n.forEach(e.predecessors(t),(function(n){var a=e.node(n),o=a.order;if((o<i||d<o)&&!(a.dummy&&e.node(t).dummy)){l(r,n,t)}}))}));o=v+1;i=d}}));return a}n.reduce(t,a);return r}function s(e,t){var r={};function a(t,a,i,o,s){var u;n.forEach(n.range(a,i),(function(a){u=t[a];if(e.node(u).dummy){n.forEach(e.predecessors(u),(function(t){var n=e.node(t);if(n.dummy&&(n.order<o||n.order>s)){l(r,t,u)}}))}}))}function i(t,r){var i=-1,o,s=0;n.forEach(r,(function(n,u){if(e.node(n).dummy==="border"){var l=e.predecessors(n);if(l.length){o=e.node(l[0]).order;a(r,s,u,i,o);s=u;i=o}}a(r,s,r.length,o,t.length)}));return r}n.reduce(t,i);return r}function u(e,t){if(e.node(t).dummy){return n.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}}function l(e,t,r){if(t>r){var n=t;t=r;r=n}var a=e[t];if(!a){e[t]=a={}}a[r]=true}function f(e,t,r){if(t>r){var a=t;t=r;r=a}return n.has(e[t],r)}function v(e,t,r,a){var i={},o={},s={};n.forEach(t,(function(e){n.forEach(e,(function(e,t){i[e]=e;o[e]=e;s[e]=t}))}));n.forEach(t,(function(e){var t=-1;n.forEach(e,(function(e){var u=a(e);if(u.length){u=n.sortBy(u,(function(e){return s[e]}));var l=(u.length-1)/2;for(var v=Math.floor(l),c=Math.ceil(l);v<=c;++v){var d=u[v];if(o[e]===e&&t<s[d]&&!f(r,e,d)){o[d]=e;o[e]=i[e]=i[d];t=s[d]}}}}))}));return{root:i,align:o}}function c(e,t,r,a,i){var o={},s=d(e,t,r,i),u=i?"borderLeft":"borderRight";function l(e,t){var r=s.nodes();var n=r.pop();var a={};while(n){if(a[n]){e(n)}else{a[n]=true;r.push(n);r=r.concat(t(n))}n=r.pop()}}function f(e){o[e]=s.inEdges(e).reduce((function(e,t){return Math.max(e,o[t.v]+s.edge(t))}),0)}function v(t){var r=s.outEdges(t).reduce((function(e,t){return Math.min(e,o[t.w]-s.edge(t))}),Number.POSITIVE_INFINITY);var n=e.node(t);if(r!==Number.POSITIVE_INFINITY&&n.borderType!==u){o[t]=Math.max(o[t],r)}}l(f,s.predecessors.bind(s));l(v,s.successors.bind(s));n.forEach(a,(function(e){o[e]=o[r[e]]}));return o}function d(e,t,r,i){var o=new a,s=e.graph(),u=m(s.nodesep,s.edgesep,i);n.forEach(t,(function(t){var a;n.forEach(t,(function(t){var n=r[t];o.setNode(n);if(a){var i=r[a],s=o.edge(i,n);o.setEdge(i,n,Math.max(u(e,t,a),s||0))}a=t}))}));return o}function h(e,t){return n.minBy(n.values(t),(function(t){var r=Number.NEGATIVE_INFINITY;var a=Number.POSITIVE_INFINITY;n.forIn(t,(function(t,n){var i=b(e,n)/2;r=Math.max(t+i,r);a=Math.min(t-i,a)}));return r-a}))}function p(e,t){var r=n.values(t),a=n.min(r),i=n.max(r);n.forEach(["u","d"],(function(r){n.forEach(["l","r"],(function(o){var s=r+o,u=e[s],l;if(u===t)return;var f=n.values(u);l=o==="l"?a-n.min(f):i-n.max(f);if(l){e[s]=n.mapValues(u,(function(e){return e+l}))}}))}))}function g(e,t){return n.mapValues(e.ul,(function(r,a){if(t){return e[t.toLowerCase()][a]}else{var i=n.sortBy(n.map(e,a));return(i[1]+i[2])/2}}))}function y(e){var t=i.buildLayerMatrix(e);var r=n.merge(o(e,t),s(e,t));var a={};var u;n.forEach(["u","d"],(function(i){u=i==="u"?t:n.values(t).reverse();n.forEach(["l","r"],(function(t){if(t==="r"){u=n.map(u,(function(e){return n.values(e).reverse()}))}var o=(i==="u"?e.predecessors:e.successors).bind(e);var s=v(e,u,r,o);var l=c(e,u,s.root,s.align,t==="r");if(t==="r"){l=n.mapValues(l,(function(e){return-e}))}a[i+t]=l}))}));var l=h(e,a);p(a,l);return g(a,e.graph().align)}function m(e,t,r){return function(a,i,o){var s=a.node(i);var u=a.node(o);var l=0;var f;l+=s.width/2;if(n.has(s,"labelpos")){switch(s.labelpos.toLowerCase()){case"l":f=-s.width/2;break;case"r":f=s.width/2;break}}if(f){l+=r?f:-f}f=0;l+=(s.dummy?t:e)/2;l+=(u.dummy?t:e)/2;l+=u.width/2;if(n.has(u,"labelpos")){switch(u.labelpos.toLowerCase()){case"l":f=u.width/2;break;case"r":f=-u.width/2;break}}if(f){l+=r?f:-f}f=0;return l}}function b(e,t){return e.node(t).width}},(e,t,r)=>{var n=r(380);var a=r(426);var i=r(221).Graph;e.exports={debugOrdering:o};function o(e){var t=a.buildLayerMatrix(e);var r=new i({compound:true,multigraph:true}).setGraph({});n.forEach(e.nodes(),(function(t){r.setNode(t,{label:t});r.setParent(t,"layer"+e.node(t).rank)}));n.forEach(e.edges(),(function(e){r.setEdge(e.v,e.w,{},e.name)}));n.forEach(t,(function(e,t){var a="layer"+t;r.setNode(a,{rank:"same"});n.reduce(e,(function(e,t){r.setEdge(e,t,{style:"invis"});return t}))}));return r}},e=>{e.exports="0.8.5"},(e,t,r)=>{"use strict";var n;(function(){var a=function e(t){if(!t){return}var r=function e(t){var r=this;var n=r.container();var a=document.createElement("canvas");n.appendChild(a);var i={zIndex:1,pixelRatio:"auto"};var o=Object.assign({},i,t);if(o.pixelRatio==="auto"){o.pixelRatio=window.devicePixelRatio||1}function s(){var e=n.offsetWidth;var t=n.offsetHeight;var i=e*o.pixelRatio;var s=t*o.pixelRatio;a.width=i;a.height=s;a.style.width=e+"px";a.style.height=t+"px";r.trigger("cyCanvas.resize")}r.on("resize",(function(){s()}));a.setAttribute("style","position:absolute; top:0; left:0; z-index:"+o.zIndex+";");s();return{getCanvas:function e(){return a},clear:function e(t){var n=r.width();var a=r.height();t.save();t.setTransform(1,0,0,1,0,0);t.clearRect(0,0,n*o.pixelRatio,a*o.pixelRatio);t.restore()},resetTransform:function e(t){t.setTransform(1,0,0,1,0,0)},setTransform:function e(t){var n=r.pan();var a=r.zoom();t.setTransform(1,0,0,1,0,0);t.translate(n.x*o.pixelRatio,n.y*o.pixelRatio);t.scale(a*o.pixelRatio,a*o.pixelRatio)}}};t("core","cyCanvas",r)};if(true&&e.exports){e.exports=function(e){a(e)}}if(true){!(n=function(){return a}.call(t,r,t,e),n!==undefined&&(e.exports=n))}if(typeof cytoscape!=="undefined"){a(cytoscape)}})()}]);var t={};function r(n){var a=t[n];if(a!==undefined){return a.exports}var i=t[n]={id:n,loaded:false,exports:{}};e[n].call(i.exports,i,i.exports,r);i.loaded=true;return i.exports}(()=>{r.g=function(){if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window==="object")return window}}()})();(()=>{r.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();(()=>{r.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();var n={}; /** * --------------------------------------------------------------------- * * GLPI - Gestionnaire Libre de Parc Informatique * * http://glpi-project.org * * @copyright 2015-2024 Teclib' and contributors. * @copyright 2003-2014 by the INDEPNET Development Team. * @licence https://www.gnu.org/licenses/gpl-3.0.html * * --------------------------------------------------------------------- * * LICENSE * * This file is part of GLPI. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * * --------------------------------------------------------------------- */window.cytoscape=r(136);r(204);r(206);r(207);r(219);r(448)})();